]> git.saurik.com Git - bison.git/blame - ChangeLog
* doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
[bison.git] / ChangeLog
CommitLineData
389c8cfd
PE
12008-01-30 Paul Eggert <eggert@cs.ucla.edu>
2
3 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
4
5d1cfef4
PE
52008-01-09 Paul Eggert <eggert@cs.ucla.edu>
6
7 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
8 Problem reported by Claudio Saavedra in
9 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
10
e2dcf996
WP
112008-01-05 Wojciech Polak <polak@gnu.org>
12
13 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
14 document's title with the input grammar file name.
15
da730230
JD
162007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
17
18 Automate regression testing of the XML/XSLT implementation. Discussed
19 starting at
20 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
21 * configure.ac (XSLTPROC): New substitution.
22 * Makefile.am (maintainer-xml-check): New phony target invoking...
23 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
24 invoking make maintainer-check with BISON_TEST_XML=1.
25 * tests/atlocal.in (XSLTPROC): New.
26 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
27 not to report reachable memory when Bison is expected to have a
28 non-zero exit status and (2) to compare XML/XSLT output with --graph
29 and --report=all output for every working grammar when
30 BISON_TEST_XML=1.
31 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
32 (AT_BISON_CHECK_XML): New.
33 (AT_QUELL_VALGRIND): New.
34 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
35 (AT_CHECK): ... don't redefine this since this was the old way to
36 quell Valgrind.
37 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
38 AT_BISON_CHECK invocations.
39 * tests/c++.at: Likewise.
40 * tests/calc.at: Likewise.
41 * tests/conflicts.at: Likewise.
42 * tests/cxx-type.at: Likewise.
43 * tests/existing.at: Likewise.
44 * tests/glr-regression.at: Likewise.
45 * tests/headers.at: Likewise.
46 * tests/input.at: Likewise.
47 * tests/java.at: Likewise.
48 * tests/output.at: Likewise.
49 * tests/push.at: Likewise.
50 * tests/reduce.at: Likewise.
51 * tests/regression.at: Likewise.
52 * tests/sets.at: Likewise.
53 * tests/skeletons.at: Likewise.
54 * tests/synclines.at: Likewise.
55 * tests/torture.at: Likewise.
56 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
57 tends to hang xsltproc.
58 (Big horizontal): Likewise.
59
408476bc
JD
602007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
61
62 In XML output, remove redundant class attribute on symbol element.
63 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
64 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
65 look up a symbol to determine whether it's a nonterminal or terminal.
66 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
67 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
68
69 Add prec/assoc information to XML output.
70 * src/gram.c (grammar_rules_print_xml): For each rule that has a
71 %prec, add a percent_prec attribute.
72 * src/print-xml.c (print_grammar): For each terminal that has a
73 precedence or associativity, add a prec or assoc attribute.
74 (xml_indent): New.
75 (xml_puts): Use xml_indent.
76 (xml_printf): Use xml_indent.
77 * src/print-xml.h (xml_indent): Prototype.
78
79 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
80 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
81
d4a26c48
JD
822007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
83
84 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
85 (bison:ruleByNumber): ... this for clarity.
86 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
87 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
88 (xsl:template match="reduction"): Update.
89 (xsl:template match="item"): Update.
90 (xsl:template match="reduction"): Update.
91
92 In the XML output, don't print the list of rules where symbols appear.
93 Compute it in XSLT instead. Discussed at
94 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
95 * data/xslt/bison.xsl (bison:ruleByLhs): New.
96 (bison:ruleByRhs): New.
97 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
98 bison:ruleByRhs.
99 (xsl:template match="terminal/rule"): Remove.
100 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
101 bison:ruleByRhs.
102 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
103 Remove.
104 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
105 bison:ruleByRhs and mode="number-link" for rule template.
106 (xsl:template match="terminal/rule"): Remove.
107 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
108 bison:ruleByRhs and mode="number-link" for rule template.
109 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
110 Rewrite as...
111 (xsl:template match="rule" mode="number-link"): ... this.
112 * src/print-xml.c (print_grammar): Don't print the list of rules.
113
ef1b4273
JD
1142007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
115
116 Don't let --report affect XML output; always print all information.
117 Discussed at
118 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
119 * src/conflicts.c (log_resolution): Implement.
120 * src/print-xml.c (print_core): Implement.
121 (print_state): Implement.
122 (print_xml): Implement.
123
124 * NEWS (2.3a+): Fix quotes.
125 * src/parse-gram.y (prologue_declaration): For consistency with -v,
126 don't let %verbose clear the list specified by --report.
127
0f6cd9e3
AD
1282007-11-26 Akim Demaille <akim@epita.fr>
129
130 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
131
d80fb37a
JD
1322007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
133
134 In the XML output, list useless and unused symbols and rules with the
135 useful ones and add a "usefulness" attribute. Discussed starting at
136 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
137 * src/gram.c (grammar_rules_partial_print_xml): Remove.
138 (grammar_rules_print_xml): Print all rules instead of just those
139 useful in the grammar, and add a "usefulness" attribute.
140 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
141 * src/print-xml.c (print_rules_useless_in_parser): Remove.
142 (print_grammar): Print all nonterminals instead of just useful ones,
143 and add a "usefulness" attribute to nonterminals and terminals.
144 (print_xml): Don't print a separate "reductions" or
145 "rules-useless-in-parser" element.
146 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
147 (reduce_xml): Remove.
148 (reduce_token_unused_in_grammar): New.
149 (reduce_nonterminal_useless_in_grammar): New.
150 * src/reduce.h (reduce_xml): Remove prototype.
151 (reduce_token_unused_in_grammar): Add prototype.
152 (reduce_nonterminal_useless_in_grammar): Add prototype.
153 * data/xslt/xml2text.xsl: Update for XML changes.
154 * data/xslt/xml2xhtml.xsl: Update for XML changes.
155 * tests/reduce.at (Useless Terminals): Update output.
156 (Useless Rules): Update output.
157 (Reduced Automaton): Update output.
158
159 Say "Terminals unused in grammar" instead of "Unused terminals".
160 * NEWS (2.3a+): Update.
161 * doc/bison.texinfo (Understanding): Update example output.
162 * src/reduce.c (reduce_output): Implement.
163 * data/xslt/xml2text.xsl: Implement.
164 * data/xslt/xml2xhtml.xsl: Implement.
165
1bb2bd75
JD
1662007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
167
168 Accept --report-file=FILE to override the default `.output' filename.
169 * NEWS (2.3a+): Mention.
170 * doc/bison.texinfo (Bison Options): Add an entry.
171 * src/files.c (compute_output_file_names): Don't override
172 spec_verbose_file if already set.
173 * src/getargs.c (usage): Document --report-file.
174 (REPORT_FILE_OPTION): New anonymous enum member.
175 (long_options): Add entry for it.
176 (getargs): Add case for it setting spec_verbose_file.
177
178 * build-aux/cross-options.pl: Don't record a short option just because
179 there's an arg.
180 * doc/.cvsignore: Add yacc.1.
181
a005a9c4
AD
1822007-11-14 Akim Demaille <akim@epita.fr>
183
184 * doc/yacc.1.in: New.
185 * configure.ac, doc/Makefile.am: Adjust.
186 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
187 config.h symbol.
188 Use AC_SUBST for assignments too.
189 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
190
cff03fb2
JD
1912007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
192
193 * src/gram.c: Remove comments that duplicate comments in gram.h.
194
195 When reporting useless rules and nonterminals, say "useless in grammar"
196 instead of "useless", and say "useless in parser" instead of "never
197 reduced". Discussed starting at
198 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
199 * NEWS (2.3a+): Mention this change.
200 * data/xslt/xml2text.xsl: Update output text and expected input XML
201 element names to match changes below.
202 * data/xslt/xml2xhtml.xsl: Likewise.
203 (xsl:template match="bison-xml-report"): Add missing entry in Table of
204 Contents: "Rules useless in parser due to conflicts".
205 * doc/bison.texinfo (Decl Summary): Reword a little.
206 (Understanding): Update example output for changes below.
207 * src/gram.c: (rule_useful_p): Rename to...
208 (rule_useful_in_grammar_p): ... this.
209 (rule_useless_p): Rename to...
210 (rule_useless_in_grammar_p): ... this.
211 (rule_never_reduced_p): Rename to...
212 (rule_useless_in_parser_p): ... this.
213 (grammar_rules_print): Update for renames.
214 (grammar_rules_print_xml): Update for renames.
215 (grammar_rules_never_reduced_report): Rename to...
216 (grammar_rules_useless_report): ... this since it is used for either
217 kind of useless rule.
218 * src/gram.h: Reword comments and update function names in prototypes.
219 * src/main.c (main): Say "rule useless in parser due to conflicts".
220 * src/print-xml.c (print_rules_never_reduced): Rename to...
221 (print_rules_useless_in_parser): ... this, and rename output XML
222 element "rules-never-reduced" to "rules-useless-in-parser".
223 (print_xml): Update for rename.
224 * src/print.c (print_results): Say "Rules useless in parser due to
225 conflicts".
226 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
227 (nonterminals_reduce): Say "nonterminal useless in grammar".
228 (reduce_output): Say "Nonterminals useless in grammar".
229 Say "Rules useless in grammar".
230 (reduce_xml): Rename output XML element "useless" to
231 "useless-in-grammar".
232 (reduce_print): Don't report the count of grammatically useless rules
233 as "rules never reduced" just because %yacc is specified.
234 In the correct report of this count, say nonterminal(s) and rule(s)
235 "useless in grammar".
236 * tests/conflicts.at (S/R in initial): Update expected output.
237 (Defaulted Conflicted Reduction): Likewise.
238 (Unreachable States After Conflict Resolution): Likewise.
239 * tests/existing.at (GNU pic Grammar): Likewise.
240 * tests/reduce.at (Useless Nonterminals): Likewise.
241 (Useless Rules): Likewise.
242 (Reduced Automaton): Likewise.
243 (Underivable Rules): Likewise.
244 (Empty Language): Likewise.
245
66f0441d
JD
2462007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
247
248 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
249 here document and before the EOF so that BSD's implementation of Bourne
250 shell doesn't parse the delimiter as part of the here document.
251 * doc/.cvsignore: Add cross-options.texi.
252 * src/getargs.c (usage): Add a blank line after the warning categories.
253
d0ee4105
PB
2542007-11-08 Paolo Bonzini <bonzini@gnu.org>
255
256 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
257
e8b1fb9b
AD
2582007-11-05 Akim Demaille <akim@epita.fr>
259
260 Remove Id: from bison.1.
261 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
262 (perl -0777 -pi -e 's/\.PP\nId): New.
263 (.x.1): Use it to ignore the version control revision.
264
2f7a96b5
AD
2652007-11-05 Akim Demaille <demaille@gostai.com>
266
267 * build-aux/Makefile.am: Ship cross-options.pl.
268 * doc/Makefile.am: Always refer to cross-options.texi with
269 $(srcdir).
270 (MAINTAINERCLEANFILES): Add it.
271
f4101aa6
AD
2722007-11-04 Akim Demaille <demaille@gostai.com>
273
274 Generate the long/short option cross-table.
275 * build-aux/cross-options.pl: New.
276 * doc/Makefile.am (cross-options.texi): New.
277 * doc/bison.texinfo: Use it.
278
727a1401
AD
2792007-11-04 Akim Demaille <demaille@gostai.com>
280
281 Generate bison.1 using help2man.
282 * doc/common.x, doc/bison.x: New.
283 * doc/Makefile.am (bison.1, .x.1): New.
284 The code is taken from autoconf-2.61/man/Makefile.am.
285 * configure.ac: Look for help2man.
286
6aeb9c57
AD
2872007-11-04 Akim Demaille <demaille@gostai.com>
288
289 Complete --help.
290 * src/getargs.c (usage): Document -W, make it clear that -d,
291 -g and -x have optional arguments.
292
d7be4085
AD
2932007-11-04 Akim Demaille <demaille@gostai.com>
294
295 Find sha1sum when named gsha1sum.
296 * bootstrap (find_tool): New.
297 ($SHA1SUM): New.
298
d9df47b6
JD
2992007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
300
301 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
302 at
303 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
304 * NEWS (2.3a+): Mention.
305 * data/bison.m4 (b4_pure_if): Don't define it here.
306 * data/c.m4 (b4_identification): Depend on individual skeletons to
307 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
308 values of the %define variables api.pure or api.push_pull. Define
309 YYPURE, YYPUSH, and YYPULL accordingly.
310 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
311 glr.cc has already defined b4_pure_flag.
312 * data/push.c: Define b4_pure_if based on `%define api.pure'.
313 Remove YYPUSH and YYPULL since they're back in b4_identification again.
314 * data/yacc.c Define b4_pure_if based on `%define api.pure'.
315 * doc/bison.texinfo (Pure Decl): Update.
316 (Push Decl): Update.
317 (Decl Summary): Add api.pure to %define entry.
318 In %pure-parser entry, say it's deprecated and reference %define.
319 (Pure Calling): Update.
320 (Error Reporting): Update.
321 (C++ Scanner Interface): Update.
322 (How Can I Reset the Parser): Update.
323 (Table of Symbols): In %pure-parser entry, say it's deprecated and
324 reference %define.
325 * src/getargs.c (pure_parser): Remove global variable.
326 * src/getargs.h (pure_parser): Remove extern.
327 * src/output.c (prepare): Don't define pure_flag muscle.
328 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
329 wrapper around `%define api.pure'.
330 * tests/calc.at (Simple LALR Calculator): Update.
331 (Simple GLR Calculator): Update.
332 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
333 Update.
334 (GLR: Resolve ambiguity, pure, locations): Update.
335 (GLR: Merge conflicting parses, pure, no locations): Update.
336 (GLR: Merge conflicting parses, pure, locations): Update.
337 * tests/glr-regression.at (Uninitialized location when reporting
338 ambiguity): Update
339 * tests/input.at (Unused %define api.pure): New test case.
340 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
341 AT_PURE_IF and AT_PURE_AND_LOC_IF.
342 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
343
c373bf8b
JD
3442007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
345
346 %define push_pull -> %define api.push_pull. Discussed starting at
347 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
348 * data/push.c: Expect the new name.
349 * data/yacc.c: Likewise.
350 * doc/bison.texinfo (Push Decl): Update.
351 (Decl Summary): Update %define entry.
352 (Push Parser Function): Update.
353 (Pull Parser Function): Update.
354 (Parser Create Function): Update.
355 (Parser Delete Function): Update.
356 * tests/calc.at (Simple LALR Calculator): Update.
357 * tests/input.at (%define enum variables): Update.
358 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
359 (Push Parsing: Multiple impure instances): Update.
360 (Push Parsing: Unsupported Skeletons): Update.
361 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
362 (Exploding the Stack Size with Malloc): Update.
363
364 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
365 other entries some.
366
32f19b6b
JD
3672007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
368
369 For the XML output's terminal element, rename @number to @token-number,
370 and add @symbol-number. In the nonterminal element, rename @number to
371 @symbol-number. Discussed starting at
372 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
373 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
374 renames.
375 (xsl:template match="nonterminal"): Likewise.
376 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
377 (xsl:template match="nonterminal"): Likewise.
378 * src/print-xml.c (print_grammar): Implement.
379
255a6b90
JD
3802007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
381
382 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
383 2007-10-11 change, the child elements here are items not rules.
408476bc 384 (xsl:template match="item"): New.
255a6b90
JD
385 (xsl:template match="rule"): Update for new reduced itemset.
386 (xsl:template match="point"): Remove.
387 (xsl:template match="empty"): For consistency with --graph, don't
388 output "/* empty */".
389 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
390 line-wrap, don't pass a negative value as first-line-length since this
391 won't work with the following changes.
392 (xsl:template name="line-wrap"): Simplify slightly.
393 (xsl:template name="ws-search"): Eliminate recursion.
394 * src/print_graph.c (print_core): Don't print a reduction's lookahead
395 set next to an item whose dot is not at the end of the RHS even if it
396 happens to be associated with the same rule.
397
88c78747
JD
3982007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
399
31984206
JD
400 Add %define lr.keep_unreachable_states.
401 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
402 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
403 * src/main.c (main): Implement it.
404 * tests/conflicts.at (Unreachable States After Conflict Resolution):
405 Extend to test it, and fix a typo.
406
4072007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
408
409 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
410 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
411 the example .output text.
412 * tests/regression.at (Extra lookahead sets in report): Improve wording
413 of comments.
414
b7a70162
WP
4152007-10-17 Wojciech Polak <polak@gnu.org>
416
417 * src/print-xml.c (print_grammar): Renamed
418 <terminal> and <nonterminal> attributes:
419 "type" to "number" and "symbol" to "name".
420 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
421 Use new attribute names.
422 (xsl:template match="nonterminal"): Likewise.
423 * data/xslt/xml2xhtml.xsl: Likewise.
424
a0de5091
JD
4252007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
426
427 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
428 (Option Cross Key): Likewise.
429
430 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
431 next to an item whose dot is not at the end of the RHS even if it
432 happens to be associated with the same rule.
433 * src/print.c (print_core): Likewise.
434 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
435 (Resolved SR Conflicts): Update output.
436 * tests/regression.at (Extra lookahead sets in report): New test case.
437
4c20d18d
WP
4382007-10-11 Wojciech Polak <polak@gnu.org>
439
440 * src/print-xml.c (print_core): Remove item set
441 redundancy.
442 * data/xslt/bison.xsl (bison:ruleNumber): New key.
443 Improve processing time. Suggested by Joel E. Denny.
444 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
445 Write xsl:param "required" attribute as comment.
446 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
447 (xsl:template match="rule"): Support new reduced itemset.
448 (xsl:template match="point"): Remove.
449 * data/xslt/xml2xhtml.xsl: Likewise.
450
f506ad1c
JD
4512007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
452
453 * src/getargs.c (version): Update copyright year.
454
21f1b063
JD
4552007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
456
457 Make xml2dot.xsl and --graph produce the same output.
458 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
459 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
460 escaped later.
461 (xsl:template name="output-node"): Use the new escape template instead
462 of the string-replace template directly.
463 (xsl:template name="output-edge"): Likewise.
464 (xsl:template name="escape"): New, escapes backslashes and newlines in
465 addition to quotation marks.
466 * src/graphviz.c (start_graph, output_node, output_edge): Add
467 whitespace to output for legibility.
468
469 Make xml2text.xsl and --report produce the same output, and remove the
470 XML "conflicts" element since a conflict summary is easily extracted
471 from the automaton.
472 * data/xslt/bison.xsl: New.
473 (xsl:template match="state" mode="bison:count-conflicts): New.
474 * data/xslt/xml2text.xsl: Import bison.xsl.
475 (xsl:template match="bison-xml-report"): Instead of styling the
476 "conflicts" element, style the "automaton" element with mode
477 "conflicts". Unlike the former, the latter lists S/R and R/R
478 conflicts for a state on the same line.
479 (xsl:template match="conflicts"): Remove.
480 (xsl:template match="conflict"): Remove.
481 (xsl:template match="terminal"): Line-wrap the list of rules in which
482 the terminal is used.
483 (xsl:template match="nonterminal"): Likewise for nonterminals.
484 (xsl:template match="automaton" mode="conflicts"): New.
485 (xsl:template match="state" mode="conflicts"): New.
486 (xsl:template name="line-wrap"): New.
487 (xsl:template name="ws-search"): New.
488 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
489 (xsl:template match="bison-xml-report"): Instead of styling the
490 "conflicts" element, style the "automaton" element with mode
491 "conflicts."
492 (xsl:template match="conflicts"): Remove.
493 (xsl:template match="conflict"): Remove.
494 (xsl:template match="automaton" mode="conflicts"): New.
495 (xsl:template match="state" mode="conflicts): New.
496 * src/conflicts.c (conflicts_output_xml): Remove.
497 * src/conflicts.h (conflicts_output_xml): Remove prototype.
498 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
499 * src/print.c (print_grammar): Consistently wrap at the 66th column so
500 the corresponding XSLT is easier. Also, never wrap between a word and
501 the comma that follows it.
502
793fbca5
JD
5032007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
504
505 Improve C++ namespace support. Discussed starting at
506 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
507 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
508 b4_namespace_close): New macros that interpret the %define variable
509 "namespace" so its value can contain "::" to indicate nested
510 namespaces.
511 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
512 the above macros.
513 * data/lalr1.cc (b4_namespace): Likewise.
514 * data/location.cc (b4_namespace): Likewise.
515 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
516 inside a new table in the general %define entry. Document `%define
517 namespace' there as well. Point the %name-prefix entry to it since it
518 explains it more completely in the case of C++.
519 (C++ Bison Interface): Mention `%define namespace' instead of
520 %name-prefix.
521 (Table of Symbols): Remove the `%define push_pull' entry. The %define
522 entry suffices.
523 * tests/c++.at (Relative namespace references): New test case.
524 (Absolute namespace references): New test case.
525 (Syntactically invalid namespace references): New test case.
526 * tests/input.at (C++ namespace reference errors): New test case.
527
35b8730d
JD
5282007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
529
530 Add syncline support and location accessor to internal %define
531 interfaces.
532 * data/bison.m4 (b4_percent_define_get_loc): New.
533 (b4_percent_define_get_syncline): New.
534 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
535 (b4_percent_define_default): Record defining location as line 1 rather
536 than 0 for the sake of synchronizing #line's, and define
537 b4_percent_define_syncline(VARIABLE).
538 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
539 * src/muscle_tab.c (muscle_syncline_grow): New.
540 (muscle_code_grow): Use muscle_syncline_grow.
541 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
542 define b4_percent_define_syncline(VARIABLE).
543 (muscle_percent_define_get_loc): New.
544 (muscle_percent_define_get_syncline): New.
545 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
546 remove some unused variables.
547 (muscle_percent_define_default): Record defining location as line 1
548 rather than 0 for the sake of synchronizing #line's, and define
549 b4_percent_define_syncline(VARIABLE).
550 (muscle_percent_define_check_values): Use
551 muscle_percent_define_get_loc.
552 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
553 (muscle_percent_define_get_syncline): Prototype.
554 * tests/skeletons.at (%define Boolean variables: invalid skeleton
555 defaults): Update output for location change.
556 (Complaining during macro argument expansion): Extend to test
557 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
558
7dc4a694
JD
5592007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
560
561 Fix some error-reporting macro bugs.
562 * data/bison.m4 (b4_cat): New.
563 (b4_error, b4_error_at): Use b4_cat to send error directives directly
564 to stdout so they don't become arguments to other macros. Update
565 comments and add examples.
566 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
567 add examples.
568 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
569 after printing the error directive so that M4 doesn't report subsequent
570 problems that are induced by this problem.
571 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
572 instead of just in them. Recognize @\n in both places. Both expand to
573 the empty string. Needed by b4_cat.
574 * tests/skeletons.at (Complaining during macro argument expansion):
575 New test case.
576 (Fatal errors make M4 exit immediately): New test case.
577
d4bd2295
JD
5782007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
579
580 Implement --print-datadir.
581 * src/getargs.c (usage): Mention.
582 (PRINT_DATADIR_OPTION): New anonymous enum member.
583 (long_options): Add entry for it.
584 (getargs): Add case for it calling compute_pkgdatadir.
585 * src/output.c (output_skeleton): Encapsulate data directory
586 computation from here...
587 (prepare): ... and from here...
588 (compute_pkgdatadir): ... into this new function.
589 * src/output.h (compute_pkgdatadir): Prototype.
590
34cdeddf
JD
5912007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
592
593 * src/print-xml.c (escape_bufs): New static global variable
594 replacing...
595 (xml_escape_n): ... the static local variable buf here.
596 (print_xml): Free memory for escape_bufs.
597 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
598
d782395d
JD
5992007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
600
601 Replace `%push-parser' and `%push-pull-parser' with
602 `%define push_pull "push"' and `%define push_pull "both"'.
603 `%define push_pull "pull"' is the default.
604 * doc/bison.texinfo (Push Decl, Push Parser Function,
605 Pull Parser Function, Parser Create Function, Parser Delete Function):
606 Update declarations.
607 (Decl Summary, Table of Symbols): Replace %push-parser and
608 %push-pull-parser entries with a %define push_pull entry.
609 * data/bison.m4 (b4_percent_define_check_values): New macro.
610 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
611 definitions...
612 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
613 definitions...
614 * data/push.c: ... to here and compute them from the value of the
615 %define variable push_pull.
616 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
617 parsing requests here...
618 * data/yacc.c: ... hack this to switch to push.c any time
619 b4_use_push_pull_flag or the %define variable push_pull is set. This
620 will go away when we mv push.c yacc.c.
621 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
622 push parsing is not supported since unused %define variables are
623 reported anyway.
624 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
625 * src/muscle_tab.h (muscle_percent_define_check_values): Update
626 comments for consistency with b4_percent_define_check_values.
627 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
628 muscles.
629 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
630 Remove.
631 (prologue_declaration): Remove %push-parser and %push-pull-parser
632 rules.
633 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
634 * tests/calc.at: Update declarations.
635 * tests/input.at (%define enum variables): New test case.
636 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
637 declaration.
638 (Push Parsing: Multiple impure instances): Update declaration.
639 (Push Parsing: Unsupported Skeletons): New test case.
640 * tests/torture.at (Exploding the Stack Size with Alloca): Update
641 declaration.
642 (Exploding the Stack Size with Malloc): Update declaration.
643
3f999f78
WP
6442007-09-24 Wojciech Polak <polak@gnu.org>
645
646 Add XSLT transformations.
647
648 * data/xslt/xml2dot.xsl: Transform XML into DOT.
649 * data/xslt/xml2text.xsl: Transform XML into plain text.
650 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
651 * data/Makefile.am (xsltdir): New variable.
652 (dist_xslt_DATA): Add xslt/*.xsl files.
653
a4f75309
PE
6542007-09-23 Paul Eggert <eggert@cs.ucla.edu>
655
656 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
657 Problem reported by Wojciech Polak.
658 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
659 (xml_printf): Undo change I made on 21 September; that is,
660 indent 2 spaces, not 1.
661
ad5feac4
JD
6622007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
663
664 Pacify ./configure --enable-gcc-warnings.
665 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
666 `char const *' instead of `char *'.
667 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
668 local variable `sep'.
669
41d7a5f2
PE
6702007-09-21 Paul Eggert <eggert@cs.ucla.edu>
671
672 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
673 elsewhere.
674 * src/print-xml.c: Prefer "const" after types; that's more consistent.
675 (xml_printf): Indent just 1 space for level.
676 (e_char, xlate_char): Remove.
677 (xml_escape_string): Rewrite to avoid undefined behavior (used
678 storage that was freed from the stack).
679 (xml_escape_n): Don't bother checking for subscript error.
680
3f999f78
WP
6812007-09-21 Wojciech Polak <polak@gnu.org>
682
683 Add Bison XML Automaton Report.
41d7a5f2
PE
684
685 Add support for an -x option to generate an XML report.
686 It is not documented yet.
687 * src/print-xml.c: New file.
688 * src/print-xml.h: Likewise.
689 * lib/timevar.def (TV_XML): New var.
690 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
691 * src/conflicts.c: Include print-xml.h.
692 (solved_conflicts_xml_obstack): New var.
693 (log_resolution, conflicts_solve, conflicts_free):
694 Add support for XML report.
695 (conflicts_output_val): New function.
696 * src/conflicts.h (conflicts_output_val): New decl.
697 * src/files.c (spec_xml_file): New var.
698 (compute_output_file_names, output_file_names_free): Add XML support.
699 * src/files.h (spec_xml_file): New decl.
700 * src/getargs.c (xml_flag): New var.
701 (usage, short_options, long_options, getargs): Add XML support.
702 * src/getargs.h (xml_flag): New decl.
703 * src/gram.c: Include print-xml.h.
704 (rule_lhs_print_xml, rule_rhs_print_xml):
705 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
706 New functions.
707 * src/gram.h: Declare external ones.
708 * src/main.c: Include print-xml.h.
709 (main): Add XML support.
710 * src/reduce.c: Include print-xml.h.
711 (reduce_xml): New function.
712 * src/reduce.h: Declare it.
713 * src/state.c: Include print-xml.h.
714 (state_new): Add XML support.
715 (state_rule_lookahead_tokens_print_xml): New function.
716 * src/state.h: Declare it.
717 (struct state): New member solved_conflicts_xml.
718 * src/symtab.c (symbol_class_get_string): New function.
719 * src/symtab.h: Declare it.
720
6d8e724d
PE
7212007-09-21 Paul Eggert <eggert@cs.ucla.edu>
722
723 * GNUmakefile: Switch to coreutils's version.
724 * bootstrap: Likewise.
725 * Makefile.cfg: Adjust to new GNUmakefile.
726 * README-hacking: Likewise.
727
728 Import from gnulib:
729
730 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
731 Bruno Haible <bruno@clisp.org>
732
733 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
734 and is a script that invokes bison. Tighten the code. Add comments.
735
922bdd7f
JD
7362007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
737
738 Spell "boolean" as "Boolean". Reported by Akim Demaille.
739 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
740 * doc/bison.texinfo (Decl Summary): Fix.
741 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
742 * tests/input.at (Boolean %define variables): Update output.
743 * tests/skeletons.at (%define boolean variables: invalid skeleton
744 defaults): Rename to...
745 (%define Boolean variables: invalid skeleton defaults): ... this and
746 update output.
747
1b17b01d
JD
7482007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
749
750 In impure push mode, don't allow more than one yypstate to be allocated
751 since multiple impure parsers would corrupt yynerrs.
752 * data/push.c (yypstate_allocated): New static global variable
753 initialized to 0.
754 (yypull_parse): If yypstate_new returns 0, don't report it as memory
755 exhaustion if yypstate_allocated is 1, but still return 2.
756 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
757 already 1. Otherwise, set it to 1.
758 (yypstate_delete): Set it to 0.
759 * tests/push.at (Push Parsing: Multiple impure instances): New test
760 case.
761
9987d1b3
JD
7622007-08-17 Bob Rossi <bob@brasko.net>
763
764 * doc/bison.texinfo (Push Decl): Document the push parser.
765 (Table of Symbols): Ditto.
766 (Pure Decl): Ditto.
767 (Decl Summary): Ditto.
768 (Multiple Parsers, Push Parser Function, Pull Parser Function,
769 Parser Create Function, Parser Delete Function):
770 Add new push parser symbols.
771 (Table of Symbols): Document push-parser, push-pull-parser,
772 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
773
f16b0819
PE
7742007-08-15 Paul Eggert <eggert@cs.ucla.edu>
775
776 Update to GPLv3.
777 * doc/gpl-3.0.texi: New file.
778 * doc/gpl.texi: Remove.
779 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
780 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
781 * README-hacking, TODO, bootstrap, bootstrap.conf:
782 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
783 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
784 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
785 * data/lalr1.cc, data/lalr1.java, data/location.cc:
786 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
787 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
788 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
789 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
790 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
791 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
792 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
793 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
794 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
795 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
796 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
797 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
798 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
799 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
800 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
801 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
802 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
803 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
804 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
805 * src/complain.c, src/complain.h, src/conflicts.c:
806 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
807 * src/files.h, src/flex-scanner.h, src/getargs.c:
808 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
809 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
810 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
811 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
812 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
813 * src/print.c, src/print.h, src/print_graph.c:
814 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
815 * src/reduce.h, src/relation.c, src/relation.h:
816 * src/revision.h, src/scan-code.h, src/scan-code.l:
817 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
818 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
819 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
820 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
821 * tests/Makefile.am, tests/actions.at, tests/c++.at:
822 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
823 * tests/existing.at, tests/glr-regression.at:
824 * tests/headers.at, tests/input.at, tests/java.at:
825 * tests/local.at, tests/output.at, tests/push.at:
826 * tests/reduce.at, tests/regression.at, tests/sets.at:
827 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
828 * tests/torture.at:
829 Update to GPLv3.
830
728c4be2
JD
8312007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
832
833 Get rid of broken %no-parser, -n, and --no-parser implementation and
834 documentation.
835 * TODO: Don't mention them.
836 * doc/bison.1: Likewise.
837 * doc/bison.texinfo (Decl Summary): Likewise.
838 (Bison Options): Likewise.
839 (Option Cross Key): Likewise.
840 * src/getargs.c (no_parser_flag): Remove global variable.
841 (usage): Don't print description of -n and --no-parser.
842 (long_options): Remove --no-parser entry here.
843 (getargs): Remove -n case in the switch here.
844 * src/getargs.h (no_parser_flag): Remove extern.
845 * tests/regression.at (Web2c Actions): Remove comment that mentions
846 --no-parser.
847
5d31a216
JD
8482007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
849
850 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
851 name user variables starting with `yy'. Just pass NULL instead of a
852 dummy local &yylval to yypush_parse.
853 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
854 starting with `yy'.
855
a2ea208d
JD
8562007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
857
858 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
859 true since it's then always used regardless of whether yyoverflow is
860 defined. Reported by Christian Burger at
861 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
862 * THANKS: Add Christian Burger.
863
91661ebb
JD
864 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
865 node names: say "Decl Summary" not "Bison Declaration Summary".
866
cbd50549
JD
8672007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
868
869 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
870 determine whether this function has already complained about an invalid
871 value for a %define boolean variable, don't check whether Bison has
872 ever examined the value. As written, the check was a tautology.
873 Instead, record and check for this complaint using a separate muscle.
874
eb1b0740
JD
8752007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
876
877 Fix push parsing memory leak reported by Brandon Lucia at
878 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
879 * THANKS: Add Brandon Lucia.
880 * data/push.c (yypstate_delete): Free the stack if it was reallocated
881 but the parse never completed and thus freed it.
882 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
883 * tests/testsuite.at: Include push.at.
884 * test/push.at: New.
885 (Push Parsing: Memory Leak for Early Deletion): New test case.
886
9d774aff
JD
8872007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
888
889 Improve handling of multiple S/R conflicts in the same state and of S/R
890 conflicts involving multiple reductions.
891 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
892 set for a state here or Bison will abort if it is reassigned on a
893 later conflicted reduction in the same state.
894 Similarly, don't finalize and assign the solved conflicts report here
895 or it will be lost if it is reassigned on a later conflicted reduction
896 in the same state.
897 (set_conflicts): Instead, assign them both here after all S/R conflicts
898 in the state have been fully examined.
899 * src/print.c (shift_set): Rename to...
900 (no_reduce_set): ... this.
901 (print_reductions): Update for rename, and add %nonassoc error action
902 tokens to no_reduce_set so that, when printing the first remaining
903 reduction on an error action token, the reduction is enclosed in
904 brackets.
905 (print_results): Update for rename.
906 * tests/conflicts.at (Solved conflicts report for multiple reductions
907 in a state): New test case.
908 (%nonassoc error actions for multiple reductions in a state): New test
909 case.
910
911 * src/main.c (main): Don't depend on C99 features.
912
10159d2a
JD
9132007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
914
915 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
916 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
917 uniwidth.
10159d2a 918
953b3935
JD
9192007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
920
921 * bootstrap (slurp): Create target directories that don't exist.
922 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
923
6ce2d93a
JD
9242007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
925
926 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
927 than item number.
928 * closure.c (closure): Likewise.
929 * state.h (reductions): Comment sorting of rules.
930 (state): Comment sorting of items.
931
ce3448d5
JD
9322007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
933
934 Fix C++ test cases after recent Gnulib changes. Discussed starting at
935 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
936 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
937 definition in order to avoid Gnulib headers since we don't use config.h
938 here.
939 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
940 rather than AT_DATA so that config.h is included.
941
8a86eef0
JD
9422007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
943
944 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
945 instead of fprintf. Guard these functions with #if YYDEBUG instead of
946 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
947 and so that YYFPRINTF is guaranteed to be defined here.
948
b1a81613
JD
9492007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
950
951 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
952 with...
953 (muscle_percent_define_check_values): ... this more helpful function.
954 Again, it's not used yet, but it will be.
955 * src/muscle_tab.h: Likewise.
956
71b61d4d
JD
957 Improve some comments in parser table construction.
958 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
959 (generate_states): Don't mention ruleset, which is internal to closure.
960 * src/closure.c (closure): Explain sorting of core and itemset, which
961 is required for this function to behave correctly.
962 * src/closure.h (closure): Mention sorting.
963
2a6b783d
JD
9642007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
965
966 * src/lalr.c (state_lookahead_tokens_count): For code readability,
967 move the check for disabled transitions to an aver since conflict
968 resolution hasn't happened yet.
969
970 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
971 labels a state as inconsistent just because it has error transitions.
972 The original form of this check appeared in revision 1.1 of lalr.c,
973 which was committed on 1991-12-21. Now (at least), changing the
974 consistency label on such a state appears to have no useful effect in
975 any of the places it is examined, which I enumerate below. The key
976 point to understanding each item in this enumeration is that a state
977 with an error transition is labelled consistent in the first place only
978 if it has no rules, so the check cannot matter for states that have
979 rules. (1) Labelling a state as inconsistent will cause set_conflicts
980 to try to identify its conflicts, and a state must have *rules* to have
981 conflicts. (2) Labelling a state as inconsistent will affect how
982 action_row sets the default *rule* for the state. (3) Labelling a
983 state as inconsistent will cause build_relations to add lookback edges
984 to *rules* in that state.
985 * src/state.h (struct state): Word the comment for member consistent
986 more carefully.
987
14462c2b
JD
9882007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
989
990 Don't depend on C99 features.
991 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
992 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
993 * src/reader.c (check_and_convert_grammar): Fix for-loop.
994 * src/state.c (state_mark_reachable_states): Fix for-loop.
995 (state_remove_unreachable_states): Fix for-loop.
996
997 Don't widen struct state with member reachable just to temporarily
998 record reachability. Instead, use a local bitset.
999 * src/state.h (struct state): Remove member.
1000 * src/state.c (state_new): Don't initialize it.
1001 (state_mark_reachable_states): Rename to...
1002 (state_record_reachable_states): ... this, and use bitset.
1003 (state_remove_unreachable_states): Use bitset.
1004
5a43d418
JD
10052007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
1006
1007 * src/Makefile.am (yacc): Quote target action commands properly so
1008 that the yacc script isn't corrupt. Reported by Hans Aberg at
1009 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
1010
0c650a20
JD
1011 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
1012 the case of pure parsers. Reported by Frans Englich at
1013 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
1014 * THANKS: Add Frans Englich.
1015
61fee93e
JD
1016 * NEWS (2.3a+): In the %code entry, reference section `Bison
1017 Declaration Summary' from the manual now since the %code summary has
1018 moved there.
1019 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
1020 in the rules section must be terminated by semicolons.
1021
f124d423
JD
10222007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1023
1024 Extend the front-end API for %define variables to more completely
1025 mirror the back-end. This will be useful in the future.
1026 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
1027 Update comments to mention the new front-end counterparts of these
1028 macros.
1029 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
1030 for muscle_string_decode and muscle_location_decode.
1031 (muscle_string_decode): New static function.
1032 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
1033 (muscle_percent_define_get, muscle_percent_define_ifdef): New
1034 functions.
1035 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
1036 muscle_percent_define_get to mimic the b4_percent_define_flag_if
1037 implementation more closely.
1038 (muscle_percent_define_invalid_value): New function.
1039 * src/muscle_tab.h (muscle_percent_define_get,
1040 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
1041 Prototype.
1042
75ad86ee
JD
10432007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1044
1045 * NEWS (2.3a+): Mention yesterday's state-removal change.
1046 (2.3a): Remove the %language entry, which was added after 2.3a.
1047 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
1048 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
1049 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
1050 tests/existing.at: Update copyright date.
1051
5967f0cf
JD
10522007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1053
1054 If conflict resolution makes states unreachable, remove those states,
1055 report rules that are then unused, and don't report conflicts in those
1056 states.
1057 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
1058 New global function.
1059 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
1060 function.
1061 * src/main.c (main): After conflict resolution, remove the unreachable
1062 states and update all data structures that reference states by number.
1063 * src/state.c (state_new): Initialize each state's reachable member to
1064 false.
1065 (state_mark_reachable_states): New static function.
1066 (state_remove_unreachable_states): New global function.
1067 * src/state.h (struct state): Add member bool reachable.
1068 (state_remove_unreachable_states): Prototype.
1069 * tests/conflicts.at (Unreachable States After Conflict Resolution):
1070 New test case.
1071 * tests/existing.at (GNU pic Grammar): Update test case output now that
1072 an unused rule is discovered.
1073
b09f4f48
JD
10742007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1075
1076 Minor code cleanup in parser table construction.
1077 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
1078 (new_itemsets, save_reductions): Update for rename to nitemset.
1079 * src/closure.c (nritemset): Rename to...
1080 (nitemset): ... this since the "r" appears to meaningless and isn't
1081 used in the comments.
1082 (closure): Update for rename.
1083 * src/closure.h (nritemset): Update extern to...
1084 (nitemset): ... this.
1085 * src/lalr.c (LA): Fix a typo in comments.
1086 * src/print.c (print_core): Update for rename to nitemset.
1087 * src/print_graph.c (print_graph): Likewise.
1088 * src/state.h: Fix some typos in header comments.
1089
bbb44d83
PE
10902007-04-04 Paul Eggert <eggert@cs.ucla.edu>
1091
9b33de72
PE
1092 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
1093 still sticks to ASCII. Sorry!
1094
bbb44d83
PE
1095 * README-hacking: New file, taken mostly from coreutils, with changes
1096 for Bison. Contains much of the contents of:
1097 * README-cvs: Remove.
1098 * bootstrap: Sync from gnulib.
1099 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
1100 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
1101
29553547
JD
11022007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
1103
1104 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
1105 Setzer.
1106 (Java Differences): Fix some typos.
1107 * THANKS: Add Sebastian Setzer.
1108
01b477c6
PB
11092007-03-07 Paolo Bonzini <bonzini@gnu.org>
1110
730739e4
AD
1111 * data/java.m4 (b4_single_class_if): Remove.
1112 (b4_abstract_if): Look at "%define abstract".
1113 (b4_lexer_if): New.
1114 (b4_union_name): Rename...
1115 (b4_yystype): ... to this. Map to "%define stype".
1116 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
1117 b4_maybe_throws): Fix quoting.
1118 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
1119 * data/lalr1.java (Lexer interface): Always define.
1120 (Lexer interface within parser class): Remove.
1121 (YYLexer class): New, used when "%code lexer" is present.
1122 (constructor): When "%code lexer" is used, pass %lex-param
1123 to the lexer constructor.
1124 (yylex, yyparse): Remove %lex-param from method invocations
1125 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
1126
1127 * doc/bison.texinfo (Java Bison Interface): Mention "%define
1128 abstract". Rename "%define union_name" to "%define stype".
1129 Rename method names according to previous patch.
1130 (Java Scanner Interface): Describe "%code lexer" instead of
1131 "%pure-parser" and "%define single_class".
1132 (Java Differences): Mention "%code lexer".
1133
1134 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
1135 Include scanner here, using macros from tests/local.at.
1136 (AT_DATA_CALC_Y): Remove final argument.
1137 (_AT_CHECK_JAVA_CALC): Likewise.
1138 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
1139 of %locations and %error-verbose.
1140 (main): Test with and without %lex-param.
1141 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
1142 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 1143
122bea3a
JMG
11442007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1145
1146 DJGPP spefic issue. Inhibit the use of disallowed characters for
1147 file name genertion on Win98, WinXP, etc. These are |<>":?*\
1148 and concern testsuite case 46.
1149 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
1150 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
1151 * djgpp/config.bat: Inhibit the use of disallowed characters.
1152
9611cfa2
JD
11532007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
1154
1155 Miscellaneous %define and %code cleanup.
1156 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
1157 values are interpreted.
1158 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
1159 documentation a little more.
1160 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
1161 muscle_percent_define_insert, muscle_percent_code_grow): New
1162 functions/macros.
1163 * src/muscle_tab.h (muscle_percent_define_insert,
1164 muscle_percent_code_grow): Prototype.
1165 * src/parse-gram.y (prologue_declaration): Use
1166 muscle_percent_define_insert and muscle_percent_code_grow when parsing
1167 %define and %code directives.
1168
1169 Make it easy to share %define boolean variables between the front-end
1170 and back-end. Though not used yet, this will be useful in the future.
1171 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
1172 Bison uses of names rather than just skeleton uses of names.
1173 (b4_percent_define_get, b4_percent_define_ifdef): Rename
1174 b4_percent_define_skeleton_variables(VARIABLE) to
1175 b4_percent_define_bison_variables(VARIABLE).
1176 (b4_percent_code_get, b4_percent_code_ifdef): Rename
1177 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
1178 b4_percent_code_bison_qualifiers(QUALIFIER).
1179 (b4_check_user_names_wrap): Update for renames.
1180 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
1181 muscle_percent_define_default): New functions mimicking
1182 b4_percent_define_flag_if and b4_percent_define_default.
1183
1184 For %define variables, report locations for invalid values and
bbb44d83 1185 redefinitions.
9611cfa2
JD
1186 * data/bison.m4 (b4_percent_define_flag_if): Read
1187 b4_percent_define_loc(VARIABLE) to report the location of an invalid
1188 value for VARIABLE.
1189 (b4_percent_define_default): Save a special location in
1190 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
1191 must later be reported as invalid.
1192 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
1193 functions.
1194 (muscle_percent_define_insert): Record the location of VARIABLE in
1195 muscle percent_define_loc(VARIABLE), and use it to report the previous
1196 location for a redefinition.
1197 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
1198 (muscle_percent_define_default): Update like b4_percent_define_default.
1199 (muscle_grow_user_name_list): Rename to...
1200 (muscle_user_name_list_grow): ... this for consistency and use
1201 muscle_location_grow.
1202 * src/muscle_tab.h (muscle_location_grow): Prototype.
1203 * tests/input.at (%define errors): Update expected output.
1204 * tests/skeletons.at (%define boolean variables: invalid skeleton
1205 defaults): New test case.
1206
0bf92491
JD
12072007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
1208
1209 * src/print.c (lookahead_set, state_default_rule): Remove.
1210 (print_reductions): Replace state_default_rule invocation with
1211 equivalent use of yydefact, which was computed in token_actions in
1212 tables.c.
1213 (print_results): Don't allocate lookahead_set.
1214
d3b12988
PB
12152007-02-27 Paolo Bonzini <bonzini@gnu.org>
1216
1217 * data/lalr1.java: Prefix all private members with yy.
1218
f57a7536
JD
12192007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
1220
1221 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 1222 Sebastien Fricker at
f57a7536 1223 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 1224 * THANKS: Add Sebastien Fricker.
f57a7536
JD
1225 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
1226 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
1227 accept a variable number of arguments.
1228
6404a5bf
JD
12292007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1230
1231 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
1232
e4e09639
JMG
12332007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1234
1235 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
1236 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
1237 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
1238
d7e0a1a7
PE
12392007-02-11 Paul Eggert <eggert@cs.ucla.edu>
1240
1241 Undo my 2007-02-07 change, switching back to the c-strcase module
1242 introduced in the 2007-02-03 change. Bruno Haible reported that
1243 the 2007-02-07 change would be dangerous in Turkish if we add a
1244 language whose name contains "i", since "i" is not lowercase "I"
1245 in Turkish.
1246 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
1247 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
1248 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
1249 * m4/.cvsignore: Remove strcase.m4.
1250 * src/getargs.c: Revert 2007-02-07 change, as follows.
1251 Include c-strcase.h.
1252 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
1253
deee93a1
JD
12542007-02-11 Bruno Haible <bruno@clisp.org>
1255
1256 Enable the Java related testsuite tests when the only Java compiler
1257 found is a gcj < 4.3. Discussed at
1258 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
1259 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
1260
574add85
JD
12612007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
1262
1263 * data/Makefile.am: Update copyright date.
1264 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
1265 yypstate_new returns NULL.
1266 (yypstate_new): Return NULL if malloc does.
1267 * src/reader.c (packgram): Move translation of rule actions from the
1268 beginning of packgram to...
1269 (check_and_convert_grammar): ... here right before packgram is invoked
1270 so it's easier to write more complete comments, and remove redundant
1271 code.
1272
e785ccf7
JD
12732007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
1274
1275 As in semantic actions, make @$ in %initial-action, %destructor, and
1276 %printer imply %locations.
1277 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
1278 scanning @$.
1279 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
1280 (@$ in %initial-action implies %locations,
1281 @$ in %destructor implies %locations,
1282 @$ in %printer implies %locations): ... these new test cases.
1283
1cfe1ed7
PE
12842007-02-07 Paul Eggert <eggert@cs.ucla.edu>
1285
1286 Undo most of the 2007-02-03 change, switching to the strcase module
1287 now that gnulib strcase has been fixed.
1288 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
1289 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
1290 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
1291 * m4/.cvsignore: Add strcase.m4.
1292 * src/getargs.c: Revert 2007-02-03 change, as follows.
1293 Don't include c-strcase.h.
1294 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
1295 strcasecmp has "unspecified behavior" outside the POSIX locale,
1296 but it works fine in practice if at least one argument is ASCII,
1297 as is the case in Bison.
1298
0049ec86
PB
12992007-02-07 Paolo Bonzini <bonzini@gnu.org>
1300
1301 * tests/java.at: Skip tests if only one of javac/java is present.
1302 Reported by Joel E. Denny.
1303 * tests/atlocal.in: Adjust copyright years.
1304
13052007-02-05 Paolo Bonzini <bonzini@gnu.org>
1306
1307 * data/lalr1.java (Stack): Work around old verifiers that disallow
1308 access to the private fields of an inner class, from the outer class.
1309 We can make Stack's fields public because user code doesn't have access
1310 to the instance of Stack used by parse(). Reported by Paul Eggert.
1311
2c2b7220
PE
13122007-02-03 Paul Eggert <eggert@cs.ucla.edu>
1313
1314 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
1315 the right spot for these files?
1316 * bootstrap.conf (gnulib_modules): Add c-strcase.
1317 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
1318 c-strncasecmp.c.
1319 * src/getargs.c: Include c-strcase.h.
1320 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
1321 to avoid unspecified behavior.
1322
b2b81dae
JD
13232007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
1324
1325 * doc/bison.texinfo (Decl Summary): Correct typo.
1326
c1d19e10
PB
13272007-01-30 Paolo Bonzini <bonzini@gnu.org>
1328
1329 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
1330 Complain if the value does not match empty, "true" or "false".
1331 * data/c++.m4: Adjust default definitions of %define variables.
1332 * data/java.m4: Adjust default definitions of %define variables.
1333 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
1334 to above behavior.
1335 * tests/input.at (Boolean %define variables): Test new behavior.
1336
8405b70c
PB
13372007-01-29 Paolo Bonzini <bonzini@gnu.org>
1338
1339 * NEWS: Mention java.
1340 * TODO: Remove things that are done.
1341 * bootstrap.conf: Add javacomp-script and javaexec-script.
1342 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
1343
1344 * data/Makefile.am: Add new files.
1345 * data/java-skel.m4: New.
1346 * data/java.m4: New.
1347 * data/lalr1.java: New.
1348
1349 * doc/bison.texinfo: Put "A Complete C++ Example" under
1350 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
1351 under Other Languages.
1352
1353 * src/getargs.c (valid_languages): Add Java.
1354 * src/getargs.h (struct bison_language): Update size of string fields.
1355
1356 * tests/Makefile.am: Add java.at.
1357 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
1358 * tests/java.at: New.
1359 * tests/testsuite.at: Include it.
1360
3eb82471
JD
13612007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
1362
1363 Clean up.
1364 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
1365 at_directive_argv arguments so these no longer have to be global
1366 variables. Also, update the implementation for the following changes.
1367 (fail_for_at_directive_too_many_args,
1368 fail_for_at_directive_too_few_args): Add at_directive_name argument.
1369 (at_directive_name): Remove as at_directive_argv[0] will be used for
1370 this now.
1371 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
1372 for the directive name.
1373 (at_directive_argc, at_directive_argv): Make these local within
1374 skel_lex instead of global.
1375 (INITIAL): Update directive start action for above changes.
1376 (SC_AT_DIRECTIVE_ARG): Rename to...
1377 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
1378 (SC_AT_DIRECTIVE_SKIP_WS): Update.
1379 (scan_skel): Move yylex_destroy to...
1380 (skel_scanner_free): ... here.
1381 * tests/skeletons.at (installed skeleton file name): Rename to...
1382 (installed skeleton file names): ... this.
1383
148d66d8
JD
13842007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
1385
1386 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1387 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
1388 Summary" not "Directives".
1389 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
1390 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
1391 since the former is now the more complete one.
1392 (Prologue Alternatives): Likewise and do the same for %defines.
1393 (Table of Symbols): Add summary of %code, add summary of %define, and
1394 move full %code documentation to...
1395 (Decl Summary): ... here for consistency with other entries in these
1396 sections.
1397 Move %define entry in order to keep this list alphabetized.
1398 Reword %define entry a little to put less emphasis on the skeleton
1399 concept, which most users shouldn't have to think about.
1400
665f0c24
PE
14012007-01-26 Paul Eggert <eggert@cs.ucla.edu>
1402
1403 Adjust to recent gnulib changes.
1404 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
1405 Add string.h, string_.h, unistd_.h, wchar_.h.
1406 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
1407 * src/system.h: Don't include <stpcpy.h>; this is now done by
1408 <string.h>.
1409
592d0b1e
PB
14102007-01-23 Paolo Bonzini <bonzini@gnu.org>
1411
1412 Simplify implementation of unqualified %code, implement macros for
1413 uniform treatment of boolean %define flags. Document %define.
1414 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
1415 b4_percent_code_ifdef): New.
1416 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
1417 * data/c++.m4: Define default value for global_tokens_and_yystype.
1418 * data/glr.cc: Likewise.
1419 * data/location.cc: Use b4_percent_define_flag_if.
1420
148d66d8 1421 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
1422
1423 * src/parse-gram.y (Unqualified %code): Change muscle name to
1424 b4_percent_code().
1425 (content.opt): Default to empty.
1426
a7867f53
JD
14272007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1428
1429 Implement support for relative and absolute skeleton file names.
1430 Discussed starting at
1431 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
1432 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
1433 (Bison Options): Document in --skeleton entry.
1434 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
1435 full_skeleton can't necessarily hold all of pkgdatadir.
1436 If the specified skeleton file name contains a `/', don't prepend
1437 pkgdatadir.
1438 * src/parse-gram.y (prologue_declaration): If the specified skeleton
1439 file name contains a `/', prepend the grammar file directory.
1440 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
1441 * skeletons.at: New file.
1442 (relative skeleton file names): New test case.
1443 (installed skeleton file names): New test case.
1444 * tests/testsuite.at: Include skeletons.at.
1445
1446 * bootstrap: Update copyright to 2007.
1447
830c9b18
PB
14482007-01-17 Paolo Bonzini <bonzini@gnu.org>
1449
1450 * bootstrap: Remove occurrences of .#bootmp from the files.
1451
a8c2e813
AD
14522007-01-17 Akim Demaille <akim@epita.fr>
1453
1454 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
1455 nonterminals.
1456 Use per-type %printer.
1457
279cabb6
JD
14582007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1459
1460 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
1461 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1462 djgpp/config.site, src/files.c, src/files.h, src/main.c,
1463 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
1464 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
1465 tests/glr-regression.at, tests/input.at, tests/local.at,
1466 tests/output.at, tests/torture.at: Update copyright to 2007.
1467
bb32f4f2
AD
14682007-01-16 Akim Demaille <akim@epita.fr>
1469
1470 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
1471 error code.
1472 (Calc++ Scanner): Exit with failure if we can't open the input
1473 file.
1474 Accept "-" standing for stdin.
1475 (Calc++ Top Level): Print the result only if the parsing was
1476 successful.
1477
7cff04b5
AD
14782007-01-16 Akim Demaille <akim@epita.fr>
1479
1480 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
1481
a4e25e1d
JD
14822007-01-15 Paolo Bonzini <bonzini@gnu.org>
1483 and Joel E. Denny <jdenny@ces.clemson.edu>
1484
1485 Clean up %define and %code implementation in M4 some. Most
1486 importantly, rename all related macros to be in the b4_percent_define
1487 and b4_percent_code namespaces. Also, complete support for `.' in
1488 %define variable names and %code qualifiers.
1489 * data/bison.m4 (b4_check_user_names): Check for special
1490 "SKELETON-NAMESPACE(name)" macros instead of using two nested
1491 m4_foreach loops.
1492 (b4_get_percent_define, b4_get_percent_code): Rename to...
1493 (b4_percent_define_get, b4_percent_code_get): ... these.
1494 Extend documentation with examples.
1495 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
1496 b4_percent_define_skeleton_variables and
1497 b4_percent_code_skeleton_qualifiers.
1498 Expect any value for the %define variable `foo' to be stored in the
1499 macro named `b4_percent_define(foo)'; expect any %code blocks for the
1500 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
1501 expect any unqualified %code blocks to be stored in a macro named
1502 `b4_percent_code_unqualified'.
1503 Use m4_indir so that %define variable names and %code qualifiers can
1504 contain `.', which is allowed by the grammar parser.
1505 (b4_percent_define_default): New macro to set a default value for a
1506 %define variable.
1507 (m4_wrap): Update wrapped code, and fix some underquoting.
1508 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
1509 Expect grammar uses of %define variables and %code qualifiers to be
1510 defined in b4_percent_define_user_variables and
1511 b4_percent_code_user_qualifiers.
1512 * data/c++.m4: Use b4_percent_define_default rather than
1513 m4_define_default. Fix some underquoting. Skeleton usage of %define
1514 variable define_location_comparison now implies skeleton usage of
1515 %define variable filename_type.
1516 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1517 data/push.c, data/yacc.c: Update macro names.
1518 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
1519 muscle names.
1520
e37c665c
JMG
15212007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1522
1523 DJGPP specific issues.
1524
1525 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
1526 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
1527
7d2d521f
JD
15282007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1529
1530 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
1531 run parsers in all tests so that Valgrind is invoked during
1532 maintainer-check-valgrind.
1533 (Duplicate representation of merged trees): Free all semantic values.
1534 (Duplicated user destructor for lookahead): Likewise.
1535
e0ac9b4b
JD
15362007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1537
1538 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
1539 command-line prefix.
1540 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
1541 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
1542 miss Valgrind messages.
1543 (Exploding the Stack Size with Malloc): Likewise.
1544
78143faa
JD
15452007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1546
1547 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
1548 locals. Reported by Juan Manuel Guerrero at
1549 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
1550 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
1551 Fix some indentation also.
1552 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
1553 explaining this issue.
1554
7ecec4dd
JD
15552007-01-09 Paolo Bonzini <bonzini@gnu.org>
1556 and Joel E. Denny <jdenny@ces.clemson.edu>
1557
1558 Simplify union and prologue handling, and escape union and lex/parse
1559 params with digraphs.
1560 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
1561 values to the empty string since these are no longer guaranteed
1562 initialized by the front-end.
1563 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
1564 braces around b4_user_stype since this is no longer done by the
1565 front-end.
1566 * src/files.c, src/files.h (pre_prologue_obstack,
1567 post_prologue_obstack): Remove.
1568 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
1569 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
1570 with digraphs. This fixes lex params and parse params.
1571 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
1572 * src/output.c (prepare): Remove muscle insertion of the prologues.
1573 (output): Remove freeing of pre_prologue_obstack and
1574 post_prologue_obstack.
1575 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
1576 than prologue_augment for prologue parsing so you don't need prologue
1577 obstacks.
5c80250c
JD
1578 (grammar_declaration): For %union RHS, use `braceless' instead of
1579 "{...}" so that braces are already stripped and code is escaped with
1580 digraphs.
7ecec4dd
JD
1581 * src/reader.c (prologue_augment): Remove.
1582 (reader): Remove initialization of pre_prologue_obstack and
1583 post_prologue_obstack.
1584 * src/reader.h (prologue_augment): Remove.
1585
1586 * data/c.m4: Remove stray parenthesis.
1587
16dc6a9e
JD
15882007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1589
1590 Remove quotes from variables names in %define directives and from
1591 qualifiers in %code directives, and restrict the characters that are
1592 allowed in them to M4-friendly ones. For %define, continue to support
1593 the quoted form as a deprecated feature. Discussed starting at
1594 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
1595 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
1596 %code.
1597 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
1598 (Decl Summary): In %defines entry, update mention of `%code requires'
1599 and `%code provides'.
16dc6a9e
JD
1600 (C++ Location Values): Update %define uses.
1601 (Calc++ Parser Interface): Likewise.
1602 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 1603 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
1604 * src/parse-gram.y (prologue_declaration): For %define variables, use
1605 `variable' instead of `STRING'.
1606 (grammar_declaration): For %code qualifiers, use `ID' instead of
1607 `STRING'.
1608 (variable): New nonterminal that takes an `ID' or a `STRING'.
1609 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
1610 and %define uses.
1611 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
1612 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
1613 (%define errors): Update %define uses.
1614
e9813cd4
JD
16152007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1616
1617 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
1618 instead of muscle_insert for %define values so that M4-special
1619 characters are replaced with digraphs.
1620 * tests/input.at (%define errors): Extend to check weird values.
1621
6afc30cc
JD
16222007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1623
1624 Instead of having skeletons declare all valid %define variables and
1625 %code qualifiers, provide macros that retrieve the associated values
1626 and build these lists automatically. Thus Bison will now warn when a
1627 variable or qualifier is not used by the skeleton in the current
1628 invocation regardless of whether it might sometimes be used by that
1629 skeleton in other invocations. Also, move all %define value macros to
1630 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
1631 form, which is replaced by %code.
1632 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
1633 (b4_check_user_names): ... this, and change the series of valid name
1634 arguments to a single list argument for names used in the skeleton
1635 similar to the existing list argument for names used in the grammar.
1636 Warn instead of complaining.
1637 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
1638 values and %code code, to format %code code properly, and to build
1639 lists of all %define variables and %code qualifiers used in the
1640 skeleton: b4_skeleton_percent_define_variables and
1641 b4_skeleton_percent_code_qualifiers.
1642 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
1643 Remove, and...
1644 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
1645 the skeleton names lists can finish building first. In place of
1646 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
1647 expect the lists b4_user_percent_define_variables and
1648 b4_user_percent_code_qualifiers.
1649 * data/c++.m4: Where setting default values for b4_parser_class_name,
1650 b4_location_type, b4_filename_type, b4_namespace, and
1651 b4_define_location_comparison, update their names to the
1652 b4_percent_define_ namespace.
1653 * data/glr.c: Don't use b4_check_percent_define_variables and
1654 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1655 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
1656 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 1657 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
1658 * data/location.cc: Use b4_get_percent_define.
1659 * data/push.c: Don't use b4_check_percent_define_variables and
1660 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1661 * data/yacc.c: Likewise, and don't call m4_exit in
1662 b4_use_push_for_pull_if or m4_wrap code will never execute.
1663 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
1664 Rename to...
1665 (muscle_grow_user_name_list): ... this for consistency with the
1666 terminology used in bison.m4.
1667 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
1668 %define variable names, and rename muscle used_percent_define_variables
1669 to user_percent_define_variables.
1670 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
1671 user_percent_code_qualifiers.
1672 (content): Remove.
1673 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
1674 {CODE} form is no longer accepted.
1675 * tests/input.at (Reject bad %code qualifiers): Rename to...
1676 (Reject unused %code qualifiers): ... this, and update test output.
1677 (%define error): Update test output.
1678
7eb8a0bc
JD
16792007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
1680
1681 Check for unrecognized %define variables similar to checking for
1682 unrecognized %code qualifiers. Check for redefined %define variables.
1683 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
1684 generalizes...
1685 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
1686 (b4_check_percent_define_variables): New, also wraps it.
1687 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
1688 variables using b4_check_percent_define_variables.
1689 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
1690 all those exercised in the test suite and all those listed in the
1691 `Default values' section of c++.m4. Are there others?
1692 * data/push.c, data/yacc.c: Declare no valid %define variables.
1693 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
1694 similar to muscle_find, but it works even when the muscle stores a
1695 const value.
1696 (muscle_grow_used_name_list): New function for constructing the used
1697 name list muscles that b4_check_for_unrecognized_names requires.
1698 * src/parse-gram.y (prologue_declaration): Warn if a variable is
1699 %define'd more than once. Define the b4_used_percent_define_variables
1700 muscle with muscle_grow_used_name_list.
1701 (grammar_declaration): Abbreviate %code code with
1702 muscle_grow_used_name_list.
1703 * tests/input.at (%define errors): New.
1704
3fc65ead
JD
17052007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1706
1707 Provide warn_at, complain_at, and fatal_at function callbacks to the
1708 skeletons, and use this for %code qualifier complaints.
1709 * data/bison.m4 (b4_error_at): New, invoked by...
1710 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
1711 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
1712 @fatal_at(...@) directives.
1713 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
1714 qualifiers in b4_used_percent_code_qualifiers and to use
1715 b4_complain_at.
1716 * src/location.c, src/location.h (boundary_set_from_string): New global
1717 function.
1718 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
1719 function.
1720 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
1721 to b4_used_percent_code_qualifiers.
1722 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
1723 function.
1724 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
1725 (lineno): Rename to...
1726 (out_lineno): ... this so I don't misunderstand it again.
1727 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
1728 here; these newlines are in the input but not the output file.
1729 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
1730 (at_directive_perform): ... this new static function, and add handling
1731 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
1732 directives.
1733 * tests/input.at (Reject bad %code qualifiers): Update test output with
1734 locations and extend.
1735
1736 * tests/output.at (Output file name: [, Output file name: ]): Remove
1737 bogus comment about these tests failing.
1738
1c7b7e1d
JD
17392007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1740
1741 Clean up b4_check_percent_code_qualifiers a little.
1742 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
1743 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
1744 documentation and add examples.
1745 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
1746 qualifiers here.
1747
08af01c2
JD
17482007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
1749
1750 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
1751 unreliable -- especially when they're hidden inside another macro.
1752 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
1753 data/c.m4: Remove m4_divert(-1).
1754 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1755 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
1756 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 1757 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
1758 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
1759 pushed and popped by m4sugar, should be first on the stack.
1760
1761 Provide warn, complain, and fatal function callbacks to the skeletons.
1762 This provides more flexibility than m4_fatal, improves the error
1763 message format, and captures messages for translation. Discussed
1764 starting at
1765 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
1766 * data/bison.m4 (b4_error): New, invoked by...
1767 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
1768 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
1769 directives. Because these M4 macros might be called when the current
1770 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
1771 the previous removal of uses of m4_divert, which caused trouble.
1772 (b4_check_percent_code_qualifiers): Use b4_complain instead of
1773 m4_fatal to report unrecognized %code qualifiers.
1774 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
1775 push parser requests.
1776 * data/glr.c: Use b4_complain instead of m4_fatal to report
1777 non-deterministic push parser requests.
1778 Update @output usage to @output(...@) form.
1779 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
1780 report missing %defines. Update @output usage to @output(...@) form.
1781 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
1782 @output(...@) form.
1783 * src/main.c (main): Invoke skel_scanner_free.
1784 * src/scan-skel.h (skel_scanner_free): Prototype new function.
1785 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
1786 obstack_for_string from flex-scanner.h.
1787 (YY_DECL): Use to declare skel_lex static.
1788 (decode_at_digraphs): Remove; now handled in the new
1789 SC_AT_DIRECTIVE_ARG start condition.
1790 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
1791 functions.
1792 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
1793 at_directive_argv): New static globals.
1794 (INITIAL): Use fail_for_invalid_at.
1795 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
1796 recognize the start of a generalized `@directive(...@)' form and
1797 start...
1798 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
1799 directive args (using the new obstack_for_string), to decode the
1800 contained @ diagraphs, and to perform the directive. It recognizes
1801 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
1802 @output(...@).
1803 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
1804 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
1805 `@,'.
1806 (scan_skel): Initialize obstack_for_string on the first call.
1807 (skel_scanner_free): New function to free obstack_for_string.
1808 * tests/input.at (Reject bad %code qualifiers): Update test output.
1809
8e0a5e9e
JD
18102007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
1811
1812 Consolidate the 4 prologue alternative directives (%code, %requires,
1813 %provides, and %code-top) into a single %code directive with an
1814 optional qualifier field. Discussed at
1815 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
1816 * NEWS (2.3a+): Rewrite the existing entry for the prologue
1817 alternatives.
1818 * doc/bison.texinfo (Prologue Alternatives): Update.
1819 (Decl Summary): Update to %code "requires" and %code "provides".
1820 (Calc++ Parser): Update to %code "requires".
148d66d8 1821 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
1822 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
1823 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
1824 are replaced by b4_percent_code_provides and b4_percent_code_requires,
1825 which are skeleton-specific.
1826 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
1827 declare what %code qualifiers it supports and to complain if any other
1828 qualifiers were used in the grammar.
1829 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
1830 and b4_user_code([b4_percent_code_provides]) in place of
1831 b4_user_requires and b4_user_provides.
1832 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
1833 Add b4_user_code([b4_percent_code_top]) and
1834 b4_user_code([b4_percent_code]).
1835 Invoke b4_check_percent_code_qualifiers.
1836 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
1837 PERCENT_REQUIRES): Remove.
1838 (grammar_declaration): Remove RHS's for %code-top, %provides, and
1839 %requires. Rewrite the %code RHS as the unqualified form defining the
1840 muscle b4_percent_code. Add another RHS for the qualified %code form,
1841 which defines muscles of the form b4_percent_code_QUALIFIER and the
1842 b4_used_percent_code_qualifiers muscle.
1843 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
1844 PERCENT_REQUIRES): Remove.
1845 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
1846 %code "requires" and %code "provides".
1847 * tests/input.at (Reject bad %code qualifiers): New.
1848
95021767
JD
18492007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
1850
1851 Use the new code_props interface for destructors and printers.
1852 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
1853 printer_location members, and change the type of the destructor and
1854 printer members to code_props.
1855 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
1856 symbol_printer_get, semantic_type_destructor_set,
1857 semantic_type_printer_set, default_tagged_destructor_set,
1858 default_tagless_destructor_set, default_tagged_printer_set,
1859 default_tagless_printer_set): Use code_props in arguments and return
1860 types in place of char const * and location.
1861 (symbol_destructor_location_get, symbol_printer_location_get): Remove
1862 since the locations are now contained in the return of
1863 symbol_destructor_get and symbol_printer_get.
1864 * src/output.c (symbol_destructors_output, symbol_printers_output):
1865 Replace with...
1866 (symbol_code_props_output): ... this to eliminate duplicate code.
1867 (output_skeleton): Update to use symbol_code_props_output.
1868 * src/reader.c (symbol_should_be_used): Update use of
1869 symbol_destructor_get.
1870 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1871 Update uses of the various _destructor_set and _printer_set functions.
1872 * src/symtab.c: (default_tagged_destructor_location,
1873 default_tagless_destructor_location, default_tagged_printer_location,
1874 default_tagless_printer_location): Remove since we...
1875 (default_tagged_destructor, default_tagless_destructor,
1876 default_tagged_printer, default_tagless_printer): ... change the type
1877 of these to code_props.
1878 (symbol_new, semantic_type_new, symbol_destructor_set,
1879 semantic_type_destructor_set, symbol_destructor_get,
1880 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
1881 symbol_check_alias_consistency, default_tagged_destructor_set,
1882 default_tagless_destructor_set, default_tagged_printer_set,
1883 default_tagless_printer_set): Update.
1884 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
1885 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
1886 code_props members.
1887 (symbol_print): Use SYMBOL_CODE_PRINT.
1888
f6857bbf
JD
18892007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
1890
1891 Use the new code_props interface for rule actions.
1892 * src/symlist.h (symbol_list): Replace action, action_location, and
1893 used members with a code_props action_props member.
1894 * src/reader.c (symbol_should_be_used, grammar_rule_check,
1895 grammar_midrule_action, grammar_current_rule_merge_set,
1896 grammar_current_rule_symbol_append, packgram): Update.
1897 * src/scan-code.h (translate_rule_action): Remove, no longer used.
1898 * src/scan-code.l (handle_action_dollar): Update.
1899 (translate_rule_action): Remove, no longer used.
1900 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
1901
7c0c6181
JD
19022007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1903
1904 Use the new code_props interface in parse-gram.y.
1905 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
1906 Update all uses of translate_* functions to use the new code_props
1907 interface and to use gram_scanner_last_string_free and
1908 code_scanner_last_string_free where possible.
1909 (grammar_declaration): symbol_list_destructor_set and
1910 symbol_list_printer_set now perform the translation, so don't do it
1911 here. Use gram_scanner_last_string_free where possible.
1912 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
1913 translate_code): Remove, no longer used.
1914 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
1915 symbol_list_printer_set): Perform code translation here rather than
1916 depending on the caller to do so.
1917
1918 * src/symlist.h (struct symbol_list): Correct some documentation typos.
1919 * src/scan-gram.h (gram_last_string): Remove declaration.
1920 * src/scan-gram.l (last_string): Declare it static.
1921
28e52c0d
JD
19222007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1923
1924 Encapsulate code properties and related functionality for the various
1925 destructors, printers, and actions into a code_props structure and
1926 interface. This patch merely implements code_props in scan-code.h and
1927 scan-code.l. Future patches will rewrite other modules to use it.
1928 Discussed starting at
1929 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
1930 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
1931 consistently initialize const structs that have an empty location
1932 field.
1933 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
1934 to ensure consistency.
1935 * src/scan-code.h (code_props): New structure.
1936 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
1937 function, macro, and const global variable for initializing a
1938 code_props with no code.
1939 (code_props_plain_init, code_props_symbol_action_init,
1940 code_props_rule_action_init, code_props_translate_code): The rest of
1941 the new code_props functional interface. Among other things, the init
1942 functions set the code_props kind field so that
1943 code_props_translate_code will know whether to behave like
1944 translate_symbol_action, translate_rule_action, or translate_code.
1945 These old translate functions must remain until all other modules are
1946 updated to use the new code_props interface.
1947 (code_scanner_last_string_free): New function similar to
1948 gram_scanner_last_string_free.
1949 (code_scanner_free): Add documentation.
1950 * src/scan-code.l: Implement the new interface.
1951 (code_lex): Make it static, add a code_props* argument, and remove the
1952 rule argument.
1953 (last_string): New static global similar to the one in scan-gram.l.
1954 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
1955 instead of rule.
1956 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
1957 code_props since Bison may one day use this information for destructors
1958 and printers.
1959 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
1960 (handle_action_dollar): Use symbol_list_n_get and set used flag
1961 directly since symbol_list_n_used_set is removed.
1962 (translate_action): Add a code_props* argument and remove the rule,
1963 action, and location arguments. Pass the code_props* on to code_lex.
1964 (translate_rule_action, translate_symbol_action, translate_code):
1965 Rewrite as wrappers around the new code_props interface.
1966 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
1967 it would eventually need to break the encapsulation of code_props.
1968
96034983
JD
19692007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
1970
1971 * etc/.cvsignore: New.
1972
945e396c
JD
19732007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
1974
1975 Add maintainer-push-check to run maintainer-check using push parsing in
1976 place of pull parsing where available.
1977 * Makefile.am (maintainer-push-check): New.
1978 * data/bison.m4 (b4_use_push_for_pull_if): New.
1979 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
1980 appropriately based on their existing values.
1981 (yypush_parse): Don't print push-parser-specific diagnostics if push
1982 parsing is being used in place of pull parsing.
1983 * data/yacc.c: If push parsing should replace pull parsing, redirect to
1984 push.c.
1985 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
1986 variable, and insert b4_use_push_for_pull_flag into muscles.
1987 * tests/Makefile.am (maintainer-push-check): New.
1988
7d596384
JD
19892006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
1990
1991 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
1992 (whether successful or failed) so that yypush_parse can be invoked
1993 again to start a new parse using the same yypstate.
1994 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
1995 check multiple yypull_parse invocations on the same yypstate. For pull
1996 mode, extend to check multiple yyparse invocations.
1997 (Exploding the Stack Size with Alloca): Extend to try with
1998 %push-pull-parser.
1999 (Exploding the Stack Size with Malloc): Likewise.
2000
2001 * tests/calc.at (Simple LALR Calculator): Don't specify
2002 %skeleton "push.c" since %push-pull-parser implies that now.
2003 * tests/headers.at (export YYLTYPE): Don't check for the push
2004 declarations. Otherwise, this test case can't be used to see if push
2005 mode can truly emulate pull mode.
2006 * tests/input.at (Torturing the Scanner): Likewise.
2007 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
2008 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
2009 AT_YACC_IF, which now includes the case of push mode since %skeleton
2010 need not be used for push mode. This will be more intuitive once
2011 push.c is renamed to yacc.c.
2012
7172e23e
JD
20132006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2014
2015 For push mode, convert yyparse from a macro to a function, invoke yylex
2016 instead of passing a yylexp argument to yypull_parse, and don't
2017 generate yypull_parse or yyparse unless %push-pull-parser is declared.
2018 Discussed starting at
2019 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
2020 * data/bison.m4 (b4_pull_if): New.
2021 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
2022 * data/push.c: Improve M4 quoting a little.
2023 (b4_generate_macro_args, b4_parenthesize): Remove.
2024 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
2025 any time a pull parser is requested.
2026 Don't #define this as a wrapper around yypull_parse. Instead, when
2027 both push and pull are requested, make it a function that does that
2028 same thing.
2029 (yypull_parse): If there's a b4_prefix, #define this to
2030 b4_prefix[pull_parse] when both push and pull are requested.
2031 Don't define this as a function unless both push and pull are
2032 requested.
2033 Remove the yylexp argument and hard-code yylex invocation instead.
2034 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
2035 %push-parser.
2036 * src/getargs.c (pull_parser): New global initialized to true.
2037 * getargs.h (pull_parser): extern it.
2038 * src/output.c (prepare): Insert pull_flag muscle.
2039 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
2040 (prologue_declaration): Set both push_parser and pull_parser = true for
2041 %push-pull-parser. Set push_parser = true and pull_parser = false for
2042 %push-parser.
2043 * src/scan-gram.l: Don't accept %push_parser as an alternative to
2044 %push-parser since there's no backward-compatibility concern here.
2045 Scan %push-pull-parser.
2046 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
2047 instead of %push-parser.
2048 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
2049 prototype it in the module that calls yyparse.
2050 * tests/input.at (Torturing the Scanner): Likewise.
2051 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
2052
2e7944cb
JD
20532006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
2054
2055 Update etc/bench.pl. Optimize push mode a little (the yyn change
2056 deserves most of the credit).
2057 * Makefile.am (SUBDIRS): Add etc subdirectory.
2058 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
2059 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
2060 yytoken, yyval, and yyloc declarations to...
2061 (yyparse or yypush_parse): ... here to improve performance. For
2062 yypush_parse invocations after the first, be sure to assign yyn its old
2063 value again.
2064 (yypstate_new): Don't bother initializing the yyresult field since the
2065 initial value isn't used.
2066 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
2067 remove the #define that, in push mode, set it to yyps->NAME.
2068 * etc/Makefile.am: New.
2069 * etc/bench.pl: Remove and build it instead from...
2070 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
2071 "tests/bison" from the build directory by default rather than just
2072 invoking "bison" from $PATH.
2073 (calc_grammar): Update push parser code: don't declare yylval globally,
2074 don't define yyparse_wrapper, and don't #define yyparse.
2075 (bench_grammar): Update to check all working combinations of yacc.c,
2076 push.c, impure, pure, pull, and push.
2077
c3d50342
JD
20782006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2079
2080 For push mode, add pull wrappers around yypush_parse.
2081 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
2082 (yypull_parse): New function wrapping yypush_parse.
2083 (yyparse): New #define wrapping yypull_parse.
2084 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
2085 is declared.
2086 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
2087 prototype yylex in the module that calls yyparse, and don't prototype
2088 yyparse there. Otherwise, the yyparse expansion won't compile.
2089 * tests/input.at (Torturing the Scanner): Likewise.
2090
94ebeba5
JD
20912006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2092
2093 Enable push parsers to operate in impure mode. Thus, %push-parser no
2094 longer implies %pure-parser. The point of this change is to move
2095 towards being able to test the push parser code by running the entire
2096 test suite as if %push-parser had been declared.
2097 * data/push.c (yypush_parse): For impure mode, remove the
2098 yypushed_char, yypushed_val, and yypushed_loc arguments.
2099 Instead, declare these as local variables initialized to the global
2100 yychar, yylval, and yylloc.
2101 For the first yypush_parse invocation only, restore the initial values
2102 of these global variables when it's time to read a token since they
2103 have been overwritten.
2104 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
2105 %push-parser.
2106 * tests/calc.at (Simple LALR(1) Calculator): Always declare
2107 %pure-parser along with %push-parser since this test case was designed
2108 for pure push parsers.
2109 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
2110 (AT_YACC_OR_PUSH_IF): New.
2111 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
2112 add a note that it's still wrong for some cases (as it has been for a
2113 while).
2114 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
2115 %push-parser no longer implies %pure-parser.
2116
a0633178
JD
21172006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2118
2119 Remove some unnecessary differences between the pull parser code and
2120 the push parser code. This patch enables yynerrs in push mode.
2121 * data/push.c: Reformat M4 a little.
2122 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
2123 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
2124 because push mode is on. Instead, if pure mode is on, move yynerrs
2125 to...
2126 (b4_declare_parser_state_variables): ... here.
2127 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
2128 to yyps->NAME so it can be used in yypush_parse.
2129 (yypush_parse): Don't omit uses of yynerrs in push mode.
2130
8646b6a3
JD
21312006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2132
2133 Fix bug such that the first pushed token's value and location are
2134 sometimes overwritten (sometimes by %initial-action) before being used.
2135 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
2136 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
2137 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
2138 more closely mimic the pull parser logic.
2139 Don't copy the pushed token to yychar, yylval, and yylloc until it's
2140 time to read a token, which is after any initialization of yylval and
2141 yylloc.
2142 (gottoken): Rename label to...
2143 (yyread_pushed_token): ... for clarity and to avoid infringing on the
2144 user namespace.
2145
9baf4d74
JD
21462006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2147
2148 Rearrange initialization of the parser state variables so that the
2149 skeleton doesn't have to have a copy for pull mode and another for push
2150 mode. This patch also fixes at least a bug such that yylloc was not
2151 initialized (with b4_location_initial_line and
2152 b4_location_initial_column) upon calling yypush_parse. However, that
2153 initialization now overwrites the first token's location;
2154 %initial-action assigning @$ already did the same thing, and both bugs
2155 will be fixed in a later patch.
2156 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
2157 (b4_declare_parser_state_variables): Remove initialization of yytoken,
2158 yyss, yyvs, yyls, and yystacksize.
2159 (yypstate_new): Remove initialization of some yypstate fields: yystate,
2160 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
2161 yylsp.
2162 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
2163 yyps->NAME so it can be used in yypush_parse.
2164 (yyparse or yypush_parse): For yypush_parse, don't print the
2165 "Starting parse" diagnostic for invocations after the first.
2166 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
2167 yypush_parse, only do it for the first invocation.
2168 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
2169 initialization to occur in yypush_parse but only on the first
2170 invocation.
2171
23522164
JD
21722006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2173
2174 * data/push.c: Add CPP guards around push parser declarations in both
2175 the header and the code file.
2176 In the code file, move the push parser declarations to the same place
2177 they appear in the header file.
2178 Clean up the M4 some, especially the inconsistent underquoting in
2179 some b4_c_function_def and b4_c_function_decl uses.
2180
bb010fe5
JD
21812006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2182
2183 Encapsulate the push parser state variables into an M4 macro so the
2184 push skeleton doesn't have to list them again for pull mode's yyparse.
2185 For push mode, remove yypush_parse's local equivalents of these
2186 variables to eliminate unnecessary copying between the two sets at
2187 run-time. This patch also fixes at least a bug related to multiple
2188 %initial-action invocations in push mode.
2189 * data/push.c (b4_declare_parser_variables): Rename to...
2190 (b4_declare_scanner_communication_variables): ... this for clarity and
2191 update both uses.
2192 (b4_declare_yyparse_variables): Remove and move its contents to the one
2193 spot where it was invoked.
2194 (b4_declare_parser_state_variables): New macro containing the parser
2195 state variables required by push mode.
2196 (struct yypstate): Replace all fields but yynew with
2197 b4_declare_parser_state_variables.
2198 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
2199 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
2200 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
2201 (yyparse or yypush_parse): For yyparse in pull mode, replace local
2202 parser state variable declarations with
2203 b4_declare_parser_state_variables.
2204 Don't initialize parser state variables when calling yypush_parse since
2205 yypstate_new already does that.
2206 Invoke the user's initial action only upon the first yypush_parse
2207 invocation.
2208 Remove all code that copies between the local parser state variables
2209 and the yypstate.
2210
2d212f8c
JD
22112006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2212
2213 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
2214 prevent a name collision in a future patch where these names will
2215 sometimes be #define'd.
2216 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
2217 since it no longer has the same name as the existing argument.
2218 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
2219
e6e704dc
JD
22202006-12-19 Paolo Bonzini <bonzini@gnu.org>
2221 and Joel E. Denny <jdenny@ces.clemson.edu>
2222
2223 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2224 that the argument is case-insensitive, and there's no `=' here.
2225 For the %skeleton entry, mention that %language is better.
2226 (Bison Options): Likewise for --language and --skeleton. Move the
2227 --skeleton entry so that the `Tuning the parser' section is sorted
2228 alphabetically on long options.
2229 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
2230 %language directive in detail here; cross-reference the %language
2231 documentation instead.
2232 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
2233 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 2234 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
2235 * examples/extexi (normalize): Instead of replacing every %require
2236 argument with the current Bison version, just substitute for
2237 `@value{VERSION}'. This guarantees that we're testing what actually
2238 appears in the documentation.
2239 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
2240 rather than `@VERSION@'.
2241
0e021770
PE
22422006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2243
fd575f05
PE
2244 * NEWS: Reword the %language news a bit, and put it earlier.
2245
0e021770
PE
2246 * src/getargs.c (skeleton_arg): Last arg is now location const *.
2247 Rewrite to simplify the logic.
2248 (language_argmatch): Likewise.
fd575f05
PE
2249 (program_name): We now own this var.
2250 * src/getargs.h (struct bison_language): Use char[] rather than
2251 const char *.
0e021770
PE
2252
2253 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
2254 Java is supported.
2255 * src/complain.c (program_name): Remove decl; no longer needed.
2256 * src/main.c (program_name): Remove; now belongs to getargs.
2257
22582006-12-18 Paolo Bonzini <bonzini@gnu.org>
2259
2260 * NEWS: Document %language.
2261
2262 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
2263
2264 * data/c-skel.m4, data/c++-skel.m4: New files.
2265 * data/glr.c: Complain on push parsers.
2266
2267 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
2268 over %skeleton.
148d66d8 2269 (Decl Summary): Document %language and %skeleton.
0e021770
PE
2270 (Command line): Document -L.
2271
2272 * examples/extexi: Rewrite %require directive.
2273 * examples/calc++/Makefile.am: Pass VERSION to extexi.
2274
2275 * src/files.c (compute_exts_from_gc): Look in language structure
2276 for .y extension.
2277 (compute_file_name_parts): Check whether .tab should be added.
2278 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
2279 (language, skeleton_arg, language_argmatch): New.
2280 (long_options): Add --language.
2281 (getargs): Use skeleton_arg, add -L/--language.
2282 * src/getargs.h: Include location.h.
2283 (struct bison_language, language, skeleton_arg, language_argmatch): New.
2284 * src/output.c (prepare): Pick default skeleton from struct language.
2285 Don't dispatch C skeletons here.
2286 * src/parse-gram.y (PERCENT_LANGUAGE): New.
2287 (prologue_declaration): Add "%language" rule, use skeleton_arg.
2288 * src/scan-gram.l ("%language"): New rule.
2289
2290 * tests/calc.at: Test %skeleton and %language.
2291 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
2292 (AT_GLR_IF): Look for %skeleton "glr.cc".
2293 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
2294 (AT_YACC_IF): Reject %language.
2295
5691bf57
PE
22962006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2297
db06f0ce
PE
2298 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
2299 since it wasn't used; only the typedef name 'semantic_type' is needed.
2300 Also, omit trailing white space.
2301
5691bf57
PE
2302 * bootstrap: Sync from coreutils.
2303 (gnulib_extra_files): Add build-aux/announce.gen.
2304 (slurp): Adjust .gitignore files like .cvsignore files.
2305 * build-aux/announce-gen: Remove from CVS, since bootstrap
2306 now creates this.
2307
791934e4
JD
23082006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
2309
2310 Make %push-parser imply %pure-parser. This fixes several bugs; see
2311 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
2312 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
2313 pure_parser = true.
2314 * data/push.c: Don't bother testing b4_push_if when deciding whether
2315 to expand b4_declare_parser_variables globally.
2316 (yypush_parse): Likewise in here.
2317
2318 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
2319 (yy_reduce_print): Reformat M4 for readability.
2320
ee5abb37
JD
23212006-12-15 Bob Rossi <bob@brasko.net>
2322 and Joel Denny <jdenny@ces.clemson.edu>
2323
2324 * data/push.c (yypstate): Add typedef, and update all uses of
2325 struct yypstate to just yypstate.
2326 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
2327
16ca01f9
JD
23282006-12-14 Bob Rossi <bob@brasko.net>
2329
2330 * data/push.c (yypush_parse): Declare prototype regardless of
2331 %locations option.
2332
ab8e7e1a
JD
23332006-12-14 Bob Rossi <bob@brasko.net>
2334
2335 * data/push.c (yyparse): Remove the prototype and the #define when in
2336 push-parser mode.
2337
9bf32be3
JD
23382006-12-13 Bob Rossi <bob@brasko.net>
2339
2340 * data/push.c (yypstate_init): Rename to...
2341 (yypstate_new): ... this and use b4_c_function_def.
2342 (yypstate_delete): New.
2343 (yypush_parse): Change parameters yynval and yynlloc to be const.
2344 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
2345 yypstate_delete functions.
2346
f02e2948
JD
23472006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
2348
2349 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
2350 strange test case titles. Reported by Bob Rossi.
2351
38eb7751
PE
23522006-12-13 Paul Eggert <eggert@cs.ucla.edu>
2353
2354 * TODO: Add pointer to Sylvain Schmitz's work on static detection
2355 of potential ambiguities in GLR grammers.
2356
bd9d212b
JD
23572006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
2358
2359 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
2360 `bison ', use m4_index instead of m4_substr since chopping up a string
2361 containing M4-special characters causes problems here.
2362
2363 Fix a couple of bugs related to special characters in user-specified
2364 file names, and make it easier for skeletons to compute output file
2365 names with the same file name prefix as Bison-computed output file
2366 names.
2367 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
2368 b4_parser_file_name and b4_spec_defines_file instead of
2369 @output_parser_name@ and @output_header_name@, which are now redundant.
2370 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
2371 b4_parser_file_name, b4_spec_defines_file, and the new
2372 @basename(FILENAME@) instead of @output_parser_name@ and
2373 @output_header_name@, which inappropriately escaped the file names as
2374 C string literals.
2375 * src/files.c (all_but_ext): Remove static qualifier.
2376 (compute_output_file_names): Move `free (all_but_ext)' to...
2377 (output_file_names_free): ... here since all_but_ext is needed later.
2378 * src/files.h (all_but_ext): Extern.
2379 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
2380 exactly what MUSCLE_INSERT_STRING used to do.
2381 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
2382 characters are escaped properly.
2383 * src/output.c (prepare): Define muscle file_name_all_but_ext as
2384 all_but_ext.
2385 For pkgdatadir muscle, maintain previous functionality by using
2386 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
2387 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
2388 digraphs would never be expanded. Hopefully no one has M4-special
2389 characters in his Bison installation path.
2390 * src/scan-skel.l: Don't parse @output_header_name@ and
2391 @output_parser_name@ anymore since they're now redundant.
2392 In @output, use decode_at_digraphs.
2393 Parse a new @basename command that invokes last_component.
2394 (decode_at_digraphs): New.
2395 (BASE_QPUTS): Remove unused.
2396 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
2397 (Output file name): New tests.
2398
3f7ca628
JD
23992006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
2400
2401 Warn about output files that are generated by the skeletons and that
2402 conflict with other output files.
2403 * data/glr.c: Don't generate the header file here when glr.cc does.
2404 * src/files.c (file_names, file_names_count): New static globals.
2405 (compute_output_file_names): Invoke output_file_name_check for files
2406 not generated by the skeletons and remove existing checks.
2407 (output_file_name_check): New function that warns about conflicting
2408 output file names.
2409 (output_file_names_free): Free file_names.
2410 * src/files.h (output_file_name_check): Declare.
2411 * src/scan-skel.l: Invoke output_file_name_check for files generated by
2412 the skeletons.
2413 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
2414 (Conflicting output files): New tests.
2415
178e123e
PE
24162006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2417
2418 * doc/bison.texinfo: Fix a couple of typos.
2419
24202006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
2421
2422 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
2423 Rename to...
2424 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
2425 update all uses.
2426 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
2427 (yypush_parse): Rename yypvars argument to yyps and remove redundant
2428 local pv.
2429 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
2430 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
2431
ea17f233
JD
24322006-12-07 Bob Rossi <bob@brasko.net>
2433 and Joel Denny <jdenny@ces.clemson.edu>
2434
2435 * data/push.c (yypvarsinit): Change return type from void* to struct
2436 yypvars*. No longer cast to void* on return.
2437 (struct yypvars): Remove yylen since it need not be remembered between
2438 yypushparse invocations.
2439 (yypushparse): Don't copy between yylen and pv->yylen.
2440
55a30bda
JD
24412006-12-05 Bob Rossi <bob@brasko.net>
2442
2443 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
2444 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
2445 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
2446 (struct yypvars): Remove b4_declare_parser_variables.
2447 (yypvarsinit): Remove init code for removed variables.
2448 (global scope): Do not declare b4_declare_parser_variables if
2449 push or pure mode.
2450 (yypushparse): Add b4_declare_parser_variables.
2451 Init new local variables, and remove init code for removed
2452 yypvars variables.
2453 (yyparse): Delete.
2454 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
2455 and yyparse for other modes.
2456 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
2457 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
2458 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
2459 (AT_PURE_LEX_IF): True if pure or push parser.
2460
85894313
JD
24612006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
2462
2463 Document Yacc prologue alternatives and default %destructor's and
2464 %printer's as experimental. Don't mention Java yet. Discussed at
2465 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
2466 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
2467 (2.3a): Annotate this entry to say the old forms of these features were
2468 also experimental.
2469 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 2470 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
2471 of Java (we'll want this back eventually).
2472
02975b9a
JD
24732006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2474
2475 Support a file name argument to %defines. Deprecate `=' in
2476 %file-prefix, %name-prefix, and %output. Discussed at
2477 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
2478 * NEWS (2.3a+): Mention.
148d66d8 2479 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
2480 form of %defines, and remove `=' from entries for %file-prefix,
2481 %name-prefix, and %output.
2482 * src/parse-gram.y (prologue_declaration): Implement.
2483 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
2484 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
2485 all but one occurrence of %name-prefix.
2486 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
2487 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
2488 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
2489 occurrence of each of %file-prefix and %output. Add check for %defines
2490 with argument.
2491 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
2492 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
2493 Remove the `=' from %output.
2494
287b314e
JD
24952006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
2496
2497 Don't escape $ in test case titles since Autoconf 2.61 now does that
2498 correctly.
2499 * tests/actions.at (Default %printer and %destructor are not for error
2500 or $undefined): Here.
2501 (Default %printer and %destructor are not for $accept): Here.
2502 * tests/input.at (Invalid $n and @n): Here.
2503
3ebecc24
JD
25042006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
2505
2506 Rename <!> to <>. Discussed starting at
2507 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
2508 * NEWS (2.3a+): Update.
148d66d8 2509 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
2510 Update.
2511 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
2512 * src/scan-gram.l (INITIAL): Implement.
2513 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
2514 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
2515 comment.
2516 * tests/actions.at (Default tagless %printer and %destructor,
2517 Default tagged and per-type %printer and %destructor,
2518 Default %printer and %destructor are not for error or $undefined,
2519 Default %printer and %destructor are not for $accept,
2520 Default %printer and %destructor for mid-rule values): Update.
2521 * tests/input.at (Default %printer and %destructor redeclared,
2522 Unused values with default %destructor): Update.
2523
26b8a438
JD
25242006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2525
2526 Don't let %prec take a nonterminal.
2527 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
2528 token.
2529 * tests/input.at (%prec takes a token): New test checking that %prec
2530 won't take a nonterminal.
2531
07c39ae9
JD
25322006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2533
405d53b7
JD
2534 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
2535 it was double-quoted.
07c39ae9
JD
2536 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
2537 grammar is maintained with Bison's highest standards.
2538 * src/getargs.c: Fix some typos in Doxygen comments.
2539
580b8926
JD
25402006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2541
2542 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
2543 later. Reported by Paul Eggert in
2544 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
2545 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
2546 * src/scan-code.l (translate_action): Don't bother invoking
2547 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
2548 (code_scanner_free): Instead of invoking
2549 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
2550 which frees more.
2551 * src/scan-gram.l (gram_scanner_free): Likewise.
2552 * src/scan-skel.l (scan_skel): Likewise.
2553
4502eadc
JD
25542006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2555
2556 * src/files.c (tr): Change return type to void.
2557 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
2558 has been called previously for the same key.
2559 (muscle_find): Return storage instead of value so that
2560 --enable-gcc-warnings doesn't produce warnings that the return discards
2561 const. aver that the value and storage are the same since storage
2562 could potentially be NULL when value is not.
2563 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
2564 same as 0.
2565
7746c8f6
PE
25662006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2567
2568 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
2569 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
2570 us a slightly cleaner distribution, and also works.
2571 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
2572 gnulib changes.
2573
eb095650
PE
25742006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
2575 and Paul Eggert <eggert@cs.ucla.edu>
2576
2577 Don't let Bison leak memory except when it complains.
2578 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
2579 (spec_defines_file, dir_prefix): Now char *, not const char *,
2580 since they are freed.
2581 * src/files.c: Likewise.
2582 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
2583 Likewise.
2584 (tr): Now operates in-place. All uses changed.
2585 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
2586 values.
2587 (compute_file_name_parts, compute_output_file_names): Don't store
2588 read-only data in variables that will be freed.
2589 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
2590 src_extension, and header_extension.
2591 (output_file_names_free): New public function to free
2592 spec_verbose_file, spec_graph_file, spec_defines_file,
2593 parser_file_name, and dir_prefix.
2594 * src/getargs.c (getargs): Don't store read-only data in variables that
2595 will be freed.
2596 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
2597 (which previously existed but was unused), and quotearg_free.
2598 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
2599 * src/muscle_tab.c: Likewise.
2600 (muscle_entry): Make the value char const *,
2601 and add a new storage member that is char * and can be freed.
2602 (muscle_entry_free): New private function.
2603 (muscle_init): Use it instead of free.
2604 (muscle_insert, muscle_grow): Update and use new storage member.
2605 (muscle_code_grow): Free the string passed to muscle_grow
2606 since it's not needed anymore.
2607 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
2608 add a new `char *code' member.
2609 ("{...}"): Declare semantic type as code.
2610 * src/scan-code.h (translate_rule_action):
2611 (translate_symbol_action, translate_code, translate_action): Return
2612 `char const *' rather than `char *' since external code should not free
2613 these strings.
2614 * src/scan-code.l: Likewise.
2615 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
2616 which is "{...}" in the parser.
2617 * tests/Makefile.am (maintainer-check-valgrind): Set
2618 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
2619 Valgrind.
2620 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
2621 complain.
2622 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
2623 expecting a non-zero exit status sets --leak-check=summary and
2624 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
2625 this case, and we don't want to hear about it.
2626
ac564be4
PE
26272006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2628
2629 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
2630 instead of from the template, to simplify configuration a bit.
2631 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
2632 and m4/wint_t.m4, as they are needed with the latest gnulib.
2633
17bd8a73
JD
26342006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2635
2636 Disable unset/unused mid-rule value warnings by default, and recognize
2637 --warnings=midrule-values to enable them. Discussed starting at
2638 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
2639 * NEWS (2.3a+): Mention.
2640 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
2641 warnings): Add entry for midrule-values subargument.
2642 * src/reader.c (symbol_should_be_used): Don't return true just because
2643 the value is a set/used mid-rule value unless
2644 --warnings=midrule-values was specified.
2645 * tests/input.at (Unused values, Unused values before symbol
2646 declarations): Run tests with and without --warnings=midrule-values.
2647
2648 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
2649 than LIST_FREE directly.
2650
89eb3c76
JD
26512006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2652
2653 Finish implementing --warnings=error, which should not be implied by
2654 --warnings=all (or by its synonyms -W and --warnings without
2655 subarguments).
2656 * src/complain.c (set_warning_issued): New function to report that
2657 warnings are being treated as errors and to record an error if so.
2658 Invoke...
2659 (warn_at, warn): ... here.
2660 * src/getargs.c (warnings_args, warnings_types): Reorder so that
2661 "error - warnings are errors" does not appear above "all - all of the
2662 above".
2663 (getargs): For -W and --warnings without subarguments, don't let
2664 FLAGS_ARGMATCH set warnings_error in warnings_flag.
2665 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
2666
ba7560e2
JD
26672006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2668
2669 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
2670 empty subargument list. For example: `bison --warnings= parser.y'.
2671
31283fc3
JD
26722006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2673
2674 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
2675 the parser header file so that gcc doesn't warn.
2676
12e35840
JD
26772006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2678
2679 Split the default %destructor/%printer into two kinds: <*> and <!>.
2680 Discussed starting at
2681 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
2682 * NEWS (2.3a+): Mention.
2683 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
2684 previous change today related to mid-rules.
148d66d8 2685 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 2686 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
2687 (TYPE_TAG_ANY): Add as <*>.
2688 (TYPE_TAG_NONE): Add as <!>.
2689 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
2690 for <*> and <!>.
2691 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
2692 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
2693 * src/symlist.c (symbol_list_default_new): Split into tagged and
2694 tagless versions.
2695 (symbol_list_destructor_set, symbol_list_printer_set): Split
2696 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
2697 SYMLIST_DEFAULT_TAGLESS.
2698 * src/symlist.h: Update symbol_list_default*_new prototypes.
2699 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
2700 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
2701 * src/symtab.c (default_destructor, default_destructor_location,
2702 default_printer, default_printer_location): Split each into tagged and
2703 tagless versions.
2704 (symbol_destructor_get, symbol_destructor_location_get,
2705 symbol_printer_get, symbol_printer_location_get): Implement tagged
2706 default and tagless default cases.
2707 (default_destructor_set, default_printer_set): Split each into tagged
2708 and tagless versions.
2709 * src/symtab.h: Update prototypes.
2710 * tests/actions.at (Default %printer and %destructor): Rename to...
2711 (Default tagless %printer and %destructor): ... this, and extend.
2712 (Per-type %printer and %destructor): Rename to...
2713 (Default tagged and per-type %printer and %destructor): ... this, and
2714 extend.
2715 (Default %printer and %destructor for user-defined end token): Extend.
2716 (Default %printer and %destructor are not for error or $undefined):
2717 Update.
2718 (Default %printer and %destructor are not for $accept): Update.
2719 (Default %printer and %destructor for mid-rule values): Extend.
2720 * tests/input.at (Default %printer and %destructor redeclared): Extend.
2721 (Unused values with default %destructor): Extend.
2722
f91b1629
JD
27232006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2724
2725 Don't apply the default %destructor/%printer to an unreferenced midrule
2726 value. Mentioned at
2727 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
2728 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
2729 like $@n instead of just @n so that the default %destructor/%printer
2730 logic doesn't see them as user-defined symbols.
2731 (symbol_is_dummy): Check for both forms of the name.
2732 * src/reader.c (packgram): Remove the `$' from each midrule symbol
2733 name for which the midrule value is referenced in any action.
2734 * tests/actions.at (Default %printer and %destructor for mid-rule
2735 values): New test.
2736 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
2737 for change to dummy symbol names.
2738
519d0004
JD
27392006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2740
2741 Warn about unset midrule $$ if the corresponding $n is used.
2742 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
2743 $n usage.
2744 (packgram): Before invoking grammar_rule_check on any rule, make sure
2745 all actions have already been scanned in order to set `used' flags.
2746 Otherwise, checking that a midrule's $$ is set will not always work
2747 properly because the midrule check must forward-reference the midrule's
2748 parent rule.
2749 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
2750 warning.
2751
a501eca9
JD
27522006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2753
2754 More improvements to the documentation of the prologue alternatives:
2755 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
2756 Bison manual.
2757 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
2758 some text to clarify the relative importance of the new directives and
2759 to show how these directives may be viewed as code labels.
2760
2cbe6b7f
JD
27612006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
2762
2763 Similar to the recently removed %before-header, add %code-top as the
2764 alternative to the pre-prologue. Mentioned at
2765 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
2766 Also, let the prologue alternatives appear in the grammar section.
2767 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
2768 (prologue_declaration): Move the existing prologue alternatives to...
2769 (grammar_declaration): ... here and add %code-top.
2770 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
2771
2772 Clean up and extend documentation for the prologue alternatives.
2773 * NEWS (2.3a+): Describe prologue alternatives.
2774 * doc/bison.texinfo (Prologue): Move discussion of prologue
2775 alternatives to...
2776 (Prologue Alternatives): ... this new section, and extend it to discuss
2777 all 4 directives in detail.
148d66d8
JD
2778 (Table of Symbols): Clean up discussion of prologue alternatives and
2779 add %code-top.
2cbe6b7f 2780
e557d3ea
JMG
27812006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2782
2783 DJGPP specific issues.
2784
2785 * djgpp/config.bat: config.hin has been moved to lib. Adjust
2786 config.bat accordingly.
2787 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
2788 * djgpp/config.site: Likewise.
2789
136a0f76
PB
27902006-10-16 Paolo Bonzini <bonzini@gnu.org>
2791
27bd5d67
PB
2792 Replace %*-header with %provides, %requires, %code. See discussion at
2793 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
2794
136a0f76
PB
2795 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
2796 (b4_user_start_header): Remove.
2797 * data/glr.c: Use new macros instead of b4_*start_header
2798 and b4_*end_header.
2799 * data/glr.cc: Likewise.
2800 * data/lalr1.cc: Likewise.
2801 * data/push.c: Likewise.
2802 * data/yacc.c: Likewise.
2803
2804 * doc/bison.texinfo: Remove %before-header, rename
2805 %{start,end,after}-header to %requires, %provides, %code.
2806
2807 * src/parse-gram.y: Likewise (also rename token names accordingly).
2808 * src/scan-gram.l: Likewise.
2809 * tests/actions.at: Likewise.
2810
10f429ef
PE
28112006-10-14 Paul Eggert <eggert@cs.ucla.edu>
2812
2813 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
2814 Problem reported by Joel E. Denny.
2815
28162006-10-14 Jim Meyering <jim@meyering.net>
2817
2818 (Sync from coreutils.)
2819 Work also when the working directory (with e.g. coreutils sources)
2820 is version controlled with git, rather than CVS.
2821 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
2822 rather than CVS.
2823 In messages and comments, say e.g., "checked-out sources",
2824 rather than "CVS sources".
2825 (version_controlled_file): New function. Work for git as well as
2826 for CVS. Don't use grep's -q option.
2827 (slurp): Call it here, in place of CVS-specific code.
2828
c4bd5bf7
JD
28292006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
2830
2831 Fix testsuite for ./configure --enable-gcc-warnings:
2832 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
2833 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
2834 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
2835 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
2836 * test/regression.at (Diagnostic that expects two alternatives):
2837 Likewise.
2838
46356ea4
PE
28392006-10-12 Paul Eggert <eggert@cs.ucla.edu>
2840
231ed89a
PE
2841 * bootstrap.conf (gnulib_modules): Add config-h.
2842 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
2843 worry about HAVE_CONFIG_H.
2844 * lib/abitset.c: Likewise.
2845 * lib/bitset.c: Likewise.
2846 * lib/bitset_stats.c: Likewise.
2847 * lib/bitsetv-print.c: Likewise.
2848 * lib/bitsetv.c: Likewise.
2849 * lib/ebitset.c: Likewise.
2850 * lib/get-errno.c: Likewise.
2851 * lib/lbitset.c: Likewise.
2852 * lib/subpipe.c: Likewise.
2853 * lib/timevar.c: Likewise.
2854 * lib/vbitset.c: Likewise.
2855 * lib/bitset.c: Include "bitset.h" first, to test interface.
2856 * lib/bitset_stats.c: Include "bitset_stats.h" first.
2857 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
2858 * lib/bitsetv.c: Include "bitsetv.h" first.
2859 * lib/get-errno.c: Include "get-errno.h" first.
2860 * m4/.cvsignore: Add config-h.m4.
2861 * tests/actions.at (Default %printer and %destructor for ...):
2862 Adjust expected line numbers in output to reflect removal of #if
2863 HAVE_CONFIG_H lines.
2864 * tests/glr-regression.at (Missed %merge type warnings when ...):
2865 Likewise.
2866 * tests/regression.at (Braced code in declaration in rules section):
2867 Likewise.
2868 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
2869 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
2870 Include <config.h> unconditionally.
2871
46356ea4
PE
2872 * bootstrap: Sync from coreutils, as follows:
2873
2874 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2875
2876 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
2877 variable was sometimes used without being initialized. This
2878 messed up the installation of the INSTALL file in some cases.
2879
2880 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2881
2882 * bootstrap (usage, main program, symlink_to_gnulib): Add option
2883 --copy. Inspired by a suggestion from Bruno Haible.
2884
2885 2006-10-03 Jim Meyering <jim@meyering.net>
2886
2887 * bootstrap: Undo last change to this file, since now gnulib-tool
2888 sticks with the automake default in generating dependencies.
2889
dd4bf078
PE
28902006-10-12 Paul Eggert <eggert@cs.ucla.edu>
2891
cf2a5f7c
PE
2892 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
2893 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
2894
2895 * doc/bison.1: Add copyright notice.
2896
2897 * data/glr.c: Don't include <stdarg.h>; not used.
2898
35fe0834
PE
2899 * NEWS: The -g and --graph options now output graphs in Graphviz
2900 DOT format, not VCG format.
2901 * doc/bison.1: Likewise.
2902 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
2903 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
2904 of this change in
2905 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
2906 * TODO: Remove Graphviz entry.
2907 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
2908 remove vcg.c, vcg.h, vcg_defaults.h.
2909 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
2910 * src/graphviz.c, src/graphviz.h: New files.
2911 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
2912 * src/files.h: Make comment more generic.
2913 * src/main.c (main): Likewise.
2914 * src/print_graph.h: Likewise.
2915 * src/getargs.c (usage): Make usage description more generic.
2916 * src/print_graph.c: Include graphviz.h rather than vcg.h.
2917 (static_graph, fgraph): Remove. All uses changed to pass
2918 arguments instead of sharing a static var.
2919 (print_core, print_actions, print_state, print_graph):
2920 Output graphviz format rather than VCG format.
2921 * tests/.cvsignore: Remove *.vcg; add *.dot.
2922 * tests/output.at: Expect *.dot files, not *.vcg files.
2923
dd4bf078
PE
2924 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
2925 accommodates the 2006-10-08 change.
2926
efdd7421
PE
29272006-10-11 Bob Rossi <bob@brasko.net>
2928
2929 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
2930 (b4_yyssa, b4_yyerror_range): New macros.
2931 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
2932 (yypvarsinit): Remove init of removed fields.
2933 (yypushparse): Remove use of removed fields; use new macros instead.
2934
96a1981a
PE
29352006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2936
2937 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
2938 in a push parser. Reindent slightly to match yacc.c better.
2939
29402006-10-11 Bob Rossi <bob@brasko.net>
2941
46356ea4
PE
2942 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
2943 yymsg_alloc fields.
2944 (yypvarsinit, yypushparse): Remove init of removed fields.
2945 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 2946
c1630a8b
PE
29472006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2948
2949 * THANKS: Add Paolo Bonzini and Bob Rossi.
2950
90b9908d
PB
29512006-10-08 Paolo Bonzini <bonzini@gnu.org>
2952
2953 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
2954 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
2955 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
2956 b4_define_user_cde and uses): Remove.
2957 (b4_comment, b4_prefix, b4_sync_start): New.
2958 * data/bison.m4: New file, with most of the content removed from c.m4.
2959 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
2960 * src/output.c (output_skeleton): Pass bison.m4.
2961 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
2962 only if specified.
2963
cf806753
PE
29642006-10-05 Paul Eggert <eggert@cs.ucla.edu>
2965
2966 Fix test failure reported by Tom Lane in
2967 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
2968 and try to make such failures easier to catch in the future.
2969 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
2970 that's now the caller's responsibility.
2971 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
2972 Set yychar = YYEOF if it's negative.
2973 * tests/actions.at (yylex): Abort if asked to read past EOF.
2974 * tests/conflicts.at (yylex): Likewise.
2975 * tests/cxx-type.at (yylex): Likewise.
2976 * tests/glr-regression.at (yylex): Likewise.
2977 * tests/input.at (yylex): Likewise.
2978 * tests/regression.at (yylex): Likewise.
2979 * tests/torture.at (yylex): Likewise.
2980
0e2f006a
PE
29812006-10-01 Paul Eggert <eggert@cs.ucla.edu>
2982
2983 Fix problems with translating English-language diagnostics.
2984 * bootstrap: Fix bug introduced in recent bootstrap changes, with
2985 respect to bison-runtime pot generation. The YY_ stuff
2986 wasn't being captured.
2987 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
2988 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
2989 * runtime-po/POTFILES.in: Add data/push.c.
2990
e3ddc1e3
PE
29912006-09-29 Paul Eggert <eggert@cs.ucla.edu>
2992
2993 Merge bootstrap changes from coreutils.
2994
2995 2006-09-28 Jim Meyering <jim@meyering.net>
2996
2997 Automatically generated dependencies are important even
2998 when all of the sources in a directory come from gnulib.
2999 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
3000 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
3001
3002 2006-09-23 Jim Meyering <jim@meyering.net>
3003
3004 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
3005
3006 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3007
3008 * bootstrap: Add support for --force.
3009 (usage): New function. Describe usage less tersely.
3010 (CVS_only_file): New var.
3011
01e972b3
PE
30122006-09-21 Paul Eggert <eggert@cs.ucla.edu>
3013
3014 * data/push.c (YYPUSH_MORE): Make it an enum instead.
3015 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
3016 Adjust white space and comments to match GNU style better.
3017
c63d3e90
PE
30182006-09-20 Bob Rossi <bob@brasko.net>
3019
3020 * data/push.c (yyresult_get): Remove function.
3021 (YYPUSH_MORE): Add #define.
3022 (yypushparse): Modify return value.
3023
e70f46d1
PE
30242006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3025
3026 * stamp-h.in: Remove; no longer needed.
3027 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
3028 Remove config.h, config.hin, intl (no longer created).
3029 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
3030 stamp-h1.
3031
3032 Sync bootstrap from coreutils, as follows:
3033
3034 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
3035
3036 * bootstrap (symlink_to_gnulib): New function.
3037 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
3038 to copies-of-gnulib.
3039 (cp_mark_as_generated, slurp, gnulib_files):
3040 Avoid making a copy if it's the same as the old version.
3041 (gnulib_files): Add support for this variable (used by Bison).
3042
a92be413
PE
30432006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3044
3045 * src/getargs.c (usage): Rework to use conventions similar to
3046 coreutils, to make translation a bit easier and the code a bit
3047 smaller. Problem reported by Tim Van Holder.
3048
4f82b42a
PE
30492006-09-15 Paul Eggert <eggert@cs.ucla.edu>
3050
3b2942e6
PE
3051 Use some of gnulib's new modules, taken from coreutils.
3052
3053 * bootstrap: Sync from coreutils, except add support for gnulib_files.
3054 * bootstrap.conf: New file.
3055 (gnulib_modules): Add configmake, inttypes, unistd.
3056 (XGETTEXT_OPTIONS): Add complain, complain_at,
3057 fatal, fatal_at, warn, warn_at, unexpected_end.
3058 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
3059 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
3060 (gl_EARLY): Add.
3061 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
3062 (gl_INIT): Add
3063 (GNULIB_AUTOCONF_SNIPPET): Remove.
3064 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
3065 the pickiest.
3066 * lib/.cvsignore: Add inttypes_.h.
3067 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
3068 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
3069 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
3070 no-longer-necessary initializations.
3071 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
3072 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
3073 use the unistd module.
3074 * src/system.h: Likewise.
3075 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
3076 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
3077 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
3078 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
3079 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
3080 * src/system.h: Include inttypes.h unconditionally, now that we
3081 use the inttypes module. Don't bother to include stdint.h, since
3082 inttypes.h now does that for us.
3083 (LOCALEDIR): Remove, now that we use the configmake module.
3084 * src/getargs.c: Include configmake.h.
3085 * src/main.c: Likewise.
3086 * src/output.c: Likewise.
3087 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
3088 not from $abs_top_builddir, since config.h moved.
3089
3090
4f82b42a
PE
3091 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
3092 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
3093
3094 * src/parse-gram.y (symbol_declaration): Don't put statements
3095 before declarations; it's not portable to C89.
3096 * src/scan-code.l (handle_action_at): Likewise.
3097
3098 * src/scan-code.l: Always initialize braces_level; the old code
3099 left it uninitialized and therefore had undefined behavior.
3100
3101 Don't attempt to redefine 'assert', since it runs afoul of
3102 systems where standard headers (mistakenly) include <assert.h>.
3103 Instead, define and use our own alternative, called 'aver'.
3104 * src/reader.c: Don't include assert.h, since we no longer
3105 use assert.
3106 * src/scan-code.l: Likewise.
3107 * src/system.h (assert): Remove, replacing with....
3108 (aver): New function, taking a bool arg. All uses changed.
3109 * src/tables.c (pack_vector): Ensure that aver arg is bool,
3110 not merely an integer.
3111
31c10e38
PE
31122006-09-15 Bob Rossi <bob@brasko.net>
3113
3114 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
3115 * data/c.m4 (YYPUSH): New.
3116 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
3117 * src/getargs.c (push_parser): New var.
3118 * src/getargs.h (push_parser): New declaration.
3119 * src/output.c (prepare): Add macro insertion of `push_flag'.
3120 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
3121 (prologue_declaration): Parse %push-parser.
3122 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
3123 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
3124 list of removed lines from the traces observed.
3125 (AT_CHECK_CALC_LALR): Added push parser tests.
3126
fa7b79c0
PE
31272006-09-13 Paul Eggert <eggert@cs.ucla.edu>
3128
21fe08ca
PE
3129 * NEWS: Version 2.3a.
3130 * configure.ac (AC_INIT): Likewise.
3131
e8ec4d9b
PE
3132 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
3133 "#define YYSTYPE int" that caused "make maintainer-check" to fail
3134 due to header ordering dependencies. I don't know why the #define
3135 was there.
3136
fa7b79c0
PE
3137 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
3138 runtime cost when YYDEBUG is not defined, and so that some tests
3139 that used to fail now work. Problem and initial suggestion by
3140 Paolo Bonzini.
3141 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
3142 * data/glr.cc (b4_parser_class_name):
3143 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
3144 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
3145 (yydebug_) [YYDEBUG]: New member.
3146 (yycdebug_): Now defined only if YYDEBUG.
3147 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
3148 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
3149 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
3150 if YYYDEBUG.
3151 (debug_stream, set_debug_stream, debug_level, set_debug_level):
3152 Define only if YYDEBUG.
3153 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
3154 set_debug_level.
3155 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
3156 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
3157 AT_CHECK_CALC_GLR_CC that are working now.
3158
4ec13d60
PE
31592006-09-12 Paul Eggert <eggert@cs.ucla.edu>
3160
3161 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
3162 We don't need them in glr.cc, and glr.c defines them.
3163 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
3164 assumes that defining it to anything is the same as defining
3165 it to 1. Problem reported by Paolo Bonzini.
3166
8e1687ae
PE
31672006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
3168
3169 * data/c.m4 (b4_null, b4_case): Define.
3170 * src/output.c (prepare_symbols): Use b4_null.
3171 (user_actions_output): Use b4_case.
3172
3dc5e96b
PE
31732006-09-11 Paul Eggert <eggert@cs.ucla.edu>
3174
aef3da86
PE
3175 * data/glr.c (b4_shared_declarations): Put start-header first,
3176 before any #includes that we generate, so that feature-test
3177 macros work. Problem reported by Michael Deutschmann in
3178 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
3179 * data/lalr1.cc: Likewise.
3180 * doc/bison.texinfo (Prologue): Document that feature-test macros
3181 should be defined before any Bison declarations.
3182 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
3183 that depend on location.hh after, not before, Bison decls, since
3184 we now include location.hh after the first user prologue.
3185
3dc5e96b
PE
3186 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
3187 Sander Brandenburg in
3188 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
3189 Also, fix minor white space and comment issues.
aef3da86
PE
3190 (Prologue): Mention that it's better to define feature-test macros
3191 before Bison declarations. Problem reported by Michael Deutschmann.
3192
3193 * README-cvs: Fix typo: "&" should be "&&". Problem reported
3194 by Jim Meyering.
3195 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
3196 This adjusts to recent gnulib changes.
3dc5e96b 3197
b2a0b7ca
JD
31982006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3199
3200 Finish implementation of per-type %destructor/%printer. Discussed
3201 starting at
3202 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
3203 and
3204 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
3205 * NEWS (2.3+): Add a description of this feature to the default
3206 %destructor/%printer description.
3207 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
3208 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3209 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
3210 list node contains a semantic type.
3211 * src/symtab.c, src/symtab.h: Extend with a table that associates
3212 semantic types with their %destructor's and %printer's.
3213 (semantic_type_from_uniqstr, semantic_type_get,
3214 semantic_type_destructor_set, semantic_type_printer_set): New functions
3215 composing the public interface of that table.
3216 (symbol_destructor_get, symbol_destructor_location_get,
3217 symbol_printer_get, symbol_printer_location_get): If there's no
3218 per-symbol %destructor/%printer, look up the per-type before trying
3219 the default.
3220 * tests/actions.at (Per-type %printer and %destructor): New test case.
3221 * tests/input.at (Default %printer and %destructor redeclared):
3222 Extend to check that multiple occurrences of %symbol-default in a
3223 single %destructor/%printer declaration is an error.
3224 (Per-type %printer and %destructor redeclared, Unused values with
3225 per-type %destructor): New test cases.
3226
3be03b13
JD
32272006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3228
3229 Require default %destructor/%printer to be declared using
3230 %symbol-default instead of an empty symbol list, and start working on
3231 new per-type %destructor/%printer. Discussed at
3232 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
3233 * NEWS (2.3+): Add %symbol-default to example.
3234 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 3235 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
3236 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
3237 (generic_symlist, generic_symlist_item): New nonterminals for creating
3238 a list in which each item is a symbol, semantic type, or
3239 %symbol-default.
3240 (grammar_declaration): Use generic_symlist in %destructor and %printer
3241 declarations instead of symbols.1 or an empty list.
3242 (symbol_declaration, precedence_declaration, symbols.1): Update actions
3243 for changes to symbol_list.
3244 * src/reader.c: Update for changes to symbol_list.
3245 * src/scan-code.l: Likewise.
3246 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
3247 * src/symlist.c, src/symlist.h: Extend such that a list node may
3248 represent a semantic type or a %symbol-default in addition to just an
3249 ordinary symbol. Add switched functions for setting %destructor's and
3250 %printer's.
3251 * tests/actions.at, tests/input.at: Add %symbol-default to all default
3252 %destructor/%printer declarations.
3253
3508ce36
JD
32542006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
3255
3256 Whether the default %destructor/%printer applies to a particular symbol
3257 isn't a question of whether the user *declares* that symbol (in %token,
3258 for example). It's a question of whether the user by any means
3259 *defines* the symbol at all (by simply using a char token, for
3260 example). $end is defined by Bison whereas any other token with token
3261 number 0 is defined by the user. The error token is always defined by
3262 Bison regardless of whether the user declares it with %token, but we
3263 may one day let the user define error as a nonterminal instead.
3264 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
3265 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
3266 the meaning of "user-defined".
3267 * tests/actions.at (Default %printer and %destructor for user-declared
3268 end token): Rename to...
3269 (Default %printer and %destructor for user-defined end token): ...
3270 this.
3271
3272 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
3273 computation of whether to apply the default, don't maintain a list of
3274 every Bison-defined symbol. Instead, just check for a first character
3275 of '$', which a user symbol cannot have, and check for the error token.
3276
9350499c
JD
32772006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
3278
3279 Don't apply the default %destructor or %printer to the error token,
3280 $undefined, or $accept. This change fits the general rule that the
3281 default %destructor and %printer are only for user-declared symbols,
3282 and it solves several difficulties that are described in the new test
3283 cases listed below.
3284 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
3285 * tests/actions.at (Default %printer and %destructor are not for error
3286 or $undefined, Default %printer and %destructor are not for $accept):
3287 New test cases.
3288
4d7370cb
JD
32892006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
3290
3291 Allow %start after the first rule.
3292 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
3293 when parsing the first rule.
3294 (check_and_convert_grammar): Search for it here after all grammar
3295 declarations have been parsed. Skip midrules, which have dummy LHS
3296 nonterminals.
3297 * src/symtab.c (symbol_is_dummy): New function.
3298 * src/symtab.h (symbol_is_dummy): Declare it.
3299 * tests/input.at (%start after first rule): New test.
3300
6d0ef4ec
JD
33012006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3302
3303 Redo some of the previous commit: add back the ability to use
3304 non-aliased/undeclared string literals since it might be useful to
3305 those declaring %token-table.
3306 * src/reader.c (check_and_convert_grammar): Undo changes in previous
3307 commit: don't worry about complaints from symbols_pack.
3308 * src/symtab.c (symbol_new, symbol_class_set,
3309 symbol_check_alias_consistency): Undo changes in previous commit: count
3310 each string literal as a new symbol and token, assign it a symbol
3311 number, and don't complain about non-aliased string literals.
3312 (symbols_pack): Since symbol_make_alias still does not decrement symbol
3313 and token counts but does still set aliased tokens to the same number,
3314 symbol_pack_processor now leaves empty slots in the symbols array.
3315 Remove those slots.
3316 * tests/regression.at (Undeclared string literal): Remove test case
3317 added in previous commit since non-aliased string literals are allowed
3318 again.
3319 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
3320 remove unnecessary string literal declarations.
3321 * tests/sets.at (Firsts): Likewise.
3322
965537bc
JD
33232006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3324
3325 Don't allow an undeclared string literal, but allow a string literal to
3326 be used before its declaration.
3327 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
3328 symbols_pack complained.
3329 * src/symtab.c (symbol_new): Don't count a string literal as a new
3330 symbol.
3331 (symbol_class_set): Don't count a string literal as a new token, and
3332 don't assign it a symbol number since symbol_make_alias does that.
3333 (symbol_make_alias): It's not necessary to decrement the symbol and
3334 token counts anymore. Don't assume that an alias declaration occurs
3335 before any uses of the identifier or string, and thus don't assert that
3336 one of them has the highest symbol number so far.
3337 (symbol_check_alias_consistency): Complain if there's a string literal
3338 that wasn't declared as an alias.
3339 (symbols_pack): Bail if symbol_check_alias_consistency failed since
3340 symbol_pack asserts that every token has been assigned a symbol number
3341 although undeclared string literals have not.
3342 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 3343 string literal): New test cases.
965537bc
JD
3344 (Characters Escapes, Web2c Actions): Declare string literals as
3345 aliases.
3346 * tests/sets.at (Firsts): Likewise.
3347
47aee066
JD
33482006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
3349
3350 In the grammar scanner, STRING_FINISH unclosed constructs and return
3351 them to the parser in order to improve error messages.
3352 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
3353 SC_BRACED_CODE, SC_PROLOGUE): Implement.
3354 * tests/input.at (Unclosed constructs): New test case.
3355 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
3356 seen.
3357
3358 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
3359 unused global.
3360
1f6b3679
JD
33612006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
3362
3363 Handle string aliases for character tokens correctly.
3364 * src/symtab.c (symbol_user_token_number_set): If the token has an
3365 alias, check and set its alias's user token number instead of its own,
3366 which is set to indicate the alias. Previously, every occurrence of
3367 the character token in the grammar overwrote that alias indicator with
3368 the character code.
3369 * tests/input.at (String aliases for character tokens): New test.
3370
219741d8
JD
33712006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
3372
3373 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
3374
11daa4e7
PE
33752006-08-11 Paul Eggert <eggert@cs.ucla.edu>
3376
3377 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
3378 to prevent failures when building on older platforms.
3379 Check for autopoint failure.
3380 Set XGETTEXT_OPTIONS to values that check for C format strings,
3381 so that translators are warned about them (this also helps
3382 prevent core dumps).
3383
3384 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
3385 function, since it simplifies our code a bit.
3386
3387 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
3388 rather than -W, so we don't get bogus warnings about sign comparisons.
3389 Add -Wpointer-arith, since that warning is useful (it reports code
3390 that does not conform to C89 and that some compilers reject).
3391 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
3392 since it's no longer needed.
3393
f9bfc42a
JD
33942006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
3395
3396 Clean up scanners a bit.
3397 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
3398 definitions so gcc won't warn when obstack_for_string is unused.
3399 * src/scan-code.l: config.h and system.h are already #include'd by
3400 scan-code-c.c, so get rid of them here.
3401 * src/scan-gram.l: Likewise.
3402 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
3403 definitions rather than duplicating the rest of it.
3404 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
3405
06e8700a
JD
34062006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
3407
3408 Suppress signed/unsigned comparison warnings for yycheck.
3409 * data/c.m4 (b4_safest_int_type): New macro.
3410 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
3411 a signed int type, cast it to b4_safest_int_type first.
3412 * data/yacc.c: Likewise.
3413 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
3414 also overwritten.
3415
9c437126
PE
34162006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3417
3418 * doc/bison.texinfo: Fix some typos.
3419
284d8a13
PE
34202006-08-02 Paul Eggert <eggert@cs.ucla.edu>
3421
3422 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
3423 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
3424
3425 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
3426 the latest gnulib does this a different way.
3427 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
3428 translation was patched, so stop omitting it.
3429
ec5479ce
JD
34302006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3431
3432 Enable declaration of default %printer/%destructor. Make the parser
3433 use these for all user-declared grammar symbols for which the user does
3434 not declare a specific %printer/%destructor. Thus, the parser uses it
3435 for token 0 if the user declares it but not if Bison generates it as
3436 $end. Discussed starting at
3437 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
3438 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
3439 and
3440 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
3441 * NEWS (2.3+): Mention.
3442 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
3443 declare a %destructor for a mid-rule's semantic value. It's just
3444 impossible to declare one specific to it.
3445 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
3446 code. Describe default %destructor form.
3447 * src/parse-gram.y (grammar_declaration): Parse default
3448 %printer/%destructor declarations.
3449 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
3450 and symbol_destructor_location_get rather than accessing the destructor
3451 and destructor_location members of struct symbol.
3452 (symbol_printers_output): Likewise but for %printer's.
3453 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
3454 again.
3455 * src/symtab.c (default_destructor, default_destructor_location,
3456 default_printer, default_printer_location): New static global
3457 variables to record the default %destructor and %printer.
3458 (symbol_destructor_get, symbol_destructor_location_get,
3459 symbol_printer_get, symbol_printer_location_get): New functions to
3460 compute the appropriate %destructor and %printer for a symbol.
3461 (default_destructor_set, default_printer_set): New functions to set the
3462 default %destructor and %printer.
3463 * src/symtab.h: Prototype all those new functions.
3464 * tests/actions.at (Default %printer and %destructor): New test to
3465 check that the right %printer and %destructor are called, that they're
3466 not called for $end, and that $$ and @$ work correctly.
3467 (Default %printer and %destructor for user-declared end token): New
3468 test to check that the default %printer and %destructor are called for
3469 a user-declared end token.
3470 * tests/input.at (Default %printer and %destructor redeclared, Unused
3471 values with default %destructor): New tests to check related grammar
3472 warnings and errors.
3473
868d2d96
JD
34742006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3475
3476 Clean up handling of %destructor for the end token (token 0).
3477 Discussed starting at
3478 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
3479 and
3480 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
3481
3482 Make the skeletons consistent in how they pop the end token and invoke
3483 its %destructor.
3484 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
3485 state, which has token number 0, since this would invoke the
3486 %destructor for the end token.
3487 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
3488 until after shifting the end token, or else it won't be popped.
3489 * data/yacc.c (yyparse): Likewise.
3490
3491 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
3492 it's the end token. Upon termination, destroy an unshifted lookahead
3493 even when it's the end token.
3494 * data/lalr1.cc (yy::parser::parse): Likewise.
3495 * data/yacc.c (yyparse): Likewise.
3496
3497 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
3498 value warnings for the end token when the user gives the end token a
3499 %destructor.
3500
3501 * tests/actions.at (Printers and Destructors): Test all the above.
3502
62a9592d
PE
35032006-07-24 Paul Eggert <eggert@cs.ucla.edu>
3504
3505 Update to latest gnulib and gettext versions.
3506 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
3507 Add fopen-safer.
3508 (gnulib_files): Add m4/warning.m4. Don't worry about files
3509 overwritten by autopoint.
3510 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
3511 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
3512 rejects them.
3513 Don't use autoreconf; instead, invoke autopoint etc. by hand,
3514 so that we can remove the intl files at a better time.
3515 (intl_files_to_remove): Remove aclocal.m4, since it gets
3516 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
3517 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
3518 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
3519 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
3520 Remove datarootdir hack; no longer needed.
3521 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
3522 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
3523 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
3524 strdup.h.
3525 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
3526 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
3527
10d6970f
PE
35282006-07-20 Paul Eggert <eggert@cs.ucla.edu>
3529
3530 * bootstrap: Adjust to today's change to gnulib-tool by invoking
3531 it with --assume-autoconf='latest-stable'.
3532
50a33993
JD
35332006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
3534
3535 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
3536 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
3537 YYSTYPE' and `{'.
3538 * src/muscle_tab.h (muscle_grow): Replace the header comments with
3539 those from muscle_tab.c since the old ones are misleading.
3540
2ce4ed68
AD
35412006-07-13 Akim Demaille <akim@epita.fr>
3542
3543 Support %define "KEY" {VALUE}.
3544 * src/scan-code.h, src/scan-code.l (translate_action)
3545 (translate_rule_action, translate_symbol_action, translate_code):
3546 Return char *, not const char *.
3547 * src/parse-gram.y (declaration): Rename as...
3548 (prologue_declaration): this.
3549 (string_content): Remove this nonterminal, use STRING.
3550 (braceless, content, content.opt): New nonterminal.
3551 Use them.
3552 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
3553 as value.
3554 * src/scan-gram.l (getargs.h): Don't include it.
3555
db7e5eb5
PE
35562006-07-12 Paul Eggert <eggert@cs.ucla.edu>
3557
3558 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
3559 rather than a for-loop that declares a local bool variable. This
3560 should work around a compatibility problem with a Cray x1e C++
3561 compiler reported by Hung Nguyen in
3562 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
3563 The for-loop was introduced in the 2004-11-17 change but I don't
3564 know why it was needed.
3565
a5d80ba5
AD
35662006-07-12 Akim Demaille <akim@epita.fr>
3567
3568 * data/c.m4: Comment changes.
3569
23eb2a69
AD
35702006-07-10 Akim Demaille <akim@lrde.epita.fr>
3571
3572 * src/complain.c (error_message, ERROR_MESSAGE): New.
3573 To factor...
3574 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
3575 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
3576
ddc8ede1
PE
35772006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3578
3579 * NEWS: Instead of %union, you can define and use your own union type
3580 YYSTYPE if your grammar contains at least one <type> tag.
3581 Your YYSTYPE need not be a macro; it can be a typedef.
3582 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
3583 (Union Decl, Decl Summary): Document this.
3584 * data/glr.c (YYSTYPE): Implement this.
3585 * data/glr.cc (YYSTYPE): Likewise.
3586 * data/lalr1.cc (YYSTYPE): Likewise.
3587 * data/yacc.c (YYSTYPE): Likewise.
3588 * src/output.c (prepare): Output tag_seen_flag.
3589 * src/parse-gram.y (declaration, grammar_declaration):
3590 Use 'union_seen' rather than 'typed' to determine whether
3591 %union has been seen, since grammars can now be typed without
3592 %union.
3593 (symbol_declaration, type.opt, symbol_def):
3594 Keep track of whether a tag has been seen.
3595 * src/reader.c (union_seen, tag_seen): New vars.
3596 (typed): remove.
3597 * src/reader.h (union_seen, tag_seen, typed): Likewise.
3598 * src/scan-code.l (untyped_var_seen): New variable.
3599 (handle_action_dollar): Adjust to above changes.
3600 (handle_action_dollar, handle_action_at):
3601 Improve overflow checking for outlandish numbers.
3602 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
3603 avoid new diagnostics generated by above changes.
3604 * tests/regression.at (YYSTYPE typedef): Add test to check
3605 for type tags without %union.
3606
3607 * src/symlist.c (symbol_list_length): Return int, not unsigned
3608 int, since callers expect int. This may need to get revisited
3609 once we have proper integer overflow checking.
3610
3611 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
3612 object is now static.
3613
3614 * src/getargs.c (flags_argmatch): Return void, not int,
3615 to pacify ./configure --enable-gcc-warnings.
3616
3617 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
3618 since last_string is already defined to FLEX_PREFIX (last_string).
3619
7b42569e
AD
36202006-07-09 Akim Demaille <akim@lrde.epita.fr>
3621
3622 Implement --warnings/-W.
3623 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
3624 replaced by...
3625 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
3626 Adjust callers.
3627 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
3628 (warnings_args, warnings_types): New.
3629 (getargs, short_options, long_options): Accept -W/--warnings.
3630 Sort the options by alphabetical order, upper case letter right
3631 before its lower case.
3632
3b452f4e
JD
36332006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3634
3635 Change %merge result type clash warnings to errors. Discussed at
3636 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
3637 * src/reader.c (record_merge_function_type): Use complain_at.
3638 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3639 declared later): Update test case results.
3640
b8a41559
AD
36412006-07-09 Akim Demaille <akim@lrde.epita.fr>
3642
3643 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
3644 to be in alphabetical order.
3645 (trace_args): Spelling fixes.
3646
cd9e1ba2
PE
36472006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3648
3649 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
3650 so they don't collide with user-defined macros.
3651 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
3652 this was never guaranteed, and now that we're using gnulib stdint,
3653 which defines int_fast16_t to long int, the problem is exposed.
3654
cb48f191
PE
36552006-07-08 Paul Eggert <eggert@cs.ucla.edu>
3656
b8445a15
PE
3657 * data/c.m4 (b4_basename): Simplify a bit, since we don't
3658 need the full POSIX semantics (and weren't implementing them
3659 anyway).
3660
cb48f191
PE
3661 Adjust to Autoconf 2.60 and today's gnulib.
3662 * bootstrap (gnulib_modules): Add stdint.
3663 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
3664 no longer copies it.
3665 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
3666 since stdint needs the former and wcwidth (which is now required
3667 by mbswidth) needs the latter.
3668 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
3669 work around a compatibility glitch between gettext 0.14.6 and
3670 Autoconf 2.60.
3671 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
3672 Do not check for uintptr_t, since new stdint module does the right
3673 thing.
3674 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
3675 Add stdint.h, stdint_.h, wcwidth.h.
3676 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
3677 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
3678 stdint.m4, wchar_t.m4, wcwidth.m4.
3679 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
3680 usual order for ../lib/*.h files.
3681 (file_name_split): Use last_component, not base_name, to adjust
3682 to gnulib changes.
3683 * src/parse-gram.h: Include <strverscmp.h> in the usual order
3684 for ../lib/*.h files.
3685 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
3686 Define unconditionally, since we now assume the stdint module.
3687 * src/scan-skel.l: Include <dirname.h>.
3688 (BASE_QPUTS): Use last_component, not base_name.
3689 * src/system.h: Include <unlocked-io.h> in the usual order
3690 for ../lib/*.h files. Include <stdint.h> unconditionally,
3691 since we now use the stdint module.
3692 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
3693 HAVE_UINTPTR_T, since we now use the stdint module.
3694 (base_name): Remove decl, since files now include <dirname.h>
3695 to get the decl.
3696
cd48d21d
AD
36972006-07-08 Akim Demaille <akim@lrde.epita.fr>
3698
3699 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
3700 New, default to 1.
3701 * data/yacc.c, data/glr.c, data/location.cc: Use them.
3702 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
3703 default.
3704 * tests/calc.at: Adjust.
3705
8ec0a172
AD
37062006-07-08 Akim Demaille <akim@lrde.epita.fr>
3707
b8445a15 3708 * data/c.m4 (b4_basename): New.
8ec0a172
AD
3709 (b4_syncline): Also output the location of its invocation (from
3710 the skeleton).
3711 (b4_user_action, b4_define_user_action, b4_user_actions)
3712 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
3713 (b4_user_stype): New.
3714 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
3715
4a678af8
JD
37162006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3717
3718 In the grammar file, the first column is 1 not 0 on the first line as
3719 on every other line.
3720 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
3721 * tests/input.at (Torturing the Scanner): Update output.
3722
3723 * src/scan-gram.l (scanner_cursor): Declare it static.
3724
dd60572a
JD
37252006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3726
3727 In warnings, say "previous declaration" rather than "first
3728 declaration".
3729 * src/symtab.c (redeclaration): Do that here.
3730 * src/reader.c (record_merge_function_type): In the case of a result
3731 type clash, report the previous declaration rather than the very first
3732 one in the grammar file.
3733 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3734 declared later): Add a third declaration to check this behavior.
3735 * tests/input.at (Incompatible Aliases): Update output.
3736
2073e1b6
AD
37372006-06-27 Akim Demaille <akim@epita.fr>
3738
3739 * doc/Doxyfile.in: New.
3740 * doc/Makefile.am: Use it.
3741 * src/lalr.h, src/symtab.h: Initial doxygenation.
3742
8ee5b538
JD
37432006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3744
3745 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
3746 declared after the %merge. This continues the effort of the previous
3747 patch.
8ee5b538
JD
3748 * src/reader.c (get_merge_function): Don't set the merger type yet.
3749 (record_merge_function_type): New function for setting the merger type
3750 and checking for clashes.
3751 (grammar_current_rule_merge_set): Set the location of the %merge for
3752 the current rule.
3753 (packgram): Invoke record_merge_function_type for each rule now that
3754 all symbol type declarations have been parsed.
3755 * src/reader.h (merger_list.type_declaration_location): New member
3756 storing the location of the first %merge from which the type for this
3757 merging function was derived.
3758 * src/symlist.h (symbol_list.merger_declaration_location): New member
3759 storing the location of a rule's %merge, if any.
3760 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3761 declared later): New test to catch the error fixed by the above patch.
3762
ffa4ba3a
JD
37632006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3764
3765 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
3766 declarations appear after the rules. Discussed at
3767 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
3768 and
3769 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
3770 Don't mistake the type of $$ in a midrule to be that of its parent
3771 rule's $$.
ffa4ba3a
JD
3772 * src/reader.c (grammar_current_rule_end): Don't invoke
3773 grammar_rule_check yet since not all symbol declarations may have been
3774 parsed yet.
3775 (grammar_midrule_action): Likewise.
3776 Don't record whether the midrule's $$ has been used yet since actions
3777 haven't been translated yet.
3778 Record the midrule's parent rule and its RHS index within the parent
3779 rule.
3780 (grammar_current_rule_action_append): Don't translate the action yet
3781 since not all symbol declarations may have been parsed yet and, thus,
3782 warnings about types for $$, $n, @$, and @n can't be reported yet.
3783 (packgram): Translate the action and invoke grammar_rule_check now that
3784 all symbol declarations have been parsed.
3785 * src/scan-code.l (handle_action_dollar): Now that this is invoked
3786 after parsing the entire grammar file, the symbol list here in the case
3787 of a midrule is actually the midrule's empty RHS, so reference its
3788 parent rule's RHS where necessary.
3789 On the other hand, now that you can already know it's a midrule, you
3790 aren't forced to think $$ has the same type as its parent rule's $$.
3791 (handle_action_at): In the case of a midrule, reference the parent rule
3792 where necessary.
3793 * src/symlist.c (symbol_list_new): Initialize new midrule-related
3794 members.
3795 (symbol_list_length): Now that this is invoked after all rules have
3796 been parsed, a NULL symbol (rather than a NULL symbol list node)
3797 terminates a rule. symbol_list_print already does this correctly.
3798 * src/symlist.h (symbol_list.midrule_parent_rule,
3799 symbol_list.midrule_parent_rhs_index): New members so that midrules can
3800 remember their relationships with their parents.
3801 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
3802 fixed by the above patch.
3803 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
3804 implementing...
3805 (Unused values): ... this old test case and...
3806 (Unused values before symbol declarations): ... this new test case.
3807 This one is the same as `Unused values' except that all symbol
3808 declarations appear after the rules in order to catch the rest of the
3809 errors fixed by the above patch.
3810
e256e17f
JD
38112006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3812
300a1930
JD
3813 More cleanup.
3814 * src/reader.c (current_rule): Declare it static since it's no longer
3815 used outside this file.
3816 (grammar_current_rule_action_append): Remove redundant arguments from
3817 translate_rule_action invocation.
3818 * src/reader.h (current_rule): Remove this unused extern.
3819 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
3820 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 3821
381ecb06
JD
38222006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
3823
3824 Clean up yesterday's patch.
3825 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
3826 to...
3827 * src/reader.c (grammar_current_rule_action_append): ... here for
3828 consistency with grammar_current_rule_symbol_append.
3829 * tests/regression.at (Braced code in declaration in rules section):
3830 Make yyerror and yylex static as usual.
3831
4210cd0b
JD
38322006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
3833
3834 Fix bug that mistakes braced code in a declaration in the rules section
3835 to be a rule action. Mentioned at
3836 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
3837 * src/scan-gram.l: Move midrule action detection from the start of the
3838 scanning of any braced code to...
3839 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
3840 action. For readability, use $2 and @2 rather than the equivalent
3841 global variables.
3842 * tests/regression.at (Braced code in declaration in rules section):
3843 New test to catch the error fixed by the above patch.
3844
3845 Work on code readability some.
3846 * src/scan-code.l (current_rule): Get rid of this misleading and
3847 redundant declaration: it's actually extern'ed in reader.h.
3848 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
3849 translate_action): Add a rule argument and use it instead of the global
3850 current_rule.
3851 (translate_rule_action): This already receives current_rule through an
3852 argument, so pass it on to translate_action instead of assigning
3853 current_rule to current_rule.
3854 (translate_symbol_action, translate_code): Pass rule = NULL to
3855 translate_action.
3856
34f98f46
JD
38572006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
3858
3859 Rename %before-definitions to %start-header and %after-definitions to
3860 %end-header. Don't use these declarations to separate pre-prologue
3861 blocks from post-prologue blocks. Add new order-independent
3862 declarations %before-header and %after-header as alternatives to the
3863 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
3864 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
3865 * NEWS (2.3+): Update for these changes.
3866 * data/glr.c (b4_before_definitions): Update to...
3867 (b4_start_header): ... this.
3868 (b4_after_definitions): Update to...
3869 (b4_end_header): ... this.
3870 * data/glr.cc: Likewise.
3871 * data/lalr1.cc: Likewise.
3872 * data/yacc.c: Likewise.
3873 * doc/bison.texinfo (The prologue): Update names, and replace remaining
3874 prologue blocks with %*-header declarations.
3875 (Calc++ Parser): Likewise.
91661ebb 3876 (Decl Summary): Update names.
148d66d8 3877 (Table of Symbols): Update description.
34f98f46
JD
3878 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
3879 (PERCENT_END_HEADER): ... this.
3880 (PERCENT_BEFORE_DEFINITIONS): Update to...
3881 (PERCENT_START_HEADER): ... this.
3882 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
3883 (declaration): Update token names and m4 macro names.
3884 When parsing %end-header and %start-header, invoke translate_code
3885 before muscle_code_grow, and no longer set global booleans to remember
3886 whether these declarations have been seen.
3887 Parse new %after-header and %before-header.
3888 * src/reader.c (before_definitions, after_definitions): Remove.
3889 (prologue_augment): Accept a new bool argument to specify whether to
3890 augment the pre-prologue or post-prologue.
3891 * src/reader.h (before_definitions, after_definitions): Remove these
3892 extern's.
3893 (prologue_augment): Add new bool argument.
3894 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
3895 (PERCENT_END_HEADER): ... this.
3896 (PERCENT_BEFORE_DEFINITIONS): Update to...
3897 (PERCENT_START_HEADER): ... this.
3898 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
3899 * tests/actions.at (Printers and Destructors): Update names.
3900
31b2b07e
JD
39012006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
3902
3903 Add comparison operators for C++ location classes. Discussed at
3904 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
3905 * data/c++.m4 (b4_define_location_comparison): New boolean %define
3906 declaration indicating whether filename_type has an operator==. If
3907 filename_type is `std::string', it defaults to `1', `0' otherwise.
3908 * data/location.cc: Iff b4_define_location_comparison is `1', add
3909 operator== and operator!= for class position and for class location.
3910
3911 Some minor fixes.
3912 * src/scan-action.l: Remove unused file.
3913 * src/symtab.c (symbol_printer_set): Use printer_location not
3914 destructor_location.
3915 * src/symtab.h (struct symbol): Replace incorrect source comment for
3916 printer members.
3917 * tests/input.at (Incompatible Aliases): Update output with correct
3918 printer location.
3919
9bc0dd67
JD
39202006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
3921
3922 Don't put the pre-prologue in the header file. For the yacc.c code
3923 file and the glr.c header and code files, move the pre-prologue before
3924 the token definitions. Add new %before-definitions and
3925 %after-definitions to declare code that will go in both the header file
3926 and code file. Discussed at
3927 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
3928 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
3929 and
3930 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
3931 * NEWS (2.3+): Describe these changes.
3932 * data/glr.c (b4_pre_prologue): Move from within to before...
3933 (b4_shared_declarations): ... this.
3934 Add new b4_before_definitions before b4_token_enums.
3935 Add new b4_after_definitions at the end.
3936 * data/glr.cc (b4_pre_prologue): Replace with...
3937 (b4_before_definitions): ... this in the header file.
3938 (b4_after_definitions): New near the end of the header file.
3939 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
3940 code file right before including the header file.
3941 (b4_before_definitions): New in the previous position of
3942 b4_pre_prologue in the header file.
3943 (b4_after_definitions): New near the end of the header file.
3944 * data/yacc.c: Clean up some m4 quoting especially in the header file.
3945 (b4_token_enums_defines): In the code file, move to right before
3946 YYSTYPE for consistency with the header file.
3947 (b4_before_definitions): New right before b4_token_enums_defines in
3948 both the header and code file.
3949 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
3950 header and code file.
3951 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
3952 of prologues for %union dependencies.
91661ebb
JD
3953 (Decl Summary): In %defines description, mention the effect of
3954 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
3955 (Calc++ Parser): Forward declare driver in a %before-definitions rather
3956 than in the pre-prologue so that make check succeeds.
148d66d8 3957 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
3958 %after-definitions.
3959 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
3960 %before-definitions.
3961 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
3962 (declaration): Parse those declarations and append to
3963 b4_before_definitions and b4_after_definitions, respectively.
3964 * src/reader.c (before_definitions, after_definitions): New bools to
3965 track whether those declarations have been seen.
3966 (prologue_augment): Add to the post-prologue if %union,
3967 %before-definitions, or %after-definitions has been seen.
3968 * src/reader.h (before_definitions, after_definitions): New extern's.
3969 * src/scan-gram.l: Scan the new declarations.
3970 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
3971 prologue block in a %before-definitions or a %after-definitions based
3972 on whether the %union is declared.
3973 * tests/regression.at (Early token definitions with --yacc, Early token
3974 definitions without --yacc): Move tests for token definitions into the
3975 post-prologue since token names are no longer defined in the
3976 pre-prologue.
3977
203b9274
AD
39782006-06-20 Akim Demaille <akim@epita.fr>
3979
3980 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
3981 (symbol_get): Use it.
3982 * src/parse-gram.y: Use it.
3983
a7ee59cf
JD
39842006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
3985
3986 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
3987 build succeeds when configured with --enable-gcc-warnings.
3988
5a2baae7
PE
39892006-06-19 Paul Eggert <eggert@cs.ucla.edu>
3990
33ad1a9c
PE
3991 * src/parse-gram.y (char_name): New function.
3992 (CHAR, STRING, string_content): For %printer, properly escape.
3993 (ID): Prefer fputs to fprintf.
3994 (id): Reindent to be consistent with other rules.
3995 Properly quote char.
3996
5a2baae7
PE
3997 The Translation Project changed its way of publishing translations
3998 to maintainers. I haven't received any responses to my request
3999 for supporting the old way, or for documenting the new way. I
4000 have modified 'bootstrap' to use screen scraping
4001 (in this case, HTML scraping). This is unreliable and inelegant,
4002 but I don't see any better way. Yuck.
4003 * bootstrap (TP_URL, WGET_COMMAND): New vars.
4004 (get_translations): New function, which uses HTML scraping to
4005 deduce locations of latest translations.
4006 Use this function to grab both bison and bison-runtime .po files.
4007 Don't bother priming the pump for the runtime-po domain any more,
4008 as it's now translated better than bison is.
4009
58d7a1a1
AD
40102006-06-19 Akim Demaille <akim@epita.fr>
4011
4012 * src/scan-gram.l: No longer "parse" things after `%union' until
4013 `{'. Rather, return a single "%union" token.
4014 No longer make symbols: return strings, and leave the conversion
4015 to symbols to the parser.
4016 (SC_PRE_CODE, token_type): Remove.
4017 * src/parse-gram.y (%union): New field `character'.
4018 Sort tokens.
4019 (CHAR): New token.
4020 (ID, ID_COLON): Now that the scanner no longer makes them
4021 identifiers, adjust all uses to invoke symbol_get.
4022 (id_colon): New, wraps the conversion from string to symbol.
4023 (%union): Accept a possible union_name.
4024 (symbol): Now can be a char.
4025 * data/c.m4 (b4_union_name): Leave a default value.
4026 * data/glr.c, data/yacc.c: Use it.
4027
b931235e
JD
40282006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
4029
4030 For associating token numbers with token names for "yacc.c", don't use
4031 #define statements unless `--yacc' is specified; always use enum
4032 yytokentype. Most important discussions start at:
4033 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
4034 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
4035 and
4036 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
4037 * NEWS (2.3+): Mention.
4038 * data/c.m4 (b4_yacc_if): New.
4039 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
4040 token #define's.
4041 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
4042 on token name definitions.
4043 * src/getargs.c (usage): Capitalize `Yacc' in English.
4044 * src/output.c (prepare): Define b4_yacc_flag.
4045 * tests/regression.at (Early token definitions): Test that tokens names
4046 are defined before the pre-prologue not just before the post-prologue.
4047 Remove this test case and copy to...
4048 (Early token definitions with --yacc): ... this to test #define's.
4049 (Early token definitions without --yacc): ... and this to test enums.
4050
9e6e7ed2
PE
40512006-06-11 Paul Eggert <eggert@cs.ucla.edu>
4052
4053 * NEWS: Reword the post-2.3 change to not be so optimistic about
4054 removing the old "look-ahead" spelling.
4055 Update previous look-ahead/lookahead change reports.
4056 * REFERENCES: look-ahead -> lookahead (since that's
4057 what he actually wrote).
4058 * doc/refcard.tex: look ahead -> lookahead,
4059 look-ahead -> lookahead
4060
742e4900
JD
40612006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
4062
4063 For consistency, use `lookahead' instead of `look-ahead' or
4064 `look_ahead'. Discussed starting at
4065 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
4066 and then at
4067 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
4068 * NEWS: For the next release, note the change to `--report'.
4069 * TODO, doc/bison.1: Update English.
4070 * doc/bison.texinfo: Update English.
4071 (Understanding Your Parser, Bison Options): Document as
4072 `--report=lookahead' rather than `--report=look-ahead'.
4073 * src/conflicts.c: Update English in comments.
4074 (lookahead_set): Rename from look_ahead_set.
4075 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
4076 (resolve_sr_conflict): Rename local look_ahead_tokens to
4077 lookahead_tokens, and update other uses.
4078 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
4079 count_rr_conflicts, conflicts_free): Update uses.
4080 * src/getargs.c (report_args): Move "lookahead" before alternate
4081 spellings.
4082 (report_types): Update uses.
4083 (usage): For `--report' usage description, state `lookahead' spelling
4084 rather than `look-ahead'.
4085 * src/getargs.h (report.report_lookahead_tokens): Rename from
4086 report_look_ahead_tokens.
4087 * src/lalr.c: Update English in comments.
4088 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
4089 (state_lookahead_tokens_count): Rename from
4090 state_look_ahead_tokens_count.
4091 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4092 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
4093 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4094 Update other uses.
4095 Update English in output.
4096 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
4097 * src/print.c: Update English in comments.
4098 (lookahead_set): Rename from look_ahead_set.
4099 (print_reduction): Rename argument lookahead_token from
4100 look_ahead_token.
4101 (print_core, state_default_rule, print_reductions, print_results):
4102 Update uses.
4103 * src/print_graph.c: Update English in comments.
4104 (print_core): Update uses.
4105 * src/state.c: Update English in comments.
4106 (reductions_new): Update uses.
4107 (state_rule_lookahead_tokens_print): Rename from
4108 state_rule_look_ahead_tokens_print, and update other uses.
4109 * src/state.h: Update English in comments.
4110 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
4111 (state_rule_lookahead_tokens_print): Rename from
4112 state_rule_look_ahead_tokens_print.
4113 * src/tables.c: Update English in comments.
4114 (conflict_row, action_row): Update uses.
4115 * tests/glr-regression.at
4116 (Incorrect lookahead during deterministic GLR,
4117 Incorrect lookahead during nondeterministic GLR): Rename
4118 print_look_ahead to print_lookahead.
4119 * tests/torture.at: Update English in comments.
4120 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
4121 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
4122 (Many lookahead tokens): Update uses.
4123 * data/glr.c: Update English in comments.
4124 * lalr1.cc: Likewise.
4125 * yacc.c: Likewise.
4126 * src/conflicts.h: Likewise.
4127 * src/lalr.h: Likewise.
4128 * src/main.c: Likewise.
4129 * src/output.c: Likewise.
4130 * src/parse-gram.c: Likewise.
4131 * src/tables.h: Likewise.
4132 * tests/calc.at: Likewise.
4133
3c40d0b5
JD
41342006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
4135
4136 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
4137
5d278082
PE
41382006-06-07 Paul Eggert <eggert@cs.ucla.edu>
4139
4140 * TODO: Add request from Nelson H. F. Beebe to be able to install
4141 Bison without installing the yacc script.
4142
9e668899
JD
41432006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4144
4145 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
4146 and yytext if they're already #define'd.
4147 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
4148 * src/scan-code-c.c: ... here.
4149 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
4150 <config.h>.
4151
0c8e079f
JD
41522006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4153
4154 Get Bison to build again when configured with --enable-gcc-warnings.
4155 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
4156 missing #include's.
4157 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
4158 loc argument as it shadows a global.
4159 * src/scan-gram.l: Remove stray comma that prevents boundary_set
4160 invocation.
4161
4162 * src/.cvsignore: Add scan-code.c.
4163
2346344a
AD
41642006-06-07 Akim Demaille <akim@epita.fr>
4165
4166 * src/scan-gram.l: Move the "add a trailing ; to actions" code
4167 to...
4168 * src/scan-code.l: here.
4169 * tests/input.at (Torturing the Scanner): Fix another location
4170 error.
4171
4862bdfd
AD
41722006-06-07 Akim Demaille <akim@epita.fr>
4173
4174 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
4175
e9071366
AD
41762006-06-06 Akim Demaille <akim@epita.fr>
4177
4178 Extract the parsing of user actions from the grammar scanner.
4179 As a consequence, the relation between the grammar scanner and
4180 parser is much simpler. We can also split "composite tokens" back
4181 into simple tokens.
4182 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
4183 * src/scan-gram.l (add_column_width, adjust_location): Move to and
4184 rename as...
4185 * src/location.h, src/location.c (add_column_width)
4186 (location_compute): these.
4187 Fix the column count: the initial column is 0.
4188 (location_print): Be robust to ending column being 0.
4189 * src/location.h (boundary_set): New.
4190 * src/main.c: Adjust to scanner_free being renamed as
4191 gram_scanner_free.
4192 * src/output.c: Include scan-code.h.
4193 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
4194 Use boundary_set.
4195 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
4196 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
4197 which is now, again, a separate token.
4198 Adjust all dependencies.
4199 Whereever actions with $ and @ are used, use translate_code.
4200 (action): Remove this nonterminal which is now useless.
4201 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
4202 (grammar_current_rule_action_append): Use translate_code.
4203 (packgram): Bound check ruleno, itemno, and rule_length.
4204 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
4205 (last_string, last_braced_code_loc, max_left_semantic_context)
4206 (scanner_initialize, scanner_free, scanner_last_string_free)
4207 (gram_out, gram_lineno, YY_DECL_): Move to...
4208 * src/scan-gram.h: this new file.
4209 (YY_DECL): Rename as...
4210 (GRAM_DECL): this.
4211 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
4212 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4213 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4214 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4215 Move these declarations, and...
4216 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
4217 these to...
4218 * src/flex-scanner.h: this new file.
4219 * src/scan-gram.l (rule_length, rule_length_overflow)
4220 (increment_rule_length): Remove.
4221 (last_braced_code_loc): Rename as...
4222 (gram_last_braced_code_loc): this.
4223 Adjust to the changes of the parser.
4224 Move all the handling of $ and @ into...
4225 * src/scan-code.l: here.
4226 * src/scan-gram.l (handle_dollar, handle_at): Remove.
4227 (handle_action_dollar, handle_action_at): Move to...
4228 * src/scan-code.l: here.
4229 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
4230 scan-code.h, scan-code-c.c, scan-gram.h.
4231 (EXTRA_bison_SOURCES): Add scan-code.l.
4232 (BUILT_SOURCES): Add scan-code.c.
4233 (yacc): Be robust to white spaces.
4234
4235 * tests/conflicts.at, tests/input.at, tests/reduce.at,
4236 * tests/regression.at: Adjust the column numbers.
4237 * tests/regression.at: Adjust the error message.
7891a7c4 4238
184e42f0
JD
42392006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4240
4241 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4242 Use Akim's wording from
4243 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
4244
7891a7c4
JD
42452006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4246
4247 Between Bison releases, manually append `+' to the previous Bison
4248 release number, and use that as a signal to automatically print the
4249 ChangeLog's CVS Id keyword from --version. Discussed starting at
4250 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
4251 * ChangeLog: Add Id header.
4252 * configure.ac (AC_INIT): Append `+' to `2.3'.
4253 * src/.cvsignore: Add revision.c.
4254 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
4255 (BUILT_SOURCES): Add revision.c.
4256 (revision.c): New target rule. This file defines a new global variable
4257 named revision. It initializes it with either the Id from ChangeLog
4258 or, if VERSION doesn't contain `+', with the empty string.
4259 * src/getargs.c (version): Print the value of revision.
4260 * src/revision.h: Extern revision.
4261
4ad3ed84
PE
42622006-06-05 Paul Eggert <eggert@cs.ucla.edu>
4263
4264 * NEWS: Version 2.3.
4265 * configure.ac (AC_INIT): Likewise.
4266
02103984
PE
42672006-05-30 Paul Eggert <eggert@cs.ucla.edu>
4268
4269 * data/glr.c (YYRECOVERING): Define to be a function-like macro
4270 with no arguments, not as an object-like macro. This is for
4271 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
4272 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
4273 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
4274 Document this.
4275
2c08afa5
JD
42762006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
4277
4278 * src/getargs.c (usage): Back out yesterday's modification of the
4279 --help output so that we don't have to wait for translation before
4280 releasing 2.3.
4281
6077da58
PE
42822006-05-29 Paul Eggert <eggert@cs.ucla.edu>
4283
4284 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
4285 Problem reported by Akim Demaille.
4286
2a26b6c2
JD
42872006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4288
4289 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4290
aefef0d6
PE
42912006-05-26 Paul Eggert <eggert@cs.ucla.edu>
4292
4293 * data/yacc.c (yy_reduce_print): Omit trailing white space in
4294 generated source code. Problem reported by Frans Englich in
4295 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
4296
fcd8e201
PE
42972006-05-22 Paul Eggert <eggert@cs.ucla.edu>
4298
4299 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
4300 shell, not within 'make', so that 'make' by an ordinary builder
4301 (using GNU make) does not worry about configuring gzip. This also
4302 works around a bug reported independently by Keith Thompson and by
4303 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
4304 stderr rather than stdout, messing up the build logs.
4305
7b5cdcbd
JD
43062006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4307
4308 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
4309 to make sure that YYID will never be unused. This fixes a 'make
4310 maintainer-check' failure caused by the recent changes to the 'Trivial
4311 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
4312 not used.
4313 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
4314
5ad0a449
JD
43152006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4316
4317 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
4318 state before an empty RHS is always resolved here. Only the location
4319 of that state is guaranteed to be resolved, and that's enough. This
4320 fixes the remaining bug reported by Derek M. Jones in
4321 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4322 * tests/glr-regression.at (Uninitialized location when reporting
4323 ambiguity): Test the above case.
4324 Also, the embedded comments in this test case claim it checks the case
4325 of an empty RHS that has inherited the initial location. However, the
4326 corresponding LHS was already resolved, so yyresolveLocations didn't
4327 actually have reason to modify it. Fix this by forcing
4328 nondeterministic operation at the beginning of the parse.
4329
50cce58e
PE
43302006-05-20 Paul Eggert <eggert@cs.ucla.edu>
4331
4332 * data/c.m4 (b4_yy_symbol_print_generate):
4333 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
4334 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
4335 of the bugs reported today by Derek M Jones in
4336 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4337 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
4338 defined to be a type name without parens or brackets.
4339 (Location Type): Similarly for YYLTYPE.
4340 * tests/regression.at (Trivial grammars): Put in a test for this
4341 bug that will be caught by 'make maintainer-check' (though not,
4342 alas, by 'make check' unless your compiler is picky).
4343
ab8d9dc5
PE
43442006-05-19 Paul Eggert <eggert@cs.ucla.edu>
4345
0d2c8934 4346 * NEWS: Version 2.2.
ab8d9dc5
PE
4347 * configure.ac (AC_INIT): Likewise.
4348
9138c575
JD
43492006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
4350
4351 * data/glr.c (yyreportTree): Make room in yystates for the state
4352 preceding the RHS. This fixes the segmentation fault reported by Derek
4353 M. Jones in
4354 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
4355 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
4356 to the user. Reported for yyreportTree by Derek M. Jones later in the
4357 same thread.
4358 * THANKS: Add Derek M. Jones.
4359 Update my email address.
4360 Fix typo in Steve Murphy's name.
4361
276f48df
PE
43622006-05-14 Paul Eggert <eggert@cs.ucla.edu>
4363
d6645148
PE
4364 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
4365 checking against YYLAST that caused the parser to miss a potential
4366 alternative in its diagnostic.
4367 Problem reported by Maria Jose Moron Fernandez in
4368 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
4369 * data/lalr1.cc (yysyntax_error_): Likewise.
4370 * data/yacc.c (yysyntax_error): Likewise.
4371 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
4372 tokens, in case we run into an older C compiler.
4373 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
4374 Use them to check for the off-by-one error fixed above.
4375
276f48df
PE
4376 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
4377 YYSIZE_T, not size_t.
4378 * tests/regression.at (Trivial grammars): New test, to catch
4379 the error fixed by the above patch.
4380
cd8b5791
AD
43812006-05-14 Akim Demaille <akim@lrde.epita.fr>
4382
4383 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
4384 scheme.
4385 Reported by Steve Murphy.
4386
34376418
AD
43872006-05-14 Akim Demaille <akim@lrde.epita.fr>
4388
4389 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
4390 * data/glr.cc: b4_location_flag is now b4_locations_flag.
4391
327afc7c
AD
43922006-05-14 Akim Demaille <akim@lrde.epita.fr>
4393
4394 Implement --trace=m4.
4395 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
4396 * src/output.c (output_skeleton): When set, pass -dV to m4.
4397
4398 Factor the handling of flags in m4.
4399 * src/output.c (prepare): Rename the muscle names debug, defines,
4400 error_verbose to debug_flag, defines_flag, error_verbose_flag.
4401 * data/c.m4: Adjust.
4402 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
4403 Use b4_define_flag_if to define other b4_FLAG_if macros.
4404 (b4_location_if): As a consequence, rename as...
4405 (b4_locations_if): this, for consistency.
4406 Adjust all the skeletons.
4407
ba9ecd19
AD
44082006-05-14 Akim Demaille <akim@lrde.epita.fr>
4409
4410 * etc/bench.pm: Shorten bench names.
4411
4e83ea15
AD
44122006-05-14 Akim Demaille <akim@lrde.epita.fr>
4413
4414 * src/output.h, src/output.c (error_verbose): Move to...
4415 * src/getargs.h, src/getargs.c: here.
4416 Sort the flags.
4417 Adjust dependencies.
4418
6e93d810
PE
44192006-05-13 Paul Eggert <eggert@cs.ucla.edu>
4420
4421 * data/c.m4 (b4_copyright): Put the special exception for Bison
4422 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
4423 uses changed. Suggested by Akim Demaille. Also, wrap the
4424 copyright notice, in case it is longer than 80 columns. Replace
4425 comma by newline after title.
6e93d810 4426
eaea13f5
PE
44272006-05-11 Paul Eggert <eggert@cs.ucla.edu>
4428
4429 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
4430 incompatibility, not a bug. Mention that it wasn't fixed as of
4431 flex 2.5.33.
4432
3cf084ec
AD
44332006-05-11 Akim Demaille <akim@lrde.epita.fr>
4434
4435 * examples/extexi: Enforce the precedence of concatenation over
4436 >>.
0a9f1c7d 4437 Reported by Tommy Nordgren.
3cf084ec 4438
32c96bd7
AD
44392006-05-11 Akim Demaille <akim@lrde.epita.fr>
4440
4441 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
4442 with the member "token".
f94705b2 4443 Reported by Martin Nylin.
32c96bd7 4444
eaea13f5
PE
44452006-05-08 Paul Eggert <eggert@cs.ucla.edu>
4446
4447 * data/glr.c: Switch to Bison 2.2 special-exception language in
4448 the copyright notice. Use more-regular format for titles and
4449 copyright notices.
4450 * data/glr.cc: Likewise.
4451 * data/location.cc: Likewise.
4452 * data/yacc.cc: Likewise.
4453 * doc/bison.texinfo (Conditions): Document this.
4454 * NEWS: likewise. Upgrade version to 2.2.
4455
6e2d1146
AD
44562006-04-27 Akim Demaille <akim@lrde.epita.fr>
4457
4458 * data/glr.cc: Remove dead code.
4459
47671055
PE
44602006-04-25 Paul Eggert <eggert@cs.ucla.edu>
4461
4462 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
4463 that variable and the line breaks the bootstrap. Problem reported
4464 by Juan M. Guerrero.
4465
ed2e6384
AD
44662006-04-24 Akim Demaille <akim@lrde.epita.fr>
4467
4468 * doc/bison.texinfo (Multiple start-symbols): New.
4469
3cedc2dc
AD
44702006-04-24 Akim Demaille <akim@lrde.epita.fr>
4471
4472 * etc/README, etc/bench.pl: New.
4473
b2ddc3f3
AD
44742006-04-03 Akim Demaille <akim@lrde.epita.fr>
4475
4476 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
4477 rule.
4478 Reported by Mickael Labau.
4479 * tests/input.at (Torturing the Scanner): Test it.
4480
91e3ac9a
PE
44812006-03-16 Paul Eggert <eggert@cs.ucla.edu>
4482
4483 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
4484 Problem reported by Bob Rossi.
4485
44862006-03-13 Paul Eggert <eggert@cs.ucla.edu>
4487
4488 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
4489 and didn't really work.
4490 For the index, use @ifnotinfo, not @iftex.
4491 Minor cleanups of spacing and terminology.
4492
5cf61e93
AD
44932006-03-12 Akim Demaille <akim@lrde.epita.fr>
4494
4495 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
4496 of AT_NAME_PREFIX when %name-prefix is not used.
4497
aa08666d
AD
44982006-03-12 Akim Demaille <akim@lrde.epita.fr>
4499
4500 Apply --prefix to C++ skeletons too: they change the namespace.
4501 The test suite already exercize these cases.
4502 * data/c++.m4 (b4_namespace): New.
4503 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
4504 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
4505 * data/yacc.c, data/glr.c: Remove a useless `[]'.
4506 * doc/bison.texinfo: Document it.
4507 (Option Cross Key): Use @multitable in all formats. It looks
4508 nicer, even in TeX outputs.
4509 (Rules): Use the same code whatever the output type is.
4510 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
4511 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
4512 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 4513
45567173
AD
45142006-03-10 Akim Demaille <akim@lrde.epita.fr>
4515
4516 * TODO: Remove dead items.
4517
e9d8f881 45182006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
4519
4520 * doc/FAQ: Remove, merged into...
4521 * doc/bison.texinfo (FAQ): this.
4522 * doc/Makefile.am (EXTRA_DIST): Adjust.
4523
c095d689
AD
45242006-03-10 Akim Demaille <akim@lrde.epita.fr>
4525
4526 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
4527 even if empty.
4528 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
4529 * doc/bison.texinfo (Calc++ Scanner): Use it.
4530
6e0f8287
PE
45312006-03-09 Paul Eggert <eggert@cs.ucla.edu>
4532
4533 Fix two nits reported by twlevo, plus one more that I discovered.
4534
4535 * src/assoc.h (assoc_to_string): Give a name to the arg, as
4536 this is the usual Bison style.
4537 * src/location.h (location_print): Likewise.
4538
4539 * src/reader.h (token_name): Likewise.
4540
d6b771c3
PE
45412006-03-08 Paul Eggert <eggert@cs.ucla.edu>
4542
4543 Fix some nits reported by twlevo.
4544 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
4545 and "POSIX". Use more-modern syntax for URLs. Mention C++
4546 and ask for Java. Don't hardwire OS version numbers. Add
4547 copyright notice.
4548 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
4549 * src/conflicts.c (solved_conflicts_obstack): Now static.
4550
1e137b71
JD
45512006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4552
4553 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
4554 page. Say "you can use it" not "you may use it" as on the web page;
4555 we're describing capabilities not granting permission.
4556
73f2e47e
PE
45572006-03-06 Paul Eggert <eggert@cs.ucla.edu>
4558
6d05403d
PE
4559 * data/glr.c (yyresolveLocations): Rename local variables to avoid
4560 shadowing warnings. Use usual patter for iterating through RHS.
4561 * tests/glr-regression.at
4562 (Uninitialized location when reporting ambiguity):
4563 Modify yylex so that it uses its argument, rather than trying
4564 to rely on ARGSUSED (which doesn't work for gcc with warnings).
4565 const char -> char const.
4566
73f2e47e
PE
4567 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
4568 Don't use tabs inside commands; it messes up 'ps'.
4569 Problem reported by twlevo.
4570
8710fc41
JD
45712006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
4572
4573 * tests/glr-regression.at (Uninitialized location when reporting
4574 ambiguity): New test case.
4575 * data/glr.c (yyresolveLocations): New function, which uses
4576 YYLLOC_DEFAULT.
4577 (yyresolveValue): Invoke yyresolveLocations before reporting an
4578 ambiguity.
4579 * doc/bison.texinfo (Default Action for Locations): Note
4580 YYLLOC_DEFAULT's usage for ambiguity locations.
4581 (GLR Semantic Actions): Cross-reference those notes.
4582
ae952af2
JD
45832006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
4584
4585 * tests/glr-regression.at (Leaked semantic values when reporting
4586 ambiguity): Remove unnecessary union and type declarations.
4587 (Leaked lookahead after nondeterministic parse syntax error): New test
4588 case.
4589 * data/glr.c (yyparse): Check for zero stacks remaining before
4590 attempting to shift the lookahead so that you don't lose it.
4591
35ee866a
JD
45922006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4593
4594 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
4595 * tests/glr-regression.at (Leaked semantic values when reporting
4596 ambiguity): New test case.
4597 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
4598 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
4599 now unnecessary yystackp parameter.
4600 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
4601 destructors can be called.
4602
4603 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
4604 in existing testcases.
4605
520181ab
JD
46062006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4607
4608 Don't leak semantic values for parent RHS when a user action cuts the
4609 parser, and clean up related code a bit.
4610 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
4611 cuts parse): Rename to...
4612 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
4613 for leaked parent RHS values.
4614 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
4615 between an unresolved state (non-empty chain of semantic options) and
4616 an incomplete one (signaled by an empty chain).
ae952af2 4617 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
4618 successfully or unsuccessfully resolved yyGLRState to...
4619 (yyresolveValue): ... here so that yyresolveValue always leaves a
4620 yyGLRState with consistent data and thus is easier to understand.
4621 Remove the yyvalp and yylocp parameters since they are always just
4622 taken from the yys parameter. When reporting a discarded merged value
4623 in debugging output, note that it is incompletely merged. Document the
4624 interface.
4625 (yyresolveAction): If resolving any of the RHS states fails, destroy
4626 them all rather than leaking them. Thus, as long as user actions are
4627 written to clean up the RHS correctly, yyresolveAction always cleans up
4628 the RHS of a semantic option. Document the interface.
4629
18d9185c
PE
46302006-02-27 Paul Eggert <eggert@cs.ucla.edu>
4631
4632 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
4633 led to a segmentation fault in GNU Pascal. Problem reported
4634 by Waldek Hebisch.
4635
841a7737
JD
46362006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
4637
4638 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
4639 mid-rule action inside a nonterminal symbol in order to declare a
4640 destructor for its semantic value.
4641
fc3f467f
PE
46422006-02-16 Paul Eggert <eggert@cs.ucla.edu>
4643
4644 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
4645 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
4646 __cplusplus && ! defined _STDLIB_H && !
4647 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
4648 defined free))]: Include <stdlib.h> rather than rolling our own
4649 declarations of malloc and free, to avoid problems with
4650 incompatible declarations (using 'throw') C++'s stdlib.h. This
4651 should fix Debian bug 340012
4652 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
4653 reported by Guillaume Melquiond.
4654
a3af26dd
PE
46552006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4656
4d7bc38c
PE
4657 * NEWS: Clarify symbols versus types in unused-value warnings.
4658
a3af26dd
PE
4659 * configure.ac (AC_INIT): Bump version number.
4660
4e26c69e
PE
46612006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4662
4663 * NEWS: Version 2.1a.
4664 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
4665 since C99 requires this.
4666
498e897c
PE
46672006-02-11 Paul Eggert <eggert@cs.ucla.edu>
4668
4669 * m4/c-working.m4: New file.
4670 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
4671
57bb17ca
PE
46722006-02-10 Paul Eggert <eggert@cs.ucla.edu>
4673
4674 * Makefile.maint: Merge from coreutils.
4675
0be105dc
PE
46762006-02-09 Paul Eggert <eggert@cs.ucla.edu>
4677
4678 More portability fixes for problems summarized by Nelson H. F. Beebe.
4679
4680 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
4681 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
4682 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
4683 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
4684 messes up because C++ code is compiled in 32-bit mode but linked
4685 in 64-bit mode.
4686
6fc0c024
PE
46872006-02-08 Paul Eggert <eggert@cs.ucla.edu>
4688
4689 More portability fixes for problems summarized by Nelson H. F. Beebe.
4690
7870f699
PE
4691 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
4692 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
4693
6fc0c024
PE
4694 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
4695 nodist_PROGRAMS, since we don't need to actually compile the
4696 example if we're just doing a plain 'make'. This avoids bothering
4697 the installer unnecessarily about problems due to weird C++
4698 compilers.
4699
fe6c2fde
PE
47002006-02-06 Paul Eggert <eggert@cs.ucla.edu>
4701
4702 More portability fixes for problems summarized by Nelson H. F. Beebe.
4703
4704 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
4705 than #include "...", and compile with -I'.'. The old method was
4706 not portable, according to Posix and the C standard, and it does
4707 not work with Sun C 5.7, where previous #line directives affect
4708 the working directory used in later #include "..." directives.
4709
927b425b
JMG
47102006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4711
4712 Various DJGGP specific issues in /djgpp
4713
d9735e9e
PE
47142006-02-02 Paul Eggert <eggert@cs.ucla.edu>
4715
4716 More portability fixes for problems summarized by Nelson H. F. Beebe.
4717
4718 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
4719 '#include <map>' works and that you can apply ++ to iterators.
4720
5a6755af
PE
47212006-02-01 Paul Eggert <eggert@cs.ucla.edu>
4722
67a0dc4f
PE
4723 Work around portability problems summarized by Nelson H. F. Beebe in
4724 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
4725
8c86f0ef
PE
4726 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4727 that '#include <string>' works.
4728
de35dd59
PE
4729 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
4730 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
4731 "warning: sorry: semantics of inline function static data `const
4732 unsigned char translate_table[262]' are wrong (you'll wind up with
4733 multiple copies)".
4734
67a0dc4f
PE
4735 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
4736 or, xor to not_, and_, or_, and xor_, respectively. This works
4737 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
4738 random system header somewhere that includes the equivalent of
4739 <iso646.h>.
4740
5a6755af
PE
4741 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
4742 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 4743 Suite Version 2.0.
5a6755af 4744
3f001415
JD
47452006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
4746
4747 During deterministic GLR operation, user actions should be able to
4748 influence the parse by changing yychar. To make this easier to fix and
4749 to make glr.c easier to evolve in general, don't maintain yytoken in
4750 parallel with yychar; just compute yytoken when needed.
4751 * tests/glr-regression.at (Incorrect lookahead during deterministic
4752 GLR): Check that setting yychar in a user action has the intended
4753 effect.
4754 * data/glr.c (yyGLRStack): Remove yytokenp member.
4755 (yyclearin): Don't set *yytokenp.
4756 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
4757 yychar rather than *yytokenp to determine the current lookahead.
4758 Compute yytoken locally when needed.
4759 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
4760 point to.
4761
4762 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
4763 after `--report' documentation.
4764
e2a8c0f5
PE
47652006-01-30 Paul Eggert <eggert@cs.ucla.edu>
4766
4767 * src/parse-gram.y (grammar_declaration): Location of printer
4768 symbol is @1, not list->location. Bug reported by twlevo.
4769 * tests/input.at (Incompatible Aliases): Adjust to above change.
4770
6b702268
PE
47712006-01-29 Paul Eggert <eggert@cs.ucla.edu>
4772
27622431
PE
4773 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
4774 all the test at once. This makes the output easier to read in the
4775 normal case.
4776
6b702268
PE
4777 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
4778 got from <http://bro-ids.org/download.html>. The bug is that
4779 when two actions appeared in succession, the second one was
4780 scanned before the first one was added to the grammar rule
4781 as a midrule action. Bison then output the incorrect warning
4782 "parse.y:905.17-906.36: warning: unused value: $3".
4783 * src/parse-gram.y (BRACED_CODE, action): These are no longer
4784 associated with a value.
4785 (rhs): Don't invoke grammar_current_rule_action_append.
4786 (action): Invoke it here instead.
4787 * src/reader.c (grammar_midrule_action): Now extern.
4788 (grammar_current_rule_action_append): Don't invoke
4789 grammar_midrule_action; that is now the scanner's job.
4790 * src/reader.h (last_string, last_braced_code_loc):
4791 (grammar_midrule_action): New decls.
4792 * src/scan-gram.l (last_string): Now extern, sigh.
4793 (last_braced_code_loc): New extern variable.
4794 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
4795 rule already has an action.
4796 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
4797 * tests/input.at (AT_CHECK_UNUSED_VALUES):
4798 Add some tests to check that the above changes fixed the bug.
4799
d40ba6c2
PE
48002006-01-27 Paul Eggert <eggert@cs.ucla.edu>
4801
4802 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
4803 All used changed. Check whether the symbol has a destructor,
4804 not whether it is typed.
4805 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
4806 that the values are still reported as unused. All line numbers
4807 adjusted.
4808
401aace6
PE
48092006-01-23 Paul Eggert <eggert@cs.ucla.edu>
4810
4811 Work around a bug in bro 0.8, which underparenthesizes its
4812 definition of YYLLOC_DEFAULT.
4813 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
4814 their arguments.
4815 * data/lalr1.cc: Likewise.
4816 * data/yacc.cc: Likewise.
4817
06f01bc4
PE
48182006-01-22 Paul Eggert <eggert@cs.ucla.edu>
4819
401aace6
PE
4820 Work around a bug in Pike 7.0, and give the Pike folks a
4821 better way to override the usual int widths.
4822 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
4823 user can override the types.
4824 (short): #undef, to work around a bug in Pike 7.0.
4825 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
4826 (union yyalloc.yyss): Use yytype_int16 rather than short.
4827 All uses changed.
4828 (yysigned_char): Remove.
4829 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
4830 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
4831 * tests/regression.at (Web2c Actions): Adjust to above changes.
4832
4833 * src/reader.c (check_and_convert_grammar): New function.
4834 (reader): Close the input file even if something went wrong during
4835 parsing. Minor file descriptor leak reported by twlevo.
4836
06f01bc4
PE
4837 * src/assoc.c (assoc_to_string): Use a default: abort (); case
4838 to pacify gcc -Wswitch-default.
4839 * src/scan-gram.l (adjust_location): Use a default: break; case
4840 to pacify gcc -Wswitch-default.
4841 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
4842 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4843 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4844 Move these decls to scan-skel.l, since they don't need to be
4845 visible elsewhere.
4846 * src/scan-skel.l: Accept the above decls.
4847 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
4848 is used.
4849
02650b7f
PE
48502006-01-21 Paul Eggert <eggert@cs.ucla.edu>
4851
4852 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
4853 since we don't want to insist on a version number at the start
4854 of the changelog every time.
4855 * Makefile.maint: Sync from coreutils a bit better.
4856 (sc_trailing_blank): Renamed from sc_trailing_space.
4857 All uses changed.
4858 (sc_no_if_have_config_h, sc_require_config_h):
4859 (sc_prohibit_assert_without_use): New rules.
4860 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
4861 (sc_dd_max_sym_length): Fix leading spaces in rule.
4862 (sc_system_h_headers): Prefix with @.
4863 (sc_useless_cpp_parens, m4-check): Output line numbers.
4864 (changelog-check): Allow version only in head.
4865 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
4866 satisfy new Makefile.maint rule.
4867 * data/glr.c: Likewise.
4868 * data/glr.cc: Likewise.
4869 * data/lalr1.cc: Likewise.
4870 * data/yacc.c: Likewise.
4871 * lib/ebitsetv.c: Likewise.
4872 * lib/lbitset.c: Likewise.
4873 * lib/subpipe.c: Likewise.
4874 * lib/timevar.c: Likewise.
4875 * src/system.h: Likewise.
4876 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
4877 * djgpp/Makefile.maint: Add copyright notice.
4878 * djgpp/README.in: Likewise.
4879 * djgpp/config.bat: Likewise.
4880 * djgpp/config.site: Likewise.
4881 * djgpp/config_h.sed: Likewise.
4882 * djgpp/djunpack.bat: Likewise.
4883 * djgpp/config.sed: Fix copyright notice to match standard format.
4884 * djgpp/subpipe.h: Likewise.
4885 * lib/bitsetv-print.c: Likewise.
4886 * lib/bitsetv.c: Likewise.
4887 * lib/subpipe.h: Likewise.
4888 * lib/timevar.c: Likewise.
4889 * lib/timevar.h: Likewise.
4890 * djgpp/subpipe.c: Use standard recipe for config.h.
4891 * lib/abitset.c: Likewise.
4892 * lib/bitset.c: Likewise.
4893 * lib/bitset_stats.c: Likewise.
4894 * lib/bitsetv-print.c: Likewise.
4895 * lib/bitsetv.c: Likewise.
4896 * lib/ebitsetv.c: Likewise.
4897 * lib/get-errno.c: Likewise.
4898 * lib/lbitset.c: Likewise.
4899 * lib/subpipe.c: Likewise.
4900 * lib/timevar.c: Likewise.
4901 * lib/vbitset.c: Likewise.
4902 * tests/local.at: Likewise.
4903 * src/scan-gram.l: Don't include verify.h, since system.h does
4904 that for us.
4905 * .x-sc_require_config_h: New file.
4906 * .x-sc_unmarked_diagnostics: New file.
4907
287c78f6
PE
49082006-01-20 Paul Eggert <eggert@cs.ucla.edu>
4909
287c78f6
PE
4910 Be a bit more systematic about using 'abort'.
4911 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
4912 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
4913 Put 'default: abort ();' before some other case, to satisfy older
4914 pedantic compilers.
4915 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4916 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
4917 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
4918 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
4919 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
4920 (get_decision_str, get_orientation_str, get_node_alignment_str):
4921 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
4922 (get_linestyle_str, get_arrowstyle_str): Likewise.
4923 * src/conflicts.c (resolve_sr_conflict):
4924 Use a default case rather than one for the one remaining enum
4925 value, to catch invalid enum values as well.
4926 * src/lalr.c (set_goto_map, map_goto):
4927 Prefer "assert (FOO);" to "if (!FOO) abort ();".
4928 * src/nullable.c (nullable_compute, token_definitions_output):
4929 Likewise.
4930 * src/reader.c (packgram, reader): Likewise.
4931 * src/state.c (transitions_to, state_new, state_reduction_find):
4932 Likewise.
4933 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
4934 (symbol_pack): Likewise.
4935 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
4936 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
4937 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
4938 * src/system.h: Don't include <assert.h>.
4939 (assert): New macro.
4940
4941 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
4942 (Destructor Decl, Parser Function, Pure Calling):
4943 Describe rules for braces inside C code more carefully.
287c78f6 4944
c66dfadd
PE
49452006-01-19 Paul Eggert <eggert@cs.ucla.edu>
4946
c21493b8
PE
4947 Fix some porting glitches found by Nelson H. F. Beebe.
4948 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
4949 compilers that don't understand that abort () does not return.
4950 * src/state.c (transitions_to): Likewise.
4951 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4952 that '#include <cstdlib>' works.
4953 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
4954 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
4955 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
4956 for the benefit of some pre-C99 compilers.
4957
b6e3facf
PE
4958 * bootstrap: Undo changes to gnulib files that autoreconf made.
4959
c66dfadd
PE
4960 Minor fixups to get 'make maintainer-check' to work.
4961 * configure.ac: Don't use -Wnested-externs, as it's incompatible
4962 with the new verify.h implementation.
4963 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
4964 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
4965 * data/yacc.c (YYUSE): Likewise.
4966 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
4967 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
4968 * src/parse-gram.y (declaration): Don't pass a string constant
4969 to a function that expects char *, since GCC might complain
4970 about the constant value.
4971 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
4972 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
4973 before #defining them.
4974 * tests/glr-regression.at
4975 (Incorrectly initialized location for empty right-hand side in GLR):
4976 In yyerror, use the msg arg.
4977 (Corrupted semantic options if user action cuts parse):
4978 (Incorrect lookahead during deterministic GLR):
4979 (Incorrect lookahead during nondeterministic GLR):
4980 Don't name a local var 'index'; it shadows string.h's 'index'.
4981
ed94ef2a
AD
49822006-01-19 Akim Demaille <akim@epita.fr>
4983
4984 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
4985 location, not just parts of it.
4986
e9ad4aec
PE
49872006-01-18 Paul Eggert <eggert@cs.ucla.edu>
4988
d6ca7905
PE
4989 * NEWS: Document the fact that multiple %unions are now allowed.
4990 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
4991 * TODO: This feature is now implemented, so remove it from
4992 the wishlist.
d6ca7905 4993
ef1b70e0
PE
4994 * Makefile.maint: Merge with coreutils Makefile.maint.
4995 (CVS_LIST): Use build-aux version if available.
4996 (VERSION_REGEXP): New macro.
4997 (syntax-check-rules): Add sc_no_if_have_config_h,
4998 sc_prohibit_assert_without_use, sc_require_config_h,
4999 sc_useless_cpp_parens.
5000 (sc_obsolete_symbols): Check for O_NDELAY.
5001 (sc_dd_max_sym_length): Track coreutils.
5002 (sc_unmarked_diagnostics): Look in all files, not just *.c.
5003 (sc_useless_cpp_parens): New rule.
5004 (news-date-check): Look for version or today's date.
5005 (changelog-check): Don't require version number near head.
5006 (copyright-check): Use current year instead of hardwiring 2005.
5007 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
5008 (announcement): Add --gpg-key-ID.
5009
5010 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
5011 with "file system".
5012
2073ce56 5013 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
5014 array. Problem reported by twlevo.
5015 * src/reader.c (packgram): Prepend a new sentinel before ritem.
5016 * src/lalr.c (build_relations): Rely on new sentinel.
5017 * src/gram.c (gram_free): Adjust to new sentinel.
5018
b7691f15
JD
50192006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
5020
5021 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
5022 yylookaheadNeeds. All uses updated.
5023 (yysplitStack): Rename local yynewLookaheadStatuses to
5024 yynewLookaheadNeeds.
5025 * data/glr-regression.at (Incorrect lookahead during nondeterministic
5026 GLR): In comments, change `lookahead status' to `lookahead need'.
5027
ddee1b06
PH
50282006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5029
5030 * data/glr.c (yysplitStack): A little stylistic rewrite.
5031
12f4614d
PH
50322006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5033
5034 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
5035
32c29292
JD
50362006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
5037
5038 * doc/bison.texinfo: Fix some typos.
5039 (GLR Semantic Actions): New subsection discussing special
5040 considerations because GLR semantic actions might be deferred.
5041 (Actions): Mention look-ahead usage of yylval.
5042 (Actions and Locations): Mention look-ahead usage of yylloc.
5043 (Special Features for Use in Actions): Add YYEOF entry and mention it
5044 in the yychar entry.
5045 In the yychar entry, remove mention of the local yychar case (pure
5046 parser) since this is irrelevant information when writing semantic
148d66d8 5047 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
5048 yychar is otherwise described as an external variable.
5049 In the yychar entry, don't call it the `current' look-ahead since it
5050 isn't when semantic actions are deferred.
5051 In the yychar and yyclearin entries, add note about deferred semantic
5052 actions.
5053 Add yylloc and yylval entries discussing look-ahead usage.
5054 (Look-Ahead Tokens): When discussing yychar, don't call it the
5055 `current' look-ahead, and do mention yylval and yylloc.
5056 (Error Recovery): Cross-reference `Action Features' when mentioning
5057 yyclearin.
148d66d8 5058 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
5059 look-ahead.
5060 In the yylloc and yylval entries, mention look-ahead usage.
5061
de366a2f 50622006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
5063
5064 * tests/glr-regression.at: Update copyright year to 2006.
5065
bf70fa87
JD
50662006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5067
5068 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
5069 use during nondeterministic operation to track which stacks have
5070 actually needed the current lookahead.
5071 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
5072 Allocate, deallocate, resize, and otherwise shuffle space for
5073 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
5074 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
5075 appropriately during nondeterministic operation.
5076 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
5077 members to store the current lookahead to be used by the deferred
5078 user action.
5079 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
5080 from which the RHS is taken. Set the lookahead members of the new
5081 yySemanticOption according to the lookahead status for stack yyk.
5082 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
5083 yyaddDeferredAction.
5084 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
5085 members of yySemanticOption before invoking yyuserAction, and then set
5086 them back to their current values afterward.
5087 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
5088 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
5089 * tests/glr-regression.at: Remove `.' from the ends of recent test case
5090 titles for consistency.
5091 (Leaked merged semantic value if user action cuts parse): In order to
5092 suppress lint warnings, use arguments in merge function, and assign
5093 char value < 128 in main.
5094 (Incorrect lookahead during deterministic GLR): New test case.
5095 (Incorrect lookahead during nondeterministic GLR): New test case.
5096
05449a2c
JD
50972006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5098
de366a2f 5099 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
5100 !yyvaluep as signal that no semantic value is available to print.
5101 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
5102 to print a semantic value.
5103
4158e0a1 51042006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 5105
4158e0a1
JD
5106 * tests/glr-regression.at: For consistency with my newer test cases,
5107 don't thank myself.
5108
d659304d
JD
51092006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5110
5111 * data/glr.c (yyresolveValue): When merging semantic options, if at
5112 least one user action succeeds but a later one cuts the parse, then
5113 destroy the semantic value before returning rather than leaking it.
5114 (yyresolveStates): If a user action cuts the parse and thus
5115 yyresolveValue fails, ignore the (unset) semantic value rather than
5116 corrupting the yyGLRState, and empty the semantic options list since
5117 the user actions should have called all necessary destructors.
5118 Simplify code with YYCHK.
5119 * tests/glr-regression.at (Corrupted semantic options if user action
5120 cuts parse): New test case.
5121 (Undesirable destructors if user action cuts parse): New test case.
5122 Before applying any of this patch, this test case never actually failed
5123 for me... but only because the corrupted semantic options usually
5124 masked this bug.
5125 (Leaked merged semantic value if user action cuts parse): New test
5126 case.
5127
6ec2c0f2
AD
51282006-01-05 Akim Demaille <akim@epita.fr>
5129
5130 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
5131
1b9c21fb
PE
51322006-01-04 Paul Eggert <eggert@cs.ucla.edu>
5133
5134 * data/c.m4 (b4_c_modern): New macro, with a new provision for
5135 _MSC_VER. Problem reported by Cenzato Marco.
5136 (b4_c_function_def): Use it.
5137 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
5138 b4_c_modern.
5139 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
5140 than rolling our own.
5141
84866159
AD
51422006-01-04 Akim Demaille <akim@epita.fr>
5143
5144 Also warn about non-used mid-rule values.
5145 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
5146 member.
5147 (symbol_list_new): Adjust.
5148 * src/reader.c (symbol_typed_p): New.
5149 (grammar_rule_check): Use it.
5150 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
5151 Check its rule.
5152 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
5153 Use it.
5154 * tests/actions.at (Exotic Dollars): Adjust.
5155
378f4bd8
AD
51562006-01-04 Akim Demaille <akim@epita.fr>
5157
5158 * src/reader.c (grammar_midrule_action): If $$ is set in a
5159 mid-rule, move the `used' bit to its lhs.
5160 * tests/input.at (Unused values): New.
5161 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
5162
e2a21b6f
PE
51632006-01-03 Paul Eggert <eggert@cs.ucla.edu>
5164
54662697
PE
5165 * doc/bison.texinfo (Bison Options): Say more accurately what
5166 --yacc does.
5167 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
5168 about declarations in the grammar when in Yacc mode, as POSIX does
5169 not require a diagnostic when the grammar uses extensions.
5170
5171 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
5172
073f9288
PE
5173 Warn about dubious constructions like "%token T T".
5174 Reported by twlevo.
5175 * src/symtab.h (struct symbol.declared): New member.
5176 * src/symtab.c (symbol_new): Initialize it to false.
5177 (symbol_class_set): New arg DECLARING, specifying whether
5178 this is a declaration that we want to warn about, if there
5179 is more than one of them. All uses changed.
5180
1221b78a
PE
5181 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
5182 Allow multiple %union directives, whose contents concatenate.
5183 * src/parse-gram.y (grammar_declaration): Likewise.
5184 Use muscle_code_grow, so that we don't need stype_line any more.
5185 All uses changed.
5186
5187 * src/muscle_tab.c (muscle_grow): Fix comment.
5188
e2a21b6f
PE
5189 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
5190 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
5191 Update copyright year to 2006.
5192
8f7e3cf9
AD
51932006-01-03 Akim Demaille <akim@epita.fr>
5194
5195 Have glr.cc pass (some of) the calc.at tests.
5196 * data/glr.cc (b4_parse_param_orig): New.
5197 (b4_parse_param): Improve its definition, and bound it more
5198 clearly in the skeleton.
5199 (b4_epilogue): Append, instead of prepending, in order to keep
5200 #line consistency.
5201 Simplify the generation of auxiliary functions: locations and
5202 purity are mandated.
5203 (b4_global_tokens_and_yystype): Honor it.
5204 * data/location.cc (c++.m4): Don't include it.
5205 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
5206 and AT_SKEL_CC_IF.
5207 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
5208 AT_LALR1_CC_IF.
5209 Be sure to initialize the first position's filename.
5210 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
5211 mandated anyway.
5212 (AT_CHECK_CALC_GLR_CC): New.
5213 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
5214
3953ed88
AD
52152006-01-02 Akim Demaille <akim@epita.fr>
5216
5217 * src/output.c (output_skeleton): Don't hard wire the inclusion of
5218 c.m4.
0a96ba81 5219 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
5220 * data/glr.cc: Do not include stack.hh.
5221
9ecafbbf
AD
52222006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5223
5224 * data/glr.c: Reformat whitespace with tabs.
5225 (b4_lpure_formals): Remove this unused m4 macro.
5226 * tests/cxx-type.at: Reformat whitespace with tabs.
5227 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
5228 since it's a member. Rename type to isNterm for clarity.
5229
c4d497a0
AD
52302005-12-29 Akim <akim@sulaco.local>
5231
5232 Let glr.cc catch up with symbol_value_print.
5233 * data/glr.cc (b4_yysymprint_generate): Replace by...
5234 (b4_yy_symbol_print_generate): this.
5235 (yy_symbol_print, yy_symbol_value_print): Declare them.
5236
4517da37
PE
52372005-12-28 Paul Eggert <eggert@cs.ucla.edu>
5238
5239 * src/location.h (boundary): Note that a line or column equal
5240 to INT_MAX indicates an overflow.
5241 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
5242 (rule_length_overflow, increment_rule_length, add_column_width):
5243 New functions.
5244 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
5245 (<SC_BRACED_CODE>"}"):
5246 Use increment_rule_length rather than incrementing it by hand.
5247 (adjust_location, handle_syncline): Diagnose overflow.
5248 (handle_action_dollar, handle_action_at):
5249 Fix bug with monstrosities like $-2147483648.
5250 Remove now-unnecessary checks.
5251 (scan_integer): Verify assumptions and remove now-unnecessary checks.
5252 (convert_ucn_to_byte): Verify assumptions.
5253 (handle_syncline): New arg LOC. All callers changed.
5254 Don't store through a value derived from char const * pointer.
5255
5256 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
5257 GCC warnings.
5258
e3233bf6
PE
52592005-12-27 Paul Eggert <eggert@cs.ucla.edu>
5260
5261 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
5262 Remove unnecessary forward static decls.
5263
8f3596a6
AD
52642005-12-27 Akim Demaille <akim@epita.fr>
5265
5266 * src/reader.c (grammar_current_rule_check): Also check that $$
5267 is used.
5268 Take the rule to check as argument, hence rename as...
5269 (grammar_rule_check): this.
5270 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
5271 Rename as...
5272 (grammar_rule_begin, grammar_rule_end): these, for consistency.
5273 (grammar_midrule_action, grammar_symbol_append): Now static.
5274 * tests/torture.at (input): Don't rely on the default action
5275 being always performed.
5276 * tests/calc.at: "Set" $$ even when the action is "cut" with
5277 YYERROR or other.
5278 * tests/actions.at (Exotic Dollars): Instead of using unused
5279 values, check that the warning is issued.
5280
721be13c
PE
52812005-12-22 Paul Eggert <eggert@cs.ucla.edu>
5282
5283 * NEWS: Improve wording for unused-value warnings.
5284
a0af42fc
AD
52852005-12-22 Akim Demaille <akim@epita.fr>
5286
5287 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
5288 (b4_yysymprint_generate): Rename as...
5289 (b4_yy_symbol_print_generate): this.
5290 Generate yy_symbol_print instead of yysymprint.
5291 Generate also yy_symbol_value_print, and use it.
5292
affac613
AD
52932005-12-22 Akim Demaille <akim@epita.fr>
5294
721be13c 5295 * NEWS: Warn about unused values.
affac613
AD
5296 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
5297 a `used' member.
5298 (symbol_list_n_get, symbol_list_n_used_set): New.
5299 (symbol_list_n_type_name_get): Use symbol_list_n_get.
5300 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
5301 * src/reader.c (grammar_current_rule_check): Check that values are
5302 used.
5303 * src/symtab.c (symbol_print): Accept 0.
5304 * tests/existing.at: Remove the type information.
5305 Empty the actions.
5306 Remove useless actions (beware of mid-rule actions: perl -000
5307 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
5308 * tests/actions.at (Exotic Dollars): Use unused values.
5309 * tests/calc.at: Likewise.
5310 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5311 Likewise.
5312
5313 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
5314 rule_useful_p.
5315
9d9b8b70
PE
53162005-12-21 Paul Eggert <eggert@cs.ucla.edu>
5317
8bb4c753
PE
5318 Undo 2005-12-01 tentative license wording change. The wording is
5319 still being reviewed by the lawyers, and we don't want to wait for
5320 them before publishing a test release. For now, revert to the
5321 previous wording.
5322 * NEWS: Undo 2005-12-01 change.
5323 * data/glr.c: Revert to previous license wording.
5324 * data/glr.cc: Likewise.
5325 * data/lalr1.cc: Likewise.
5326 * data/location.cc: Likewise.
5327 * data/yacc.c: Likewise.
5328
9d9b8b70
PE
5329 * NEWS: Reword %destructor vs YYABORT etc.
5330 * data/glr.c: Use American spacing, for consistency.
5331 * data/glr.cc: Likewise.
5332 * data/lalr1.cc: Likewise.
5333 * data/yacc.c: Likewise.
5334 * data/yacc.c: Reformat comments slightly.
5335 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
5336 for consistency. Fix some spelling errors and reword recently-included
5337 text slightly.
5338 * tests/cxx-type.at: Cast results of malloc, for C++.
5339
2c3b392a
AD
53402005-12-21 Joel E. Denny <address@hidden>
5341
5342 * tests/cxx-type.at: Construct a tree, count the parents of shared
5343 nodes, and free each node once and only once. Previously, the memory
5344 for semantic values was leaked instead.
5345
d6cff4dc
AD
53462005-12-21 Joel E. Denny <address@hidden>
5347
5348 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
5349 (yylval, yylloc): If pure, #define to yystackp->yyval and
5350 yystackp->yyloc similar to yychar and yynerrs.
5351 (yyparse): If pure, remove local yylval and yylloc. Add local
5352 yystackp to accommodate pure definitions of yylval and yylloc.
5353 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
5354 yylvalp and yyllocp to &yylval and &yylloc.
5355 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
5356 namespace. Previously, nerrs and char were missing, but lval and lloc
5357 weren't necessary.
5358 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
5359 yylvalp and yyllocp parameters since, if pure, these are now always
5360 accessible through yystackp. If not pure, they are still accessible
5361 globally.
5362 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
5363 `if (YYID (N))' to pacify lint.
5364
a85284cf
AD
53652005-12-21 Akim Demaille <akim@epita.fr>
5366
5367 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
5368 destroy the RHS symbols of a rule.
5369 * data/yacc.c (yylen): Initialize to 0.
5370 Keep its value to the number of items to possibly shift.
5371 In particular, a regular successful parse that ends on YYFINAL by
5372 a (internal) YYACCEPT must not have yylen != 0.
5373 (yyerrorlab, yyreturn): Pop the RHS.
5374 Reorder a bit to emphasize the `shifting' bits of code.
5375 (YYPOPSTACK): Now accept a number of items to pop.
5376 * data/lalr1.cc: Likewise.
5377 * data/glr.c: Formatting changes.
5378 Use goto instead of fall through.
5379 * doc/bison.texinfo (Destructor Decl): Complete.
5380
d508c281
JMG
53812005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5382
5383 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5384 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
5385 * djgpp/config.bat: Replace every occurence of the file name
5386 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5387 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5388 * djgpp/config.sed: Replace every occurence of the file name
5389 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5390 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5391 * djgpp/djunpack.bat: DJGPP specific file.
5392 * djgpp/fnchange.lst: DJGPP specific file.
5393 * djgpp/README.in: Add new information about how to unpack the bison
5394 source on MSDOS and other systems which have 8.3 file name restrictions
5395 using djunpack.bat and fnchange.lst.
5396
3e7a2cd9
PE
53972005-12-12 Paul Eggert <eggert@cs.ucla.edu>
5398
5399 * bootstrap (build_cvs_prefix): Remove; unused.
5400 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
5401 when getting gnulib.
5402
54032005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
5404
5405 * data/glr.c: Reorder typedef declarations for structs to match order
5406 of struct declarations.
5407 Rename yystack everywhere to yystackp except in yyparse where it's not
5408 a pointer.
5409 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
5410 consistency.
5411 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
5412 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
5413 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
5414 lint.
5415
877519f8
PE
54162005-12-09 Paul Eggert <eggert@cs.ucla.edu>
5417
0eca5a39
PE
5418 * tests/sets.at (Accept): Fix typos in regular expression used to
5419 sed out the final state number.
5420
2cec9080
PE
5421 Work around portability problem on Solaris 10: flex-generated
5422 files include <stdio.h> before <config.h>, which messes up
5423 because the latter defines __EXTENSIONS__. Address the problem
5424 by creating two new little files that include <config.h> first,
5425 then include the flex-generated files. Rewrite everyone else
5426 to include <config.h> first, as well.
5427 * lib/timevar.c: Always include "config.h".
5428 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
5429 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
5430 (EXTRA_bison_SOURCES): New macro.
5431 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
5432 * src/system.h: Don't include config.h.
5433 * src/LR0.c: Include <config.h> first.
5434 * src/assoc.c: Likewise.
5435 * src/closure.c: Likewise.
5436 * src/complain.c: Likewise.
5437 * src/conflicts.c: Likewise.
5438 * src/derives.c: Likewise.
5439 * src/files.c: Likewise.
5440 * src/getargs.c: Likewise.
5441 * src/gram.c: Likewise.
5442 * src/lalr.c: Likewise.
5443 * src/location.c: Likewise.
5444 * src/main.c: Likewise.
5445 * src/muscle_tab.c: Likewise.
5446 * src/nullable.c: Likewise.
5447 * src/output.c: Likewise.
5448 * src/parse-gram.y: Likewise.
5449 * src/print.c: Likewise.
5450 * src/print_graph.c: Likewise.
5451 * src/reader.c: Likewise.
5452 * src/reduce.c: Likewise.
5453 * src/relation.c: Likewise.
5454 * src/state.c: Likewise.
5455 * src/symlist.c: Likewise.
5456 * src/symtab.c: Likewise.
5457 * src/tables.c: Likewise.
5458 * src/uniqstr.c: Likewise.
5459 * src/vcg.c: Likewise.
5460
877519f8
PE
5461 * src/parse-gram.y: Fix minor problems uncovered by lint.
5462 (current_lhs, current_lhs_location): Now static.
5463 (current_assoc): Remove unused variable.
5464
5465 Cleanups so that Bison-generated parsers have less lint.
5466 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
5467 Prepend /*ARGSUSED*/, for lint's sake.
5468 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
5469 definition if 'lint' is defined.
5470 (YYID): New macro (or function, if lint).
5471 All uses of /*CONSTCOND*/0 replaced by YYID(0).
5472 * data/yacc.c: Likewise.
5473 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
5474 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
5475 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
5476 is C++ only.
5477 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
5478 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
5479 Use YYID(0) rather than 0, for lint.
5480 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
5481 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
5482
f5228370
PE
54832005-12-07 Paul Eggert <eggert@cs.ucla.edu>
5484
5485 * tests/glr-regression.at
5486 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5487 Close memory leak reported by twlevo.
5488
69ce078b
PE
54892005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
5490
6ff99711
PE
5491 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
5492 all stacks.
5493 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
5494 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5495 New test case.
5496 (Duplicated user destructor for lookahead): This test now is expected
5497 to succeed.
5498
af3412cd
PE
54992005-12-01 Paul Eggert <eggert@cs.ucla.edu>
5500
32b5b719 5501 * NEWS: Document the following change.
af3412cd
PE
5502 * data/yacc.c: Say "parser skeleton" rather than "file", since
5503 it's no longer just a file.
5504 * data/glr.c: Grant a special exception for C GLR parsers, that
5505 reads like the already-existing exception for C LALR(1) parsers.
5506 * data/glr.cc: Likewise.
5507 * data/lalr1.cc: Likewise.
5508 * data/location.cc: Likewise.
5509 * data/yacc.c: Reword the "written by" statement to clarify that
5510 it was the parser skeleton, not the entire output file.
5511 * data/glr.c: Written by Paul Hilfinger.
5512 * data/glr.cc: Written by Akim Demaille.
5513 * data/lalr1.cc: Likewise.
5514
035aa4a0
PE
55152005-11-18 Paul Eggert <eggert@cs.ucla.edu>
5516
d9963c85
PE
5517 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
5518 Fix typos in previous change that broke 'make check'.
5519 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
5520 supported in C.
5521 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
5522 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
5523 We can revert this once things settle down.
5524
035aa4a0
PE
5525 * src/conflicts.c (conflicts_print): Don't print file name twice
5526 when %expect fails because there were no conflicts.
5527 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
5528 change.
5529 * tests/conflicts.at (%expect not enough, %expect too much):
5530 (%expect with reduce conflicts): Adjust to new behavior.
5531
55322005-11-18 Akim Demaille <akim@epita.fr>
5533
5534 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
5535 errors.
5536 * NEWS: Document this.
5537 * doc/bison.texinfo (Expect Decl): Likewise.
5538
d1ff7a7c
AD
55392005-11-16 Akim Demaille <akim@epita.fr>
5540
5541 Generalize the display of semantic values and locations in traces.
5542 * data/glr.c (yy_reduce_print): Fix indices (again).
5543 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
5544 literal integers.
5545 * data/lalr1.cc (yyreduce_print): Rename as...
5546 (yy_reduce_print): this.
5547 Display values and locations.
5548 * data/yacc.c (yy_reduce_print): Likewise.
5549 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
5550 (yysymprint): Move higher to be visible from yy_reduce_print).
5551 (yyparse): Adjust.
5552 * tests/calc.at: Adjust the expected length of the traces.
5553
6de5398d
AD
55542005-11-14 Akim Demaille <akim@epita.fr>
5555
5556 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
5557 from 1 to N, while values and location start at 0.
5558 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
5559
a1373f55
AD
55602005-11-14 Akim Demaille <akim@epita.fr>
5561
5562 * data/glr.c (yy_reduce_print): Fix the $ number.
5563
613d8952
AD
55642005-11-14 Akim Demaille <akim@epita.fr>
5565
5566 "Use" parse parameters.
5567 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
5568 * data/glr.c, data/glr.cc: Use them.
5569 * data/glr.c (YYUSE): Have a C++ definition that supports
5570 non-pointer types.
5571
b2741627
AD
55722005-11-14 Akim Demaille <akim@epita.fr>
5573
5574 * data/glr.c (yyexpandGLRStack): Declare only if defined.
5575
5059b5c8
AD
55762005-11-14 Akim Demaille <akim@epita.fr>
5577
42249483
AD
5578 * data/glr.cc: New.
5579 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 5580
4626a15d
AD
55812005-11-12 Akim Demaille <akim@epita.fr>
5582
5583 Let position and location be PODs.
5584 * data/location.cc (position::initialize, location::initialize): New.
5585 (position::position, location::location): Define only if
5586 b4_location_constructors is defined.
5587 * data/lalr1.cc (b4_location_constructors): Define it for backward
5588 compatibility.
5589 * doc/bison.texinfo (Initial Action Decl): Use initialize.
5590
55912005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
5592
5593 * data/lalr1.cc: Move the body of the ctor and dtor into the
5594 parser file (instead of the header).
5595 Wrap the implementations in a "namespace yy".
5596
55972005-11-12 Akim Demaille <akim@epita.fr>
5598
5599 Have glr.c include its header file when created.
5600 * data/glr.c (b4_shared_declarations): New.
5601 Output them verbatim in the parser if !%defines, otherwise
5602 output then in the header file, and include it instead.
5603
1989d947
AD
56042005-11-11 Akim Demaille <akim@epita.fr>
5605
5606 * data/glr.c: Comment changes.
5607
56082005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
5609
5610 When yydebug, report semantic and location values for reductions.
5611 * data/glr.c (yy_reduce_print): Report the semantic values and the
5612 locations.
5613 (YY_REDUCE_PRINT): Adjust.
5614 (yyglrReduce): Use them.
5615 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
5616 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
5617 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
5618 traces.
5619
02998094
AD
56202005-11-10 Akim Demaille <akim@epita.fr>
5621
5622 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
5623 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
5624 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
5625
5210672f
PE
56262005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
5627
5628 * m4/cxx.m4, examples/Makefile.am: Don't build
5629 examples/calc++ if no C++ compiler is available. (trivial change)
5630
a8991a1d
AD
56312005-11-09 Akim Demaille <akim@epita.fr>
5632
5633 * src/scan-skel.l: Use a couple of asserts.
5634
36b5e963
AD
56352005-11-03 Akim Demaille <akim@epita.fr>
5636
5637 In some (weird) cases, the final state number is incorrect.
5638 Reported by Alexandre Duret-Lutz.
5639 * src/LR0.c (state_list_append): Remove the computation of
5640 final_state.
5641 (save_reductions): Do it here.
5642 (get_state): Alpha conversion.
5643 (generate_states): Use a for loop.
5644 * src/gram.h (item_number_is_rule_number)
5645 (item_number_is_symbol_number): New.
5646 * src/state.c: Use assert.
5647 * src/system.h: Include assert.h.
5648 * tests/sets.at (Accept): New.
5649
44e7ead1
PH
56502005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5651
5652 * data/glr.c (yyfill): Adjust comment.
36b5e963 5653 (yyresolveAction): Initialize default location properly
44e7ead1
PH
5654 for empty right-hand sides.
5655 (yydoAction): Ditto.
5656 Add comment explaining apparently dead code.
36b5e963
AD
5657 * tests/glr-regression.at
5658 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 5659 New test.
36b5e963 5660
e10a80ee
PE
56612005-10-30 Paul Eggert <eggert@cs.ucla.edu>
5662
5663 * bootstrap (cleanup_gnulib): New function. Use it to clean up
5664 gnulib when interrupted. This fixes some race conditions and
5665 works around some portability problems (one noted by Paul
5666 Hilfinger).
5667
067b32ee
AD
56682005-10-22 Akim <akim@epita.fr>
5669
5670 * Makefile.cfg: Adjust to config -> build-aux.
5671 Reported by twledo.
5672
4b367315
AD
56732005-10-21 Akim Demaille <akim@epita.fr>
5674
5675 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
5676 the %parse-params.
5677 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
5678 * data/yacc.c (b4_Pure_if): Rename as...
5679 (b4_yacc_pure_if): this.
5680 (YY_SYMBOL_PRINT, yyparse): Adjust.
5681 * doc/bison.texinfo: Formatting changes.
5682
24cc23d9
AD
56832005-10-21 Akim Demaille <akim@epita.fr>
5684
5685 Finish the transition config -> build-aux.
5686 * configure.ac, Makefile.am: Use build-aux.
5687 * config/prev-version, config/announce-gen, config/Makefile.am:
5688 Move to...
5689 * build-aux/prev-version, build-aux/announce-gen,
5690 * build-aux/Makefile.am: here.
5691
d4476375
AD
56922005-10-14 Akim Demaille <akim@epita.fr>
5693
5694 * examples/calc++/test: Use set -x only when VERBOSE.
5695
302c0aee
PE
56962005-10-13 Paul Eggert <eggert@cs.ucla.edu>
5697
5698 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
5699 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
5700
7625ec2c
AD
57012005-10-13 Akim Demaille <akim@epita.fr>
5702
5703 * src/scan-skel.l: Output the base name parts of the parser and
5704 header file names.
302c0aee 5705 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
5706 additional checks.
5707 Use this to exercise C++ outputs in subdirs.
5708 Reported by Oleg Smolsky.
5709
ba0fe3c7
PE
57102005-10-12 Paul Eggert <eggert@cs.ucla.edu>
5711
5712 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
5713 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
5714 Problem reported by John P. Hartmann.
5715 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
5716 already defined it.
5717
9b8a5ce0
AD
57182005-10-12 Akim Demaille <akim@epita.fr>
5719
5720 * src/parse-gram.y (version_check): Exit 63 to please missing
5721 (stands for "version mismatch).
5722 * tests/input.at, doc/bison.texinfo: Adjust.
5723
4f6e011e
PE
57242005-10-10 Paul Eggert <eggert@cs.ucla.edu>
5725
5726 Work around portability problems with Visual Age C compiler
5727 (xlc and xlC_r) reported by John P. Hartmann.
5728 * data/location.cc (initial_column, initial_line): Remove.
5729 All uses replaced by 0 and 1.
5730 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
5731 that xlc complains about.
5732 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 5733 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 5734 as __STDC__.
4d7aa45e
PE
5735 * data/yacc.c (YYMODERN_C): New macro, which also looks at
5736 __STDC_VERSION__. Use it everywhere instead of looking at
5737 __STDC__ and __cplusplus.
4f6e011e 5738
a1b3bf8c
AD
57392005-10-10 Akim Demaille <akim@epita.fr>
5740
5741 * examples/calc++/test: Be quiet unless VERBOSE.
5742
412e44aa
PE
57432005-10-05 Paul Eggert <eggert@cs.ucla.edu>
5744
2a4647a3
PE
5745 * data/c.m4 (yydestruct, yysymprint):
5746 Use YYUSE instead of casting to void.
5747 * data/glr.c (YYUSE): New macro.
5748 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5749 Use it instead of rolling our own.
5750 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5751 (YYCHK1):
5752 Use /*CONSTCOND*/ to suppress lint warnings.
5753 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5754 (YY_STACK_PRINT): Use 'false' not '0'.
5755 (YYUSE): New macro.
5756 (yysymprint_, yydestruct_): Use it instead of rolling our own.
5757 * data/yacc.c (YYUSE): New macro.
5758 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
5759 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
5760 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
5761
5762
412e44aa
PE
5763 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
5764 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
5765
88c6637f
PE
57662005-10-04 Paul Eggert <eggert@cs.ucla.edu>
5767
2f4f028d
PE
5768 Undo the parts of the unlocked-I/O change that substituted
5769 putc or puts for printf. This might hurt performance a bit,
5770 but some people prefer the printf style.
5771 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
5772 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
5773 All uses replaced by YYFPRINTF and YYDPRINTF.
5774 * data/yacc.c: Likewise.
5775 * lib/bitset.c (bitset_print): Likewise.
5776 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
5777 putc and puts.
5778 * lib/lbitset.c (debug_lbitset): Likewise.
5779 * src/closure.c (print_firsts, print_fderives): Likewise.
5780 * src/gram.c (grammar_dump): Likewise.
5781 * src/lalr.c (look_ahead_tokens_print): Likewise.
5782 * src/output.c (escaped_output): Likewise.
5783 (user_actions_output): Break apart two printfs.
5784 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
5785 * src/reduce.c (reduce_print): Likewise.
5786 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
5787 * src/system.h: Include unlocked-io.h rathe than stdio.h.
5788
88c6637f
PE
5789 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5790 Use assignments rather than casts-to-void to suppress
5791 unused-variable warnings. This pacifies 'lint'.
5792 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
5793 unused-variable warnings.
5794
fb32e373
JMG
57952005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5796
5797 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5798
edb8f44f
PE
57992005-10-02 Paul Eggert <eggert@cs.ucla.edu>
5800
fb9c0b33
PE
5801 Use unlocked I/O for a minor performance improvement on hosts like
5802 GNU/Linux and Solaris that support unlocked I/O. The basic idea
5803 is to use the gnlib unlocked-io module, and to prefer putc and
5804 puts to printf when either will work (since the latter doesn't
5805 come in an unlocked flavor).
5806 * bootstrap (gnulib_modules): Add unlocked-io.
5807 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
5808 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
5809 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
5810 and similarly for puts and putc and printf.
5811 * data/yacc.c: Likewise.
5812 * lib/bitset.c (bitset_print): Likewise.
5813 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
5814 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
5815 to printf.
5816 * lib/lbitset.c (debug_lbitset): Likewise.
5817 * src/closure.c (print_firsts, print_fderives): Likewise.
5818 * src/gram.c (grammar_dump): Likewise.
5819 * src/lalr.c (look_ahead_tokens_print): Likewise.
5820 * src/output.c (escaped_output): Likewise.
5821 (user_actions_output): Coalesce two printfs.
2f4f028d 5822 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
5823 * src/reduce.c (reduce_print): Likewise.
5824 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 5825 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 5826
edb8f44f
PE
5827 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
5828 this confuses xgettext.
5829
b50d2359
AD
58302005-10-02 Akim Demaille <akim@epita.fr>
5831
5832 * bootstrap (gnulib_modules): Add strverscmp.
5833 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
5834 * m4/.cvsignore: Add strverscmp.m4.
5835 * src/parse-gram.y (%require): New token, new rule.
5836 (version_check): New.
5837 * src/scan-gram.l (%require): Adjust.
5838 * tests/input.at (AT_REQUIRE): New.
5839 Use it.
5840 * doc/bison.texinfo (Require Decl): New.
5841 (Calc++ Parser): Use %require.
5842
21667f64
AD
58432005-10-02 Akim Demaille <akim@epita.fr>
5844
5845 * data/location.cc: New.
5846
2b81e969
AD
58472005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
5848 Akim Demaille <akim@epita.fr>
5849
5850 Make sure -odir/foo.cc creates dir/location.hh etc.
5851 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
5852 (spec_file_prefix, spec_verbose_file, spec_graph_file)
5853 (spec_defines_file): Now const.
5854 (dir_prefix): New.
5855 (short_base_name): Remove.
5856 * src/files.c: Adjust.
5857 (dirname.h): Include.
5858 (base_name): Don't prototype it.
5859 (finput): Remove, duplicates gram_in.
5860 (full_base_name, short_base_name): Replace by...
5861 (all_but_ext, all_but_tab_ext): these.
5862 (compute_base_names): Rename as...
5863 (compute_file_name_parts): this.
5864 Update to compute the new variables, including dir_prefix.
5865 Adjust dependencies.
5866 * src/output.c (prepare): Output them.
5867 * src/reader.c: Adjust to use gram_in, not finput.
5868 * src/scan-skel.l (@dir_prefix@): New.
5869
ad6a9b97
JMG
58702005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5871
5872 * lib/subpipe.c: New function end_of_output_subpipe() added
5873 to allow support for non-posix systems. This is a no-op function
5874 for posix systems.
5875
5876 * lib/subpipe.h: New function end_of_output_subpipe() added
5877 to allow support for non-posix systems. This is a no-op function
5878 for posix systems.
5879
5880 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
5881 handle the lack of pipe/fork functionality on non-posix systems.
5882
5883 * djgpp/Makefile.maint: DJGPP specific file.
5884
5885 * djgpp/README.in: DJGPP specific file.
5886
5887 * djgpp/config.bat: DJGPP specific configuration file.
5888
5889 * djgpp/config.sed: DJGPP specific configuration file.
5890
5891 * djgpp/config.site: DJGPP specific configuration file.
5892
5893 * djgpp/config_h.sed: DJGPP specific configuration file.
5894
5895 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
5896
5897 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
5898
fc695704
AD
58992005-10-02 Akim Demaille <akim@epita.fr>
5900
5901 * data/location.cc: New, extract from...
5902 * data/lalr1.cc: here.
5903 (location.hh): Include it after the user prologue, in case the
5904 filename type is defined by the user.
5905 Forward declation location and position before the pre-prologue.
5906 (yyresult_): Rename as...
5907 (yyresult): this, it's a local variable, not an attribute.
5908 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
5909
59102005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
5911
5912 * examples/extexi: Restore the #line generation.
5913
fb9712a9
AD
59142005-09-30 Akim Demaille <akim@epita.fr>,
5915 Alexandre Duret-Lutz <adl@gnu.org>
5916
5917 Move the token type and YYSTYPE in the parser class.
5918 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
5919 (parser::token): New, from the moved free definition of tokens.
5920 (parser::semantic_value): Now a full definition instead of an
5921 indirection to YYSTYPE.
5922 (b4_post_prologue): No longer included in the header file, but
5923 in the implementation file.
5924 * doc/bison.texi (C+ Language Interface): Update.
5925 * src/parse-gram.y: Support unary %define.
5926 * tests/actions.at: Define global_tokens_and_yystype for backward
5927 compatibility until we update the tests.
5928 * tests/calc.at: Idem.
5929 (first_line, first_column, last_line, last_column): Define for lalr1.cc
5930 to simplify the code.
5931
55f0c7b1
PE
59322005-09-29 Paul Eggert <eggert@cs.ucla.edu>
5933
5934 Port to SunOS 4.1.4, which lacks strtoul and strerror.
5935 Ah, the good old days! Problem reported by Peter Klein.
5936 * bootstrap (gnulib_modules): Add strerror, strtoul.
5937 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
5938 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
5939
fb9712a9 59402005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
5941
5942 * data/c.m4 (b4_error_verbose_if): New.
5943 * data/lalr1.cc: Use it.
5944 (YYERROR_VERBOSE_IF): Remove.
5945 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
5946 parser members, replaced by...
5947 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
5948 local variables.
5949 (yysyntax_error_): Takes the state number as argument.
5950 (yyreduce_print_): Use the argument yyrule, not the former
5951 attribute yyn_.
5952
8a6f72f3
PE
59532005-09-26 Paul Eggert <eggert@cs.ucla.edu>
5954
5955 * bootstrap (gnulib_modules): Add verify.
5956 * lib/.cvsignore: Add verify.h.
5957 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
5958 * src/system.h (verify): Remove.
5959 Include verify.h instead.
5960 * src/tables.c (tables_generate): Use new API for 'verify'.
5961
0d50976f
PE
59622005-09-21 Paul Eggert <eggert@cs.ucla.edu>
5963
ebc3737e
PE
5964 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
5965 local variables whose names begin with 'yy'.
5966 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
5967 Trivial changes from Joel E. Denny.
5968
0d50976f
PE
5969 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
5970 it itself.
5971 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
5972 don't use alloca any more.
5973
5974 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
5975 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 5976 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
5977 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
5978 to match yacc.c, to test more hosts.
5979
a05b79df
PE
59802005-09-20 Paul Eggert <eggert@cs.ucla.edu>
5981
55289366
PE
5982 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
5983 doesn't affect behavior.
5984 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
5985 Solaris, AIX, MSC.
5986 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
5987 This works a bit better with glibc, if user code has already included
5988 stdlib.h.
5989 * doc/bison.texinfo (Bison Parser): Document that users can't
5990 arbitrarily use malloc and free for other purposes. Document
5991 that <alloca.h> and <malloc.h> might be included.
5992 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
5993 user must declare alloca.
5994
a05b79df
PE
5995 * HACKING (release): Forwarn the Translation Project about
5996 stable releses.
5997
3ab2ca22
AD
59982005-09-20 Akim Demaille <akim@epita.fr>
5999
6000 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
6001
a9739e7c
PE
60022005-09-19 Paul Eggert <eggert@cs.ucla.edu>
6003
a702593e
PE
6004 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
6005 (YYSTACK_ALLOC_MAXIMUM): Use it.
6006 (yysyntax_error): New function.
6007 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
6008 multiple syntax errors are reported, and alloca is being used.
6009 Instead, reallocate buffers twice as big each time, so that
6010 we waste at most half the allocated memory. Start with a small
6011 (128-byte) buffer that will suffice in most cases anyway.
6012 Use yysyntax_error to do most of the work.
6013
6014 * doc/bison.texinfo (Error Reporting, Table of Symbols):
6015 yynerrs is the number of errors reported, not the number of
6016 errors encountered.
6017
a9739e7c
PE
6018 * tests/glr-regression.at (Duplicated user destructor for lookahead):
6019 Mark it as expected to fail.
6020 Cast result of malloc; problem reported by twlevo@xs4all.nl.
6021 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
6022 Don't start user-code symbols with "yy", to avoid name space problems.
6023
f479c6c6
AD
60242005-09-19 Akim Demaille <akim@epita.fr>
6025
6026 Remove the traits, failed experiment.
6027 It never proved useful, and anyway because of the current
6028 definition, it was not possible to have several specialization of
6029 this traits, making it useless.
6030 * data/lalr1.cc (yy:traits): Remove.
6031 Inline its definitions in the parser class.
6032
e2586f82
AD
60332005-09-19 Akim Demaille <akim@epita.fr>
6034
6035 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
6036 least Mac OSX with a /usr/local install of gettext.
6037
2e8cf949
AD
60382005-09-19 Akim Demaille <akim@epita.fr>
6039
6040 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
6041 and yytoken for similarity with the other skeletons.
6042
c7fb0b90
AD
60432005-09-19 Akim Demaille <akim@epita.fr>
6044
4e26c69e 6045 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 6046
1bd0deda
PE
60472005-09-16 Paul Eggert <eggert@cs.ucla.edu>
6048
6049 * NEWS: Version 2.1.
6050
6051 * NEWS: Remove notice of yytname change, since it was never in an
6052 official release.
6053 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
6054 diagnostic.
6055 * src/output.c (prepare): Likewise.
6056 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
6057 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
6058 is not defined. This is an awful hack, but it's enough for now.
6059 All callers changed.
6060 * tests/glr-regression-at (make_value): Args are const pointers now,
6061 to avoid GCC warning.
6062 (Duplicated user destructor for lookahead): New test. Currently
6063 skipped. It fails on my host but I'm not sure it'll always fail.
6064
60652005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
6066
6067 * src/symtab.h (struct symbol): Declare the printer and destructor
6068 as const, to avoid accidental calls to free.
6069 (symbol_destructor_set, symbol_printer_set): Adjust.
6070 * src/symtab.c: Adjust.
6071
1bd0deda 60722005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
6073
6074 * data/c.m4 (b4_token_enums): New.
6075 (b4_token_defines): Rename as...
6076 (b4_token_enums_defines): this.
6077 (b4_token_defines): New, output only the #defines.
6078 * data/yacc.c, data/glr.c: Adjust.
6079 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
6080 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
6081 as default values.
6082
dbcdae2d
AD
60832005-09-16 Akim Demaille <akim@epita.fr>
6084
6085 * data/lalr1.cc (yylex_): Remove, inline its code.
6086 (yyreport_syntax_error_): Remove, replaced by...
6087 (yysyntax_error_): this which returns a string and leaves to the
6088 caller the call to the users' error function.
6089 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
6090 Move from members of the parser object...
6091 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
6092 to local variables of the parse function.
6093
70d8f291
AD
60942005-09-16 Akim Demaille <akim@epita.fr>
6095
6096 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
6097 since it's in Bison's name space.
6098
b47dbebe
PE
60992005-09-15 Paul Eggert <eggert@cs.ucla.edu>
6100
ae199bf1
PE
6101 * data/glr.c (yyresolveValue): Add default case to pacify
6102 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
6103
b47dbebe
PE
6104 * NEWS: Document when yyparse started to return 2.
6105 * doc/bison.texinfo (Parser Function): Document when yyparse
6106 returns 2.
6107
6108 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
6109 (b4_filename_type): Renamed back from b4_file_name_type. All uses
6110 changed.
6111 (class position): file_name -> filename (reverting). All uses changed.
6112
61132005-09-14 Paul Eggert <eggert@cs.ucla.edu>
6114
6115 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
6116 do anything if $@ exists. This reverts part of the 2005-07-07
6117 patch.
6118
00292f66
PE
61192005-09-11 Paul Eggert <eggert@cs.ucla.edu>
6120
6121 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
6122 contains obsolete information and isn't worth distributing as a
6123 separate file anyway.
6124 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
6125 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
6126 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
6127 (yyparse): Abort if user code uses longjmp to throw an unexpected
6128 value.
6129
a420f962
PE
61302005-09-09 Paul Eggert <eggert@cs.ucla.edu>
6131
00292f66
PE
6132 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
6133 Suggested by twlevo@xs4all.nl.
6134
127287e9
PE
6135 * data/glr.c (YYCHK1): Do not assume YYE is in range.
6136 This avoids a diagnostic from gcc -Wswitch-enum.
6137 Problem reported by twlevo@xs4all.nl.
6138
a420f962
PE
6139 * doc/bison.texinfo: Don't use "filename", as per GNU coding
6140 standards. Use "file name" or "file" or "name", depending on
6141 the context.
6142 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
6143 not to hack/foo.tab.c.
6144 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
6145 * data/glr.c: b4_filename -> b4_file_name.
6146 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
6147 All uses changed.
6148 (class position): filename -> file_name. All uses changed.
6149 * data/yacc.c: b4_filename -> b4_file_name.
6150 * lib/bitset.h: filename -> file_name in local vars.
6151 * lib/bitset_stats.c: Likewise.
6152 * src/files.c: Likewise.
6153 * src/scan-skel.l ("@output ".*\n): Likewise.
6154 * src/files.c (file_name_split): Renamed from filename_split.
6155 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
6156
61572005-09-08 Paul Eggert <eggert@cs.ucla.edu>
6158
6159 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
6160 to accommodate latest gnulib.
6161
6162 * tests/glr-regression.at (Duplicate representation of merged trees):
6163 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
6164
6165 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
6166 needed.
6167
42a6501d
PE
61682005-08-26 Paul Eggert <eggert@cs.ucla.edu>
6169
6170 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
6171 All uses changed. Invoke user destructor after an error during a
6172 split parse (trivial change from Joel E. Denny).
6173
6174 * tests/glr-regression.at
6175 (User destructor after an error during a split parse): New test case.
6176 Problem reported by Joel E. Denny in:
6177 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
6178
ef9a1faf
PE
61792005-08-25 Paul Eggert <eggert@cs.ucla.edu>
6180
5b4aaf78
PE
6181 * README-cvs: Give URLs for recommended tools.
6182 Mention Gzip version problem, and bootstrapping issues.
6183 Remove troubleshooting section, as it's somewhat obsolete.
6184
b5240ba5
PE
6185 * bootstrap (no_cache): New var, to accommodate different wget
6186 variants. Use it instead of '-C off'. Problem reported by
6187 twlevo@xs4all.nl.
6188
ef9a1faf
PE
6189 * data/glr.c (yydestroyStackItem): New function.
6190 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
6191 debugging information. Problem reported by Joel E. Denny.
6192
e6efa9da
AD
61932005-08-25 Akim Demaille <akim@epita.fr>
6194
6195 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
6196
adc90f13
PE
61972005-08-24 Paul Eggert <eggert@cs.ucla.edu>
6198
6199 * data/glr.c (yyrecoverSyntaxError, yyreturn):
6200 Don't invoke destructor on unresolved entries.
6201 * tests/glr-regression.at
6202 (User destructor for unresolved GLR semantic value): New test case.
6203 Problem reported by Joel E. Denny in:
6204 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
6205
f9315de5
PE
62062005-08-21 Paul Eggert <eggert@cs.ucla.edu>
6207
15d29c1f
PE
6208 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
6209 Add strnlen.c.
6210 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
6211 lib-prefix.m4, po.m4.
6212
dd5f2af2
PE
6213 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
6214 in yydestruct diagnostic, since it might not be an error.
6215 Problem reported by Joel Denny near end of
6216 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 6217 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
6218 * data/yacc.c (yyreturn): Likewise.
6219 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
6220
6221 * src/files.c: Remove obsolete FIXME comment.
6222
6223 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
6224 with the other templates, and to fix bogus run-on messages such
6225 as the one reported at the end of
6226 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6227 All callers changed to avoid the newline.
6228 (yyprocessOneStack): Output two lines rather than one, to accommodate
6229 the above change. This changes the debug output format slightly.
6230
f9315de5
PE
6231 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
6232 reported by Joel E. Denny in
6233 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
6234 (trivial change).
6235 * tests/glr-regression.at (Duplicate representation of merged trees):
6236 New test, from Joel E. Denny in:
6237 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
6238 * THANKS: Add Joel E. Denny.
6239
6240 * configure.ac (AC_INIT): Bump to 2.0c.
6241
04098407
PE
62422005-07-24 Paul Eggert <eggert@cs.ucla.edu>
6243
6244 * NEWS: Version 2.0b.
6245
ca5d2013
PE
6246 * Makefile.am (SUBDIRS): Put examples before tests, so that
6247 "make check" doesn't finish with "All 1 tests passed".
6248
3d54b576
PE
6249 * tests/regression.at (Token definitions): Don't rely on
6250 AT_PARSER_CHECK for data that contains backslashes. It currently
6251 uses 'echo', and 'echo' isn't portable if its argument contains
6252 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
6253 that the byte '\0xff' is not printable in the C locale; it is,
6254 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
6255 not printable, so use '\0x81' to test.
6256
d53ae497
PE
6257 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
6258 version of GCC, since the macro is used with non-GCC compilers.
6259
fc01665e
PE
6260 Fix core dump reported by Pablo De Napoli in
6261 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
6262 * tests/regression.at (Invalid inputs with {}): New test.
6263 * src/parse-gram.y (token_name): Translate type before using
6264 it as an index.
6265
04098407
PE
6266 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
6267 the user's name space. All uses changed to __attribute__
6268 ((__unused__)).
6269 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
6270 Add __attribute__ ((__noreturn__)).
6271
6272 * etc/clcommit: Remove. We weren't using it, and it failed
6273 "make maintainer-distcheck".
6274 * Makefile.maint: Merge from coreutils.
6275 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
6276 (syntax-check-rules): Change list of rules as described below.
6277 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
6278 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
6279 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
6280 (sc_trailing_space): New rules.
6281 (sc_xalloc_h_in_src): Remove.
6282 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
6283 (sc_space_tab, sc_error_exit_success, sc_changelog):
6284 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
6285 (makefile-check, po-check, author_mark_check):
6286 (makefile_path_separator_check, copyright-check):
6287 Use grep -n, to make it easier to find violations.
6288 Use CVS_LIST and CVS_LIST_EXCEPT.
6289 (header_regexp, h_re): Remove.
6290 (dd_c): New macro.
6291 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
6292 (my-distcheck): Use more-modern GCC flags.
6293 (signatures, %.asc): Remove.
6294 (rel-files, announcement): Remove signatures.
6295 Restore old updating code, even though we don't use it, so
6296 that we're the same as coreutils.
6297 (alpha, beta, major): Depend on news-date-check.
6298 Make the upload commands.
6299
6300 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
6301 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
6302 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
6303 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
6304 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
6305 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
6306 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
6307 * tests/sets.at: Likewise.
6308
6309 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
6310 we comment out the Autoconf version number.
6311 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
6312 it's error-prone and "make maintainer-distcheck" rejects it.
6313
6314 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
6315 Indent calls to "error" to pacify "make maintainer-distcheck",
6316 when the calls are not intended to be translated.
6317 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
6318
6319 * src/Makefile.am (DEFS): Use +=, to pacify
6320 "make maintainer-distcheck".
6321 (bison_SOURCES): Add scan-skel.h.
6322 (sc_tight_scope): New rule, from coreutils.
6323
6324 * src/files.c (src_extension, header_extension):
6325 Now static, not extern.
6326 * src/getargs.c (short_options): Likewise.
6327 * src/muscle_tab.c (muscle_table): Likewise.
6328 * src/parse-gram.y (current_class, current_type, current_prec):
6329 Likewise.
6330 * src/reader.c (grammar_end, previous_rule_end): Likewise.
6331 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
6332 * src/main.c (main): Cast bindtextdomain and textdomain calls to
6333 void, to avoid warning when NLS is disabled.
6334 * src/output.c: Include scan-skel.h.
6335 (scan_skel): Remove decl, since scan-skel.h does this.
6336 (output_skeleton):
6337 Indent calls to "error" to pacify "make maintainer-distcheck".
6338 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
6339 * src/reader.h (gram_end, gram_lineno): New decls to pacify
6340 "make maintainer-distcheck".
6341 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
6342 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
6343 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
6344 (skel_lex_destroy, scan_skel): Move these decls to...
6345 * src/scan-skel.h: New file.
6346 * src/uniqstr.c (uniqstr_assert):
6347 Indent calls to "error" to pacify "make maintainer-distcheck".
6348
6349 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
6350 not @VAR@.
6351
6352 * tests/torture.at: Revamp to avoid misuse of atoi that
6353 "make maintainer-distcheck" complained about.
6354
6355 * examples/extexi (message): Don't print a message more than once,
6356 and omit line-number decoration that makes Emacs compile think
6357 that informative messages are worth worrying about.
6358
63592005-07-22 Paul Eggert <eggert@cs.ucla.edu>
6360
6361 * configure.ac: Update version number.
6362
6363 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
6364 accidentally.
6365 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
6366 autogenerated by the maintainer.
6367 * examples/calc++/.cvsignore: Add *.yy.
6368
6369 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
6370 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6371 * lib/bitsetv.c (bitsetv_alloc): Likewise.
6372
6373 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
6374
6375 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
6376 from maintainer-distcheck about casting the argument of 'free'.
6377
6378 * NEWS: Mention recent yytname changes.
6379 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
6380
6381 * bootstrap: For translations that have not yet been upgraded to
6382 the new runtime-po domain, prime the pump by extracting the
6383 relevant strings from the obsolete translations. This code can be
6384 removed once the bison-runtime domain has been translated by each
6385 team.
6386
6387 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
6388 now that token names are already quoted.
6389
6390 Fix problem reported by Anthony Heading.
6391 * data/glr.c (YYTOKEN_TABLE): New macro.
6392 (yytname): Define if YYTOKEN_TABLE.
6393 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
6394 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
6395 (YYERROR_VERBOSE): Define the same way the other skeletons do.
6396 * src/output.c (prepare_symbols): Output token_table_flag.
6397
0ffda363
PE
63982005-07-21 Paul Eggert <eggert@cs.ucla.edu>
6399
6400 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
6401 again if the first call fails.
6402
6403 * data/glr.c (yytnamerr): New function.
6404 (yyreportSyntaxError): Use it to dequote most string literals.
6405 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
6406 with other skeletons. All uses changed.
6407 (yytnameerr_): New function.
6408 (yyreport_syntax_error): Use it to dequote most string literals.
6409 * data/yacc.c (yytnamerr): New function.
6410 (yyerrlab): Use it to decode most string literals.
6411 * doc/bison.texinfo (Decl Summary, Calling Convention):
6412 Clarify quoting convention of yytname.
6413 * src/output.c (prepare_symbols): Quote all names. This undoes
6414 the 2005-04-17 change, which is now accomplished (mostly) via
6415 changes in the parsers as described above.
6416 * tests/regression.at (Token definitions, Web2c Actions):
6417 Undo most 2005-04-17 change here, too.
6418
64192005-07-20 Paul Eggert <eggert@cs.ucla.edu>
6420
6421 Fix more problems reported by twlevo@xs4all.nl.
6422 * tests/cxx-type.at: Don't pipe output of ./types through sed to
6423 remove trailing spaces. This loses the exit status of ./types,
6424 and isn't needed since ./types shouldn't be emitting trailing
6425 spaces.
6426 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
6427 as the stack isn't valid in that case.
6428
6429 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6430 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6431 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6432 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
6433 is used.
6434 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
6435 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6436 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6437 Likewise.
6438
6439 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
6440 overly-picky compilers that reject 'char *foo = "bar";'.
6441
6442 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
6443 to FILE * parameter, not to stderr. This fixes a typo introduced
6444 in the 2005-07-12 change.
6445
6446 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
6447 warnings from GCC 4.
6448
6449 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
6450 (yyglrShiftDefer, yysplitStack):
6451 Remove unused parameters b4_pure_formals. All uses changed.
6452 (yyglrShift): Remove unused parameters b4_user_formals.
6453 All uses changed.
6454 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
6455
6100a9aa
PE
64562005-07-18 Paul Eggert <eggert@cs.ucla.edu>
6457
258b75ca
PE
6458 Destructor cleanups and regularization among the three skeletons.
6459 * NEWS: Document the behavior changes.
6460 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
6461 stack before failing, as the cleanup code will do it for us now.
6462 * data/lalr1.cc (yyerrlab): Likewise.
6463 * data/glr.c (yyparse): Pop everything off the stack before
6464 freeing it, so that destructors get called properly.
6465 * data/lalr1.cc (yyreturn): Likewise.
6466 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
6467 This is more consistent.
6468 * doc/bison.texinfo (Destructor Decl): Mention more reasons
6469 why destructors might be called. 1.875 -> 2.1.
6470 (Destructor Decl, Decl Summary, Table of Symbols):
6471 Some English-language cleanups for %destructor.
6472 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6473 Add output line for destructor of start symbol.
6474 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
6475 because of that same extra output line.
6476
1a059451
PE
6477 * NEWS: Document minor wording changes in diagnostics of
6478 Bison-generated parsers.
6479 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
6480 Remove unused formals. All uses changed.
6481 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
6482 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
6483 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
6484 Rename yyoverflowab to yyexhaustedlab.
6485 When memory exhaustion occurs during syntax-error reporting,
6486 report it separately rather than in a single diagnostic; this
6487 eases translation.
6488 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
6489 (Memory Exhausted): Renamed from Parser Stack Overflow.
6490 Revamp wording slightly to prefer "memory exhaustion".
6491 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
6492
97460c78
PE
6493 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
6494
30757c8c
PE
6495 Add i18n support to the GLR skeleton. Partially fix the C++
6496 skeleton; a C++ expert needs to finish this. Remove debugging
6497 msgids; there's little point to having them translated, since they
6498 can be understood only by someone who can read the
6499 (English-language) source code.
6500
6501 Generate runtime-po/bison-runtime.pot automatically, so that we
6502 don't have to worry about garbage getting in that file. We'll
6503 make sure after the next official release that old msgids don't
6504 get lost. See
6505 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
6506
6507 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
6508 Now auto-generated.
6509 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
6510 Fix typos in explanations of the runtime file.
6511 * bootstrap: Change gettext keyword from YYI18N to YY_.
6512 Use standard Makefile.in.in in runtime-po, since we'll arrange
6513 for backward-compatible bison-runtime.po files in a different way.
6514 * data/glr.c (YY_): New macro, from yacc.c.
6515 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
6516 Translate messages intended for users.
6517 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
6518 the wording in the other skeletons. We don't know that the memory
6519 is virtual.
6520 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
6521 Use same method that yacc.c uses.
6522 Don't translate debugging messages.
6523 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
6524 it doesn't work (yet), and requires C++ expertise to fix.
6525 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
6526 Move defn to a more logical place, to be consistent with other
6527 skeletons.
6528 Don't translate debugging messages.
6529 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
6530 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
6531 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
6532 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
6533
ac8c5689
PE
6534 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
6535 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
6536 void, not int.
6537 * tests/glr-regression.at (Badly Collapsed GLR States):
6538 Likewise.
6539 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6540 yylex should return 0 at EOF rather than aborting.
6541
6100a9aa
PE
6542 Improve tests for stack overflow in GLR parser.
6543 Problem reported by twlevo@xs4all.nl.
6544 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
6545 All uses removed.
6546 (yyStackOverflow): Just longjmp, but with value 2 so that caller
6547 can handle the problem.
6548 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
6549 (yyparse): New local variable yyresult to record the result.
6550 Use result of setjmp to set it, rather than storing itinto
6551 struct.
6552 (yyDone): Remove label.
6553 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
6554 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
6555 if YYABORT is used).
6556 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
6557 yyparse status; put status > 1 into diagnostic.
6558 Check that status==2 works.
6559 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
6560 Use exit status 3 for failure to open (which shouldn't happen).
6561
15f40952
PE
65622005-07-17 Paul Eggert <eggert@cs.ucla.edu>
6563
67fd79c4
PE
6564 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
6565 1 on syntax error; just let yyparse do its thing.
6566 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
6567 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
6568 (Exploding the Stack Size with Alloca):
6569 (Exploding the Stack Size with Malloc):
6570 Expect exit status 2, not 1, since the parser is supposed to blow
6571 its stack. Problem reported by twlevo@xs4all.nl.
6572
15f40952
PE
6573 * data/glr.c (yyparse): Don't assume that the initial calls
6574 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
6575 Print a stack-overflow message and fail instead.
6576 Initialize the line-number information before creating the stack,
6577 so that the stack-overflow message can report line zero safely.
6578
f32c66b5
PE
65792005-07-14 Paul Eggert <eggert@cs.ucla.edu>
6580
a22ff96f 6581 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
6582 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
6583 (yyuserMerge): Provide a default case if b4_mergers is empty.
6584 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
6585 * tests/glr-regression.at
6586 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 6587 Add casts to pacify C++ compilers.
1beb0b24
PE
6588 * tests/glr-regression.at (Improper merging of GLR delayed action
6589 sets): Declare yylex before using it.
f32c66b5 6590 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
6591 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
6592 test for valgrind; valgrind is independent of g++.
6593 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
6594 for compatibility with POSIX 1003.1-2001 (if running coreutils).
6595 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
6596 Use a destructor, so that we can expand the stack. Change
6597 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 6598
d741bd1b
PE
65992005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6600
6601 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
6602 a valgrind failure. Problem reported by twlevo@xs4all.nl.
6603
0410a6e0
PE
66042005-07-13 Paul Eggert <eggert@cs.ucla.edu>
6605
6606 * PACKAGING: New file, suggested by Bruno Haible and taken from
6607 similar wording in gettext's PACKAGING file.
6608 * NEWS: Mention PACKAGING.
6609 * Makefile.am (EXTRA_DIST): Add PACKAGING.
6610
f7ab6a50
PE
66112005-07-12 Paul Eggert <eggert@cs.ucla.edu>
6612
baf785db 6613 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
6614 * bootstrap: Get runtime translations into runtime-po.
6615 Create runtime-po files automatically, if possible.
6616 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
6617 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
6618 does not infringe on the user's name space.
6619 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
6620 * doc/bison.texinfo (Internationalization): Revamp the English
6621 and Texinfo syntax a bit, to try to make it clearer.
6622 (Bison Options, Option Cross Key): Mention --print-localedir.
6623 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
6624 YYENABLE_NLS. Quote a bit more.
6625 * runtime-po/.cvsignore: New file.
6626 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
6627 * runtime-po/Rules-quot: Remove; now created by bootstrap.
6628 * runtime-po/quot.sed: Likewise.
6629 * runtime-po/boldquot.sed: Likewise.
6630 * runtime-po/en@quot.header: Likewise.
6631 * runtime-po/en@boldquot.header: Likewise.
6632 * runtime-po/insert-header.sin: Likewise.
6633 * runtime-po/remove-potcdate.sin: Likewise.
6634 * runtime-po/Makevars: Likewise.
6635 * runtime-po/LINGUAS: Likewise.
6636 * runtime-po/de.po: Likewise; we will rely on the translation project
6637 to maintain this, so "bootstrap" should get it.
0410a6e0 6638 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
6639 its value.
6640 * src/main.c (main): Bind the bison-runtime domain, too.
6641
66422005-07-12 Bruno Haible <bruno@clisp.org>
6643
6644 * data/yacc.c: Include <libintl.h> when NLS is enabled.
6645 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
6646 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
6647 * runtime-po: New directory.
6648 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
6649 $(DOMAIN).pot-update rule, so that old messages are never dropped.
6650 * runtime-po/Rules-quot: New file, copied from po/.
6651 * runtime-po/quot.sed: Likewise.
6652 * runtime-po/boldquot.sed: Likewise.
6653 * runtime-po/en@quot.header: Likewise.
6654 * runtime-po/en@boldquot.header: Likewise.
6655 * runtime-po/insert-header.sin: Likewise.
6656 * runtime-po/remove-potcdate.sin: Likewise.
6657 * runtime-po/Makevars: New file.
6658 * runtime-po/POTFILES.in: New file.
6659 * runtime-po/LINGUAS: New file.
6660 * runtime-po/bison-runtime.pot: New file.
6661 * runtime-po/de.po: New file.
6662 * m4/bison.m4: New file.
6663 * Makefile.am (SUBDIRS): Add runtime-po.
6664 (aclocaldir, aclocal_DATA): New variables.
6665 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
6666 Define aclocaldir.
6667 * src/getargs.c (usage): Document --print-localedir option.
6668 (PRINT_LOCALEDIR_OPTION): New enum item.
6669 (long_options): Add --print-localedir option.
6670 (getargs): Handle --print-localedir option.
6671 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
6672 (Internationalization): New section.
6673
22dda0f0
AD
66742005-07-12 Akim Demaille <akim@epita.fr>
6675
6676 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
6677 for consistency with the rest of the code.
6678 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
6679 Add separators.
6680
82b248ad
AD
66812005-07-12 Akim Demaille <akim@epita.fr>
6682
6683 * src/parse-gram.y: Use %printer instead of YYPRINT.
6684
fa0e9314
AD
66852005-07-12 Akim Demaille <akim@epita.fr>
6686
867a3e00
AD
6687 * src/symtab.h, src/symtab.c (symbol_print): New.
6688 * src/symlist.h, src/symlist.c (symbol_list_print): New.
6689 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
6690
66912005-07-12 Akim Demaille <akim@epita.fr>
6692
6693 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
6694 b4_at_dollar and b4_dollar_dollar.
6695
e054b190
PE
66962005-07-11 Paul Eggert <eggert@cs.ucla.edu>
6697
6698 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
6699 and Pennello's paper.
6700
34160ec4
PE
67012005-07-09 Paul Eggert <eggert@cs.ucla.edu>
6702
407d4a75
PE
6703 * data/yacc.c (yyparse): Undo previous patch. Instead,
6704 set yylsp[0] and yyvsp[0] only if the initial action
6705 sets yylloc and yylval, respectively.
6706
34160ec4
PE
6707 * data/yacc.c (yyparse): In the initial action, set
6708 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
6709 This avoids the use of undefined variables if the initial
6710 action does not set yylloc and/or yylval.
6711
c3d5a4a7
PE
67122005-07-07 Paul Eggert <eggert@cs.ucla.edu>
6713
b34d96c1
PE
6714 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
6715 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
6716 Remove from CVS. These files are automatically generated.
6717 * examples/extexi: Clarify that this file is now part of Bison,
6718 not GNU M4, and that it works with any POSIX-compatible Awk.
6719 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
6720 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
6721 so that we also get calc++-parser.yy. Geneate it.
6722 Use $(AWK), not gawk, since any conforming Awk will do.
6723 Put comment before action, since older 'make' can't handle comment
6724 in action.
6725 $(BUILT_SOURCES): List all built sources, not just some of them.
6726 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
6727 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
6728 $($(calc_sources_generated)): Remove unnecessary test for existence
6729 of target. (This had a shell syntax error anyway; a stray "x".)
6730 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
6731 calc++-parser.yy.
6732 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
6733
c3d5a4a7
PE
6734 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
6735 implied by the other modules.
6736
828c373b
AD
67372005-07-06 Akim Demaille <akim@epita.fr>
6738
6739 Bind examples/calc++ to the package.
6740 * examples/calc++/Makefile: Remove, replaced by...
6741 * examples/calc++/Makefile.am: ... this new file.
6742 * examples/calc++/test: Remove input.
6743 * examples/calc++/compile: Remove.
6744 * examples/Makefile.am: New.
6745 * configure.ac, Makefile.am: Adjust.
6746 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
6747
63cb01d6
PE
67482005-07-05 Paul Eggert <eggert@cs.ucla.edu>
6749
fd2df2ed
PE
6750 * data/glr.c (yyFail): Drastically simplify; since the format argument
6751 never had any % directives, we can simply pass it to yyerror.
6752 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
6753 be modified later, as that is the usual style in glr.c.
6754 Problems reported by Paul Hilfinger.
6755
63cb01d6
PE
6756 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
6757 and size overflow errors.
6758 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
6759 in case the user prolog sets feature-test macros like _GNU_SOURCE.
6760 (YYSIZEMAX): New macro.
6761 (yystpcpy): New function, taken from yacc.c.
6762 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
6763 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
6764 so that we don't have to maintain their signatures.
6765 (yyFail): Check for buffer overflow, by using vsnprintf rather
6766 than vsprintf. Allocate a bigger buffer if possible.
6767 Report an error if buffer allocation fails.
6768 (yyStackOverflow): New function.
6769 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
6770 the initialization was successful. It might fail if storage was
6771 exhausted.
6772 (yyexpandGLRStack): Add more checks for storage allocation failure.
6773 Use yyStackOverflow to report failures.
6774 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
6775 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
6776 Don't assume stack number fits in int.
6777 (yysplitStack): Check for storage allocation failure.
6778 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
6779 can print diagnostics on storage allocation failure. All callers
6780 changed.
6781 (yyresolveValue): Use yybool for boolean.
6782 (yyreportSyntaxError): Check for size-calculation overflow.
6783 This code is taken from yacc.c.
6784 (yyparse): Check for storage allocation errors when allocating
6785 the initial stack.
6786
1c59e0a1
AD
67872005-07-05 Akim Demaille <akim@epita.fr>
6788
6789 Extract calc++ from the documentation.
6790 * doc/bison.texinfo (Calc++): Add the extraction marks.
6791 * examples/extexi: New, from the aborted GNU Programming 2E.
6792 Separate the different paragraph of a file with empty lines.
6793 * examples/Makefile: Use it to extract the whole calc++ example.
6794
8a0adb01
AD
67952005-06-24 Akim Demaille <akim@epita.fr>
6796
6797 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
6798 class typedefs.
6799
12545799
AD
68002005-06-22 Akim Demaille <akim@epita.fr>
6801
6802 * doc/bison.texinfo (C++ Language Interface): First stab.
6803 (C++ Parsers): Remove.
6804
99be0235
AD
68052005-06-22 Akim Demaille <akim@epita.fr>
6806
6807 * data/lalr1.cc (yylex_): Honor %lex-param.
6808
0ffd4fd1
AD
68092005-06-22 Akim Demaille <akim@epita.fr>
6810
6811 Start a set of simple examples.
6812 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
6813 * examples/calc++/calc++-driver.hh,
6814 * examples/calc++/calc++-parser.yy,
6815 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
6816 * examples/calc++/compile, examples/calc++/test: New.
6817
0925ebb4
PE
68182005-06-09 Paul Eggert <eggert@cs.ucla.edu>
6819
6820 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
6821 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
6822 which stems from the 2005-05-27 patch.
6823
43d3b664
PH
68242005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6825
6826 * data/glr.c: Modify treatment of unused parameters to permit use
6827 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
6828
3062864d
PE
68292005-05-30 Paul Eggert <eggert@cs.ucla.edu>
6830
6831 Fix infringement on user name space reported by Janos Zoltan Szabo.
6832 * data/yacc.c (yyparse): strlen -> yystrlen.
6833
989b5b8e
AD
68342005-05-30 Akim Demaille <akim@epita.fr>
6835
6836 * data/lalr1.cc (_): New.
6837 Translate the various messages.
6838
bedf57f5
PE
68392005-05-27 Paul Eggert <eggert@cs.ucla.edu>
6840
6841 Fix infringement on user name space reported by Bruno Haible.
6842 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
6843 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
6844 the user's name space.
6845 (alloca): Include <stdlib.h> to get it, if it's not built in.
6846 (YYMALLOC, YYFREE): Define only if needed.
6847 (malloc, free): Declare, but only if needed, as this infringes on
6848 the user name space.
6849
4d1801f1
PE
68502005-05-25 Paul Eggert <eggert@cs.ucla.edu>
6851
6852 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
6853 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
6854 with %d format.
6855 * lib/ebitset.c (min, max): Undef before defining.
6856 * lib/vbitset.c (min, max): Likewise.
6857 * lib/subpipe.c (create_subpipe): Save local variables in case
6858 vfork clobbers them.
6859
68602005-05-24 Bruno Haible <bruno@clisp.org>
6861
6862 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
6863 error message syntax used by gcc-4.0.
6864
b94a9e1e
PE
68652005-05-23 Paul Eggert <eggert@cs.ucla.edu>
6866
85ac3861
PE
6867 * README: Mention m4 1.4.3. Remove obsolete advice about
6868 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
6869
b94a9e1e
PE
6870 * bootstrap: Remove workaround for problem I encountered with
6871 gettext 0.14.1; it seems to be fixed now.
6872
51c30d21
PE
68732005-05-22 Paul Eggert <eggert@cs.ucla.edu>
6874
009ce67d
PE
6875 * NEWS: Version 2.0a.
6876
f2a97c62
PE
6877 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
6878 the previous change.
6879
c8775f93
PE
6880 Various maintainer cleanups.
6881 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
6882 conftest*, for benefit of CVS commands run at the same time as
6883 "configure". Add build-aux, since "bootstrap" now creates it and
6884 its subfiles.
6885 * Makefile.cfg (move_if_change): Remove.
6886 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
6887 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
6888 (po_repo, do-po-update, po-update, wget_files, get-targets):
6889 (config.guess-url_prefix, config.sub-url_prefix):
6890 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
6891 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
6892 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
6893 Remove.
6894 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
6895 this is now the recommended name.
6896 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
6897 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
6898 ylwrap. These files now go into build-aux.
6899 * config/move-if-change: Remove.
6900 * config/prev-version.txt: Bump from 1.75 to 2.0.
6901
3ea5f0ec
PE
6902 * bootstrap: Add stdio-safer, unistd-safer modules.
6903 Remove m4/glibc2.m4 (introduced by latest gnulib, but
6904 we don't need it).
6905 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
6906 fopen-safer.c, stdio-safer.h, unistd-safer.h.
6907 * lib/subpipe.c: Include "unistd-safer.h".
6908 (create_subpipe): Make sure all the newly-created
6909 file descriptors are > 2, so that diagnostics don't
6910 get sent down them (which might cause Bison to hang, in theory).
6911 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
6912 * src/files.c (xfopen): Use fopen_safer, not fopen.
6913
51c30d21
PE
6914 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
6915 yesterday's yacc.c fix.
6916
cea1469d
PE
69172005-05-21 Paul Eggert <eggert@cs.ucla.edu>
6918
3ea5f0ec
PE
6919 * data/glr.c, data/lalr1.cc: Update copyright date.
6920
cea1469d
PE
6921 Fix a destructor bug reported by Wolfgang Spraul in
6922 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
6923 * data/yacc.c (yyabortlab): Don't call destructor, and
6924 don't set yychar to EMPTY.
6925 (yyoverflowlab): Don't call destructor.
6926 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
6927 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
6928 since we no longer output the message "discarding lookahead token
6929 end of input ()".
6930
5e6f62f2
PH
69312005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6932
6933 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
6934 fix a small glitch in debugging output.
6935 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
6936 after YY_SYMBOL_PRINT where needed.
6937
6938 (struct yyGLRState): Add some comments.
6939 (struct yySemanticOption): Add some comments.
6940 (union yyGLRStackItem): Add comment.
6941
6942 (yymergeOptionSets): Correct this to properly perform the union,
6943 avoiding infinite reported by Michael Rosien.
6944 Update comment.
6945
6946 * tests/glr-regression.at: Add test for GLR merging error reported
6947 by M. Rosien.
cea1469d 6948
0fb669f9
PE
69492005-05-13 Paul Eggert <eggert@cs.ucla.edu>
6950
6951 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
6952 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
6953 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
6954 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
6955 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
6956 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
6957 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
6958 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
6959 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
6960 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
6961 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
6962 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
6963 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
6964 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
6965 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
6966 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
6967 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
6968 src/derives.h, src/files.c, src/files.h, src/getargs.c,
6969 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
6970 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
6971 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
6972 src/output.h, src/parse-gram.c, src/parse-gram.h,
6973 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
6974 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
6975 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
6976 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
6977 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
6978 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
6979 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
6980 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
6981 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
6982 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
6983 tests/reduce.at, tests/regression.at, tests/sets.at,
6984 tests/synclines.at, tests/testsuite.at, tests/torture.at:
6985 Update FSF postal mail address.
6986
51f4735e
PE
69872005-05-11 Paul Eggert <eggert@cs.ucla.edu>
6988
6989 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
6990 Problem reported by Ralf Menzel.
6991
80ce3401
PE
69922005-05-01 Paul Eggert <eggert@cs.ucla.edu>
6993
6994 * tests/actions.at: Test that stack overflow invokes destructors.
6995 From Marcus Holland-Moritz.
6996 * data/yacc.c (yyerrlab): Move the code that destroys the stack
6997 from here....
6998 (yyreturn): to here. That way, destructors are called properly
6999 even if the stack overflows, or the user calls YYACCEPT or
7000 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
7001 (yyoverflowlab): Destroy the lookahead.
7002
70032005-04-24 Paul Eggert <eggert@cs.ucla.edu>
7004
7005 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
7006
72f000b0
PE
70072005-04-17 Paul Eggert <eggert@cs.ucla.edu>
7008
7009 * NEWS: Bison-generated C parsers no longer quote literal strings
7010 associated with tokens.
7011 * src/output.c (prepare_symbols): Don't escape strings,
7012 since users don't want to see C escapes.
7013 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
7014 in diagnostics.
c19683bb 7015 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
7016 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
7017
1094323f
PE
70182005-04-16 Paul Eggert <eggert@cs.ucla.edu>
7019
7020 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
7021 the data size is known to be too small and we can't increase it.
7022 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
7023
ca407bdf
PE
70242005-04-15 Paul Eggert <eggert@cs.ucla.edu>
7025
7026 * src/parse-gram.y: Include quotearg.h.
7027 (string_as_id): Quote $1 before using it as a key, since the
7028 lexer no longer quotes it for us.
7029 (string_content): Don't strip quotes, since lexer no longer
7030 quotes it for us.
7031 * src/scan-gram.l: Include quotearg.h.
7032 ("\""): Omit quote.
7033 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
7034 a key, since the rest of the lexer doesn't quote it.
7035 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
7036 * tests/regression.at (Token definitions): Check for backslashes
7037 in token strings.
7038
7039 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
7040 (YYSIZE_T): Define to unsigned long int when using an older compiler.
7041 (yyparse): Revamp code to generate long syntax error message, to
7042 make it easier to translate, and to avoid problems with arithmetic
7043 overflow. Change "virtual memory" to "memory" in diagnostic, since
7044 we don't know whether the memory is virtual.
7045
1ce59070
PE
70462005-04-13 Paul Eggert <eggert@cs.ucla.edu>
7047
7048 * NEWS: Bison-generated C parsers now use the _ macro to
7049 translate strings.
7050 * data/yacc.c (_) [!defined _]: New macro.
7051 All English strings wrapped inside this macro.
7052 * doc/bison.texinfo (Bison Parser): Document _.
7053 * po/POTFILES.in: Include src/parse-gram.c, since it now
7054 includes translateable strings that parse-gram.y doesn't.
7055
a749a695
PE
70562005-04-12 Paul Eggert <eggert@cs.ucla.edu>
7057
7058 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
7059 reverting the 2004-10-11 change to this function.
7060 (symbol_check_alias_consistency): Don't call symbol_type_set
7061 if the type name is already correct.
7062 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
7063
8fb1053b
PE
70642005-03-25 Paul Eggert <eggert@cs.ucla.edu>
7065
7066 * tests/regression.at (Token definitions): Don't use a token named
7067 c, as that generates a "#define c ..." that runs afoul of buggy
7068 stdlib.h that uses the identifier c as a member of struct
7069 drand48_data. Problem reported by Horst Wente.
7070
ff498c4a
PE
70712005-03-21 Paul Eggert <eggert@cs.ucla.edu>
7072
7073 * bootstrap: Change translation URL from
7074 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
7075 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
7076 redirection glitches. Problem reported by twlevo@xs4all.nl.
7077
65211d70
PE
70782005-03-20 Paul Eggert <eggert@cs.ucla.edu>
7079
7080 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
7081 after operands; POSIX says this isn't portable for the c99 command.
7082
9577fb1f
PE
70832005-03-18 Paul Eggert <eggert@cs.ucla.edu>
7084
7085 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
7086 immediately if a data overrun has occurred; this may help us track
7087 down what may be a spurious failure on MacOS.
7088
78b178f7
PE
70892005-03-17 Paul Eggert <eggert@cs.ucla.edu>
7090
a2599d0f
PE
7091 Respond to problems reported by twlevo@xs4all.nl.
7092
7093 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
7094
78b178f7
PE
7095 * src/vcg.h: Comment fix.
7096 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
7097 (G_CMAX): Change to -1 instead of INT_MAX.
7098
7099 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 7100
7296e729
PE
71012005-03-15 Paul Eggert <eggert@cs.ucla.edu>
7102
7103 * src/tables.c (state_number_to_vector_number): Put it inside an
7104 "#if 0", since it's not currently used. Problem reported by
7105 Roland McGrath.
7106
05ac60f3
PE
71072005-03-06 Paul Eggert <eggert@cs.ucla.edu>
7108
7109 * src/output.c (escaped_output): Renamed from
7110 escaped_file_name_output, since we now use it for symbol tags as
7111 well. All uses changed.
7112 (symbol_destructors_output, symbol_printers_output):
7113 Escape symbol tags too.
7114 Problem reported by Matyas Forstner in
7115 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
7116
7117 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
7118 not needed.
7119 * src/output.c (user_actions_output, token_definitions_output,
7120 symbol_destructors_output, symbol_printers_output): Likewise.
7121 * src/reader.c (prologue_augment): Likewise.
7122 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
7123
7124 * src/vcg.c (output_edge): Don't quote linestyle arg.
7125 Problem reported by twlevo@xs4all.nl.
7126
7eb453ac
PE
71272005-02-28 Paul Eggert <eggert@cs.ucla.edu>
7128
7129 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
7130 example, reported by Derek M Jones. Also, make the example even
7131 more outrageous, to better illustrate how bad the problem is.
7132
4c04c52a
PE
71332005-02-24 Paul Eggert <eggert@cs.ucla.edu>
7134
7135 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
7136 putsym. Typo reported by Sebastian Piping.
7137
a61e1620
PE
71382005-02-23 Paul Eggert <eggert@cs.ucla.edu>
7139
7140 * doc/bison.texinfo (Language and Grammar): some -> same
7141 (Epilogue): int he -> in the
7142 Typos reported by Sebastian Piping via Justin Pence.
7143
9ec93868
PE
71442005-02-07 Paul Eggert <eggert@cs.ucla.edu>
7145
7146 * tests/glr-regression.at (Improper handling of embedded actions
7147 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
7148 embedded actions and $-N in GLR parsers", work around an Autoconf bug
7149 with dollar signs in test names.
7150 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
7151 for a similar reason.
7152
73ce7e7e
PE
71532005-01-28 Paul Eggert <eggert@cs.ucla.edu>
7154
7155 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
7156 wants to redefine G_VIEW.
7157
2e72b98e
PE
71582005-01-27 Paul Eggert <eggert@cs.ucla.edu>
7159
7160 * src/vcg.c (get_view_str): Remove case for normal_view.
7161 Problem reported by twlevo@xs4all.nl.
7162
e0d634e5
PE
71632005-01-24 Paul Eggert <eggert@cs.ucla.edu>
7164
ccf830a4
PE
7165 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
7166 Problem reported by twlevo@xs4all.nl.
7167
e0d634e5
PE
7168 * doc/bison.texinfo: Change @dircategory from "GNU programming
7169 tools" to "Software development". Requested by Richard Stallman
7170 via Karl Berry.
7171
7bbc8cb0
PE
71722005-01-23 Paul Eggert <eggert@cs.ucla.edu>
7173
7174 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
7175 Problem reported by twlevo@xs4all.nl.
7176
08b770bc
PE
71772005-01-21 Paul Eggert <eggert@cs.ucla.edu>
7178
7179 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
7180 keyword; it's not needed with modern compilers, and it doesn't
7181 affect correctness with older compilers. Suggested by
7182 twlevo@xs4all.nl.
7183
95f22ad2
PE
71842005-01-17 Paul Eggert <eggert@cs.ucla.edu>
7185
7186 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
7187 gcc -Wswitch-default.
7188 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7189 * data/yacc.c (yyparse): Likewise.
7190
d229d15c
PE
71912005-01-12 Paul Eggert <eggert@cs.ucla.edu>
7192
7193 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
7194 already. Let config.h define any nonstandard values.
7195
ecadd90f
PE
71962005-01-10 Paul Eggert <eggert@cs.ucla.edu>
7197
7198 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
7199 for the benefit of slower hosts. Problem reported by
7200 Nelson H. F. Beebe.
7201
213744b5
PE
72022005-01-07 Paul Eggert <eggert@cs.ucla.edu>
7203
7204 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
7205 being defined and not used.
7206 * data/lalr1.cc (yyparse): Likewise.
7207 Use "if (false)" rather than "if (0)".
7208
249d3236
PE
72092005-01-05 Paul Eggert <eggert@cs.ucla.edu>
7210
7211 * TODO: Mention that we should allow NUL bytes in tokens.
7212
987cc1fb
PE
72132005-01-02 Paul Eggert <eggert@cs.ucla.edu>
7214
7215 * src/scan-skel.l (<<EOF>>): Don't close standard output.
7216 Problem reported by Hans Aberg.
7217
08fe02d9
PE
72182005-01-01 Paul Eggert <eggert@cs.ucla.edu>
7219
7220 * src/getargs.c (version): Happy new year; update overall
7221 program copyright date from 2004 to 2005.
7222
7223 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
7224 Problem reported by Hans Aberg.
7225 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
7226 (Output file names.): Add a test for the case when standard output
7227 is closed.
7228
010c0266
PE
72292004-12-26 Paul Eggert <eggert@cs.ucla.edu>
7230
7231 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
7232 to fix an oversight in the Bison 2.0 manual.
7233
da12206a
PE
72342004-12-25 Paul Eggert <eggert@cs.ucla.edu>
7235
7236 * NEWS: Version 2.0. Reformat the existing news items since
7237 1.875, so that related items are grouped together.
3a4734aa 7238 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
7239 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
7240
c935d934
PE
7241 * tests/torture.at (Exploding the Stack Size with Alloca): Set
7242 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
7243 otherwise, we're not testing alloca. Unfortunately there's no
7244 simple way to consult HAVE_ALLOCA here.
7245
da12206a
PE
7246 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
7247 for yymsg, too.
7248
7249 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
7250 hand. This avoids a warning about comparing int to size_t when
7251 GCC warnings are enabled.
7252
0a2c5137
PE
72532004-12-22 Paul Eggert <eggert@cs.ucla.edu>
7254
d7e14fc0
PE
7255 * NEWS: Bison-generated parsers no longer default to using the
7256 alloca function (when available) to extend the parser stack, due
7257 to widespread problems in unchecked stack-overflow detection.
7258 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
7259 responsibility to set it to a positive value. This lets the user
7260 specify a value that is not a preprocessor constant.
7261 * data/yacc.c (YYMAXDEPTH): Likewise.
7262 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
7263 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
7264 to be a compile-time constant. However, explain the constraints on it.
7265 Also, explain the constraints on YYINITDEPTH.
7266 (Table of Symbols): Explain that alloca is no longer the default.
7267 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
7268 to 1.
7269
0a2c5137
PE
7270 * doc/bison.texinfo (Location Default Action): Mention that n must
7271 be zero when k is zero. Suggested by Frank Heckenbach.
7272
e019c247
AD
72732004-12-22 Akim Demaille <akim@epita.fr>
7274
7275 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
7276 (parser::state_type, parser::semantic_type, parser::location_type):
7277 Private, not public.
7278 (parser::parse): Return ints, not bool.
7279 Returning a bool introduces a problem: 0 corresponds to false, and
7280 it seems weird to return false on success. Returning true changes
7281 the conventions for yyparse.
7282 Alternatively we could return void and send an exception.
7283 There is no clear consensus (yet?).
7284 (state_stack, semantic_stack, location_stack): Rename as...
7285 (state_stack_type, semantic_stack_type, location_stack_type): these.
7286 Private, not public.
7287 * tests/c++.at: New.
7288 * tests/testsuite.at, tests/Makefile.am: Adjust.
7289
72731bb7
AD
72902004-12-21 Akim Demaille <akim@epita.fr>
7291
7292 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
7293
9a0d8bec
AD
72942004-12-21 Akim Demaille <akim@epita.fr>
7295
7296 Don't impose std::string for filenames.
7297
7298 * data/lalr1.cc (b4_filename_type): New.
7299 (position::filename): Use it.
7300 (parser.hh): Move the inclusion of stack.hh and location.hh below
7301 the user code, so that needed headers for the filename type can be
7302 included first.
72731bb7
AD
7303 Forward declare them before the user code.
7304 * tests/Makefile.am (check-local, installcheck-local): Pass
7305 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 7306
99880de5
AD
73072004-12-20 Akim Demaille <akim@epita.fr>
7308
7309 Use more STL like names: my_class instead of MyClass.
7310
7311 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
7312 (SemanticStack, SemanticType, StateStack, StateType)
7313 (TokenNumberType, Stack, Slice, Traits, Parser::location)
7314 (Parser::value): Rename as...
7315 (location_stack, location_type, rhs_number_type, semantic_stack)
7316 (semantic_type, state_stack, state_type, token_number_type, stack)
7317 (slice, traits, parser::yylloc, parser::yylval): these.
7318
7319 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
7320
9bec482e
PE
73212004-12-19 Paul Eggert <eggert@cs.ucla.edu>
7322
7323 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
7324 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7325
f6fbd3da
PE
73262004-12-17 Paul Eggert <eggert@cs.ucla.edu>
7327
7328 Remove uses of 'short int' and 'unsigned short int'. This raises
7329 some arbitrary limits. It uses more memory but nowadays that's
7330 not much of an issue.
7331
7332 This change does not affect the generated parsers; that's a different
7333 task, as some users will want to conserve memory there.
7334
7335 Ideally we should use size_t to represent all object counts, and
7336 something like ptrdiff_t to represent signed differences of object
7337 counts; but that will require more code-cleanup than I have the
7338 time to do right now.
7339
7340 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
7341 Use size_t, not int or short int, to count objects.
7342 * src/closure.c (nritemset, closure): Likewise.
7343 * src/closure.h (nritemset, closure): Likewise.
7344 * src/nullable.c (nullable_compute): Likewise.
7345 * src/print.c (print_core): Likewise.
7346 * src/print_graph.c (print_core): Likewise.
7347 * src/state.c (state_compare, state_hash): Likewise.
7348 * src/state.h (struct state): Likewise.
7349 * src/tables.c (default_goto, goto_actions): Likewise.
7350
7351 * src/gram.h (rule_number, rule): Use int, not short int.
7352 * src/output.c (prepare_rules): Likewise.
7353 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
7354 errs, reductions): Likewise.
7355 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
7356 Likewise.
7357 * src/tables.c (vector_number, tally, action_number,
7358 ACTION_NUMBER_MINIMUM): Likewise.
7359 * src/output.c (muscle_insert_short_int_table): Remove.
7360
efeed023
AD
73612004-12-17 Akim Demaille <akim@epita.fr>
7362
7363 * data/lalr1.cc: Extensive Doxygenation.
7364 (error_): Rename as...
7365 (error): this, since it is visible to the user.
7366 Adjust callers.
7367 (Parser::message): Now an automatic variable from...
7368 (Parser::yyreport_syntax_error_): here.
7369 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
7370 Parser::error.
7371 * tests/input.at: Escape $.
7372
bc82c5a5
PE
73732004-12-16 Paul Eggert <eggert@cs.ucla.edu>
7374
7375 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
7376 Parenthesize rhs to avoid obscure problems with mistakes like
7377 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
7378 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7379 b4_rhs_location): Likewise.
7380 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7381 b4_rhs_location): Likewise.
7382
fd19f271
AD
73832004-12-16 Akim Demaille <akim@epita.fr>
7384
7385 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
7386 yacc.c: be sure to stay within yycheck_.
7387 * tests/actions.at: Re-enable C++ tests.
7388
10454ea4
AD
73892004-12-16 Akim Demaille <akim@epita.fr>
7390
7391 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
7392 real.
7393
c5b95ccf
AD
73942004-12-16 Akim Demaille <akim@epita.fr>
7395
7396 Use #define to handle the %name-prefix.
7397
7398 * data/glr.c, data/yacc.c: Comment changes.
7399 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
7400 so that one can refer to yylex in the parser file, and have it
7401 renamed, as is the case with other skeletons.
7402
617a8f12
AD
74032004-12-16 Akim Demaille <akim@epita.fr>
7404
7405 Move lalr1.cc internals into yy*.
7406
7407 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
7408 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
7409 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
7410 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
7411 (empty_, final_, terror_, errcode_, ntokens_)
7412 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
7413 (looka_, ilooka_, error_range_, nerrs_):
7414 Rename as...
7415 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
7416 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
7417 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
7418 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
7419 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
7420 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
7421 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
7422 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
7423 these.
7424
1e547e6e
PE
74252004-12-15 Paul Eggert <eggert@cs.ucla.edu>
7426
7427 Fix some problems reported by twlevo at xs4all.
7428 * src/symtab.c (symbol_new): Report an error if the input grammar
7429 contains too many symbols. This is better than calling abort() later.
7430 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
7431 (struct node, struct graph):
7432 Rename member expand to stretch. All uses changed.
7433 (struct graph): Remove member layoutalgorithm. All uses removed.
7434 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
7435 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
7436 All uses changed.
7437 (N_STRETCH): Rename from N_EXPAND. All uses changed.
7438
735d6bd4
AD
74392004-12-15 Akim Demaille <akim@epita.fr>
7440
7441 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
7442 Add more Doxygen comments.
7443 (symprint_, stack_print_, reduce_print_, destruct_, pop)
7444 (report_syntax_error_, translate_): Rename as...
7445 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
7446 (yypop_, yyreport_syntax_error_, yytranslate_): this.
7447
2e1f5829
AD
74482004-12-15 Akim Demaille <akim@epita.fr>
7449
7450 * data/lalr1.cc (lex_): Rename as...
7451 (yylex_): this.
7452 Move the trace here.
7453 Take the %name-prefix into account.
7454 Reported by Alexandre Duret-Lutz.
7455
a3cb6248
AD
74562004-12-15 Akim Demaille <akim@epita.fr>
7457
7458 Simplify the C++ parser constructor.
7459
7460 * data/lalr1.cc (debug_): Rename as...
7461 (yydebug_): so that the parser's internals are always in the yy*
7462 pseudo namespace.
7463 Adjust uses.
7464 (b4_parse_param_decl): Remove the leading comma as it is now only
7465 called as unique argument list.
7466 (Parser::Parser): Remove the constructor accepting a location and
7467 an initial debugging level.
7468 Remove from the other ctor the argument for the debugging level.
7469 (debug_level_type, debug_level, set_debug_level): New.
7470
7471 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
7472 constructor calls.
7473
07fed891
AD
74742004-12-15 Akim Demaille <akim@epita.fr>
7475
7476 Remove b4_root related material: failure experiment
a3cb6248 7477 (which goal was to allow to derive from a class).
07fed891
AD
7478
7479 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
7480 definitions and uses.
7481
e603eaa5
PE
74822004-12-14 Paul Eggert <eggert@cs.ucla.edu>
7483
7484 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
7485 not 2, since it's not portable to subtract 1 from the start of an
7486 array. The new item 0 is never set or used. All uses changed.
7487
7488 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
7489 the default definition of YYLLOC_DEFAULT. Problem reported
7490 by Frank Heckenbach.
7491
fafb007d
PE
74922004-12-12 Paul Eggert <eggert@cs.ucla.edu>
7493
7494 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
7495 the normal case and one for the error case. Just use the
7496 first one uniformly. Problem reported by Frank Heckenbach.
7497 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
7498 use exactly the same macro in both places.
7499 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
7500 so that the normal-case YYRHSLOC works for the error case too.
7501 All uses changed.
7502 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
7503 (YYLLOC_DEFAULT): Use the same macro as glr.c.
7504 * doc/bison.texinfo (Location Default Action): Don't claim that
7505 we have an array of locations. Use the same macro for both glr
7506 and lalr parsers. Mention YYRHSLOC. Mention what happens when
7507 the index is 0.
7508
48814dcd
PE
75092004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7510
a4e1a53b
PE
7511 * HACKING: Update email addresses to send announcements to.
7512
48814dcd
PE
7513 * configure.ac (AC_INIT): Bump version to 1.875f.
7514
337116ba
PE
75152004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7516
7517 * NEWS: Version 1.875e.
7518 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
7519
7520 * src/scan-skel.l: Include "complain.h", for "fatal".
7521
7522 * src/relation.h (relation_print, relation_digraph):
7523 Relation sizes are of type relation_node, not size_t (this is
7524 merely a doc fix, since the two types are equivalent).
7525 (relation_transpose): Relation sizes are of type relation_node,
7526 not int.
7527 * src/relation.c: Likewise.
7528 (top, infinity): Now of type relation_node, not int.
7529 (traverse, relation_transpose): Use relation_node, not int.
7530
7531 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
7532 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
7533 (yyparse): Remove unused local introduced in 2004-10-25 patch.
7534
7535 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 7536 specifying whether the test should be skipped. Use it tp
337116ba 7537 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 7538 fail on some hosts, and should be skipped.
337116ba 7539
da2a7671
PE
75402004-12-08 Paul Eggert <eggert@cs.ucla.edu>
7541
7542 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
7543 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
7544 unless otherwise specified below.
7545
7546 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
7547 to allocate kernel_base, kernel_items, kernel_size, since
7548 they needn't be initialized to 0.
7549 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
7550 * src/closure.c (new_closure): Likewise, for itemset.
7551 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
7552 * src/lalr.c (set_goto_map): Likewise, for temp_map.
7553 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
7554 (build_relations): Likewise for edge, states1, includes.
7555 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
7556 * src/reader.c (packgram): Likewise, for ritem, rules.
7557 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
7558 * src/relation.c (relation_digraph): Likewise for VERTICES.
7559 (relation_transpose): Likewise for new_R, end_R.
7560 * src/symtab.c (symbols_token_translations_init): Likewise for
7561 token_translations.
7562 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
7563 (token_actions): Likewise for yydefact, actrow, conflrow,
7564 conflict_list.
7565 (save_column): Likewise for froms[symno], tos[symno].
7566 (goto_actions): Likewise for state_count.
7567 (pack_table): Likewise for base, pos, check.
7568 (tables_generate): Likewise for width.
7569
7570 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
7571 for initial core. Just have a separate core, so we needn't worry
7572 about whether kernel_size and kernel_base are initialized.
7573
7574 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
7575 kernel_size, kernel_items): Remove unnecessary initialization.
7576 * src/conflicts.c (conflicts): Likewise.
7577 * src/derives.c (derives): Likewise.
7578 * src/muscle_tablc (muscle_insert): Likewise.
7579 * src/relation.c (relation_digraph): Likewise.
7580 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
7581 conflrow, conflict_table, conflict_list, table, check):
7582 Likewise.
7583
7584 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
7585 This is because all callers pass unsigned int.
7586 * src/closure.h (new_closure): Likewise.
7587
7588 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
7589 (build_relations): Initialize includes[i] in all cases.
7590 * src/reader.c (packgram): Always initialize rules[ruleno].prec
7591 and rules[ruleno].precsym. Initialize members in order.
7592 * src/relation.c (relation_transpose): Always initialize new_R[i]
7593 and end_R[i].
7594 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
7595
7596 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
7597 conflict_list[0] was always 0, but now it isn't initialized.
7598
7599 * src/table.c (table_grow): When conflict_table grew, the grown
7600 area wasn't cleared. Fix this.
7601
7602 * lib/.cvsignore: Add strdup.c, strdup.h.
7603 * m4/.cvsignore: Add strdup.m4.
7604
00baeeac
PE
76052004-12-07 Paul Eggert <eggert@cs.ucla.edu>
7606
7607 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
7608 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
7609 GOTO_NUMBER_MAXIMUM, since we occasionally compute
7610 ngotos + 1 without checking for overflow.
7611 (build_relations): Use END_NODE, not -1, to denote end of edges.
7612 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
7613 build_relations): Use goto_number, not int, for goto numbers.
7614 * src/tables.c (save_column, default_goto): Likewise.
7615
be3d9d42
AD
76162004-11-23 Akim Demaille <akim@epita.fr>
7617
7618 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
7619 of #defining from yystype.
7620 Don't typedef yystype, C++ does not need it.
7621 This lets it possible to forward declare it as union.
7622
78e526d5
PE
76232004-11-23 Paul Eggert <eggert@cs.ucla.edu>
7624
7625 * bootstrap (gnulib_modules): Add extensions.
7626 Problem reported by Jim Meyering.
7627
afbb696d
PE
76282004-11-22 Paul Eggert <eggert@cs.ucla.edu>
7629
7630 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
7631 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
7632 src/system.h, src/tables.c: XFREE -> free, to accommodate
7633 recent change to gnulib xalloc.h.
78e526d5 7634 Problem reported by Jim Meyering.
afbb696d 7635
c1f8f16a
AD
76362004-11-17 Akim Demaille <akim@epita.fr>
7637
7638 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
7639
db7e5eb5 76402004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
7641 Alexandre Duret-Lutz <adl@gnu.org>
7642
7643 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
7644 changes.
7645 (YYCDEBUG): Adjust.
7646 Use it instead of cdebug_.
7647 (Parser::debug_stream, Parser::set_debug_stream): New.
7648 (Parser::symprint_): Define cdebug_ for temporary backward
7649 compatibility.
7650 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
7651 debug_stream ().
7652
68e11668
AD
76532004-11-17 Akim Demaille <akim@epita.fr>
7654
7655 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
7656 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
7657 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
7658 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
7659
97cbc73e
PE
76602004-10-27 Paul Eggert <eggert@cs.ucla.edu>
7661
7662 * data/glr.c (yyloc_default): Remove; not used.
7663 Problem reported by Frank Heckenbach.
7664
e342c3be
AD
76652004-10-25 Akim Demaille <akim@epita.fr>
7666
7667 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
7668 Introduce another definition to address simple location arrays.
7669 (yyGLRStack): New member: yyerror_range.
7670 (yyrecoverSyntaxError, yyparse): Update it.
7671 (yyrecoverSyntaxError): Use it when shifting the error token to
7672 have an accurate range, equivalent to the one computed by both
7673 yacc.c and lalr1.cc.
7674 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
7675 that column numbers start at column 0, as per GNU Coding
7676 Standards, the others tests, and the doc.
7677 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
7678 Adjust to the above change (first column is 0).
7679 And adjust the location of the "<error>", now covering the whole
7680 line.
7681
93602feb 76822004-10-22 Akim Demaille <akim@epita.fr>
04098407 7683 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
7684
7685 Remove some arbitrary limits on goto numbers and relations.
7686 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
7687 initial values, since they're never used.
7688 (set_goto_map): ngotos is now unsigned, so test for overflow
7689 by seeing whether it wraps around to zero.
7690 * src/lalr.h (goto_number): Now size_t, not short int.
7691 (GOTO_NUMBER_MAXIMUM): Remove.
7692 * src/relation.c (relation_print, traverse, relation_transpose):
7693 Check for END_NODE rather than looking at sign.
7694 * src/relation.h (END_NODE): New macro.
7695 (relation_node): Now size_t, not short int.
7696
dba08b04
PE
76972004-10-22 Paul Eggert <eggert@cs.ucla.edu>
7698
7699 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
7700 keyword, not an identifier. Problem reported by Baron Schwartz in
7701 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
7702
df09ef2e
AD
77032004-10-11 Akim Demaille <akim@epita.fr>
7704
7705 * src/symtab.c (symbol_check_alias_consistency): Also check
7706 type names, destructors, and printers.
7707 Reported by Alexandre Duret-Lutz.
7708 Recode the handling of associativity and precedence in terms
7709 of symbol_precedence_set.
7710 Accept no redeclaration at all, not even equal to the previous
7711 value.
7712 (redeclaration): New.
7713 Use it to factor redeclaration complaints.
7714 (symbol_make_alias): Don't set the type of the alias, let
7715 symbol_check_alias_consistency do it as for other features.
7716 * src/symtab.h (symbol): Add new member prec_location, and
7717 type_location.
7718 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
7719 * tests/input.at (Incompatible Aliases): New.
7720
146bc99d
PE
77212004-10-09 Paul Eggert <eggert@cs.ucla.edu>
7722
7723 .cvsignore fixes to accommodate gnulib changes,
7724 and the practice of naming build directories "_build".
7725 * .cvsignore: Add "_*". Sort.
7726 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
7727 * m4/.cvsignore: Add "*_gl.m4".
7728
e503aa60
AD
77292004-10-06 Akim Demaille <akim@epita.fr>
7730
7731 * src/parse-gram.y (add_param): Fix the truncation of trailing
7732 spaces.
7733
b4a20338
AD
77342004-10-05 Akim Demaille <akim@epita.fr>
7735
7736 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
7737 whether the reducion was empty or not. This leaves room to
7738 improve the use of YYLLOC_DEFAULT in such a case.
7739 lalr1.cc is still experimental, so changing this is acceptable.
7740 And finally, there are probably not many users who changed the
7741 handling of locations in GLR, so changing is admissible too.
7742
7743 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
7744 empty reduction, set @$ to an empty location ending the previously
7745 stacked symbol.
7746 Adjust uses to make sure the code is triggered on empty
7747 reductions.
7748 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
7749 expected output: empty reductions have empty locations.
7750
f85a5e6f
AD
77512004-09-29 Akim Demaille <akim@epita.fr>
7752
7753 * data/lalr1.cc: Move towards a more standard C++ coding style
7754 for templates: Class < T > -> Class<T>.
7755
b203fc2c
AD
77562004-09-29 Akim Demaille <akim@epita.fr>
7757
7758 * data/lalr1.cc: Reinstall the former ctor, for sake of
7759 compatibility, but warn it will be removed.
7760 Move towards a more standard C++ coding style (i.e., type *var ->
7761 type* var).
7762
5b7e1e73
PE
77632004-09-27 Paul Eggert <eggert@cs.ucla.edu>
7764
3fee967f
PE
7765 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
7766 since it's less likely to work if NULs are involved in the future.
5b7e1e73 7767
0dcca5c2
AD
77682004-09-27 Akim Demaille <akim@epita.fr>
7769
7770 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
7771
6dde1c82
AD
77722004-09-27 Akim Demaille <akim@epita.fr>
7773
7774 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 7775 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
7776 and argument names.
7777 (b4_cc_constructor_call): Likewise.
7778
b233d555
AD
77792004-09-24 Akim Demaille <akim@epita.fr>
7780
7781 * src/parse-gram.y (add_param): Strip the leading and trailing
7782 blanks from a formal argument declaration.
7783 (YY_LOCATION_PRINT): New.
7784
619404e3
AD
77852004-09-24 Akim Demaille <akim@epita.fr>
7786
7787 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
7788 after the location.
7789
dd8d9022
AD
77902004-09-24 Akim Demaille <akim@epita.fr>
7791
7792 * doc/bison.texinfo (Table of Symbols): Sort.
7793
0092f063
AD
77942004-09-21 Akim Demaille <akim@epita.fr>
7795
7796 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
7797 the useless parentheses.
7798 Suggested by Paul Eggert.
7799
451364ed
AD
78002004-09-20 Akim Demaille <akim@epita.fr>
7801
7802 Let the initial-action act on the look-ahead, and use it for the
7803 "initial push" (corresponding to an hypothetical beginning-of-file).
7804 And let lalr1.cc honor %initial-action.
7805
7806 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
7807 example.
7808 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
7809 (Parser::Parser): Remove the ctor that used to initialize it.
7810 (Parser::parse): Like in the other skeletons, issue the "starting
7811 parse" message before any action.
7812 Honor %initial-action.
7813 Initialize the stacks with the lookahead.
7814 * data/yacc.c: Let $$ and @$ in %initial-action designate the
7815 look-ahead.
7816 Push them in the stacks.
7817 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
7818
18d192f0
AD
78192004-09-20 Akim Demaille <akim@epita.fr>
7820
7821 * doc/bison.texinfo (Initial Action Decl): New.
7822
b8458aa5
AD
78232004-09-20 Akim Demaille <akim@epita.fr>
7824
7825 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
7826 clearer criterion to define it.
7827 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
7828 When reducing on an empty RHS, use the latest stacked location as
7829 location.
7830 yylloc is not always available.
7831 * data/glr.c: Likewise.
7832 Also, honor initial-actions.
7833
3fc16193
AD
78342004-09-20 Akim Demaille <akim@epita.fr>
7835
7836 * data/yacc.c (YY_LOCATION_PRINT): New.
7837 Define when we know YYLTYPE's structure, i.e., when the default
7838 YYLLOC_DEFAULT is used.
7839 * data/c.m4 (b4_yysymprint_generate): Use it.
7840 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
7841 value of the result.
7842 (error_start_): Replace with...
7843 (error_range_): this location array.
7844 This allows to replace code relying on the implementation of
7845 locations by portable code.
7846 * data/yacc.c (yylerrsp): Replace with...
7847 (yyerror_range): this.
7848 Every time a token is popped, update yyerror_range[0], to have an
7849 accurate location for the error token.
7850 * data/glr.c (YY_LOCATION_PRINT): New.
7851 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
7852 deference a pointer.
7853 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
7854 report the location in %printers.
7855
7856 * src/scan-skel.l: Instead of abort, report error messages to ease
7857 understanding skeleton scanning failures.
7858
ecfe33e7
AD
78592004-09-16 Akim Demaille <akim@epita.fr>
7860
7861 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
7862 (iterator, const_iterator): these, to be more in the C++ spirit.
7863 Also, return reverse iterators so that when displaying the stack
7864 we display its bottom first.
7865 (Parser::stack_print_, Parser::reduce_print_): Match the messages
7866 from yacc.c.
7867 We should probably use vector here though.
7868
1576d44d
AD
78692004-09-16 Akim Demaille <akim@epita.fr>
7870
7871 Have more complete shift traces.
7872
7873 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
7874 to report Shifts instead of ad hoc YYDPRINTF invocations,
7875 including for the error token.
7876 * data/lalr1.cc (symprint_): Output the location.
7877 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
7878 output the location within the %printer.
7879 Activate GLR tests, at least to make sure they compile properly.
7880 They still don't pass though.
7881 * tests/calc.at: Adjust expect verbose output, since now "Entering
7882 state..." is on a different line than the "Shifting" message.
7883
9c66f418
AD
78842004-09-08 Akim Demaille <akim@epita.fr>
7885
7886 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
7887 Bison directive from the Bison file to the invocation of this
7888 macro, so that these directives are passed to
7889 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
7890 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
7891 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
7892 the extra Bison directives instead of the whole series.
7893 Change the grammar so that there are recoverable errors, and
7894 unrecoverable errors. Now we can have the parser give up before
7895 consuming the whole input. As a result we now can observe that
7896 the lookahead is freed when needed.
7897 Change the parser source to parse argv[1] instead of a hard coded
7898 string.
7899 Simplify yylex, and give a value and location to EOF.
7900 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
7901 passed directives already coded in the file.
7902 Add some tests to check the location of "error".
7903 For some tests, the C++ parser is correct, and not yacc.c.
7904 For other tests, they provide different, but unsatisfying, values,
7905 so keep the C++ value so that at least one parser is "correct"
7906 according to the test suite.
7907 (Actions after errors): Remove, this is subsumed by the
7908 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
7909
52d5733f
AD
79102004-09-06 Akim Demaille <akim@epita.fr>
7911
7912 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 7913 (Parser::pop): New.
52d5733f
AD
7914 Use it.
7915
a0e68930
AD
79162004-09-06 Akim Demaille <akim@epita.fr>
7917
7918 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
7919 argument, an informative message.
7920 Call YY_SYMBOL_PRINT.
7921 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
7922 * data/lalr1.cc (destruct_): Likewise.
7923 In addition, no longer depend on b4_yysymprint_generate and
7924 b4_yydestruct_generate to generate these functions, do it "by
7925 hand".
7926
e757bb10
AD
79272004-09-03 Akim Demaille <akim@epita.fr>
7928
7929 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
7930 invoked, yydestruct the lookahead.
7931 * tests/calc.at (Calculator $1): Update the expected lengths of
7932 traces: there is an added line for the discarded lookahead.
7933 * doc/bison.texinfo (Destructor Decl): Some rewording.
7934 Define "discarded" symbols.
7935
0fe1f06d
AD
79362004-09-02 Akim Demaille <akim@epita.fr>
7937
7938 * data/lalr1.cc (translate_, destruct_): No reason to be static.
7939
284acc8b
AD
79402004-09-02 Akim Demaille <akim@epita.fr>
7941
7942 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
7943 (YYDSYMPRINTF): Rename as...
7944 (YY_SYMBOL_PRINT): this.
7945 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
7946 two.
7947 Use it instead of direct symprint_ calls.
7948 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
7949 one.
7950
a5eb1ed2
AD
79512004-09-02 Akim Demaille <akim@epita.fr>
7952
b7c72fe1
AD
7953 * data/lalr1.cc (b4_yysymprint_generate): New.
7954 (symprint_): New member function, defined when YYDEBUG.
7955 Use it consistently instead of token/nterm debugging output by
7956 hand.
a5eb1ed2
AD
7957 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
7958 %printer calls to use cdebug_ when using lalr1.cc.
7959
417141dd
AD
79602004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
7961
7962 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
7963 with #ifdef YYDEBUG.
7964
2fa09258
AD
79652004-08-26 Akim Demaille <akim@epita.fr>
7966
7967 * doc/bison.texinfo (Implementing Loops): Rename as...
7968 (Implementing Gotos/Loops): this.
7969
9378b508
PE
79702004-08-13 Paul Eggert <eggert@cs.ucla.edu>
7971
7972 Adjust to latest gnulib.
7973 * bootstrap (gnulib_modules): Add xalloc-die.
7974 Set LC_ALL=C so that file names sort consistently.
7975 Prefer the gnulib copies of gettext.m4, glibc21.m4,
7976 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
7977 uintmax_t.m4, ulonglong.m4.
7978 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
7979 po.m4 since we are now using _gl.m4 instead.
7980
87a8ad5c
PE
79812004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
7982
7983 * src/scan-action.l: Remove. Scanning of semantic actions is
7984 handled in scan-gram.l.
7985
dca81a78
PE
79862004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
7987
7988 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
7989
7990 * src/location.h (struct): The file member is a uniqstr.
7991 (equal_boundaries): Use UNIQSTR_EQ for comparison.
7992
c9cbf7c5
PE
79932004-07-22 Paul Eggert <eggert@cs.ucla.edu>
7994
7995 Fix bug with non-%union parsers that have printers or destructors,
7996 which led to a Bison core dump. Reported by Peter Fales in
7997 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 7998
c9cbf7c5
PE
7999 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
8000 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
8001 not to our own type.
8002 * src/output.c (symbol_destructors_output, symbol_printers_output):
8003 Don't assume %union.
8004 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
8005 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
8006 UNION-FLAG. All callers changed.
8007 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
8008 Use type char, not unsigned int, when declaring an array of char;
8009 this lets us remove a cast.
8010 (Printers and Destructors): Add non-%union test cases.
8011
fa7e68c3
PE
80122004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8013
8014 * doc/bison.texinfo: Minor editorial changes, mostly to the new
8015 GLR writeups. E.g., avoid frenchspacing and the future tense,
8016 change "lookahead" to "look-ahead", and change "wrt" to "with
8017 respect to".
2fa09258 8018
fa7e68c3
PE
80192004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8020
8021 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
8022 New sections, split off from the GLR Parsers section. Put the new
8023 Simple GLR Parser near the start of the GLR section, for clarity.
8024 Rewrite connective text.
8025
99a9344e
PE
80262004-06-21 Frank Heckenbach <frank@g-n-u.de>
8027
8028 * doc/bison.texinfo (Simple GLR Parsers): New section.
8029
8dd162d3
PE
80302004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8031
8032 * NEWS, TODO, doc/bison.texinfo:
8033 Use "look-ahead" instead of "lookahead", to be consistent.
8034 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
8035 while we're fixing "look-ahead".
8036 * src/conflicts.c (shift_set): Renamed from shiftset.
8037 (look_ahead_set): Renamed from lookaheadset.
8038 * src/print.c: Likewise.
8039 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
8040 name for "lookahead".
8041 (report_types, usage): Likewise.
8042 * src/getargs.h (report_look_ahead_tokens): Renamed from
8043 report_lookaheads.
8044 * src/lalr.c (compute_look_ahead_tokens): Renamed from
8045 compute_lookaheads.
8046 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
8047 (look_ahead_tokens_print): Renamed from lookaheads_print.
8048 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
8049 state_rule_lookaheads_print.
8050 * src/state.h: Likewise.
8051 (reductions.look_ahead_tokens): Renamed from lookaheads.
8052 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
8053 AT_DATA_LOOKAHEADS_GRAMMAR.
8054
57a90331
PE
80552004-06-03 Paul Eggert <eggert@cs.ucla.edu>
8056
8057 * README: Update location of patched M4 distribution.
8058
8ed3234a
PE
80592004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
8060
8061 Don't assume the C++ compiler takes the same arguments as the C compiler
8062 (trivial change).
8063 * configure.ac (O0CXXFLAGS): New var.
8064 * tests/atlocal.in (CXXFLAGS): Use it.
8065
07971983
PE
80662004-05-29 Paul Eggert <eggert@cs.ucla.edu>
8067
8068 Fix some "make check" problems with C++ reported by
8069 Albert Chin-A-Young for Tru64 C++ in this thread:
8070 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
8071
8072 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
8073 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8074 Output to a .cc file for C++, not to a .c file.
8075 * tests/calc.at (AT_CHECK_CALC): Likewise.
8076 * tests/regression.at (AT_CHECK_DANCER): Likewise.
8077 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
8078
29058652
PE
80792004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
8080
8081 * tests/calc.at, tests/actions.at: Workaround for SGI
8082 C++ compiler. (trivial change)
8083
62cb8a99
PE
80842004-05-27 Paul Eggert <eggert@cs.ucla.edu>
8085
fd418816
PE
8086 Spent a few hours checking out which prerequisite versions the
8087 current sources actually require. I went all the way back to
8088 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
8089 a seemingly endless set of combinations of versions more recent
8090 than that. The bottom line is that the current sources require
8091 fairly recent versions of the build tools, and it'll be some work
8092 to change this.
8093 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
8094 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
8095 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
8096 Add comments explaining why those particular versions are
8097 currently needed.
2fa09258 8098
62cb8a99
PE
8099 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
8100 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 8101 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
8102
8103 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
8104 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
8105
caa52c10
PE
81062004-05-26 Paul Eggert <eggert@cs.ucla.edu>
8107
8108 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
8109 0.11.5. Suggested by Bruno Haible.
8110 * bootstrap: Remove gettext version checking.
8111
8112 * doc/bison.texinfo (Decl Summary): Also mention that %union
8113 can depend on prerequisite types. Problem reported by Tim
8114 Van Holder.
8115
4bfd5e4e
PE
81162004-05-25 Paul Eggert <eggert@cs.ucla.edu>
8117
2cef3017
PE
8118 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
8119 * README-alpha: Don't tell people not to package this.
8120
b9c85d5c
PE
8121 * bootstrap: Don't assume $(...) works; use `...` instead.
8122 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
8123 gettext better.
8124
4bfd5e4e
PE
8125 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
8126 put into the -d output file, and mention what to do if YYSTYPE is
8127 defined as a macro.
8128
6a36ff94
PE
81292004-05-24 Paul Eggert <eggert@cs.ucla.edu>
8130
6712933e
PE
8131 Undo change made earlier today: it caused autopoint to not bring
8132 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
8133 autopoint's.
8134
8135 * bootstrap: Check that gettext version matches what's in
8136 configure.ac. Warn users to ignore robots.txt ERROR 404.
8137 * bootstrap: Undo today's earlier change (logged below).
8138 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 8139
6a36ff94
PE
8140 The gettext version checking is causing more trouble than it's
8141 curing; remove it. Problem reported by Paul Hilfinger.
8142
8143 * bootstrap: Issue a warning that one can expect a message
8144 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
8145 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
8146
209ea708
PE
81472004-05-23 Paul Eggert <eggert@cs.ucla.edu>
8148
8149 Ensure that the C++ compiler used for testing actually works on a
8150 simple test program; if not, skip the C++-related tests. Problem
8151 reported by Vin Shelton in:
161a71f3 8152 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
8153
8154 * m4/cxx.m4: New file.
8155 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
8156 * tests/atlocal.in (BISON_CXX_WORKS): Add.
8157 * tests/local.at (AT_COMPILE_CXX): Use it.
8158
41ca2549
PE
81592004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8160
383e69dc
PE
8161 * data/glr.c (yylloc): Output this macro even if locations are not
8162 being generated, as the GLR parser needs it even in that case.
8163 Problem reported by Troy A. Johnson
8164 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
8165
41ca2549
PE
8166 * configure.ac (AC_INIT): Update to 1.875e.
8167
e476c87d
PE
81682004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8169
8170 * NEWS: Version 1.875d.
8171 * configure.ac (AC_INIT): Likewise.
8172 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
8173
8174 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
8175 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
8176 lalr1.cc runs afoul of the first, and the last two are no longer
8177 supported by GCC 3.4.0.
8178 * README: Mention GNU m4 1.4 or later; mention m4 patches.
8179 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
8180
233a88ad
PE
81812004-05-06 Paul Eggert <eggert@cs.ucla.edu>
8182
8183 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
8184 unsigned int, for compatibility with latest gnulib hash module.
8185 * src/state.c (state_hash, state_hasher): Likewise.
8186 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
8187 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 8188
12ffdd28
PE
81892004-05-03 Paul Eggert <eggert@cs.ucla.edu>
8190
8191 * NEWS: Unescaped newlines are no longer allowed in char & strings.
8192
8193 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
8194 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
8195 character and string literals.
8196 (unexpected_end): New function.
8197 (unexpected_eof): Use it.
8198 (unexpected_newline): New function.
8199 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
8200 actions.
e476c87d 8201
12ffdd28
PE
8202 * NEWS: Document %expect-rr.
8203
8204 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
8205 Fix typo by replacing $1 with $option.
8206 Remove more 'intl'-related files.
9668e2be 8207 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
8208
8209 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
8210 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
8211 strtoul.c.
8212 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
8213 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
8214 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
8215 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
8216 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
8217 * src/.cvsignore: Add *.output.
8218
8219 * src/parse-gram.y: Put copyright notice inside %{ %} so it
8220 gets copied to the output file.
e476c87d 8221
1f65350a
PE
82222004-04-28 Paul Eggert <eggert@twinsun.com>
8223
8224 Get files from the gnulib and po repositories, instead of relying
8225 on them being in our CVS. Upgrade to latest versions of gnulib
8226 and Automake.
8227
8228 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
8229 * bootstrap: Bootstrap from gnulib and po repositories.
8230 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
8231 * README-cvs: Document these changes. Remove version numbers from
8232 mentions of build tools, since they change so often. Mention Flex.
8233
8234 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
8235 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
8236 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
8237 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 8238 does this for us.
12ffdd28
PE
8239 (AC_ISC_POSIX): Remove; we no longer support this
8240 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
8241 (AC_HEADER_STDC): Remove: we now assume C89 or better.
8242 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
8243 Do not check for C89 headers, except for locale.h which is used
8244 by the Yacc library and must port to K&R hosts.
8245 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
8246 Do not check for C89 functions, except for setlocale which is
8247 used by the Yacc library.
8248 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
8249 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
8250 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
8251 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
8252 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
8253 AM_GNU_GETTEXT): Remove; now done by:
8254 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
8255 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
8256 for us.
8257
8258 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
8259 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
8260 Define to empty, as gnulib.mk will do the rest for us.
8261 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
8262 for us.
8263 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
8264 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
8265
8266 * src/files.c: Include gnulib's xstrndup.h.
8267
8268 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
8269 (REALLOC): Use xnrealloc, for likewise.
8270 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
8271 (strnlen, memrchr): Remove decls; functions no longer used.
8272 Include <stpcpy.h>.
8273
8274 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
8275 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
8276 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
8277 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
8278 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
8279 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
8280 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
8281 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
8282 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
8283 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
8284 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
8285 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8286 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
8287 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
8288 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
8289 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
8290 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
8291 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
8292 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
8293 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
8294 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
8295 Remove, as these files are now generated automatically
8296 by bootstrap or automake.
8297
8298 * po/ChangeLog: Remove: all but one entry was a duplicate
8299 of this file, and I moved that 2000-11-02 entry here.
8300
8301 * config/.cvsignore: Add Makefile, depcomp, install-sh.
8302 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
8303 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
8304 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
8305 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
8306 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
8307 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
8308 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
8309 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
8310 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
8311 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
8312 xstrndup.h.
8313 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
8314 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
8315 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
8316 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
8317 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
8318 * src/.cvsignore: Remove *_.c.
8319
8320
8321 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
8322 support it. (The latest stable gzip doesn't.)
8323
83242004-04-27 Paul Eggert <eggert@twinsun.com>
8325
8326 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
8327 case, as stos_ is now used by destructors due to the 2004-02-09
8328 change.
8329
8330 Remove more K&R C support.
8331 * lib/libiberty.y (PARAMS): Remove. All uses removed.
8332 * lib/subpipe.c (errno): Remove decl.
8333 Include <stdlib.h> unconditionally.
8334 (EXIT_FAILURE): Remove macro.
8335 * src/complain.c (vfprintf, strerror): Remove.
8336 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
8337 unconditionally.
8338 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
8339 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
8340 (strchr, strspn, memchr): Remove decls.
8341 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
8342 unconditionally. Do not declare perror.
8343 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
8344 unconditionally.
8345
8346 * src/complain.c (_): Remove useless defn, as system.h defines this.
8347
8348 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
8349 with latest obstack.h.
8350 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
8351 to procedure types, as obstack.h now does that for us.
8352 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
8353
8354 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
8355 so that this include file can stand alone.
8356 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
8357 does this now. Include subpipe.h first after config.h, to
8358 test whether it can stand alone.
8359
8360 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
8361 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
8362 unused declaration.
8363
8364 * tests/synclines.at (%union synch line): Put a dummy member in
8365 the union, because empty unions aren't allowed in C. Caught
8366 by GCC 3.4.0.
8367
4f16766c
PE
83682004-04-13 Jim Meyering <jim@meyering.net>
8369
8370 * src/conflicts.c (conflicts_print): Correct format string typo:
8371 use `%%' to produce literal `%'. (trivial change)
8372
779e7ceb
PE
83732004-03-30 Paul Eggert <eggert@twinsun.com>
8374
8375 * src/getargs.c (version): Update copyright year to 2004.
8376
8377 * data/c.m4 (b4_int_type): Use 'short int' rather than
8378 'short', and similarly for 'long', 'unsigned', etc.
8379 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
8380 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
8381 yy_yypstack, yydumpstack): Likewise.
8382 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
8383 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
8384 Likewise.
8385 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
8386 yy_stack_print, yyparse): Likewise.
8387 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
8388 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
8389 * lib/bitset.c (bitset_print): Likewise.
8390 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
8391 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8392 * lib/bitsetv.c (bitsetv_dump): Likewise.
8393 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
8394 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
8395 Likewise.
8396 * src/LR0.c (allocate_itemsets): Likewise.
8397 * src/gram.h (rule_number, rule): Likewise.
8398 * src/lalr.h (goto_number): Likewise.
8399 * src/nullable.c (nullable_compute): Likewise.
8400 * src/output.c (prepare_rules): Likewise.
8401 * src/relation.c (relation_print, relation_digraph): Likewise.
8402 * src/relation.h (relation_node): Likewise.
8403 * src/state.h (state_number, transitions, errs, reductions,
8404 struct state): Likewise.
8405 * src/symtab.h (symbol_number, struct symbol): Likewise.
8406 * src/tables.c (vector_number, tally, action_number,
8407 default_goto, goto_actions): Likewise.
8408 * tests/existing.at (GNU Cim Grammar): Likewise.
8409 * tests/regression.at (Web2c Actions): Likewise.
8410
8411 * src/output.c (muscle_insert_short_int_table): Renamed from
8412 muscle_insert_short_table. All uses changed.
8413
d6328241
PH
84142004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8415
8416 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
8417 (declaration): Replace expected_conflicts with expected_sr_conflicts.
8418 Add %expect-rr rule.
4f16766c 8419
d6328241
PH
8420 * src/scan-gram.l: Recognize %expect-rr.
8421
4f16766c 8422 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 8423 expected_conflicts.
4f16766c 8424 (expected_rr_conflicts): Declare.
d6328241
PH
8425
8426 * src/conflicts.c (expected_sr_conflicts): Rename from
8427 expected_conflicts.
8428 (expected_rr_conflicts): Define.
8429 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
8430 for GLR parsers.
8431 Use expected_sr_conflicts in place of expected_conflicts.
8432 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 8433
d6328241 8434 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 8435
1452af69
PE
84362004-03-08 Paul Eggert <eggert@gnu.org>
8437
8438 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 8439 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
8440
8441 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
8442 in lalr1.cc.
8443 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
8444 * src/scan-gram.l (scan_integer): New function.
8445 ({int}): Use it.
8446 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
8447 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
8448 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
8449 Say "long int", not "long", for uniformity with GNU style.
8450
006d217d
PE
84512004-02-25 Paul Eggert <eggert@twinsun.com>
8452
8453 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
8454 compilers. This fixes a problem with Intel's C++ compiler being
8455 chatty, reported by Guido Trentalancia in
161a71f3 8456 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 8457
c2729758
ADL
84582004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
8459
8460 Support %destructor and merge error locations in lalr1.cc.
8461
8462 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
8463 (Parser::stos_): Define unconditionally.
8464 (Parser::destruct_): New method. Generate its body with
8465 b4_yydestruct_generate.
8466 (Parser::error_start_): New attribute.
8467 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
8468 token which are discarded.
8469 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
8470 error_start_ when erroneous token are discarded.
8471 (Parser::parse) <yyerrlab1>: Compute the location of the error
8472 token so that it covers all the discarded tokens.
8473 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
8474 it can be called with `%skeleton "lalr1.cc"', and do that.
8475
dd0e0635
PE
84762004-02-02 Paul Eggert <eggert@twinsun.com>
8477
8478 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
8479 $(top_srcdir)/lib and ../lib. This fixes a bug reported
8480 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
8481 There's no need to mention top_builddir since Automake does that
8482 for us.
8483 (INCLUDES): Remove, as Automake says it's obsolescent.
8484 Contents migrated into AM_CPPFLAGS as described above.
8485 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
8486
84872004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8488
8489 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
8490 (yyreportSyntaxError): Handle case where lookahead token is
8491 YYEMPTY.
8492
be16239b
PH
84932004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8494
8495 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
8496 resulting parsers are compilable with C++.
8497
5fa90832
PE
84982003-12-23 Paul Eggert <eggert@twinsun.com>
8499
8500 * config/depcomp, config/install-sh: Sync with Automake 1.8.
8501 * src/output.c (output_skeleton): Rename local var.
8502 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
8503 Bison tokens, as this runs afoul of the 2003-10-07 change that
8504 disallowed NUL bytes in character constants or string literals.
8505
8506 * tests/local.at: Require Autoconf 2.59's Autotest.
8507 * tests/testsuite.at: Don't include local.at, since we now assume
8508 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
8509 including it.
8510 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
8511 multiple inclusion warnings.
dd0e0635 8512
b165c324
AD
85132003-12-02 Akim Demaille <akim@epita.fr>
8514
8515 * doc/bison.texinfo (How Can I Reset the Parser): More about start
8516 conditions.
8517 From Bruno Haible.
8518
26e06a21
ADL
85192003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
8520
8521 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
8522
92ac3705
PE
85232003-10-07 Paul Eggert <eggert@twinsun.com>
8524
6a5ecb38
PE
8525 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
8526 if testsuite doesn't exist.
8527
92ac3705
PE
8528 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
8529 literals, unfortunately.
8530 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
8531 Complain about NUL bytes in character constants or string literals.
8532
91d2c560
PE
85332003-10-05 Paul Eggert <eggert@twinsun.com>
8534
8535 * NEWS: Don't document %no-default-prec, as it's still
8536 too experimental.
8537 * doc/bison.texinfo: Document %no-default-prec only if
8538 the defaultprec flag is set. Normally it's not.
8539
0cc3da3a
PE
85402003-10-04 Paul Eggert <eggert@twinsun.com>
8541
8542 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
8543 non-modifiable lvalue, instead of a modifiable one.
8544 * doc/bison.texinfo (Actions): Document that $$ can
8545 be assigned to. Do not claim that $$ and $N are
8546 array element references: user code should not rely on this.
8547
22fccf95
PE
85482003-10-01 Paul Eggert <eggert@twinsun.com>
8549
8550 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
8551 (grammar_declaration): Use it.
8552 * src/scan-gram.l: New token %no-default-prec.
8553 * tests/conflicts.at: Revamp tests to use %no-default-prec.
8554 * NEWS, doc/bison.texinfo: Document the above.
8555
fc8f2965
AD
85562003-10-01 Akim Demaille <akim@epita.fr>
8557
8558 VCG no longer supports long_straight_phase.
8559
8560 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
8561 * src/print_graph.c (print_graph): Adjust.
8562
39a06c25
PE
85632003-09-30 Frank Heckenbach <frank@g-n-u.de>
8564 and Paul Eggert <eggert@twinsun.com>
8565
8566 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
8567 Table of Symbols): Document %default-prec.
8568 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
8569 (grammar_declaration): Set default_prec on %default-prec.
8570 * src/scan-gram.l (%default-prec): New token.
8571 * src/reader.h (default_prec): New flag.
8572 * src/reader.c: Likewise.
8573 (packgram): Handle it.
8574 * tests/conflicts.at (%default-prec without %prec,
8575 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 8576
39a06c25
PE
85772003-09-30 Paul Eggert <eggert@twinsun.com>
8578
8579 * tests/testsuite.at: Include local.at, not input.at, fixing
8580 a typo in the 2003-08-25 patch.
8581
62b6aef9
AD
85822003-08-27 Akim Demaille <akim@epita.fr>
8583
8584 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
8585 GCC warnings.
8586
89e1cc61
AD
85872003-08-26 Akim Demaille <akim@epita.fr>
8588
8589 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
8590 "<\#" to avoid magic from Gnus when posting parts of this script.
8591
a08460b0
AD
85922003-08-26 Akim Demaille <akim@epita.fr>
8593
8594 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
8595 (Parser::parse): here.
8596 Adjust: nerrs and errstatus is now replaced by...
8597 (Parser::nerrs_, Parser::errstatus_): New.
8598
603f1cfd
AD
85992003-08-25 Akim Demaille <akim@epita.fr>
8600
8601 * config/announce-gen, Makefile.cfg: New.
8602 * Makefile.am: Adjust.
8603 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
8604 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
8605
cd3684cf
AD
86062003-08-25 Akim Demaille <akim@epita.fr>
8607
8608 When reducing initial empty rules, Bison parser read an initial
8609 location that is not defined. This results in garbage, and that
8610 affects Bison's own parser. Therefore we need (i) to extend Bison
8611 to support a means to initialize this location, and (ii) to use
8612 this CVS Bison to fix CVS Bison's parser.
8613
8614 * src/reader.h, reader.c (epilogue_augment): Remove, replace
8615 with...
8616 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
8617 * src/parse-gram.y: Adjust.
8618 (%initial-action): New.
8619 (%error-verbose): Since we require CVS Bison, there is no reason
8620 not to use it.
8621 * src/scan-gram.l: Adjust.
8622 * src/Makefile.am (YACC): New, to make sure we use our own parser.
8623 * data/yacc.c (yyparse): Use b4_initial_action.
8624
4e03e201
AD
86252003-08-25 Akim Demaille <akim@epita.fr>
8626
8627 * doc/bison.texinfo: Don't promote stdout for error messages.
8628
8c182d05
AD
86292003-08-25 Akim Demaille <akim@epita.fr>
8630
8631 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
8632 From Alexandre Duret-Lutz.
8633
6a60c4cf
PE
86342003-08-25 Akim Demaille <akim@epita.fr>
8635
8636 Version 1.875c.
8637
25f66e1a
AD
86382003-08-25 Akim Demaille <akim@epita.fr>
8639
8640 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
8641 Use them.
8642
5348bfbe
AD
86432003-08-25 Akim Demaille <akim@epita.fr>
8644
8645 * data/lalr1.cc (Parser::reduce_print_): New.
8646 Use it.
8647
47301314
AD
86482003-08-25 Akim Demaille <akim@epita.fr>
8649
8650 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
8651 error recovery loops. This patch is based on
161a71f3 8652 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
8653 Also, augment the similarity between lalr1.cc and yacc.c.
8654 Note: the locations of error recovery rules are not correct yet.
8655
8656 * data/lalr1.cc: Comment changes to augment the similarity between
8657 lalr1.cc and yacc.c.
8658 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
8659 (yyerrlab1): Remove, but where it used to be (now the bottom part of
8660 yyerrlab), when hitting EOF, pop the whole stack here instead of
8661 merely falling thru the default error handling mechanism.
8662 (yyerrorlab): New label, with the old contents of YYERROR,
8663 plus the following change: pop the stack of rhs corresponding
8664 to the production that invoked YYERROR. That is how Yacc
8665 behaves (required by POSIX).
8666 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
8667 fail.
8668
1f7a61ff
AD
86692003-08-25 Akim Demaille <akim@epita.fr>
8670
8671 Tune local.at so that people can "autom4te -l autotest calc.at -o
8672 calc" for instance, to extract a sub test suite.
8673
8674 * tests/testsuite.at: Move the initialization, Autotest version
8675 requirement, and AT_TESTED invocation into...
8676 * tests/local.at: here.
8677 * tests/testsuite.at: Include it for compatibility with Autoconf
8678 2.57.
8679 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
8680 be ignore.
8681
327b5b56
PE
86822003-08-04 Paul Eggert <eggert@twinsun.com>
8683
8684 Rework code slightly to avoid gcc -Wtraditional warnings.
8685 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
8686 The returned value is now stored in *YY0. All callers changed.
8687 * src/output.c (merge_output): Adjust to the above change.
8688
0051e3ed
PE
86892003-07-26 Paul Eggert <eggert@twinsun.com>
8690
8691 * data/glr.c (YYASSERT): New macro.
8692 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
8693 yyresolveStates, yyprocessOneStack):
8694 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
8695 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 8696
137437c6
PE
86972003-07-25 Paul Eggert <eggert@twinsun.com>
8698
5b620e06
PE
8699 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
8700 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 8701 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
8702 by Frank Heckenbach, though I have omitted the structure-initialization
8703 part of his glr-knr.diff patch since I recall that the Portable
8704 C Compiler didn't require that change.
8705
137437c6
PE
8706 Let the user specify how to allocate and free memory.
8707 Derived from a suggestion by Frank Heckenbach in
161a71f3 8708 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
8709 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
8710 All uses of free, malloc, realloc changed to use these macros,
8711 and unnecessary casts removed.
8712 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
8713
ddb85ca5
PE
87142003-07-06 Matthias Mann <MatthiasMann@gmx.de>
8715
8716 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
8717 use s.empty() rather than s == "" to test for empty string; see
161a71f3 8718 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
8719 (trivial change)
8720
39910e09
AD
87212003-06-25 Akim Demaille <akim@epita.fr>
8722
8723 * config/depcomp, config/install-sh: Update from masters.
8724
0ae99356
PE
87252003-06-20 Paul Eggert <eggert@twinsun.com>
8726
8727 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
8728 and return properly parenthesized result.
8729 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
8730 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8731 Remove unnecessary parentheses from uses.
8732 * doc/bison.texinfo (Location Default Action): Describe the
8733 conventions for parentheses.
8734
cd05d13c
PE
87352003-06-19 Paul Eggert <eggert@twinsun.com>
8736
81fd08ca
PE
8737 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
8738 yyreportTree): Do not assume that size_t is the same width as int,
8739 when printing sizes. Print sizes using an unsigned format.
8740 Problem reported by Frank Heckenbach in
161a71f3 8741 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 8742
cd05d13c
PE
8743 Port to Forte Developer 7 C compiler.
8744 * data/glr.c (struct YYLTYPE): If locations are not being used,
8745 declare a single dummy member, as empty structs do not conform
8746 to the C standard.
8747 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
8748 the Forte Developer 7 C compiler complains that end-of-loop
8749 code is not reached.
8750
4dcf140b
PE
87512003-06-17 Paul Eggert <eggert@twinsun.com>
8752
8753 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
8754 avoid warnings from picky compilers about redefinition of PARAMS.
8755
8dd76bee
PE
87562003-06-17 Paul Eggert <eggert@twinsun.com>
8757
8758 Version 1.875b.
8759
8760 * NEWS: Document 1.875b.
8761
8762 * lib/bbitset.h: Do not include config.h; that's the includer's job.
8763 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
8764 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
8765 Don't use 'index' in comments, as it's a builtin fn on some hosts.
8766 * lib/bitset_stats.c: Include gettext.h unconditionally, as
8767 per recent gettext manual's suggestion.
8768 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
8769 Use prototypes, not old-style definitions.
8770 * lib/lbitset.c (lbitset_unused_clear): Likewise.
8771 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
8772 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
8773 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
8774 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
8775 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
8776 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
8777 vbitset_or_and_cmp, vbitset_copy): Likewise.
8778
8779 * lib/libiberty.h: Do not include config.h; that's the includer's job.
8780 Do not include <stdlib.h>.
8781 (PARAMS): Define unconditionally for C89.
8782 (ATTRIBUTE_NORETURN): Remove.
8783 (ATTRIBUTE_UNUSED): Define unconditionally.
8784
8785 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 8786 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
8787 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
8788 * lib/vbitset.c, lib/vbitset.h: New files.
8789 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
8790 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
8791 from libbitset.
8792
8793 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
8794 `How Can I Reset @code{yyparse}', since texinfo does not allow
8795 arbitrary @ in node names.
8796
8797 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
8798 shouldn't be needed according to the gettext 0.12.1 documentation
8799 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 8800 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 8801 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 8802 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 8803
8dd76bee
PE
8804 * lib/.cvsignore: Add stdbool.h.
8805 * m4/.cvsignore: Add nls.m4, po.m4.
8806
8807 Upgrade to CVS gnulib.
8808 * stdbool_.h: File renamed from stdbool.h.in.
8809 * configure.ac (AM_STDBOOL_H): Invoke this instead of
8810 AC_HEADER_STDBOOL.
8811 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
8812 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
8813 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
8814 (MOSTLYCLEANFILES): New var.
8815 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
8816 (stdbool.h): New rule.
8817 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
8818 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
8819 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
8820 m4/quote.m4: Upgrade to today's gnulib.
8821
8822 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
8823 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
8824 the tests right now.
8825 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
8826 yyerror are declared before use; C99 requires this.
8827
25005f6a
PH
88282003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8829
8830 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
8831 first.
8832 (yyrecoverSyntaxError): Correct the logic for setting and testing
8833 yyerrState.
8834 Correct comment on handling EOF.
8835 Allow states with only a default reduction, rather than failing
8dd76bee 8836 (I can't quite reconstruct why these were not allowed before).
25005f6a 8837
137437c6 8838 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 8839 buffer overruns, corrupting state.
8dd76bee
PE
8840
8841 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
8842 definition.
8843 * src/reader.h (max_left_semantic_context): New variable declaration.
8844 * src/scan-gram.l (max_left_semantic_context): Define.
8845 (handle_action_dollar): Update max_left_semantic_context.
8846 * data/glr.c (YYMAXLEFT): New definition.
8847 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
8848 (yyresolveAction): Ditto.
8849
8850 Fixes to problems with location handling in GLR parsers reported by
8851 Frank Heckenbach (2003/06/05).
8852
8853 * data/glr.c (YYLTYPE): Make trivial if locations not used.
8854 (YYRHSLOC): Add parentheses, and define only if locations used.
8855 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
8856 locations not used.
8857 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
8858 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 8859
25005f6a
PH
8860 * tests/cxx-type.at: Exercise location information; update tests
8861 to differentiate output with and without locations.
8dd76bee 8862 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
8863 because default YYLTYPE not yet defined.
8864 Change semantic actions to compute strings, rather than printing
8865 them directly (to test proper passing of semantics values). Change
8866 output to prefix notation and update test data and expected results.
8867 (yylex): Track locations.
8868 (stmtMerge): Return value rather than printing, and include arguments
8869 in value.
8dd76bee 8870
711f40b7
PE
88712003-06-03 Paul Eggert <eggert@twinsun.com>
8872
8873 Avoid warnings generated by GCC 2.95.4 when Bison is
8874 configured with --enable-gcc-warnings.
8875 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
8876 yy::]b4_parser_class_name[::translate_,
8877 yy::Stack::operator[] (unsigned),
8878 yy::Stack::operator[] (unsigned) const,
8879 yy::Slice::operator[] (unsigned),
8880 yy::Slice::operator[] (unsigned) const):
8881 Rename local vars to avoid warnings.
8882 * tests/glr-regression.at (Improper handling of embedded actions
8883 and $-N in GLR parsers): Remove unused local variable from yylex.
8884 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
8885 (void) as arg when not pure, since we now assume C89 when building
8886 Bison. Pacify GCC by using parameter.
8887
ac695f7d
PE
88882003-06-02 Paul Eggert <eggert@twinsun.com>
8889
8890 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
8891 yy::Location::lines, yy::Location::columns): Rename arguments
8892 to avoid shadowing; this removes a warning generated by GCC 3.3.
8893
26ec81e0
PE
88942003-06-01 Paul Eggert <eggert@twinsun.com>
8895
8896 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
8897 to g++, as GCC 3.3 complains if you do it.
8898 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
8899 everything that WARNING_CFLAGS has, except omit warnings
8900 not suitable for C++.
8901 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
8902 * tests/atlocal.in (CXXFLAGS): New var.
8903 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
8904
8905 Fix a GLR parser bug I reported in February; see
161a71f3 8906 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
8907 The problem was that GLR parsers did not conform to the C standard,
8908 because actions like { $1 = $2 + $3; } expanded to expressions
8909 that invoked YYFILL in separate subexpressions, and YYFILL assigned
8910 to a local variable. The C standard says that expressions
8911 like (var = f ()) + (var = f ()) have undefined behavior.
8912 Another problem was that GCC sometimes issues warnings that
8913 yyfill and its parameters are unused.
8914
8915 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
8916 as possibly unused.
8917 (yyfill): New function.
8918 (YYFILL): Use it.
8919 (yyuserAction): Change type of yynormal to bool, so that it matches
8920 the new yyfill signature. Mark it as possibly unused.
8921
8922
8923 Follow up on a bug I reported in February, where a Bison-generated
8924 parser can loop. Provide a test case and a fix for yacc.c. I
8925 don't have a fix for lalr1.cc or for glr.c, unfortunately.
8926 The original bug report is in:
161a71f3 8927 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
8928
8929 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
8930 macro's size was becoming unwieldy.
8931 (yyerrlab): Do not discard an empty lookahead symbol, as this
8932 might destroy garbage.
8933 (yyerrorlab): New label, with the old contents of YYERROR,
8934 plus the following change: pop the stack of rhs corresponding
8935 to the production that invoked YYERROR. That is how Yacc
8936 behaves, and POSIX requires this behavior.
8937 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
8938 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
8939 Define 'alarm' to do nothing if unistd.h is not available.
8940 Add a new rule "exp: '-' error;" to test the above change to
8941 data/yacc.c. Use 'alarm' to abort any test taking longer than
8942 10 seconds, as it's probably looping.
8943 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
8944 Also, the new yacc.c generates two fewer diagnostics for an
8945 existing test.
8946
d0829076
PE
89472003-05-24 Paul Eggert <eggert@twinsun.com>
8948
c6ae27df
PE
8949 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
8950 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
8951 This fixes a problem reported by John Bowman when the Compaq/HP
8952 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
8953 -ansi -Wall -gall).
8954 * data/yacc.c (union yyalloc): Likewise.
8955 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 8956
d0829076
PE
8957 Switch from 'int' to 'bool' where that makes sense.
8958
8959 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
8960 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
8961 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
8962 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
8963 Return or accept bool, not int. All callers changed.
8964 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
8965 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
8966 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
8967 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
8968 bitset_or_and_cmp_): Likewise.
8969 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
8970 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
8971 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
8972 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
8973 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
8974 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
8975 bitset_stats_or_and_cmp): Likewise.
8976 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
8977 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
8978 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
8979 ebitset_xor_cmp): Likewise.
8980 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
8981 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
8982 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
8983 lbitset_xor_cmp): Likewise.
8984 * lib/bbitset.h: Include <stdbool.h>.
8985 (struct bitset_vtable): The following members now return bool, not
8986 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
8987 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
8988 or_and_cmp).
8989 * src/conflicts.c (count_rr_conflicts): Likewise.
8990 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
8991 All uses changed.
8992 * lib/ebitset.c (ebitset_obstack_init): Likewise.
8993 * lib/lbitset.c (lbitset_obstack_init): Likewise.
8994 * src/getargs.c (debug_flag, defines_flag, locations_flag,
8995 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
8996 graph_flag): Likewise.
8997 * src/getargs.h (debug_flag, defines_flag, locations_flag,
8998 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
8999 graph_flag): Likewise.
9000 * src/output.c (error_verbose): Likewise.
9001 * src/output.h (error_verbose): Likewise.
9002 * src/reader.c (start_flag, typed): Likewise.
9003 * src/reader.h (typed): Likewise.
9004 * src/getargs.c (LOCATIONS_OPTION): New constant.
9005 (long_options, getargs): Use it.
9006 * src/lalr.c (build_relations): Use bool, not int.
9007 * src/nullable.c (nullable_compute): Likewise.
9008 * src/print.c (print_reductions): Likewise.
9009 * src/tables.c (action_row, pack_vector): Likewise.
9010 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
9011 * src/output.c (prepare): Use it.
9012 * src/output.c (token_definitions_output,
9013 symbol_destructors_output, symbol_destructors_output): Use string,
9014 not boolean integer, to keep track of whether to output separator.
9015 * src/print_graph.c (print_core): Likewise.
9016 * src/state.c (state_rule_lookaheads_print): Likewise.
9017
9018 * config/install-sh: Sync from automake 1.7.5.
9019
6b2584b7
PE
90202003-05-14 Paul Eggert <eggert@twinsun.com>
9021
9022 * src/parse-gram.y (rules_or_grammar_declaration): Require a
9023 semicolon after a grammar declaration, in the interest of possible
9024 future changes to the Bison input language.
9025 Do not allow a stray semicolon at the start of the grammar.
9026 (rhses.1): Allow one or more semicolons after any rule, including
9027 just before "|" as required by POSIX.
9028 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
9029 grammar.
9030
caf37a36
ADL
90312003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
9032
9033 %parse-param support for lalr1.cc.
9034
9035 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
9036 b4_cc_constructor_calls, b4_cc_constructor_call,
9037 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
9038 definitions.
9039 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
9040 parse-param arguments.
9041 (yy::b4_parser_class_name): Declare instance variables to
9042 hold parse-param arguments.
9043 * tests/calc.at: s/value/semantic_value/ because value clashes
9044 with a member of yy::b4_parser_class_name. Adjust C++ code
9045 to handle %parse-param. Enable %parse-param test in C++.
9046
3ab37077
PE
90472003-05-12 Paul Eggert <eggert@twinsun.com>
9048
9049 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
9050 English a bit. Fix fclose typo. Change "const char" to "char
9051 const", and use ANSI C rather than K&R for "main". Suggest
9052 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
9053 and suggest yy_switch_to_buffer.
9054
90552003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
9056
9057 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
9058 C89. This avoids a diagnostic on compilers that define __STDC__
9059 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 9060 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 9061
e743727f
PE
90622003-05-03 Paul Eggert <eggert@twinsun.com>
9063
9064 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
9065 Do not overrun array bounds.
9066 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 9067 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 9068
916708d5
AD
90692003-04-29 Akim Demaille <akim@epita.fr>
9070
9071 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
9072 * src/getargs.c, src/getargs.h: here, as bool, not int.
9073 (nondeterministic_parser): New.
9074 * src/parse-gram.y, src/scan-gram.l: Support
9075 %nondeterministic-parser.
9076 * src/output.c (prepare): Use nondeterministic_parser instead
9077 of glr_parser where appropriate.
9078 * src/tables.c (conflict_row, action_row, save_row)
9079 (token_actions, token_actions, pack_vector): Ditto.
9080
a06ea4aa
AD
90812003-04-29 Akim Demaille <akim@epita.fr>
9082
9083 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
9084
211074ca
AD
90852003-04-29 Akim Demaille <akim@epita.fr>
9086
9087 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
9088 with %pure-parser and %locations to exercise the patch from Yakov
9089 Markovitch below.
9090
6175ffe3
PE
90912003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
9092
9093 * data/yacc.c: (b4_lex_param): Corrected for the case where
9094 %lex-param is provided and %pure-parser isn't.
9095
b1e95857
PE
90962003-04-27 Paul Eggert <eggert@twinsun.com>
9097
9098 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 9099 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
9100 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
9101 if it is not defined.
9102 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
9103
acda9df6
PE
91042003-04-26 Paul Eggert <eggert@twinsun.com>
9105
3470c57b
PE
9106 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
9107 Declare to be of type suitable for the ninf value itself, not of
9108 type suitable for the corresponding table, since the latter might
9109 be unsigned but the ninf value might be negative. This fixes a
9110 bug reported by Alexandre Duret-Lutz in
161a71f3 9111 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 9112
acda9df6
PE
9113 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
9114 invokes it. We shouldn't invoke it twice because it will attempt
9115 to put error.o in the archive twice. This fixes a glitch reported
9116 by Martin Mokrejs in
161a71f3 9117 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 9118
b5250f26
PE
91192003-04-21 Paul Eggert <eggert@twinsun.com>
9120
9121 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
9122 to gnulib.
9123
089ac0f1
PE
91242003-04-21 Yakov Markovitch <Markovitch@iso.ru>
9125
9126 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
9127 Fix obvious typo that results in uncompilable GLR parsers
9128 when both %pure-parser and %locations are used. (trivial change)
9129
5ededac6
PE
91302003-04-17 Paul Eggert <eggert@twinsun.com>
9131
1b8f2fff
PE
9132 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
9133 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
9134 Do not insert the expected token via unput, as this runs afoul
9135 of a POSIX-compatibility bug in flex 2.5.31.
9136 All uses changed to BEGIN the parent state,
9137 since we no longer insert the expected token via unput.
9138 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
9139 that is no longer emitted after the above change.
9140
5ededac6
PE
9141 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
9142 the first one. This change is from Paul Hilfinger, and it fixes
9143 regression reported by Werner Lemberg in
161a71f3 9144 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
9145
9146 (resolve_sr_conflict): Don't invoke state_errs_set
9147 unless one or more tokens have been explicitly made errors.
9148 Otherwise, the above change causes Bison to abort.
9149
9150 * tests/existing.at (GNU pic Grammar): New test case, taken from
9151 Lemberg's email.
9152
b8be9132
AD
91532003-03-31 Akim Demaille <akim@epita.fr>
9154
9155 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
9156
d423d460
AD
91572003-03-31 Akim Demaille <akim@epita.fr>
9158
9159 * src/output.c (prepare_symbols): Avoid trailing spaces in the
9160 output.
9161
c7e441b4
AD
91622003-03-31 Akim Demaille <akim@epita.fr>
9163
9164 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
9165 From Paul Hilfinger.
9166
231897ad
AD
91672003-03-29 Akim Demaille <akim@epita.fr>
9168
9169 * m4/error.m4: Do not put under dynamic conditions some code which
9170 expansion is under static control.
9171
5b066063
AD
91722003-03-29 Akim Demaille <akim@epita.fr>
9173
9174 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
9175
22a74fec
AD
91762003-03-29 Akim Demaille <akim@epita.fr>
9177
9178 * doc/bison.texinfo (Strings are Destroyed): New.
9179
0eee27e7
PE
91802003-03-13 Paul Eggert <eggert@twinsun.com>
9181
9182 * .cvsignore: Add configure.lineno.
9183 * src/.cvsignore: Add yacc.
9184 * tests/.cvsignore: Add testsuite.log.
9185 * doc/fdl.texi: Sync with latest FSF version.
9186
f61aad93
PE
91872003-03-12 Paul Eggert <eggert@twinsun.com>
9188
537636c7
PE
9189 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
9190 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
9191 cursor, instead of leaving it undefined. This fixes a bug
9192 reported by Tim Van Holder in
161a71f3 9193 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
9194 * tests/input.at (Torturing the Scanner): Test the scanner on
9195 an empty input file, which was Tim Van Holder's test case.
9196
9197 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
9198 <sys/resource.h> can be included, include sys/time.h and
9199 sys/times.h first, if available. This works around the SunOS
9200 4.1.4 porting bug reported by Bruce Becker in
161a71f3 9201 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
9202
9203 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
9204 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
9205 AC_HEADER_SYS_WAIT.
9206
f61aad93
PE
9207 Merge changes from gnulib. This was prompted because the CVS
9208 snapshot didn't build on Solaris 7 due to strnlen problems.
9209
9210 These changes need to be merged back into gnulib:
9211 * lib/hash.c: Include <stdbool.h> unconditionally.
9212 * m4/onceonly.m4 (m4_quote): New macro.
9213 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
9214 Quote AC_FOREACH variable-expansions properly.
9215 The 2003-01-03 obstack.h change also needs merging.
9216 {end of changes requiring merging}
5b066063 9217
f61aad93
PE
9218 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
9219 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
9220 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
9221 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
9222 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
9223 New files, imported from gnulib.
9224 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
9225 above.
9226
9227 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
9228 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
9229 gnulib sources.
9230
9231 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
9232 Add.
9233 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
9234 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
9235 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
9236 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
9237 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
9238 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
9239 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
9240 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
9241 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
9242 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
9243 (jm_PREREQ_ARGMATCH): Remove.
9244 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
9245 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
9246
9247 * src/system.h: Include <stdbool.h> unconditionally.
9248
9249 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
9250 assuming at least C89 in the bitset code for some time now.
9251
d2ffe116
AD
92522003-03-03 Akim Demaille <akim@epita.fr>
9253
9254 * ro.po: New.
9255
052826fd
AD
92562003-03-02 Akim Demaille <akim@epita.fr>
9257
9258 * doc/bison.texinfo (Table of Symbols): Reactivate the
9259 documentation for %lex-param, and %parse-param.
9260
c4749565
AD
92612003-03-02 Akim Demaille <akim@epita.fr>
9262
9263 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
9264 generate verbose error messages.
9265 Use the number of tokens as an upper bound in yytname, as it
9266 cannot be a non terminal.
9267
d5286af1
AD
92682003-03-02 Akim Demaille <akim@epita.fr>
9269
9270 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
9271 message.
9272
22e304a6
AD
92732003-03-02 Akim Demaille <akim@epita.fr>
9274
22e304a6
AD
9275 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
9276 Use them to exercise yycheck overrun.
9277 Based on Andrew Suffield's grammar.
9278
67a25fed
AD
92792003-03-02 Akim Demaille <akim@epita.fr>
9280
9281 Create tests/local.at for Bison generic testing macros.
9282
9283 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
9284 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
9285 This new file.
9286 * tests/calc.at (AT_CHECK_CALC): Adjust.
9287 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
9288 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
9289 * tests/local.at: here.
9290 (AT_COMPILE_CXX): Tags the tests using it as c++.
9291 Ignore the test if CXX is not functional.
9292
9c2b381f
PE
92932003-03-01 Paul Eggert <eggert@twinsun.com>
9294
9295 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
9296 not loc->end, since loc->end might contain garbage and this leads
9297 to undefined behavior on some platforms.
9298 (id_loc, token_start): Use (IF_LINTed) initial values that do not
9299 depend on *loc, so that the reader doesn't give the the false
9300 impression that *loc is initialized.
9301 (<INITIAL>"%%"): Do not bother setting code_start, since its value
9302 does not survive the return.
9303
0433ba88
AD
93042003-03-01 Akim Demaille <akim@epita.fr>
9305
9306 * src/scan-gram.l (code_start): Always initialize it when entering
9307 into yylex, as SC_EPILOGUE is activated *before* the corresponding
9308 yylex invocation. An alternative would be making it static, but
9309 then it starts with the second %%'s beginning, instead of its end.
9310
b305ea69
PE
93112003-02-28 Paul Eggert <eggert@twinsun.com>
9312
9313 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
9314 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 9315 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 9316
c3d25e01
PE
93172003-02-26 Paul Eggert <eggert@twinsun.com>
9318
9319 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
9320 Remove Sequent/Pyramid discussion (nobody uses them any more).
9321 Merge VMS and MS-DOS discussion; these ports may well be dead
9322 but let's keep mentioning them for now. Put <> around email
9323 addresses. Add copyright notice.
9324
c267ffbc
PE
93252003-02-24 Paul Eggert <eggert@twinsun.com>
9326
9327 * data/glr.c (yy_reduce_print): yylineno -> yylno,
9328 to avoid collision with flex use of yylineno.
9329 Problem reported by Bruce Lilly in
161a71f3 9330 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
9331 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9332 * data/yacc.c (yy_reduce_print): Likewise.
9333
9334 * config/depcomp: Sync with Automake 1.7.3.
9335
f939fc12
AD
93362003-02-21 Akim Demaille <akim@epita.fr>
9337
9338 * data/lalr1.cc: Use temporary variables instead of casts to
9339 change integer types.
9340 Suggested by Paul Eggert.
9341
95923bd6
AD
93422003-02-21 Akim Demaille <akim@epita.fr>
9343
9344 * doc/bison.texinfo: Use "location" consistently to refer to @n,
9345 to avoid confusions with lalr1.cc's notion of Position.
9346 Suggested by Paul Eggert.
9347
2cdc240e
AD
93482003-02-20 Akim Demaille <akim@epita.fr>
9349
9350 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
9351 before initial_columns.
9352 (location.hh): Use consistent variable names when defining the
9353 operator<<.
9354 Use "last" so that we subtract from Positions, not from unsigned.
9355
5d003116
AD
93562003-02-20 Akim Demaille <akim@epita.fr>
9357
9358 * data/lalr1.cc (position.hh): New subfile, including the extended
9359 and Doxygen'ed documentation of class Position.
9360 (location.hh): Use it.
9361 Document a` la Doxygen.
ba1ecc07 9362 With the help of Benoit Perrot.
5d003116 9363
d02b25f9
AD
93642003-02-20 Akim Demaille <akim@epita.fr>
9365
9366 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
9367 AT_YACC_IF.
9368 Redefine AT_YYERROR_SEES_LOC_IF using it.
9369 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
9370 not defined.
9371 Don't use the location in yy::Parser::error_ and
9372 yy::Parser::print_ when not %locations.
9373 Activate more lalr1.cc tests.
9374
0d1c3a04
AD
93752003-02-19 Akim Demaille <akim@epita.fr>
9376
9377 * data/lalr1.cc: When displaying a line number, be sure to make it
9378 an int.
9379
60a777aa
AD
93802003-02-19 Akim Demaille <akim@epita.fr>
9381
9382 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
9383 Remove, useless.
9384 (YYABORT, YYACCEPT, YYERROR): New.
9385 * tests/calc.at: Renable the lalr1.cc test.
9386
0b86fc41
AD
93872003-02-19 Akim Demaille <akim@epita.fr>
9388
9389 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
9390 error recovery, mixing with/without pops and discarding of the
9391 lookahead.
9392 Exercise YYERROR.
9393 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
9394
da99a5dc
PE
93952003-02-17 Paul Eggert <eggert@twinsun.com>
9396
9397 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
9398 * tests/testsuite.at (AT_COMPILE): Use them.
9399 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 9400 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 9401
93b8c255
PE
94022003-02-12 Paul Eggert <eggert@twinsun.com>
9403
9404 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
9405 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 9406 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
9407 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
9408 Check for malloc failure, for consistency with yacc.c.
9409 (yytname_size): Remove, for consistency with yacc.c.
9410
9411 The bug still remains in data/lalr1.cc, as I didn't have time
9412 to fix it there.
9413
7548fed2
AD
94142003-02-06 Akim Demaille <akim@epita.fr>
9415
9416 * configure.ac (GXX): Rename as...
9417 (CXX): this, to keep the original Autoconf semantics.
9418 Require 2.57.
9419 * data/lalr1.cc: Fix b4_copyright invocations.
9420 If YYDEBUG is not defined, don't depend upon name_ being defined.
9421 (location.hh): Include string and iostream.
9422 (Position::filename): New member.
9423 (Position::Position ()): New.
9424 (operator<< (Position)): New.
9425 (operator- (Position, int)): New.
9426 (Location::first, Location::last): Rename as...
9427 (Location::begin, Location::end): these, to mock the conventional
9428 iterator names.
9429 (operator<< (Location)): New.
9430 * tests/atlocal.in (CXX): New.
9431 * tests/testsuite.at (AT_COMPILE_CXX): New.
9432 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
9433 locations in a more synthetic way.
9434 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
9435 lalr1.cc is used.
9436 Adjust the C locations to match those from Emacs: first column is
9437 column 0.
9438 Change all the expected results.
9439 Conform to the GCS: simplify the locations when applicable.
9440 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
9441 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
9442 these CPP macros with the m4 macros new defined by...
9443 (AT_CHECK_PUSHDEFS): this, i.e.:
9444 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 9445 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
9446 New macros.
9447 (AT_CHECK_POPDEFS): Undefine them.
9448 (AT_CHECK_CALC_LALR1_CC): New.
9449 Use it for the first lalr1.cc test.
9450
43a176ef
AD
94512003-02-04 Akim Demaille <akim@epita.fr>
9452
9453 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
9454 Location as is defined.
9455
fc049e9c
AD
94562003-02-04 Akim Demaille <akim@epita.fr>
9457
9458 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
9459 name_ being defined.
9460
a737b216
PE
94612003-02-03 Paul Eggert <eggert@twinsun.com>
9462
9463 * src/gram.h (start_symbol): Remove unused decl.
9464
9465 Use more-consistent naming conventions for local vars.
9466
9467 * src/derives.c (derives_compute): Change type of local var from
9468 int to rule_number.
9469 * src/gram.c (grammar_rules_partial_print): Likewise.
9470 * src/print.c (print_core): Likewise.
9471 * src/reduce.c (reduce_grammar_tables): Likewise.
9472
9473 * src/gram.c (grammar_dump): Change name of item_number *
9474 local var from r to rp.
9475 * src/nullable.c (nullable_compute): Likewise.
9476
9477 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
9478
9479 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
9480 for symbol or symbol_number var.
9481 * src/reader.c (grammar_start_symbol_set): Likewise.
9482 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
9483 Likewise.
9484 * src/state.c (transitions_to): Likewise.
9485 * src/state.h: Likewise.
9486 * src/tables.c (symbol_number_to_vector_number): Likewise.
9487
9488 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
9489 char * var.
9490
9491 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
9492 var.
9493
9494 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
9495 var.
9496
9497 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
9498 Use str, not s, for char * var. Use ch, not c, for character var.
9499 Use size for size var.
9500
9501 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
9502 char * var.
9503 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
9504 uniqstr var.
9505 * src/uniqstr.h: Likewise.
9506
9507 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9508 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9509 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
9510 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
9511 param to have same name as that of enum, so that we don't use
9512 "s" to stand for a non-state.
9513
68e93ad5
AD
95142003-02-02 Akim Demaille <akim@epita.fr>
9515
9516 * src/scan-skel.l: Scan more than one inert character per yylex
9517 invocation.
9518
92898986
PE
95192003-02-01 Paul Eggert <eggert@twinsun.com>
9520
9521 Version 1.875a.
9522
1d9d5d71
PE
9523 * po/LINGUAS: Add ms.
9524
0435d061
AD
95252003-01-30 Akim Demaille <akim@epita.fr>
9526
9527 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
9528
6029a57f
PH
95292003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9530
9531 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
9532 of $1.
0435d061
AD
9533
9534 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 9535 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 9536 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 9537
6029a57f
PH
9538 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
9539 (b4_rhs_location): Ditto.
0435d061 9540 (yyfill): New function to copy from stack tree into array
6029a57f 9541 incrementally.
0435d061
AD
9542 (yyuserAction): Modify to allow incremental move of semantic values
9543 to rhs array when in GLR mode.
9544 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
9545 as needed.
9546 Remove dummy use of yystack, as there is now a guaranteed use.
9547 (yydoAction): Modify to allow incremental move of semantic values
9548 to rhs array when in GLR mode.
9549 (yyresolveAction): Ditto.
9550 (yyglrShiftDefer): Update comment.
0435d061 9551 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
9552 (yyglrReduce): Ditto.
9553 (yydoAction): Ditto
0435d061 9554
6029a57f
PH
9555 * tests/glr-regr1.at: Rename to ...
9556 * tests/glr-regression.at: Add new regression test for the problems
9557 described above (adapted from S. Eken).
9558 Update copyright notice.
9559 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
9560 * tests/Makefile.am: Ditto.
9561
6cee6297
PE
95622003-01-28 Paul Eggert <eggert@twinsun.com>
9563
9564 * data/lalr1.cc: Do not use @output_header_name@ unless
9565 b4_defines_flag is set. This fixes two bugs reported by
9566 Tim Van Holder in
161a71f3
PE
9567 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
9568 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 9569
b2a836b5
PE
95702003-01-21 Paul Eggert <eggert@twinsun.com>
9571
9572 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
9573 we don't need to worry about yyerrlab1 being reported as an
9574 "unused label" by non-GCC C compilers. The downside is that if
9575 locations are used then a couple of statements are duplicated each
9576 time YYERROR is invoked, but the upside is that the warnings
9577 should vanish.
9578 (yyerrlab1): Move code to YERROR.
9579 (yyerrlab2): Remove. Change uses back to yyerrlab1.
9580 This reverts some of the 2002-12-27 change.
9581
4196b931
PE
95822003-01-17 Paul Eggert <eggert@twinsun.com>
9583
9584 * src/output.c (symbol_printers_output): Fix typo that led
9585 to core dump. Problem reported by Antonio Rus in
161a71f3 9586 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 9587
3ae831b4
AD
95882003-01-13 Akim Demaille <akim@epita.fr>,
9589 Quoc Peyrot <chojin@lrde.epita.fr>,
9590 Robert Anisko <anisko_r@lrde.epita.fr>
9591
9592 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
9593 when the stacks contain one element, as the loop would otherwise
9594 free the last state, and then use the top state (the one we just
9595 popped). This means that the initial elements will not be freed
9596 explicitly, as is the case in yacc.c; it is not a problem, as
9597 these elements have fake values.
9598
e3aa65c5
PE
95992003-01-11 Paul Eggert <eggert@twinsun.com>
9600
9601 * NEWS: %expect-violations are now just warnings, reverting
9602 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
9603 bootstrapping problem reported by Matthias Klose; see
161a71f3 9604 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
9605 * src/conflicts.c (conflicts_print): Likewise.
9606 * tests/conflicts.at (%expect not enough, %expect too much,
9607 %expect with reduce conflicts): Likewise.
9608 * doc/bison.texinfo (Expect Decl): Document this. Also mention
9609 that the warning is enabled if the number of conflicts changes
9610 (not necessarily increases).
9611
9612 * src/getargs.c (version): Update copyright year.
9613
f0057011
AD
96142003-01-09 Akim Demaille <akim@epita.fr>
9615
9616 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
9617
1ee6d2a0
PE
96182003-01-08 Paul Eggert <eggert@twinsun.com>
9619
9620 * Makefile.maint (WGETFLAGS):
9621 New macro, containing "-C off" to disable proxy caches.
9622 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
9623 (rel-check): Use $(WGET) instead of wget.
9624
d4fd77c4
PE
96252003-01-06 Paul Eggert <eggert@twinsun.com>
9626
9627 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
9628 the GLR paper of Scott, Johnstone and Hussain.
9629
464c6927
PE
96302003-01-04 Paul Eggert <eggert@twinsun.com>
9631
d600ee67
PE
9632 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
9633 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
9634 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
9635 (EXTRA_LIBRARIES): New var, for liby.a.
9636 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
9637 (EXTRA_SCRIPTS): New var, for yacc.
9638
464c6927
PE
9639 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
9640 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
9641 Problem reported by Nelson H. F. Beebe.
9642
96432003-01-03 Paul Eggert <eggert@twinsun.com>
9644
9645 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
9646 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
9647 when compiling Bison 1.875's `bitset bset = obstack_alloc
9648 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
9649
9650 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
9651 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
9652 grow to a huge size with typical invocation.
d600ee67 9653
464c6927
PE
9654 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
9655 Use the pattern recommended by Autoconf 2.57, except also protect
9656 against double-definition.
9657 * src/system.h: Likewise.
9658 Portability issues reported by Nelson H. F. Beebe.
d600ee67 9659
464c6927
PE
9660 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
9661 All uses changed. Provide a definition in both C and C++.
9662 (yytrue, yyfalse): Define even if defined (__cplusplus).
9663
9664 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
9665 Reported by Nelson H. F. Beebe.
d600ee67 9666
464c6927
PE
9667 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
9668
0f42c7d5
PE
96692003-01-02 Paul Eggert <eggert@twinsun.com>
9670
9671 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
9672 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
9673 Bug reported by Nelson H. F. Beebe.
9674
dc546b0f
PE
96752003-01-01 Paul Eggert <eggert@twinsun.com>
9676
9677 * Version 1.875.
9678
2c09b6a7
PE
96792002-12-30 Paul Eggert <eggert@twinsun.com>
9680
9681 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
9682 Moved here from...
9683 (<INITIAL>","): Here. This causes stray "," to be treated
9684 more uniformly.
9685
dc546b0f 9686 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
9687 last brace in braced code when not in Yacc mode, for compatibility
9688 with Bison 1.35. This resurrects the 2001-12-15 patch to
9689 src/reader.c.
9690
9691 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
9692 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
9693
535c0f63
PE
96942002-12-28 Paul Eggert <eggert@twinsun.com>
9695
9696 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
9697 that of SYM's type. This fixes Debian bug 168069, reported by
9698 Thomas Olsson.
d600ee67 9699
963fcc17
PE
97002002-12-28 Paul Eggert <eggert@twinsun.com>
9701
9702 Version 1.75f.
9703
9704 Switch back to the Yacc style of conflict reports, undoing some
9705 of the 2002-07-30 change.
9706 * doc/bison.texinfo (Understanding): Use Yacc style for
9707 conflict reports. Also, use new way of locating rules.
9708 * src/conflicts.c (conflict_report):
9709 Renamed from conflict_report_yacc, removing the old
9710 'conflict_report'. Translate the entire conflict report at once,
9711 so that we don't assume that "," has the same interpretation in
9712 all languages.
9713 (conflicts_output): Use Yacc-style conflict report for each state,
9714 instead of our more-complicated style.
9715 (conflicts_print): Use Yacc-style conflict report, except print
9716 the input file name when not emulating Yacc.
9717 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
9718 Conflicted Reduction, %expect not enough, %expect too much,
9719 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
9720 * tests/existing.at (GNU Cim Grammar): Likewise.
9721 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
9722
9723 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
9724 fatal): Don't invoke fflush; it's not needed and it might even be
9725 harmful for stdout, as stdout might not be open.
9726 * src/reduce.c (reduce_print): Likewise.
9727
b1efe548
PE
97282002-12-27 Paul Eggert <eggert@twinsun.com>
9729
9730 Fix a bug where error locations were not being recorded correctly.
9731 This problem was originally reported by Paul Hilfinger in
161a71f3 9732 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
9733
9734 * data/yacc.c (yyparse): New local var yylerrsp, to record the
9735 top of the location stack's error locations.
9736 (yyerrlab): Set it. When discarding a token, push its location
9737 onto yylerrsp so that we don't lose track of the error's end.
9738 (yyerrlab1): Now is only the target of YYERROR, so that we can
9739 properly record the location of the action that failed. For GCC
9740 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
9741 GCC warning about yyerrlab1 being unused if YYERROR is unused.
9742 (yyerrlab2): New label, which yyerrlab now falls through to.
9743 Compute the error's location by applying YYLLOC_DEFAULT to
9744 the locations of all the symbols that went into the error.
9745 * doc/bison.texinfo (Location Default Action): Mention that
9746 YYLLOC_DEFAULT is also invoked for syntax errors.
9747 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9748 Error locations include the locations of all the tokens that were
9749 discarded, not just the last token.
d600ee67 9750
983c5c2c
PE
97512002-12-26 Paul Eggert <eggert@twinsun.com>
9752
b1efe548
PE
9753 * src/files.c: Include quote.h.
9754 (compute_output_file_names): Warn if we detect conflicting
9755 outputs to the same file. This should catch the misunderstanding
9756 exemplified by Debian Bug 165349, reported by Bruce Stephens..
9757
9758 * src/conflicts.c (conflicts_print): If the user specifies
9759 "%expect N", report an error if there are any reduce/reduce
9760 conflicts. This is what the manual says should happen.
9761 This fixes Debian bug 130890, reported by Anthony DeRobertis.
9762 * tests/conflicts.at (%expect with reduce conflicts): New test.
9763
983c5c2c
PE
9764 Don't use m4_include on relative file names, as it doesn't work as
9765 desired if there happens to be a file with that name under ".".
d600ee67 9766
983c5c2c
PE
9767 * m4sugar/version.m4: Remove; it was included but it wasn't used.
9768 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
9769 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
9770 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
9771 * src/output.c (output_skeleton): Use full path names when
9772 specifying a file to include; don't rely on include path, as
9773 it's unreliable when the working file contains a file with
9774 that name.
d600ee67 9775
983c5c2c
PE
97762002-12-25 Paul Eggert <eggert@twinsun.com>
9777
9778 Remove obsolete references to bison.simple and bison.hairy.
9779 Problem mentioned by Aubin Mahe in
161a71f3 9780 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
9781 * data/glr.c: Comment fix.
9782 * doc/bison.1: Remove references. Also, mention "yacc".
9783
9784 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
9785 with -g option.
9786
9787 * src/parse-gram.y (declaration): Use enum "report_states" rather
9788 than its numeric value 1.
9789
9790 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
9791 opening a new one. This fixes Debian bug 165349, reported by
9792 Bruce Stephens.
9793
23f2d9dc
PE
97942002-12-24 Paul Eggert <eggert@twinsun.com>
9795
9796 Version 1.75e.
9797
9798 * Makefile.maint (cvs-update): Don't assume that the shell
9799 supports $(...), as Solaris sh doesn't.
9800
9801 * src/parse-gram.y (lloc_default): Remove test for empty
9802 nonterminals at the end, since it didn't change the result.
9803
98042002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
9805
9806 If the user does not define YYSTYPE as a macro, Bison now declares it
9807 using typedef instead of defining it as a macro. POSIX requires this.
9808 For consistency, YYLTYPE is also declared instead of defined.
9809
9810 %union directives can now have a tag before the `{', e.g., the
9811 directive `%union foo {...}' now generates the C code
9812 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
9813 The default union tag is `YYSTYPE', for compatibility with Solaris 9
9814 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
9815 instead of `yyltype'.
9816
9817 `yystype' and `yyltype' are now obsolescent macros instead of being
9818 typedefs or tags; they are no longer documented and will be
9819 withdrawn in a future release.
9820
9821 * data/glr.c (b4_location_type): Remove.
9822 (YYSTYPE): Renamed from yystype.
9823 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
9824 (struct YYLTYPE): Renamed from struct yyltype.
9825 (YYLTYPE): Renamed from yyltype.
9826 (yyltype, yystype): New (and obsolescent) macros,
9827 for backward compatibility.
9828 * data/yacc.c: Likewise.
9829
9830 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
9831 does not specify a union tag. This is for compatibility with
9832 Solaris 9 yacc.
9833
9834 * src/parse-gram.y (add_param): 2nd arg is now char * not char
9835 const *, since it is now modified by stripping surrounding { }.
9836 (current_braced_code): Remove.
9837 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
9838 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
9839 trailing " {...}". Now of type <chars>.
9840 (grammar_declaration): Adjust to bundled tokens.
9841 (code_content): Remove; stripping is now done by add_param.
9842 (print_token_value): Print contents of bundled tokens.
9843 (token_name): New function.
9844
9845 * src/reader.h (braced_code, current_braced_code): Remove.
9846 (token_name): New decl.
9847
9848 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
9849 token_type, not braced_code code_kind. All uses changed.
9850 (SC_PRE_CODE): New state, for scanning after a keyword that
9851 has (or usually has) an immediately-following braced code.
9852 (token_type): New local var, to keep track of which token type
9853 to return when scanning braced code.
9854 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 9855 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
9856 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
9857 instead of returning a token type immediately.
9858 (<INITIAL>"{"): Set token type.
9859 (<SC_BRACED_CODE>"}"): Use it.
9860 (handle_action_dollar, handle_action_at): Now returns bool
9861 indicating success. Fail if ! current_rule; this prevents a core dump.
9862 (handle_symbol_code_dollar, handle_symbol_code_at):
9863 Remove; merge body into caller.
9864 (handle_dollar, handle_at): Complain in invalid contexts.
9865
9866 * NEWS, doc/bison.texinfo: Document the above.
9867 * NEWS: Fix years and program names in copyright notice.
9868
879ca4f8
PE
98692002-12-17 Paul Eggert <eggert@twinsun.com>
9870
9871 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
9872 Reporting, Table of Symbols): Omit mentions of %lex-param and
9873 %parse-param from the documentation for now.
9874
1c5fe69d
PE
98752002-12-15 Paul Eggert <eggert@twinsun.com>
9876
9877 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
9878 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
9879 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
9880 disagreed with the Bison documentation. Bug
9881 reported by Andrew Walrond.
d600ee67 9882
1c5fe69d
PE
9883 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
9884 as the caller now does that.
9885 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
9886 (YYEMPTY): Parenthesize right hand side, since others use it.
9887 (yyparse): Don't assume that our generated code is the only code
9888 that sets yychar.
9889
d1de5372
PE
98902002-12-13 Paul Eggert <eggert@twinsun.com>
9891
9892 Version 1.75d.
9893
9894 POSIX requires a "yacc" command.
9895 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
9896 (MOSTLYCLEANFILES): Add yacc.
9897 (yacc): New rule.
1c5fe69d 9898 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
9899 as an alias for bison y.
9900
9901 * po/LINGUAS: Add da.
d600ee67 9902
d1de5372
PE
9903 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
9904 problem with latest <getopt.h>.
9905 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
9906
9907 * doc/fdl.texi: Upgrade to 1.2.
9908 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
9909 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
9910 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
9911 gnulib.
9912 * config/install-sh: Sync with autotools.
9913
9914 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 9915 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
9916 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
9917 locations are requested.
9918 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
9919 locations are requested.
9920
d0f3fe23
PE
99212002-12-12 Paul Eggert <eggert@twinsun.com>
9922
9923 Remove unportable casts and storage allocation tricks.
9924 While we're at it, remove almost all casts, since they
9925 usually aren't needed and are a sign of trouble.
9926
9927 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
9928
9929 * src/derives.c (derives_compute): Do not subtract NTOKENS from
9930 the pointer DSET returned by malloc; this isn't portable.
9931 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
9932 Similarly for DERIVES.
9933 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
9934 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
9935 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
9936
9937 * src/derives.c (derives_compute): Do not bother invoking
9938 int_of_rule_number, since rule numbers are integers.
9939
9940 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
9941 rather than XMALLOC (char, N).
9942
9943 * src/files.c (filename_split): Rewrite to avoid cast.
9944
9945 * src/gram.h (symbol_number_as_item_number,
9946 item_number_as_symbol_number, rule_number_as_item_number,
9947 item_number_as_rule_number):
9948 Now inline functions rather than macros, to avoid casts.
9949 * src/state.h (state_number_as_int): Likewise.
9950 * src/tables.c (state_number_to_vector_number,
9951 symbol_number_to_vector_number): Likewise.
9952
9953 * src/gram.h (int_of_rule_number): Remove; no longer used.
9954
9955 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
9956 since the resulting storage is always stored into.
9957
9958 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
9959 where it's needed.
9960
9961 * src/muscle_tab.c (muscle_m4_output):
9962 Now inline. Return bool, not int.
9963 * src/state.c (state_compare): Likewise.
9964 * src/symtab.c (symbol_check_defined,
9965 symbol_check_alias_consistency, symbol_pack, symbol_translation,
9966 hash_compare_symbol, hash_symbol):
9967 Likewise.
9968 * src/uniqstr.c (uniqstr_print): Likewise.
9969 * src/muscle_tab.c (muscle_m4_output_processor):
9970 New function, to avoid casts.
9971 * src/state.c (state_comparator, stage_hasher): Likewise.
9972 * src/symtab.c (symbol_check_defined_processor,
9973 symbol_check_alias_consistency_processor, symbol_pack_processor,
9974 symbol_translation_processor, hash_symbol_comparator,
9975 hash_symbol_hasher): Likewise.
9976 * src/uniqstr.c (uniqstr_print_processor): Likewise.
9977 * src/muscle_tab.c (muscles_m4_output):
9978 Use new functions instead of casting old functions unportably.
9979 * src/state.c (state_hash_new): Likewise.
9980 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
9981 symbols_token_translations_init):
9982 Likewise.
9983 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
9984
9985 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
9986 var instead of casting to long, to avoid casts.
9987 (prepare_states): Use MALLOC rather than alloca, so that we don't
9988 have to worry about alloca.
9989 * src/state.c (state_hash_lookup): Likewise.
9990
9991 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
9992 local var instead of casting to unsigned char, to avoid casts.
9993
9994 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
9995 STATE_ALLOC): Remove.
9996 (transitions_new, errs_new, reductions_new, state_new): Use malloc
9997 rather than calloc, and use offsetof to avoid allocating slightly
9998 too much storage.
9999 (state_new): Initialize all members.
10000
10001 * src/state.c (state_hash): Use unsigned accumulator, not signed.
10002
10003 * src/symtab.c (symbol_free): Remove; unused.
10004 (symbol_get): Remove cast in lhs of assignment.
10005 (symbols_do): Now static. Accept generic arguments, not
10006 hashing-related ones.
10007
10008 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
10009 (symbol_processor): Remove.
10010 (symbols_do): Remove decl; now static.
10011
10012 * src/system.h (alloca): Remove; decl no longer needed.
10013 (<stddef.h>): Include, for offsetof.
10014 (<inttypes.>, <stdint.h>): Include if available.
10015 (uintptr_t): New type, if system lacks it.
10016 (CALLOC, MALLOC, REALLOC): New macros.
10017 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
10018 new macros.
10019
10020 * src/tables.c (table_size): Now int, to pacify GCC.
10021 (table_grow, table_ninf_remap): Use signed table size.
10022 (save_row): Don't bother initializing locals when not needed.
10023 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
10024 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
10025
10026 * src/vcg.h: Correct misspellings.
10027
10028 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
10029
10030
10031 * src/getargs.c (getargs): Don't assume EOF == -1.
10032
26b4a969
PE
100332002-12-09 Paul Eggert <eggert@twinsun.com>
10034
10035 Change identifier spellings to avoid collisions with names
10036 that are reserved by POSIX.
10037
10038 Don't use names ending in _t, since POSIX reserves them.
10039 For consistency, remove _e and _s endings -- they're weren't
10040 needed to remove ambiguity. All uses changed.
10041 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
10042 turn was just renamed from struniq_t.
10043 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
10044 which in turn was just renamed from struniq_processor_t.
10045 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
10046 in turn was renamed from hash_compare_struniq_t.
10047 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
10048 (state_list): Renamed from state_list_t.
10049 * src/assoc.h (assoc): Renamed from assoc_t.
10050 * src/conflicts.c (enum conflict_resolution): Renamed from
10051 enum conflict_resolution_e.
10052 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
10053 (rule_list): Renamed from rule_list_t.
10054 * src/getargs.h (enum trace): Renamed from enum trace_e.
10055 (enum report): Renamed from enum report_e.
10056 * src/gram.h (item_number): Renamed from item_number_t.
10057 (rule_number): Renamed from rule_number_t.
10058 (struct rule_s): Remove the "rule_s" part; not used.
10059 (rule): Renamed from rule_t.
10060 (rule_filter): Renamed from rule_filter_t.
10061 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
10062 (goto_list): Renamed from goto_list_t.
10063 * src/lalr.h (goto_number): Renamed from goto_number_t.
10064 * src/location.h (location): Renamed from location_t.
10065 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
10066 and moved here from:
10067 * src/muscle_tab.h (muscle_entry_t): here.
10068 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
10069 (rule_list): Renamed from rule_list_t.
10070 * src/print_graph.c (static_graph): Renamed from graph.
10071 * src/reader.h (braced_code): Renamed from braced_code_t.
10072 Remove brace_code_e tag.
10073 * src/relation.h (relation_node): Renamed from relation_node_t.
10074 (relation_nodes): Renamed from relation_nodes_t.
10075 (relation): Renamed from relation_t.
10076 * src/state.h (state_number): Renamed from state_number_t.
10077 (struct state): Renamed from struct state_s.
10078 (state): Renamed from state_t.
10079 (transitions): Renamed from transitions_t. Unused (and
10080 misspelled) transtion_s tag removed.
10081 (errs): Renamed from errs_t. Unused errs_s tag removed.
10082 (reductions): Renamed from reductions_t. Unused tag
10083 reductions_s removed.
10084 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
10085 (struct symbol_list): Renamed from struct symbol_list_s.
10086 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
10087 (struct symbol): Renamed from struct symbol_s.
10088 (symbol): Renamed from symbol_t.
10089 * src/tables.c (vector_number): Renamed from vector_number_t.
10090 (action_number): Renamed from action_t.
10091 * src/tables.h (base_number): Renamed from base_t.
10092 * src/vcg.h (enum color): Renamed from enum color_e.
10093 (enum textmode): Renamed from enum textmode_e.
10094 (enum shape): Renamed from enum shape_e.
10095 (struct colorentry): Renamed from struct colorentry_s.
10096 (struct classname): Renamed from struct classname_s.
10097 (struct infoname): Renamed from struct infoname_s.
10098 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
10099 (enum decision): Renamed from enum decision_e.
10100 (enum orientation): Renamed from enum orientation_e.
10101 (enum alignment): Renamed from enum alignment_e.
10102 (enum arrow_mode): Renamed from enum arrow_mode_e.
10103 (enum crossing_type): Renamed from enum crossing_type_e.
10104 (enum view): Renamed from enum view_e.
10105 (struct node): Renamed from struct node_s.
10106 (node): Renamed from node_t.
10107 (enum linestyle): Renamed from enum linestyle_e.
10108 (enum arrowstyle): Renamed from enum arrowstyle_e.
10109 (struct edge): Renamed from struct edge.
10110 (edge): Renamed from edge_t.
10111 (struct graph): Renamed from struct graph_s.
10112 (graph): Renamed from graph_t.
10113 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
10114 Rename value_t -> value.
10115 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
10116 value_t_as_yystype -> value_as_yystype.
10117
10118 Don't include <errno.h> in the mainstream code, since it
10119 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
10120 * lib/get-errno.c, lib/get-errno.h: New files.
10121 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
10122 get-errno.c.
10123 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
10124 * src/output.c (output_skeleton): Likewise.
10125 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
10126 instead of errno.
10127 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
10128 Likewise.
10129 (handle_action_dollar, handle_action_at): Likewise.
10130 * src/system.h: Do not include <errno.h>.
10131 (TAB_EXT): Renamed from EXT_TAB.
10132 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
10133
10134 Avoid str[a-z]*, since <string.h> reserves that name space.
10135 Change all instances of "struniq" in names to "uniqstr", and
10136 likewise for "STRUNIQ" and "UNIQSTR".
10137 * src/uniqstr.c: Renamed from src/struniq.c.
10138 * src/uniqstr.h: Renamed from src/struniq.h.
10139 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
10140 * src/files.c (strsuffix): Remove; unused.
10141 (concat2): Renamed from stringappend. Now static.
10142 * src/files.h (strsuffix, stringappend): Remove; unused.
10143 * src/parse-gram.y (<chars>): Renamed from <string>.
10144 (<uniqstr>): Renamed from <struniq>.
10145 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
10146 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
10147 (struct graph_s.expand): Renamed from struct graph_s.stretch.
10148 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
10149 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
10150 (N_EXPAND): Renamed from N_STRETCH.
10151
10152 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
10153 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
10154 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
10155 Remove; unused.
10156 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
10157 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
10158 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
10159 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
10160 (BASE_MAXIMUM): Renamed from BASE_MAX.
10161 (BASE_MINIMUM): Renamed from BASE_MIN.
10162 (ACTION_MAX): Remove; unused.
10163 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
10164 Unnecessary casts removed from above defines.
10165
10166
10167 Fix misspelling in names.
10168 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
10169 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
10170 G_NODE_ALIGNEMENT.
10171
10172
10173 * lib/timevar.c (timevar_report): Renamed from time_report,
10174 for consistency with other names.
10175 * lib/timevar.h (timevar_report): New decl.
10176 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
10177
10178
10179 Sort include-file uses.
10180
10181 Reorder all include files under src to be in the order "system.h".
10182 then the ../lib include files in angle brackets (alphabetized),
10183 then the . include files in double-quotes (alphabetized). Fix
10184 dependency breakages encountered in this process, as follows:
10185 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
10186 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
10187 * src/state.h: Include "symtab.h".
10188
996b1c7e
PE
101892002-12-08 Paul Eggert <eggert@twinsun.com>
10190
10191 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
10192 since this causes problems when __file__ contains character
10193 sequences like "@" that are treated specially by src/scan-skel.l.
10194 Instead, just use the file's basename. This fixes the bug
10195 reported by Martin Mokrejs in
161a71f3 10196 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 10197
e19c4e5d
PE
101982002-12-06 Paul Eggert <eggert@twinsun.com>
10199
10200 Add support for rules that do not have trailing semicolons, as
10201 POSIX requires. Improve the quality of locations in Bison
10202 diagnostics.
26b4a969 10203
e19c4e5d
PE
10204 * src/location.c: Include <quotearg.h>.
10205 (empty_location): Now const.
10206 (location_print): New function. Follow the recommendation of the
10207 GNU Coding Standards for locations that span file boundaries.
10208 * src/location.h: Do not include <quotearg.h>; no longer needed.
10209 (boundary): New type.
10210 (location_t): Use it. This allows locations to span file boundaries.
10211 All member uses changed: file -> start.file or end.file (as needed),
10212 first_line -> start.line, first_column -> start.column,
10213 last_line -> end.line, last_column -> end.column.
10214 (equal_boundaries): New function.
10215 (LOCATION_RESET, LOCATION_STEP): Remove.
10216 (LOCATION_PRINT): Remove. All callers changed to use location_print.
10217 (empty_location): Now const.
10218 (location_print): New decl.
10219 * src/parse-gram.y (lloc_default): New function, which handles
10220 empty locations more accurately.
10221 (YYLLOC_DEFAULT): Use it.
10222 (%token COLON): Remove.
10223 (%token ID_COLON): New token.
26b4a969 10224 (rules): Use it.
e19c4e5d
PE
10225 (declarations, rules): Remove trailing semicolon.
10226 (declaration, rules_or_grammar_declaration):
10227 Allow empty (";") declaration.
10228 (symbol_def): Remove empty actions; no longer needed.
10229 (rules_or_grammar_declaration): Remove trailing semicolon.
10230 (semi_colon.opt): Remove.
10231 * src/reader.h: Include location.h.
10232 (scanner_cursor): New decl.
10233 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
10234 rolling our own.
10235 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
10236 of *loc.
10237 (STEP): Remove. No longer needed, now that adjust_location does
10238 the work. All uses removed.
10239 (scanner_cursor): New var.
10240 (adjust_location): Renamed from extend_location. It now sets
10241 *loc and adjusts the scanner cursor. All uses changed.
10242 Don't bother testing for CR.
10243 (handle_syncline): Remove location arg; now updates scanner cursor.
10244 All callers changed.
10245 (unexpected_end_of_file): Now accepts start boundary of token or
10246 comment, not location. All callers changed. Update scanner cursor,
10247 not the location.
10248 (SC_AFTER_IDENTIFIER): New state.
10249 (context_state): Renamed from c_context. All uses changed.
10250 (id_loc, code_start, token_start): New local vars.
10251 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
10252 processing of Yacc white space and equivalents here.
10253 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
10254 instead of returning ID immediately, since we need to search for
10255 a subsequent colon.
10256 (<INITIAL>"'", "\""): Save token_start.
10257 (<INITIAL>"%{", "{", "%%"): Save code_start.
10258 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
10259 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
10260 BEGIN context_state at end, not INITIAL.
10261 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
10262 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
10263 Return correct token start.
10264 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
10265 the start of a character, string or multiline comment is found.
10266 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
10267 Reduction): Adjust reported locations to match the more-precise
10268 results now expected.
10269 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
10270 * tests/reduce.at (Useless Rules, Reduced Automaton,
10271 Underivable Rules): Likewise.
10272 * tests/regression.at (Invalid inputs): No longer `expecting ";"
10273 or "|"' now that so many other tokens are allowed by the new grammar.
10274
10275 * src/complain.h (current_file): Remove duplicate decl;
10276 current_file is now owned by files.h.
10277 * src/complain.c, src/scan-gram.l: Include files.h.
10278
102792002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 10280
e19c4e5d
PE
10281 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
10282 promotes to int; it might be unsigned int.
10283 * data/yacc.c (yy_reduce_print): Likewise.
10284
10285 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
10286 be #defined in the prologue, not in the Bison declarations.
10287 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 10288
b64755e3
PE
102892002-12-02 Paul Eggert <eggert@twinsun.com>
10290
10291 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
10292 * lib/strtoul.c: New file, from gnulib.
10293 This fixes a porting bug reported by Peter Klein in
161a71f3 10294 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 10295
6e746484
PE
102962002-11-30 Paul Eggert <eggert@twinsun.com>
10297
b64755e3
PE
10298 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
10299 and put only a forward declaration in the prologue. This is for
10300 consistency with the other scanner helper functions.
10301
6ba55592
PE
10302 Type clashes now generate warnings, not errors, since it
10303 appears that POSIX may allow some grammars with type clashes.
10304 * src/reader.c (grammar_current_rule_check): Warn about
10305 type clashes instead of complaining.
10306 * tests/input.at (Type Clashes): Expect warnings, not complaints.
10307
6e746484
PE
10308 Add Yacc library, since POSIX requires it.
10309 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
10310 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
10311 * lib/main.c, lib/yyerror.c: New files.
10312
10313 gram_error can be static; it need not be extern.
10314 * src/reader.h (gram_error): Remove decl.
10315 * src/parse-gram.y (gram_error): Now static. Add static decl.
10316 (print_token_value): Omit parameter names from forward decl,
10317 for consistency.
10318
88510f9c
PE
103192002-11-29 Paul Eggert <eggert@twinsun.com>
10320
6e746484
PE
10321 * doc/bison.texinfo: Emphasize that yylex and yyerror must
10322 be declared before being used. E.g., one should typically
10323 declare them in the prologue. Use GNU coding style in examples.
10324 Put "const" consistently after the type it modifies. Mention
10325 that C99 supports "inline". Mention that yyerror traditionally
10326 returns "int".
10327
88510f9c
PE
10328 %parse-param and %lex-param now take just one argument, the
10329 declaration; the argument name is deduced from the declaration.
10330
10331 * doc/bison.texinfo (Parser Function, Pure Calling, Error
10332 Reporting, Table of Symbols): Document this.
10333 * src/parse-gram.y (add_param): New function.
10334 (COMMA): Remove.
10335 (declaration): Implement new rule for %parse-param and %lex-param.
10336 * src/scan-gram.l: "," now elicits a warning, rather than being
10337 a token; this is more compatible with byacc.
10338 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
10339
bb92250c
PE
103402002-11-27 Paul Eggert <eggert@twinsun.com>
10341
10342 Rename identifiers to avoid real and potential collisions.
10343
10344 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
10345 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 10346 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
10347 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10348 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
10349 * src/parse-gram.y (print_token_value): Renamed from yyprint.
10350 All uses changed.
10351 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
10352 The name "yycontrol" violates the name space rules, and this stuff
10353 wasn't being used anyway.
10354 (input): Remove action; this stuff wasn't being used.
10355 (gram_error): Rename local variable yylloc -> loc.
10356 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
10357 (YY_DECL): Don't use "yy" at start of local variables.
10358 All uses changed, e.g., yylloc -> loc.
10359 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
10360 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
10361 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
10362 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
10363
10364 * src/parse-gram.y (gram_error): loc is now const *.
10365 * src/reader.h (gram_error): Likewise.
10366
3af4feb2
PE
103672002-11-24 Paul Eggert <eggert@twinsun.com>
10368
10369 Version 1.75c.
10370
10371 * tests/actions.at (Actions after errors): Use an output format
10372 more similar to that of the Printers and Destructors test.
10373 Test the position of the ';' token too.
10374 (Printers and Destructors): Likewise.
10375 (Printers and Destructors: %glr-parser): Remove for now, to avoid
10376 unnecessarily alarming people when the test fails.
10377
10378 * data/yacc.c (yyerrlab1): Move this label down, so that the
10379 parser does not discard the lookahead token if the user code
10380 invokes YYERROR. This change is required for POSIX conformance.
10381
10382 * lib/error.c: Sync with gnulib.
10383
103842002-11-22 Paul Eggert <eggert@twinsun.com>
10385
10386 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
10387 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
10388 * lib/xmalloc.c: Likewise.
26b4a969 10389
58004308
PE
103902002-11-20 Paul Eggert <eggert@twinsun.com>
10391
10392 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
10393
103942002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 10395
58004308
PE
10396 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
10397 should use `if (! x) abort ();' rather than `assert (x);', and
10398 anyway it's one less thing to worry about configuring.
10399
10400 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
10401 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
10402 and replace all instances of assert with abort.
10403 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10404 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
10405
10406 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
10407 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
10408 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
10409 hash_find_entry, hash_rehash, hash_insert): Likewise.
10410 * src/conflicts.c (resolve_sr_conflict): Likewise.
10411 * src/lalr.c (set_goto_map, map_goto): Likewise.
10412 * src/nullable.c (nullable_compute): Likewise.
10413 * src/output.c (prepare_rules, token_definitions_output): Likewise.
10414 * src/reader.c (packgram, reader): Likewise.
10415 * src/state.c (state_new, state_free, state_transitions_set,
10416 state_reduction_find): Likewise.
10417 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
10418 symbol_pack): Likewise.
10419 * src/tables.c (conflict_row, pack_vector): Likewise.
10420 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10421 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10422 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
10423 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
10424
10425 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
10426 (ARGMATCH_CONSTRAINT): New macro.
10427 (ARGMATCH_ASSERT): Use it.
10428
10429 * src/system.h (verify): New macro.
10430 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
10431 rather than assert.
10432 * src/tables.c (tables_generate): Likewise.
10433
10434 * src/struniq.c (struniq_assert): Now returns void, and aborts
10435 if the assertion is false.
10436 (struniq_assert_p): Remove.
10437 * src/struniq.h: Likewise.
10438
76ae8198
PE
104392002-11-18 Paul Eggert <eggert@twinsun.com>
10440
10441 * data/glr.c (yygetLRActions): Replace `yyindex' with
10442 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
10443 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 10444 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 10445
d3c4e709
AD
104462002-11-18 Akim Demaille <akim@epita.fr>
10447
10448 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
10449 space.
10450 From Tim Van Holder.
10451
8d8a7238
PE
104522002-11-17 Paul Eggert <eggert@twinsun.com>
10453
10454 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
10455 to "SyntaxError" for consistency with my 2002-11-15 change.
10456
10457 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
10458 not define to {}, since this breaks the common use of `YYDPRINTF
10459 ((...));' if a single statement is desired (e.g. before `else').
10460 Work around GCC warnings by surrounding corresponding calls with
10461 {} if needed.
10462 (yyhasResolvedValue): Remove unused function.
10463 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
10464 loop body.
10465 (yyreportSyntaxError): Renamed from yyreportParseError.
10466 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
10467 All uses changed.
10468 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
10469 extern when possible. Remove unused initializations.
10470
b0937b22
AD
104712002-11-16 Akim Demaille <akim@epita.fr>
10472
10473 Augment the similarity between GLR and LALR traces.
10474
10475 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
10476 (YY_REDUCE_PRINT): New.
10477 (yyparse): Use them.
10478 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
10479 YYDPRINT here.
10480 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
10481 state reached after the reduction/recovery, since...
10482 (yyparse, yyprocessOneStack): Report the state we are entering in.
10483
c5e3e510
AD
104842002-11-16 Akim Demaille <akim@epita.fr>
10485
10486 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
10487 Add support for --trace=skeleton.
10488 * src/scan-skel.l: %option debug.
10489 Scan strings of non-@ or \n instead of character by character.
10490 (scan_skel): Handle trace_skeleton.
10491 (QPUTS): New.
10492 (@output_parser_name@, @output_header_name@): ``Restore'' their
10493 support (used to be M4 macros).
10494 * data/yacc.c: Quote larger chunks, a la glr.c.
10495 * data/lalr1.cc: Likewise.
10496 The header guards are no longer available, so use some other
10497 string than `YYLSP_NEEDED'.
10498
4c6cc1db
AD
104992002-11-16 Akim Demaille <akim@epita.fr>
10500
10501 Make the ``Printers and Destructors'' test more verbose, taking
10502 `yacc.c''s behavior as (possibly wrong) reference.
10503
10504 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
10505 instead of fprint on stdout.
10506 Set and report the last_line of the symbols.
10507 Consistently display values and locations.
10508
6d9e8019
PE
105092002-11-16 Paul Eggert <eggert@twinsun.com>
10510
10511 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
10512
6e649e65
PE
105132002-11-15 Paul Eggert <eggert@twinsun.com>
10514
b25d88f6
PE
10515 * tests/actions.at (Actions after errors): New test case.
10516
6e649e65
PE
10517 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
10518 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
10519 tests/action.at, tests/calc.at, tests/conflicts.at,
10520 tests/cxx-type.at, tests/regression.at:
10521 "parse error" -> "syntax error" for POSIX compatibility.
10522 "parsing stack overflow..." -> "parser stack overflow" so
10523 that code matches Bison documentation.
10524
0f39aab9
AD
105252002-11-15 Akim Demaille <akim@epita.fr>
10526
10527 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
10528 take two BRACED_CODE, not two string_content.
10529 Free the scanner's obstack when we are done.
10530 (code_content): New.
10531 * tests/calc.at: Adjust.
10532 * doc/bison.texinfo: Adjust.
10533 Also, make sure to include the `,' for these declarations.
10534
761c1926
AD
105352002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
10536
10537 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
10538 definition; avoids potential autoreconf problems.
10539
b0f98b10
AD
105402002-11-15 Akim Demaille <akim@epita.fr>
10541
10542 Always check the value returned by yyparse.
10543
10544 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
10545 returned by yyparse.
10546 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
10547 Adjust calls.
10548 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
10549 returned by yyparse.
10550
970785f1
PH
105512002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10552
10553 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
10554 on input.at test.
10555
8fcc7db1
PE
105562002-11-14 Paul Eggert <eggert@twinsun.com>
10557
7ec1b48e
PE
10558 * src/output.c (output_skeleton): Call xfopen instead of
10559 duplicating xfopen's body.
10560
cfff7583 10561 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 10562 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 10563
8fcc7db1
PE
10564 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
10565 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
10566 Group compiler. Instead, use "$CC -E bar.c". Include the .h
10567 file twice in the grammar, as an extra check.
10568
10569 * tests/input.at (Torturing the Scanner): Surround the
10570 backslash-newline tests with "#if 0", to make it less likely that
10571 we'll run into compiler bugs. Bring back solitary \ inside
10572 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 10573 test backslash-newline in C character constant.
8fcc7db1 10574
4e8d992c
AD
105752002-11-14 Akim Demaille <akim@epita.fr>
10576
10577 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
10578 status of the compiler.
f32b346d 10579 Calling `exit 1' is no longer needed.
4e8d992c
AD
10580 Reported by Nelson H. F. Beebe.
10581
9501dc6e
AD
105822002-11-14 Akim Demaille <akim@epita.fr>
10583
10584 * tests/atlocal.in (CPPFLAGS): We have config.h.
10585 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
10586 New.
10587 * tests/actions.at, tests/calc.at, tests/conflicts.at,
10588 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
10589 * tests/regression.at, tests/torture.at: Use them for all the
10590 grammars that are to be compiled.
10591 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
10592 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
10593 * doc/bison.texinfo (GLR Parsers): Document `inline'.
10594
18b519c0
AD
105952002-11-14 Akim Demaille <akim@epita.fr>
10596
10597 * doc/bison.texinfo: Various formatting changes (alignments in
10598 samples, additional @group/@end group, GCS in samples.
10599 Use @deffn instead of simple @table to define the directives,
10600 macros, variables etc.
10601
9a86cdb9
PE
106022002-11-13 Paul Eggert <eggert@twinsun.com>
10603
daa33def 10604 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 10605 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 10606
daa33def 10607 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 10608 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
10609 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
10610 * tests/headers.at (export YYLTYPE): Likewise.
10611
10612 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 10613 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 10614
9a86cdb9
PE
10615 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
10616 comments, since they're not portable. Use GNU coding style.
10617
9c1e26bd
AD
106182002-11-13 Akim Demaille <akim@epita.fr>
10619
10620 * data/yacc.c: Leave bigger chunks of quoted text.
10621 (YYDSYMPRINTF): New.
10622 Use it to report symbol activities.
10623 * data/glr.c (YYDSYMPRINTF): New.
10624 Use it.
10625
87f721cc
PE
106262002-11-12 Paul Eggert <eggert@twinsun.com>
10627
10628 Version 1.75b.
10629
10630 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
10631 (yyglrReduce): Return yyok, not 0.
10632 This should avoid the enumerated-type warnings reported
464c6927 10633 by Nelson H. F. Beebe in
161a71f3 10634 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
10635
10636 * lib/bbitset.h (BITSET_INLINE): Remove.
10637 * lib/bitset.h [! BITSET_INLINE]: Remove.
10638 (bitset_set, bitset_reset, bitset_test): Rename local vars
10639 to avoid shadowing warnings by GCC.
10640
10641 * data/glr.c (inline): Remove #define. It's the user's
10642 responsibility to #define it away, just like 'const'.
464c6927 10643 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 10644 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 10645
87f721cc
PE
10646 * Makefile.maint (po-check): Scan .l and .y files instead of the
10647 .c and the .h files that they generate. This fixes the bug
10648 reported by Tim Van Holder in:
161a71f3 10649 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
10650 Look for N_ as well as for _. Try to avoid matching #define for
10651 N_ and _.
10652 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
10653 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
10654 * src/scan-gram.l: Revamp regular expressions so that " and '
10655 do not confuse xgettext.
10656
10657 * src/struniq.h (struniq_new): Do not declare the return type
10658 to be 'const'; this violates the C standard.
10659 * src/struniq.c (struniq_new): Likewise.
10660
be14ade5
AD
106612002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
10662
10663 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
10664 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
10665 linker.
10666
05291fbc
AD
106672002-11-12 Akim Demaille <akim@epita.fr>
10668
10669 * Makefile.maint: Sync with Autoconf:
10670 (local_updates): New.
10671
1f5fd52e
AD
106722002-11-12 Akim Demaille <akim@epita.fr>
10673
10674 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
10675
283f1e64
AD
106762002-11-12 Akim Demaille <akim@epita.fr>
10677
10678 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
10679 locations.
10680
886b69d1
AD
106812002-11-12 Akim Demaille <akim@epita.fr>
10682
10683 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
10684 not yyvalue.
10685
3df37415
AD
106862002-11-12 Akim Demaille <akim@epita.fr>
10687
10688 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
10689 Use it to test the GLR parser.
10690
7bd6c77e
AD
106912002-11-12 Akim Demaille <akim@epita.fr>
10692
10693 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
10694 defines it.
10695 * data/glr.c (yystos): New.
10696 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
10697 (YYDSYMPRINT): New.
10698 (yyval): Don't define it, it is handled via M4.
10699 (yyrecoverParseError): Free verbosely the discarded symbols.
10700 * data/yacc.c (yysymprint): Remove, rather...
10701 (b4_yysymprint_generate): invoke.
10702 * data/c.m4 (b4_yysymprint_generate): New.
10703 Accept pointers as arguments, as opposed to the version from
10704 yacc.c.
10705 (b4_yydestruct_generate): Likewise.
10706 * tests/cations.at (Printers and Destructors): Use Bison directives
10707 instead of CPP macros.
10708 Don't rely on internal details.
10709
b0400cc6
AD
107102002-11-12 Akim Demaille <akim@epita.fr>
10711
10712 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
10713 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
10714 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
10715 it against YYEMPTY and so forth), work on yytoken (i.e., set
10716 it to YYEMPTY etc.).
10717 (yydestruct): Replace with a b4_yydestruct_generate invocation.
10718 (b4_symbol_actions): Remove.
10719 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
10720 for 0, end-of-input.
10721
72f889cc
AD
107222002-11-12 Akim Demaille <akim@epita.fr>
10723
10724 * doc/bison.texinfo (Destructor Decl): New.
10725
b1ae9233
AD
107262002-11-12 Akim Demaille <akim@epita.fr>
10727
10728 * src/tables.c (tables_generate): Use free for pointers that
10729 cannot be NULL, not XFREE.
10730 (pack_vector): Use assert, not fatal, for bound violations.
10731 * src/state.c (state_new): Likewise.
10732 * src/reader.c (reader): Likewise.
10733 * src/lalr.c (set_goto_map): Likewise.
72f889cc 10734 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
10735 the file name.
10736
7ec2d4cd
AD
107372002-11-12 Akim Demaille <akim@epita.fr>
10738
10739 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
10740 Restore.
10741 * src/scan-gram.l (last_string): Is global to the file, not to
10742 yylex.
10743 * src/parse-gram.y (input): Don't append the epilogue here,
10744 (epilogue.opt): do it here, and free the scanner's obstack.
10745 * src/reader.c (epilogue_set): Rename as...
10746 (epilogue_augment): this.
10747 * data/c.m4 (b4_epilogue): Defaults to empty.
10748
573a6cd3
AD
107492002-11-12 Akim Demaille <akim@epita.fr>
10750
10751 * src/getargs.c (long_options): Remove duplicates.
10752 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
10753 Remove.
10754 * doc/bison.rnh: Remove.
10755 * doc/bison.texinfo (VMS Invocation): Remove.
10756
95612cfa
AD
107572002-11-12 Akim Demaille <akim@epita.fr>
10758
10759 * src/struniq.h, src/struniq.c (struniq_t): Is const.
10760 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
10761
10762 Use struniq for symbols.
10763
10764 * src/symtab.h (symbol_t): The tag member is a struniq.
10765 (symbol_type_set): Adjust.
10766 * src/symtab.c (symbol_new): Takes a struniq.
10767 (symbol_free): Don't free the tag member.
10768 (hash_compare_symbol_t, hash_symbol_t): Rename as...
10769 (hash_compare_symbol, hash_symbol): these.
10770 Use the fact that tags as struniqs.
10771 (symbol_get): Use struniq_new.
10772 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
10773 Returns a strniq.
10774 * src/reader.h (merger_list, grammar_currentmerge_set): The name
10775 and type members are struniqs.
10776 * src/reader.c (get_merge_function)
10777 (grammar_current_rule_merge_set): Adjust.
10778 (TYPE, current_type): Are struniq.
10779
10780 Use struniq for file names.
10781
10782 * src/files.h, src/files.c (infile): Split into...
10783 (grammar_file, current_file): these.
10784 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
10785 * src/reduce.c (reduce_print): Likewise.
10786 * src/getargs.c (getargs): Likewise.
10787 * src/complain.h, src/complain.c: Likewise.
10788 * src/main.c (main): Call struniqs_new early enough to use it for
10789 file names.
10790 Don't free the input file name.
10791
3e6656f9
AD
107922002-11-12 Akim Demaille <akim@epita.fr>
10793
10794 * src/symtab.c (symbol_free): Remove dead deactivated code:
10795 type_name are properly removed.
10796 Don't use XFREE to free items that cannot be NULL.
10797 * src/struniq.h, src/struniq.c: New.
10798 * src/main.c (main): Initialize/free struniqs.
10799 * src/parse-gram.y (%union): Add astruniq member.
10800 (yyprint): Adjust.
10801 * src/scan-gram.l (<{tag}>): Return a struniq.
10802 Free the obstack bit that used to store it.
10803 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
10804
7672019c
PE
108052002-11-11 Paul Eggert <eggert@twinsun.com>
10806
10807 Revamp to fix many (but not all) of the C- and M4-related quoting
10808 problems. Among other things, this fixes the Bison bug reported
10809 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 10810 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
10811
10812 Use new @ escapes consistently. Represent brackets with @{ and @}
10813 rather than @<:@ and @:>@, since this works a bit better with dumb
10814 editors like vi. Represent @ with @@, since @ is now consistently
10815 an escape. Use @oline@ and @ofile@ rather than __oline__ and
10816 __ofile__, to avoid unexpected expansions. Similarly, use @output
10817 rather than #output.
10818
10819 * data/c.m4 (b4_copyright): Omit file name from comment, since
10820 the file name could contain "*/".
10821 (b4_synclines_flag): Don't quote the 2nd argument; it should already
10822 be quoted. All uses changed.
10823
10824 * data/glr.c: Use new @ escapes consistently.
10825 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
10826 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
10827 Remove, since they couldn't handle arbitrary characters in file
10828 names.
10829 * data/lalr1.cc: Likewise.
10830 * data/yacc.c: Likewise.
10831
10832 * src/files.c (output_infix): Remove; all uses removed.
10833 * src/files.h: Likewise.
10834
10835 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
10836 mishandled funny characters in file names, and anyway it isn't
10837 needed any more.
10838 * data/yacc.c: Likewise.
10839 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
10840
10841 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
10842 * data/yacc.c: Likewise.
10843
10844 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
10845 strings now.
10846 (muscle_init): Quote filename as a C string.
10847 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
10848 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
10849 * src/output.c (escaped_file_name_output): New function.
10850 (prepare_symbols): Quote tokens for M4.
10851 (prepare): Don't insert output_infix, output_prefix,
10852 output_parser_name, output_header_name; this is now down by scan-skel.
10853 Insert skeleton as a C string.
10854
10855 * src/output.c (user_actions_output, symbol_destructors_output,
10856 symbol_printers_output): Quote filenames for C and M4.
10857 * src/reader.c (prologue_augment, epilogue_set): Likewise.
10858
10859 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
10860 escapes other than \\ and \'; this simplifies the code.
10861 (<SC_STRING>): Likewise, for \\ and \".
10862 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
10863 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
10864 Use new escapes @{ and @} for [ and ].
10865
10866 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
10867 them with auto vars.
10868 Switch to new escape scheme, where @ is the escape character uniformly.
10869 Abort if a stray escape character is found. Avoid unbounded input
10870 buffer when parsing non-escaped text.
10871
10872 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
10873 __oline__, #output, $@, and @{ do not have unintended meanings.
10874
acea4f3b
PE
108752002-11-09 Paul Eggert <eggert@twinsun.com>
10876
10877 Fix the test failure due to GCC warnings described in
161a71f3 10878 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
10879 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
10880 evaluate to 0 if it's impossible for NINF to be in the respective
10881 table.
10882 (yygetLRActions, yyrecoverParseError): Use them.
10883
10884 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
10885 counted in the token inserted at end of file. Now takes
10886 location_t *, not location_t, so that the location can be
10887 adjusted. All uses changed.
10888
10889 * tests/regression.at (Invalid inputs): Adjust wording in
10890 diagnostic to match the new behavior.
10891
10892 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
10893 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
10894 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
10895 abort ();'. This reduces the runtime of the "Many lookaheads"
10896 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
10897 GCC 3.2.
10898
20ef1ad5
PE
108992002-11-07 Paul Eggert <eggert@twinsun.com>
10900
10901 * src/parse-gram.y (CHARACTER): Remove unused token.
10902 All uses removed.
10903
10904 * src/scan-gram.l: Remove stack option. We no longer use the
10905 stack, since the stack was never deeper than 1; instead, use the
10906 new auto var c_context to record the stacked value.
10907
10908 Remove nounput option. At an unexpected end of file, we now unput
10909 the minimal input necessary to end cleanly; this simplifies the
10910 code.
10911
10912 Avoid unbounded token sizes where this is easy.
10913
10914 (unexpected_end_of_file): New function.
10915 Use it to systematize the error message on unexpected EOF.
10916 (last-string): Now auto, not static.
10917 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
10918 (scanner_last_string_free): Remove; not used.
10919 (percent_percent_count): Move decl to just before use.
10920 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
10921 not the (never otherwised-used) CHARACTER.
10922
93724f13
AD
109232002-11-07 Akim Demaille <akim@epita.fr>
10924
10925 Let yyerror always receive the msg as last argument, so that
10926 yyerror can be variadic.
10927
10928 * data/yacc.c (b4_yyerror_args): New.
10929 Use it when calling yyerror.
10930 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
10931 Use it when calling yyerror.
10932 * doc/bison.texinfo (Error Reporting): Adjust.
10933 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
10934 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
10935
6e40b4eb
AD
109362002-11-06 Akim Demaille <akim@epita.fr>
10937
10938 #line should have quoted strings.
10939 Ideally, this should be done by m4_quotearg.
10940
10941 * src/scan-skel.l: Include quotearg.h.
10942 Quote __ofile__.
10943 * src/output.c (symbol_printers_output)
10944 (symbol_destructors_output): Quote the file name.
10945
2dfbfc12
AD
109462002-11-06 Akim Demaille <akim@epita.fr>
10947
10948 * tests/regression.at (Invalid inputs): Adjust to the recent
10949 messages.
10950
437c2d80
AD
109512002-11-06 Akim Demaille <akim@epita.fr>
10952
10953 Restore --no-lines.
10954 Reported by Jim Kent.
10955
10956 * data/c.m4 (b4_syncline): New.
10957 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
10958 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
10959 * src/output.c (user_actions_output): Likewise.
10960 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 10961 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 10962
900c5db5
AD
109632002-11-06 Akim Demaille <akim@epita.fr>
10964
10965 * src/main.c (main): Free `infile'.
10966 * src/scan-gram.l (handle_syncline): New.
10967 Recognize `#line'.
10968 * src/output.c (user_actions_output, symbol_destructors_output)
10969 (symbol_printers_output): Use the location's file name, not
10970 infile.
10971 * src/reader.c (prologue_augment, epilogue_set): Likewise.
10972
e183b123 109732002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 10974
e183b123 10975 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 10976 either has GLR conflict entries.
e183b123 10977
193eb6b7
PE
109782002-11-05 Paul Eggert <eggert@twinsun.com>
10979
e183b123
PE
10980 * src/scan-gram.l: Use more accurate diagnostics, e.g.
10981 "integer out of range" rather than "invalid value".
10982 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
10983 accordingly.
10984
193eb6b7
PE
10985 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
10986 Also, remove one static variable in the scanner.
10987
10988 * src/scan-gram.l (braces_level): Now auto, not static.
10989 Initialize to zero if the compiler is being picky.
10990 (INITIAL): Clear braces_level instead of incrementing it.
10991 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
10992 as POSIX 1003.1-2001 requires.
10993 * src/system.h (IF_LINT): New macro, taken from coreutils.
10994 * configure.ac: Define "lint" if --enable-gcc-warnings.
10995
29c01725
AD
109962002-11-05 Akim Demaille <akim@epita.fr>
10997
10998 * src/scan-gram.l: When it starts with `%', complain about the
10999 whole directive, not just that `invalid character: %'.
11000
8aeac3ca
AD
110012002-11-04 Akim Demaille <akim@epita.fr>
11002
11003 * Makefile.maint: Update from Autoconf.
11004 (update, cvs-update, po-update, do-po-update): New.
11005
793a58bb
AD
110062002-11-04 Akim Demaille <akim@epita.fr>
11007
11008 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
11009 and yyerror.
11010 Have yyerror `use' its arguments.
11011 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
11012 returns true when location & yacc & pure & parse-param.
11013 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
11014
c4d720cd
AD
110152002-11-04 Akim Demaille <akim@epita.fr>
11016
11017 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
11018 clashes.
11019 * src/scan-gram.l: Use [\'] instead of ['] to pacify
11020 font-lock-mode.
11021 Use complain_at.
11022 Use quote, not quote_n since LOCATION_PRINT no longer uses the
11023 slot 0.
11024
613a0dc5
PE
110252002-11-03 Paul Eggert <eggert@twinsun.com>
11026
11027 * src/reader.c (get_merge_function, grammar_current_rule_check):
11028 Use consistent diagnostics for reporting type name clashes.
11029 Quote the types with <>, for consistency with Yacc.
11030 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
11031
2a8d363a
AD
110322002-11-03 Akim Demaille <akim@epita.fr>
11033
11034 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
11035 New.
11036 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
11037 (b4_parse_param): Remove.
11038 Use b4_identification.
11039 Propagate b4_pure_args where needed to pass them to yyerror.
11040 * data/glr.m4 (b4_parse_param): Remove.
11041 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
11042 (b4_lpure_formals): New.
11043 Use b4_identification.
11044 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
11045 b4_user_formals and b4_user_args.
11046 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
11047 (yyreportAmbiguity): When using a pure parser, also need
11048 the location, and the parse-params.
11049 Adjust callers.
11050 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
11051 When using a pure parser, also need the parse-params.
11052 Adjust callers.
11053 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
11054 (%pure-parser + %parse-param) LALR and GLR parsers.
11055 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
11056 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
11057 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
11058 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
11059 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
11060 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
11061 * doc/bison.texinfo: Untabify the whole file.
11062 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
11063 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
11064 (Error Reporting): Adjust to these new directives.
11065 Document %error-verbose, deprecate YYERROR_VERBOSE.
11066
9e32add8
AD
110672002-11-03 Akim Demaille <akim@epita.fr>
11068
11069 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
11070 AT_CHECK_CALC_GLR invocations to use % directives, instead of
11071 command line options.
11072 * tests/cxx-type.at: Formatting changes.
11073
b02d90a5
PE
110742002-11-03 Paul Eggert <eggert@twinsun.com>
11075
11076 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
11077 to count columns correctly, and to check for invalid inputs.
9e32add8 11078
b02d90a5
PE
11079 Use mbsnwidth to count columns correctly. Account for tabs, too.
11080 Include mbswidth.h.
11081 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
11082 (extend_location): New function.
11083 (YY_LINES): Remove.
11084
11085 Handle CRLF in C code rather than in Lex code.
11086 (YY_INPUT): New macro.
11087 (no_cr_read): New function.
11088
11089 Scan UCNs, even though we don't fully handle them yet.
11090 (convert_ucn_to_byte): New function.
11091
11092 Handle backslash-newline correctly in C code.
11093 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
11094 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
11095 all uses changed.
11096 (tag, splice): New EREs. Do not allow NUL or newline in tags.
11097 Use {splice} wherever C allows backslash-newline.
11098 YY_STEP after space, newline, vertical-tab.
11099 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 11100
b02d90a5
PE
11101 (letter, id): Don't assume ASCII; e.g., spell out a-z.
11102
11103 ({int}, handle_action_dollar, handle_action_at): Check for integer
11104 overflow.
9e32add8 11105
b02d90a5
PE
11106 (YY_STEP): Omit trailing semicolon, so that it's more like C.
11107
11108 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
11109 as well as \000. Check for UCHAR_MAX, not 255.
11110 Allow \x with an arbitrary positive number of digits, as in C.
11111 Check for overflow here.
11112 Allow \? and UCNs, for compatibility with C.
11113
11114 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
11115 with quote slot used by complain_at.
11116
11117 * tests/input.at: Add tests for backslash-newline, m4 quotes
11118 in symbols, long literals, and funny escapes in strings.
11119
11120 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
11121 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
11122 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
11123 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
11124 * m4/mbswidth.m4: New file, from GNU coreutils.
11125
11126 * doc/bison.texinfo (Grammar Outline): Document // comments.
11127 (Symbols): Document that trigraphs have no special meaning in Bison,
11128 nor is backslash-newline allowed.
11129 (Actions): Document that trigraphs have no special meaning.
11130
11131 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
11132 no longer used.
11133
111342002-11-02 Paul Eggert <eggert@twinsun.com>
11135
11136 * src/reader.c: Don't include quote.h; not needed.
11137 (get_merge_function): Reword warning to be consistent with
11138 type clash diagnostic in grammar_current_rule_check.
11139
11140 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
11141 bug in trigraph handling.
11142
11143 * src/output.c (prepare_symbols): When printing token names,
11144 escape "[" as "@<:@" and likewise for "]".
11145
11146 * src/system.h (errno): Remove declaration, as we are now
11147 assuming C89 or better, and C89 guarantees errno.
11148
762b212b
PE
111492002-10-30 Paul Eggert <eggert@twinsun.com>
11150
11151 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
11152 Check for close failures.
11153 * src/files.h (xfclose): Return void, not int, since it always
11154 returned zero.
11155 * src/files.c (xfclose): Likewise. Report I/O error if ferror
11156 indicates one.
11157 * src/output.c (output_skeleton): Use xfclose rather than fclose
11158 and ferror. xfclose now checks ferror.
11159
11160 * data/glr.c (YYLEFTMOST_STATE): Remove.
11161 (yyreportTree): Use a stack-based leftmost state. This avoids
11162 our continuing battles with bogus warnings about initializers.
11163
56100c60
AD
111642002-10-30 Akim Demaille <akim@epita.fr>
11165
11166 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
11167 #if.
11168
51b4a04c
PH
111692002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11170
11171 * tests/glr-regr1.at: New test for reported regressions.
11172 * tests/testsuite.at: Add glr-regr1.at test.
11173 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 11174
bf1ebda2
PE
111752002-10-24 Paul Eggert <eggert@twinsun.com>
11176
5c16c6b1
PE
11177 Version 1.75a.
11178
bf1ebda2
PE
11179 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
11180 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
11181 we use malloc. Don't assume 'A' through 'Z' are contiguous.
11182 Don't assume strdup exists; POSIX says its an XSI extension.
11183 Check for buffer overflow on input.
11184
b526ee61
AD
111852002-10-24 Akim Demaille <akim@epita.fr>
11186
11187 * src/output.c (output_skeleton): Don't disable M4sugar comments
11188 too soon: it results in comments being expanded.
11189 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
11190 first output.
11191
f1886bb2
AD
111922002-10-24 Akim Demaille <akim@epita.fr>
11193
11194 * data/yacc.c (m4_int_type): New.
11195 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
11196 char' as only yacc.c wants K&R portability.
11197 * data/glr.c (yysigned_char): Remove.
11198 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
11199 Reported by Quoc Peyrot.
11200
c5576256
PE
112012002-10-23 Paul Eggert <eggert@twinsun.com>
11202
11203 * src/main.c (main): With --trace=time, report times even if a
11204 non-fatal error occurs. Formerly, the times were reported in some
11205 such cases but not in others.
11206 * src/reader.c (reader): Just return if a complaint has been issued,
11207 instead of exiting, so that 'main' can report times.
11208
27b0ffea
AD
112092002-10-22 Akim Demaille <akim@epita.fr>
11210
11211 * src/system.h: Include sys/types.
11212 Reported by Bert Deknuydt.
11213
223a7883
PE
112142002-10-23 Paul Eggert <eggert@twinsun.com>
11215
11216 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
11217 Suggested by Art Haas.
11218
112192002-10-22 Paul Eggert <eggert@twinsun.com>
11220
11221 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
11222 decl; not needed any more.
11223 * src/main.c (main): Use return to exit, undoing yesterday's change.
11224 The last OS that we could find where this wouldn't work is
11225 SunOS 3.5, and that's too old to worry about now.
11226
11227 * data/glr.c (struct yyltype): Define members even when not
11228 doing locations. This is more consistent with yacc.c, and it
11229 works around the following bug reports:
161a71f3
PE
11230 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
11231 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 11232
223a7883
PE
11233 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
11234 @acronym consistently. Standardize on "Yacc" instead of "YACC",
11235 "Algol" instead of "ALGOL". Give a bit more history about BNF.
11236
8b76775a
AD
112372002-10-22 Akim Demaille <akim@epita.fr>
11238
11239 * data/README: New.
11240
6db10d14
PE
112412002-10-21 Paul Eggert <eggert@twinsun.com>
11242
11243 Be consistent about 'bool'; the old code used an enum in one
11244 module and an int in another, and this violates the C standard.
11245 * m4/stdbool.m4: New file, from coreutils 4.5.3.
11246 * configure.ac (AC_HEADER_STDBOOL): Add.
11247 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
11248 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
11249 * src/symtab.c (hash_compare_symbol_t): Likewise.
11250 * src/system.h (bool, false, true): Use a definition consistent
11251 with ../lib/hash.c. All uses changed.
11252
11253 * src/complain.c (warning_issued): Renamed from warn_message_count,
11254 so that we needn't worry about integer overflow (!).
11255 Now of type bool. All uses changed.
11256 (complaint_issued): Renamed from complain_message_count; likewise.
11257
11258 * src/main.c (main): Use exit to exit with failure.
27b0ffea 11259
6db10d14
PE
11260 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
11261 rather than 1 and 0.
11262 * src/main.c (main): Likewise.
11263 * src/getargs.c (getargs): Likewise.
11264 * src/reader.c (reader): Likewise.
11265
11266 * src/getarg.c (getargs): Remove duplicate code for
11267 "Try `bison --help'".
11268
11269 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
11270 What was that "2" for?
11271
11272 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
11273 * src/getargs.c (usage): Likewise.
11274
11275 * src/getargs.c (getargs): When there are too few operands, report
11276 the last one. When there are too many, report the first extra
11277 one. This is how diffutils does it.
11278
92a060fd
PE
112792002-10-20 Paul Eggert <eggert@twinsun.com>
11280
11281 Remove K&R vestiges.
11282 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
11283 * src/complain.c (VA_START): Remove. Assume prototypes.
11284 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
11285 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
11286 fatal): Assume prototypes.
11287 * src/complain.h: Assume prototypes.
11288 * src/system.h (PARAMS): Remove.
11289 Include <limits.h> unconditionally, since it's guaranteeed even
11290 for a freestanding C89 compiler.
11291 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
11292 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 11293
e7cb57c0
AD
112942002-10-20 Akim Demaille <akim@epita.fr>
11295
11296 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
11297 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
11298 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
11299 (yyresolveStates, yyresolveAction, yyresolveStack)
11300 (yyprocessOneStack): Use them.
11301 (yy_reduce_print): New.
11302 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
11303
0245f82d
AD
113042002-10-20 Akim Demaille <akim@epita.fr>
11305
11306 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
11307 arguments and output `void'.
11308 (b4_c_function): Rename as...
11309 (b4_c_function_def): this.
11310 (b4_c_function_decl, b4_c_ansi_function_def)
11311 (b4_c_ansi_function_decl): New.
11312 Change the interpretation of the arguments: before `int, foo', now
11313 `int foo, foo'.
11314 * data/yacc.c (yyparse): Prototype and define thanks to these.
11315 Adjust b4_c_function_def uses.
11316 * data/glr.c (yyparse): Likewise, but ANSI only.
11317
39912f52
AD
113182002-10-20 Akim Demaille <akim@epita.fr>
11319
11320 * src/output.c (prepare): Move the definition of `tokens_number',
11321 `nterms_number', `undef_token_number', `user_token_number_max'
11322 to...
11323 (prepare_tokens): Here.
11324 (prepare_tokens): Rename as...
11325 (prepare_symbols): this.
11326 (prepare): Move the definition of `rules_number' to...
11327 (prepare_rules): here.
11328 (prepare): Move the definition of `last', `final_state_number',
11329 `states_number' to...
11330 (prepare_states): here.
11331 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
11332
20c1e2ad
AD
113332002-10-20 Akim Demaille <akim@epita.fr>
11334
11335 * src/tables.h, src/tables.c, src/output.c: Comment changes.
11336
21964f43
AD
113372002-10-20 Akim Demaille <akim@epita.fr>
11338
11339 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
11340 * data/c.m4: here.
11341
66d30cd4
AD
113422002-10-20 Akim Demaille <akim@epita.fr>
11343
11344 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
11345 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
11346 `pair'.
11347 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
11348 `name' to...
11349 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
11350 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
11351 These.
11352
95f2c9fe
PE
113532002-10-19 Paul Eggert <eggert@twinsun.com>
11354
11355 Do not create a temporary file, as that involves security and
11356 cleanup headaches. Instead, use a pair of pipes.
11357 Derived from a suggestion by Florian Krohm.
11358 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
11359 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
11360 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
11361 (BISON_PREREQ_SUBPIPE): Add.
11362 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
11363 Add subpipe.h, subpipe.c.
11364 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
11365 * po/POTFILES.in: Add lib/subpipe.c.
11366 * src/output.c: Include "subpipe.h".
11367 (m4_invoke): Remove decl.
11368 (scan_skel): New decl.
11369 (output_skeleton): Use pipe rather than temporary file for m4 input.
11370 Check that m4sugar.m4 is readable, to avoid deadlock.
11371 Check for pipe I/O error.
11372 * src/scan-skel.l (readpipe): Remove decl.
11373 (scan_skel): New function, to be used in place of m4_invoke.
11374 Read from stream rather than file.
66d30cd4 11375
95f2c9fe
PE
11376 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
11377 float, as this generates a warning on Solaris 8 + GCC 3.2 with
11378 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
11379 this generates a more-accurate value anyway.
11380
11381 * lib/timevar.c (timervar_accumulate): Rename locals to
11382 avoid confusion with similarly-named more-global.
11383 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
11384
11385 * src/output.c (prepare): Use xstrdup to convert char const *
11386 to char *, to avoid GCC warning.
11387
c19988b7
AD
113882002-10-19 Akim Demaille <akim@epita.fr>
11389
11390 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
11391 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
11392 Use them to have `calc.y' ready for %pure-parser.
11393 * data/yacc.c (YYLEX): Pass a yylex return type to
11394 b4_c_function_call.
11395
ae7453f2
AD
113962002-10-19 Akim Demaille <akim@epita.fr>
11397
11398 Prototype support of %lex-param and %parse-param.
11399
11400 * src/parse-gram.y: Add the definition of the %lex-param and
11401 %parse-param tokens, plus their rules.
11402 Drop the `_' version of %glr-parser.
11403 Add the "," token.
11404 * src/scan-gram.l (INITIAL): Scan them.
11405 * src/muscle_tab.c: Comment changes.
11406 (muscle_insert, muscle_find): Rename `pair' as `probe'.
11407 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
11408 (muscle_entry_s): The `value' member is no longer const.
11409 Adjust all dependencies.
11410 * src/muscle_tab.c (muscle_init): Adjust: use
11411 MUSCLE_INSERT_STRING.
11412 Initialize the obstack earlier.
11413 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
11414 (muscle_pair_list_grow): New.
11415 * data/c.m4 (b4_c_function_call, b4_c_args): New.
11416 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
11417 * tests/calc.at: Use %locations, not --locations.
11418 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
11419
0e575721
AD
114202002-10-19 Akim Demaille <akim@epita.fr>
11421
11422 * src/getargs.c (usage): Take status as argument and exit
11423 accordingly.
11424 Report the traditional `Try ... --help' message when status != 0.
11425 (usage, version): Don't take a FILE * as arg, it is pointless.
11426 (getargs): When there is an incorrect number of arguments, make it
11427 an error, and report it GNUlically thanks to `usage ()'.
11428
724ce7f5
PE
114292002-10-18 Paul Eggert <eggert@twinsun.com>
11430
3a781eb2
PE
11431 * data/glr.c (yyreportParseError): Don't assume that sprintf
11432 yields the length of the printed string, as this is not true
11433 on SunOS 4.1.4. Reported by Peter Klein.
11434
724ce7f5
PE
11435 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
11436 * tests/conflicts.at (%nonassoc and eof): Likewise.
11437 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
11438
473d0a75
AD
114392002-10-17 Akim Demaille <akim@epita.fr>
11440
11441 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
11442 * src/getargs.c (trace_types, trace_args): Adjust.
11443 * src/reader.c (grammar_current_rule_prec_set)
11444 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
11445 Standardize error messages.
11446 And s/@prec/%prec/!
11447 (reader): Use trace_flag to enable scanner/parser debugging,
11448 instead of an adhoc scheme.
11449 * src/scan-gram.l: Remove trailing debugging code.
11450
e76d2469
PE
114512002-10-16 Paul Eggert <eggert@twinsun.com>
11452
93e2236a
PE
11453 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
11454 MUSCLE_TAB_H.
11455
e76d2469
PE
11456 * NEWS: Officially drop support for building Bison with K&R C,
11457 since it didn't work anyway and it's not worth worrying about.
11458 * Makefile.maint (wget_files): Remove ansi2knr.c.
11459 (ansi2knr.c-url_prefix): Remove.
11460 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
11461 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11462 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11463
5bd1c419
PE
114642002-10-15 Paul Eggert <eggert@twinsun.com>
11465
11466 Stop using the "enum_" trick for K&R-style function definitions;
11467 it confused me, and I was the author! Instead, assume that people
11468 who want to use K&R C compilers (when using these modules in GCC,
11469 perhaps?) will run ansi2knr.
11470
11471 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
11472 All uses of "enum_" changed to "enum ".
11473 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11474 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 11475
5bd1c419
PE
11476 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
11477 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
11478 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
11479 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
11480 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
11481 abitset_not, abitset_ones, abitset_or, abitset_or_and,
11482 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
11483 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
11484 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
11485 Use function prototypes; this removes the need for declaring
11486 static functions simply to provide their prototypes.
11487 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
11488 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
11489 bitset_count_, bitset_create, bitset_dump, bitset_first,
11490 bitset_free, bitset_init, bitset_last, bitset_next,
11491 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
11492 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
11493 bitset_print, bitset_release_memory, bitset_toggle_,
11494 bitset_type_choose, bitset_type_get, bitset_type_name_get,
11495 debug_bitset): Likewise.
11496 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
11497 * lib/bitset_stats.c (bitset_log_histogram_print,
11498 bitset_percent_histogram_print, bitset_stats_and,
11499 bitset_stats_and_cmp, bitset_stats_and_or,
11500 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
11501 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
11502 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
11503 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
11504 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
11505 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
11506 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
11507 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
11508 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
11509 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
11510 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
11511 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
11512 bitset_stats_zero): Likewise.
11513 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11514 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11515 bitsetv_dump, debug_bitsetv): Likewise.
11516 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
11517 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
11518 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
11519 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
11520 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
11521 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
11522 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
11523 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
11524 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
11525 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
11526 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
11527 Likewise.
11528 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
11529 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
11530 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
11531 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
11532 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
11533 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
11534 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
11535 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
11536 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
11537 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
11538 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 11539
ae26e1f0
AD
115402002-10-14 Akim Demaille <akim@epita.fr>
11541
11542 Version 1.75.
11543
d43baf71
AD
115442002-10-14 Akim Demaille <akim@epita.fr>
11545
11546 * tests/Makefile.am (maintainer-check-posix): New.
11547
7ebc83e3
AD
115482002-10-14 Akim Demaille <akim@epita.fr>
11549
11550 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
11551 member.
11552
05846dae
AD
115532002-10-14 Akim Demaille <akim@epita.fr>
11554
11555 * src/tables.c (table_ninf_remap): base -> tab.
11556 Reported by Matt Rosing.
11557
1318e37d
PE
115582002-10-14 Paul Eggert <eggert@twinsun.com>
11559
447fbb17
PE
11560 * tests/action.at, tests/calc.at, tests/conflicts.at,
11561 tests/cxx-type.at, tests/headers.at, tests/input.at,
11562 tests/regression.at, tests/synclines.at, tests/torture.at:
11563 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
11564 so that the tests still work even if POSIXLY_CORRECT is set.
11565 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 11566
1318e37d
PE
11567 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
11568 for portability to K&R hosts. Fix typo: signed char is guaranteed
11569 only to 127, not to 128.
11570 * data/glr.c (yysigned_char): New type.
11571 * data/yacc.c (yysigned_char): Likewise.
11572 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
11573
cc0f0794
PE
115742002-10-13 Paul Eggert <eggert@twinsun.com>
11575
5038f418
PE
11576 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
11577 true due to limited range of data type" warning from GCC.
11578
cc0f0794
PE
11579 * data/c.m4 (b4_token_defines): Protect against double-inclusion
11580 by wrapping enum yytokentype's definition inside #ifndef
11581 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
11582
6fed0802
AD
115832002-10-13 Akim Demaille <akim@epita.fr>
11584
11585 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
11586 Un yy- yyrhs to avoid the name clash with the global YYRHS.
11587
32f0598d
AD
115882002-10-13 Akim Demaille <akim@epita.fr>
11589
11590 * Makefile.maint: Update from Autoconf 2.54.
11591 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
11592
7ea9a33f
AD
115932002-10-13 Akim Demaille <akim@epita.fr>
11594
11595 * src/print.c (print_state): Separate the list of solved conflicts
11596 from the other items.
11597 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
11598
ea99527d
AD
115992002-10-13 Akim Demaille <akim@epita.fr>
11600
11601 Let nondeterministic skeletons be usable with deterministic
11602 tables.
11603
11604 With the patch, GAWK compiled by GCC without -O2 passes its test
11605 suite using a GLR parser driven by LALR tables. It fails with -O2
11606 because `struct stat' gives two different answers on my machine:
11607 88 (definition of an auto var) and later 96 (memset on this var).
11608 Hence the stack is badly corrumpted. The headers inclusion is to
11609 blame: if I move the awk.h inclusion before GLR's system header
11610 inclusion, the two struct stat have the same size.
11611
11612 * src/tables.c (pack_table): Always create conflict_table.
11613 (token_actions): Always create conflict_list.
11614 * data/glr.c (YYFLAG): Remove, unused.
11615
f377f69f
AD
116162002-10-13 Akim Demaille <akim@epita.fr>
11617
11618 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
11619 (O0FLAGS): New.
11620 (VALGRIND, GXX): New.
11621 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
11622 * tests/bison.in: Run $PREBISON a pre-command.
11623 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
11624 (maintainer-check-g++): New.
11625 * Makefile.am (maintainer-check): New.
11626
2a1fe6ed
AD
116272002-10-13 Akim Demaille <akim@epita.fr>
11628
11629 * data/glr.c: Formatting changes.
11630 Tweak some trace messages to match yacc.c's.
11631
f50adbbd
AD
116322002-10-13 Akim Demaille <akim@epita.fr>
11633
11634 GLR parsers sometimes raise parse errors instead of performing the
11635 default reduction.
11636 Reported by Charles-Henry de Boysson.
11637
11638 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 11639 check the length of the traces when %glr.
f50adbbd
AD
11640 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
11641 GLR's traces.
11642 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
11643 Test GLR parsers.
11644 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
11645 (yyltype): Remove the yy prefix from the member names.
11646 (yytable): Complete its comment.
11647 (yygetLRActions): Map error action number from YYTABLE from
11648 YYTABLE_NINF to 0.
11649 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
11650 (which was a bug: it should have been YYTABEL_NINF, and yet it was
11651 not satisfying as we could compare an YYACTION computed from
11652 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
11653 only value for error actions.
11654 (yyreportParseError): In verbose parse error messages, don't issue
11655 `error' in the list of expected tokens.
11656 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
11657 next action to perform to match glr.c's decoding.
11658 (yytable): Complete its comment.
11659
bcbad5b9
PE
116602002-10-13 Paul Eggert <eggert@twinsun.com>
11661
11662 Fix problem reported by Henrik Grubbstroem in
161a71f3 11663 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
11664 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
11665 because the Bison parser reads the second action before reducing
11666 the first one.
11667 * src/scan-gram.l (rule_length): New static var.
11668 Use it to keep track of the rule length in the scanner, since
11669 we can't expect the parser to be in lock-step sync with the scanner.
11670 (handle_action_dollar, handle_action_at): Use this var.
11671 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 11672
14904b89
PE
116732002-10-12 Paul Eggert <eggert@twinsun.com>
11674
1fe611e5
PE
11675 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
11676 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
11677 Include <sys/time.h> when checking for clock_t and struct tms.
11678 Use same include order as source.
11679 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 11680 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 11681
1fe611e5
PE
11682 * lib/timevar.c: Update copyright date and clarify comments.
11683 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 11684
1fe611e5
PE
11685 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
11686 GCC version as of today, then merge Bison's changes.
11687 Change "GCC" to "Bison" in copyright notice. timevar.def's
11688 author is Akim, so change that too.
11689
98194095
PE
11690 * src/reader.c (grammar_current_rule_check):
11691 Don't worry about the default action if $$ is untyped.
11692 Prevents bogus warnings reported by Jim Gifford in
161a71f3 11693 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 11694
14904b89
PE
11695 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
11696 * data/glr.c, data/lalr1.cc, data/yacc.c:
11697 Output token definitions before the first part of user declarations.
11698 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 11699 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 11700
ff6dca18
PE
117012002-10-11 Paul Eggert <eggert@twinsun.com>
11702
11703 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
11704 (yyparse): here. This undoes some of the 2002-07-25 change.
11705 Compatibility problem reported by Ralf S. Engelschall with
11706 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
11707
eb714592
AD
117082002-10-11 Akim Demaille <akim@epita.fr>
11709
11710 * tests/regression.at Characters Escapes): New.
11711 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
11712 characters.
11713 Reported by Jan Nieuwenhuizen.
11714
b7195100
AD
117152002-10-11 Akim Demaille <akim@epita.fr>
11716
11717 * po/id.po: New.
11718
f28a0f2d
PE
117192002-10-10 Paul Eggert <eggert@twinsun.com>
11720
11721 Portability fixes for bitsets; this also avoids several GCC
11722 warnings.
11723
11724 * lib/abitset.c: Include <stddef.h>, for offsetof.
11725 * lib/lbitset.c: Likewise.
11726
11727 * lib/abitset.c (abitset_bytes): Return a size that is aligned
11728 properly for vectors of objects. Do not assume that adding a
11729 header size to a multiple of a word size yields a value that is
11730 properly aligned for the whole union.
11731 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11732
11733 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
11734 unique names for structures.
11735 * lib/ebitset.c (ebitset_bytes): Likewise.
11736 * lib/lbitset.c (lbitset_bytes): Likewise.
11737
11738 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
11739 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
11740 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
11741 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
11742 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
11743 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
11744 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
11745 to improve the type-checking that GCC can do.
11746 * lib/bitset.c (bitset_op4_cmp): Likewise.
11747 * lib/bitset_stats.c (bitset_stats_count,
11748 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
11749 bitset_stats_copy, bitset_stats_disjoint_p,
11750 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
11751 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
11752 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
11753 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
11754 bitset_stats_and_or_cmp, bitset_stats_andn_or,
11755 bitset_stats_andn_or_cmp, bitset_stats_or_and,
11756 bitset_stats_or_and_cmp): Likewise.
11757 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
11758 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
11759 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
11760 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
11761
11762 * lib/abitset.h: Include bitset.h, not bbitset.h.
11763 * lib/ebitset.h: Likewise.
11764 * lib/lbitset.h: Likewise.
11765
11766 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
11767 All instances of parameters of type enum bitset_opts are now of
11768 type enum_bitset_opts, to conform to the C Standard, and similarly
11769 for enum_bitset_type.
11770 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11771 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11772
11773 Do not use "struct bitset_struct" to mean different things in
11774 different modules. Not only is this confusing, it violates
11775 the C Standard, which requires that structure types in different
11776 modules must be compatible if one is to be passed to the other.
11777 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
11778 All instances of "struct bitset_struct *" replaced with "bitset".
11779 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
11780 (union bitset_union, struct abitset_struct, struct ebitset_struct,
11781 struct lbitset_struct, struct bitset_stats_struct): New types.
11782 All uses of struct bitset_struct changed to union bitset_union,
11783 etc.
ba0fe3c7 11784 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
11785 struct bitset_struct): Remove.
11786 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
11787 struct bitset_struct): Remove.
11788 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
11789 bitset_struct): Remove.
11790 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
11791 Likewise.
11792
11793 Do not call a function of type T using a call that assumes the
11794 function is of a different type U. Standard C requires that a
11795 function must be called with a type that is compatible with its
11796 definition.
11797 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11798 New decls.
11799 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11800 New functions.
11801 * lib/ebitset.c (PFV): Remove.
11802 * lib/lbitset.c (PFV): Likewise.
11803 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
11804 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
11805 decls.
11806 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
11807 (ebitset_vtable): Use them.
11808 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
11809 lbitset_xor): New functions.
11810 (lbitset_vtable): Use them.
11811
11812 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
11813 Declare.
11814
11815 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
11816 GCC warning.
11817 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
11818 Use offsetof, for simplicity.
11819
6fbe4984
PE
118202002-10-06 Paul Eggert <eggert@twinsun.com>
11821
11822 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
11823 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 11824 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
11825 which was inadvertently undone by the 2002-09-30 patch.
11826 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
11827 the same width as int.
11828
420f93c8
PE
118292002-10-04 Paul Eggert <eggert@twinsun.com>
11830
11831 Version 1.50.
11832
11833 * configure.ac (AC_INIT), NEWS: Increment version number.
11834
11835 * doc/bison.texinfo: Minor spelling, grammar, and white space
11836 fixes.
11837 (Symbols): Mention that any negative value returned from yylex
11838 signifies end-of-input. Warn about negative chars. Mention
11839 the portable Standard C character set.
11840
11841 The GNU coding standard says CFLAGS and YFLAGS are reserved
11842 for the installer to set.
11843 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
11844 * src/Makefile.am (AM_CFLAGS): Likewise.
11845 (AM_YFLAGS): Renamed from YFLAGS.
11846
11847 Fix some MAX and MIN problems.
11848 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
11849 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
11850 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
11851 * src/reader.c (reader): Use it.
11852
11853 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
11854 POSIX 1003.1-2001 has removed fgrep.
11855
118562002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
11857
11858 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
11859 interpreted as signed.
11860 * lib/ebitset.c (ebitset_list): Fix bug.
11861
ff68026d
PE
118622002-10-01 Paul Eggert <eggert@twinsun.com>
11863
11864 More fixes for 64-bit hosts and large bitsets.
11865
11866 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
11867 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
11868 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
11869 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
11870 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
11871 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
11872 bitset_count_): Likewise.
11873 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
11874 bitset_first, bitset_last): Likewise.
11875 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
11876 bitset_stats_list_reverse, bitset_stats_size,
11877 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
11878 Likewise.
11879 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11880 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11881 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11882 bitsetv_reflexive_transitive_closure): Likewise.
11883 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
11884 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
11885 Likewise.
11886 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
11887 Likewise.
420f93c8 11888
ff68026d
PE
11889 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
11890 Use size_t, not unsigned int, to count bytes.
11891 * lib/abitset.h (abitset_bytes): Likewise.
11892 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
11893 Likewise.
11894 * lib/bitset.h (bitset_bytes): Likewise.
11895 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
11896 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
11897 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11898 * lib/ebitset.c (ebitset_bytes): Likewise.
11899 * lib/ebitset.h (ebitset_bytes): Likewise.
11900 * lib/lbitset.c (lbitset_bytes): Likewise.
11901 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 11902
ff68026d
PE
11903 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
11904 abitset_subset_p, abitset_disjoint_p, abitset_and,
11905 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
11906 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
11907 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
11908 abitset_or_and, abitset_or_and_cmp):
11909 Use bitset_windex instead of unsigned int.
11910 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
11911 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
11912 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
11913 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
11914 Likewise.
11915 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 11916
ff68026d
PE
11917 * lib/bitset.c (bitset_print):
11918 Use proper printf formats for widths of integer types.
11919 * lib/bitset_stats.c (bitset_percent_histogram_print,
11920 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
11921 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11922 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
11923 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 11924
ff68026d
PE
11925 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
11926 BITSET_SIZE_MAX): New macros.
11927 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
11928 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
11929 to BITSET_WINDEX_MAX.
11930
11931 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
11932 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
11933 since we now return the bitset_bindex type (not int).
11934
11935 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
11936 when computing sizes.
11937 * lib/ebitset.c (ebitset_elts_grow): Likewise.
11938
11939 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
11940 and avoid cast to unsigned.
11941
6aa452a6
AD
119422002-09-30 Akim Demaille <akim@epita.fr>
11943
11944 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11945 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
11946 Updates from Michael Hayes.
11947
927f7817
AD
119482002-09-30 Art Haas <ahaas@neosoft.com>
11949
11950 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
11951 invocations.
11952 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
11953 defined.
11954
9738f41e
AD
119552002-09-27 Akim Demaille <akim@epita.fr>
11956
11957 Version 1.49c.
11958
a5c75d7f
AD
119592002-09-27 Akim Demaille <akim@epita.fr>
11960
11961 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
11962 (Because of AC_LIBSOURCE).
11963
8280e179
AD
119642002-09-27 Akim Demaille <akim@epita.fr>
11965
11966 Playing with Autoscan.
11967
11968 * configure.ac: Remove the old LIBOBJ tweaks.
11969 (AC_REPLACE_FUNCS): Add strrchr and strtol.
11970 * lib/strrchr.c: New.
11971 * lib/strtol.c: New, from the Coreutils 4.5.1.
11972
ae64af35
AD
119732002-09-27 Akim Demaille <akim@epita.fr>
11974
11975 Playing with Autoscan.
11976
11977 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
11978 * lib/Makefile.am (libbison_a_SOURCES): No longer include
11979 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
11980 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
11981 Coreutils 4.5.1.
11982
d1a1114f
AD
119832002-09-24 Akim Demaille <akim@epita.fr>
11984
11985 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
11986 (Frequently Asked Questions, Parser Stack Overflow): New.
11987
b906441c
AD
119882002-09-13 Akim Demaille <akim@epita.fr>
11989
11990 Playing with autoscan.
11991
11992 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
11993 * src/files.c (skeleton_find): Remove, unused.
11994 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
11995 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
11996
bd701811
AD
119972002-09-13 Akim Demaille <akim@epita.fr>
11998
11999 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
12000 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
12001
e0a13e7b
AD
120022002-09-13 Akim Demaille <akim@epita.fr>
12003
12004 * configure.ac: Require 2.54.
12005 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
12006 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
12007 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
12008 Remove, provided by Autoconf macros.
12009
c97011bf
AD
120102002-09-12 Akim Demaille <akim@epita.fr>
12011
12012 * m4/prereq.m4: Update, from Coreutils 4.5.1.
12013
d862b1be
AD
120142002-09-12 Akim Demaille <akim@epita.fr>
12015
12016 * m4/prereq.m4: Update, from Fileutils 4.1.5.
12017 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
12018 Reported by Martin Mokrejs.
12019
3d38c03a
AD
120202002-09-10 Akim Demaille <akim@epita.fr>
12021
12022 * src/parse-gram.y: Associate a human readable string to each
12023 token type.
12024 * tests/regression.at (Invalid inputs): Adjust.
12025
b6347355
AD
120262002-09-10 Gary V. Vaughan <gary@gnu.org>
12027
12028 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
12029 with an Autoconf-2.5x style configure.ac.
12030
09ba4ab2
PE
120312002-09-06 Paul Eggert <eggert@twinsun.com>
12032
12033 * doc/bison.texinfo (Conditions): Make explicit that the GPL
12034 exception applies only to yacc.c. This is a modification of a
12035 patch originally suggested by Akim Demaille.
12036
21846f69
AD
120372002-09-06 Akim Demaille <akim@epita.fr>
12038
09ba4ab2
PE
12039 * data/c.m4 (b4_copyright): Move the GPL exception comment from
12040 here to...
12041 * data/yacc.c: here.
12042
21846f69
AD
12043 * data/lalr1.cc (struct yyltype): Don't define it, since we use
12044 LocationType.
12045 (b4_ltype): Default to yy::Location from location.hh.
12046
c0ad8bf3
AD
120472002-09-04 Jim Meyering <jim@meyering.net>
12048
12049 * data/yacc.c: Guard the declaration of yytoknum also with
12050 `#ifdef YYPRINT', so it is declared only when used.
12051
3a93251e
AD
120522002-09-04 Akim Demaille <akim@epita.fr>
12053
12054 * configure.in: Rename as...
12055 * configure.ac: this.
12056 Bump to 1.49c.
12057
427c0dda
AD
120582002-09-04 Akim Demaille <akim@epita.fr>
12059
12060 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
12061 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
12062 translate maintainer only messages.
12063
6a254321
PE
120642002-08-12 Paul Eggert <eggert@twinsun.com>
12065
645e30d1
PE
12066 Version 1.49b.
12067
6a254321
PE
12068 * Makefile.am (SUBDIRS): Remove intl.
12069 (DISTCLEANFILES): Remove.
12070 * NEWS: Mention that GNU M4 is now required. Clarify what is
12071 meant by "larger grammars". Mention the pt_BR translation.
12072 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
12073 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
12074 Bump version from 0.11.2 to 0.11.5.
12075 (BISON_PREREQ_STAGE): Remove.
12076 (AM_GNU_GETTEXT): Use external gettext.
12077 (AC_OUTPUT): Remove intl/Makefile.
12078
12079 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
12080
12081 * data/glr.c: Include string.h, for strlen.
12082 (yyreportParseError): Use size_t for yysize.
12083 (yy_yypstack): No longer nested inside yypstates, as nested
12084 functions are not portable. Do not assume size_t is the
12085 same width as int.
12086 (yypstates): Do not assume that ptrdiff_t is the same width
12087 as int, and similarly for yyposn and YYINDEX.
12088
12089 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
12090
12091 * lib/Makefile.am (INCLUDES): Do not include from the intl
12092 directory, which has been removed.
12093 * src/Makefile.am (INCLUDES): Likewise.
12094
12095 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
12096 (bitsets_sources, additional_bitsets_sources, timevars_sources):
12097 New vars.
12098
12099 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
12100 * tests/Makefile.am (EXTRA_DIST): Likewise.
12101
12102 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
12103 Do not assume that bitset_windex is the same width as unsigned.
12104
12105 * lib/abitset.c (abitset_unused_clear): Do not assume that
12106 bitset_word is the same width as int.
12107 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
12108 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
12109 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
12110 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
12111 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
12112
12113 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
12114 portability to one's complement hosts!).
12115 * lib/ebitset.c (ebitset_op1): Likewise.
12116 * lib/lbitset.c (lbitset_op1): Likewise.
12117
12118 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
12119 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12120 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
12121 Sync with fileutils.
12122 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
12123 lib/gettext.h: Sync with diffutils.
12124
12125 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
12126 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
12127
12128 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
12129 PROTOTYPES to check for prototypes, and "defined __STDC__" to
12130 check for void *.
12131
12132 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
12133 size_t; the old version tried to do this but casted improperly.
12134 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
12135 (bitset_test): Now returns int, not unsigned long.
12136
12137 * lib/bitset_stats.c: Include "gettext.h".
12138 (_): New macro.
12139 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
12140 name locals "index", as it generates unnecessary warnings on some
12141 hosts that have an "index" function.
12142
12143 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
12144 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
12145 they need translation.
12146 * src/LR0.c (state_list_append, new_itemsets, get_state,
12147 append_states, generate_states): Likewise.
12148 * src/assoc.c (assoc_to_string): Likewise.
12149 * src/closure.c (print_closure, set_firsts, closure): Likewise.
12150 * src/gram.c (grammar_dump): Likewise.
12151 * src/injections.c (injections_compute): Likewise.
12152 * src/lalr.c (lookaheads_print): Likewise.
12153 * src/relation.c (relation_transpose): Likewise.
12154 * src/scan-gram.l: Likewise.
12155 * src/tables.c (table_grow, pack_vector): Likewise.
12156
12157 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
12158 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
12159 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
12160 * m4/mbstate_t.m4: Sync with fileutils.
12161 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
12162
12163 * po/LINGUAS: Add pt_BR.
12164 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
12165 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
12166 lib/timevar.c.
12167 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
12168 manual recommends.
12169 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
12170
12171 * src/complain.c (strerror_r): Remove decl; not needed.
12172 (strerror): Use same pattern as ../lib/error.c.
12173
12174 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
12175
12176 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
12177
12178 * src/main.c (main): Cast result of bindtextdomain and textdomain
12179 to void, to avoid a GCC warning when --disable-nls is in effect.
12180
12181 * src/scan-gram.l: Use strings rather than escapes when possible,
12182 to minimize the number of warnings from xgettext.
12183 (handle_action_dollar, handle_action_at): Don't use isdigit,
12184 as it mishandles negative chars and it may not work as expected
12185 outside the C locale.
12186
12187 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
12188 this is a GCC extension and is not portable to other compilers.
12189
12190 * src/system.h (alloca): Use same pattern as ../lib/error.c.
12191 Do not include <ctype.h>; no longer needed.
12192 Do not include <malloc.h>; no longer needed (and generates
12193 warnings on OpenBSD 3.0).
12194
12195 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
12196 it's not portable.
12197
12198 * tests/regression.at: Do not use 'cc -c input.c -o input';
12199 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
12200
12201 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
12202 exit status as failure, not just exit status 1. Sun C exits
12203 with status 2 sometimes.
12204
12205 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
12206 Use it for the two large tests.
12207
c8f002c7
AD
122082002-08-02 Akim Demaille <akim@epita.fr>
12209
12210 * src/conflicts.c (conflicts_output): Don't output rules never
12211 reduced here, since anyway that computation doesn't work.
12212 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
12213 (rule_useless_p, rule_never_reduced_p): New.
12214 (grammar_rules_partial_print): Use a filter instead of a range.
12215 Display the title only if needed.
12216 (grammar_rules_print): Adjust.
12217 (grammar_rules_never_reduced_report): New.
12218 * src/tables.c (action_row): Move the computation of rules never
12219 reduced to...
12220 (token_actions): here.
12221 * src/main.c (main): Make the parser before making the report, so
12222 that rules never reduced are computed.
12223 Call grammar_rules_never_reduced_report.
12224 * src/print.c (print_results): Report rules never reduced.
12225 * tests/conflicts.at, tests/reduce.at: Adjust.
12226
cd08e51e
AD
122272002-08-01 Akim Demaille <akim@epita.fr>
12228
12229 Instead of attaching lookaheads and duplicating the rules being
12230 reduced by a state, attach the lookaheads to the reductions.
12231
12232 * src/state.h (state_t): Remove the `lookaheads',
12233 `lookaheads_rule' member.
12234 (reductions_t): Add a `lookaheads' member.
12235 Use a regular array for the `rules'.
12236 * src/state.c (reductions_new): Initialize the lookaheads member
12237 to 0.
12238 (state_rule_lookaheads_print): Adjust.
12239 * src/state.h, src/state.c (state_reductions_find): New.
12240 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
12241 (count_rr_conflicts): Adjust.
12242 * src/lalr.c (LArule): Remove.
12243 (add_lookback_edge): Adjust.
12244 (state_lookaheads_count): New.
12245 (states_lookaheads_initialize): Merge into...
12246 (initialize_LA): this.
12247 (lalr_free): Adjust.
12248 * src/main.c (main): Don't free nullable and derives too early: it
12249 is used by --verbose.
12250 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
12251
bb0027a9
AD
122522002-08-01 Akim Demaille <akim@epita.fr>
12253
12254 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
12255 `rule_number_t**'.
12256 (set_derives, free_derives): Rename as...
12257 (derives_compute, derives_free): this.
12258 Adjust all dependencies.
12259 * src/nullable.c (set_nullable, free_nullable): Rename as...
12260 (nullable_compute, nullable_free): these.
12261 (rule_list_t): Store rule_t *, not rule_number_t.
12262 * src/state.c (state_rule_lookaheads_print): Directly compare rule
12263 pointers, instead of their numbers.
12264 * src/main.c (main): Call nullable_free, and derives_free earlier,
12265 as they were lo longer used.
12266
3325ddc4
AD
122672002-08-01 Akim Demaille <akim@epita.fr>
12268
12269 * lib/timevar.c (get_time): Include children time.
12270 * src/lalr.h (LA, LArule): Don't export them: used with the
12271 state_t.
12272 * src/lalr.c (LA, LArule): Static.
12273 * src/lalr.h, src/lalr.c (lalr_free): New.
12274 * src/main.c (main): Call it.
12275 * src/tables.c (pack_vector): Check whether loc is >= to the
12276 table_size, not >.
12277 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
12278 (tables_generate): do it, since that's also it which allocates
12279 them.
12280 Don't free LA and LArule, main does.
12281
c6f1a33c
AD
122822002-07-31 Akim Demaille <akim@epita.fr>
12283
12284 Separate parser tables computation and output.
12285
12286 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
12287 (conflict_list, conflict_list_cnt, table, check, table_ninf)
12288 (yydefgoto, yydefact, high): Move to...
12289 * src/tables.h, src/tables.c: here.
12290 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12291 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12292 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
12293 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
12294 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
12295 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
12296 (action_row, save_row, token_actions, save_column, default_goto)
12297 (goto_actions, sort_actions, matching_state, pack_vector)
12298 (table_ninf_remap, pack_table, prepare_actions): Move to...
12299 * src/tables.c: here.
12300 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
12301 * src/output.c (token_actions, output_base, output_conflicts)
12302 (output_check): Merge into...
12303 (prepare_actions): this.
12304 (actions_output): Rename as...
12305 (user_actions_output): this.
12306 * src/main.c (main): Call tables_generate and tables_free.
12307
1509d42f
AD
123082002-07-31 Akim Demaille <akim@epita.fr>
12309
12310 Steal GCC's --time-report support.
12311
12312 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
12313 stolen/adjusted from GCC.
12314 * m4/stage.m4: Remove time related checks.
12315 * m4/timevar.m4: New.
12316 * configure.in: Adjust.
12317 * src/system.h: Adjust to using timevar.h.
12318 * src/getargs.h, src/getargs.c: Support trace_time for
12319 --trace=time.
12320 * src/main.c (stage): Remove.
12321 (main): Replace `stage' invocations with timevar calls.
12322 * src/output.c: Insert pertinent timevar calls.
12323
273a74fa
AD
123242002-07-31 Akim Demaille <akim@epita.fr>
12325
12326 Let --trace have arguments.
12327
12328 * src/getargs.h (enum trace_e): New.
12329 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
12330 (long_options, short_options): --trace/-T takes an optional
12331 argument.
12332 Change all the uses of trace_flag to reflect the new flags.
12333 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
12334
12335 Strengthen `stage' portability.
12336
12337 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
12338 * configure.in: Use it.
12339 Don't check for malloc.h and sys/times.h.
12340 * src/system.h: Include them when appropriate.
12341 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
12342 times and struct tms are available.
12343
217598da
AD
123442002-07-30 Akim Demaille <akim@epita.fr>
12345
12346 In verbose parse error message, don't report `error' as an
12347 expected token.
12348 * tests/actions.at (Printers and Destructors): Adjust.
12349 * tests/calc.at (Calculator $1): Adjust.
12350 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
12351 error message, do not report the parser accepts the error token in
12352 that state.
12353
52489d44
AD
123542002-07-30 Akim Demaille <akim@epita.fr>
12355
12356 Normalize conflict related messages.
12357
12358 * src/complain.h, src/complain.c (warn, complain): New.
12359 * src/conflicts.c (conflicts_print): Use them.
12360 (conflict_report_yacc): New, extracted from...
12361 (conflicts_print): here.
12362 * tests/conflicts.at, tests/existing.at: Adjust.
12363
e8832397
AD
123642002-07-30 Akim Demaille <akim@epita.fr>
12365
12366 Report rules which are never reduced by the parser: those hidden
12367 by conflicts.
12368
12369 * src/LR0.c (save_reductions): Don't make the final state too
12370 different: save its reduction (accept) instead of having a state
12371 without any action (no shift or goto, no reduce).
12372 Note: the final state is now a ``regular'' state, i.e., the
12373 parsers now contain `reduce 0' as default reduction.
12374 Nevertheless, since they decide to `accept' when yystate =
12375 final_state, they still will not reduce rule 0.
12376 * src/print.c (print_actions, print_reduction): Adjust.
12377 * src/output.c (action_row): Track reduced rules.
12378 (token_actions): Report rules never reduced.
12379 * tests/conflicts.at, tests/regression.at: Adjust.
12380
caf23d24
AD
123812002-07-30 Akim Demaille <akim@epita.fr>
12382
12383 `stage' was accidently included in a previous patch.
12384 Initiate its autoconfiscation.
12385
12386 * configure.in: Look for malloc.h and sys/times.h.
12387 * src/main.c (stage): Adjust.
12388 Report only when trace_flag.
12389
640748ee
AD
123902002-07-29 Akim Demaille <akim@epita.fr>
12391
12392 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
12393 state_number_t.
12394 (errs_t): symbol_t*, not symbol_number_t.
12395 (reductions_t): rule_t*, not rule_number_t.
12396 (FOR_EACH_SHIFT): New.
12397 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
12398 * src/print.c, src/print_graph.c: Adjust.
12399
88bce5a2
AD
124002002-07-29 Akim Demaille <akim@epita.fr>
12401
12402 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
12403
12404 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
12405 (endtoken, accept): these.
12406 * src/reader.c (reader): Set endtoken's default tag to "$end".
12407 Set undeftoken's tag to "$undefined" instead of "$undefined.".
12408 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
12409 Adjust.
12410
1bfb97db
AD
124112002-07-29 Akim Demaille <akim@epita.fr>
12412
12413 * src/reduce.c (reduce_grammar): When the language is empty,
12414 complain about the start symbol, not the axiom.
12415 Use its location.
12416 * tests/reduce.at (Empty Language): New.
12417
fc5734fe
AD
124182002-07-26 Akim Demaille <akim@epita.fr>
12419
12420 * src/reader.h, src/reader.c (gram_error): ... can't get
12421 yycontrol without making too strong assumptions on the parser
12422 itself.
12423 * src/output.c (prepare_tokens): Use the real 0th value of
12424 token_translations instead of `0'.
12425 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
12426 visible here.
12427 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
12428 for the time being: %locations ought to provide it to yyerror.
12429
3650b4b8
AD
124302002-07-25 Akim Demaille <akim@epita.fr>
12431
12432 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
12433 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
12434 * tests/regression.at (Web2c Actions): Adjust.
12435
4b3d3a8e
AD
124362002-07-25 Akim Demaille <akim@epita.fr>
12437
12438 Stop storing rules from 1 to nrules + 1.
12439
12440 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
12441 * src/nullable.c, src/output.c, src/print.c, src/reader.c
12442 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
12443 Iterate from 0 to nrules.
12444 Use rule_number_as_item_number and item_number_as_rule_number.
12445 Adjust to `derive' now containing possibly 0.
12446 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
12447 Handle the `- 1' part in rule numbers from/to item numbers.
12448 * src/conflicts.c (log_resolution): Fix the message which reversed
12449 shift and reduce.
12450 * src/output.c (action_row): Initialize default_rule to -1.
12451 (token_actions): Adjust.
12452 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
12453 expected output.
12454 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
12455
4a2a22f4
AD
124562002-07-25 Akim Demaille <akim@epita.fr>
12457
12458 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
12459 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
12460 (b4_c_knr_arg_decl): New.
12461 * data/yacc.c: Use it to define yysymprint, yydestruct, and
12462 yyreport_parse_error.
12463
b8df3223
AD
124642002-07-25 Akim Demaille <akim@epita.fr>
12465
12466 * data/yacc.c (yyreport_parse_error): New, extracted from...
12467 (yyparse): here.
12468 (yydestruct, yysymprint): Move above yyparse.
12469 Be K&R compliant.
12470
a762e609
AD
124712002-07-25 Akim Demaille <akim@epita.fr>
12472
12473 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
12474 replace...
12475 (b4_sint_type, b4_uint_type): these.
12476 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
12477 * tests/regression.at (Web2c Actions): Adjust.
12478
12b0043a
AD
124792002-07-25 Akim Demaille <akim@epita.fr>
12480
12481 * src/gram.h (TIEM_NUMBER_MAX): New.
12482 (item_number_of_rule_number, rule_number_of_item_number): Rename
12483 as...
12484 (rule_number_as_item_number, item_number_as_rule_number): these.
12485 Adjust dependencies.
12486 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12487 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12488 (symbol_number_to_vector_number): New.
12489 (order): Of vector_number_t* type.
12490 (base_t, BASE_MAX, BASE_MIN): New.
12491 (froms, tos, width, pos, check): Of base_t type.
12492 (action_number_t, ACTION_MIN, ACTION_MAX): New.
12493 (actrow): Of action_number_t type.
12494 (conflrow): Of unsigned int type.
12495 (table_ninf, base_ninf): New.
12496 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
12497 (muscle_insert_int_table, muscle_insert_base_table)
12498 (muscle_insert_rule_number_table): New.
12499 (prepare_tokens): Output `toknum' as int_table.
12500 (action_row): Returns a rule_number_t.
12501 Use ACTION_MIN, not SHRT_MIN.
12502 (token_actions): yydefact is rule_number_t*.
12503 (table_ninf_remap): New.
12504 (pack_table): Use it for `base' and `table'.
12505 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
12506 replaced with...
12507 (YYPACT_NINF, YYTABLE_NINF): these.
12508 (yypact, yytable): Compute their types instead of hard-coded
12509 `short'.
12510 * tests/regression.at (Web2c Actions): Adjust.
12511
5dde258a
AD
125122002-07-19 Akim Demaille <akim@epita.fr>
12513
12514 * src/scan-gram.l (id): Can start with an underscore.
12515
a945ec39
AD
125162002-07-16 Akim Demaille <akim@epita.fr>
12517
12518 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
12519 Adjust all former `associativity' dependencies.
12520 * src/symtab.c (symbol_new): Default associativity is `undef', not
12521 `right'.
12522 (symbol_check_alias_consistence): Adjust.
12523
fae437e8
AD
125242002-07-09 Akim Demaille <akim@epita.fr>
12525
12526 * doc/bison.texinfo: Properly set the ``header'' part.
12527 Use @dircategory ``GNU programming tools'' as per Texinfo's
12528 documentation.
12529 Use @copying.
12530
1a715ef2
AD
125312002-07-09 Akim Demaille <akim@epita.fr>
12532
12533 * lib/quotearg.h: Protect against multiple inclusions.
12534 * src/location.h (location_t): Add a `file' member.
12535 (LOCATION_RESET, LOCATION_PRINT): Adjust.
12536 * src/complain.c (warn_at, complain_at, fatal_at): Drop
12537 `error_one_per_line' support.
12538
a5d50994
AD
125392002-07-09 Akim Demaille <akim@epita.fr>
12540
12541 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
12542 * src/reader.c (lineno): Remove.
12543 Adjust all dependencies.
12544 (get_merge_function): Take a location and use complain_at.
12545 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
12546 * tests/regression.at (Invalid inputs, Mixing %token styles):
12547 Adjust.
12548
b275314e
AD
125492002-07-09 Akim Demaille <akim@epita.fr>
12550
12551 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
12552 recovery rule, and forbid extensions when --yacc.
12553 (gram_error): Use complain_at.
12554 * src/reader.c (reader): Exit if there were parse errors.
12555
865b9df1
AD
125562002-07-09 Akim Demaille <akim@epita.fr>
12557
12558 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
12559 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
12560 Reported by R Blake <blakers@mac.com>.
12561
c76e14da
AD
125622002-07-09 Akim Demaille <akim@epita.fr>
12563
12564 * data/yacc.c: Output the copyright notive in the header.
12565
7db2ed2d
AD
125662002-07-03 Akim Demaille <akim@epita.fr>
12567
12568 * src/output.c (froms, tos): Are state_number_t.
12569 (save_column): sp, sp1, and sp2 are state_number_t.
12570 (prepare): Rename `final' as `final_state_number', `nnts' as
12571 `nterms_number', `nrules' as `rules_number', `nstates' as
12572 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
12573 unused.
12574 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
12575 * data/lalr1.cc (nsym_): Remove, unused.
12576
e68e0410
AD
125772002-07-03 Akim Demaille <akim@epita.fr>
12578
12579 * src/lalr.h, src/lalr.c (goto_number_t): New.
12580 * src/lalr.c (goto_list_t): New.
12581 Propagate them.
12582 * src/nullable.c (rule_list_t): New.
12583 Propagate.
12584 * src/types.h: Remove.
12585
e1a4f3a4
AD
125862002-07-03 Akim Demaille <akim@epita.fr>
12587
12588 * src/closure.c (print_fderives): Use rule_rhs_print.
12589 * src/derives.c (print_derives): Use rule_rhs_print.
12590 (rule_list_t): New, replaces `shorts'.
12591 (set_derives): Add comments.
12592 * tests/sets.at (Nullable, Firsts): Adjust.
12593
536545f3
AD
125942002-07-03 Akim Demaille <akim@epita.fr>
12595
12596 * src/output.c (prepare_actions): Free `tally' and `width'.
12597 (prepare_actions): Allocate and free `order'.
12598 * src/symtab.c (symbols_free): Free `symbols'.
12599 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
12600 * src/output.c (m4_invoke): Move to...
12601 * src/scan-skel.l: here.
12602 (<<EOF>>): Close yyout, and free its name.
12603
8b752b00
AD
126042002-07-03 Akim Demaille <akim@epita.fr>
12605
12606 Fix some memory leaks, and fix a bug: state 0 was examined twice.
12607
12608 * src/LR0.c (new_state): Merge into...
12609 (state_list_append): this.
12610 (new_states): Merge into...
12611 (generate_states): here.
12612 (set_states): Don't ensure a proper `errs' state member here, do it...
12613 * src/conflicts.c (conflicts_solve): here.
12614 * src/state.h, src/state.c: Comment changes.
12615 (state_t): Rename member `shifts' as `transitions'.
12616 Adjust all dependencies.
12617 (errs_new): For consistency, also take the values as argument.
12618 (errs_dup): Remove.
12619 (state_errs_set): New.
12620 (state_reductions_set, state_transitions_set): Assert that no
12621 previous value was assigned.
12622 (state_free): New.
12623 (states_free): Use it.
12624 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
12625 temporary storage: use `errs' and `nerrs' as elsewhere.
12626 (set_conflicts): Allocate and free this `errs'.
12627
613f5e1a
AD
126282002-07-02 Akim Demaille <akim@epita.fr>
12629
12630 * lib/libiberty.h: New.
12631 * lib: Update the bitset implementation from upstream.
12632 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
12633 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
12634 * src/main.c: Adjust bitset stats calls.
12635
26e0cadc
PE
126362002-07-01 Paul Eggert <eggert@twinsun.com>
12637
12638 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
12639 char, so that negative chars don't collide with $.
12640
1154cced
AD
126412002-06-30 Akim Demaille <akim@epita.fr>
12642
12643 Have the GLR tests be `warning' checked, and fix the warnings.
12644
12645 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
12646 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
12647 (yyremoveDeletes): `yyi' and `yyj' are size_t.
12648 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
12649 (yyaddDeferredAction): static.
12650 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
12651 (yyreportParseError): yyprefix is const.
12652 yytokenp is used only when verbose.
12653 (yy__GNUC__): Replace with __GNUC__.
12654 (yypdumpstack): yyi is size_t.
12655 (yypreference): Un-yy local variables and arguments, to avoid
12656 clashes with `yyr1'. Anyway, we are not in the user name space.
12657 (yytname_size): be an int, as is compared with ints.
12658 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
12659 Use them.
12660 * tests/cxx-gram.at: Use quotation to protect $1.
12661 Use AT_COMPILE to enable warnings hunts.
12662 Prototype yylex and yyerror.
12663 `Use' argc.
12664 Include `string.h', not `strings.h'.
12665 Produce and prototype stmtMerge only when used.
12666 yylex takes a location.
12667
97650f4e
AD
126682002-06-30 Akim Demaille <akim@epita.fr>
12669
12670 We spend a lot of time in quotearg, in particular when --verbose.
12671
12672 * src/symtab.c (symbol_get): Store a quoted version of the key.
12673 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
12674 Adjust all callers.
12675
d2576365
AD
126762002-06-30 Akim Demaille <akim@epita.fr>
12677
12678 * src/state.h (reductions_t): Rename member `nreds' as num.
12679 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
12680 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
12681
ccaf65bc
AD
126822002-06-30 Akim Demaille <akim@epita.fr>
12683
12684 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
12685 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
12686 (shifts_to): Rename as...
12687 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
12688 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
12689 (TRANSITION_IS_DISABLED, transitions_to): these.
12690
87675353
AD
126912002-06-30 Akim Demaille <akim@epita.fr>
12692
12693 * src/print.c (print_shifts, print_gotos): Merge into...
12694 (print_transitions): this.
12695 (print_transitions, print_errs, print_reductions): Align the
12696 lookaheads columns.
12697 (print_core, print_transitions, print_errs, print_state,
12698 print_grammar): Output empty lines separator before, not after.
12699 (state_default_rule_compute): Rename as...
12700 (state_default_rule): this.
12701 * tests/conflicts.at (Defaulted Conflicted Reduction),
12702 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
12703 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
12704
ce4ccb4b
AD
127052002-06-30 Akim Demaille <akim@epita.fr>
12706
12707 Display items as we display rules.
12708
12709 * src/gram.h, src/gram.c (rule_lhs_print): New.
12710 * src/gram.c (grammar_rules_partial_print): Use it.
12711 * src/print.c (print_core): Likewise.
12712 * tests/conflicts.at (Defaulted Conflicted Reduction),
12713 (Unresolved SR Conflicts): Adjust.
12714 (Unresolved SR Conflicts): Adjust and rename as...
12715 (Resolved SR Conflicts): this, as was meant.
12716 * tests/regression.at (Web2c Report): Adjust.
12717
bc933ef1
AD
127182002-06-30 Akim Demaille <akim@epita.fr>
12719
12720 * src/print.c (state_default_rule_compute): New, extracted from...
12721 (print_reductions): here.
12722 Pessimize, but clarify the code.
12723 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
12724
53d4308d
AD
127252002-06-30 Akim Demaille <akim@epita.fr>
12726
12727 * src/output.c (action_row): Let default_rule be always a rule
12728 number.
12729
574fb2d5
AD
127302002-06-30 Akim Demaille <akim@epita.fr>
12731
12732 * src/closure.c (print_firsts, print_fderives, closure):
12733 Use BITSET_EXECUTE.
12734 * src/lalr.c (lookaheads_print): Likewise.
12735 * src/state.c (state_rule_lookaheads_print): Likewise.
12736 * src/print_graph.c (print_core): Likewise.
12737 * src/print.c (print_reductions): Likewise.
12738 * src/output.c (action_row): Likewise.
12739 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
12740
05811fd7
AD
127412002-06-30 Akim Demaille <akim@epita.fr>
12742
12743 * src/print_graph.c: Use report_flag.
12744
0e4d5753
AD
127452002-06-30 Akim Demaille <akim@epita.fr>
12746
12747 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
12748 to...
12749 * src/relation.h, src/relation.c (traverse, relation_digraph)
12750 (relation_print, relation_transpose): New.
12751
24c7d800
AD
127522002-06-30 Akim Demaille <akim@epita.fr>
12753
12754 * src/state.h, src/state.c (shifts_to): New.
12755 * src/lalr.c (build_relations): Use it.
12756
9222837b
AD
127572002-06-30 Akim Demaille <akim@epita.fr>
12758
12759 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
12760 (item_number_of_rule_number, rule_number_of_item_number): New.
12761 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
12762 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
12763 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
12764 Propagate their use.
12765 Much remains to be done, in particular wrt `shorts' from types.h.
12766
260008e5
AD
127672002-06-30 Akim Demaille <akim@epita.fr>
12768
12769 * src/symtab.c (symbol_new): Initialize the `printer' member.
12770
8a731ca8
AD
127712002-06-30 Akim Demaille <akim@epita.fr>
12772
12773 * src/LR0.c (save_reductions): Remove, replaced by...
12774 * src/state.h, src/state.c (state_reductions_set): New.
12775 (reductions, errs): Rename as...
12776 (reductions_t, errs_t): these.
12777 Adjust all dependencies.
12778
32e1e0a4
AD
127792002-06-30 Akim Demaille <akim@epita.fr>
12780
12781 * src/LR0.c (state_list_t, state_list_append): New.
12782 (first_state, last_state): Now symbol_list_t.
12783 (this_state): Remove.
12784 (new_itemsets, append_states, save_reductions): Take a state_t as
12785 argument.
12786 (set_states, generate_states): Adjust.
12787 (save_shifts): Remove, replaced by...
12788 * src/state.h, src/state.c (state_shifts_set): New.
12789 (shifts): Rename as...
12790 (shifts_t): this.
12791 Adjust all dependencies.
12792 * src/state.h (state_t): Remove the `next' member.
12793
e5fb6710
AD
127942002-06-30 Akim Demaille <akim@epita.fr>
12795
12796 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
12797 escaped in slot 0.
12798
c7ca99d4
AD
127992002-06-30 Akim Demaille <akim@epita.fr>
12800
12801 Use hash.h for the state hash table.
12802
12803 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
12804 (allocate_storage): Use state_hash_new.
12805 (free_storage): Use state_hash_free.
12806 (new_state, get_state): Adjust.
12807 * src/lalr.h, src/lalr.c (states): Move to...
12808 * src/states.h (state_t): Remove the `link' member, no longer
12809 used.
12810 * src/states.h, src/states.c: here.
12811 (state_hash_new, state_hash_free, state_hash_lookup)
12812 (state_hash_insert, states_free): New.
12813 * src/states.c (state_table, state_compare, state_hash): New.
12814 * src/output.c (output_actions): Do not free states now, since we
12815 still need to know the final_state number in `prepare', called
12816 afterwards. Do it...
12817 * src/main.c (main): here: call states_free after `output'.
12818
df0e7316
AD
128192002-06-30 Akim Demaille <akim@epita.fr>
12820
12821 * src/state.h, src/state.c (state_new): New, extracted from...
12822 * src/LR0.c (new_state): here.
12823 * src/state.h (STATE_ALLOC): Move to...
12824 * src/state.c: here.
12825 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
12826 * src/state.h, src/state.c: here.
12827
39f41916
AD
128282002-06-30 Akim Demaille <akim@epita.fr>
12829
12830 * src/reader.c (gensym): Rename as...
12831 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
12832 (getsym): Rename as...
12833 (symbol_get): this.
12834
d57650a5
AD
128352002-06-30 Akim Demaille <akim@epita.fr>
12836
12837 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
12838 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
12839 * src/output.c, src/print.c, src/print_graph.c: Propagate.
12840 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
12841
5a08f1ce
AD
128422002-06-30 Akim Demaille <akim@epita.fr>
12843
12844 Make the test suite pass with warnings checked.
12845
12846 * tests/actions.at (Printers and Destructors): Improve.
12847 Avoid unsigned vs. signed issues.
12848 * tests/calc.at: Don't exercise the scanner here, do it...
12849 * tests/input.at (Torturing the Scanner): here.
12850
720623af
PH
128512002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12852
88e7e941 12853 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
12854 reorganize first lines parallel to yacc.c.
12855
fb8135fa
AD
128562002-06-28 Akim Demaille <akim@epita.fr>
12857
12858 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
12859 (b4_token_enum, b4_token_defines): New, factored from...
12860 * data/lalr1.cc, data/yacc.c, glr.c: here.
12861
41442480
AD
128622002-06-28 Akim Demaille <akim@epita.fr>
12863
12864 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
12865 unused variables.
12866 * src/output.c (merger_output): static.
12867
e0e5bf84
AD
128682002-06-28 Akim Demaille <akim@epita.fr>
12869
ba0fe3c7 12870 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
12871 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
12872 pacify GCC.
12873 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 12874
676385e2
PH
128752002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12876
12877 Accumulated changelog for new GLR parsing features.
12878
6a254321 12879 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
12880 conflicts_total_count.
12881 * src/conflicts.h: Ditto.
12882 * src/output.c (token_actions): Use the new name.
12883 (output_conflicts): Change conflp => conflict_list_heads, and
12884 confl => conflict_list for better readability.
12885 * data/glr.c: Use the new names.
12886 * NEWS: Add self to GLR announcement.
e0e5bf84 12887
676385e2
PH
12888 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
12889
12890 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
12891 Akim Demaille.
12892
12893 * data/bison.glr: Change name to glr.c
12894 * data/glr.c: Renamed from bison.glr.
12895 * data/Makefile.am: Add glr.c
e0e5bf84
AD
12896
12897 * src/getargs.c:
12898
676385e2 12899 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 12900 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 12901
676385e2
PH
12902 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12903
12904 * data/bison.glr: Be sure to restore the
12905 current #line when returning to the skeleton contents after having
12906 exposed the input file's #line.
12907
12908 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12909
12910 * data/bison.glr: Bring up to date with changes to bison.simple.
12911
12912 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12913
12914 * data/bison.glr: Correct definitions that use b4_prefix.
12915 Various reformatting.
12916 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
12917 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
12918 yytokenp argument; now part of stack.
12919 (yychar): Define to behave as documented.
12920 (yyclearin): Ditto.
e0e5bf84 12921
676385e2
PH
12922 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12923
12924 * src/reader.h: Add declaration for free_merger_functions.
12925
12926 * src/reader.c (merge_functions): New variable.
12927 (get_merge_function): New function.
12928 (free_merger_functions): New function.
12929 (readgram): Check for %prec that is not followed by a symbol.
12930 Handle %dprec and %merge declarations.
12931 (packgram): Initialize dprec and merger fields in rules array.
12932
12933 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
12934 conflict_list_cnt, conflict_list_free): New variables.
12935 (table_grow): Also grow conflict_table.
e0e5bf84 12936 (prepare_rules): Output dprec and merger tables.
676385e2 12937 (conflict_row): New function.
e0e5bf84 12938 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
12939 default reduction in conflicted states for GLR parser so that there
12940 are spaces for the conflict lists.
12941 (save_row): Also save conflict information.
12942 (token_actions): Allocate conflict list.
12943 (merger_output): New function.
12944 (pack_vector): Pack conflict table, too.
12945 (output_conflicts): New function to output yyconflp and yyconfl.
12946 (output_check): Allocate conflict_tos.
12947 (output_actions): Output conflict tables, also.
12948 (output_skeleton): Output b4_mergers definition.
12949 (prepare): Output b4_max_rhs_length definition.
12950 Use 'bison.glr' as default skeleton for GLR parsers.
12951
12952 * src/gram.c (glr_parser): New flag.
12953 (grammar_free): Call free_merger_functions.
12954
12955 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
12956 all pairs of conflicting reductions, rather than just all tokens
12957 causing conflicts. Needed to size conflict tables.
e0e5bf84 12958 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
12959 interface.
12960 (conflicts_print): Ditto.
12961 (count_total_conflicts): New function.
12962
12963 * src/reader.h (merger_list): New type.
12964 (merge_functions): New variable.
12965
12966 * src/lex.h (tok_dprec, tok_merge): New token types.
12967
12968 * src/gram.h (rule_s): Add dprec and merger fields.
12969 (glr_parser): New flag.
12970
12971 * src/conflicts.h (count_total_conflicts): New function.
12972
12973 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
12974
12975 * doc/bison.texinfo (Generalized LR Parsing): New section.
12976 (GLR Parsers): New section.
12977 (Language and Grammar): Mention GLR parsing.
12978 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
12979 Correct typo ("tge" -> "the").
12980
12981 * data/bison.glr: New skeleton for GLR parsing.
12982
12983 * tests/cxx-gram.at: New tests for GLR parsing.
12984
12985 * tests/testsuite.at: Include cxx-gram.at.
12986
12987 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 12988
676385e2
PH
12989 * src/parse-gram.y:
12990
12991 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
12992
12993 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 12994
b5480d74 129952002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
12996
12997 * src/options.h, src/options.c: Remove.
12998 * src/getargs.c (short_options, long_options): New.
12999
60491a94
AD
130002002-06-27 Akim Demaille <akim@epita.fr>
13001
13002 * data/bison.simple, data/bison.c++: Rename as...
13003 * data/yacc.c, data/lalr1.cc: these.
13004 * doc/bison.texinfo (Environment Variables): Remove.
13005
9be0c25b
AD
130062002-06-25 Raja R Harinath <harinath@cs.umn.edu>
13007
13008 * src/getargs.c (report_argmatch): Initialize strtok().
13009
1ae72863
AD
130102002-06-20 Akim Demaille <akim@epita.fr>
13011
13012 * data/bison.simple (b4_symbol_actions): New, replaces...
13013 (b4_symbol_destructor, b4_symbol_printer): these.
13014 (yysymprint): Be sure to call YYPRINT only for tokens, and using
13015 user token numbers.
13016
87542d29
AD
130172002-06-20 Akim Demaille <akim@epita.fr>
13018
13019 * data/bison.simple (yydestructor): Rename as...
13020 (yydestruct): this.
13021
1a31ed21
AD
130222002-06-20 Akim Demaille <akim@epita.fr>
13023
13024 * src/symtab.h, src/symtab.c (symbol_type_set)
13025 (symbol_destructor_set, symbol_precedence_set): The location is
13026 the last argument.
13027 Adjust all callers.
13028
e776192e
AD
130292002-06-20 Akim Demaille <akim@epita.fr>
13030
13031 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
13032 internals.
13033 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
13034 Takes a location.
13035 * src/symtab.h, src/symtab.c (symbol_class_set)
13036 (symbol_user_token_number_set): Likewise.
13037 Adjust all callers.
13038 Promote complain_at.
13039 * tests/input.at (Type Clashes): Adjust.
13040
5c1180b3
AD
130412002-06-20 Akim Demaille <akim@epita.fr>
13042
13043 * data/bison.simple (YYLEX): Fix the declaration when
13044 %pure-parser.
13045
e3170060
AD
130462002-06-20 Akim Demaille <akim@epita.fr>
13047
13048 * data/bison.simple (yysymprint): Don't print the token number,
13049 just its name.
13050 * tests/actions.at (Destructors): Rename as...
13051 (Printers and Destructors): this.
13052 Also exercise %printer.
13053
253862fd
AD
130542002-06-20 Akim Demaille <akim@epita.fr>
13055
13056 * data/bison.simple (YYDSYMPRINT): New.
13057 Use it to remove many of the #if YYDEBUG/if (yydebug).
13058
366eea36
AD
130592002-06-20 Akim Demaille <akim@epita.fr>
13060
13061 * src/symtab.h, src/symtab.c (symbol_t): printer and
13062 printer_location are new members.
13063 (symbol_printer_set): New.
13064 * src/parse-gram.y (PERCENT_PRINTER): New token.
13065 Handle its associated rule.
13066 * src/scan-gram.l: Adjust.
13067 (handle_destructor_at, handle_destructor_dollar): Rename as...
13068 (handle_symbol_code_at, handle_symbol_code_dollar): these.
13069 * src/output.c (symbol_printers_output): New.
13070 (output_skeleton): Call it.
13071 * data/bison.simple (yysymprint): New. Cannot be named yyprint
13072 since there are already many grammar files with a user `yyprint'.
13073 Replace the calls to YYPRINT to calls to yysymprint.
13074 * tests/calc.at: Adjust.
13075 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
13076 taking advantage of parser very internal details (stack size!).
13077
4f25ebb0
AD
130782002-06-20 Akim Demaille <akim@epita.fr>
13079
13080 * src/scan-gram.l: Complete the scanner with the missing patterns
13081 to pacify Flex.
13082 Use `quote' and `symbol_tag_get' where appropriate.
13083
93b68a0e
AD
130842002-06-19 Akim Demaille <akim@epita.fr>
13085
13086 * tests/actions.at (Destructors): Augment to test locations.
13087 * data/bison.simple (yydestructor): Pass it the current location
13088 if locations are enabled.
13089 Prototype only when __STDC__ or C++.
13090 Change the argument names to move into the yy name space: there is
13091 user code here.
13092
58612f1d
AD
130932002-06-19 Akim Demaille <akim@epita.fr>
13094
74310291
AD
13095 * data/bison.simple (b4_pure_if): New.
13096 Use it instead of #ifdef YYPURE.
13097
130982002-06-19 Akim Demaille <akim@epita.fr>
13099
13100 * data/bison.simple (b4_location_if): New.
58612f1d
AD
13101 Use it instead of #ifdef YYLSP_NEEDED.
13102
f25bfb75
AD
131032002-06-19 Akim Demaille <akim@epita.fr>
13104
13105 Prepare @$ in %destructor, but currently don't bind it in the
13106 skeleton, as %location use is not cleaned up yet.
13107
13108 * src/scan-gram.l (handle_dollar, handle_destructor_at)
13109 (handle_action_at): New.
13110 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
13111 a braced_code_t and a location as additional arguments.
13112 (handle_destructor_dollar): Instead of requiring `b4_eval', just
13113 unquote one when outputting `b4_dollar_dollar'.
13114 Adjust callers.
13115 * data/bison.simple (b4_eval): Remove.
13116 (b4_symbol_destructor): Adjust.
13117 * tests/input.at (Invalid @n): Adjust.
13118
c732d2c6
AD
131192002-06-19 Zack Weinberg <zack@codesourcery.com>
13120
13121 * doc/bison.texinfo: Document ability to have multiple
13122 prologue sections.
13123
8c165d89
AD
131242002-06-18 Akim Demaille <akim@epita.fr>
13125
13126 * src/files.c (compute_base_names): When computing the output file
13127 names from the input file name, strip the directory part.
13128
ca98bf57
AD
131292002-06-18 Akim Demaille <akim@epita.fr>
13130
13131 * data/bison.simple.new: Comment changes.
13132 Reported by Andreas Schwab.
13133
0bfb02ff
AD
131342002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
13135
13136 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
13137 there are no `label `yyoverflowlab' defined but not used' warnings
13138 when yyoverflow is defined.
13139
24c0aad7
AD
131402002-06-18 Akim Demaille <akim@epita.fr>
13141
13142 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
13143 new member.
13144 (symbol_destructor_set): Adjust.
13145 * src/output.c (symbol_destructors_output): Output the destructor
13146 locations.
13147 Output the symbol name.
13148 * data/bison.simple (b4_symbol_destructor): Adjust.
13149
5719c109
AD
131502002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
13151 and Akim Demaille <akim@epita.fr>
13152
13153 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
13154 what's left on the stack when the error recovery hits EOF.
13155 * tests/actions.at (Destructors): Complete to exercise this case.
13156
9280d3ef
AD
131572002-06-17 Akim Demaille <akim@epita.fr>
13158
13159 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
13160 arguments is really empty, not only equal to `[]'.
13161 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
13162 member.
13163 (symbol_destructor_set): New.
13164 * src/output.c (symbol_destructors_output): New.
13165 * src/reader.h (brace_code_t, current_braced_code): New.
13166 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
13167 (handle_dollar): Rename as...
13168 (handle_action_dollar): this.
13169 (handle_destructor_dollar): New.
13170 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
13171 (grammar_declaration): Use it.
13172 * data/bison.simple (yystos): Is always defined.
13173 (yydestructor): New.
13174 * tests/actions.at (Destructors): New.
13175 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
13176
dafdc66f
AD
131772002-06-17 Akim Demaille <akim@epita.fr>
13178
13179 * src/symlist.h, src/symlist.c (symbol_list_length): New.
13180 * src/scan-gram.l (handle_dollar, handle_at): Compute the
13181 rule_length only when needed.
13182 * src/output.c (actions_output, token_definitions_output): Output
13183 the full M4 block.
13184 * src/symtab.c: Don't access directly to the symbol tag, use
13185 symbol_tag_get.
13186 * src/parse-gram.y: Use symbol_list_free.
13187
56c47203
AD
131882002-06-17 Akim Demaille <akim@epita.fr>
13189
13190 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
13191 (symbol_list_prepend, get_type_name): Move to...
13192 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
13193 (symbol_list_prepend, symbol_list_n_type_name_get): here.
13194 Adjust all callers.
13195 (symbol_list_free): New.
13196 * src/scan-gram.l (handle_dollar): Takes a location.
13197 * tests/input.at (Invalid $n): Adjust.
13198
1e0bab92
AD
131992002-06-17 Akim Demaille <akim@epita.fr>
13200
13201 * src/reader.h, src/reader.c (symbol_list_new): Export it.
13202 (symbol_list_prepend): New.
13203 * src/parse-gram.y (%union): `list' is a new member.
13204 (symbols.1): New, replaces...
13205 (terms_to_prec.1, nterms_to_type.1): these.
13206 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
13207 Take a location as additional argument.
13208 Adjust all callers.
13209
04e60654
AD
132102002-06-15 Akim Demaille <akim@epita.fr>
13211
13212 * src/parse-gram.y: Move %token in the declaration section so that
13213 we don't depend upon CVS Bison.
13214
10e5b8bd
AD
132152002-06-15 Akim Demaille <akim@epita.fr>
13216
13217 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
13218 * src/print.c (print_core): Use it.
13219
9801d40c
AD
132202002-06-15 Akim Demaille <akim@epita.fr>
13221
13222 * src/conflicts.c (log_resolution): Accept the rule involved in
13223 the sr conflicts instead of the lookahead number that points to
13224 that rule.
13225 (flush_reduce): Accept the current lookahead vector as argument,
13226 instead of the index in LA.
13227 (resolve_sr_conflict): Accept the current number of lookahead
13228 bitset to consider for the STATE, instead of the index in LA.
13229 (set_conflicts): Adjust.
13230 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
13231
c0263492
AD
132322002-06-15 Akim Demaille <akim@epita.fr>
13233
13234 * src/state.h (state_t): Replace the `lookaheadsp' member, a
13235 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
13236 Adjust all dependencies.
13237 * src/lalr.c (initialize_lookaheads): Split into...
13238 (states_lookaheads_count, states_lookaheads_initialize): these.
13239 (lalr): Adjust.
13240
9757c359
AD
132412002-06-15 Akim Demaille <akim@epita.fr>
13242
13243 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
13244 out of...
13245 (grammar_rules_print): here.
13246 * src/reduce.c (reduce_output): Use it.
13247 * tests/reduce.at (Useless Rules, Reduced Automaton)
13248 (Underivable Rules): Adjust.
13249
6b98e4b5
AD
132502002-06-15 Akim Demaille <akim@epita.fr>
13251
13252 Copy BYacc's nice way to report the grammar.
13253
13254 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
13255 New.
13256 Don't print the rules' location, it is confusing and useless.
13257 (rule_print): Use grammar_rhs_print.
13258 * src/print.c (print_grammar): Use grammar_rules_print.
13259
6b98e4b5
AD
132602002-06-15 Akim Demaille <akim@epita.fr>
13261
13262 Complete and rationalize `useless thing' warnings.
13263
13264 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
13265 (symbol_tag_print): New.
13266 Use them everywhere in place of accessing directly the tag member.
13267 * src/gram.h, src/gram.c (rule_print): New.
13268 Use it where a rule used to be printed `by hand'.
13269 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
13270 (reduce_grammar_tables): Report the useless rules.
13271 (reduce_print): Useless things are a warning, not an error.
13272 Report it as such.
13273 * tests/reduce.at (Useless Nonterminals, Useless Rules):
13274 (Reduced Automaton, Underivable Rules): Adjust.
13275 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
13276 * tests/conflicts.at (Unresolved SR Conflicts)
13277 (Solved SR Conflicts): Adjust.
13278
ee000ba4
AD
132792002-06-15 Akim Demaille <akim@epita.fr>
13280
13281 Let symbols have a location.
13282
13283 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
13284 (getsym): Adjust.
13285 Adjust all callers.
13286 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
13287 Use location_t, not int.
13288 * src/symtab.c (symbol_check_defined): Take advantage of the
13289 location.
13290 * tests/regression.at (Invalid inputs): Adjust.
13291
8efe435c
AD
132922002-06-15 Akim Demaille <akim@epita.fr>
13293
13294 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
13295 (input): Don't try to initialize yylloc here, do it in the
13296 scanner.
13297 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
13298 * src/gram.h (rule_t): Change line and action_line into location
13299 and action_location, of location_t type.
13300 Adjust all dependencies.
13301 * src/location.h, src/location.c (empty_location): New.
13302 * src/reader.h, src/reader.c (grammar_start_symbol_set)
13303 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
13304 (grammar_current_rule_symbol_append)
13305 (grammar_current_rule_action_append): Expect a location as argument.
13306 * src/reader.c (grammar_midrule_action): Adjust to attach an
13307 action's location as dummy symbol location.
13308 * src/symtab.h, src/symtab.c (startsymbol_location): New.
13309 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
13310 the line numbers.
13311
1921f1d7
AD
133122002-06-14 Akim Demaille <akim@epita.fr>
13313
13314 Grammar declarations may be found in the grammar section.
13315
13316 * src/parse-gram.y (rules_or_grammar_declaration): New.
13317 (declarations): Each declaration may end with a semicolon, not
13318 just...
13319 (grammar_declaration): `"%union"'.
13320 (grammar): Branch to rules_or_grammar_declaration.
13321
4515534c
AD
133222002-06-14 Akim Demaille <akim@epita.fr>
13323
13324 * src/main.c (main): Invoke scanner_free.
13325
f958596b
AD
133262002-06-14 Akim Demaille <akim@epita.fr>
13327
13328 * src/output.c (m4_invoke): Extracted from...
13329 (output_skeleton): here.
13330 Free tempfile.
13331
2c569025
AD
133322002-06-14 Akim Demaille <akim@epita.fr>
13333
13334 * src/parse-gram.y (directives, directive, gram)
13335 (grammar_directives, precedence_directives, precedence_directive):
13336 Rename as...
13337 (declarations, declaration, grammar, grammar_declaration)
13338 (precedence_declaration, precedence_declarator): these.
13339 (symbol_declaration): New.
13340
592e8d4d
AD
133412002-06-14 Akim Demaille <akim@epita.fr>
13342
13343 * src/files.c (action_obstack): Remove, unused.
13344 (output_obstack): Remove it, and all its dependencies, as it is no
13345 longer needed.
13346 * src/reader.c (epilogue_set): Build the epilogue in the
13347 muscle_obstack.
13348 * src/output.h, src/output.c (muscle_obstack): Move to...
13349 * src/muscle_tab.h, src/muscle_tab.h: here.
13350 (muscle_init): Initialize muscle_obstack.
13351 (muscle_free): New.
13352 * src/main.c (main): Call it.
13353
0c15323d
AD
133542002-06-14 Akim Demaille <akim@epita.fr>
13355
13356 * src/location.h: New, extracted from...
13357 * src/reader.h: here.
13358 * src/Makefile.am (noinst_HEADERS): Merge into
13359 (bison_SOURCES): this.
13360 Add location.h.
13361 * src/parse-gram.y: Use location_t instead of Bison's.
13362 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
13363 Use location_t instead of ints.
13364
e96c9728
AD
133652002-06-14 Akim Demaille <akim@epita.fr>
13366
13367 * data/bison.simple, data/bison.c++: Be sure to restore the
13368 current #line when returning to the skeleton contents after having
13369 exposed the input file's #line.
13370
75d1fe16
AD
133712002-06-12 Akim Demaille <akim@epita.fr>
13372
13373 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
13374 eager.
13375 * tests/actions.at (Exotic Dollars): New.
13376
6c35d22c
AD
133772002-06-12 Akim Demaille <akim@epita.fr>
13378
13379 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
13380 ['"/] too eagerly.
13381 * tests/input.at (Torturing the Scanner): New.
13382
1d6412ad
AD
133832002-06-11 Akim Demaille <akim@epita.fr>
13384
13385 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
13386 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
13387 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
13388 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
13389 * src/reader.c (reader): Use it.
13390
4cdb01db
AD
133912002-06-11 Akim Demaille <akim@epita.fr>
13392
13393 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
13394 Adjust all callers.
13395 (scanner_last_string_free): New.
13396
44995b2e
AD
133972002-06-11 Akim Demaille <akim@epita.fr>
13398
13399 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
13400 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
13401 (last_string, YY_OBS_FREE): New.
13402 Use them when returning an ID.
13403
e9955c83
AD
134042002-06-11 Akim Demaille <akim@epita.fr>
13405
13406 Have Bison grammars parsed by a Bison grammar.
13407
13408 * src/reader.c, src/reader.h (prologue_augment): New.
13409 * src/reader.c (copy_definition): Remove.
13410
13411 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
13412 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
13413 (grammar_current_rule_prec_set, grammar_current_rule_check)
13414 (grammar_current_rule_symbol_append)
13415 (grammar_current_rule_action_append): Export.
13416 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
13417 (symbol_list_action_append): Remove.
13418 Hook the routines from reader.
13419 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
13420 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
13421
13422 * src/reader.c (read_declarations): Remove, unused.
13423
13424 * src/parse-gram.y: Handle the epilogue.
13425 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
13426 (grammar_start_symbol_set): this.
13427 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
13428 * src/reader.c (readgram): Remove, unused.
13429 (reader): Adjust to insert eoftoken and axiom where appropriate.
13430
13431 * src/reader.c (copy_dollar): Replace with...
13432 * src/scan-gram.h (handle_dollar): this.
13433 * src/parse-gram.y: Remove `%thong'.
13434
13435 * src/reader.c (copy_at): Replace with...
13436 * src/scan-gram.h (handle_at): this.
13437
13438 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
13439 New.
13440
13441 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
13442 time being.
13443
13444 * src/reader.h, src/reader.c (grammar_rule_end): New.
13445
13446 * src/parse.y (current_type, current_class): New.
13447 Implement `%nterm', `%token' support.
13448 Merge `%term' into `%token'.
13449 (string_as_id): New.
13450 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
13451 type name.
13452
13453 * src/parse-gram.y: Be sure to handle properly the beginning of
13454 rules.
13455
13456 * src/parse-gram.y: Handle %type.
13457 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
13458
13459 * src/parse-gram.y: More directives support.
13460 * src/options.c: No longer handle source directives.
13461
13462 * src/parse-gram.y: Fix %output.
13463
13464 * src/parse-gram.y: Handle %union.
13465 Use the prologue locations.
13466 * src/reader.c (parse_union_decl): Remove.
13467
13468 * src/reader.h, src/reader.c (epilogue_set): New.
13469 * src/parse-gram.y: Use it.
13470
13471 * data/bison.simple, data/bison.c++: b4_stype is now either not
13472 defined, then default to int, or to the contents of %union,
13473 without `union' itself.
13474 Adjust.
13475 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
13476
13477 * src/output.c (actions_output): Don't output braces, as they are
13478 already handled by the scanner.
13479
13480 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
13481 characters to themselves.
13482
13483 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
13484 that the epilogue has a proper #line.
13485
13486 * src/parse-gram.y: Handle precedence/associativity.
13487
13488 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
13489 a terminal.
13490 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
13491 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
13492 at all to define terminals that cannot be emitted.
13493
13494 * src/scan-gram.l: Escape M4 characters.
13495
13496 * src/scan-gram.l: Working properly with escapes in user
13497 strings/characters.
13498
13499 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
13500 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
13501 grammar.
13502 Use more modest sizes, as for the time being the parser does not
13503 release memory, and therefore the process swallows a huge amount
13504 of memory.
13505
13506 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
13507 stricter %token grammar.
13508
13509 * src/symtab.h (associativity): Add `undef_assoc'.
13510 (symbol_precedence_set): Do nothing when passed an undef_assoc.
13511 * src/symtab.c (symbol_check_alias_consistence): Adjust.
13512
13513 * tests/regression.at (Invalid %directive): Remove, as it is now
13514 meaningless.
13515 (Invalid inputs): Adjust to the new error messages.
13516 (Token definitions): The new grammar doesn't allow too many
13517 eccentricities.
13518
13519 * src/lex.h, src/lex.c: Remove.
13520 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
13521 (copy_character, copy_string2, copy_string, copy_identifier)
13522 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
13523 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
13524 (parse_action): Remove.
13525 * po/POTFILES.in: Adjust.
13526
2e047461
AD
135272002-06-11 Akim Demaille <akim@epita.fr>
13528
cd05d13c 13529 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
13530 rule's action member: return the action as a string.
13531 Don't require `rule_length' as an argument: compute it.
13532 (grammar_current_rule_symbol_append)
13533 (grammar_current_rule_action_append): New, eved out from
13534 (readgram): here.
13535 Remove `action_flag', `rulelength', unused now.
13536
9af3fbce
AD
135372002-06-11 Akim Demaille <akim@epita.fr>
13538
13539 * src/reader.c (grammar_current_rule_prec_set).
13540 (grammar_current_rule_check): New, eved out from...
13541 (readgram): here.
13542 Remove `xaction', `first_rhs': useless.
13543 * tests/input.at (Type clashes): New.
13544 * tests/existing.at (GNU Cim Grammar): Adjust.
13545
1485e106
AD
135462002-06-11 Akim Demaille <akim@epita.fr>
13547
13548 * src/reader.c (grammar_midrule_action): New, Eved out from
13549 (readgram): here.
13550
da4160c3
AD
135512002-06-11 Akim Demaille <akim@epita.fr>
13552
13553 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
13554 New.
13555 (readgram): Use them as replacement of inlined code, crule and
13556 crule1.
13557
f6d0f937
AD
135582002-06-11 Akim Demaille <akim@epita.fr>
13559
13560 * src/reader.c (grammar_end, grammar_symbol_append): New.
13561 (readgram): Use them.
13562 Make the use of `p' as local as possible.
13563
69078d4b
AD
135642002-06-10 Akim Demaille <akim@epita.fr>
13565
13566 GCJ's parser requires the tokens to be defined before the prologue.
13567
13568 * data/bison.simple: Output the token definition before the user's
13569 prologue.
13570 * tests/regression.at (Braces parsing, Duplicate string)
13571 (Mixing %token styles): Check the output from bison.
13572 (Early token definitions): New.
13573
5e424082
AD
135742002-06-10 Akim Demaille <akim@epita.fr>
13575
13576 * src/symtab.c (symbol_user_token_number_set): Don't complain when
13577 assigning twice the same user number to a token, so that we can
13578 use it in...
13579 * src/lex.c (lex): here.
13580 Also use `symbol_class_set' instead of hand written code.
13581 * src/reader.c (parse_assoc_decl): Likewise.
13582
44536b35
AD
135832002-06-10 Akim Demaille <akim@epita.fr>
13584
13585 * src/symtab.c, src/symtab.c (symbol_class_set)
13586 (symbol_user_token_number_set): New.
13587 * src/reader.c (parse_token_decl): Use them.
13588 Use a switch instead of ifs.
13589 Use a single argument.
13590
8b9f2372
AD
135912002-06-10 Akim Demaille <akim@epita.fr>
13592
13593 Remove `%thong' support as it is undocumented, unused, duplicates
13594 `%token's job, and creates useless e-mail traffic with people who
13595 want to know what it is, why it is undocumented, unused, and
13596 duplicates `%token's job.
13597
13598 * src/reader.c (parse_thong_decl): Remove.
13599 * src/options.c (option_table): Remove "thong".
13600 * src/lex.h (tok_thong): Remove.
13601
3ae2b51f
AD
136022002-06-10 Akim Demaille <akim@epita.fr>
13603
13604 * src/symtab.c, src/symtab.c (symbol_type_set)
13605 (symbol_precedence_set): New.
13606 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
13607 (value_components_used): Remove, unused.
13608
2f1afb73
AD
136092002-06-09 Akim Demaille <akim@epita.fr>
13610
13611 Move symbols handling code out of the reader.
13612
13613 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
13614 (axiom): Move to...
13615 * src/symtab.h, src/symtab.c: here.
13616
13617 * src/gram.c (start_symbol): Remove: use startsymbol->number.
13618 * src/reader.c (startval): Rename as...
13619 * src/symtab.h, src/symtab.c (startsymbol): this.
13620 * src/reader.c: Adjust.
13621
13622 * src/reader.c (symbol_check_defined, symbol_make_alias)
13623 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13624 (token_translations_init)
13625 Move to...
13626 * src/symtab.c: here.
13627 * src/reader.c (packsymbols): Move to...
13628 * src/symtab.h, src/symtab.c (symbols_pack): here.
13629 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
13630 argument.
13631
e9bca3ad
AD
136322002-06-03 Akim Demaille <akim@epita.fr>
13633
13634 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
13635 then statements.
13636
86eff183
AD
136372002-06-03 Akim Demaille <akim@epita.fr>
13638
13639 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
13640 structs with non literals.
13641 * src/scan-skel.l: never-interactive.
13642 * src/conflicts.c (enum conflict_resolution_e): No trailing
13643 comma.
13644 * src/getargs.c (usage): Split long literal strings.
13645 Reported by Hans Aberg.
13646
717be197
AD
136472002-05-28 Akim Demaille <akim@epita.fr>
13648
13649 * data/bison.c++: Use C++ ostreams.
13650 (cdebug_): New member.
13651
670ddffd
AD
136522002-05-28 Akim Demaille <akim@epita.fr>
13653
13654 * src/output.c (output_skeleton): Be sure to allocate enough room
13655 for `/' _and_ for `\0' in full_skeleton.
13656
769b430f
AD
136572002-05-28 Akim Demaille <akim@epita.fr>
13658
13659 * data/bison.c++: Catch up with bison.simple:
13660 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13661 and Paul Eggert <eggert@twinsun.com>: `error' handing.
13662 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
13663 and popping traces.
13664
7067cb36
PH
136652002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13666
13667 * src/output.c (output_skeleton): Put an explicit path in front of
13668 the skeleton file name, rather than relying on the -I directory,
13669 to partially alleviate effects of having a skeleton file lying around
13670 in the current directory.
769b430f 13671
4a713ec2
PH
136722002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13673
769b430f 13674 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
13675 obstack_printf should be obstack_fgrow1.
13676
b408954b
AD
136772002-05-26 Akim Demaille <akim@epita.fr>
13678
13679 * src/state.h (state_t): `solved_conflicts' is a new member.
13680 * src/LR0.c (new_state): Set it to 0.
13681 * src/conflicts.h, src/conflicts.c (print_conflicts)
13682 (free_conflicts, solve_conflicts): Rename as...
13683 (conflicts_print, conflicts_free, conflicts_solve): these.
13684 Adjust callers.
13685 * src/conflicts.c (enum conflict_resolution_e)
13686 (solved_conflicts_obstack): New, used by...
13687 (log_resolution): this.
13688 Adjust to attach the conflict resolution to each state.
13689 Complete the description with the precedence/associativity
13690 information.
13691 (resolve_sr_conflict): Adjust.
13692 * src/print.c (print_state): Output its solved_conflicts.
13693 * tests/conflicts.at (Unresolved SR Conflicts)
13694 (Solved SR Conflicts): Exercise --report=all.
13695
a49aecd5
AD
136962002-05-26 Akim Demaille <akim@epita.fr>
13697
13698 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13699 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13700 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
13701 (token_number_t, item_number_as_token_number)
13702 (token_number_as_item_number, muscle_insert_token_number_table):
13703 Rename as...
13704 (symbol_number_t, item_number_as_symbol_number)
13705 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
13706 these, since it is more appropriate.
13707
5504898e
AD
137082002-05-26 Akim Demaille <akim@epita.fr>
13709
13710 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
13711 `Error:' lines.
13712 * data/bison.simple (yystos) [YYDEBUG]: New.
13713 (yyparse) [YYDEBUG]: Display the symbols which are popped during
13714 error recovery.
13715 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
13716
ec3bc396
AD
137172002-05-25 Akim Demaille <akim@epita.fr>
13718
13719 * doc/bison.texinfo (Debugging): Split into...
13720 (Tracing): this new section, its former contents, and...
13721 (Understanding): this new section.
13722 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
13723 by...
13724 (report_flag): this.
13725 Adjust all dependencies.
13726 (report_args, report_types, report_argmatch): New.
13727 (usage, getargs): Report/support -r, --report.
13728 * src/options.h
13729 (struct option_table_struct): Rename as..,
13730 (struct option_table_s): this.
13731 Rename the `set_flag' member to `flag' to match with getopt_long's
13732 struct.
13733 * src/options.c (option_table): Split verbose into an entry for
13734 %verbose, and another for --verbose.
13735 Support --report/-r, so remove -r from the obsolete --raw.
13736 * src/print.c: Attach full item sets and lookaheads reports to
13737 report_flag instead of trace_flag.
13738 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
13739
78df8250
PE
137402002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13741 and Paul Eggert <eggert@twinsun.com>
769b430f 13742
78df8250
PE
13743 * data/bison.simple (yyparse): Correct error handling to conform to
13744 POSIX and yacc. Specifically, after syntax error is discovered,
13745 do not reduce further before shifting the error token.
13746 Clean up the code a bit by removing the labels yyerrdefault,
13747 yyerrhandle, yyerrpop.
13748 * NEWS: Document the above.
13749
c0c9ea05
PH
137502002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13751
13752 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
13753 type; it isn't always big enough, since it doesn't necessarily
13754 include non-terminals.
769b430f 13755 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
13756 the latter can be removed.
13757 (yy_token_number_type): Remove, only one use.
13758 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
13759 don't use TokenNumberType as element type.
769b430f 13760
c0c9ea05
PH
13761 * tests/regression.at: Modify expected output to agree with change
13762 to yyr1 and yytranslate.
769b430f 13763
6390a83f
FK
137642002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
13765
13766 * src/reader.c (parse_action): Use copy_character instead of
13767 obstack_1grow.
13768
db7c8e9a
AD
137692002-05-13 Akim Demaille <akim@epita.fr>
13770
13771 * tests/regression.at (Token definitions): Prototype yylex and
13772 yyerror.
13773
fcc61800
PH
137742002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13775
158c687b 13776 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
13777 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
13778 32-bit arithmetic.
13779 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
13780
5683e9b2
AD
137812002-05-07 Akim Demaille <akim@epita.fr>
13782
13783 * tests/synclines.at: Be sure to prototype yylex and yyerror to
13784 avoid GCC warnings.
13785
0c2d3f4c
AD
137862002-05-07 Akim Demaille <akim@epita.fr>
13787
13788 Kill GCC warnings.
13789
13790 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
13791 over the RHS of each rule.
13792 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
13793 * src/state.h (state_t): Member `nitems' is unsigned short.
13794 * src/LR0.c (get_state): Adjust.
13795 * src/reader.c (packgram): Likewise.
13796 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
13797 `Type'.
13798 (muscle_insert_int_table): Remove, unused.
13799 (prepare_rules): Remove `max'.
13800
1565b720
AD
138012002-05-06 Akim Demaille <akim@epita.fr>
13802
13803 * src/closure.c (print_firsts): Display of the symbol tags.
13804 (bitmatrix_print): Move to...
13805 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
13806 here.
13807 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
13808
cfaee611
AD
138092002-05-06 Akim Demaille <akim@epita.fr>
13810
13811 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
13812 hash_do_for_each.
13813
458be8e0
AD
138142002-05-06 Akim Demaille <akim@epita.fr>
13815
13816 * src/LR0.c (new_state, get_state): Instead of using the global
13817 `kernel_size' and `kernel_base', have two new arguments:
13818 `core_size' and `core'.
13819 Adjust callers.
13820
a900a624
AD
138212002-05-06 Akim Demaille <akim@epita.fr>
13822
13823 * src/reader.c (packgram): No longer end `ritem' with a 0
13824 sentinel: it is not used.
13825
d4e7d3a1
AD
138262002-05-05 Akim Demaille <akim@epita.fr>
13827
13828 New experimental feature: display the lookaheads in the report and
13829 graph.
13830
13831 * src/print (print_core): When --trace-flag, display the rules
13832 lookaheads.
13833 * src/print_graph.c (print_core): Likewise.
13834 Swap the arguments.
13835 Adjust caller.
13836
39ceb25b
AD
138372002-05-05 Akim Demaille <akim@epita.fr>
13838
13839 * tests/torture.at (Many lookaheads): New test.
13840
5372019f
AD
138412002-05-05 Akim Demaille <akim@epita.fr>
13842
13843 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
13844 (GENERATE_MUSCLE_INSERT_TABLE): this.
13845 (output_int_table, output_unsigned_int_table, output_short_table)
13846 (output_token_number_table, output_item_number_table): Replace with...
13847 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
13848 (muscle_insert_short_table, muscle_insert_token_number_table)
13849 (muscle_insert_item_number_table): these.
13850 Adjust all callers.
13851 (prepare_tokens): Don't free `translations', since...
13852 * src/reader.h, src/reader.c (grammar_free): do it.
13853 Move to...
13854 * src/gram.h, src/gram.c (grammar_free): here.
13855 * data/bison.simple, data/bison.c++: b4_token_number_max is now
13856 b4_translate_max.
13857
5df5f6d5
AD
138582002-05-05 Akim Demaille <akim@epita.fr>
13859
13860 * src/output.c (output_unsigned_int_table): New.
13861 (prepare_rules): `i' is unsigned.
13862 `prhs', `rline', `r2' are unsigned int.
13863 Rename muscle `rhs_number_max' as `rhs_max'.
13864 Output muscles `prhs_max', `rline_max', and `r2_max'.
13865 Free rline and r1.
13866 * data/bison.simple, data/bison.c++: Adjust to use these muscles
13867 to compute types instead of constant types.
13868 * tests/regression.at (Web2c Actions): Adjust.
13869
b87f8b21
AD
138702002-05-04 Akim Demaille <akim@epita.fr>
13871
13872 * src/symtab.h (SALIAS, SUNDEF): Rename as...
13873 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
13874 Adjust dependencies.
13875 * src/output.c (token_definitions_output): Be sure not to output a
13876 `#define 'a'' when fed with `%token 'a' "a"'.
13877 * tests/regression.at (Token definitions): New.
13878
8bb936e4
PE
138792002-05-03 Paul Eggert <eggert@twinsun.com>
13880
13881 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
13882 for K&R C.
13883
138842002-05-03 gettextize <bug-gnu-gettext@gnu.org>
13885
13886 * Makefile.am (SUBDIRS): Remove intl.
13887 (EXTRA_DIST): Add config/config.rpath.
13888
53c71a12
AD
138892002-05-03 Akim Demaille <akim@epita.fr>
13890
13891 * data/bison.simple (m4_if): Don't output empty enums.
13892 And actually, output valid enum definitions :(.
13893
289dd0cf
AD
138942002-05-03 Akim Demaille <akim@epita.fr>
13895
13896 * configure.bat: Remove, completely obsolete.
13897 * Makefile.am (EXTRA_DIST): Adjust.
13898 Don't distribute config.rpath...
13899 * config/Makefile.am (EXTRA_DIST): Do it.
13900
db85e524
AD
139012002-05-03 Akim Demaille <akim@epita.fr>
13902
13903 * configure.in (GETTEXT_VERSION): New.
13904 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
13905
83ccf991
AD
139062002-05-03 Akim Demaille <akim@epita.fr>
13907
13908 * data/bison.simple (b4_token_enum): New.
13909 (b4_token_defines): Use it to output tokens both as #define and
13910 enums.
13911 Suggested by Paul Eggert.
13912 * src/output.c (token_definitions_output): Don't output spurious
13913 white spaces.
13914
1f418995
AD
139152002-05-03 Akim Demaille <akim@epita.fr>
13916
13917 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
13918
45119f04
RA
139192002-05-02 Robert Anisko <robert@lrde.epita.fr>
13920
13921 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
13922 Update the stack class, give a try to deque as the default container.
13923
b2d52318
AD
139242002-05-02 Akim Demaille <akim@epita.fr>
13925
13926 * data/bison.simple (yyparse): Do not implement @$ = @1.
13927 (YYLLOC_DEFAULT): Adjust to do it.
13928 * doc/bison.texinfo (Location Default Action): Fix.
13929
3a8b4109
AD
139302002-05-02 Akim Demaille <akim@epita.fr>
13931
13932 * src/reader.c (parse_braces): Merge into...
13933 (parse_action): this.
13934
84614e13
AD
139352002-05-02 Akim Demaille <akim@epita.fr>
13936
13937 * configure.in (ALL_LINGUAS): Remove.
13938 * po/LINGUAS, hr.po: New.
13939
fdbcd8e2
AD
139402002-05-02 Akim Demaille <akim@epita.fr>
13941
13942 Remove the so called hairy (semantic) parsers.
13943
13944 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
13945 * src/gram.h, src/gram.c (semantic_parser): Remove.
13946 (rule_t): Remove the guard and guard_line members.
13947 * src/lex.h (token_t): remove tok_guard.
13948 * src/options.c (option_table): Remove %guard and %semantic_parser
13949 support.
13950 * src/output.c, src/output.h (guards_output): Remove.
13951 (prepare): Adjust.
13952 (token_definitions_output): Don't output the `T'
13953 tokens (???).
13954 (output_skeleton): Don't output the guards.
13955 * src/files.c, src/files.c (attrsfile): Remove.
13956 * src/reader.c (symbol_list): Remove the guard and guard_line
13957 members.
13958 Adjust dependencies.
13959 (parse_guard): Remove.
13960 * data/bison.hairy: Remove.
13961 * doc/bison.texinfo (Environment Variables): Remove occurrences of
13962 BISON_HAIRY.
13963
82b6cb3f
AD
139642002-05-02 Akim Demaille <akim@epita.fr>
13965
13966 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
13967 (parse_guard): Rename the formal argument `stack_offset' as
13968 `rule_length', which is more readable.
13969 Adjust callers.
13970 (copy_at, copy_dollar): Instead of outputting the hard coded
13971 values of $$, $n and so forth, output invocation to b4_lhs_value,
13972 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
13973 Note: this patch partially drops `semantic-parser' support: it
13974 always does `rule_length - n', where semantic parsers ought to
13975 always use `-n'.
82b6cb3f
AD
13976 * data/bison.simple, data/bison.c++ (b4_lhs_value)
13977 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
13978
6cbfbcc5
AD
139792002-05-02 Akim Demaille <akim@epita.fr>
13980
13981 * configure.in (AC_INIT): Bump to 1.49b.
13982 (AM_INIT_AUTOMAKE): Short invocation.
13983
b8548114
AD
139842002-05-02 Akim Demaille <akim@epita.fr>
13985
13986 Version 1.49a.
13987
c20cd1fa
AD
139882002-05-01 Akim Demaille <akim@epita.fr>
13989
13990 * src/skeleton.h: Remove.
13991
8a9566d4
AD
139922002-05-01 Akim Demaille <akim@epita.fr>
13993
13994 * src/skeleton.h: Fix the #endif.
13995 Reported by Magnus Fromreide.
13996
8c6d399a
PE
139972002-04-26 Paul Eggert <eggert@twinsun.com>
13998
13999 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
14000 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 14001 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 14002
2b7ed18a
RA
140032002-04-25 Robert Anisko <robert@lrde.epita.fr>
14004
14005 * src/scan-skel.l: Postprocess quadrigraphs.
14006
14007 * src/reader.c (copy_character): New function, used to output
14008 single characters while replacing `[' and `]' with quadrigraphs, to
14009 avoid troubles with M4 quotes.
14010 (copy_comment): Output characters with copy_character.
14011 (read_additionnal_code): Likewise.
14012 (copy_string2): Likewise.
14013 (copy_definition): Likewise.
14014
14015 * tests/calc.at: Exercise M4 quoting.
14016
34a89c50
AD
140172002-04-25 Akim Demaille <akim@epita.fr>
14018
14019 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
14020 between `!' and the command.
14021 Reported by Paul Eggert.
14022
0dd1580a
RA
140232002-04-24 Robert Anisko <robert@lrde.epita.fr>
14024
14025 * tests/calc.at: Exercise prologue splitting.
14026
14027 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
14028 `b4_post_prologue' instead of `b4_prologue'.
14029
14030 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
14031 muscles.
14032 (output): Free pre_prologue_obstack and post_prologue_obstack.
14033 * src/files.h, src/files.c (attrs_obstack): Remove.
14034 (pre_prologue_obstack, post_prologue_obstack): New.
14035 * src/reader.c (copy_definition): Add a parameter to specify the
14036 obstack to fill, instead of using attrs_obstack unconditionally.
14037 (read_declarations): Pass pre_prologue_obstack to copy_definition if
14038 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
14039
83c1796f
PE
140402002-04-23 Paul Eggert <eggert@twinsun.com>
14041
14042 * data/bison.simple: Remove unnecessary commentary and white
14043 space differences from 1_29-branch.
14044 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
14045
14046 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
14047 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
14048 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
14049 constructors or destructors.
14050
14051 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
14052
1207eeac
AD
140532002-04-23 Akim Demaille <akim@epita.fr>
14054
14055 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
14056 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
14057 location with columns.
14058 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
14059 All reported by Paul Eggert.
14060
78ab8f67
AD
140612002-04-22 Akim Demaille <akim@epita.fr>
14062
14063 * src/reduce.c (dump_grammar): Move to...
14064 * src/gram.h, src/gram.c (grammar_dump): here.
14065 Be sure to separate long item numbers.
14066 Don't read the members of a rule's prec if its nil.
14067
133c20e2
AD
140682002-04-22 Akim Demaille <akim@epita.fr>
14069
14070 * src/output.c (table_size, table_grow): New.
14071 (MAXTABLE): Remove, replace uses with table_size.
14072 (pack_vector): Instead of dying when the table is too big, grow it.
14073
9515e8a7
AD
140742002-04-22 Akim Demaille <akim@epita.fr>
14075
14076 * data/bison.simple (yyr1): Its type is that of a token number.
14077 * data/bison.c++ (r1_): Likewise.
14078 * tests/regression.at (Web2c Actions): Adjust.
14079
23c5a174
AD
140802002-04-22 Akim Demaille <akim@epita.fr>
14081
14082 * src/reader.c (token_translations_init): 256 is now the default
14083 value for the error token, i.e., it will be assigned another
14084 number if the user assigned 256 to one of her tokens.
14085 (reader): Don't force 256 to error.
14086 * doc/bison.texinfo (Symbols): Adjust.
14087 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
14088 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
14089 etc. instead of 10, 20, 30 (which was used to `jump' over error
14090 (256) and undefined (2)).
14091
5fbb0954
AD
140922002-04-22 Akim Demaille <akim@epita.fr>
14093
14094 Propagate more token_number_t.
14095
14096 * src/gram.h (token_number_as_item_number)
14097 (item_number_as_token_number): New.
14098 * src/output.c (GENERATE_OUTPUT_TABLE): New.
14099 Use it to create output_item_number_table and
14100 output_token_number_table.
14101 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14102 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
14103 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
14104 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
14105
4f940944
AD
141062002-04-22 Akim Demaille <akim@epita.fr>
14107
14108 * src/output.h, src/output.c (get_lines_number): Remove.
14109
3ded9a63
AD
141102002-04-19 Akim Demaille <akim@epita.fr>
14111
14112 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
14113 as Lex/Flex'.
14114 (Debugging): More details about enabling the debugging features.
14115 (Table of Symbols): Describe $$, $n, @$, and @n.
14116 Suggested by Tim Josling.
14117
e0c471a9
AD
141182002-04-19 Akim Demaille <akim@epita.fr>
14119
14120 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
14121
fecc10cd
AD
141222002-04-10 Akim Demaille <akim@epita.fr>
14123
14124 * src/system.h: Rely on HAVE_LIMITS_H.
14125 Suggested by Paul Eggert.
14126
51dec47b
AD
141272002-04-09 Akim Demaille <akim@epita.fr>
14128
14129 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
14130 full stderr, and strip it according to the bison options, instead
14131 of composing the error message from different bits.
14132 This makes it easier to check for several error messages.
14133 Adjust all the invocations.
14134 Add an invocation exercising the error token.
14135 Add an invocation demonstrating a stupid error message.
14136 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
14137 Adjust the tests.
14138 Error message are for stderr, not stdout.
14139
007a50a4
AD
141402002-04-09 Akim Demaille <akim@epita.fr>
14141
14142 * src/gram.h, src/gram.c (error_token_number): Remove, use
14143 errtoken->number.
14144 * src/reader.c (reader): Don't specify the user token number (2)
14145 for $undefined, as it uselessly prevents using it.
14146 * src/gram.h (token_number_t): Move to...
14147 * src/symtab.h: here.
14148 (state_t.number): Is a token_number_t.
14149 * src/print.c, src/reader.c: Use undeftoken->number instead of
14150 hard coded 2.
14151 (Even though this 2 is not the same as above: the number of the
14152 undeftoken remains being 2, it is its user token number which
14153 might not be 2).
14154 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
14155 `user_token_number_max'.
14156 Output `undef_token_number'.
14157 * data/bison.simple, data/bison.c++: Use them.
14158 Be sure to map invalid yylex return values to
14159 `undef_token_number'. This saves us from gratuitous SEGV.
14160
14161 * tests/conflicts.at (Solved SR Conflicts)
14162 (Unresolved SR Conflicts): Adjust.
14163 * tests/regression.at (Web2c Actions): Adjust.
14164
06446ccf
AD
141652002-04-08 Akim Demaille <akim@epita.fr>
14166
14167 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
14168 Adding #line.
14169 Remove the duplicate `typedefs'.
14170 (RhsNumberType): Fix the declaration and various other typos.
14171 Use __ofile__.
14172 * data/bison.simple: Use __ofile__.
14173 * src/scan-skel.l: Handle __ofile__.
14174
62a3e4f0
AD
141752002-04-08 Akim Demaille <akim@epita.fr>
14176
14177 * src/gram.h (item_number_t): New, the type of item numbers in
14178 RITEM. Note that it must be able to code symbol numbers as
14179 positive number, and the negation of rule numbers as negative
14180 numbers.
14181 Adjust all dependencies (pretty many).
14182 * src/reduce.c (rule): Remove this `short *' pointer: use
14183 item_number_t.
14184 * src/system.h (MINSHORT, MAXSHORT): Remove.
14185 Include `limits.h'.
14186 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
14187 (shortcpy): Remove.
14188 (MAXTABLE): Move to...
14189 * src/output.c (MAXTABLE): here.
14190 (prepare_rules): Use output_int_table to output rhs.
14191 * data/bison.simple, data/bison.c++: Adjust.
14192 * tests/torture.at (Big triangle): Move the limit from 254 to
14193 500.
14194 * tests/regression.at (Web2c Actions): Ajust.
14195
14196 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
14197 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
14198 passes, but produces negative #line number, once fixed, GCC is
14199 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
14200 C), it passes.
14201 * src/state.h (state_h): Code input lines on ints, not shorts.
14202
bb88b0fc
AD
142032002-04-08 Akim Demaille <akim@epita.fr>
14204
14205 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
14206 and then the grammar.
14207
9a636f47
AD
142082002-04-08 Akim Demaille <akim@epita.fr>
14209
14210 * src/system.h: No longer using strndup.
14211
680e8701
AD
142122002-04-07 Akim Demaille <akim@epita.fr>
14213
14214 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
14215 * src/output.c (output_table_data): Return the longest number.
14216 (prepare_tokens): Output `token_number_max').
14217 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
14218 New.
14219 Use them to define yy_token_number_type/TokenNumberType.
14220 Use this type for yytranslate.
14221 * tests/torture.at (Big triangle): Push the limit from 124 to
14222 253.
14223 * tests/regression.at (Web2c Actions): Adjust.
14224
817e9f41
AD
142252002-04-07 Akim Demaille <akim@epita.fr>
14226
14227 * tests/torture.at (Big triangle): New.
14228 (GNU AWK Grammar, GNU Cim Grammar): Move to...
14229 * tests/existing.at: here.
14230
5123689b
AD
142312002-04-07 Akim Demaille <akim@epita.fr>
14232
14233 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
14234 nritems.
14235 Adjust dependencies.
14236
f3849179
AD
142372002-04-07 Akim Demaille <akim@epita.fr>
14238
14239 * src/reader.c: Normalize increments to prefix form.
14240
bd02036a
AD
142412002-04-07 Akim Demaille <akim@epita.fr>
14242
14243 * src/reader.c, symtab.c: Remove debugging code.
14244
db8837cb
AD
142452002-04-07 Akim Demaille <akim@epita.fr>
14246
14247 Rename all the `bucket's as `symbol_t'.
14248
14249 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
14250 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
14251 * src/symtab.c, src/symtab.h (bucket): Rename as...
14252 (symbol_t): this.
14253 (symbol_list_new, bucket_check_defined, bucket_make_alias)
14254 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
14255 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14256 (buckets_new, buckets_free, buckets_do): Rename as...
14257 (symbol_list_new, symbol_check_defined, symbol_make_alias)
14258 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
14259 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
14260 (symbols_new, symbols_free, symbols_do): these.
14261
72a23c97
AD
142622002-04-07 Akim Demaille <akim@epita.fr>
14263
14264 Use lib/hash for the symbol table.
14265
14266 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
14267 EOF.
14268 * src/lex.c (lex): Set the `number' member of new terminals.
14269 * src/reader.c (bucket_check_defined, bucket_make_alias)
14270 (bucket_check_alias_consistence, bucket_translation): New.
14271 (reader, grammar_free, readgram, token_translations_init)
14272 (packsymbols): Adjust.
14273 (reader): Number the predefined tokens.
14274 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
14275 for predefined tokens.
14276 * src/symtab.h (bucket): Remove all the hash table related
14277 members.
14278 * src/symtab.c (symtab): Replace by...
14279 (bucket_table): this.
14280 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14281 (buckets_new, buckets_do): New.
14282
280a38c3
AD
142832002-04-07 Akim Demaille <akim@epita.fr>
14284
14285 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
14286 (start_symbol, max_user_token_number, semantic_parser)
14287 (error_token_number): Initialize.
14288 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
14289 Initialize.
14290 (reader): Don't.
14291 (errtoken, eoftoken, undeftoken, axiom): Extern.
14292
03b31c0c
AD
142932002-04-07 Akim Demaille <akim@epita.fr>
14294
14295 * src/gram.h (rule_s): prec and precsym are now pointers
14296 to the bucket giving the priority/associativity.
14297 Member `associativity' removed: useless.
14298 * src/reduce.c, src/conflicts.c: Adjust.
14299
8b3df748
AD
143002002-04-07 Akim Demaille <akim@epita.fr>
14301
14302 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
14303 Properly escape the symbols' TAG when outputting them.
14304
e601aa1d
AD
143052002-04-07 Akim Demaille <akim@epita.fr>
14306
14307 * src/lalr.h (LA): Is a bitsetv, not bitset*.
14308
b0299a2e
AD
143092002-04-07 Akim Demaille <akim@epita.fr>
14310
14311 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
14312 (LArule): this, which is an array to rule_t*.
14313 * src/print.c, src/conflicts.c: Adjust.
14314
d7e1f00c
AD
143152002-04-07 Akim Demaille <akim@epita.fr>
14316
14317 * src/gram.h (rule_t): Rename `number' as `user_number'.
14318 `number' is a new member.
14319 Adjust dependencies.
14320 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
14321
cc9305dd
AD
143222002-04-07 Akim Demaille <akim@epita.fr>
14323
14324 As a result of the previous patch, it is no longer needed
14325 to reorder ritem itself.
14326
14327 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
14328
b0940840
AD
143292002-04-07 Akim Demaille <akim@epita.fr>
14330
14331 Be sure never to walk through RITEMS, but use only data related to
14332 the rules themselves. RITEMS should be banished.
14333
14334 * src/output.c (output_token_translations): Rename as...
14335 (prepare_tokens): this.
14336 In addition to `translate', prepare the muscles `tname' and
14337 `toknum', which were handled by...
14338 (output_rule_data): this.
14339 Remove, and move the remainder of its outputs into...
14340 (prepare_rules): this new routines, which also merges content from
14341 (output_gram): this.
14342 (prepare_rules): Be sure never to walk through RITEMS.
14343 (output_stos): Rename as...
14344 (prepare_stos): this.
14345 (output): Always invoke prepare_states, after all, just don't use it
14346 in the output if you don't need it.
14347
643a5994
AD
143482002-04-07 Akim Demaille <akim@epita.fr>
14349
14350 * src/LR0.c (new_state): Display `nstates' as the name of the
14351 newly created state.
14352 Adjust to initialize first_state and last_state if needed.
14353 Be sure to distinguish the initial from the final state.
14354 (new_states): Create the itemset of the initial state, and use
14355 new_state.
14356 * src/closure.c (closure): Now that the initial state has its
14357 items properly set, there is no need for a special case when
14358 creating `ruleset'.
14359
14360 As a result, now the rule 0, reducing to $axiom, is visible in the
14361 outputs. Adjust the test suite.
14362
14363 * tests/conflicts.at (Solved SR Conflicts)
14364 (Unresolved SR Conflicts): Adjust.
14365 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
14366 * tests/conflicts.at (S/R in initial): New.
14367
b4c4ccc2
AD
143682002-04-07 Akim Demaille <akim@epita.fr>
14369
14370 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
14371 the RHS of the rules.
14372 * src/output.c (output_gram): Likewise.
14373
bba97eb2
AD
143742002-04-07 Akim Demaille <akim@epita.fr>
14375
14376 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
14377 bucket.
14378 Adjust all dependencies.
14379 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
14380 `number' of the buckets too.
14381 * src/gram.h: Include `symtab.h'.
14382 (associativity): Move to...
14383 * src/symtab.h: here.
14384 No longer include `gram.h'.
14385
c3b407f4
AD
143862002-04-07 Akim Demaille <akim@epita.fr>
14387
14388 * src/gram.h, src/gram.c (rules_rhs_length): New.
14389 (ritem_longest_rhs): Use it.
14390 * src/gram.h (rule_t): `number' is a new member.
14391 * src/reader.c (packgram): Set it.
14392 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
14393 the end of `rules', and count them out of `nrules'.
14394 (reduce_output, dump_grammar): Adjust.
14395 * src/print.c (print_grammar): It is no longer needed to check for
14396 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
14397 * tests/reduce.at (Reduced Automaton): New test.
14398
11652ab3
AD
143992002-04-07 Akim Demaille <akim@epita.fr>
14400
14401 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
14402 lacking `+ 1' to nrules, Bison reported as useless a token if it
14403 was used solely to set the precedence of the last rule...
14404
26b23c1a
AD
144052002-04-07 Akim Demaille <akim@epita.fr>
14406
14407 * data/bison.c++, data/bison.simple: Don't output the current file
14408 name in #line, to avoid useless diffs between two identical
14409 outputs under different names.
14410
18bcecb0
AD
144112002-04-07 Akim Demaille <akim@epita.fr>
14412
14413 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
14414 Normalize loops to using `< nrules + 1', not `<= nrules'.
14415
fa770c86
AD
144162002-04-07 Akim Demaille <akim@epita.fr>
14417
14418 * TODO: Update.
14419
d9b739c3
AD
144202002-04-07 Akim Demaille <akim@epita.fr>
14421
14422 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
14423 bucket.value as bucket.number.
14424
99013900
AD
144252002-04-07 Akim Demaille <akim@epita.fr>
14426
14427 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
14428 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14429 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
14430 RHS, instead of being an index in RITEMS.
14431
e966383b
PE
144322002-04-04 Paul Eggert <eggert@twinsun.com>
14433
14434 * doc/bison.texinfo: Update copyright date.
14435 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
14436 (Symbols): Warn about running Bison in one character set,
14437 but compiling and/or running in an incompatible one.
14438 Warn about character code 256, too.
14439
144402002-04-03 Paul Eggert <eggert@twinsun.com>
14441
14442 * src/bison.data (YYSTACK_ALLOC): Depend on whether
14443 YYERROR_VERBOSE is nonzero, not whether it is defined.
14444
14445 Merge changes from bison-1_29-branch.
c307773e 14446
8d6c48b9
PE
144472002-03-20 Paul Eggert <eggert@twinsun.com>
14448
14449 Merge fixes from Debian bison_1.34-1.diff.
14450
14451 * configure.in (AC_PREREQ): 2.53.
14452
e53c6322
AD
144532002-03-20 Akim Demaille <akim@epita.fr>
14454
14455 * src/conflicts.c (log_resolution): Argument `resolution' is const.
14456
9ffbeca7
PE
144572002-03-19 Paul Eggert <eggert@twinsun.com>
14458
21db0b2a
PE
14459 * src/bison.simple (YYCOPY): New macro.
14460 (YYSTACK_RELOCATE): Use it.
14461 Remove Type arg; no longer needed. All callers changed.
14462 (yymemcpy): Remove; no longer needed.
14463
9ffbeca7
PE
14464 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
14465 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14466
642cb8f8
AD
144672002-03-19 Akim Demaille <akim@epita.fr>
14468
14469 Test and fix the #line outputs.
14470
14471 * tests/atlocal.at (GCC): New.
14472 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 14473 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
14474 (Action synch line, Epilogue synch line): New tests.
14475 * src/reader.c (parse_union_decl): Define the muscle stype_line.
14476 * data/bison.simple, data/bison.c++: Use it.
14477
3c31a486
AD
144782002-03-19 Akim Demaille <akim@epita.fr>
14479
14480 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
14481 (Solved SR Conflicts, %expect not enough, %expect right)
14482 (%expect too much): Move to...
14483 * tests/conflicts.at: this new file.
14484
0d8bed56
AD
144852002-03-19 Akim Demaille <akim@epita.fr>
14486
14487 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14488 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
14489 that we can move to enums for instance.
14490 * src/output.c (token_definitions_output): Output a list of
14491 `token-name, token-number' instead of the #define.
14492 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
14493
9208d17f
AD
144942002-03-14 Akim Demaille <akim@epita.fr>
14495
14496 Use Gettext 0.11.1.
14497
af27eacb
RA
144982002-03-09 Robert Anisko <robert@lrde.epita.fr>
14499
14500 * data/bison.c++: Make the user able to add members to the generated
14501 parser by subclassing.
14502
9101a310
RA
145032002-03-05 Robert Anisko <robert@lrde.epita.fr>
14504
14505 * src/reader.c (read_additionnal_code): `c' should be an integer, not
14506 a character.
14507 Reported by Nicolas Tisserand and Nicolas Burrus.
14508
fff9bf0b
RA
145092002-03-04 Robert Anisko <robert@lrde.epita.fr>
14510
14511 * src/reader.c: Warn about lacking semi-colons, do not complain.
14512
64dba31e
RA
145132002-03-04 Robert Anisko <robert@lrde.epita.fr>
14514
14515 * data/bison.c++: Remove a debug line.
14516
374f5a14
RA
145172002-03-04 Robert Anisko <robert@lrde.epita.fr>
14518
14519 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
14520 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
14521 provide a default implementation.
14522
bfcf1f3a
AD
145232002-03-04 Akim Demaille <akim@epita.fr>
14524
14525 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
14526 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
14527 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
14528 * tests/semantic.at (Parsing Guards): Similarly.
14529 * src/reader.at (readgram): Complain if the last rule is not ended
14530 with a semi-colon.
14531
65ccf9fc
AD
145322002-03-04 Akim Demaille <akim@epita.fr>
14533
14534 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
14535 * src/closure.c: here.
14536 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
14537 RTC.
14538 * src/warshall.h, src/warshall.c: Remove.
14539 * tests/sets.at (Broken Closure): Adjust.
14540
d0039cbc
AD
145412002-03-04 Akim Demaille <akim@epita.fr>
14542
14543 * src/output.c (output_skeleton): tempdir is const.
14544 bytes_read is unused.
14545
345cea78
AD
145462002-03-04 Akim Demaille <akim@epita.fr>
14547
14548 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14549 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
14550 Update.
14551 From Michael Hayes.
14552
564801f7
AD
145532002-03-04 Akim Demaille <akim@epita.fr>
14554
14555 * src/closure.c (closure): `r' is unused.
14556
e5352bc7
AD
145572002-03-04 Akim Demaille <akim@epita.fr>
14558
14559 * tests/sets.at (Broken Closure): Add the ending `;'.
14560 * src/reader.at (readgram): Complain if a rule is not ended with a
14561 semi-colon.
14562
914feea9
AD
145632002-03-04 Akim Demaille <akim@epita.fr>
14564
14565 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
14566 (count_sr_conflicts): Use bitset_count.
14567 * src/reduce.c (inaccessable_symbols): Ditto.
14568 (bits_size): Remove.
14569 * src/warshall.h, src/warshall.c: Convert to bitsetv.
14570
f0250de6
AD
145712002-03-04 Akim Demaille <akim@epita.fr>
14572
14573 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
14574 * src/reduce.c: Remove the `bitset_zero's following the
14575 `bitset_create's, as now it is performed by the latter.
14576
ef017502
AD
145772002-03-04 Akim Demaille <akim@epita.fr>
14578
14579 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
14580 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
14581 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
14582 latest sources from Michael.
14583
76514394
AD
145842002-03-04 Akim Demaille <akim@epita.fr>
14585
14586 * src/output.c (output): Don't free the grammar.
14587 * src/reader.c (grammar_free): New.
14588 * src/main.c (main): Call it and don't free symtab here.
14589
55024580
AD
145902002-03-04 Akim Demaille <akim@epita.fr>
14591
14592 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
14593 before returning.
14594 Reported by Benoit Perrot.
14595
f9abaa2c
AD
145962002-03-04 Akim Demaille <akim@epita.fr>
14597
14598 Use bitset operations when possible, not loops over bits.
14599
14600 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
14601 bitset_or.
14602 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
14603 * src/reduce.c (useless_nonterminals): Formatting changes.
14604 * src/warshall.c (TC): Use bitset_or.
14605
0e721e75
AD
146062002-03-04 Akim Demaille <akim@epita.fr>
14607
14608 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
14609 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
14610 Ditto.
14611
0fb1ffb1
AD
146122002-03-04 Akim Demaille <akim@epita.fr>
14613
14614 * src/lalr.c (F): Now a bitset*.
14615 Adjust all dependencies.
14616
b86796bf
AD
146172002-03-04 Akim Demaille <akim@epita.fr>
14618
14619 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
14620 Adjust all dependencies.
14621
602bbf31
AD
146222002-03-04 Akim Demaille <akim@epita.fr>
14623
14624 * src/L0.c, src/LR0.h (nstates): Be size_t.
14625 Adjust comparisons (signed vs unsigned).
14626 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
14627 bitset*.
14628 Adjust all dependencies.
14629
d8a0245c
AD
146302002-03-04 Akim Demaille <akim@epita.fr>
14631
14632 * src/closure.c (firsts): Now, also a bitset.
14633 Adjust all dependencies.
14634 (varsetsize): Remove, now unused.
14635 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
14636
34ba9743
AD
146372002-03-04 Akim Demaille <akim@epita.fr>
14638
14639 * src/print.c: Convert to use bitset.h, not hand coded iterations
14640 over ints.
14641
ed86e78c
AD
146422002-03-04 Akim Demaille <akim@epita.fr>
14643
14644 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
14645
dfdb1797
AD
146462002-03-04 Akim Demaille <akim@epita.fr>
14647
14648 * src/closure.c (ruleset): Be a bitset.
14649 (rulesetsize): Remove.
14650
7086e707
AD
146512002-03-04 Akim Demaille <akim@epita.fr>
14652
14653 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14654 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
14655 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
14656 * src/closure.c (fderives): Be an array of bitsets.
14657
98254360
RA
146582002-02-28 Robert Anisko <robert@lrde.epita.fr>
14659
14660 * data/bison.c++: Merge the two generated headers. Insert a copyright
14661 notice in each output file.
14662
a75c057f
AD
146632002-02-28 Akim Demaille <akim@epita.fr>
14664
14665 * data/bison.c++: Copy the prologue of bison.simple to fetch
14666 useful M4 definitions, such as b4_header_guard.
14667
06b00abc
AD
146682002-02-25 Akim Demaille <akim@epita.fr>
14669
14670 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
14671 translator friendly scheme for the bgr
14672 copyright notice.
06b00abc 14673
70e7d534
AD
146742002-02-25 Akim Demaille <akim@epita.fr>
14675
14676 * src/output.c (header_output): Remove, now handled completely via
14677 M4.
14678
abe017f6
AD
146792002-02-25 Akim Demaille <akim@epita.fr>
14680
14681 * m4/m4.m4: New, from CVS Autoconf.
14682 * configure.in: Invoke it.
14683 * src/output.c (output_skeleton): Use its result instead of the
14684 hard coded name.
14685
381fb12e
AD
146862002-02-25 Akim Demaille <akim@epita.fr>
14687
14688 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
14689 Fileutils 4.1.5.
14690 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
14691 * src/output.c (output_skeleton): Use mkstemp to create a real
14692 temporary file.
14693 Move the filling of `skeleton' and its muscle to...
14694 (prepare): here.
14695 (output): Move the definition of the prologue muscle to...
14696 (prepare): here.
14697 * src/system.h (DEFAULT_TMPDIR): New.
14698
6f38107f
PE
146992002-02-14 Paul Eggert <eggert@twinsun.com>
14700
14701 Remove the support for C++ namespace cleanliness; it was
14702 causing more problems than it was curing, since it didn't work
14703 properly on some nonstandard C++ compilers. This can wait
14704 for a proper C++ parser.
14705
14706 * NEWS: Document this.
14707 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
14708 of C++, as it's treated like C now.
14709 * src/bison.simple (YYSTD): Remove.
14710 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
14711 Treat C++ just like Standard C instead of trying to support
14712 namespace cleanliness.
14713
80cce3da
AD
147142002-02-14 Akim Demaille <akim@epita.fr>
14715
14716 * tests/regression.at (else): Adjust to Andreas' change.
14717
842e8679
AD
147182002-02-14 Akim Demaille <akim@epita.fr>
14719
14720 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
14721
4bda3f10
AD
147222002-02-13 Andreas Schwab <schwab@suse.de>
14723
14724 * src/output.c (output_rule_data): Don't output NULL, it might
14725 not be defined yet.
14726
4162fa07 147272002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 14728
4162fa07
RA
14729 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
14730 (Copyright notice): Update.
b418ecd8 14731
bd16a5dc
AD
147322002-02-11 Akim Demaille <akim@epita.fr>
14733
14734 * tests/regression.at (%nonassoc and eof): Don't include
14735 nonportable headers.
14736
8d69a1a3
RA
147372002-02-08 Robert Anisko <robert@lrde.epita.fr>
14738
14739 * data/bison.c++: Correct error recovery. Make the user able to
14740 initialize the starting location.
14741
9b2d0677
AD
147422002-02-07 Akim Demaille <akim@epita.fr>
14743
14744 * tests/input.at: New.
14745
69e2658b
RA
147462002-02-07 Robert Anisko <robert@lrde.epita.fr>
14747
14748 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 14749 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
14750 directives around tables only needed for debugging.
14751
4aacc3a7
RA
147522002-02-07 Robert Anisko <robert@lrde.epita.fr>
14753
14754 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
14755 C++ parsers.
14756 (yy::b4_name::parse): Use print_.
14757
762a801e
RA
147582002-02-07 Robert Anisko <robert@lrde.epita.fr>
14759
14760 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
14761
4bb2bc3f
RA
147622002-02-07 Robert Anisko <robert@lrde.epita.fr>
14763
14764 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
14765 C++ parsers.
14766 (yy::b4_name::parse): Build verbose error messages, and use error_.
14767
6b45a3ca
RA
147682002-02-06 Robert Anisko <robert@lrde.epita.fr>
14769
14770 * data/bison.c++: Fix m4 quoting in comments.
14771
50997c6e
RA
147722002-02-06 Robert Anisko <robert@lrde.epita.fr>
14773
14774 * data/bison.c++: Adjust the parser code. Fix some muscles that were
14775 not expanded by m4.
14776
3f3eed27
AD
147772002-02-05 Akim Demaille <akim@epita.fr>
14778
14779 * data/bison.c++: Adjust to the M4 back end.
14780 More is certainly needed.
14781
be2a1a68
AD
147822002-02-05 Akim Demaille <akim@epita.fr>
14783
14784 Give a try to M4 as a back end.
14785
14786 * lib/readpipe.c: New, from wdiff.
14787 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
14788 BISON_HAIRY.
14789 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
14790 specific values. Now it is m4 that performs the lookup.
14791 * src/parse-skel.y: Remove.
14792 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
14793 * src/output.c (actions_output, guards_output)
14794 (token_definitions_output): No longer keeps track of the output
14795 line number, hence remove the second argument.
14796 (guards_output): Check against the guard member of a rule, not the
14797 action member.
14798 Adjust callers.
14799 (output_skeleton): Don't look for the skeleton location, let m4 do
14800 that.
14801 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
14802 file will be used.
14803 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
14804 (prepare): Given that for the time being changesyntax is not
14805 usable in M4, rename the muscles using `-' to `_'.
14806 Define `defines_flag', `output_parser_name' and `output_header_name'.
14807 * src/output.h (actions_output, guards_output)
14808 (token_definitions_output): Adjust prototypes.
14809 * src/scan-skel.l: Instead of scanning the skeletons, it now
14810 processes the output of m4: `__oline__' and `#output'.
14811 * data/bison.simple: Adjust to be used by M4(sugar).
14812 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
14813 to date.
14814 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
14815 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
14816 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
14817 shamelessly stolen from CVS Autoconf.
14818
beda758b
AD
148192002-02-05 Akim Demaille <akim@epita.fr>
14820
14821 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
14822 * configure.in: Check for the declarations of free and malloc.
14823 * src/muscle_tab.c: Adjust.
14824
5ece6d43
AD
148252002-02-05 Akim Demaille <akim@epita.fr>
14826
14827 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
14828 which have no values.
14829
5bb18f9a
AD
148302002-02-05 Akim Demaille <akim@epita.fr>
14831
14832 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
14833 * data/: here.
14834
894dd62e
PE
148352002-01-29 Paul Eggert <eggert@twinsun.com>
14836
14837 * src/bison.simple (YYSIZE_T): Do not define merely because
14838 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
14839 On some platforms, <alloca.h> does not declare YYSTD (size_t).
14840
82841af7
AD
148412002-01-27 Akim Demaille <akim@epita.fr>
14842
14843 Fix `%nonassoc and eof'.
14844
14845 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
14846 which were not properly copied! Replace
14847 memcpy (res->errs, src->errs, src->nerrs);
14848 with
14849 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
14850 !!!
14851 * tests/regression.at (%nonassoc and eof): Adjust to newest
14852 Autotest: `.' is not in the PATH.
14853
318b76e9
AD
148542002-01-27 Akim Demaille <akim@epita.fr>
14855
14856 * tests/sets.at (AT_EXTRACT_SETS): New.
14857 (Nullable): Use it.
14858 (Firsts): New.
14859
30d2f3d5
AD
148602002-01-26 Akim Demaille <akim@epita.fr>
14861
14862 * tests/actions.at, tests/calc.at, tests/headers.at,
14863 * tests/torture.at: Adjust to the newest Autotest which no longer
14864 forces `.' in the PATH.
14865
30f8c395
AD
148662002-01-25 Akim Demaille <akim@epita.fr>
14867
14868 * tests/regression.at (%nonassoc and eof): New.
14869 Suggested by Robert Anisko.
14870
29ae55f1
AD
148712002-01-24 Akim Demaille <akim@epita.fr>
14872
14873 Bison dumps core when trying to complain about broken input files.
14874 Reported by Cris van Pelt.
14875
14876 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
14877 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
14878 into...
14879 (Invalid inputs): Strengthen: exercise parse_percent_token.
14880
2b548aa6
RA
148812002-01-24 Robert Anisko <robert.anisko@epita.fr>
14882
14883 * src/Makefile.am: Add bison.c++.
14884 * src/bison.c++: New skeleton.
14885
bb0146c2
AD
148862002-01-21 Paolo Bonzini <bonzini@gnu.org>
14887
14888 * po/it.po: New.
14889
bec30531
AD
148902002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
14891
14892 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
14893
fc6edc45
MA
148942002-01-20 Marc Autret <marc@gnu.org>
14895
14896 * src/files.c (compute_output_file_names): Fix
14897
5e5d5415
MA
148982002-01-20 Marc Autret <marc@gnu.org>
14899
14900 * tests/output.at: New test.
14901 * src/files.c (compute_base_names): Don't map extensions when
14902 the YACC flag is set, use defaults.
14903 Reported by Evgeny Stambulchik.
14904
44ea3fbd
MA
149052002-01-20 Marc Autret <marc@gnu.org>
14906
ba0fe3c7
PE
14907 * src/system.h: Need to define __attribute__ away for non-GCC
14908 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
14909 Suggested by Albert Chin-A-Young.
14910
338963d1
TVH
149112002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
14912
14913 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
14914 canonical definition.
14915 * src/system.h: Use the canonical definition for PARAMS (avoids
14916 a conflict with the macro from lib/hash.h).
14917
c57b2479
AD
149182002-01-11 Akim Demaille <akim@epita.fr>
14919
14920 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 14921 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 14922
b85810ae
AD
149232002-01-09 Akim Demaille <akim@epita.fr>
14924
14925 * src/files.c, src/files.h (output_infix): New.
14926 (tab_extension): Remove.
14927 (compute_base_names): Compute the former, drop the latter.
14928 * src/output.c (prepare): Insert the muscles `output-infix', and
14929 `output-suffix'.
14930 * src/parse-skel.y (string, string.1): New.
14931 (section.header): Use it.
14932 (section.yacc): Remove.
14933 (prefix): Remove too.
14934 * src/scan-skel.l: Adjust.
14935 * src/bison.simple, src/bison.hairy: Adjust.
14936
cae60122
AD
149372002-01-09 Akim Demaille <akim@epita.fr>
14938
14939 * configure.in (WERROR_CFLAGS): Compute it.
14940 * src/Makefile.am (CFLAGS): Pass it.
14941 * tests/atlocal.in (CFLAGS): Idem.
14942 * src/files.c: Fix a few warnings.
14943 (get_extension_index): Remove, unused.
14944
ae404801
AD
149452002-01-08 Akim Demaille <akim@epita.fr>
14946
14947 * src/getargs.c (AS_FILE_NAME): New.
14948 (getargs): Use it to convert DOSish file names.
14949 * src/files.c (base_name): Rename as full_base_name to avoid
14950 clashes with `base_name ()'.
14951 (filename_split): New.
14952 (compute_base_names): N-th rewrite, using filename_split.
14953
22312b71
AD
149542002-01-08 Akim Demaille <akim@epita.fr>
14955
14956 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
14957 New, stolen from the Fileutils 4.1.
14958 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14959 * configure.in: Check for the presence of memrchr, and of its
14960 prototype.
14961
a67cef01
TVH
149622002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
14963
14964 * lib/hash.h (__P): Added definition for this macro.
14965 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
14966 BUILT_SOURCES, to ensure they are generated first.
14967 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
14968 %error-verbose to allow bootstrapping with bison 1.30x.
14969
2b25d624
AD
149702002-01-06 Akim Demaille <akim@epita.fr>
14971
14972 * src/reader.c (parse_braces): Don't fetch the next char, the
14973 convention is to fetch on entry.
14974 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
14975 'switch' without a following semicolon.
14976 * tests/regression.at (braces parsing): New.
14977
3460813b
AD
149782002-01-06 Akim Demaille <akim@epita.fr>
14979
14980 Bison is dead wrong in its RR conflict reports.
14981
14982 * tests/torture.at (GNU Cim Grammar): New.
14983 * src/conflicts.c (count_rr_conflicts): Fix.
14984
73784c64
AD
149852002-01-06 Akim Demaille <akim@epita.fr>
14986
14987 Creating package.m4 from configure.ac causes too many problems.
14988
14989 * tests/Makefile.am (package.m4): Create it by hand,
14990 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
14991
25d81090
AD
149922002-01-06 Akim Demaille <akim@epita.fr>
14993
14994 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
14995 skeleton.h.
14996
a9b8959e
PE
149972002-01-04 Paul Eggert <eggert@twinsun.com>
14998
14999 * doc/bison.texinfo (Debugging):
15000 Remove YYSTDERR; it's no longer defined or used.
15001 Also, s/cstdio.h/cstdio/.
15002
25d81090
AD
150032002-01-03 Akim Demaille <akim@epita.fr>
15004
15005 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
15006
1109455c
AD
150072002-01-03 Akim Demaille <akim@epita.fr>
15008
15009 * src/parse-skel.y (process_skeleton): Don't bind the parser's
15010 tracing code to --trace, wait for a better --trace option, with
15011 args.
15012
7ea5e977
AD
150132002-01-03 Akim Demaille <akim@epita.fr>
15014
15015 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
15016 The ISO C++ standard is extremely clear about it: stderr is
15017 considered a macro, not a regular symbol (see table 94 `Header
15018 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
15019 Therefore std:: does not apply to it. It still does with fprintf.
15020 Also, s/cstdio.h/cstdio/.
15021
fab5b110
AD
150222002-01-03 Akim Demaille <akim@epita.fr>
15023
15024 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
15025 for non system headers.
15026
aed7fd9b
AD
150272002-01-02 Akim Demaille <akim@epita.fr>
15028
15029 Equip the skeleton chain with location tracking, runtime trace,
15030 pure parser and scanner.
15031
15032 * src/parse-skel.y: Request a pure parser, locations, and prefix
15033 renaming.
15034 (%union): Having several members with the same type does not help
15035 type mismatches, simplify.
15036 (YYPRINT, yyprint): New.
15037 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
15038 (skel_error): this.
15039 Handle locations.
15040 * src/scan-skel.l: Adjust to these changes.
15041 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
15042 (LOCATION_PRINT, skel_control_t): New.
15043
24fad99e
AD
150442001-12-30 Akim Demaille <akim@epita.fr>
15045
15046 * src/parse-skel.y: Get rid of the shift/reduce conflict:
15047 replace `gb' with BLANKS.
15048 * src/scan-skel.l: Adjust.
15049
a4b36db4
AD
150502001-12-30 Akim Demaille <akim@epita.fr>
15051
15052 * src/system.h: We don't need nor want bcopy.
15053 Throw away MS-DOS crap: we don't need getpid.
15054 * configure.in: We don't need strndup. It was even causing
15055 problems: because Flex includes the headers *before* us,
15056 _GNU_SOURCE is not defined by config.h, and therefore strndup was
15057 not visible.
15058 * lib/xstrndup.c: New.
15059 * src/scan-skel.l: Use it.
15060 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
15061 * src/parse-skel.y: Use %directives instead of #defines.
15062
1239777d
AD
150632001-12-30 Akim Demaille <akim@epita.fr>
15064
15065 * src/skeleton.h: New.
15066 * src/output.c (output_parser, output_master_parser): Remove, dead
15067 code.
15068 * src/output.h (get_lines_number, actions_output, guards_output)
15069 (token_definitions_output): Prototype them.
15070 * src/parse-skel.y: Add the license notice.
15071 Include output.h and skeleton.h.
15072 (process_skeleton): Returns void, and takes a single parameter.
15073 * src/scan-skel.l: Add the license notice.
15074 Include skeleton.h.
15075 Don't use %option yylineno: it seems that then Flex imagines
15076 REJECT has been used, and therefore it won't reallocate its
15077 buffers (which makes no other sense to me than a bug). It results
15078 in warnings for `unused: yy_flex_realloc'.
15079
9b3add5b
RA
150802001-12-30 Robert Anisko <robert.anisko@epita.fr>
15081
15082 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15083 (MUSCLE_INSERT_PREFIX): ...to there.
15084 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15085 (MUSCLE_INSERT_PREFIX): Move from here...
15086
15087 * src/bison.hairy: Add a section directive. Put braces around muscle
15088 names. This parser skeleton is still broken, but Bison should not
15089 choke on a bad muscle 'syntax'.
15090 * src/bison.simple: Add a section directive. Put braces around muscle
15091 names.
15092
15093 * src/files.h (strsuffix, stringappend): Add declarations.
15094 (tab_extension): Add declaration.
15095 (short_base_name): Add declaration.
15096
15097 * src/files.c (strsuffix, stringappend): No longer static. These
15098 functions are used in the skeleton parser.
15099 (tab_extension): New.
15100 (compute_base_names): Use the computations done in this function
fab5b110 15101 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
15102 names.
15103 (short_base_name): No longer static.
15104
15105 * src/output.c (output_skeleton): New.
15106 (output): Disable call to output_master_parser, and give a try to
15107 a new skeleton handling system.
15108 (guards_output, actions_output): No longer static.
15109 (token_definitions_output, get_lines_number): No longer static.
15110
15111 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
15112
fab5b110 15113 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
15114 parse-skel.y.
15115
15116 * src/parse-skel.y: New file.
15117 * src/scan-skel.l: New file.
15118
b5b61c61
AD
151192001-12-29 Akim Demaille <akim@epita.fr>
15120
15121 %name-prefix is broken.
15122
15123 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
15124 Adjust all dependencies.
15125 * tests/headers.at (export YYLTYPE): Strengthen this test: use
15126 %name-prefix.
15127
15128 Renaming yylval but not yylloc is not consistent. Now we do.
15129
15130 * src/bison.simple: Prefix yylloc if used.
15131 * doc/bison.texinfo (Decl Summary): Document that.
15132
8c9a50be
AD
151332001-12-29 Akim Demaille <akim@epita.fr>
15134
15135 * doc/bison.texinfo: Promote `%long-directive' over
15136 `%long_directive'.
15137 Remove all references to fixed-output-files, yacc is enough.
15138
d99361e6
AD
151392001-12-29 Akim Demaille <akim@epita.fr>
15140
15141 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
15142 user prologue. These are defaults.
15143 * tests/actions.at (Mid-rule actions): Make sure the user can
15144 define YYDEBUG and YYERROR_VERBOSE.
15145
b9cecb91
AD
151462001-12-29 Akim Demaille <akim@epita.fr>
15147
15148 * src/output.c (header_output): Don't forget to export YYLTYPE and
15149 yylloc.
15150 * tests/headers.at (export YYLTYPE): New, make sure it does.
15151 * tests/regression.at (%union and --defines, Invalid CPP headers):
15152 Move to...
15153 * tests/headers.at: here.
15154
aea13e97
AD
151552001-12-29 Akim Demaille <akim@epita.fr>
15156
15157 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
15158
931394cb
AD
151592001-12-29 Akim Demaille <akim@epita.fr>
15160
15161 * tests/actions.at (Mid-rule actions): Output on a single line
15162 instead of several.
15163
704a47c4
AD
151642001-12-29 Akim Demaille <akim@epita.fr>
15165
15166 * doc/bison.texinfo: Formatting changes.
15167
091e20bb
AD
151682001-12-29 Akim Demaille <akim@epita.fr>
15169
15170 Don't store the token defs in a muscle, just be ready to output it
15171 on command. Now possible via `symbols'. Fixes a memory leak.
15172
15173 * src/output.c (token_definitions_output): New.
15174 (output_parser, header_output): Use it.
15175 * src/reader.c (symbols_save): Remove.
15176
cce71710
AD
151772001-12-29 Akim Demaille <akim@epita.fr>
15178
15179 * src/bison.simple: Do not provide a default for YYSTYPE and
15180 YYLTYPE before the user's prologue. Otherwise it's hardly... a
15181 default.
15182
82c035a8
AD
151832001-12-29 Akim Demaille <akim@epita.fr>
15184
15185 Mid-rule actions are simply... ignored!
15186
15187 * src/reader.c (readgram): Be sure to attach mid-rule actions to
15188 the empty-rule associated to the dummy symbol, not to the host
15189 rule.
15190 * tests/actions.at (Mid-rule actions): New.
15191
8419d367
AD
151922001-12-29 Akim Demaille <akim@epita.fr>
15193
15194 Memory leak.
15195
15196 * src/reader.c (reader): Free grammar.
15197
375d5806
AD
151982001-12-29 Akim Demaille <akim@epita.fr>
15199
15200 Memory leak.
15201
15202 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
15203 since it allocates it for each state, although only one is needed.
15204 (allocate_storage): Do it here.
15205
f51cb8ff
AD
152062001-12-29 Akim Demaille <akim@epita.fr>
15207
15208 * src/options.h, src/options.c (create_long_option_table): Rename
15209 as...
15210 (long_option_table_new): this, with a clearer prototype.
15211 (percent_table): Remove, unused,
15212 * src/getargs.c (getargs): Adjust.
15213
29e88316
AD
152142001-12-29 Akim Demaille <akim@epita.fr>
15215
15216 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
15217 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
15218 as states.
15219
b9f71f19
AD
152202001-12-29 Akim Demaille <akim@epita.fr>
15221
15222 * src/lalr.c (build_relations): Rename `states' as `states1'.
15223 Sorry, I don't understand exactly what it is, no better name...
15224
1a2b5d37
AD
152252001-12-29 Akim Demaille <akim@epita.fr>
15226
15227 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
15228 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
15229 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
15230 as rules.
15231
1cca533e
AD
152322001-12-29 Akim Demaille <akim@epita.fr>
15233
15234 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
15235 ago.
15236
c03ae966
AD
152372001-12-29 Akim Demaille <akim@epita.fr>
15238
15239 * src/reader.c, src/reader.h (user_toknums): Remove.
15240 Adjust all users to use symbols[i]->user_token_number.
15241
5a670b1e
AD
152422001-12-29 Akim Demaille <akim@epita.fr>
15243
15244 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
15245 Adjust all users to use symbols[i]->prec or ->assoc.
15246
ad949da9
AD
152472001-12-29 Akim Demaille <akim@epita.fr>
15248
15249 * src/reader.c, src/reader.h (tags): Remove.
15250 Adjust all users to use symbols[i]->tag.
15251
0e78e603
AD
152522001-12-29 Akim Demaille <akim@epita.fr>
15253
15254 * src/gram.h, src/gram.c (symbols): New, similar to state_table
15255 and rule_table.
15256 * src/reader.c (packsymbols): Fill this table.
15257 Drop sprec.
15258 * src/conflicts.c (resolve_sr_conflict): Adjust.
15259 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
15260 single table.
15261 Use symbols[i]->tag instead of tags[i].
15262
213e640e
AD
152632001-12-29 Akim Demaille <akim@epita.fr>
15264
15265 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
15266 In addition, put a comment in there, to replace...
15267 * tests/regression.at (%union and C comments): Remove.
15268
e7b8bef1
AD
152692001-12-29 Akim Demaille <akim@epita.fr>
15270
15271 * tests/regression.at (Web2c Actions): Blindly move the actual
15272 output as expected output. The contents *seem* right to me, but I
15273 can't pretend reading perfectly parser tables... Nonetheless, all
15274 the other tests pass correctly, the table look OK, even though the
15275 presence of `$axiom' is to be noted: AFAICS it is useless (but
15276 harmless).
15277
b68e7744
AD
152782001-12-29 Akim Demaille <akim@epita.fr>
15279
15280 * src/reader.c (readgram): Don't add the rule 0 if there were no
15281 rules read. In other words, add it _after_ having performed
15282 grammar sanity checks.
15283 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
15284
78d5bae9
AD
152852001-12-29 Akim Demaille <akim@epita.fr>
15286
15287 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
15288 visible, and some states have now a different number.
15289
ff442794
AD
152902001-12-29 Akim Demaille <akim@epita.fr>
15291
15292 * src/reader.c (readgram): Bind the initial rule's lineno to that
15293 of the first rule.
15294 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
15295 (Solved SR Conflicts): Adjust rule 0's line number.
15296
610ab194
AD
152972001-12-29 Akim Demaille <akim@epita.fr>
15298
15299 Fix the `GAWK Grammar' failure.
15300
15301 * src/LR0.c (final_state): Initialize to -1 so that we do compute
15302 the reductions of the first state which was mistakenly confused
15303 with the final state because precisely final_state was initialized
15304 to 0.
15305 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
15306 now noticed by Bison.
15307 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
15308 have a reduction on $default.
15309
29d29c8f
AD
153102001-12-29 Akim Demaille <akim@epita.fr>
15311
15312 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
15313 rule line numbers.
15314 * src/closure.c (print_closure): Likewise.
15315 * src/derives.c (print_derives): Likewise.
15316 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
15317 now.
15318
7c6b64d0
AD
153192001-12-29 Akim Demaille <akim@epita.fr>
15320
15321 * src/lalr.c (lookaheads_print): New.
15322 (lalr): Call it when --trace-flag.
15323 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
15324 are dumped.
15325
3d4daee3
AD
153262001-12-29 Akim Demaille <akim@epita.fr>
15327
15328 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
15329 when walking through ritem, even via rule->rhs.
15330 * src/reduce.c (dump_grammar, useful_production, reduce_output)
15331 (useful_production, useless_nonterminals): Likewise.
15332 (reduce_grammar_tables): Likewise, plus update nritems.
15333 * src/nullable.c (set_nullable): Likewise.
15334 * src/lalr.c (build_relations): Likewise.
15335 * tests/sets.at (Nullable): Adjust.
15336 Fortunately, now, the $axiom is no longer nullable.
15337
9e7f6bbd
AD
153382001-12-29 Akim Demaille <akim@epita.fr>
15339
15340 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
15341 the 0-sentinel.
15342 * src/gram.c (ritem_longest_rhs): Likewise.
15343 * src/reduce.c (nonterminals_reduce): Likewise.
15344 * src/print_graph.c (print_graph): Likewise.
15345 * src/output.c (output_rule_data): Likewise.
15346 * src/nullable.c (set_nullable): Likewise.
15347
255ef638
AD
153482001-12-29 Akim Demaille <akim@epita.fr>
15349
15350 * src/output.c: Comment changes.
15351
0d8a7363
AD
153522001-12-27 Paul Eggert <eggert@twinsun.com>
15353
15354 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
15355 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
15356 Sparc, as they were causing more porting problems than the
15357 (minor) performance improvement was worth.
15358
15359 Also, catch up with 1.31's YYSTD.
15360
3db472b9
AD
153612001-12-27 Akim Demaille <akim@epita.fr>
15362
15363 * src/output.c (output_gram): Rely on nritems, not the
15364 0-sentinel. See below.
15365 Use -1 as separator, not 0.
15366 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
15367 Rely on -1 as separator in yyrhs, instead of 0.
15368 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
15369 twice `Now at end of input', therefore there are two lines less to
15370 expect.
15371
b365aa05
AD
153722001-12-27 Akim Demaille <akim@epita.fr>
15373
15374 * tests/regression.at (Unresolved SR Conflicts):
15375 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
15376 below.
15377
30171f79
AD
153782001-12-27 Akim Demaille <akim@epita.fr>
15379
15380 * src/LR0.c (new_state): Recognize the final state by the fact it
15381 is reached by eoftoken.
15382 (insert_start_shifting_state, insert_eof_shifting_state)
15383 (insert_accepting_state, augment_automaton): Remove, since now
15384 these states are automatically computed from the initial state.
15385 (generate_states): Adjust.
15386 * src/print.c: When reporting a rule number to the user, substract
15387 1, so that the axiom rule is rule 0, and the first user rule is 1.
15388 * src/reduce.c: Likewise.
15389 * src/print_graph.c (print_core): For the time being, just as for
15390 the report, depend upon --trace-flags to dump the full set of
15391 items.
15392 * src/reader.c (readgram): Once the grammar read, insert the rule
15393 0: `$axiom: START-SYMBOL $'.
15394 * tests/set.at: Adjust: rule 0 is now displayed, and since the
15395 number of the states has changed (the final state is no longer
15396 necessarily the last), catch up.
15397
75142d45
AD
153982001-12-27 Akim Demaille <akim@epita.fr>
15399
15400 Try to make the use of the eoftoken valid. Given that its value
15401 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
15402 is used instead of > 0 where appropriate, (ii), depend upon nritems
15403 instead of the 0-sentinel.
15404
15405 * src/gram.h, src/gram.c (nritems): New.
15406 Expected to be duplication of nitems, but for the time being...
15407 * src/reader.c (packgram): Assert nritems and nitems are equal.
15408 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
15409 * src/closure.c (print_closure, print_fderives): Likewise.
15410 * src/gram.c (ritem_print): Likewise.
15411 * src/print.c (print_core, print_grammar): Likewise.
15412 * src/print_graph.c: Likewise.
15413
b7c49edf
AD
154142001-12-27 Akim Demaille <akim@epita.fr>
15415
15416 * src/main.c (main): If there are complains after grammar
15417 reductions, then output the report anyway if requested, then die.
15418 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
15419 * src/reader.c (eoftoken): New.
15420 (parse_token_decl): If the token being defined has value `0', it
15421 is the eoftoken.
15422 (packsymbols): No longer hack `tags' to insert `$' by hand.
15423 Be sure to preserve the value of the eoftoken.
15424 (reader): Make sure eoftoken is defined.
15425 Initialize nsyms to 0: now eoftoken is created just like the others.
15426 * src/print.c (print_grammar): Don't special case the eof token.
15427 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
15428 lie anyway, albeit pleasant.
15429 * tests/calc.at: Exercise error messages with eoftoken.
15430 Change the grammar so that empty input is invalid.
15431 Adjust expectations.
15432 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
15433
ec2da99f
AD
154342001-12-27 Akim Demaille <akim@epita.fr>
15435
15436 * configure.in: Check the protos of strchr ans strspn.
15437 Replace strchr if needed.
15438 * src/system.h: Provide the protos of strchr, strspn and memchr if
15439 missing.
15440 * lib/strchr.c: New.
15441 * src/reader.c (symbols_save): Use strchr.
15442
8adfa272
AD
154432001-12-27 Akim Demaille <akim@epita.fr>
15444
15445 * src/print.c, src/print_graph.c (escape): New.
15446 Use it to quote the TAGS outputs.
15447 * src/print_graph.c (print_state): Now errors are in red, and
15448 reductions in green.
15449 Prefer high to wide: output the state number on a line of its own.
15450
80dac38c
AD
154512001-12-27 Akim Demaille <akim@epita.fr>
15452
15453 * src/state.h, src/state.c (reductions_new): New.
15454 * src/LR0.c (set_state_table): Let all the states have a
15455 `reductions', even if reduced to 0.
15456 (save_reductions): Adjust.
15457 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
15458 * src/print.c (print_reductions, print_actions): Adjust.
15459 * src/output.c (action_row): Adjust.
15460
2cec70b9
AD
154612001-12-27 Akim Demaille <akim@epita.fr>
15462
15463 * src/state.h, src/state.c (errs_new, errs_dup): New.
15464 * src/LR0.c (set_state_table): Let all the states have an errs,
15465 even if reduced to 0.
15466 * src/print.c (print_errs, print_reductions): Adjust.
15467 * src/output.c (output_actions, action_row): Adjust.
15468 * src/conflicts.c (resolve_sr_conflict): Adjust.
15469
13ca549a
AD
154702001-12-27 Akim Demaille <akim@epita.fr>
15471
15472 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
15473
5092aba5
AD
154742001-12-27 Akim Demaille <akim@epita.fr>
15475
15476 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
15477 * src/print.c: here.
15478 (lookaheadset, shiftset): New, used as additional storage by
15479 print_reductions.
15480 (print_results): Adjust.
15481 (print_shifts, print_gotos, print_errs): New, extracted from...
15482 (print_actions): here.
15483 * src/print_graph.c (print_actions): Remove dead code.
15484
11e2beca
AD
154852001-12-27 Akim Demaille <akim@epita.fr>
15486
15487 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
15488 `$n' and `@n'.
15489
dac3c910
AD
154902001-12-27 Akim Demaille <akim@epita.fr>
15491
15492 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
15493 (build_relations): Adjust.
15494
d0b0fefa
AD
154952001-12-27 Akim Demaille <akim@epita.fr>
15496
15497 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
15498 duplication.
15499
adc8c848
AD
155002001-12-27 Akim Demaille <akim@epita.fr>
15501
15502 * src/reader.c (packgram): Catch nitems overflows.
15503
14d293ac
AD
155042001-12-27 Akim Demaille <akim@epita.fr>
15505
15506 * src/files.c, src/files.h (guard_obstack): Remove.
15507 * src/output.c (output): Adjust.
15508 * src/reader.c (parse_braces): New, factoring...
15509 (copy_action, copy_guard): these two which are renamed as...
15510 (parse_action, parse_guard): these.
15511 As a voluntary consequence, using braces around guards is now
15512 mandatory.
15513
f499b062
AD
155142001-12-27 Akim Demaille <akim@epita.fr>
15515
15516 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
15517 * src/reader.c (symbol_list): `guard' and `guard_line' are new
15518 members.
15519 (symbol_list_new): Adjust.
15520 (copy_action): action_line is the first line, not the last.
15521 (copy_guard): Just as for actions, store the `action' only, not
15522 the switch/case/break flesh.
15523 Don't parse the user action that might follow the guard, let...
15524 (readgram): do it, i.e., now, there can be an action after a
15525 guard.
15526 In other words the guard is just explicitly optional.
15527 (packgram): Adjust.
15528 * src/output.c (guards_output): New.
15529 (output_parser): Call it when needed.
15530 (output): Also free the guard and attrs obstacks.
15531 * src/files.c, src/files.h (obstack_save): Remove.
15532 (output_files): Remove.
15533 As a result, if one needs the former `.act' file, using an
15534 appropriate skeleton which requires actions and guards is now
15535 required.
15536 * src/main.c (main): Adjust.
15537 * tests/semantic.at: New.
15538 * tests/regression.at: Use `input.y' as input file name.
15539 Avoid 8+3 problems by requiring input.c when the test needs the
15540 parser.
15541
d945f5cd
AD
155422001-12-27 Akim Demaille <akim@epita.fr>
15543
15544 * src/reader.c (symbol_list_new): Be sure to initialize all the
15545 fields.
15546
d200e455
AD
155472001-12-27 Akim Demaille <akim@epita.fr>
15548
15549 All the hacks using a final pseudo state are now useless.
15550
15551 * src/LR0.c (set_state_table): state_table holds exactly nstates.
15552 * src/lalr.c (nLA): New.
15553 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
15554 instead of lookaheadsp from the pseudo state (nstate + 1).
15555
f9507c28
AD
155562001-12-27 Akim Demaille <akim@epita.fr>
15557
15558 * src/output.c (action_row, token_actions): Use a state_t instead
15559 of a integer, and nlookaheads instead of the following state's
15560 lookaheadsp.
15561
065fbd27
AD
155622001-12-27 Akim Demaille <akim@epita.fr>
15563
15564 * src/conflicts.c (log_resolution, flush_shift)
15565 (resolve_sr_conflict, set_conflicts, solve_conflicts)
15566 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
15567 (conflicts_print, print_reductions): Use a state_t instead of an
15568 integer when referring to a state.
15569 As much as possible, depend upon nlookaheads, instead of the
15570 `lookaheadsp' member of the following state (since lookaheads of
15571 successive states are successive, the difference between state n + 1
15572 and n served as the number of lookaheads for state n).
15573 * src/lalr.c (add_lookback_edge): Likewise.
15574 * src/print.c (print_core, print_actions, print_state)
15575 (print_results): Likewise.
15576 * src/print_graph.c (print_core, print_actions, print_state)
15577 (print_graph): Likewise.
15578 * src/conflicts.h: Adjust.
15579
1b177bd7
AD
155802001-12-27 Akim Demaille <akim@epita.fr>
15581
15582 * src/bison.hairy: Formatting/comment changes.
15583 ANSIfy.
15584 Remove `register' indications.
15585 Add plenty of `static'.
15586
7742ddeb
AD
155872001-12-27 Akim Demaille <akim@epita.fr>
15588
15589 * src/output.c (prepare): Drop the muscle `ntbase' which
15590 duplicates ntokens.
15591 * src/bison.simple: Formatting/comment changes.
15592 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
15593 is an undocumented synonym.
15594
1fa14068
AD
155952001-12-22 Akim Demaille <akim@epita.fr>
15596
15597 * src/output.c (output_table_data): Change the prototype to use
15598 `int' for array ranges: some invocations do pass an int, not a
15599 short.
15600 Reported by Wayne Green.
15601
b9752825
AD
156022001-12-22 Akim Demaille <akim@epita.fr>
15603
15604 Some actions of web2c.y are improperly triggered.
15605 Reported by Mike Castle.
15606
15607 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
15608 * tests/regression.at (Web2c): Rename as...
15609 (Web2c Report): this.
15610 (Web2c Actions): New.
15611
776209d6
AD
156122001-12-22 Akim Demaille <akim@epita.fr>
15613
15614 Reductions in web2c.y are improperly reported.
15615 Reported by Mike Castle.
15616
15617 * src/conflicts.c (print_reductions): Fix.
15618 * tests/regression.at (Web2c): New.
15619
275fc3ad
AD
156202001-12-18 Akim Demaille <akim@epita.fr>
15621
15622 Some host fail on `assert (!"foo")', which expands to
15623 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
15624 Reported by Nelson Beebee.
15625
15626 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
15627 `#define it_succeeded 0' and `assert (it_succeeded)'.
15628
897668ee
MA
156292001-12-17 Marc Autret <autret_m@epita.fr>
15630
15631 * src/bison.simple: Don't hard code the skeleton line and filename.
15632 * src/output.c (output_parser): Rename 'line' as 'output_line'.
15633 New line counter 'skeleton_line' (skeleton-line muscle).
15634
ab3399e0
PE
156352001-12-17 Paul Eggert <eggert@twinsun.com>
15636
15637 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
15638 YYDEBUG must be defined to a nonzero value.
15639
15640 * src/bison.simple (yytname): Do not assume that the user defines
15641 YYDEBUG to a properly parenthesized expression.
15642
3877f72b
AD
156432001-12-17 Akim Demaille <akim@epita.fr>
15644
15645 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
15646 nlookaheads is a new member.
15647 Adjust all users.
15648 * src/lalr.h (nlookaheads): Remove this orphan declaration.
15649 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
15650 state.
776209d6 15651
331dbc1b
AD
156522001-12-17 Akim Demaille <akim@epita.fr>
15653
15654 * src/files.h, src/files.c (open_files, close_files): Remove.
15655 * src/main.c (main): Don't open/close files, nor invoke lex_free,
15656 let...
15657 * src/reader.c (reader): Do it.
776209d6 15658
be750e4c
AD
156592001-12-17 Akim Demaille <akim@epita.fr>
15660
15661 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 15662
709ae8c6
AD
156632001-12-17 Akim Demaille <akim@epita.fr>
15664
15665 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
15666 (flush_reduce): New.
15667 (resolve_sr_conflict): Adjust.
776209d6 15668
f87685c3
AD
156692001-12-17 Akim Demaille <akim@epita.fr>
15670
15671 * src/output.c (output_obstack): Be static and rename as...
15672 (format_obstack): this, to avoid any confusion with files.c's
15673 output_obstack.
15674 * src/reader.h (muscle_obstack): Move to...
15675 * src/output.h: here, since it's defined in output.c.
15676
837491d8
AD
156772001-12-17 Akim Demaille <akim@epita.fr>
15678
15679 * src/output.c (action_row, save_column, default_goto)
15680 (sort_actions, matching_state, pack_vector): Better variable
15681 locality.
15682
796d61fb
AD
156832001-12-17 Akim Demaille <akim@epita.fr>
15684
15685 * src/output.c: Various formatting changes.
776209d6 15686
64d15509
AD
156872001-12-17 Akim Demaille <akim@epita.fr>
15688
15689 * src/files.c (output_files): Free the output_obstack.
15690 * src/main.c (main): Call print and print_graph conditionally.
15691 * src/print.c (print): Work unconditionally.
15692 * src/print_graph.c (print_graph): Work unconditionally.
15693 * src/conflicts.c (log_resolution): Output only if verbose_flag.
15694
fbc8ecb7
MA
156952001-12-16 Marc Autret <autret_m@epita.fr>
15696
15697 * src/output.c (actions_output): Fix. When we use %no-lines,
15698 there is one less line per action.
15699
f0440388
MA
157002001-12-16 Marc Autret <autret_m@epita.fr>
15701
15702 * src/bison.simple: Remove a useless #line directive.
15703 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
15704 * src/output.c (get_lines_number): New.
776209d6 15705 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
15706 output muscles.
15707 Fix line numbering.
15708 (actions_output): Computes the number of lines taken by actions.
15709 (output_master_parser): Insert new skeleton which is the name of
15710 the output parser file name.
15711
a79986b8
MA
157122001-12-15 Marc Autret <autret_m@epita.fr>
15713
15714 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
15715
4ec8e00f
MA
157162001-12-15 Marc Autret <autret_m@epita.fr>
15717
15718 * src/output.c (output_gram): Keep track of the hairy one.
15719
1a4648ff
AD
157202001-12-15 Akim Demaille <akim@epita.fr>
15721
15722 Make `make distcheck' work.
15723
15724 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
15725 system.h which uses libgettext.h.
15726
9c2c67e6
AD
157272001-12-15 Akim Demaille <akim@epita.fr>
15728
15729 * src/nullable.c (set_nullable): Useless rules must be skipped,
15730 otherwise, since we range over their symbols, we might look at a
15731 nonterminal which no longer ``exists'', i.e., it is not counted in
15732 `nvars', hence we overflow our arrays.
15733
93ede233
AD
157342001-12-15 Akim Demaille <akim@epita.fr>
15735
15736 The header can also be produced directly, without any obstack!
15737 Yahoo!
15738
15739 * src/files.c, src/files.h (defines_obstack): Remove.
15740 (compute_header_macro): Global.
15741 (defines_obstack_save): Remove.
15742 * src/reader.c (parse_union_decl): No longer output to
15743 defines_obstack: its content can be found in the `stype' muscle
15744 anyway.
15745 (output_token_translations): Merge into...
15746 (symbols_output): this.
15747 Rename as...
15748 (symbols_save): this.
15749 (reader): Adjust.
15750 * src/output.c (header_output): New.
15751 (output): Call it.
15752
2666f928
AD
157532001-12-15 Akim Demaille <akim@epita.fr>
15754
15755 * src/reader.c (parse_union_decl): Instead of handling two obstack
15756 simultaneously, use one to define the `stype' muscle, and use the
15757 value of the latter to fill defines_obstack.
15758 (copy_comment): Remove.
15759 (copy_comment2): Work for a single obstack.
15760 Rename as...
15761 (copy_comment): this.
15762
428046f8
AD
157632001-12-15 Akim Demaille <akim@epita.fr>
15764
15765 * src/lex.c, src/lex.h (xgetc): No longer static.
15766 * src/reader.c (parse_union_decl): Revamp.
15767
ea52d706
AD
157682001-12-15 Akim Demaille <akim@epita.fr>
15769
15770 Still making progress in separating Bison into (i) input, (ii)
15771 process, (iii) output: now we can directly output the parser file
15772 without using table_obstack at all.
15773
15774 * src/files.c, src/files.h (table_obstack): Bye bye.
15775 (parser_file_name): New.
15776 * src/files.c (compute_output_file_names): Compute it.
15777 * src/output.c (actions_output, output_parser)
15778 (output_master_parser): To a file instead of an obstack.
15779
3f96f4dc
AD
157802001-12-15 Akim Demaille <akim@epita.fr>
15781
15782 Attach actions to rules, instead of pre-outputting them to
15783 actions_obstack.
15784
15785 * src/gram.h (rule_t): action and action_line are new members.
15786 * src/reader.c (symbol_list): Likewise.
15787 (copy_action): Save the actions within the rule.
15788 (packgram): Save them in rule_table.
15789 * src/output.c (actions_output): New.
15790 (output_parser): Use it on `%%actions'.
15791 (output_rule_data): Don't free rule_table.
15792 (output): Do it.
15793 (prepare): Don't save the `action' muscle.
15794 * src/bison.simple: s/%%action/%%actions/.
15795
51576fb3
AD
157962001-12-15 Akim Demaille <akim@epita.fr>
15797
15798 * src/reader.c (copy_action): When --yacc, don't append a `;'
15799 to the user action: let it fail if lacking.
dee049eb 15800 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 15801
2648a72d
AD
158022001-12-14 Akim Demaille <akim@epita.fr>
15803
15804 * src/lex.c (literalchar): Simply return the char you decoded, non
15805 longer mess around with obstacks and int pointers.
15806 Adjust all callers.
15807
92790e5b
AD
158082001-12-14 Akim Demaille <akim@epita.fr>
15809
15810 * src/lex.c (literalchar): Don't escape the special characters,
15811 just decode them, and keep them as char (before, eol was output as
15812 the 2 char string `\n' etc.).
15813 * src/output.c (output_rule_data): Use quotearg to output the
15814 token strings.
15815
927c1557
PE
158162001-12-13 Paul Eggert <eggert@twinsun.com>
15817
15818 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
15819 Do not infringe on the global user namespace when using C++.
15820 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
15821 All uses of `fprintf' and `stderr' changed.
15822
15823 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
15824
ed8e1f68
AD
158252001-12-13 Akim Demaille <akim@epita.fr>
15826
15827 The computation of nullable is broken: it doesn't handle empty
15828 RHS's properly.
15829
15830 * tests/torture.at (GNU AWK Grammar): New.
15831 * tests/sets.at (Nullable): New.
15832 * src/nullable.c (set_nullable): Instead of blindly looping over
15833 `ritems', loop over the rules, and then over their rhs's.
15834
15835 Work around Autotest bugs.
15836
15837 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
15838 frame, because Autotest understand lines starting with a `+' as
15839 traces from the shell. Then, they are not processed properly.
15840 Admittedly an Autotest bug, but we don't have time to wait for
15841 Autotest to catch up.
15842 * tests/regression.at (Broken Closure): Adjust to the new table
15843 frames.
15844 Move to...
15845 * tests/sets.at: here.
15846
cb581495
AD
158472001-12-13 Akim Demaille <akim@epita.fr>
15848
15849 * src/closure.c (closure): Use nrules instead of playing tricks
15850 with BITS_PER_WORD.
15851
2e729273
AD
158522001-12-13 Akim Demaille <akim@epita.fr>
15853
15854 * src/print.c (print_actions): Output the handling of `$' as the
15855 traces do: shifting the token EOF. Before EOF was treated as a
15856 nonterminal.
15857 * tests/regression.at: Adjust some tests.
15858 * src/print_graph.c (print_core): Complete the set of items via
15859 closure. The next-to-final and final states are still unsatisfying,
15860 but that's to be addressed elsewhere.
15861 No longer output the rule numbers, but do output the state number.
15862 A single loop for the shifts + gotos is enough, but picked a
15863 distinct color for each.
15864 (print_graph): Initialize and finalize closure.
15865
107f7dfb
AD
158662001-12-13 Akim Demaille <akim@epita.fr>
15867
15868 * src/reader.c (readgram): Remove dead code, an strip useless
15869 braces.
15870 (get_type): Remove, unused.
15871
9b53a24f
AD
158722001-12-12 Akim Demaille <akim@epita.fr>
15873
15874 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
15875 on that of lib/error.c.
15876
dbfb6dcd
AD
158772001-12-12 Akim Demaille <akim@epita.fr>
15878
15879 Some hosts don't like `/' in includes.
15880
15881 * src/system.h: Include libgettext.h without qualifying the path.
15882 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
15883 $(top_srcdir).
15884
c25fb648
MA
158852001-12-11 Marc Autret <autret_m@epita.fr>
15886
15887 * src/output.c (output_parser): Remove useless muscle.
15888
710ddc4f
MA
158892001-12-11 Marc Autret <autret_m@epita.fr>
15890
15891 * src/bison.simple: Remove #line just before %%epilogue. It
15892 is now handled in ...
15893 * src/reader.c (read_additionnal_code): Add the output of a
15894 #line for the epilogue.
15895
e83d80b8
MA
158962001-12-10 Marc Autret <autret_m@epita.fr>
15897
927c1557 15898 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
15899 replace precedent remove.
15900 * src/bison.simple: Remove #line before %%prologue because
15901 %%input-line is wrong at this time.
15902
971d5158
MA
159032001-12-10 Marc Autret <autret_m@epita.fr>
15904
15905 * src/reader.c (symbols_output): Clean up.
927c1557 15906 * src/output.c (output_gram, output): Clean up.
971d5158 15907
5edafffd
AD
159082001-12-10 Akim Demaille <akim@epita.fr>
15909
15910 * src/lalr.c (initialize_lookaheads): New. Extracted from...
15911 * src/LR0.c (set_state_table): here.
15912 * src/lalr.c (lalr): Call it.
15913
0279f8e9
AD
159142001-12-10 Akim Demaille <akim@epita.fr>
15915
15916 * src/state.h (shifts): Remove the `number' member: shifts are
15917 attached to state, hence no longer need to be labelled with a
15918 state number.
15919
190c4f5f
AD
159202001-12-10 Akim Demaille <akim@epita.fr>
15921
15922 Now that states have a complete set of members, the linked list of
15923 shifts is useless: just fill directly the state's shifts member.
15924
15925 * src/state.h (shifts): Remove the `next' member.
15926 * src/LR0.c (first_state, last_state): Remove.
15927 Adjust the callers.
15928 (augment_automaton): Don't look for the shifts that must be added
15929 a shift on EOF: it is those of the state we looked for! But now,
15930 since shifts are attached, it is no longer needed to looking
15931 merely by its id: its number.
15932
2a73b93d
AD
159332001-12-10 Akim Demaille <akim@epita.fr>
15934
15935 * src/LR0.c (augment_automaton): Better variable locality.
15936 Remove an impossible branch: if there is a state corresponding to
15937 the start symbol being shifted, then there is shift for the start
15938 symbol from the initial state.
15939
74392f6a
AD
159402001-12-10 Akim Demaille <akim@epita.fr>
15941
15942 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
15943 only when appropriate: when insert_start_shifting_state' is not
15944 invoked.
15945 * tests/regression.at (Rule Line Numbers): Adjust.
15946
37c82725
AD
159472001-12-10 Akim Demaille <akim@epita.fr>
15948
15949 * src/LR0.c (augment_automaton): Now that all states have shifts,
15950 merge the two cases addition shifts to the initial state.
15951
6a164e0c
AD
159522001-12-10 Akim Demaille <akim@epita.fr>
15953
15954 * src/lalr.c (set_state_table): Move to...
15955 * src/LR0.c: here.
15956 * src/lalr.c (lalr): Don't call it...
15957 * src/LR0.c (generate_states): do it.
15958 * src/LR0.h (first_state): Remove, only the table is used.
15959
7215de24
AD
159602001-12-10 Akim Demaille <akim@epita.fr>
15961
15962 * src/LR0.h (first_shift, first_reduction): Remove.
15963 * src/lalr.c: Don't use first_shift: find shifts through the
15964 states.
15965
80e25d4d
AD
159662001-12-10 Akim Demaille <akim@epita.fr>
15967
15968 * src/LR0.c: Attach shifts to states as soon as they are
15969 computed.
15970 * src/lalr.c (set_state_table): Instead of assigning shifts to
15971 state, just assert that the mapping was properly done.
15972
0ab3728b
AD
159732001-12-10 Akim Demaille <akim@epita.fr>
15974
15975 * src/LR0.c (insert_start_shift): Rename as...
15976 (insert_start_shifting_state): this.
15977 (insert_eof_shifting_state, insert_accepting_state): New.
15978 (augment_automaton): Adjust.
15979 Better locality of the variables.
15980 When looking if the start_symbol is shifted from the initial
15981 state, using `while (... symbol != start_symbol ...)' sounds
15982 better than `while (... symbol < start_symbol ...)': If fail
15983 to see how the order between symbols could be relevant!
15984
78af9bbc
AD
159852001-12-10 Akim Demaille <akim@epita.fr>
15986
15987 * src/getargs.h: Don't declare `spec_name_prefix' and
15988 `spec_file_prefix', declared by src/files.h.
15989 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
15990 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
15991 * src/output.c (prepare): Adjust.
15992 * src/reader.c (symbols_output): Likewise.
15993 * src/vmsgetargs.c: Vaguely adjust, but who cares?
15994
bdef2a41
AD
159952001-12-10 Akim Demaille <akim@epita.fr>
15996
15997 * src/muscle_tab.c (muscle_init): NULL is a better default than
15998 `"0"'.
15999
3735969c
AD
160002001-12-10 Akim Demaille <akim@epita.fr>
16001
16002 * src/reader.c (reader): Calling symbols_output once is enough.
16003
49701457
AD
160042001-12-10 Akim Demaille <akim@epita.fr>
16005
16006 Now that states have a complete set of members, the linked list of
16007 reductions is useless: just fill directly the state's reductions
16008 member.
16009
16010 * src/state.h (struct reductions): Remove member `number' and
16011 `next'.
16012 * src/LR0.c (first_reduction, last_reduction): Remove.
16013 (save_reductions): Don't link the new reductions, store them in
16014 this_state.
16015 * src/lalr.c (set_state_table): No need to attach reductions to
16016 states, it's already done.
16017 * src/output.c (output_actions): No longer free the shifts, then
16018 the reductions, then the states: free all the states and their
16019 members.
16020
0edad749
AD
160212001-12-10 Akim Demaille <akim@epita.fr>
16022
16023 * src/options.c (OPTN, DRTV, BOTH): New.
16024 (option_table): Use them.
16025
0edad749
AD
16026 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
16027 the job of system.h.
16028 * src/options.c: Don't include stdio.h and xalloc.h for the same
16029 reasons.
16030
5449dd0f
AD
160312001-12-10 Akim Demaille <akim@epita.fr>
16032
16033 * src/output.c (output, prepare): Make sure the values of the
16034 muscles `action' and `prologue' are 0-terminated.
16035
a870c567
AD
160362001-12-10 Akim Demaille <akim@epita.fr>
16037
16038 Clean up GCC warnings.
16039
16040 * src/reader.c (copy_action): `buf' is not used.
16041 (parse_skel_decl): Be static.
16042 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
16043 * src/options.h (create_long_option_table): Have a real prototype.
16044 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
16045 (hash_delete_at): Return const void *.
16046 Adjust casts to preserve the const.
16047
80df8768
AD
160482001-12-10 Akim Demaille <akim@epita.fr>
16049
16050 * configure.in: Require 2.52g.
16051 M4 is not needed, but AUTOM4TE is.
16052 * m4/m4.m4: Remove.
16053 * tests/Makefile.am: Adjust.
16054
f693ad14
AD
160552001-12-10 Akim Demaille <akim@epita.fr>
16056
16057 One structure for states is enough, even though theoretically
16058 there are LR(0) states and LALR(1) states.
16059
16060 * src/lalr.h (state_t): Remove.
16061 (state_table): Be state_t **, not state_t *.
16062 * src/state.h (core, CORE_ALLOC): Rename as...
16063 (state_t, STATE_ALLOC): this.
16064 Add the LALR(1) members: shifts, reductions, errs.
16065 * src/LR0.c (state_table): Rename as...
16066 (state_hash): this, to avoid name clashes with the global
16067 `state_table'.
16068 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
16069 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
16070
74ffbcb6
AD
160712001-12-10 Akim Demaille <akim@epita.fr>
16072
16073 Bison dumps core on bash.y.
16074 Reported by Pascal Bart.
16075
16076 * src/warshall.c (bitmatrix_print): New.
16077 (TC): Use it.
ba0fe3c7 16078 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
16079 j must be the outer loop.
16080 * tests/regression.at (Broken Closure): New.
16081
07708e19
AD
160822001-12-05 Akim Demaille <akim@epita.fr>
16083
16084 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
16085 its argument.
ba1ecc07 16086 Reported by Peter Hamorsky.
07708e19 16087
92b16366
AD
160882001-12-05 Akim Demaille <akim@epita.fr>
16089
16090 * src/conflicts.c (err_table): Remove.
16091 (resolve_sr_conflict): Adjust.
16092 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
16093 Rename as...
16094 (state_t.reductions, state_t.shifts): this.
16095
076ab033
AD
160962001-12-05 Akim Demaille <akim@epita.fr>
16097
16098 * src/reduce.c (reduce_grammar_tables): No longer disable the
16099 removal of useless rules via CPP but via `if (0)', so that the
16100 compiler still check the code is valid.
16101 For instance, it should have noticed `rline' no longer exists: use
16102 the `line' member of rule_t.
16103 * src/gram.c (dummy, rline): Remove, unused.
16104
3843c413
AD
161052001-12-05 Akim Demaille <akim@epita.fr>
16106
16107 * src/output.c (pack_vector): Use assert, not berror.
16108 * src/main.c (berror): Remove, unused.
16109
43168960
AD
161102001-12-05 Akim Demaille <akim@epita.fr>
16111
16112 New experimental feature: if --verbose --trace output all the
16113 items of a state, not only its kernel.
16114
16115 * src/print.c (print_core): If `trace_flag', then invoke closure
16116 before outputting the items of the state (print_core is no longer
16117 a correct name them).
16118 (print_results): Invoke new_closure/free_closure if needed.
16119
b2872512
AD
161202001-12-05 Akim Demaille <akim@epita.fr>
16121
16122 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
16123 * src/closure.c, src/closure.h (itemsetsize): Rename as...
16124 (nitemset): for consistency with the rest of the project.
16125
23cbcc6c
AD
161262001-12-05 Akim Demaille <akim@epita.fr>
16127
16128 * src/closure.c (print_closure): Improve.
16129 (closure): Use it for printing input and output.
16130
03ec521c
AD
161312001-12-05 Akim Demaille <akim@epita.fr>
16132
16133 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
16134 indexed by nonterminals.
16135
3a7456dd
AD
161362001-12-05 Akim Demaille <akim@epita.fr>
16137
16138 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
16139 what it was!).
16140 * src/warshall.h: Remove accidental duplication of the content.
16141
1cbcf2e7
AD
161422001-12-05 Akim Demaille <akim@epita.fr>
16143
16144 * src/closure.c (set_fderives): De-obfuscate.
16145
84182270
AD
161462001-12-05 Akim Demaille <akim@epita.fr>
16147
16148 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
16149
3f6f053c
AD
161502001-12-05 Akim Demaille <akim@epita.fr>
16151
16152 * src/closure.c (set_firsts): De-obfuscate.
16153
7a5350ba
AD
161542001-12-05 Akim Demaille <akim@epita.fr>
16155
16156 * src/output.c (action_row): De-obfuscate
16157 using the good o' techniques: arrays not pointers, variable
16158 locality, BITISSET, RESETBIT etc.
16159
d954473d
AD
161602001-12-05 Akim Demaille <akim@epita.fr>
16161
16162 Pessimize the code to simplify it: from now on, all the states
16163 have a valid SHIFTS, which NSHIFTS is possibly 0.
16164
16165 * src/LR0.c (shifts_new): Be global and move to..
16166 * src/state.c, src/state.h: here.
16167 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
16168 * src/print_graph: Adjust.
16169
9839bbe5
AD
161702001-12-05 Akim Demaille <akim@epita.fr>
16171
16172 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
16173 * src/conflicts.c: Use it.
16174 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
16175 incorrectly ``simplified''.
16176
9f136c07
AD
161772001-12-05 Akim Demaille <akim@epita.fr>
16178
16179 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
16180 using the good o' techniques: arrays not pointers, variable
16181 locality, BITISSET, RESETBIT etc.
16182
b608206e
AD
161832001-12-05 Akim Demaille <akim@epita.fr>
16184
16185 * src/state.h (SHIFT_SYMBOL): New.
16186 * src/conflicts.c: Use it to deobfuscate.
16187
52afa962
AD
161882001-12-05 Akim Demaille <akim@epita.fr>
16189
16190 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
16191 (print_reductions): De-obfuscate using the good o' techniques:
16192 arrays not pointers, variable locality, BITISSET.
16193
e74dc321
AD
161942001-12-05 Akim Demaille <akim@epita.fr>
16195
16196 * src/conflicts.c (print_reductions): Arrays, not pointers.
16197 Use BITISSET.
16198
768fca83
AD
161992001-12-05 Akim Demaille <akim@epita.fr>
16200
16201 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16202
a17e599f
AD
162032001-12-05 Akim Demaille <akim@epita.fr>
16204
16205 * src/conflicts.c (print_reductions): Improve variable locality.
16206
a04bc341
AD
162072001-12-05 Akim Demaille <akim@epita.fr>
16208
16209 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16210
c8ea038e
AD
162112001-12-05 Akim Demaille <akim@epita.fr>
16212
16213 * src/conflicts.c (print_reductions): Improve variable locality.
16214
aa2aab3c
AD
162152001-12-05 Akim Demaille <akim@epita.fr>
16216
16217 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
16218 * src/lalr.c: Use them.
16219
b178c8cc
AD
162202001-12-05 Akim Demaille <akim@epita.fr>
16221
16222 * src/LR0.c (augment_automaton): Formatting changes.
16223 Better variable locality.
16224
f67d13aa
AD
162252001-12-05 Akim Demaille <akim@epita.fr>
16226
16227 * src/lalr.c (matrix_print): New.
16228 (transpose): Use it.
16229 Use arrays instead of pointers.
16230
c2713865
AD
162312001-12-05 Akim Demaille <akim@epita.fr>
16232
16233 * src/lalr.c (maxrhs): Move to...
16234 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
16235 * src/lalr.c (build_relations): Adjust.
16236
9887c18a
AD
162372001-12-05 Akim Demaille <akim@epita.fr>
16238
16239 * src/lalr.c (transpose): Free the memory allocated to the
16240 argument, as it is replaced by the results by the unique caller.
16241 (build_relations): Merely invoke transpose: it handles the memory
16242 deallocation.
16243 Improve variable locality.
16244 Avoid variables used as mere abbreviations.
16245 (compute_lookaheads): Use arrays instead of pointers.
16246
4d4f699c
AD
162472001-12-05 Akim Demaille <akim@epita.fr>
16248
16249 * src/lalr.c (initialize_F): Improve variable locality.
16250 Avoid variables used as mere abbreviations.
16251
80a69750
AD
162522001-12-05 Akim Demaille <akim@epita.fr>
16253
16254 * src/derives.c (print_derives): Display the ruleno.
16255 * src/lalr.c (initialize_F, transpose): Better variable locality
16256 to improve readability.
16257 Avoid variables used as mere abbreviations.
16258
fe961097
AD
162592001-12-05 Akim Demaille <akim@epita.fr>
16260
16261 * src/lalr.c (traverse): Use arrays instead of pointers.
16262
e3e4e814
AD
162632001-12-05 Akim Demaille <akim@epita.fr>
16264
16265 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
16266 the handling of squeue.
16267 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16268
630e182b
AD
162692001-12-05 Akim Demaille <akim@epita.fr>
16270
16271 Because useless nonterminals are now kept alive (instead of being
16272 `destroyed'), we now sometimes examine them, and store information
16273 related to them. Hence we need to know their number, and adjust
16274 memory allocations.
16275
16276 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
16277 static.
16278 * src/LR0.c (allocate_itemsets): The memory allocated to
16279 `symbol_count' was used for two different purpose: once to count
16280 the number of occurrences of each symbol, and later reassigned to
16281 `shift_symbol', containing the symbol that can be shifted from a
16282 given state.
16283 Deobfuscate, i.e., allocate, use and free `symbol_count' here
16284 only, and...
16285 (new_itemsets): Allocate `shift_symbol' here.
16286 (allocate_itemsets): symbol_count includes useless nonterminals.
16287 Make room for them.
16288 (free_storage): Use `free', not `XFREE', for pointers that cannot
16289 be null.
16290
81b51460
AD
162912001-12-05 Akim Demaille <akim@epita.fr>
16292
16293 * src/nullable.c (set_nullable): Deobfuscate the handling of
16294 ritem.
16295 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16296
3067fbef
AD
162972001-12-05 Akim Demaille <akim@epita.fr>
16298
16299 * src/gram.c, src/gram.h (ritem_print): New.
16300 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
16301 (This useless function was defined only to work around VMS linkers
16302 that can't handle compilation units with variables only).
16303 * src/reduce.c (dump_grammar): Use it to trace the construction of
16304 ritem.
16305
c2bea5f9
PE
163062001-12-04 Paul Eggert <eggert@twinsun.com>
16307
7d27c823
PE
16308 * src/bison.simple (union yyalloc): Change member names
16309 to be the same as the stack names.
16310 (yyparse): yyptr is now union yyalloc *, not char *.
16311 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
16312 and may generate better code on some machines.
c2bea5f9
PE
16313 (yystpcpy): Use prototype if __STDC__ is defined, not just
16314 if __cplusplus is defined.
35687a9d 16315
2c8a9dfa
AD
163162001-11-30 Akim Demaille <akim@epita.fr>
16317
16318 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
16319 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
16320 Gettext doesn't compile cleanly, and dies with -Werror.
16321 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
16322 Include WARNING_CFLAGS here.
16323 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
16324 before being defined.
16325
f4e421e6
AD
163262001-11-27 Paul Eggert <eggert@twinsun.com>
16327
16328 * lib/quotearg.h (quotearg_n, quotearg_n_style):
16329 First arg is int, not unsigned.
16330 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
16331 (SIZE_MAX, UINT_MAX): New macros.
16332 (quotearg_n_options): Abort if N is negative.
16333 Avoid overflow check on hosts where size_t is 64 bits and int
16334 is 32 bits, as overflow is impossible there.
16335 Fix off-by-one typo that caused unnecessary reallocation.
16336
7093d0f5
AD
163372001-11-29 Paul Eggert <eggert@twinsun.com>
16338
16339 Name space cleanup in generated parser.
16340
16341 * doc/bison.texinfo (Bison Parser): Discuss system headers
16342 and their effect on the user name space.
16343
16344 * src/bison.simple:
16345 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
16346 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
16347 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
16348
16349 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
16350 on user names when possible.
16351
16352 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
16353 Simplify test for whather <alloca.h> exists.
16354
16355 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
16356
16357 (<stdio.h>): Include if YYDEBUG.
16358
16359 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
16360 ! defined (yyoverflow) && ! defined (yymemcpy).
16361
16362 (yymemcpy, yyparse): Rename local variables as needed so that
16363 they all begin with 'yy'.
16364
16365 (yystrlen, yystpcpy): New functions.
16366
16367 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
16368 All uses changed.
16369
16370 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
16371 instead of relying on string.h functions. Use YYSTACK_ALLOC
16372 and YYSTACK_FREE instead of malloc and free.
16373
fd51e5ff
AD
163742001-11-30 Akim Demaille <akim@epita.fr>
16375
16376 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
16377 before their first uses.
16378 (YYBISON, YYPURE): Move to the top of the output.
16379
7d13ff5f
AD
163802001-11-30 Akim Demaille <akim@epita.fr>
16381
16382 * tests/reduce.at (Useless Nonterminals): Fix.
16383
892a3995
AD
163842001-11-30 Akim Demaille <akim@epita.fr>
16385
16386 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
16387 if body instead of `;' to pacify GCC's warnings.
16388
68f1e3ed
AD
163892001-11-30 Akim Demaille <akim@epita.fr>
16390
16391 Instead of mapping the LHS of unused rules to -1, keep the LHS
16392 valid, but flag the rules as invalid.
16393
16394 * src/gram.h (rule_t): `useful' is a new member.
16395 * src/print.c (print_grammar): Adjust.
16396 * src/derives.c (set_derives): Likewise.
16397 * src/reader.c (packgram, reduce_output): Likewise.
16398 * src/reduce.c (reduce_grammar_tables): Likewise.
16399 * tests/reduce.at (Underivable Rules, Useless Rules): New.
16400
d2d1b42b
AD
164012001-11-30 Akim Demaille <akim@epita.fr>
16402
16403 * src/reduce.c (reduce_output): Formatting changes.
16404 * src/print.c (print_results, print_grammar): Likewise.
16405 * tests/regression.at (Rule Line Numbers)
16406 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
16407
760b53a8
AD
164082001-11-30 Akim Demaille <akim@epita.fr>
16409
16410 * src/reduce.c (nonterminals_reduce): Instead of throwing away
16411 useless nonterminals, move them at the end of the symbol arrays.
16412 (reduce_output): Adjust.
16413 * tests/reduce.at (Useless Nonterminals): Adjust.
16414
00238958
AD
164152001-11-30 Akim Demaille <akim@epita.fr>
16416
16417 * src/reduce.c: Various comment/formatting changes.
16418 (nonterminals_reduce): New, extracted from...
16419 (reduce_grammar_tables): here.
16420 (reduce_grammar): Call nonterminals_reduce.
16421
396452de
PE
164222001-11-29 Paul Eggert <eggert@twinsun.com>
16423
16424 * src/bison.simple (YYSTACK_REALLOC): Remove.
16425 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
16426 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
16427 New macros.
16428 (union yyalloc): New type.
16429 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
16430 an arbitrary restriction on hosts where size_t is wider than int.
16431
16432 (yyparse): Don't dump core if alloca or malloc fails; instead, report
16433 a parser stack overflow. Allocate just one block of memory for all
16434 three stacks, instead of allocating three blocks; this typically is
16435 faster and reduces fragmentation.
16436
16437 Do not limit the number of items in the stack to a value that fits
16438 in 'int', as this is an arbitrary limit on hosts with 64-bit
16439 size_t and 32-bit int.
16440
147e184c
MA
164412001-11-29 Marc Autret <autret_m@epita.fr>
16442
16443 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
16444 of defining YYERROR_VERBOSE.
16445 [AT_DATA]: $4 is now out of C declarations in the prologue.
16446
426cf563
MA
164472001-11-28 Marc Autret <autret_m@epita.fr>
16448
16449 * src/reader.c (parse_dquoted_param): New.
16450 (parse_skel_decl): Use it.
16451 * src/lex.h: Add its prototype.
16452 * src/lex.c (literalchar): Become not static.
16453
c7925b99
MA
164542001-11-28 Marc Autret <autret_m@epita.fr>
16455
16456 * src/output.h: And put its extern declaration here.
16457 * src/output.c (error_verbose): Define here.
16458 (prepare): Echo name modification.
16459 * src/getargs.h: Clean its extern declaration.
16460 * src/getargs.c (error_verbose_flag): Remove.
16461 (getargs): Remove case 'e'.
16462 * src/options.c (option_table): 'error-verbose' is now seen as simple
16463 percent option.
16464 Include output.h.
16465
16466 * src/reader.c (read_declarations): Remove case tok_include.
16467 (parse_include_decl): Remove.
16468 * src/lex.h (token_t): Remove tok_include.
16469 * src/options.c (option_table): 'include' is now a simple command line
16470 option.
16471
5b5d1929
MA
164722001-11-28 Marc Autret <autret_m@epita.fr>
16473
16474 * src/bison.simple: Adjust muscle names.
16475 * src/muscle_tab.c (muscle_init): Also rename the muscles.
16476 * src/output.c (prepare): s/_/-/ for the muscles names.
16477 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
16478
8850be4b
MA
164792001-11-28 Marc Autret <autret_m@epita.fr>
16480
16481 * src/bison.simple: Fix debug.
16482 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
16483
4a38e613
AD
164842001-11-28 Akim Demaille <akim@epita.fr>
16485
16486 * src/LR0.c (shifts_new): New.
16487 (save_shifts, insert_start_shift, augment_automaton): Use it.
16488
4b35e1c1
AD
164892001-11-28 Akim Demaille <akim@epita.fr>
16490
16491 * src/closure.c (closure): `b' and `ruleno' denote the same value:
16492 keep ruleno only.
16493
d2b04478
AD
164942001-11-28 Akim Demaille <akim@epita.fr>
16495
16496 * src/closure.c (closure): Instead of looping over word in array
16497 then bits in words, loop over bits in array.
16498
2c4c30aa
AD
164992001-11-28 Akim Demaille <akim@epita.fr>
16500
16501 * src/closure.c (closure): No longer optimize the special case
16502 where all the bits of `ruleset[r]' are set to 0, to make the code
16503 clearer.
16504
576890b7
AD
165052001-11-28 Akim Demaille <akim@epita.fr>
16506
16507 * src/closure.c (closure): `r' and `c' are new variables, used to
16508 de-obfuscate accesses to RULESET and CORE.
16509
cb487d7d
AD
165102001-11-28 Akim Demaille <akim@epita.fr>
16511
16512 * src/reduce.c (reduce_print): Use ngettext.
16513 (dump_grammar): Improve the trace accuracy.
16514
6013d43f
AD
165152001-11-28 Akim Demaille <akim@epita.fr>
16516
16517 * src/reduce.c (dump_grammar): Don't translate trace messages.
16518
cb4956ee
AD
165192001-11-28 Akim Demaille <akim@epita.fr>
16520
16521 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
16522 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
16523 as all tags are free'ed afterwards.
16524 From Enrico Scholz.
16525
648185ab
PE
165262001-11-27 Paul Eggert <eggert@twinsun.com>
16527
16528 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
16529 use alloca when we didn't want to, and vice versa.
16530
68254a03
MA
165312001-11-27 Marc Autret <autret_m@epita.fr>
16532
9113b58f
AD
16533 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
16534 initialization.
68254a03
MA
16535 * src/output.c (prepare): Remove its update.
16536
04d843a2
MA
165372001-11-27 Marc Autret <autret_m@epita.fr>
16538
16539 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
16540 Use %error-verbose.
16541
d2079671 165422001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
16543
16544 * src/bison.simple: Remove YYERROR_VERBOSE using.
16545 Use %%error_verbose.
16546 (yyparse): Likewise.
16547 * src/output.c (prepare): Give its final value.
16548 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
16549 * src/getargs.h: Add its extern declaration.
16550 * src/getargs.c (error_verbose_flag): New int.
16551 (getargs): Update to catch new case.
16552 * src/options.c (option_table): 'error-verbose' is a new option.
16553 (shortopts): Update.
16554
e0327bc8
AD
165552001-11-27 Akim Demaille <akim@epita.fr>
16556
16557 * src/system.h: Use intl/libgettext.h.
16558 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
16559
000f1a3c
AD
165602001-11-27 Akim Demaille <akim@epita.fr>
16561
16562 * tests/torture.at (Exploding the Stack Size with Malloc):
16563 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
16564
26cfe0be
AD
165652001-11-27 Akim Demaille <akim@epita.fr>
16566
16567 * src/files.c: Include error.h.
16568 Reported by Hans Aberg.
16569
f6bd5427
MA
165702001-11-26 Marc Autret <autret_m@epita.fr>
16571
d2079671 16572 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
16573 (read_declarations): Add case tok_include.
16574 * src/getargs.h (include): Add its extern definition.
16575 * src/getargs.c (include): New const char *.
16576 (getargs): Add case '-I'.
16577 * src/options.c (option_table): Add include as command line and
16578 percent option.
16579 * src/lex.h (token_t): Add tok_include.
16580
2ca209c1
AD
165812001-11-26 Akim Demaille <akim@epita.fr>
16582
16583 * src/reader.c (readgram): Make sure rules for mid-rule actions
16584 have a lineno equal to that of their host rule.
16585 Reported by Hans Aberg.
16586 * tests/regression.at (Rule Line Numbers): New.
16587
0e41b407
AD
165882001-11-26 Akim Demaille <akim@epita.fr>
16589
16590 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
16591 size_ts.
16592
165932001-11-26 Akim Demaille <akim@epita.fr>
16594
16595 * src/complain.c, src/complain.h (error): Remove, provided by
16596 lib/error.[ch].
16597
e0c40012
AD
165982001-11-26 Akim Demaille <akim@epita.fr>
16599
16600 * src/reader.c (read_declarations): Don't abort on tok_illegal,
16601 issue an error message.
16602 * tests/regression.at (Invalid %directive): New.
16603 Reported by Hans Aberg.
16604
5e147124
AD
166052001-11-26 Akim Demaille <akim@epita.fr>
16606
16607 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
16608 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16609
a034c8b8
AD
166102001-11-26 Akim Demaille <akim@epita.fr>
16611
16612 * src/conflicts.c (conflicts_print): Don't complain at all when
16613 there are no reduce/reduce conflicts, and as many shift/reduce
16614 conflicts as expected.
16615 * tests/regression.at (%expect right): Adjust.
16616
c64a20f3
AD
166172001-11-23 Akim Demaille <akim@epita.fr>
16618
16619 * lib/alloca.c: Update, from fileutils.
16620
5b0d29bb
AD
166212001-11-23 Akim Demaille <akim@epita.fr>
16622
16623 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
16624
722c4bfe
AD
166252001-11-23 Akim Demaille <akim@epita.fr>
16626
16627 * src/system.h: Include alloca.h.
16628 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
16629
6255b435
AD
166302001-11-23 Akim Demaille <akim@epita.fr>
16631
16632 * src/print_graph.c (print_actions): Remove `rule', unused.
16633 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
16634 pacify GCC's signed < unsigned warnings.
16635 * src/closure.c (itemsetsize): Likewise.
16636 * src/reader.c (symbol_list_new): Static.
16637
b29b2ed5
AD
166382001-11-23 Akim Demaille <akim@epita.fr>
16639
16640 Attaching lineno to buckets is stupid, since only one copy of each
16641 symbol is kept, only the line of the first occurrence is kept too.
16642
16643 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
16644 * src/reader.c (rline_allocated): Remove, unused.
16645 (symbol_list): Have a `line' member.
16646 (symbol_list_new): New.
16647 (readgram): Use it.
16648 * src/print.c (print_grammar): Output the rule line numbers.
16649 * tests/regression.at (Solved SR Conflicts)
16650 (Unresolved SR Conflicts): Adjust.
16651 Reported by Hans Aberg.
16652
a81b1d4a
MA
166532001-11-22 Marc Autret <autret_m@epita.fr>
16654
16655 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
16656
c1ecb3c1
MA
166572001-11-22 Marc Autret <autret_m@epita.fr>
16658
16659 * src/muscle_tab.c (muscle_init): Remove initialization of
16660 skeleton muscle.
16661 * src/output.c (output_master_parser): Do it here.
16662
fbe01355
AD
166632001-11-20 Akim Demaille <akim@epita.fr>
16664
16665 * po/sv.po: New.
16666 * configure.in (ALL_LINGUAS): Adjust.
16667 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
16668 longer contains strings to translate.
16669
81e895c0
AD
166702001-11-19 Akim Demaille <akim@epita.fr>
16671
16672 * src/conflicts.c (conflicts_print): Add a missing \n.
16673
6bb1878b
AD
166742001-11-19 Akim Demaille <akim@epita.fr>
16675
16676 * src/nullable.c (nullable_print): New.
16677 (set_nullable): Call it when tracing.
16678 Better locality of variables.
16679
d9ec2d07
AD
166802001-11-19 Akim Demaille <akim@epita.fr>
16681
16682 * src/print.c (print_actions): Better locality of variables.
16683
720e5c1b
AD
166842001-11-19 Akim Demaille <akim@epita.fr>
16685
16686 * src/derives.c (print_derives): Fix and enrich.
16687 * src/closure.c (print_fderives): Likewise.
16688
fb908786
AD
166892001-11-19 Akim Demaille <akim@epita.fr>
16690
16691 * src/closure.c (itemsetend): Remove, replaced with...
16692 (itemsetsize): new.
16693
125ecb56
AD
166942001-11-19 Akim Demaille <akim@epita.fr>
16695
16696 * src/LR0.c (kernel_end): Remove, replaced with...
16697 (kernel_size): new.
16698
d8cf039f
AD
166992001-11-19 Akim Demaille <akim@epita.fr>
16700
16701 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
16702 to clarify.
16703
7bec0760
AD
167042001-11-19 Akim Demaille <akim@epita.fr>
16705
16706 * src/closure.c (closure): Use arrays instead of pointers to clarify.
16707
c87d4863
AD
167082001-11-19 Akim Demaille <akim@epita.fr>
16709
16710 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
16711 trace messages.
16712 * src/LR0.c: Likewise.
16713 (allocate_itemsets): Use arrays instead of pointers to clarify.
16714
9bfe901c
AD
167152001-11-19 Akim Demaille <akim@epita.fr>
16716
16717 * src/getargs.c (statistics_flag): Replace with...
16718 (trace_flag): New.
16719 (longopts): Accept --trace instead of --statistics.
16720 * src/getargs.h, src/options.c: Adjust.
16721 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
16722 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
16723
97db7bd4
AD
167242001-11-19 Akim Demaille <akim@epita.fr>
16725
cc72668c 16726 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
16727 pointers to clarify the code.
16728 (save_reductions, save_shifts): Factor common parts of alternatives.
16729
2c5f66ed
AD
167302001-11-19 Akim Demaille <akim@epita.fr>
16731
16732 * src/LR0.c (new_state, get_state): Complete TRACE code.
16733 * src/closure.c: Include `reader.h' to get `tags', needed by the
16734 trace code.
16735 Rename the conditional DEBUG as TRACE.
16736 Output consistently TRACEs to stderr, not stdout.
16737 * src/derives.c: Likewise.
16738 * src/reduce.c: (inaccessable_symbols): Using if is better style
16739 than goto.
16740 Use `#if TRACE' instead of `#if 0' for tracing code.
16741
300f275f
AD
167422001-11-19 Akim Demaille <akim@epita.fr>
16743
16744 * src/system.h (LIST_FREE, shortcpy): New.
16745 * src/LR0.c: Use them.
16746 * src/output.c (free_itemsets, free_reductions, free_shifts):
16747 Remove, replaced by LIST_FREE.
16748
f59c437a
AD
167492001-11-19 Akim Demaille <akim@epita.fr>
16750
16751 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
16752 (REDUCTIONS_ALLOC): New.
16753 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
16754 allocation.
16755
6986fd9e
AD
167562001-11-19 Akim Demaille <akim@epita.fr>
16757
16758 * src/LR0.c (new_state): Complete trace code.
16759 * src/nullable.c (set_nullable): Don't translate traces.
16760
4bc30f78
AD
167612001-11-19 Akim Demaille <akim@epita.fr>
16762
16763 * src/print_graph.c (print_core): Better locality of variables.
16764 * src/print.c (print_core): Likewise.
16765
08a946e0
AD
167662001-11-19 Akim Demaille <akim@epita.fr>
16767
16768 * src/vcg.c: You do the output, so you are responsible of the
16769 handling of VCG syntax, in particular: use quotearg.
16770 * src/print_graph.c: Don't.
16771 (print_actions): Don't output the actions as part of the nodes,
16772 since that's the job of the edges.
16773 (print_state): Don't output by hand: fill the node description,
9bfe901c 16774 and ask for its output.
08a946e0 16775
f0473484
AD
167762001-11-19 Akim Demaille <akim@epita.fr>
16777
cc72668c
AD
16778 * src/bison.simple (yyparse): When verbosely reporting an error,
16779 no longer put additional quotes around token names.
f0473484
AD
16780 * tests/calc.at: Adjust.
16781
e41dc700
AD
167822001-11-19 Akim Demaille <akim@epita.fr>
16783
16784 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
16785 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
16786 * src/output.c: Adjust.
16787
652a871c
AD
167882001-11-19 Akim Demaille <akim@epita.fr>
16789
16790 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
16791 (rule_t): this.
16792 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
16793
b2ed6e58
AD
167942001-11-19 Akim Demaille <akim@epita.fr>
16795
16796 * src/gram.h (rule_t): New.
16797 (rule_table): New.
16798 (rrhs, rlhs): Remove, part of state_t.
16799 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
16800 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16801 * src/reader.c, src/reduce.c: Adjust.
16802
edad7067
AD
168032001-11-19 Akim Demaille <akim@epita.fr>
16804
16805 * src/reader.c (symbols_output): New, extracted from...
16806 (packsymbols): Here.
16807 (reader): Call it.
16808
3feec034
AD
168092001-11-19 Akim Demaille <akim@epita.fr>
16810
16811 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
16812 (maxrhs): this new function.
16813
ddcd5fdf
AD
168142001-11-19 Akim Demaille <akim@epita.fr>
16815
cc72668c 16816 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
16817 Adjust.
16818
bb527fc2
AD
168192001-11-19 Akim Demaille <akim@epita.fr>
16820
cc72668c 16821 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
16822 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16823 * src/lalr.c: Adjust.
16824
a845a697
AD
168252001-11-19 Akim Demaille <akim@epita.fr>
16826
16827 * src/lalr.c (initialize_LA): Only initialize LA. Let...
16828 (set_state_table): handle the `lookaheads' members.
16829
f004bf6a
AD
168302001-11-19 Akim Demaille <akim@epita.fr>
16831
cc72668c
AD
16832 * src/lalr.h (lookaheads): Removed array, whose contents is now
16833 a member of...
f004bf6a
AD
16834 (state_t): this structure.
16835 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16836 Adjust.
16837
de326cc0
AD
168382001-11-19 Akim Demaille <akim@epita.fr>
16839
cc72668c
AD
16840 * src/lalr.h (consistent): Removed array, whose contents is now
16841 a member of...
de326cc0
AD
16842 (state_t): this structure.
16843 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16844 Adjust.
16845
90b4416b
AD
168462001-11-19 Akim Demaille <akim@epita.fr>
16847
cc72668c
AD
16848 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
16849 contents are now members of...
90b4416b
AD
16850 (state_t): this structure.
16851 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16852 Adjust.
16853
9703cc49
AD
168542001-11-19 Akim Demaille <akim@epita.fr>
16855
16856 * src/lalr.h (state_t): New.
16857 (state_table): Be a state_t * instead of a core **.
16858 (accessing_symbol): Remove, part of state_t.
16859 * src/lalr.c: Adjust.
16860 (set_accessing_symbol): Merge into...
16861 (set_state_table): this.
16862 * src/print_graph.c, src/conflicts.c: Adjust.
16863
d803322e
AD
168642001-11-14 Akim Demaille <akim@epita.fr>
16865
16866 * tests/calc.at, tests/output.at, tests/regression.at,
16867 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
16868 now the tests are run in private dirs, therefore AC_CLEANUP and
16869 family can be simplified to 0-ary.
16870 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
16871 use abs. path to find config.h.
16872 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
16873 stderr, there can be way too much random noise.
16874 Instead pass -Werror to GCC and rely on the exit status.
16875 Reported by Wolfram Wagner.
16876
3d76b07d
AD
168772001-11-14 Akim Demaille <akim@epita.fr>
16878
16879 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
16880 defined only if yyoverflow is defined, to avoid `warning: unused
16881 variable `yyvs1''.
16882 Reported by The Test Suite.
16883
09b503c8
AD
168842001-11-14 Akim Demaille <akim@epita.fr>
16885
16886 * src/print.c: Include reduce.h.
16887 Reported by Hans Aberg.
16888
168892001-11-14 Akim Demaille <akim@epita.fr>
16890
16891 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
16892 Revert a previous patch: these are really const.
16893 * src/conflicts.c (conflict_report): Additional useless pair of
16894 braces to pacify GCC's warnings for `if () if () {} else {}'.
16895 * src/lex.c (parse_percent_token): Replace equal_offset with
16896 arg_offset.
16897 arg is const.
16898 Be sure to strdup `arg' when used, since there is no reason for
16899 token_buffer not to change.
16900
0f37a994
AD
169012001-11-14 Akim Demaille <akim@epita.fr>
16902
16903 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
16904 definition.
16905 * src/main.c (main): Use them.
16906 Suggested by Hans Aberg.
16907
d39d93b8
AD
169082001-11-12 Akim Demaille <akim@epita.fr>
16909
16910 * src/system.h (ngettext): Now that we use ngettext, be sure to
16911 provide a default definition when NLS are not used.
16912
9edcd895
AD
169132001-11-12 Akim Demaille <akim@epita.fr>
16914
16915 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
16916 Use @kbd to denote user input.
16917 (Language and Grammar): ANSIfy the example.
16918 Adjust its layout for info/notinfo.
16919 (Location Tracking Calc): Output error messages to stderr.
16920 Output locations in a more GNUtically correct way.
16921 Fix a couple of Englishos.
16922 Adjust @group/@end group pairs.
16923
7da99ede
AD
169242001-11-12 Akim Demaille <akim@epita.fr>
16925
e3aa65c5 16926 %expect was not functioning at all.
7da99ede
AD
16927
16928 * src/conflicts.c (expected_conflicts): Set to -1.
16929 (conflict_report): Use ngettext.
16930 (conflicts_print): Check %expect and make its violation an error.
16931 * doc/bison.texinfo (Expect Decl): Adjust.
16932 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
16933 * tests/regression.at (%expect not enough, %expect right)
16934 (%expect too much): New.
16935
ba9dda1a
AD
169362001-11-12 Akim Demaille <akim@epita.fr>
16937
16938 * tests/regression.at (Conflicts): Rename as...
16939 (Unresolved SR Conflicts): this.
16940 (Solved SR Conflicts): New.
16941
337c5bd1
AD
169422001-11-12 Akim Demaille <akim@epita.fr>
16943
16944 * src/reduce.c (print_results): Rename as...
16945 (reduce_output): This.
16946 Output to OUT, passed as argument, instead of output_obstack.
16947 (dump_grammar): Likewise.
16948 (reduce_free): New.
16949 Also free V1.
16950 (reduce_grammar): No longer call reduce_output, since...
16951 * src/print.c (print_results): do it.
16952 * src/main.c (main): Call reduce_free;
16953
c73a41af
AD
169542001-11-12 Akim Demaille <akim@epita.fr>
16955
16956 * src/conflicts.c (print_reductions): Accept OUT as argument.
16957 Output to it, not to output_obstack.
16958 * src/print.c (print_actions): Adjust.
16959
0df87bb6
AD
169602001-11-12 Akim Demaille <akim@epita.fr>
16961
16962 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
16963 the result instead of using...
16964 (src_total, rrc_total, src_count, rrc_count): Remove.
16965 (any_conflicts): Remove.
16966 (print_conflicts): Split into...
16967 (conflicts_print, conflicts_output): New.
16968 * src/conflicts.h: Adjust.
16969 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 16970 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
16971 * tests/regression.at (Conflicts): New.
16972 Reported by Tom Lane.
16973
e4d3d4de
AD
169742001-11-12 Akim Demaille <akim@epita.fr>
16975
16976 * tests/regression.at (Invalid input): Remove, duplicate with
16977 ``Invalid input: 1''.
16978
6d7d248e
AD
169792001-11-12 Akim Demaille <akim@epita.fr>
16980
16981 * tests/torture.at (AT_DATA_STACK_TORTURE)
16982 (Exploding the Stack Size with Alloca)
16983 (Exploding the Stack Size with Malloc): New.
16984
e9e4c321
AD
169852001-11-12 Akim Demaille <akim@epita.fr>
16986
16987 * src/bison.simple (YYSTACK_REALLOC): New.
16988 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 16989 Reported by Per Allansson.
e9e4c321 16990
5f7e0832
AD
169912001-11-12 Pascal Bart <pascal.bart@epita.fr>
16992
16993 * src/bison.simple: Define type yystype instead of YYSTYPE, and
16994 define CPP macro, which substitute YYSTYPE by yystype.
16995 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
16996 with yyltype/YYLTYPE. This allows inclusion of the generated
16997 header within the parser if the compiler, such as GGC, accepts
16998 multiple equivalent #defines.
16999 From Akim.
17000
e3f1699f
AD
170012001-11-05 Akim Demaille <akim@epita.fr>
17002
17003 * src/reader.c (symbols_output): New, extracted from...
17004 (packsymbols): here.
17005 (reader): Adjust.
17006
65be0866
AD
170072001-11-05 Akim Demaille <akim@epita.fr>
17008
17009 * src/lex.c (parse_percent_token): s/quotearg/quote/.
17010
e4d910bf
AD
170112001-11-05 Akim Demaille <akim@epita.fr>
17012
17013 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
17014 pattern.
17015
951366c1
AD
170162001-11-05 Akim Demaille <akim@epita.fr>
17017
17018 * src/options.h (struct option_table_struct): set_flags is void*.
17019 * src/options.c (longopts): Support `--output' and `%output'.
17020 (usage): Adjust.
17021 * src/lex.h (tok_setopt): Remove, replaced with...
17022 (tok_intopt, tok_stropt): these new guys.
17023 * src/lex.c (getopt.h): Not needed.
17024 (token_buffer, unlexed_token_buffer): Not const.
17025 (percent_table): Promote `-' over `_' in directive names.
17026 Active `%name-prefix', `file-prefix', and `output'.
17027 (parse_percent_token): Accept possible arguments to directives.
17028 Promote `-' over `_' in directive names.
17029
d8988b2f
AD
170302001-11-04 Akim Demaille <akim@epita.fr>
17031
17032 * doc/bison.texinfo (Decl Summary): Split the list into
17033 `directives for grammars' and `directives for bison'.
17034 Sort'em.
17035 Add description of `%name-prefix', `file-prefix', and `output'.
17036 Promote `-' over `_' in directive names.
17037 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
17038 Simplify the description of `--name-prefix'.
17039 Promote `-' over `_' in directive names.
17040 Promote `--output' over `--output-file'.
17041 Fix the description of `--defines'.
17042 * tests/output.at: Exercise %file-prefix and %output.
17043
6468d18e
AD
170442001-11-02 Akim Demaille <akim@epita.fr>
17045
17046 * doc/refcard.tex: Update.
17047
6b7e85b9
AD
170482001-11-02 Akim Demaille <akim@epita.fr>
17049
17050 * src/symtab.h (SUNDEF): New.
17051 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
17052 stand for `uninitialized', instead of 0.
17053 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
17054 * src/lex.c (lex): Adjust.
17055
17056 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
17057 Number it 0.
17058 Let yylex return it instead of a plain 0.
17059 Reported by Dick Streefland.
17060
cd5aafcf
AD
170612001-11-02 Akim Demaille <akim@epita.fr>
17062
17063 * tests/regression.at (Mixing %token styles): New test.
17064
037ca2f1
AD
170652001-11-02 Akim Demaille <akim@epita.fr>
17066
17067 * src/reader.c (parse_thong_decl): Formatting changes.
17068 (token_translations_init): New, extracted from...
17069 (packsymbols): Here.
17070 Adjust.
17071
270a173c
AD
170722001-11-01 Akim Demaille <akim@epita.fr>
17073
17074 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
17075 Check that `9foo.y' produces correct cpp guards.
17076 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
17077 guards.
17078 Reported by Wwp.
17079
561f9a30
AD
170802001-11-01 Akim Demaille <akim@epita.fr>
17081
17082 * tests/regression.at (Invalid input: 2): New.
17083 * src/lex.c (unlexed_token_buffer): New.
17084 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
17085 too.
17086 Reported by Wwp.
17087
f987e9d2
AD
170882001-11-01 Akim Demaille <akim@epita.fr>
17089
17090 * tests/calc.at: Catch up with 1.30.
17091 * configure.in: Bump to 1.49a.
17092 Adjust to newer Autotest.
17093
0846f581
PB
170942001-10-19 Pascal Bart <pascal.bart@epita.fr>
17095
17096 * src/conflicts.c: Move global variables rrc_total and src_total ...
17097 (print_conflicts): here.
17098 * src/output.c (output): Free global variable user_toknums.
17099 * src/lex.c (token_obstack): Become static.
17100
3c1a79b3
AD
171012001-10-18 Akim Demaille <akim@epita.fr>
17102
17103 * tests/atlocal.in (GCC): Add.
17104 * tests/calc.at: s/m4_match/m4_bmatch/.
17105 s/m4_patsubst/m4_bpatsubst/.
17106 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
17107 * configure.in: AC_SUBST(GCC).
17108
5d52e7d0
MA
171092001-10-14 Marc Autret <autret_m@epita.fr>
17110
17111 * src/options.c (create_long_option_table): Fix.
17112
631aa1d3
AD
171132001-10-10 Akim Demaille <akim@epita.fr>
17114
17115 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
17116
f6ec6d13
AD
171172001-10-04 Akim Demaille <akim@epita.fr>
17118
17119 * src/reader.c (parse_union_decl): Push the caracters in
17120 union_obstack, not attrs_obstack.
17121
342b8b6e
AD
171222001-10-04 Akim Demaille <akim@epita.fr>
17123
17124 Merge in the branch 1.29.
17125
17126 * src/reader.c (packsymbols): Use a temporary obstack for
17127 `%%tokendef', since output_stack is already used elsewhere.
17128
17129 2001-10-02 Akim Demaille <akim@epita.fr>
17130
17131 Bump 1.29d.
17132
17133 2001-10-02 Akim Demaille <akim@epita.fr>
17134
17135 Version 1.29c.
17136
17137 2001-10-02 Akim Demaille <akim@epita.fr>
17138
17139 * tests/regression.at (Invalid CPP headers): New.
17140 From Alexander Belopolsky.
17141 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
17142
17143 2001-10-02 Akim Demaille <akim@epita.fr>
17144
17145 * tests/regression.at (Invalid input): New.
17146 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
17147 Reported by Shura.
17148
17149 2001-10-02 Akim Demaille <akim@epita.fr>
17150
17151 * tests/calc.at: Now that --debug works, the tests must be adjusted.
17152
17153 2001-10-02 Akim Demaille <akim@epita.fr>
17154
17155 * src/output.c (output_parser): Assert `skeleton'.
17156 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
17157 systems.
17158 From Shura.
17159
17160 2001-10-01 Marc Autret <autret_m@epita.fr>
17161
17162 * src/lex.h: Echo modifications.
17163 * src/lex.c (unlex): Parameter is now token_t.
17164 From Hans Aberg.
17165
17166 2001-10-01 Marc Autret <autret_m@epita.fr>
17167
17168 * src/main.c: Include lex.h.
17169 From Hans Aberg.
17170
17171 2001-09-29 Akim Demaille <akim@epita.fr>
17172
17173 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
17174
17175 2001-09-28 Akim Demaille <akim@epita.fr>
17176
17177 * tests/testsuite.at: Update to newer Autotest.
17178 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
17179
17180 2001-09-27 Akim Demaille <akim@epita.fr>
17181
17182 Position independent wrapper.
17183
17184 * tests/bison: Remove.
17185 * tests/bison.in: New.
17186 * configure.in: Adjust.
17187
17188 2001-09-27 Paul Eggert <eggert@twinsun.com>
17189
17190 Port quotearg fixes from tar 1.13.24.
17191
17192 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
17193 tm to be declared.
17194 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
17195 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
17196
17197 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
17198 * m4/mbrtowc.m4: New file.
17199 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
17200 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
17201
17202 2001-09-27 Akim Demaille <akim@epita.fr>
17203
17204 Bump to 1.29c.
17205
17206 2001-09-27 Akim Demaille <akim@epita.fr>
17207
17208 Version 1.29b.
17209
17210 2001-09-25 Akim Demaille <akim@epita.fr>
17211
17212 * src/system.h: Include `xalloc.h'.
17213 Remove it from the C files.
17214 * src/files.c (output_files): Free the obstacks.
17215 * src/lex.c (init_lex): Rename as...
17216 (lex_init): this.
17217 (lex_free): New.
17218 * src/main.c (main): Use it.
17219
17220 2001-09-24 Marc Autret <autret_m@epita.fr>
17221
17222 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
17223 to output informations in fout (FILE*).
17224 (open_graph, close_graph): Likewise.
17225 (output_graph, output_edge, output_node): Likewise.
17226 * src/vcg.h: Update function prototypes.
17227 * src/print_graph.c (print_graph): Open output graph file.
17228 (print_actions): Adjust.
17229 * src/files.h: Remove extern declaration.
17230 * src/files.c: Remove graph_obstack declaration.
17231 (open_files): Remove graph_obstack initialization.
17232 (output_files): Remove graph_obstack saving.
17233
17234 2001-09-24 Marc Autret <autret_m@epita.fr>
17235
17236 * src/files.c (compute_output_file_names): Fix.
17237
17238 2001-09-24 Marc Autret <autret_m@epita.fr>,
17239 Akim Demaille <akim@epita.fr>
17240
17241 * src/reader.c (reader): Remove call to free_symtab ().
17242 * src/main.c (main): Call it here.
17243 Include symtab.h.
17244 * src/conflicts.c (initialize_conflicts): Rename as...
17245 (solve_conflicts): this.
17246 * src/print.c (print_core, print_actions, print_state)
17247 (print_grammar): Dump to a file instead a `output_obstack'.
17248 (print_results): Dump `output_obstack', and then proceed with the
17249 FILE *.
17250 * src/files.c (compute_output_file_names, close_files): New.
17251 (output_files): Adjust.
17252 * src/main.c (main): Adjust.
17253
17254 2001-09-23 Marc Autret <autret_m@epita.fr>
17255
17256 * src/files.c (compute_header_macro): Computes header macro name
17257 from spec_defines_file when given.
17258
17259 2001-09-23 Marc Autret <autret_m@epita.fr>
17260
17261 * src/files.c (output_files): Add default extensions.
17262
17263 2001-09-22 Akim Demaille <akim@epita.fr>
17264
17265 * src/conflicts.c (finalize_conflicts): Rename as...
17266 (free_conflicts): this.
17267
17268 2001-09-22 Akim Demaille <akim@epita.fr>
17269
17270 * src/gram.c (gram_free): Rename back as...
17271 (dummy): this.
17272 (output_token_translations): Free `token_translations'.
17273 * src/symtab.c (free_symtab): Free the tag field.
17274
17275 2001-09-22 Akim Demaille <akim@epita.fr>
17276
17277 Remove `translations' as it is always set to true.
17278
17279 * src/gram.h: Adjust.
17280 * src/reader.c (packsymbols, parse_token_decl): Adjust
17281 * src/print.c (print_grammar): Adjust.
17282 * src/output.c (output_token_translations): Adjust.
17283 * src/lex.c (lex): Adjust.
17284 * src/gram.c: Be sure the set pointers to NULL.
17285 (dummy): Rename as...
17286 (gram_free): this.
17287
17288 2001-09-22 Akim Demaille <akim@epita.fr>
17289
17290 * configure.in: Invoke AM_LIB_DMALLOC.
17291 * src/system.h: Use dmalloc.
17292 * src/LR0.c: Be sure to have pointers initialized to NULL.
17293 (allocate_itemsets): Allocate kernel_items only if needed.
17294
17295 2001-09-22 Akim Demaille <akim@epita.fr>
17296
17297 * configure.in: Bump to 1.29b.
17298 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
17299 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
17300 need xmalloc.c in calc.y.
17301 From Pascal Bart.
17302
17303 2001-09-21 Akim Demaille <akim@epita.fr>
17304
17305 Version 1.29a.
17306 * Makefile.maint, config/config.guess, config/config.sub,
17307 * config/missing: Update from masters.
17308 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
17309 upon package.m4.
17310 * configure.in (ALL_LINGUAS): Add `tr'.
17311
17312 2001-09-21 Akim Demaille <akim@epita.fr>
17313
17314 * tests/Makefile.am (package.m4): Move to...
17315 ($(srcdir)/$(TESTSUITE)): here.
17316
17317 2001-09-20 Akim Demaille <akim@epita.fr>
17318
17319 * src/complain.c: No longer try to be standalone: use system.h.
17320 Don't assume __STDC__ is defined to 1. Just test if it is defined.
17321 * src/complain.h: Likewise.
17322 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
17323 Remove the unused variable `n'.
17324 From Albert Chin-A-Young.
17325
17326 2001-09-18 Marc Autret <autret_m@epita.fr>
17327
17328 * doc/bison.1: Update.
17329 * doc/bison.texinfo (Bison Options): Update --defines and --graph
17330 descriptions.
17331 (Option Cross Key): Update.
17332 Add --graph.
17333
17334 2001-09-18 Marc Autret <autret_m@epita.fr>
17335
17336 * tests/regression.at: New test (comment in %union).
17337
17338 2001-09-18 Marc Autret <autret_m@epita.fr>
17339
17340 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
17341 do that.
17342 Reported by Keith Browne.
17343
17344 2001-09-18 Marc Autret <autret_m@epita.fr>
17345
17346 * tests/output.at: Add tests for --defines and --graph.
17347
17348 2001-09-18 Marc Autret <autret_m@epita.fr>
17349
17350 * tests/output.at: Removes tests of %{header,src}_extension features.
17351
17352 2001-09-18 Akim Demaille <akim@epita.fr>
17353
17354 * tests/Makefile.am (package.m4): New.
17355 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
17356 (_AT_CHECK_CALC_ERROR): Likewise.
17357 Factor the `, ' part of verbose error messages.
17358
17359 2001-09-18 Marc Autret <autret_m@epita.fr>
17360
17361 * src/getargs.c (longopts): Declare --defines and --graph as options
17362 with optional arguments.
17363 * src/files.h: Add extern declarations.
17364 * src/files.c (spec_graph_file, spec_defines_file): New.
17365 (output_files): Update.
17366 Remove CPP-outed code.
17367
17368 2001-09-18 Marc Autret <autret_m@epita.fr>
17369
17370 Turn off %{source,header}_extension feature.
17371
17372 * src/files.c (compute_exts_from_gf): Update.
17373 (compute_exts_from_src): Update.
17374 (output_files): CPP-out useless code.
17375 * src/files.h: Remove {header,source}_extension extern declarations.
17376 * src/reader.c (parse_dquoted_param): CPP-out.
17377 (parse_header_extension_decl): Remove.
17378 (parse_source_extension_decl): Remove.
17379 (read_declarations): Remove cases tok_{hdrext,srcext}.
17380 * src/lex.c (percent_table): Remove {header,source}_extension entries.
17381 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
17382
17383 2001-09-10 Akim Demaille <akim@epita.fr>
17384
17385 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
17386 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
17387 (AT_CHECK_OUTPUT): this.
17388 Merely check ls' exit status, its output is useless.
17389
17390 2001-09-10 Akim Demaille <akim@epita.fr>
17391
17392 * tests/calc.at: Use m4_match.
17393 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
17394
17395 2001-09-10 Marc Autret <autret_m@epita.fr>,
17396 Akim Demaille <akim@epita.fr>
17397
17398 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
17399 enum color_e.
17400 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
17401 to `normal'.
17402 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
17403 * src/lex.h: Adjust prototype.
17404 (token_t): Add `tok_undef'.
17405 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
17406 (parse_percent_token): Now returns token_t.
17407 Add default statement in switch.
17408 (lex): Separate `c' as an input variable, from the token_t result
17409 part.
17410 (unlexed): Is a token_t.
17411
17412 2001-09-10 Akim Demaille <akim@epita.fr>
17413
17414 * configure.in: Bump to 1.29a.
17415
17416 2001-09-07 Akim Demaille <akim@epita.fr>
17417
17418 Version 1.29.
17419
17420 2001-08-30 Akim Demaille <akim@epita.fr>
17421
17422 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
17423 * m4/atconfig.m4: Remove.
17424 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
17425 * tests/bison: New.
17426 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
17427 m4_if, m4_patsubst, and m4_regexp.
17428 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
17429 `input' file instead of echo.
17430
17431 2001-08-29 Akim Demaille <akim@epita.fr>
17432
17433 Bump to 1.28e.
17434
17435 2001-08-29 Akim Demaille <akim@epita.fr>
17436
17437 Version 1.28d.
17438
17439 2001-08-29 Paul Eggert <eggert@twinsun.com>
17440
17441 * src/bison.simple (yyparse): Don't take the address of an
17442 item before the start of an array, as that doesn't conform to
17443 the C Standard.
17444
17445 2001-08-29 Robert Anisko <anisko_r@epita.fr>
17446
17447 * doc/bison.texinfo (Location Tracking Calc): New node.
17448
17449 2001-08-29 Paul Eggert <eggert@twinsun.com>
17450
17451 * src/output.c (output): Do not define const, as this now
17452 causes more problems than it cures.
17453
17454 2001-08-29 Akim Demaille <akim@epita.fr>
17455
17456 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
17457 the nodes.
17458 Be sure to tag the `detailmenu'.
17459
17460 2001-08-29 Akim Demaille <akim@epita.fr>
17461
17462 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
17463 download in a tmp dir.
17464
17465 2001-08-28 Marc Autret <autret_m@epita.fr>
17466
17467 * config/depcomp: New file.
17468
17469 2001-08-28 Marc Autret <autret_m@epita.fr>
17470
17471 * doc/bison.1 (mandoc): Adjust.
17472 From Juan Manuel Guerrero.
17473
17474 2001-08-28 Marc Autret <autret_m@epita.fr>
17475
17476 * src/print_graph.c (print_state): Fix.
17477
17478 2001-08-27 Marc Autret <autret_m@epita.fr>
17479
17480 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
17481 char * members.
17482 Echo modifications to the functions prototypes.
17483 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
17484
17485 2001-08-27 Marc Autret <autret_m@epita.fr>
17486
17487 * src/vcg.c: Include `xalloc.h'.
17488 (add_colorentry): New.
17489 (add_classname): New.
17490 (add_infoname): New.
17491 * src/vcg.h: Add new prototypes.
17492
17493 2001-08-27 Akim Demaille <akim@epita.fr>
17494
17495 * Makefile.maint: Sync. again with CVS Autoconf.
17496
17497 2001-08-27 Akim Demaille <akim@epita.fr>
17498
17499 * Makefile.maint: Formatting changes.
17500 (po-update, cvs-update, update): New targets.
17501 (AMTAR): Remove.
17502
17503 2001-08-27 Akim Demaille <akim@epita.fr>
17504
17505 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17506 * Makefile.maint: Sync. with CVS Autoconf.
17507
17508 2001-08-27 Marc Autret <autret_m@epita.fr>
17509
17510 * src/vcg.h (struct infoname_s): New.
17511 (struct colorentry_s): New.
17512 (graph_s): New fields {vertical,horizontal}_order in structure.
17513 Add `infoname' field.
17514 Add `colorentry' field;
17515 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
17516 (G_HORIZONTAL_ORDER): New.
17517 (G_INFONAME): New.
17518 (G_COLORENTRY): New.
17519 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
17520 Add output of `infoname'.
17521 Add output of `colorentry'.
17522
17523 2001-08-27 Marc Autret <autret_m@epita.fr>
17524
17525 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
17526 This one shadowed a global parameter.
17527
17528 2001-08-24 Marc Autret <autret_m@epita.fr>
17529
17530 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
17531 instead of `unsigned'.
17532 (print_state): Do not call obstack_object_size () in obstack_grow ()
17533 to avoid macro variables shadowing.
17534
17535 2001-08-23 Marc Autret <autret_m@epita.fr>
17536
17537 * src/lex.c (percent_table): Typo: s/naem/name/.
17538 Add graph option.
17539 Normalize new options declarations.
17540
17541 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
17542
17543 * tests/suite.at: Exercise %header_extension and %source_extension.
17544
17545 2001-08-16 Marc Autret <autret_m@epita.fr>
17546
17547 * src/reader.c (parse_dquoted_param): New.
17548 (parse_header_extension_decl): Use it.
17549 (parse_source_extension_decl): Likewise.
17550
17551 2001-08-16 Marc Autret <autret_m@epita.fr>
17552
17553 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
17554 (get_xxxx_str): Use assert () instead of complain ().
17555 Remove return invokations in default cases.
17556 (get_decision_str): Modify default behaviour. Remove second argument.
17557 Echo modifications on calls.
17558 (output_graph): Fix.
17559
17560 2001-08-16 Marc Autret <autret_m@epita.fr>
17561
17562 * src/getargs.c (usage): Update with ``-g, --graph''.
17563
17564 2001-08-16 Marc Autret <autret_m@epita.fr>
17565
17566 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
17567 (Option Cross Key): Likewise.
17568 * doc/bison.1: Update.
17569
1c8c2190
PB
175702001-09-25 Pascal Bart <pascal.bart@epita.fr>
17571
17572 * src/output.c (output_master_parser): Don't finish action_obstack.
17573 (output_parser): Don't care about the muscle action, here.
17574 (prepare): Copy the action_obstack in the action muscle.
17575 (output): Free action_obstack.
17576
180d45ba
PB
175772001-09-23 Pascal Bart <pascal.bart@epita.fr>
17578
17579 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
17580 will contain `%union' declaration.
17581 (parse_union_decl): Delete #line directive output.
17582 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
17583 informations about %union.
17584 (parse_union_decl): Copy the union_obstack in the muscle stype.
17585 * src/bison.simple: Add new #line directive.
17586 Add typdef %%stype YYSTYPE.
17587
c51d1a19
PB
175882001-09-23 Pascal Bart <pascal.bart@epita.fr>
17589
17590 * src/bison.simple: Add new `#line' directive.
17591
6f9344da
PB
175922001-09-22 Pascal Bart <pascal.bart@epita.fr>
17593
17594 * src/bison.simple: New `#line' directive.
17595 * src/output.c (output_parser): Support new dynamic muscle input_line.
17596
652def80
MA
175972001-09-22 Marc Autret <autret_m@epita.fr>
17598
17599 * src/output.c (output_master_parser): New.
17600 (output_parser): Be more re-entrant.
17601
25b222fa
MA
176022001-09-21 Marc Autret <autret_m@epita.fr>
17603
17604 * src/reader.c (copy_definition, parse_union_decl): Update and use
17605 `linef' muscle.
17606 (copy_action): Likewise.
17607 Use obstack_1grow ().
17608 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
17609
6bc35ae5
MA
176102001-09-21 Marc Autret <autret_m@epita.fr>
17611
17612 * src/options.c (option_table): Adjust.
17613 * src/lex.c (parse_percent_token): Fix.
17614
c0629aa1
PB
176152001-09-20 Pascal Bart <pascal.bart@epita.fr>
17616
17617 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 17618
82b6d266
PB
176192001-09-20 Pascal Bart <pascal.bart@epita.fr>
17620
17621 * src/lex.c (parse_percent_token): Change type of variable `tx', which
17622 is now an option_table_struct*.
17623 (option_strcmp): New function option_strcmp.
17624 (parse_percent_token): Call option_strcmp.
17625 * src/getargs.c (xalloc.h, options.h): Include it.
17626 (getargs): Call create_long_option_table.
17627 (getargs): Free longopts at the end of the function.
17628 (shortopts): Move in options.c.
17629 * src/options.c (create_long_option_table): New function. Convert
17630 information from option_table to option structure.
17631 * src/reader.c (options.h): Include it.
17632
17633 * src/Makefile.am: Adjust.
17634 * src/options.c (option_table): Create from longopts and percent_table.
17635 * src/getargs.c (longopts): Delete.
17636 * src/lex.c (struct percent_table_struct): Delete.
17637 (percent_table): Delete.
17638 (options.h): Include it.
17639 * src/options.c: Create.
17640 * src/options.h: Create.
17641 Declare enum opt_access_e.
17642 Define struct option_table_struct.
17643
75f5aaea
MA
176442001-09-20 Marc Autret <autret_m@epita.fr>
17645
17646 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
17647 sections of Bison.
17648
f508cb0a
PB
176492001-09-19 Pascal Bart <pascal.bart@epita.fr>
17650
17651 * src/bison.simple: s/%%filename/%%skeleton.
17652 * src/muscle_tab.c (getargs.h): Include it.
17653 (muscle_init): Insert new muscle skeleton.
17654
13105fc1
PB
176552001-09-18 Pascal Bart <pascal.bart@epita.fr>
17656
17657 * src/output.c (output_parser): Delete unused variable actions_dumped.
17658
b0c4483e
PB
176592001-09-07 Pascal Bart <pascal.bart@epita.fr>
17660
17661 * src/output.c (output): Delete call to reader_output_yylsp.
17662 * src/reader.c (reader): Likewise.
ba0fe3c7 17663 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 17664
11d82f03
MA
176652001-09-02 Marc Autret <autret_m@epita.fr>
17666
17667 * src/reader.c: Include muscle_tab.h.
17668 (parse_union_decl): Update.
17669 (parse_macro_decl): Rename parse_muscle_decl.
17670 Update to use renamed functions and variable.
17671 (read_declarations, copy_action, read_additionnal_code, : Updated
17672 with correct variables and functions names.
17673 (packsymbols, reader): Likewise.
342b8b6e 17674
11d82f03 17675 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 17676
11d82f03
MA
17677 * src/output.c: Include muscle_tab.h
17678 In all functions using macro_insert, change by using muscle_insert ().
17679 (macro_obstack): Rename muscle_obstack.
17680 Echo modifications in the whole file.
17681 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
17682 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
17683 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
17684
17685 * src/muscle_tab.h: Update double inclusion macros.
17686 (macro_entry_s): Rename muscle_entry_s.
17687 Update prototypes.
342b8b6e 17688
11d82f03
MA
17689 * src/muscle_tab.c: Include muscle_tab.h.
17690 Rename macro_tabble to muscle_table.
17691 (mhash1, mhash2, mcmp): Use muscle_entry.
17692 (macro_init): Rename muscle_init. Update.
17693 (macro_insert): Rename muscle_insert. Update.
17694 (macro_find): Rename muscle_find. Update.
17695
17696 * src/main.c: Include muscle_tab.h.
17697 (main): Call muscle_init ().
17698 * src/Makefile.am (bison_SOURCES): Echo modifications.
17699
93a37297
MA
177002001-09-02 Marc Autret <autret_m@epita.fr>
17701
f753cd62 17702 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 17703
f753cd62
MA
17704 * src/muscle_tab.c, src/muscle_tab.h: Add files.
17705
177062001-09-02 Marc Autret <autret_m@epita.fr>
17707
17708 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 17709
682d48cd
PB
177102001-09-01 Pascal Bart <pascal.bart@epita.fr>
17711
342b8b6e 17712 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
17713 filename.
17714
087c8fda
MA
177152001-09-01 Marc Autret <autret_m@epita.fr>
17716
17717 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
17718 to an explicit value to activate the feature. We do it here.
17719
dda680cb
PB
177202001-08-31 Pascal Bart <pascal.bart@epita.fr>
17721
17722 * src/output.c (prepare): Delete the `filename' muscule insertion.
17723 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
17724 (parse_union_decl): Likewise.
17725 * src/macrotab.c (macro_init): Initialize filename by infile.
17726
9e644e64
MA
177272001-08-31 Marc Autret <autret_m@epita.fr>
17728
17729 * src/bison.simple (YYLSP_NEEDED): New definition.
17730 * src/output.c (prepare): Add macro insertion of `locations_flag'
17731
17da6427
PB
177322001-08-31 Pascal Bart <pascal.bart@epita.fr>
17733
17734 * src/output.c (prepare): Delete insertion of previous muscles,
17735 and insert the `prefix' muscles.
17736 * src/macrotab.c (macro_init): Likewise.
17737 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 17738 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
17739 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
17740 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 17741 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
17742 name_prefix.
17743
e8cb70b9
PB
177442001-08-31 Pascal Bart <pascal.bart@epita.fr>
17745
17746 * src/main.c (main): Standardize.
17747 * src/output.c (output_table_data, output_parser): Likewise.
17748 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
17749
63c2d5de
MA
177502001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
17751
342b8b6e 17752 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
17753 %%epilogue.
17754 * src/output.c (output): Rename %%declarations to %%prologue.
17755 * src/bison.simple: Echo modifications.
342b8b6e 17756
d8cb5183
MA
177572001-08-31 Marc Autret <autret_m@epita.fr>
17758
17759 * src/reader.c (readgram): CleanUp.
17760 (output_token_defines): Likewise.
17761 (packsymbols): Likewise.
17762 (reader): Likewise.
17763 * src/output.c (output): CPP-out useless code.
17764
6c686258
PB
177652001-08-31 Pascal Bart <pascal.bart@epita.fr>
17766
342b8b6e 17767 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
17768 output_trailers and output_headers.
17769 * src/output.h: Remove obsolete functions prototypes of output_headers
17770 and output_trailers.
17771
8f451ef7
PB
177722001-08-30 Pascal Bart <pascal.bart@epita.fr>
17773
17774 * src/main.c: Include macrotab.h.
342b8b6e 17775 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
17776 Adjust functions prototypes.
17777 * src/macrotab.c (macro_insert): Constify key and value.
17778 (macro_find): Constify key.
17779 (macro_insert): Include 'xalloc.h'
17780 (macro_insert): Use XMALLOC.
17781 (macro_find): Constify return value.
17782 * src/output.c (output_table_data): Rename table to table_data.
17783 (output_parser): Constify macro_key, macro_value.
17784
997b6fd0 177852001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
17786
17787 * src/reader.c (parse_skel_decl): New.
342b8b6e 17788 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
17789 * src/lex.h (token_t): New token `tok_skel'.
17790 * src/lex.c (percent_table): Add skeleton option entry.
17791 Standardize.
17792
ff48177d
MA
177932001-08-29 Marc Autret <autret_m@epita.fr>
17794
17795 * src/bison.simple: Add %%user_code directive at the end.
17796 * src/reader.c (read_additionnal_code): New.
17797 (reader): Use it.
17798 * src/output.c (output_program): Remove.
17799 (output): Update.
17800
b33160bf
MA
178012001-08-28 Marc Autret <autret_m@epita.fr>
17802
17803 * src/output.c (output_actions): Clean up.
4e5caae2 17804 (output_gram): CPP-out useless code.
b33160bf
MA
17805 * src/reader.c (reader): Clean up, CPP-out useless code.
17806
d1a2daf7
PB
178072001-08-28 Pascal Bart <pascal.bart@epita.fr>
17808
342b8b6e 17809 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 17810 directive.
d1a2daf7
PB
17811 * src/bison.simple: Add `%%definitions'.
17812
2b763dfe
MA
178132001-08-28 Marc Autret <autret_m@epita.fr>
17814
17815 * config/depcomp: New file.
17816
f1a87ef6
PE
178172001-08-27 Paul Eggert <eggert@twinsun.com>
17818
17819 * src/bison.simple (yyparse): Don't take the address of an
17820 item before the start of an array, as that doesn't conform to
17821 the C Standard.
17822
82e236e2
RA
178232001-08-27 Robert Anisko <robert.anisko@epita.fr>
17824
f1a87ef6 17825 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
17826 obstack. It was done too late here.
17827
17828 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
17829 completely wrong.
17830 (reader): Initialize the macro obstack here, since we need it to grow
17831 '%define' directives.
17832
17833 * src/reader.h: Declare the macro obstack as extern.
17834
b0cfa28a
RA
178352001-08-27 Robert Anisko <robert.anisko@epita.fr>
17836
17837 * src/output.c (output_parser): Fix. Store single '%' characters in
17838 the output obstack instead of throwing them away.
17839
6fc74234
AD
178402001-08-27 Akim Demaille <akim@epita.fr>
17841
17842 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17843
9c76d118
RA
178442001-08-25 Robert Anisko <robert.anisko@epita.fr>
17845
17846 * lib/Makefile.am: Adjust.
17847
a8289c62
RA
178482001-08-25 Robert Anisko <robert.anisko@epita.fr>
17849
17850 * src/bison.simple: Update and add '%%' directives.
17851
b6610515
RA
178522001-08-25 Robert Anisko <robert.anisko@epita.fr>
17853
17854 * src/reader.c (reader): Remove calls to 'output_headers' and
17855 'output_trailers'. Remove some C output.
17856 (readgram): Disable a piece of code that was writing a default
17857 definition for 'YYSTYPE'.
17858 (reader_output_yylsp): Remove.
17859 (packsymbols): Output token defintions to a macro.
17860 (copy_definition): Disable C output.
6fc74234 17861
b6610515
RA
17862 * src/reader.c (parse_macro_decl): New function used to parse macro
17863 declarations.
17864 (copy_string2): Put the body of copy_string into this new function.
17865 Add a parameter to let the caller choose whether he wants to copy the
17866 string delimiters or not.
17867 (copy_string): Be a simple call to copy_string2 with the last argument
17868 bound to true.
17869 (read_declarations): Add case for macro definition.
17870 (copy_identifier): New.
6fc74234 17871 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
17872 rather than lex.
17873
26f609ff
RA
178742001-08-25 Robert Anisko <robert.anisko@epita.fr>
17875
17876 * src/output.c (prepare): Add prefixed names.
17877 (output_parser): Output semantic actions.
17878 (output_parser): Fix bug on '%%line' directives.
6fc74234 17879
26f609ff
RA
17880 * src/output.c (output_headers): Remove. The C code printed by this
17881 function should now be in the skeletons.
17882 (output_trailers): Remove.
17883 (output): Disable call to 'reader_output_yylsp'.
17884 (output_rule_data): Do not output tables to the table obstack.
17885
17886 * src/output.c: Remove some C dedicated output.
17887 Improve the use of macro and output obstacks.
17888 (output_defines): Remove.
6fc74234 17889
26f609ff
RA
17890 * src/output.c (output_token_translations): Associate 'translate'
17891 table with a macro. No output to the table obstack.
17892 (output_gram): Same for 'rhs' and 'prhs'.
17893 (output_stos): Same for 'stos'.
17894 (output_rule_data): Same for 'r1' and 'r2'.
17895 (token_actions): Same for 'defact'.
17896 (goto_actions): Same for 'defgoto'.
17897 (output_base): Same for 'pact' and 'pgoto'.
17898 (output_table): Same for 'table'.
17899 (output_check): Same for 'check'.
6fc74234 17900
26f609ff
RA
17901 * src/output.c (output_table_data): New function.
17902 (output_short_table): Remove.
17903 (output_short_or_char_table): Remove.
6fc74234 17904
26f609ff
RA
17905 * src/output.c (output_parser): Replace most of the skeleton copy code
17906 with something new. Skeletons are now processed character by character
17907 rather than line by line, and Bison looks for '%%' macros. This is the
17908 first step in making Bison's output process (a lot) more flexible.
17909 (output_parser): Use the macro table.
17910
6f43b113
RA
179112001-08-25 Robert Anisko <robert.anisko@epita.fr>
17912
17913 * src/main.c (main): Initialize the macro table.
17914
dd3127cf
RA
179152001-08-25 Robert Anisko <robert.anisko@epita.fr>
17916
17917 * src/lex.c (percent_table): Add tok_define.
17918 * src/lex.h: Add tok_define.
17919
aa321494
RA
179202001-08-25 Robert Anisko <robert.anisko@epita.fr>
17921
17922 * src/macrotab.c: New file.
17923 * src/macrotab.h: New file.
17924 * src/Makefile.am: Update.
17925
68bd3b6b
RA
179262001-08-25 Robert Anisko <robert.anisko@epita.fr>
17927
17928 * lib/hash.c: New file.
17929 * lib/hash.h: New file.
17930 * lib/Makefile.am: Update.
17931
45f8dd1e
AD
179322001-08-15 Akim Demaille <akim@epita.fr>
17933
17934 Version 1.28c.
17935
40a64a7a 179362001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
17937
17938 * src/reader.c (readgram): Indent output macro YYSTYPE.
17939 (packsymbols): Likewise.
17940 (output_token_defines): Likewise.
17941 * src/files.c: Standardize.
17942 (compute_header_macro): New.
17943 (defines_obstack_save): New. Use compute_header_macro.
17944 (output_files): Update. Use defines_obstack_save.
17945
f9a8293a
AD
179462001-08-15 Akim Demaille <akim@epita.fr>
17947
17948 * doc/bison.texinfo (Table of Symbols): Document
17949 YYSTACK_USE_ALLOCA.
17950
150ca7a7
AD
179512001-08-15 Akim Demaille <akim@epita.fr>
17952
17953 * missing: Update from CVS Automake.
17954 * config/config.guess, config/config.sub, config/texinfo.tex:
17955 Update from gnu.org.
17956
69b5cec4
AD
179572001-08-15 Akim Demaille <akim@epita.fr>
17958
17959 * Makefile.maint: Sync with CVS Autoconf.
17960
f2b5126e
PB
179612001-08-14 Pascal Bart <pascal.bart@epita.fr>
17962
69b5cec4 17963 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
17964 `fdl.texi'.
17965 * doc/fdl.texi: Add to package.
17966
4ecbf796
MA
179672001-08-14 Marc Autret <autret_m@epita.fr>
17968
17969 Turn on %{source,header}_extension features.
17970
69b5cec4 17971 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
17972 source_extension.
17973 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 17974 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
17975 between options.
17976
95fb5662
MA
179772001-08-14 Marc Autret <autret_m@epita.fr>
17978
17979 * src/files.c (compute_base_names): Add extensions computing when
17980 `--file-prefix' used.
17981 Standardize function calls.
17982
78d09da9
MA
179832001-08-13 Marc Autret <autret_m@epita.fr>
17984
69b5cec4 17985 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
17986 defining it (defined but null disables alloca).
17987
5a009f2c
MA
179882001-08-13 Marc Autret <autret_m@epita.fr>
17989
17990 * src/bison.simple (_yy_memcpy): CPP reformat.
17991
1e41465a
PB
179922001-08-13 Pascal Bart <pascal.bart@epita.fr>
17993
17994 * tests/atconfig.in (CPPFLAGS): Fix.
17995
c67a198d
PB
179962001-08-10 Pascal Bart <pascal.bart@epita.fr>
17997
79282c6c 17998 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
17999 `gpl.texi'.
18000 * doc/gpl.texi: Add to package.
18001
09a6de7e
MA
180022001-08-10 Marc Autret <autret_m@epita.fr>
18003
18004 * src/print_graph.h: Fix.
18005 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
18006
b77b9ee0
AD
180072001-08-10 Akim Demaille <akim@epita.fr>
18008
18009 * src/system.h: Provide default declarations for stpcpy, strndup,
18010 and strnlen.
18011
3e259915
MA
180122001-08-10 Robert Anisko <anisko_r@epita.fr>
18013
18014 * doc/bison.texinfo (Locations): Update @$ stuff.
18015
ca96bc2d
MA
180162001-08-09 Robert Anisko <anisko_r@epita.fr>
18017
18018 * src/bison.simple (YYLLOC_DEFAULT): Update.
18019 (yyparse): Adjust.
18020
fdc6758b
MA
180212001-08-08 Marc Autret <autret_m@epita.fr>
18022
b77b9ee0 18023 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
18024 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
18025 Reported by Fabrice Bauzac.
957d4dbf 18026
600cad3b
MA
180272001-08-08 Marc Autret <autret_m@epita.fr>
18028
18029 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
18030 * src/vcg.c (output_node): Fix.
18031 * src/vcg.h: Cleanup.
18032 * src/print_graph.c: Add comments.
b77b9ee0 18033 (node_output_size): New global variable. Simplify the formatting of
600cad3b 18034 the VCG graph output.
b77b9ee0 18035 (print_actions): Unused code is now used. It notifies the final state
600cad3b 18036 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 18037 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
18038 blue.
18039 Get the current node name and node_obstack by argument.
18040 (node_obstack): New variable.
18041 (print_state): Manage node_obstack.
18042 (print_core): Use node_obstack given by argument.
18043 A node is not only computed here but in print_actions also.
18044 (print_graph): CPP out useless code instead of commenting it.
18045
976e528f
AD
180462001-08-07 Pascal Bart <pascal.bart@epita.fr>
18047
18048 * tests/atconfig.in (CPPFLAGS): Fix.
18049
20e8e5ca
AD
180502001-08-07 Akim Demaille <akim@epita.fr>
18051
18052 * src/print_graph.c (quote): New.
18053 (print_core): Use it.
18054
957d4dbf 180552001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 18056
3e3da797
AD
18057 * src/vcg.c (complain.h): Include it.
18058 Unepitaize `return' invocations.
c4b66126 18059 [NDEBUG] (main): Remove.
79282c6c 18060 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
18061 * src/files.c (open_files): Initialize graph_obstack.
18062 * src/print_graph.c (print_actions): CPP out useless code.
18063 (print_core): Don't output the last `\n' in labels.
18064 Use `quote'.
18065 * src/files.c (output_files): Output the VCG file.
18066 * src/main.c (main): Invoke print_graph ();
3e3da797 18067
957d4dbf 180682001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
18069
18070 Automaton VCG graph output.
18071 Using option ``-g'' or long option ``--graph'', you can generate
18072 a gram_filename.vcg file containing a VCG description of the LALR (1)
18073 automaton of your grammar.
18074
18075 * src/main.c: Call to print_graph() function.
18076 * src/getargs.h: Update.
18077 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
18078 (graph_flag): New flag.
18079 (longopts): Update.
18080 (getargs): Add case `g'.
18081 * src/files.c (graph_obstack): New obstack struct.
18082 (open_files): Initialize new obstack.
18083 (output_files): Saves graph_obstack if required.
18084 * src/files.h (graph_obstack): New extern declaration.
18085 * src/Makefile.am: Add new source files.
18086
927c1557 180872001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
18088
18089 * src/print_graph.c, src/print_graph.h (graph): New.
18090 * src/vcg.h: New file.
18091 * src/vcg.c: New file, VCG graph handling.
18092
7333d403
AD
180932001-08-06 Marc Autret <autret_m@epita.fr>
18094
18095 Add of %source_extension and %header_extension which specify
18096 the source or/and the header output file extension.
18097
18098 * src/files.c (compute_base_names): Remove initialisation of
18099 src_extension and header_extension.
18100 (compute_exts_from_gf): Update.
18101 (compute_exts_from_src): Update.
18102 (output_files): Update.
18103 * src/reader.c (parse_header_extension_decl): New.
18104 (parse_source_extension_decl): New.
18105 (read_declarations): New case statements for the new tokens.
18106 * src/lex.c (percent_table): Add entries for %source_extension
18107 and %header_extension.
18108 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
18109
84163231
AD
181102001-08-06 Marc Autret <autret_m@epita.fr>
18111
18112 * configure.in: Bump to 1.28c.
18113 * doc/bison.texinfo: Texinfo thingies.
18114
8303fc42
AD
181152001-08-04 Pascal Bart <pascal.bart@epita.fr>
18116
18117 * tests/atconfig.in (CPPFLAGS): Add.
18118 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
18119
70a84437
AD
181202001-08-03 Akim Demaille <akim@epita.fr>
18121
18122 Version 1.28b.
18123
2ce10144
AD
181242001-08-03 Akim Demaille <akim@epita.fr>
18125
18126 * tests/Makefile.am (check-local): Ship testsuite.
18127 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
18128 Include `string.h'.
18129
1e3e4bc1
AD
181302001-08-03 Akim Demaille <akim@epita.fr>
18131
18132 * configure.in: Try using -Wformat when compiling.
18133
42b45b7f
AD
181342001-08-03 Akim Demaille <akim@epita.fr>
18135
18136 * configure.in: Bump to 1.28b.
18137
8f13fe33
AD
181382001-08-03 Akim Demaille <akim@epita.fr>
18139
18140 * src/complain.c: Adjust strerror_r portability issues.
18141
b37ba92c
AD
181422001-08-03 Akim Demaille <akim@epita.fr>
18143
18144 Version 1.28a.
18145
b0ce6046
AD
181462001-08-03 Akim Demaille <akim@epita.fr>
18147
18148 * src/getargs.c, src/getarg.h (skeleton)): Constify.
18149 * src/lex.c (literalchar): Avoid name clashes on `buf'.
18150 * src/getargs.c: Include complain.h.
18151 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
18152 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
18153
d01c415b
AD
181542001-08-03 Akim Demaille <akim@epita.fr>
18155
18156 * src/reader.c (readgram): Display hidden chars in error messages.
18157
459dd1a6
AD
181582001-08-03 Akim Demaille <akim@epita.fr>
18159
18160 Update to gettext 0.10.39.
18161
53b74c0c
AD
181622001-08-03 Akim Demaille <akim@epita.fr>
18163
18164 * lib/strspn.c: New.
18165
234a3be3
AD
181662001-08-01 Marc Autret <autret_m@epita.fr>
18167
18168 * doc/bison.texinfo: Update.
18169 * doc/bison.1 (mandoc): Update.
18170 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
18171 * src/files.c: Support output files extensions computing.
18172 (src_extension): New static variable.
18173 (header_extension): New static variable.
18174 (tr): New function.
18175 (get_extension_index): New function, gets the index of an extension
18176 filename in a string.
18177 (compute_exts_from_gf): New function, computes extensions from the
18178 grammar file extension.
18179 (compute_exts_from_src): New functions, computes extensions from the
18180 C source file extension, file given by ``-o'' option.
18181 (compute_base_names): Update.
18182 (output_files): Update.
18183
847bf1f5
AD
181842001-08-01 Robert Anisko <anisko_r@epita.fr>
18185
d995fee7 18186 * doc/bison.texi: Document @$.
847bf1f5
AD
18187 (Locations): New section.
18188
d074a105
AD
181892001-07-18 Akim Demaille <akim@epita.fr>
18190
18191 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
18192 * config/prev-version.txt, config/move-if-change: New.
18193 * Makefile.am: Adjust.
18194
3419715d
AD
181952001-07-08 Pascal Bart <pascal.bart@epita.fr>
18196
18197 * src/bison.simple (yyparse): Suppress warning `comparaison
18198 between signed and unsigned'.
18199
62ab6972
AD
182002001-07-05 Pascal Bart <pascal.bart@epita.fr>
18201
18202 * src/getargs.h (raw_flag): Remove.
18203 * src/getargs.c: Die on `-r'/`--raw'.
18204 * src/lex.c (parse_percent_token): Die on `%raw'.
18205 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
18206 * tests/calc.at: Suppress test with option `--raw'.
18207
1e24cc5b
AD
182082001-07-14 Akim Demaille <akim@epita.fr>
18209
18210 * config/: New.
18211 * configure.in: Require Autoconf 2.50.
18212 Update to gettext 0.10.38.
18213
32dfccf8
AD
182142001-03-16 Akim Demaille <akim@epita.fr>
18215
18216 * doc/bison.texinfo: ANSIfy the examples.
18217
cd5bd6ac
AD
182182001-03-16 Akim Demaille <akim@epita.fr>
18219
18220 * getargs.c (skeleton): New variable.
18221 (longopts): --skeleton is a new option.
18222 (shortopts, getargs): -S is a new option.
18223 * getargs.h: Declare skeleton.
18224 * output.c (output_parser): Use it.
18225
5141b016
AD
182262001-03-16 Akim Demaille <akim@epita.fr>
18227
18228 * m4/strerror_r.m4: New.
18229 * m4/error.m4: Run AC_FUNC_STRERROR_R.
18230 * lib/error.h, lib/error.c: Update.
18231
447992b9
AD
182322001-03-16 Akim Demaille <akim@epita.fr>
18233
18234 * src/getargs.c (longopts): Clean up.
18235
274d42ce
AD
182362001-02-21 Akim Demaille <akim@epita.fr>
18237
18238 * src/reader.c (gensym): `gensym_count' is your own.
18239 Use a static buf to create the symbol name, as token_buffer is no
18240 longer a buffer.
18241
22c821f3
AD
182422001-02-08 Akim Demaille <akim@epita.fr>
18243
18244 * src/conflicts.c (conflict_report): Be sure not to append to res
18245 between two calls, which could happen if both first sprintf were
18246 skipped, but not the first cp += strlen.
18247
18569462
AD
182482001-02-08 Akim Demaille <akim@epita.fr>
18249
18250 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
18251 New, from fileutils 4.0.37.
18252 * configure.in: Require Autoconf 2.49c. I took some time before
18253 making this decision. This is the only way out for portability
18254 issues in Bison, it would mean way too much duplicate effort to
18255 import in Bison features implemented in 2.49c since 2.13.
18256 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
18257
0d8f3c8a
AD
182582001-02-02 Akim Demaille <akim@epita.fr>
18259
18260 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 18261 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 18262
f17bcd1f
AD
182632001-01-19 Akim Demaille <akim@epita.fr>
18264
18265 Get rid of the ad hoc handling of token_buffer in the scanner: use
18266 the obstacks.
18267
18268 * src/lex.c (token_obstack): New.
18269 (init_lex): Initialize it. No longer call...
18270 (grow_token_buffer): this. Remove it.
18271 Adjust all the places which used it to use the obstack.
18272
511e79b3
AD
182732001-01-19 Akim Demaille <akim@epita.fr>
18274
18275 * src/lex.h: Rename all the tokens:
18276 s/\bENDFILE\b/tok_eof/g;
18277 s/\bIDENTIFIER\b/tok_identifier/g;
18278 etc.
18279 Let them be enums, not #define, to ease debugging.
18280 Adjust all the code.
18281
0d6508ef
AD
182822001-01-18 Akim Demaille <akim@epita.fr>
18283
18284 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
18285 * src/lex.c (maxtoken, grow_token_buffer): Static.
18286
6deb4447
AD
182872001-01-18 Akim Demaille <akim@epita.fr>
18288
18289 Since we now use obstacks, more % directives can be enabled.
18290
18291 * src/lex.c (percent_table): Also accept `%yacc',
18292 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
18293 `%debug'.
18294 Handle the actions for `%semantic_parser' and `%pure_parser' here,
18295 instead of returning a token.
18296 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
18297 * src/reader.c (read_declarations): Adjust.
18298 * src/files.c (open_files): Don't call `compute_base_names', don't
18299 compute `attrsfile' since they depend upon data which might be
18300 *in* the input file now.
18301 (output_files): Do it here.
18302 * src/output.c (output_headers): Document the fact that this patch
18303 introduces a guaranteed SEGV for semantic parsers.
18304 * doc/bison.texinfo: Document them.
18305 * tests/suite.at: Exercise these %options.
18306
ff4423cc
AD
183072000-12-20 Akim Demaille <akim@epita.fr>
18308
18309 Also handle the output file (--verbose) with obstacks.
18310
18311 * files.c (foutput): Remove.
18312 (output_obstack): New.
18313 Adjust all dependencies.
18314 * src/conflicts.c: Return a string.
18315 * src/system.h (obstack_grow_string): Rename as...
18316 (obstack_sgrow): this. Be ready to work with non literals.
18317 (obstack_fgrow4): New.
18318
956dba3a
AD
183192000-12-20 Akim Demaille <akim@epita.fr>
18320
18321 * src/files.c (open_files): Fix the computation of short_base_name
18322 in the case of `-o foo.tab.c'.
18323
337bab46
AD
183242000-12-20 Akim Demaille <akim@epita.fr>
18325
18326 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
18327 (copy_dollar): Now that everything uses obstacks, get rid of the
18328 FILE * parameters.
18329
5d3214b8
AD
183302000-12-20 Akim Demaille <akim@epita.fr>
18331
18332 * src/files.c (open_files): Actually the `.output' file is based
18333 on the short_base_name, not base_name.
18334 * tests/suite.at (Checking output file names): Adjust.
18335
29092a57
AD
183362000-12-20 Akim Demaille <akim@epita.fr>
18337
18338 * src/bison.s1: Remove, we now use directly...
18339 * src/bison.simple: this.
18340 * src/Makefile.am: Use pkgdata instead of data.
18341
ea5607fd
AD
183422000-12-20 Akim Demaille <akim@epita.fr>
18343
18344 * src/files.c (guard_obstack): New.
18345 (open_files): Initialize it.
18346 (output_files): Dump it...
18347 * src/files.h: Export it.
18348 * src/reader.c (copy_guard): Use it.
18349
27110317
AD
183502000-12-19 Akim Demaille <akim@epita.fr>
18351
18352 * src/files.c (outfile, defsfile, actfile): Removed as global
18353 vars.
18354 (open_files): Don't compute them.
18355 (output_files): Adjust.
18356 (base_name, short_base_name): Be global.
18357 Adjust dependencies.
18358
19c50364
AD
183592000-12-19 Akim Demaille <akim@epita.fr>
18360
18361 * src/files.c (strsuffix): New.
18362 (stringappend): Be just like strcat but allocate.
18363 (base_names): Eve out from open_files.
18364 Try to simplify the rather hairy computation of base_name and
18365 short_base_name.
18366 (open_files): Use it.
18367 * tests/suite.at (Checking output file names): New test.
18368
573c1d9f
AD
183692000-12-19 Akim Demaille <akim@epita.fr>
18370
18371 * src/system.h (obstack_grow_literal_string): Rename as...
18372 (obstack_grow_string): this.
18373 * src/output.c (output_parser): Recognize `%% actions' instead of
18374 `$'.
18375 * src/bison.s1: s/$/%% actions/.
18376 * src/bison.hairy: Likewise.
18377
ef7ddedd
AD
183782000-12-19 Akim Demaille <akim@epita.fr>
18379
18380 * src/output.c (output_parser): Compute the `#line' lines when
18381 there are.
18382 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
18383 Suggested by Hans Aberg.
18384
ff61dabd
AD
183852000-12-19 Akim Demaille <akim@epita.fr>
18386
18387 Let the handling of the skeleton files be local to the procedures
18388 that use it.
18389
18390 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
18391 longer static.
18392 (fparser, open_extra_files): Remove.
18393 (open_files, output_files): Don't take care of fparser.
18394 * src/files.h: Adjust.
18395 * src/output.c (output_parser): Open and close the file to the
18396 skeleton.
18397 * src/reader.c (read_declarations): When %semantic_parser, open
18398 fguard.
18399
55b96341
AD
184002000-12-19 Akim Demaille <akim@epita.fr>
18401
18402 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
18403 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
18404
358c15b7
AD
184052000-12-19 Akim Demaille <akim@epita.fr>
18406
18407 * src/files.c (open_files): Yipee! We no longer need all the code
18408 looking for `/tmp' since we have no tmp file.
18409
7de3329e
AD
184102000-12-19 Akim Demaille <akim@epita.fr>
18411
18412 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
18413 New macros.
18414 * src/files.c (open_files): Less dependency on MSDOS etc.
18415
3abcd459
AD
184162000-12-14 Akim Demaille <akim@epita.fr>
18417
18418 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
18419 Provide a default definition.
18420 Use it when executing the default @ action.
18421 * src/reader.c (reader_output_yylsp): No longer include
18422 `timestamp' and `text' in the default YYLTYPE.
18423
2a91a95e
AD
184242000-12-12 Akim Demaille <akim@epita.fr>
18425
18426 * src/reader.c (copy_definition, parse_union_decl, copy_action)
18427 (copy_guard): Quote the file names.
18428 Reported by Laurent Mascherpa.
18429
14d3eb9b
AD
184302000-12-12 Akim Demaille <akim@epita.fr>
18431
18432 * src/output.c (output_headers, output_program, output): Be sure
18433 to escape special characters when outputting filenames.
18434 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
18435 (output_headers): Don't depend on them, Use ACTSTR.
18436
d7045ec6
AD
184372000-11-17 Akim Demaille <akim@epita.fr>
18438
18439 * lib/obstack.h: Formatting changes.
18440 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
18441 prevents type checking.
18442 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
18443 cast the value to (void *): assigning a `foo *' to a `void *'
18444 variable is valid.
18445 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
18446 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
18447 append characters.
18448
6fd54b73
AD
184492000-11-17 Akim Demaille <akim@epita.fr>
18450
18451 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
18452 as...
18453 (suite.m4, regression.m4, calc.m4): these.
18454 * tests/atgeneral.m4: Update from CVS Autoconf.
18455
4c50eae6
AD
184562000-11-17 Akim Demaille <akim@epita.fr>
18457
18458 * tests/regression.m4 (%union and --defines): New test,
18459 demonstrating a current bug in the obstack implementation.
18460
a35f64ea
AD
184612000-11-17 Akim Demaille <akim@epita.fr>
18462
18463 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
18464 macros.
18465 Use them to declare the variables which are global or local to
18466 `yyparse'.
18467
7de23534
AD
184682000-11-17 Akim Demaille <akim@epita.fr>
18469
18470 * acconfig.h: Remove, no longer used.
18471
aa7815f5
AD
184722000-11-07 Akim Demaille <akim@epita.fr>
18473
18474 * src: s/Copyright (C)/Copyright/g.
18475
5af1f549
AD
184762000-11-07 Akim Demaille <akim@epita.fr>
18477
18478 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
18479 defining.
18480 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
18481
553e2b22
AD
184822000-11-07 Akim Demaille <akim@epita.fr>
18483
18484 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
18485 Merge in a single CPP if/else.
18486
8a4f41d6
AD
184872000-11-07 Akim Demaille <akim@epita.fr>
18488
18489 * src/output.c (output): Remove useless variables.
18490 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
18491 argument `data' for consistency with the prototypes.
18492 Qualify it `const'.
18493 (obstack_copy, obstack_copy0): Rename the second argument as
18494 `address' for consistency. Qualify it `const'.
18495 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
18496 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
18497 `const' their input argument (`data' or `address').
18498 Adjust the corresponding macros to include `const' in casts.
18499
095a3fb5
AD
185002000-11-03 Akim Demaille <akim@epita.fr>
18501
18502 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
18503 s/PFILE1/BISON_HAIRY/.
18504 Adjust dependencies.
18505
d1cdce7c
AD
185062000-11-03 Akim Demaille <akim@epita.fr>
18507
090c5ebf 18508 For some reason, this was not applied.
d1cdce7c
AD
18509
18510 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18511 `unlink': it's no longer used.
18512
9311529b
AD
185132000-11-03 Akim Demaille <akim@epita.fr>
18514
18515 * src/files.c (skeleton_find): New function, eved out of...
18516 (open_files, open_extra_files): here.
18517
d8880f69
AD
185182000-11-03 Akim Demaille <akim@epita.fr>
18519
18520 Don't use `atexit'.
18521
18522 * src/files.c (obstack_save): New function.
18523 (done): Rename as...
18524 (output_files): this.
18525 Use `obstack_save'.
18526 * src/main.c (main): Don't use `atexit' to register `done', since
18527 it no longer has to remove tmp files, just call `output_files'
18528 when there are no errors.
18529
0dbb648e
AD
185302000-11-02 Akim Demaille <akim@epita.fr>
18531
18532 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18533 `unlink': it's no longer used.
18534 * src/files.h: Formatting changes.
18535
896fe5c1
AD
185362000-11-02 Akim Demaille <akim@epita.fr>
18537
18538 Remove the last uses of mktemp and unlink/delete.
18539
18540 * src/files.c (fdefines, ftable): Removed.
18541 (defines_ostack, table_obstack): New.
18542 Adjust dependencies of the former into uses of the latter.
18543 * src/output.c (output_short_or_char_table, output_short_table):
18544 Convert to using obstacks.
18545 * src/reader.c (copy_comment2): Accept one FILE * and two
18546 obstacks.
18547 (output_token_defines, reader_output_yylsp): Use obstacks.
18548 * src/system.h (obstack_fgrow3): New.
1f65350a 18549 * po/POTFILES.in: Adjust.
896fe5c1 18550
dd60faec
AD
185512000-11-01 Akim Demaille <akim@epita.fr>
18552
18553 Change each use of `fattrs' into a use of `attrs_obstack'.
18554
18555 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
18556 * src/files.c (fattrs): Remove.
18557 (attrs_obstack): New.
18558 Adjust all dependencies.
18559 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
18560
8c7ebe49
AD
185612000-11-01 Akim Demaille <akim@epita.fr>
18562
18563 Introduce obstacks.
18564 Change each use of `faction' into a use of `action_obstack'.
18565
18566 * lib/obstack.h, lib/obstack.c: New files.
18567 * src/files.c (faction): Remove.
18568 (action_obstack): New.
18569 Adjust all dependencies.
18570
77aee789
AD
185712000-10-20 Akim Demaille <akim@epita.fr>
18572
18573 * lib/quote.h (PARAMS): New macro. Use it.
18574
43591cec
AD
185752000-10-16 Akim Demaille <akim@epita.fr>
18576
18577 * src/output.c (output_short_or_char_table): New function.
18578 (output_short_table, output_token_translations): Use it.
18579 (goto_actions): Use output_short_table.
18580
1e9798d5
AD
185812000-10-16 Akim Demaille <akim@epita.fr>
18582
18583 * src/symtab.c (bucket_new): New function.
18584 (getsym): Use it.
18585
18586 * src/output.c (output_short_table): New argument to display the
18587 comment associated with the table.
18588 Adjust dependencies.
18589 (output_gram): Use it.
18590 (output_rule_data): Nicer output layout for YYTNAME.
18591
f282676b
AD
185922000-10-16 Akim Demaille <akim@epita.fr>
18593
18594 * src/lex.c (read_typename): New function.
18595 (lex): Use it.
18596 * src/reader.c (copy_dollar): Likewise.
18597
550a72a3
AD
185982000-10-16 Akim Demaille <akim@epita.fr>
18599
18600 * src/reader.c (copy_comment2): Expect the input stream to be on
18601 the `/' which is suspected to open a comment, instead of being
18602 called after `//' or `/*' was read.
18603 (copy_comment, copy_definition, parse_union_decl, copy_action)
18604 (copy_guard): Adjust.
18605
131e2fef
AD
186062000-10-16 Akim Demaille <akim@epita.fr>
18607
18608 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
18609 `read_signed_integer'.
18610
79282c5a
AD
186112000-10-16 Akim Demaille <akim@epita.fr>
18612
18613 * src/reader.c (copy_dollar): New function.
18614 (copy_guard, copy_action): Use it.
18615
ff4a34be
AD
186162000-10-16 Akim Demaille <akim@epita.fr>
18617
18618 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
18619 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
18620 New files, from Fileutils 4.0.27.
18621 * src/main.c (printable_version): Remove.
18622 * src/lex.c, src/reader.c: Use `quote'.
18623
186242000-10-04 Akim Demaille <akim@epita.fr>
18625
18626 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
18627
14ded682
AD
186282000-10-04 Akim Demaille <akim@epita.fr>
18629
18630 * doc/bison.texinfo: Various typos spotted by Neil Booth.
18631
8e03724b
AD
186322000-10-04 Akim Demaille <akim@epita.fr>
18633
18634 When a literal string is used to define two different tokens,
18635 `bison -v' segfaults.
18636 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
18637
18638 * tests/regression.m4: New file.
18639 Include the core of the sample provided by Piotr Gackiewicz.
18640 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
18641 properly.
18642
a9e64249
AD
186432000-10-04 Akim Demaille <akim@epita.fr>
18644
18645 * src/reader.c (parse_expect_decl): Keep `count' within the size
18646 of `buffer'.
18647 From Neil Booth.
18648
da9abf43
AD
186492000-10-02 Paul Eggert <eggert@twinsun.com>
18650
18651 * bison.s1 (yyparse): Assign the default value
18652 unconditionally, to avoid a GCC warning and make the parser a
18653 tad smaller.
18654
c33638bb
AD
186552000-10-02 Akim Demaille <akim@epita.fr>
18656
18657 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
18658 options.
18659
444c570a
AD
186602000-10-02 Akim Demaille <akim@epita.fr>
18661
18662 * src/derives.c, src/print.c, src/reduce.c: To ease the
18663 translation, move some `\n' out of the translated strings.
18664
89cab50d
AD
186652000-10-02 Akim Demaille <akim@epita.fr>
18666
18667 The location tracking mechanism is precious for parse error
18668 messages. Nevertheless, it is enabled only when `@n' is used in
18669 the grammar, which is a different issue (you can use it in error
18670 message, but not in the grammar per se). Therefore, there should
18671 be another means to enable it.
18672
18673 * src/getargs.c (getargs): Support `--locations'.
18674 (usage): Report it.
18675 * src/getargs.h (locationsflag): Export it.
18676 * src/lex.c (percent_table): Support `%locations'.
18677 * src/reader.c (yylsp_needed): Remove this variable, now replaced
18678 with `locationsflag'.
18679 * doc/bison.texinfo: Document `--locations' and `%locations'.
18680 Sort the options.
18681 * tests/calc.m4: Test it.
18682
18683 For regularity of the names, replace each
18684 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
18685 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
18686 In addition replace each `flag' with `_flag'.
18687
d6c2cba0
AD
186882000-10-02 Akim Demaille <akim@epita.fr>
18689
18690 Also test parse error messages, including with YYERROR_VERBOSE.
18691
18692 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
18693 associative).
18694 Use it to check the computations.
18695 Use it to check `nonassoc' is honored.
18696 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
18697 `--yyerror-verbose'.
18698 (_AT_CHECK_CALC): Adjust to this option.
18699 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
18700
5a35a6cb
AD
187012000-10-02 Akim Demaille <akim@epita.fr>
18702
18703 Test also `--verbose', `--defines' and `--name-prefix'. Testing
18704 the latter demonstrates a flaw in the handling of non debugging
18705 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
18706 was used in order to simplify:
18707
18708 #if YYDEBUG
18709 if (yydebug)
18710 {
18711 ...
18712 }
18713 #endif
18714
18715 into
18716
18717 if (yydebug)
18718 {
18719 ...
18720 }
18721
18722 unfortunately this leads to a CPP conflict when
18723 `--name-prefix=foo' is used since it produces `#define yydebug
18724 foodebug'.
18725
18726 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
18727 (YYDPRINTF): New macro.
18728 Spread its use.
18729 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
18730 the bison options.
18731 Also test `--verbose', `--defines' and `--name-prefix'.
18732
71da9eea
AD
187332000-10-02 Akim Demaille <akim@epita.fr>
18734
18735 Improve the readability of the produced parsers.
18736
18737 * src/bison.s1: Formatting changes.
18738 Improve the comment related to the `$' mark.
18739 (yydefault): Don't fall through to `yyresume': `goto' there.
18740 * src/output.c (output_parser): When the `$' is met, skip the end
18741 of its line.
18742 New variable, `number_of_dollar_signs', to check there's exactly
18743 one `$' in the parser skeleton.
18744
95e36146
AD
187452000-10-02 Akim Demaille <akim@epita.fr>
18746
18747 * lib/xstrdup.c: New file, from the fileutils.
18748 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
18749 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
18750 instead of strlen + xmalloc + strcpy.
18751 * src/symtab.c (copys): Remove, use xstrdup instead.
18752
d7020c20
AD
187532000-10-02 Akim Demaille <akim@epita.fr>
18754
18755 * src/gram.h (associativity): New enum type which replaces the
18756 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
18757 `right_assoc', `left_assoc' and `non_assoc'.
18758 Adjust all dependencies.
18759 * src/reader.c: Formatting changes.
18760 (LTYPESTR): Don't define it, use it as a literal in
18761 `reader_output_yylsp'.
18762 * src/symtab.h (symbol_class): New enum type which replaces the
18763 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
18764 `sunknown', `stoken and `snterm'.
18765
1916f98e
AD
187662000-10-02 Akim Demaille <akim@epita.fr>
18767
18768 * src/getargs.c (fixed_outfiles): Rename as...
18769 (yaccflag): for consistency and accuracy.
18770 Adjust dependencies.
18771
d7913476
AD
187722000-10-02 Akim Demaille <akim@epita.fr>
18773
18774 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
18775 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
18776 difficult and introduced a lot of core dump. It turns out that
18777 Bison used an implementation of `xmalloc' based on `calloc', and
18778 at various places it does depend upon the initialization to 0. I
18779 have not tried to isolate the pertinent places, and all the former
18780 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
18781 someone should address this issue.
18782
18783 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
18784 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
18785 files.
18786 Adjust dependencies.
18787 * src/warshall.h: New file.
18788 Propagate.
18789
340ef489
AD
187902000-10-02 Akim Demaille <akim@epita.fr>
18791
18792 Various anti-`extern in *.c' changes.
18793
18794 * src/system.h: Include `assert.h'.
18795
b2ca4022
AD
187962000-10-02 Akim Demaille <akim@epita.fr>
18797
18798 * src/state.h (nstates, final_state, first_state, first_shift)
18799 (first_reduction): Move their exportation from here...
18800 * src/LR0.h: to here.
18801 Adjust dependencies.
18802 * src/getargs.c (statisticsflag): New variable.
18803 Add support for `--statistics'.
18804 Adjust dependencies.
18805
18806 Remove a lot of now useless `extern' statements in most files.
18807
403b315b
AD
188082000-10-02 Akim Demaille <akim@epita.fr>
18809
18810 * src/LR0.h: New file.
18811 Propagate its use.
18812
07a58c13
AD
188132000-10-02 Akim Demaille <akim@epita.fr>
18814
18815 * src/print.h: New file.
18816 Propagate its use.
18817 * src/print.c: Formatting and ordering changes.
18818 (verbose, terse): Replace with...
18819 (print_results): this new function.
18820 Adjust dependencies.
18821
0619caf0
AD
188222000-10-02 Akim Demaille <akim@epita.fr>
18823
18824 * src/conflicts.c (conflict_report): New function.
18825 (conflict_log, verbose_conflict_log): Replace with...
18826 (print_conflicts): this function.
18827 Adjust dependencies.
18828 * src/conflicts.h: New file.
18829 Propagate its inclusion.
18830
3519ec76
AD
188312000-10-02 Akim Demaille <akim@epita.fr>
18832
18833 * src/nullable.h: New file.
18834 Propagate its inclusion.
18835 * src/nullable.c: Formatting changes.
18836
015acc48
AD
188372000-10-02 Akim Demaille <akim@epita.fr>
18838
18839 * src/reduce.h: New file.
18840 Propagate its inclusion.
18841 * src/reduce.c: Topological sort and other formatting changes.
18842 (bool, TRUE, FALSE): Move their definition to...
18843 * src/system.h: here.
18844
8963a27b
AD
188452000-10-02 Akim Demaille <akim@epita.fr>
18846
18847 * src/files.c: Formatting changes.
18848 (tryopen, tryclose, openfiles): Rename as...
18849 (xfopen, xfclose, open_files): this.
18850 (stringappend): static.
18851 * src/files.h: Complete the list of exported symbols.
18852 Propagate its use.
18853
a70083a3
AD
188542000-10-02 Akim Demaille <akim@epita.fr>
18855
18856 * src/reader.h: New file.
18857 Propagate its use instead of tedious list of `extern' and
18858 prototypes.
18859 * src/reader.c: Formatting changes, topological sort,
18860 s/register//.
18861
abadc117
AD
188622000-10-02 Akim Demaille <akim@epita.fr>
18863
18864 * src/lex.h: Prototype `lex.c' exported functions.
18865 * src/reader.c: Adjust.
18866 * src/lex.c: Formatting changes.
18867 (safegetc): Rename as...
18868 (xgetc): this.
18869
720d742f
AD
188702000-10-02 Akim Demaille <akim@epita.fr>
18871
18872 * src/lalr.h: New file.
18873 Propagate its inclusion instead of prototypes and `extern'.
18874 * src/lalr.c: Formatting changes, topological sorting etc.
18875
f2acea59
AD
188762000-10-02 Akim Demaille <akim@epita.fr>
18877
18878 * src/output.c (token_actions): Introduce a temporary array,
18879 YYDEFACT, that makes it possible for this function to use
18880 output_short_table.
18881
d019d655
AD
188822000-10-02 Akim Demaille <akim@epita.fr>
18883
18884 `user_toknums' is output as a `short[]' in `output.c', while it is
18885 defined as a `int[]' in `reader.c'. For consistency with the
18886 other output tables, `user_toknums' is now defined as a table of
18887 shorts.
18888
18889 * src/reader.c (user_toknums): Be a short table instead of an int
18890 table.
18891 Adjust dependencies.
18892
18893 Factor the short table outputs.
18894
18895 * src/output.c (output_short_table): New function.
18896 * src/output.c (output_gram, output_stos, output_rule_data)
18897 (output_base, output_table, output_check): Use it.
18898
6c89f1c1
AD
188992000-10-02 Akim Demaille <akim@epita.fr>
18900
18901 * src/output.c (output): Topological sort of the functions, in
18902 order to get rid of the `static' prototypes.
18903 No longer use `register'.
18904 * src/output.h: New file.
18905 Propagate its inclusion in files explicitly prototyping functions
18906 from output.c.
18907
d9efd181
AD
189082000-09-21 Akim Demaille <akim@epita.fr>
18909
18910 * src/atgeneral.m4: Update from Autoconf.
18911
c29240e7 189122000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
18913
18914 * src/closure.h: New file.
18915 * src/closure.c: Formatting changes, topological sort over the
18916 functions, use of closure.h.
18917 (initialize_closure, finalize_closure): Rename as...
18918 (new_closure, free_closure): these. Adjust dependencies.
18919 * src/LR0.c: Formatting changes, topological sort, use of
18920 cloture.h.
18921 (initialize_states): Rename as...
18922 (new_states): this.
18923 * src/Makefile.am (noinst_HEADERS): Adjust.
18924
499daa50
AD
189252000-09-20 Akim Demaille <akim@epita.fr>
18926
18927 * src/acconfig.h: Don't protect config.h against multiple
18928 inclusion.
18929 Don't define PARAMS.
18930 * src/system.h: Define PARAMS.
18931 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
18932 purpose of config.h. system.h must not try to fix wrong
18933 definitions in config.h.
18934
cc84fd5d
AD
189352000-09-20 Akim Demaille <akim@epita.fr>
18936
18937 * src/derives.h: New file.
18938 * src/main.c, src/derives.h: Use it.
18939 Formatting changes.
18940 * src/Makefile.am (noinst_HEADERS): Adjust.
18941
db5b3a89
AD
189422000-09-20 Akim Demaille <akim@epita.fr>
18943
18944 * tests/atgeneral.m4: Update from Autoconf.
18945 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
18946 (AT_CHECK_CALC): New macros.
18947 Use these macros to test bison with options `', `--raw',
18948 `--debug', `--yacc', `--yacc --debug'.
18949
ceed8467
AD
189502000-09-19 Akim Demaille <akim@epita.fr>
18951
18952 * src/output.c: Formatting changes.
18953 * src/machine.h: Remove, leaving its contents in...
18954 * src/system.h: here.
18955 Include stdio.h.
18956 Adjust all dependencies on stdio.h and machine.h.
18957 * src/getargs.h: New file.
18958 Let all `extern' declarations about getargs.c be replaced with
18959 inclusion of `getargs.h'.
18960 * src/Makefile.am (noinst_HEADERS): Adjust.
18961
18962 * tests/calc.m4 (yyin): Be initialized in main, not on the global
18963 scope.
18964 (yyerror): Returns void, not int.
18965 * doc/bison.texinfo: Formatting changes.
18966
05a1d24b
AD
189672000-09-19 Akim Demaille <akim@epita.fr>
18968
18969 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
18970 portable.
18971
cbd25751
AD
189722000-09-18 Akim Demaille <akim@epita.fr>
18973
18974 * configure.in: Append WARNING_CFLAGS to CFLAGS.
18975 * src/Makefile.am (INCLUDES): Don't.
18976 Be ready to fetch headers in lib/.
18977
13863333
AD
189782000-09-18 Akim Demaille <akim@epita.fr>
18979
18980 * doc/bison.texinfo: Update the copyright.
18981 ANSIfy and GNUify the examples.
18982 Remove the old menu.
18983
0d533154
AD
189842000-09-18 Akim Demaille <akim@epita.fr>
18985
18986 First set of tests: use the `calc' example from the documentation.
18987
18988 * src/bison.s1 (yyparse): Condition the code using `yytname' which
18989 is defined only when YYDEBUG is.
18990 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
18991 * src/files.c (tryopen, tryclose): Formatting changes.
18992 Move to the top and be static.
18993 * src/reader.c (read_signed_integer): Likewise.
18994 * tests/calc.m4: New file.
18995 * Makefile.am, suite.m4: Adjust.
18996 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
18997
e79137ac
AD
189982000-09-18 Akim Demaille <akim@epita.fr>
18999
19000 Add support for an Autotest test suite for Bison.
19001
19002 * m4/m4.m4, m4/atconfig.m4: New files.
19003 * m4/Makefile.am (EXTRA_DIST): Adjust.
19004 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
19005 files.
19006 * src/getargs.c: Display a more standard --version message.
19007 * src/reader.c (reader): Formatting changes.
19008 No longer depend upon VERSION_STRING.
19009 * configure.in: No longer use `dnl'.
19010 Set up the test suite and the new directory `tests/.
19011 (VERSION_STRING): Remove.
19012
27821bff
AD
190132000-04-14 Akim Demaille <akim@epita.fr>
19014
19015 * src/reader.c (copy_comment2): New function, same as former
19016 `copy_comment', but outputs into two FILE *.
19017 (copy_comment): Use it.
19018 (parse_union_decl): Use it.
19019 (get_type, parse_start_decl): Use the same `invalid' message.
19020 (parse_start_decl, parse_union_decl): Use the same `multiple'
19021 message.
19022 (parse_union_decl, copy_guard, copy_action): Use the same
19023 `unmatched' message.
19024 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
19025
cfe5fbc0
AD
190262000-03-31 Akim Demaille <akim@epita.fr>
19027
19028 * src/files.c (tryopen, tryclose): Move to the top.
19029 Be static.
19030
cb7db13e
AD
190312000-03-31 Akim Demaille <akim@epita.fr>
19032
19033 * src/main.c (main): Don't call `done', exit does it.
19034
a0f6b076
AD
190352000-03-31 Akim Demaille <akim@epita.fr>
19036
36281465
AD
19037 * allocate.c: s/return (foo)/return foo/.
19038 * lalr.c: Likewise.
19039 * LR0.c: Likewise.
19040 * output.c: Likewise.
19041 * reader.c: Likewise.
19042 * symtab.c: Likewise.
19043 * vmsgetargs.c: Likewise.
19044
190452000-03-31 Akim Demaille <akim@epita.fr>
19046
19047 Clean up the error reporting functions.
a0f6b076
AD
19048
19049 * src/report.c: New file.
19050 * src/report.h: Likewise.
19051 * src/Makefile.am: Adjust.
19052 * m4/error.m4: New file.
19053 * m4/Makefile.am: Adjust.
19054 * configure.in (jm_PREREQ_ERROR): Call it.
19055 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
19056 Remove.
19057 (fatal, fatals): Remove. All callers use complain.c::fatal.
19058 (warn, warni, warns, warnss, warnss): Remove. All callers use
19059 complain.c::complain.
19060 (toomany): Remove, use fatal instead.
19061 * src/files.c (done): No argument, use complain_message_count.
19062 * src/main.c (main): Register `done' to `atexit'.
19063
19064 * src/getargs.c (usage): More `fputs', less `fprintf'.
19065
18539825
AD
190662000-03-28 Akim Demaille <akim@epita.fr>
19067
19068 * lib/: New directory.
19069 * Makefile.am (SUBDIRS): Adjust.
19070 * configure.in: Adjust.
19071 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
19072 useless.
19073 * src/alloca.c: Moved to lib/.
19074 * src/getopt.c: Likewise.
19075 * src/getopt1.c: Likewise.
19076 * src/getopt.h: Likewise.
19077 * src/ansi2knr.c: Likewise.
19078 * src/ansi2knr.1: Likewise.
19079 * src/Makefile.am: Adjust.
19080 * lib/Makefile.am: New file.
19081
9f306f2a
AD
190822000-03-28 Akim Demaille <akim@epita.fr>
19083
19084 * src/getargs.c (usage): Refresh the help message.
19085
0ba347b6
AD
190862000-03-17 Akim Demaille <akim@epita.fr>
19087
19088 * src/getopt1.c: Updated from textutils 2.0e
19089 * src/getopt.c: Likewise.
19090 * src/getopt.h: Likewise.
19091
dbe7f271
AD
190922000-03-17 Akim Demaille <akim@epita.fr>
19093
19094 * src/Makefile.am (bison.simple): Fix the awk program: quote only
19095 the file name, not the whole `#line LINE FILE'.
19096
75bbe78d
AD
190972000-03-17 Akim Demaille <akim@epita.fr>
19098
19099 On syntax errors, report the token on which we choked.
19100
aa5fd0ee
AD
19101 * src/bison.s1 (yyparse): In the label yyerrlab, when
19102 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 19103
7b306f52
AD
191042000-03-17 Akim Demaille <akim@epita.fr>
19105
aa5fd0ee 19106 * src/reader.c (copy_at): New function.
7b306f52
AD
19107 (copy_guard): Use it.
19108 (copy_action): Use it.
19109
e87b5700
AD
191102000-03-17 Akim Demaille <akim@epita.fr>
19111
19112 Be kind to translators, save some useless translations.
19113
aa5fd0ee 19114 * src/main.c (banner): New function.
e87b5700
AD
19115 (fatal_banner): Use it.
19116 (warn_banner): Use it.
19117
ae3c3164
AD
191182000-03-17 Akim Demaille <akim@epita.fr>
19119
aa5fd0ee
AD
19120 * src/reader.c (copy_definition): Use copy_string and
19121 copy_comment. Removed now unused `match', `ended',
19122 `cplus_comment'.
ae3c3164
AD
19123 (copy_comment, copy_string): Moved, to be visible from
19124 copy_definition.
19125
4dc58e7c
AD
191262000-03-17 Akim Demaille <akim@epita.fr>
19127
aa5fd0ee
AD
19128 * src/reader.c (copy_string): Declare `static inline'. No
19129 problems with inline, since it is checked by configure.
4dc58e7c
AD
19130 (copy_comment): Likewise.
19131
0a6384c4
AD
191322000-03-17 Akim Demaille <akim@epita.fr>
19133
aa5fd0ee 19134 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 19135
3cef001a
AD
191362000-03-17 Akim Demaille <akim@epita.fr>
19137
aa5fd0ee 19138 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
19139 (copy_action): Use it. Removed now unused `match', `ended',
19140 `cplus_comment'.
19141 (copy_guard): Likewise.
19142
ca36d2ef
AD
191432000-03-17 Akim Demaille <akim@epita.fr>
19144
aa5fd0ee 19145 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
19146 (copy_action): Use it.
19147 (copy_guard): Likewise.
19148
6666f98f
AD
191492000-03-17 Akim Demaille <akim@epita.fr>
19150
19151 Change the handling of @s so that they behave exactly like $s.
19152 There is now a pseudo variable @$ (readble and writable), location
19153 of the lhs of the rule (by default ranging from the location of
19154 the first symbol of the rhs, to the location of the last symbol,
19155 or, if the rhs is empty, YYLLOC).
19156
19157 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
19158 yyval.
19159 (yyparse): When providing a default semantic action, provide a
19160 default location action.
19161 (after the $): No longer change `*YYLSP', just stack YYLOC the
19162 same way you stack YYVAL.
19163 * src/reader.c (read_declarations): Use warns.
19164 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
19165 (copy_action, case '@'): Likewise.
19166 Use a standard error message, to save useless work from
19167 translators.
19168
41aca2e0
AD
191692000-03-17 Akim Demaille <akim@epita.fr>
19170
aa5fd0ee
AD
19171 * src/bison.s1: Formatting and cosmetics changes.
19172 * src/reader.c: Likewise.
41aca2e0
AD
19173 Update the Copyright notice.
19174
dc08c1d5
AD
191752000-03-17 Akim Demaille <akim@epita.fr>
19176
aa5fd0ee
AD
19177 * src/bison.s1 (#line): All set to `#line' only, since the
19178 Makefile now handles them.
dc08c1d5 19179
9ee3c97b
AD
191802000-03-16 Akim Demaille <akim@epita.fr>
19181
19182 * src/output.c (output_rule_data): Output the documentation of
19183 some of the tables.
19184 (Copyright notice): Update.
19185 Formatting changes.
19186
0de741ca
AD
191872000-03-16 Akim Demaille <akim@epita.fr>
19188
19189 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
19190 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
19191 One `#if YYDEBUG' remains, since it uses variables which are
19192 defined only if `YYDEBUG != 0'.
19193
bb10be54
AD
191942000-03-16 Akim Demaille <akim@epita.fr>
19195
19196 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
19197 and related variables so that the similarities are highlighted.
19198
b07b484a
AD
191992000-03-16 Akim Demaille <akim@epita.fr>
19200
19201 * src/bison.s1: Properly indent CPP directives.
19202
361f60b3
AD
192032000-03-16 Akim Demaille <akim@epita.fr>
19204
19205 * src/bison.s1: Properly indent the `alloca' CPP section.
19206
8c44d3ec
AD
192072000-03-16 Akim Demaille <akim@epita.fr>
19208
19209 Do not hard code values of directories in `configure.in'.
19210 Update the `configure' tool chain.
19211
19212 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
19213 src/makefile.am.
19214 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
19215 (AC_OUTPUT): Add m4/Makefile.
19216 Bump to bison 1.28a, 1.29 has never been released.
19217 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
19218 handled via src/Makefile.am.
19219 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
19220 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
19221 autoheader.
19222 * Makefile.am (SUBDIRS): Add m4.
19223 (ACLOCAL_AM_FLAGS): New variable.
19224 (AUTOMAKE_OPTIONS): Add check-news.
19225 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
19226 the proper line number and file name.
19227 (DEFS): Propagate the location of bison library files and of the
19228 locale files.
19229 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
19230 builddir.
19231 * acinclude.m4: Remove, replaced by the directory m4.
19232 * m4/Makefile.am (EXTRA_DIST): New variable.
19233 * m4/gettext.m4: New file, from the fileutils.
19234 * m4/lcmessage.m4: Likewise
19235 * m4/progtest.m4: Likewise.
19236 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
19237
f95997e7
AD
192382000-03-10 Akim Demaille <akim@epita.fr>
19239
19240 * src/closure.c:
19241 Formatting changes of various comments.
19242 Respect the GNU coding standards at various places.
19243 Don't use `_()' when no translation is needed.
19244
192451999-12-13 Jesse Thilo <jthilo@gnu.org>
19246
19247 * src/files.c:
19248 OS/2 honors TMPDIR environment variable.
19249
192501999-12-13 Jesse Thilo <jthilo@gnu.org>
19251
19252 * doc/bison.texinfo: Tweaked spelling and grammar.
19253 Updated ISBN.
19254 Removed reference to price of printed copy.
19255 Mention BISON_SIMPLE and BISON_HAIRY.
19256
192571999-12-13 Jesse Thilo <jthilo@gnu.org>
19258
19259 * configure.in, NEWS:
19260 Bison 1.29 released.
19261
192621999-10-27 Jesse Thilo <jthilo@gnu.org>
19263
19264 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
19265 Added reference card.
19266
192671999-07-26 Jesse Thilo <jthilo@gnu.org>
19268
19269 * po/ru.po: Added Russian translation.
19270
192711999-07-26 Jesse Thilo <jthilo@gnu.org>
19272
19273 * configure.in: Added Russian translation.
19274
192751999-07-06 Jesse Thilo <jthilo@gnu.org>
19276
19277 * configure.in, NEWS, README:
19278 Released version 1.28.
19279
192801999-06-14 Jesse Thilo <jthilo@gnu.org>
19281
19282 * src/system.h:
19283 Squashed redefinition warning on some systems.
19284
19285 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
19286 Have configure build version string instead of relying on ANSI string
19287 concatentation.
19288
192891999-06-14 Jesse Thilo <jthilo@gnu.org>
19290
19291 * po/POTFILES.in: Got rid of version.c.
19292
192931999-06-14 Jesse Thilo <jthilo@gnu.org>
19294
19295 * acconfig.h, configure.in:
19296 Have configure build version string instead of relying on ANSI string
19297 concatentation.
19298
192991999-06-08 Jesse Thilo <jthilo@gnu.org>
19300
19301 * doc/bison.1:
19302 Dropped mention of `+' for long-named options.
19303
193041999-05-30 Jesse Thilo <jthilo@gnu.org>
19305
19306 * src/files.c: Added <unistd.h> for unlink().
19307
19308 * src/Makefile.am, src/system.h:
19309 I18n fixes.
19310
193111999-05-30 Jesse Thilo <jthilo@gnu.org>
19312
19313 * README: Added a FAQ list.
19314
19315 * configure.in, acconfig.h:
19316 I18n fixes.
19317
193181999-05-30 Jesse Thilo <jthilo@gnu.org>
19319
19320 * doc/FAQ, doc/Makefile.am:
19321 Added a FAQ list.
19322
193231999-05-19 Jesse Thilo <jthilo@gnu.org>
19324
19325 * src/alloc.h, src/symtab.h, src/version.c:
19326 Protected inclusion of "config.h" with HAVE_CONFIG_H.
19327
193281999-04-18 Jesse Thilo <jthilo@gnu.org>
19329
19330 * src/.cvsignore, src/Makefile.am:
19331 Reorganized: sources in `src', documentation in `doc'.
19332
19333 * src/lex.c (literalchar):
19334 fixed the code for escaping double quotes (thanks
19335 Jonathan Czisny.)
19336
193371999-04-18 Jesse Thilo <jthilo@gnu.org>
19338
19339 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
19340 Adjusted paths to reflect directory reorganization.
19341
193421999-04-18 Jesse Thilo <jthilo@gnu.org>
19343
19344 * doc/.cvsignore, doc/Makefile.am:
19345 Reorganized: sources in `src', documentation in `doc'.
19346
193471999-04-18 Jesse Thilo <jthilo@gnu.org>
19348
19349 * configure.in:
19350 Updated AC_INIT file to reflect directory reorganization.
19351
19352 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
19353 Reorganized: sources in `src', documentation in `doc'.
19354
193551999-04-13 Jesse Thilo <jthilo@gnu.org>
19356
19357 * src/allocate.c:
19358 Don't declare calloc() and realloc() if not necessary.
19359
193601999-04-13 Jesse Thilo <jthilo@gnu.org>
19361
19362 * configure.in, acconfig.h, acinclude.m4:
19363 Don't declare calloc() and realloc() if not necessary.
19364
193651999-03-23 Jesse Thilo <jthilo@gnu.org>
19366
19367 * po/.cvsignore: Added i18n support.
19368
193691999-03-23 Jesse Thilo <jthilo@gnu.org>
19370
19371 * acconfig.h, configure.in, Makefile.am:
19372 Added i18n support.
19373
193741999-03-22 Jesse Thilo <jthilo@gnu.org>
19375
19376 * src/bison.s1: Fixed #line numbers.
19377
193781999-03-15 Jesse Thilo <jthilo@gnu.org>
19379
19380 * po/es.po, po/fr.po, po/nl.po, po/de.po:
19381 Added PO files from Translation Project.
19382
193831999-03-03 Jesse Thilo <jthilo@gnu.org>
19384
19385 * Makefile.am:
19386 Added support for non-ANSI compilers (ansi2knr).
19387
193881999-02-16 Jesse Thilo <jthilo@gnu.org>
19389
19390 * configure.in: Bumped version number to 1.27.
19391
19392 * Makefile.am:
19393 Added `bison.simple' to list of files removed by `make distclean'.
19394
193951999-02-12 Jesse Thilo <jthilo@gnu.org>
19396
19397 * src/files.c, src/files.h:
19398 Defined locations of parser files in config.h instead of Makefile.
19399
194001999-02-12 Jesse Thilo <jthilo@gnu.org>
19401
19402 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
19403 Defined locations of parser files in config.h instead of Makefile.
19404
194051999-02-09 Jesse Thilo <jthilo@gnu.org>
19406
19407 * Makefile.am:
19408 Removed inappropriate use of $< macro.
19409
194101999-02-05 Jesse Thilo <jthilo@gnu.org>
19411
19412 * po/Makefile.in.in, po/POTFILES.in:
19413 Add `po' directory skeleton.
19414
194151999-01-27 Jesse Thilo <jthilo@gnu.org>
19416
19417 * README: Document help-bison list.
19418
19419 * configure.in: Add check for mkstemp().
19420
194211999-01-20 Jesse Thilo <jthilo@gnu.org>
19422
19423 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
19424 Hush a few compiler warnings.
19425
19426 * src/files.c:
19427 Add tryclose(), which verifies that fclose was successful.
19428 Hush a couple of compiler warnings.
19429
194301999-01-20 Jesse Thilo <jthilo@gnu.org>
19431
19432 * Makefile.am, OChangeLog:
19433 ChangeLog is now automatically generated. Include the old version as
19434 OChangeLog.
19435
194361999-01-14 Jesse Thilo <jthilo@gnu.org>
19437
19438 * 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:
19439 Update FSF address.
19440
194411999-01-14 Jesse Thilo <jthilo@gnu.org>
19442
19443 * doc/bison.texinfo: Fix formatting glitch.
19444
19445 * doc/bison.texinfo: Update FSF address.
19446
194471999-01-14 Jesse Thilo <jthilo@gnu.org>
19448
19449 * acconfig.h: Update FSF address.
19450
194511999-01-08 Jesse Thilo <jthilo@gnu.org>
19452
19453 * src/system.h:
19454 Don't define PACKAGE here, since config.h defines it.
19455
194561998-12-30 Jesse Thilo <jthilo@gnu.org>
19457
19458 * src/reader.c: Update copyright date.
19459
19460 * src/main.c:
19461 Ditch sprintf to statically-sized buffers in fatal/warn functions in
19462 favor of output directly to stderr (avoids buffer overruns).
19463
19464 * src/reader.c: Some checks for premature EOF.
19465
19466 * 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:
19467 Use prototypes if the compiler understands them.
19468
19469 * src/files.c: Honor TMPDIR on Unix hosts.
19470 Use prototypes if the compiler understands them.
19471
19472 * src/reader.c:
19473 Fix a couple of buffer overrun bugs.
19474 Use prototypes if the compiler understands them.
19475
19476 * src/system.h: Include unistd.h and ctype.h.
19477 Use #ifdef instead of #if for NLS symbols.
19478
194791998-12-30 Jesse Thilo <jthilo@gnu.org>
19480
19481 * doc/bison.texinfo:
19482 Delete comment "consider using @set for edition number, etc..." since
19483 we now are doing so.
19484
194851998-12-30 Jesse Thilo <jthilo@gnu.org>
19486
19487 * configure.in:
19488 Use prototypes if the compiler understands them.
19489
19490 * NEWS: Document 1.26 highlights.
19491
19492 * Makefile.am: Require Automake 1.3 or later.
19493
19494 * acconfig.h:
19495 Use prototypes if the compiler understands them.
19496
194971998-12-29 Jesse Thilo <jthilo@gnu.org>
19498
19499 * src/version.c:
19500 Use VERSION symbol from automake for version number.
19501
195021998-12-29 Jesse Thilo <jthilo@gnu.org>
19503
19504 * acconfig.h, configure.in, version.cin:
19505 Use VERSION symbol from automake for version number.
19506
195071998-11-28 Jesse Thilo <jthilo@gnu.org>
19508
19509 * Makefile.am:
19510 Distribute original version of simple parser (bison.s1), not built
19511 version (bison.simple).
19512
195131998-11-28 Jesse Thilo <jthilo@gnu.org>
19514
19515 * doc/bison.texinfo: Add info dir entry.
19516
19517 * doc/bison.texinfo:
19518 Let automake put version number into documentation.
19519
195201998-11-26 Jesse Thilo <jthilo@gnu.org>
19521
19522 * src/bison.cld, src/build.com, src/vmshlp.mar:
19523 Add non-RCS files from /gd/gnu/bison.
19524
195251998-11-26 Jesse Thilo <jthilo@gnu.org>
19526
19527 * doc/bison.1:
19528 Document the BISON_HAIRY and BISON_SIMPLE variables.
19529
195301998-11-25 Jesse Thilo <jthilo@gnu.org>
19531
19532 * src/version.c: Build version.c automatically.
19533
19534 * src/reader.c:
19535 Fix token numbering (used to start at 258, not 257).
19536
19537 * src/system.h: Include config.h.
19538
19539 * src/getargs.c: Update bug report address.
19540
19541 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
19542 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
19543
195441998-11-25 Jesse Thilo <jthilo@gnu.org>
19545
19546 * Makefile.am:
19547 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19548
19549 * configure.in, version.cin:
19550 Build version.c automatically.
19551
19552 * AUTHORS: Add AUTHORS file.
19553
19554 * README: Update bug report address.
19555
19556 * bison.simple:
19557 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19558
19559 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
19560 Add automake stuff.
19561
195621998-11-25 Jesse Thilo <jthilo@gnu.org>
19563
19564 * doc/bison.texinfo: Clean up some formatting.
19565
195661998-05-05 Richard Stallman <rms@gnu.org>
19567
19568 * doc/bison.texinfo:
19569 Explain better why to make a pure parser.
19570
195711998-01-05 Richard Stallman <rms@gnu.org>
19572
19573 * src/files.c (openfiles):
19574 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
19575 find a temporary directory, if possible. Do not unlink files while
19576 they are open.
19577
195781997-08-25 Richard Stallman <rms@gnu.org>
19579
19580 * src/reader.c (stack_offset;):
19581 Change some warni to warns.
19582
19583 * src/lex.c (literalchar): Use warns, not warni.
19584
195851997-06-28 Richard Stallman <rms@gnu.org>
19586
19587 * src/bison.s1: Add a Bison version comment.
19588
19589 * src/main.c (fatal, warn, berror):
19590 Use program_name.
19591
195921997-06-28 Richard Stallman <rms@gnu.org>
19593
19594 * Makefile.in (bison_version): New variable.
19595 (dist): Use that variable.
19596 (bison.s1): Substitute the Bison version into bison.simple.
19597
19598 * bison.simple: Add a Bison version comment.
19599
196001997-06-18 Richard Stallman <rms@gnu.org>
19601
19602 * src/main.c (fatal, warn, berror):
19603 Make error messages standard.
19604 (toomany): Improve error message text.
19605
19606 * 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:
19607 new.h renamed to alloc.h.
19608
196091997-06-18 Richard Stallman <rms@gnu.org>
19610
19611 * Makefile.in: new.h renamed to alloc.h.
19612
196131997-05-24 Richard Stallman <rms@gnu.org>
19614
19615 * src/lex.c (literalchar):
19616 Fix the code for escaping \, " and '.
19617
19618 (lex): Avoid trouble when there are many chars
19619 to discard in a char literal with just several chars in it.
19620
196211997-05-17 Richard Stallman <rms@gnu.org>
19622
19623 * src/bison.s1:
19624 Use malloc, if using alloca is troublesome.
19625 (YYSTACK_USE_ALLOCA): New flag macro.
19626 Define it for some systems and compilers.
19627 (YYSTACK_ALLOC): New macro.
19628 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19629 If it was malloc'd, free it.
19630
196311997-05-17 Richard Stallman <rms@gnu.org>
19632
19633 * bison.simple:
19634 Use malloc, if using alloca is troublesome.
19635 (YYSTACK_USE_ALLOCA): New flag macro.
19636 Define it for some systems and compilers.
19637 (YYSTACK_ALLOC): New macro.
19638 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19639 If it was malloc'd, free it.
19640
196411997-04-23 Richard Stallman <rms@gnu.org>
19642
19643 * src/bison.s1:
19644 (alloca) [__hpux]: Always define as __builtin_alloca.
19645
196461997-04-23 Richard Stallman <rms@gnu.org>
19647
19648 * bison.simple:
19649 (alloca) [__hpux]: Always define as __builtin_alloca.
19650
196511997-04-22 Richard Stallman <rms@gnu.org>
19652
19653 * src/bison.s1:
19654 [__hpux]: Include alloca.h (right for HPUX 10)
19655 instead of declaring alloca (right for HPUX 9).
19656
19657 * src/bison.s1 (__yy_memcpy):
19658 Declare arg `count' as unsigned int.
19659 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19660
196611997-04-22 Richard Stallman <rms@gnu.org>
19662
19663 * bison.simple:
19664 [__hpux]: Include alloca.h (right for HPUX 10)
19665 instead of declaring alloca (right for HPUX 9).
19666
19667 * bison.simple (__yy_memcpy):
19668 Declare arg `count' as unsigned int.
19669 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19670
196711997-01-03 Richard Stallman <rms@gnu.org>
19672
19673 * src/allocate.c: [__STDC__ or _MSC_VER]:
19674 Declare calloc and realloc to return void *.
19675
196761997-01-02 Richard Stallman <rms@gnu.org>
19677
19678 * src/system.h:
19679 [_MSC_VER]: Include stdlib.h and process.h.
19680 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
19681
19682 * src/main.c (main): Return FAILURE as a value.
19683 (printable_version): Declare arg as int, not char.
19684
196851997-01-02 Richard Stallman <rms@gnu.org>
19686
19687 * Makefile.in (dist):
19688 Explicitly check for symlinks, and copy them.
19689
196901996-12-19 Richard Stallman <rms@gnu.org>
19691
19692 * src/files.c:
19693 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
19694
196951996-12-18 Paul Eggert <eggert@gnu.org>
19696
19697 * src/bison.s1 (yyparse):
19698 If __GNUC__ and YYPARSE_PARAM are both defined,
19699 declare yyparse to have a void * argument.
19700
197011996-12-18 Paul Eggert <eggert@gnu.org>
19702
19703 * bison.simple (yyparse):
19704 If __GNUC__ and YYPARSE_PARAM are both defined,
19705 declare yyparse to have a void * argument.
19706
197071996-12-17 Richard Stallman <rms@gnu.org>
19708
19709 * src/reduce.c (nbits): Add some casts.
19710
197111996-08-12 Richard Stallman <rms@gnu.org>
19712
19713 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
19714
197151996-08-12 Richard Stallman <rms@gnu.org>
19716
19717 * bison.simple: Test _MSDOS as well as _MSDOS_.
19718
197191996-07-31 Richard Stallman <rms@gnu.org>
19720
19721 * src/bison.s1:
19722 [__sun && __i386]: Include alloca.h.
19723
197241996-07-31 Richard Stallman <rms@gnu.org>
19725
19726 * bison.simple:
19727 [__sun && __i386]: Include alloca.h.
19728
197291996-07-30 Richard Stallman <rms@gnu.org>
19730
19731 * src/bison.s1: Comment change.
19732
19733 * src/bison.s1: Test _MSDOS_, not MSDOS.
19734
197351996-07-30 Richard Stallman <rms@gnu.org>
19736
19737 * bison.simple: Comment change.
19738
19739 * bison.simple: Test _MSDOS_, not MSDOS.
19740
197411996-06-01 Richard Stallman <rms@gnu.org>
19742
19743 * 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:
19744 Insert `_' macro around many string constants.
19745
19746 * src/main.c:
19747 Insert `_' macro around many string constants.
19748
19749 (main): Call setlocale, bindtextdomain and textdomain.
19750
19751 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
19752 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
19753 [ENABLE_NLS]: Include libintl.h.
19754 [ENABLE_NLS] (gettext): Define.
19755 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
19756 (N_, PACKAGE, LOCALEDIR): New macros.
19757
197581996-06-01 Richard Stallman <rms@gnu.org>
19759
19760 * POTFILES.in: New file.
19761
19762 * Makefile.in (allocate.o):
19763 Define target explicitly.
19764
19765 * Makefile.in (CFLAGS): Set to @CFLAGS@.
19766 (LDFLAGS): Set to @LDFLAGS@.
19767 (configure): Run autoconf only if preceding `cd' succeeds.
19768 (bison.s1): Redirect output to temporary file then move the
19769 temporary to the target, rather than redirecting directly to bison.s1.
19770 (clean): Remove config.status and config.log.
19771 (distclean): Don't remove config.status here.
19772
197731996-05-12 Richard Stallman <rms@gnu.org>
19774
19775 * src/bison.s1:
19776 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19777
197781996-05-12 Richard Stallman <rms@gnu.org>
19779
19780 * bison.simple:
19781 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19782
197831996-05-11 Richard Stallman <rms@gnu.org>
19784
19785 * src/bison.s1 (__yy_memcpy):
19786 Really reorder the args, as was supposedly done on Feb 14 1995.
19787 (yyparse): Calls changed accordingly.
19788
197891996-05-11 Richard Stallman <rms@gnu.org>
19790
19791 * Makefile.in (dist): Don't use $(srcdir).
19792
19793 * bison.simple (__yy_memcpy):
19794 Really reorder the args, as was supposedly done on Feb 14 1995.
19795 (yyparse): Calls changed accordingly.
19796
197971996-01-27 Richard Stallman <rms@gnu.org>
19798
19799 * src/output.c (output_rule_data):
19800 Test YYERROR_VERBOSE in the conditional
19801 around the definition of ttyname.
19802
198031995-12-29 Richard Stallman <rms@gnu.org>
19804
19805 * src/bison.s1:
19806 Fix line numbers in #line commands.
19807
198081995-12-29 Richard Stallman <rms@gnu.org>
19809
19810 * bison.simple:
19811 Fix line numbers in #line commands.
19812
198131995-12-27 Richard Stallman <rms@gnu.org>
19814
19815 * src/bison.s1 (YYPARSE_PARAM_DECL):
19816 In C++, make it always null.
19817 (YYPARSE_PARAM_ARG): New macro.
19818 (yyparse): Use YYPARSE_PARAM_ARG.
19819
198201995-12-27 Richard Stallman <rms@gnu.org>
19821
19822 * bison.simple (YYPARSE_PARAM_DECL):
19823 In C++, make it always null.
19824 (YYPARSE_PARAM_ARG): New macro.
19825 (yyparse): Use YYPARSE_PARAM_ARG.
19826
198271995-11-29 Richard Stallman <rms@gnu.org>
19828
19829 * doc/bison.texinfo:
19830 Describe literal string tokens, %raw, %no_lines, %token_table.
19831
198321995-11-29 Daniel Hagerty <hag@gnu.org>
19833
19834 * doc/bison.texinfo: Fixed update date
19835
198361995-10-16 Richard Stallman <rms@gnu.org>
19837
19838 * src/version.c: Version 1.25.
19839
198401995-10-16 Richard Stallman <rms@gnu.org>
19841
19842 * NEWS: *** empty log message ***
19843
198441995-10-16 Richard Stallman <rms@gnu.org>
19845
19846 * doc/bison.1, doc/bison.rnh:
19847 Add new options.
19848
198491995-10-15 Richard Stallman <rms@gnu.org>
19850
19851 * src/vmsgetargs.c, src/getargs.c:
19852 Added -n, -k, and -raw switches.
19853 (noparserflag, toknumflag, rawtoknumflag): New variables.
19854
19855 * src/symtab.h (SALIAS):
19856 New #define for adding aliases to %token.
19857 (struct bucket): Added `alias' field.
19858
19859 * src/reduce.c (reduce_grammar):
19860 Revise error message.
19861 (print_notices): Remove final `.' from error message.
19862
19863 * src/reader.c (reader_output_yylsp):
19864 New function.
19865 (readgram): Use `#if 0' around code that accepted %command
19866 inside grammar rules: The documentation doesn't allow it,
19867 and it will fail since the %command processors scan for the next %.
19868 (parse_token_decl): Extended the %token
19869 declaration to allow a multi-character symbol as an alias.
19870 (parse_thong_decl): New function.
19871 (read_declarations): Added %thong declarations.
19872 (read_declarations): Handle NOOP to deal with allowing
19873 % declarations as another means to specify the flags.
19874 (readgram): Allow %prec prior to semantics embedded in a rule.
19875 (skip_to_char, read_declarations, copy_definition)
19876 (parse_token_decl, parse_start_decl, parse_type_decl)
19877 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
19878 (get_type_name, copy_guard, copy_action, readgram)
19879 (get_type, packsymbols): Revised most error messages.
19880 Changed `fatal' to `warnxxx' to avoid aborting for error.
19881 Revised and use multiple warnxxx functions to avoid using VARARGS1.
19882 (read_declarations): Improve the error message for
19883 an invalid character. Do not abort.
19884 (read_declarations, copy_guard, copy_action): Use
19885 printable_version to avoid unprintable characters in printed output.
19886 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
19887 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
19888 Allow the type of a non-terminal can be given
19889 more than once, as long as all specifications give the same type.
19890
19891 * src/output.c:
19892 (output_headers, output_trailers, output, output_gram)
19893 (output_rule_data): Implement noparserflag variable.
19894 Implement toknumflag variable.
19895 (output): Call reader_output_yylsp to output LTYPESTR.
19896
19897 * src/main.c (main):
19898 If reader sees an error, don't process the grammar.
19899 (fatals): Updated to not use VARARGS1.
19900 (printable_version, int_to_string, warn, warni, warns, warnss)
19901 (warnsss): New error reporting functions. Avoid abort for error.
19902
19903 * src/lex.h:
19904 Added THONG and NOOP for alias processing.
19905 Added SETOPT for the new code that allows setting options with %flags.
19906
19907 * src/lex.c:
19908 Include getopt.h. Add some extern decls.
19909 (safegetc): New function to deal with EOF gracefully.
19910 (literalchar); new function to deal with reading \ escapes.
19911 (lex): Use literalchar.
19912 (lex): Implemented "..." tokens.
19913 (literalchar, lex, parse_percent_token): Made tokenbuffer
19914 always contain the token. This includes growing the token
19915 buffer while reading an integer.
19916 (parse_percent_token): Replaced if-else statement with percent_table.
19917 (parse_percent_token): Added % declarations as another
19918 way to specify the flags -n, -l, and -r. Also added hooks for
19919 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
19920 major changes to files.c.
19921 (lex) Retain in the incoming stream a character following
19922 an incorrect '/'.
19923 (skip_white_space, lex): Revised most error messages
19924 and changed fatal to warn to avoid aborting.
19925 (percent_table): Added %thong declarations.
19926
19927 * src/gram.h: Comment changes.
19928
19929 * src/files.c (openfiles, open_extra_files, done):
19930 Add faction flag
19931 and actfile file. Handle noparserflag. Both for -n switch.
19932
19933 * src/conflicts.c (resolve_sr_conflict):
19934 Remove use of alloca.
19935
199361995-06-01 Jim Meyering <meyering@gnu.org>
19937
19938 * doc/bison.texinfo: *** empty log message ***
19939
199401995-05-06 Richard Stallman <rms@gnu.org>
19941
19942 * src/bison.s1: Comment change.
19943
199441995-05-06 Richard Stallman <rms@gnu.org>
19945
19946 * bison.simple: Comment change.
19947
199481995-05-03 Richard Stallman <rms@gnu.org>
19949
19950 * src/version.c: Version now 1.24.
19951
19952 * src/bison.s1: Change distribution terms.
19953
19954 * src/version.c: Version now 1.23.
19955
199561995-05-03 Richard Stallman <rms@gnu.org>
19957
19958 * doc/bison.texinfo:
19959 Rewrite "Conditions for Using Bison".
19960 Update version to 1.24.
19961
199621995-05-03 Richard Stallman <rms@gnu.org>
19963
19964 * bison.simple: Change distribution terms.
19965
199661995-02-23 Richard Stallman <rms@gnu.org>
19967
19968 * src/files.c: Test __VMS_POSIX as well as VMS.
19969
199701995-02-14 Jim Meyering <meyering@gnu.org>
19971
19972 * src/bison.s1 (__yy_memcpy):
19973 Renamed from __yy_bcopy to avoid
19974 confusion. Reverse FROM and TO arguments to be consistent with
19975 those of memcpy.
19976
199771995-02-14 Jim Meyering <meyering@gnu.org>
19978
19979 * bison.simple (__yy_memcpy):
19980 Renamed from __yy_bcopy to avoid
19981 confusion. Reverse FROM and TO arguments to be consistent with
19982 those of memcpy.
19983
199841994-11-10 David J. MacKenzie <djm@gnu.org>
19985
19986 * NEWS: reformat
19987
19988 * NEWS: New file.
19989
19990 * Makefile.in (DISTFILES): Include NEWS.
19991
19992 * Makefile.in (DISTFILES):
19993 Include install-sh, not install.sh.
19994
19995 * configure.in: Update to Autoconf v2 macro names.
19996
199971994-10-05 David J. MacKenzie <djm@gnu.org>
19998
19999 * Makefile.in: fix typo
20000
20001 * Makefile.in (prefix, exec_prefix):
20002 Let configure set them.
20003
200041994-09-28 David J. MacKenzie <djm@gnu.org>
20005
20006 * Makefile.in: Set datadir to $(prefix)/share.
20007
200081994-09-15 Richard Stallman <rms@gnu.org>
20009
20010 * src/bison.s1:
20011 Update copyright notice and GPL version.
20012
200131994-09-15 Richard Stallman <rms@gnu.org>
20014
20015 * bison.simple:
20016 Update copyright notice and GPL version.
20017
200181994-07-12 Richard Stallman <rms@gnu.org>
20019
20020 * src/reduce.c, src/reader.c:
20021 entered into RCS
20022
200231994-05-05 David J. MacKenzie <djm@gnu.org>
20024
20025 * Makefile.in: entered into RCS
20026
200271994-03-26 Richard Stallman <rms@gnu.org>
20028
20029 * src/bison.s1: entered into RCS
20030
200311994-03-26 Richard Stallman <rms@gnu.org>
20032
20033 * bison.simple: entered into RCS
20034
200351994-03-25 Richard Stallman <rms@gnu.org>
20036
20037 * src/main.c: entered into RCS
20038
200391994-03-24 Richard Stallman <rms@gnu.org>
20040
20041 * src/conflicts.c: entered into RCS
20042
200431994-01-02 Richard Stallman <rms@gnu.org>
20044
20045 * Makefile.in: *** empty log message ***
20046
200471993-11-21 Richard Stallman <rms@gnu.org>
20048
20049 * src/bison.s1: *** empty log message ***
20050
200511993-11-21 Richard Stallman <rms@gnu.org>
20052
20053 * doc/bison.texinfo: entered into RCS
20054
20055 * doc/bison.texinfo: *** empty log message ***
20056
200571993-11-21 Richard Stallman <rms@gnu.org>
20058
20059 * bison.simple: *** empty log message ***
20060
200611993-10-25 David J. MacKenzie <djm@gnu.org>
20062
20063 * doc/bison.texinfo: *** empty log message ***
20064
200651993-10-19 Richard Stallman <rms@gnu.org>
20066
20067 * src/bison.s1: *** empty log message ***
20068
200691993-10-19 Richard Stallman <rms@gnu.org>
20070
20071 * bison.simple: *** empty log message ***
20072
200731993-10-14 Richard Stallman <rms@gnu.org>
20074
20075 * src/bison.s1: *** empty log message ***
20076
200771993-10-14 Richard Stallman <rms@gnu.org>
20078
20079 * bison.simple: *** empty log message ***
20080
200811993-09-14 David J. MacKenzie <djm@gnu.org>
20082
20083 * doc/bison.texinfo: *** empty log message ***
20084
200851993-09-13 Noah Friedman <friedman@gnu.org>
20086
20087 * Makefile.in: *** empty log message ***
20088
200891993-09-10 Richard Stallman <rms@gnu.org>
20090
20091 * src/conflicts.c: *** empty log message ***
20092
20093 * src/system.h: entered into RCS
20094
200951993-09-10 Richard Stallman <rms@gnu.org>
20096
20097 * doc/bison.1: entered into RCS
20098
200991993-09-06 Noah Friedman <friedman@gnu.org>
20100
20101 * src/version.c: entered into RCS
20102
201031993-09-06 Noah Friedman <friedman@gnu.org>
20104
20105 * Makefile.in: *** empty log message ***
20106
201071993-07-30 David J. MacKenzie <djm@gnu.org>
20108
20109 * Makefile.in: *** empty log message ***
20110
201111993-07-24 Richard Stallman <rms@gnu.org>
20112
20113 * src/bison.s1: *** empty log message ***
20114
201151993-07-24 Richard Stallman <rms@gnu.org>
20116
20117 * bison.simple: *** empty log message ***
20118
201191993-07-08 David J. MacKenzie <djm@gnu.org>
20120
20121 * Makefile.in: *** empty log message ***
20122
201231993-07-04 Richard Stallman <rms@gnu.org>
20124
20125 * src/bison.s1: *** empty log message ***
20126
201271993-07-04 Richard Stallman <rms@gnu.org>
20128
20129 * bison.simple: *** empty log message ***
20130
201311993-06-26 David J. MacKenzie <djm@gnu.org>
20132
20133 * src/getargs.c: entered into RCS
20134
201351993-06-26 David J. MacKenzie <djm@gnu.org>
20136
20137 * doc/bison.texinfo: *** empty log message ***
20138
20139 * doc/bison.1: New file.
20140
201411993-06-25 Richard Stallman <rms@gnu.org>
20142
20143 * src/getargs.c: New file.
20144
201451993-06-16 Richard Stallman <rms@gnu.org>
20146
20147 * src/bison.s1: *** empty log message ***
20148
201491993-06-16 Richard Stallman <rms@gnu.org>
20150
20151 * bison.simple: *** empty log message ***
20152
201531993-06-03 Richard Stallman <rms@gnu.org>
20154
20155 * src/bison.s1: New file.
20156
201571993-06-03 Richard Stallman <rms@gnu.org>
20158
20159 * doc/bison.texinfo: *** empty log message ***
20160
201611993-06-03 Richard Stallman <rms@gnu.org>
20162
20163 * bison.simple: New file.
20164
201651993-05-19 Richard Stallman <rms@gnu.org>
20166
20167 * doc/bison.texinfo: New file.
20168
201691993-05-07 Noah Friedman <friedman@gnu.org>
20170
20171 * Makefile.in: *** empty log message ***
20172
201731993-04-28 Noah Friedman <friedman@gnu.org>
20174
20175 * src/reader.c: *** empty log message ***
20176
201771993-04-23 Noah Friedman <friedman@gnu.org>
20178
20179 * src/alloc.h: entered into RCS
20180
201811993-04-20 David J. MacKenzie <djm@gnu.org>
20182
20183 * src/version.c: *** empty log message ***
20184
20185 * src/files.c, src/allocate.c:
20186 entered into RCS
20187
20188 * src/reader.c: *** empty log message ***
20189
20190 * src/lex.c: entered into RCS
20191
20192 * src/conflicts.c: New file.
20193
20194 * src/symtab.c: entered into RCS
20195
20196 * src/alloc.h: New file.
20197
20198 * src/LR0.c: entered into RCS
20199
202001993-04-18 Noah Friedman <friedman@gnu.org>
20201
20202 * src/reader.c: New file.
20203
20204 * src/version.c: *** empty log message ***
20205
202061993-04-18 Noah Friedman <friedman@gnu.org>
20207
20208 * Makefile.in: *** empty log message ***
20209
202101993-04-17 Noah Friedman <friedman@gnu.org>
20211
20212 * Makefile.in: *** empty log message ***
20213
202141993-04-15 Richard Stallman <rms@gnu.org>
20215
20216 * src/main.c, src/files.c:
20217 New file.
20218
202191993-04-15 Noah Friedman <friedman@gnu.org>
20220
20221 * configure.in: entered into RCS
20222
20223 * configure.in: *** empty log message ***
20224
20225 * configure.in: New file.
20226
202271993-04-14 Richard Stallman <rms@gnu.org>
20228
20229 * Makefile.in: New file.
20230
202311993-04-13 Richard Stallman <rms@gnu.org>
20232
20233 * src/version.c: New file.
20234
202351993-03-25 Richard Stallman <rms@gnu.org>
20236
20237 * src/output.c: entered into RCS
20238
202391992-09-25 Richard Stallman <rms@gnu.org>
20240
20241 * configure.bat: entered into RCS
20242
202431992-06-22 Richard Stallman <rms@gnu.org>
20244
20245 * src/vmsgetargs.c: entered into RCS
20246
202471992-06-22 Richard Stallman <rms@gnu.org>
20248
20249 * doc/bison.rnh: entered into RCS
20250
202511992-04-20 David J. MacKenzie <djm@gnu.org>
20252
20253 * README: entered into RCS
20254
202551992-01-22 Richard Stallman <rms@gnu.org>
20256
20257 * src/machine.h: entered into RCS
20258
202591991-12-21 Richard Stallman <rms@gnu.org>
20260
20261 * src/lalr.c, src/closure.c:
20262 entered into RCS
20263
202641991-12-20 Richard Stallman <rms@gnu.org>
20265
20266 * src/state.h: entered into RCS
20267
202681991-12-18 Richard Stallman <rms@gnu.org>
20269
20270 * src/print.c, src/nullable.c, src/derives.c:
20271 entered into RCS
20272
202731991-11-03 David J. MacKenzie <djm@gnu.org>
20274
20275 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
20276 entered into RCS
20277
202781988-09-09 Richard Stallman <rms@gnu.org>
20279
20280 * src/bison.hairy: entered into RCS
20281
202821987-12-16 Richard Stallman <rms@gnu.org>
20283
20284 * REFERENCES: entered into RCS
dc546b0f 20285
f294a2c2 20286
04098407 20287 -----
f294a2c2 20288
04098407 20289 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
95021767
JD
20290 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
20291 Free Software Foundation, Inc.
f294a2c2 20292
04098407
PE
20293 Copying and distribution of this file, with or without
20294 modification, are permitted provided the copyright notice and this
20295 notice are preserved.
e9071366
AD
20296
20297$Id$