]> git.saurik.com Git - bison.git/blame - ChangeLog
* THANKS: Update my email address.
[bison.git] / ChangeLog
CommitLineData
a924ef36
JMG
12008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2
3 DJGPP specific issues.
4 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
5 be changed. Copyright timestamp adjusted.
6 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
7 be changed. Copyright timestamp adjusted.
8 * djgpp/config.site: Copyright timestamp adjusted.
9 * djgpp/config_h.sed: Copyright timestamp adjusted.
10 * djgpp/djunpack.bat: Copyright timestamp adjusted.
11 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
12 filename translation list.
13 * djgpp/subpipe.c (init_subpipe): Check the environment variables
14 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
15 files shall be created. Before trying to use the temp dir where the
16 environment variable points to check that the dir really exists. If
17 not default to the cwd as temp dir. Copyright timestamp adjusted.
18 * djgpp/subpipe.h: Copyright timestamp adjusted.
19 * djgpp/testsuite.sed: Copyright timestamp adjusted.
20
389c8cfd
PE
212008-01-30 Paul Eggert <eggert@cs.ucla.edu>
22
23 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
24
5d1cfef4
PE
252008-01-09 Paul Eggert <eggert@cs.ucla.edu>
26
27 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
28 Problem reported by Claudio Saavedra in
29 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
30
e2dcf996
WP
312008-01-05 Wojciech Polak <polak@gnu.org>
32
33 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
34 document's title with the input grammar file name.
35
da730230
JD
362007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
37
38 Automate regression testing of the XML/XSLT implementation. Discussed
39 starting at
40 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
41 * configure.ac (XSLTPROC): New substitution.
42 * Makefile.am (maintainer-xml-check): New phony target invoking...
43 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
44 invoking make maintainer-check with BISON_TEST_XML=1.
45 * tests/atlocal.in (XSLTPROC): New.
46 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
47 not to report reachable memory when Bison is expected to have a
48 non-zero exit status and (2) to compare XML/XSLT output with --graph
49 and --report=all output for every working grammar when
50 BISON_TEST_XML=1.
51 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
52 (AT_BISON_CHECK_XML): New.
53 (AT_QUELL_VALGRIND): New.
54 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
55 (AT_CHECK): ... don't redefine this since this was the old way to
56 quell Valgrind.
57 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
58 AT_BISON_CHECK invocations.
59 * tests/c++.at: Likewise.
60 * tests/calc.at: Likewise.
61 * tests/conflicts.at: Likewise.
62 * tests/cxx-type.at: Likewise.
63 * tests/existing.at: Likewise.
64 * tests/glr-regression.at: Likewise.
65 * tests/headers.at: Likewise.
66 * tests/input.at: Likewise.
67 * tests/java.at: Likewise.
68 * tests/output.at: Likewise.
69 * tests/push.at: Likewise.
70 * tests/reduce.at: Likewise.
71 * tests/regression.at: Likewise.
72 * tests/sets.at: Likewise.
73 * tests/skeletons.at: Likewise.
74 * tests/synclines.at: Likewise.
75 * tests/torture.at: Likewise.
76 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
77 tends to hang xsltproc.
78 (Big horizontal): Likewise.
79
408476bc
JD
802007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
81
82 In XML output, remove redundant class attribute on symbol element.
83 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
84 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
85 look up a symbol to determine whether it's a nonterminal or terminal.
86 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
87 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
88
89 Add prec/assoc information to XML output.
90 * src/gram.c (grammar_rules_print_xml): For each rule that has a
91 %prec, add a percent_prec attribute.
92 * src/print-xml.c (print_grammar): For each terminal that has a
93 precedence or associativity, add a prec or assoc attribute.
94 (xml_indent): New.
95 (xml_puts): Use xml_indent.
96 (xml_printf): Use xml_indent.
97 * src/print-xml.h (xml_indent): Prototype.
98
99 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
100 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
101
d4a26c48
JD
1022007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
103
104 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
105 (bison:ruleByNumber): ... this for clarity.
106 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
107 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
108 (xsl:template match="reduction"): Update.
109 (xsl:template match="item"): Update.
110 (xsl:template match="reduction"): Update.
111
112 In the XML output, don't print the list of rules where symbols appear.
113 Compute it in XSLT instead. Discussed at
114 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
115 * data/xslt/bison.xsl (bison:ruleByLhs): New.
116 (bison:ruleByRhs): New.
117 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
118 bison:ruleByRhs.
119 (xsl:template match="terminal/rule"): Remove.
120 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
121 bison:ruleByRhs.
122 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
123 Remove.
124 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
125 bison:ruleByRhs and mode="number-link" for rule template.
126 (xsl:template match="terminal/rule"): Remove.
127 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
128 bison:ruleByRhs and mode="number-link" for rule template.
129 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
130 Rewrite as...
131 (xsl:template match="rule" mode="number-link"): ... this.
132 * src/print-xml.c (print_grammar): Don't print the list of rules.
133
ef1b4273
JD
1342007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
135
136 Don't let --report affect XML output; always print all information.
137 Discussed at
138 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
139 * src/conflicts.c (log_resolution): Implement.
140 * src/print-xml.c (print_core): Implement.
141 (print_state): Implement.
142 (print_xml): Implement.
143
144 * NEWS (2.3a+): Fix quotes.
145 * src/parse-gram.y (prologue_declaration): For consistency with -v,
146 don't let %verbose clear the list specified by --report.
147
0f6cd9e3
AD
1482007-11-26 Akim Demaille <akim@epita.fr>
149
150 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
151
d80fb37a
JD
1522007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
153
154 In the XML output, list useless and unused symbols and rules with the
155 useful ones and add a "usefulness" attribute. Discussed starting at
156 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
157 * src/gram.c (grammar_rules_partial_print_xml): Remove.
158 (grammar_rules_print_xml): Print all rules instead of just those
159 useful in the grammar, and add a "usefulness" attribute.
160 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
161 * src/print-xml.c (print_rules_useless_in_parser): Remove.
162 (print_grammar): Print all nonterminals instead of just useful ones,
163 and add a "usefulness" attribute to nonterminals and terminals.
164 (print_xml): Don't print a separate "reductions" or
165 "rules-useless-in-parser" element.
166 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
167 (reduce_xml): Remove.
168 (reduce_token_unused_in_grammar): New.
169 (reduce_nonterminal_useless_in_grammar): New.
170 * src/reduce.h (reduce_xml): Remove prototype.
171 (reduce_token_unused_in_grammar): Add prototype.
172 (reduce_nonterminal_useless_in_grammar): Add prototype.
173 * data/xslt/xml2text.xsl: Update for XML changes.
174 * data/xslt/xml2xhtml.xsl: Update for XML changes.
175 * tests/reduce.at (Useless Terminals): Update output.
176 (Useless Rules): Update output.
177 (Reduced Automaton): Update output.
178
179 Say "Terminals unused in grammar" instead of "Unused terminals".
180 * NEWS (2.3a+): Update.
181 * doc/bison.texinfo (Understanding): Update example output.
182 * src/reduce.c (reduce_output): Implement.
183 * data/xslt/xml2text.xsl: Implement.
184 * data/xslt/xml2xhtml.xsl: Implement.
185
1bb2bd75
JD
1862007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
187
188 Accept --report-file=FILE to override the default `.output' filename.
189 * NEWS (2.3a+): Mention.
190 * doc/bison.texinfo (Bison Options): Add an entry.
191 * src/files.c (compute_output_file_names): Don't override
192 spec_verbose_file if already set.
193 * src/getargs.c (usage): Document --report-file.
194 (REPORT_FILE_OPTION): New anonymous enum member.
195 (long_options): Add entry for it.
196 (getargs): Add case for it setting spec_verbose_file.
197
198 * build-aux/cross-options.pl: Don't record a short option just because
199 there's an arg.
200 * doc/.cvsignore: Add yacc.1.
201
a005a9c4
AD
2022007-11-14 Akim Demaille <akim@epita.fr>
203
204 * doc/yacc.1.in: New.
205 * configure.ac, doc/Makefile.am: Adjust.
206 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
207 config.h symbol.
208 Use AC_SUBST for assignments too.
209 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
210
cff03fb2
JD
2112007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
212
213 * src/gram.c: Remove comments that duplicate comments in gram.h.
214
215 When reporting useless rules and nonterminals, say "useless in grammar"
216 instead of "useless", and say "useless in parser" instead of "never
217 reduced". Discussed starting at
218 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
219 * NEWS (2.3a+): Mention this change.
220 * data/xslt/xml2text.xsl: Update output text and expected input XML
221 element names to match changes below.
222 * data/xslt/xml2xhtml.xsl: Likewise.
223 (xsl:template match="bison-xml-report"): Add missing entry in Table of
224 Contents: "Rules useless in parser due to conflicts".
225 * doc/bison.texinfo (Decl Summary): Reword a little.
226 (Understanding): Update example output for changes below.
227 * src/gram.c: (rule_useful_p): Rename to...
228 (rule_useful_in_grammar_p): ... this.
229 (rule_useless_p): Rename to...
230 (rule_useless_in_grammar_p): ... this.
231 (rule_never_reduced_p): Rename to...
232 (rule_useless_in_parser_p): ... this.
233 (grammar_rules_print): Update for renames.
234 (grammar_rules_print_xml): Update for renames.
235 (grammar_rules_never_reduced_report): Rename to...
236 (grammar_rules_useless_report): ... this since it is used for either
237 kind of useless rule.
238 * src/gram.h: Reword comments and update function names in prototypes.
239 * src/main.c (main): Say "rule useless in parser due to conflicts".
240 * src/print-xml.c (print_rules_never_reduced): Rename to...
241 (print_rules_useless_in_parser): ... this, and rename output XML
242 element "rules-never-reduced" to "rules-useless-in-parser".
243 (print_xml): Update for rename.
244 * src/print.c (print_results): Say "Rules useless in parser due to
245 conflicts".
246 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
247 (nonterminals_reduce): Say "nonterminal useless in grammar".
248 (reduce_output): Say "Nonterminals useless in grammar".
249 Say "Rules useless in grammar".
250 (reduce_xml): Rename output XML element "useless" to
251 "useless-in-grammar".
252 (reduce_print): Don't report the count of grammatically useless rules
253 as "rules never reduced" just because %yacc is specified.
254 In the correct report of this count, say nonterminal(s) and rule(s)
255 "useless in grammar".
256 * tests/conflicts.at (S/R in initial): Update expected output.
257 (Defaulted Conflicted Reduction): Likewise.
258 (Unreachable States After Conflict Resolution): Likewise.
259 * tests/existing.at (GNU pic Grammar): Likewise.
260 * tests/reduce.at (Useless Nonterminals): Likewise.
261 (Useless Rules): Likewise.
262 (Reduced Automaton): Likewise.
263 (Underivable Rules): Likewise.
264 (Empty Language): Likewise.
265
66f0441d
JD
2662007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
267
268 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
269 here document and before the EOF so that BSD's implementation of Bourne
270 shell doesn't parse the delimiter as part of the here document.
271 * doc/.cvsignore: Add cross-options.texi.
272 * src/getargs.c (usage): Add a blank line after the warning categories.
273
d0ee4105
PB
2742007-11-08 Paolo Bonzini <bonzini@gnu.org>
275
276 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
277
e8b1fb9b
AD
2782007-11-05 Akim Demaille <akim@epita.fr>
279
280 Remove Id: from bison.1.
281 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
282 (perl -0777 -pi -e 's/\.PP\nId): New.
283 (.x.1): Use it to ignore the version control revision.
284
2f7a96b5
AD
2852007-11-05 Akim Demaille <demaille@gostai.com>
286
287 * build-aux/Makefile.am: Ship cross-options.pl.
288 * doc/Makefile.am: Always refer to cross-options.texi with
289 $(srcdir).
290 (MAINTAINERCLEANFILES): Add it.
291
f4101aa6
AD
2922007-11-04 Akim Demaille <demaille@gostai.com>
293
294 Generate the long/short option cross-table.
295 * build-aux/cross-options.pl: New.
296 * doc/Makefile.am (cross-options.texi): New.
297 * doc/bison.texinfo: Use it.
298
727a1401
AD
2992007-11-04 Akim Demaille <demaille@gostai.com>
300
301 Generate bison.1 using help2man.
302 * doc/common.x, doc/bison.x: New.
303 * doc/Makefile.am (bison.1, .x.1): New.
304 The code is taken from autoconf-2.61/man/Makefile.am.
305 * configure.ac: Look for help2man.
306
6aeb9c57
AD
3072007-11-04 Akim Demaille <demaille@gostai.com>
308
309 Complete --help.
310 * src/getargs.c (usage): Document -W, make it clear that -d,
311 -g and -x have optional arguments.
312
d7be4085
AD
3132007-11-04 Akim Demaille <demaille@gostai.com>
314
315 Find sha1sum when named gsha1sum.
316 * bootstrap (find_tool): New.
317 ($SHA1SUM): New.
318
d9df47b6
JD
3192007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
320
321 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
322 at
323 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
324 * NEWS (2.3a+): Mention.
325 * data/bison.m4 (b4_pure_if): Don't define it here.
326 * data/c.m4 (b4_identification): Depend on individual skeletons to
327 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
328 values of the %define variables api.pure or api.push_pull. Define
329 YYPURE, YYPUSH, and YYPULL accordingly.
330 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
331 glr.cc has already defined b4_pure_flag.
332 * data/push.c: Define b4_pure_if based on `%define api.pure'.
333 Remove YYPUSH and YYPULL since they're back in b4_identification again.
334 * data/yacc.c Define b4_pure_if based on `%define api.pure'.
335 * doc/bison.texinfo (Pure Decl): Update.
336 (Push Decl): Update.
337 (Decl Summary): Add api.pure to %define entry.
338 In %pure-parser entry, say it's deprecated and reference %define.
339 (Pure Calling): Update.
340 (Error Reporting): Update.
341 (C++ Scanner Interface): Update.
342 (How Can I Reset the Parser): Update.
343 (Table of Symbols): In %pure-parser entry, say it's deprecated and
344 reference %define.
345 * src/getargs.c (pure_parser): Remove global variable.
346 * src/getargs.h (pure_parser): Remove extern.
347 * src/output.c (prepare): Don't define pure_flag muscle.
348 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
349 wrapper around `%define api.pure'.
350 * tests/calc.at (Simple LALR Calculator): Update.
351 (Simple GLR Calculator): Update.
352 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
353 Update.
354 (GLR: Resolve ambiguity, pure, locations): Update.
355 (GLR: Merge conflicting parses, pure, no locations): Update.
356 (GLR: Merge conflicting parses, pure, locations): Update.
357 * tests/glr-regression.at (Uninitialized location when reporting
358 ambiguity): Update
359 * tests/input.at (Unused %define api.pure): New test case.
360 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
361 AT_PURE_IF and AT_PURE_AND_LOC_IF.
362 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
363
c373bf8b
JD
3642007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
365
366 %define push_pull -> %define api.push_pull. Discussed starting at
367 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
368 * data/push.c: Expect the new name.
369 * data/yacc.c: Likewise.
370 * doc/bison.texinfo (Push Decl): Update.
371 (Decl Summary): Update %define entry.
372 (Push Parser Function): Update.
373 (Pull Parser Function): Update.
374 (Parser Create Function): Update.
375 (Parser Delete Function): Update.
376 * tests/calc.at (Simple LALR Calculator): Update.
377 * tests/input.at (%define enum variables): Update.
378 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
379 (Push Parsing: Multiple impure instances): Update.
380 (Push Parsing: Unsupported Skeletons): Update.
381 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
382 (Exploding the Stack Size with Malloc): Update.
383
384 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
385 other entries some.
386
32f19b6b
JD
3872007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
388
389 For the XML output's terminal element, rename @number to @token-number,
390 and add @symbol-number. In the nonterminal element, rename @number to
391 @symbol-number. Discussed starting at
392 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
393 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
394 renames.
395 (xsl:template match="nonterminal"): Likewise.
396 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
397 (xsl:template match="nonterminal"): Likewise.
398 * src/print-xml.c (print_grammar): Implement.
399
255a6b90
JD
4002007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
401
402 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
403 2007-10-11 change, the child elements here are items not rules.
408476bc 404 (xsl:template match="item"): New.
255a6b90
JD
405 (xsl:template match="rule"): Update for new reduced itemset.
406 (xsl:template match="point"): Remove.
407 (xsl:template match="empty"): For consistency with --graph, don't
408 output "/* empty */".
409 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
410 line-wrap, don't pass a negative value as first-line-length since this
411 won't work with the following changes.
412 (xsl:template name="line-wrap"): Simplify slightly.
413 (xsl:template name="ws-search"): Eliminate recursion.
414 * src/print_graph.c (print_core): Don't print a reduction's lookahead
415 set next to an item whose dot is not at the end of the RHS even if it
416 happens to be associated with the same rule.
417
88c78747
JD
4182007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
419
31984206
JD
420 Add %define lr.keep_unreachable_states.
421 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
422 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
423 * src/main.c (main): Implement it.
424 * tests/conflicts.at (Unreachable States After Conflict Resolution):
425 Extend to test it, and fix a typo.
426
4272007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
428
429 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
430 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
431 the example .output text.
432 * tests/regression.at (Extra lookahead sets in report): Improve wording
433 of comments.
434
b7a70162
WP
4352007-10-17 Wojciech Polak <polak@gnu.org>
436
437 * src/print-xml.c (print_grammar): Renamed
438 <terminal> and <nonterminal> attributes:
439 "type" to "number" and "symbol" to "name".
440 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
441 Use new attribute names.
442 (xsl:template match="nonterminal"): Likewise.
443 * data/xslt/xml2xhtml.xsl: Likewise.
444
a0de5091
JD
4452007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
446
447 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
448 (Option Cross Key): Likewise.
449
450 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
451 next to an item whose dot is not at the end of the RHS even if it
452 happens to be associated with the same rule.
453 * src/print.c (print_core): Likewise.
454 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
455 (Resolved SR Conflicts): Update output.
456 * tests/regression.at (Extra lookahead sets in report): New test case.
457
4c20d18d
WP
4582007-10-11 Wojciech Polak <polak@gnu.org>
459
460 * src/print-xml.c (print_core): Remove item set
461 redundancy.
462 * data/xslt/bison.xsl (bison:ruleNumber): New key.
463 Improve processing time. Suggested by Joel E. Denny.
464 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
465 Write xsl:param "required" attribute as comment.
466 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
467 (xsl:template match="rule"): Support new reduced itemset.
468 (xsl:template match="point"): Remove.
469 * data/xslt/xml2xhtml.xsl: Likewise.
470
f506ad1c
JD
4712007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
472
473 * src/getargs.c (version): Update copyright year.
474
21f1b063
JD
4752007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
476
477 Make xml2dot.xsl and --graph produce the same output.
478 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
479 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
480 escaped later.
481 (xsl:template name="output-node"): Use the new escape template instead
482 of the string-replace template directly.
483 (xsl:template name="output-edge"): Likewise.
484 (xsl:template name="escape"): New, escapes backslashes and newlines in
485 addition to quotation marks.
486 * src/graphviz.c (start_graph, output_node, output_edge): Add
487 whitespace to output for legibility.
488
489 Make xml2text.xsl and --report produce the same output, and remove the
490 XML "conflicts" element since a conflict summary is easily extracted
491 from the automaton.
492 * data/xslt/bison.xsl: New.
493 (xsl:template match="state" mode="bison:count-conflicts): New.
494 * data/xslt/xml2text.xsl: Import bison.xsl.
495 (xsl:template match="bison-xml-report"): Instead of styling the
496 "conflicts" element, style the "automaton" element with mode
497 "conflicts". Unlike the former, the latter lists S/R and R/R
498 conflicts for a state on the same line.
499 (xsl:template match="conflicts"): Remove.
500 (xsl:template match="conflict"): Remove.
501 (xsl:template match="terminal"): Line-wrap the list of rules in which
502 the terminal is used.
503 (xsl:template match="nonterminal"): Likewise for nonterminals.
504 (xsl:template match="automaton" mode="conflicts"): New.
505 (xsl:template match="state" mode="conflicts"): New.
506 (xsl:template name="line-wrap"): New.
507 (xsl:template name="ws-search"): New.
508 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
509 (xsl:template match="bison-xml-report"): Instead of styling the
510 "conflicts" element, style the "automaton" element with mode
511 "conflicts."
512 (xsl:template match="conflicts"): Remove.
513 (xsl:template match="conflict"): Remove.
514 (xsl:template match="automaton" mode="conflicts"): New.
515 (xsl:template match="state" mode="conflicts): New.
516 * src/conflicts.c (conflicts_output_xml): Remove.
517 * src/conflicts.h (conflicts_output_xml): Remove prototype.
518 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
519 * src/print.c (print_grammar): Consistently wrap at the 66th column so
520 the corresponding XSLT is easier. Also, never wrap between a word and
521 the comma that follows it.
522
793fbca5
JD
5232007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
524
525 Improve C++ namespace support. Discussed starting at
526 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
527 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
528 b4_namespace_close): New macros that interpret the %define variable
529 "namespace" so its value can contain "::" to indicate nested
530 namespaces.
531 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
532 the above macros.
533 * data/lalr1.cc (b4_namespace): Likewise.
534 * data/location.cc (b4_namespace): Likewise.
535 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
536 inside a new table in the general %define entry. Document `%define
537 namespace' there as well. Point the %name-prefix entry to it since it
538 explains it more completely in the case of C++.
539 (C++ Bison Interface): Mention `%define namespace' instead of
540 %name-prefix.
541 (Table of Symbols): Remove the `%define push_pull' entry. The %define
542 entry suffices.
543 * tests/c++.at (Relative namespace references): New test case.
544 (Absolute namespace references): New test case.
545 (Syntactically invalid namespace references): New test case.
546 * tests/input.at (C++ namespace reference errors): New test case.
547
35b8730d
JD
5482007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
549
550 Add syncline support and location accessor to internal %define
551 interfaces.
552 * data/bison.m4 (b4_percent_define_get_loc): New.
553 (b4_percent_define_get_syncline): New.
554 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
555 (b4_percent_define_default): Record defining location as line 1 rather
556 than 0 for the sake of synchronizing #line's, and define
557 b4_percent_define_syncline(VARIABLE).
558 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
559 * src/muscle_tab.c (muscle_syncline_grow): New.
560 (muscle_code_grow): Use muscle_syncline_grow.
561 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
562 define b4_percent_define_syncline(VARIABLE).
563 (muscle_percent_define_get_loc): New.
564 (muscle_percent_define_get_syncline): New.
565 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
566 remove some unused variables.
567 (muscle_percent_define_default): Record defining location as line 1
568 rather than 0 for the sake of synchronizing #line's, and define
569 b4_percent_define_syncline(VARIABLE).
570 (muscle_percent_define_check_values): Use
571 muscle_percent_define_get_loc.
572 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
573 (muscle_percent_define_get_syncline): Prototype.
574 * tests/skeletons.at (%define Boolean variables: invalid skeleton
575 defaults): Update output for location change.
576 (Complaining during macro argument expansion): Extend to test
577 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
578
7dc4a694
JD
5792007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
580
581 Fix some error-reporting macro bugs.
582 * data/bison.m4 (b4_cat): New.
583 (b4_error, b4_error_at): Use b4_cat to send error directives directly
584 to stdout so they don't become arguments to other macros. Update
585 comments and add examples.
586 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
587 add examples.
588 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
589 after printing the error directive so that M4 doesn't report subsequent
590 problems that are induced by this problem.
591 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
592 instead of just in them. Recognize @\n in both places. Both expand to
593 the empty string. Needed by b4_cat.
594 * tests/skeletons.at (Complaining during macro argument expansion):
595 New test case.
596 (Fatal errors make M4 exit immediately): New test case.
597
d4bd2295
JD
5982007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
599
600 Implement --print-datadir.
601 * src/getargs.c (usage): Mention.
602 (PRINT_DATADIR_OPTION): New anonymous enum member.
603 (long_options): Add entry for it.
604 (getargs): Add case for it calling compute_pkgdatadir.
605 * src/output.c (output_skeleton): Encapsulate data directory
606 computation from here...
607 (prepare): ... and from here...
608 (compute_pkgdatadir): ... into this new function.
609 * src/output.h (compute_pkgdatadir): Prototype.
610
34cdeddf
JD
6112007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
612
613 * src/print-xml.c (escape_bufs): New static global variable
614 replacing...
615 (xml_escape_n): ... the static local variable buf here.
616 (print_xml): Free memory for escape_bufs.
617 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
618
d782395d
JD
6192007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
620
621 Replace `%push-parser' and `%push-pull-parser' with
622 `%define push_pull "push"' and `%define push_pull "both"'.
623 `%define push_pull "pull"' is the default.
624 * doc/bison.texinfo (Push Decl, Push Parser Function,
625 Pull Parser Function, Parser Create Function, Parser Delete Function):
626 Update declarations.
627 (Decl Summary, Table of Symbols): Replace %push-parser and
628 %push-pull-parser entries with a %define push_pull entry.
629 * data/bison.m4 (b4_percent_define_check_values): New macro.
630 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
631 definitions...
632 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
633 definitions...
634 * data/push.c: ... to here and compute them from the value of the
635 %define variable push_pull.
636 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
637 parsing requests here...
638 * data/yacc.c: ... hack this to switch to push.c any time
639 b4_use_push_pull_flag or the %define variable push_pull is set. This
640 will go away when we mv push.c yacc.c.
641 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
642 push parsing is not supported since unused %define variables are
643 reported anyway.
644 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
645 * src/muscle_tab.h (muscle_percent_define_check_values): Update
646 comments for consistency with b4_percent_define_check_values.
647 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
648 muscles.
649 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
650 Remove.
651 (prologue_declaration): Remove %push-parser and %push-pull-parser
652 rules.
653 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
654 * tests/calc.at: Update declarations.
655 * tests/input.at (%define enum variables): New test case.
656 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
657 declaration.
658 (Push Parsing: Multiple impure instances): Update declaration.
659 (Push Parsing: Unsupported Skeletons): New test case.
660 * tests/torture.at (Exploding the Stack Size with Alloca): Update
661 declaration.
662 (Exploding the Stack Size with Malloc): Update declaration.
663
3f999f78
WP
6642007-09-24 Wojciech Polak <polak@gnu.org>
665
666 Add XSLT transformations.
667
668 * data/xslt/xml2dot.xsl: Transform XML into DOT.
669 * data/xslt/xml2text.xsl: Transform XML into plain text.
670 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
671 * data/Makefile.am (xsltdir): New variable.
672 (dist_xslt_DATA): Add xslt/*.xsl files.
673
a4f75309
PE
6742007-09-23 Paul Eggert <eggert@cs.ucla.edu>
675
676 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
677 Problem reported by Wojciech Polak.
678 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
679 (xml_printf): Undo change I made on 21 September; that is,
680 indent 2 spaces, not 1.
681
ad5feac4
JD
6822007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
683
684 Pacify ./configure --enable-gcc-warnings.
685 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
686 `char const *' instead of `char *'.
687 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
688 local variable `sep'.
689
41d7a5f2
PE
6902007-09-21 Paul Eggert <eggert@cs.ucla.edu>
691
692 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
693 elsewhere.
694 * src/print-xml.c: Prefer "const" after types; that's more consistent.
695 (xml_printf): Indent just 1 space for level.
696 (e_char, xlate_char): Remove.
697 (xml_escape_string): Rewrite to avoid undefined behavior (used
698 storage that was freed from the stack).
699 (xml_escape_n): Don't bother checking for subscript error.
700
3f999f78
WP
7012007-09-21 Wojciech Polak <polak@gnu.org>
702
703 Add Bison XML Automaton Report.
41d7a5f2
PE
704
705 Add support for an -x option to generate an XML report.
706 It is not documented yet.
707 * src/print-xml.c: New file.
708 * src/print-xml.h: Likewise.
709 * lib/timevar.def (TV_XML): New var.
710 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
711 * src/conflicts.c: Include print-xml.h.
712 (solved_conflicts_xml_obstack): New var.
713 (log_resolution, conflicts_solve, conflicts_free):
714 Add support for XML report.
715 (conflicts_output_val): New function.
716 * src/conflicts.h (conflicts_output_val): New decl.
717 * src/files.c (spec_xml_file): New var.
718 (compute_output_file_names, output_file_names_free): Add XML support.
719 * src/files.h (spec_xml_file): New decl.
720 * src/getargs.c (xml_flag): New var.
721 (usage, short_options, long_options, getargs): Add XML support.
722 * src/getargs.h (xml_flag): New decl.
723 * src/gram.c: Include print-xml.h.
724 (rule_lhs_print_xml, rule_rhs_print_xml):
725 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
726 New functions.
727 * src/gram.h: Declare external ones.
728 * src/main.c: Include print-xml.h.
729 (main): Add XML support.
730 * src/reduce.c: Include print-xml.h.
731 (reduce_xml): New function.
732 * src/reduce.h: Declare it.
733 * src/state.c: Include print-xml.h.
734 (state_new): Add XML support.
735 (state_rule_lookahead_tokens_print_xml): New function.
736 * src/state.h: Declare it.
737 (struct state): New member solved_conflicts_xml.
738 * src/symtab.c (symbol_class_get_string): New function.
739 * src/symtab.h: Declare it.
740
6d8e724d
PE
7412007-09-21 Paul Eggert <eggert@cs.ucla.edu>
742
743 * GNUmakefile: Switch to coreutils's version.
744 * bootstrap: Likewise.
745 * Makefile.cfg: Adjust to new GNUmakefile.
746 * README-hacking: Likewise.
747
748 Import from gnulib:
749
750 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
751 Bruno Haible <bruno@clisp.org>
752
753 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
754 and is a script that invokes bison. Tighten the code. Add comments.
755
922bdd7f
JD
7562007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
757
758 Spell "boolean" as "Boolean". Reported by Akim Demaille.
759 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
760 * doc/bison.texinfo (Decl Summary): Fix.
761 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
762 * tests/input.at (Boolean %define variables): Update output.
763 * tests/skeletons.at (%define boolean variables: invalid skeleton
764 defaults): Rename to...
765 (%define Boolean variables: invalid skeleton defaults): ... this and
766 update output.
767
1b17b01d
JD
7682007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
769
770 In impure push mode, don't allow more than one yypstate to be allocated
771 since multiple impure parsers would corrupt yynerrs.
772 * data/push.c (yypstate_allocated): New static global variable
773 initialized to 0.
774 (yypull_parse): If yypstate_new returns 0, don't report it as memory
775 exhaustion if yypstate_allocated is 1, but still return 2.
776 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
777 already 1. Otherwise, set it to 1.
778 (yypstate_delete): Set it to 0.
779 * tests/push.at (Push Parsing: Multiple impure instances): New test
780 case.
781
9987d1b3
JD
7822007-08-17 Bob Rossi <bob@brasko.net>
783
784 * doc/bison.texinfo (Push Decl): Document the push parser.
785 (Table of Symbols): Ditto.
786 (Pure Decl): Ditto.
787 (Decl Summary): Ditto.
788 (Multiple Parsers, Push Parser Function, Pull Parser Function,
789 Parser Create Function, Parser Delete Function):
790 Add new push parser symbols.
791 (Table of Symbols): Document push-parser, push-pull-parser,
792 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
793
f16b0819
PE
7942007-08-15 Paul Eggert <eggert@cs.ucla.edu>
795
796 Update to GPLv3.
797 * doc/gpl-3.0.texi: New file.
798 * doc/gpl.texi: Remove.
799 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
800 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
801 * README-hacking, TODO, bootstrap, bootstrap.conf:
802 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
803 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
804 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
805 * data/lalr1.cc, data/lalr1.java, data/location.cc:
806 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
807 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
808 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
809 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
810 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
811 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
812 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
813 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
814 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
815 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
816 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
817 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
818 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
819 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
820 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
821 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
822 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
823 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
824 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
825 * src/complain.c, src/complain.h, src/conflicts.c:
826 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
827 * src/files.h, src/flex-scanner.h, src/getargs.c:
828 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
829 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
830 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
831 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
832 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
833 * src/print.c, src/print.h, src/print_graph.c:
834 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
835 * src/reduce.h, src/relation.c, src/relation.h:
836 * src/revision.h, src/scan-code.h, src/scan-code.l:
837 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
838 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
839 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
840 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
841 * tests/Makefile.am, tests/actions.at, tests/c++.at:
842 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
843 * tests/existing.at, tests/glr-regression.at:
844 * tests/headers.at, tests/input.at, tests/java.at:
845 * tests/local.at, tests/output.at, tests/push.at:
846 * tests/reduce.at, tests/regression.at, tests/sets.at:
847 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
848 * tests/torture.at:
849 Update to GPLv3.
850
728c4be2
JD
8512007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
852
853 Get rid of broken %no-parser, -n, and --no-parser implementation and
854 documentation.
855 * TODO: Don't mention them.
856 * doc/bison.1: Likewise.
857 * doc/bison.texinfo (Decl Summary): Likewise.
858 (Bison Options): Likewise.
859 (Option Cross Key): Likewise.
860 * src/getargs.c (no_parser_flag): Remove global variable.
861 (usage): Don't print description of -n and --no-parser.
862 (long_options): Remove --no-parser entry here.
863 (getargs): Remove -n case in the switch here.
864 * src/getargs.h (no_parser_flag): Remove extern.
865 * tests/regression.at (Web2c Actions): Remove comment that mentions
866 --no-parser.
867
5d31a216
JD
8682007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
869
870 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
871 name user variables starting with `yy'. Just pass NULL instead of a
872 dummy local &yylval to yypush_parse.
873 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
874 starting with `yy'.
875
a2ea208d
JD
8762007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
877
878 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
879 true since it's then always used regardless of whether yyoverflow is
880 defined. Reported by Christian Burger at
881 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
882 * THANKS: Add Christian Burger.
883
91661ebb
JD
884 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
885 node names: say "Decl Summary" not "Bison Declaration Summary".
886
cbd50549
JD
8872007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
888
889 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
890 determine whether this function has already complained about an invalid
891 value for a %define boolean variable, don't check whether Bison has
892 ever examined the value. As written, the check was a tautology.
893 Instead, record and check for this complaint using a separate muscle.
894
eb1b0740
JD
8952007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
896
897 Fix push parsing memory leak reported by Brandon Lucia at
898 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
899 * THANKS: Add Brandon Lucia.
900 * data/push.c (yypstate_delete): Free the stack if it was reallocated
901 but the parse never completed and thus freed it.
902 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
903 * tests/testsuite.at: Include push.at.
904 * test/push.at: New.
905 (Push Parsing: Memory Leak for Early Deletion): New test case.
906
9d774aff
JD
9072007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
908
909 Improve handling of multiple S/R conflicts in the same state and of S/R
910 conflicts involving multiple reductions.
911 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
912 set for a state here or Bison will abort if it is reassigned on a
913 later conflicted reduction in the same state.
914 Similarly, don't finalize and assign the solved conflicts report here
915 or it will be lost if it is reassigned on a later conflicted reduction
916 in the same state.
917 (set_conflicts): Instead, assign them both here after all S/R conflicts
918 in the state have been fully examined.
919 * src/print.c (shift_set): Rename to...
920 (no_reduce_set): ... this.
921 (print_reductions): Update for rename, and add %nonassoc error action
922 tokens to no_reduce_set so that, when printing the first remaining
923 reduction on an error action token, the reduction is enclosed in
924 brackets.
925 (print_results): Update for rename.
926 * tests/conflicts.at (Solved conflicts report for multiple reductions
927 in a state): New test case.
928 (%nonassoc error actions for multiple reductions in a state): New test
929 case.
930
931 * src/main.c (main): Don't depend on C99 features.
932
10159d2a
JD
9332007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
934
935 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
936 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
937 uniwidth.
10159d2a 938
953b3935
JD
9392007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
940
941 * bootstrap (slurp): Create target directories that don't exist.
942 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
943
6ce2d93a
JD
9442007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
945
946 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
947 than item number.
948 * closure.c (closure): Likewise.
949 * state.h (reductions): Comment sorting of rules.
950 (state): Comment sorting of items.
951
ce3448d5
JD
9522007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
953
954 Fix C++ test cases after recent Gnulib changes. Discussed starting at
955 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
956 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
957 definition in order to avoid Gnulib headers since we don't use config.h
958 here.
959 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
960 rather than AT_DATA so that config.h is included.
961
8a86eef0
JD
9622007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
963
964 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
965 instead of fprintf. Guard these functions with #if YYDEBUG instead of
966 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
967 and so that YYFPRINTF is guaranteed to be defined here.
968
b1a81613
JD
9692007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
970
971 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
972 with...
973 (muscle_percent_define_check_values): ... this more helpful function.
974 Again, it's not used yet, but it will be.
975 * src/muscle_tab.h: Likewise.
976
71b61d4d
JD
977 Improve some comments in parser table construction.
978 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
979 (generate_states): Don't mention ruleset, which is internal to closure.
980 * src/closure.c (closure): Explain sorting of core and itemset, which
981 is required for this function to behave correctly.
982 * src/closure.h (closure): Mention sorting.
983
2a6b783d
JD
9842007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
985
986 * src/lalr.c (state_lookahead_tokens_count): For code readability,
987 move the check for disabled transitions to an aver since conflict
988 resolution hasn't happened yet.
989
990 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
991 labels a state as inconsistent just because it has error transitions.
992 The original form of this check appeared in revision 1.1 of lalr.c,
993 which was committed on 1991-12-21. Now (at least), changing the
994 consistency label on such a state appears to have no useful effect in
995 any of the places it is examined, which I enumerate below. The key
996 point to understanding each item in this enumeration is that a state
997 with an error transition is labelled consistent in the first place only
998 if it has no rules, so the check cannot matter for states that have
999 rules. (1) Labelling a state as inconsistent will cause set_conflicts
1000 to try to identify its conflicts, and a state must have *rules* to have
1001 conflicts. (2) Labelling a state as inconsistent will affect how
1002 action_row sets the default *rule* for the state. (3) Labelling a
1003 state as inconsistent will cause build_relations to add lookback edges
1004 to *rules* in that state.
1005 * src/state.h (struct state): Word the comment for member consistent
1006 more carefully.
1007
14462c2b
JD
10082007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1009
1010 Don't depend on C99 features.
1011 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
1012 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
1013 * src/reader.c (check_and_convert_grammar): Fix for-loop.
1014 * src/state.c (state_mark_reachable_states): Fix for-loop.
1015 (state_remove_unreachable_states): Fix for-loop.
1016
1017 Don't widen struct state with member reachable just to temporarily
1018 record reachability. Instead, use a local bitset.
1019 * src/state.h (struct state): Remove member.
1020 * src/state.c (state_new): Don't initialize it.
1021 (state_mark_reachable_states): Rename to...
1022 (state_record_reachable_states): ... this, and use bitset.
1023 (state_remove_unreachable_states): Use bitset.
1024
5a43d418
JD
10252007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
1026
1027 * src/Makefile.am (yacc): Quote target action commands properly so
1028 that the yacc script isn't corrupt. Reported by Hans Aberg at
1029 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
1030
0c650a20
JD
1031 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
1032 the case of pure parsers. Reported by Frans Englich at
1033 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
1034 * THANKS: Add Frans Englich.
1035
61fee93e
JD
1036 * NEWS (2.3a+): In the %code entry, reference section `Bison
1037 Declaration Summary' from the manual now since the %code summary has
1038 moved there.
1039 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
1040 in the rules section must be terminated by semicolons.
1041
f124d423
JD
10422007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1043
1044 Extend the front-end API for %define variables to more completely
1045 mirror the back-end. This will be useful in the future.
1046 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
1047 Update comments to mention the new front-end counterparts of these
1048 macros.
1049 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
1050 for muscle_string_decode and muscle_location_decode.
1051 (muscle_string_decode): New static function.
1052 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
1053 (muscle_percent_define_get, muscle_percent_define_ifdef): New
1054 functions.
1055 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
1056 muscle_percent_define_get to mimic the b4_percent_define_flag_if
1057 implementation more closely.
1058 (muscle_percent_define_invalid_value): New function.
1059 * src/muscle_tab.h (muscle_percent_define_get,
1060 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
1061 Prototype.
1062
75ad86ee
JD
10632007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1064
1065 * NEWS (2.3a+): Mention yesterday's state-removal change.
1066 (2.3a): Remove the %language entry, which was added after 2.3a.
1067 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
1068 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
1069 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
1070 tests/existing.at: Update copyright date.
1071
5967f0cf
JD
10722007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1073
1074 If conflict resolution makes states unreachable, remove those states,
1075 report rules that are then unused, and don't report conflicts in those
1076 states.
1077 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
1078 New global function.
1079 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
1080 function.
1081 * src/main.c (main): After conflict resolution, remove the unreachable
1082 states and update all data structures that reference states by number.
1083 * src/state.c (state_new): Initialize each state's reachable member to
1084 false.
1085 (state_mark_reachable_states): New static function.
1086 (state_remove_unreachable_states): New global function.
1087 * src/state.h (struct state): Add member bool reachable.
1088 (state_remove_unreachable_states): Prototype.
1089 * tests/conflicts.at (Unreachable States After Conflict Resolution):
1090 New test case.
1091 * tests/existing.at (GNU pic Grammar): Update test case output now that
1092 an unused rule is discovered.
1093
b09f4f48
JD
10942007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1095
1096 Minor code cleanup in parser table construction.
1097 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
1098 (new_itemsets, save_reductions): Update for rename to nitemset.
1099 * src/closure.c (nritemset): Rename to...
1100 (nitemset): ... this since the "r" appears to meaningless and isn't
1101 used in the comments.
1102 (closure): Update for rename.
1103 * src/closure.h (nritemset): Update extern to...
1104 (nitemset): ... this.
1105 * src/lalr.c (LA): Fix a typo in comments.
1106 * src/print.c (print_core): Update for rename to nitemset.
1107 * src/print_graph.c (print_graph): Likewise.
1108 * src/state.h: Fix some typos in header comments.
1109
bbb44d83
PE
11102007-04-04 Paul Eggert <eggert@cs.ucla.edu>
1111
9b33de72
PE
1112 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
1113 still sticks to ASCII. Sorry!
1114
bbb44d83
PE
1115 * README-hacking: New file, taken mostly from coreutils, with changes
1116 for Bison. Contains much of the contents of:
1117 * README-cvs: Remove.
1118 * bootstrap: Sync from gnulib.
1119 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
1120 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
1121
29553547
JD
11222007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
1123
1124 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
1125 Setzer.
1126 (Java Differences): Fix some typos.
1127 * THANKS: Add Sebastian Setzer.
1128
01b477c6
PB
11292007-03-07 Paolo Bonzini <bonzini@gnu.org>
1130
730739e4
AD
1131 * data/java.m4 (b4_single_class_if): Remove.
1132 (b4_abstract_if): Look at "%define abstract".
1133 (b4_lexer_if): New.
1134 (b4_union_name): Rename...
1135 (b4_yystype): ... to this. Map to "%define stype".
1136 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
1137 b4_maybe_throws): Fix quoting.
1138 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
1139 * data/lalr1.java (Lexer interface): Always define.
1140 (Lexer interface within parser class): Remove.
1141 (YYLexer class): New, used when "%code lexer" is present.
1142 (constructor): When "%code lexer" is used, pass %lex-param
1143 to the lexer constructor.
1144 (yylex, yyparse): Remove %lex-param from method invocations
1145 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
1146
1147 * doc/bison.texinfo (Java Bison Interface): Mention "%define
1148 abstract". Rename "%define union_name" to "%define stype".
1149 Rename method names according to previous patch.
1150 (Java Scanner Interface): Describe "%code lexer" instead of
1151 "%pure-parser" and "%define single_class".
1152 (Java Differences): Mention "%code lexer".
1153
1154 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
1155 Include scanner here, using macros from tests/local.at.
1156 (AT_DATA_CALC_Y): Remove final argument.
1157 (_AT_CHECK_JAVA_CALC): Likewise.
1158 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
1159 of %locations and %error-verbose.
1160 (main): Test with and without %lex-param.
1161 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
1162 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 1163
122bea3a
JMG
11642007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1165
1166 DJGPP spefic issue. Inhibit the use of disallowed characters for
1167 file name genertion on Win98, WinXP, etc. These are |<>":?*\
1168 and concern testsuite case 46.
1169 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
1170 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
1171 * djgpp/config.bat: Inhibit the use of disallowed characters.
1172
9611cfa2
JD
11732007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
1174
1175 Miscellaneous %define and %code cleanup.
1176 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
1177 values are interpreted.
1178 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
1179 documentation a little more.
1180 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
1181 muscle_percent_define_insert, muscle_percent_code_grow): New
1182 functions/macros.
1183 * src/muscle_tab.h (muscle_percent_define_insert,
1184 muscle_percent_code_grow): Prototype.
1185 * src/parse-gram.y (prologue_declaration): Use
1186 muscle_percent_define_insert and muscle_percent_code_grow when parsing
1187 %define and %code directives.
1188
1189 Make it easy to share %define boolean variables between the front-end
1190 and back-end. Though not used yet, this will be useful in the future.
1191 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
1192 Bison uses of names rather than just skeleton uses of names.
1193 (b4_percent_define_get, b4_percent_define_ifdef): Rename
1194 b4_percent_define_skeleton_variables(VARIABLE) to
1195 b4_percent_define_bison_variables(VARIABLE).
1196 (b4_percent_code_get, b4_percent_code_ifdef): Rename
1197 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
1198 b4_percent_code_bison_qualifiers(QUALIFIER).
1199 (b4_check_user_names_wrap): Update for renames.
1200 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
1201 muscle_percent_define_default): New functions mimicking
1202 b4_percent_define_flag_if and b4_percent_define_default.
1203
1204 For %define variables, report locations for invalid values and
bbb44d83 1205 redefinitions.
9611cfa2
JD
1206 * data/bison.m4 (b4_percent_define_flag_if): Read
1207 b4_percent_define_loc(VARIABLE) to report the location of an invalid
1208 value for VARIABLE.
1209 (b4_percent_define_default): Save a special location in
1210 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
1211 must later be reported as invalid.
1212 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
1213 functions.
1214 (muscle_percent_define_insert): Record the location of VARIABLE in
1215 muscle percent_define_loc(VARIABLE), and use it to report the previous
1216 location for a redefinition.
1217 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
1218 (muscle_percent_define_default): Update like b4_percent_define_default.
1219 (muscle_grow_user_name_list): Rename to...
1220 (muscle_user_name_list_grow): ... this for consistency and use
1221 muscle_location_grow.
1222 * src/muscle_tab.h (muscle_location_grow): Prototype.
1223 * tests/input.at (%define errors): Update expected output.
1224 * tests/skeletons.at (%define boolean variables: invalid skeleton
1225 defaults): New test case.
1226
0bf92491
JD
12272007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
1228
1229 * src/print.c (lookahead_set, state_default_rule): Remove.
1230 (print_reductions): Replace state_default_rule invocation with
1231 equivalent use of yydefact, which was computed in token_actions in
1232 tables.c.
1233 (print_results): Don't allocate lookahead_set.
1234
d3b12988
PB
12352007-02-27 Paolo Bonzini <bonzini@gnu.org>
1236
1237 * data/lalr1.java: Prefix all private members with yy.
1238
f57a7536
JD
12392007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
1240
1241 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 1242 Sebastien Fricker at
f57a7536 1243 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 1244 * THANKS: Add Sebastien Fricker.
f57a7536
JD
1245 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
1246 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
1247 accept a variable number of arguments.
1248
6404a5bf
JD
12492007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1250
1251 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
1252
e4e09639
JMG
12532007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1254
1255 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
1256 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
1257 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
1258
d7e0a1a7
PE
12592007-02-11 Paul Eggert <eggert@cs.ucla.edu>
1260
1261 Undo my 2007-02-07 change, switching back to the c-strcase module
1262 introduced in the 2007-02-03 change. Bruno Haible reported that
1263 the 2007-02-07 change would be dangerous in Turkish if we add a
1264 language whose name contains "i", since "i" is not lowercase "I"
1265 in Turkish.
1266 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
1267 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
1268 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
1269 * m4/.cvsignore: Remove strcase.m4.
1270 * src/getargs.c: Revert 2007-02-07 change, as follows.
1271 Include c-strcase.h.
1272 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
1273
deee93a1
JD
12742007-02-11 Bruno Haible <bruno@clisp.org>
1275
1276 Enable the Java related testsuite tests when the only Java compiler
1277 found is a gcj < 4.3. Discussed at
1278 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
1279 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
1280
574add85
JD
12812007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
1282
1283 * data/Makefile.am: Update copyright date.
1284 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
1285 yypstate_new returns NULL.
1286 (yypstate_new): Return NULL if malloc does.
1287 * src/reader.c (packgram): Move translation of rule actions from the
1288 beginning of packgram to...
1289 (check_and_convert_grammar): ... here right before packgram is invoked
1290 so it's easier to write more complete comments, and remove redundant
1291 code.
1292
e785ccf7
JD
12932007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
1294
1295 As in semantic actions, make @$ in %initial-action, %destructor, and
1296 %printer imply %locations.
1297 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
1298 scanning @$.
1299 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
1300 (@$ in %initial-action implies %locations,
1301 @$ in %destructor implies %locations,
1302 @$ in %printer implies %locations): ... these new test cases.
1303
1cfe1ed7
PE
13042007-02-07 Paul Eggert <eggert@cs.ucla.edu>
1305
1306 Undo most of the 2007-02-03 change, switching to the strcase module
1307 now that gnulib strcase has been fixed.
1308 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
1309 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
1310 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
1311 * m4/.cvsignore: Add strcase.m4.
1312 * src/getargs.c: Revert 2007-02-03 change, as follows.
1313 Don't include c-strcase.h.
1314 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
1315 strcasecmp has "unspecified behavior" outside the POSIX locale,
1316 but it works fine in practice if at least one argument is ASCII,
1317 as is the case in Bison.
1318
0049ec86
PB
13192007-02-07 Paolo Bonzini <bonzini@gnu.org>
1320
1321 * tests/java.at: Skip tests if only one of javac/java is present.
1322 Reported by Joel E. Denny.
1323 * tests/atlocal.in: Adjust copyright years.
1324
13252007-02-05 Paolo Bonzini <bonzini@gnu.org>
1326
1327 * data/lalr1.java (Stack): Work around old verifiers that disallow
1328 access to the private fields of an inner class, from the outer class.
1329 We can make Stack's fields public because user code doesn't have access
1330 to the instance of Stack used by parse(). Reported by Paul Eggert.
1331
2c2b7220
PE
13322007-02-03 Paul Eggert <eggert@cs.ucla.edu>
1333
1334 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
1335 the right spot for these files?
1336 * bootstrap.conf (gnulib_modules): Add c-strcase.
1337 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
1338 c-strncasecmp.c.
1339 * src/getargs.c: Include c-strcase.h.
1340 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
1341 to avoid unspecified behavior.
1342
b2b81dae
JD
13432007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
1344
1345 * doc/bison.texinfo (Decl Summary): Correct typo.
1346
c1d19e10
PB
13472007-01-30 Paolo Bonzini <bonzini@gnu.org>
1348
1349 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
1350 Complain if the value does not match empty, "true" or "false".
1351 * data/c++.m4: Adjust default definitions of %define variables.
1352 * data/java.m4: Adjust default definitions of %define variables.
1353 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
1354 to above behavior.
1355 * tests/input.at (Boolean %define variables): Test new behavior.
1356
8405b70c
PB
13572007-01-29 Paolo Bonzini <bonzini@gnu.org>
1358
1359 * NEWS: Mention java.
1360 * TODO: Remove things that are done.
1361 * bootstrap.conf: Add javacomp-script and javaexec-script.
1362 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
1363
1364 * data/Makefile.am: Add new files.
1365 * data/java-skel.m4: New.
1366 * data/java.m4: New.
1367 * data/lalr1.java: New.
1368
1369 * doc/bison.texinfo: Put "A Complete C++ Example" under
1370 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
1371 under Other Languages.
1372
1373 * src/getargs.c (valid_languages): Add Java.
1374 * src/getargs.h (struct bison_language): Update size of string fields.
1375
1376 * tests/Makefile.am: Add java.at.
1377 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
1378 * tests/java.at: New.
1379 * tests/testsuite.at: Include it.
1380
3eb82471
JD
13812007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
1382
1383 Clean up.
1384 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
1385 at_directive_argv arguments so these no longer have to be global
1386 variables. Also, update the implementation for the following changes.
1387 (fail_for_at_directive_too_many_args,
1388 fail_for_at_directive_too_few_args): Add at_directive_name argument.
1389 (at_directive_name): Remove as at_directive_argv[0] will be used for
1390 this now.
1391 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
1392 for the directive name.
1393 (at_directive_argc, at_directive_argv): Make these local within
1394 skel_lex instead of global.
1395 (INITIAL): Update directive start action for above changes.
1396 (SC_AT_DIRECTIVE_ARG): Rename to...
1397 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
1398 (SC_AT_DIRECTIVE_SKIP_WS): Update.
1399 (scan_skel): Move yylex_destroy to...
1400 (skel_scanner_free): ... here.
1401 * tests/skeletons.at (installed skeleton file name): Rename to...
1402 (installed skeleton file names): ... this.
1403
148d66d8
JD
14042007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
1405
1406 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1407 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
1408 Summary" not "Directives".
1409 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
1410 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
1411 since the former is now the more complete one.
1412 (Prologue Alternatives): Likewise and do the same for %defines.
1413 (Table of Symbols): Add summary of %code, add summary of %define, and
1414 move full %code documentation to...
1415 (Decl Summary): ... here for consistency with other entries in these
1416 sections.
1417 Move %define entry in order to keep this list alphabetized.
1418 Reword %define entry a little to put less emphasis on the skeleton
1419 concept, which most users shouldn't have to think about.
1420
665f0c24
PE
14212007-01-26 Paul Eggert <eggert@cs.ucla.edu>
1422
1423 Adjust to recent gnulib changes.
1424 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
1425 Add string.h, string_.h, unistd_.h, wchar_.h.
1426 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
1427 * src/system.h: Don't include <stpcpy.h>; this is now done by
1428 <string.h>.
1429
592d0b1e
PB
14302007-01-23 Paolo Bonzini <bonzini@gnu.org>
1431
1432 Simplify implementation of unqualified %code, implement macros for
1433 uniform treatment of boolean %define flags. Document %define.
1434 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
1435 b4_percent_code_ifdef): New.
1436 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
1437 * data/c++.m4: Define default value for global_tokens_and_yystype.
1438 * data/glr.cc: Likewise.
1439 * data/location.cc: Use b4_percent_define_flag_if.
1440
148d66d8 1441 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
1442
1443 * src/parse-gram.y (Unqualified %code): Change muscle name to
1444 b4_percent_code().
1445 (content.opt): Default to empty.
1446
a7867f53
JD
14472007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1448
1449 Implement support for relative and absolute skeleton file names.
1450 Discussed starting at
1451 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
1452 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
1453 (Bison Options): Document in --skeleton entry.
1454 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
1455 full_skeleton can't necessarily hold all of pkgdatadir.
1456 If the specified skeleton file name contains a `/', don't prepend
1457 pkgdatadir.
1458 * src/parse-gram.y (prologue_declaration): If the specified skeleton
1459 file name contains a `/', prepend the grammar file directory.
1460 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
1461 * skeletons.at: New file.
1462 (relative skeleton file names): New test case.
1463 (installed skeleton file names): New test case.
1464 * tests/testsuite.at: Include skeletons.at.
1465
1466 * bootstrap: Update copyright to 2007.
1467
830c9b18
PB
14682007-01-17 Paolo Bonzini <bonzini@gnu.org>
1469
1470 * bootstrap: Remove occurrences of .#bootmp from the files.
1471
a8c2e813
AD
14722007-01-17 Akim Demaille <akim@epita.fr>
1473
1474 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
1475 nonterminals.
1476 Use per-type %printer.
1477
279cabb6
JD
14782007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1479
1480 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
1481 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1482 djgpp/config.site, src/files.c, src/files.h, src/main.c,
1483 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
1484 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
1485 tests/glr-regression.at, tests/input.at, tests/local.at,
1486 tests/output.at, tests/torture.at: Update copyright to 2007.
1487
bb32f4f2
AD
14882007-01-16 Akim Demaille <akim@epita.fr>
1489
1490 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
1491 error code.
1492 (Calc++ Scanner): Exit with failure if we can't open the input
1493 file.
1494 Accept "-" standing for stdin.
1495 (Calc++ Top Level): Print the result only if the parsing was
1496 successful.
1497
7cff04b5
AD
14982007-01-16 Akim Demaille <akim@epita.fr>
1499
1500 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
1501
a4e25e1d
JD
15022007-01-15 Paolo Bonzini <bonzini@gnu.org>
1503 and Joel E. Denny <jdenny@ces.clemson.edu>
1504
1505 Clean up %define and %code implementation in M4 some. Most
1506 importantly, rename all related macros to be in the b4_percent_define
1507 and b4_percent_code namespaces. Also, complete support for `.' in
1508 %define variable names and %code qualifiers.
1509 * data/bison.m4 (b4_check_user_names): Check for special
1510 "SKELETON-NAMESPACE(name)" macros instead of using two nested
1511 m4_foreach loops.
1512 (b4_get_percent_define, b4_get_percent_code): Rename to...
1513 (b4_percent_define_get, b4_percent_code_get): ... these.
1514 Extend documentation with examples.
1515 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
1516 b4_percent_define_skeleton_variables and
1517 b4_percent_code_skeleton_qualifiers.
1518 Expect any value for the %define variable `foo' to be stored in the
1519 macro named `b4_percent_define(foo)'; expect any %code blocks for the
1520 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
1521 expect any unqualified %code blocks to be stored in a macro named
1522 `b4_percent_code_unqualified'.
1523 Use m4_indir so that %define variable names and %code qualifiers can
1524 contain `.', which is allowed by the grammar parser.
1525 (b4_percent_define_default): New macro to set a default value for a
1526 %define variable.
1527 (m4_wrap): Update wrapped code, and fix some underquoting.
1528 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
1529 Expect grammar uses of %define variables and %code qualifiers to be
1530 defined in b4_percent_define_user_variables and
1531 b4_percent_code_user_qualifiers.
1532 * data/c++.m4: Use b4_percent_define_default rather than
1533 m4_define_default. Fix some underquoting. Skeleton usage of %define
1534 variable define_location_comparison now implies skeleton usage of
1535 %define variable filename_type.
1536 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1537 data/push.c, data/yacc.c: Update macro names.
1538 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
1539 muscle names.
1540
e37c665c
JMG
15412007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1542
1543 DJGPP specific issues.
1544
1545 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
1546 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
1547
7d2d521f
JD
15482007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1549
1550 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
1551 run parsers in all tests so that Valgrind is invoked during
1552 maintainer-check-valgrind.
1553 (Duplicate representation of merged trees): Free all semantic values.
1554 (Duplicated user destructor for lookahead): Likewise.
1555
e0ac9b4b
JD
15562007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1557
1558 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
1559 command-line prefix.
1560 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
1561 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
1562 miss Valgrind messages.
1563 (Exploding the Stack Size with Malloc): Likewise.
1564
78143faa
JD
15652007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1566
1567 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
1568 locals. Reported by Juan Manuel Guerrero at
1569 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
1570 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
1571 Fix some indentation also.
1572 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
1573 explaining this issue.
1574
7ecec4dd
JD
15752007-01-09 Paolo Bonzini <bonzini@gnu.org>
1576 and Joel E. Denny <jdenny@ces.clemson.edu>
1577
1578 Simplify union and prologue handling, and escape union and lex/parse
1579 params with digraphs.
1580 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
1581 values to the empty string since these are no longer guaranteed
1582 initialized by the front-end.
1583 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
1584 braces around b4_user_stype since this is no longer done by the
1585 front-end.
1586 * src/files.c, src/files.h (pre_prologue_obstack,
1587 post_prologue_obstack): Remove.
1588 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
1589 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
1590 with digraphs. This fixes lex params and parse params.
1591 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
1592 * src/output.c (prepare): Remove muscle insertion of the prologues.
1593 (output): Remove freeing of pre_prologue_obstack and
1594 post_prologue_obstack.
1595 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
1596 than prologue_augment for prologue parsing so you don't need prologue
1597 obstacks.
5c80250c
JD
1598 (grammar_declaration): For %union RHS, use `braceless' instead of
1599 "{...}" so that braces are already stripped and code is escaped with
1600 digraphs.
7ecec4dd
JD
1601 * src/reader.c (prologue_augment): Remove.
1602 (reader): Remove initialization of pre_prologue_obstack and
1603 post_prologue_obstack.
1604 * src/reader.h (prologue_augment): Remove.
1605
1606 * data/c.m4: Remove stray parenthesis.
1607
16dc6a9e
JD
16082007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1609
1610 Remove quotes from variables names in %define directives and from
1611 qualifiers in %code directives, and restrict the characters that are
1612 allowed in them to M4-friendly ones. For %define, continue to support
1613 the quoted form as a deprecated feature. Discussed starting at
1614 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
1615 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
1616 %code.
1617 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
1618 (Decl Summary): In %defines entry, update mention of `%code requires'
1619 and `%code provides'.
16dc6a9e
JD
1620 (C++ Location Values): Update %define uses.
1621 (Calc++ Parser Interface): Likewise.
1622 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 1623 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
1624 * src/parse-gram.y (prologue_declaration): For %define variables, use
1625 `variable' instead of `STRING'.
1626 (grammar_declaration): For %code qualifiers, use `ID' instead of
1627 `STRING'.
1628 (variable): New nonterminal that takes an `ID' or a `STRING'.
1629 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
1630 and %define uses.
1631 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
1632 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
1633 (%define errors): Update %define uses.
1634
e9813cd4
JD
16352007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1636
1637 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
1638 instead of muscle_insert for %define values so that M4-special
1639 characters are replaced with digraphs.
1640 * tests/input.at (%define errors): Extend to check weird values.
1641
6afc30cc
JD
16422007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1643
1644 Instead of having skeletons declare all valid %define variables and
1645 %code qualifiers, provide macros that retrieve the associated values
1646 and build these lists automatically. Thus Bison will now warn when a
1647 variable or qualifier is not used by the skeleton in the current
1648 invocation regardless of whether it might sometimes be used by that
1649 skeleton in other invocations. Also, move all %define value macros to
1650 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
1651 form, which is replaced by %code.
1652 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
1653 (b4_check_user_names): ... this, and change the series of valid name
1654 arguments to a single list argument for names used in the skeleton
1655 similar to the existing list argument for names used in the grammar.
1656 Warn instead of complaining.
1657 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
1658 values and %code code, to format %code code properly, and to build
1659 lists of all %define variables and %code qualifiers used in the
1660 skeleton: b4_skeleton_percent_define_variables and
1661 b4_skeleton_percent_code_qualifiers.
1662 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
1663 Remove, and...
1664 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
1665 the skeleton names lists can finish building first. In place of
1666 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
1667 expect the lists b4_user_percent_define_variables and
1668 b4_user_percent_code_qualifiers.
1669 * data/c++.m4: Where setting default values for b4_parser_class_name,
1670 b4_location_type, b4_filename_type, b4_namespace, and
1671 b4_define_location_comparison, update their names to the
1672 b4_percent_define_ namespace.
1673 * data/glr.c: Don't use b4_check_percent_define_variables and
1674 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1675 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
1676 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 1677 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
1678 * data/location.cc: Use b4_get_percent_define.
1679 * data/push.c: Don't use b4_check_percent_define_variables and
1680 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1681 * data/yacc.c: Likewise, and don't call m4_exit in
1682 b4_use_push_for_pull_if or m4_wrap code will never execute.
1683 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
1684 Rename to...
1685 (muscle_grow_user_name_list): ... this for consistency with the
1686 terminology used in bison.m4.
1687 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
1688 %define variable names, and rename muscle used_percent_define_variables
1689 to user_percent_define_variables.
1690 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
1691 user_percent_code_qualifiers.
1692 (content): Remove.
1693 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
1694 {CODE} form is no longer accepted.
1695 * tests/input.at (Reject bad %code qualifiers): Rename to...
1696 (Reject unused %code qualifiers): ... this, and update test output.
1697 (%define error): Update test output.
1698
7eb8a0bc
JD
16992007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
1700
1701 Check for unrecognized %define variables similar to checking for
1702 unrecognized %code qualifiers. Check for redefined %define variables.
1703 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
1704 generalizes...
1705 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
1706 (b4_check_percent_define_variables): New, also wraps it.
1707 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
1708 variables using b4_check_percent_define_variables.
1709 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
1710 all those exercised in the test suite and all those listed in the
1711 `Default values' section of c++.m4. Are there others?
1712 * data/push.c, data/yacc.c: Declare no valid %define variables.
1713 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
1714 similar to muscle_find, but it works even when the muscle stores a
1715 const value.
1716 (muscle_grow_used_name_list): New function for constructing the used
1717 name list muscles that b4_check_for_unrecognized_names requires.
1718 * src/parse-gram.y (prologue_declaration): Warn if a variable is
1719 %define'd more than once. Define the b4_used_percent_define_variables
1720 muscle with muscle_grow_used_name_list.
1721 (grammar_declaration): Abbreviate %code code with
1722 muscle_grow_used_name_list.
1723 * tests/input.at (%define errors): New.
1724
3fc65ead
JD
17252007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1726
1727 Provide warn_at, complain_at, and fatal_at function callbacks to the
1728 skeletons, and use this for %code qualifier complaints.
1729 * data/bison.m4 (b4_error_at): New, invoked by...
1730 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
1731 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
1732 @fatal_at(...@) directives.
1733 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
1734 qualifiers in b4_used_percent_code_qualifiers and to use
1735 b4_complain_at.
1736 * src/location.c, src/location.h (boundary_set_from_string): New global
1737 function.
1738 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
1739 function.
1740 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
1741 to b4_used_percent_code_qualifiers.
1742 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
1743 function.
1744 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
1745 (lineno): Rename to...
1746 (out_lineno): ... this so I don't misunderstand it again.
1747 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
1748 here; these newlines are in the input but not the output file.
1749 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
1750 (at_directive_perform): ... this new static function, and add handling
1751 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
1752 directives.
1753 * tests/input.at (Reject bad %code qualifiers): Update test output with
1754 locations and extend.
1755
1756 * tests/output.at (Output file name: [, Output file name: ]): Remove
1757 bogus comment about these tests failing.
1758
1c7b7e1d
JD
17592007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1760
1761 Clean up b4_check_percent_code_qualifiers a little.
1762 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
1763 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
1764 documentation and add examples.
1765 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
1766 qualifiers here.
1767
08af01c2
JD
17682007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
1769
1770 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
1771 unreliable -- especially when they're hidden inside another macro.
1772 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
1773 data/c.m4: Remove m4_divert(-1).
1774 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1775 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
1776 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 1777 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
1778 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
1779 pushed and popped by m4sugar, should be first on the stack.
1780
1781 Provide warn, complain, and fatal function callbacks to the skeletons.
1782 This provides more flexibility than m4_fatal, improves the error
1783 message format, and captures messages for translation. Discussed
1784 starting at
1785 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
1786 * data/bison.m4 (b4_error): New, invoked by...
1787 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
1788 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
1789 directives. Because these M4 macros might be called when the current
1790 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
1791 the previous removal of uses of m4_divert, which caused trouble.
1792 (b4_check_percent_code_qualifiers): Use b4_complain instead of
1793 m4_fatal to report unrecognized %code qualifiers.
1794 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
1795 push parser requests.
1796 * data/glr.c: Use b4_complain instead of m4_fatal to report
1797 non-deterministic push parser requests.
1798 Update @output usage to @output(...@) form.
1799 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
1800 report missing %defines. Update @output usage to @output(...@) form.
1801 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
1802 @output(...@) form.
1803 * src/main.c (main): Invoke skel_scanner_free.
1804 * src/scan-skel.h (skel_scanner_free): Prototype new function.
1805 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
1806 obstack_for_string from flex-scanner.h.
1807 (YY_DECL): Use to declare skel_lex static.
1808 (decode_at_digraphs): Remove; now handled in the new
1809 SC_AT_DIRECTIVE_ARG start condition.
1810 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
1811 functions.
1812 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
1813 at_directive_argv): New static globals.
1814 (INITIAL): Use fail_for_invalid_at.
1815 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
1816 recognize the start of a generalized `@directive(...@)' form and
1817 start...
1818 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
1819 directive args (using the new obstack_for_string), to decode the
1820 contained @ diagraphs, and to perform the directive. It recognizes
1821 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
1822 @output(...@).
1823 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
1824 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
1825 `@,'.
1826 (scan_skel): Initialize obstack_for_string on the first call.
1827 (skel_scanner_free): New function to free obstack_for_string.
1828 * tests/input.at (Reject bad %code qualifiers): Update test output.
1829
8e0a5e9e
JD
18302007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
1831
1832 Consolidate the 4 prologue alternative directives (%code, %requires,
1833 %provides, and %code-top) into a single %code directive with an
1834 optional qualifier field. Discussed at
1835 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
1836 * NEWS (2.3a+): Rewrite the existing entry for the prologue
1837 alternatives.
1838 * doc/bison.texinfo (Prologue Alternatives): Update.
1839 (Decl Summary): Update to %code "requires" and %code "provides".
1840 (Calc++ Parser): Update to %code "requires".
148d66d8 1841 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
1842 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
1843 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
1844 are replaced by b4_percent_code_provides and b4_percent_code_requires,
1845 which are skeleton-specific.
1846 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
1847 declare what %code qualifiers it supports and to complain if any other
1848 qualifiers were used in the grammar.
1849 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
1850 and b4_user_code([b4_percent_code_provides]) in place of
1851 b4_user_requires and b4_user_provides.
1852 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
1853 Add b4_user_code([b4_percent_code_top]) and
1854 b4_user_code([b4_percent_code]).
1855 Invoke b4_check_percent_code_qualifiers.
1856 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
1857 PERCENT_REQUIRES): Remove.
1858 (grammar_declaration): Remove RHS's for %code-top, %provides, and
1859 %requires. Rewrite the %code RHS as the unqualified form defining the
1860 muscle b4_percent_code. Add another RHS for the qualified %code form,
1861 which defines muscles of the form b4_percent_code_QUALIFIER and the
1862 b4_used_percent_code_qualifiers muscle.
1863 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
1864 PERCENT_REQUIRES): Remove.
1865 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
1866 %code "requires" and %code "provides".
1867 * tests/input.at (Reject bad %code qualifiers): New.
1868
95021767
JD
18692007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
1870
1871 Use the new code_props interface for destructors and printers.
1872 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
1873 printer_location members, and change the type of the destructor and
1874 printer members to code_props.
1875 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
1876 symbol_printer_get, semantic_type_destructor_set,
1877 semantic_type_printer_set, default_tagged_destructor_set,
1878 default_tagless_destructor_set, default_tagged_printer_set,
1879 default_tagless_printer_set): Use code_props in arguments and return
1880 types in place of char const * and location.
1881 (symbol_destructor_location_get, symbol_printer_location_get): Remove
1882 since the locations are now contained in the return of
1883 symbol_destructor_get and symbol_printer_get.
1884 * src/output.c (symbol_destructors_output, symbol_printers_output):
1885 Replace with...
1886 (symbol_code_props_output): ... this to eliminate duplicate code.
1887 (output_skeleton): Update to use symbol_code_props_output.
1888 * src/reader.c (symbol_should_be_used): Update use of
1889 symbol_destructor_get.
1890 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1891 Update uses of the various _destructor_set and _printer_set functions.
1892 * src/symtab.c: (default_tagged_destructor_location,
1893 default_tagless_destructor_location, default_tagged_printer_location,
1894 default_tagless_printer_location): Remove since we...
1895 (default_tagged_destructor, default_tagless_destructor,
1896 default_tagged_printer, default_tagless_printer): ... change the type
1897 of these to code_props.
1898 (symbol_new, semantic_type_new, symbol_destructor_set,
1899 semantic_type_destructor_set, symbol_destructor_get,
1900 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
1901 symbol_check_alias_consistency, default_tagged_destructor_set,
1902 default_tagless_destructor_set, default_tagged_printer_set,
1903 default_tagless_printer_set): Update.
1904 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
1905 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
1906 code_props members.
1907 (symbol_print): Use SYMBOL_CODE_PRINT.
1908
f6857bbf
JD
19092007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
1910
1911 Use the new code_props interface for rule actions.
1912 * src/symlist.h (symbol_list): Replace action, action_location, and
1913 used members with a code_props action_props member.
1914 * src/reader.c (symbol_should_be_used, grammar_rule_check,
1915 grammar_midrule_action, grammar_current_rule_merge_set,
1916 grammar_current_rule_symbol_append, packgram): Update.
1917 * src/scan-code.h (translate_rule_action): Remove, no longer used.
1918 * src/scan-code.l (handle_action_dollar): Update.
1919 (translate_rule_action): Remove, no longer used.
1920 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
1921
7c0c6181
JD
19222007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1923
1924 Use the new code_props interface in parse-gram.y.
1925 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
1926 Update all uses of translate_* functions to use the new code_props
1927 interface and to use gram_scanner_last_string_free and
1928 code_scanner_last_string_free where possible.
1929 (grammar_declaration): symbol_list_destructor_set and
1930 symbol_list_printer_set now perform the translation, so don't do it
1931 here. Use gram_scanner_last_string_free where possible.
1932 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
1933 translate_code): Remove, no longer used.
1934 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
1935 symbol_list_printer_set): Perform code translation here rather than
1936 depending on the caller to do so.
1937
1938 * src/symlist.h (struct symbol_list): Correct some documentation typos.
1939 * src/scan-gram.h (gram_last_string): Remove declaration.
1940 * src/scan-gram.l (last_string): Declare it static.
1941
28e52c0d
JD
19422007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1943
1944 Encapsulate code properties and related functionality for the various
1945 destructors, printers, and actions into a code_props structure and
1946 interface. This patch merely implements code_props in scan-code.h and
1947 scan-code.l. Future patches will rewrite other modules to use it.
1948 Discussed starting at
1949 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
1950 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
1951 consistently initialize const structs that have an empty location
1952 field.
1953 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
1954 to ensure consistency.
1955 * src/scan-code.h (code_props): New structure.
1956 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
1957 function, macro, and const global variable for initializing a
1958 code_props with no code.
1959 (code_props_plain_init, code_props_symbol_action_init,
1960 code_props_rule_action_init, code_props_translate_code): The rest of
1961 the new code_props functional interface. Among other things, the init
1962 functions set the code_props kind field so that
1963 code_props_translate_code will know whether to behave like
1964 translate_symbol_action, translate_rule_action, or translate_code.
1965 These old translate functions must remain until all other modules are
1966 updated to use the new code_props interface.
1967 (code_scanner_last_string_free): New function similar to
1968 gram_scanner_last_string_free.
1969 (code_scanner_free): Add documentation.
1970 * src/scan-code.l: Implement the new interface.
1971 (code_lex): Make it static, add a code_props* argument, and remove the
1972 rule argument.
1973 (last_string): New static global similar to the one in scan-gram.l.
1974 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
1975 instead of rule.
1976 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
1977 code_props since Bison may one day use this information for destructors
1978 and printers.
1979 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
1980 (handle_action_dollar): Use symbol_list_n_get and set used flag
1981 directly since symbol_list_n_used_set is removed.
1982 (translate_action): Add a code_props* argument and remove the rule,
1983 action, and location arguments. Pass the code_props* on to code_lex.
1984 (translate_rule_action, translate_symbol_action, translate_code):
1985 Rewrite as wrappers around the new code_props interface.
1986 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
1987 it would eventually need to break the encapsulation of code_props.
1988
96034983
JD
19892007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
1990
1991 * etc/.cvsignore: New.
1992
945e396c
JD
19932007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
1994
1995 Add maintainer-push-check to run maintainer-check using push parsing in
1996 place of pull parsing where available.
1997 * Makefile.am (maintainer-push-check): New.
1998 * data/bison.m4 (b4_use_push_for_pull_if): New.
1999 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
2000 appropriately based on their existing values.
2001 (yypush_parse): Don't print push-parser-specific diagnostics if push
2002 parsing is being used in place of pull parsing.
2003 * data/yacc.c: If push parsing should replace pull parsing, redirect to
2004 push.c.
2005 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
2006 variable, and insert b4_use_push_for_pull_flag into muscles.
2007 * tests/Makefile.am (maintainer-push-check): New.
2008
7d596384
JD
20092006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2010
2011 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
2012 (whether successful or failed) so that yypush_parse can be invoked
2013 again to start a new parse using the same yypstate.
2014 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
2015 check multiple yypull_parse invocations on the same yypstate. For pull
2016 mode, extend to check multiple yyparse invocations.
2017 (Exploding the Stack Size with Alloca): Extend to try with
2018 %push-pull-parser.
2019 (Exploding the Stack Size with Malloc): Likewise.
2020
2021 * tests/calc.at (Simple LALR Calculator): Don't specify
2022 %skeleton "push.c" since %push-pull-parser implies that now.
2023 * tests/headers.at (export YYLTYPE): Don't check for the push
2024 declarations. Otherwise, this test case can't be used to see if push
2025 mode can truly emulate pull mode.
2026 * tests/input.at (Torturing the Scanner): Likewise.
2027 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
2028 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
2029 AT_YACC_IF, which now includes the case of push mode since %skeleton
2030 need not be used for push mode. This will be more intuitive once
2031 push.c is renamed to yacc.c.
2032
7172e23e
JD
20332006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2034
2035 For push mode, convert yyparse from a macro to a function, invoke yylex
2036 instead of passing a yylexp argument to yypull_parse, and don't
2037 generate yypull_parse or yyparse unless %push-pull-parser is declared.
2038 Discussed starting at
2039 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
2040 * data/bison.m4 (b4_pull_if): New.
2041 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
2042 * data/push.c: Improve M4 quoting a little.
2043 (b4_generate_macro_args, b4_parenthesize): Remove.
2044 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
2045 any time a pull parser is requested.
2046 Don't #define this as a wrapper around yypull_parse. Instead, when
2047 both push and pull are requested, make it a function that does that
2048 same thing.
2049 (yypull_parse): If there's a b4_prefix, #define this to
2050 b4_prefix[pull_parse] when both push and pull are requested.
2051 Don't define this as a function unless both push and pull are
2052 requested.
2053 Remove the yylexp argument and hard-code yylex invocation instead.
2054 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
2055 %push-parser.
2056 * src/getargs.c (pull_parser): New global initialized to true.
2057 * getargs.h (pull_parser): extern it.
2058 * src/output.c (prepare): Insert pull_flag muscle.
2059 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
2060 (prologue_declaration): Set both push_parser and pull_parser = true for
2061 %push-pull-parser. Set push_parser = true and pull_parser = false for
2062 %push-parser.
2063 * src/scan-gram.l: Don't accept %push_parser as an alternative to
2064 %push-parser since there's no backward-compatibility concern here.
2065 Scan %push-pull-parser.
2066 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
2067 instead of %push-parser.
2068 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
2069 prototype it in the module that calls yyparse.
2070 * tests/input.at (Torturing the Scanner): Likewise.
2071 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
2072
2e7944cb
JD
20732006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
2074
2075 Update etc/bench.pl. Optimize push mode a little (the yyn change
2076 deserves most of the credit).
2077 * Makefile.am (SUBDIRS): Add etc subdirectory.
2078 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
2079 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
2080 yytoken, yyval, and yyloc declarations to...
2081 (yyparse or yypush_parse): ... here to improve performance. For
2082 yypush_parse invocations after the first, be sure to assign yyn its old
2083 value again.
2084 (yypstate_new): Don't bother initializing the yyresult field since the
2085 initial value isn't used.
2086 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
2087 remove the #define that, in push mode, set it to yyps->NAME.
2088 * etc/Makefile.am: New.
2089 * etc/bench.pl: Remove and build it instead from...
2090 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
2091 "tests/bison" from the build directory by default rather than just
2092 invoking "bison" from $PATH.
2093 (calc_grammar): Update push parser code: don't declare yylval globally,
2094 don't define yyparse_wrapper, and don't #define yyparse.
2095 (bench_grammar): Update to check all working combinations of yacc.c,
2096 push.c, impure, pure, pull, and push.
2097
c3d50342
JD
20982006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2099
2100 For push mode, add pull wrappers around yypush_parse.
2101 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
2102 (yypull_parse): New function wrapping yypush_parse.
2103 (yyparse): New #define wrapping yypull_parse.
2104 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
2105 is declared.
2106 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
2107 prototype yylex in the module that calls yyparse, and don't prototype
2108 yyparse there. Otherwise, the yyparse expansion won't compile.
2109 * tests/input.at (Torturing the Scanner): Likewise.
2110
94ebeba5
JD
21112006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2112
2113 Enable push parsers to operate in impure mode. Thus, %push-parser no
2114 longer implies %pure-parser. The point of this change is to move
2115 towards being able to test the push parser code by running the entire
2116 test suite as if %push-parser had been declared.
2117 * data/push.c (yypush_parse): For impure mode, remove the
2118 yypushed_char, yypushed_val, and yypushed_loc arguments.
2119 Instead, declare these as local variables initialized to the global
2120 yychar, yylval, and yylloc.
2121 For the first yypush_parse invocation only, restore the initial values
2122 of these global variables when it's time to read a token since they
2123 have been overwritten.
2124 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
2125 %push-parser.
2126 * tests/calc.at (Simple LALR(1) Calculator): Always declare
2127 %pure-parser along with %push-parser since this test case was designed
2128 for pure push parsers.
2129 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
2130 (AT_YACC_OR_PUSH_IF): New.
2131 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
2132 add a note that it's still wrong for some cases (as it has been for a
2133 while).
2134 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
2135 %push-parser no longer implies %pure-parser.
2136
a0633178
JD
21372006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2138
2139 Remove some unnecessary differences between the pull parser code and
2140 the push parser code. This patch enables yynerrs in push mode.
2141 * data/push.c: Reformat M4 a little.
2142 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
2143 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
2144 because push mode is on. Instead, if pure mode is on, move yynerrs
2145 to...
2146 (b4_declare_parser_state_variables): ... here.
2147 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
2148 to yyps->NAME so it can be used in yypush_parse.
2149 (yypush_parse): Don't omit uses of yynerrs in push mode.
2150
8646b6a3
JD
21512006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2152
2153 Fix bug such that the first pushed token's value and location are
2154 sometimes overwritten (sometimes by %initial-action) before being used.
2155 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
2156 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
2157 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
2158 more closely mimic the pull parser logic.
2159 Don't copy the pushed token to yychar, yylval, and yylloc until it's
2160 time to read a token, which is after any initialization of yylval and
2161 yylloc.
2162 (gottoken): Rename label to...
2163 (yyread_pushed_token): ... for clarity and to avoid infringing on the
2164 user namespace.
2165
9baf4d74
JD
21662006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2167
2168 Rearrange initialization of the parser state variables so that the
2169 skeleton doesn't have to have a copy for pull mode and another for push
2170 mode. This patch also fixes at least a bug such that yylloc was not
2171 initialized (with b4_location_initial_line and
2172 b4_location_initial_column) upon calling yypush_parse. However, that
2173 initialization now overwrites the first token's location;
2174 %initial-action assigning @$ already did the same thing, and both bugs
2175 will be fixed in a later patch.
2176 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
2177 (b4_declare_parser_state_variables): Remove initialization of yytoken,
2178 yyss, yyvs, yyls, and yystacksize.
2179 (yypstate_new): Remove initialization of some yypstate fields: yystate,
2180 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
2181 yylsp.
2182 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
2183 yyps->NAME so it can be used in yypush_parse.
2184 (yyparse or yypush_parse): For yypush_parse, don't print the
2185 "Starting parse" diagnostic for invocations after the first.
2186 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
2187 yypush_parse, only do it for the first invocation.
2188 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
2189 initialization to occur in yypush_parse but only on the first
2190 invocation.
2191
23522164
JD
21922006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2193
2194 * data/push.c: Add CPP guards around push parser declarations in both
2195 the header and the code file.
2196 In the code file, move the push parser declarations to the same place
2197 they appear in the header file.
2198 Clean up the M4 some, especially the inconsistent underquoting in
2199 some b4_c_function_def and b4_c_function_decl uses.
2200
bb010fe5
JD
22012006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2202
2203 Encapsulate the push parser state variables into an M4 macro so the
2204 push skeleton doesn't have to list them again for pull mode's yyparse.
2205 For push mode, remove yypush_parse's local equivalents of these
2206 variables to eliminate unnecessary copying between the two sets at
2207 run-time. This patch also fixes at least a bug related to multiple
2208 %initial-action invocations in push mode.
2209 * data/push.c (b4_declare_parser_variables): Rename to...
2210 (b4_declare_scanner_communication_variables): ... this for clarity and
2211 update both uses.
2212 (b4_declare_yyparse_variables): Remove and move its contents to the one
2213 spot where it was invoked.
2214 (b4_declare_parser_state_variables): New macro containing the parser
2215 state variables required by push mode.
2216 (struct yypstate): Replace all fields but yynew with
2217 b4_declare_parser_state_variables.
2218 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
2219 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
2220 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
2221 (yyparse or yypush_parse): For yyparse in pull mode, replace local
2222 parser state variable declarations with
2223 b4_declare_parser_state_variables.
2224 Don't initialize parser state variables when calling yypush_parse since
2225 yypstate_new already does that.
2226 Invoke the user's initial action only upon the first yypush_parse
2227 invocation.
2228 Remove all code that copies between the local parser state variables
2229 and the yypstate.
2230
2d212f8c
JD
22312006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2232
2233 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
2234 prevent a name collision in a future patch where these names will
2235 sometimes be #define'd.
2236 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
2237 since it no longer has the same name as the existing argument.
2238 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
2239
e6e704dc
JD
22402006-12-19 Paolo Bonzini <bonzini@gnu.org>
2241 and Joel E. Denny <jdenny@ces.clemson.edu>
2242
2243 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2244 that the argument is case-insensitive, and there's no `=' here.
2245 For the %skeleton entry, mention that %language is better.
2246 (Bison Options): Likewise for --language and --skeleton. Move the
2247 --skeleton entry so that the `Tuning the parser' section is sorted
2248 alphabetically on long options.
2249 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
2250 %language directive in detail here; cross-reference the %language
2251 documentation instead.
2252 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
2253 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 2254 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
2255 * examples/extexi (normalize): Instead of replacing every %require
2256 argument with the current Bison version, just substitute for
2257 `@value{VERSION}'. This guarantees that we're testing what actually
2258 appears in the documentation.
2259 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
2260 rather than `@VERSION@'.
2261
0e021770
PE
22622006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2263
fd575f05
PE
2264 * NEWS: Reword the %language news a bit, and put it earlier.
2265
0e021770
PE
2266 * src/getargs.c (skeleton_arg): Last arg is now location const *.
2267 Rewrite to simplify the logic.
2268 (language_argmatch): Likewise.
fd575f05
PE
2269 (program_name): We now own this var.
2270 * src/getargs.h (struct bison_language): Use char[] rather than
2271 const char *.
0e021770
PE
2272
2273 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
2274 Java is supported.
2275 * src/complain.c (program_name): Remove decl; no longer needed.
2276 * src/main.c (program_name): Remove; now belongs to getargs.
2277
22782006-12-18 Paolo Bonzini <bonzini@gnu.org>
2279
2280 * NEWS: Document %language.
2281
2282 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
2283
2284 * data/c-skel.m4, data/c++-skel.m4: New files.
2285 * data/glr.c: Complain on push parsers.
2286
2287 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
2288 over %skeleton.
148d66d8 2289 (Decl Summary): Document %language and %skeleton.
0e021770
PE
2290 (Command line): Document -L.
2291
2292 * examples/extexi: Rewrite %require directive.
2293 * examples/calc++/Makefile.am: Pass VERSION to extexi.
2294
2295 * src/files.c (compute_exts_from_gc): Look in language structure
2296 for .y extension.
2297 (compute_file_name_parts): Check whether .tab should be added.
2298 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
2299 (language, skeleton_arg, language_argmatch): New.
2300 (long_options): Add --language.
2301 (getargs): Use skeleton_arg, add -L/--language.
2302 * src/getargs.h: Include location.h.
2303 (struct bison_language, language, skeleton_arg, language_argmatch): New.
2304 * src/output.c (prepare): Pick default skeleton from struct language.
2305 Don't dispatch C skeletons here.
2306 * src/parse-gram.y (PERCENT_LANGUAGE): New.
2307 (prologue_declaration): Add "%language" rule, use skeleton_arg.
2308 * src/scan-gram.l ("%language"): New rule.
2309
2310 * tests/calc.at: Test %skeleton and %language.
2311 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
2312 (AT_GLR_IF): Look for %skeleton "glr.cc".
2313 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
2314 (AT_YACC_IF): Reject %language.
2315
5691bf57
PE
23162006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2317
db06f0ce
PE
2318 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
2319 since it wasn't used; only the typedef name 'semantic_type' is needed.
2320 Also, omit trailing white space.
2321
5691bf57
PE
2322 * bootstrap: Sync from coreutils.
2323 (gnulib_extra_files): Add build-aux/announce.gen.
2324 (slurp): Adjust .gitignore files like .cvsignore files.
2325 * build-aux/announce-gen: Remove from CVS, since bootstrap
2326 now creates this.
2327
791934e4
JD
23282006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
2329
2330 Make %push-parser imply %pure-parser. This fixes several bugs; see
2331 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
2332 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
2333 pure_parser = true.
2334 * data/push.c: Don't bother testing b4_push_if when deciding whether
2335 to expand b4_declare_parser_variables globally.
2336 (yypush_parse): Likewise in here.
2337
2338 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
2339 (yy_reduce_print): Reformat M4 for readability.
2340
ee5abb37
JD
23412006-12-15 Bob Rossi <bob@brasko.net>
2342 and Joel Denny <jdenny@ces.clemson.edu>
2343
2344 * data/push.c (yypstate): Add typedef, and update all uses of
2345 struct yypstate to just yypstate.
2346 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
2347
16ca01f9
JD
23482006-12-14 Bob Rossi <bob@brasko.net>
2349
2350 * data/push.c (yypush_parse): Declare prototype regardless of
2351 %locations option.
2352
ab8e7e1a
JD
23532006-12-14 Bob Rossi <bob@brasko.net>
2354
2355 * data/push.c (yyparse): Remove the prototype and the #define when in
2356 push-parser mode.
2357
9bf32be3
JD
23582006-12-13 Bob Rossi <bob@brasko.net>
2359
2360 * data/push.c (yypstate_init): Rename to...
2361 (yypstate_new): ... this and use b4_c_function_def.
2362 (yypstate_delete): New.
2363 (yypush_parse): Change parameters yynval and yynlloc to be const.
2364 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
2365 yypstate_delete functions.
2366
f02e2948
JD
23672006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
2368
2369 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
2370 strange test case titles. Reported by Bob Rossi.
2371
38eb7751
PE
23722006-12-13 Paul Eggert <eggert@cs.ucla.edu>
2373
2374 * TODO: Add pointer to Sylvain Schmitz's work on static detection
2375 of potential ambiguities in GLR grammers.
2376
bd9d212b
JD
23772006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
2378
2379 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
2380 `bison ', use m4_index instead of m4_substr since chopping up a string
2381 containing M4-special characters causes problems here.
2382
2383 Fix a couple of bugs related to special characters in user-specified
2384 file names, and make it easier for skeletons to compute output file
2385 names with the same file name prefix as Bison-computed output file
2386 names.
2387 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
2388 b4_parser_file_name and b4_spec_defines_file instead of
2389 @output_parser_name@ and @output_header_name@, which are now redundant.
2390 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
2391 b4_parser_file_name, b4_spec_defines_file, and the new
2392 @basename(FILENAME@) instead of @output_parser_name@ and
2393 @output_header_name@, which inappropriately escaped the file names as
2394 C string literals.
2395 * src/files.c (all_but_ext): Remove static qualifier.
2396 (compute_output_file_names): Move `free (all_but_ext)' to...
2397 (output_file_names_free): ... here since all_but_ext is needed later.
2398 * src/files.h (all_but_ext): Extern.
2399 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
2400 exactly what MUSCLE_INSERT_STRING used to do.
2401 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
2402 characters are escaped properly.
2403 * src/output.c (prepare): Define muscle file_name_all_but_ext as
2404 all_but_ext.
2405 For pkgdatadir muscle, maintain previous functionality by using
2406 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
2407 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
2408 digraphs would never be expanded. Hopefully no one has M4-special
2409 characters in his Bison installation path.
2410 * src/scan-skel.l: Don't parse @output_header_name@ and
2411 @output_parser_name@ anymore since they're now redundant.
2412 In @output, use decode_at_digraphs.
2413 Parse a new @basename command that invokes last_component.
2414 (decode_at_digraphs): New.
2415 (BASE_QPUTS): Remove unused.
2416 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
2417 (Output file name): New tests.
2418
3f7ca628
JD
24192006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
2420
2421 Warn about output files that are generated by the skeletons and that
2422 conflict with other output files.
2423 * data/glr.c: Don't generate the header file here when glr.cc does.
2424 * src/files.c (file_names, file_names_count): New static globals.
2425 (compute_output_file_names): Invoke output_file_name_check for files
2426 not generated by the skeletons and remove existing checks.
2427 (output_file_name_check): New function that warns about conflicting
2428 output file names.
2429 (output_file_names_free): Free file_names.
2430 * src/files.h (output_file_name_check): Declare.
2431 * src/scan-skel.l: Invoke output_file_name_check for files generated by
2432 the skeletons.
2433 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
2434 (Conflicting output files): New tests.
2435
178e123e
PE
24362006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2437
2438 * doc/bison.texinfo: Fix a couple of typos.
2439
24402006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
2441
2442 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
2443 Rename to...
2444 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
2445 update all uses.
2446 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
2447 (yypush_parse): Rename yypvars argument to yyps and remove redundant
2448 local pv.
2449 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
2450 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
2451
ea17f233
JD
24522006-12-07 Bob Rossi <bob@brasko.net>
2453 and Joel Denny <jdenny@ces.clemson.edu>
2454
2455 * data/push.c (yypvarsinit): Change return type from void* to struct
2456 yypvars*. No longer cast to void* on return.
2457 (struct yypvars): Remove yylen since it need not be remembered between
2458 yypushparse invocations.
2459 (yypushparse): Don't copy between yylen and pv->yylen.
2460
55a30bda
JD
24612006-12-05 Bob Rossi <bob@brasko.net>
2462
2463 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
2464 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
2465 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
2466 (struct yypvars): Remove b4_declare_parser_variables.
2467 (yypvarsinit): Remove init code for removed variables.
2468 (global scope): Do not declare b4_declare_parser_variables if
2469 push or pure mode.
2470 (yypushparse): Add b4_declare_parser_variables.
2471 Init new local variables, and remove init code for removed
2472 yypvars variables.
2473 (yyparse): Delete.
2474 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
2475 and yyparse for other modes.
2476 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
2477 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
2478 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
2479 (AT_PURE_LEX_IF): True if pure or push parser.
2480
85894313
JD
24812006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
2482
2483 Document Yacc prologue alternatives and default %destructor's and
2484 %printer's as experimental. Don't mention Java yet. Discussed at
2485 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
2486 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
2487 (2.3a): Annotate this entry to say the old forms of these features were
2488 also experimental.
2489 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 2490 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
2491 of Java (we'll want this back eventually).
2492
02975b9a
JD
24932006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2494
2495 Support a file name argument to %defines. Deprecate `=' in
2496 %file-prefix, %name-prefix, and %output. Discussed at
2497 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
2498 * NEWS (2.3a+): Mention.
148d66d8 2499 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
2500 form of %defines, and remove `=' from entries for %file-prefix,
2501 %name-prefix, and %output.
2502 * src/parse-gram.y (prologue_declaration): Implement.
2503 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
2504 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
2505 all but one occurrence of %name-prefix.
2506 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
2507 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
2508 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
2509 occurrence of each of %file-prefix and %output. Add check for %defines
2510 with argument.
2511 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
2512 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
2513 Remove the `=' from %output.
2514
287b314e
JD
25152006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
2516
2517 Don't escape $ in test case titles since Autoconf 2.61 now does that
2518 correctly.
2519 * tests/actions.at (Default %printer and %destructor are not for error
2520 or $undefined): Here.
2521 (Default %printer and %destructor are not for $accept): Here.
2522 * tests/input.at (Invalid $n and @n): Here.
2523
3ebecc24
JD
25242006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
2525
2526 Rename <!> to <>. Discussed starting at
2527 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
2528 * NEWS (2.3a+): Update.
148d66d8 2529 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
2530 Update.
2531 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
2532 * src/scan-gram.l (INITIAL): Implement.
2533 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
2534 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
2535 comment.
2536 * tests/actions.at (Default tagless %printer and %destructor,
2537 Default tagged and per-type %printer and %destructor,
2538 Default %printer and %destructor are not for error or $undefined,
2539 Default %printer and %destructor are not for $accept,
2540 Default %printer and %destructor for mid-rule values): Update.
2541 * tests/input.at (Default %printer and %destructor redeclared,
2542 Unused values with default %destructor): Update.
2543
26b8a438
JD
25442006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2545
2546 Don't let %prec take a nonterminal.
2547 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
2548 token.
2549 * tests/input.at (%prec takes a token): New test checking that %prec
2550 won't take a nonterminal.
2551
07c39ae9
JD
25522006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2553
405d53b7
JD
2554 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
2555 it was double-quoted.
07c39ae9
JD
2556 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
2557 grammar is maintained with Bison's highest standards.
2558 * src/getargs.c: Fix some typos in Doxygen comments.
2559
580b8926
JD
25602006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2561
2562 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
2563 later. Reported by Paul Eggert in
2564 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
2565 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
2566 * src/scan-code.l (translate_action): Don't bother invoking
2567 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
2568 (code_scanner_free): Instead of invoking
2569 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
2570 which frees more.
2571 * src/scan-gram.l (gram_scanner_free): Likewise.
2572 * src/scan-skel.l (scan_skel): Likewise.
2573
4502eadc
JD
25742006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2575
2576 * src/files.c (tr): Change return type to void.
2577 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
2578 has been called previously for the same key.
2579 (muscle_find): Return storage instead of value so that
2580 --enable-gcc-warnings doesn't produce warnings that the return discards
2581 const. aver that the value and storage are the same since storage
2582 could potentially be NULL when value is not.
2583 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
2584 same as 0.
2585
7746c8f6
PE
25862006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2587
2588 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
2589 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
2590 us a slightly cleaner distribution, and also works.
2591 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
2592 gnulib changes.
2593
eb095650
PE
25942006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
2595 and Paul Eggert <eggert@cs.ucla.edu>
2596
2597 Don't let Bison leak memory except when it complains.
2598 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
2599 (spec_defines_file, dir_prefix): Now char *, not const char *,
2600 since they are freed.
2601 * src/files.c: Likewise.
2602 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
2603 Likewise.
2604 (tr): Now operates in-place. All uses changed.
2605 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
2606 values.
2607 (compute_file_name_parts, compute_output_file_names): Don't store
2608 read-only data in variables that will be freed.
2609 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
2610 src_extension, and header_extension.
2611 (output_file_names_free): New public function to free
2612 spec_verbose_file, spec_graph_file, spec_defines_file,
2613 parser_file_name, and dir_prefix.
2614 * src/getargs.c (getargs): Don't store read-only data in variables that
2615 will be freed.
2616 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
2617 (which previously existed but was unused), and quotearg_free.
2618 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
2619 * src/muscle_tab.c: Likewise.
2620 (muscle_entry): Make the value char const *,
2621 and add a new storage member that is char * and can be freed.
2622 (muscle_entry_free): New private function.
2623 (muscle_init): Use it instead of free.
2624 (muscle_insert, muscle_grow): Update and use new storage member.
2625 (muscle_code_grow): Free the string passed to muscle_grow
2626 since it's not needed anymore.
2627 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
2628 add a new `char *code' member.
2629 ("{...}"): Declare semantic type as code.
2630 * src/scan-code.h (translate_rule_action):
2631 (translate_symbol_action, translate_code, translate_action): Return
2632 `char const *' rather than `char *' since external code should not free
2633 these strings.
2634 * src/scan-code.l: Likewise.
2635 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
2636 which is "{...}" in the parser.
2637 * tests/Makefile.am (maintainer-check-valgrind): Set
2638 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
2639 Valgrind.
2640 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
2641 complain.
2642 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
2643 expecting a non-zero exit status sets --leak-check=summary and
2644 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
2645 this case, and we don't want to hear about it.
2646
ac564be4
PE
26472006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2648
2649 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
2650 instead of from the template, to simplify configuration a bit.
2651 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
2652 and m4/wint_t.m4, as they are needed with the latest gnulib.
2653
17bd8a73
JD
26542006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2655
2656 Disable unset/unused mid-rule value warnings by default, and recognize
2657 --warnings=midrule-values to enable them. Discussed starting at
2658 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
2659 * NEWS (2.3a+): Mention.
2660 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
2661 warnings): Add entry for midrule-values subargument.
2662 * src/reader.c (symbol_should_be_used): Don't return true just because
2663 the value is a set/used mid-rule value unless
2664 --warnings=midrule-values was specified.
2665 * tests/input.at (Unused values, Unused values before symbol
2666 declarations): Run tests with and without --warnings=midrule-values.
2667
2668 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
2669 than LIST_FREE directly.
2670
89eb3c76
JD
26712006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2672
2673 Finish implementing --warnings=error, which should not be implied by
2674 --warnings=all (or by its synonyms -W and --warnings without
2675 subarguments).
2676 * src/complain.c (set_warning_issued): New function to report that
2677 warnings are being treated as errors and to record an error if so.
2678 Invoke...
2679 (warn_at, warn): ... here.
2680 * src/getargs.c (warnings_args, warnings_types): Reorder so that
2681 "error - warnings are errors" does not appear above "all - all of the
2682 above".
2683 (getargs): For -W and --warnings without subarguments, don't let
2684 FLAGS_ARGMATCH set warnings_error in warnings_flag.
2685 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
2686
ba7560e2
JD
26872006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2688
2689 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
2690 empty subargument list. For example: `bison --warnings= parser.y'.
2691
31283fc3
JD
26922006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2693
2694 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
2695 the parser header file so that gcc doesn't warn.
2696
12e35840
JD
26972006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2698
2699 Split the default %destructor/%printer into two kinds: <*> and <!>.
2700 Discussed starting at
2701 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
2702 * NEWS (2.3a+): Mention.
2703 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
2704 previous change today related to mid-rules.
148d66d8 2705 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 2706 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
2707 (TYPE_TAG_ANY): Add as <*>.
2708 (TYPE_TAG_NONE): Add as <!>.
2709 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
2710 for <*> and <!>.
2711 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
2712 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
2713 * src/symlist.c (symbol_list_default_new): Split into tagged and
2714 tagless versions.
2715 (symbol_list_destructor_set, symbol_list_printer_set): Split
2716 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
2717 SYMLIST_DEFAULT_TAGLESS.
2718 * src/symlist.h: Update symbol_list_default*_new prototypes.
2719 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
2720 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
2721 * src/symtab.c (default_destructor, default_destructor_location,
2722 default_printer, default_printer_location): Split each into tagged and
2723 tagless versions.
2724 (symbol_destructor_get, symbol_destructor_location_get,
2725 symbol_printer_get, symbol_printer_location_get): Implement tagged
2726 default and tagless default cases.
2727 (default_destructor_set, default_printer_set): Split each into tagged
2728 and tagless versions.
2729 * src/symtab.h: Update prototypes.
2730 * tests/actions.at (Default %printer and %destructor): Rename to...
2731 (Default tagless %printer and %destructor): ... this, and extend.
2732 (Per-type %printer and %destructor): Rename to...
2733 (Default tagged and per-type %printer and %destructor): ... this, and
2734 extend.
2735 (Default %printer and %destructor for user-defined end token): Extend.
2736 (Default %printer and %destructor are not for error or $undefined):
2737 Update.
2738 (Default %printer and %destructor are not for $accept): Update.
2739 (Default %printer and %destructor for mid-rule values): Extend.
2740 * tests/input.at (Default %printer and %destructor redeclared): Extend.
2741 (Unused values with default %destructor): Extend.
2742
f91b1629
JD
27432006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2744
2745 Don't apply the default %destructor/%printer to an unreferenced midrule
2746 value. Mentioned at
2747 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
2748 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
2749 like $@n instead of just @n so that the default %destructor/%printer
2750 logic doesn't see them as user-defined symbols.
2751 (symbol_is_dummy): Check for both forms of the name.
2752 * src/reader.c (packgram): Remove the `$' from each midrule symbol
2753 name for which the midrule value is referenced in any action.
2754 * tests/actions.at (Default %printer and %destructor for mid-rule
2755 values): New test.
2756 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
2757 for change to dummy symbol names.
2758
519d0004
JD
27592006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2760
2761 Warn about unset midrule $$ if the corresponding $n is used.
2762 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
2763 $n usage.
2764 (packgram): Before invoking grammar_rule_check on any rule, make sure
2765 all actions have already been scanned in order to set `used' flags.
2766 Otherwise, checking that a midrule's $$ is set will not always work
2767 properly because the midrule check must forward-reference the midrule's
2768 parent rule.
2769 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
2770 warning.
2771
a501eca9
JD
27722006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2773
2774 More improvements to the documentation of the prologue alternatives:
2775 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
2776 Bison manual.
2777 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
2778 some text to clarify the relative importance of the new directives and
2779 to show how these directives may be viewed as code labels.
2780
2cbe6b7f
JD
27812006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
2782
2783 Similar to the recently removed %before-header, add %code-top as the
2784 alternative to the pre-prologue. Mentioned at
2785 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
2786 Also, let the prologue alternatives appear in the grammar section.
2787 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
2788 (prologue_declaration): Move the existing prologue alternatives to...
2789 (grammar_declaration): ... here and add %code-top.
2790 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
2791
2792 Clean up and extend documentation for the prologue alternatives.
2793 * NEWS (2.3a+): Describe prologue alternatives.
2794 * doc/bison.texinfo (Prologue): Move discussion of prologue
2795 alternatives to...
2796 (Prologue Alternatives): ... this new section, and extend it to discuss
2797 all 4 directives in detail.
148d66d8
JD
2798 (Table of Symbols): Clean up discussion of prologue alternatives and
2799 add %code-top.
2cbe6b7f 2800
e557d3ea
JMG
28012006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2802
2803 DJGPP specific issues.
2804
2805 * djgpp/config.bat: config.hin has been moved to lib. Adjust
2806 config.bat accordingly.
2807 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
2808 * djgpp/config.site: Likewise.
2809
136a0f76
PB
28102006-10-16 Paolo Bonzini <bonzini@gnu.org>
2811
27bd5d67
PB
2812 Replace %*-header with %provides, %requires, %code. See discussion at
2813 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
2814
136a0f76
PB
2815 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
2816 (b4_user_start_header): Remove.
2817 * data/glr.c: Use new macros instead of b4_*start_header
2818 and b4_*end_header.
2819 * data/glr.cc: Likewise.
2820 * data/lalr1.cc: Likewise.
2821 * data/push.c: Likewise.
2822 * data/yacc.c: Likewise.
2823
2824 * doc/bison.texinfo: Remove %before-header, rename
2825 %{start,end,after}-header to %requires, %provides, %code.
2826
2827 * src/parse-gram.y: Likewise (also rename token names accordingly).
2828 * src/scan-gram.l: Likewise.
2829 * tests/actions.at: Likewise.
2830
10f429ef
PE
28312006-10-14 Paul Eggert <eggert@cs.ucla.edu>
2832
2833 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
2834 Problem reported by Joel E. Denny.
2835
28362006-10-14 Jim Meyering <jim@meyering.net>
2837
2838 (Sync from coreutils.)
2839 Work also when the working directory (with e.g. coreutils sources)
2840 is version controlled with git, rather than CVS.
2841 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
2842 rather than CVS.
2843 In messages and comments, say e.g., "checked-out sources",
2844 rather than "CVS sources".
2845 (version_controlled_file): New function. Work for git as well as
2846 for CVS. Don't use grep's -q option.
2847 (slurp): Call it here, in place of CVS-specific code.
2848
c4bd5bf7
JD
28492006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
2850
2851 Fix testsuite for ./configure --enable-gcc-warnings:
2852 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
2853 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
2854 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
2855 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
2856 * test/regression.at (Diagnostic that expects two alternatives):
2857 Likewise.
2858
46356ea4
PE
28592006-10-12 Paul Eggert <eggert@cs.ucla.edu>
2860
231ed89a
PE
2861 * bootstrap.conf (gnulib_modules): Add config-h.
2862 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
2863 worry about HAVE_CONFIG_H.
2864 * lib/abitset.c: Likewise.
2865 * lib/bitset.c: Likewise.
2866 * lib/bitset_stats.c: Likewise.
2867 * lib/bitsetv-print.c: Likewise.
2868 * lib/bitsetv.c: Likewise.
2869 * lib/ebitset.c: Likewise.
2870 * lib/get-errno.c: Likewise.
2871 * lib/lbitset.c: Likewise.
2872 * lib/subpipe.c: Likewise.
2873 * lib/timevar.c: Likewise.
2874 * lib/vbitset.c: Likewise.
2875 * lib/bitset.c: Include "bitset.h" first, to test interface.
2876 * lib/bitset_stats.c: Include "bitset_stats.h" first.
2877 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
2878 * lib/bitsetv.c: Include "bitsetv.h" first.
2879 * lib/get-errno.c: Include "get-errno.h" first.
2880 * m4/.cvsignore: Add config-h.m4.
2881 * tests/actions.at (Default %printer and %destructor for ...):
2882 Adjust expected line numbers in output to reflect removal of #if
2883 HAVE_CONFIG_H lines.
2884 * tests/glr-regression.at (Missed %merge type warnings when ...):
2885 Likewise.
2886 * tests/regression.at (Braced code in declaration in rules section):
2887 Likewise.
2888 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
2889 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
2890 Include <config.h> unconditionally.
2891
46356ea4
PE
2892 * bootstrap: Sync from coreutils, as follows:
2893
2894 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2895
2896 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
2897 variable was sometimes used without being initialized. This
2898 messed up the installation of the INSTALL file in some cases.
2899
2900 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2901
2902 * bootstrap (usage, main program, symlink_to_gnulib): Add option
2903 --copy. Inspired by a suggestion from Bruno Haible.
2904
2905 2006-10-03 Jim Meyering <jim@meyering.net>
2906
2907 * bootstrap: Undo last change to this file, since now gnulib-tool
2908 sticks with the automake default in generating dependencies.
2909
dd4bf078
PE
29102006-10-12 Paul Eggert <eggert@cs.ucla.edu>
2911
cf2a5f7c
PE
2912 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
2913 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
2914
2915 * doc/bison.1: Add copyright notice.
2916
2917 * data/glr.c: Don't include <stdarg.h>; not used.
2918
35fe0834
PE
2919 * NEWS: The -g and --graph options now output graphs in Graphviz
2920 DOT format, not VCG format.
2921 * doc/bison.1: Likewise.
2922 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
2923 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
2924 of this change in
2925 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
2926 * TODO: Remove Graphviz entry.
2927 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
2928 remove vcg.c, vcg.h, vcg_defaults.h.
2929 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
2930 * src/graphviz.c, src/graphviz.h: New files.
2931 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
2932 * src/files.h: Make comment more generic.
2933 * src/main.c (main): Likewise.
2934 * src/print_graph.h: Likewise.
2935 * src/getargs.c (usage): Make usage description more generic.
2936 * src/print_graph.c: Include graphviz.h rather than vcg.h.
2937 (static_graph, fgraph): Remove. All uses changed to pass
2938 arguments instead of sharing a static var.
2939 (print_core, print_actions, print_state, print_graph):
2940 Output graphviz format rather than VCG format.
2941 * tests/.cvsignore: Remove *.vcg; add *.dot.
2942 * tests/output.at: Expect *.dot files, not *.vcg files.
2943
dd4bf078
PE
2944 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
2945 accommodates the 2006-10-08 change.
2946
efdd7421
PE
29472006-10-11 Bob Rossi <bob@brasko.net>
2948
2949 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
2950 (b4_yyssa, b4_yyerror_range): New macros.
2951 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
2952 (yypvarsinit): Remove init of removed fields.
2953 (yypushparse): Remove use of removed fields; use new macros instead.
2954
96a1981a
PE
29552006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2956
2957 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
2958 in a push parser. Reindent slightly to match yacc.c better.
2959
29602006-10-11 Bob Rossi <bob@brasko.net>
2961
46356ea4
PE
2962 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
2963 yymsg_alloc fields.
2964 (yypvarsinit, yypushparse): Remove init of removed fields.
2965 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 2966
c1630a8b
PE
29672006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2968
2969 * THANKS: Add Paolo Bonzini and Bob Rossi.
2970
90b9908d
PB
29712006-10-08 Paolo Bonzini <bonzini@gnu.org>
2972
2973 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
2974 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
2975 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
2976 b4_define_user_cde and uses): Remove.
2977 (b4_comment, b4_prefix, b4_sync_start): New.
2978 * data/bison.m4: New file, with most of the content removed from c.m4.
2979 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
2980 * src/output.c (output_skeleton): Pass bison.m4.
2981 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
2982 only if specified.
2983
cf806753
PE
29842006-10-05 Paul Eggert <eggert@cs.ucla.edu>
2985
2986 Fix test failure reported by Tom Lane in
2987 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
2988 and try to make such failures easier to catch in the future.
2989 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
2990 that's now the caller's responsibility.
2991 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
2992 Set yychar = YYEOF if it's negative.
2993 * tests/actions.at (yylex): Abort if asked to read past EOF.
2994 * tests/conflicts.at (yylex): Likewise.
2995 * tests/cxx-type.at (yylex): Likewise.
2996 * tests/glr-regression.at (yylex): Likewise.
2997 * tests/input.at (yylex): Likewise.
2998 * tests/regression.at (yylex): Likewise.
2999 * tests/torture.at (yylex): Likewise.
3000
0e2f006a
PE
30012006-10-01 Paul Eggert <eggert@cs.ucla.edu>
3002
3003 Fix problems with translating English-language diagnostics.
3004 * bootstrap: Fix bug introduced in recent bootstrap changes, with
3005 respect to bison-runtime pot generation. The YY_ stuff
3006 wasn't being captured.
3007 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
3008 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
3009 * runtime-po/POTFILES.in: Add data/push.c.
3010
e3ddc1e3
PE
30112006-09-29 Paul Eggert <eggert@cs.ucla.edu>
3012
3013 Merge bootstrap changes from coreutils.
3014
3015 2006-09-28 Jim Meyering <jim@meyering.net>
3016
3017 Automatically generated dependencies are important even
3018 when all of the sources in a directory come from gnulib.
3019 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
3020 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
3021
3022 2006-09-23 Jim Meyering <jim@meyering.net>
3023
3024 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
3025
3026 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3027
3028 * bootstrap: Add support for --force.
3029 (usage): New function. Describe usage less tersely.
3030 (CVS_only_file): New var.
3031
01e972b3
PE
30322006-09-21 Paul Eggert <eggert@cs.ucla.edu>
3033
3034 * data/push.c (YYPUSH_MORE): Make it an enum instead.
3035 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
3036 Adjust white space and comments to match GNU style better.
3037
c63d3e90
PE
30382006-09-20 Bob Rossi <bob@brasko.net>
3039
3040 * data/push.c (yyresult_get): Remove function.
3041 (YYPUSH_MORE): Add #define.
3042 (yypushparse): Modify return value.
3043
e70f46d1
PE
30442006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3045
3046 * stamp-h.in: Remove; no longer needed.
3047 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
3048 Remove config.h, config.hin, intl (no longer created).
3049 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
3050 stamp-h1.
3051
3052 Sync bootstrap from coreutils, as follows:
3053
3054 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
3055
3056 * bootstrap (symlink_to_gnulib): New function.
3057 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
3058 to copies-of-gnulib.
3059 (cp_mark_as_generated, slurp, gnulib_files):
3060 Avoid making a copy if it's the same as the old version.
3061 (gnulib_files): Add support for this variable (used by Bison).
3062
a92be413
PE
30632006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3064
3065 * src/getargs.c (usage): Rework to use conventions similar to
3066 coreutils, to make translation a bit easier and the code a bit
3067 smaller. Problem reported by Tim Van Holder.
3068
4f82b42a
PE
30692006-09-15 Paul Eggert <eggert@cs.ucla.edu>
3070
3b2942e6
PE
3071 Use some of gnulib's new modules, taken from coreutils.
3072
3073 * bootstrap: Sync from coreutils, except add support for gnulib_files.
3074 * bootstrap.conf: New file.
3075 (gnulib_modules): Add configmake, inttypes, unistd.
3076 (XGETTEXT_OPTIONS): Add complain, complain_at,
3077 fatal, fatal_at, warn, warn_at, unexpected_end.
3078 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
3079 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
3080 (gl_EARLY): Add.
3081 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
3082 (gl_INIT): Add
3083 (GNULIB_AUTOCONF_SNIPPET): Remove.
3084 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
3085 the pickiest.
3086 * lib/.cvsignore: Add inttypes_.h.
3087 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
3088 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
3089 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
3090 no-longer-necessary initializations.
3091 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
3092 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
3093 use the unistd module.
3094 * src/system.h: Likewise.
3095 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
3096 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
3097 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
3098 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
3099 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
3100 * src/system.h: Include inttypes.h unconditionally, now that we
3101 use the inttypes module. Don't bother to include stdint.h, since
3102 inttypes.h now does that for us.
3103 (LOCALEDIR): Remove, now that we use the configmake module.
3104 * src/getargs.c: Include configmake.h.
3105 * src/main.c: Likewise.
3106 * src/output.c: Likewise.
3107 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
3108 not from $abs_top_builddir, since config.h moved.
3109
3110
4f82b42a
PE
3111 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
3112 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
3113
3114 * src/parse-gram.y (symbol_declaration): Don't put statements
3115 before declarations; it's not portable to C89.
3116 * src/scan-code.l (handle_action_at): Likewise.
3117
3118 * src/scan-code.l: Always initialize braces_level; the old code
3119 left it uninitialized and therefore had undefined behavior.
3120
3121 Don't attempt to redefine 'assert', since it runs afoul of
3122 systems where standard headers (mistakenly) include <assert.h>.
3123 Instead, define and use our own alternative, called 'aver'.
3124 * src/reader.c: Don't include assert.h, since we no longer
3125 use assert.
3126 * src/scan-code.l: Likewise.
3127 * src/system.h (assert): Remove, replacing with....
3128 (aver): New function, taking a bool arg. All uses changed.
3129 * src/tables.c (pack_vector): Ensure that aver arg is bool,
3130 not merely an integer.
3131
31c10e38
PE
31322006-09-15 Bob Rossi <bob@brasko.net>
3133
3134 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
3135 * data/c.m4 (YYPUSH): New.
3136 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
3137 * src/getargs.c (push_parser): New var.
3138 * src/getargs.h (push_parser): New declaration.
3139 * src/output.c (prepare): Add macro insertion of `push_flag'.
3140 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
3141 (prologue_declaration): Parse %push-parser.
3142 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
3143 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
3144 list of removed lines from the traces observed.
3145 (AT_CHECK_CALC_LALR): Added push parser tests.
3146
fa7b79c0
PE
31472006-09-13 Paul Eggert <eggert@cs.ucla.edu>
3148
21fe08ca
PE
3149 * NEWS: Version 2.3a.
3150 * configure.ac (AC_INIT): Likewise.
3151
e8ec4d9b
PE
3152 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
3153 "#define YYSTYPE int" that caused "make maintainer-check" to fail
3154 due to header ordering dependencies. I don't know why the #define
3155 was there.
3156
fa7b79c0
PE
3157 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
3158 runtime cost when YYDEBUG is not defined, and so that some tests
3159 that used to fail now work. Problem and initial suggestion by
3160 Paolo Bonzini.
3161 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
3162 * data/glr.cc (b4_parser_class_name):
3163 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
3164 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
3165 (yydebug_) [YYDEBUG]: New member.
3166 (yycdebug_): Now defined only if YYDEBUG.
3167 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
3168 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
3169 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
3170 if YYYDEBUG.
3171 (debug_stream, set_debug_stream, debug_level, set_debug_level):
3172 Define only if YYDEBUG.
3173 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
3174 set_debug_level.
3175 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
3176 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
3177 AT_CHECK_CALC_GLR_CC that are working now.
3178
4ec13d60
PE
31792006-09-12 Paul Eggert <eggert@cs.ucla.edu>
3180
3181 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
3182 We don't need them in glr.cc, and glr.c defines them.
3183 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
3184 assumes that defining it to anything is the same as defining
3185 it to 1. Problem reported by Paolo Bonzini.
3186
8e1687ae
PE
31872006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
3188
3189 * data/c.m4 (b4_null, b4_case): Define.
3190 * src/output.c (prepare_symbols): Use b4_null.
3191 (user_actions_output): Use b4_case.
3192
3dc5e96b
PE
31932006-09-11 Paul Eggert <eggert@cs.ucla.edu>
3194
aef3da86
PE
3195 * data/glr.c (b4_shared_declarations): Put start-header first,
3196 before any #includes that we generate, so that feature-test
3197 macros work. Problem reported by Michael Deutschmann in
3198 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
3199 * data/lalr1.cc: Likewise.
3200 * doc/bison.texinfo (Prologue): Document that feature-test macros
3201 should be defined before any Bison declarations.
3202 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
3203 that depend on location.hh after, not before, Bison decls, since
3204 we now include location.hh after the first user prologue.
3205
3dc5e96b
PE
3206 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
3207 Sander Brandenburg in
3208 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
3209 Also, fix minor white space and comment issues.
aef3da86
PE
3210 (Prologue): Mention that it's better to define feature-test macros
3211 before Bison declarations. Problem reported by Michael Deutschmann.
3212
3213 * README-cvs: Fix typo: "&" should be "&&". Problem reported
3214 by Jim Meyering.
3215 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
3216 This adjusts to recent gnulib changes.
3dc5e96b 3217
b2a0b7ca
JD
32182006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3219
3220 Finish implementation of per-type %destructor/%printer. Discussed
3221 starting at
3222 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
3223 and
3224 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
3225 * NEWS (2.3+): Add a description of this feature to the default
3226 %destructor/%printer description.
3227 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
3228 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3229 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
3230 list node contains a semantic type.
3231 * src/symtab.c, src/symtab.h: Extend with a table that associates
3232 semantic types with their %destructor's and %printer's.
3233 (semantic_type_from_uniqstr, semantic_type_get,
3234 semantic_type_destructor_set, semantic_type_printer_set): New functions
3235 composing the public interface of that table.
3236 (symbol_destructor_get, symbol_destructor_location_get,
3237 symbol_printer_get, symbol_printer_location_get): If there's no
3238 per-symbol %destructor/%printer, look up the per-type before trying
3239 the default.
3240 * tests/actions.at (Per-type %printer and %destructor): New test case.
3241 * tests/input.at (Default %printer and %destructor redeclared):
3242 Extend to check that multiple occurrences of %symbol-default in a
3243 single %destructor/%printer declaration is an error.
3244 (Per-type %printer and %destructor redeclared, Unused values with
3245 per-type %destructor): New test cases.
3246
3be03b13
JD
32472006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3248
3249 Require default %destructor/%printer to be declared using
3250 %symbol-default instead of an empty symbol list, and start working on
3251 new per-type %destructor/%printer. Discussed at
3252 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
3253 * NEWS (2.3+): Add %symbol-default to example.
3254 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 3255 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
3256 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
3257 (generic_symlist, generic_symlist_item): New nonterminals for creating
3258 a list in which each item is a symbol, semantic type, or
3259 %symbol-default.
3260 (grammar_declaration): Use generic_symlist in %destructor and %printer
3261 declarations instead of symbols.1 or an empty list.
3262 (symbol_declaration, precedence_declaration, symbols.1): Update actions
3263 for changes to symbol_list.
3264 * src/reader.c: Update for changes to symbol_list.
3265 * src/scan-code.l: Likewise.
3266 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
3267 * src/symlist.c, src/symlist.h: Extend such that a list node may
3268 represent a semantic type or a %symbol-default in addition to just an
3269 ordinary symbol. Add switched functions for setting %destructor's and
3270 %printer's.
3271 * tests/actions.at, tests/input.at: Add %symbol-default to all default
3272 %destructor/%printer declarations.
3273
3508ce36
JD
32742006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
3275
3276 Whether the default %destructor/%printer applies to a particular symbol
3277 isn't a question of whether the user *declares* that symbol (in %token,
3278 for example). It's a question of whether the user by any means
3279 *defines* the symbol at all (by simply using a char token, for
3280 example). $end is defined by Bison whereas any other token with token
3281 number 0 is defined by the user. The error token is always defined by
3282 Bison regardless of whether the user declares it with %token, but we
3283 may one day let the user define error as a nonterminal instead.
3284 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
3285 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
3286 the meaning of "user-defined".
3287 * tests/actions.at (Default %printer and %destructor for user-declared
3288 end token): Rename to...
3289 (Default %printer and %destructor for user-defined end token): ...
3290 this.
3291
3292 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
3293 computation of whether to apply the default, don't maintain a list of
3294 every Bison-defined symbol. Instead, just check for a first character
3295 of '$', which a user symbol cannot have, and check for the error token.
3296
9350499c
JD
32972006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
3298
3299 Don't apply the default %destructor or %printer to the error token,
3300 $undefined, or $accept. This change fits the general rule that the
3301 default %destructor and %printer are only for user-declared symbols,
3302 and it solves several difficulties that are described in the new test
3303 cases listed below.
3304 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
3305 * tests/actions.at (Default %printer and %destructor are not for error
3306 or $undefined, Default %printer and %destructor are not for $accept):
3307 New test cases.
3308
4d7370cb
JD
33092006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
3310
3311 Allow %start after the first rule.
3312 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
3313 when parsing the first rule.
3314 (check_and_convert_grammar): Search for it here after all grammar
3315 declarations have been parsed. Skip midrules, which have dummy LHS
3316 nonterminals.
3317 * src/symtab.c (symbol_is_dummy): New function.
3318 * src/symtab.h (symbol_is_dummy): Declare it.
3319 * tests/input.at (%start after first rule): New test.
3320
6d0ef4ec
JD
33212006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3322
3323 Redo some of the previous commit: add back the ability to use
3324 non-aliased/undeclared string literals since it might be useful to
3325 those declaring %token-table.
3326 * src/reader.c (check_and_convert_grammar): Undo changes in previous
3327 commit: don't worry about complaints from symbols_pack.
3328 * src/symtab.c (symbol_new, symbol_class_set,
3329 symbol_check_alias_consistency): Undo changes in previous commit: count
3330 each string literal as a new symbol and token, assign it a symbol
3331 number, and don't complain about non-aliased string literals.
3332 (symbols_pack): Since symbol_make_alias still does not decrement symbol
3333 and token counts but does still set aliased tokens to the same number,
3334 symbol_pack_processor now leaves empty slots in the symbols array.
3335 Remove those slots.
3336 * tests/regression.at (Undeclared string literal): Remove test case
3337 added in previous commit since non-aliased string literals are allowed
3338 again.
3339 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
3340 remove unnecessary string literal declarations.
3341 * tests/sets.at (Firsts): Likewise.
3342
965537bc
JD
33432006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3344
3345 Don't allow an undeclared string literal, but allow a string literal to
3346 be used before its declaration.
3347 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
3348 symbols_pack complained.
3349 * src/symtab.c (symbol_new): Don't count a string literal as a new
3350 symbol.
3351 (symbol_class_set): Don't count a string literal as a new token, and
3352 don't assign it a symbol number since symbol_make_alias does that.
3353 (symbol_make_alias): It's not necessary to decrement the symbol and
3354 token counts anymore. Don't assume that an alias declaration occurs
3355 before any uses of the identifier or string, and thus don't assert that
3356 one of them has the highest symbol number so far.
3357 (symbol_check_alias_consistency): Complain if there's a string literal
3358 that wasn't declared as an alias.
3359 (symbols_pack): Bail if symbol_check_alias_consistency failed since
3360 symbol_pack asserts that every token has been assigned a symbol number
3361 although undeclared string literals have not.
3362 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 3363 string literal): New test cases.
965537bc
JD
3364 (Characters Escapes, Web2c Actions): Declare string literals as
3365 aliases.
3366 * tests/sets.at (Firsts): Likewise.
3367
47aee066
JD
33682006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
3369
3370 In the grammar scanner, STRING_FINISH unclosed constructs and return
3371 them to the parser in order to improve error messages.
3372 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
3373 SC_BRACED_CODE, SC_PROLOGUE): Implement.
3374 * tests/input.at (Unclosed constructs): New test case.
3375 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
3376 seen.
3377
3378 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
3379 unused global.
3380
1f6b3679
JD
33812006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
3382
3383 Handle string aliases for character tokens correctly.
3384 * src/symtab.c (symbol_user_token_number_set): If the token has an
3385 alias, check and set its alias's user token number instead of its own,
3386 which is set to indicate the alias. Previously, every occurrence of
3387 the character token in the grammar overwrote that alias indicator with
3388 the character code.
3389 * tests/input.at (String aliases for character tokens): New test.
3390
219741d8
JD
33912006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
3392
3393 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
3394
11daa4e7
PE
33952006-08-11 Paul Eggert <eggert@cs.ucla.edu>
3396
3397 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
3398 to prevent failures when building on older platforms.
3399 Check for autopoint failure.
3400 Set XGETTEXT_OPTIONS to values that check for C format strings,
3401 so that translators are warned about them (this also helps
3402 prevent core dumps).
3403
3404 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
3405 function, since it simplifies our code a bit.
3406
3407 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
3408 rather than -W, so we don't get bogus warnings about sign comparisons.
3409 Add -Wpointer-arith, since that warning is useful (it reports code
3410 that does not conform to C89 and that some compilers reject).
3411 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
3412 since it's no longer needed.
3413
f9bfc42a
JD
34142006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
3415
3416 Clean up scanners a bit.
3417 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
3418 definitions so gcc won't warn when obstack_for_string is unused.
3419 * src/scan-code.l: config.h and system.h are already #include'd by
3420 scan-code-c.c, so get rid of them here.
3421 * src/scan-gram.l: Likewise.
3422 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
3423 definitions rather than duplicating the rest of it.
3424 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
3425
06e8700a
JD
34262006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
3427
3428 Suppress signed/unsigned comparison warnings for yycheck.
3429 * data/c.m4 (b4_safest_int_type): New macro.
3430 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
3431 a signed int type, cast it to b4_safest_int_type first.
3432 * data/yacc.c: Likewise.
3433 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
3434 also overwritten.
3435
9c437126
PE
34362006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3437
3438 * doc/bison.texinfo: Fix some typos.
3439
284d8a13
PE
34402006-08-02 Paul Eggert <eggert@cs.ucla.edu>
3441
3442 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
3443 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
3444
3445 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
3446 the latest gnulib does this a different way.
3447 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
3448 translation was patched, so stop omitting it.
3449
ec5479ce
JD
34502006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3451
3452 Enable declaration of default %printer/%destructor. Make the parser
3453 use these for all user-declared grammar symbols for which the user does
3454 not declare a specific %printer/%destructor. Thus, the parser uses it
3455 for token 0 if the user declares it but not if Bison generates it as
3456 $end. Discussed starting at
3457 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
3458 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
3459 and
3460 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
3461 * NEWS (2.3+): Mention.
3462 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
3463 declare a %destructor for a mid-rule's semantic value. It's just
3464 impossible to declare one specific to it.
3465 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
3466 code. Describe default %destructor form.
3467 * src/parse-gram.y (grammar_declaration): Parse default
3468 %printer/%destructor declarations.
3469 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
3470 and symbol_destructor_location_get rather than accessing the destructor
3471 and destructor_location members of struct symbol.
3472 (symbol_printers_output): Likewise but for %printer's.
3473 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
3474 again.
3475 * src/symtab.c (default_destructor, default_destructor_location,
3476 default_printer, default_printer_location): New static global
3477 variables to record the default %destructor and %printer.
3478 (symbol_destructor_get, symbol_destructor_location_get,
3479 symbol_printer_get, symbol_printer_location_get): New functions to
3480 compute the appropriate %destructor and %printer for a symbol.
3481 (default_destructor_set, default_printer_set): New functions to set the
3482 default %destructor and %printer.
3483 * src/symtab.h: Prototype all those new functions.
3484 * tests/actions.at (Default %printer and %destructor): New test to
3485 check that the right %printer and %destructor are called, that they're
3486 not called for $end, and that $$ and @$ work correctly.
3487 (Default %printer and %destructor for user-declared end token): New
3488 test to check that the default %printer and %destructor are called for
3489 a user-declared end token.
3490 * tests/input.at (Default %printer and %destructor redeclared, Unused
3491 values with default %destructor): New tests to check related grammar
3492 warnings and errors.
3493
868d2d96
JD
34942006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3495
3496 Clean up handling of %destructor for the end token (token 0).
3497 Discussed starting at
3498 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
3499 and
3500 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
3501
3502 Make the skeletons consistent in how they pop the end token and invoke
3503 its %destructor.
3504 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
3505 state, which has token number 0, since this would invoke the
3506 %destructor for the end token.
3507 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
3508 until after shifting the end token, or else it won't be popped.
3509 * data/yacc.c (yyparse): Likewise.
3510
3511 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
3512 it's the end token. Upon termination, destroy an unshifted lookahead
3513 even when it's the end token.
3514 * data/lalr1.cc (yy::parser::parse): Likewise.
3515 * data/yacc.c (yyparse): Likewise.
3516
3517 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
3518 value warnings for the end token when the user gives the end token a
3519 %destructor.
3520
3521 * tests/actions.at (Printers and Destructors): Test all the above.
3522
62a9592d
PE
35232006-07-24 Paul Eggert <eggert@cs.ucla.edu>
3524
3525 Update to latest gnulib and gettext versions.
3526 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
3527 Add fopen-safer.
3528 (gnulib_files): Add m4/warning.m4. Don't worry about files
3529 overwritten by autopoint.
3530 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
3531 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
3532 rejects them.
3533 Don't use autoreconf; instead, invoke autopoint etc. by hand,
3534 so that we can remove the intl files at a better time.
3535 (intl_files_to_remove): Remove aclocal.m4, since it gets
3536 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
3537 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
3538 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
3539 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
3540 Remove datarootdir hack; no longer needed.
3541 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
3542 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
3543 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
3544 strdup.h.
3545 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
3546 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
3547
10d6970f
PE
35482006-07-20 Paul Eggert <eggert@cs.ucla.edu>
3549
3550 * bootstrap: Adjust to today's change to gnulib-tool by invoking
3551 it with --assume-autoconf='latest-stable'.
3552
50a33993
JD
35532006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
3554
3555 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
3556 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
3557 YYSTYPE' and `{'.
3558 * src/muscle_tab.h (muscle_grow): Replace the header comments with
3559 those from muscle_tab.c since the old ones are misleading.
3560
2ce4ed68
AD
35612006-07-13 Akim Demaille <akim@epita.fr>
3562
3563 Support %define "KEY" {VALUE}.
3564 * src/scan-code.h, src/scan-code.l (translate_action)
3565 (translate_rule_action, translate_symbol_action, translate_code):
3566 Return char *, not const char *.
3567 * src/parse-gram.y (declaration): Rename as...
3568 (prologue_declaration): this.
3569 (string_content): Remove this nonterminal, use STRING.
3570 (braceless, content, content.opt): New nonterminal.
3571 Use them.
3572 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
3573 as value.
3574 * src/scan-gram.l (getargs.h): Don't include it.
3575
db7e5eb5
PE
35762006-07-12 Paul Eggert <eggert@cs.ucla.edu>
3577
3578 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
3579 rather than a for-loop that declares a local bool variable. This
3580 should work around a compatibility problem with a Cray x1e C++
3581 compiler reported by Hung Nguyen in
3582 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
3583 The for-loop was introduced in the 2004-11-17 change but I don't
3584 know why it was needed.
3585
a5d80ba5
AD
35862006-07-12 Akim Demaille <akim@epita.fr>
3587
3588 * data/c.m4: Comment changes.
3589
23eb2a69
AD
35902006-07-10 Akim Demaille <akim@lrde.epita.fr>
3591
3592 * src/complain.c (error_message, ERROR_MESSAGE): New.
3593 To factor...
3594 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
3595 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
3596
ddc8ede1
PE
35972006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3598
3599 * NEWS: Instead of %union, you can define and use your own union type
3600 YYSTYPE if your grammar contains at least one <type> tag.
3601 Your YYSTYPE need not be a macro; it can be a typedef.
3602 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
3603 (Union Decl, Decl Summary): Document this.
3604 * data/glr.c (YYSTYPE): Implement this.
3605 * data/glr.cc (YYSTYPE): Likewise.
3606 * data/lalr1.cc (YYSTYPE): Likewise.
3607 * data/yacc.c (YYSTYPE): Likewise.
3608 * src/output.c (prepare): Output tag_seen_flag.
3609 * src/parse-gram.y (declaration, grammar_declaration):
3610 Use 'union_seen' rather than 'typed' to determine whether
3611 %union has been seen, since grammars can now be typed without
3612 %union.
3613 (symbol_declaration, type.opt, symbol_def):
3614 Keep track of whether a tag has been seen.
3615 * src/reader.c (union_seen, tag_seen): New vars.
3616 (typed): remove.
3617 * src/reader.h (union_seen, tag_seen, typed): Likewise.
3618 * src/scan-code.l (untyped_var_seen): New variable.
3619 (handle_action_dollar): Adjust to above changes.
3620 (handle_action_dollar, handle_action_at):
3621 Improve overflow checking for outlandish numbers.
3622 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
3623 avoid new diagnostics generated by above changes.
3624 * tests/regression.at (YYSTYPE typedef): Add test to check
3625 for type tags without %union.
3626
3627 * src/symlist.c (symbol_list_length): Return int, not unsigned
3628 int, since callers expect int. This may need to get revisited
3629 once we have proper integer overflow checking.
3630
3631 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
3632 object is now static.
3633
3634 * src/getargs.c (flags_argmatch): Return void, not int,
3635 to pacify ./configure --enable-gcc-warnings.
3636
3637 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
3638 since last_string is already defined to FLEX_PREFIX (last_string).
3639
7b42569e
AD
36402006-07-09 Akim Demaille <akim@lrde.epita.fr>
3641
3642 Implement --warnings/-W.
3643 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
3644 replaced by...
3645 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
3646 Adjust callers.
3647 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
3648 (warnings_args, warnings_types): New.
3649 (getargs, short_options, long_options): Accept -W/--warnings.
3650 Sort the options by alphabetical order, upper case letter right
3651 before its lower case.
3652
3b452f4e
JD
36532006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3654
3655 Change %merge result type clash warnings to errors. Discussed at
3656 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
3657 * src/reader.c (record_merge_function_type): Use complain_at.
3658 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3659 declared later): Update test case results.
3660
b8a41559
AD
36612006-07-09 Akim Demaille <akim@lrde.epita.fr>
3662
3663 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
3664 to be in alphabetical order.
3665 (trace_args): Spelling fixes.
3666
cd9e1ba2
PE
36672006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3668
3669 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
3670 so they don't collide with user-defined macros.
3671 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
3672 this was never guaranteed, and now that we're using gnulib stdint,
3673 which defines int_fast16_t to long int, the problem is exposed.
3674
cb48f191
PE
36752006-07-08 Paul Eggert <eggert@cs.ucla.edu>
3676
b8445a15
PE
3677 * data/c.m4 (b4_basename): Simplify a bit, since we don't
3678 need the full POSIX semantics (and weren't implementing them
3679 anyway).
3680
cb48f191
PE
3681 Adjust to Autoconf 2.60 and today's gnulib.
3682 * bootstrap (gnulib_modules): Add stdint.
3683 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
3684 no longer copies it.
3685 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
3686 since stdint needs the former and wcwidth (which is now required
3687 by mbswidth) needs the latter.
3688 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
3689 work around a compatibility glitch between gettext 0.14.6 and
3690 Autoconf 2.60.
3691 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
3692 Do not check for uintptr_t, since new stdint module does the right
3693 thing.
3694 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
3695 Add stdint.h, stdint_.h, wcwidth.h.
3696 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
3697 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
3698 stdint.m4, wchar_t.m4, wcwidth.m4.
3699 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
3700 usual order for ../lib/*.h files.
3701 (file_name_split): Use last_component, not base_name, to adjust
3702 to gnulib changes.
3703 * src/parse-gram.h: Include <strverscmp.h> in the usual order
3704 for ../lib/*.h files.
3705 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
3706 Define unconditionally, since we now assume the stdint module.
3707 * src/scan-skel.l: Include <dirname.h>.
3708 (BASE_QPUTS): Use last_component, not base_name.
3709 * src/system.h: Include <unlocked-io.h> in the usual order
3710 for ../lib/*.h files. Include <stdint.h> unconditionally,
3711 since we now use the stdint module.
3712 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
3713 HAVE_UINTPTR_T, since we now use the stdint module.
3714 (base_name): Remove decl, since files now include <dirname.h>
3715 to get the decl.
3716
cd48d21d
AD
37172006-07-08 Akim Demaille <akim@lrde.epita.fr>
3718
3719 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
3720 New, default to 1.
3721 * data/yacc.c, data/glr.c, data/location.cc: Use them.
3722 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
3723 default.
3724 * tests/calc.at: Adjust.
3725
8ec0a172
AD
37262006-07-08 Akim Demaille <akim@lrde.epita.fr>
3727
b8445a15 3728 * data/c.m4 (b4_basename): New.
8ec0a172
AD
3729 (b4_syncline): Also output the location of its invocation (from
3730 the skeleton).
3731 (b4_user_action, b4_define_user_action, b4_user_actions)
3732 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
3733 (b4_user_stype): New.
3734 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
3735
4a678af8
JD
37362006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3737
3738 In the grammar file, the first column is 1 not 0 on the first line as
3739 on every other line.
3740 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
3741 * tests/input.at (Torturing the Scanner): Update output.
3742
3743 * src/scan-gram.l (scanner_cursor): Declare it static.
3744
dd60572a
JD
37452006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3746
3747 In warnings, say "previous declaration" rather than "first
3748 declaration".
3749 * src/symtab.c (redeclaration): Do that here.
3750 * src/reader.c (record_merge_function_type): In the case of a result
3751 type clash, report the previous declaration rather than the very first
3752 one in the grammar file.
3753 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3754 declared later): Add a third declaration to check this behavior.
3755 * tests/input.at (Incompatible Aliases): Update output.
3756
2073e1b6
AD
37572006-06-27 Akim Demaille <akim@epita.fr>
3758
3759 * doc/Doxyfile.in: New.
3760 * doc/Makefile.am: Use it.
3761 * src/lalr.h, src/symtab.h: Initial doxygenation.
3762
8ee5b538
JD
37632006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3764
3765 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
3766 declared after the %merge. This continues the effort of the previous
3767 patch.
8ee5b538
JD
3768 * src/reader.c (get_merge_function): Don't set the merger type yet.
3769 (record_merge_function_type): New function for setting the merger type
3770 and checking for clashes.
3771 (grammar_current_rule_merge_set): Set the location of the %merge for
3772 the current rule.
3773 (packgram): Invoke record_merge_function_type for each rule now that
3774 all symbol type declarations have been parsed.
3775 * src/reader.h (merger_list.type_declaration_location): New member
3776 storing the location of the first %merge from which the type for this
3777 merging function was derived.
3778 * src/symlist.h (symbol_list.merger_declaration_location): New member
3779 storing the location of a rule's %merge, if any.
3780 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3781 declared later): New test to catch the error fixed by the above patch.
3782
ffa4ba3a
JD
37832006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3784
3785 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
3786 declarations appear after the rules. Discussed at
3787 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
3788 and
3789 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
3790 Don't mistake the type of $$ in a midrule to be that of its parent
3791 rule's $$.
ffa4ba3a
JD
3792 * src/reader.c (grammar_current_rule_end): Don't invoke
3793 grammar_rule_check yet since not all symbol declarations may have been
3794 parsed yet.
3795 (grammar_midrule_action): Likewise.
3796 Don't record whether the midrule's $$ has been used yet since actions
3797 haven't been translated yet.
3798 Record the midrule's parent rule and its RHS index within the parent
3799 rule.
3800 (grammar_current_rule_action_append): Don't translate the action yet
3801 since not all symbol declarations may have been parsed yet and, thus,
3802 warnings about types for $$, $n, @$, and @n can't be reported yet.
3803 (packgram): Translate the action and invoke grammar_rule_check now that
3804 all symbol declarations have been parsed.
3805 * src/scan-code.l (handle_action_dollar): Now that this is invoked
3806 after parsing the entire grammar file, the symbol list here in the case
3807 of a midrule is actually the midrule's empty RHS, so reference its
3808 parent rule's RHS where necessary.
3809 On the other hand, now that you can already know it's a midrule, you
3810 aren't forced to think $$ has the same type as its parent rule's $$.
3811 (handle_action_at): In the case of a midrule, reference the parent rule
3812 where necessary.
3813 * src/symlist.c (symbol_list_new): Initialize new midrule-related
3814 members.
3815 (symbol_list_length): Now that this is invoked after all rules have
3816 been parsed, a NULL symbol (rather than a NULL symbol list node)
3817 terminates a rule. symbol_list_print already does this correctly.
3818 * src/symlist.h (symbol_list.midrule_parent_rule,
3819 symbol_list.midrule_parent_rhs_index): New members so that midrules can
3820 remember their relationships with their parents.
3821 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
3822 fixed by the above patch.
3823 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
3824 implementing...
3825 (Unused values): ... this old test case and...
3826 (Unused values before symbol declarations): ... this new test case.
3827 This one is the same as `Unused values' except that all symbol
3828 declarations appear after the rules in order to catch the rest of the
3829 errors fixed by the above patch.
3830
e256e17f
JD
38312006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3832
300a1930
JD
3833 More cleanup.
3834 * src/reader.c (current_rule): Declare it static since it's no longer
3835 used outside this file.
3836 (grammar_current_rule_action_append): Remove redundant arguments from
3837 translate_rule_action invocation.
3838 * src/reader.h (current_rule): Remove this unused extern.
3839 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
3840 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 3841
381ecb06
JD
38422006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
3843
3844 Clean up yesterday's patch.
3845 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
3846 to...
3847 * src/reader.c (grammar_current_rule_action_append): ... here for
3848 consistency with grammar_current_rule_symbol_append.
3849 * tests/regression.at (Braced code in declaration in rules section):
3850 Make yyerror and yylex static as usual.
3851
4210cd0b
JD
38522006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
3853
3854 Fix bug that mistakes braced code in a declaration in the rules section
3855 to be a rule action. Mentioned at
3856 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
3857 * src/scan-gram.l: Move midrule action detection from the start of the
3858 scanning of any braced code to...
3859 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
3860 action. For readability, use $2 and @2 rather than the equivalent
3861 global variables.
3862 * tests/regression.at (Braced code in declaration in rules section):
3863 New test to catch the error fixed by the above patch.
3864
3865 Work on code readability some.
3866 * src/scan-code.l (current_rule): Get rid of this misleading and
3867 redundant declaration: it's actually extern'ed in reader.h.
3868 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
3869 translate_action): Add a rule argument and use it instead of the global
3870 current_rule.
3871 (translate_rule_action): This already receives current_rule through an
3872 argument, so pass it on to translate_action instead of assigning
3873 current_rule to current_rule.
3874 (translate_symbol_action, translate_code): Pass rule = NULL to
3875 translate_action.
3876
34f98f46
JD
38772006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
3878
3879 Rename %before-definitions to %start-header and %after-definitions to
3880 %end-header. Don't use these declarations to separate pre-prologue
3881 blocks from post-prologue blocks. Add new order-independent
3882 declarations %before-header and %after-header as alternatives to the
3883 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
3884 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
3885 * NEWS (2.3+): Update for these changes.
3886 * data/glr.c (b4_before_definitions): Update to...
3887 (b4_start_header): ... this.
3888 (b4_after_definitions): Update to...
3889 (b4_end_header): ... this.
3890 * data/glr.cc: Likewise.
3891 * data/lalr1.cc: Likewise.
3892 * data/yacc.c: Likewise.
3893 * doc/bison.texinfo (The prologue): Update names, and replace remaining
3894 prologue blocks with %*-header declarations.
3895 (Calc++ Parser): Likewise.
91661ebb 3896 (Decl Summary): Update names.
148d66d8 3897 (Table of Symbols): Update description.
34f98f46
JD
3898 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
3899 (PERCENT_END_HEADER): ... this.
3900 (PERCENT_BEFORE_DEFINITIONS): Update to...
3901 (PERCENT_START_HEADER): ... this.
3902 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
3903 (declaration): Update token names and m4 macro names.
3904 When parsing %end-header and %start-header, invoke translate_code
3905 before muscle_code_grow, and no longer set global booleans to remember
3906 whether these declarations have been seen.
3907 Parse new %after-header and %before-header.
3908 * src/reader.c (before_definitions, after_definitions): Remove.
3909 (prologue_augment): Accept a new bool argument to specify whether to
3910 augment the pre-prologue or post-prologue.
3911 * src/reader.h (before_definitions, after_definitions): Remove these
3912 extern's.
3913 (prologue_augment): Add new bool argument.
3914 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
3915 (PERCENT_END_HEADER): ... this.
3916 (PERCENT_BEFORE_DEFINITIONS): Update to...
3917 (PERCENT_START_HEADER): ... this.
3918 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
3919 * tests/actions.at (Printers and Destructors): Update names.
3920
31b2b07e
JD
39212006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
3922
3923 Add comparison operators for C++ location classes. Discussed at
3924 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
3925 * data/c++.m4 (b4_define_location_comparison): New boolean %define
3926 declaration indicating whether filename_type has an operator==. If
3927 filename_type is `std::string', it defaults to `1', `0' otherwise.
3928 * data/location.cc: Iff b4_define_location_comparison is `1', add
3929 operator== and operator!= for class position and for class location.
3930
3931 Some minor fixes.
3932 * src/scan-action.l: Remove unused file.
3933 * src/symtab.c (symbol_printer_set): Use printer_location not
3934 destructor_location.
3935 * src/symtab.h (struct symbol): Replace incorrect source comment for
3936 printer members.
3937 * tests/input.at (Incompatible Aliases): Update output with correct
3938 printer location.
3939
9bc0dd67
JD
39402006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
3941
3942 Don't put the pre-prologue in the header file. For the yacc.c code
3943 file and the glr.c header and code files, move the pre-prologue before
3944 the token definitions. Add new %before-definitions and
3945 %after-definitions to declare code that will go in both the header file
3946 and code file. Discussed at
3947 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
3948 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
3949 and
3950 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
3951 * NEWS (2.3+): Describe these changes.
3952 * data/glr.c (b4_pre_prologue): Move from within to before...
3953 (b4_shared_declarations): ... this.
3954 Add new b4_before_definitions before b4_token_enums.
3955 Add new b4_after_definitions at the end.
3956 * data/glr.cc (b4_pre_prologue): Replace with...
3957 (b4_before_definitions): ... this in the header file.
3958 (b4_after_definitions): New near the end of the header file.
3959 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
3960 code file right before including the header file.
3961 (b4_before_definitions): New in the previous position of
3962 b4_pre_prologue in the header file.
3963 (b4_after_definitions): New near the end of the header file.
3964 * data/yacc.c: Clean up some m4 quoting especially in the header file.
3965 (b4_token_enums_defines): In the code file, move to right before
3966 YYSTYPE for consistency with the header file.
3967 (b4_before_definitions): New right before b4_token_enums_defines in
3968 both the header and code file.
3969 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
3970 header and code file.
3971 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
3972 of prologues for %union dependencies.
91661ebb
JD
3973 (Decl Summary): In %defines description, mention the effect of
3974 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
3975 (Calc++ Parser): Forward declare driver in a %before-definitions rather
3976 than in the pre-prologue so that make check succeeds.
148d66d8 3977 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
3978 %after-definitions.
3979 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
3980 %before-definitions.
3981 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
3982 (declaration): Parse those declarations and append to
3983 b4_before_definitions and b4_after_definitions, respectively.
3984 * src/reader.c (before_definitions, after_definitions): New bools to
3985 track whether those declarations have been seen.
3986 (prologue_augment): Add to the post-prologue if %union,
3987 %before-definitions, or %after-definitions has been seen.
3988 * src/reader.h (before_definitions, after_definitions): New extern's.
3989 * src/scan-gram.l: Scan the new declarations.
3990 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
3991 prologue block in a %before-definitions or a %after-definitions based
3992 on whether the %union is declared.
3993 * tests/regression.at (Early token definitions with --yacc, Early token
3994 definitions without --yacc): Move tests for token definitions into the
3995 post-prologue since token names are no longer defined in the
3996 pre-prologue.
3997
203b9274
AD
39982006-06-20 Akim Demaille <akim@epita.fr>
3999
4000 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
4001 (symbol_get): Use it.
4002 * src/parse-gram.y: Use it.
4003
a7ee59cf
JD
40042006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
4005
4006 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
4007 build succeeds when configured with --enable-gcc-warnings.
4008
5a2baae7
PE
40092006-06-19 Paul Eggert <eggert@cs.ucla.edu>
4010
33ad1a9c
PE
4011 * src/parse-gram.y (char_name): New function.
4012 (CHAR, STRING, string_content): For %printer, properly escape.
4013 (ID): Prefer fputs to fprintf.
4014 (id): Reindent to be consistent with other rules.
4015 Properly quote char.
4016
5a2baae7
PE
4017 The Translation Project changed its way of publishing translations
4018 to maintainers. I haven't received any responses to my request
4019 for supporting the old way, or for documenting the new way. I
4020 have modified 'bootstrap' to use screen scraping
4021 (in this case, HTML scraping). This is unreliable and inelegant,
4022 but I don't see any better way. Yuck.
4023 * bootstrap (TP_URL, WGET_COMMAND): New vars.
4024 (get_translations): New function, which uses HTML scraping to
4025 deduce locations of latest translations.
4026 Use this function to grab both bison and bison-runtime .po files.
4027 Don't bother priming the pump for the runtime-po domain any more,
4028 as it's now translated better than bison is.
4029
58d7a1a1
AD
40302006-06-19 Akim Demaille <akim@epita.fr>
4031
4032 * src/scan-gram.l: No longer "parse" things after `%union' until
4033 `{'. Rather, return a single "%union" token.
4034 No longer make symbols: return strings, and leave the conversion
4035 to symbols to the parser.
4036 (SC_PRE_CODE, token_type): Remove.
4037 * src/parse-gram.y (%union): New field `character'.
4038 Sort tokens.
4039 (CHAR): New token.
4040 (ID, ID_COLON): Now that the scanner no longer makes them
4041 identifiers, adjust all uses to invoke symbol_get.
4042 (id_colon): New, wraps the conversion from string to symbol.
4043 (%union): Accept a possible union_name.
4044 (symbol): Now can be a char.
4045 * data/c.m4 (b4_union_name): Leave a default value.
4046 * data/glr.c, data/yacc.c: Use it.
4047
b931235e
JD
40482006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
4049
4050 For associating token numbers with token names for "yacc.c", don't use
4051 #define statements unless `--yacc' is specified; always use enum
4052 yytokentype. Most important discussions start at:
4053 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
4054 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
4055 and
4056 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
4057 * NEWS (2.3+): Mention.
4058 * data/c.m4 (b4_yacc_if): New.
4059 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
4060 token #define's.
4061 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
4062 on token name definitions.
4063 * src/getargs.c (usage): Capitalize `Yacc' in English.
4064 * src/output.c (prepare): Define b4_yacc_flag.
4065 * tests/regression.at (Early token definitions): Test that tokens names
4066 are defined before the pre-prologue not just before the post-prologue.
4067 Remove this test case and copy to...
4068 (Early token definitions with --yacc): ... this to test #define's.
4069 (Early token definitions without --yacc): ... and this to test enums.
4070
9e6e7ed2
PE
40712006-06-11 Paul Eggert <eggert@cs.ucla.edu>
4072
4073 * NEWS: Reword the post-2.3 change to not be so optimistic about
4074 removing the old "look-ahead" spelling.
4075 Update previous look-ahead/lookahead change reports.
4076 * REFERENCES: look-ahead -> lookahead (since that's
4077 what he actually wrote).
4078 * doc/refcard.tex: look ahead -> lookahead,
4079 look-ahead -> lookahead
4080
742e4900
JD
40812006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
4082
4083 For consistency, use `lookahead' instead of `look-ahead' or
4084 `look_ahead'. Discussed starting at
4085 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
4086 and then at
4087 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
4088 * NEWS: For the next release, note the change to `--report'.
4089 * TODO, doc/bison.1: Update English.
4090 * doc/bison.texinfo: Update English.
4091 (Understanding Your Parser, Bison Options): Document as
4092 `--report=lookahead' rather than `--report=look-ahead'.
4093 * src/conflicts.c: Update English in comments.
4094 (lookahead_set): Rename from look_ahead_set.
4095 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
4096 (resolve_sr_conflict): Rename local look_ahead_tokens to
4097 lookahead_tokens, and update other uses.
4098 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
4099 count_rr_conflicts, conflicts_free): Update uses.
4100 * src/getargs.c (report_args): Move "lookahead" before alternate
4101 spellings.
4102 (report_types): Update uses.
4103 (usage): For `--report' usage description, state `lookahead' spelling
4104 rather than `look-ahead'.
4105 * src/getargs.h (report.report_lookahead_tokens): Rename from
4106 report_look_ahead_tokens.
4107 * src/lalr.c: Update English in comments.
4108 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
4109 (state_lookahead_tokens_count): Rename from
4110 state_look_ahead_tokens_count.
4111 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4112 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
4113 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4114 Update other uses.
4115 Update English in output.
4116 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
4117 * src/print.c: Update English in comments.
4118 (lookahead_set): Rename from look_ahead_set.
4119 (print_reduction): Rename argument lookahead_token from
4120 look_ahead_token.
4121 (print_core, state_default_rule, print_reductions, print_results):
4122 Update uses.
4123 * src/print_graph.c: Update English in comments.
4124 (print_core): Update uses.
4125 * src/state.c: Update English in comments.
4126 (reductions_new): Update uses.
4127 (state_rule_lookahead_tokens_print): Rename from
4128 state_rule_look_ahead_tokens_print, and update other uses.
4129 * src/state.h: Update English in comments.
4130 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
4131 (state_rule_lookahead_tokens_print): Rename from
4132 state_rule_look_ahead_tokens_print.
4133 * src/tables.c: Update English in comments.
4134 (conflict_row, action_row): Update uses.
4135 * tests/glr-regression.at
4136 (Incorrect lookahead during deterministic GLR,
4137 Incorrect lookahead during nondeterministic GLR): Rename
4138 print_look_ahead to print_lookahead.
4139 * tests/torture.at: Update English in comments.
4140 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
4141 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
4142 (Many lookahead tokens): Update uses.
4143 * data/glr.c: Update English in comments.
4144 * lalr1.cc: Likewise.
4145 * yacc.c: Likewise.
4146 * src/conflicts.h: Likewise.
4147 * src/lalr.h: Likewise.
4148 * src/main.c: Likewise.
4149 * src/output.c: Likewise.
4150 * src/parse-gram.c: Likewise.
4151 * src/tables.h: Likewise.
4152 * tests/calc.at: Likewise.
4153
3c40d0b5
JD
41542006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
4155
4156 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
4157
5d278082
PE
41582006-06-07 Paul Eggert <eggert@cs.ucla.edu>
4159
4160 * TODO: Add request from Nelson H. F. Beebe to be able to install
4161 Bison without installing the yacc script.
4162
9e668899
JD
41632006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4164
4165 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
4166 and yytext if they're already #define'd.
4167 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
4168 * src/scan-code-c.c: ... here.
4169 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
4170 <config.h>.
4171
0c8e079f
JD
41722006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4173
4174 Get Bison to build again when configured with --enable-gcc-warnings.
4175 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
4176 missing #include's.
4177 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
4178 loc argument as it shadows a global.
4179 * src/scan-gram.l: Remove stray comma that prevents boundary_set
4180 invocation.
4181
4182 * src/.cvsignore: Add scan-code.c.
4183
2346344a
AD
41842006-06-07 Akim Demaille <akim@epita.fr>
4185
4186 * src/scan-gram.l: Move the "add a trailing ; to actions" code
4187 to...
4188 * src/scan-code.l: here.
4189 * tests/input.at (Torturing the Scanner): Fix another location
4190 error.
4191
4862bdfd
AD
41922006-06-07 Akim Demaille <akim@epita.fr>
4193
4194 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
4195
e9071366
AD
41962006-06-06 Akim Demaille <akim@epita.fr>
4197
4198 Extract the parsing of user actions from the grammar scanner.
4199 As a consequence, the relation between the grammar scanner and
4200 parser is much simpler. We can also split "composite tokens" back
4201 into simple tokens.
4202 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
4203 * src/scan-gram.l (add_column_width, adjust_location): Move to and
4204 rename as...
4205 * src/location.h, src/location.c (add_column_width)
4206 (location_compute): these.
4207 Fix the column count: the initial column is 0.
4208 (location_print): Be robust to ending column being 0.
4209 * src/location.h (boundary_set): New.
4210 * src/main.c: Adjust to scanner_free being renamed as
4211 gram_scanner_free.
4212 * src/output.c: Include scan-code.h.
4213 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
4214 Use boundary_set.
4215 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
4216 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
4217 which is now, again, a separate token.
4218 Adjust all dependencies.
4219 Whereever actions with $ and @ are used, use translate_code.
4220 (action): Remove this nonterminal which is now useless.
4221 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
4222 (grammar_current_rule_action_append): Use translate_code.
4223 (packgram): Bound check ruleno, itemno, and rule_length.
4224 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
4225 (last_string, last_braced_code_loc, max_left_semantic_context)
4226 (scanner_initialize, scanner_free, scanner_last_string_free)
4227 (gram_out, gram_lineno, YY_DECL_): Move to...
4228 * src/scan-gram.h: this new file.
4229 (YY_DECL): Rename as...
4230 (GRAM_DECL): this.
4231 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
4232 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4233 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4234 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4235 Move these declarations, and...
4236 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
4237 these to...
4238 * src/flex-scanner.h: this new file.
4239 * src/scan-gram.l (rule_length, rule_length_overflow)
4240 (increment_rule_length): Remove.
4241 (last_braced_code_loc): Rename as...
4242 (gram_last_braced_code_loc): this.
4243 Adjust to the changes of the parser.
4244 Move all the handling of $ and @ into...
4245 * src/scan-code.l: here.
4246 * src/scan-gram.l (handle_dollar, handle_at): Remove.
4247 (handle_action_dollar, handle_action_at): Move to...
4248 * src/scan-code.l: here.
4249 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
4250 scan-code.h, scan-code-c.c, scan-gram.h.
4251 (EXTRA_bison_SOURCES): Add scan-code.l.
4252 (BUILT_SOURCES): Add scan-code.c.
4253 (yacc): Be robust to white spaces.
4254
4255 * tests/conflicts.at, tests/input.at, tests/reduce.at,
4256 * tests/regression.at: Adjust the column numbers.
4257 * tests/regression.at: Adjust the error message.
7891a7c4 4258
184e42f0
JD
42592006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4260
4261 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4262 Use Akim's wording from
4263 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
4264
7891a7c4
JD
42652006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4266
4267 Between Bison releases, manually append `+' to the previous Bison
4268 release number, and use that as a signal to automatically print the
4269 ChangeLog's CVS Id keyword from --version. Discussed starting at
4270 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
4271 * ChangeLog: Add Id header.
4272 * configure.ac (AC_INIT): Append `+' to `2.3'.
4273 * src/.cvsignore: Add revision.c.
4274 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
4275 (BUILT_SOURCES): Add revision.c.
4276 (revision.c): New target rule. This file defines a new global variable
4277 named revision. It initializes it with either the Id from ChangeLog
4278 or, if VERSION doesn't contain `+', with the empty string.
4279 * src/getargs.c (version): Print the value of revision.
4280 * src/revision.h: Extern revision.
4281
4ad3ed84
PE
42822006-06-05 Paul Eggert <eggert@cs.ucla.edu>
4283
4284 * NEWS: Version 2.3.
4285 * configure.ac (AC_INIT): Likewise.
4286
02103984
PE
42872006-05-30 Paul Eggert <eggert@cs.ucla.edu>
4288
4289 * data/glr.c (YYRECOVERING): Define to be a function-like macro
4290 with no arguments, not as an object-like macro. This is for
4291 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
4292 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
4293 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
4294 Document this.
4295
2c08afa5
JD
42962006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
4297
4298 * src/getargs.c (usage): Back out yesterday's modification of the
4299 --help output so that we don't have to wait for translation before
4300 releasing 2.3.
4301
6077da58
PE
43022006-05-29 Paul Eggert <eggert@cs.ucla.edu>
4303
4304 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
4305 Problem reported by Akim Demaille.
4306
2a26b6c2
JD
43072006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4308
4309 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4310
aefef0d6
PE
43112006-05-26 Paul Eggert <eggert@cs.ucla.edu>
4312
4313 * data/yacc.c (yy_reduce_print): Omit trailing white space in
4314 generated source code. Problem reported by Frans Englich in
4315 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
4316
fcd8e201
PE
43172006-05-22 Paul Eggert <eggert@cs.ucla.edu>
4318
4319 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
4320 shell, not within 'make', so that 'make' by an ordinary builder
4321 (using GNU make) does not worry about configuring gzip. This also
4322 works around a bug reported independently by Keith Thompson and by
4323 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
4324 stderr rather than stdout, messing up the build logs.
4325
7b5cdcbd
JD
43262006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4327
4328 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
4329 to make sure that YYID will never be unused. This fixes a 'make
4330 maintainer-check' failure caused by the recent changes to the 'Trivial
4331 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
4332 not used.
4333 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
4334
5ad0a449
JD
43352006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4336
4337 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
4338 state before an empty RHS is always resolved here. Only the location
4339 of that state is guaranteed to be resolved, and that's enough. This
4340 fixes the remaining bug reported by Derek M. Jones in
4341 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4342 * tests/glr-regression.at (Uninitialized location when reporting
4343 ambiguity): Test the above case.
4344 Also, the embedded comments in this test case claim it checks the case
4345 of an empty RHS that has inherited the initial location. However, the
4346 corresponding LHS was already resolved, so yyresolveLocations didn't
4347 actually have reason to modify it. Fix this by forcing
4348 nondeterministic operation at the beginning of the parse.
4349
50cce58e
PE
43502006-05-20 Paul Eggert <eggert@cs.ucla.edu>
4351
4352 * data/c.m4 (b4_yy_symbol_print_generate):
4353 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
4354 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
4355 of the bugs reported today by Derek M Jones in
4356 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4357 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
4358 defined to be a type name without parens or brackets.
4359 (Location Type): Similarly for YYLTYPE.
4360 * tests/regression.at (Trivial grammars): Put in a test for this
4361 bug that will be caught by 'make maintainer-check' (though not,
4362 alas, by 'make check' unless your compiler is picky).
4363
ab8d9dc5
PE
43642006-05-19 Paul Eggert <eggert@cs.ucla.edu>
4365
0d2c8934 4366 * NEWS: Version 2.2.
ab8d9dc5
PE
4367 * configure.ac (AC_INIT): Likewise.
4368
9138c575
JD
43692006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
4370
4371 * data/glr.c (yyreportTree): Make room in yystates for the state
4372 preceding the RHS. This fixes the segmentation fault reported by Derek
4373 M. Jones in
4374 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
4375 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
4376 to the user. Reported for yyreportTree by Derek M. Jones later in the
4377 same thread.
4378 * THANKS: Add Derek M. Jones.
4379 Update my email address.
4380 Fix typo in Steve Murphy's name.
4381
276f48df
PE
43822006-05-14 Paul Eggert <eggert@cs.ucla.edu>
4383
d6645148
PE
4384 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
4385 checking against YYLAST that caused the parser to miss a potential
4386 alternative in its diagnostic.
4387 Problem reported by Maria Jose Moron Fernandez in
4388 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
4389 * data/lalr1.cc (yysyntax_error_): Likewise.
4390 * data/yacc.c (yysyntax_error): Likewise.
4391 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
4392 tokens, in case we run into an older C compiler.
4393 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
4394 Use them to check for the off-by-one error fixed above.
4395
276f48df
PE
4396 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
4397 YYSIZE_T, not size_t.
4398 * tests/regression.at (Trivial grammars): New test, to catch
4399 the error fixed by the above patch.
4400
cd8b5791
AD
44012006-05-14 Akim Demaille <akim@lrde.epita.fr>
4402
4403 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
4404 scheme.
4405 Reported by Steve Murphy.
4406
34376418
AD
44072006-05-14 Akim Demaille <akim@lrde.epita.fr>
4408
4409 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
4410 * data/glr.cc: b4_location_flag is now b4_locations_flag.
4411
327afc7c
AD
44122006-05-14 Akim Demaille <akim@lrde.epita.fr>
4413
4414 Implement --trace=m4.
4415 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
4416 * src/output.c (output_skeleton): When set, pass -dV to m4.
4417
4418 Factor the handling of flags in m4.
4419 * src/output.c (prepare): Rename the muscle names debug, defines,
4420 error_verbose to debug_flag, defines_flag, error_verbose_flag.
4421 * data/c.m4: Adjust.
4422 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
4423 Use b4_define_flag_if to define other b4_FLAG_if macros.
4424 (b4_location_if): As a consequence, rename as...
4425 (b4_locations_if): this, for consistency.
4426 Adjust all the skeletons.
4427
ba9ecd19
AD
44282006-05-14 Akim Demaille <akim@lrde.epita.fr>
4429
4430 * etc/bench.pm: Shorten bench names.
4431
4e83ea15
AD
44322006-05-14 Akim Demaille <akim@lrde.epita.fr>
4433
4434 * src/output.h, src/output.c (error_verbose): Move to...
4435 * src/getargs.h, src/getargs.c: here.
4436 Sort the flags.
4437 Adjust dependencies.
4438
6e93d810
PE
44392006-05-13 Paul Eggert <eggert@cs.ucla.edu>
4440
4441 * data/c.m4 (b4_copyright): Put the special exception for Bison
4442 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
4443 uses changed. Suggested by Akim Demaille. Also, wrap the
4444 copyright notice, in case it is longer than 80 columns. Replace
4445 comma by newline after title.
6e93d810 4446
eaea13f5
PE
44472006-05-11 Paul Eggert <eggert@cs.ucla.edu>
4448
4449 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
4450 incompatibility, not a bug. Mention that it wasn't fixed as of
4451 flex 2.5.33.
4452
3cf084ec
AD
44532006-05-11 Akim Demaille <akim@lrde.epita.fr>
4454
4455 * examples/extexi: Enforce the precedence of concatenation over
4456 >>.
0a9f1c7d 4457 Reported by Tommy Nordgren.
3cf084ec 4458
32c96bd7
AD
44592006-05-11 Akim Demaille <akim@lrde.epita.fr>
4460
4461 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
4462 with the member "token".
f94705b2 4463 Reported by Martin Nylin.
32c96bd7 4464
eaea13f5
PE
44652006-05-08 Paul Eggert <eggert@cs.ucla.edu>
4466
4467 * data/glr.c: Switch to Bison 2.2 special-exception language in
4468 the copyright notice. Use more-regular format for titles and
4469 copyright notices.
4470 * data/glr.cc: Likewise.
4471 * data/location.cc: Likewise.
4472 * data/yacc.cc: Likewise.
4473 * doc/bison.texinfo (Conditions): Document this.
4474 * NEWS: likewise. Upgrade version to 2.2.
4475
6e2d1146
AD
44762006-04-27 Akim Demaille <akim@lrde.epita.fr>
4477
4478 * data/glr.cc: Remove dead code.
4479
47671055
PE
44802006-04-25 Paul Eggert <eggert@cs.ucla.edu>
4481
4482 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
4483 that variable and the line breaks the bootstrap. Problem reported
4484 by Juan M. Guerrero.
4485
ed2e6384
AD
44862006-04-24 Akim Demaille <akim@lrde.epita.fr>
4487
4488 * doc/bison.texinfo (Multiple start-symbols): New.
4489
3cedc2dc
AD
44902006-04-24 Akim Demaille <akim@lrde.epita.fr>
4491
4492 * etc/README, etc/bench.pl: New.
4493
b2ddc3f3
AD
44942006-04-03 Akim Demaille <akim@lrde.epita.fr>
4495
4496 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
4497 rule.
4498 Reported by Mickael Labau.
4499 * tests/input.at (Torturing the Scanner): Test it.
4500
91e3ac9a
PE
45012006-03-16 Paul Eggert <eggert@cs.ucla.edu>
4502
4503 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
4504 Problem reported by Bob Rossi.
4505
45062006-03-13 Paul Eggert <eggert@cs.ucla.edu>
4507
4508 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
4509 and didn't really work.
4510 For the index, use @ifnotinfo, not @iftex.
4511 Minor cleanups of spacing and terminology.
4512
5cf61e93
AD
45132006-03-12 Akim Demaille <akim@lrde.epita.fr>
4514
4515 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
4516 of AT_NAME_PREFIX when %name-prefix is not used.
4517
aa08666d
AD
45182006-03-12 Akim Demaille <akim@lrde.epita.fr>
4519
4520 Apply --prefix to C++ skeletons too: they change the namespace.
4521 The test suite already exercize these cases.
4522 * data/c++.m4 (b4_namespace): New.
4523 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
4524 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
4525 * data/yacc.c, data/glr.c: Remove a useless `[]'.
4526 * doc/bison.texinfo: Document it.
4527 (Option Cross Key): Use @multitable in all formats. It looks
4528 nicer, even in TeX outputs.
4529 (Rules): Use the same code whatever the output type is.
4530 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
4531 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
4532 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 4533
45567173
AD
45342006-03-10 Akim Demaille <akim@lrde.epita.fr>
4535
4536 * TODO: Remove dead items.
4537
e9d8f881 45382006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
4539
4540 * doc/FAQ: Remove, merged into...
4541 * doc/bison.texinfo (FAQ): this.
4542 * doc/Makefile.am (EXTRA_DIST): Adjust.
4543
c095d689
AD
45442006-03-10 Akim Demaille <akim@lrde.epita.fr>
4545
4546 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
4547 even if empty.
4548 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
4549 * doc/bison.texinfo (Calc++ Scanner): Use it.
4550
6e0f8287
PE
45512006-03-09 Paul Eggert <eggert@cs.ucla.edu>
4552
4553 Fix two nits reported by twlevo, plus one more that I discovered.
4554
4555 * src/assoc.h (assoc_to_string): Give a name to the arg, as
4556 this is the usual Bison style.
4557 * src/location.h (location_print): Likewise.
4558
4559 * src/reader.h (token_name): Likewise.
4560
d6b771c3
PE
45612006-03-08 Paul Eggert <eggert@cs.ucla.edu>
4562
4563 Fix some nits reported by twlevo.
4564 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
4565 and "POSIX". Use more-modern syntax for URLs. Mention C++
4566 and ask for Java. Don't hardwire OS version numbers. Add
4567 copyright notice.
4568 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
4569 * src/conflicts.c (solved_conflicts_obstack): Now static.
4570
1e137b71
JD
45712006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4572
4573 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
4574 page. Say "you can use it" not "you may use it" as on the web page;
4575 we're describing capabilities not granting permission.
4576
73f2e47e
PE
45772006-03-06 Paul Eggert <eggert@cs.ucla.edu>
4578
6d05403d
PE
4579 * data/glr.c (yyresolveLocations): Rename local variables to avoid
4580 shadowing warnings. Use usual patter for iterating through RHS.
4581 * tests/glr-regression.at
4582 (Uninitialized location when reporting ambiguity):
4583 Modify yylex so that it uses its argument, rather than trying
4584 to rely on ARGSUSED (which doesn't work for gcc with warnings).
4585 const char -> char const.
4586
73f2e47e
PE
4587 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
4588 Don't use tabs inside commands; it messes up 'ps'.
4589 Problem reported by twlevo.
4590
8710fc41
JD
45912006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
4592
4593 * tests/glr-regression.at (Uninitialized location when reporting
4594 ambiguity): New test case.
4595 * data/glr.c (yyresolveLocations): New function, which uses
4596 YYLLOC_DEFAULT.
4597 (yyresolveValue): Invoke yyresolveLocations before reporting an
4598 ambiguity.
4599 * doc/bison.texinfo (Default Action for Locations): Note
4600 YYLLOC_DEFAULT's usage for ambiguity locations.
4601 (GLR Semantic Actions): Cross-reference those notes.
4602
ae952af2
JD
46032006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
4604
4605 * tests/glr-regression.at (Leaked semantic values when reporting
4606 ambiguity): Remove unnecessary union and type declarations.
4607 (Leaked lookahead after nondeterministic parse syntax error): New test
4608 case.
4609 * data/glr.c (yyparse): Check for zero stacks remaining before
4610 attempting to shift the lookahead so that you don't lose it.
4611
35ee866a
JD
46122006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4613
4614 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
4615 * tests/glr-regression.at (Leaked semantic values when reporting
4616 ambiguity): New test case.
4617 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
4618 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
4619 now unnecessary yystackp parameter.
4620 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
4621 destructors can be called.
4622
4623 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
4624 in existing testcases.
4625
520181ab
JD
46262006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4627
4628 Don't leak semantic values for parent RHS when a user action cuts the
4629 parser, and clean up related code a bit.
4630 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
4631 cuts parse): Rename to...
4632 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
4633 for leaked parent RHS values.
4634 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
4635 between an unresolved state (non-empty chain of semantic options) and
4636 an incomplete one (signaled by an empty chain).
ae952af2 4637 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
4638 successfully or unsuccessfully resolved yyGLRState to...
4639 (yyresolveValue): ... here so that yyresolveValue always leaves a
4640 yyGLRState with consistent data and thus is easier to understand.
4641 Remove the yyvalp and yylocp parameters since they are always just
4642 taken from the yys parameter. When reporting a discarded merged value
4643 in debugging output, note that it is incompletely merged. Document the
4644 interface.
4645 (yyresolveAction): If resolving any of the RHS states fails, destroy
4646 them all rather than leaking them. Thus, as long as user actions are
4647 written to clean up the RHS correctly, yyresolveAction always cleans up
4648 the RHS of a semantic option. Document the interface.
4649
18d9185c
PE
46502006-02-27 Paul Eggert <eggert@cs.ucla.edu>
4651
4652 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
4653 led to a segmentation fault in GNU Pascal. Problem reported
4654 by Waldek Hebisch.
4655
841a7737
JD
46562006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
4657
4658 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
4659 mid-rule action inside a nonterminal symbol in order to declare a
4660 destructor for its semantic value.
4661
fc3f467f
PE
46622006-02-16 Paul Eggert <eggert@cs.ucla.edu>
4663
4664 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
4665 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
4666 __cplusplus && ! defined _STDLIB_H && !
4667 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
4668 defined free))]: Include <stdlib.h> rather than rolling our own
4669 declarations of malloc and free, to avoid problems with
4670 incompatible declarations (using 'throw') C++'s stdlib.h. This
4671 should fix Debian bug 340012
4672 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
4673 reported by Guillaume Melquiond.
4674
a3af26dd
PE
46752006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4676
4d7bc38c
PE
4677 * NEWS: Clarify symbols versus types in unused-value warnings.
4678
a3af26dd
PE
4679 * configure.ac (AC_INIT): Bump version number.
4680
4e26c69e
PE
46812006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4682
4683 * NEWS: Version 2.1a.
4684 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
4685 since C99 requires this.
4686
498e897c
PE
46872006-02-11 Paul Eggert <eggert@cs.ucla.edu>
4688
4689 * m4/c-working.m4: New file.
4690 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
4691
57bb17ca
PE
46922006-02-10 Paul Eggert <eggert@cs.ucla.edu>
4693
4694 * Makefile.maint: Merge from coreutils.
4695
0be105dc
PE
46962006-02-09 Paul Eggert <eggert@cs.ucla.edu>
4697
4698 More portability fixes for problems summarized by Nelson H. F. Beebe.
4699
4700 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
4701 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
4702 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
4703 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
4704 messes up because C++ code is compiled in 32-bit mode but linked
4705 in 64-bit mode.
4706
6fc0c024
PE
47072006-02-08 Paul Eggert <eggert@cs.ucla.edu>
4708
4709 More portability fixes for problems summarized by Nelson H. F. Beebe.
4710
7870f699
PE
4711 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
4712 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
4713
6fc0c024
PE
4714 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
4715 nodist_PROGRAMS, since we don't need to actually compile the
4716 example if we're just doing a plain 'make'. This avoids bothering
4717 the installer unnecessarily about problems due to weird C++
4718 compilers.
4719
fe6c2fde
PE
47202006-02-06 Paul Eggert <eggert@cs.ucla.edu>
4721
4722 More portability fixes for problems summarized by Nelson H. F. Beebe.
4723
4724 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
4725 than #include "...", and compile with -I'.'. The old method was
4726 not portable, according to Posix and the C standard, and it does
4727 not work with Sun C 5.7, where previous #line directives affect
4728 the working directory used in later #include "..." directives.
4729
927b425b
JMG
47302006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4731
4732 Various DJGGP specific issues in /djgpp
4733
d9735e9e
PE
47342006-02-02 Paul Eggert <eggert@cs.ucla.edu>
4735
4736 More portability fixes for problems summarized by Nelson H. F. Beebe.
4737
4738 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
4739 '#include <map>' works and that you can apply ++ to iterators.
4740
5a6755af
PE
47412006-02-01 Paul Eggert <eggert@cs.ucla.edu>
4742
67a0dc4f
PE
4743 Work around portability problems summarized by Nelson H. F. Beebe in
4744 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
4745
8c86f0ef
PE
4746 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4747 that '#include <string>' works.
4748
de35dd59
PE
4749 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
4750 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
4751 "warning: sorry: semantics of inline function static data `const
4752 unsigned char translate_table[262]' are wrong (you'll wind up with
4753 multiple copies)".
4754
67a0dc4f
PE
4755 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
4756 or, xor to not_, and_, or_, and xor_, respectively. This works
4757 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
4758 random system header somewhere that includes the equivalent of
4759 <iso646.h>.
4760
5a6755af
PE
4761 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
4762 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 4763 Suite Version 2.0.
5a6755af 4764
3f001415
JD
47652006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
4766
4767 During deterministic GLR operation, user actions should be able to
4768 influence the parse by changing yychar. To make this easier to fix and
4769 to make glr.c easier to evolve in general, don't maintain yytoken in
4770 parallel with yychar; just compute yytoken when needed.
4771 * tests/glr-regression.at (Incorrect lookahead during deterministic
4772 GLR): Check that setting yychar in a user action has the intended
4773 effect.
4774 * data/glr.c (yyGLRStack): Remove yytokenp member.
4775 (yyclearin): Don't set *yytokenp.
4776 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
4777 yychar rather than *yytokenp to determine the current lookahead.
4778 Compute yytoken locally when needed.
4779 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
4780 point to.
4781
4782 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
4783 after `--report' documentation.
4784
e2a8c0f5
PE
47852006-01-30 Paul Eggert <eggert@cs.ucla.edu>
4786
4787 * src/parse-gram.y (grammar_declaration): Location of printer
4788 symbol is @1, not list->location. Bug reported by twlevo.
4789 * tests/input.at (Incompatible Aliases): Adjust to above change.
4790
6b702268
PE
47912006-01-29 Paul Eggert <eggert@cs.ucla.edu>
4792
27622431
PE
4793 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
4794 all the test at once. This makes the output easier to read in the
4795 normal case.
4796
6b702268
PE
4797 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
4798 got from <http://bro-ids.org/download.html>. The bug is that
4799 when two actions appeared in succession, the second one was
4800 scanned before the first one was added to the grammar rule
4801 as a midrule action. Bison then output the incorrect warning
4802 "parse.y:905.17-906.36: warning: unused value: $3".
4803 * src/parse-gram.y (BRACED_CODE, action): These are no longer
4804 associated with a value.
4805 (rhs): Don't invoke grammar_current_rule_action_append.
4806 (action): Invoke it here instead.
4807 * src/reader.c (grammar_midrule_action): Now extern.
4808 (grammar_current_rule_action_append): Don't invoke
4809 grammar_midrule_action; that is now the scanner's job.
4810 * src/reader.h (last_string, last_braced_code_loc):
4811 (grammar_midrule_action): New decls.
4812 * src/scan-gram.l (last_string): Now extern, sigh.
4813 (last_braced_code_loc): New extern variable.
4814 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
4815 rule already has an action.
4816 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
4817 * tests/input.at (AT_CHECK_UNUSED_VALUES):
4818 Add some tests to check that the above changes fixed the bug.
4819
d40ba6c2
PE
48202006-01-27 Paul Eggert <eggert@cs.ucla.edu>
4821
4822 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
4823 All used changed. Check whether the symbol has a destructor,
4824 not whether it is typed.
4825 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
4826 that the values are still reported as unused. All line numbers
4827 adjusted.
4828
401aace6
PE
48292006-01-23 Paul Eggert <eggert@cs.ucla.edu>
4830
4831 Work around a bug in bro 0.8, which underparenthesizes its
4832 definition of YYLLOC_DEFAULT.
4833 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
4834 their arguments.
4835 * data/lalr1.cc: Likewise.
4836 * data/yacc.cc: Likewise.
4837
06f01bc4
PE
48382006-01-22 Paul Eggert <eggert@cs.ucla.edu>
4839
401aace6
PE
4840 Work around a bug in Pike 7.0, and give the Pike folks a
4841 better way to override the usual int widths.
4842 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
4843 user can override the types.
4844 (short): #undef, to work around a bug in Pike 7.0.
4845 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
4846 (union yyalloc.yyss): Use yytype_int16 rather than short.
4847 All uses changed.
4848 (yysigned_char): Remove.
4849 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
4850 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
4851 * tests/regression.at (Web2c Actions): Adjust to above changes.
4852
4853 * src/reader.c (check_and_convert_grammar): New function.
4854 (reader): Close the input file even if something went wrong during
4855 parsing. Minor file descriptor leak reported by twlevo.
4856
06f01bc4
PE
4857 * src/assoc.c (assoc_to_string): Use a default: abort (); case
4858 to pacify gcc -Wswitch-default.
4859 * src/scan-gram.l (adjust_location): Use a default: break; case
4860 to pacify gcc -Wswitch-default.
4861 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
4862 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4863 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4864 Move these decls to scan-skel.l, since they don't need to be
4865 visible elsewhere.
4866 * src/scan-skel.l: Accept the above decls.
4867 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
4868 is used.
4869
02650b7f
PE
48702006-01-21 Paul Eggert <eggert@cs.ucla.edu>
4871
4872 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
4873 since we don't want to insist on a version number at the start
4874 of the changelog every time.
4875 * Makefile.maint: Sync from coreutils a bit better.
4876 (sc_trailing_blank): Renamed from sc_trailing_space.
4877 All uses changed.
4878 (sc_no_if_have_config_h, sc_require_config_h):
4879 (sc_prohibit_assert_without_use): New rules.
4880 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
4881 (sc_dd_max_sym_length): Fix leading spaces in rule.
4882 (sc_system_h_headers): Prefix with @.
4883 (sc_useless_cpp_parens, m4-check): Output line numbers.
4884 (changelog-check): Allow version only in head.
4885 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
4886 satisfy new Makefile.maint rule.
4887 * data/glr.c: Likewise.
4888 * data/glr.cc: Likewise.
4889 * data/lalr1.cc: Likewise.
4890 * data/yacc.c: Likewise.
4891 * lib/ebitsetv.c: Likewise.
4892 * lib/lbitset.c: Likewise.
4893 * lib/subpipe.c: Likewise.
4894 * lib/timevar.c: Likewise.
4895 * src/system.h: Likewise.
4896 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
4897 * djgpp/Makefile.maint: Add copyright notice.
4898 * djgpp/README.in: Likewise.
4899 * djgpp/config.bat: Likewise.
4900 * djgpp/config.site: Likewise.
4901 * djgpp/config_h.sed: Likewise.
4902 * djgpp/djunpack.bat: Likewise.
4903 * djgpp/config.sed: Fix copyright notice to match standard format.
4904 * djgpp/subpipe.h: Likewise.
4905 * lib/bitsetv-print.c: Likewise.
4906 * lib/bitsetv.c: Likewise.
4907 * lib/subpipe.h: Likewise.
4908 * lib/timevar.c: Likewise.
4909 * lib/timevar.h: Likewise.
4910 * djgpp/subpipe.c: Use standard recipe for config.h.
4911 * lib/abitset.c: Likewise.
4912 * lib/bitset.c: Likewise.
4913 * lib/bitset_stats.c: Likewise.
4914 * lib/bitsetv-print.c: Likewise.
4915 * lib/bitsetv.c: Likewise.
4916 * lib/ebitsetv.c: Likewise.
4917 * lib/get-errno.c: Likewise.
4918 * lib/lbitset.c: Likewise.
4919 * lib/subpipe.c: Likewise.
4920 * lib/timevar.c: Likewise.
4921 * lib/vbitset.c: Likewise.
4922 * tests/local.at: Likewise.
4923 * src/scan-gram.l: Don't include verify.h, since system.h does
4924 that for us.
4925 * .x-sc_require_config_h: New file.
4926 * .x-sc_unmarked_diagnostics: New file.
4927
287c78f6
PE
49282006-01-20 Paul Eggert <eggert@cs.ucla.edu>
4929
287c78f6
PE
4930 Be a bit more systematic about using 'abort'.
4931 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
4932 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
4933 Put 'default: abort ();' before some other case, to satisfy older
4934 pedantic compilers.
4935 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4936 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
4937 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
4938 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
4939 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
4940 (get_decision_str, get_orientation_str, get_node_alignment_str):
4941 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
4942 (get_linestyle_str, get_arrowstyle_str): Likewise.
4943 * src/conflicts.c (resolve_sr_conflict):
4944 Use a default case rather than one for the one remaining enum
4945 value, to catch invalid enum values as well.
4946 * src/lalr.c (set_goto_map, map_goto):
4947 Prefer "assert (FOO);" to "if (!FOO) abort ();".
4948 * src/nullable.c (nullable_compute, token_definitions_output):
4949 Likewise.
4950 * src/reader.c (packgram, reader): Likewise.
4951 * src/state.c (transitions_to, state_new, state_reduction_find):
4952 Likewise.
4953 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
4954 (symbol_pack): Likewise.
4955 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
4956 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
4957 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
4958 * src/system.h: Don't include <assert.h>.
4959 (assert): New macro.
4960
4961 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
4962 (Destructor Decl, Parser Function, Pure Calling):
4963 Describe rules for braces inside C code more carefully.
287c78f6 4964
c66dfadd
PE
49652006-01-19 Paul Eggert <eggert@cs.ucla.edu>
4966
c21493b8
PE
4967 Fix some porting glitches found by Nelson H. F. Beebe.
4968 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
4969 compilers that don't understand that abort () does not return.
4970 * src/state.c (transitions_to): Likewise.
4971 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4972 that '#include <cstdlib>' works.
4973 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
4974 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
4975 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
4976 for the benefit of some pre-C99 compilers.
4977
b6e3facf
PE
4978 * bootstrap: Undo changes to gnulib files that autoreconf made.
4979
c66dfadd
PE
4980 Minor fixups to get 'make maintainer-check' to work.
4981 * configure.ac: Don't use -Wnested-externs, as it's incompatible
4982 with the new verify.h implementation.
4983 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
4984 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
4985 * data/yacc.c (YYUSE): Likewise.
4986 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
4987 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
4988 * src/parse-gram.y (declaration): Don't pass a string constant
4989 to a function that expects char *, since GCC might complain
4990 about the constant value.
4991 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
4992 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
4993 before #defining them.
4994 * tests/glr-regression.at
4995 (Incorrectly initialized location for empty right-hand side in GLR):
4996 In yyerror, use the msg arg.
4997 (Corrupted semantic options if user action cuts parse):
4998 (Incorrect lookahead during deterministic GLR):
4999 (Incorrect lookahead during nondeterministic GLR):
5000 Don't name a local var 'index'; it shadows string.h's 'index'.
5001
ed94ef2a
AD
50022006-01-19 Akim Demaille <akim@epita.fr>
5003
5004 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
5005 location, not just parts of it.
5006
e9ad4aec
PE
50072006-01-18 Paul Eggert <eggert@cs.ucla.edu>
5008
d6ca7905
PE
5009 * NEWS: Document the fact that multiple %unions are now allowed.
5010 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
5011 * TODO: This feature is now implemented, so remove it from
5012 the wishlist.
d6ca7905 5013
ef1b70e0
PE
5014 * Makefile.maint: Merge with coreutils Makefile.maint.
5015 (CVS_LIST): Use build-aux version if available.
5016 (VERSION_REGEXP): New macro.
5017 (syntax-check-rules): Add sc_no_if_have_config_h,
5018 sc_prohibit_assert_without_use, sc_require_config_h,
5019 sc_useless_cpp_parens.
5020 (sc_obsolete_symbols): Check for O_NDELAY.
5021 (sc_dd_max_sym_length): Track coreutils.
5022 (sc_unmarked_diagnostics): Look in all files, not just *.c.
5023 (sc_useless_cpp_parens): New rule.
5024 (news-date-check): Look for version or today's date.
5025 (changelog-check): Don't require version number near head.
5026 (copyright-check): Use current year instead of hardwiring 2005.
5027 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
5028 (announcement): Add --gpg-key-ID.
5029
5030 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
5031 with "file system".
5032
2073ce56 5033 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
5034 array. Problem reported by twlevo.
5035 * src/reader.c (packgram): Prepend a new sentinel before ritem.
5036 * src/lalr.c (build_relations): Rely on new sentinel.
5037 * src/gram.c (gram_free): Adjust to new sentinel.
5038
b7691f15
JD
50392006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
5040
5041 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
5042 yylookaheadNeeds. All uses updated.
5043 (yysplitStack): Rename local yynewLookaheadStatuses to
5044 yynewLookaheadNeeds.
5045 * data/glr-regression.at (Incorrect lookahead during nondeterministic
5046 GLR): In comments, change `lookahead status' to `lookahead need'.
5047
ddee1b06
PH
50482006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5049
5050 * data/glr.c (yysplitStack): A little stylistic rewrite.
5051
12f4614d
PH
50522006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5053
5054 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
5055
32c29292
JD
50562006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
5057
5058 * doc/bison.texinfo: Fix some typos.
5059 (GLR Semantic Actions): New subsection discussing special
5060 considerations because GLR semantic actions might be deferred.
5061 (Actions): Mention look-ahead usage of yylval.
5062 (Actions and Locations): Mention look-ahead usage of yylloc.
5063 (Special Features for Use in Actions): Add YYEOF entry and mention it
5064 in the yychar entry.
5065 In the yychar entry, remove mention of the local yychar case (pure
5066 parser) since this is irrelevant information when writing semantic
148d66d8 5067 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
5068 yychar is otherwise described as an external variable.
5069 In the yychar entry, don't call it the `current' look-ahead since it
5070 isn't when semantic actions are deferred.
5071 In the yychar and yyclearin entries, add note about deferred semantic
5072 actions.
5073 Add yylloc and yylval entries discussing look-ahead usage.
5074 (Look-Ahead Tokens): When discussing yychar, don't call it the
5075 `current' look-ahead, and do mention yylval and yylloc.
5076 (Error Recovery): Cross-reference `Action Features' when mentioning
5077 yyclearin.
148d66d8 5078 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
5079 look-ahead.
5080 In the yylloc and yylval entries, mention look-ahead usage.
5081
de366a2f 50822006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
5083
5084 * tests/glr-regression.at: Update copyright year to 2006.
5085
bf70fa87
JD
50862006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5087
5088 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
5089 use during nondeterministic operation to track which stacks have
5090 actually needed the current lookahead.
5091 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
5092 Allocate, deallocate, resize, and otherwise shuffle space for
5093 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
5094 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
5095 appropriately during nondeterministic operation.
5096 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
5097 members to store the current lookahead to be used by the deferred
5098 user action.
5099 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
5100 from which the RHS is taken. Set the lookahead members of the new
5101 yySemanticOption according to the lookahead status for stack yyk.
5102 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
5103 yyaddDeferredAction.
5104 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
5105 members of yySemanticOption before invoking yyuserAction, and then set
5106 them back to their current values afterward.
5107 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
5108 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
5109 * tests/glr-regression.at: Remove `.' from the ends of recent test case
5110 titles for consistency.
5111 (Leaked merged semantic value if user action cuts parse): In order to
5112 suppress lint warnings, use arguments in merge function, and assign
5113 char value < 128 in main.
5114 (Incorrect lookahead during deterministic GLR): New test case.
5115 (Incorrect lookahead during nondeterministic GLR): New test case.
5116
05449a2c
JD
51172006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5118
de366a2f 5119 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
5120 !yyvaluep as signal that no semantic value is available to print.
5121 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
5122 to print a semantic value.
5123
4158e0a1 51242006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 5125
4158e0a1
JD
5126 * tests/glr-regression.at: For consistency with my newer test cases,
5127 don't thank myself.
5128
d659304d
JD
51292006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5130
5131 * data/glr.c (yyresolveValue): When merging semantic options, if at
5132 least one user action succeeds but a later one cuts the parse, then
5133 destroy the semantic value before returning rather than leaking it.
5134 (yyresolveStates): If a user action cuts the parse and thus
5135 yyresolveValue fails, ignore the (unset) semantic value rather than
5136 corrupting the yyGLRState, and empty the semantic options list since
5137 the user actions should have called all necessary destructors.
5138 Simplify code with YYCHK.
5139 * tests/glr-regression.at (Corrupted semantic options if user action
5140 cuts parse): New test case.
5141 (Undesirable destructors if user action cuts parse): New test case.
5142 Before applying any of this patch, this test case never actually failed
5143 for me... but only because the corrupted semantic options usually
5144 masked this bug.
5145 (Leaked merged semantic value if user action cuts parse): New test
5146 case.
5147
6ec2c0f2
AD
51482006-01-05 Akim Demaille <akim@epita.fr>
5149
5150 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
5151
1b9c21fb
PE
51522006-01-04 Paul Eggert <eggert@cs.ucla.edu>
5153
5154 * data/c.m4 (b4_c_modern): New macro, with a new provision for
5155 _MSC_VER. Problem reported by Cenzato Marco.
5156 (b4_c_function_def): Use it.
5157 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
5158 b4_c_modern.
5159 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
5160 than rolling our own.
5161
84866159
AD
51622006-01-04 Akim Demaille <akim@epita.fr>
5163
5164 Also warn about non-used mid-rule values.
5165 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
5166 member.
5167 (symbol_list_new): Adjust.
5168 * src/reader.c (symbol_typed_p): New.
5169 (grammar_rule_check): Use it.
5170 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
5171 Check its rule.
5172 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
5173 Use it.
5174 * tests/actions.at (Exotic Dollars): Adjust.
5175
378f4bd8
AD
51762006-01-04 Akim Demaille <akim@epita.fr>
5177
5178 * src/reader.c (grammar_midrule_action): If $$ is set in a
5179 mid-rule, move the `used' bit to its lhs.
5180 * tests/input.at (Unused values): New.
5181 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
5182
e2a21b6f
PE
51832006-01-03 Paul Eggert <eggert@cs.ucla.edu>
5184
54662697
PE
5185 * doc/bison.texinfo (Bison Options): Say more accurately what
5186 --yacc does.
5187 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
5188 about declarations in the grammar when in Yacc mode, as POSIX does
5189 not require a diagnostic when the grammar uses extensions.
5190
5191 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
5192
073f9288
PE
5193 Warn about dubious constructions like "%token T T".
5194 Reported by twlevo.
5195 * src/symtab.h (struct symbol.declared): New member.
5196 * src/symtab.c (symbol_new): Initialize it to false.
5197 (symbol_class_set): New arg DECLARING, specifying whether
5198 this is a declaration that we want to warn about, if there
5199 is more than one of them. All uses changed.
5200
1221b78a
PE
5201 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
5202 Allow multiple %union directives, whose contents concatenate.
5203 * src/parse-gram.y (grammar_declaration): Likewise.
5204 Use muscle_code_grow, so that we don't need stype_line any more.
5205 All uses changed.
5206
5207 * src/muscle_tab.c (muscle_grow): Fix comment.
5208
e2a21b6f
PE
5209 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
5210 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
5211 Update copyright year to 2006.
5212
8f7e3cf9
AD
52132006-01-03 Akim Demaille <akim@epita.fr>
5214
5215 Have glr.cc pass (some of) the calc.at tests.
5216 * data/glr.cc (b4_parse_param_orig): New.
5217 (b4_parse_param): Improve its definition, and bound it more
5218 clearly in the skeleton.
5219 (b4_epilogue): Append, instead of prepending, in order to keep
5220 #line consistency.
5221 Simplify the generation of auxiliary functions: locations and
5222 purity are mandated.
5223 (b4_global_tokens_and_yystype): Honor it.
5224 * data/location.cc (c++.m4): Don't include it.
5225 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
5226 and AT_SKEL_CC_IF.
5227 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
5228 AT_LALR1_CC_IF.
5229 Be sure to initialize the first position's filename.
5230 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
5231 mandated anyway.
5232 (AT_CHECK_CALC_GLR_CC): New.
5233 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
5234
3953ed88
AD
52352006-01-02 Akim Demaille <akim@epita.fr>
5236
5237 * src/output.c (output_skeleton): Don't hard wire the inclusion of
5238 c.m4.
0a96ba81 5239 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
5240 * data/glr.cc: Do not include stack.hh.
5241
9ecafbbf
AD
52422006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5243
5244 * data/glr.c: Reformat whitespace with tabs.
5245 (b4_lpure_formals): Remove this unused m4 macro.
5246 * tests/cxx-type.at: Reformat whitespace with tabs.
5247 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
5248 since it's a member. Rename type to isNterm for clarity.
5249
c4d497a0
AD
52502005-12-29 Akim <akim@sulaco.local>
5251
5252 Let glr.cc catch up with symbol_value_print.
5253 * data/glr.cc (b4_yysymprint_generate): Replace by...
5254 (b4_yy_symbol_print_generate): this.
5255 (yy_symbol_print, yy_symbol_value_print): Declare them.
5256
4517da37
PE
52572005-12-28 Paul Eggert <eggert@cs.ucla.edu>
5258
5259 * src/location.h (boundary): Note that a line or column equal
5260 to INT_MAX indicates an overflow.
5261 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
5262 (rule_length_overflow, increment_rule_length, add_column_width):
5263 New functions.
5264 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
5265 (<SC_BRACED_CODE>"}"):
5266 Use increment_rule_length rather than incrementing it by hand.
5267 (adjust_location, handle_syncline): Diagnose overflow.
5268 (handle_action_dollar, handle_action_at):
5269 Fix bug with monstrosities like $-2147483648.
5270 Remove now-unnecessary checks.
5271 (scan_integer): Verify assumptions and remove now-unnecessary checks.
5272 (convert_ucn_to_byte): Verify assumptions.
5273 (handle_syncline): New arg LOC. All callers changed.
5274 Don't store through a value derived from char const * pointer.
5275
5276 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
5277 GCC warnings.
5278
e3233bf6
PE
52792005-12-27 Paul Eggert <eggert@cs.ucla.edu>
5280
5281 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
5282 Remove unnecessary forward static decls.
5283
8f3596a6
AD
52842005-12-27 Akim Demaille <akim@epita.fr>
5285
5286 * src/reader.c (grammar_current_rule_check): Also check that $$
5287 is used.
5288 Take the rule to check as argument, hence rename as...
5289 (grammar_rule_check): this.
5290 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
5291 Rename as...
5292 (grammar_rule_begin, grammar_rule_end): these, for consistency.
5293 (grammar_midrule_action, grammar_symbol_append): Now static.
5294 * tests/torture.at (input): Don't rely on the default action
5295 being always performed.
5296 * tests/calc.at: "Set" $$ even when the action is "cut" with
5297 YYERROR or other.
5298 * tests/actions.at (Exotic Dollars): Instead of using unused
5299 values, check that the warning is issued.
5300
721be13c
PE
53012005-12-22 Paul Eggert <eggert@cs.ucla.edu>
5302
5303 * NEWS: Improve wording for unused-value warnings.
5304
a0af42fc
AD
53052005-12-22 Akim Demaille <akim@epita.fr>
5306
5307 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
5308 (b4_yysymprint_generate): Rename as...
5309 (b4_yy_symbol_print_generate): this.
5310 Generate yy_symbol_print instead of yysymprint.
5311 Generate also yy_symbol_value_print, and use it.
5312
affac613
AD
53132005-12-22 Akim Demaille <akim@epita.fr>
5314
721be13c 5315 * NEWS: Warn about unused values.
affac613
AD
5316 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
5317 a `used' member.
5318 (symbol_list_n_get, symbol_list_n_used_set): New.
5319 (symbol_list_n_type_name_get): Use symbol_list_n_get.
5320 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
5321 * src/reader.c (grammar_current_rule_check): Check that values are
5322 used.
5323 * src/symtab.c (symbol_print): Accept 0.
5324 * tests/existing.at: Remove the type information.
5325 Empty the actions.
5326 Remove useless actions (beware of mid-rule actions: perl -000
5327 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
5328 * tests/actions.at (Exotic Dollars): Use unused values.
5329 * tests/calc.at: Likewise.
5330 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5331 Likewise.
5332
5333 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
5334 rule_useful_p.
5335
9d9b8b70
PE
53362005-12-21 Paul Eggert <eggert@cs.ucla.edu>
5337
8bb4c753
PE
5338 Undo 2005-12-01 tentative license wording change. The wording is
5339 still being reviewed by the lawyers, and we don't want to wait for
5340 them before publishing a test release. For now, revert to the
5341 previous wording.
5342 * NEWS: Undo 2005-12-01 change.
5343 * data/glr.c: Revert to previous license wording.
5344 * data/glr.cc: Likewise.
5345 * data/lalr1.cc: Likewise.
5346 * data/location.cc: Likewise.
5347 * data/yacc.c: Likewise.
5348
9d9b8b70
PE
5349 * NEWS: Reword %destructor vs YYABORT etc.
5350 * data/glr.c: Use American spacing, for consistency.
5351 * data/glr.cc: Likewise.
5352 * data/lalr1.cc: Likewise.
5353 * data/yacc.c: Likewise.
5354 * data/yacc.c: Reformat comments slightly.
5355 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
5356 for consistency. Fix some spelling errors and reword recently-included
5357 text slightly.
5358 * tests/cxx-type.at: Cast results of malloc, for C++.
5359
2c3b392a
AD
53602005-12-21 Joel E. Denny <address@hidden>
5361
5362 * tests/cxx-type.at: Construct a tree, count the parents of shared
5363 nodes, and free each node once and only once. Previously, the memory
5364 for semantic values was leaked instead.
5365
d6cff4dc
AD
53662005-12-21 Joel E. Denny <address@hidden>
5367
5368 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
5369 (yylval, yylloc): If pure, #define to yystackp->yyval and
5370 yystackp->yyloc similar to yychar and yynerrs.
5371 (yyparse): If pure, remove local yylval and yylloc. Add local
5372 yystackp to accommodate pure definitions of yylval and yylloc.
5373 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
5374 yylvalp and yyllocp to &yylval and &yylloc.
5375 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
5376 namespace. Previously, nerrs and char were missing, but lval and lloc
5377 weren't necessary.
5378 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
5379 yylvalp and yyllocp parameters since, if pure, these are now always
5380 accessible through yystackp. If not pure, they are still accessible
5381 globally.
5382 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
5383 `if (YYID (N))' to pacify lint.
5384
a85284cf
AD
53852005-12-21 Akim Demaille <akim@epita.fr>
5386
5387 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
5388 destroy the RHS symbols of a rule.
5389 * data/yacc.c (yylen): Initialize to 0.
5390 Keep its value to the number of items to possibly shift.
5391 In particular, a regular successful parse that ends on YYFINAL by
5392 a (internal) YYACCEPT must not have yylen != 0.
5393 (yyerrorlab, yyreturn): Pop the RHS.
5394 Reorder a bit to emphasize the `shifting' bits of code.
5395 (YYPOPSTACK): Now accept a number of items to pop.
5396 * data/lalr1.cc: Likewise.
5397 * data/glr.c: Formatting changes.
5398 Use goto instead of fall through.
5399 * doc/bison.texinfo (Destructor Decl): Complete.
5400
d508c281
JMG
54012005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5402
5403 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5404 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
5405 * djgpp/config.bat: Replace every occurence of the file name
5406 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5407 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5408 * djgpp/config.sed: Replace every occurence of the file name
5409 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5410 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5411 * djgpp/djunpack.bat: DJGPP specific file.
5412 * djgpp/fnchange.lst: DJGPP specific file.
5413 * djgpp/README.in: Add new information about how to unpack the bison
5414 source on MSDOS and other systems which have 8.3 file name restrictions
5415 using djunpack.bat and fnchange.lst.
5416
3e7a2cd9
PE
54172005-12-12 Paul Eggert <eggert@cs.ucla.edu>
5418
5419 * bootstrap (build_cvs_prefix): Remove; unused.
5420 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
5421 when getting gnulib.
5422
54232005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
5424
5425 * data/glr.c: Reorder typedef declarations for structs to match order
5426 of struct declarations.
5427 Rename yystack everywhere to yystackp except in yyparse where it's not
5428 a pointer.
5429 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
5430 consistency.
5431 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
5432 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
5433 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
5434 lint.
5435
877519f8
PE
54362005-12-09 Paul Eggert <eggert@cs.ucla.edu>
5437
0eca5a39
PE
5438 * tests/sets.at (Accept): Fix typos in regular expression used to
5439 sed out the final state number.
5440
2cec9080
PE
5441 Work around portability problem on Solaris 10: flex-generated
5442 files include <stdio.h> before <config.h>, which messes up
5443 because the latter defines __EXTENSIONS__. Address the problem
5444 by creating two new little files that include <config.h> first,
5445 then include the flex-generated files. Rewrite everyone else
5446 to include <config.h> first, as well.
5447 * lib/timevar.c: Always include "config.h".
5448 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
5449 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
5450 (EXTRA_bison_SOURCES): New macro.
5451 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
5452 * src/system.h: Don't include config.h.
5453 * src/LR0.c: Include <config.h> first.
5454 * src/assoc.c: Likewise.
5455 * src/closure.c: Likewise.
5456 * src/complain.c: Likewise.
5457 * src/conflicts.c: Likewise.
5458 * src/derives.c: Likewise.
5459 * src/files.c: Likewise.
5460 * src/getargs.c: Likewise.
5461 * src/gram.c: Likewise.
5462 * src/lalr.c: Likewise.
5463 * src/location.c: Likewise.
5464 * src/main.c: Likewise.
5465 * src/muscle_tab.c: Likewise.
5466 * src/nullable.c: Likewise.
5467 * src/output.c: Likewise.
5468 * src/parse-gram.y: Likewise.
5469 * src/print.c: Likewise.
5470 * src/print_graph.c: Likewise.
5471 * src/reader.c: Likewise.
5472 * src/reduce.c: Likewise.
5473 * src/relation.c: Likewise.
5474 * src/state.c: Likewise.
5475 * src/symlist.c: Likewise.
5476 * src/symtab.c: Likewise.
5477 * src/tables.c: Likewise.
5478 * src/uniqstr.c: Likewise.
5479 * src/vcg.c: Likewise.
5480
877519f8
PE
5481 * src/parse-gram.y: Fix minor problems uncovered by lint.
5482 (current_lhs, current_lhs_location): Now static.
5483 (current_assoc): Remove unused variable.
5484
5485 Cleanups so that Bison-generated parsers have less lint.
5486 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
5487 Prepend /*ARGSUSED*/, for lint's sake.
5488 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
5489 definition if 'lint' is defined.
5490 (YYID): New macro (or function, if lint).
5491 All uses of /*CONSTCOND*/0 replaced by YYID(0).
5492 * data/yacc.c: Likewise.
5493 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
5494 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
5495 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
5496 is C++ only.
5497 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
5498 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
5499 Use YYID(0) rather than 0, for lint.
5500 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
5501 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
5502
f5228370
PE
55032005-12-07 Paul Eggert <eggert@cs.ucla.edu>
5504
5505 * tests/glr-regression.at
5506 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5507 Close memory leak reported by twlevo.
5508
69ce078b
PE
55092005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
5510
6ff99711
PE
5511 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
5512 all stacks.
5513 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
5514 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5515 New test case.
5516 (Duplicated user destructor for lookahead): This test now is expected
5517 to succeed.
5518
af3412cd
PE
55192005-12-01 Paul Eggert <eggert@cs.ucla.edu>
5520
32b5b719 5521 * NEWS: Document the following change.
af3412cd
PE
5522 * data/yacc.c: Say "parser skeleton" rather than "file", since
5523 it's no longer just a file.
5524 * data/glr.c: Grant a special exception for C GLR parsers, that
5525 reads like the already-existing exception for C LALR(1) parsers.
5526 * data/glr.cc: Likewise.
5527 * data/lalr1.cc: Likewise.
5528 * data/location.cc: Likewise.
5529 * data/yacc.c: Reword the "written by" statement to clarify that
5530 it was the parser skeleton, not the entire output file.
5531 * data/glr.c: Written by Paul Hilfinger.
5532 * data/glr.cc: Written by Akim Demaille.
5533 * data/lalr1.cc: Likewise.
5534
035aa4a0
PE
55352005-11-18 Paul Eggert <eggert@cs.ucla.edu>
5536
d9963c85
PE
5537 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
5538 Fix typos in previous change that broke 'make check'.
5539 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
5540 supported in C.
5541 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
5542 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
5543 We can revert this once things settle down.
5544
035aa4a0
PE
5545 * src/conflicts.c (conflicts_print): Don't print file name twice
5546 when %expect fails because there were no conflicts.
5547 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
5548 change.
5549 * tests/conflicts.at (%expect not enough, %expect too much):
5550 (%expect with reduce conflicts): Adjust to new behavior.
5551
55522005-11-18 Akim Demaille <akim@epita.fr>
5553
5554 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
5555 errors.
5556 * NEWS: Document this.
5557 * doc/bison.texinfo (Expect Decl): Likewise.
5558
d1ff7a7c
AD
55592005-11-16 Akim Demaille <akim@epita.fr>
5560
5561 Generalize the display of semantic values and locations in traces.
5562 * data/glr.c (yy_reduce_print): Fix indices (again).
5563 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
5564 literal integers.
5565 * data/lalr1.cc (yyreduce_print): Rename as...
5566 (yy_reduce_print): this.
5567 Display values and locations.
5568 * data/yacc.c (yy_reduce_print): Likewise.
5569 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
5570 (yysymprint): Move higher to be visible from yy_reduce_print).
5571 (yyparse): Adjust.
5572 * tests/calc.at: Adjust the expected length of the traces.
5573
6de5398d
AD
55742005-11-14 Akim Demaille <akim@epita.fr>
5575
5576 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
5577 from 1 to N, while values and location start at 0.
5578 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
5579
a1373f55
AD
55802005-11-14 Akim Demaille <akim@epita.fr>
5581
5582 * data/glr.c (yy_reduce_print): Fix the $ number.
5583
613d8952
AD
55842005-11-14 Akim Demaille <akim@epita.fr>
5585
5586 "Use" parse parameters.
5587 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
5588 * data/glr.c, data/glr.cc: Use them.
5589 * data/glr.c (YYUSE): Have a C++ definition that supports
5590 non-pointer types.
5591
b2741627
AD
55922005-11-14 Akim Demaille <akim@epita.fr>
5593
5594 * data/glr.c (yyexpandGLRStack): Declare only if defined.
5595
5059b5c8
AD
55962005-11-14 Akim Demaille <akim@epita.fr>
5597
42249483
AD
5598 * data/glr.cc: New.
5599 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 5600
4626a15d
AD
56012005-11-12 Akim Demaille <akim@epita.fr>
5602
5603 Let position and location be PODs.
5604 * data/location.cc (position::initialize, location::initialize): New.
5605 (position::position, location::location): Define only if
5606 b4_location_constructors is defined.
5607 * data/lalr1.cc (b4_location_constructors): Define it for backward
5608 compatibility.
5609 * doc/bison.texinfo (Initial Action Decl): Use initialize.
5610
56112005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
5612
5613 * data/lalr1.cc: Move the body of the ctor and dtor into the
5614 parser file (instead of the header).
5615 Wrap the implementations in a "namespace yy".
5616
56172005-11-12 Akim Demaille <akim@epita.fr>
5618
5619 Have glr.c include its header file when created.
5620 * data/glr.c (b4_shared_declarations): New.
5621 Output them verbatim in the parser if !%defines, otherwise
5622 output then in the header file, and include it instead.
5623
1989d947
AD
56242005-11-11 Akim Demaille <akim@epita.fr>
5625
5626 * data/glr.c: Comment changes.
5627
56282005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
5629
5630 When yydebug, report semantic and location values for reductions.
5631 * data/glr.c (yy_reduce_print): Report the semantic values and the
5632 locations.
5633 (YY_REDUCE_PRINT): Adjust.
5634 (yyglrReduce): Use them.
5635 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
5636 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
5637 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
5638 traces.
5639
02998094
AD
56402005-11-10 Akim Demaille <akim@epita.fr>
5641
5642 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
5643 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
5644 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
5645
5210672f
PE
56462005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
5647
5648 * m4/cxx.m4, examples/Makefile.am: Don't build
5649 examples/calc++ if no C++ compiler is available. (trivial change)
5650
a8991a1d
AD
56512005-11-09 Akim Demaille <akim@epita.fr>
5652
5653 * src/scan-skel.l: Use a couple of asserts.
5654
36b5e963
AD
56552005-11-03 Akim Demaille <akim@epita.fr>
5656
5657 In some (weird) cases, the final state number is incorrect.
5658 Reported by Alexandre Duret-Lutz.
5659 * src/LR0.c (state_list_append): Remove the computation of
5660 final_state.
5661 (save_reductions): Do it here.
5662 (get_state): Alpha conversion.
5663 (generate_states): Use a for loop.
5664 * src/gram.h (item_number_is_rule_number)
5665 (item_number_is_symbol_number): New.
5666 * src/state.c: Use assert.
5667 * src/system.h: Include assert.h.
5668 * tests/sets.at (Accept): New.
5669
44e7ead1
PH
56702005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5671
5672 * data/glr.c (yyfill): Adjust comment.
36b5e963 5673 (yyresolveAction): Initialize default location properly
44e7ead1
PH
5674 for empty right-hand sides.
5675 (yydoAction): Ditto.
5676 Add comment explaining apparently dead code.
36b5e963
AD
5677 * tests/glr-regression.at
5678 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 5679 New test.
36b5e963 5680
e10a80ee
PE
56812005-10-30 Paul Eggert <eggert@cs.ucla.edu>
5682
5683 * bootstrap (cleanup_gnulib): New function. Use it to clean up
5684 gnulib when interrupted. This fixes some race conditions and
5685 works around some portability problems (one noted by Paul
5686 Hilfinger).
5687
067b32ee
AD
56882005-10-22 Akim <akim@epita.fr>
5689
5690 * Makefile.cfg: Adjust to config -> build-aux.
5691 Reported by twledo.
5692
4b367315
AD
56932005-10-21 Akim Demaille <akim@epita.fr>
5694
5695 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
5696 the %parse-params.
5697 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
5698 * data/yacc.c (b4_Pure_if): Rename as...
5699 (b4_yacc_pure_if): this.
5700 (YY_SYMBOL_PRINT, yyparse): Adjust.
5701 * doc/bison.texinfo: Formatting changes.
5702
24cc23d9
AD
57032005-10-21 Akim Demaille <akim@epita.fr>
5704
5705 Finish the transition config -> build-aux.
5706 * configure.ac, Makefile.am: Use build-aux.
5707 * config/prev-version, config/announce-gen, config/Makefile.am:
5708 Move to...
5709 * build-aux/prev-version, build-aux/announce-gen,
5710 * build-aux/Makefile.am: here.
5711
d4476375
AD
57122005-10-14 Akim Demaille <akim@epita.fr>
5713
5714 * examples/calc++/test: Use set -x only when VERBOSE.
5715
302c0aee
PE
57162005-10-13 Paul Eggert <eggert@cs.ucla.edu>
5717
5718 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
5719 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
5720
7625ec2c
AD
57212005-10-13 Akim Demaille <akim@epita.fr>
5722
5723 * src/scan-skel.l: Output the base name parts of the parser and
5724 header file names.
302c0aee 5725 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
5726 additional checks.
5727 Use this to exercise C++ outputs in subdirs.
5728 Reported by Oleg Smolsky.
5729
ba0fe3c7
PE
57302005-10-12 Paul Eggert <eggert@cs.ucla.edu>
5731
5732 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
5733 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
5734 Problem reported by John P. Hartmann.
5735 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
5736 already defined it.
5737
9b8a5ce0
AD
57382005-10-12 Akim Demaille <akim@epita.fr>
5739
5740 * src/parse-gram.y (version_check): Exit 63 to please missing
5741 (stands for "version mismatch).
5742 * tests/input.at, doc/bison.texinfo: Adjust.
5743
4f6e011e
PE
57442005-10-10 Paul Eggert <eggert@cs.ucla.edu>
5745
5746 Work around portability problems with Visual Age C compiler
5747 (xlc and xlC_r) reported by John P. Hartmann.
5748 * data/location.cc (initial_column, initial_line): Remove.
5749 All uses replaced by 0 and 1.
5750 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
5751 that xlc complains about.
5752 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 5753 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 5754 as __STDC__.
4d7aa45e
PE
5755 * data/yacc.c (YYMODERN_C): New macro, which also looks at
5756 __STDC_VERSION__. Use it everywhere instead of looking at
5757 __STDC__ and __cplusplus.
4f6e011e 5758
a1b3bf8c
AD
57592005-10-10 Akim Demaille <akim@epita.fr>
5760
5761 * examples/calc++/test: Be quiet unless VERBOSE.
5762
412e44aa
PE
57632005-10-05 Paul Eggert <eggert@cs.ucla.edu>
5764
2a4647a3
PE
5765 * data/c.m4 (yydestruct, yysymprint):
5766 Use YYUSE instead of casting to void.
5767 * data/glr.c (YYUSE): New macro.
5768 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5769 Use it instead of rolling our own.
5770 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5771 (YYCHK1):
5772 Use /*CONSTCOND*/ to suppress lint warnings.
5773 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5774 (YY_STACK_PRINT): Use 'false' not '0'.
5775 (YYUSE): New macro.
5776 (yysymprint_, yydestruct_): Use it instead of rolling our own.
5777 * data/yacc.c (YYUSE): New macro.
5778 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
5779 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
5780 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
5781
5782
412e44aa
PE
5783 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
5784 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
5785
88c6637f
PE
57862005-10-04 Paul Eggert <eggert@cs.ucla.edu>
5787
2f4f028d
PE
5788 Undo the parts of the unlocked-I/O change that substituted
5789 putc or puts for printf. This might hurt performance a bit,
5790 but some people prefer the printf style.
5791 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
5792 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
5793 All uses replaced by YYFPRINTF and YYDPRINTF.
5794 * data/yacc.c: Likewise.
5795 * lib/bitset.c (bitset_print): Likewise.
5796 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
5797 putc and puts.
5798 * lib/lbitset.c (debug_lbitset): Likewise.
5799 * src/closure.c (print_firsts, print_fderives): Likewise.
5800 * src/gram.c (grammar_dump): Likewise.
5801 * src/lalr.c (look_ahead_tokens_print): Likewise.
5802 * src/output.c (escaped_output): Likewise.
5803 (user_actions_output): Break apart two printfs.
5804 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
5805 * src/reduce.c (reduce_print): Likewise.
5806 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
5807 * src/system.h: Include unlocked-io.h rathe than stdio.h.
5808
88c6637f
PE
5809 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5810 Use assignments rather than casts-to-void to suppress
5811 unused-variable warnings. This pacifies 'lint'.
5812 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
5813 unused-variable warnings.
5814
fb32e373
JMG
58152005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5816
5817 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5818
edb8f44f
PE
58192005-10-02 Paul Eggert <eggert@cs.ucla.edu>
5820
fb9c0b33
PE
5821 Use unlocked I/O for a minor performance improvement on hosts like
5822 GNU/Linux and Solaris that support unlocked I/O. The basic idea
5823 is to use the gnlib unlocked-io module, and to prefer putc and
5824 puts to printf when either will work (since the latter doesn't
5825 come in an unlocked flavor).
5826 * bootstrap (gnulib_modules): Add unlocked-io.
5827 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
5828 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
5829 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
5830 and similarly for puts and putc and printf.
5831 * data/yacc.c: Likewise.
5832 * lib/bitset.c (bitset_print): Likewise.
5833 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
5834 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
5835 to printf.
5836 * lib/lbitset.c (debug_lbitset): Likewise.
5837 * src/closure.c (print_firsts, print_fderives): Likewise.
5838 * src/gram.c (grammar_dump): Likewise.
5839 * src/lalr.c (look_ahead_tokens_print): Likewise.
5840 * src/output.c (escaped_output): Likewise.
5841 (user_actions_output): Coalesce two printfs.
2f4f028d 5842 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
5843 * src/reduce.c (reduce_print): Likewise.
5844 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 5845 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 5846
edb8f44f
PE
5847 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
5848 this confuses xgettext.
5849
b50d2359
AD
58502005-10-02 Akim Demaille <akim@epita.fr>
5851
5852 * bootstrap (gnulib_modules): Add strverscmp.
5853 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
5854 * m4/.cvsignore: Add strverscmp.m4.
5855 * src/parse-gram.y (%require): New token, new rule.
5856 (version_check): New.
5857 * src/scan-gram.l (%require): Adjust.
5858 * tests/input.at (AT_REQUIRE): New.
5859 Use it.
5860 * doc/bison.texinfo (Require Decl): New.
5861 (Calc++ Parser): Use %require.
5862
21667f64
AD
58632005-10-02 Akim Demaille <akim@epita.fr>
5864
5865 * data/location.cc: New.
5866
2b81e969
AD
58672005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
5868 Akim Demaille <akim@epita.fr>
5869
5870 Make sure -odir/foo.cc creates dir/location.hh etc.
5871 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
5872 (spec_file_prefix, spec_verbose_file, spec_graph_file)
5873 (spec_defines_file): Now const.
5874 (dir_prefix): New.
5875 (short_base_name): Remove.
5876 * src/files.c: Adjust.
5877 (dirname.h): Include.
5878 (base_name): Don't prototype it.
5879 (finput): Remove, duplicates gram_in.
5880 (full_base_name, short_base_name): Replace by...
5881 (all_but_ext, all_but_tab_ext): these.
5882 (compute_base_names): Rename as...
5883 (compute_file_name_parts): this.
5884 Update to compute the new variables, including dir_prefix.
5885 Adjust dependencies.
5886 * src/output.c (prepare): Output them.
5887 * src/reader.c: Adjust to use gram_in, not finput.
5888 * src/scan-skel.l (@dir_prefix@): New.
5889
ad6a9b97
JMG
58902005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5891
5892 * lib/subpipe.c: New function end_of_output_subpipe() added
5893 to allow support for non-posix systems. This is a no-op function
5894 for posix systems.
5895
5896 * lib/subpipe.h: New function end_of_output_subpipe() added
5897 to allow support for non-posix systems. This is a no-op function
5898 for posix systems.
5899
5900 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
5901 handle the lack of pipe/fork functionality on non-posix systems.
5902
5903 * djgpp/Makefile.maint: DJGPP specific file.
5904
5905 * djgpp/README.in: DJGPP specific file.
5906
5907 * djgpp/config.bat: DJGPP specific configuration file.
5908
5909 * djgpp/config.sed: DJGPP specific configuration file.
5910
5911 * djgpp/config.site: DJGPP specific configuration file.
5912
5913 * djgpp/config_h.sed: DJGPP specific configuration file.
5914
5915 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
5916
5917 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
5918
fc695704
AD
59192005-10-02 Akim Demaille <akim@epita.fr>
5920
5921 * data/location.cc: New, extract from...
5922 * data/lalr1.cc: here.
5923 (location.hh): Include it after the user prologue, in case the
5924 filename type is defined by the user.
5925 Forward declation location and position before the pre-prologue.
5926 (yyresult_): Rename as...
5927 (yyresult): this, it's a local variable, not an attribute.
5928 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
5929
59302005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
5931
5932 * examples/extexi: Restore the #line generation.
5933
fb9712a9
AD
59342005-09-30 Akim Demaille <akim@epita.fr>,
5935 Alexandre Duret-Lutz <adl@gnu.org>
5936
5937 Move the token type and YYSTYPE in the parser class.
5938 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
5939 (parser::token): New, from the moved free definition of tokens.
5940 (parser::semantic_value): Now a full definition instead of an
5941 indirection to YYSTYPE.
5942 (b4_post_prologue): No longer included in the header file, but
5943 in the implementation file.
5944 * doc/bison.texi (C+ Language Interface): Update.
5945 * src/parse-gram.y: Support unary %define.
5946 * tests/actions.at: Define global_tokens_and_yystype for backward
5947 compatibility until we update the tests.
5948 * tests/calc.at: Idem.
5949 (first_line, first_column, last_line, last_column): Define for lalr1.cc
5950 to simplify the code.
5951
55f0c7b1
PE
59522005-09-29 Paul Eggert <eggert@cs.ucla.edu>
5953
5954 Port to SunOS 4.1.4, which lacks strtoul and strerror.
5955 Ah, the good old days! Problem reported by Peter Klein.
5956 * bootstrap (gnulib_modules): Add strerror, strtoul.
5957 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
5958 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
5959
fb9712a9 59602005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
5961
5962 * data/c.m4 (b4_error_verbose_if): New.
5963 * data/lalr1.cc: Use it.
5964 (YYERROR_VERBOSE_IF): Remove.
5965 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
5966 parser members, replaced by...
5967 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
5968 local variables.
5969 (yysyntax_error_): Takes the state number as argument.
5970 (yyreduce_print_): Use the argument yyrule, not the former
5971 attribute yyn_.
5972
8a6f72f3
PE
59732005-09-26 Paul Eggert <eggert@cs.ucla.edu>
5974
5975 * bootstrap (gnulib_modules): Add verify.
5976 * lib/.cvsignore: Add verify.h.
5977 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
5978 * src/system.h (verify): Remove.
5979 Include verify.h instead.
5980 * src/tables.c (tables_generate): Use new API for 'verify'.
5981
0d50976f
PE
59822005-09-21 Paul Eggert <eggert@cs.ucla.edu>
5983
ebc3737e
PE
5984 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
5985 local variables whose names begin with 'yy'.
5986 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
5987 Trivial changes from Joel E. Denny.
5988
0d50976f
PE
5989 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
5990 it itself.
5991 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
5992 don't use alloca any more.
5993
5994 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
5995 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 5996 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
5997 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
5998 to match yacc.c, to test more hosts.
5999
a05b79df
PE
60002005-09-20 Paul Eggert <eggert@cs.ucla.edu>
6001
55289366
PE
6002 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
6003 doesn't affect behavior.
6004 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
6005 Solaris, AIX, MSC.
6006 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
6007 This works a bit better with glibc, if user code has already included
6008 stdlib.h.
6009 * doc/bison.texinfo (Bison Parser): Document that users can't
6010 arbitrarily use malloc and free for other purposes. Document
6011 that <alloca.h> and <malloc.h> might be included.
6012 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
6013 user must declare alloca.
6014
a05b79df
PE
6015 * HACKING (release): Forwarn the Translation Project about
6016 stable releses.
6017
3ab2ca22
AD
60182005-09-20 Akim Demaille <akim@epita.fr>
6019
6020 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
6021
a9739e7c
PE
60222005-09-19 Paul Eggert <eggert@cs.ucla.edu>
6023
a702593e
PE
6024 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
6025 (YYSTACK_ALLOC_MAXIMUM): Use it.
6026 (yysyntax_error): New function.
6027 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
6028 multiple syntax errors are reported, and alloca is being used.
6029 Instead, reallocate buffers twice as big each time, so that
6030 we waste at most half the allocated memory. Start with a small
6031 (128-byte) buffer that will suffice in most cases anyway.
6032 Use yysyntax_error to do most of the work.
6033
6034 * doc/bison.texinfo (Error Reporting, Table of Symbols):
6035 yynerrs is the number of errors reported, not the number of
6036 errors encountered.
6037
a9739e7c
PE
6038 * tests/glr-regression.at (Duplicated user destructor for lookahead):
6039 Mark it as expected to fail.
6040 Cast result of malloc; problem reported by twlevo@xs4all.nl.
6041 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
6042 Don't start user-code symbols with "yy", to avoid name space problems.
6043
f479c6c6
AD
60442005-09-19 Akim Demaille <akim@epita.fr>
6045
6046 Remove the traits, failed experiment.
6047 It never proved useful, and anyway because of the current
6048 definition, it was not possible to have several specialization of
6049 this traits, making it useless.
6050 * data/lalr1.cc (yy:traits): Remove.
6051 Inline its definitions in the parser class.
6052
e2586f82
AD
60532005-09-19 Akim Demaille <akim@epita.fr>
6054
6055 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
6056 least Mac OSX with a /usr/local install of gettext.
6057
2e8cf949
AD
60582005-09-19 Akim Demaille <akim@epita.fr>
6059
6060 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
6061 and yytoken for similarity with the other skeletons.
6062
c7fb0b90
AD
60632005-09-19 Akim Demaille <akim@epita.fr>
6064
4e26c69e 6065 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 6066
1bd0deda
PE
60672005-09-16 Paul Eggert <eggert@cs.ucla.edu>
6068
6069 * NEWS: Version 2.1.
6070
6071 * NEWS: Remove notice of yytname change, since it was never in an
6072 official release.
6073 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
6074 diagnostic.
6075 * src/output.c (prepare): Likewise.
6076 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
6077 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
6078 is not defined. This is an awful hack, but it's enough for now.
6079 All callers changed.
6080 * tests/glr-regression-at (make_value): Args are const pointers now,
6081 to avoid GCC warning.
6082 (Duplicated user destructor for lookahead): New test. Currently
6083 skipped. It fails on my host but I'm not sure it'll always fail.
6084
60852005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
6086
6087 * src/symtab.h (struct symbol): Declare the printer and destructor
6088 as const, to avoid accidental calls to free.
6089 (symbol_destructor_set, symbol_printer_set): Adjust.
6090 * src/symtab.c: Adjust.
6091
1bd0deda 60922005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
6093
6094 * data/c.m4 (b4_token_enums): New.
6095 (b4_token_defines): Rename as...
6096 (b4_token_enums_defines): this.
6097 (b4_token_defines): New, output only the #defines.
6098 * data/yacc.c, data/glr.c: Adjust.
6099 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
6100 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
6101 as default values.
6102
dbcdae2d
AD
61032005-09-16 Akim Demaille <akim@epita.fr>
6104
6105 * data/lalr1.cc (yylex_): Remove, inline its code.
6106 (yyreport_syntax_error_): Remove, replaced by...
6107 (yysyntax_error_): this which returns a string and leaves to the
6108 caller the call to the users' error function.
6109 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
6110 Move from members of the parser object...
6111 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
6112 to local variables of the parse function.
6113
70d8f291
AD
61142005-09-16 Akim Demaille <akim@epita.fr>
6115
6116 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
6117 since it's in Bison's name space.
6118
b47dbebe
PE
61192005-09-15 Paul Eggert <eggert@cs.ucla.edu>
6120
ae199bf1
PE
6121 * data/glr.c (yyresolveValue): Add default case to pacify
6122 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
6123
b47dbebe
PE
6124 * NEWS: Document when yyparse started to return 2.
6125 * doc/bison.texinfo (Parser Function): Document when yyparse
6126 returns 2.
6127
6128 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
6129 (b4_filename_type): Renamed back from b4_file_name_type. All uses
6130 changed.
6131 (class position): file_name -> filename (reverting). All uses changed.
6132
61332005-09-14 Paul Eggert <eggert@cs.ucla.edu>
6134
6135 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
6136 do anything if $@ exists. This reverts part of the 2005-07-07
6137 patch.
6138
00292f66
PE
61392005-09-11 Paul Eggert <eggert@cs.ucla.edu>
6140
6141 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
6142 contains obsolete information and isn't worth distributing as a
6143 separate file anyway.
6144 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
6145 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
6146 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
6147 (yyparse): Abort if user code uses longjmp to throw an unexpected
6148 value.
6149
a420f962
PE
61502005-09-09 Paul Eggert <eggert@cs.ucla.edu>
6151
00292f66
PE
6152 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
6153 Suggested by twlevo@xs4all.nl.
6154
127287e9
PE
6155 * data/glr.c (YYCHK1): Do not assume YYE is in range.
6156 This avoids a diagnostic from gcc -Wswitch-enum.
6157 Problem reported by twlevo@xs4all.nl.
6158
a420f962
PE
6159 * doc/bison.texinfo: Don't use "filename", as per GNU coding
6160 standards. Use "file name" or "file" or "name", depending on
6161 the context.
6162 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
6163 not to hack/foo.tab.c.
6164 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
6165 * data/glr.c: b4_filename -> b4_file_name.
6166 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
6167 All uses changed.
6168 (class position): filename -> file_name. All uses changed.
6169 * data/yacc.c: b4_filename -> b4_file_name.
6170 * lib/bitset.h: filename -> file_name in local vars.
6171 * lib/bitset_stats.c: Likewise.
6172 * src/files.c: Likewise.
6173 * src/scan-skel.l ("@output ".*\n): Likewise.
6174 * src/files.c (file_name_split): Renamed from filename_split.
6175 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
6176
61772005-09-08 Paul Eggert <eggert@cs.ucla.edu>
6178
6179 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
6180 to accommodate latest gnulib.
6181
6182 * tests/glr-regression.at (Duplicate representation of merged trees):
6183 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
6184
6185 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
6186 needed.
6187
42a6501d
PE
61882005-08-26 Paul Eggert <eggert@cs.ucla.edu>
6189
6190 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
6191 All uses changed. Invoke user destructor after an error during a
6192 split parse (trivial change from Joel E. Denny).
6193
6194 * tests/glr-regression.at
6195 (User destructor after an error during a split parse): New test case.
6196 Problem reported by Joel E. Denny in:
6197 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
6198
ef9a1faf
PE
61992005-08-25 Paul Eggert <eggert@cs.ucla.edu>
6200
5b4aaf78
PE
6201 * README-cvs: Give URLs for recommended tools.
6202 Mention Gzip version problem, and bootstrapping issues.
6203 Remove troubleshooting section, as it's somewhat obsolete.
6204
b5240ba5
PE
6205 * bootstrap (no_cache): New var, to accommodate different wget
6206 variants. Use it instead of '-C off'. Problem reported by
6207 twlevo@xs4all.nl.
6208
ef9a1faf
PE
6209 * data/glr.c (yydestroyStackItem): New function.
6210 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
6211 debugging information. Problem reported by Joel E. Denny.
6212
e6efa9da
AD
62132005-08-25 Akim Demaille <akim@epita.fr>
6214
6215 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
6216
adc90f13
PE
62172005-08-24 Paul Eggert <eggert@cs.ucla.edu>
6218
6219 * data/glr.c (yyrecoverSyntaxError, yyreturn):
6220 Don't invoke destructor on unresolved entries.
6221 * tests/glr-regression.at
6222 (User destructor for unresolved GLR semantic value): New test case.
6223 Problem reported by Joel E. Denny in:
6224 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
6225
f9315de5
PE
62262005-08-21 Paul Eggert <eggert@cs.ucla.edu>
6227
15d29c1f
PE
6228 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
6229 Add strnlen.c.
6230 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
6231 lib-prefix.m4, po.m4.
6232
dd5f2af2
PE
6233 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
6234 in yydestruct diagnostic, since it might not be an error.
6235 Problem reported by Joel Denny near end of
6236 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 6237 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
6238 * data/yacc.c (yyreturn): Likewise.
6239 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
6240
6241 * src/files.c: Remove obsolete FIXME comment.
6242
6243 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
6244 with the other templates, and to fix bogus run-on messages such
6245 as the one reported at the end of
6246 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6247 All callers changed to avoid the newline.
6248 (yyprocessOneStack): Output two lines rather than one, to accommodate
6249 the above change. This changes the debug output format slightly.
6250
f9315de5
PE
6251 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
6252 reported by Joel E. Denny in
6253 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
6254 (trivial change).
6255 * tests/glr-regression.at (Duplicate representation of merged trees):
6256 New test, from Joel E. Denny in:
6257 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
6258 * THANKS: Add Joel E. Denny.
6259
6260 * configure.ac (AC_INIT): Bump to 2.0c.
6261
04098407
PE
62622005-07-24 Paul Eggert <eggert@cs.ucla.edu>
6263
6264 * NEWS: Version 2.0b.
6265
ca5d2013
PE
6266 * Makefile.am (SUBDIRS): Put examples before tests, so that
6267 "make check" doesn't finish with "All 1 tests passed".
6268
3d54b576
PE
6269 * tests/regression.at (Token definitions): Don't rely on
6270 AT_PARSER_CHECK for data that contains backslashes. It currently
6271 uses 'echo', and 'echo' isn't portable if its argument contains
6272 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
6273 that the byte '\0xff' is not printable in the C locale; it is,
6274 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
6275 not printable, so use '\0x81' to test.
6276
d53ae497
PE
6277 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
6278 version of GCC, since the macro is used with non-GCC compilers.
6279
fc01665e
PE
6280 Fix core dump reported by Pablo De Napoli in
6281 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
6282 * tests/regression.at (Invalid inputs with {}): New test.
6283 * src/parse-gram.y (token_name): Translate type before using
6284 it as an index.
6285
04098407
PE
6286 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
6287 the user's name space. All uses changed to __attribute__
6288 ((__unused__)).
6289 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
6290 Add __attribute__ ((__noreturn__)).
6291
6292 * etc/clcommit: Remove. We weren't using it, and it failed
6293 "make maintainer-distcheck".
6294 * Makefile.maint: Merge from coreutils.
6295 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
6296 (syntax-check-rules): Change list of rules as described below.
6297 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
6298 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
6299 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
6300 (sc_trailing_space): New rules.
6301 (sc_xalloc_h_in_src): Remove.
6302 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
6303 (sc_space_tab, sc_error_exit_success, sc_changelog):
6304 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
6305 (makefile-check, po-check, author_mark_check):
6306 (makefile_path_separator_check, copyright-check):
6307 Use grep -n, to make it easier to find violations.
6308 Use CVS_LIST and CVS_LIST_EXCEPT.
6309 (header_regexp, h_re): Remove.
6310 (dd_c): New macro.
6311 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
6312 (my-distcheck): Use more-modern GCC flags.
6313 (signatures, %.asc): Remove.
6314 (rel-files, announcement): Remove signatures.
6315 Restore old updating code, even though we don't use it, so
6316 that we're the same as coreutils.
6317 (alpha, beta, major): Depend on news-date-check.
6318 Make the upload commands.
6319
6320 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
6321 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
6322 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
6323 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
6324 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
6325 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
6326 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
6327 * tests/sets.at: Likewise.
6328
6329 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
6330 we comment out the Autoconf version number.
6331 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
6332 it's error-prone and "make maintainer-distcheck" rejects it.
6333
6334 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
6335 Indent calls to "error" to pacify "make maintainer-distcheck",
6336 when the calls are not intended to be translated.
6337 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
6338
6339 * src/Makefile.am (DEFS): Use +=, to pacify
6340 "make maintainer-distcheck".
6341 (bison_SOURCES): Add scan-skel.h.
6342 (sc_tight_scope): New rule, from coreutils.
6343
6344 * src/files.c (src_extension, header_extension):
6345 Now static, not extern.
6346 * src/getargs.c (short_options): Likewise.
6347 * src/muscle_tab.c (muscle_table): Likewise.
6348 * src/parse-gram.y (current_class, current_type, current_prec):
6349 Likewise.
6350 * src/reader.c (grammar_end, previous_rule_end): Likewise.
6351 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
6352 * src/main.c (main): Cast bindtextdomain and textdomain calls to
6353 void, to avoid warning when NLS is disabled.
6354 * src/output.c: Include scan-skel.h.
6355 (scan_skel): Remove decl, since scan-skel.h does this.
6356 (output_skeleton):
6357 Indent calls to "error" to pacify "make maintainer-distcheck".
6358 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
6359 * src/reader.h (gram_end, gram_lineno): New decls to pacify
6360 "make maintainer-distcheck".
6361 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
6362 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
6363 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
6364 (skel_lex_destroy, scan_skel): Move these decls to...
6365 * src/scan-skel.h: New file.
6366 * src/uniqstr.c (uniqstr_assert):
6367 Indent calls to "error" to pacify "make maintainer-distcheck".
6368
6369 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
6370 not @VAR@.
6371
6372 * tests/torture.at: Revamp to avoid misuse of atoi that
6373 "make maintainer-distcheck" complained about.
6374
6375 * examples/extexi (message): Don't print a message more than once,
6376 and omit line-number decoration that makes Emacs compile think
6377 that informative messages are worth worrying about.
6378
63792005-07-22 Paul Eggert <eggert@cs.ucla.edu>
6380
6381 * configure.ac: Update version number.
6382
6383 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
6384 accidentally.
6385 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
6386 autogenerated by the maintainer.
6387 * examples/calc++/.cvsignore: Add *.yy.
6388
6389 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
6390 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6391 * lib/bitsetv.c (bitsetv_alloc): Likewise.
6392
6393 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
6394
6395 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
6396 from maintainer-distcheck about casting the argument of 'free'.
6397
6398 * NEWS: Mention recent yytname changes.
6399 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
6400
6401 * bootstrap: For translations that have not yet been upgraded to
6402 the new runtime-po domain, prime the pump by extracting the
6403 relevant strings from the obsolete translations. This code can be
6404 removed once the bison-runtime domain has been translated by each
6405 team.
6406
6407 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
6408 now that token names are already quoted.
6409
6410 Fix problem reported by Anthony Heading.
6411 * data/glr.c (YYTOKEN_TABLE): New macro.
6412 (yytname): Define if YYTOKEN_TABLE.
6413 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
6414 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
6415 (YYERROR_VERBOSE): Define the same way the other skeletons do.
6416 * src/output.c (prepare_symbols): Output token_table_flag.
6417
0ffda363
PE
64182005-07-21 Paul Eggert <eggert@cs.ucla.edu>
6419
6420 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
6421 again if the first call fails.
6422
6423 * data/glr.c (yytnamerr): New function.
6424 (yyreportSyntaxError): Use it to dequote most string literals.
6425 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
6426 with other skeletons. All uses changed.
6427 (yytnameerr_): New function.
6428 (yyreport_syntax_error): Use it to dequote most string literals.
6429 * data/yacc.c (yytnamerr): New function.
6430 (yyerrlab): Use it to decode most string literals.
6431 * doc/bison.texinfo (Decl Summary, Calling Convention):
6432 Clarify quoting convention of yytname.
6433 * src/output.c (prepare_symbols): Quote all names. This undoes
6434 the 2005-04-17 change, which is now accomplished (mostly) via
6435 changes in the parsers as described above.
6436 * tests/regression.at (Token definitions, Web2c Actions):
6437 Undo most 2005-04-17 change here, too.
6438
64392005-07-20 Paul Eggert <eggert@cs.ucla.edu>
6440
6441 Fix more problems reported by twlevo@xs4all.nl.
6442 * tests/cxx-type.at: Don't pipe output of ./types through sed to
6443 remove trailing spaces. This loses the exit status of ./types,
6444 and isn't needed since ./types shouldn't be emitting trailing
6445 spaces.
6446 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
6447 as the stack isn't valid in that case.
6448
6449 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6450 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6451 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6452 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
6453 is used.
6454 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
6455 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6456 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6457 Likewise.
6458
6459 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
6460 overly-picky compilers that reject 'char *foo = "bar";'.
6461
6462 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
6463 to FILE * parameter, not to stderr. This fixes a typo introduced
6464 in the 2005-07-12 change.
6465
6466 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
6467 warnings from GCC 4.
6468
6469 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
6470 (yyglrShiftDefer, yysplitStack):
6471 Remove unused parameters b4_pure_formals. All uses changed.
6472 (yyglrShift): Remove unused parameters b4_user_formals.
6473 All uses changed.
6474 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
6475
6100a9aa
PE
64762005-07-18 Paul Eggert <eggert@cs.ucla.edu>
6477
258b75ca
PE
6478 Destructor cleanups and regularization among the three skeletons.
6479 * NEWS: Document the behavior changes.
6480 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
6481 stack before failing, as the cleanup code will do it for us now.
6482 * data/lalr1.cc (yyerrlab): Likewise.
6483 * data/glr.c (yyparse): Pop everything off the stack before
6484 freeing it, so that destructors get called properly.
6485 * data/lalr1.cc (yyreturn): Likewise.
6486 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
6487 This is more consistent.
6488 * doc/bison.texinfo (Destructor Decl): Mention more reasons
6489 why destructors might be called. 1.875 -> 2.1.
6490 (Destructor Decl, Decl Summary, Table of Symbols):
6491 Some English-language cleanups for %destructor.
6492 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6493 Add output line for destructor of start symbol.
6494 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
6495 because of that same extra output line.
6496
1a059451
PE
6497 * NEWS: Document minor wording changes in diagnostics of
6498 Bison-generated parsers.
6499 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
6500 Remove unused formals. All uses changed.
6501 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
6502 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
6503 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
6504 Rename yyoverflowab to yyexhaustedlab.
6505 When memory exhaustion occurs during syntax-error reporting,
6506 report it separately rather than in a single diagnostic; this
6507 eases translation.
6508 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
6509 (Memory Exhausted): Renamed from Parser Stack Overflow.
6510 Revamp wording slightly to prefer "memory exhaustion".
6511 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
6512
97460c78
PE
6513 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
6514
30757c8c
PE
6515 Add i18n support to the GLR skeleton. Partially fix the C++
6516 skeleton; a C++ expert needs to finish this. Remove debugging
6517 msgids; there's little point to having them translated, since they
6518 can be understood only by someone who can read the
6519 (English-language) source code.
6520
6521 Generate runtime-po/bison-runtime.pot automatically, so that we
6522 don't have to worry about garbage getting in that file. We'll
6523 make sure after the next official release that old msgids don't
6524 get lost. See
6525 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
6526
6527 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
6528 Now auto-generated.
6529 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
6530 Fix typos in explanations of the runtime file.
6531 * bootstrap: Change gettext keyword from YYI18N to YY_.
6532 Use standard Makefile.in.in in runtime-po, since we'll arrange
6533 for backward-compatible bison-runtime.po files in a different way.
6534 * data/glr.c (YY_): New macro, from yacc.c.
6535 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
6536 Translate messages intended for users.
6537 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
6538 the wording in the other skeletons. We don't know that the memory
6539 is virtual.
6540 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
6541 Use same method that yacc.c uses.
6542 Don't translate debugging messages.
6543 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
6544 it doesn't work (yet), and requires C++ expertise to fix.
6545 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
6546 Move defn to a more logical place, to be consistent with other
6547 skeletons.
6548 Don't translate debugging messages.
6549 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
6550 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
6551 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
6552 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
6553
ac8c5689
PE
6554 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
6555 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
6556 void, not int.
6557 * tests/glr-regression.at (Badly Collapsed GLR States):
6558 Likewise.
6559 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6560 yylex should return 0 at EOF rather than aborting.
6561
6100a9aa
PE
6562 Improve tests for stack overflow in GLR parser.
6563 Problem reported by twlevo@xs4all.nl.
6564 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
6565 All uses removed.
6566 (yyStackOverflow): Just longjmp, but with value 2 so that caller
6567 can handle the problem.
6568 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
6569 (yyparse): New local variable yyresult to record the result.
6570 Use result of setjmp to set it, rather than storing itinto
6571 struct.
6572 (yyDone): Remove label.
6573 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
6574 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
6575 if YYABORT is used).
6576 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
6577 yyparse status; put status > 1 into diagnostic.
6578 Check that status==2 works.
6579 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
6580 Use exit status 3 for failure to open (which shouldn't happen).
6581
15f40952
PE
65822005-07-17 Paul Eggert <eggert@cs.ucla.edu>
6583
67fd79c4
PE
6584 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
6585 1 on syntax error; just let yyparse do its thing.
6586 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
6587 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
6588 (Exploding the Stack Size with Alloca):
6589 (Exploding the Stack Size with Malloc):
6590 Expect exit status 2, not 1, since the parser is supposed to blow
6591 its stack. Problem reported by twlevo@xs4all.nl.
6592
15f40952
PE
6593 * data/glr.c (yyparse): Don't assume that the initial calls
6594 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
6595 Print a stack-overflow message and fail instead.
6596 Initialize the line-number information before creating the stack,
6597 so that the stack-overflow message can report line zero safely.
6598
f32c66b5
PE
65992005-07-14 Paul Eggert <eggert@cs.ucla.edu>
6600
a22ff96f 6601 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
6602 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
6603 (yyuserMerge): Provide a default case if b4_mergers is empty.
6604 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
6605 * tests/glr-regression.at
6606 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 6607 Add casts to pacify C++ compilers.
1beb0b24
PE
6608 * tests/glr-regression.at (Improper merging of GLR delayed action
6609 sets): Declare yylex before using it.
f32c66b5 6610 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
6611 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
6612 test for valgrind; valgrind is independent of g++.
6613 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
6614 for compatibility with POSIX 1003.1-2001 (if running coreutils).
6615 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
6616 Use a destructor, so that we can expand the stack. Change
6617 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 6618
d741bd1b
PE
66192005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6620
6621 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
6622 a valgrind failure. Problem reported by twlevo@xs4all.nl.
6623
0410a6e0
PE
66242005-07-13 Paul Eggert <eggert@cs.ucla.edu>
6625
6626 * PACKAGING: New file, suggested by Bruno Haible and taken from
6627 similar wording in gettext's PACKAGING file.
6628 * NEWS: Mention PACKAGING.
6629 * Makefile.am (EXTRA_DIST): Add PACKAGING.
6630
f7ab6a50
PE
66312005-07-12 Paul Eggert <eggert@cs.ucla.edu>
6632
baf785db 6633 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
6634 * bootstrap: Get runtime translations into runtime-po.
6635 Create runtime-po files automatically, if possible.
6636 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
6637 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
6638 does not infringe on the user's name space.
6639 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
6640 * doc/bison.texinfo (Internationalization): Revamp the English
6641 and Texinfo syntax a bit, to try to make it clearer.
6642 (Bison Options, Option Cross Key): Mention --print-localedir.
6643 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
6644 YYENABLE_NLS. Quote a bit more.
6645 * runtime-po/.cvsignore: New file.
6646 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
6647 * runtime-po/Rules-quot: Remove; now created by bootstrap.
6648 * runtime-po/quot.sed: Likewise.
6649 * runtime-po/boldquot.sed: Likewise.
6650 * runtime-po/en@quot.header: Likewise.
6651 * runtime-po/en@boldquot.header: Likewise.
6652 * runtime-po/insert-header.sin: Likewise.
6653 * runtime-po/remove-potcdate.sin: Likewise.
6654 * runtime-po/Makevars: Likewise.
6655 * runtime-po/LINGUAS: Likewise.
6656 * runtime-po/de.po: Likewise; we will rely on the translation project
6657 to maintain this, so "bootstrap" should get it.
0410a6e0 6658 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
6659 its value.
6660 * src/main.c (main): Bind the bison-runtime domain, too.
6661
66622005-07-12 Bruno Haible <bruno@clisp.org>
6663
6664 * data/yacc.c: Include <libintl.h> when NLS is enabled.
6665 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
6666 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
6667 * runtime-po: New directory.
6668 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
6669 $(DOMAIN).pot-update rule, so that old messages are never dropped.
6670 * runtime-po/Rules-quot: New file, copied from po/.
6671 * runtime-po/quot.sed: Likewise.
6672 * runtime-po/boldquot.sed: Likewise.
6673 * runtime-po/en@quot.header: Likewise.
6674 * runtime-po/en@boldquot.header: Likewise.
6675 * runtime-po/insert-header.sin: Likewise.
6676 * runtime-po/remove-potcdate.sin: Likewise.
6677 * runtime-po/Makevars: New file.
6678 * runtime-po/POTFILES.in: New file.
6679 * runtime-po/LINGUAS: New file.
6680 * runtime-po/bison-runtime.pot: New file.
6681 * runtime-po/de.po: New file.
6682 * m4/bison.m4: New file.
6683 * Makefile.am (SUBDIRS): Add runtime-po.
6684 (aclocaldir, aclocal_DATA): New variables.
6685 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
6686 Define aclocaldir.
6687 * src/getargs.c (usage): Document --print-localedir option.
6688 (PRINT_LOCALEDIR_OPTION): New enum item.
6689 (long_options): Add --print-localedir option.
6690 (getargs): Handle --print-localedir option.
6691 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
6692 (Internationalization): New section.
6693
22dda0f0
AD
66942005-07-12 Akim Demaille <akim@epita.fr>
6695
6696 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
6697 for consistency with the rest of the code.
6698 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
6699 Add separators.
6700
82b248ad
AD
67012005-07-12 Akim Demaille <akim@epita.fr>
6702
6703 * src/parse-gram.y: Use %printer instead of YYPRINT.
6704
fa0e9314
AD
67052005-07-12 Akim Demaille <akim@epita.fr>
6706
867a3e00
AD
6707 * src/symtab.h, src/symtab.c (symbol_print): New.
6708 * src/symlist.h, src/symlist.c (symbol_list_print): New.
6709 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
6710
67112005-07-12 Akim Demaille <akim@epita.fr>
6712
6713 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
6714 b4_at_dollar and b4_dollar_dollar.
6715
e054b190
PE
67162005-07-11 Paul Eggert <eggert@cs.ucla.edu>
6717
6718 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
6719 and Pennello's paper.
6720
34160ec4
PE
67212005-07-09 Paul Eggert <eggert@cs.ucla.edu>
6722
407d4a75
PE
6723 * data/yacc.c (yyparse): Undo previous patch. Instead,
6724 set yylsp[0] and yyvsp[0] only if the initial action
6725 sets yylloc and yylval, respectively.
6726
34160ec4
PE
6727 * data/yacc.c (yyparse): In the initial action, set
6728 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
6729 This avoids the use of undefined variables if the initial
6730 action does not set yylloc and/or yylval.
6731
c3d5a4a7
PE
67322005-07-07 Paul Eggert <eggert@cs.ucla.edu>
6733
b34d96c1
PE
6734 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
6735 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
6736 Remove from CVS. These files are automatically generated.
6737 * examples/extexi: Clarify that this file is now part of Bison,
6738 not GNU M4, and that it works with any POSIX-compatible Awk.
6739 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
6740 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
6741 so that we also get calc++-parser.yy. Geneate it.
6742 Use $(AWK), not gawk, since any conforming Awk will do.
6743 Put comment before action, since older 'make' can't handle comment
6744 in action.
6745 $(BUILT_SOURCES): List all built sources, not just some of them.
6746 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
6747 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
6748 $($(calc_sources_generated)): Remove unnecessary test for existence
6749 of target. (This had a shell syntax error anyway; a stray "x".)
6750 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
6751 calc++-parser.yy.
6752 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
6753
c3d5a4a7
PE
6754 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
6755 implied by the other modules.
6756
828c373b
AD
67572005-07-06 Akim Demaille <akim@epita.fr>
6758
6759 Bind examples/calc++ to the package.
6760 * examples/calc++/Makefile: Remove, replaced by...
6761 * examples/calc++/Makefile.am: ... this new file.
6762 * examples/calc++/test: Remove input.
6763 * examples/calc++/compile: Remove.
6764 * examples/Makefile.am: New.
6765 * configure.ac, Makefile.am: Adjust.
6766 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
6767
63cb01d6
PE
67682005-07-05 Paul Eggert <eggert@cs.ucla.edu>
6769
fd2df2ed
PE
6770 * data/glr.c (yyFail): Drastically simplify; since the format argument
6771 never had any % directives, we can simply pass it to yyerror.
6772 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
6773 be modified later, as that is the usual style in glr.c.
6774 Problems reported by Paul Hilfinger.
6775
63cb01d6
PE
6776 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
6777 and size overflow errors.
6778 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
6779 in case the user prolog sets feature-test macros like _GNU_SOURCE.
6780 (YYSIZEMAX): New macro.
6781 (yystpcpy): New function, taken from yacc.c.
6782 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
6783 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
6784 so that we don't have to maintain their signatures.
6785 (yyFail): Check for buffer overflow, by using vsnprintf rather
6786 than vsprintf. Allocate a bigger buffer if possible.
6787 Report an error if buffer allocation fails.
6788 (yyStackOverflow): New function.
6789 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
6790 the initialization was successful. It might fail if storage was
6791 exhausted.
6792 (yyexpandGLRStack): Add more checks for storage allocation failure.
6793 Use yyStackOverflow to report failures.
6794 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
6795 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
6796 Don't assume stack number fits in int.
6797 (yysplitStack): Check for storage allocation failure.
6798 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
6799 can print diagnostics on storage allocation failure. All callers
6800 changed.
6801 (yyresolveValue): Use yybool for boolean.
6802 (yyreportSyntaxError): Check for size-calculation overflow.
6803 This code is taken from yacc.c.
6804 (yyparse): Check for storage allocation errors when allocating
6805 the initial stack.
6806
1c59e0a1
AD
68072005-07-05 Akim Demaille <akim@epita.fr>
6808
6809 Extract calc++ from the documentation.
6810 * doc/bison.texinfo (Calc++): Add the extraction marks.
6811 * examples/extexi: New, from the aborted GNU Programming 2E.
6812 Separate the different paragraph of a file with empty lines.
6813 * examples/Makefile: Use it to extract the whole calc++ example.
6814
8a0adb01
AD
68152005-06-24 Akim Demaille <akim@epita.fr>
6816
6817 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
6818 class typedefs.
6819
12545799
AD
68202005-06-22 Akim Demaille <akim@epita.fr>
6821
6822 * doc/bison.texinfo (C++ Language Interface): First stab.
6823 (C++ Parsers): Remove.
6824
99be0235
AD
68252005-06-22 Akim Demaille <akim@epita.fr>
6826
6827 * data/lalr1.cc (yylex_): Honor %lex-param.
6828
0ffd4fd1
AD
68292005-06-22 Akim Demaille <akim@epita.fr>
6830
6831 Start a set of simple examples.
6832 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
6833 * examples/calc++/calc++-driver.hh,
6834 * examples/calc++/calc++-parser.yy,
6835 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
6836 * examples/calc++/compile, examples/calc++/test: New.
6837
0925ebb4
PE
68382005-06-09 Paul Eggert <eggert@cs.ucla.edu>
6839
6840 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
6841 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
6842 which stems from the 2005-05-27 patch.
6843
43d3b664
PH
68442005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6845
6846 * data/glr.c: Modify treatment of unused parameters to permit use
6847 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
6848
3062864d
PE
68492005-05-30 Paul Eggert <eggert@cs.ucla.edu>
6850
6851 Fix infringement on user name space reported by Janos Zoltan Szabo.
6852 * data/yacc.c (yyparse): strlen -> yystrlen.
6853
989b5b8e
AD
68542005-05-30 Akim Demaille <akim@epita.fr>
6855
6856 * data/lalr1.cc (_): New.
6857 Translate the various messages.
6858
bedf57f5
PE
68592005-05-27 Paul Eggert <eggert@cs.ucla.edu>
6860
6861 Fix infringement on user name space reported by Bruno Haible.
6862 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
6863 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
6864 the user's name space.
6865 (alloca): Include <stdlib.h> to get it, if it's not built in.
6866 (YYMALLOC, YYFREE): Define only if needed.
6867 (malloc, free): Declare, but only if needed, as this infringes on
6868 the user name space.
6869
4d1801f1
PE
68702005-05-25 Paul Eggert <eggert@cs.ucla.edu>
6871
6872 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
6873 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
6874 with %d format.
6875 * lib/ebitset.c (min, max): Undef before defining.
6876 * lib/vbitset.c (min, max): Likewise.
6877 * lib/subpipe.c (create_subpipe): Save local variables in case
6878 vfork clobbers them.
6879
68802005-05-24 Bruno Haible <bruno@clisp.org>
6881
6882 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
6883 error message syntax used by gcc-4.0.
6884
b94a9e1e
PE
68852005-05-23 Paul Eggert <eggert@cs.ucla.edu>
6886
85ac3861
PE
6887 * README: Mention m4 1.4.3. Remove obsolete advice about
6888 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
6889
b94a9e1e
PE
6890 * bootstrap: Remove workaround for problem I encountered with
6891 gettext 0.14.1; it seems to be fixed now.
6892
51c30d21
PE
68932005-05-22 Paul Eggert <eggert@cs.ucla.edu>
6894
009ce67d
PE
6895 * NEWS: Version 2.0a.
6896
f2a97c62
PE
6897 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
6898 the previous change.
6899
c8775f93
PE
6900 Various maintainer cleanups.
6901 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
6902 conftest*, for benefit of CVS commands run at the same time as
6903 "configure". Add build-aux, since "bootstrap" now creates it and
6904 its subfiles.
6905 * Makefile.cfg (move_if_change): Remove.
6906 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
6907 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
6908 (po_repo, do-po-update, po-update, wget_files, get-targets):
6909 (config.guess-url_prefix, config.sub-url_prefix):
6910 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
6911 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
6912 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
6913 Remove.
6914 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
6915 this is now the recommended name.
6916 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
6917 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
6918 ylwrap. These files now go into build-aux.
6919 * config/move-if-change: Remove.
6920 * config/prev-version.txt: Bump from 1.75 to 2.0.
6921
3ea5f0ec
PE
6922 * bootstrap: Add stdio-safer, unistd-safer modules.
6923 Remove m4/glibc2.m4 (introduced by latest gnulib, but
6924 we don't need it).
6925 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
6926 fopen-safer.c, stdio-safer.h, unistd-safer.h.
6927 * lib/subpipe.c: Include "unistd-safer.h".
6928 (create_subpipe): Make sure all the newly-created
6929 file descriptors are > 2, so that diagnostics don't
6930 get sent down them (which might cause Bison to hang, in theory).
6931 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
6932 * src/files.c (xfopen): Use fopen_safer, not fopen.
6933
51c30d21
PE
6934 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
6935 yesterday's yacc.c fix.
6936
cea1469d
PE
69372005-05-21 Paul Eggert <eggert@cs.ucla.edu>
6938
3ea5f0ec
PE
6939 * data/glr.c, data/lalr1.cc: Update copyright date.
6940
cea1469d
PE
6941 Fix a destructor bug reported by Wolfgang Spraul in
6942 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
6943 * data/yacc.c (yyabortlab): Don't call destructor, and
6944 don't set yychar to EMPTY.
6945 (yyoverflowlab): Don't call destructor.
6946 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
6947 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
6948 since we no longer output the message "discarding lookahead token
6949 end of input ()".
6950
5e6f62f2
PH
69512005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6952
6953 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
6954 fix a small glitch in debugging output.
6955 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
6956 after YY_SYMBOL_PRINT where needed.
6957
6958 (struct yyGLRState): Add some comments.
6959 (struct yySemanticOption): Add some comments.
6960 (union yyGLRStackItem): Add comment.
6961
6962 (yymergeOptionSets): Correct this to properly perform the union,
6963 avoiding infinite reported by Michael Rosien.
6964 Update comment.
6965
6966 * tests/glr-regression.at: Add test for GLR merging error reported
6967 by M. Rosien.
cea1469d 6968
0fb669f9
PE
69692005-05-13 Paul Eggert <eggert@cs.ucla.edu>
6970
6971 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
6972 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
6973 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
6974 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
6975 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
6976 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
6977 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
6978 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
6979 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
6980 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
6981 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
6982 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
6983 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
6984 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
6985 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
6986 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
6987 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
6988 src/derives.h, src/files.c, src/files.h, src/getargs.c,
6989 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
6990 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
6991 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
6992 src/output.h, src/parse-gram.c, src/parse-gram.h,
6993 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
6994 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
6995 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
6996 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
6997 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
6998 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
6999 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
7000 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
7001 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
7002 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
7003 tests/reduce.at, tests/regression.at, tests/sets.at,
7004 tests/synclines.at, tests/testsuite.at, tests/torture.at:
7005 Update FSF postal mail address.
7006
51f4735e
PE
70072005-05-11 Paul Eggert <eggert@cs.ucla.edu>
7008
7009 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
7010 Problem reported by Ralf Menzel.
7011
80ce3401
PE
70122005-05-01 Paul Eggert <eggert@cs.ucla.edu>
7013
7014 * tests/actions.at: Test that stack overflow invokes destructors.
7015 From Marcus Holland-Moritz.
7016 * data/yacc.c (yyerrlab): Move the code that destroys the stack
7017 from here....
7018 (yyreturn): to here. That way, destructors are called properly
7019 even if the stack overflows, or the user calls YYACCEPT or
7020 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
7021 (yyoverflowlab): Destroy the lookahead.
7022
70232005-04-24 Paul Eggert <eggert@cs.ucla.edu>
7024
7025 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
7026
72f000b0
PE
70272005-04-17 Paul Eggert <eggert@cs.ucla.edu>
7028
7029 * NEWS: Bison-generated C parsers no longer quote literal strings
7030 associated with tokens.
7031 * src/output.c (prepare_symbols): Don't escape strings,
7032 since users don't want to see C escapes.
7033 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
7034 in diagnostics.
c19683bb 7035 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
7036 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
7037
1094323f
PE
70382005-04-16 Paul Eggert <eggert@cs.ucla.edu>
7039
7040 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
7041 the data size is known to be too small and we can't increase it.
7042 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
7043
ca407bdf
PE
70442005-04-15 Paul Eggert <eggert@cs.ucla.edu>
7045
7046 * src/parse-gram.y: Include quotearg.h.
7047 (string_as_id): Quote $1 before using it as a key, since the
7048 lexer no longer quotes it for us.
7049 (string_content): Don't strip quotes, since lexer no longer
7050 quotes it for us.
7051 * src/scan-gram.l: Include quotearg.h.
7052 ("\""): Omit quote.
7053 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
7054 a key, since the rest of the lexer doesn't quote it.
7055 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
7056 * tests/regression.at (Token definitions): Check for backslashes
7057 in token strings.
7058
7059 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
7060 (YYSIZE_T): Define to unsigned long int when using an older compiler.
7061 (yyparse): Revamp code to generate long syntax error message, to
7062 make it easier to translate, and to avoid problems with arithmetic
7063 overflow. Change "virtual memory" to "memory" in diagnostic, since
7064 we don't know whether the memory is virtual.
7065
1ce59070
PE
70662005-04-13 Paul Eggert <eggert@cs.ucla.edu>
7067
7068 * NEWS: Bison-generated C parsers now use the _ macro to
7069 translate strings.
7070 * data/yacc.c (_) [!defined _]: New macro.
7071 All English strings wrapped inside this macro.
7072 * doc/bison.texinfo (Bison Parser): Document _.
7073 * po/POTFILES.in: Include src/parse-gram.c, since it now
7074 includes translateable strings that parse-gram.y doesn't.
7075
a749a695
PE
70762005-04-12 Paul Eggert <eggert@cs.ucla.edu>
7077
7078 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
7079 reverting the 2004-10-11 change to this function.
7080 (symbol_check_alias_consistency): Don't call symbol_type_set
7081 if the type name is already correct.
7082 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
7083
8fb1053b
PE
70842005-03-25 Paul Eggert <eggert@cs.ucla.edu>
7085
7086 * tests/regression.at (Token definitions): Don't use a token named
7087 c, as that generates a "#define c ..." that runs afoul of buggy
7088 stdlib.h that uses the identifier c as a member of struct
7089 drand48_data. Problem reported by Horst Wente.
7090
ff498c4a
PE
70912005-03-21 Paul Eggert <eggert@cs.ucla.edu>
7092
7093 * bootstrap: Change translation URL from
7094 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
7095 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
7096 redirection glitches. Problem reported by twlevo@xs4all.nl.
7097
65211d70
PE
70982005-03-20 Paul Eggert <eggert@cs.ucla.edu>
7099
7100 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
7101 after operands; POSIX says this isn't portable for the c99 command.
7102
9577fb1f
PE
71032005-03-18 Paul Eggert <eggert@cs.ucla.edu>
7104
7105 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
7106 immediately if a data overrun has occurred; this may help us track
7107 down what may be a spurious failure on MacOS.
7108
78b178f7
PE
71092005-03-17 Paul Eggert <eggert@cs.ucla.edu>
7110
a2599d0f
PE
7111 Respond to problems reported by twlevo@xs4all.nl.
7112
7113 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
7114
78b178f7
PE
7115 * src/vcg.h: Comment fix.
7116 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
7117 (G_CMAX): Change to -1 instead of INT_MAX.
7118
7119 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 7120
7296e729
PE
71212005-03-15 Paul Eggert <eggert@cs.ucla.edu>
7122
7123 * src/tables.c (state_number_to_vector_number): Put it inside an
7124 "#if 0", since it's not currently used. Problem reported by
7125 Roland McGrath.
7126
05ac60f3
PE
71272005-03-06 Paul Eggert <eggert@cs.ucla.edu>
7128
7129 * src/output.c (escaped_output): Renamed from
7130 escaped_file_name_output, since we now use it for symbol tags as
7131 well. All uses changed.
7132 (symbol_destructors_output, symbol_printers_output):
7133 Escape symbol tags too.
7134 Problem reported by Matyas Forstner in
7135 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
7136
7137 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
7138 not needed.
7139 * src/output.c (user_actions_output, token_definitions_output,
7140 symbol_destructors_output, symbol_printers_output): Likewise.
7141 * src/reader.c (prologue_augment): Likewise.
7142 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
7143
7144 * src/vcg.c (output_edge): Don't quote linestyle arg.
7145 Problem reported by twlevo@xs4all.nl.
7146
7eb453ac
PE
71472005-02-28 Paul Eggert <eggert@cs.ucla.edu>
7148
7149 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
7150 example, reported by Derek M Jones. Also, make the example even
7151 more outrageous, to better illustrate how bad the problem is.
7152
4c04c52a
PE
71532005-02-24 Paul Eggert <eggert@cs.ucla.edu>
7154
7155 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
7156 putsym. Typo reported by Sebastian Piping.
7157
a61e1620
PE
71582005-02-23 Paul Eggert <eggert@cs.ucla.edu>
7159
7160 * doc/bison.texinfo (Language and Grammar): some -> same
7161 (Epilogue): int he -> in the
7162 Typos reported by Sebastian Piping via Justin Pence.
7163
9ec93868
PE
71642005-02-07 Paul Eggert <eggert@cs.ucla.edu>
7165
7166 * tests/glr-regression.at (Improper handling of embedded actions
7167 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
7168 embedded actions and $-N in GLR parsers", work around an Autoconf bug
7169 with dollar signs in test names.
7170 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
7171 for a similar reason.
7172
73ce7e7e
PE
71732005-01-28 Paul Eggert <eggert@cs.ucla.edu>
7174
7175 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
7176 wants to redefine G_VIEW.
7177
2e72b98e
PE
71782005-01-27 Paul Eggert <eggert@cs.ucla.edu>
7179
7180 * src/vcg.c (get_view_str): Remove case for normal_view.
7181 Problem reported by twlevo@xs4all.nl.
7182
e0d634e5
PE
71832005-01-24 Paul Eggert <eggert@cs.ucla.edu>
7184
ccf830a4
PE
7185 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
7186 Problem reported by twlevo@xs4all.nl.
7187
e0d634e5
PE
7188 * doc/bison.texinfo: Change @dircategory from "GNU programming
7189 tools" to "Software development". Requested by Richard Stallman
7190 via Karl Berry.
7191
7bbc8cb0
PE
71922005-01-23 Paul Eggert <eggert@cs.ucla.edu>
7193
7194 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
7195 Problem reported by twlevo@xs4all.nl.
7196
08b770bc
PE
71972005-01-21 Paul Eggert <eggert@cs.ucla.edu>
7198
7199 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
7200 keyword; it's not needed with modern compilers, and it doesn't
7201 affect correctness with older compilers. Suggested by
7202 twlevo@xs4all.nl.
7203
95f22ad2
PE
72042005-01-17 Paul Eggert <eggert@cs.ucla.edu>
7205
7206 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
7207 gcc -Wswitch-default.
7208 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7209 * data/yacc.c (yyparse): Likewise.
7210
d229d15c
PE
72112005-01-12 Paul Eggert <eggert@cs.ucla.edu>
7212
7213 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
7214 already. Let config.h define any nonstandard values.
7215
ecadd90f
PE
72162005-01-10 Paul Eggert <eggert@cs.ucla.edu>
7217
7218 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
7219 for the benefit of slower hosts. Problem reported by
7220 Nelson H. F. Beebe.
7221
213744b5
PE
72222005-01-07 Paul Eggert <eggert@cs.ucla.edu>
7223
7224 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
7225 being defined and not used.
7226 * data/lalr1.cc (yyparse): Likewise.
7227 Use "if (false)" rather than "if (0)".
7228
249d3236
PE
72292005-01-05 Paul Eggert <eggert@cs.ucla.edu>
7230
7231 * TODO: Mention that we should allow NUL bytes in tokens.
7232
987cc1fb
PE
72332005-01-02 Paul Eggert <eggert@cs.ucla.edu>
7234
7235 * src/scan-skel.l (<<EOF>>): Don't close standard output.
7236 Problem reported by Hans Aberg.
7237
08fe02d9
PE
72382005-01-01 Paul Eggert <eggert@cs.ucla.edu>
7239
7240 * src/getargs.c (version): Happy new year; update overall
7241 program copyright date from 2004 to 2005.
7242
7243 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
7244 Problem reported by Hans Aberg.
7245 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
7246 (Output file names.): Add a test for the case when standard output
7247 is closed.
7248
010c0266
PE
72492004-12-26 Paul Eggert <eggert@cs.ucla.edu>
7250
7251 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
7252 to fix an oversight in the Bison 2.0 manual.
7253
da12206a
PE
72542004-12-25 Paul Eggert <eggert@cs.ucla.edu>
7255
7256 * NEWS: Version 2.0. Reformat the existing news items since
7257 1.875, so that related items are grouped together.
3a4734aa 7258 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
7259 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
7260
c935d934
PE
7261 * tests/torture.at (Exploding the Stack Size with Alloca): Set
7262 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
7263 otherwise, we're not testing alloca. Unfortunately there's no
7264 simple way to consult HAVE_ALLOCA here.
7265
da12206a
PE
7266 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
7267 for yymsg, too.
7268
7269 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
7270 hand. This avoids a warning about comparing int to size_t when
7271 GCC warnings are enabled.
7272
0a2c5137
PE
72732004-12-22 Paul Eggert <eggert@cs.ucla.edu>
7274
d7e14fc0
PE
7275 * NEWS: Bison-generated parsers no longer default to using the
7276 alloca function (when available) to extend the parser stack, due
7277 to widespread problems in unchecked stack-overflow detection.
7278 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
7279 responsibility to set it to a positive value. This lets the user
7280 specify a value that is not a preprocessor constant.
7281 * data/yacc.c (YYMAXDEPTH): Likewise.
7282 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
7283 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
7284 to be a compile-time constant. However, explain the constraints on it.
7285 Also, explain the constraints on YYINITDEPTH.
7286 (Table of Symbols): Explain that alloca is no longer the default.
7287 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
7288 to 1.
7289
0a2c5137
PE
7290 * doc/bison.texinfo (Location Default Action): Mention that n must
7291 be zero when k is zero. Suggested by Frank Heckenbach.
7292
e019c247
AD
72932004-12-22 Akim Demaille <akim@epita.fr>
7294
7295 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
7296 (parser::state_type, parser::semantic_type, parser::location_type):
7297 Private, not public.
7298 (parser::parse): Return ints, not bool.
7299 Returning a bool introduces a problem: 0 corresponds to false, and
7300 it seems weird to return false on success. Returning true changes
7301 the conventions for yyparse.
7302 Alternatively we could return void and send an exception.
7303 There is no clear consensus (yet?).
7304 (state_stack, semantic_stack, location_stack): Rename as...
7305 (state_stack_type, semantic_stack_type, location_stack_type): these.
7306 Private, not public.
7307 * tests/c++.at: New.
7308 * tests/testsuite.at, tests/Makefile.am: Adjust.
7309
72731bb7
AD
73102004-12-21 Akim Demaille <akim@epita.fr>
7311
7312 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
7313
9a0d8bec
AD
73142004-12-21 Akim Demaille <akim@epita.fr>
7315
7316 Don't impose std::string for filenames.
7317
7318 * data/lalr1.cc (b4_filename_type): New.
7319 (position::filename): Use it.
7320 (parser.hh): Move the inclusion of stack.hh and location.hh below
7321 the user code, so that needed headers for the filename type can be
7322 included first.
72731bb7
AD
7323 Forward declare them before the user code.
7324 * tests/Makefile.am (check-local, installcheck-local): Pass
7325 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 7326
99880de5
AD
73272004-12-20 Akim Demaille <akim@epita.fr>
7328
7329 Use more STL like names: my_class instead of MyClass.
7330
7331 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
7332 (SemanticStack, SemanticType, StateStack, StateType)
7333 (TokenNumberType, Stack, Slice, Traits, Parser::location)
7334 (Parser::value): Rename as...
7335 (location_stack, location_type, rhs_number_type, semantic_stack)
7336 (semantic_type, state_stack, state_type, token_number_type, stack)
7337 (slice, traits, parser::yylloc, parser::yylval): these.
7338
7339 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
7340
9bec482e
PE
73412004-12-19 Paul Eggert <eggert@cs.ucla.edu>
7342
7343 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
7344 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7345
f6fbd3da
PE
73462004-12-17 Paul Eggert <eggert@cs.ucla.edu>
7347
7348 Remove uses of 'short int' and 'unsigned short int'. This raises
7349 some arbitrary limits. It uses more memory but nowadays that's
7350 not much of an issue.
7351
7352 This change does not affect the generated parsers; that's a different
7353 task, as some users will want to conserve memory there.
7354
7355 Ideally we should use size_t to represent all object counts, and
7356 something like ptrdiff_t to represent signed differences of object
7357 counts; but that will require more code-cleanup than I have the
7358 time to do right now.
7359
7360 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
7361 Use size_t, not int or short int, to count objects.
7362 * src/closure.c (nritemset, closure): Likewise.
7363 * src/closure.h (nritemset, closure): Likewise.
7364 * src/nullable.c (nullable_compute): Likewise.
7365 * src/print.c (print_core): Likewise.
7366 * src/print_graph.c (print_core): Likewise.
7367 * src/state.c (state_compare, state_hash): Likewise.
7368 * src/state.h (struct state): Likewise.
7369 * src/tables.c (default_goto, goto_actions): Likewise.
7370
7371 * src/gram.h (rule_number, rule): Use int, not short int.
7372 * src/output.c (prepare_rules): Likewise.
7373 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
7374 errs, reductions): Likewise.
7375 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
7376 Likewise.
7377 * src/tables.c (vector_number, tally, action_number,
7378 ACTION_NUMBER_MINIMUM): Likewise.
7379 * src/output.c (muscle_insert_short_int_table): Remove.
7380
efeed023
AD
73812004-12-17 Akim Demaille <akim@epita.fr>
7382
7383 * data/lalr1.cc: Extensive Doxygenation.
7384 (error_): Rename as...
7385 (error): this, since it is visible to the user.
7386 Adjust callers.
7387 (Parser::message): Now an automatic variable from...
7388 (Parser::yyreport_syntax_error_): here.
7389 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
7390 Parser::error.
7391 * tests/input.at: Escape $.
7392
bc82c5a5
PE
73932004-12-16 Paul Eggert <eggert@cs.ucla.edu>
7394
7395 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
7396 Parenthesize rhs to avoid obscure problems with mistakes like
7397 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
7398 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7399 b4_rhs_location): Likewise.
7400 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7401 b4_rhs_location): Likewise.
7402
fd19f271
AD
74032004-12-16 Akim Demaille <akim@epita.fr>
7404
7405 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
7406 yacc.c: be sure to stay within yycheck_.
7407 * tests/actions.at: Re-enable C++ tests.
7408
10454ea4
AD
74092004-12-16 Akim Demaille <akim@epita.fr>
7410
7411 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
7412 real.
7413
c5b95ccf
AD
74142004-12-16 Akim Demaille <akim@epita.fr>
7415
7416 Use #define to handle the %name-prefix.
7417
7418 * data/glr.c, data/yacc.c: Comment changes.
7419 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
7420 so that one can refer to yylex in the parser file, and have it
7421 renamed, as is the case with other skeletons.
7422
617a8f12
AD
74232004-12-16 Akim Demaille <akim@epita.fr>
7424
7425 Move lalr1.cc internals into yy*.
7426
7427 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
7428 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
7429 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
7430 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
7431 (empty_, final_, terror_, errcode_, ntokens_)
7432 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
7433 (looka_, ilooka_, error_range_, nerrs_):
7434 Rename as...
7435 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
7436 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
7437 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
7438 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
7439 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
7440 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
7441 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
7442 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
7443 these.
7444
1e547e6e
PE
74452004-12-15 Paul Eggert <eggert@cs.ucla.edu>
7446
7447 Fix some problems reported by twlevo at xs4all.
7448 * src/symtab.c (symbol_new): Report an error if the input grammar
7449 contains too many symbols. This is better than calling abort() later.
7450 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
7451 (struct node, struct graph):
7452 Rename member expand to stretch. All uses changed.
7453 (struct graph): Remove member layoutalgorithm. All uses removed.
7454 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
7455 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
7456 All uses changed.
7457 (N_STRETCH): Rename from N_EXPAND. All uses changed.
7458
735d6bd4
AD
74592004-12-15 Akim Demaille <akim@epita.fr>
7460
7461 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
7462 Add more Doxygen comments.
7463 (symprint_, stack_print_, reduce_print_, destruct_, pop)
7464 (report_syntax_error_, translate_): Rename as...
7465 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
7466 (yypop_, yyreport_syntax_error_, yytranslate_): this.
7467
2e1f5829
AD
74682004-12-15 Akim Demaille <akim@epita.fr>
7469
7470 * data/lalr1.cc (lex_): Rename as...
7471 (yylex_): this.
7472 Move the trace here.
7473 Take the %name-prefix into account.
7474 Reported by Alexandre Duret-Lutz.
7475
a3cb6248
AD
74762004-12-15 Akim Demaille <akim@epita.fr>
7477
7478 Simplify the C++ parser constructor.
7479
7480 * data/lalr1.cc (debug_): Rename as...
7481 (yydebug_): so that the parser's internals are always in the yy*
7482 pseudo namespace.
7483 Adjust uses.
7484 (b4_parse_param_decl): Remove the leading comma as it is now only
7485 called as unique argument list.
7486 (Parser::Parser): Remove the constructor accepting a location and
7487 an initial debugging level.
7488 Remove from the other ctor the argument for the debugging level.
7489 (debug_level_type, debug_level, set_debug_level): New.
7490
7491 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
7492 constructor calls.
7493
07fed891
AD
74942004-12-15 Akim Demaille <akim@epita.fr>
7495
7496 Remove b4_root related material: failure experiment
a3cb6248 7497 (which goal was to allow to derive from a class).
07fed891
AD
7498
7499 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
7500 definitions and uses.
7501
e603eaa5
PE
75022004-12-14 Paul Eggert <eggert@cs.ucla.edu>
7503
7504 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
7505 not 2, since it's not portable to subtract 1 from the start of an
7506 array. The new item 0 is never set or used. All uses changed.
7507
7508 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
7509 the default definition of YYLLOC_DEFAULT. Problem reported
7510 by Frank Heckenbach.
7511
fafb007d
PE
75122004-12-12 Paul Eggert <eggert@cs.ucla.edu>
7513
7514 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
7515 the normal case and one for the error case. Just use the
7516 first one uniformly. Problem reported by Frank Heckenbach.
7517 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
7518 use exactly the same macro in both places.
7519 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
7520 so that the normal-case YYRHSLOC works for the error case too.
7521 All uses changed.
7522 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
7523 (YYLLOC_DEFAULT): Use the same macro as glr.c.
7524 * doc/bison.texinfo (Location Default Action): Don't claim that
7525 we have an array of locations. Use the same macro for both glr
7526 and lalr parsers. Mention YYRHSLOC. Mention what happens when
7527 the index is 0.
7528
48814dcd
PE
75292004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7530
a4e1a53b
PE
7531 * HACKING: Update email addresses to send announcements to.
7532
48814dcd
PE
7533 * configure.ac (AC_INIT): Bump version to 1.875f.
7534
337116ba
PE
75352004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7536
7537 * NEWS: Version 1.875e.
7538 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
7539
7540 * src/scan-skel.l: Include "complain.h", for "fatal".
7541
7542 * src/relation.h (relation_print, relation_digraph):
7543 Relation sizes are of type relation_node, not size_t (this is
7544 merely a doc fix, since the two types are equivalent).
7545 (relation_transpose): Relation sizes are of type relation_node,
7546 not int.
7547 * src/relation.c: Likewise.
7548 (top, infinity): Now of type relation_node, not int.
7549 (traverse, relation_transpose): Use relation_node, not int.
7550
7551 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
7552 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
7553 (yyparse): Remove unused local introduced in 2004-10-25 patch.
7554
7555 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 7556 specifying whether the test should be skipped. Use it tp
337116ba 7557 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 7558 fail on some hosts, and should be skipped.
337116ba 7559
da2a7671
PE
75602004-12-08 Paul Eggert <eggert@cs.ucla.edu>
7561
7562 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
7563 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
7564 unless otherwise specified below.
7565
7566 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
7567 to allocate kernel_base, kernel_items, kernel_size, since
7568 they needn't be initialized to 0.
7569 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
7570 * src/closure.c (new_closure): Likewise, for itemset.
7571 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
7572 * src/lalr.c (set_goto_map): Likewise, for temp_map.
7573 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
7574 (build_relations): Likewise for edge, states1, includes.
7575 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
7576 * src/reader.c (packgram): Likewise, for ritem, rules.
7577 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
7578 * src/relation.c (relation_digraph): Likewise for VERTICES.
7579 (relation_transpose): Likewise for new_R, end_R.
7580 * src/symtab.c (symbols_token_translations_init): Likewise for
7581 token_translations.
7582 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
7583 (token_actions): Likewise for yydefact, actrow, conflrow,
7584 conflict_list.
7585 (save_column): Likewise for froms[symno], tos[symno].
7586 (goto_actions): Likewise for state_count.
7587 (pack_table): Likewise for base, pos, check.
7588 (tables_generate): Likewise for width.
7589
7590 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
7591 for initial core. Just have a separate core, so we needn't worry
7592 about whether kernel_size and kernel_base are initialized.
7593
7594 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
7595 kernel_size, kernel_items): Remove unnecessary initialization.
7596 * src/conflicts.c (conflicts): Likewise.
7597 * src/derives.c (derives): Likewise.
7598 * src/muscle_tablc (muscle_insert): Likewise.
7599 * src/relation.c (relation_digraph): Likewise.
7600 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
7601 conflrow, conflict_table, conflict_list, table, check):
7602 Likewise.
7603
7604 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
7605 This is because all callers pass unsigned int.
7606 * src/closure.h (new_closure): Likewise.
7607
7608 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
7609 (build_relations): Initialize includes[i] in all cases.
7610 * src/reader.c (packgram): Always initialize rules[ruleno].prec
7611 and rules[ruleno].precsym. Initialize members in order.
7612 * src/relation.c (relation_transpose): Always initialize new_R[i]
7613 and end_R[i].
7614 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
7615
7616 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
7617 conflict_list[0] was always 0, but now it isn't initialized.
7618
7619 * src/table.c (table_grow): When conflict_table grew, the grown
7620 area wasn't cleared. Fix this.
7621
7622 * lib/.cvsignore: Add strdup.c, strdup.h.
7623 * m4/.cvsignore: Add strdup.m4.
7624
00baeeac
PE
76252004-12-07 Paul Eggert <eggert@cs.ucla.edu>
7626
7627 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
7628 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
7629 GOTO_NUMBER_MAXIMUM, since we occasionally compute
7630 ngotos + 1 without checking for overflow.
7631 (build_relations): Use END_NODE, not -1, to denote end of edges.
7632 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
7633 build_relations): Use goto_number, not int, for goto numbers.
7634 * src/tables.c (save_column, default_goto): Likewise.
7635
be3d9d42
AD
76362004-11-23 Akim Demaille <akim@epita.fr>
7637
7638 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
7639 of #defining from yystype.
7640 Don't typedef yystype, C++ does not need it.
7641 This lets it possible to forward declare it as union.
7642
78e526d5
PE
76432004-11-23 Paul Eggert <eggert@cs.ucla.edu>
7644
7645 * bootstrap (gnulib_modules): Add extensions.
7646 Problem reported by Jim Meyering.
7647
afbb696d
PE
76482004-11-22 Paul Eggert <eggert@cs.ucla.edu>
7649
7650 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
7651 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
7652 src/system.h, src/tables.c: XFREE -> free, to accommodate
7653 recent change to gnulib xalloc.h.
78e526d5 7654 Problem reported by Jim Meyering.
afbb696d 7655
c1f8f16a
AD
76562004-11-17 Akim Demaille <akim@epita.fr>
7657
7658 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
7659
db7e5eb5 76602004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
7661 Alexandre Duret-Lutz <adl@gnu.org>
7662
7663 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
7664 changes.
7665 (YYCDEBUG): Adjust.
7666 Use it instead of cdebug_.
7667 (Parser::debug_stream, Parser::set_debug_stream): New.
7668 (Parser::symprint_): Define cdebug_ for temporary backward
7669 compatibility.
7670 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
7671 debug_stream ().
7672
68e11668
AD
76732004-11-17 Akim Demaille <akim@epita.fr>
7674
7675 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
7676 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
7677 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
7678 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
7679
97cbc73e
PE
76802004-10-27 Paul Eggert <eggert@cs.ucla.edu>
7681
7682 * data/glr.c (yyloc_default): Remove; not used.
7683 Problem reported by Frank Heckenbach.
7684
e342c3be
AD
76852004-10-25 Akim Demaille <akim@epita.fr>
7686
7687 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
7688 Introduce another definition to address simple location arrays.
7689 (yyGLRStack): New member: yyerror_range.
7690 (yyrecoverSyntaxError, yyparse): Update it.
7691 (yyrecoverSyntaxError): Use it when shifting the error token to
7692 have an accurate range, equivalent to the one computed by both
7693 yacc.c and lalr1.cc.
7694 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
7695 that column numbers start at column 0, as per GNU Coding
7696 Standards, the others tests, and the doc.
7697 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
7698 Adjust to the above change (first column is 0).
7699 And adjust the location of the "<error>", now covering the whole
7700 line.
7701
93602feb 77022004-10-22 Akim Demaille <akim@epita.fr>
04098407 7703 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
7704
7705 Remove some arbitrary limits on goto numbers and relations.
7706 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
7707 initial values, since they're never used.
7708 (set_goto_map): ngotos is now unsigned, so test for overflow
7709 by seeing whether it wraps around to zero.
7710 * src/lalr.h (goto_number): Now size_t, not short int.
7711 (GOTO_NUMBER_MAXIMUM): Remove.
7712 * src/relation.c (relation_print, traverse, relation_transpose):
7713 Check for END_NODE rather than looking at sign.
7714 * src/relation.h (END_NODE): New macro.
7715 (relation_node): Now size_t, not short int.
7716
dba08b04
PE
77172004-10-22 Paul Eggert <eggert@cs.ucla.edu>
7718
7719 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
7720 keyword, not an identifier. Problem reported by Baron Schwartz in
7721 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
7722
df09ef2e
AD
77232004-10-11 Akim Demaille <akim@epita.fr>
7724
7725 * src/symtab.c (symbol_check_alias_consistency): Also check
7726 type names, destructors, and printers.
7727 Reported by Alexandre Duret-Lutz.
7728 Recode the handling of associativity and precedence in terms
7729 of symbol_precedence_set.
7730 Accept no redeclaration at all, not even equal to the previous
7731 value.
7732 (redeclaration): New.
7733 Use it to factor redeclaration complaints.
7734 (symbol_make_alias): Don't set the type of the alias, let
7735 symbol_check_alias_consistency do it as for other features.
7736 * src/symtab.h (symbol): Add new member prec_location, and
7737 type_location.
7738 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
7739 * tests/input.at (Incompatible Aliases): New.
7740
146bc99d
PE
77412004-10-09 Paul Eggert <eggert@cs.ucla.edu>
7742
7743 .cvsignore fixes to accommodate gnulib changes,
7744 and the practice of naming build directories "_build".
7745 * .cvsignore: Add "_*". Sort.
7746 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
7747 * m4/.cvsignore: Add "*_gl.m4".
7748
e503aa60
AD
77492004-10-06 Akim Demaille <akim@epita.fr>
7750
7751 * src/parse-gram.y (add_param): Fix the truncation of trailing
7752 spaces.
7753
b4a20338
AD
77542004-10-05 Akim Demaille <akim@epita.fr>
7755
7756 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
7757 whether the reducion was empty or not. This leaves room to
7758 improve the use of YYLLOC_DEFAULT in such a case.
7759 lalr1.cc is still experimental, so changing this is acceptable.
7760 And finally, there are probably not many users who changed the
7761 handling of locations in GLR, so changing is admissible too.
7762
7763 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
7764 empty reduction, set @$ to an empty location ending the previously
7765 stacked symbol.
7766 Adjust uses to make sure the code is triggered on empty
7767 reductions.
7768 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
7769 expected output: empty reductions have empty locations.
7770
f85a5e6f
AD
77712004-09-29 Akim Demaille <akim@epita.fr>
7772
7773 * data/lalr1.cc: Move towards a more standard C++ coding style
7774 for templates: Class < T > -> Class<T>.
7775
b203fc2c
AD
77762004-09-29 Akim Demaille <akim@epita.fr>
7777
7778 * data/lalr1.cc: Reinstall the former ctor, for sake of
7779 compatibility, but warn it will be removed.
7780 Move towards a more standard C++ coding style (i.e., type *var ->
7781 type* var).
7782
5b7e1e73
PE
77832004-09-27 Paul Eggert <eggert@cs.ucla.edu>
7784
3fee967f
PE
7785 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
7786 since it's less likely to work if NULs are involved in the future.
5b7e1e73 7787
0dcca5c2
AD
77882004-09-27 Akim Demaille <akim@epita.fr>
7789
7790 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
7791
6dde1c82
AD
77922004-09-27 Akim Demaille <akim@epita.fr>
7793
7794 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 7795 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
7796 and argument names.
7797 (b4_cc_constructor_call): Likewise.
7798
b233d555
AD
77992004-09-24 Akim Demaille <akim@epita.fr>
7800
7801 * src/parse-gram.y (add_param): Strip the leading and trailing
7802 blanks from a formal argument declaration.
7803 (YY_LOCATION_PRINT): New.
7804
619404e3
AD
78052004-09-24 Akim Demaille <akim@epita.fr>
7806
7807 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
7808 after the location.
7809
dd8d9022
AD
78102004-09-24 Akim Demaille <akim@epita.fr>
7811
7812 * doc/bison.texinfo (Table of Symbols): Sort.
7813
0092f063
AD
78142004-09-21 Akim Demaille <akim@epita.fr>
7815
7816 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
7817 the useless parentheses.
7818 Suggested by Paul Eggert.
7819
451364ed
AD
78202004-09-20 Akim Demaille <akim@epita.fr>
7821
7822 Let the initial-action act on the look-ahead, and use it for the
7823 "initial push" (corresponding to an hypothetical beginning-of-file).
7824 And let lalr1.cc honor %initial-action.
7825
7826 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
7827 example.
7828 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
7829 (Parser::Parser): Remove the ctor that used to initialize it.
7830 (Parser::parse): Like in the other skeletons, issue the "starting
7831 parse" message before any action.
7832 Honor %initial-action.
7833 Initialize the stacks with the lookahead.
7834 * data/yacc.c: Let $$ and @$ in %initial-action designate the
7835 look-ahead.
7836 Push them in the stacks.
7837 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
7838
18d192f0
AD
78392004-09-20 Akim Demaille <akim@epita.fr>
7840
7841 * doc/bison.texinfo (Initial Action Decl): New.
7842
b8458aa5
AD
78432004-09-20 Akim Demaille <akim@epita.fr>
7844
7845 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
7846 clearer criterion to define it.
7847 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
7848 When reducing on an empty RHS, use the latest stacked location as
7849 location.
7850 yylloc is not always available.
7851 * data/glr.c: Likewise.
7852 Also, honor initial-actions.
7853
3fc16193
AD
78542004-09-20 Akim Demaille <akim@epita.fr>
7855
7856 * data/yacc.c (YY_LOCATION_PRINT): New.
7857 Define when we know YYLTYPE's structure, i.e., when the default
7858 YYLLOC_DEFAULT is used.
7859 * data/c.m4 (b4_yysymprint_generate): Use it.
7860 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
7861 value of the result.
7862 (error_start_): Replace with...
7863 (error_range_): this location array.
7864 This allows to replace code relying on the implementation of
7865 locations by portable code.
7866 * data/yacc.c (yylerrsp): Replace with...
7867 (yyerror_range): this.
7868 Every time a token is popped, update yyerror_range[0], to have an
7869 accurate location for the error token.
7870 * data/glr.c (YY_LOCATION_PRINT): New.
7871 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
7872 deference a pointer.
7873 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
7874 report the location in %printers.
7875
7876 * src/scan-skel.l: Instead of abort, report error messages to ease
7877 understanding skeleton scanning failures.
7878
ecfe33e7
AD
78792004-09-16 Akim Demaille <akim@epita.fr>
7880
7881 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
7882 (iterator, const_iterator): these, to be more in the C++ spirit.
7883 Also, return reverse iterators so that when displaying the stack
7884 we display its bottom first.
7885 (Parser::stack_print_, Parser::reduce_print_): Match the messages
7886 from yacc.c.
7887 We should probably use vector here though.
7888
1576d44d
AD
78892004-09-16 Akim Demaille <akim@epita.fr>
7890
7891 Have more complete shift traces.
7892
7893 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
7894 to report Shifts instead of ad hoc YYDPRINTF invocations,
7895 including for the error token.
7896 * data/lalr1.cc (symprint_): Output the location.
7897 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
7898 output the location within the %printer.
7899 Activate GLR tests, at least to make sure they compile properly.
7900 They still don't pass though.
7901 * tests/calc.at: Adjust expect verbose output, since now "Entering
7902 state..." is on a different line than the "Shifting" message.
7903
9c66f418
AD
79042004-09-08 Akim Demaille <akim@epita.fr>
7905
7906 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
7907 Bison directive from the Bison file to the invocation of this
7908 macro, so that these directives are passed to
7909 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
7910 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
7911 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
7912 the extra Bison directives instead of the whole series.
7913 Change the grammar so that there are recoverable errors, and
7914 unrecoverable errors. Now we can have the parser give up before
7915 consuming the whole input. As a result we now can observe that
7916 the lookahead is freed when needed.
7917 Change the parser source to parse argv[1] instead of a hard coded
7918 string.
7919 Simplify yylex, and give a value and location to EOF.
7920 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
7921 passed directives already coded in the file.
7922 Add some tests to check the location of "error".
7923 For some tests, the C++ parser is correct, and not yacc.c.
7924 For other tests, they provide different, but unsatisfying, values,
7925 so keep the C++ value so that at least one parser is "correct"
7926 according to the test suite.
7927 (Actions after errors): Remove, this is subsumed by the
7928 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
7929
52d5733f
AD
79302004-09-06 Akim Demaille <akim@epita.fr>
7931
7932 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 7933 (Parser::pop): New.
52d5733f
AD
7934 Use it.
7935
a0e68930
AD
79362004-09-06 Akim Demaille <akim@epita.fr>
7937
7938 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
7939 argument, an informative message.
7940 Call YY_SYMBOL_PRINT.
7941 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
7942 * data/lalr1.cc (destruct_): Likewise.
7943 In addition, no longer depend on b4_yysymprint_generate and
7944 b4_yydestruct_generate to generate these functions, do it "by
7945 hand".
7946
e757bb10
AD
79472004-09-03 Akim Demaille <akim@epita.fr>
7948
7949 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
7950 invoked, yydestruct the lookahead.
7951 * tests/calc.at (Calculator $1): Update the expected lengths of
7952 traces: there is an added line for the discarded lookahead.
7953 * doc/bison.texinfo (Destructor Decl): Some rewording.
7954 Define "discarded" symbols.
7955
0fe1f06d
AD
79562004-09-02 Akim Demaille <akim@epita.fr>
7957
7958 * data/lalr1.cc (translate_, destruct_): No reason to be static.
7959
284acc8b
AD
79602004-09-02 Akim Demaille <akim@epita.fr>
7961
7962 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
7963 (YYDSYMPRINTF): Rename as...
7964 (YY_SYMBOL_PRINT): this.
7965 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
7966 two.
7967 Use it instead of direct symprint_ calls.
7968 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
7969 one.
7970
a5eb1ed2
AD
79712004-09-02 Akim Demaille <akim@epita.fr>
7972
b7c72fe1
AD
7973 * data/lalr1.cc (b4_yysymprint_generate): New.
7974 (symprint_): New member function, defined when YYDEBUG.
7975 Use it consistently instead of token/nterm debugging output by
7976 hand.
a5eb1ed2
AD
7977 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
7978 %printer calls to use cdebug_ when using lalr1.cc.
7979
417141dd
AD
79802004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
7981
7982 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
7983 with #ifdef YYDEBUG.
7984
2fa09258
AD
79852004-08-26 Akim Demaille <akim@epita.fr>
7986
7987 * doc/bison.texinfo (Implementing Loops): Rename as...
7988 (Implementing Gotos/Loops): this.
7989
9378b508
PE
79902004-08-13 Paul Eggert <eggert@cs.ucla.edu>
7991
7992 Adjust to latest gnulib.
7993 * bootstrap (gnulib_modules): Add xalloc-die.
7994 Set LC_ALL=C so that file names sort consistently.
7995 Prefer the gnulib copies of gettext.m4, glibc21.m4,
7996 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
7997 uintmax_t.m4, ulonglong.m4.
7998 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
7999 po.m4 since we are now using _gl.m4 instead.
8000
87a8ad5c
PE
80012004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
8002
8003 * src/scan-action.l: Remove. Scanning of semantic actions is
8004 handled in scan-gram.l.
8005
dca81a78
PE
80062004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
8007
8008 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
8009
8010 * src/location.h (struct): The file member is a uniqstr.
8011 (equal_boundaries): Use UNIQSTR_EQ for comparison.
8012
c9cbf7c5
PE
80132004-07-22 Paul Eggert <eggert@cs.ucla.edu>
8014
8015 Fix bug with non-%union parsers that have printers or destructors,
8016 which led to a Bison core dump. Reported by Peter Fales in
8017 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 8018
c9cbf7c5
PE
8019 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
8020 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
8021 not to our own type.
8022 * src/output.c (symbol_destructors_output, symbol_printers_output):
8023 Don't assume %union.
8024 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
8025 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
8026 UNION-FLAG. All callers changed.
8027 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
8028 Use type char, not unsigned int, when declaring an array of char;
8029 this lets us remove a cast.
8030 (Printers and Destructors): Add non-%union test cases.
8031
fa7e68c3
PE
80322004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8033
8034 * doc/bison.texinfo: Minor editorial changes, mostly to the new
8035 GLR writeups. E.g., avoid frenchspacing and the future tense,
8036 change "lookahead" to "look-ahead", and change "wrt" to "with
8037 respect to".
2fa09258 8038
fa7e68c3
PE
80392004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8040
8041 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
8042 New sections, split off from the GLR Parsers section. Put the new
8043 Simple GLR Parser near the start of the GLR section, for clarity.
8044 Rewrite connective text.
8045
99a9344e
PE
80462004-06-21 Frank Heckenbach <frank@g-n-u.de>
8047
8048 * doc/bison.texinfo (Simple GLR Parsers): New section.
8049
8dd162d3
PE
80502004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8051
8052 * NEWS, TODO, doc/bison.texinfo:
8053 Use "look-ahead" instead of "lookahead", to be consistent.
8054 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
8055 while we're fixing "look-ahead".
8056 * src/conflicts.c (shift_set): Renamed from shiftset.
8057 (look_ahead_set): Renamed from lookaheadset.
8058 * src/print.c: Likewise.
8059 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
8060 name for "lookahead".
8061 (report_types, usage): Likewise.
8062 * src/getargs.h (report_look_ahead_tokens): Renamed from
8063 report_lookaheads.
8064 * src/lalr.c (compute_look_ahead_tokens): Renamed from
8065 compute_lookaheads.
8066 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
8067 (look_ahead_tokens_print): Renamed from lookaheads_print.
8068 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
8069 state_rule_lookaheads_print.
8070 * src/state.h: Likewise.
8071 (reductions.look_ahead_tokens): Renamed from lookaheads.
8072 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
8073 AT_DATA_LOOKAHEADS_GRAMMAR.
8074
57a90331
PE
80752004-06-03 Paul Eggert <eggert@cs.ucla.edu>
8076
8077 * README: Update location of patched M4 distribution.
8078
8ed3234a
PE
80792004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
8080
8081 Don't assume the C++ compiler takes the same arguments as the C compiler
8082 (trivial change).
8083 * configure.ac (O0CXXFLAGS): New var.
8084 * tests/atlocal.in (CXXFLAGS): Use it.
8085
07971983
PE
80862004-05-29 Paul Eggert <eggert@cs.ucla.edu>
8087
8088 Fix some "make check" problems with C++ reported by
8089 Albert Chin-A-Young for Tru64 C++ in this thread:
8090 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
8091
8092 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
8093 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8094 Output to a .cc file for C++, not to a .c file.
8095 * tests/calc.at (AT_CHECK_CALC): Likewise.
8096 * tests/regression.at (AT_CHECK_DANCER): Likewise.
8097 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
8098
29058652
PE
80992004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
8100
8101 * tests/calc.at, tests/actions.at: Workaround for SGI
8102 C++ compiler. (trivial change)
8103
62cb8a99
PE
81042004-05-27 Paul Eggert <eggert@cs.ucla.edu>
8105
fd418816
PE
8106 Spent a few hours checking out which prerequisite versions the
8107 current sources actually require. I went all the way back to
8108 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
8109 a seemingly endless set of combinations of versions more recent
8110 than that. The bottom line is that the current sources require
8111 fairly recent versions of the build tools, and it'll be some work
8112 to change this.
8113 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
8114 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
8115 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
8116 Add comments explaining why those particular versions are
8117 currently needed.
2fa09258 8118
62cb8a99
PE
8119 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
8120 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 8121 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
8122
8123 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
8124 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
8125
caa52c10
PE
81262004-05-26 Paul Eggert <eggert@cs.ucla.edu>
8127
8128 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
8129 0.11.5. Suggested by Bruno Haible.
8130 * bootstrap: Remove gettext version checking.
8131
8132 * doc/bison.texinfo (Decl Summary): Also mention that %union
8133 can depend on prerequisite types. Problem reported by Tim
8134 Van Holder.
8135
4bfd5e4e
PE
81362004-05-25 Paul Eggert <eggert@cs.ucla.edu>
8137
2cef3017
PE
8138 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
8139 * README-alpha: Don't tell people not to package this.
8140
b9c85d5c
PE
8141 * bootstrap: Don't assume $(...) works; use `...` instead.
8142 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
8143 gettext better.
8144
4bfd5e4e
PE
8145 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
8146 put into the -d output file, and mention what to do if YYSTYPE is
8147 defined as a macro.
8148
6a36ff94
PE
81492004-05-24 Paul Eggert <eggert@cs.ucla.edu>
8150
6712933e
PE
8151 Undo change made earlier today: it caused autopoint to not bring
8152 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
8153 autopoint's.
8154
8155 * bootstrap: Check that gettext version matches what's in
8156 configure.ac. Warn users to ignore robots.txt ERROR 404.
8157 * bootstrap: Undo today's earlier change (logged below).
8158 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 8159
6a36ff94
PE
8160 The gettext version checking is causing more trouble than it's
8161 curing; remove it. Problem reported by Paul Hilfinger.
8162
8163 * bootstrap: Issue a warning that one can expect a message
8164 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
8165 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
8166
209ea708
PE
81672004-05-23 Paul Eggert <eggert@cs.ucla.edu>
8168
8169 Ensure that the C++ compiler used for testing actually works on a
8170 simple test program; if not, skip the C++-related tests. Problem
8171 reported by Vin Shelton in:
161a71f3 8172 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
8173
8174 * m4/cxx.m4: New file.
8175 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
8176 * tests/atlocal.in (BISON_CXX_WORKS): Add.
8177 * tests/local.at (AT_COMPILE_CXX): Use it.
8178
41ca2549
PE
81792004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8180
383e69dc
PE
8181 * data/glr.c (yylloc): Output this macro even if locations are not
8182 being generated, as the GLR parser needs it even in that case.
8183 Problem reported by Troy A. Johnson
8184 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
8185
41ca2549
PE
8186 * configure.ac (AC_INIT): Update to 1.875e.
8187
e476c87d
PE
81882004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8189
8190 * NEWS: Version 1.875d.
8191 * configure.ac (AC_INIT): Likewise.
8192 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
8193
8194 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
8195 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
8196 lalr1.cc runs afoul of the first, and the last two are no longer
8197 supported by GCC 3.4.0.
8198 * README: Mention GNU m4 1.4 or later; mention m4 patches.
8199 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
8200
233a88ad
PE
82012004-05-06 Paul Eggert <eggert@cs.ucla.edu>
8202
8203 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
8204 unsigned int, for compatibility with latest gnulib hash module.
8205 * src/state.c (state_hash, state_hasher): Likewise.
8206 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
8207 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 8208
12ffdd28
PE
82092004-05-03 Paul Eggert <eggert@cs.ucla.edu>
8210
8211 * NEWS: Unescaped newlines are no longer allowed in char & strings.
8212
8213 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
8214 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
8215 character and string literals.
8216 (unexpected_end): New function.
8217 (unexpected_eof): Use it.
8218 (unexpected_newline): New function.
8219 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
8220 actions.
e476c87d 8221
12ffdd28
PE
8222 * NEWS: Document %expect-rr.
8223
8224 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
8225 Fix typo by replacing $1 with $option.
8226 Remove more 'intl'-related files.
9668e2be 8227 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
8228
8229 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
8230 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
8231 strtoul.c.
8232 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
8233 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
8234 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
8235 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
8236 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
8237 * src/.cvsignore: Add *.output.
8238
8239 * src/parse-gram.y: Put copyright notice inside %{ %} so it
8240 gets copied to the output file.
e476c87d 8241
1f65350a
PE
82422004-04-28 Paul Eggert <eggert@twinsun.com>
8243
8244 Get files from the gnulib and po repositories, instead of relying
8245 on them being in our CVS. Upgrade to latest versions of gnulib
8246 and Automake.
8247
8248 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
8249 * bootstrap: Bootstrap from gnulib and po repositories.
8250 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
8251 * README-cvs: Document these changes. Remove version numbers from
8252 mentions of build tools, since they change so often. Mention Flex.
8253
8254 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
8255 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
8256 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
8257 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 8258 does this for us.
12ffdd28
PE
8259 (AC_ISC_POSIX): Remove; we no longer support this
8260 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
8261 (AC_HEADER_STDC): Remove: we now assume C89 or better.
8262 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
8263 Do not check for C89 headers, except for locale.h which is used
8264 by the Yacc library and must port to K&R hosts.
8265 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
8266 Do not check for C89 functions, except for setlocale which is
8267 used by the Yacc library.
8268 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
8269 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
8270 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
8271 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
8272 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
8273 AM_GNU_GETTEXT): Remove; now done by:
8274 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
8275 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
8276 for us.
8277
8278 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
8279 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
8280 Define to empty, as gnulib.mk will do the rest for us.
8281 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
8282 for us.
8283 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
8284 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
8285
8286 * src/files.c: Include gnulib's xstrndup.h.
8287
8288 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
8289 (REALLOC): Use xnrealloc, for likewise.
8290 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
8291 (strnlen, memrchr): Remove decls; functions no longer used.
8292 Include <stpcpy.h>.
8293
8294 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
8295 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
8296 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
8297 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
8298 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
8299 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
8300 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
8301 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
8302 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
8303 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
8304 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
8305 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8306 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
8307 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
8308 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
8309 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
8310 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
8311 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
8312 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
8313 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
8314 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
8315 Remove, as these files are now generated automatically
8316 by bootstrap or automake.
8317
8318 * po/ChangeLog: Remove: all but one entry was a duplicate
8319 of this file, and I moved that 2000-11-02 entry here.
8320
8321 * config/.cvsignore: Add Makefile, depcomp, install-sh.
8322 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
8323 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
8324 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
8325 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
8326 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
8327 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
8328 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
8329 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
8330 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
8331 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
8332 xstrndup.h.
8333 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
8334 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
8335 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
8336 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
8337 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
8338 * src/.cvsignore: Remove *_.c.
8339
8340
8341 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
8342 support it. (The latest stable gzip doesn't.)
8343
83442004-04-27 Paul Eggert <eggert@twinsun.com>
8345
8346 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
8347 case, as stos_ is now used by destructors due to the 2004-02-09
8348 change.
8349
8350 Remove more K&R C support.
8351 * lib/libiberty.y (PARAMS): Remove. All uses removed.
8352 * lib/subpipe.c (errno): Remove decl.
8353 Include <stdlib.h> unconditionally.
8354 (EXIT_FAILURE): Remove macro.
8355 * src/complain.c (vfprintf, strerror): Remove.
8356 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
8357 unconditionally.
8358 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
8359 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
8360 (strchr, strspn, memchr): Remove decls.
8361 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
8362 unconditionally. Do not declare perror.
8363 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
8364 unconditionally.
8365
8366 * src/complain.c (_): Remove useless defn, as system.h defines this.
8367
8368 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
8369 with latest obstack.h.
8370 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
8371 to procedure types, as obstack.h now does that for us.
8372 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
8373
8374 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
8375 so that this include file can stand alone.
8376 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
8377 does this now. Include subpipe.h first after config.h, to
8378 test whether it can stand alone.
8379
8380 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
8381 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
8382 unused declaration.
8383
8384 * tests/synclines.at (%union synch line): Put a dummy member in
8385 the union, because empty unions aren't allowed in C. Caught
8386 by GCC 3.4.0.
8387
4f16766c
PE
83882004-04-13 Jim Meyering <jim@meyering.net>
8389
8390 * src/conflicts.c (conflicts_print): Correct format string typo:
8391 use `%%' to produce literal `%'. (trivial change)
8392
779e7ceb
PE
83932004-03-30 Paul Eggert <eggert@twinsun.com>
8394
8395 * src/getargs.c (version): Update copyright year to 2004.
8396
8397 * data/c.m4 (b4_int_type): Use 'short int' rather than
8398 'short', and similarly for 'long', 'unsigned', etc.
8399 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
8400 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
8401 yy_yypstack, yydumpstack): Likewise.
8402 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
8403 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
8404 Likewise.
8405 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
8406 yy_stack_print, yyparse): Likewise.
8407 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
8408 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
8409 * lib/bitset.c (bitset_print): Likewise.
8410 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
8411 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8412 * lib/bitsetv.c (bitsetv_dump): Likewise.
8413 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
8414 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
8415 Likewise.
8416 * src/LR0.c (allocate_itemsets): Likewise.
8417 * src/gram.h (rule_number, rule): Likewise.
8418 * src/lalr.h (goto_number): Likewise.
8419 * src/nullable.c (nullable_compute): Likewise.
8420 * src/output.c (prepare_rules): Likewise.
8421 * src/relation.c (relation_print, relation_digraph): Likewise.
8422 * src/relation.h (relation_node): Likewise.
8423 * src/state.h (state_number, transitions, errs, reductions,
8424 struct state): Likewise.
8425 * src/symtab.h (symbol_number, struct symbol): Likewise.
8426 * src/tables.c (vector_number, tally, action_number,
8427 default_goto, goto_actions): Likewise.
8428 * tests/existing.at (GNU Cim Grammar): Likewise.
8429 * tests/regression.at (Web2c Actions): Likewise.
8430
8431 * src/output.c (muscle_insert_short_int_table): Renamed from
8432 muscle_insert_short_table. All uses changed.
8433
d6328241
PH
84342004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8435
8436 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
8437 (declaration): Replace expected_conflicts with expected_sr_conflicts.
8438 Add %expect-rr rule.
4f16766c 8439
d6328241
PH
8440 * src/scan-gram.l: Recognize %expect-rr.
8441
4f16766c 8442 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 8443 expected_conflicts.
4f16766c 8444 (expected_rr_conflicts): Declare.
d6328241
PH
8445
8446 * src/conflicts.c (expected_sr_conflicts): Rename from
8447 expected_conflicts.
8448 (expected_rr_conflicts): Define.
8449 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
8450 for GLR parsers.
8451 Use expected_sr_conflicts in place of expected_conflicts.
8452 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 8453
d6328241 8454 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 8455
1452af69
PE
84562004-03-08 Paul Eggert <eggert@gnu.org>
8457
8458 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 8459 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
8460
8461 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
8462 in lalr1.cc.
8463 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
8464 * src/scan-gram.l (scan_integer): New function.
8465 ({int}): Use it.
8466 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
8467 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
8468 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
8469 Say "long int", not "long", for uniformity with GNU style.
8470
006d217d
PE
84712004-02-25 Paul Eggert <eggert@twinsun.com>
8472
8473 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
8474 compilers. This fixes a problem with Intel's C++ compiler being
8475 chatty, reported by Guido Trentalancia in
161a71f3 8476 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 8477
c2729758
ADL
84782004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
8479
8480 Support %destructor and merge error locations in lalr1.cc.
8481
8482 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
8483 (Parser::stos_): Define unconditionally.
8484 (Parser::destruct_): New method. Generate its body with
8485 b4_yydestruct_generate.
8486 (Parser::error_start_): New attribute.
8487 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
8488 token which are discarded.
8489 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
8490 error_start_ when erroneous token are discarded.
8491 (Parser::parse) <yyerrlab1>: Compute the location of the error
8492 token so that it covers all the discarded tokens.
8493 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
8494 it can be called with `%skeleton "lalr1.cc"', and do that.
8495
dd0e0635
PE
84962004-02-02 Paul Eggert <eggert@twinsun.com>
8497
8498 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
8499 $(top_srcdir)/lib and ../lib. This fixes a bug reported
8500 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
8501 There's no need to mention top_builddir since Automake does that
8502 for us.
8503 (INCLUDES): Remove, as Automake says it's obsolescent.
8504 Contents migrated into AM_CPPFLAGS as described above.
8505 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
8506
85072004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8508
8509 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
8510 (yyreportSyntaxError): Handle case where lookahead token is
8511 YYEMPTY.
8512
be16239b
PH
85132004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8514
8515 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
8516 resulting parsers are compilable with C++.
8517
5fa90832
PE
85182003-12-23 Paul Eggert <eggert@twinsun.com>
8519
8520 * config/depcomp, config/install-sh: Sync with Automake 1.8.
8521 * src/output.c (output_skeleton): Rename local var.
8522 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
8523 Bison tokens, as this runs afoul of the 2003-10-07 change that
8524 disallowed NUL bytes in character constants or string literals.
8525
8526 * tests/local.at: Require Autoconf 2.59's Autotest.
8527 * tests/testsuite.at: Don't include local.at, since we now assume
8528 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
8529 including it.
8530 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
8531 multiple inclusion warnings.
dd0e0635 8532
b165c324
AD
85332003-12-02 Akim Demaille <akim@epita.fr>
8534
8535 * doc/bison.texinfo (How Can I Reset the Parser): More about start
8536 conditions.
8537 From Bruno Haible.
8538
26e06a21
ADL
85392003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
8540
8541 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
8542
92ac3705
PE
85432003-10-07 Paul Eggert <eggert@twinsun.com>
8544
6a5ecb38
PE
8545 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
8546 if testsuite doesn't exist.
8547
92ac3705
PE
8548 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
8549 literals, unfortunately.
8550 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
8551 Complain about NUL bytes in character constants or string literals.
8552
91d2c560
PE
85532003-10-05 Paul Eggert <eggert@twinsun.com>
8554
8555 * NEWS: Don't document %no-default-prec, as it's still
8556 too experimental.
8557 * doc/bison.texinfo: Document %no-default-prec only if
8558 the defaultprec flag is set. Normally it's not.
8559
0cc3da3a
PE
85602003-10-04 Paul Eggert <eggert@twinsun.com>
8561
8562 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
8563 non-modifiable lvalue, instead of a modifiable one.
8564 * doc/bison.texinfo (Actions): Document that $$ can
8565 be assigned to. Do not claim that $$ and $N are
8566 array element references: user code should not rely on this.
8567
22fccf95
PE
85682003-10-01 Paul Eggert <eggert@twinsun.com>
8569
8570 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
8571 (grammar_declaration): Use it.
8572 * src/scan-gram.l: New token %no-default-prec.
8573 * tests/conflicts.at: Revamp tests to use %no-default-prec.
8574 * NEWS, doc/bison.texinfo: Document the above.
8575
fc8f2965
AD
85762003-10-01 Akim Demaille <akim@epita.fr>
8577
8578 VCG no longer supports long_straight_phase.
8579
8580 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
8581 * src/print_graph.c (print_graph): Adjust.
8582
39a06c25
PE
85832003-09-30 Frank Heckenbach <frank@g-n-u.de>
8584 and Paul Eggert <eggert@twinsun.com>
8585
8586 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
8587 Table of Symbols): Document %default-prec.
8588 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
8589 (grammar_declaration): Set default_prec on %default-prec.
8590 * src/scan-gram.l (%default-prec): New token.
8591 * src/reader.h (default_prec): New flag.
8592 * src/reader.c: Likewise.
8593 (packgram): Handle it.
8594 * tests/conflicts.at (%default-prec without %prec,
8595 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 8596
39a06c25
PE
85972003-09-30 Paul Eggert <eggert@twinsun.com>
8598
8599 * tests/testsuite.at: Include local.at, not input.at, fixing
8600 a typo in the 2003-08-25 patch.
8601
62b6aef9
AD
86022003-08-27 Akim Demaille <akim@epita.fr>
8603
8604 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
8605 GCC warnings.
8606
89e1cc61
AD
86072003-08-26 Akim Demaille <akim@epita.fr>
8608
8609 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
8610 "<\#" to avoid magic from Gnus when posting parts of this script.
8611
a08460b0
AD
86122003-08-26 Akim Demaille <akim@epita.fr>
8613
8614 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
8615 (Parser::parse): here.
8616 Adjust: nerrs and errstatus is now replaced by...
8617 (Parser::nerrs_, Parser::errstatus_): New.
8618
603f1cfd
AD
86192003-08-25 Akim Demaille <akim@epita.fr>
8620
8621 * config/announce-gen, Makefile.cfg: New.
8622 * Makefile.am: Adjust.
8623 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
8624 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
8625
cd3684cf
AD
86262003-08-25 Akim Demaille <akim@epita.fr>
8627
8628 When reducing initial empty rules, Bison parser read an initial
8629 location that is not defined. This results in garbage, and that
8630 affects Bison's own parser. Therefore we need (i) to extend Bison
8631 to support a means to initialize this location, and (ii) to use
8632 this CVS Bison to fix CVS Bison's parser.
8633
8634 * src/reader.h, reader.c (epilogue_augment): Remove, replace
8635 with...
8636 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
8637 * src/parse-gram.y: Adjust.
8638 (%initial-action): New.
8639 (%error-verbose): Since we require CVS Bison, there is no reason
8640 not to use it.
8641 * src/scan-gram.l: Adjust.
8642 * src/Makefile.am (YACC): New, to make sure we use our own parser.
8643 * data/yacc.c (yyparse): Use b4_initial_action.
8644
4e03e201
AD
86452003-08-25 Akim Demaille <akim@epita.fr>
8646
8647 * doc/bison.texinfo: Don't promote stdout for error messages.
8648
8c182d05
AD
86492003-08-25 Akim Demaille <akim@epita.fr>
8650
8651 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
8652 From Alexandre Duret-Lutz.
8653
6a60c4cf
PE
86542003-08-25 Akim Demaille <akim@epita.fr>
8655
8656 Version 1.875c.
8657
25f66e1a
AD
86582003-08-25 Akim Demaille <akim@epita.fr>
8659
8660 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
8661 Use them.
8662
5348bfbe
AD
86632003-08-25 Akim Demaille <akim@epita.fr>
8664
8665 * data/lalr1.cc (Parser::reduce_print_): New.
8666 Use it.
8667
47301314
AD
86682003-08-25 Akim Demaille <akim@epita.fr>
8669
8670 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
8671 error recovery loops. This patch is based on
161a71f3 8672 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
8673 Also, augment the similarity between lalr1.cc and yacc.c.
8674 Note: the locations of error recovery rules are not correct yet.
8675
8676 * data/lalr1.cc: Comment changes to augment the similarity between
8677 lalr1.cc and yacc.c.
8678 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
8679 (yyerrlab1): Remove, but where it used to be (now the bottom part of
8680 yyerrlab), when hitting EOF, pop the whole stack here instead of
8681 merely falling thru the default error handling mechanism.
8682 (yyerrorlab): New label, with the old contents of YYERROR,
8683 plus the following change: pop the stack of rhs corresponding
8684 to the production that invoked YYERROR. That is how Yacc
8685 behaves (required by POSIX).
8686 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
8687 fail.
8688
1f7a61ff
AD
86892003-08-25 Akim Demaille <akim@epita.fr>
8690
8691 Tune local.at so that people can "autom4te -l autotest calc.at -o
8692 calc" for instance, to extract a sub test suite.
8693
8694 * tests/testsuite.at: Move the initialization, Autotest version
8695 requirement, and AT_TESTED invocation into...
8696 * tests/local.at: here.
8697 * tests/testsuite.at: Include it for compatibility with Autoconf
8698 2.57.
8699 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
8700 be ignore.
8701
327b5b56
PE
87022003-08-04 Paul Eggert <eggert@twinsun.com>
8703
8704 Rework code slightly to avoid gcc -Wtraditional warnings.
8705 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
8706 The returned value is now stored in *YY0. All callers changed.
8707 * src/output.c (merge_output): Adjust to the above change.
8708
0051e3ed
PE
87092003-07-26 Paul Eggert <eggert@twinsun.com>
8710
8711 * data/glr.c (YYASSERT): New macro.
8712 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
8713 yyresolveStates, yyprocessOneStack):
8714 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
8715 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 8716
137437c6
PE
87172003-07-25 Paul Eggert <eggert@twinsun.com>
8718
5b620e06
PE
8719 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
8720 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 8721 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
8722 by Frank Heckenbach, though I have omitted the structure-initialization
8723 part of his glr-knr.diff patch since I recall that the Portable
8724 C Compiler didn't require that change.
8725
137437c6
PE
8726 Let the user specify how to allocate and free memory.
8727 Derived from a suggestion by Frank Heckenbach in
161a71f3 8728 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
8729 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
8730 All uses of free, malloc, realloc changed to use these macros,
8731 and unnecessary casts removed.
8732 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
8733
ddb85ca5
PE
87342003-07-06 Matthias Mann <MatthiasMann@gmx.de>
8735
8736 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
8737 use s.empty() rather than s == "" to test for empty string; see
161a71f3 8738 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
8739 (trivial change)
8740
39910e09
AD
87412003-06-25 Akim Demaille <akim@epita.fr>
8742
8743 * config/depcomp, config/install-sh: Update from masters.
8744
0ae99356
PE
87452003-06-20 Paul Eggert <eggert@twinsun.com>
8746
8747 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
8748 and return properly parenthesized result.
8749 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
8750 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8751 Remove unnecessary parentheses from uses.
8752 * doc/bison.texinfo (Location Default Action): Describe the
8753 conventions for parentheses.
8754
cd05d13c
PE
87552003-06-19 Paul Eggert <eggert@twinsun.com>
8756
81fd08ca
PE
8757 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
8758 yyreportTree): Do not assume that size_t is the same width as int,
8759 when printing sizes. Print sizes using an unsigned format.
8760 Problem reported by Frank Heckenbach in
161a71f3 8761 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 8762
cd05d13c
PE
8763 Port to Forte Developer 7 C compiler.
8764 * data/glr.c (struct YYLTYPE): If locations are not being used,
8765 declare a single dummy member, as empty structs do not conform
8766 to the C standard.
8767 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
8768 the Forte Developer 7 C compiler complains that end-of-loop
8769 code is not reached.
8770
4dcf140b
PE
87712003-06-17 Paul Eggert <eggert@twinsun.com>
8772
8773 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
8774 avoid warnings from picky compilers about redefinition of PARAMS.
8775
8dd76bee
PE
87762003-06-17 Paul Eggert <eggert@twinsun.com>
8777
8778 Version 1.875b.
8779
8780 * NEWS: Document 1.875b.
8781
8782 * lib/bbitset.h: Do not include config.h; that's the includer's job.
8783 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
8784 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
8785 Don't use 'index' in comments, as it's a builtin fn on some hosts.
8786 * lib/bitset_stats.c: Include gettext.h unconditionally, as
8787 per recent gettext manual's suggestion.
8788 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
8789 Use prototypes, not old-style definitions.
8790 * lib/lbitset.c (lbitset_unused_clear): Likewise.
8791 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
8792 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
8793 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
8794 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
8795 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
8796 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
8797 vbitset_or_and_cmp, vbitset_copy): Likewise.
8798
8799 * lib/libiberty.h: Do not include config.h; that's the includer's job.
8800 Do not include <stdlib.h>.
8801 (PARAMS): Define unconditionally for C89.
8802 (ATTRIBUTE_NORETURN): Remove.
8803 (ATTRIBUTE_UNUSED): Define unconditionally.
8804
8805 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 8806 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
8807 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
8808 * lib/vbitset.c, lib/vbitset.h: New files.
8809 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
8810 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
8811 from libbitset.
8812
8813 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
8814 `How Can I Reset @code{yyparse}', since texinfo does not allow
8815 arbitrary @ in node names.
8816
8817 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
8818 shouldn't be needed according to the gettext 0.12.1 documentation
8819 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 8820 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 8821 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 8822 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 8823
8dd76bee
PE
8824 * lib/.cvsignore: Add stdbool.h.
8825 * m4/.cvsignore: Add nls.m4, po.m4.
8826
8827 Upgrade to CVS gnulib.
8828 * stdbool_.h: File renamed from stdbool.h.in.
8829 * configure.ac (AM_STDBOOL_H): Invoke this instead of
8830 AC_HEADER_STDBOOL.
8831 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
8832 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
8833 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
8834 (MOSTLYCLEANFILES): New var.
8835 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
8836 (stdbool.h): New rule.
8837 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
8838 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
8839 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
8840 m4/quote.m4: Upgrade to today's gnulib.
8841
8842 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
8843 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
8844 the tests right now.
8845 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
8846 yyerror are declared before use; C99 requires this.
8847
25005f6a
PH
88482003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8849
8850 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
8851 first.
8852 (yyrecoverSyntaxError): Correct the logic for setting and testing
8853 yyerrState.
8854 Correct comment on handling EOF.
8855 Allow states with only a default reduction, rather than failing
8dd76bee 8856 (I can't quite reconstruct why these were not allowed before).
25005f6a 8857
137437c6 8858 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 8859 buffer overruns, corrupting state.
8dd76bee
PE
8860
8861 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
8862 definition.
8863 * src/reader.h (max_left_semantic_context): New variable declaration.
8864 * src/scan-gram.l (max_left_semantic_context): Define.
8865 (handle_action_dollar): Update max_left_semantic_context.
8866 * data/glr.c (YYMAXLEFT): New definition.
8867 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
8868 (yyresolveAction): Ditto.
8869
8870 Fixes to problems with location handling in GLR parsers reported by
8871 Frank Heckenbach (2003/06/05).
8872
8873 * data/glr.c (YYLTYPE): Make trivial if locations not used.
8874 (YYRHSLOC): Add parentheses, and define only if locations used.
8875 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
8876 locations not used.
8877 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
8878 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 8879
25005f6a
PH
8880 * tests/cxx-type.at: Exercise location information; update tests
8881 to differentiate output with and without locations.
8dd76bee 8882 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
8883 because default YYLTYPE not yet defined.
8884 Change semantic actions to compute strings, rather than printing
8885 them directly (to test proper passing of semantics values). Change
8886 output to prefix notation and update test data and expected results.
8887 (yylex): Track locations.
8888 (stmtMerge): Return value rather than printing, and include arguments
8889 in value.
8dd76bee 8890
711f40b7
PE
88912003-06-03 Paul Eggert <eggert@twinsun.com>
8892
8893 Avoid warnings generated by GCC 2.95.4 when Bison is
8894 configured with --enable-gcc-warnings.
8895 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
8896 yy::]b4_parser_class_name[::translate_,
8897 yy::Stack::operator[] (unsigned),
8898 yy::Stack::operator[] (unsigned) const,
8899 yy::Slice::operator[] (unsigned),
8900 yy::Slice::operator[] (unsigned) const):
8901 Rename local vars to avoid warnings.
8902 * tests/glr-regression.at (Improper handling of embedded actions
8903 and $-N in GLR parsers): Remove unused local variable from yylex.
8904 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
8905 (void) as arg when not pure, since we now assume C89 when building
8906 Bison. Pacify GCC by using parameter.
8907
ac695f7d
PE
89082003-06-02 Paul Eggert <eggert@twinsun.com>
8909
8910 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
8911 yy::Location::lines, yy::Location::columns): Rename arguments
8912 to avoid shadowing; this removes a warning generated by GCC 3.3.
8913
26ec81e0
PE
89142003-06-01 Paul Eggert <eggert@twinsun.com>
8915
8916 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
8917 to g++, as GCC 3.3 complains if you do it.
8918 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
8919 everything that WARNING_CFLAGS has, except omit warnings
8920 not suitable for C++.
8921 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
8922 * tests/atlocal.in (CXXFLAGS): New var.
8923 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
8924
8925 Fix a GLR parser bug I reported in February; see
161a71f3 8926 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
8927 The problem was that GLR parsers did not conform to the C standard,
8928 because actions like { $1 = $2 + $3; } expanded to expressions
8929 that invoked YYFILL in separate subexpressions, and YYFILL assigned
8930 to a local variable. The C standard says that expressions
8931 like (var = f ()) + (var = f ()) have undefined behavior.
8932 Another problem was that GCC sometimes issues warnings that
8933 yyfill and its parameters are unused.
8934
8935 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
8936 as possibly unused.
8937 (yyfill): New function.
8938 (YYFILL): Use it.
8939 (yyuserAction): Change type of yynormal to bool, so that it matches
8940 the new yyfill signature. Mark it as possibly unused.
8941
8942
8943 Follow up on a bug I reported in February, where a Bison-generated
8944 parser can loop. Provide a test case and a fix for yacc.c. I
8945 don't have a fix for lalr1.cc or for glr.c, unfortunately.
8946 The original bug report is in:
161a71f3 8947 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
8948
8949 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
8950 macro's size was becoming unwieldy.
8951 (yyerrlab): Do not discard an empty lookahead symbol, as this
8952 might destroy garbage.
8953 (yyerrorlab): New label, with the old contents of YYERROR,
8954 plus the following change: pop the stack of rhs corresponding
8955 to the production that invoked YYERROR. That is how Yacc
8956 behaves, and POSIX requires this behavior.
8957 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
8958 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
8959 Define 'alarm' to do nothing if unistd.h is not available.
8960 Add a new rule "exp: '-' error;" to test the above change to
8961 data/yacc.c. Use 'alarm' to abort any test taking longer than
8962 10 seconds, as it's probably looping.
8963 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
8964 Also, the new yacc.c generates two fewer diagnostics for an
8965 existing test.
8966
d0829076
PE
89672003-05-24 Paul Eggert <eggert@twinsun.com>
8968
c6ae27df
PE
8969 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
8970 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
8971 This fixes a problem reported by John Bowman when the Compaq/HP
8972 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
8973 -ansi -Wall -gall).
8974 * data/yacc.c (union yyalloc): Likewise.
8975 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 8976
d0829076
PE
8977 Switch from 'int' to 'bool' where that makes sense.
8978
8979 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
8980 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
8981 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
8982 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
8983 Return or accept bool, not int. All callers changed.
8984 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
8985 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
8986 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
8987 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
8988 bitset_or_and_cmp_): Likewise.
8989 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
8990 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
8991 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
8992 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
8993 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
8994 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
8995 bitset_stats_or_and_cmp): Likewise.
8996 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
8997 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
8998 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
8999 ebitset_xor_cmp): Likewise.
9000 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
9001 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
9002 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
9003 lbitset_xor_cmp): Likewise.
9004 * lib/bbitset.h: Include <stdbool.h>.
9005 (struct bitset_vtable): The following members now return bool, not
9006 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
9007 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
9008 or_and_cmp).
9009 * src/conflicts.c (count_rr_conflicts): Likewise.
9010 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
9011 All uses changed.
9012 * lib/ebitset.c (ebitset_obstack_init): Likewise.
9013 * lib/lbitset.c (lbitset_obstack_init): Likewise.
9014 * src/getargs.c (debug_flag, defines_flag, locations_flag,
9015 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9016 graph_flag): Likewise.
9017 * src/getargs.h (debug_flag, defines_flag, locations_flag,
9018 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9019 graph_flag): Likewise.
9020 * src/output.c (error_verbose): Likewise.
9021 * src/output.h (error_verbose): Likewise.
9022 * src/reader.c (start_flag, typed): Likewise.
9023 * src/reader.h (typed): Likewise.
9024 * src/getargs.c (LOCATIONS_OPTION): New constant.
9025 (long_options, getargs): Use it.
9026 * src/lalr.c (build_relations): Use bool, not int.
9027 * src/nullable.c (nullable_compute): Likewise.
9028 * src/print.c (print_reductions): Likewise.
9029 * src/tables.c (action_row, pack_vector): Likewise.
9030 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
9031 * src/output.c (prepare): Use it.
9032 * src/output.c (token_definitions_output,
9033 symbol_destructors_output, symbol_destructors_output): Use string,
9034 not boolean integer, to keep track of whether to output separator.
9035 * src/print_graph.c (print_core): Likewise.
9036 * src/state.c (state_rule_lookaheads_print): Likewise.
9037
9038 * config/install-sh: Sync from automake 1.7.5.
9039
6b2584b7
PE
90402003-05-14 Paul Eggert <eggert@twinsun.com>
9041
9042 * src/parse-gram.y (rules_or_grammar_declaration): Require a
9043 semicolon after a grammar declaration, in the interest of possible
9044 future changes to the Bison input language.
9045 Do not allow a stray semicolon at the start of the grammar.
9046 (rhses.1): Allow one or more semicolons after any rule, including
9047 just before "|" as required by POSIX.
9048 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
9049 grammar.
9050
caf37a36
ADL
90512003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
9052
9053 %parse-param support for lalr1.cc.
9054
9055 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
9056 b4_cc_constructor_calls, b4_cc_constructor_call,
9057 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
9058 definitions.
9059 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
9060 parse-param arguments.
9061 (yy::b4_parser_class_name): Declare instance variables to
9062 hold parse-param arguments.
9063 * tests/calc.at: s/value/semantic_value/ because value clashes
9064 with a member of yy::b4_parser_class_name. Adjust C++ code
9065 to handle %parse-param. Enable %parse-param test in C++.
9066
3ab37077
PE
90672003-05-12 Paul Eggert <eggert@twinsun.com>
9068
9069 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
9070 English a bit. Fix fclose typo. Change "const char" to "char
9071 const", and use ANSI C rather than K&R for "main". Suggest
9072 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
9073 and suggest yy_switch_to_buffer.
9074
90752003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
9076
9077 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
9078 C89. This avoids a diagnostic on compilers that define __STDC__
9079 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 9080 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 9081
e743727f
PE
90822003-05-03 Paul Eggert <eggert@twinsun.com>
9083
9084 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
9085 Do not overrun array bounds.
9086 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 9087 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 9088
916708d5
AD
90892003-04-29 Akim Demaille <akim@epita.fr>
9090
9091 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
9092 * src/getargs.c, src/getargs.h: here, as bool, not int.
9093 (nondeterministic_parser): New.
9094 * src/parse-gram.y, src/scan-gram.l: Support
9095 %nondeterministic-parser.
9096 * src/output.c (prepare): Use nondeterministic_parser instead
9097 of glr_parser where appropriate.
9098 * src/tables.c (conflict_row, action_row, save_row)
9099 (token_actions, token_actions, pack_vector): Ditto.
9100
a06ea4aa
AD
91012003-04-29 Akim Demaille <akim@epita.fr>
9102
9103 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
9104
211074ca
AD
91052003-04-29 Akim Demaille <akim@epita.fr>
9106
9107 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
9108 with %pure-parser and %locations to exercise the patch from Yakov
9109 Markovitch below.
9110
6175ffe3
PE
91112003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
9112
9113 * data/yacc.c: (b4_lex_param): Corrected for the case where
9114 %lex-param is provided and %pure-parser isn't.
9115
b1e95857
PE
91162003-04-27 Paul Eggert <eggert@twinsun.com>
9117
9118 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 9119 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
9120 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
9121 if it is not defined.
9122 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
9123
acda9df6
PE
91242003-04-26 Paul Eggert <eggert@twinsun.com>
9125
3470c57b
PE
9126 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
9127 Declare to be of type suitable for the ninf value itself, not of
9128 type suitable for the corresponding table, since the latter might
9129 be unsigned but the ninf value might be negative. This fixes a
9130 bug reported by Alexandre Duret-Lutz in
161a71f3 9131 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 9132
acda9df6
PE
9133 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
9134 invokes it. We shouldn't invoke it twice because it will attempt
9135 to put error.o in the archive twice. This fixes a glitch reported
9136 by Martin Mokrejs in
161a71f3 9137 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 9138
b5250f26
PE
91392003-04-21 Paul Eggert <eggert@twinsun.com>
9140
9141 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
9142 to gnulib.
9143
089ac0f1
PE
91442003-04-21 Yakov Markovitch <Markovitch@iso.ru>
9145
9146 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
9147 Fix obvious typo that results in uncompilable GLR parsers
9148 when both %pure-parser and %locations are used. (trivial change)
9149
5ededac6
PE
91502003-04-17 Paul Eggert <eggert@twinsun.com>
9151
1b8f2fff
PE
9152 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
9153 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
9154 Do not insert the expected token via unput, as this runs afoul
9155 of a POSIX-compatibility bug in flex 2.5.31.
9156 All uses changed to BEGIN the parent state,
9157 since we no longer insert the expected token via unput.
9158 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
9159 that is no longer emitted after the above change.
9160
5ededac6
PE
9161 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
9162 the first one. This change is from Paul Hilfinger, and it fixes
9163 regression reported by Werner Lemberg in
161a71f3 9164 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
9165
9166 (resolve_sr_conflict): Don't invoke state_errs_set
9167 unless one or more tokens have been explicitly made errors.
9168 Otherwise, the above change causes Bison to abort.
9169
9170 * tests/existing.at (GNU pic Grammar): New test case, taken from
9171 Lemberg's email.
9172
b8be9132
AD
91732003-03-31 Akim Demaille <akim@epita.fr>
9174
9175 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
9176
d423d460
AD
91772003-03-31 Akim Demaille <akim@epita.fr>
9178
9179 * src/output.c (prepare_symbols): Avoid trailing spaces in the
9180 output.
9181
c7e441b4
AD
91822003-03-31 Akim Demaille <akim@epita.fr>
9183
9184 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
9185 From Paul Hilfinger.
9186
231897ad
AD
91872003-03-29 Akim Demaille <akim@epita.fr>
9188
9189 * m4/error.m4: Do not put under dynamic conditions some code which
9190 expansion is under static control.
9191
5b066063
AD
91922003-03-29 Akim Demaille <akim@epita.fr>
9193
9194 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
9195
22a74fec
AD
91962003-03-29 Akim Demaille <akim@epita.fr>
9197
9198 * doc/bison.texinfo (Strings are Destroyed): New.
9199
0eee27e7
PE
92002003-03-13 Paul Eggert <eggert@twinsun.com>
9201
9202 * .cvsignore: Add configure.lineno.
9203 * src/.cvsignore: Add yacc.
9204 * tests/.cvsignore: Add testsuite.log.
9205 * doc/fdl.texi: Sync with latest FSF version.
9206
f61aad93
PE
92072003-03-12 Paul Eggert <eggert@twinsun.com>
9208
537636c7
PE
9209 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
9210 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
9211 cursor, instead of leaving it undefined. This fixes a bug
9212 reported by Tim Van Holder in
161a71f3 9213 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
9214 * tests/input.at (Torturing the Scanner): Test the scanner on
9215 an empty input file, which was Tim Van Holder's test case.
9216
9217 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
9218 <sys/resource.h> can be included, include sys/time.h and
9219 sys/times.h first, if available. This works around the SunOS
9220 4.1.4 porting bug reported by Bruce Becker in
161a71f3 9221 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
9222
9223 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
9224 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
9225 AC_HEADER_SYS_WAIT.
9226
f61aad93
PE
9227 Merge changes from gnulib. This was prompted because the CVS
9228 snapshot didn't build on Solaris 7 due to strnlen problems.
9229
9230 These changes need to be merged back into gnulib:
9231 * lib/hash.c: Include <stdbool.h> unconditionally.
9232 * m4/onceonly.m4 (m4_quote): New macro.
9233 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
9234 Quote AC_FOREACH variable-expansions properly.
9235 The 2003-01-03 obstack.h change also needs merging.
9236 {end of changes requiring merging}
5b066063 9237
f61aad93
PE
9238 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
9239 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
9240 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
9241 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
9242 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
9243 New files, imported from gnulib.
9244 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
9245 above.
9246
9247 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
9248 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
9249 gnulib sources.
9250
9251 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
9252 Add.
9253 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
9254 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
9255 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
9256 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
9257 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
9258 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
9259 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
9260 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
9261 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
9262 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
9263 (jm_PREREQ_ARGMATCH): Remove.
9264 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
9265 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
9266
9267 * src/system.h: Include <stdbool.h> unconditionally.
9268
9269 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
9270 assuming at least C89 in the bitset code for some time now.
9271
d2ffe116
AD
92722003-03-03 Akim Demaille <akim@epita.fr>
9273
9274 * ro.po: New.
9275
052826fd
AD
92762003-03-02 Akim Demaille <akim@epita.fr>
9277
9278 * doc/bison.texinfo (Table of Symbols): Reactivate the
9279 documentation for %lex-param, and %parse-param.
9280
c4749565
AD
92812003-03-02 Akim Demaille <akim@epita.fr>
9282
9283 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
9284 generate verbose error messages.
9285 Use the number of tokens as an upper bound in yytname, as it
9286 cannot be a non terminal.
9287
d5286af1
AD
92882003-03-02 Akim Demaille <akim@epita.fr>
9289
9290 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
9291 message.
9292
22e304a6
AD
92932003-03-02 Akim Demaille <akim@epita.fr>
9294
22e304a6
AD
9295 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
9296 Use them to exercise yycheck overrun.
9297 Based on Andrew Suffield's grammar.
9298
67a25fed
AD
92992003-03-02 Akim Demaille <akim@epita.fr>
9300
9301 Create tests/local.at for Bison generic testing macros.
9302
9303 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
9304 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
9305 This new file.
9306 * tests/calc.at (AT_CHECK_CALC): Adjust.
9307 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
9308 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
9309 * tests/local.at: here.
9310 (AT_COMPILE_CXX): Tags the tests using it as c++.
9311 Ignore the test if CXX is not functional.
9312
9c2b381f
PE
93132003-03-01 Paul Eggert <eggert@twinsun.com>
9314
9315 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
9316 not loc->end, since loc->end might contain garbage and this leads
9317 to undefined behavior on some platforms.
9318 (id_loc, token_start): Use (IF_LINTed) initial values that do not
9319 depend on *loc, so that the reader doesn't give the the false
9320 impression that *loc is initialized.
9321 (<INITIAL>"%%"): Do not bother setting code_start, since its value
9322 does not survive the return.
9323
0433ba88
AD
93242003-03-01 Akim Demaille <akim@epita.fr>
9325
9326 * src/scan-gram.l (code_start): Always initialize it when entering
9327 into yylex, as SC_EPILOGUE is activated *before* the corresponding
9328 yylex invocation. An alternative would be making it static, but
9329 then it starts with the second %%'s beginning, instead of its end.
9330
b305ea69
PE
93312003-02-28 Paul Eggert <eggert@twinsun.com>
9332
9333 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
9334 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 9335 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 9336
c3d25e01
PE
93372003-02-26 Paul Eggert <eggert@twinsun.com>
9338
9339 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
9340 Remove Sequent/Pyramid discussion (nobody uses them any more).
9341 Merge VMS and MS-DOS discussion; these ports may well be dead
9342 but let's keep mentioning them for now. Put <> around email
9343 addresses. Add copyright notice.
9344
c267ffbc
PE
93452003-02-24 Paul Eggert <eggert@twinsun.com>
9346
9347 * data/glr.c (yy_reduce_print): yylineno -> yylno,
9348 to avoid collision with flex use of yylineno.
9349 Problem reported by Bruce Lilly in
161a71f3 9350 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
9351 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9352 * data/yacc.c (yy_reduce_print): Likewise.
9353
9354 * config/depcomp: Sync with Automake 1.7.3.
9355
f939fc12
AD
93562003-02-21 Akim Demaille <akim@epita.fr>
9357
9358 * data/lalr1.cc: Use temporary variables instead of casts to
9359 change integer types.
9360 Suggested by Paul Eggert.
9361
95923bd6
AD
93622003-02-21 Akim Demaille <akim@epita.fr>
9363
9364 * doc/bison.texinfo: Use "location" consistently to refer to @n,
9365 to avoid confusions with lalr1.cc's notion of Position.
9366 Suggested by Paul Eggert.
9367
2cdc240e
AD
93682003-02-20 Akim Demaille <akim@epita.fr>
9369
9370 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
9371 before initial_columns.
9372 (location.hh): Use consistent variable names when defining the
9373 operator<<.
9374 Use "last" so that we subtract from Positions, not from unsigned.
9375
5d003116
AD
93762003-02-20 Akim Demaille <akim@epita.fr>
9377
9378 * data/lalr1.cc (position.hh): New subfile, including the extended
9379 and Doxygen'ed documentation of class Position.
9380 (location.hh): Use it.
9381 Document a` la Doxygen.
ba1ecc07 9382 With the help of Benoit Perrot.
5d003116 9383
d02b25f9
AD
93842003-02-20 Akim Demaille <akim@epita.fr>
9385
9386 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
9387 AT_YACC_IF.
9388 Redefine AT_YYERROR_SEES_LOC_IF using it.
9389 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
9390 not defined.
9391 Don't use the location in yy::Parser::error_ and
9392 yy::Parser::print_ when not %locations.
9393 Activate more lalr1.cc tests.
9394
0d1c3a04
AD
93952003-02-19 Akim Demaille <akim@epita.fr>
9396
9397 * data/lalr1.cc: When displaying a line number, be sure to make it
9398 an int.
9399
60a777aa
AD
94002003-02-19 Akim Demaille <akim@epita.fr>
9401
9402 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
9403 Remove, useless.
9404 (YYABORT, YYACCEPT, YYERROR): New.
9405 * tests/calc.at: Renable the lalr1.cc test.
9406
0b86fc41
AD
94072003-02-19 Akim Demaille <akim@epita.fr>
9408
9409 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
9410 error recovery, mixing with/without pops and discarding of the
9411 lookahead.
9412 Exercise YYERROR.
9413 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
9414
da99a5dc
PE
94152003-02-17 Paul Eggert <eggert@twinsun.com>
9416
9417 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
9418 * tests/testsuite.at (AT_COMPILE): Use them.
9419 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 9420 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 9421
93b8c255
PE
94222003-02-12 Paul Eggert <eggert@twinsun.com>
9423
9424 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
9425 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 9426 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
9427 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
9428 Check for malloc failure, for consistency with yacc.c.
9429 (yytname_size): Remove, for consistency with yacc.c.
9430
9431 The bug still remains in data/lalr1.cc, as I didn't have time
9432 to fix it there.
9433
7548fed2
AD
94342003-02-06 Akim Demaille <akim@epita.fr>
9435
9436 * configure.ac (GXX): Rename as...
9437 (CXX): this, to keep the original Autoconf semantics.
9438 Require 2.57.
9439 * data/lalr1.cc: Fix b4_copyright invocations.
9440 If YYDEBUG is not defined, don't depend upon name_ being defined.
9441 (location.hh): Include string and iostream.
9442 (Position::filename): New member.
9443 (Position::Position ()): New.
9444 (operator<< (Position)): New.
9445 (operator- (Position, int)): New.
9446 (Location::first, Location::last): Rename as...
9447 (Location::begin, Location::end): these, to mock the conventional
9448 iterator names.
9449 (operator<< (Location)): New.
9450 * tests/atlocal.in (CXX): New.
9451 * tests/testsuite.at (AT_COMPILE_CXX): New.
9452 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
9453 locations in a more synthetic way.
9454 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
9455 lalr1.cc is used.
9456 Adjust the C locations to match those from Emacs: first column is
9457 column 0.
9458 Change all the expected results.
9459 Conform to the GCS: simplify the locations when applicable.
9460 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
9461 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
9462 these CPP macros with the m4 macros new defined by...
9463 (AT_CHECK_PUSHDEFS): this, i.e.:
9464 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 9465 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
9466 New macros.
9467 (AT_CHECK_POPDEFS): Undefine them.
9468 (AT_CHECK_CALC_LALR1_CC): New.
9469 Use it for the first lalr1.cc test.
9470
43a176ef
AD
94712003-02-04 Akim Demaille <akim@epita.fr>
9472
9473 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
9474 Location as is defined.
9475
fc049e9c
AD
94762003-02-04 Akim Demaille <akim@epita.fr>
9477
9478 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
9479 name_ being defined.
9480
a737b216
PE
94812003-02-03 Paul Eggert <eggert@twinsun.com>
9482
9483 * src/gram.h (start_symbol): Remove unused decl.
9484
9485 Use more-consistent naming conventions for local vars.
9486
9487 * src/derives.c (derives_compute): Change type of local var from
9488 int to rule_number.
9489 * src/gram.c (grammar_rules_partial_print): Likewise.
9490 * src/print.c (print_core): Likewise.
9491 * src/reduce.c (reduce_grammar_tables): Likewise.
9492
9493 * src/gram.c (grammar_dump): Change name of item_number *
9494 local var from r to rp.
9495 * src/nullable.c (nullable_compute): Likewise.
9496
9497 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
9498
9499 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
9500 for symbol or symbol_number var.
9501 * src/reader.c (grammar_start_symbol_set): Likewise.
9502 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
9503 Likewise.
9504 * src/state.c (transitions_to): Likewise.
9505 * src/state.h: Likewise.
9506 * src/tables.c (symbol_number_to_vector_number): Likewise.
9507
9508 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
9509 char * var.
9510
9511 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
9512 var.
9513
9514 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
9515 var.
9516
9517 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
9518 Use str, not s, for char * var. Use ch, not c, for character var.
9519 Use size for size var.
9520
9521 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
9522 char * var.
9523 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
9524 uniqstr var.
9525 * src/uniqstr.h: Likewise.
9526
9527 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9528 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9529 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
9530 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
9531 param to have same name as that of enum, so that we don't use
9532 "s" to stand for a non-state.
9533
68e93ad5
AD
95342003-02-02 Akim Demaille <akim@epita.fr>
9535
9536 * src/scan-skel.l: Scan more than one inert character per yylex
9537 invocation.
9538
92898986
PE
95392003-02-01 Paul Eggert <eggert@twinsun.com>
9540
9541 Version 1.875a.
9542
1d9d5d71
PE
9543 * po/LINGUAS: Add ms.
9544
0435d061
AD
95452003-01-30 Akim Demaille <akim@epita.fr>
9546
9547 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
9548
6029a57f
PH
95492003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9550
9551 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
9552 of $1.
0435d061
AD
9553
9554 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 9555 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 9556 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 9557
6029a57f
PH
9558 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
9559 (b4_rhs_location): Ditto.
0435d061 9560 (yyfill): New function to copy from stack tree into array
6029a57f 9561 incrementally.
0435d061
AD
9562 (yyuserAction): Modify to allow incremental move of semantic values
9563 to rhs array when in GLR mode.
9564 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
9565 as needed.
9566 Remove dummy use of yystack, as there is now a guaranteed use.
9567 (yydoAction): Modify to allow incremental move of semantic values
9568 to rhs array when in GLR mode.
9569 (yyresolveAction): Ditto.
9570 (yyglrShiftDefer): Update comment.
0435d061 9571 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
9572 (yyglrReduce): Ditto.
9573 (yydoAction): Ditto
0435d061 9574
6029a57f
PH
9575 * tests/glr-regr1.at: Rename to ...
9576 * tests/glr-regression.at: Add new regression test for the problems
9577 described above (adapted from S. Eken).
9578 Update copyright notice.
9579 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
9580 * tests/Makefile.am: Ditto.
9581
6cee6297
PE
95822003-01-28 Paul Eggert <eggert@twinsun.com>
9583
9584 * data/lalr1.cc: Do not use @output_header_name@ unless
9585 b4_defines_flag is set. This fixes two bugs reported by
9586 Tim Van Holder in
161a71f3
PE
9587 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
9588 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 9589
b2a836b5
PE
95902003-01-21 Paul Eggert <eggert@twinsun.com>
9591
9592 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
9593 we don't need to worry about yyerrlab1 being reported as an
9594 "unused label" by non-GCC C compilers. The downside is that if
9595 locations are used then a couple of statements are duplicated each
9596 time YYERROR is invoked, but the upside is that the warnings
9597 should vanish.
9598 (yyerrlab1): Move code to YERROR.
9599 (yyerrlab2): Remove. Change uses back to yyerrlab1.
9600 This reverts some of the 2002-12-27 change.
9601
4196b931
PE
96022003-01-17 Paul Eggert <eggert@twinsun.com>
9603
9604 * src/output.c (symbol_printers_output): Fix typo that led
9605 to core dump. Problem reported by Antonio Rus in
161a71f3 9606 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 9607
3ae831b4
AD
96082003-01-13 Akim Demaille <akim@epita.fr>,
9609 Quoc Peyrot <chojin@lrde.epita.fr>,
9610 Robert Anisko <anisko_r@lrde.epita.fr>
9611
9612 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
9613 when the stacks contain one element, as the loop would otherwise
9614 free the last state, and then use the top state (the one we just
9615 popped). This means that the initial elements will not be freed
9616 explicitly, as is the case in yacc.c; it is not a problem, as
9617 these elements have fake values.
9618
e3aa65c5
PE
96192003-01-11 Paul Eggert <eggert@twinsun.com>
9620
9621 * NEWS: %expect-violations are now just warnings, reverting
9622 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
9623 bootstrapping problem reported by Matthias Klose; see
161a71f3 9624 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
9625 * src/conflicts.c (conflicts_print): Likewise.
9626 * tests/conflicts.at (%expect not enough, %expect too much,
9627 %expect with reduce conflicts): Likewise.
9628 * doc/bison.texinfo (Expect Decl): Document this. Also mention
9629 that the warning is enabled if the number of conflicts changes
9630 (not necessarily increases).
9631
9632 * src/getargs.c (version): Update copyright year.
9633
f0057011
AD
96342003-01-09 Akim Demaille <akim@epita.fr>
9635
9636 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
9637
1ee6d2a0
PE
96382003-01-08 Paul Eggert <eggert@twinsun.com>
9639
9640 * Makefile.maint (WGETFLAGS):
9641 New macro, containing "-C off" to disable proxy caches.
9642 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
9643 (rel-check): Use $(WGET) instead of wget.
9644
d4fd77c4
PE
96452003-01-06 Paul Eggert <eggert@twinsun.com>
9646
9647 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
9648 the GLR paper of Scott, Johnstone and Hussain.
9649
464c6927
PE
96502003-01-04 Paul Eggert <eggert@twinsun.com>
9651
d600ee67
PE
9652 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
9653 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
9654 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
9655 (EXTRA_LIBRARIES): New var, for liby.a.
9656 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
9657 (EXTRA_SCRIPTS): New var, for yacc.
9658
464c6927
PE
9659 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
9660 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
9661 Problem reported by Nelson H. F. Beebe.
9662
96632003-01-03 Paul Eggert <eggert@twinsun.com>
9664
9665 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
9666 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
9667 when compiling Bison 1.875's `bitset bset = obstack_alloc
9668 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
9669
9670 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
9671 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
9672 grow to a huge size with typical invocation.
d600ee67 9673
464c6927
PE
9674 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
9675 Use the pattern recommended by Autoconf 2.57, except also protect
9676 against double-definition.
9677 * src/system.h: Likewise.
9678 Portability issues reported by Nelson H. F. Beebe.
d600ee67 9679
464c6927
PE
9680 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
9681 All uses changed. Provide a definition in both C and C++.
9682 (yytrue, yyfalse): Define even if defined (__cplusplus).
9683
9684 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
9685 Reported by Nelson H. F. Beebe.
d600ee67 9686
464c6927
PE
9687 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
9688
0f42c7d5
PE
96892003-01-02 Paul Eggert <eggert@twinsun.com>
9690
9691 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
9692 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
9693 Bug reported by Nelson H. F. Beebe.
9694
dc546b0f
PE
96952003-01-01 Paul Eggert <eggert@twinsun.com>
9696
9697 * Version 1.875.
9698
2c09b6a7
PE
96992002-12-30 Paul Eggert <eggert@twinsun.com>
9700
9701 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
9702 Moved here from...
9703 (<INITIAL>","): Here. This causes stray "," to be treated
9704 more uniformly.
9705
dc546b0f 9706 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
9707 last brace in braced code when not in Yacc mode, for compatibility
9708 with Bison 1.35. This resurrects the 2001-12-15 patch to
9709 src/reader.c.
9710
9711 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
9712 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
9713
535c0f63
PE
97142002-12-28 Paul Eggert <eggert@twinsun.com>
9715
9716 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
9717 that of SYM's type. This fixes Debian bug 168069, reported by
9718 Thomas Olsson.
d600ee67 9719
963fcc17
PE
97202002-12-28 Paul Eggert <eggert@twinsun.com>
9721
9722 Version 1.75f.
9723
9724 Switch back to the Yacc style of conflict reports, undoing some
9725 of the 2002-07-30 change.
9726 * doc/bison.texinfo (Understanding): Use Yacc style for
9727 conflict reports. Also, use new way of locating rules.
9728 * src/conflicts.c (conflict_report):
9729 Renamed from conflict_report_yacc, removing the old
9730 'conflict_report'. Translate the entire conflict report at once,
9731 so that we don't assume that "," has the same interpretation in
9732 all languages.
9733 (conflicts_output): Use Yacc-style conflict report for each state,
9734 instead of our more-complicated style.
9735 (conflicts_print): Use Yacc-style conflict report, except print
9736 the input file name when not emulating Yacc.
9737 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
9738 Conflicted Reduction, %expect not enough, %expect too much,
9739 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
9740 * tests/existing.at (GNU Cim Grammar): Likewise.
9741 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
9742
9743 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
9744 fatal): Don't invoke fflush; it's not needed and it might even be
9745 harmful for stdout, as stdout might not be open.
9746 * src/reduce.c (reduce_print): Likewise.
9747
b1efe548
PE
97482002-12-27 Paul Eggert <eggert@twinsun.com>
9749
9750 Fix a bug where error locations were not being recorded correctly.
9751 This problem was originally reported by Paul Hilfinger in
161a71f3 9752 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
9753
9754 * data/yacc.c (yyparse): New local var yylerrsp, to record the
9755 top of the location stack's error locations.
9756 (yyerrlab): Set it. When discarding a token, push its location
9757 onto yylerrsp so that we don't lose track of the error's end.
9758 (yyerrlab1): Now is only the target of YYERROR, so that we can
9759 properly record the location of the action that failed. For GCC
9760 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
9761 GCC warning about yyerrlab1 being unused if YYERROR is unused.
9762 (yyerrlab2): New label, which yyerrlab now falls through to.
9763 Compute the error's location by applying YYLLOC_DEFAULT to
9764 the locations of all the symbols that went into the error.
9765 * doc/bison.texinfo (Location Default Action): Mention that
9766 YYLLOC_DEFAULT is also invoked for syntax errors.
9767 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9768 Error locations include the locations of all the tokens that were
9769 discarded, not just the last token.
d600ee67 9770
983c5c2c
PE
97712002-12-26 Paul Eggert <eggert@twinsun.com>
9772
b1efe548
PE
9773 * src/files.c: Include quote.h.
9774 (compute_output_file_names): Warn if we detect conflicting
9775 outputs to the same file. This should catch the misunderstanding
9776 exemplified by Debian Bug 165349, reported by Bruce Stephens..
9777
9778 * src/conflicts.c (conflicts_print): If the user specifies
9779 "%expect N", report an error if there are any reduce/reduce
9780 conflicts. This is what the manual says should happen.
9781 This fixes Debian bug 130890, reported by Anthony DeRobertis.
9782 * tests/conflicts.at (%expect with reduce conflicts): New test.
9783
983c5c2c
PE
9784 Don't use m4_include on relative file names, as it doesn't work as
9785 desired if there happens to be a file with that name under ".".
d600ee67 9786
983c5c2c
PE
9787 * m4sugar/version.m4: Remove; it was included but it wasn't used.
9788 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
9789 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
9790 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
9791 * src/output.c (output_skeleton): Use full path names when
9792 specifying a file to include; don't rely on include path, as
9793 it's unreliable when the working file contains a file with
9794 that name.
d600ee67 9795
983c5c2c
PE
97962002-12-25 Paul Eggert <eggert@twinsun.com>
9797
9798 Remove obsolete references to bison.simple and bison.hairy.
9799 Problem mentioned by Aubin Mahe in
161a71f3 9800 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
9801 * data/glr.c: Comment fix.
9802 * doc/bison.1: Remove references. Also, mention "yacc".
9803
9804 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
9805 with -g option.
9806
9807 * src/parse-gram.y (declaration): Use enum "report_states" rather
9808 than its numeric value 1.
9809
9810 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
9811 opening a new one. This fixes Debian bug 165349, reported by
9812 Bruce Stephens.
9813
23f2d9dc
PE
98142002-12-24 Paul Eggert <eggert@twinsun.com>
9815
9816 Version 1.75e.
9817
9818 * Makefile.maint (cvs-update): Don't assume that the shell
9819 supports $(...), as Solaris sh doesn't.
9820
9821 * src/parse-gram.y (lloc_default): Remove test for empty
9822 nonterminals at the end, since it didn't change the result.
9823
98242002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
9825
9826 If the user does not define YYSTYPE as a macro, Bison now declares it
9827 using typedef instead of defining it as a macro. POSIX requires this.
9828 For consistency, YYLTYPE is also declared instead of defined.
9829
9830 %union directives can now have a tag before the `{', e.g., the
9831 directive `%union foo {...}' now generates the C code
9832 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
9833 The default union tag is `YYSTYPE', for compatibility with Solaris 9
9834 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
9835 instead of `yyltype'.
9836
9837 `yystype' and `yyltype' are now obsolescent macros instead of being
9838 typedefs or tags; they are no longer documented and will be
9839 withdrawn in a future release.
9840
9841 * data/glr.c (b4_location_type): Remove.
9842 (YYSTYPE): Renamed from yystype.
9843 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
9844 (struct YYLTYPE): Renamed from struct yyltype.
9845 (YYLTYPE): Renamed from yyltype.
9846 (yyltype, yystype): New (and obsolescent) macros,
9847 for backward compatibility.
9848 * data/yacc.c: Likewise.
9849
9850 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
9851 does not specify a union tag. This is for compatibility with
9852 Solaris 9 yacc.
9853
9854 * src/parse-gram.y (add_param): 2nd arg is now char * not char
9855 const *, since it is now modified by stripping surrounding { }.
9856 (current_braced_code): Remove.
9857 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
9858 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
9859 trailing " {...}". Now of type <chars>.
9860 (grammar_declaration): Adjust to bundled tokens.
9861 (code_content): Remove; stripping is now done by add_param.
9862 (print_token_value): Print contents of bundled tokens.
9863 (token_name): New function.
9864
9865 * src/reader.h (braced_code, current_braced_code): Remove.
9866 (token_name): New decl.
9867
9868 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
9869 token_type, not braced_code code_kind. All uses changed.
9870 (SC_PRE_CODE): New state, for scanning after a keyword that
9871 has (or usually has) an immediately-following braced code.
9872 (token_type): New local var, to keep track of which token type
9873 to return when scanning braced code.
9874 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 9875 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
9876 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
9877 instead of returning a token type immediately.
9878 (<INITIAL>"{"): Set token type.
9879 (<SC_BRACED_CODE>"}"): Use it.
9880 (handle_action_dollar, handle_action_at): Now returns bool
9881 indicating success. Fail if ! current_rule; this prevents a core dump.
9882 (handle_symbol_code_dollar, handle_symbol_code_at):
9883 Remove; merge body into caller.
9884 (handle_dollar, handle_at): Complain in invalid contexts.
9885
9886 * NEWS, doc/bison.texinfo: Document the above.
9887 * NEWS: Fix years and program names in copyright notice.
9888
879ca4f8
PE
98892002-12-17 Paul Eggert <eggert@twinsun.com>
9890
9891 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
9892 Reporting, Table of Symbols): Omit mentions of %lex-param and
9893 %parse-param from the documentation for now.
9894
1c5fe69d
PE
98952002-12-15 Paul Eggert <eggert@twinsun.com>
9896
9897 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
9898 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
9899 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
9900 disagreed with the Bison documentation. Bug
9901 reported by Andrew Walrond.
d600ee67 9902
1c5fe69d
PE
9903 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
9904 as the caller now does that.
9905 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
9906 (YYEMPTY): Parenthesize right hand side, since others use it.
9907 (yyparse): Don't assume that our generated code is the only code
9908 that sets yychar.
9909
d1de5372
PE
99102002-12-13 Paul Eggert <eggert@twinsun.com>
9911
9912 Version 1.75d.
9913
9914 POSIX requires a "yacc" command.
9915 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
9916 (MOSTLYCLEANFILES): Add yacc.
9917 (yacc): New rule.
1c5fe69d 9918 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
9919 as an alias for bison y.
9920
9921 * po/LINGUAS: Add da.
d600ee67 9922
d1de5372
PE
9923 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
9924 problem with latest <getopt.h>.
9925 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
9926
9927 * doc/fdl.texi: Upgrade to 1.2.
9928 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
9929 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
9930 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
9931 gnulib.
9932 * config/install-sh: Sync with autotools.
9933
9934 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 9935 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
9936 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
9937 locations are requested.
9938 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
9939 locations are requested.
9940
d0f3fe23
PE
99412002-12-12 Paul Eggert <eggert@twinsun.com>
9942
9943 Remove unportable casts and storage allocation tricks.
9944 While we're at it, remove almost all casts, since they
9945 usually aren't needed and are a sign of trouble.
9946
9947 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
9948
9949 * src/derives.c (derives_compute): Do not subtract NTOKENS from
9950 the pointer DSET returned by malloc; this isn't portable.
9951 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
9952 Similarly for DERIVES.
9953 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
9954 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
9955 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
9956
9957 * src/derives.c (derives_compute): Do not bother invoking
9958 int_of_rule_number, since rule numbers are integers.
9959
9960 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
9961 rather than XMALLOC (char, N).
9962
9963 * src/files.c (filename_split): Rewrite to avoid cast.
9964
9965 * src/gram.h (symbol_number_as_item_number,
9966 item_number_as_symbol_number, rule_number_as_item_number,
9967 item_number_as_rule_number):
9968 Now inline functions rather than macros, to avoid casts.
9969 * src/state.h (state_number_as_int): Likewise.
9970 * src/tables.c (state_number_to_vector_number,
9971 symbol_number_to_vector_number): Likewise.
9972
9973 * src/gram.h (int_of_rule_number): Remove; no longer used.
9974
9975 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
9976 since the resulting storage is always stored into.
9977
9978 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
9979 where it's needed.
9980
9981 * src/muscle_tab.c (muscle_m4_output):
9982 Now inline. Return bool, not int.
9983 * src/state.c (state_compare): Likewise.
9984 * src/symtab.c (symbol_check_defined,
9985 symbol_check_alias_consistency, symbol_pack, symbol_translation,
9986 hash_compare_symbol, hash_symbol):
9987 Likewise.
9988 * src/uniqstr.c (uniqstr_print): Likewise.
9989 * src/muscle_tab.c (muscle_m4_output_processor):
9990 New function, to avoid casts.
9991 * src/state.c (state_comparator, stage_hasher): Likewise.
9992 * src/symtab.c (symbol_check_defined_processor,
9993 symbol_check_alias_consistency_processor, symbol_pack_processor,
9994 symbol_translation_processor, hash_symbol_comparator,
9995 hash_symbol_hasher): Likewise.
9996 * src/uniqstr.c (uniqstr_print_processor): Likewise.
9997 * src/muscle_tab.c (muscles_m4_output):
9998 Use new functions instead of casting old functions unportably.
9999 * src/state.c (state_hash_new): Likewise.
10000 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
10001 symbols_token_translations_init):
10002 Likewise.
10003 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
10004
10005 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
10006 var instead of casting to long, to avoid casts.
10007 (prepare_states): Use MALLOC rather than alloca, so that we don't
10008 have to worry about alloca.
10009 * src/state.c (state_hash_lookup): Likewise.
10010
10011 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
10012 local var instead of casting to unsigned char, to avoid casts.
10013
10014 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
10015 STATE_ALLOC): Remove.
10016 (transitions_new, errs_new, reductions_new, state_new): Use malloc
10017 rather than calloc, and use offsetof to avoid allocating slightly
10018 too much storage.
10019 (state_new): Initialize all members.
10020
10021 * src/state.c (state_hash): Use unsigned accumulator, not signed.
10022
10023 * src/symtab.c (symbol_free): Remove; unused.
10024 (symbol_get): Remove cast in lhs of assignment.
10025 (symbols_do): Now static. Accept generic arguments, not
10026 hashing-related ones.
10027
10028 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
10029 (symbol_processor): Remove.
10030 (symbols_do): Remove decl; now static.
10031
10032 * src/system.h (alloca): Remove; decl no longer needed.
10033 (<stddef.h>): Include, for offsetof.
10034 (<inttypes.>, <stdint.h>): Include if available.
10035 (uintptr_t): New type, if system lacks it.
10036 (CALLOC, MALLOC, REALLOC): New macros.
10037 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
10038 new macros.
10039
10040 * src/tables.c (table_size): Now int, to pacify GCC.
10041 (table_grow, table_ninf_remap): Use signed table size.
10042 (save_row): Don't bother initializing locals when not needed.
10043 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
10044 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
10045
10046 * src/vcg.h: Correct misspellings.
10047
10048 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
10049
10050
10051 * src/getargs.c (getargs): Don't assume EOF == -1.
10052
26b4a969
PE
100532002-12-09 Paul Eggert <eggert@twinsun.com>
10054
10055 Change identifier spellings to avoid collisions with names
10056 that are reserved by POSIX.
10057
10058 Don't use names ending in _t, since POSIX reserves them.
10059 For consistency, remove _e and _s endings -- they're weren't
10060 needed to remove ambiguity. All uses changed.
10061 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
10062 turn was just renamed from struniq_t.
10063 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
10064 which in turn was just renamed from struniq_processor_t.
10065 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
10066 in turn was renamed from hash_compare_struniq_t.
10067 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
10068 (state_list): Renamed from state_list_t.
10069 * src/assoc.h (assoc): Renamed from assoc_t.
10070 * src/conflicts.c (enum conflict_resolution): Renamed from
10071 enum conflict_resolution_e.
10072 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
10073 (rule_list): Renamed from rule_list_t.
10074 * src/getargs.h (enum trace): Renamed from enum trace_e.
10075 (enum report): Renamed from enum report_e.
10076 * src/gram.h (item_number): Renamed from item_number_t.
10077 (rule_number): Renamed from rule_number_t.
10078 (struct rule_s): Remove the "rule_s" part; not used.
10079 (rule): Renamed from rule_t.
10080 (rule_filter): Renamed from rule_filter_t.
10081 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
10082 (goto_list): Renamed from goto_list_t.
10083 * src/lalr.h (goto_number): Renamed from goto_number_t.
10084 * src/location.h (location): Renamed from location_t.
10085 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
10086 and moved here from:
10087 * src/muscle_tab.h (muscle_entry_t): here.
10088 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
10089 (rule_list): Renamed from rule_list_t.
10090 * src/print_graph.c (static_graph): Renamed from graph.
10091 * src/reader.h (braced_code): Renamed from braced_code_t.
10092 Remove brace_code_e tag.
10093 * src/relation.h (relation_node): Renamed from relation_node_t.
10094 (relation_nodes): Renamed from relation_nodes_t.
10095 (relation): Renamed from relation_t.
10096 * src/state.h (state_number): Renamed from state_number_t.
10097 (struct state): Renamed from struct state_s.
10098 (state): Renamed from state_t.
10099 (transitions): Renamed from transitions_t. Unused (and
10100 misspelled) transtion_s tag removed.
10101 (errs): Renamed from errs_t. Unused errs_s tag removed.
10102 (reductions): Renamed from reductions_t. Unused tag
10103 reductions_s removed.
10104 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
10105 (struct symbol_list): Renamed from struct symbol_list_s.
10106 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
10107 (struct symbol): Renamed from struct symbol_s.
10108 (symbol): Renamed from symbol_t.
10109 * src/tables.c (vector_number): Renamed from vector_number_t.
10110 (action_number): Renamed from action_t.
10111 * src/tables.h (base_number): Renamed from base_t.
10112 * src/vcg.h (enum color): Renamed from enum color_e.
10113 (enum textmode): Renamed from enum textmode_e.
10114 (enum shape): Renamed from enum shape_e.
10115 (struct colorentry): Renamed from struct colorentry_s.
10116 (struct classname): Renamed from struct classname_s.
10117 (struct infoname): Renamed from struct infoname_s.
10118 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
10119 (enum decision): Renamed from enum decision_e.
10120 (enum orientation): Renamed from enum orientation_e.
10121 (enum alignment): Renamed from enum alignment_e.
10122 (enum arrow_mode): Renamed from enum arrow_mode_e.
10123 (enum crossing_type): Renamed from enum crossing_type_e.
10124 (enum view): Renamed from enum view_e.
10125 (struct node): Renamed from struct node_s.
10126 (node): Renamed from node_t.
10127 (enum linestyle): Renamed from enum linestyle_e.
10128 (enum arrowstyle): Renamed from enum arrowstyle_e.
10129 (struct edge): Renamed from struct edge.
10130 (edge): Renamed from edge_t.
10131 (struct graph): Renamed from struct graph_s.
10132 (graph): Renamed from graph_t.
10133 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
10134 Rename value_t -> value.
10135 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
10136 value_t_as_yystype -> value_as_yystype.
10137
10138 Don't include <errno.h> in the mainstream code, since it
10139 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
10140 * lib/get-errno.c, lib/get-errno.h: New files.
10141 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
10142 get-errno.c.
10143 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
10144 * src/output.c (output_skeleton): Likewise.
10145 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
10146 instead of errno.
10147 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
10148 Likewise.
10149 (handle_action_dollar, handle_action_at): Likewise.
10150 * src/system.h: Do not include <errno.h>.
10151 (TAB_EXT): Renamed from EXT_TAB.
10152 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
10153
10154 Avoid str[a-z]*, since <string.h> reserves that name space.
10155 Change all instances of "struniq" in names to "uniqstr", and
10156 likewise for "STRUNIQ" and "UNIQSTR".
10157 * src/uniqstr.c: Renamed from src/struniq.c.
10158 * src/uniqstr.h: Renamed from src/struniq.h.
10159 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
10160 * src/files.c (strsuffix): Remove; unused.
10161 (concat2): Renamed from stringappend. Now static.
10162 * src/files.h (strsuffix, stringappend): Remove; unused.
10163 * src/parse-gram.y (<chars>): Renamed from <string>.
10164 (<uniqstr>): Renamed from <struniq>.
10165 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
10166 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
10167 (struct graph_s.expand): Renamed from struct graph_s.stretch.
10168 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
10169 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
10170 (N_EXPAND): Renamed from N_STRETCH.
10171
10172 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
10173 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
10174 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
10175 Remove; unused.
10176 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
10177 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
10178 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
10179 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
10180 (BASE_MAXIMUM): Renamed from BASE_MAX.
10181 (BASE_MINIMUM): Renamed from BASE_MIN.
10182 (ACTION_MAX): Remove; unused.
10183 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
10184 Unnecessary casts removed from above defines.
10185
10186
10187 Fix misspelling in names.
10188 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
10189 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
10190 G_NODE_ALIGNEMENT.
10191
10192
10193 * lib/timevar.c (timevar_report): Renamed from time_report,
10194 for consistency with other names.
10195 * lib/timevar.h (timevar_report): New decl.
10196 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
10197
10198
10199 Sort include-file uses.
10200
10201 Reorder all include files under src to be in the order "system.h".
10202 then the ../lib include files in angle brackets (alphabetized),
10203 then the . include files in double-quotes (alphabetized). Fix
10204 dependency breakages encountered in this process, as follows:
10205 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
10206 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
10207 * src/state.h: Include "symtab.h".
10208
996b1c7e
PE
102092002-12-08 Paul Eggert <eggert@twinsun.com>
10210
10211 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
10212 since this causes problems when __file__ contains character
10213 sequences like "@" that are treated specially by src/scan-skel.l.
10214 Instead, just use the file's basename. This fixes the bug
10215 reported by Martin Mokrejs in
161a71f3 10216 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 10217
e19c4e5d
PE
102182002-12-06 Paul Eggert <eggert@twinsun.com>
10219
10220 Add support for rules that do not have trailing semicolons, as
10221 POSIX requires. Improve the quality of locations in Bison
10222 diagnostics.
26b4a969 10223
e19c4e5d
PE
10224 * src/location.c: Include <quotearg.h>.
10225 (empty_location): Now const.
10226 (location_print): New function. Follow the recommendation of the
10227 GNU Coding Standards for locations that span file boundaries.
10228 * src/location.h: Do not include <quotearg.h>; no longer needed.
10229 (boundary): New type.
10230 (location_t): Use it. This allows locations to span file boundaries.
10231 All member uses changed: file -> start.file or end.file (as needed),
10232 first_line -> start.line, first_column -> start.column,
10233 last_line -> end.line, last_column -> end.column.
10234 (equal_boundaries): New function.
10235 (LOCATION_RESET, LOCATION_STEP): Remove.
10236 (LOCATION_PRINT): Remove. All callers changed to use location_print.
10237 (empty_location): Now const.
10238 (location_print): New decl.
10239 * src/parse-gram.y (lloc_default): New function, which handles
10240 empty locations more accurately.
10241 (YYLLOC_DEFAULT): Use it.
10242 (%token COLON): Remove.
10243 (%token ID_COLON): New token.
26b4a969 10244 (rules): Use it.
e19c4e5d
PE
10245 (declarations, rules): Remove trailing semicolon.
10246 (declaration, rules_or_grammar_declaration):
10247 Allow empty (";") declaration.
10248 (symbol_def): Remove empty actions; no longer needed.
10249 (rules_or_grammar_declaration): Remove trailing semicolon.
10250 (semi_colon.opt): Remove.
10251 * src/reader.h: Include location.h.
10252 (scanner_cursor): New decl.
10253 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
10254 rolling our own.
10255 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
10256 of *loc.
10257 (STEP): Remove. No longer needed, now that adjust_location does
10258 the work. All uses removed.
10259 (scanner_cursor): New var.
10260 (adjust_location): Renamed from extend_location. It now sets
10261 *loc and adjusts the scanner cursor. All uses changed.
10262 Don't bother testing for CR.
10263 (handle_syncline): Remove location arg; now updates scanner cursor.
10264 All callers changed.
10265 (unexpected_end_of_file): Now accepts start boundary of token or
10266 comment, not location. All callers changed. Update scanner cursor,
10267 not the location.
10268 (SC_AFTER_IDENTIFIER): New state.
10269 (context_state): Renamed from c_context. All uses changed.
10270 (id_loc, code_start, token_start): New local vars.
10271 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
10272 processing of Yacc white space and equivalents here.
10273 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
10274 instead of returning ID immediately, since we need to search for
10275 a subsequent colon.
10276 (<INITIAL>"'", "\""): Save token_start.
10277 (<INITIAL>"%{", "{", "%%"): Save code_start.
10278 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
10279 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
10280 BEGIN context_state at end, not INITIAL.
10281 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
10282 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
10283 Return correct token start.
10284 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
10285 the start of a character, string or multiline comment is found.
10286 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
10287 Reduction): Adjust reported locations to match the more-precise
10288 results now expected.
10289 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
10290 * tests/reduce.at (Useless Rules, Reduced Automaton,
10291 Underivable Rules): Likewise.
10292 * tests/regression.at (Invalid inputs): No longer `expecting ";"
10293 or "|"' now that so many other tokens are allowed by the new grammar.
10294
10295 * src/complain.h (current_file): Remove duplicate decl;
10296 current_file is now owned by files.h.
10297 * src/complain.c, src/scan-gram.l: Include files.h.
10298
102992002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 10300
e19c4e5d
PE
10301 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
10302 promotes to int; it might be unsigned int.
10303 * data/yacc.c (yy_reduce_print): Likewise.
10304
10305 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
10306 be #defined in the prologue, not in the Bison declarations.
10307 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 10308
b64755e3
PE
103092002-12-02 Paul Eggert <eggert@twinsun.com>
10310
10311 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
10312 * lib/strtoul.c: New file, from gnulib.
10313 This fixes a porting bug reported by Peter Klein in
161a71f3 10314 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 10315
6e746484
PE
103162002-11-30 Paul Eggert <eggert@twinsun.com>
10317
b64755e3
PE
10318 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
10319 and put only a forward declaration in the prologue. This is for
10320 consistency with the other scanner helper functions.
10321
6ba55592
PE
10322 Type clashes now generate warnings, not errors, since it
10323 appears that POSIX may allow some grammars with type clashes.
10324 * src/reader.c (grammar_current_rule_check): Warn about
10325 type clashes instead of complaining.
10326 * tests/input.at (Type Clashes): Expect warnings, not complaints.
10327
6e746484
PE
10328 Add Yacc library, since POSIX requires it.
10329 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
10330 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
10331 * lib/main.c, lib/yyerror.c: New files.
10332
10333 gram_error can be static; it need not be extern.
10334 * src/reader.h (gram_error): Remove decl.
10335 * src/parse-gram.y (gram_error): Now static. Add static decl.
10336 (print_token_value): Omit parameter names from forward decl,
10337 for consistency.
10338
88510f9c
PE
103392002-11-29 Paul Eggert <eggert@twinsun.com>
10340
6e746484
PE
10341 * doc/bison.texinfo: Emphasize that yylex and yyerror must
10342 be declared before being used. E.g., one should typically
10343 declare them in the prologue. Use GNU coding style in examples.
10344 Put "const" consistently after the type it modifies. Mention
10345 that C99 supports "inline". Mention that yyerror traditionally
10346 returns "int".
10347
88510f9c
PE
10348 %parse-param and %lex-param now take just one argument, the
10349 declaration; the argument name is deduced from the declaration.
10350
10351 * doc/bison.texinfo (Parser Function, Pure Calling, Error
10352 Reporting, Table of Symbols): Document this.
10353 * src/parse-gram.y (add_param): New function.
10354 (COMMA): Remove.
10355 (declaration): Implement new rule for %parse-param and %lex-param.
10356 * src/scan-gram.l: "," now elicits a warning, rather than being
10357 a token; this is more compatible with byacc.
10358 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
10359
bb92250c
PE
103602002-11-27 Paul Eggert <eggert@twinsun.com>
10361
10362 Rename identifiers to avoid real and potential collisions.
10363
10364 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
10365 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 10366 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
10367 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10368 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
10369 * src/parse-gram.y (print_token_value): Renamed from yyprint.
10370 All uses changed.
10371 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
10372 The name "yycontrol" violates the name space rules, and this stuff
10373 wasn't being used anyway.
10374 (input): Remove action; this stuff wasn't being used.
10375 (gram_error): Rename local variable yylloc -> loc.
10376 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
10377 (YY_DECL): Don't use "yy" at start of local variables.
10378 All uses changed, e.g., yylloc -> loc.
10379 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
10380 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
10381 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
10382 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
10383
10384 * src/parse-gram.y (gram_error): loc is now const *.
10385 * src/reader.h (gram_error): Likewise.
10386
3af4feb2
PE
103872002-11-24 Paul Eggert <eggert@twinsun.com>
10388
10389 Version 1.75c.
10390
10391 * tests/actions.at (Actions after errors): Use an output format
10392 more similar to that of the Printers and Destructors test.
10393 Test the position of the ';' token too.
10394 (Printers and Destructors): Likewise.
10395 (Printers and Destructors: %glr-parser): Remove for now, to avoid
10396 unnecessarily alarming people when the test fails.
10397
10398 * data/yacc.c (yyerrlab1): Move this label down, so that the
10399 parser does not discard the lookahead token if the user code
10400 invokes YYERROR. This change is required for POSIX conformance.
10401
10402 * lib/error.c: Sync with gnulib.
10403
104042002-11-22 Paul Eggert <eggert@twinsun.com>
10405
10406 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
10407 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
10408 * lib/xmalloc.c: Likewise.
26b4a969 10409
58004308
PE
104102002-11-20 Paul Eggert <eggert@twinsun.com>
10411
10412 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
10413
104142002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 10415
58004308
PE
10416 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
10417 should use `if (! x) abort ();' rather than `assert (x);', and
10418 anyway it's one less thing to worry about configuring.
10419
10420 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
10421 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
10422 and replace all instances of assert with abort.
10423 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10424 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
10425
10426 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
10427 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
10428 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
10429 hash_find_entry, hash_rehash, hash_insert): Likewise.
10430 * src/conflicts.c (resolve_sr_conflict): Likewise.
10431 * src/lalr.c (set_goto_map, map_goto): Likewise.
10432 * src/nullable.c (nullable_compute): Likewise.
10433 * src/output.c (prepare_rules, token_definitions_output): Likewise.
10434 * src/reader.c (packgram, reader): Likewise.
10435 * src/state.c (state_new, state_free, state_transitions_set,
10436 state_reduction_find): Likewise.
10437 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
10438 symbol_pack): Likewise.
10439 * src/tables.c (conflict_row, pack_vector): Likewise.
10440 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10441 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10442 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
10443 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
10444
10445 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
10446 (ARGMATCH_CONSTRAINT): New macro.
10447 (ARGMATCH_ASSERT): Use it.
10448
10449 * src/system.h (verify): New macro.
10450 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
10451 rather than assert.
10452 * src/tables.c (tables_generate): Likewise.
10453
10454 * src/struniq.c (struniq_assert): Now returns void, and aborts
10455 if the assertion is false.
10456 (struniq_assert_p): Remove.
10457 * src/struniq.h: Likewise.
10458
76ae8198
PE
104592002-11-18 Paul Eggert <eggert@twinsun.com>
10460
10461 * data/glr.c (yygetLRActions): Replace `yyindex' with
10462 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
10463 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 10464 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 10465
d3c4e709
AD
104662002-11-18 Akim Demaille <akim@epita.fr>
10467
10468 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
10469 space.
10470 From Tim Van Holder.
10471
8d8a7238
PE
104722002-11-17 Paul Eggert <eggert@twinsun.com>
10473
10474 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
10475 to "SyntaxError" for consistency with my 2002-11-15 change.
10476
10477 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
10478 not define to {}, since this breaks the common use of `YYDPRINTF
10479 ((...));' if a single statement is desired (e.g. before `else').
10480 Work around GCC warnings by surrounding corresponding calls with
10481 {} if needed.
10482 (yyhasResolvedValue): Remove unused function.
10483 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
10484 loop body.
10485 (yyreportSyntaxError): Renamed from yyreportParseError.
10486 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
10487 All uses changed.
10488 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
10489 extern when possible. Remove unused initializations.
10490
b0937b22
AD
104912002-11-16 Akim Demaille <akim@epita.fr>
10492
10493 Augment the similarity between GLR and LALR traces.
10494
10495 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
10496 (YY_REDUCE_PRINT): New.
10497 (yyparse): Use them.
10498 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
10499 YYDPRINT here.
10500 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
10501 state reached after the reduction/recovery, since...
10502 (yyparse, yyprocessOneStack): Report the state we are entering in.
10503
c5e3e510
AD
105042002-11-16 Akim Demaille <akim@epita.fr>
10505
10506 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
10507 Add support for --trace=skeleton.
10508 * src/scan-skel.l: %option debug.
10509 Scan strings of non-@ or \n instead of character by character.
10510 (scan_skel): Handle trace_skeleton.
10511 (QPUTS): New.
10512 (@output_parser_name@, @output_header_name@): ``Restore'' their
10513 support (used to be M4 macros).
10514 * data/yacc.c: Quote larger chunks, a la glr.c.
10515 * data/lalr1.cc: Likewise.
10516 The header guards are no longer available, so use some other
10517 string than `YYLSP_NEEDED'.
10518
4c6cc1db
AD
105192002-11-16 Akim Demaille <akim@epita.fr>
10520
10521 Make the ``Printers and Destructors'' test more verbose, taking
10522 `yacc.c''s behavior as (possibly wrong) reference.
10523
10524 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
10525 instead of fprint on stdout.
10526 Set and report the last_line of the symbols.
10527 Consistently display values and locations.
10528
6d9e8019
PE
105292002-11-16 Paul Eggert <eggert@twinsun.com>
10530
10531 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
10532
6e649e65
PE
105332002-11-15 Paul Eggert <eggert@twinsun.com>
10534
b25d88f6
PE
10535 * tests/actions.at (Actions after errors): New test case.
10536
6e649e65
PE
10537 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
10538 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
10539 tests/action.at, tests/calc.at, tests/conflicts.at,
10540 tests/cxx-type.at, tests/regression.at:
10541 "parse error" -> "syntax error" for POSIX compatibility.
10542 "parsing stack overflow..." -> "parser stack overflow" so
10543 that code matches Bison documentation.
10544
0f39aab9
AD
105452002-11-15 Akim Demaille <akim@epita.fr>
10546
10547 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
10548 take two BRACED_CODE, not two string_content.
10549 Free the scanner's obstack when we are done.
10550 (code_content): New.
10551 * tests/calc.at: Adjust.
10552 * doc/bison.texinfo: Adjust.
10553 Also, make sure to include the `,' for these declarations.
10554
761c1926
AD
105552002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
10556
10557 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
10558 definition; avoids potential autoreconf problems.
10559
b0f98b10
AD
105602002-11-15 Akim Demaille <akim@epita.fr>
10561
10562 Always check the value returned by yyparse.
10563
10564 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
10565 returned by yyparse.
10566 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
10567 Adjust calls.
10568 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
10569 returned by yyparse.
10570
970785f1
PH
105712002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10572
10573 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
10574 on input.at test.
10575
8fcc7db1
PE
105762002-11-14 Paul Eggert <eggert@twinsun.com>
10577
7ec1b48e
PE
10578 * src/output.c (output_skeleton): Call xfopen instead of
10579 duplicating xfopen's body.
10580
cfff7583 10581 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 10582 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 10583
8fcc7db1
PE
10584 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
10585 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
10586 Group compiler. Instead, use "$CC -E bar.c". Include the .h
10587 file twice in the grammar, as an extra check.
10588
10589 * tests/input.at (Torturing the Scanner): Surround the
10590 backslash-newline tests with "#if 0", to make it less likely that
10591 we'll run into compiler bugs. Bring back solitary \ inside
10592 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 10593 test backslash-newline in C character constant.
8fcc7db1 10594
4e8d992c
AD
105952002-11-14 Akim Demaille <akim@epita.fr>
10596
10597 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
10598 status of the compiler.
f32b346d 10599 Calling `exit 1' is no longer needed.
4e8d992c
AD
10600 Reported by Nelson H. F. Beebe.
10601
9501dc6e
AD
106022002-11-14 Akim Demaille <akim@epita.fr>
10603
10604 * tests/atlocal.in (CPPFLAGS): We have config.h.
10605 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
10606 New.
10607 * tests/actions.at, tests/calc.at, tests/conflicts.at,
10608 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
10609 * tests/regression.at, tests/torture.at: Use them for all the
10610 grammars that are to be compiled.
10611 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
10612 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
10613 * doc/bison.texinfo (GLR Parsers): Document `inline'.
10614
18b519c0
AD
106152002-11-14 Akim Demaille <akim@epita.fr>
10616
10617 * doc/bison.texinfo: Various formatting changes (alignments in
10618 samples, additional @group/@end group, GCS in samples.
10619 Use @deffn instead of simple @table to define the directives,
10620 macros, variables etc.
10621
9a86cdb9
PE
106222002-11-13 Paul Eggert <eggert@twinsun.com>
10623
daa33def 10624 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 10625 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 10626
daa33def 10627 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 10628 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
10629 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
10630 * tests/headers.at (export YYLTYPE): Likewise.
10631
10632 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 10633 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 10634
9a86cdb9
PE
10635 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
10636 comments, since they're not portable. Use GNU coding style.
10637
9c1e26bd
AD
106382002-11-13 Akim Demaille <akim@epita.fr>
10639
10640 * data/yacc.c: Leave bigger chunks of quoted text.
10641 (YYDSYMPRINTF): New.
10642 Use it to report symbol activities.
10643 * data/glr.c (YYDSYMPRINTF): New.
10644 Use it.
10645
87f721cc
PE
106462002-11-12 Paul Eggert <eggert@twinsun.com>
10647
10648 Version 1.75b.
10649
10650 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
10651 (yyglrReduce): Return yyok, not 0.
10652 This should avoid the enumerated-type warnings reported
464c6927 10653 by Nelson H. F. Beebe in
161a71f3 10654 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
10655
10656 * lib/bbitset.h (BITSET_INLINE): Remove.
10657 * lib/bitset.h [! BITSET_INLINE]: Remove.
10658 (bitset_set, bitset_reset, bitset_test): Rename local vars
10659 to avoid shadowing warnings by GCC.
10660
10661 * data/glr.c (inline): Remove #define. It's the user's
10662 responsibility to #define it away, just like 'const'.
464c6927 10663 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 10664 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 10665
87f721cc
PE
10666 * Makefile.maint (po-check): Scan .l and .y files instead of the
10667 .c and the .h files that they generate. This fixes the bug
10668 reported by Tim Van Holder in:
161a71f3 10669 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
10670 Look for N_ as well as for _. Try to avoid matching #define for
10671 N_ and _.
10672 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
10673 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
10674 * src/scan-gram.l: Revamp regular expressions so that " and '
10675 do not confuse xgettext.
10676
10677 * src/struniq.h (struniq_new): Do not declare the return type
10678 to be 'const'; this violates the C standard.
10679 * src/struniq.c (struniq_new): Likewise.
10680
be14ade5
AD
106812002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
10682
10683 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
10684 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
10685 linker.
10686
05291fbc
AD
106872002-11-12 Akim Demaille <akim@epita.fr>
10688
10689 * Makefile.maint: Sync with Autoconf:
10690 (local_updates): New.
10691
1f5fd52e
AD
106922002-11-12 Akim Demaille <akim@epita.fr>
10693
10694 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
10695
283f1e64
AD
106962002-11-12 Akim Demaille <akim@epita.fr>
10697
10698 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
10699 locations.
10700
886b69d1
AD
107012002-11-12 Akim Demaille <akim@epita.fr>
10702
10703 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
10704 not yyvalue.
10705
3df37415
AD
107062002-11-12 Akim Demaille <akim@epita.fr>
10707
10708 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
10709 Use it to test the GLR parser.
10710
7bd6c77e
AD
107112002-11-12 Akim Demaille <akim@epita.fr>
10712
10713 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
10714 defines it.
10715 * data/glr.c (yystos): New.
10716 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
10717 (YYDSYMPRINT): New.
10718 (yyval): Don't define it, it is handled via M4.
10719 (yyrecoverParseError): Free verbosely the discarded symbols.
10720 * data/yacc.c (yysymprint): Remove, rather...
10721 (b4_yysymprint_generate): invoke.
10722 * data/c.m4 (b4_yysymprint_generate): New.
10723 Accept pointers as arguments, as opposed to the version from
10724 yacc.c.
10725 (b4_yydestruct_generate): Likewise.
10726 * tests/cations.at (Printers and Destructors): Use Bison directives
10727 instead of CPP macros.
10728 Don't rely on internal details.
10729
b0400cc6
AD
107302002-11-12 Akim Demaille <akim@epita.fr>
10731
10732 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
10733 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
10734 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
10735 it against YYEMPTY and so forth), work on yytoken (i.e., set
10736 it to YYEMPTY etc.).
10737 (yydestruct): Replace with a b4_yydestruct_generate invocation.
10738 (b4_symbol_actions): Remove.
10739 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
10740 for 0, end-of-input.
10741
72f889cc
AD
107422002-11-12 Akim Demaille <akim@epita.fr>
10743
10744 * doc/bison.texinfo (Destructor Decl): New.
10745
b1ae9233
AD
107462002-11-12 Akim Demaille <akim@epita.fr>
10747
10748 * src/tables.c (tables_generate): Use free for pointers that
10749 cannot be NULL, not XFREE.
10750 (pack_vector): Use assert, not fatal, for bound violations.
10751 * src/state.c (state_new): Likewise.
10752 * src/reader.c (reader): Likewise.
10753 * src/lalr.c (set_goto_map): Likewise.
72f889cc 10754 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
10755 the file name.
10756
7ec2d4cd
AD
107572002-11-12 Akim Demaille <akim@epita.fr>
10758
10759 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
10760 Restore.
10761 * src/scan-gram.l (last_string): Is global to the file, not to
10762 yylex.
10763 * src/parse-gram.y (input): Don't append the epilogue here,
10764 (epilogue.opt): do it here, and free the scanner's obstack.
10765 * src/reader.c (epilogue_set): Rename as...
10766 (epilogue_augment): this.
10767 * data/c.m4 (b4_epilogue): Defaults to empty.
10768
573a6cd3
AD
107692002-11-12 Akim Demaille <akim@epita.fr>
10770
10771 * src/getargs.c (long_options): Remove duplicates.
10772 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
10773 Remove.
10774 * doc/bison.rnh: Remove.
10775 * doc/bison.texinfo (VMS Invocation): Remove.
10776
95612cfa
AD
107772002-11-12 Akim Demaille <akim@epita.fr>
10778
10779 * src/struniq.h, src/struniq.c (struniq_t): Is const.
10780 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
10781
10782 Use struniq for symbols.
10783
10784 * src/symtab.h (symbol_t): The tag member is a struniq.
10785 (symbol_type_set): Adjust.
10786 * src/symtab.c (symbol_new): Takes a struniq.
10787 (symbol_free): Don't free the tag member.
10788 (hash_compare_symbol_t, hash_symbol_t): Rename as...
10789 (hash_compare_symbol, hash_symbol): these.
10790 Use the fact that tags as struniqs.
10791 (symbol_get): Use struniq_new.
10792 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
10793 Returns a strniq.
10794 * src/reader.h (merger_list, grammar_currentmerge_set): The name
10795 and type members are struniqs.
10796 * src/reader.c (get_merge_function)
10797 (grammar_current_rule_merge_set): Adjust.
10798 (TYPE, current_type): Are struniq.
10799
10800 Use struniq for file names.
10801
10802 * src/files.h, src/files.c (infile): Split into...
10803 (grammar_file, current_file): these.
10804 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
10805 * src/reduce.c (reduce_print): Likewise.
10806 * src/getargs.c (getargs): Likewise.
10807 * src/complain.h, src/complain.c: Likewise.
10808 * src/main.c (main): Call struniqs_new early enough to use it for
10809 file names.
10810 Don't free the input file name.
10811
3e6656f9
AD
108122002-11-12 Akim Demaille <akim@epita.fr>
10813
10814 * src/symtab.c (symbol_free): Remove dead deactivated code:
10815 type_name are properly removed.
10816 Don't use XFREE to free items that cannot be NULL.
10817 * src/struniq.h, src/struniq.c: New.
10818 * src/main.c (main): Initialize/free struniqs.
10819 * src/parse-gram.y (%union): Add astruniq member.
10820 (yyprint): Adjust.
10821 * src/scan-gram.l (<{tag}>): Return a struniq.
10822 Free the obstack bit that used to store it.
10823 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
10824
7672019c
PE
108252002-11-11 Paul Eggert <eggert@twinsun.com>
10826
10827 Revamp to fix many (but not all) of the C- and M4-related quoting
10828 problems. Among other things, this fixes the Bison bug reported
10829 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 10830 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
10831
10832 Use new @ escapes consistently. Represent brackets with @{ and @}
10833 rather than @<:@ and @:>@, since this works a bit better with dumb
10834 editors like vi. Represent @ with @@, since @ is now consistently
10835 an escape. Use @oline@ and @ofile@ rather than __oline__ and
10836 __ofile__, to avoid unexpected expansions. Similarly, use @output
10837 rather than #output.
10838
10839 * data/c.m4 (b4_copyright): Omit file name from comment, since
10840 the file name could contain "*/".
10841 (b4_synclines_flag): Don't quote the 2nd argument; it should already
10842 be quoted. All uses changed.
10843
10844 * data/glr.c: Use new @ escapes consistently.
10845 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
10846 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
10847 Remove, since they couldn't handle arbitrary characters in file
10848 names.
10849 * data/lalr1.cc: Likewise.
10850 * data/yacc.c: Likewise.
10851
10852 * src/files.c (output_infix): Remove; all uses removed.
10853 * src/files.h: Likewise.
10854
10855 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
10856 mishandled funny characters in file names, and anyway it isn't
10857 needed any more.
10858 * data/yacc.c: Likewise.
10859 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
10860
10861 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
10862 * data/yacc.c: Likewise.
10863
10864 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
10865 strings now.
10866 (muscle_init): Quote filename as a C string.
10867 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
10868 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
10869 * src/output.c (escaped_file_name_output): New function.
10870 (prepare_symbols): Quote tokens for M4.
10871 (prepare): Don't insert output_infix, output_prefix,
10872 output_parser_name, output_header_name; this is now down by scan-skel.
10873 Insert skeleton as a C string.
10874
10875 * src/output.c (user_actions_output, symbol_destructors_output,
10876 symbol_printers_output): Quote filenames for C and M4.
10877 * src/reader.c (prologue_augment, epilogue_set): Likewise.
10878
10879 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
10880 escapes other than \\ and \'; this simplifies the code.
10881 (<SC_STRING>): Likewise, for \\ and \".
10882 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
10883 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
10884 Use new escapes @{ and @} for [ and ].
10885
10886 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
10887 them with auto vars.
10888 Switch to new escape scheme, where @ is the escape character uniformly.
10889 Abort if a stray escape character is found. Avoid unbounded input
10890 buffer when parsing non-escaped text.
10891
10892 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
10893 __oline__, #output, $@, and @{ do not have unintended meanings.
10894
acea4f3b
PE
108952002-11-09 Paul Eggert <eggert@twinsun.com>
10896
10897 Fix the test failure due to GCC warnings described in
161a71f3 10898 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
10899 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
10900 evaluate to 0 if it's impossible for NINF to be in the respective
10901 table.
10902 (yygetLRActions, yyrecoverParseError): Use them.
10903
10904 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
10905 counted in the token inserted at end of file. Now takes
10906 location_t *, not location_t, so that the location can be
10907 adjusted. All uses changed.
10908
10909 * tests/regression.at (Invalid inputs): Adjust wording in
10910 diagnostic to match the new behavior.
10911
10912 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
10913 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
10914 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
10915 abort ();'. This reduces the runtime of the "Many lookaheads"
10916 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
10917 GCC 3.2.
10918
20ef1ad5
PE
109192002-11-07 Paul Eggert <eggert@twinsun.com>
10920
10921 * src/parse-gram.y (CHARACTER): Remove unused token.
10922 All uses removed.
10923
10924 * src/scan-gram.l: Remove stack option. We no longer use the
10925 stack, since the stack was never deeper than 1; instead, use the
10926 new auto var c_context to record the stacked value.
10927
10928 Remove nounput option. At an unexpected end of file, we now unput
10929 the minimal input necessary to end cleanly; this simplifies the
10930 code.
10931
10932 Avoid unbounded token sizes where this is easy.
10933
10934 (unexpected_end_of_file): New function.
10935 Use it to systematize the error message on unexpected EOF.
10936 (last-string): Now auto, not static.
10937 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
10938 (scanner_last_string_free): Remove; not used.
10939 (percent_percent_count): Move decl to just before use.
10940 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
10941 not the (never otherwised-used) CHARACTER.
10942
93724f13
AD
109432002-11-07 Akim Demaille <akim@epita.fr>
10944
10945 Let yyerror always receive the msg as last argument, so that
10946 yyerror can be variadic.
10947
10948 * data/yacc.c (b4_yyerror_args): New.
10949 Use it when calling yyerror.
10950 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
10951 Use it when calling yyerror.
10952 * doc/bison.texinfo (Error Reporting): Adjust.
10953 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
10954 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
10955
6e40b4eb
AD
109562002-11-06 Akim Demaille <akim@epita.fr>
10957
10958 #line should have quoted strings.
10959 Ideally, this should be done by m4_quotearg.
10960
10961 * src/scan-skel.l: Include quotearg.h.
10962 Quote __ofile__.
10963 * src/output.c (symbol_printers_output)
10964 (symbol_destructors_output): Quote the file name.
10965
2dfbfc12
AD
109662002-11-06 Akim Demaille <akim@epita.fr>
10967
10968 * tests/regression.at (Invalid inputs): Adjust to the recent
10969 messages.
10970
437c2d80
AD
109712002-11-06 Akim Demaille <akim@epita.fr>
10972
10973 Restore --no-lines.
10974 Reported by Jim Kent.
10975
10976 * data/c.m4 (b4_syncline): New.
10977 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
10978 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
10979 * src/output.c (user_actions_output): Likewise.
10980 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 10981 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 10982
900c5db5
AD
109832002-11-06 Akim Demaille <akim@epita.fr>
10984
10985 * src/main.c (main): Free `infile'.
10986 * src/scan-gram.l (handle_syncline): New.
10987 Recognize `#line'.
10988 * src/output.c (user_actions_output, symbol_destructors_output)
10989 (symbol_printers_output): Use the location's file name, not
10990 infile.
10991 * src/reader.c (prologue_augment, epilogue_set): Likewise.
10992
e183b123 109932002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 10994
e183b123 10995 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 10996 either has GLR conflict entries.
e183b123 10997
193eb6b7
PE
109982002-11-05 Paul Eggert <eggert@twinsun.com>
10999
e183b123
PE
11000 * src/scan-gram.l: Use more accurate diagnostics, e.g.
11001 "integer out of range" rather than "invalid value".
11002 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
11003 accordingly.
11004
193eb6b7
PE
11005 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
11006 Also, remove one static variable in the scanner.
11007
11008 * src/scan-gram.l (braces_level): Now auto, not static.
11009 Initialize to zero if the compiler is being picky.
11010 (INITIAL): Clear braces_level instead of incrementing it.
11011 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
11012 as POSIX 1003.1-2001 requires.
11013 * src/system.h (IF_LINT): New macro, taken from coreutils.
11014 * configure.ac: Define "lint" if --enable-gcc-warnings.
11015
29c01725
AD
110162002-11-05 Akim Demaille <akim@epita.fr>
11017
11018 * src/scan-gram.l: When it starts with `%', complain about the
11019 whole directive, not just that `invalid character: %'.
11020
8aeac3ca
AD
110212002-11-04 Akim Demaille <akim@epita.fr>
11022
11023 * Makefile.maint: Update from Autoconf.
11024 (update, cvs-update, po-update, do-po-update): New.
11025
793a58bb
AD
110262002-11-04 Akim Demaille <akim@epita.fr>
11027
11028 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
11029 and yyerror.
11030 Have yyerror `use' its arguments.
11031 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
11032 returns true when location & yacc & pure & parse-param.
11033 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
11034
c4d720cd
AD
110352002-11-04 Akim Demaille <akim@epita.fr>
11036
11037 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
11038 clashes.
11039 * src/scan-gram.l: Use [\'] instead of ['] to pacify
11040 font-lock-mode.
11041 Use complain_at.
11042 Use quote, not quote_n since LOCATION_PRINT no longer uses the
11043 slot 0.
11044
613a0dc5
PE
110452002-11-03 Paul Eggert <eggert@twinsun.com>
11046
11047 * src/reader.c (get_merge_function, grammar_current_rule_check):
11048 Use consistent diagnostics for reporting type name clashes.
11049 Quote the types with <>, for consistency with Yacc.
11050 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
11051
2a8d363a
AD
110522002-11-03 Akim Demaille <akim@epita.fr>
11053
11054 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
11055 New.
11056 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
11057 (b4_parse_param): Remove.
11058 Use b4_identification.
11059 Propagate b4_pure_args where needed to pass them to yyerror.
11060 * data/glr.m4 (b4_parse_param): Remove.
11061 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
11062 (b4_lpure_formals): New.
11063 Use b4_identification.
11064 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
11065 b4_user_formals and b4_user_args.
11066 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
11067 (yyreportAmbiguity): When using a pure parser, also need
11068 the location, and the parse-params.
11069 Adjust callers.
11070 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
11071 When using a pure parser, also need the parse-params.
11072 Adjust callers.
11073 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
11074 (%pure-parser + %parse-param) LALR and GLR parsers.
11075 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
11076 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
11077 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
11078 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
11079 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
11080 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
11081 * doc/bison.texinfo: Untabify the whole file.
11082 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
11083 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
11084 (Error Reporting): Adjust to these new directives.
11085 Document %error-verbose, deprecate YYERROR_VERBOSE.
11086
9e32add8
AD
110872002-11-03 Akim Demaille <akim@epita.fr>
11088
11089 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
11090 AT_CHECK_CALC_GLR invocations to use % directives, instead of
11091 command line options.
11092 * tests/cxx-type.at: Formatting changes.
11093
b02d90a5
PE
110942002-11-03 Paul Eggert <eggert@twinsun.com>
11095
11096 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
11097 to count columns correctly, and to check for invalid inputs.
9e32add8 11098
b02d90a5
PE
11099 Use mbsnwidth to count columns correctly. Account for tabs, too.
11100 Include mbswidth.h.
11101 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
11102 (extend_location): New function.
11103 (YY_LINES): Remove.
11104
11105 Handle CRLF in C code rather than in Lex code.
11106 (YY_INPUT): New macro.
11107 (no_cr_read): New function.
11108
11109 Scan UCNs, even though we don't fully handle them yet.
11110 (convert_ucn_to_byte): New function.
11111
11112 Handle backslash-newline correctly in C code.
11113 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
11114 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
11115 all uses changed.
11116 (tag, splice): New EREs. Do not allow NUL or newline in tags.
11117 Use {splice} wherever C allows backslash-newline.
11118 YY_STEP after space, newline, vertical-tab.
11119 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 11120
b02d90a5
PE
11121 (letter, id): Don't assume ASCII; e.g., spell out a-z.
11122
11123 ({int}, handle_action_dollar, handle_action_at): Check for integer
11124 overflow.
9e32add8 11125
b02d90a5
PE
11126 (YY_STEP): Omit trailing semicolon, so that it's more like C.
11127
11128 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
11129 as well as \000. Check for UCHAR_MAX, not 255.
11130 Allow \x with an arbitrary positive number of digits, as in C.
11131 Check for overflow here.
11132 Allow \? and UCNs, for compatibility with C.
11133
11134 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
11135 with quote slot used by complain_at.
11136
11137 * tests/input.at: Add tests for backslash-newline, m4 quotes
11138 in symbols, long literals, and funny escapes in strings.
11139
11140 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
11141 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
11142 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
11143 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
11144 * m4/mbswidth.m4: New file, from GNU coreutils.
11145
11146 * doc/bison.texinfo (Grammar Outline): Document // comments.
11147 (Symbols): Document that trigraphs have no special meaning in Bison,
11148 nor is backslash-newline allowed.
11149 (Actions): Document that trigraphs have no special meaning.
11150
11151 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
11152 no longer used.
11153
111542002-11-02 Paul Eggert <eggert@twinsun.com>
11155
11156 * src/reader.c: Don't include quote.h; not needed.
11157 (get_merge_function): Reword warning to be consistent with
11158 type clash diagnostic in grammar_current_rule_check.
11159
11160 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
11161 bug in trigraph handling.
11162
11163 * src/output.c (prepare_symbols): When printing token names,
11164 escape "[" as "@<:@" and likewise for "]".
11165
11166 * src/system.h (errno): Remove declaration, as we are now
11167 assuming C89 or better, and C89 guarantees errno.
11168
762b212b
PE
111692002-10-30 Paul Eggert <eggert@twinsun.com>
11170
11171 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
11172 Check for close failures.
11173 * src/files.h (xfclose): Return void, not int, since it always
11174 returned zero.
11175 * src/files.c (xfclose): Likewise. Report I/O error if ferror
11176 indicates one.
11177 * src/output.c (output_skeleton): Use xfclose rather than fclose
11178 and ferror. xfclose now checks ferror.
11179
11180 * data/glr.c (YYLEFTMOST_STATE): Remove.
11181 (yyreportTree): Use a stack-based leftmost state. This avoids
11182 our continuing battles with bogus warnings about initializers.
11183
56100c60
AD
111842002-10-30 Akim Demaille <akim@epita.fr>
11185
11186 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
11187 #if.
11188
51b4a04c
PH
111892002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11190
11191 * tests/glr-regr1.at: New test for reported regressions.
11192 * tests/testsuite.at: Add glr-regr1.at test.
11193 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 11194
bf1ebda2
PE
111952002-10-24 Paul Eggert <eggert@twinsun.com>
11196
5c16c6b1
PE
11197 Version 1.75a.
11198
bf1ebda2
PE
11199 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
11200 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
11201 we use malloc. Don't assume 'A' through 'Z' are contiguous.
11202 Don't assume strdup exists; POSIX says its an XSI extension.
11203 Check for buffer overflow on input.
11204
b526ee61
AD
112052002-10-24 Akim Demaille <akim@epita.fr>
11206
11207 * src/output.c (output_skeleton): Don't disable M4sugar comments
11208 too soon: it results in comments being expanded.
11209 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
11210 first output.
11211
f1886bb2
AD
112122002-10-24 Akim Demaille <akim@epita.fr>
11213
11214 * data/yacc.c (m4_int_type): New.
11215 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
11216 char' as only yacc.c wants K&R portability.
11217 * data/glr.c (yysigned_char): Remove.
11218 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
11219 Reported by Quoc Peyrot.
11220
c5576256
PE
112212002-10-23 Paul Eggert <eggert@twinsun.com>
11222
11223 * src/main.c (main): With --trace=time, report times even if a
11224 non-fatal error occurs. Formerly, the times were reported in some
11225 such cases but not in others.
11226 * src/reader.c (reader): Just return if a complaint has been issued,
11227 instead of exiting, so that 'main' can report times.
11228
27b0ffea
AD
112292002-10-22 Akim Demaille <akim@epita.fr>
11230
11231 * src/system.h: Include sys/types.
11232 Reported by Bert Deknuydt.
11233
223a7883
PE
112342002-10-23 Paul Eggert <eggert@twinsun.com>
11235
11236 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
11237 Suggested by Art Haas.
11238
112392002-10-22 Paul Eggert <eggert@twinsun.com>
11240
11241 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
11242 decl; not needed any more.
11243 * src/main.c (main): Use return to exit, undoing yesterday's change.
11244 The last OS that we could find where this wouldn't work is
11245 SunOS 3.5, and that's too old to worry about now.
11246
11247 * data/glr.c (struct yyltype): Define members even when not
11248 doing locations. This is more consistent with yacc.c, and it
11249 works around the following bug reports:
161a71f3
PE
11250 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
11251 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 11252
223a7883
PE
11253 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
11254 @acronym consistently. Standardize on "Yacc" instead of "YACC",
11255 "Algol" instead of "ALGOL". Give a bit more history about BNF.
11256
8b76775a
AD
112572002-10-22 Akim Demaille <akim@epita.fr>
11258
11259 * data/README: New.
11260
6db10d14
PE
112612002-10-21 Paul Eggert <eggert@twinsun.com>
11262
11263 Be consistent about 'bool'; the old code used an enum in one
11264 module and an int in another, and this violates the C standard.
11265 * m4/stdbool.m4: New file, from coreutils 4.5.3.
11266 * configure.ac (AC_HEADER_STDBOOL): Add.
11267 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
11268 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
11269 * src/symtab.c (hash_compare_symbol_t): Likewise.
11270 * src/system.h (bool, false, true): Use a definition consistent
11271 with ../lib/hash.c. All uses changed.
11272
11273 * src/complain.c (warning_issued): Renamed from warn_message_count,
11274 so that we needn't worry about integer overflow (!).
11275 Now of type bool. All uses changed.
11276 (complaint_issued): Renamed from complain_message_count; likewise.
11277
11278 * src/main.c (main): Use exit to exit with failure.
27b0ffea 11279
6db10d14
PE
11280 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
11281 rather than 1 and 0.
11282 * src/main.c (main): Likewise.
11283 * src/getargs.c (getargs): Likewise.
11284 * src/reader.c (reader): Likewise.
11285
11286 * src/getarg.c (getargs): Remove duplicate code for
11287 "Try `bison --help'".
11288
11289 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
11290 What was that "2" for?
11291
11292 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
11293 * src/getargs.c (usage): Likewise.
11294
11295 * src/getargs.c (getargs): When there are too few operands, report
11296 the last one. When there are too many, report the first extra
11297 one. This is how diffutils does it.
11298
92a060fd
PE
112992002-10-20 Paul Eggert <eggert@twinsun.com>
11300
11301 Remove K&R vestiges.
11302 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
11303 * src/complain.c (VA_START): Remove. Assume prototypes.
11304 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
11305 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
11306 fatal): Assume prototypes.
11307 * src/complain.h: Assume prototypes.
11308 * src/system.h (PARAMS): Remove.
11309 Include <limits.h> unconditionally, since it's guaranteeed even
11310 for a freestanding C89 compiler.
11311 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
11312 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 11313
e7cb57c0
AD
113142002-10-20 Akim Demaille <akim@epita.fr>
11315
11316 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
11317 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
11318 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
11319 (yyresolveStates, yyresolveAction, yyresolveStack)
11320 (yyprocessOneStack): Use them.
11321 (yy_reduce_print): New.
11322 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
11323
0245f82d
AD
113242002-10-20 Akim Demaille <akim@epita.fr>
11325
11326 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
11327 arguments and output `void'.
11328 (b4_c_function): Rename as...
11329 (b4_c_function_def): this.
11330 (b4_c_function_decl, b4_c_ansi_function_def)
11331 (b4_c_ansi_function_decl): New.
11332 Change the interpretation of the arguments: before `int, foo', now
11333 `int foo, foo'.
11334 * data/yacc.c (yyparse): Prototype and define thanks to these.
11335 Adjust b4_c_function_def uses.
11336 * data/glr.c (yyparse): Likewise, but ANSI only.
11337
39912f52
AD
113382002-10-20 Akim Demaille <akim@epita.fr>
11339
11340 * src/output.c (prepare): Move the definition of `tokens_number',
11341 `nterms_number', `undef_token_number', `user_token_number_max'
11342 to...
11343 (prepare_tokens): Here.
11344 (prepare_tokens): Rename as...
11345 (prepare_symbols): this.
11346 (prepare): Move the definition of `rules_number' to...
11347 (prepare_rules): here.
11348 (prepare): Move the definition of `last', `final_state_number',
11349 `states_number' to...
11350 (prepare_states): here.
11351 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
11352
20c1e2ad
AD
113532002-10-20 Akim Demaille <akim@epita.fr>
11354
11355 * src/tables.h, src/tables.c, src/output.c: Comment changes.
11356
21964f43
AD
113572002-10-20 Akim Demaille <akim@epita.fr>
11358
11359 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
11360 * data/c.m4: here.
11361
66d30cd4
AD
113622002-10-20 Akim Demaille <akim@epita.fr>
11363
11364 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
11365 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
11366 `pair'.
11367 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
11368 `name' to...
11369 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
11370 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
11371 These.
11372
95f2c9fe
PE
113732002-10-19 Paul Eggert <eggert@twinsun.com>
11374
11375 Do not create a temporary file, as that involves security and
11376 cleanup headaches. Instead, use a pair of pipes.
11377 Derived from a suggestion by Florian Krohm.
11378 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
11379 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
11380 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
11381 (BISON_PREREQ_SUBPIPE): Add.
11382 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
11383 Add subpipe.h, subpipe.c.
11384 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
11385 * po/POTFILES.in: Add lib/subpipe.c.
11386 * src/output.c: Include "subpipe.h".
11387 (m4_invoke): Remove decl.
11388 (scan_skel): New decl.
11389 (output_skeleton): Use pipe rather than temporary file for m4 input.
11390 Check that m4sugar.m4 is readable, to avoid deadlock.
11391 Check for pipe I/O error.
11392 * src/scan-skel.l (readpipe): Remove decl.
11393 (scan_skel): New function, to be used in place of m4_invoke.
11394 Read from stream rather than file.
66d30cd4 11395
95f2c9fe
PE
11396 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
11397 float, as this generates a warning on Solaris 8 + GCC 3.2 with
11398 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
11399 this generates a more-accurate value anyway.
11400
11401 * lib/timevar.c (timervar_accumulate): Rename locals to
11402 avoid confusion with similarly-named more-global.
11403 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
11404
11405 * src/output.c (prepare): Use xstrdup to convert char const *
11406 to char *, to avoid GCC warning.
11407
c19988b7
AD
114082002-10-19 Akim Demaille <akim@epita.fr>
11409
11410 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
11411 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
11412 Use them to have `calc.y' ready for %pure-parser.
11413 * data/yacc.c (YYLEX): Pass a yylex return type to
11414 b4_c_function_call.
11415
ae7453f2
AD
114162002-10-19 Akim Demaille <akim@epita.fr>
11417
11418 Prototype support of %lex-param and %parse-param.
11419
11420 * src/parse-gram.y: Add the definition of the %lex-param and
11421 %parse-param tokens, plus their rules.
11422 Drop the `_' version of %glr-parser.
11423 Add the "," token.
11424 * src/scan-gram.l (INITIAL): Scan them.
11425 * src/muscle_tab.c: Comment changes.
11426 (muscle_insert, muscle_find): Rename `pair' as `probe'.
11427 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
11428 (muscle_entry_s): The `value' member is no longer const.
11429 Adjust all dependencies.
11430 * src/muscle_tab.c (muscle_init): Adjust: use
11431 MUSCLE_INSERT_STRING.
11432 Initialize the obstack earlier.
11433 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
11434 (muscle_pair_list_grow): New.
11435 * data/c.m4 (b4_c_function_call, b4_c_args): New.
11436 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
11437 * tests/calc.at: Use %locations, not --locations.
11438 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
11439
0e575721
AD
114402002-10-19 Akim Demaille <akim@epita.fr>
11441
11442 * src/getargs.c (usage): Take status as argument and exit
11443 accordingly.
11444 Report the traditional `Try ... --help' message when status != 0.
11445 (usage, version): Don't take a FILE * as arg, it is pointless.
11446 (getargs): When there is an incorrect number of arguments, make it
11447 an error, and report it GNUlically thanks to `usage ()'.
11448
724ce7f5
PE
114492002-10-18 Paul Eggert <eggert@twinsun.com>
11450
3a781eb2
PE
11451 * data/glr.c (yyreportParseError): Don't assume that sprintf
11452 yields the length of the printed string, as this is not true
11453 on SunOS 4.1.4. Reported by Peter Klein.
11454
724ce7f5
PE
11455 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
11456 * tests/conflicts.at (%nonassoc and eof): Likewise.
11457 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
11458
473d0a75
AD
114592002-10-17 Akim Demaille <akim@epita.fr>
11460
11461 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
11462 * src/getargs.c (trace_types, trace_args): Adjust.
11463 * src/reader.c (grammar_current_rule_prec_set)
11464 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
11465 Standardize error messages.
11466 And s/@prec/%prec/!
11467 (reader): Use trace_flag to enable scanner/parser debugging,
11468 instead of an adhoc scheme.
11469 * src/scan-gram.l: Remove trailing debugging code.
11470
e76d2469
PE
114712002-10-16 Paul Eggert <eggert@twinsun.com>
11472
93e2236a
PE
11473 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
11474 MUSCLE_TAB_H.
11475
e76d2469
PE
11476 * NEWS: Officially drop support for building Bison with K&R C,
11477 since it didn't work anyway and it's not worth worrying about.
11478 * Makefile.maint (wget_files): Remove ansi2knr.c.
11479 (ansi2knr.c-url_prefix): Remove.
11480 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
11481 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11482 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11483
5bd1c419
PE
114842002-10-15 Paul Eggert <eggert@twinsun.com>
11485
11486 Stop using the "enum_" trick for K&R-style function definitions;
11487 it confused me, and I was the author! Instead, assume that people
11488 who want to use K&R C compilers (when using these modules in GCC,
11489 perhaps?) will run ansi2knr.
11490
11491 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
11492 All uses of "enum_" changed to "enum ".
11493 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11494 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 11495
5bd1c419
PE
11496 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
11497 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
11498 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
11499 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
11500 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
11501 abitset_not, abitset_ones, abitset_or, abitset_or_and,
11502 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
11503 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
11504 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
11505 Use function prototypes; this removes the need for declaring
11506 static functions simply to provide their prototypes.
11507 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
11508 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
11509 bitset_count_, bitset_create, bitset_dump, bitset_first,
11510 bitset_free, bitset_init, bitset_last, bitset_next,
11511 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
11512 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
11513 bitset_print, bitset_release_memory, bitset_toggle_,
11514 bitset_type_choose, bitset_type_get, bitset_type_name_get,
11515 debug_bitset): Likewise.
11516 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
11517 * lib/bitset_stats.c (bitset_log_histogram_print,
11518 bitset_percent_histogram_print, bitset_stats_and,
11519 bitset_stats_and_cmp, bitset_stats_and_or,
11520 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
11521 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
11522 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
11523 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
11524 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
11525 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
11526 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
11527 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
11528 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
11529 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
11530 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
11531 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
11532 bitset_stats_zero): Likewise.
11533 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11534 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11535 bitsetv_dump, debug_bitsetv): Likewise.
11536 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
11537 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
11538 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
11539 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
11540 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
11541 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
11542 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
11543 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
11544 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
11545 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
11546 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
11547 Likewise.
11548 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
11549 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
11550 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
11551 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
11552 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
11553 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
11554 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
11555 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
11556 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
11557 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
11558 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 11559
ae26e1f0
AD
115602002-10-14 Akim Demaille <akim@epita.fr>
11561
11562 Version 1.75.
11563
d43baf71
AD
115642002-10-14 Akim Demaille <akim@epita.fr>
11565
11566 * tests/Makefile.am (maintainer-check-posix): New.
11567
7ebc83e3
AD
115682002-10-14 Akim Demaille <akim@epita.fr>
11569
11570 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
11571 member.
11572
05846dae
AD
115732002-10-14 Akim Demaille <akim@epita.fr>
11574
11575 * src/tables.c (table_ninf_remap): base -> tab.
11576 Reported by Matt Rosing.
11577
1318e37d
PE
115782002-10-14 Paul Eggert <eggert@twinsun.com>
11579
447fbb17
PE
11580 * tests/action.at, tests/calc.at, tests/conflicts.at,
11581 tests/cxx-type.at, tests/headers.at, tests/input.at,
11582 tests/regression.at, tests/synclines.at, tests/torture.at:
11583 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
11584 so that the tests still work even if POSIXLY_CORRECT is set.
11585 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 11586
1318e37d
PE
11587 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
11588 for portability to K&R hosts. Fix typo: signed char is guaranteed
11589 only to 127, not to 128.
11590 * data/glr.c (yysigned_char): New type.
11591 * data/yacc.c (yysigned_char): Likewise.
11592 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
11593
cc0f0794
PE
115942002-10-13 Paul Eggert <eggert@twinsun.com>
11595
5038f418
PE
11596 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
11597 true due to limited range of data type" warning from GCC.
11598
cc0f0794
PE
11599 * data/c.m4 (b4_token_defines): Protect against double-inclusion
11600 by wrapping enum yytokentype's definition inside #ifndef
11601 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
11602
6fed0802
AD
116032002-10-13 Akim Demaille <akim@epita.fr>
11604
11605 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
11606 Un yy- yyrhs to avoid the name clash with the global YYRHS.
11607
32f0598d
AD
116082002-10-13 Akim Demaille <akim@epita.fr>
11609
11610 * Makefile.maint: Update from Autoconf 2.54.
11611 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
11612
7ea9a33f
AD
116132002-10-13 Akim Demaille <akim@epita.fr>
11614
11615 * src/print.c (print_state): Separate the list of solved conflicts
11616 from the other items.
11617 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
11618
ea99527d
AD
116192002-10-13 Akim Demaille <akim@epita.fr>
11620
11621 Let nondeterministic skeletons be usable with deterministic
11622 tables.
11623
11624 With the patch, GAWK compiled by GCC without -O2 passes its test
11625 suite using a GLR parser driven by LALR tables. It fails with -O2
11626 because `struct stat' gives two different answers on my machine:
11627 88 (definition of an auto var) and later 96 (memset on this var).
11628 Hence the stack is badly corrumpted. The headers inclusion is to
11629 blame: if I move the awk.h inclusion before GLR's system header
11630 inclusion, the two struct stat have the same size.
11631
11632 * src/tables.c (pack_table): Always create conflict_table.
11633 (token_actions): Always create conflict_list.
11634 * data/glr.c (YYFLAG): Remove, unused.
11635
f377f69f
AD
116362002-10-13 Akim Demaille <akim@epita.fr>
11637
11638 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
11639 (O0FLAGS): New.
11640 (VALGRIND, GXX): New.
11641 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
11642 * tests/bison.in: Run $PREBISON a pre-command.
11643 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
11644 (maintainer-check-g++): New.
11645 * Makefile.am (maintainer-check): New.
11646
2a1fe6ed
AD
116472002-10-13 Akim Demaille <akim@epita.fr>
11648
11649 * data/glr.c: Formatting changes.
11650 Tweak some trace messages to match yacc.c's.
11651
f50adbbd
AD
116522002-10-13 Akim Demaille <akim@epita.fr>
11653
11654 GLR parsers sometimes raise parse errors instead of performing the
11655 default reduction.
11656 Reported by Charles-Henry de Boysson.
11657
11658 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 11659 check the length of the traces when %glr.
f50adbbd
AD
11660 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
11661 GLR's traces.
11662 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
11663 Test GLR parsers.
11664 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
11665 (yyltype): Remove the yy prefix from the member names.
11666 (yytable): Complete its comment.
11667 (yygetLRActions): Map error action number from YYTABLE from
11668 YYTABLE_NINF to 0.
11669 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
11670 (which was a bug: it should have been YYTABEL_NINF, and yet it was
11671 not satisfying as we could compare an YYACTION computed from
11672 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
11673 only value for error actions.
11674 (yyreportParseError): In verbose parse error messages, don't issue
11675 `error' in the list of expected tokens.
11676 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
11677 next action to perform to match glr.c's decoding.
11678 (yytable): Complete its comment.
11679
bcbad5b9
PE
116802002-10-13 Paul Eggert <eggert@twinsun.com>
11681
11682 Fix problem reported by Henrik Grubbstroem in
161a71f3 11683 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
11684 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
11685 because the Bison parser reads the second action before reducing
11686 the first one.
11687 * src/scan-gram.l (rule_length): New static var.
11688 Use it to keep track of the rule length in the scanner, since
11689 we can't expect the parser to be in lock-step sync with the scanner.
11690 (handle_action_dollar, handle_action_at): Use this var.
11691 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 11692
14904b89
PE
116932002-10-12 Paul Eggert <eggert@twinsun.com>
11694
1fe611e5
PE
11695 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
11696 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
11697 Include <sys/time.h> when checking for clock_t and struct tms.
11698 Use same include order as source.
11699 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 11700 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 11701
1fe611e5
PE
11702 * lib/timevar.c: Update copyright date and clarify comments.
11703 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 11704
1fe611e5
PE
11705 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
11706 GCC version as of today, then merge Bison's changes.
11707 Change "GCC" to "Bison" in copyright notice. timevar.def's
11708 author is Akim, so change that too.
11709
98194095
PE
11710 * src/reader.c (grammar_current_rule_check):
11711 Don't worry about the default action if $$ is untyped.
11712 Prevents bogus warnings reported by Jim Gifford in
161a71f3 11713 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 11714
14904b89
PE
11715 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
11716 * data/glr.c, data/lalr1.cc, data/yacc.c:
11717 Output token definitions before the first part of user declarations.
11718 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 11719 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 11720
ff6dca18
PE
117212002-10-11 Paul Eggert <eggert@twinsun.com>
11722
11723 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
11724 (yyparse): here. This undoes some of the 2002-07-25 change.
11725 Compatibility problem reported by Ralf S. Engelschall with
11726 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
11727
eb714592
AD
117282002-10-11 Akim Demaille <akim@epita.fr>
11729
11730 * tests/regression.at Characters Escapes): New.
11731 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
11732 characters.
11733 Reported by Jan Nieuwenhuizen.
11734
b7195100
AD
117352002-10-11 Akim Demaille <akim@epita.fr>
11736
11737 * po/id.po: New.
11738
f28a0f2d
PE
117392002-10-10 Paul Eggert <eggert@twinsun.com>
11740
11741 Portability fixes for bitsets; this also avoids several GCC
11742 warnings.
11743
11744 * lib/abitset.c: Include <stddef.h>, for offsetof.
11745 * lib/lbitset.c: Likewise.
11746
11747 * lib/abitset.c (abitset_bytes): Return a size that is aligned
11748 properly for vectors of objects. Do not assume that adding a
11749 header size to a multiple of a word size yields a value that is
11750 properly aligned for the whole union.
11751 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11752
11753 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
11754 unique names for structures.
11755 * lib/ebitset.c (ebitset_bytes): Likewise.
11756 * lib/lbitset.c (lbitset_bytes): Likewise.
11757
11758 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
11759 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
11760 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
11761 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
11762 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
11763 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
11764 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
11765 to improve the type-checking that GCC can do.
11766 * lib/bitset.c (bitset_op4_cmp): Likewise.
11767 * lib/bitset_stats.c (bitset_stats_count,
11768 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
11769 bitset_stats_copy, bitset_stats_disjoint_p,
11770 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
11771 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
11772 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
11773 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
11774 bitset_stats_and_or_cmp, bitset_stats_andn_or,
11775 bitset_stats_andn_or_cmp, bitset_stats_or_and,
11776 bitset_stats_or_and_cmp): Likewise.
11777 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
11778 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
11779 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
11780 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
11781
11782 * lib/abitset.h: Include bitset.h, not bbitset.h.
11783 * lib/ebitset.h: Likewise.
11784 * lib/lbitset.h: Likewise.
11785
11786 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
11787 All instances of parameters of type enum bitset_opts are now of
11788 type enum_bitset_opts, to conform to the C Standard, and similarly
11789 for enum_bitset_type.
11790 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11791 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11792
11793 Do not use "struct bitset_struct" to mean different things in
11794 different modules. Not only is this confusing, it violates
11795 the C Standard, which requires that structure types in different
11796 modules must be compatible if one is to be passed to the other.
11797 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
11798 All instances of "struct bitset_struct *" replaced with "bitset".
11799 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
11800 (union bitset_union, struct abitset_struct, struct ebitset_struct,
11801 struct lbitset_struct, struct bitset_stats_struct): New types.
11802 All uses of struct bitset_struct changed to union bitset_union,
11803 etc.
ba0fe3c7 11804 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
11805 struct bitset_struct): Remove.
11806 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
11807 struct bitset_struct): Remove.
11808 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
11809 bitset_struct): Remove.
11810 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
11811 Likewise.
11812
11813 Do not call a function of type T using a call that assumes the
11814 function is of a different type U. Standard C requires that a
11815 function must be called with a type that is compatible with its
11816 definition.
11817 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11818 New decls.
11819 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11820 New functions.
11821 * lib/ebitset.c (PFV): Remove.
11822 * lib/lbitset.c (PFV): Likewise.
11823 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
11824 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
11825 decls.
11826 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
11827 (ebitset_vtable): Use them.
11828 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
11829 lbitset_xor): New functions.
11830 (lbitset_vtable): Use them.
11831
11832 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
11833 Declare.
11834
11835 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
11836 GCC warning.
11837 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
11838 Use offsetof, for simplicity.
11839
6fbe4984
PE
118402002-10-06 Paul Eggert <eggert@twinsun.com>
11841
11842 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
11843 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 11844 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
11845 which was inadvertently undone by the 2002-09-30 patch.
11846 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
11847 the same width as int.
11848
420f93c8
PE
118492002-10-04 Paul Eggert <eggert@twinsun.com>
11850
11851 Version 1.50.
11852
11853 * configure.ac (AC_INIT), NEWS: Increment version number.
11854
11855 * doc/bison.texinfo: Minor spelling, grammar, and white space
11856 fixes.
11857 (Symbols): Mention that any negative value returned from yylex
11858 signifies end-of-input. Warn about negative chars. Mention
11859 the portable Standard C character set.
11860
11861 The GNU coding standard says CFLAGS and YFLAGS are reserved
11862 for the installer to set.
11863 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
11864 * src/Makefile.am (AM_CFLAGS): Likewise.
11865 (AM_YFLAGS): Renamed from YFLAGS.
11866
11867 Fix some MAX and MIN problems.
11868 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
11869 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
11870 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
11871 * src/reader.c (reader): Use it.
11872
11873 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
11874 POSIX 1003.1-2001 has removed fgrep.
11875
118762002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
11877
11878 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
11879 interpreted as signed.
11880 * lib/ebitset.c (ebitset_list): Fix bug.
11881
ff68026d
PE
118822002-10-01 Paul Eggert <eggert@twinsun.com>
11883
11884 More fixes for 64-bit hosts and large bitsets.
11885
11886 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
11887 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
11888 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
11889 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
11890 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
11891 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
11892 bitset_count_): Likewise.
11893 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
11894 bitset_first, bitset_last): Likewise.
11895 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
11896 bitset_stats_list_reverse, bitset_stats_size,
11897 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
11898 Likewise.
11899 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11900 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11901 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11902 bitsetv_reflexive_transitive_closure): Likewise.
11903 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
11904 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
11905 Likewise.
11906 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
11907 Likewise.
420f93c8 11908
ff68026d
PE
11909 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
11910 Use size_t, not unsigned int, to count bytes.
11911 * lib/abitset.h (abitset_bytes): Likewise.
11912 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
11913 Likewise.
11914 * lib/bitset.h (bitset_bytes): Likewise.
11915 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
11916 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
11917 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11918 * lib/ebitset.c (ebitset_bytes): Likewise.
11919 * lib/ebitset.h (ebitset_bytes): Likewise.
11920 * lib/lbitset.c (lbitset_bytes): Likewise.
11921 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 11922
ff68026d
PE
11923 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
11924 abitset_subset_p, abitset_disjoint_p, abitset_and,
11925 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
11926 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
11927 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
11928 abitset_or_and, abitset_or_and_cmp):
11929 Use bitset_windex instead of unsigned int.
11930 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
11931 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
11932 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
11933 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
11934 Likewise.
11935 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 11936
ff68026d
PE
11937 * lib/bitset.c (bitset_print):
11938 Use proper printf formats for widths of integer types.
11939 * lib/bitset_stats.c (bitset_percent_histogram_print,
11940 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
11941 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11942 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
11943 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 11944
ff68026d
PE
11945 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
11946 BITSET_SIZE_MAX): New macros.
11947 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
11948 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
11949 to BITSET_WINDEX_MAX.
11950
11951 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
11952 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
11953 since we now return the bitset_bindex type (not int).
11954
11955 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
11956 when computing sizes.
11957 * lib/ebitset.c (ebitset_elts_grow): Likewise.
11958
11959 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
11960 and avoid cast to unsigned.
11961
6aa452a6
AD
119622002-09-30 Akim Demaille <akim@epita.fr>
11963
11964 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11965 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
11966 Updates from Michael Hayes.
11967
927f7817
AD
119682002-09-30 Art Haas <ahaas@neosoft.com>
11969
11970 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
11971 invocations.
11972 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
11973 defined.
11974
9738f41e
AD
119752002-09-27 Akim Demaille <akim@epita.fr>
11976
11977 Version 1.49c.
11978
a5c75d7f
AD
119792002-09-27 Akim Demaille <akim@epita.fr>
11980
11981 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
11982 (Because of AC_LIBSOURCE).
11983
8280e179
AD
119842002-09-27 Akim Demaille <akim@epita.fr>
11985
11986 Playing with Autoscan.
11987
11988 * configure.ac: Remove the old LIBOBJ tweaks.
11989 (AC_REPLACE_FUNCS): Add strrchr and strtol.
11990 * lib/strrchr.c: New.
11991 * lib/strtol.c: New, from the Coreutils 4.5.1.
11992
ae64af35
AD
119932002-09-27 Akim Demaille <akim@epita.fr>
11994
11995 Playing with Autoscan.
11996
11997 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
11998 * lib/Makefile.am (libbison_a_SOURCES): No longer include
11999 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
12000 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
12001 Coreutils 4.5.1.
12002
d1a1114f
AD
120032002-09-24 Akim Demaille <akim@epita.fr>
12004
12005 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
12006 (Frequently Asked Questions, Parser Stack Overflow): New.
12007
b906441c
AD
120082002-09-13 Akim Demaille <akim@epita.fr>
12009
12010 Playing with autoscan.
12011
12012 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
12013 * src/files.c (skeleton_find): Remove, unused.
12014 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
12015 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
12016
bd701811
AD
120172002-09-13 Akim Demaille <akim@epita.fr>
12018
12019 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
12020 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
12021
e0a13e7b
AD
120222002-09-13 Akim Demaille <akim@epita.fr>
12023
12024 * configure.ac: Require 2.54.
12025 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
12026 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
12027 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
12028 Remove, provided by Autoconf macros.
12029
c97011bf
AD
120302002-09-12 Akim Demaille <akim@epita.fr>
12031
12032 * m4/prereq.m4: Update, from Coreutils 4.5.1.
12033
d862b1be
AD
120342002-09-12 Akim Demaille <akim@epita.fr>
12035
12036 * m4/prereq.m4: Update, from Fileutils 4.1.5.
12037 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
12038 Reported by Martin Mokrejs.
12039
3d38c03a
AD
120402002-09-10 Akim Demaille <akim@epita.fr>
12041
12042 * src/parse-gram.y: Associate a human readable string to each
12043 token type.
12044 * tests/regression.at (Invalid inputs): Adjust.
12045
b6347355
AD
120462002-09-10 Gary V. Vaughan <gary@gnu.org>
12047
12048 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
12049 with an Autoconf-2.5x style configure.ac.
12050
09ba4ab2
PE
120512002-09-06 Paul Eggert <eggert@twinsun.com>
12052
12053 * doc/bison.texinfo (Conditions): Make explicit that the GPL
12054 exception applies only to yacc.c. This is a modification of a
12055 patch originally suggested by Akim Demaille.
12056
21846f69
AD
120572002-09-06 Akim Demaille <akim@epita.fr>
12058
09ba4ab2
PE
12059 * data/c.m4 (b4_copyright): Move the GPL exception comment from
12060 here to...
12061 * data/yacc.c: here.
12062
21846f69
AD
12063 * data/lalr1.cc (struct yyltype): Don't define it, since we use
12064 LocationType.
12065 (b4_ltype): Default to yy::Location from location.hh.
12066
c0ad8bf3
AD
120672002-09-04 Jim Meyering <jim@meyering.net>
12068
12069 * data/yacc.c: Guard the declaration of yytoknum also with
12070 `#ifdef YYPRINT', so it is declared only when used.
12071
3a93251e
AD
120722002-09-04 Akim Demaille <akim@epita.fr>
12073
12074 * configure.in: Rename as...
12075 * configure.ac: this.
12076 Bump to 1.49c.
12077
427c0dda
AD
120782002-09-04 Akim Demaille <akim@epita.fr>
12079
12080 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
12081 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
12082 translate maintainer only messages.
12083
6a254321
PE
120842002-08-12 Paul Eggert <eggert@twinsun.com>
12085
645e30d1
PE
12086 Version 1.49b.
12087
6a254321
PE
12088 * Makefile.am (SUBDIRS): Remove intl.
12089 (DISTCLEANFILES): Remove.
12090 * NEWS: Mention that GNU M4 is now required. Clarify what is
12091 meant by "larger grammars". Mention the pt_BR translation.
12092 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
12093 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
12094 Bump version from 0.11.2 to 0.11.5.
12095 (BISON_PREREQ_STAGE): Remove.
12096 (AM_GNU_GETTEXT): Use external gettext.
12097 (AC_OUTPUT): Remove intl/Makefile.
12098
12099 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
12100
12101 * data/glr.c: Include string.h, for strlen.
12102 (yyreportParseError): Use size_t for yysize.
12103 (yy_yypstack): No longer nested inside yypstates, as nested
12104 functions are not portable. Do not assume size_t is the
12105 same width as int.
12106 (yypstates): Do not assume that ptrdiff_t is the same width
12107 as int, and similarly for yyposn and YYINDEX.
12108
12109 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
12110
12111 * lib/Makefile.am (INCLUDES): Do not include from the intl
12112 directory, which has been removed.
12113 * src/Makefile.am (INCLUDES): Likewise.
12114
12115 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
12116 (bitsets_sources, additional_bitsets_sources, timevars_sources):
12117 New vars.
12118
12119 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
12120 * tests/Makefile.am (EXTRA_DIST): Likewise.
12121
12122 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
12123 Do not assume that bitset_windex is the same width as unsigned.
12124
12125 * lib/abitset.c (abitset_unused_clear): Do not assume that
12126 bitset_word is the same width as int.
12127 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
12128 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
12129 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
12130 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
12131 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
12132
12133 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
12134 portability to one's complement hosts!).
12135 * lib/ebitset.c (ebitset_op1): Likewise.
12136 * lib/lbitset.c (lbitset_op1): Likewise.
12137
12138 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
12139 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12140 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
12141 Sync with fileutils.
12142 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
12143 lib/gettext.h: Sync with diffutils.
12144
12145 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
12146 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
12147
12148 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
12149 PROTOTYPES to check for prototypes, and "defined __STDC__" to
12150 check for void *.
12151
12152 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
12153 size_t; the old version tried to do this but casted improperly.
12154 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
12155 (bitset_test): Now returns int, not unsigned long.
12156
12157 * lib/bitset_stats.c: Include "gettext.h".
12158 (_): New macro.
12159 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
12160 name locals "index", as it generates unnecessary warnings on some
12161 hosts that have an "index" function.
12162
12163 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
12164 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
12165 they need translation.
12166 * src/LR0.c (state_list_append, new_itemsets, get_state,
12167 append_states, generate_states): Likewise.
12168 * src/assoc.c (assoc_to_string): Likewise.
12169 * src/closure.c (print_closure, set_firsts, closure): Likewise.
12170 * src/gram.c (grammar_dump): Likewise.
12171 * src/injections.c (injections_compute): Likewise.
12172 * src/lalr.c (lookaheads_print): Likewise.
12173 * src/relation.c (relation_transpose): Likewise.
12174 * src/scan-gram.l: Likewise.
12175 * src/tables.c (table_grow, pack_vector): Likewise.
12176
12177 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
12178 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
12179 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
12180 * m4/mbstate_t.m4: Sync with fileutils.
12181 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
12182
12183 * po/LINGUAS: Add pt_BR.
12184 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
12185 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
12186 lib/timevar.c.
12187 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
12188 manual recommends.
12189 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
12190
12191 * src/complain.c (strerror_r): Remove decl; not needed.
12192 (strerror): Use same pattern as ../lib/error.c.
12193
12194 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
12195
12196 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
12197
12198 * src/main.c (main): Cast result of bindtextdomain and textdomain
12199 to void, to avoid a GCC warning when --disable-nls is in effect.
12200
12201 * src/scan-gram.l: Use strings rather than escapes when possible,
12202 to minimize the number of warnings from xgettext.
12203 (handle_action_dollar, handle_action_at): Don't use isdigit,
12204 as it mishandles negative chars and it may not work as expected
12205 outside the C locale.
12206
12207 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
12208 this is a GCC extension and is not portable to other compilers.
12209
12210 * src/system.h (alloca): Use same pattern as ../lib/error.c.
12211 Do not include <ctype.h>; no longer needed.
12212 Do not include <malloc.h>; no longer needed (and generates
12213 warnings on OpenBSD 3.0).
12214
12215 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
12216 it's not portable.
12217
12218 * tests/regression.at: Do not use 'cc -c input.c -o input';
12219 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
12220
12221 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
12222 exit status as failure, not just exit status 1. Sun C exits
12223 with status 2 sometimes.
12224
12225 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
12226 Use it for the two large tests.
12227
c8f002c7
AD
122282002-08-02 Akim Demaille <akim@epita.fr>
12229
12230 * src/conflicts.c (conflicts_output): Don't output rules never
12231 reduced here, since anyway that computation doesn't work.
12232 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
12233 (rule_useless_p, rule_never_reduced_p): New.
12234 (grammar_rules_partial_print): Use a filter instead of a range.
12235 Display the title only if needed.
12236 (grammar_rules_print): Adjust.
12237 (grammar_rules_never_reduced_report): New.
12238 * src/tables.c (action_row): Move the computation of rules never
12239 reduced to...
12240 (token_actions): here.
12241 * src/main.c (main): Make the parser before making the report, so
12242 that rules never reduced are computed.
12243 Call grammar_rules_never_reduced_report.
12244 * src/print.c (print_results): Report rules never reduced.
12245 * tests/conflicts.at, tests/reduce.at: Adjust.
12246
cd08e51e
AD
122472002-08-01 Akim Demaille <akim@epita.fr>
12248
12249 Instead of attaching lookaheads and duplicating the rules being
12250 reduced by a state, attach the lookaheads to the reductions.
12251
12252 * src/state.h (state_t): Remove the `lookaheads',
12253 `lookaheads_rule' member.
12254 (reductions_t): Add a `lookaheads' member.
12255 Use a regular array for the `rules'.
12256 * src/state.c (reductions_new): Initialize the lookaheads member
12257 to 0.
12258 (state_rule_lookaheads_print): Adjust.
12259 * src/state.h, src/state.c (state_reductions_find): New.
12260 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
12261 (count_rr_conflicts): Adjust.
12262 * src/lalr.c (LArule): Remove.
12263 (add_lookback_edge): Adjust.
12264 (state_lookaheads_count): New.
12265 (states_lookaheads_initialize): Merge into...
12266 (initialize_LA): this.
12267 (lalr_free): Adjust.
12268 * src/main.c (main): Don't free nullable and derives too early: it
12269 is used by --verbose.
12270 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
12271
bb0027a9
AD
122722002-08-01 Akim Demaille <akim@epita.fr>
12273
12274 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
12275 `rule_number_t**'.
12276 (set_derives, free_derives): Rename as...
12277 (derives_compute, derives_free): this.
12278 Adjust all dependencies.
12279 * src/nullable.c (set_nullable, free_nullable): Rename as...
12280 (nullable_compute, nullable_free): these.
12281 (rule_list_t): Store rule_t *, not rule_number_t.
12282 * src/state.c (state_rule_lookaheads_print): Directly compare rule
12283 pointers, instead of their numbers.
12284 * src/main.c (main): Call nullable_free, and derives_free earlier,
12285 as they were lo longer used.
12286
3325ddc4
AD
122872002-08-01 Akim Demaille <akim@epita.fr>
12288
12289 * lib/timevar.c (get_time): Include children time.
12290 * src/lalr.h (LA, LArule): Don't export them: used with the
12291 state_t.
12292 * src/lalr.c (LA, LArule): Static.
12293 * src/lalr.h, src/lalr.c (lalr_free): New.
12294 * src/main.c (main): Call it.
12295 * src/tables.c (pack_vector): Check whether loc is >= to the
12296 table_size, not >.
12297 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
12298 (tables_generate): do it, since that's also it which allocates
12299 them.
12300 Don't free LA and LArule, main does.
12301
c6f1a33c
AD
123022002-07-31 Akim Demaille <akim@epita.fr>
12303
12304 Separate parser tables computation and output.
12305
12306 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
12307 (conflict_list, conflict_list_cnt, table, check, table_ninf)
12308 (yydefgoto, yydefact, high): Move to...
12309 * src/tables.h, src/tables.c: here.
12310 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12311 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12312 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
12313 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
12314 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
12315 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
12316 (action_row, save_row, token_actions, save_column, default_goto)
12317 (goto_actions, sort_actions, matching_state, pack_vector)
12318 (table_ninf_remap, pack_table, prepare_actions): Move to...
12319 * src/tables.c: here.
12320 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
12321 * src/output.c (token_actions, output_base, output_conflicts)
12322 (output_check): Merge into...
12323 (prepare_actions): this.
12324 (actions_output): Rename as...
12325 (user_actions_output): this.
12326 * src/main.c (main): Call tables_generate and tables_free.
12327
1509d42f
AD
123282002-07-31 Akim Demaille <akim@epita.fr>
12329
12330 Steal GCC's --time-report support.
12331
12332 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
12333 stolen/adjusted from GCC.
12334 * m4/stage.m4: Remove time related checks.
12335 * m4/timevar.m4: New.
12336 * configure.in: Adjust.
12337 * src/system.h: Adjust to using timevar.h.
12338 * src/getargs.h, src/getargs.c: Support trace_time for
12339 --trace=time.
12340 * src/main.c (stage): Remove.
12341 (main): Replace `stage' invocations with timevar calls.
12342 * src/output.c: Insert pertinent timevar calls.
12343
273a74fa
AD
123442002-07-31 Akim Demaille <akim@epita.fr>
12345
12346 Let --trace have arguments.
12347
12348 * src/getargs.h (enum trace_e): New.
12349 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
12350 (long_options, short_options): --trace/-T takes an optional
12351 argument.
12352 Change all the uses of trace_flag to reflect the new flags.
12353 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
12354
12355 Strengthen `stage' portability.
12356
12357 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
12358 * configure.in: Use it.
12359 Don't check for malloc.h and sys/times.h.
12360 * src/system.h: Include them when appropriate.
12361 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
12362 times and struct tms are available.
12363
217598da
AD
123642002-07-30 Akim Demaille <akim@epita.fr>
12365
12366 In verbose parse error message, don't report `error' as an
12367 expected token.
12368 * tests/actions.at (Printers and Destructors): Adjust.
12369 * tests/calc.at (Calculator $1): Adjust.
12370 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
12371 error message, do not report the parser accepts the error token in
12372 that state.
12373
52489d44
AD
123742002-07-30 Akim Demaille <akim@epita.fr>
12375
12376 Normalize conflict related messages.
12377
12378 * src/complain.h, src/complain.c (warn, complain): New.
12379 * src/conflicts.c (conflicts_print): Use them.
12380 (conflict_report_yacc): New, extracted from...
12381 (conflicts_print): here.
12382 * tests/conflicts.at, tests/existing.at: Adjust.
12383
e8832397
AD
123842002-07-30 Akim Demaille <akim@epita.fr>
12385
12386 Report rules which are never reduced by the parser: those hidden
12387 by conflicts.
12388
12389 * src/LR0.c (save_reductions): Don't make the final state too
12390 different: save its reduction (accept) instead of having a state
12391 without any action (no shift or goto, no reduce).
12392 Note: the final state is now a ``regular'' state, i.e., the
12393 parsers now contain `reduce 0' as default reduction.
12394 Nevertheless, since they decide to `accept' when yystate =
12395 final_state, they still will not reduce rule 0.
12396 * src/print.c (print_actions, print_reduction): Adjust.
12397 * src/output.c (action_row): Track reduced rules.
12398 (token_actions): Report rules never reduced.
12399 * tests/conflicts.at, tests/regression.at: Adjust.
12400
caf23d24
AD
124012002-07-30 Akim Demaille <akim@epita.fr>
12402
12403 `stage' was accidently included in a previous patch.
12404 Initiate its autoconfiscation.
12405
12406 * configure.in: Look for malloc.h and sys/times.h.
12407 * src/main.c (stage): Adjust.
12408 Report only when trace_flag.
12409
640748ee
AD
124102002-07-29 Akim Demaille <akim@epita.fr>
12411
12412 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
12413 state_number_t.
12414 (errs_t): symbol_t*, not symbol_number_t.
12415 (reductions_t): rule_t*, not rule_number_t.
12416 (FOR_EACH_SHIFT): New.
12417 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
12418 * src/print.c, src/print_graph.c: Adjust.
12419
88bce5a2
AD
124202002-07-29 Akim Demaille <akim@epita.fr>
12421
12422 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
12423
12424 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
12425 (endtoken, accept): these.
12426 * src/reader.c (reader): Set endtoken's default tag to "$end".
12427 Set undeftoken's tag to "$undefined" instead of "$undefined.".
12428 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
12429 Adjust.
12430
1bfb97db
AD
124312002-07-29 Akim Demaille <akim@epita.fr>
12432
12433 * src/reduce.c (reduce_grammar): When the language is empty,
12434 complain about the start symbol, not the axiom.
12435 Use its location.
12436 * tests/reduce.at (Empty Language): New.
12437
fc5734fe
AD
124382002-07-26 Akim Demaille <akim@epita.fr>
12439
12440 * src/reader.h, src/reader.c (gram_error): ... can't get
12441 yycontrol without making too strong assumptions on the parser
12442 itself.
12443 * src/output.c (prepare_tokens): Use the real 0th value of
12444 token_translations instead of `0'.
12445 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
12446 visible here.
12447 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
12448 for the time being: %locations ought to provide it to yyerror.
12449
3650b4b8
AD
124502002-07-25 Akim Demaille <akim@epita.fr>
12451
12452 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
12453 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
12454 * tests/regression.at (Web2c Actions): Adjust.
12455
4b3d3a8e
AD
124562002-07-25 Akim Demaille <akim@epita.fr>
12457
12458 Stop storing rules from 1 to nrules + 1.
12459
12460 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
12461 * src/nullable.c, src/output.c, src/print.c, src/reader.c
12462 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
12463 Iterate from 0 to nrules.
12464 Use rule_number_as_item_number and item_number_as_rule_number.
12465 Adjust to `derive' now containing possibly 0.
12466 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
12467 Handle the `- 1' part in rule numbers from/to item numbers.
12468 * src/conflicts.c (log_resolution): Fix the message which reversed
12469 shift and reduce.
12470 * src/output.c (action_row): Initialize default_rule to -1.
12471 (token_actions): Adjust.
12472 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
12473 expected output.
12474 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
12475
4a2a22f4
AD
124762002-07-25 Akim Demaille <akim@epita.fr>
12477
12478 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
12479 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
12480 (b4_c_knr_arg_decl): New.
12481 * data/yacc.c: Use it to define yysymprint, yydestruct, and
12482 yyreport_parse_error.
12483
b8df3223
AD
124842002-07-25 Akim Demaille <akim@epita.fr>
12485
12486 * data/yacc.c (yyreport_parse_error): New, extracted from...
12487 (yyparse): here.
12488 (yydestruct, yysymprint): Move above yyparse.
12489 Be K&R compliant.
12490
a762e609
AD
124912002-07-25 Akim Demaille <akim@epita.fr>
12492
12493 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
12494 replace...
12495 (b4_sint_type, b4_uint_type): these.
12496 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
12497 * tests/regression.at (Web2c Actions): Adjust.
12498
12b0043a
AD
124992002-07-25 Akim Demaille <akim@epita.fr>
12500
12501 * src/gram.h (TIEM_NUMBER_MAX): New.
12502 (item_number_of_rule_number, rule_number_of_item_number): Rename
12503 as...
12504 (rule_number_as_item_number, item_number_as_rule_number): these.
12505 Adjust dependencies.
12506 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12507 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12508 (symbol_number_to_vector_number): New.
12509 (order): Of vector_number_t* type.
12510 (base_t, BASE_MAX, BASE_MIN): New.
12511 (froms, tos, width, pos, check): Of base_t type.
12512 (action_number_t, ACTION_MIN, ACTION_MAX): New.
12513 (actrow): Of action_number_t type.
12514 (conflrow): Of unsigned int type.
12515 (table_ninf, base_ninf): New.
12516 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
12517 (muscle_insert_int_table, muscle_insert_base_table)
12518 (muscle_insert_rule_number_table): New.
12519 (prepare_tokens): Output `toknum' as int_table.
12520 (action_row): Returns a rule_number_t.
12521 Use ACTION_MIN, not SHRT_MIN.
12522 (token_actions): yydefact is rule_number_t*.
12523 (table_ninf_remap): New.
12524 (pack_table): Use it for `base' and `table'.
12525 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
12526 replaced with...
12527 (YYPACT_NINF, YYTABLE_NINF): these.
12528 (yypact, yytable): Compute their types instead of hard-coded
12529 `short'.
12530 * tests/regression.at (Web2c Actions): Adjust.
12531
5dde258a
AD
125322002-07-19 Akim Demaille <akim@epita.fr>
12533
12534 * src/scan-gram.l (id): Can start with an underscore.
12535
a945ec39
AD
125362002-07-16 Akim Demaille <akim@epita.fr>
12537
12538 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
12539 Adjust all former `associativity' dependencies.
12540 * src/symtab.c (symbol_new): Default associativity is `undef', not
12541 `right'.
12542 (symbol_check_alias_consistence): Adjust.
12543
fae437e8
AD
125442002-07-09 Akim Demaille <akim@epita.fr>
12545
12546 * doc/bison.texinfo: Properly set the ``header'' part.
12547 Use @dircategory ``GNU programming tools'' as per Texinfo's
12548 documentation.
12549 Use @copying.
12550
1a715ef2
AD
125512002-07-09 Akim Demaille <akim@epita.fr>
12552
12553 * lib/quotearg.h: Protect against multiple inclusions.
12554 * src/location.h (location_t): Add a `file' member.
12555 (LOCATION_RESET, LOCATION_PRINT): Adjust.
12556 * src/complain.c (warn_at, complain_at, fatal_at): Drop
12557 `error_one_per_line' support.
12558
a5d50994
AD
125592002-07-09 Akim Demaille <akim@epita.fr>
12560
12561 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
12562 * src/reader.c (lineno): Remove.
12563 Adjust all dependencies.
12564 (get_merge_function): Take a location and use complain_at.
12565 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
12566 * tests/regression.at (Invalid inputs, Mixing %token styles):
12567 Adjust.
12568
b275314e
AD
125692002-07-09 Akim Demaille <akim@epita.fr>
12570
12571 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
12572 recovery rule, and forbid extensions when --yacc.
12573 (gram_error): Use complain_at.
12574 * src/reader.c (reader): Exit if there were parse errors.
12575
865b9df1
AD
125762002-07-09 Akim Demaille <akim@epita.fr>
12577
12578 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
12579 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
12580 Reported by R Blake <blakers@mac.com>.
12581
c76e14da
AD
125822002-07-09 Akim Demaille <akim@epita.fr>
12583
12584 * data/yacc.c: Output the copyright notive in the header.
12585
7db2ed2d
AD
125862002-07-03 Akim Demaille <akim@epita.fr>
12587
12588 * src/output.c (froms, tos): Are state_number_t.
12589 (save_column): sp, sp1, and sp2 are state_number_t.
12590 (prepare): Rename `final' as `final_state_number', `nnts' as
12591 `nterms_number', `nrules' as `rules_number', `nstates' as
12592 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
12593 unused.
12594 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
12595 * data/lalr1.cc (nsym_): Remove, unused.
12596
e68e0410
AD
125972002-07-03 Akim Demaille <akim@epita.fr>
12598
12599 * src/lalr.h, src/lalr.c (goto_number_t): New.
12600 * src/lalr.c (goto_list_t): New.
12601 Propagate them.
12602 * src/nullable.c (rule_list_t): New.
12603 Propagate.
12604 * src/types.h: Remove.
12605
e1a4f3a4
AD
126062002-07-03 Akim Demaille <akim@epita.fr>
12607
12608 * src/closure.c (print_fderives): Use rule_rhs_print.
12609 * src/derives.c (print_derives): Use rule_rhs_print.
12610 (rule_list_t): New, replaces `shorts'.
12611 (set_derives): Add comments.
12612 * tests/sets.at (Nullable, Firsts): Adjust.
12613
536545f3
AD
126142002-07-03 Akim Demaille <akim@epita.fr>
12615
12616 * src/output.c (prepare_actions): Free `tally' and `width'.
12617 (prepare_actions): Allocate and free `order'.
12618 * src/symtab.c (symbols_free): Free `symbols'.
12619 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
12620 * src/output.c (m4_invoke): Move to...
12621 * src/scan-skel.l: here.
12622 (<<EOF>>): Close yyout, and free its name.
12623
8b752b00
AD
126242002-07-03 Akim Demaille <akim@epita.fr>
12625
12626 Fix some memory leaks, and fix a bug: state 0 was examined twice.
12627
12628 * src/LR0.c (new_state): Merge into...
12629 (state_list_append): this.
12630 (new_states): Merge into...
12631 (generate_states): here.
12632 (set_states): Don't ensure a proper `errs' state member here, do it...
12633 * src/conflicts.c (conflicts_solve): here.
12634 * src/state.h, src/state.c: Comment changes.
12635 (state_t): Rename member `shifts' as `transitions'.
12636 Adjust all dependencies.
12637 (errs_new): For consistency, also take the values as argument.
12638 (errs_dup): Remove.
12639 (state_errs_set): New.
12640 (state_reductions_set, state_transitions_set): Assert that no
12641 previous value was assigned.
12642 (state_free): New.
12643 (states_free): Use it.
12644 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
12645 temporary storage: use `errs' and `nerrs' as elsewhere.
12646 (set_conflicts): Allocate and free this `errs'.
12647
613f5e1a
AD
126482002-07-02 Akim Demaille <akim@epita.fr>
12649
12650 * lib/libiberty.h: New.
12651 * lib: Update the bitset implementation from upstream.
12652 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
12653 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
12654 * src/main.c: Adjust bitset stats calls.
12655
26e0cadc
PE
126562002-07-01 Paul Eggert <eggert@twinsun.com>
12657
12658 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
12659 char, so that negative chars don't collide with $.
12660
1154cced
AD
126612002-06-30 Akim Demaille <akim@epita.fr>
12662
12663 Have the GLR tests be `warning' checked, and fix the warnings.
12664
12665 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
12666 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
12667 (yyremoveDeletes): `yyi' and `yyj' are size_t.
12668 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
12669 (yyaddDeferredAction): static.
12670 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
12671 (yyreportParseError): yyprefix is const.
12672 yytokenp is used only when verbose.
12673 (yy__GNUC__): Replace with __GNUC__.
12674 (yypdumpstack): yyi is size_t.
12675 (yypreference): Un-yy local variables and arguments, to avoid
12676 clashes with `yyr1'. Anyway, we are not in the user name space.
12677 (yytname_size): be an int, as is compared with ints.
12678 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
12679 Use them.
12680 * tests/cxx-gram.at: Use quotation to protect $1.
12681 Use AT_COMPILE to enable warnings hunts.
12682 Prototype yylex and yyerror.
12683 `Use' argc.
12684 Include `string.h', not `strings.h'.
12685 Produce and prototype stmtMerge only when used.
12686 yylex takes a location.
12687
97650f4e
AD
126882002-06-30 Akim Demaille <akim@epita.fr>
12689
12690 We spend a lot of time in quotearg, in particular when --verbose.
12691
12692 * src/symtab.c (symbol_get): Store a quoted version of the key.
12693 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
12694 Adjust all callers.
12695
d2576365
AD
126962002-06-30 Akim Demaille <akim@epita.fr>
12697
12698 * src/state.h (reductions_t): Rename member `nreds' as num.
12699 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
12700 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
12701
ccaf65bc
AD
127022002-06-30 Akim Demaille <akim@epita.fr>
12703
12704 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
12705 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
12706 (shifts_to): Rename as...
12707 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
12708 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
12709 (TRANSITION_IS_DISABLED, transitions_to): these.
12710
87675353
AD
127112002-06-30 Akim Demaille <akim@epita.fr>
12712
12713 * src/print.c (print_shifts, print_gotos): Merge into...
12714 (print_transitions): this.
12715 (print_transitions, print_errs, print_reductions): Align the
12716 lookaheads columns.
12717 (print_core, print_transitions, print_errs, print_state,
12718 print_grammar): Output empty lines separator before, not after.
12719 (state_default_rule_compute): Rename as...
12720 (state_default_rule): this.
12721 * tests/conflicts.at (Defaulted Conflicted Reduction),
12722 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
12723 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
12724
ce4ccb4b
AD
127252002-06-30 Akim Demaille <akim@epita.fr>
12726
12727 Display items as we display rules.
12728
12729 * src/gram.h, src/gram.c (rule_lhs_print): New.
12730 * src/gram.c (grammar_rules_partial_print): Use it.
12731 * src/print.c (print_core): Likewise.
12732 * tests/conflicts.at (Defaulted Conflicted Reduction),
12733 (Unresolved SR Conflicts): Adjust.
12734 (Unresolved SR Conflicts): Adjust and rename as...
12735 (Resolved SR Conflicts): this, as was meant.
12736 * tests/regression.at (Web2c Report): Adjust.
12737
bc933ef1
AD
127382002-06-30 Akim Demaille <akim@epita.fr>
12739
12740 * src/print.c (state_default_rule_compute): New, extracted from...
12741 (print_reductions): here.
12742 Pessimize, but clarify the code.
12743 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
12744
53d4308d
AD
127452002-06-30 Akim Demaille <akim@epita.fr>
12746
12747 * src/output.c (action_row): Let default_rule be always a rule
12748 number.
12749
574fb2d5
AD
127502002-06-30 Akim Demaille <akim@epita.fr>
12751
12752 * src/closure.c (print_firsts, print_fderives, closure):
12753 Use BITSET_EXECUTE.
12754 * src/lalr.c (lookaheads_print): Likewise.
12755 * src/state.c (state_rule_lookaheads_print): Likewise.
12756 * src/print_graph.c (print_core): Likewise.
12757 * src/print.c (print_reductions): Likewise.
12758 * src/output.c (action_row): Likewise.
12759 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
12760
05811fd7
AD
127612002-06-30 Akim Demaille <akim@epita.fr>
12762
12763 * src/print_graph.c: Use report_flag.
12764
0e4d5753
AD
127652002-06-30 Akim Demaille <akim@epita.fr>
12766
12767 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
12768 to...
12769 * src/relation.h, src/relation.c (traverse, relation_digraph)
12770 (relation_print, relation_transpose): New.
12771
24c7d800
AD
127722002-06-30 Akim Demaille <akim@epita.fr>
12773
12774 * src/state.h, src/state.c (shifts_to): New.
12775 * src/lalr.c (build_relations): Use it.
12776
9222837b
AD
127772002-06-30 Akim Demaille <akim@epita.fr>
12778
12779 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
12780 (item_number_of_rule_number, rule_number_of_item_number): New.
12781 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
12782 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
12783 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
12784 Propagate their use.
12785 Much remains to be done, in particular wrt `shorts' from types.h.
12786
260008e5
AD
127872002-06-30 Akim Demaille <akim@epita.fr>
12788
12789 * src/symtab.c (symbol_new): Initialize the `printer' member.
12790
8a731ca8
AD
127912002-06-30 Akim Demaille <akim@epita.fr>
12792
12793 * src/LR0.c (save_reductions): Remove, replaced by...
12794 * src/state.h, src/state.c (state_reductions_set): New.
12795 (reductions, errs): Rename as...
12796 (reductions_t, errs_t): these.
12797 Adjust all dependencies.
12798
32e1e0a4
AD
127992002-06-30 Akim Demaille <akim@epita.fr>
12800
12801 * src/LR0.c (state_list_t, state_list_append): New.
12802 (first_state, last_state): Now symbol_list_t.
12803 (this_state): Remove.
12804 (new_itemsets, append_states, save_reductions): Take a state_t as
12805 argument.
12806 (set_states, generate_states): Adjust.
12807 (save_shifts): Remove, replaced by...
12808 * src/state.h, src/state.c (state_shifts_set): New.
12809 (shifts): Rename as...
12810 (shifts_t): this.
12811 Adjust all dependencies.
12812 * src/state.h (state_t): Remove the `next' member.
12813
e5fb6710
AD
128142002-06-30 Akim Demaille <akim@epita.fr>
12815
12816 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
12817 escaped in slot 0.
12818
c7ca99d4
AD
128192002-06-30 Akim Demaille <akim@epita.fr>
12820
12821 Use hash.h for the state hash table.
12822
12823 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
12824 (allocate_storage): Use state_hash_new.
12825 (free_storage): Use state_hash_free.
12826 (new_state, get_state): Adjust.
12827 * src/lalr.h, src/lalr.c (states): Move to...
12828 * src/states.h (state_t): Remove the `link' member, no longer
12829 used.
12830 * src/states.h, src/states.c: here.
12831 (state_hash_new, state_hash_free, state_hash_lookup)
12832 (state_hash_insert, states_free): New.
12833 * src/states.c (state_table, state_compare, state_hash): New.
12834 * src/output.c (output_actions): Do not free states now, since we
12835 still need to know the final_state number in `prepare', called
12836 afterwards. Do it...
12837 * src/main.c (main): here: call states_free after `output'.
12838
df0e7316
AD
128392002-06-30 Akim Demaille <akim@epita.fr>
12840
12841 * src/state.h, src/state.c (state_new): New, extracted from...
12842 * src/LR0.c (new_state): here.
12843 * src/state.h (STATE_ALLOC): Move to...
12844 * src/state.c: here.
12845 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
12846 * src/state.h, src/state.c: here.
12847
39f41916
AD
128482002-06-30 Akim Demaille <akim@epita.fr>
12849
12850 * src/reader.c (gensym): Rename as...
12851 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
12852 (getsym): Rename as...
12853 (symbol_get): this.
12854
d57650a5
AD
128552002-06-30 Akim Demaille <akim@epita.fr>
12856
12857 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
12858 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
12859 * src/output.c, src/print.c, src/print_graph.c: Propagate.
12860 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
12861
5a08f1ce
AD
128622002-06-30 Akim Demaille <akim@epita.fr>
12863
12864 Make the test suite pass with warnings checked.
12865
12866 * tests/actions.at (Printers and Destructors): Improve.
12867 Avoid unsigned vs. signed issues.
12868 * tests/calc.at: Don't exercise the scanner here, do it...
12869 * tests/input.at (Torturing the Scanner): here.
12870
720623af
PH
128712002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12872
88e7e941 12873 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
12874 reorganize first lines parallel to yacc.c.
12875
fb8135fa
AD
128762002-06-28 Akim Demaille <akim@epita.fr>
12877
12878 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
12879 (b4_token_enum, b4_token_defines): New, factored from...
12880 * data/lalr1.cc, data/yacc.c, glr.c: here.
12881
41442480
AD
128822002-06-28 Akim Demaille <akim@epita.fr>
12883
12884 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
12885 unused variables.
12886 * src/output.c (merger_output): static.
12887
e0e5bf84
AD
128882002-06-28 Akim Demaille <akim@epita.fr>
12889
ba0fe3c7 12890 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
12891 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
12892 pacify GCC.
12893 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 12894
676385e2
PH
128952002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12896
12897 Accumulated changelog for new GLR parsing features.
12898
6a254321 12899 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
12900 conflicts_total_count.
12901 * src/conflicts.h: Ditto.
12902 * src/output.c (token_actions): Use the new name.
12903 (output_conflicts): Change conflp => conflict_list_heads, and
12904 confl => conflict_list for better readability.
12905 * data/glr.c: Use the new names.
12906 * NEWS: Add self to GLR announcement.
e0e5bf84 12907
676385e2
PH
12908 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
12909
12910 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
12911 Akim Demaille.
12912
12913 * data/bison.glr: Change name to glr.c
12914 * data/glr.c: Renamed from bison.glr.
12915 * data/Makefile.am: Add glr.c
e0e5bf84
AD
12916
12917 * src/getargs.c:
12918
676385e2 12919 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 12920 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 12921
676385e2
PH
12922 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12923
12924 * data/bison.glr: Be sure to restore the
12925 current #line when returning to the skeleton contents after having
12926 exposed the input file's #line.
12927
12928 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12929
12930 * data/bison.glr: Bring up to date with changes to bison.simple.
12931
12932 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12933
12934 * data/bison.glr: Correct definitions that use b4_prefix.
12935 Various reformatting.
12936 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
12937 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
12938 yytokenp argument; now part of stack.
12939 (yychar): Define to behave as documented.
12940 (yyclearin): Ditto.
e0e5bf84 12941
676385e2
PH
12942 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12943
12944 * src/reader.h: Add declaration for free_merger_functions.
12945
12946 * src/reader.c (merge_functions): New variable.
12947 (get_merge_function): New function.
12948 (free_merger_functions): New function.
12949 (readgram): Check for %prec that is not followed by a symbol.
12950 Handle %dprec and %merge declarations.
12951 (packgram): Initialize dprec and merger fields in rules array.
12952
12953 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
12954 conflict_list_cnt, conflict_list_free): New variables.
12955 (table_grow): Also grow conflict_table.
e0e5bf84 12956 (prepare_rules): Output dprec and merger tables.
676385e2 12957 (conflict_row): New function.
e0e5bf84 12958 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
12959 default reduction in conflicted states for GLR parser so that there
12960 are spaces for the conflict lists.
12961 (save_row): Also save conflict information.
12962 (token_actions): Allocate conflict list.
12963 (merger_output): New function.
12964 (pack_vector): Pack conflict table, too.
12965 (output_conflicts): New function to output yyconflp and yyconfl.
12966 (output_check): Allocate conflict_tos.
12967 (output_actions): Output conflict tables, also.
12968 (output_skeleton): Output b4_mergers definition.
12969 (prepare): Output b4_max_rhs_length definition.
12970 Use 'bison.glr' as default skeleton for GLR parsers.
12971
12972 * src/gram.c (glr_parser): New flag.
12973 (grammar_free): Call free_merger_functions.
12974
12975 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
12976 all pairs of conflicting reductions, rather than just all tokens
12977 causing conflicts. Needed to size conflict tables.
e0e5bf84 12978 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
12979 interface.
12980 (conflicts_print): Ditto.
12981 (count_total_conflicts): New function.
12982
12983 * src/reader.h (merger_list): New type.
12984 (merge_functions): New variable.
12985
12986 * src/lex.h (tok_dprec, tok_merge): New token types.
12987
12988 * src/gram.h (rule_s): Add dprec and merger fields.
12989 (glr_parser): New flag.
12990
12991 * src/conflicts.h (count_total_conflicts): New function.
12992
12993 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
12994
12995 * doc/bison.texinfo (Generalized LR Parsing): New section.
12996 (GLR Parsers): New section.
12997 (Language and Grammar): Mention GLR parsing.
12998 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
12999 Correct typo ("tge" -> "the").
13000
13001 * data/bison.glr: New skeleton for GLR parsing.
13002
13003 * tests/cxx-gram.at: New tests for GLR parsing.
13004
13005 * tests/testsuite.at: Include cxx-gram.at.
13006
13007 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 13008
676385e2
PH
13009 * src/parse-gram.y:
13010
13011 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
13012
13013 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 13014
b5480d74 130152002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
13016
13017 * src/options.h, src/options.c: Remove.
13018 * src/getargs.c (short_options, long_options): New.
13019
60491a94
AD
130202002-06-27 Akim Demaille <akim@epita.fr>
13021
13022 * data/bison.simple, data/bison.c++: Rename as...
13023 * data/yacc.c, data/lalr1.cc: these.
13024 * doc/bison.texinfo (Environment Variables): Remove.
13025
9be0c25b
AD
130262002-06-25 Raja R Harinath <harinath@cs.umn.edu>
13027
13028 * src/getargs.c (report_argmatch): Initialize strtok().
13029
1ae72863
AD
130302002-06-20 Akim Demaille <akim@epita.fr>
13031
13032 * data/bison.simple (b4_symbol_actions): New, replaces...
13033 (b4_symbol_destructor, b4_symbol_printer): these.
13034 (yysymprint): Be sure to call YYPRINT only for tokens, and using
13035 user token numbers.
13036
87542d29
AD
130372002-06-20 Akim Demaille <akim@epita.fr>
13038
13039 * data/bison.simple (yydestructor): Rename as...
13040 (yydestruct): this.
13041
1a31ed21
AD
130422002-06-20 Akim Demaille <akim@epita.fr>
13043
13044 * src/symtab.h, src/symtab.c (symbol_type_set)
13045 (symbol_destructor_set, symbol_precedence_set): The location is
13046 the last argument.
13047 Adjust all callers.
13048
e776192e
AD
130492002-06-20 Akim Demaille <akim@epita.fr>
13050
13051 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
13052 internals.
13053 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
13054 Takes a location.
13055 * src/symtab.h, src/symtab.c (symbol_class_set)
13056 (symbol_user_token_number_set): Likewise.
13057 Adjust all callers.
13058 Promote complain_at.
13059 * tests/input.at (Type Clashes): Adjust.
13060
5c1180b3
AD
130612002-06-20 Akim Demaille <akim@epita.fr>
13062
13063 * data/bison.simple (YYLEX): Fix the declaration when
13064 %pure-parser.
13065
e3170060
AD
130662002-06-20 Akim Demaille <akim@epita.fr>
13067
13068 * data/bison.simple (yysymprint): Don't print the token number,
13069 just its name.
13070 * tests/actions.at (Destructors): Rename as...
13071 (Printers and Destructors): this.
13072 Also exercise %printer.
13073
253862fd
AD
130742002-06-20 Akim Demaille <akim@epita.fr>
13075
13076 * data/bison.simple (YYDSYMPRINT): New.
13077 Use it to remove many of the #if YYDEBUG/if (yydebug).
13078
366eea36
AD
130792002-06-20 Akim Demaille <akim@epita.fr>
13080
13081 * src/symtab.h, src/symtab.c (symbol_t): printer and
13082 printer_location are new members.
13083 (symbol_printer_set): New.
13084 * src/parse-gram.y (PERCENT_PRINTER): New token.
13085 Handle its associated rule.
13086 * src/scan-gram.l: Adjust.
13087 (handle_destructor_at, handle_destructor_dollar): Rename as...
13088 (handle_symbol_code_at, handle_symbol_code_dollar): these.
13089 * src/output.c (symbol_printers_output): New.
13090 (output_skeleton): Call it.
13091 * data/bison.simple (yysymprint): New. Cannot be named yyprint
13092 since there are already many grammar files with a user `yyprint'.
13093 Replace the calls to YYPRINT to calls to yysymprint.
13094 * tests/calc.at: Adjust.
13095 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
13096 taking advantage of parser very internal details (stack size!).
13097
4f25ebb0
AD
130982002-06-20 Akim Demaille <akim@epita.fr>
13099
13100 * src/scan-gram.l: Complete the scanner with the missing patterns
13101 to pacify Flex.
13102 Use `quote' and `symbol_tag_get' where appropriate.
13103
93b68a0e
AD
131042002-06-19 Akim Demaille <akim@epita.fr>
13105
13106 * tests/actions.at (Destructors): Augment to test locations.
13107 * data/bison.simple (yydestructor): Pass it the current location
13108 if locations are enabled.
13109 Prototype only when __STDC__ or C++.
13110 Change the argument names to move into the yy name space: there is
13111 user code here.
13112
58612f1d
AD
131132002-06-19 Akim Demaille <akim@epita.fr>
13114
74310291
AD
13115 * data/bison.simple (b4_pure_if): New.
13116 Use it instead of #ifdef YYPURE.
13117
131182002-06-19 Akim Demaille <akim@epita.fr>
13119
13120 * data/bison.simple (b4_location_if): New.
58612f1d
AD
13121 Use it instead of #ifdef YYLSP_NEEDED.
13122
f25bfb75
AD
131232002-06-19 Akim Demaille <akim@epita.fr>
13124
13125 Prepare @$ in %destructor, but currently don't bind it in the
13126 skeleton, as %location use is not cleaned up yet.
13127
13128 * src/scan-gram.l (handle_dollar, handle_destructor_at)
13129 (handle_action_at): New.
13130 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
13131 a braced_code_t and a location as additional arguments.
13132 (handle_destructor_dollar): Instead of requiring `b4_eval', just
13133 unquote one when outputting `b4_dollar_dollar'.
13134 Adjust callers.
13135 * data/bison.simple (b4_eval): Remove.
13136 (b4_symbol_destructor): Adjust.
13137 * tests/input.at (Invalid @n): Adjust.
13138
c732d2c6
AD
131392002-06-19 Zack Weinberg <zack@codesourcery.com>
13140
13141 * doc/bison.texinfo: Document ability to have multiple
13142 prologue sections.
13143
8c165d89
AD
131442002-06-18 Akim Demaille <akim@epita.fr>
13145
13146 * src/files.c (compute_base_names): When computing the output file
13147 names from the input file name, strip the directory part.
13148
ca98bf57
AD
131492002-06-18 Akim Demaille <akim@epita.fr>
13150
13151 * data/bison.simple.new: Comment changes.
13152 Reported by Andreas Schwab.
13153
0bfb02ff
AD
131542002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
13155
13156 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
13157 there are no `label `yyoverflowlab' defined but not used' warnings
13158 when yyoverflow is defined.
13159
24c0aad7
AD
131602002-06-18 Akim Demaille <akim@epita.fr>
13161
13162 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
13163 new member.
13164 (symbol_destructor_set): Adjust.
13165 * src/output.c (symbol_destructors_output): Output the destructor
13166 locations.
13167 Output the symbol name.
13168 * data/bison.simple (b4_symbol_destructor): Adjust.
13169
5719c109
AD
131702002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
13171 and Akim Demaille <akim@epita.fr>
13172
13173 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
13174 what's left on the stack when the error recovery hits EOF.
13175 * tests/actions.at (Destructors): Complete to exercise this case.
13176
9280d3ef
AD
131772002-06-17 Akim Demaille <akim@epita.fr>
13178
13179 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
13180 arguments is really empty, not only equal to `[]'.
13181 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
13182 member.
13183 (symbol_destructor_set): New.
13184 * src/output.c (symbol_destructors_output): New.
13185 * src/reader.h (brace_code_t, current_braced_code): New.
13186 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
13187 (handle_dollar): Rename as...
13188 (handle_action_dollar): this.
13189 (handle_destructor_dollar): New.
13190 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
13191 (grammar_declaration): Use it.
13192 * data/bison.simple (yystos): Is always defined.
13193 (yydestructor): New.
13194 * tests/actions.at (Destructors): New.
13195 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
13196
dafdc66f
AD
131972002-06-17 Akim Demaille <akim@epita.fr>
13198
13199 * src/symlist.h, src/symlist.c (symbol_list_length): New.
13200 * src/scan-gram.l (handle_dollar, handle_at): Compute the
13201 rule_length only when needed.
13202 * src/output.c (actions_output, token_definitions_output): Output
13203 the full M4 block.
13204 * src/symtab.c: Don't access directly to the symbol tag, use
13205 symbol_tag_get.
13206 * src/parse-gram.y: Use symbol_list_free.
13207
56c47203
AD
132082002-06-17 Akim Demaille <akim@epita.fr>
13209
13210 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
13211 (symbol_list_prepend, get_type_name): Move to...
13212 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
13213 (symbol_list_prepend, symbol_list_n_type_name_get): here.
13214 Adjust all callers.
13215 (symbol_list_free): New.
13216 * src/scan-gram.l (handle_dollar): Takes a location.
13217 * tests/input.at (Invalid $n): Adjust.
13218
1e0bab92
AD
132192002-06-17 Akim Demaille <akim@epita.fr>
13220
13221 * src/reader.h, src/reader.c (symbol_list_new): Export it.
13222 (symbol_list_prepend): New.
13223 * src/parse-gram.y (%union): `list' is a new member.
13224 (symbols.1): New, replaces...
13225 (terms_to_prec.1, nterms_to_type.1): these.
13226 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
13227 Take a location as additional argument.
13228 Adjust all callers.
13229
04e60654
AD
132302002-06-15 Akim Demaille <akim@epita.fr>
13231
13232 * src/parse-gram.y: Move %token in the declaration section so that
13233 we don't depend upon CVS Bison.
13234
10e5b8bd
AD
132352002-06-15 Akim Demaille <akim@epita.fr>
13236
13237 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
13238 * src/print.c (print_core): Use it.
13239
9801d40c
AD
132402002-06-15 Akim Demaille <akim@epita.fr>
13241
13242 * src/conflicts.c (log_resolution): Accept the rule involved in
13243 the sr conflicts instead of the lookahead number that points to
13244 that rule.
13245 (flush_reduce): Accept the current lookahead vector as argument,
13246 instead of the index in LA.
13247 (resolve_sr_conflict): Accept the current number of lookahead
13248 bitset to consider for the STATE, instead of the index in LA.
13249 (set_conflicts): Adjust.
13250 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
13251
c0263492
AD
132522002-06-15 Akim Demaille <akim@epita.fr>
13253
13254 * src/state.h (state_t): Replace the `lookaheadsp' member, a
13255 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
13256 Adjust all dependencies.
13257 * src/lalr.c (initialize_lookaheads): Split into...
13258 (states_lookaheads_count, states_lookaheads_initialize): these.
13259 (lalr): Adjust.
13260
9757c359
AD
132612002-06-15 Akim Demaille <akim@epita.fr>
13262
13263 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
13264 out of...
13265 (grammar_rules_print): here.
13266 * src/reduce.c (reduce_output): Use it.
13267 * tests/reduce.at (Useless Rules, Reduced Automaton)
13268 (Underivable Rules): Adjust.
13269
6b98e4b5
AD
132702002-06-15 Akim Demaille <akim@epita.fr>
13271
13272 Copy BYacc's nice way to report the grammar.
13273
13274 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
13275 New.
13276 Don't print the rules' location, it is confusing and useless.
13277 (rule_print): Use grammar_rhs_print.
13278 * src/print.c (print_grammar): Use grammar_rules_print.
13279
6b98e4b5
AD
132802002-06-15 Akim Demaille <akim@epita.fr>
13281
13282 Complete and rationalize `useless thing' warnings.
13283
13284 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
13285 (symbol_tag_print): New.
13286 Use them everywhere in place of accessing directly the tag member.
13287 * src/gram.h, src/gram.c (rule_print): New.
13288 Use it where a rule used to be printed `by hand'.
13289 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
13290 (reduce_grammar_tables): Report the useless rules.
13291 (reduce_print): Useless things are a warning, not an error.
13292 Report it as such.
13293 * tests/reduce.at (Useless Nonterminals, Useless Rules):
13294 (Reduced Automaton, Underivable Rules): Adjust.
13295 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
13296 * tests/conflicts.at (Unresolved SR Conflicts)
13297 (Solved SR Conflicts): Adjust.
13298
ee000ba4
AD
132992002-06-15 Akim Demaille <akim@epita.fr>
13300
13301 Let symbols have a location.
13302
13303 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
13304 (getsym): Adjust.
13305 Adjust all callers.
13306 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
13307 Use location_t, not int.
13308 * src/symtab.c (symbol_check_defined): Take advantage of the
13309 location.
13310 * tests/regression.at (Invalid inputs): Adjust.
13311
8efe435c
AD
133122002-06-15 Akim Demaille <akim@epita.fr>
13313
13314 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
13315 (input): Don't try to initialize yylloc here, do it in the
13316 scanner.
13317 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
13318 * src/gram.h (rule_t): Change line and action_line into location
13319 and action_location, of location_t type.
13320 Adjust all dependencies.
13321 * src/location.h, src/location.c (empty_location): New.
13322 * src/reader.h, src/reader.c (grammar_start_symbol_set)
13323 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
13324 (grammar_current_rule_symbol_append)
13325 (grammar_current_rule_action_append): Expect a location as argument.
13326 * src/reader.c (grammar_midrule_action): Adjust to attach an
13327 action's location as dummy symbol location.
13328 * src/symtab.h, src/symtab.c (startsymbol_location): New.
13329 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
13330 the line numbers.
13331
1921f1d7
AD
133322002-06-14 Akim Demaille <akim@epita.fr>
13333
13334 Grammar declarations may be found in the grammar section.
13335
13336 * src/parse-gram.y (rules_or_grammar_declaration): New.
13337 (declarations): Each declaration may end with a semicolon, not
13338 just...
13339 (grammar_declaration): `"%union"'.
13340 (grammar): Branch to rules_or_grammar_declaration.
13341
4515534c
AD
133422002-06-14 Akim Demaille <akim@epita.fr>
13343
13344 * src/main.c (main): Invoke scanner_free.
13345
f958596b
AD
133462002-06-14 Akim Demaille <akim@epita.fr>
13347
13348 * src/output.c (m4_invoke): Extracted from...
13349 (output_skeleton): here.
13350 Free tempfile.
13351
2c569025
AD
133522002-06-14 Akim Demaille <akim@epita.fr>
13353
13354 * src/parse-gram.y (directives, directive, gram)
13355 (grammar_directives, precedence_directives, precedence_directive):
13356 Rename as...
13357 (declarations, declaration, grammar, grammar_declaration)
13358 (precedence_declaration, precedence_declarator): these.
13359 (symbol_declaration): New.
13360
592e8d4d
AD
133612002-06-14 Akim Demaille <akim@epita.fr>
13362
13363 * src/files.c (action_obstack): Remove, unused.
13364 (output_obstack): Remove it, and all its dependencies, as it is no
13365 longer needed.
13366 * src/reader.c (epilogue_set): Build the epilogue in the
13367 muscle_obstack.
13368 * src/output.h, src/output.c (muscle_obstack): Move to...
13369 * src/muscle_tab.h, src/muscle_tab.h: here.
13370 (muscle_init): Initialize muscle_obstack.
13371 (muscle_free): New.
13372 * src/main.c (main): Call it.
13373
0c15323d
AD
133742002-06-14 Akim Demaille <akim@epita.fr>
13375
13376 * src/location.h: New, extracted from...
13377 * src/reader.h: here.
13378 * src/Makefile.am (noinst_HEADERS): Merge into
13379 (bison_SOURCES): this.
13380 Add location.h.
13381 * src/parse-gram.y: Use location_t instead of Bison's.
13382 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
13383 Use location_t instead of ints.
13384
e96c9728
AD
133852002-06-14 Akim Demaille <akim@epita.fr>
13386
13387 * data/bison.simple, data/bison.c++: Be sure to restore the
13388 current #line when returning to the skeleton contents after having
13389 exposed the input file's #line.
13390
75d1fe16
AD
133912002-06-12 Akim Demaille <akim@epita.fr>
13392
13393 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
13394 eager.
13395 * tests/actions.at (Exotic Dollars): New.
13396
6c35d22c
AD
133972002-06-12 Akim Demaille <akim@epita.fr>
13398
13399 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
13400 ['"/] too eagerly.
13401 * tests/input.at (Torturing the Scanner): New.
13402
1d6412ad
AD
134032002-06-11 Akim Demaille <akim@epita.fr>
13404
13405 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
13406 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
13407 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
13408 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
13409 * src/reader.c (reader): Use it.
13410
4cdb01db
AD
134112002-06-11 Akim Demaille <akim@epita.fr>
13412
13413 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
13414 Adjust all callers.
13415 (scanner_last_string_free): New.
13416
44995b2e
AD
134172002-06-11 Akim Demaille <akim@epita.fr>
13418
13419 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
13420 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
13421 (last_string, YY_OBS_FREE): New.
13422 Use them when returning an ID.
13423
e9955c83
AD
134242002-06-11 Akim Demaille <akim@epita.fr>
13425
13426 Have Bison grammars parsed by a Bison grammar.
13427
13428 * src/reader.c, src/reader.h (prologue_augment): New.
13429 * src/reader.c (copy_definition): Remove.
13430
13431 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
13432 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
13433 (grammar_current_rule_prec_set, grammar_current_rule_check)
13434 (grammar_current_rule_symbol_append)
13435 (grammar_current_rule_action_append): Export.
13436 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
13437 (symbol_list_action_append): Remove.
13438 Hook the routines from reader.
13439 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
13440 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
13441
13442 * src/reader.c (read_declarations): Remove, unused.
13443
13444 * src/parse-gram.y: Handle the epilogue.
13445 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
13446 (grammar_start_symbol_set): this.
13447 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
13448 * src/reader.c (readgram): Remove, unused.
13449 (reader): Adjust to insert eoftoken and axiom where appropriate.
13450
13451 * src/reader.c (copy_dollar): Replace with...
13452 * src/scan-gram.h (handle_dollar): this.
13453 * src/parse-gram.y: Remove `%thong'.
13454
13455 * src/reader.c (copy_at): Replace with...
13456 * src/scan-gram.h (handle_at): this.
13457
13458 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
13459 New.
13460
13461 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
13462 time being.
13463
13464 * src/reader.h, src/reader.c (grammar_rule_end): New.
13465
13466 * src/parse.y (current_type, current_class): New.
13467 Implement `%nterm', `%token' support.
13468 Merge `%term' into `%token'.
13469 (string_as_id): New.
13470 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
13471 type name.
13472
13473 * src/parse-gram.y: Be sure to handle properly the beginning of
13474 rules.
13475
13476 * src/parse-gram.y: Handle %type.
13477 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
13478
13479 * src/parse-gram.y: More directives support.
13480 * src/options.c: No longer handle source directives.
13481
13482 * src/parse-gram.y: Fix %output.
13483
13484 * src/parse-gram.y: Handle %union.
13485 Use the prologue locations.
13486 * src/reader.c (parse_union_decl): Remove.
13487
13488 * src/reader.h, src/reader.c (epilogue_set): New.
13489 * src/parse-gram.y: Use it.
13490
13491 * data/bison.simple, data/bison.c++: b4_stype is now either not
13492 defined, then default to int, or to the contents of %union,
13493 without `union' itself.
13494 Adjust.
13495 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
13496
13497 * src/output.c (actions_output): Don't output braces, as they are
13498 already handled by the scanner.
13499
13500 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
13501 characters to themselves.
13502
13503 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
13504 that the epilogue has a proper #line.
13505
13506 * src/parse-gram.y: Handle precedence/associativity.
13507
13508 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
13509 a terminal.
13510 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
13511 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
13512 at all to define terminals that cannot be emitted.
13513
13514 * src/scan-gram.l: Escape M4 characters.
13515
13516 * src/scan-gram.l: Working properly with escapes in user
13517 strings/characters.
13518
13519 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
13520 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
13521 grammar.
13522 Use more modest sizes, as for the time being the parser does not
13523 release memory, and therefore the process swallows a huge amount
13524 of memory.
13525
13526 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
13527 stricter %token grammar.
13528
13529 * src/symtab.h (associativity): Add `undef_assoc'.
13530 (symbol_precedence_set): Do nothing when passed an undef_assoc.
13531 * src/symtab.c (symbol_check_alias_consistence): Adjust.
13532
13533 * tests/regression.at (Invalid %directive): Remove, as it is now
13534 meaningless.
13535 (Invalid inputs): Adjust to the new error messages.
13536 (Token definitions): The new grammar doesn't allow too many
13537 eccentricities.
13538
13539 * src/lex.h, src/lex.c: Remove.
13540 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
13541 (copy_character, copy_string2, copy_string, copy_identifier)
13542 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
13543 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
13544 (parse_action): Remove.
13545 * po/POTFILES.in: Adjust.
13546
2e047461
AD
135472002-06-11 Akim Demaille <akim@epita.fr>
13548
cd05d13c 13549 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
13550 rule's action member: return the action as a string.
13551 Don't require `rule_length' as an argument: compute it.
13552 (grammar_current_rule_symbol_append)
13553 (grammar_current_rule_action_append): New, eved out from
13554 (readgram): here.
13555 Remove `action_flag', `rulelength', unused now.
13556
9af3fbce
AD
135572002-06-11 Akim Demaille <akim@epita.fr>
13558
13559 * src/reader.c (grammar_current_rule_prec_set).
13560 (grammar_current_rule_check): New, eved out from...
13561 (readgram): here.
13562 Remove `xaction', `first_rhs': useless.
13563 * tests/input.at (Type clashes): New.
13564 * tests/existing.at (GNU Cim Grammar): Adjust.
13565
1485e106
AD
135662002-06-11 Akim Demaille <akim@epita.fr>
13567
13568 * src/reader.c (grammar_midrule_action): New, Eved out from
13569 (readgram): here.
13570
da4160c3
AD
135712002-06-11 Akim Demaille <akim@epita.fr>
13572
13573 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
13574 New.
13575 (readgram): Use them as replacement of inlined code, crule and
13576 crule1.
13577
f6d0f937
AD
135782002-06-11 Akim Demaille <akim@epita.fr>
13579
13580 * src/reader.c (grammar_end, grammar_symbol_append): New.
13581 (readgram): Use them.
13582 Make the use of `p' as local as possible.
13583
69078d4b
AD
135842002-06-10 Akim Demaille <akim@epita.fr>
13585
13586 GCJ's parser requires the tokens to be defined before the prologue.
13587
13588 * data/bison.simple: Output the token definition before the user's
13589 prologue.
13590 * tests/regression.at (Braces parsing, Duplicate string)
13591 (Mixing %token styles): Check the output from bison.
13592 (Early token definitions): New.
13593
5e424082
AD
135942002-06-10 Akim Demaille <akim@epita.fr>
13595
13596 * src/symtab.c (symbol_user_token_number_set): Don't complain when
13597 assigning twice the same user number to a token, so that we can
13598 use it in...
13599 * src/lex.c (lex): here.
13600 Also use `symbol_class_set' instead of hand written code.
13601 * src/reader.c (parse_assoc_decl): Likewise.
13602
44536b35
AD
136032002-06-10 Akim Demaille <akim@epita.fr>
13604
13605 * src/symtab.c, src/symtab.c (symbol_class_set)
13606 (symbol_user_token_number_set): New.
13607 * src/reader.c (parse_token_decl): Use them.
13608 Use a switch instead of ifs.
13609 Use a single argument.
13610
8b9f2372
AD
136112002-06-10 Akim Demaille <akim@epita.fr>
13612
13613 Remove `%thong' support as it is undocumented, unused, duplicates
13614 `%token's job, and creates useless e-mail traffic with people who
13615 want to know what it is, why it is undocumented, unused, and
13616 duplicates `%token's job.
13617
13618 * src/reader.c (parse_thong_decl): Remove.
13619 * src/options.c (option_table): Remove "thong".
13620 * src/lex.h (tok_thong): Remove.
13621
3ae2b51f
AD
136222002-06-10 Akim Demaille <akim@epita.fr>
13623
13624 * src/symtab.c, src/symtab.c (symbol_type_set)
13625 (symbol_precedence_set): New.
13626 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
13627 (value_components_used): Remove, unused.
13628
2f1afb73
AD
136292002-06-09 Akim Demaille <akim@epita.fr>
13630
13631 Move symbols handling code out of the reader.
13632
13633 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
13634 (axiom): Move to...
13635 * src/symtab.h, src/symtab.c: here.
13636
13637 * src/gram.c (start_symbol): Remove: use startsymbol->number.
13638 * src/reader.c (startval): Rename as...
13639 * src/symtab.h, src/symtab.c (startsymbol): this.
13640 * src/reader.c: Adjust.
13641
13642 * src/reader.c (symbol_check_defined, symbol_make_alias)
13643 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13644 (token_translations_init)
13645 Move to...
13646 * src/symtab.c: here.
13647 * src/reader.c (packsymbols): Move to...
13648 * src/symtab.h, src/symtab.c (symbols_pack): here.
13649 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
13650 argument.
13651
e9bca3ad
AD
136522002-06-03 Akim Demaille <akim@epita.fr>
13653
13654 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
13655 then statements.
13656
86eff183
AD
136572002-06-03 Akim Demaille <akim@epita.fr>
13658
13659 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
13660 structs with non literals.
13661 * src/scan-skel.l: never-interactive.
13662 * src/conflicts.c (enum conflict_resolution_e): No trailing
13663 comma.
13664 * src/getargs.c (usage): Split long literal strings.
13665 Reported by Hans Aberg.
13666
717be197
AD
136672002-05-28 Akim Demaille <akim@epita.fr>
13668
13669 * data/bison.c++: Use C++ ostreams.
13670 (cdebug_): New member.
13671
670ddffd
AD
136722002-05-28 Akim Demaille <akim@epita.fr>
13673
13674 * src/output.c (output_skeleton): Be sure to allocate enough room
13675 for `/' _and_ for `\0' in full_skeleton.
13676
769b430f
AD
136772002-05-28 Akim Demaille <akim@epita.fr>
13678
13679 * data/bison.c++: Catch up with bison.simple:
13680 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13681 and Paul Eggert <eggert@twinsun.com>: `error' handing.
13682 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
13683 and popping traces.
13684
7067cb36
PH
136852002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13686
13687 * src/output.c (output_skeleton): Put an explicit path in front of
13688 the skeleton file name, rather than relying on the -I directory,
13689 to partially alleviate effects of having a skeleton file lying around
13690 in the current directory.
769b430f 13691
4a713ec2
PH
136922002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13693
769b430f 13694 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
13695 obstack_printf should be obstack_fgrow1.
13696
b408954b
AD
136972002-05-26 Akim Demaille <akim@epita.fr>
13698
13699 * src/state.h (state_t): `solved_conflicts' is a new member.
13700 * src/LR0.c (new_state): Set it to 0.
13701 * src/conflicts.h, src/conflicts.c (print_conflicts)
13702 (free_conflicts, solve_conflicts): Rename as...
13703 (conflicts_print, conflicts_free, conflicts_solve): these.
13704 Adjust callers.
13705 * src/conflicts.c (enum conflict_resolution_e)
13706 (solved_conflicts_obstack): New, used by...
13707 (log_resolution): this.
13708 Adjust to attach the conflict resolution to each state.
13709 Complete the description with the precedence/associativity
13710 information.
13711 (resolve_sr_conflict): Adjust.
13712 * src/print.c (print_state): Output its solved_conflicts.
13713 * tests/conflicts.at (Unresolved SR Conflicts)
13714 (Solved SR Conflicts): Exercise --report=all.
13715
a49aecd5
AD
137162002-05-26 Akim Demaille <akim@epita.fr>
13717
13718 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13719 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13720 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
13721 (token_number_t, item_number_as_token_number)
13722 (token_number_as_item_number, muscle_insert_token_number_table):
13723 Rename as...
13724 (symbol_number_t, item_number_as_symbol_number)
13725 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
13726 these, since it is more appropriate.
13727
5504898e
AD
137282002-05-26 Akim Demaille <akim@epita.fr>
13729
13730 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
13731 `Error:' lines.
13732 * data/bison.simple (yystos) [YYDEBUG]: New.
13733 (yyparse) [YYDEBUG]: Display the symbols which are popped during
13734 error recovery.
13735 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
13736
ec3bc396
AD
137372002-05-25 Akim Demaille <akim@epita.fr>
13738
13739 * doc/bison.texinfo (Debugging): Split into...
13740 (Tracing): this new section, its former contents, and...
13741 (Understanding): this new section.
13742 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
13743 by...
13744 (report_flag): this.
13745 Adjust all dependencies.
13746 (report_args, report_types, report_argmatch): New.
13747 (usage, getargs): Report/support -r, --report.
13748 * src/options.h
13749 (struct option_table_struct): Rename as..,
13750 (struct option_table_s): this.
13751 Rename the `set_flag' member to `flag' to match with getopt_long's
13752 struct.
13753 * src/options.c (option_table): Split verbose into an entry for
13754 %verbose, and another for --verbose.
13755 Support --report/-r, so remove -r from the obsolete --raw.
13756 * src/print.c: Attach full item sets and lookaheads reports to
13757 report_flag instead of trace_flag.
13758 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
13759
78df8250
PE
137602002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13761 and Paul Eggert <eggert@twinsun.com>
769b430f 13762
78df8250
PE
13763 * data/bison.simple (yyparse): Correct error handling to conform to
13764 POSIX and yacc. Specifically, after syntax error is discovered,
13765 do not reduce further before shifting the error token.
13766 Clean up the code a bit by removing the labels yyerrdefault,
13767 yyerrhandle, yyerrpop.
13768 * NEWS: Document the above.
13769
c0c9ea05
PH
137702002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13771
13772 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
13773 type; it isn't always big enough, since it doesn't necessarily
13774 include non-terminals.
769b430f 13775 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
13776 the latter can be removed.
13777 (yy_token_number_type): Remove, only one use.
13778 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
13779 don't use TokenNumberType as element type.
769b430f 13780
c0c9ea05
PH
13781 * tests/regression.at: Modify expected output to agree with change
13782 to yyr1 and yytranslate.
769b430f 13783
6390a83f
FK
137842002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
13785
13786 * src/reader.c (parse_action): Use copy_character instead of
13787 obstack_1grow.
13788
db7c8e9a
AD
137892002-05-13 Akim Demaille <akim@epita.fr>
13790
13791 * tests/regression.at (Token definitions): Prototype yylex and
13792 yyerror.
13793
fcc61800
PH
137942002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13795
158c687b 13796 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
13797 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
13798 32-bit arithmetic.
13799 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
13800
5683e9b2
AD
138012002-05-07 Akim Demaille <akim@epita.fr>
13802
13803 * tests/synclines.at: Be sure to prototype yylex and yyerror to
13804 avoid GCC warnings.
13805
0c2d3f4c
AD
138062002-05-07 Akim Demaille <akim@epita.fr>
13807
13808 Kill GCC warnings.
13809
13810 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
13811 over the RHS of each rule.
13812 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
13813 * src/state.h (state_t): Member `nitems' is unsigned short.
13814 * src/LR0.c (get_state): Adjust.
13815 * src/reader.c (packgram): Likewise.
13816 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
13817 `Type'.
13818 (muscle_insert_int_table): Remove, unused.
13819 (prepare_rules): Remove `max'.
13820
1565b720
AD
138212002-05-06 Akim Demaille <akim@epita.fr>
13822
13823 * src/closure.c (print_firsts): Display of the symbol tags.
13824 (bitmatrix_print): Move to...
13825 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
13826 here.
13827 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
13828
cfaee611
AD
138292002-05-06 Akim Demaille <akim@epita.fr>
13830
13831 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
13832 hash_do_for_each.
13833
458be8e0
AD
138342002-05-06 Akim Demaille <akim@epita.fr>
13835
13836 * src/LR0.c (new_state, get_state): Instead of using the global
13837 `kernel_size' and `kernel_base', have two new arguments:
13838 `core_size' and `core'.
13839 Adjust callers.
13840
a900a624
AD
138412002-05-06 Akim Demaille <akim@epita.fr>
13842
13843 * src/reader.c (packgram): No longer end `ritem' with a 0
13844 sentinel: it is not used.
13845
d4e7d3a1
AD
138462002-05-05 Akim Demaille <akim@epita.fr>
13847
13848 New experimental feature: display the lookaheads in the report and
13849 graph.
13850
13851 * src/print (print_core): When --trace-flag, display the rules
13852 lookaheads.
13853 * src/print_graph.c (print_core): Likewise.
13854 Swap the arguments.
13855 Adjust caller.
13856
39ceb25b
AD
138572002-05-05 Akim Demaille <akim@epita.fr>
13858
13859 * tests/torture.at (Many lookaheads): New test.
13860
5372019f
AD
138612002-05-05 Akim Demaille <akim@epita.fr>
13862
13863 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
13864 (GENERATE_MUSCLE_INSERT_TABLE): this.
13865 (output_int_table, output_unsigned_int_table, output_short_table)
13866 (output_token_number_table, output_item_number_table): Replace with...
13867 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
13868 (muscle_insert_short_table, muscle_insert_token_number_table)
13869 (muscle_insert_item_number_table): these.
13870 Adjust all callers.
13871 (prepare_tokens): Don't free `translations', since...
13872 * src/reader.h, src/reader.c (grammar_free): do it.
13873 Move to...
13874 * src/gram.h, src/gram.c (grammar_free): here.
13875 * data/bison.simple, data/bison.c++: b4_token_number_max is now
13876 b4_translate_max.
13877
5df5f6d5
AD
138782002-05-05 Akim Demaille <akim@epita.fr>
13879
13880 * src/output.c (output_unsigned_int_table): New.
13881 (prepare_rules): `i' is unsigned.
13882 `prhs', `rline', `r2' are unsigned int.
13883 Rename muscle `rhs_number_max' as `rhs_max'.
13884 Output muscles `prhs_max', `rline_max', and `r2_max'.
13885 Free rline and r1.
13886 * data/bison.simple, data/bison.c++: Adjust to use these muscles
13887 to compute types instead of constant types.
13888 * tests/regression.at (Web2c Actions): Adjust.
13889
b87f8b21
AD
138902002-05-04 Akim Demaille <akim@epita.fr>
13891
13892 * src/symtab.h (SALIAS, SUNDEF): Rename as...
13893 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
13894 Adjust dependencies.
13895 * src/output.c (token_definitions_output): Be sure not to output a
13896 `#define 'a'' when fed with `%token 'a' "a"'.
13897 * tests/regression.at (Token definitions): New.
13898
8bb936e4
PE
138992002-05-03 Paul Eggert <eggert@twinsun.com>
13900
13901 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
13902 for K&R C.
13903
139042002-05-03 gettextize <bug-gnu-gettext@gnu.org>
13905
13906 * Makefile.am (SUBDIRS): Remove intl.
13907 (EXTRA_DIST): Add config/config.rpath.
13908
53c71a12
AD
139092002-05-03 Akim Demaille <akim@epita.fr>
13910
13911 * data/bison.simple (m4_if): Don't output empty enums.
13912 And actually, output valid enum definitions :(.
13913
289dd0cf
AD
139142002-05-03 Akim Demaille <akim@epita.fr>
13915
13916 * configure.bat: Remove, completely obsolete.
13917 * Makefile.am (EXTRA_DIST): Adjust.
13918 Don't distribute config.rpath...
13919 * config/Makefile.am (EXTRA_DIST): Do it.
13920
db85e524
AD
139212002-05-03 Akim Demaille <akim@epita.fr>
13922
13923 * configure.in (GETTEXT_VERSION): New.
13924 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
13925
83ccf991
AD
139262002-05-03 Akim Demaille <akim@epita.fr>
13927
13928 * data/bison.simple (b4_token_enum): New.
13929 (b4_token_defines): Use it to output tokens both as #define and
13930 enums.
13931 Suggested by Paul Eggert.
13932 * src/output.c (token_definitions_output): Don't output spurious
13933 white spaces.
13934
1f418995
AD
139352002-05-03 Akim Demaille <akim@epita.fr>
13936
13937 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
13938
45119f04
RA
139392002-05-02 Robert Anisko <robert@lrde.epita.fr>
13940
13941 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
13942 Update the stack class, give a try to deque as the default container.
13943
b2d52318
AD
139442002-05-02 Akim Demaille <akim@epita.fr>
13945
13946 * data/bison.simple (yyparse): Do not implement @$ = @1.
13947 (YYLLOC_DEFAULT): Adjust to do it.
13948 * doc/bison.texinfo (Location Default Action): Fix.
13949
3a8b4109
AD
139502002-05-02 Akim Demaille <akim@epita.fr>
13951
13952 * src/reader.c (parse_braces): Merge into...
13953 (parse_action): this.
13954
84614e13
AD
139552002-05-02 Akim Demaille <akim@epita.fr>
13956
13957 * configure.in (ALL_LINGUAS): Remove.
13958 * po/LINGUAS, hr.po: New.
13959
fdbcd8e2
AD
139602002-05-02 Akim Demaille <akim@epita.fr>
13961
13962 Remove the so called hairy (semantic) parsers.
13963
13964 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
13965 * src/gram.h, src/gram.c (semantic_parser): Remove.
13966 (rule_t): Remove the guard and guard_line members.
13967 * src/lex.h (token_t): remove tok_guard.
13968 * src/options.c (option_table): Remove %guard and %semantic_parser
13969 support.
13970 * src/output.c, src/output.h (guards_output): Remove.
13971 (prepare): Adjust.
13972 (token_definitions_output): Don't output the `T'
13973 tokens (???).
13974 (output_skeleton): Don't output the guards.
13975 * src/files.c, src/files.c (attrsfile): Remove.
13976 * src/reader.c (symbol_list): Remove the guard and guard_line
13977 members.
13978 Adjust dependencies.
13979 (parse_guard): Remove.
13980 * data/bison.hairy: Remove.
13981 * doc/bison.texinfo (Environment Variables): Remove occurrences of
13982 BISON_HAIRY.
13983
82b6cb3f
AD
139842002-05-02 Akim Demaille <akim@epita.fr>
13985
13986 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
13987 (parse_guard): Rename the formal argument `stack_offset' as
13988 `rule_length', which is more readable.
13989 Adjust callers.
13990 (copy_at, copy_dollar): Instead of outputting the hard coded
13991 values of $$, $n and so forth, output invocation to b4_lhs_value,
13992 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
13993 Note: this patch partially drops `semantic-parser' support: it
13994 always does `rule_length - n', where semantic parsers ought to
13995 always use `-n'.
82b6cb3f
AD
13996 * data/bison.simple, data/bison.c++ (b4_lhs_value)
13997 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
13998
6cbfbcc5
AD
139992002-05-02 Akim Demaille <akim@epita.fr>
14000
14001 * configure.in (AC_INIT): Bump to 1.49b.
14002 (AM_INIT_AUTOMAKE): Short invocation.
14003
b8548114
AD
140042002-05-02 Akim Demaille <akim@epita.fr>
14005
14006 Version 1.49a.
14007
c20cd1fa
AD
140082002-05-01 Akim Demaille <akim@epita.fr>
14009
14010 * src/skeleton.h: Remove.
14011
8a9566d4
AD
140122002-05-01 Akim Demaille <akim@epita.fr>
14013
14014 * src/skeleton.h: Fix the #endif.
14015 Reported by Magnus Fromreide.
14016
8c6d399a
PE
140172002-04-26 Paul Eggert <eggert@twinsun.com>
14018
14019 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
14020 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 14021 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 14022
2b7ed18a
RA
140232002-04-25 Robert Anisko <robert@lrde.epita.fr>
14024
14025 * src/scan-skel.l: Postprocess quadrigraphs.
14026
14027 * src/reader.c (copy_character): New function, used to output
14028 single characters while replacing `[' and `]' with quadrigraphs, to
14029 avoid troubles with M4 quotes.
14030 (copy_comment): Output characters with copy_character.
14031 (read_additionnal_code): Likewise.
14032 (copy_string2): Likewise.
14033 (copy_definition): Likewise.
14034
14035 * tests/calc.at: Exercise M4 quoting.
14036
34a89c50
AD
140372002-04-25 Akim Demaille <akim@epita.fr>
14038
14039 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
14040 between `!' and the command.
14041 Reported by Paul Eggert.
14042
0dd1580a
RA
140432002-04-24 Robert Anisko <robert@lrde.epita.fr>
14044
14045 * tests/calc.at: Exercise prologue splitting.
14046
14047 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
14048 `b4_post_prologue' instead of `b4_prologue'.
14049
14050 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
14051 muscles.
14052 (output): Free pre_prologue_obstack and post_prologue_obstack.
14053 * src/files.h, src/files.c (attrs_obstack): Remove.
14054 (pre_prologue_obstack, post_prologue_obstack): New.
14055 * src/reader.c (copy_definition): Add a parameter to specify the
14056 obstack to fill, instead of using attrs_obstack unconditionally.
14057 (read_declarations): Pass pre_prologue_obstack to copy_definition if
14058 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
14059
83c1796f
PE
140602002-04-23 Paul Eggert <eggert@twinsun.com>
14061
14062 * data/bison.simple: Remove unnecessary commentary and white
14063 space differences from 1_29-branch.
14064 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
14065
14066 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
14067 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
14068 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
14069 constructors or destructors.
14070
14071 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
14072
1207eeac
AD
140732002-04-23 Akim Demaille <akim@epita.fr>
14074
14075 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
14076 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
14077 location with columns.
14078 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
14079 All reported by Paul Eggert.
14080
78ab8f67
AD
140812002-04-22 Akim Demaille <akim@epita.fr>
14082
14083 * src/reduce.c (dump_grammar): Move to...
14084 * src/gram.h, src/gram.c (grammar_dump): here.
14085 Be sure to separate long item numbers.
14086 Don't read the members of a rule's prec if its nil.
14087
133c20e2
AD
140882002-04-22 Akim Demaille <akim@epita.fr>
14089
14090 * src/output.c (table_size, table_grow): New.
14091 (MAXTABLE): Remove, replace uses with table_size.
14092 (pack_vector): Instead of dying when the table is too big, grow it.
14093
9515e8a7
AD
140942002-04-22 Akim Demaille <akim@epita.fr>
14095
14096 * data/bison.simple (yyr1): Its type is that of a token number.
14097 * data/bison.c++ (r1_): Likewise.
14098 * tests/regression.at (Web2c Actions): Adjust.
14099
23c5a174
AD
141002002-04-22 Akim Demaille <akim@epita.fr>
14101
14102 * src/reader.c (token_translations_init): 256 is now the default
14103 value for the error token, i.e., it will be assigned another
14104 number if the user assigned 256 to one of her tokens.
14105 (reader): Don't force 256 to error.
14106 * doc/bison.texinfo (Symbols): Adjust.
14107 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
14108 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
14109 etc. instead of 10, 20, 30 (which was used to `jump' over error
14110 (256) and undefined (2)).
14111
5fbb0954
AD
141122002-04-22 Akim Demaille <akim@epita.fr>
14113
14114 Propagate more token_number_t.
14115
14116 * src/gram.h (token_number_as_item_number)
14117 (item_number_as_token_number): New.
14118 * src/output.c (GENERATE_OUTPUT_TABLE): New.
14119 Use it to create output_item_number_table and
14120 output_token_number_table.
14121 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14122 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
14123 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
14124 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
14125
4f940944
AD
141262002-04-22 Akim Demaille <akim@epita.fr>
14127
14128 * src/output.h, src/output.c (get_lines_number): Remove.
14129
3ded9a63
AD
141302002-04-19 Akim Demaille <akim@epita.fr>
14131
14132 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
14133 as Lex/Flex'.
14134 (Debugging): More details about enabling the debugging features.
14135 (Table of Symbols): Describe $$, $n, @$, and @n.
14136 Suggested by Tim Josling.
14137
e0c471a9
AD
141382002-04-19 Akim Demaille <akim@epita.fr>
14139
14140 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
14141
fecc10cd
AD
141422002-04-10 Akim Demaille <akim@epita.fr>
14143
14144 * src/system.h: Rely on HAVE_LIMITS_H.
14145 Suggested by Paul Eggert.
14146
51dec47b
AD
141472002-04-09 Akim Demaille <akim@epita.fr>
14148
14149 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
14150 full stderr, and strip it according to the bison options, instead
14151 of composing the error message from different bits.
14152 This makes it easier to check for several error messages.
14153 Adjust all the invocations.
14154 Add an invocation exercising the error token.
14155 Add an invocation demonstrating a stupid error message.
14156 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
14157 Adjust the tests.
14158 Error message are for stderr, not stdout.
14159
007a50a4
AD
141602002-04-09 Akim Demaille <akim@epita.fr>
14161
14162 * src/gram.h, src/gram.c (error_token_number): Remove, use
14163 errtoken->number.
14164 * src/reader.c (reader): Don't specify the user token number (2)
14165 for $undefined, as it uselessly prevents using it.
14166 * src/gram.h (token_number_t): Move to...
14167 * src/symtab.h: here.
14168 (state_t.number): Is a token_number_t.
14169 * src/print.c, src/reader.c: Use undeftoken->number instead of
14170 hard coded 2.
14171 (Even though this 2 is not the same as above: the number of the
14172 undeftoken remains being 2, it is its user token number which
14173 might not be 2).
14174 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
14175 `user_token_number_max'.
14176 Output `undef_token_number'.
14177 * data/bison.simple, data/bison.c++: Use them.
14178 Be sure to map invalid yylex return values to
14179 `undef_token_number'. This saves us from gratuitous SEGV.
14180
14181 * tests/conflicts.at (Solved SR Conflicts)
14182 (Unresolved SR Conflicts): Adjust.
14183 * tests/regression.at (Web2c Actions): Adjust.
14184
06446ccf
AD
141852002-04-08 Akim Demaille <akim@epita.fr>
14186
14187 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
14188 Adding #line.
14189 Remove the duplicate `typedefs'.
14190 (RhsNumberType): Fix the declaration and various other typos.
14191 Use __ofile__.
14192 * data/bison.simple: Use __ofile__.
14193 * src/scan-skel.l: Handle __ofile__.
14194
62a3e4f0
AD
141952002-04-08 Akim Demaille <akim@epita.fr>
14196
14197 * src/gram.h (item_number_t): New, the type of item numbers in
14198 RITEM. Note that it must be able to code symbol numbers as
14199 positive number, and the negation of rule numbers as negative
14200 numbers.
14201 Adjust all dependencies (pretty many).
14202 * src/reduce.c (rule): Remove this `short *' pointer: use
14203 item_number_t.
14204 * src/system.h (MINSHORT, MAXSHORT): Remove.
14205 Include `limits.h'.
14206 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
14207 (shortcpy): Remove.
14208 (MAXTABLE): Move to...
14209 * src/output.c (MAXTABLE): here.
14210 (prepare_rules): Use output_int_table to output rhs.
14211 * data/bison.simple, data/bison.c++: Adjust.
14212 * tests/torture.at (Big triangle): Move the limit from 254 to
14213 500.
14214 * tests/regression.at (Web2c Actions): Ajust.
14215
14216 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
14217 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
14218 passes, but produces negative #line number, once fixed, GCC is
14219 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
14220 C), it passes.
14221 * src/state.h (state_h): Code input lines on ints, not shorts.
14222
bb88b0fc
AD
142232002-04-08 Akim Demaille <akim@epita.fr>
14224
14225 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
14226 and then the grammar.
14227
9a636f47
AD
142282002-04-08 Akim Demaille <akim@epita.fr>
14229
14230 * src/system.h: No longer using strndup.
14231
680e8701
AD
142322002-04-07 Akim Demaille <akim@epita.fr>
14233
14234 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
14235 * src/output.c (output_table_data): Return the longest number.
14236 (prepare_tokens): Output `token_number_max').
14237 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
14238 New.
14239 Use them to define yy_token_number_type/TokenNumberType.
14240 Use this type for yytranslate.
14241 * tests/torture.at (Big triangle): Push the limit from 124 to
14242 253.
14243 * tests/regression.at (Web2c Actions): Adjust.
14244
817e9f41
AD
142452002-04-07 Akim Demaille <akim@epita.fr>
14246
14247 * tests/torture.at (Big triangle): New.
14248 (GNU AWK Grammar, GNU Cim Grammar): Move to...
14249 * tests/existing.at: here.
14250
5123689b
AD
142512002-04-07 Akim Demaille <akim@epita.fr>
14252
14253 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
14254 nritems.
14255 Adjust dependencies.
14256
f3849179
AD
142572002-04-07 Akim Demaille <akim@epita.fr>
14258
14259 * src/reader.c: Normalize increments to prefix form.
14260
bd02036a
AD
142612002-04-07 Akim Demaille <akim@epita.fr>
14262
14263 * src/reader.c, symtab.c: Remove debugging code.
14264
db8837cb
AD
142652002-04-07 Akim Demaille <akim@epita.fr>
14266
14267 Rename all the `bucket's as `symbol_t'.
14268
14269 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
14270 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
14271 * src/symtab.c, src/symtab.h (bucket): Rename as...
14272 (symbol_t): this.
14273 (symbol_list_new, bucket_check_defined, bucket_make_alias)
14274 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
14275 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14276 (buckets_new, buckets_free, buckets_do): Rename as...
14277 (symbol_list_new, symbol_check_defined, symbol_make_alias)
14278 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
14279 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
14280 (symbols_new, symbols_free, symbols_do): these.
14281
72a23c97
AD
142822002-04-07 Akim Demaille <akim@epita.fr>
14283
14284 Use lib/hash for the symbol table.
14285
14286 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
14287 EOF.
14288 * src/lex.c (lex): Set the `number' member of new terminals.
14289 * src/reader.c (bucket_check_defined, bucket_make_alias)
14290 (bucket_check_alias_consistence, bucket_translation): New.
14291 (reader, grammar_free, readgram, token_translations_init)
14292 (packsymbols): Adjust.
14293 (reader): Number the predefined tokens.
14294 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
14295 for predefined tokens.
14296 * src/symtab.h (bucket): Remove all the hash table related
14297 members.
14298 * src/symtab.c (symtab): Replace by...
14299 (bucket_table): this.
14300 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14301 (buckets_new, buckets_do): New.
14302
280a38c3
AD
143032002-04-07 Akim Demaille <akim@epita.fr>
14304
14305 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
14306 (start_symbol, max_user_token_number, semantic_parser)
14307 (error_token_number): Initialize.
14308 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
14309 Initialize.
14310 (reader): Don't.
14311 (errtoken, eoftoken, undeftoken, axiom): Extern.
14312
03b31c0c
AD
143132002-04-07 Akim Demaille <akim@epita.fr>
14314
14315 * src/gram.h (rule_s): prec and precsym are now pointers
14316 to the bucket giving the priority/associativity.
14317 Member `associativity' removed: useless.
14318 * src/reduce.c, src/conflicts.c: Adjust.
14319
8b3df748
AD
143202002-04-07 Akim Demaille <akim@epita.fr>
14321
14322 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
14323 Properly escape the symbols' TAG when outputting them.
14324
e601aa1d
AD
143252002-04-07 Akim Demaille <akim@epita.fr>
14326
14327 * src/lalr.h (LA): Is a bitsetv, not bitset*.
14328
b0299a2e
AD
143292002-04-07 Akim Demaille <akim@epita.fr>
14330
14331 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
14332 (LArule): this, which is an array to rule_t*.
14333 * src/print.c, src/conflicts.c: Adjust.
14334
d7e1f00c
AD
143352002-04-07 Akim Demaille <akim@epita.fr>
14336
14337 * src/gram.h (rule_t): Rename `number' as `user_number'.
14338 `number' is a new member.
14339 Adjust dependencies.
14340 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
14341
cc9305dd
AD
143422002-04-07 Akim Demaille <akim@epita.fr>
14343
14344 As a result of the previous patch, it is no longer needed
14345 to reorder ritem itself.
14346
14347 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
14348
b0940840
AD
143492002-04-07 Akim Demaille <akim@epita.fr>
14350
14351 Be sure never to walk through RITEMS, but use only data related to
14352 the rules themselves. RITEMS should be banished.
14353
14354 * src/output.c (output_token_translations): Rename as...
14355 (prepare_tokens): this.
14356 In addition to `translate', prepare the muscles `tname' and
14357 `toknum', which were handled by...
14358 (output_rule_data): this.
14359 Remove, and move the remainder of its outputs into...
14360 (prepare_rules): this new routines, which also merges content from
14361 (output_gram): this.
14362 (prepare_rules): Be sure never to walk through RITEMS.
14363 (output_stos): Rename as...
14364 (prepare_stos): this.
14365 (output): Always invoke prepare_states, after all, just don't use it
14366 in the output if you don't need it.
14367
643a5994
AD
143682002-04-07 Akim Demaille <akim@epita.fr>
14369
14370 * src/LR0.c (new_state): Display `nstates' as the name of the
14371 newly created state.
14372 Adjust to initialize first_state and last_state if needed.
14373 Be sure to distinguish the initial from the final state.
14374 (new_states): Create the itemset of the initial state, and use
14375 new_state.
14376 * src/closure.c (closure): Now that the initial state has its
14377 items properly set, there is no need for a special case when
14378 creating `ruleset'.
14379
14380 As a result, now the rule 0, reducing to $axiom, is visible in the
14381 outputs. Adjust the test suite.
14382
14383 * tests/conflicts.at (Solved SR Conflicts)
14384 (Unresolved SR Conflicts): Adjust.
14385 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
14386 * tests/conflicts.at (S/R in initial): New.
14387
b4c4ccc2
AD
143882002-04-07 Akim Demaille <akim@epita.fr>
14389
14390 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
14391 the RHS of the rules.
14392 * src/output.c (output_gram): Likewise.
14393
bba97eb2
AD
143942002-04-07 Akim Demaille <akim@epita.fr>
14395
14396 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
14397 bucket.
14398 Adjust all dependencies.
14399 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
14400 `number' of the buckets too.
14401 * src/gram.h: Include `symtab.h'.
14402 (associativity): Move to...
14403 * src/symtab.h: here.
14404 No longer include `gram.h'.
14405
c3b407f4
AD
144062002-04-07 Akim Demaille <akim@epita.fr>
14407
14408 * src/gram.h, src/gram.c (rules_rhs_length): New.
14409 (ritem_longest_rhs): Use it.
14410 * src/gram.h (rule_t): `number' is a new member.
14411 * src/reader.c (packgram): Set it.
14412 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
14413 the end of `rules', and count them out of `nrules'.
14414 (reduce_output, dump_grammar): Adjust.
14415 * src/print.c (print_grammar): It is no longer needed to check for
14416 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
14417 * tests/reduce.at (Reduced Automaton): New test.
14418
11652ab3
AD
144192002-04-07 Akim Demaille <akim@epita.fr>
14420
14421 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
14422 lacking `+ 1' to nrules, Bison reported as useless a token if it
14423 was used solely to set the precedence of the last rule...
14424
26b23c1a
AD
144252002-04-07 Akim Demaille <akim@epita.fr>
14426
14427 * data/bison.c++, data/bison.simple: Don't output the current file
14428 name in #line, to avoid useless diffs between two identical
14429 outputs under different names.
14430
18bcecb0
AD
144312002-04-07 Akim Demaille <akim@epita.fr>
14432
14433 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
14434 Normalize loops to using `< nrules + 1', not `<= nrules'.
14435
fa770c86
AD
144362002-04-07 Akim Demaille <akim@epita.fr>
14437
14438 * TODO: Update.
14439
d9b739c3
AD
144402002-04-07 Akim Demaille <akim@epita.fr>
14441
14442 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
14443 bucket.value as bucket.number.
14444
99013900
AD
144452002-04-07 Akim Demaille <akim@epita.fr>
14446
14447 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
14448 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14449 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
14450 RHS, instead of being an index in RITEMS.
14451
e966383b
PE
144522002-04-04 Paul Eggert <eggert@twinsun.com>
14453
14454 * doc/bison.texinfo: Update copyright date.
14455 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
14456 (Symbols): Warn about running Bison in one character set,
14457 but compiling and/or running in an incompatible one.
14458 Warn about character code 256, too.
14459
144602002-04-03 Paul Eggert <eggert@twinsun.com>
14461
14462 * src/bison.data (YYSTACK_ALLOC): Depend on whether
14463 YYERROR_VERBOSE is nonzero, not whether it is defined.
14464
14465 Merge changes from bison-1_29-branch.
c307773e 14466
8d6c48b9
PE
144672002-03-20 Paul Eggert <eggert@twinsun.com>
14468
14469 Merge fixes from Debian bison_1.34-1.diff.
14470
14471 * configure.in (AC_PREREQ): 2.53.
14472
e53c6322
AD
144732002-03-20 Akim Demaille <akim@epita.fr>
14474
14475 * src/conflicts.c (log_resolution): Argument `resolution' is const.
14476
9ffbeca7
PE
144772002-03-19 Paul Eggert <eggert@twinsun.com>
14478
21db0b2a
PE
14479 * src/bison.simple (YYCOPY): New macro.
14480 (YYSTACK_RELOCATE): Use it.
14481 Remove Type arg; no longer needed. All callers changed.
14482 (yymemcpy): Remove; no longer needed.
14483
9ffbeca7
PE
14484 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
14485 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14486
642cb8f8
AD
144872002-03-19 Akim Demaille <akim@epita.fr>
14488
14489 Test and fix the #line outputs.
14490
14491 * tests/atlocal.at (GCC): New.
14492 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 14493 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
14494 (Action synch line, Epilogue synch line): New tests.
14495 * src/reader.c (parse_union_decl): Define the muscle stype_line.
14496 * data/bison.simple, data/bison.c++: Use it.
14497
3c31a486
AD
144982002-03-19 Akim Demaille <akim@epita.fr>
14499
14500 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
14501 (Solved SR Conflicts, %expect not enough, %expect right)
14502 (%expect too much): Move to...
14503 * tests/conflicts.at: this new file.
14504
0d8bed56
AD
145052002-03-19 Akim Demaille <akim@epita.fr>
14506
14507 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14508 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
14509 that we can move to enums for instance.
14510 * src/output.c (token_definitions_output): Output a list of
14511 `token-name, token-number' instead of the #define.
14512 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
14513
9208d17f
AD
145142002-03-14 Akim Demaille <akim@epita.fr>
14515
14516 Use Gettext 0.11.1.
14517
af27eacb
RA
145182002-03-09 Robert Anisko <robert@lrde.epita.fr>
14519
14520 * data/bison.c++: Make the user able to add members to the generated
14521 parser by subclassing.
14522
9101a310
RA
145232002-03-05 Robert Anisko <robert@lrde.epita.fr>
14524
14525 * src/reader.c (read_additionnal_code): `c' should be an integer, not
14526 a character.
14527 Reported by Nicolas Tisserand and Nicolas Burrus.
14528
fff9bf0b
RA
145292002-03-04 Robert Anisko <robert@lrde.epita.fr>
14530
14531 * src/reader.c: Warn about lacking semi-colons, do not complain.
14532
64dba31e
RA
145332002-03-04 Robert Anisko <robert@lrde.epita.fr>
14534
14535 * data/bison.c++: Remove a debug line.
14536
374f5a14
RA
145372002-03-04 Robert Anisko <robert@lrde.epita.fr>
14538
14539 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
14540 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
14541 provide a default implementation.
14542
bfcf1f3a
AD
145432002-03-04 Akim Demaille <akim@epita.fr>
14544
14545 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
14546 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
14547 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
14548 * tests/semantic.at (Parsing Guards): Similarly.
14549 * src/reader.at (readgram): Complain if the last rule is not ended
14550 with a semi-colon.
14551
65ccf9fc
AD
145522002-03-04 Akim Demaille <akim@epita.fr>
14553
14554 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
14555 * src/closure.c: here.
14556 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
14557 RTC.
14558 * src/warshall.h, src/warshall.c: Remove.
14559 * tests/sets.at (Broken Closure): Adjust.
14560
d0039cbc
AD
145612002-03-04 Akim Demaille <akim@epita.fr>
14562
14563 * src/output.c (output_skeleton): tempdir is const.
14564 bytes_read is unused.
14565
345cea78
AD
145662002-03-04 Akim Demaille <akim@epita.fr>
14567
14568 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14569 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
14570 Update.
14571 From Michael Hayes.
14572
564801f7
AD
145732002-03-04 Akim Demaille <akim@epita.fr>
14574
14575 * src/closure.c (closure): `r' is unused.
14576
e5352bc7
AD
145772002-03-04 Akim Demaille <akim@epita.fr>
14578
14579 * tests/sets.at (Broken Closure): Add the ending `;'.
14580 * src/reader.at (readgram): Complain if a rule is not ended with a
14581 semi-colon.
14582
914feea9
AD
145832002-03-04 Akim Demaille <akim@epita.fr>
14584
14585 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
14586 (count_sr_conflicts): Use bitset_count.
14587 * src/reduce.c (inaccessable_symbols): Ditto.
14588 (bits_size): Remove.
14589 * src/warshall.h, src/warshall.c: Convert to bitsetv.
14590
f0250de6
AD
145912002-03-04 Akim Demaille <akim@epita.fr>
14592
14593 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
14594 * src/reduce.c: Remove the `bitset_zero's following the
14595 `bitset_create's, as now it is performed by the latter.
14596
ef017502
AD
145972002-03-04 Akim Demaille <akim@epita.fr>
14598
14599 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
14600 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
14601 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
14602 latest sources from Michael.
14603
76514394
AD
146042002-03-04 Akim Demaille <akim@epita.fr>
14605
14606 * src/output.c (output): Don't free the grammar.
14607 * src/reader.c (grammar_free): New.
14608 * src/main.c (main): Call it and don't free symtab here.
14609
55024580
AD
146102002-03-04 Akim Demaille <akim@epita.fr>
14611
14612 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
14613 before returning.
14614 Reported by Benoit Perrot.
14615
f9abaa2c
AD
146162002-03-04 Akim Demaille <akim@epita.fr>
14617
14618 Use bitset operations when possible, not loops over bits.
14619
14620 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
14621 bitset_or.
14622 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
14623 * src/reduce.c (useless_nonterminals): Formatting changes.
14624 * src/warshall.c (TC): Use bitset_or.
14625
0e721e75
AD
146262002-03-04 Akim Demaille <akim@epita.fr>
14627
14628 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
14629 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
14630 Ditto.
14631
0fb1ffb1
AD
146322002-03-04 Akim Demaille <akim@epita.fr>
14633
14634 * src/lalr.c (F): Now a bitset*.
14635 Adjust all dependencies.
14636
b86796bf
AD
146372002-03-04 Akim Demaille <akim@epita.fr>
14638
14639 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
14640 Adjust all dependencies.
14641
602bbf31
AD
146422002-03-04 Akim Demaille <akim@epita.fr>
14643
14644 * src/L0.c, src/LR0.h (nstates): Be size_t.
14645 Adjust comparisons (signed vs unsigned).
14646 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
14647 bitset*.
14648 Adjust all dependencies.
14649
d8a0245c
AD
146502002-03-04 Akim Demaille <akim@epita.fr>
14651
14652 * src/closure.c (firsts): Now, also a bitset.
14653 Adjust all dependencies.
14654 (varsetsize): Remove, now unused.
14655 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
14656
34ba9743
AD
146572002-03-04 Akim Demaille <akim@epita.fr>
14658
14659 * src/print.c: Convert to use bitset.h, not hand coded iterations
14660 over ints.
14661
ed86e78c
AD
146622002-03-04 Akim Demaille <akim@epita.fr>
14663
14664 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
14665
dfdb1797
AD
146662002-03-04 Akim Demaille <akim@epita.fr>
14667
14668 * src/closure.c (ruleset): Be a bitset.
14669 (rulesetsize): Remove.
14670
7086e707
AD
146712002-03-04 Akim Demaille <akim@epita.fr>
14672
14673 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14674 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
14675 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
14676 * src/closure.c (fderives): Be an array of bitsets.
14677
98254360
RA
146782002-02-28 Robert Anisko <robert@lrde.epita.fr>
14679
14680 * data/bison.c++: Merge the two generated headers. Insert a copyright
14681 notice in each output file.
14682
a75c057f
AD
146832002-02-28 Akim Demaille <akim@epita.fr>
14684
14685 * data/bison.c++: Copy the prologue of bison.simple to fetch
14686 useful M4 definitions, such as b4_header_guard.
14687
06b00abc
AD
146882002-02-25 Akim Demaille <akim@epita.fr>
14689
14690 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
14691 translator friendly scheme for the bgr
14692 copyright notice.
06b00abc 14693
70e7d534
AD
146942002-02-25 Akim Demaille <akim@epita.fr>
14695
14696 * src/output.c (header_output): Remove, now handled completely via
14697 M4.
14698
abe017f6
AD
146992002-02-25 Akim Demaille <akim@epita.fr>
14700
14701 * m4/m4.m4: New, from CVS Autoconf.
14702 * configure.in: Invoke it.
14703 * src/output.c (output_skeleton): Use its result instead of the
14704 hard coded name.
14705
381fb12e
AD
147062002-02-25 Akim Demaille <akim@epita.fr>
14707
14708 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
14709 Fileutils 4.1.5.
14710 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
14711 * src/output.c (output_skeleton): Use mkstemp to create a real
14712 temporary file.
14713 Move the filling of `skeleton' and its muscle to...
14714 (prepare): here.
14715 (output): Move the definition of the prologue muscle to...
14716 (prepare): here.
14717 * src/system.h (DEFAULT_TMPDIR): New.
14718
6f38107f
PE
147192002-02-14 Paul Eggert <eggert@twinsun.com>
14720
14721 Remove the support for C++ namespace cleanliness; it was
14722 causing more problems than it was curing, since it didn't work
14723 properly on some nonstandard C++ compilers. This can wait
14724 for a proper C++ parser.
14725
14726 * NEWS: Document this.
14727 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
14728 of C++, as it's treated like C now.
14729 * src/bison.simple (YYSTD): Remove.
14730 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
14731 Treat C++ just like Standard C instead of trying to support
14732 namespace cleanliness.
14733
80cce3da
AD
147342002-02-14 Akim Demaille <akim@epita.fr>
14735
14736 * tests/regression.at (else): Adjust to Andreas' change.
14737
842e8679
AD
147382002-02-14 Akim Demaille <akim@epita.fr>
14739
14740 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
14741
4bda3f10
AD
147422002-02-13 Andreas Schwab <schwab@suse.de>
14743
14744 * src/output.c (output_rule_data): Don't output NULL, it might
14745 not be defined yet.
14746
4162fa07 147472002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 14748
4162fa07
RA
14749 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
14750 (Copyright notice): Update.
b418ecd8 14751
bd16a5dc
AD
147522002-02-11 Akim Demaille <akim@epita.fr>
14753
14754 * tests/regression.at (%nonassoc and eof): Don't include
14755 nonportable headers.
14756
8d69a1a3
RA
147572002-02-08 Robert Anisko <robert@lrde.epita.fr>
14758
14759 * data/bison.c++: Correct error recovery. Make the user able to
14760 initialize the starting location.
14761
9b2d0677
AD
147622002-02-07 Akim Demaille <akim@epita.fr>
14763
14764 * tests/input.at: New.
14765
69e2658b
RA
147662002-02-07 Robert Anisko <robert@lrde.epita.fr>
14767
14768 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 14769 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
14770 directives around tables only needed for debugging.
14771
4aacc3a7
RA
147722002-02-07 Robert Anisko <robert@lrde.epita.fr>
14773
14774 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
14775 C++ parsers.
14776 (yy::b4_name::parse): Use print_.
14777
762a801e
RA
147782002-02-07 Robert Anisko <robert@lrde.epita.fr>
14779
14780 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
14781
4bb2bc3f
RA
147822002-02-07 Robert Anisko <robert@lrde.epita.fr>
14783
14784 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
14785 C++ parsers.
14786 (yy::b4_name::parse): Build verbose error messages, and use error_.
14787
6b45a3ca
RA
147882002-02-06 Robert Anisko <robert@lrde.epita.fr>
14789
14790 * data/bison.c++: Fix m4 quoting in comments.
14791
50997c6e
RA
147922002-02-06 Robert Anisko <robert@lrde.epita.fr>
14793
14794 * data/bison.c++: Adjust the parser code. Fix some muscles that were
14795 not expanded by m4.
14796
3f3eed27
AD
147972002-02-05 Akim Demaille <akim@epita.fr>
14798
14799 * data/bison.c++: Adjust to the M4 back end.
14800 More is certainly needed.
14801
be2a1a68
AD
148022002-02-05 Akim Demaille <akim@epita.fr>
14803
14804 Give a try to M4 as a back end.
14805
14806 * lib/readpipe.c: New, from wdiff.
14807 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
14808 BISON_HAIRY.
14809 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
14810 specific values. Now it is m4 that performs the lookup.
14811 * src/parse-skel.y: Remove.
14812 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
14813 * src/output.c (actions_output, guards_output)
14814 (token_definitions_output): No longer keeps track of the output
14815 line number, hence remove the second argument.
14816 (guards_output): Check against the guard member of a rule, not the
14817 action member.
14818 Adjust callers.
14819 (output_skeleton): Don't look for the skeleton location, let m4 do
14820 that.
14821 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
14822 file will be used.
14823 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
14824 (prepare): Given that for the time being changesyntax is not
14825 usable in M4, rename the muscles using `-' to `_'.
14826 Define `defines_flag', `output_parser_name' and `output_header_name'.
14827 * src/output.h (actions_output, guards_output)
14828 (token_definitions_output): Adjust prototypes.
14829 * src/scan-skel.l: Instead of scanning the skeletons, it now
14830 processes the output of m4: `__oline__' and `#output'.
14831 * data/bison.simple: Adjust to be used by M4(sugar).
14832 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
14833 to date.
14834 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
14835 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
14836 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
14837 shamelessly stolen from CVS Autoconf.
14838
beda758b
AD
148392002-02-05 Akim Demaille <akim@epita.fr>
14840
14841 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
14842 * configure.in: Check for the declarations of free and malloc.
14843 * src/muscle_tab.c: Adjust.
14844
5ece6d43
AD
148452002-02-05 Akim Demaille <akim@epita.fr>
14846
14847 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
14848 which have no values.
14849
5bb18f9a
AD
148502002-02-05 Akim Demaille <akim@epita.fr>
14851
14852 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
14853 * data/: here.
14854
894dd62e
PE
148552002-01-29 Paul Eggert <eggert@twinsun.com>
14856
14857 * src/bison.simple (YYSIZE_T): Do not define merely because
14858 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
14859 On some platforms, <alloca.h> does not declare YYSTD (size_t).
14860
82841af7
AD
148612002-01-27 Akim Demaille <akim@epita.fr>
14862
14863 Fix `%nonassoc and eof'.
14864
14865 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
14866 which were not properly copied! Replace
14867 memcpy (res->errs, src->errs, src->nerrs);
14868 with
14869 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
14870 !!!
14871 * tests/regression.at (%nonassoc and eof): Adjust to newest
14872 Autotest: `.' is not in the PATH.
14873
318b76e9
AD
148742002-01-27 Akim Demaille <akim@epita.fr>
14875
14876 * tests/sets.at (AT_EXTRACT_SETS): New.
14877 (Nullable): Use it.
14878 (Firsts): New.
14879
30d2f3d5
AD
148802002-01-26 Akim Demaille <akim@epita.fr>
14881
14882 * tests/actions.at, tests/calc.at, tests/headers.at,
14883 * tests/torture.at: Adjust to the newest Autotest which no longer
14884 forces `.' in the PATH.
14885
30f8c395
AD
148862002-01-25 Akim Demaille <akim@epita.fr>
14887
14888 * tests/regression.at (%nonassoc and eof): New.
14889 Suggested by Robert Anisko.
14890
29ae55f1
AD
148912002-01-24 Akim Demaille <akim@epita.fr>
14892
14893 Bison dumps core when trying to complain about broken input files.
14894 Reported by Cris van Pelt.
14895
14896 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
14897 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
14898 into...
14899 (Invalid inputs): Strengthen: exercise parse_percent_token.
14900
2b548aa6
RA
149012002-01-24 Robert Anisko <robert.anisko@epita.fr>
14902
14903 * src/Makefile.am: Add bison.c++.
14904 * src/bison.c++: New skeleton.
14905
bb0146c2
AD
149062002-01-21 Paolo Bonzini <bonzini@gnu.org>
14907
14908 * po/it.po: New.
14909
bec30531
AD
149102002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
14911
14912 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
14913
fc6edc45
MA
149142002-01-20 Marc Autret <marc@gnu.org>
14915
14916 * src/files.c (compute_output_file_names): Fix
14917
5e5d5415
MA
149182002-01-20 Marc Autret <marc@gnu.org>
14919
14920 * tests/output.at: New test.
14921 * src/files.c (compute_base_names): Don't map extensions when
14922 the YACC flag is set, use defaults.
14923 Reported by Evgeny Stambulchik.
14924
44ea3fbd
MA
149252002-01-20 Marc Autret <marc@gnu.org>
14926
ba0fe3c7
PE
14927 * src/system.h: Need to define __attribute__ away for non-GCC
14928 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
14929 Suggested by Albert Chin-A-Young.
14930
338963d1
TVH
149312002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
14932
14933 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
14934 canonical definition.
14935 * src/system.h: Use the canonical definition for PARAMS (avoids
14936 a conflict with the macro from lib/hash.h).
14937
c57b2479
AD
149382002-01-11 Akim Demaille <akim@epita.fr>
14939
14940 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 14941 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 14942
b85810ae
AD
149432002-01-09 Akim Demaille <akim@epita.fr>
14944
14945 * src/files.c, src/files.h (output_infix): New.
14946 (tab_extension): Remove.
14947 (compute_base_names): Compute the former, drop the latter.
14948 * src/output.c (prepare): Insert the muscles `output-infix', and
14949 `output-suffix'.
14950 * src/parse-skel.y (string, string.1): New.
14951 (section.header): Use it.
14952 (section.yacc): Remove.
14953 (prefix): Remove too.
14954 * src/scan-skel.l: Adjust.
14955 * src/bison.simple, src/bison.hairy: Adjust.
14956
cae60122
AD
149572002-01-09 Akim Demaille <akim@epita.fr>
14958
14959 * configure.in (WERROR_CFLAGS): Compute it.
14960 * src/Makefile.am (CFLAGS): Pass it.
14961 * tests/atlocal.in (CFLAGS): Idem.
14962 * src/files.c: Fix a few warnings.
14963 (get_extension_index): Remove, unused.
14964
ae404801
AD
149652002-01-08 Akim Demaille <akim@epita.fr>
14966
14967 * src/getargs.c (AS_FILE_NAME): New.
14968 (getargs): Use it to convert DOSish file names.
14969 * src/files.c (base_name): Rename as full_base_name to avoid
14970 clashes with `base_name ()'.
14971 (filename_split): New.
14972 (compute_base_names): N-th rewrite, using filename_split.
14973
22312b71
AD
149742002-01-08 Akim Demaille <akim@epita.fr>
14975
14976 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
14977 New, stolen from the Fileutils 4.1.
14978 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14979 * configure.in: Check for the presence of memrchr, and of its
14980 prototype.
14981
a67cef01
TVH
149822002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
14983
14984 * lib/hash.h (__P): Added definition for this macro.
14985 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
14986 BUILT_SOURCES, to ensure they are generated first.
14987 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
14988 %error-verbose to allow bootstrapping with bison 1.30x.
14989
2b25d624
AD
149902002-01-06 Akim Demaille <akim@epita.fr>
14991
14992 * src/reader.c (parse_braces): Don't fetch the next char, the
14993 convention is to fetch on entry.
14994 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
14995 'switch' without a following semicolon.
14996 * tests/regression.at (braces parsing): New.
14997
3460813b
AD
149982002-01-06 Akim Demaille <akim@epita.fr>
14999
15000 Bison is dead wrong in its RR conflict reports.
15001
15002 * tests/torture.at (GNU Cim Grammar): New.
15003 * src/conflicts.c (count_rr_conflicts): Fix.
15004
73784c64
AD
150052002-01-06 Akim Demaille <akim@epita.fr>
15006
15007 Creating package.m4 from configure.ac causes too many problems.
15008
15009 * tests/Makefile.am (package.m4): Create it by hand,
15010 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
15011
25d81090
AD
150122002-01-06 Akim Demaille <akim@epita.fr>
15013
15014 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
15015 skeleton.h.
15016
a9b8959e
PE
150172002-01-04 Paul Eggert <eggert@twinsun.com>
15018
15019 * doc/bison.texinfo (Debugging):
15020 Remove YYSTDERR; it's no longer defined or used.
15021 Also, s/cstdio.h/cstdio/.
15022
25d81090
AD
150232002-01-03 Akim Demaille <akim@epita.fr>
15024
15025 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
15026
1109455c
AD
150272002-01-03 Akim Demaille <akim@epita.fr>
15028
15029 * src/parse-skel.y (process_skeleton): Don't bind the parser's
15030 tracing code to --trace, wait for a better --trace option, with
15031 args.
15032
7ea5e977
AD
150332002-01-03 Akim Demaille <akim@epita.fr>
15034
15035 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
15036 The ISO C++ standard is extremely clear about it: stderr is
15037 considered a macro, not a regular symbol (see table 94 `Header
15038 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
15039 Therefore std:: does not apply to it. It still does with fprintf.
15040 Also, s/cstdio.h/cstdio/.
15041
fab5b110
AD
150422002-01-03 Akim Demaille <akim@epita.fr>
15043
15044 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
15045 for non system headers.
15046
aed7fd9b
AD
150472002-01-02 Akim Demaille <akim@epita.fr>
15048
15049 Equip the skeleton chain with location tracking, runtime trace,
15050 pure parser and scanner.
15051
15052 * src/parse-skel.y: Request a pure parser, locations, and prefix
15053 renaming.
15054 (%union): Having several members with the same type does not help
15055 type mismatches, simplify.
15056 (YYPRINT, yyprint): New.
15057 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
15058 (skel_error): this.
15059 Handle locations.
15060 * src/scan-skel.l: Adjust to these changes.
15061 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
15062 (LOCATION_PRINT, skel_control_t): New.
15063
24fad99e
AD
150642001-12-30 Akim Demaille <akim@epita.fr>
15065
15066 * src/parse-skel.y: Get rid of the shift/reduce conflict:
15067 replace `gb' with BLANKS.
15068 * src/scan-skel.l: Adjust.
15069
a4b36db4
AD
150702001-12-30 Akim Demaille <akim@epita.fr>
15071
15072 * src/system.h: We don't need nor want bcopy.
15073 Throw away MS-DOS crap: we don't need getpid.
15074 * configure.in: We don't need strndup. It was even causing
15075 problems: because Flex includes the headers *before* us,
15076 _GNU_SOURCE is not defined by config.h, and therefore strndup was
15077 not visible.
15078 * lib/xstrndup.c: New.
15079 * src/scan-skel.l: Use it.
15080 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
15081 * src/parse-skel.y: Use %directives instead of #defines.
15082
1239777d
AD
150832001-12-30 Akim Demaille <akim@epita.fr>
15084
15085 * src/skeleton.h: New.
15086 * src/output.c (output_parser, output_master_parser): Remove, dead
15087 code.
15088 * src/output.h (get_lines_number, actions_output, guards_output)
15089 (token_definitions_output): Prototype them.
15090 * src/parse-skel.y: Add the license notice.
15091 Include output.h and skeleton.h.
15092 (process_skeleton): Returns void, and takes a single parameter.
15093 * src/scan-skel.l: Add the license notice.
15094 Include skeleton.h.
15095 Don't use %option yylineno: it seems that then Flex imagines
15096 REJECT has been used, and therefore it won't reallocate its
15097 buffers (which makes no other sense to me than a bug). It results
15098 in warnings for `unused: yy_flex_realloc'.
15099
9b3add5b
RA
151002001-12-30 Robert Anisko <robert.anisko@epita.fr>
15101
15102 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15103 (MUSCLE_INSERT_PREFIX): ...to there.
15104 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15105 (MUSCLE_INSERT_PREFIX): Move from here...
15106
15107 * src/bison.hairy: Add a section directive. Put braces around muscle
15108 names. This parser skeleton is still broken, but Bison should not
15109 choke on a bad muscle 'syntax'.
15110 * src/bison.simple: Add a section directive. Put braces around muscle
15111 names.
15112
15113 * src/files.h (strsuffix, stringappend): Add declarations.
15114 (tab_extension): Add declaration.
15115 (short_base_name): Add declaration.
15116
15117 * src/files.c (strsuffix, stringappend): No longer static. These
15118 functions are used in the skeleton parser.
15119 (tab_extension): New.
15120 (compute_base_names): Use the computations done in this function
fab5b110 15121 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
15122 names.
15123 (short_base_name): No longer static.
15124
15125 * src/output.c (output_skeleton): New.
15126 (output): Disable call to output_master_parser, and give a try to
15127 a new skeleton handling system.
15128 (guards_output, actions_output): No longer static.
15129 (token_definitions_output, get_lines_number): No longer static.
15130
15131 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
15132
fab5b110 15133 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
15134 parse-skel.y.
15135
15136 * src/parse-skel.y: New file.
15137 * src/scan-skel.l: New file.
15138
b5b61c61
AD
151392001-12-29 Akim Demaille <akim@epita.fr>
15140
15141 %name-prefix is broken.
15142
15143 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
15144 Adjust all dependencies.
15145 * tests/headers.at (export YYLTYPE): Strengthen this test: use
15146 %name-prefix.
15147
15148 Renaming yylval but not yylloc is not consistent. Now we do.
15149
15150 * src/bison.simple: Prefix yylloc if used.
15151 * doc/bison.texinfo (Decl Summary): Document that.
15152
8c9a50be
AD
151532001-12-29 Akim Demaille <akim@epita.fr>
15154
15155 * doc/bison.texinfo: Promote `%long-directive' over
15156 `%long_directive'.
15157 Remove all references to fixed-output-files, yacc is enough.
15158
d99361e6
AD
151592001-12-29 Akim Demaille <akim@epita.fr>
15160
15161 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
15162 user prologue. These are defaults.
15163 * tests/actions.at (Mid-rule actions): Make sure the user can
15164 define YYDEBUG and YYERROR_VERBOSE.
15165
b9cecb91
AD
151662001-12-29 Akim Demaille <akim@epita.fr>
15167
15168 * src/output.c (header_output): Don't forget to export YYLTYPE and
15169 yylloc.
15170 * tests/headers.at (export YYLTYPE): New, make sure it does.
15171 * tests/regression.at (%union and --defines, Invalid CPP headers):
15172 Move to...
15173 * tests/headers.at: here.
15174
aea13e97
AD
151752001-12-29 Akim Demaille <akim@epita.fr>
15176
15177 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
15178
931394cb
AD
151792001-12-29 Akim Demaille <akim@epita.fr>
15180
15181 * tests/actions.at (Mid-rule actions): Output on a single line
15182 instead of several.
15183
704a47c4
AD
151842001-12-29 Akim Demaille <akim@epita.fr>
15185
15186 * doc/bison.texinfo: Formatting changes.
15187
091e20bb
AD
151882001-12-29 Akim Demaille <akim@epita.fr>
15189
15190 Don't store the token defs in a muscle, just be ready to output it
15191 on command. Now possible via `symbols'. Fixes a memory leak.
15192
15193 * src/output.c (token_definitions_output): New.
15194 (output_parser, header_output): Use it.
15195 * src/reader.c (symbols_save): Remove.
15196
cce71710
AD
151972001-12-29 Akim Demaille <akim@epita.fr>
15198
15199 * src/bison.simple: Do not provide a default for YYSTYPE and
15200 YYLTYPE before the user's prologue. Otherwise it's hardly... a
15201 default.
15202
82c035a8
AD
152032001-12-29 Akim Demaille <akim@epita.fr>
15204
15205 Mid-rule actions are simply... ignored!
15206
15207 * src/reader.c (readgram): Be sure to attach mid-rule actions to
15208 the empty-rule associated to the dummy symbol, not to the host
15209 rule.
15210 * tests/actions.at (Mid-rule actions): New.
15211
8419d367
AD
152122001-12-29 Akim Demaille <akim@epita.fr>
15213
15214 Memory leak.
15215
15216 * src/reader.c (reader): Free grammar.
15217
375d5806
AD
152182001-12-29 Akim Demaille <akim@epita.fr>
15219
15220 Memory leak.
15221
15222 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
15223 since it allocates it for each state, although only one is needed.
15224 (allocate_storage): Do it here.
15225
f51cb8ff
AD
152262001-12-29 Akim Demaille <akim@epita.fr>
15227
15228 * src/options.h, src/options.c (create_long_option_table): Rename
15229 as...
15230 (long_option_table_new): this, with a clearer prototype.
15231 (percent_table): Remove, unused,
15232 * src/getargs.c (getargs): Adjust.
15233
29e88316
AD
152342001-12-29 Akim Demaille <akim@epita.fr>
15235
15236 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
15237 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
15238 as states.
15239
b9f71f19
AD
152402001-12-29 Akim Demaille <akim@epita.fr>
15241
15242 * src/lalr.c (build_relations): Rename `states' as `states1'.
15243 Sorry, I don't understand exactly what it is, no better name...
15244
1a2b5d37
AD
152452001-12-29 Akim Demaille <akim@epita.fr>
15246
15247 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
15248 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
15249 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
15250 as rules.
15251
1cca533e
AD
152522001-12-29 Akim Demaille <akim@epita.fr>
15253
15254 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
15255 ago.
15256
c03ae966
AD
152572001-12-29 Akim Demaille <akim@epita.fr>
15258
15259 * src/reader.c, src/reader.h (user_toknums): Remove.
15260 Adjust all users to use symbols[i]->user_token_number.
15261
5a670b1e
AD
152622001-12-29 Akim Demaille <akim@epita.fr>
15263
15264 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
15265 Adjust all users to use symbols[i]->prec or ->assoc.
15266
ad949da9
AD
152672001-12-29 Akim Demaille <akim@epita.fr>
15268
15269 * src/reader.c, src/reader.h (tags): Remove.
15270 Adjust all users to use symbols[i]->tag.
15271
0e78e603
AD
152722001-12-29 Akim Demaille <akim@epita.fr>
15273
15274 * src/gram.h, src/gram.c (symbols): New, similar to state_table
15275 and rule_table.
15276 * src/reader.c (packsymbols): Fill this table.
15277 Drop sprec.
15278 * src/conflicts.c (resolve_sr_conflict): Adjust.
15279 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
15280 single table.
15281 Use symbols[i]->tag instead of tags[i].
15282
213e640e
AD
152832001-12-29 Akim Demaille <akim@epita.fr>
15284
15285 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
15286 In addition, put a comment in there, to replace...
15287 * tests/regression.at (%union and C comments): Remove.
15288
e7b8bef1
AD
152892001-12-29 Akim Demaille <akim@epita.fr>
15290
15291 * tests/regression.at (Web2c Actions): Blindly move the actual
15292 output as expected output. The contents *seem* right to me, but I
15293 can't pretend reading perfectly parser tables... Nonetheless, all
15294 the other tests pass correctly, the table look OK, even though the
15295 presence of `$axiom' is to be noted: AFAICS it is useless (but
15296 harmless).
15297
b68e7744
AD
152982001-12-29 Akim Demaille <akim@epita.fr>
15299
15300 * src/reader.c (readgram): Don't add the rule 0 if there were no
15301 rules read. In other words, add it _after_ having performed
15302 grammar sanity checks.
15303 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
15304
78d5bae9
AD
153052001-12-29 Akim Demaille <akim@epita.fr>
15306
15307 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
15308 visible, and some states have now a different number.
15309
ff442794
AD
153102001-12-29 Akim Demaille <akim@epita.fr>
15311
15312 * src/reader.c (readgram): Bind the initial rule's lineno to that
15313 of the first rule.
15314 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
15315 (Solved SR Conflicts): Adjust rule 0's line number.
15316
610ab194
AD
153172001-12-29 Akim Demaille <akim@epita.fr>
15318
15319 Fix the `GAWK Grammar' failure.
15320
15321 * src/LR0.c (final_state): Initialize to -1 so that we do compute
15322 the reductions of the first state which was mistakenly confused
15323 with the final state because precisely final_state was initialized
15324 to 0.
15325 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
15326 now noticed by Bison.
15327 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
15328 have a reduction on $default.
15329
29d29c8f
AD
153302001-12-29 Akim Demaille <akim@epita.fr>
15331
15332 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
15333 rule line numbers.
15334 * src/closure.c (print_closure): Likewise.
15335 * src/derives.c (print_derives): Likewise.
15336 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
15337 now.
15338
7c6b64d0
AD
153392001-12-29 Akim Demaille <akim@epita.fr>
15340
15341 * src/lalr.c (lookaheads_print): New.
15342 (lalr): Call it when --trace-flag.
15343 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
15344 are dumped.
15345
3d4daee3
AD
153462001-12-29 Akim Demaille <akim@epita.fr>
15347
15348 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
15349 when walking through ritem, even via rule->rhs.
15350 * src/reduce.c (dump_grammar, useful_production, reduce_output)
15351 (useful_production, useless_nonterminals): Likewise.
15352 (reduce_grammar_tables): Likewise, plus update nritems.
15353 * src/nullable.c (set_nullable): Likewise.
15354 * src/lalr.c (build_relations): Likewise.
15355 * tests/sets.at (Nullable): Adjust.
15356 Fortunately, now, the $axiom is no longer nullable.
15357
9e7f6bbd
AD
153582001-12-29 Akim Demaille <akim@epita.fr>
15359
15360 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
15361 the 0-sentinel.
15362 * src/gram.c (ritem_longest_rhs): Likewise.
15363 * src/reduce.c (nonterminals_reduce): Likewise.
15364 * src/print_graph.c (print_graph): Likewise.
15365 * src/output.c (output_rule_data): Likewise.
15366 * src/nullable.c (set_nullable): Likewise.
15367
255ef638
AD
153682001-12-29 Akim Demaille <akim@epita.fr>
15369
15370 * src/output.c: Comment changes.
15371
0d8a7363
AD
153722001-12-27 Paul Eggert <eggert@twinsun.com>
15373
15374 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
15375 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
15376 Sparc, as they were causing more porting problems than the
15377 (minor) performance improvement was worth.
15378
15379 Also, catch up with 1.31's YYSTD.
15380
3db472b9
AD
153812001-12-27 Akim Demaille <akim@epita.fr>
15382
15383 * src/output.c (output_gram): Rely on nritems, not the
15384 0-sentinel. See below.
15385 Use -1 as separator, not 0.
15386 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
15387 Rely on -1 as separator in yyrhs, instead of 0.
15388 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
15389 twice `Now at end of input', therefore there are two lines less to
15390 expect.
15391
b365aa05
AD
153922001-12-27 Akim Demaille <akim@epita.fr>
15393
15394 * tests/regression.at (Unresolved SR Conflicts):
15395 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
15396 below.
15397
30171f79
AD
153982001-12-27 Akim Demaille <akim@epita.fr>
15399
15400 * src/LR0.c (new_state): Recognize the final state by the fact it
15401 is reached by eoftoken.
15402 (insert_start_shifting_state, insert_eof_shifting_state)
15403 (insert_accepting_state, augment_automaton): Remove, since now
15404 these states are automatically computed from the initial state.
15405 (generate_states): Adjust.
15406 * src/print.c: When reporting a rule number to the user, substract
15407 1, so that the axiom rule is rule 0, and the first user rule is 1.
15408 * src/reduce.c: Likewise.
15409 * src/print_graph.c (print_core): For the time being, just as for
15410 the report, depend upon --trace-flags to dump the full set of
15411 items.
15412 * src/reader.c (readgram): Once the grammar read, insert the rule
15413 0: `$axiom: START-SYMBOL $'.
15414 * tests/set.at: Adjust: rule 0 is now displayed, and since the
15415 number of the states has changed (the final state is no longer
15416 necessarily the last), catch up.
15417
75142d45
AD
154182001-12-27 Akim Demaille <akim@epita.fr>
15419
15420 Try to make the use of the eoftoken valid. Given that its value
15421 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
15422 is used instead of > 0 where appropriate, (ii), depend upon nritems
15423 instead of the 0-sentinel.
15424
15425 * src/gram.h, src/gram.c (nritems): New.
15426 Expected to be duplication of nitems, but for the time being...
15427 * src/reader.c (packgram): Assert nritems and nitems are equal.
15428 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
15429 * src/closure.c (print_closure, print_fderives): Likewise.
15430 * src/gram.c (ritem_print): Likewise.
15431 * src/print.c (print_core, print_grammar): Likewise.
15432 * src/print_graph.c: Likewise.
15433
b7c49edf
AD
154342001-12-27 Akim Demaille <akim@epita.fr>
15435
15436 * src/main.c (main): If there are complains after grammar
15437 reductions, then output the report anyway if requested, then die.
15438 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
15439 * src/reader.c (eoftoken): New.
15440 (parse_token_decl): If the token being defined has value `0', it
15441 is the eoftoken.
15442 (packsymbols): No longer hack `tags' to insert `$' by hand.
15443 Be sure to preserve the value of the eoftoken.
15444 (reader): Make sure eoftoken is defined.
15445 Initialize nsyms to 0: now eoftoken is created just like the others.
15446 * src/print.c (print_grammar): Don't special case the eof token.
15447 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
15448 lie anyway, albeit pleasant.
15449 * tests/calc.at: Exercise error messages with eoftoken.
15450 Change the grammar so that empty input is invalid.
15451 Adjust expectations.
15452 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
15453
ec2da99f
AD
154542001-12-27 Akim Demaille <akim@epita.fr>
15455
15456 * configure.in: Check the protos of strchr ans strspn.
15457 Replace strchr if needed.
15458 * src/system.h: Provide the protos of strchr, strspn and memchr if
15459 missing.
15460 * lib/strchr.c: New.
15461 * src/reader.c (symbols_save): Use strchr.
15462
8adfa272
AD
154632001-12-27 Akim Demaille <akim@epita.fr>
15464
15465 * src/print.c, src/print_graph.c (escape): New.
15466 Use it to quote the TAGS outputs.
15467 * src/print_graph.c (print_state): Now errors are in red, and
15468 reductions in green.
15469 Prefer high to wide: output the state number on a line of its own.
15470
80dac38c
AD
154712001-12-27 Akim Demaille <akim@epita.fr>
15472
15473 * src/state.h, src/state.c (reductions_new): New.
15474 * src/LR0.c (set_state_table): Let all the states have a
15475 `reductions', even if reduced to 0.
15476 (save_reductions): Adjust.
15477 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
15478 * src/print.c (print_reductions, print_actions): Adjust.
15479 * src/output.c (action_row): Adjust.
15480
2cec70b9
AD
154812001-12-27 Akim Demaille <akim@epita.fr>
15482
15483 * src/state.h, src/state.c (errs_new, errs_dup): New.
15484 * src/LR0.c (set_state_table): Let all the states have an errs,
15485 even if reduced to 0.
15486 * src/print.c (print_errs, print_reductions): Adjust.
15487 * src/output.c (output_actions, action_row): Adjust.
15488 * src/conflicts.c (resolve_sr_conflict): Adjust.
15489
13ca549a
AD
154902001-12-27 Akim Demaille <akim@epita.fr>
15491
15492 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
15493
5092aba5
AD
154942001-12-27 Akim Demaille <akim@epita.fr>
15495
15496 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
15497 * src/print.c: here.
15498 (lookaheadset, shiftset): New, used as additional storage by
15499 print_reductions.
15500 (print_results): Adjust.
15501 (print_shifts, print_gotos, print_errs): New, extracted from...
15502 (print_actions): here.
15503 * src/print_graph.c (print_actions): Remove dead code.
15504
11e2beca
AD
155052001-12-27 Akim Demaille <akim@epita.fr>
15506
15507 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
15508 `$n' and `@n'.
15509
dac3c910
AD
155102001-12-27 Akim Demaille <akim@epita.fr>
15511
15512 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
15513 (build_relations): Adjust.
15514
d0b0fefa
AD
155152001-12-27 Akim Demaille <akim@epita.fr>
15516
15517 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
15518 duplication.
15519
adc8c848
AD
155202001-12-27 Akim Demaille <akim@epita.fr>
15521
15522 * src/reader.c (packgram): Catch nitems overflows.
15523
14d293ac
AD
155242001-12-27 Akim Demaille <akim@epita.fr>
15525
15526 * src/files.c, src/files.h (guard_obstack): Remove.
15527 * src/output.c (output): Adjust.
15528 * src/reader.c (parse_braces): New, factoring...
15529 (copy_action, copy_guard): these two which are renamed as...
15530 (parse_action, parse_guard): these.
15531 As a voluntary consequence, using braces around guards is now
15532 mandatory.
15533
f499b062
AD
155342001-12-27 Akim Demaille <akim@epita.fr>
15535
15536 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
15537 * src/reader.c (symbol_list): `guard' and `guard_line' are new
15538 members.
15539 (symbol_list_new): Adjust.
15540 (copy_action): action_line is the first line, not the last.
15541 (copy_guard): Just as for actions, store the `action' only, not
15542 the switch/case/break flesh.
15543 Don't parse the user action that might follow the guard, let...
15544 (readgram): do it, i.e., now, there can be an action after a
15545 guard.
15546 In other words the guard is just explicitly optional.
15547 (packgram): Adjust.
15548 * src/output.c (guards_output): New.
15549 (output_parser): Call it when needed.
15550 (output): Also free the guard and attrs obstacks.
15551 * src/files.c, src/files.h (obstack_save): Remove.
15552 (output_files): Remove.
15553 As a result, if one needs the former `.act' file, using an
15554 appropriate skeleton which requires actions and guards is now
15555 required.
15556 * src/main.c (main): Adjust.
15557 * tests/semantic.at: New.
15558 * tests/regression.at: Use `input.y' as input file name.
15559 Avoid 8+3 problems by requiring input.c when the test needs the
15560 parser.
15561
d945f5cd
AD
155622001-12-27 Akim Demaille <akim@epita.fr>
15563
15564 * src/reader.c (symbol_list_new): Be sure to initialize all the
15565 fields.
15566
d200e455
AD
155672001-12-27 Akim Demaille <akim@epita.fr>
15568
15569 All the hacks using a final pseudo state are now useless.
15570
15571 * src/LR0.c (set_state_table): state_table holds exactly nstates.
15572 * src/lalr.c (nLA): New.
15573 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
15574 instead of lookaheadsp from the pseudo state (nstate + 1).
15575
f9507c28
AD
155762001-12-27 Akim Demaille <akim@epita.fr>
15577
15578 * src/output.c (action_row, token_actions): Use a state_t instead
15579 of a integer, and nlookaheads instead of the following state's
15580 lookaheadsp.
15581
065fbd27
AD
155822001-12-27 Akim Demaille <akim@epita.fr>
15583
15584 * src/conflicts.c (log_resolution, flush_shift)
15585 (resolve_sr_conflict, set_conflicts, solve_conflicts)
15586 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
15587 (conflicts_print, print_reductions): Use a state_t instead of an
15588 integer when referring to a state.
15589 As much as possible, depend upon nlookaheads, instead of the
15590 `lookaheadsp' member of the following state (since lookaheads of
15591 successive states are successive, the difference between state n + 1
15592 and n served as the number of lookaheads for state n).
15593 * src/lalr.c (add_lookback_edge): Likewise.
15594 * src/print.c (print_core, print_actions, print_state)
15595 (print_results): Likewise.
15596 * src/print_graph.c (print_core, print_actions, print_state)
15597 (print_graph): Likewise.
15598 * src/conflicts.h: Adjust.
15599
1b177bd7
AD
156002001-12-27 Akim Demaille <akim@epita.fr>
15601
15602 * src/bison.hairy: Formatting/comment changes.
15603 ANSIfy.
15604 Remove `register' indications.
15605 Add plenty of `static'.
15606
7742ddeb
AD
156072001-12-27 Akim Demaille <akim@epita.fr>
15608
15609 * src/output.c (prepare): Drop the muscle `ntbase' which
15610 duplicates ntokens.
15611 * src/bison.simple: Formatting/comment changes.
15612 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
15613 is an undocumented synonym.
15614
1fa14068
AD
156152001-12-22 Akim Demaille <akim@epita.fr>
15616
15617 * src/output.c (output_table_data): Change the prototype to use
15618 `int' for array ranges: some invocations do pass an int, not a
15619 short.
15620 Reported by Wayne Green.
15621
b9752825
AD
156222001-12-22 Akim Demaille <akim@epita.fr>
15623
15624 Some actions of web2c.y are improperly triggered.
15625 Reported by Mike Castle.
15626
15627 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
15628 * tests/regression.at (Web2c): Rename as...
15629 (Web2c Report): this.
15630 (Web2c Actions): New.
15631
776209d6
AD
156322001-12-22 Akim Demaille <akim@epita.fr>
15633
15634 Reductions in web2c.y are improperly reported.
15635 Reported by Mike Castle.
15636
15637 * src/conflicts.c (print_reductions): Fix.
15638 * tests/regression.at (Web2c): New.
15639
275fc3ad
AD
156402001-12-18 Akim Demaille <akim@epita.fr>
15641
15642 Some host fail on `assert (!"foo")', which expands to
15643 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
15644 Reported by Nelson Beebee.
15645
15646 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
15647 `#define it_succeeded 0' and `assert (it_succeeded)'.
15648
897668ee
MA
156492001-12-17 Marc Autret <autret_m@epita.fr>
15650
15651 * src/bison.simple: Don't hard code the skeleton line and filename.
15652 * src/output.c (output_parser): Rename 'line' as 'output_line'.
15653 New line counter 'skeleton_line' (skeleton-line muscle).
15654
ab3399e0
PE
156552001-12-17 Paul Eggert <eggert@twinsun.com>
15656
15657 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
15658 YYDEBUG must be defined to a nonzero value.
15659
15660 * src/bison.simple (yytname): Do not assume that the user defines
15661 YYDEBUG to a properly parenthesized expression.
15662
3877f72b
AD
156632001-12-17 Akim Demaille <akim@epita.fr>
15664
15665 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
15666 nlookaheads is a new member.
15667 Adjust all users.
15668 * src/lalr.h (nlookaheads): Remove this orphan declaration.
15669 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
15670 state.
776209d6 15671
331dbc1b
AD
156722001-12-17 Akim Demaille <akim@epita.fr>
15673
15674 * src/files.h, src/files.c (open_files, close_files): Remove.
15675 * src/main.c (main): Don't open/close files, nor invoke lex_free,
15676 let...
15677 * src/reader.c (reader): Do it.
776209d6 15678
be750e4c
AD
156792001-12-17 Akim Demaille <akim@epita.fr>
15680
15681 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 15682
709ae8c6
AD
156832001-12-17 Akim Demaille <akim@epita.fr>
15684
15685 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
15686 (flush_reduce): New.
15687 (resolve_sr_conflict): Adjust.
776209d6 15688
f87685c3
AD
156892001-12-17 Akim Demaille <akim@epita.fr>
15690
15691 * src/output.c (output_obstack): Be static and rename as...
15692 (format_obstack): this, to avoid any confusion with files.c's
15693 output_obstack.
15694 * src/reader.h (muscle_obstack): Move to...
15695 * src/output.h: here, since it's defined in output.c.
15696
837491d8
AD
156972001-12-17 Akim Demaille <akim@epita.fr>
15698
15699 * src/output.c (action_row, save_column, default_goto)
15700 (sort_actions, matching_state, pack_vector): Better variable
15701 locality.
15702
796d61fb
AD
157032001-12-17 Akim Demaille <akim@epita.fr>
15704
15705 * src/output.c: Various formatting changes.
776209d6 15706
64d15509
AD
157072001-12-17 Akim Demaille <akim@epita.fr>
15708
15709 * src/files.c (output_files): Free the output_obstack.
15710 * src/main.c (main): Call print and print_graph conditionally.
15711 * src/print.c (print): Work unconditionally.
15712 * src/print_graph.c (print_graph): Work unconditionally.
15713 * src/conflicts.c (log_resolution): Output only if verbose_flag.
15714
fbc8ecb7
MA
157152001-12-16 Marc Autret <autret_m@epita.fr>
15716
15717 * src/output.c (actions_output): Fix. When we use %no-lines,
15718 there is one less line per action.
15719
f0440388
MA
157202001-12-16 Marc Autret <autret_m@epita.fr>
15721
15722 * src/bison.simple: Remove a useless #line directive.
15723 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
15724 * src/output.c (get_lines_number): New.
776209d6 15725 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
15726 output muscles.
15727 Fix line numbering.
15728 (actions_output): Computes the number of lines taken by actions.
15729 (output_master_parser): Insert new skeleton which is the name of
15730 the output parser file name.
15731
a79986b8
MA
157322001-12-15 Marc Autret <autret_m@epita.fr>
15733
15734 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
15735
4ec8e00f
MA
157362001-12-15 Marc Autret <autret_m@epita.fr>
15737
15738 * src/output.c (output_gram): Keep track of the hairy one.
15739
1a4648ff
AD
157402001-12-15 Akim Demaille <akim@epita.fr>
15741
15742 Make `make distcheck' work.
15743
15744 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
15745 system.h which uses libgettext.h.
15746
9c2c67e6
AD
157472001-12-15 Akim Demaille <akim@epita.fr>
15748
15749 * src/nullable.c (set_nullable): Useless rules must be skipped,
15750 otherwise, since we range over their symbols, we might look at a
15751 nonterminal which no longer ``exists'', i.e., it is not counted in
15752 `nvars', hence we overflow our arrays.
15753
93ede233
AD
157542001-12-15 Akim Demaille <akim@epita.fr>
15755
15756 The header can also be produced directly, without any obstack!
15757 Yahoo!
15758
15759 * src/files.c, src/files.h (defines_obstack): Remove.
15760 (compute_header_macro): Global.
15761 (defines_obstack_save): Remove.
15762 * src/reader.c (parse_union_decl): No longer output to
15763 defines_obstack: its content can be found in the `stype' muscle
15764 anyway.
15765 (output_token_translations): Merge into...
15766 (symbols_output): this.
15767 Rename as...
15768 (symbols_save): this.
15769 (reader): Adjust.
15770 * src/output.c (header_output): New.
15771 (output): Call it.
15772
2666f928
AD
157732001-12-15 Akim Demaille <akim@epita.fr>
15774
15775 * src/reader.c (parse_union_decl): Instead of handling two obstack
15776 simultaneously, use one to define the `stype' muscle, and use the
15777 value of the latter to fill defines_obstack.
15778 (copy_comment): Remove.
15779 (copy_comment2): Work for a single obstack.
15780 Rename as...
15781 (copy_comment): this.
15782
428046f8
AD
157832001-12-15 Akim Demaille <akim@epita.fr>
15784
15785 * src/lex.c, src/lex.h (xgetc): No longer static.
15786 * src/reader.c (parse_union_decl): Revamp.
15787
ea52d706
AD
157882001-12-15 Akim Demaille <akim@epita.fr>
15789
15790 Still making progress in separating Bison into (i) input, (ii)
15791 process, (iii) output: now we can directly output the parser file
15792 without using table_obstack at all.
15793
15794 * src/files.c, src/files.h (table_obstack): Bye bye.
15795 (parser_file_name): New.
15796 * src/files.c (compute_output_file_names): Compute it.
15797 * src/output.c (actions_output, output_parser)
15798 (output_master_parser): To a file instead of an obstack.
15799
3f96f4dc
AD
158002001-12-15 Akim Demaille <akim@epita.fr>
15801
15802 Attach actions to rules, instead of pre-outputting them to
15803 actions_obstack.
15804
15805 * src/gram.h (rule_t): action and action_line are new members.
15806 * src/reader.c (symbol_list): Likewise.
15807 (copy_action): Save the actions within the rule.
15808 (packgram): Save them in rule_table.
15809 * src/output.c (actions_output): New.
15810 (output_parser): Use it on `%%actions'.
15811 (output_rule_data): Don't free rule_table.
15812 (output): Do it.
15813 (prepare): Don't save the `action' muscle.
15814 * src/bison.simple: s/%%action/%%actions/.
15815
51576fb3
AD
158162001-12-15 Akim Demaille <akim@epita.fr>
15817
15818 * src/reader.c (copy_action): When --yacc, don't append a `;'
15819 to the user action: let it fail if lacking.
dee049eb 15820 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 15821
2648a72d
AD
158222001-12-14 Akim Demaille <akim@epita.fr>
15823
15824 * src/lex.c (literalchar): Simply return the char you decoded, non
15825 longer mess around with obstacks and int pointers.
15826 Adjust all callers.
15827
92790e5b
AD
158282001-12-14 Akim Demaille <akim@epita.fr>
15829
15830 * src/lex.c (literalchar): Don't escape the special characters,
15831 just decode them, and keep them as char (before, eol was output as
15832 the 2 char string `\n' etc.).
15833 * src/output.c (output_rule_data): Use quotearg to output the
15834 token strings.
15835
927c1557
PE
158362001-12-13 Paul Eggert <eggert@twinsun.com>
15837
15838 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
15839 Do not infringe on the global user namespace when using C++.
15840 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
15841 All uses of `fprintf' and `stderr' changed.
15842
15843 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
15844
ed8e1f68
AD
158452001-12-13 Akim Demaille <akim@epita.fr>
15846
15847 The computation of nullable is broken: it doesn't handle empty
15848 RHS's properly.
15849
15850 * tests/torture.at (GNU AWK Grammar): New.
15851 * tests/sets.at (Nullable): New.
15852 * src/nullable.c (set_nullable): Instead of blindly looping over
15853 `ritems', loop over the rules, and then over their rhs's.
15854
15855 Work around Autotest bugs.
15856
15857 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
15858 frame, because Autotest understand lines starting with a `+' as
15859 traces from the shell. Then, they are not processed properly.
15860 Admittedly an Autotest bug, but we don't have time to wait for
15861 Autotest to catch up.
15862 * tests/regression.at (Broken Closure): Adjust to the new table
15863 frames.
15864 Move to...
15865 * tests/sets.at: here.
15866
cb581495
AD
158672001-12-13 Akim Demaille <akim@epita.fr>
15868
15869 * src/closure.c (closure): Use nrules instead of playing tricks
15870 with BITS_PER_WORD.
15871
2e729273
AD
158722001-12-13 Akim Demaille <akim@epita.fr>
15873
15874 * src/print.c (print_actions): Output the handling of `$' as the
15875 traces do: shifting the token EOF. Before EOF was treated as a
15876 nonterminal.
15877 * tests/regression.at: Adjust some tests.
15878 * src/print_graph.c (print_core): Complete the set of items via
15879 closure. The next-to-final and final states are still unsatisfying,
15880 but that's to be addressed elsewhere.
15881 No longer output the rule numbers, but do output the state number.
15882 A single loop for the shifts + gotos is enough, but picked a
15883 distinct color for each.
15884 (print_graph): Initialize and finalize closure.
15885
107f7dfb
AD
158862001-12-13 Akim Demaille <akim@epita.fr>
15887
15888 * src/reader.c (readgram): Remove dead code, an strip useless
15889 braces.
15890 (get_type): Remove, unused.
15891
9b53a24f
AD
158922001-12-12 Akim Demaille <akim@epita.fr>
15893
15894 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
15895 on that of lib/error.c.
15896
dbfb6dcd
AD
158972001-12-12 Akim Demaille <akim@epita.fr>
15898
15899 Some hosts don't like `/' in includes.
15900
15901 * src/system.h: Include libgettext.h without qualifying the path.
15902 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
15903 $(top_srcdir).
15904
c25fb648
MA
159052001-12-11 Marc Autret <autret_m@epita.fr>
15906
15907 * src/output.c (output_parser): Remove useless muscle.
15908
710ddc4f
MA
159092001-12-11 Marc Autret <autret_m@epita.fr>
15910
15911 * src/bison.simple: Remove #line just before %%epilogue. It
15912 is now handled in ...
15913 * src/reader.c (read_additionnal_code): Add the output of a
15914 #line for the epilogue.
15915
e83d80b8
MA
159162001-12-10 Marc Autret <autret_m@epita.fr>
15917
927c1557 15918 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
15919 replace precedent remove.
15920 * src/bison.simple: Remove #line before %%prologue because
15921 %%input-line is wrong at this time.
15922
971d5158
MA
159232001-12-10 Marc Autret <autret_m@epita.fr>
15924
15925 * src/reader.c (symbols_output): Clean up.
927c1557 15926 * src/output.c (output_gram, output): Clean up.
971d5158 15927
5edafffd
AD
159282001-12-10 Akim Demaille <akim@epita.fr>
15929
15930 * src/lalr.c (initialize_lookaheads): New. Extracted from...
15931 * src/LR0.c (set_state_table): here.
15932 * src/lalr.c (lalr): Call it.
15933
0279f8e9
AD
159342001-12-10 Akim Demaille <akim@epita.fr>
15935
15936 * src/state.h (shifts): Remove the `number' member: shifts are
15937 attached to state, hence no longer need to be labelled with a
15938 state number.
15939
190c4f5f
AD
159402001-12-10 Akim Demaille <akim@epita.fr>
15941
15942 Now that states have a complete set of members, the linked list of
15943 shifts is useless: just fill directly the state's shifts member.
15944
15945 * src/state.h (shifts): Remove the `next' member.
15946 * src/LR0.c (first_state, last_state): Remove.
15947 Adjust the callers.
15948 (augment_automaton): Don't look for the shifts that must be added
15949 a shift on EOF: it is those of the state we looked for! But now,
15950 since shifts are attached, it is no longer needed to looking
15951 merely by its id: its number.
15952
2a73b93d
AD
159532001-12-10 Akim Demaille <akim@epita.fr>
15954
15955 * src/LR0.c (augment_automaton): Better variable locality.
15956 Remove an impossible branch: if there is a state corresponding to
15957 the start symbol being shifted, then there is shift for the start
15958 symbol from the initial state.
15959
74392f6a
AD
159602001-12-10 Akim Demaille <akim@epita.fr>
15961
15962 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
15963 only when appropriate: when insert_start_shifting_state' is not
15964 invoked.
15965 * tests/regression.at (Rule Line Numbers): Adjust.
15966
37c82725
AD
159672001-12-10 Akim Demaille <akim@epita.fr>
15968
15969 * src/LR0.c (augment_automaton): Now that all states have shifts,
15970 merge the two cases addition shifts to the initial state.
15971
6a164e0c
AD
159722001-12-10 Akim Demaille <akim@epita.fr>
15973
15974 * src/lalr.c (set_state_table): Move to...
15975 * src/LR0.c: here.
15976 * src/lalr.c (lalr): Don't call it...
15977 * src/LR0.c (generate_states): do it.
15978 * src/LR0.h (first_state): Remove, only the table is used.
15979
7215de24
AD
159802001-12-10 Akim Demaille <akim@epita.fr>
15981
15982 * src/LR0.h (first_shift, first_reduction): Remove.
15983 * src/lalr.c: Don't use first_shift: find shifts through the
15984 states.
15985
80e25d4d
AD
159862001-12-10 Akim Demaille <akim@epita.fr>
15987
15988 * src/LR0.c: Attach shifts to states as soon as they are
15989 computed.
15990 * src/lalr.c (set_state_table): Instead of assigning shifts to
15991 state, just assert that the mapping was properly done.
15992
0ab3728b
AD
159932001-12-10 Akim Demaille <akim@epita.fr>
15994
15995 * src/LR0.c (insert_start_shift): Rename as...
15996 (insert_start_shifting_state): this.
15997 (insert_eof_shifting_state, insert_accepting_state): New.
15998 (augment_automaton): Adjust.
15999 Better locality of the variables.
16000 When looking if the start_symbol is shifted from the initial
16001 state, using `while (... symbol != start_symbol ...)' sounds
16002 better than `while (... symbol < start_symbol ...)': If fail
16003 to see how the order between symbols could be relevant!
16004
78af9bbc
AD
160052001-12-10 Akim Demaille <akim@epita.fr>
16006
16007 * src/getargs.h: Don't declare `spec_name_prefix' and
16008 `spec_file_prefix', declared by src/files.h.
16009 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
16010 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
16011 * src/output.c (prepare): Adjust.
16012 * src/reader.c (symbols_output): Likewise.
16013 * src/vmsgetargs.c: Vaguely adjust, but who cares?
16014
bdef2a41
AD
160152001-12-10 Akim Demaille <akim@epita.fr>
16016
16017 * src/muscle_tab.c (muscle_init): NULL is a better default than
16018 `"0"'.
16019
3735969c
AD
160202001-12-10 Akim Demaille <akim@epita.fr>
16021
16022 * src/reader.c (reader): Calling symbols_output once is enough.
16023
49701457
AD
160242001-12-10 Akim Demaille <akim@epita.fr>
16025
16026 Now that states have a complete set of members, the linked list of
16027 reductions is useless: just fill directly the state's reductions
16028 member.
16029
16030 * src/state.h (struct reductions): Remove member `number' and
16031 `next'.
16032 * src/LR0.c (first_reduction, last_reduction): Remove.
16033 (save_reductions): Don't link the new reductions, store them in
16034 this_state.
16035 * src/lalr.c (set_state_table): No need to attach reductions to
16036 states, it's already done.
16037 * src/output.c (output_actions): No longer free the shifts, then
16038 the reductions, then the states: free all the states and their
16039 members.
16040
0edad749
AD
160412001-12-10 Akim Demaille <akim@epita.fr>
16042
16043 * src/options.c (OPTN, DRTV, BOTH): New.
16044 (option_table): Use them.
16045
0edad749
AD
16046 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
16047 the job of system.h.
16048 * src/options.c: Don't include stdio.h and xalloc.h for the same
16049 reasons.
16050
5449dd0f
AD
160512001-12-10 Akim Demaille <akim@epita.fr>
16052
16053 * src/output.c (output, prepare): Make sure the values of the
16054 muscles `action' and `prologue' are 0-terminated.
16055
a870c567
AD
160562001-12-10 Akim Demaille <akim@epita.fr>
16057
16058 Clean up GCC warnings.
16059
16060 * src/reader.c (copy_action): `buf' is not used.
16061 (parse_skel_decl): Be static.
16062 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
16063 * src/options.h (create_long_option_table): Have a real prototype.
16064 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
16065 (hash_delete_at): Return const void *.
16066 Adjust casts to preserve the const.
16067
80df8768
AD
160682001-12-10 Akim Demaille <akim@epita.fr>
16069
16070 * configure.in: Require 2.52g.
16071 M4 is not needed, but AUTOM4TE is.
16072 * m4/m4.m4: Remove.
16073 * tests/Makefile.am: Adjust.
16074
f693ad14
AD
160752001-12-10 Akim Demaille <akim@epita.fr>
16076
16077 One structure for states is enough, even though theoretically
16078 there are LR(0) states and LALR(1) states.
16079
16080 * src/lalr.h (state_t): Remove.
16081 (state_table): Be state_t **, not state_t *.
16082 * src/state.h (core, CORE_ALLOC): Rename as...
16083 (state_t, STATE_ALLOC): this.
16084 Add the LALR(1) members: shifts, reductions, errs.
16085 * src/LR0.c (state_table): Rename as...
16086 (state_hash): this, to avoid name clashes with the global
16087 `state_table'.
16088 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
16089 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
16090
74ffbcb6
AD
160912001-12-10 Akim Demaille <akim@epita.fr>
16092
16093 Bison dumps core on bash.y.
16094 Reported by Pascal Bart.
16095
16096 * src/warshall.c (bitmatrix_print): New.
16097 (TC): Use it.
ba0fe3c7 16098 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
16099 j must be the outer loop.
16100 * tests/regression.at (Broken Closure): New.
16101
07708e19
AD
161022001-12-05 Akim Demaille <akim@epita.fr>
16103
16104 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
16105 its argument.
ba1ecc07 16106 Reported by Peter Hamorsky.
07708e19 16107
92b16366
AD
161082001-12-05 Akim Demaille <akim@epita.fr>
16109
16110 * src/conflicts.c (err_table): Remove.
16111 (resolve_sr_conflict): Adjust.
16112 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
16113 Rename as...
16114 (state_t.reductions, state_t.shifts): this.
16115
076ab033
AD
161162001-12-05 Akim Demaille <akim@epita.fr>
16117
16118 * src/reduce.c (reduce_grammar_tables): No longer disable the
16119 removal of useless rules via CPP but via `if (0)', so that the
16120 compiler still check the code is valid.
16121 For instance, it should have noticed `rline' no longer exists: use
16122 the `line' member of rule_t.
16123 * src/gram.c (dummy, rline): Remove, unused.
16124
3843c413
AD
161252001-12-05 Akim Demaille <akim@epita.fr>
16126
16127 * src/output.c (pack_vector): Use assert, not berror.
16128 * src/main.c (berror): Remove, unused.
16129
43168960
AD
161302001-12-05 Akim Demaille <akim@epita.fr>
16131
16132 New experimental feature: if --verbose --trace output all the
16133 items of a state, not only its kernel.
16134
16135 * src/print.c (print_core): If `trace_flag', then invoke closure
16136 before outputting the items of the state (print_core is no longer
16137 a correct name them).
16138 (print_results): Invoke new_closure/free_closure if needed.
16139
b2872512
AD
161402001-12-05 Akim Demaille <akim@epita.fr>
16141
16142 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
16143 * src/closure.c, src/closure.h (itemsetsize): Rename as...
16144 (nitemset): for consistency with the rest of the project.
16145
23cbcc6c
AD
161462001-12-05 Akim Demaille <akim@epita.fr>
16147
16148 * src/closure.c (print_closure): Improve.
16149 (closure): Use it for printing input and output.
16150
03ec521c
AD
161512001-12-05 Akim Demaille <akim@epita.fr>
16152
16153 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
16154 indexed by nonterminals.
16155
3a7456dd
AD
161562001-12-05 Akim Demaille <akim@epita.fr>
16157
16158 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
16159 what it was!).
16160 * src/warshall.h: Remove accidental duplication of the content.
16161
1cbcf2e7
AD
161622001-12-05 Akim Demaille <akim@epita.fr>
16163
16164 * src/closure.c (set_fderives): De-obfuscate.
16165
84182270
AD
161662001-12-05 Akim Demaille <akim@epita.fr>
16167
16168 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
16169
3f6f053c
AD
161702001-12-05 Akim Demaille <akim@epita.fr>
16171
16172 * src/closure.c (set_firsts): De-obfuscate.
16173
7a5350ba
AD
161742001-12-05 Akim Demaille <akim@epita.fr>
16175
16176 * src/output.c (action_row): De-obfuscate
16177 using the good o' techniques: arrays not pointers, variable
16178 locality, BITISSET, RESETBIT etc.
16179
d954473d
AD
161802001-12-05 Akim Demaille <akim@epita.fr>
16181
16182 Pessimize the code to simplify it: from now on, all the states
16183 have a valid SHIFTS, which NSHIFTS is possibly 0.
16184
16185 * src/LR0.c (shifts_new): Be global and move to..
16186 * src/state.c, src/state.h: here.
16187 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
16188 * src/print_graph: Adjust.
16189
9839bbe5
AD
161902001-12-05 Akim Demaille <akim@epita.fr>
16191
16192 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
16193 * src/conflicts.c: Use it.
16194 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
16195 incorrectly ``simplified''.
16196
9f136c07
AD
161972001-12-05 Akim Demaille <akim@epita.fr>
16198
16199 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
16200 using the good o' techniques: arrays not pointers, variable
16201 locality, BITISSET, RESETBIT etc.
16202
b608206e
AD
162032001-12-05 Akim Demaille <akim@epita.fr>
16204
16205 * src/state.h (SHIFT_SYMBOL): New.
16206 * src/conflicts.c: Use it to deobfuscate.
16207
52afa962
AD
162082001-12-05 Akim Demaille <akim@epita.fr>
16209
16210 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
16211 (print_reductions): De-obfuscate using the good o' techniques:
16212 arrays not pointers, variable locality, BITISSET.
16213
e74dc321
AD
162142001-12-05 Akim Demaille <akim@epita.fr>
16215
16216 * src/conflicts.c (print_reductions): Arrays, not pointers.
16217 Use BITISSET.
16218
768fca83
AD
162192001-12-05 Akim Demaille <akim@epita.fr>
16220
16221 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16222
a17e599f
AD
162232001-12-05 Akim Demaille <akim@epita.fr>
16224
16225 * src/conflicts.c (print_reductions): Improve variable locality.
16226
a04bc341
AD
162272001-12-05 Akim Demaille <akim@epita.fr>
16228
16229 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16230
c8ea038e
AD
162312001-12-05 Akim Demaille <akim@epita.fr>
16232
16233 * src/conflicts.c (print_reductions): Improve variable locality.
16234
aa2aab3c
AD
162352001-12-05 Akim Demaille <akim@epita.fr>
16236
16237 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
16238 * src/lalr.c: Use them.
16239
b178c8cc
AD
162402001-12-05 Akim Demaille <akim@epita.fr>
16241
16242 * src/LR0.c (augment_automaton): Formatting changes.
16243 Better variable locality.
16244
f67d13aa
AD
162452001-12-05 Akim Demaille <akim@epita.fr>
16246
16247 * src/lalr.c (matrix_print): New.
16248 (transpose): Use it.
16249 Use arrays instead of pointers.
16250
c2713865
AD
162512001-12-05 Akim Demaille <akim@epita.fr>
16252
16253 * src/lalr.c (maxrhs): Move to...
16254 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
16255 * src/lalr.c (build_relations): Adjust.
16256
9887c18a
AD
162572001-12-05 Akim Demaille <akim@epita.fr>
16258
16259 * src/lalr.c (transpose): Free the memory allocated to the
16260 argument, as it is replaced by the results by the unique caller.
16261 (build_relations): Merely invoke transpose: it handles the memory
16262 deallocation.
16263 Improve variable locality.
16264 Avoid variables used as mere abbreviations.
16265 (compute_lookaheads): Use arrays instead of pointers.
16266
4d4f699c
AD
162672001-12-05 Akim Demaille <akim@epita.fr>
16268
16269 * src/lalr.c (initialize_F): Improve variable locality.
16270 Avoid variables used as mere abbreviations.
16271
80a69750
AD
162722001-12-05 Akim Demaille <akim@epita.fr>
16273
16274 * src/derives.c (print_derives): Display the ruleno.
16275 * src/lalr.c (initialize_F, transpose): Better variable locality
16276 to improve readability.
16277 Avoid variables used as mere abbreviations.
16278
fe961097
AD
162792001-12-05 Akim Demaille <akim@epita.fr>
16280
16281 * src/lalr.c (traverse): Use arrays instead of pointers.
16282
e3e4e814
AD
162832001-12-05 Akim Demaille <akim@epita.fr>
16284
16285 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
16286 the handling of squeue.
16287 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16288
630e182b
AD
162892001-12-05 Akim Demaille <akim@epita.fr>
16290
16291 Because useless nonterminals are now kept alive (instead of being
16292 `destroyed'), we now sometimes examine them, and store information
16293 related to them. Hence we need to know their number, and adjust
16294 memory allocations.
16295
16296 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
16297 static.
16298 * src/LR0.c (allocate_itemsets): The memory allocated to
16299 `symbol_count' was used for two different purpose: once to count
16300 the number of occurrences of each symbol, and later reassigned to
16301 `shift_symbol', containing the symbol that can be shifted from a
16302 given state.
16303 Deobfuscate, i.e., allocate, use and free `symbol_count' here
16304 only, and...
16305 (new_itemsets): Allocate `shift_symbol' here.
16306 (allocate_itemsets): symbol_count includes useless nonterminals.
16307 Make room for them.
16308 (free_storage): Use `free', not `XFREE', for pointers that cannot
16309 be null.
16310
81b51460
AD
163112001-12-05 Akim Demaille <akim@epita.fr>
16312
16313 * src/nullable.c (set_nullable): Deobfuscate the handling of
16314 ritem.
16315 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16316
3067fbef
AD
163172001-12-05 Akim Demaille <akim@epita.fr>
16318
16319 * src/gram.c, src/gram.h (ritem_print): New.
16320 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
16321 (This useless function was defined only to work around VMS linkers
16322 that can't handle compilation units with variables only).
16323 * src/reduce.c (dump_grammar): Use it to trace the construction of
16324 ritem.
16325
c2bea5f9
PE
163262001-12-04 Paul Eggert <eggert@twinsun.com>
16327
7d27c823
PE
16328 * src/bison.simple (union yyalloc): Change member names
16329 to be the same as the stack names.
16330 (yyparse): yyptr is now union yyalloc *, not char *.
16331 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
16332 and may generate better code on some machines.
c2bea5f9
PE
16333 (yystpcpy): Use prototype if __STDC__ is defined, not just
16334 if __cplusplus is defined.
35687a9d 16335
2c8a9dfa
AD
163362001-11-30 Akim Demaille <akim@epita.fr>
16337
16338 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
16339 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
16340 Gettext doesn't compile cleanly, and dies with -Werror.
16341 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
16342 Include WARNING_CFLAGS here.
16343 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
16344 before being defined.
16345
f4e421e6
AD
163462001-11-27 Paul Eggert <eggert@twinsun.com>
16347
16348 * lib/quotearg.h (quotearg_n, quotearg_n_style):
16349 First arg is int, not unsigned.
16350 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
16351 (SIZE_MAX, UINT_MAX): New macros.
16352 (quotearg_n_options): Abort if N is negative.
16353 Avoid overflow check on hosts where size_t is 64 bits and int
16354 is 32 bits, as overflow is impossible there.
16355 Fix off-by-one typo that caused unnecessary reallocation.
16356
7093d0f5
AD
163572001-11-29 Paul Eggert <eggert@twinsun.com>
16358
16359 Name space cleanup in generated parser.
16360
16361 * doc/bison.texinfo (Bison Parser): Discuss system headers
16362 and their effect on the user name space.
16363
16364 * src/bison.simple:
16365 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
16366 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
16367 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
16368
16369 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
16370 on user names when possible.
16371
16372 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
16373 Simplify test for whather <alloca.h> exists.
16374
16375 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
16376
16377 (<stdio.h>): Include if YYDEBUG.
16378
16379 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
16380 ! defined (yyoverflow) && ! defined (yymemcpy).
16381
16382 (yymemcpy, yyparse): Rename local variables as needed so that
16383 they all begin with 'yy'.
16384
16385 (yystrlen, yystpcpy): New functions.
16386
16387 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
16388 All uses changed.
16389
16390 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
16391 instead of relying on string.h functions. Use YYSTACK_ALLOC
16392 and YYSTACK_FREE instead of malloc and free.
16393
fd51e5ff
AD
163942001-11-30 Akim Demaille <akim@epita.fr>
16395
16396 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
16397 before their first uses.
16398 (YYBISON, YYPURE): Move to the top of the output.
16399
7d13ff5f
AD
164002001-11-30 Akim Demaille <akim@epita.fr>
16401
16402 * tests/reduce.at (Useless Nonterminals): Fix.
16403
892a3995
AD
164042001-11-30 Akim Demaille <akim@epita.fr>
16405
16406 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
16407 if body instead of `;' to pacify GCC's warnings.
16408
68f1e3ed
AD
164092001-11-30 Akim Demaille <akim@epita.fr>
16410
16411 Instead of mapping the LHS of unused rules to -1, keep the LHS
16412 valid, but flag the rules as invalid.
16413
16414 * src/gram.h (rule_t): `useful' is a new member.
16415 * src/print.c (print_grammar): Adjust.
16416 * src/derives.c (set_derives): Likewise.
16417 * src/reader.c (packgram, reduce_output): Likewise.
16418 * src/reduce.c (reduce_grammar_tables): Likewise.
16419 * tests/reduce.at (Underivable Rules, Useless Rules): New.
16420
d2d1b42b
AD
164212001-11-30 Akim Demaille <akim@epita.fr>
16422
16423 * src/reduce.c (reduce_output): Formatting changes.
16424 * src/print.c (print_results, print_grammar): Likewise.
16425 * tests/regression.at (Rule Line Numbers)
16426 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
16427
760b53a8
AD
164282001-11-30 Akim Demaille <akim@epita.fr>
16429
16430 * src/reduce.c (nonterminals_reduce): Instead of throwing away
16431 useless nonterminals, move them at the end of the symbol arrays.
16432 (reduce_output): Adjust.
16433 * tests/reduce.at (Useless Nonterminals): Adjust.
16434
00238958
AD
164352001-11-30 Akim Demaille <akim@epita.fr>
16436
16437 * src/reduce.c: Various comment/formatting changes.
16438 (nonterminals_reduce): New, extracted from...
16439 (reduce_grammar_tables): here.
16440 (reduce_grammar): Call nonterminals_reduce.
16441
396452de
PE
164422001-11-29 Paul Eggert <eggert@twinsun.com>
16443
16444 * src/bison.simple (YYSTACK_REALLOC): Remove.
16445 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
16446 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
16447 New macros.
16448 (union yyalloc): New type.
16449 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
16450 an arbitrary restriction on hosts where size_t is wider than int.
16451
16452 (yyparse): Don't dump core if alloca or malloc fails; instead, report
16453 a parser stack overflow. Allocate just one block of memory for all
16454 three stacks, instead of allocating three blocks; this typically is
16455 faster and reduces fragmentation.
16456
16457 Do not limit the number of items in the stack to a value that fits
16458 in 'int', as this is an arbitrary limit on hosts with 64-bit
16459 size_t and 32-bit int.
16460
147e184c
MA
164612001-11-29 Marc Autret <autret_m@epita.fr>
16462
16463 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
16464 of defining YYERROR_VERBOSE.
16465 [AT_DATA]: $4 is now out of C declarations in the prologue.
16466
426cf563
MA
164672001-11-28 Marc Autret <autret_m@epita.fr>
16468
16469 * src/reader.c (parse_dquoted_param): New.
16470 (parse_skel_decl): Use it.
16471 * src/lex.h: Add its prototype.
16472 * src/lex.c (literalchar): Become not static.
16473
c7925b99
MA
164742001-11-28 Marc Autret <autret_m@epita.fr>
16475
16476 * src/output.h: And put its extern declaration here.
16477 * src/output.c (error_verbose): Define here.
16478 (prepare): Echo name modification.
16479 * src/getargs.h: Clean its extern declaration.
16480 * src/getargs.c (error_verbose_flag): Remove.
16481 (getargs): Remove case 'e'.
16482 * src/options.c (option_table): 'error-verbose' is now seen as simple
16483 percent option.
16484 Include output.h.
16485
16486 * src/reader.c (read_declarations): Remove case tok_include.
16487 (parse_include_decl): Remove.
16488 * src/lex.h (token_t): Remove tok_include.
16489 * src/options.c (option_table): 'include' is now a simple command line
16490 option.
16491
5b5d1929
MA
164922001-11-28 Marc Autret <autret_m@epita.fr>
16493
16494 * src/bison.simple: Adjust muscle names.
16495 * src/muscle_tab.c (muscle_init): Also rename the muscles.
16496 * src/output.c (prepare): s/_/-/ for the muscles names.
16497 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
16498
8850be4b
MA
164992001-11-28 Marc Autret <autret_m@epita.fr>
16500
16501 * src/bison.simple: Fix debug.
16502 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
16503
4a38e613
AD
165042001-11-28 Akim Demaille <akim@epita.fr>
16505
16506 * src/LR0.c (shifts_new): New.
16507 (save_shifts, insert_start_shift, augment_automaton): Use it.
16508
4b35e1c1
AD
165092001-11-28 Akim Demaille <akim@epita.fr>
16510
16511 * src/closure.c (closure): `b' and `ruleno' denote the same value:
16512 keep ruleno only.
16513
d2b04478
AD
165142001-11-28 Akim Demaille <akim@epita.fr>
16515
16516 * src/closure.c (closure): Instead of looping over word in array
16517 then bits in words, loop over bits in array.
16518
2c4c30aa
AD
165192001-11-28 Akim Demaille <akim@epita.fr>
16520
16521 * src/closure.c (closure): No longer optimize the special case
16522 where all the bits of `ruleset[r]' are set to 0, to make the code
16523 clearer.
16524
576890b7
AD
165252001-11-28 Akim Demaille <akim@epita.fr>
16526
16527 * src/closure.c (closure): `r' and `c' are new variables, used to
16528 de-obfuscate accesses to RULESET and CORE.
16529
cb487d7d
AD
165302001-11-28 Akim Demaille <akim@epita.fr>
16531
16532 * src/reduce.c (reduce_print): Use ngettext.
16533 (dump_grammar): Improve the trace accuracy.
16534
6013d43f
AD
165352001-11-28 Akim Demaille <akim@epita.fr>
16536
16537 * src/reduce.c (dump_grammar): Don't translate trace messages.
16538
cb4956ee
AD
165392001-11-28 Akim Demaille <akim@epita.fr>
16540
16541 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
16542 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
16543 as all tags are free'ed afterwards.
16544 From Enrico Scholz.
16545
648185ab
PE
165462001-11-27 Paul Eggert <eggert@twinsun.com>
16547
16548 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
16549 use alloca when we didn't want to, and vice versa.
16550
68254a03
MA
165512001-11-27 Marc Autret <autret_m@epita.fr>
16552
9113b58f
AD
16553 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
16554 initialization.
68254a03
MA
16555 * src/output.c (prepare): Remove its update.
16556
04d843a2
MA
165572001-11-27 Marc Autret <autret_m@epita.fr>
16558
16559 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
16560 Use %error-verbose.
16561
d2079671 165622001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
16563
16564 * src/bison.simple: Remove YYERROR_VERBOSE using.
16565 Use %%error_verbose.
16566 (yyparse): Likewise.
16567 * src/output.c (prepare): Give its final value.
16568 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
16569 * src/getargs.h: Add its extern declaration.
16570 * src/getargs.c (error_verbose_flag): New int.
16571 (getargs): Update to catch new case.
16572 * src/options.c (option_table): 'error-verbose' is a new option.
16573 (shortopts): Update.
16574
e0327bc8
AD
165752001-11-27 Akim Demaille <akim@epita.fr>
16576
16577 * src/system.h: Use intl/libgettext.h.
16578 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
16579
000f1a3c
AD
165802001-11-27 Akim Demaille <akim@epita.fr>
16581
16582 * tests/torture.at (Exploding the Stack Size with Malloc):
16583 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
16584
26cfe0be
AD
165852001-11-27 Akim Demaille <akim@epita.fr>
16586
16587 * src/files.c: Include error.h.
16588 Reported by Hans Aberg.
16589
f6bd5427
MA
165902001-11-26 Marc Autret <autret_m@epita.fr>
16591
d2079671 16592 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
16593 (read_declarations): Add case tok_include.
16594 * src/getargs.h (include): Add its extern definition.
16595 * src/getargs.c (include): New const char *.
16596 (getargs): Add case '-I'.
16597 * src/options.c (option_table): Add include as command line and
16598 percent option.
16599 * src/lex.h (token_t): Add tok_include.
16600
2ca209c1
AD
166012001-11-26 Akim Demaille <akim@epita.fr>
16602
16603 * src/reader.c (readgram): Make sure rules for mid-rule actions
16604 have a lineno equal to that of their host rule.
16605 Reported by Hans Aberg.
16606 * tests/regression.at (Rule Line Numbers): New.
16607
0e41b407
AD
166082001-11-26 Akim Demaille <akim@epita.fr>
16609
16610 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
16611 size_ts.
16612
166132001-11-26 Akim Demaille <akim@epita.fr>
16614
16615 * src/complain.c, src/complain.h (error): Remove, provided by
16616 lib/error.[ch].
16617
e0c40012
AD
166182001-11-26 Akim Demaille <akim@epita.fr>
16619
16620 * src/reader.c (read_declarations): Don't abort on tok_illegal,
16621 issue an error message.
16622 * tests/regression.at (Invalid %directive): New.
16623 Reported by Hans Aberg.
16624
5e147124
AD
166252001-11-26 Akim Demaille <akim@epita.fr>
16626
16627 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
16628 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16629
a034c8b8
AD
166302001-11-26 Akim Demaille <akim@epita.fr>
16631
16632 * src/conflicts.c (conflicts_print): Don't complain at all when
16633 there are no reduce/reduce conflicts, and as many shift/reduce
16634 conflicts as expected.
16635 * tests/regression.at (%expect right): Adjust.
16636
c64a20f3
AD
166372001-11-23 Akim Demaille <akim@epita.fr>
16638
16639 * lib/alloca.c: Update, from fileutils.
16640
5b0d29bb
AD
166412001-11-23 Akim Demaille <akim@epita.fr>
16642
16643 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
16644
722c4bfe
AD
166452001-11-23 Akim Demaille <akim@epita.fr>
16646
16647 * src/system.h: Include alloca.h.
16648 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
16649
6255b435
AD
166502001-11-23 Akim Demaille <akim@epita.fr>
16651
16652 * src/print_graph.c (print_actions): Remove `rule', unused.
16653 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
16654 pacify GCC's signed < unsigned warnings.
16655 * src/closure.c (itemsetsize): Likewise.
16656 * src/reader.c (symbol_list_new): Static.
16657
b29b2ed5
AD
166582001-11-23 Akim Demaille <akim@epita.fr>
16659
16660 Attaching lineno to buckets is stupid, since only one copy of each
16661 symbol is kept, only the line of the first occurrence is kept too.
16662
16663 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
16664 * src/reader.c (rline_allocated): Remove, unused.
16665 (symbol_list): Have a `line' member.
16666 (symbol_list_new): New.
16667 (readgram): Use it.
16668 * src/print.c (print_grammar): Output the rule line numbers.
16669 * tests/regression.at (Solved SR Conflicts)
16670 (Unresolved SR Conflicts): Adjust.
16671 Reported by Hans Aberg.
16672
a81b1d4a
MA
166732001-11-22 Marc Autret <autret_m@epita.fr>
16674
16675 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
16676
c1ecb3c1
MA
166772001-11-22 Marc Autret <autret_m@epita.fr>
16678
16679 * src/muscle_tab.c (muscle_init): Remove initialization of
16680 skeleton muscle.
16681 * src/output.c (output_master_parser): Do it here.
16682
fbe01355
AD
166832001-11-20 Akim Demaille <akim@epita.fr>
16684
16685 * po/sv.po: New.
16686 * configure.in (ALL_LINGUAS): Adjust.
16687 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
16688 longer contains strings to translate.
16689
81e895c0
AD
166902001-11-19 Akim Demaille <akim@epita.fr>
16691
16692 * src/conflicts.c (conflicts_print): Add a missing \n.
16693
6bb1878b
AD
166942001-11-19 Akim Demaille <akim@epita.fr>
16695
16696 * src/nullable.c (nullable_print): New.
16697 (set_nullable): Call it when tracing.
16698 Better locality of variables.
16699
d9ec2d07
AD
167002001-11-19 Akim Demaille <akim@epita.fr>
16701
16702 * src/print.c (print_actions): Better locality of variables.
16703
720e5c1b
AD
167042001-11-19 Akim Demaille <akim@epita.fr>
16705
16706 * src/derives.c (print_derives): Fix and enrich.
16707 * src/closure.c (print_fderives): Likewise.
16708
fb908786
AD
167092001-11-19 Akim Demaille <akim@epita.fr>
16710
16711 * src/closure.c (itemsetend): Remove, replaced with...
16712 (itemsetsize): new.
16713
125ecb56
AD
167142001-11-19 Akim Demaille <akim@epita.fr>
16715
16716 * src/LR0.c (kernel_end): Remove, replaced with...
16717 (kernel_size): new.
16718
d8cf039f
AD
167192001-11-19 Akim Demaille <akim@epita.fr>
16720
16721 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
16722 to clarify.
16723
7bec0760
AD
167242001-11-19 Akim Demaille <akim@epita.fr>
16725
16726 * src/closure.c (closure): Use arrays instead of pointers to clarify.
16727
c87d4863
AD
167282001-11-19 Akim Demaille <akim@epita.fr>
16729
16730 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
16731 trace messages.
16732 * src/LR0.c: Likewise.
16733 (allocate_itemsets): Use arrays instead of pointers to clarify.
16734
9bfe901c
AD
167352001-11-19 Akim Demaille <akim@epita.fr>
16736
16737 * src/getargs.c (statistics_flag): Replace with...
16738 (trace_flag): New.
16739 (longopts): Accept --trace instead of --statistics.
16740 * src/getargs.h, src/options.c: Adjust.
16741 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
16742 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
16743
97db7bd4
AD
167442001-11-19 Akim Demaille <akim@epita.fr>
16745
cc72668c 16746 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
16747 pointers to clarify the code.
16748 (save_reductions, save_shifts): Factor common parts of alternatives.
16749
2c5f66ed
AD
167502001-11-19 Akim Demaille <akim@epita.fr>
16751
16752 * src/LR0.c (new_state, get_state): Complete TRACE code.
16753 * src/closure.c: Include `reader.h' to get `tags', needed by the
16754 trace code.
16755 Rename the conditional DEBUG as TRACE.
16756 Output consistently TRACEs to stderr, not stdout.
16757 * src/derives.c: Likewise.
16758 * src/reduce.c: (inaccessable_symbols): Using if is better style
16759 than goto.
16760 Use `#if TRACE' instead of `#if 0' for tracing code.
16761
300f275f
AD
167622001-11-19 Akim Demaille <akim@epita.fr>
16763
16764 * src/system.h (LIST_FREE, shortcpy): New.
16765 * src/LR0.c: Use them.
16766 * src/output.c (free_itemsets, free_reductions, free_shifts):
16767 Remove, replaced by LIST_FREE.
16768
f59c437a
AD
167692001-11-19 Akim Demaille <akim@epita.fr>
16770
16771 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
16772 (REDUCTIONS_ALLOC): New.
16773 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
16774 allocation.
16775
6986fd9e
AD
167762001-11-19 Akim Demaille <akim@epita.fr>
16777
16778 * src/LR0.c (new_state): Complete trace code.
16779 * src/nullable.c (set_nullable): Don't translate traces.
16780
4bc30f78
AD
167812001-11-19 Akim Demaille <akim@epita.fr>
16782
16783 * src/print_graph.c (print_core): Better locality of variables.
16784 * src/print.c (print_core): Likewise.
16785
08a946e0
AD
167862001-11-19 Akim Demaille <akim@epita.fr>
16787
16788 * src/vcg.c: You do the output, so you are responsible of the
16789 handling of VCG syntax, in particular: use quotearg.
16790 * src/print_graph.c: Don't.
16791 (print_actions): Don't output the actions as part of the nodes,
16792 since that's the job of the edges.
16793 (print_state): Don't output by hand: fill the node description,
9bfe901c 16794 and ask for its output.
08a946e0 16795
f0473484
AD
167962001-11-19 Akim Demaille <akim@epita.fr>
16797
cc72668c
AD
16798 * src/bison.simple (yyparse): When verbosely reporting an error,
16799 no longer put additional quotes around token names.
f0473484
AD
16800 * tests/calc.at: Adjust.
16801
e41dc700
AD
168022001-11-19 Akim Demaille <akim@epita.fr>
16803
16804 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
16805 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
16806 * src/output.c: Adjust.
16807
652a871c
AD
168082001-11-19 Akim Demaille <akim@epita.fr>
16809
16810 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
16811 (rule_t): this.
16812 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
16813
b2ed6e58
AD
168142001-11-19 Akim Demaille <akim@epita.fr>
16815
16816 * src/gram.h (rule_t): New.
16817 (rule_table): New.
16818 (rrhs, rlhs): Remove, part of state_t.
16819 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
16820 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16821 * src/reader.c, src/reduce.c: Adjust.
16822
edad7067
AD
168232001-11-19 Akim Demaille <akim@epita.fr>
16824
16825 * src/reader.c (symbols_output): New, extracted from...
16826 (packsymbols): Here.
16827 (reader): Call it.
16828
3feec034
AD
168292001-11-19 Akim Demaille <akim@epita.fr>
16830
16831 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
16832 (maxrhs): this new function.
16833
ddcd5fdf
AD
168342001-11-19 Akim Demaille <akim@epita.fr>
16835
cc72668c 16836 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
16837 Adjust.
16838
bb527fc2
AD
168392001-11-19 Akim Demaille <akim@epita.fr>
16840
cc72668c 16841 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
16842 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16843 * src/lalr.c: Adjust.
16844
a845a697
AD
168452001-11-19 Akim Demaille <akim@epita.fr>
16846
16847 * src/lalr.c (initialize_LA): Only initialize LA. Let...
16848 (set_state_table): handle the `lookaheads' members.
16849
f004bf6a
AD
168502001-11-19 Akim Demaille <akim@epita.fr>
16851
cc72668c
AD
16852 * src/lalr.h (lookaheads): Removed array, whose contents is now
16853 a member of...
f004bf6a
AD
16854 (state_t): this structure.
16855 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16856 Adjust.
16857
de326cc0
AD
168582001-11-19 Akim Demaille <akim@epita.fr>
16859
cc72668c
AD
16860 * src/lalr.h (consistent): Removed array, whose contents is now
16861 a member of...
de326cc0
AD
16862 (state_t): this structure.
16863 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16864 Adjust.
16865
90b4416b
AD
168662001-11-19 Akim Demaille <akim@epita.fr>
16867
cc72668c
AD
16868 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
16869 contents are now members of...
90b4416b
AD
16870 (state_t): this structure.
16871 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16872 Adjust.
16873
9703cc49
AD
168742001-11-19 Akim Demaille <akim@epita.fr>
16875
16876 * src/lalr.h (state_t): New.
16877 (state_table): Be a state_t * instead of a core **.
16878 (accessing_symbol): Remove, part of state_t.
16879 * src/lalr.c: Adjust.
16880 (set_accessing_symbol): Merge into...
16881 (set_state_table): this.
16882 * src/print_graph.c, src/conflicts.c: Adjust.
16883
d803322e
AD
168842001-11-14 Akim Demaille <akim@epita.fr>
16885
16886 * tests/calc.at, tests/output.at, tests/regression.at,
16887 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
16888 now the tests are run in private dirs, therefore AC_CLEANUP and
16889 family can be simplified to 0-ary.
16890 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
16891 use abs. path to find config.h.
16892 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
16893 stderr, there can be way too much random noise.
16894 Instead pass -Werror to GCC and rely on the exit status.
16895 Reported by Wolfram Wagner.
16896
3d76b07d
AD
168972001-11-14 Akim Demaille <akim@epita.fr>
16898
16899 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
16900 defined only if yyoverflow is defined, to avoid `warning: unused
16901 variable `yyvs1''.
16902 Reported by The Test Suite.
16903
09b503c8
AD
169042001-11-14 Akim Demaille <akim@epita.fr>
16905
16906 * src/print.c: Include reduce.h.
16907 Reported by Hans Aberg.
16908
169092001-11-14 Akim Demaille <akim@epita.fr>
16910
16911 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
16912 Revert a previous patch: these are really const.
16913 * src/conflicts.c (conflict_report): Additional useless pair of
16914 braces to pacify GCC's warnings for `if () if () {} else {}'.
16915 * src/lex.c (parse_percent_token): Replace equal_offset with
16916 arg_offset.
16917 arg is const.
16918 Be sure to strdup `arg' when used, since there is no reason for
16919 token_buffer not to change.
16920
0f37a994
AD
169212001-11-14 Akim Demaille <akim@epita.fr>
16922
16923 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
16924 definition.
16925 * src/main.c (main): Use them.
16926 Suggested by Hans Aberg.
16927
d39d93b8
AD
169282001-11-12 Akim Demaille <akim@epita.fr>
16929
16930 * src/system.h (ngettext): Now that we use ngettext, be sure to
16931 provide a default definition when NLS are not used.
16932
9edcd895
AD
169332001-11-12 Akim Demaille <akim@epita.fr>
16934
16935 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
16936 Use @kbd to denote user input.
16937 (Language and Grammar): ANSIfy the example.
16938 Adjust its layout for info/notinfo.
16939 (Location Tracking Calc): Output error messages to stderr.
16940 Output locations in a more GNUtically correct way.
16941 Fix a couple of Englishos.
16942 Adjust @group/@end group pairs.
16943
7da99ede
AD
169442001-11-12 Akim Demaille <akim@epita.fr>
16945
e3aa65c5 16946 %expect was not functioning at all.
7da99ede
AD
16947
16948 * src/conflicts.c (expected_conflicts): Set to -1.
16949 (conflict_report): Use ngettext.
16950 (conflicts_print): Check %expect and make its violation an error.
16951 * doc/bison.texinfo (Expect Decl): Adjust.
16952 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
16953 * tests/regression.at (%expect not enough, %expect right)
16954 (%expect too much): New.
16955
ba9dda1a
AD
169562001-11-12 Akim Demaille <akim@epita.fr>
16957
16958 * tests/regression.at (Conflicts): Rename as...
16959 (Unresolved SR Conflicts): this.
16960 (Solved SR Conflicts): New.
16961
337c5bd1
AD
169622001-11-12 Akim Demaille <akim@epita.fr>
16963
16964 * src/reduce.c (print_results): Rename as...
16965 (reduce_output): This.
16966 Output to OUT, passed as argument, instead of output_obstack.
16967 (dump_grammar): Likewise.
16968 (reduce_free): New.
16969 Also free V1.
16970 (reduce_grammar): No longer call reduce_output, since...
16971 * src/print.c (print_results): do it.
16972 * src/main.c (main): Call reduce_free;
16973
c73a41af
AD
169742001-11-12 Akim Demaille <akim@epita.fr>
16975
16976 * src/conflicts.c (print_reductions): Accept OUT as argument.
16977 Output to it, not to output_obstack.
16978 * src/print.c (print_actions): Adjust.
16979
0df87bb6
AD
169802001-11-12 Akim Demaille <akim@epita.fr>
16981
16982 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
16983 the result instead of using...
16984 (src_total, rrc_total, src_count, rrc_count): Remove.
16985 (any_conflicts): Remove.
16986 (print_conflicts): Split into...
16987 (conflicts_print, conflicts_output): New.
16988 * src/conflicts.h: Adjust.
16989 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 16990 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
16991 * tests/regression.at (Conflicts): New.
16992 Reported by Tom Lane.
16993
e4d3d4de
AD
169942001-11-12 Akim Demaille <akim@epita.fr>
16995
16996 * tests/regression.at (Invalid input): Remove, duplicate with
16997 ``Invalid input: 1''.
16998
6d7d248e
AD
169992001-11-12 Akim Demaille <akim@epita.fr>
17000
17001 * tests/torture.at (AT_DATA_STACK_TORTURE)
17002 (Exploding the Stack Size with Alloca)
17003 (Exploding the Stack Size with Malloc): New.
17004
e9e4c321
AD
170052001-11-12 Akim Demaille <akim@epita.fr>
17006
17007 * src/bison.simple (YYSTACK_REALLOC): New.
17008 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 17009 Reported by Per Allansson.
e9e4c321 17010
5f7e0832
AD
170112001-11-12 Pascal Bart <pascal.bart@epita.fr>
17012
17013 * src/bison.simple: Define type yystype instead of YYSTYPE, and
17014 define CPP macro, which substitute YYSTYPE by yystype.
17015 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
17016 with yyltype/YYLTYPE. This allows inclusion of the generated
17017 header within the parser if the compiler, such as GGC, accepts
17018 multiple equivalent #defines.
17019 From Akim.
17020
e3f1699f
AD
170212001-11-05 Akim Demaille <akim@epita.fr>
17022
17023 * src/reader.c (symbols_output): New, extracted from...
17024 (packsymbols): here.
17025 (reader): Adjust.
17026
65be0866
AD
170272001-11-05 Akim Demaille <akim@epita.fr>
17028
17029 * src/lex.c (parse_percent_token): s/quotearg/quote/.
17030
e4d910bf
AD
170312001-11-05 Akim Demaille <akim@epita.fr>
17032
17033 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
17034 pattern.
17035
951366c1
AD
170362001-11-05 Akim Demaille <akim@epita.fr>
17037
17038 * src/options.h (struct option_table_struct): set_flags is void*.
17039 * src/options.c (longopts): Support `--output' and `%output'.
17040 (usage): Adjust.
17041 * src/lex.h (tok_setopt): Remove, replaced with...
17042 (tok_intopt, tok_stropt): these new guys.
17043 * src/lex.c (getopt.h): Not needed.
17044 (token_buffer, unlexed_token_buffer): Not const.
17045 (percent_table): Promote `-' over `_' in directive names.
17046 Active `%name-prefix', `file-prefix', and `output'.
17047 (parse_percent_token): Accept possible arguments to directives.
17048 Promote `-' over `_' in directive names.
17049
d8988b2f
AD
170502001-11-04 Akim Demaille <akim@epita.fr>
17051
17052 * doc/bison.texinfo (Decl Summary): Split the list into
17053 `directives for grammars' and `directives for bison'.
17054 Sort'em.
17055 Add description of `%name-prefix', `file-prefix', and `output'.
17056 Promote `-' over `_' in directive names.
17057 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
17058 Simplify the description of `--name-prefix'.
17059 Promote `-' over `_' in directive names.
17060 Promote `--output' over `--output-file'.
17061 Fix the description of `--defines'.
17062 * tests/output.at: Exercise %file-prefix and %output.
17063
6468d18e
AD
170642001-11-02 Akim Demaille <akim@epita.fr>
17065
17066 * doc/refcard.tex: Update.
17067
6b7e85b9
AD
170682001-11-02 Akim Demaille <akim@epita.fr>
17069
17070 * src/symtab.h (SUNDEF): New.
17071 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
17072 stand for `uninitialized', instead of 0.
17073 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
17074 * src/lex.c (lex): Adjust.
17075
17076 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
17077 Number it 0.
17078 Let yylex return it instead of a plain 0.
17079 Reported by Dick Streefland.
17080
cd5aafcf
AD
170812001-11-02 Akim Demaille <akim@epita.fr>
17082
17083 * tests/regression.at (Mixing %token styles): New test.
17084
037ca2f1
AD
170852001-11-02 Akim Demaille <akim@epita.fr>
17086
17087 * src/reader.c (parse_thong_decl): Formatting changes.
17088 (token_translations_init): New, extracted from...
17089 (packsymbols): Here.
17090 Adjust.
17091
270a173c
AD
170922001-11-01 Akim Demaille <akim@epita.fr>
17093
17094 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
17095 Check that `9foo.y' produces correct cpp guards.
17096 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
17097 guards.
17098 Reported by Wwp.
17099
561f9a30
AD
171002001-11-01 Akim Demaille <akim@epita.fr>
17101
17102 * tests/regression.at (Invalid input: 2): New.
17103 * src/lex.c (unlexed_token_buffer): New.
17104 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
17105 too.
17106 Reported by Wwp.
17107
f987e9d2
AD
171082001-11-01 Akim Demaille <akim@epita.fr>
17109
17110 * tests/calc.at: Catch up with 1.30.
17111 * configure.in: Bump to 1.49a.
17112 Adjust to newer Autotest.
17113
0846f581
PB
171142001-10-19 Pascal Bart <pascal.bart@epita.fr>
17115
17116 * src/conflicts.c: Move global variables rrc_total and src_total ...
17117 (print_conflicts): here.
17118 * src/output.c (output): Free global variable user_toknums.
17119 * src/lex.c (token_obstack): Become static.
17120
3c1a79b3
AD
171212001-10-18 Akim Demaille <akim@epita.fr>
17122
17123 * tests/atlocal.in (GCC): Add.
17124 * tests/calc.at: s/m4_match/m4_bmatch/.
17125 s/m4_patsubst/m4_bpatsubst/.
17126 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
17127 * configure.in: AC_SUBST(GCC).
17128
5d52e7d0
MA
171292001-10-14 Marc Autret <autret_m@epita.fr>
17130
17131 * src/options.c (create_long_option_table): Fix.
17132
631aa1d3
AD
171332001-10-10 Akim Demaille <akim@epita.fr>
17134
17135 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
17136
f6ec6d13
AD
171372001-10-04 Akim Demaille <akim@epita.fr>
17138
17139 * src/reader.c (parse_union_decl): Push the caracters in
17140 union_obstack, not attrs_obstack.
17141
342b8b6e
AD
171422001-10-04 Akim Demaille <akim@epita.fr>
17143
17144 Merge in the branch 1.29.
17145
17146 * src/reader.c (packsymbols): Use a temporary obstack for
17147 `%%tokendef', since output_stack is already used elsewhere.
17148
17149 2001-10-02 Akim Demaille <akim@epita.fr>
17150
17151 Bump 1.29d.
17152
17153 2001-10-02 Akim Demaille <akim@epita.fr>
17154
17155 Version 1.29c.
17156
17157 2001-10-02 Akim Demaille <akim@epita.fr>
17158
17159 * tests/regression.at (Invalid CPP headers): New.
17160 From Alexander Belopolsky.
17161 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
17162
17163 2001-10-02 Akim Demaille <akim@epita.fr>
17164
17165 * tests/regression.at (Invalid input): New.
17166 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
17167 Reported by Shura.
17168
17169 2001-10-02 Akim Demaille <akim@epita.fr>
17170
17171 * tests/calc.at: Now that --debug works, the tests must be adjusted.
17172
17173 2001-10-02 Akim Demaille <akim@epita.fr>
17174
17175 * src/output.c (output_parser): Assert `skeleton'.
17176 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
17177 systems.
17178 From Shura.
17179
17180 2001-10-01 Marc Autret <autret_m@epita.fr>
17181
17182 * src/lex.h: Echo modifications.
17183 * src/lex.c (unlex): Parameter is now token_t.
17184 From Hans Aberg.
17185
17186 2001-10-01 Marc Autret <autret_m@epita.fr>
17187
17188 * src/main.c: Include lex.h.
17189 From Hans Aberg.
17190
17191 2001-09-29 Akim Demaille <akim@epita.fr>
17192
17193 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
17194
17195 2001-09-28 Akim Demaille <akim@epita.fr>
17196
17197 * tests/testsuite.at: Update to newer Autotest.
17198 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
17199
17200 2001-09-27 Akim Demaille <akim@epita.fr>
17201
17202 Position independent wrapper.
17203
17204 * tests/bison: Remove.
17205 * tests/bison.in: New.
17206 * configure.in: Adjust.
17207
17208 2001-09-27 Paul Eggert <eggert@twinsun.com>
17209
17210 Port quotearg fixes from tar 1.13.24.
17211
17212 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
17213 tm to be declared.
17214 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
17215 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
17216
17217 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
17218 * m4/mbrtowc.m4: New file.
17219 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
17220 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
17221
17222 2001-09-27 Akim Demaille <akim@epita.fr>
17223
17224 Bump to 1.29c.
17225
17226 2001-09-27 Akim Demaille <akim@epita.fr>
17227
17228 Version 1.29b.
17229
17230 2001-09-25 Akim Demaille <akim@epita.fr>
17231
17232 * src/system.h: Include `xalloc.h'.
17233 Remove it from the C files.
17234 * src/files.c (output_files): Free the obstacks.
17235 * src/lex.c (init_lex): Rename as...
17236 (lex_init): this.
17237 (lex_free): New.
17238 * src/main.c (main): Use it.
17239
17240 2001-09-24 Marc Autret <autret_m@epita.fr>
17241
17242 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
17243 to output informations in fout (FILE*).
17244 (open_graph, close_graph): Likewise.
17245 (output_graph, output_edge, output_node): Likewise.
17246 * src/vcg.h: Update function prototypes.
17247 * src/print_graph.c (print_graph): Open output graph file.
17248 (print_actions): Adjust.
17249 * src/files.h: Remove extern declaration.
17250 * src/files.c: Remove graph_obstack declaration.
17251 (open_files): Remove graph_obstack initialization.
17252 (output_files): Remove graph_obstack saving.
17253
17254 2001-09-24 Marc Autret <autret_m@epita.fr>
17255
17256 * src/files.c (compute_output_file_names): Fix.
17257
17258 2001-09-24 Marc Autret <autret_m@epita.fr>,
17259 Akim Demaille <akim@epita.fr>
17260
17261 * src/reader.c (reader): Remove call to free_symtab ().
17262 * src/main.c (main): Call it here.
17263 Include symtab.h.
17264 * src/conflicts.c (initialize_conflicts): Rename as...
17265 (solve_conflicts): this.
17266 * src/print.c (print_core, print_actions, print_state)
17267 (print_grammar): Dump to a file instead a `output_obstack'.
17268 (print_results): Dump `output_obstack', and then proceed with the
17269 FILE *.
17270 * src/files.c (compute_output_file_names, close_files): New.
17271 (output_files): Adjust.
17272 * src/main.c (main): Adjust.
17273
17274 2001-09-23 Marc Autret <autret_m@epita.fr>
17275
17276 * src/files.c (compute_header_macro): Computes header macro name
17277 from spec_defines_file when given.
17278
17279 2001-09-23 Marc Autret <autret_m@epita.fr>
17280
17281 * src/files.c (output_files): Add default extensions.
17282
17283 2001-09-22 Akim Demaille <akim@epita.fr>
17284
17285 * src/conflicts.c (finalize_conflicts): Rename as...
17286 (free_conflicts): this.
17287
17288 2001-09-22 Akim Demaille <akim@epita.fr>
17289
17290 * src/gram.c (gram_free): Rename back as...
17291 (dummy): this.
17292 (output_token_translations): Free `token_translations'.
17293 * src/symtab.c (free_symtab): Free the tag field.
17294
17295 2001-09-22 Akim Demaille <akim@epita.fr>
17296
17297 Remove `translations' as it is always set to true.
17298
17299 * src/gram.h: Adjust.
17300 * src/reader.c (packsymbols, parse_token_decl): Adjust
17301 * src/print.c (print_grammar): Adjust.
17302 * src/output.c (output_token_translations): Adjust.
17303 * src/lex.c (lex): Adjust.
17304 * src/gram.c: Be sure the set pointers to NULL.
17305 (dummy): Rename as...
17306 (gram_free): this.
17307
17308 2001-09-22 Akim Demaille <akim@epita.fr>
17309
17310 * configure.in: Invoke AM_LIB_DMALLOC.
17311 * src/system.h: Use dmalloc.
17312 * src/LR0.c: Be sure to have pointers initialized to NULL.
17313 (allocate_itemsets): Allocate kernel_items only if needed.
17314
17315 2001-09-22 Akim Demaille <akim@epita.fr>
17316
17317 * configure.in: Bump to 1.29b.
17318 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
17319 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
17320 need xmalloc.c in calc.y.
17321 From Pascal Bart.
17322
17323 2001-09-21 Akim Demaille <akim@epita.fr>
17324
17325 Version 1.29a.
17326 * Makefile.maint, config/config.guess, config/config.sub,
17327 * config/missing: Update from masters.
17328 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
17329 upon package.m4.
17330 * configure.in (ALL_LINGUAS): Add `tr'.
17331
17332 2001-09-21 Akim Demaille <akim@epita.fr>
17333
17334 * tests/Makefile.am (package.m4): Move to...
17335 ($(srcdir)/$(TESTSUITE)): here.
17336
17337 2001-09-20 Akim Demaille <akim@epita.fr>
17338
17339 * src/complain.c: No longer try to be standalone: use system.h.
17340 Don't assume __STDC__ is defined to 1. Just test if it is defined.
17341 * src/complain.h: Likewise.
17342 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
17343 Remove the unused variable `n'.
17344 From Albert Chin-A-Young.
17345
17346 2001-09-18 Marc Autret <autret_m@epita.fr>
17347
17348 * doc/bison.1: Update.
17349 * doc/bison.texinfo (Bison Options): Update --defines and --graph
17350 descriptions.
17351 (Option Cross Key): Update.
17352 Add --graph.
17353
17354 2001-09-18 Marc Autret <autret_m@epita.fr>
17355
17356 * tests/regression.at: New test (comment in %union).
17357
17358 2001-09-18 Marc Autret <autret_m@epita.fr>
17359
17360 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
17361 do that.
17362 Reported by Keith Browne.
17363
17364 2001-09-18 Marc Autret <autret_m@epita.fr>
17365
17366 * tests/output.at: Add tests for --defines and --graph.
17367
17368 2001-09-18 Marc Autret <autret_m@epita.fr>
17369
17370 * tests/output.at: Removes tests of %{header,src}_extension features.
17371
17372 2001-09-18 Akim Demaille <akim@epita.fr>
17373
17374 * tests/Makefile.am (package.m4): New.
17375 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
17376 (_AT_CHECK_CALC_ERROR): Likewise.
17377 Factor the `, ' part of verbose error messages.
17378
17379 2001-09-18 Marc Autret <autret_m@epita.fr>
17380
17381 * src/getargs.c (longopts): Declare --defines and --graph as options
17382 with optional arguments.
17383 * src/files.h: Add extern declarations.
17384 * src/files.c (spec_graph_file, spec_defines_file): New.
17385 (output_files): Update.
17386 Remove CPP-outed code.
17387
17388 2001-09-18 Marc Autret <autret_m@epita.fr>
17389
17390 Turn off %{source,header}_extension feature.
17391
17392 * src/files.c (compute_exts_from_gf): Update.
17393 (compute_exts_from_src): Update.
17394 (output_files): CPP-out useless code.
17395 * src/files.h: Remove {header,source}_extension extern declarations.
17396 * src/reader.c (parse_dquoted_param): CPP-out.
17397 (parse_header_extension_decl): Remove.
17398 (parse_source_extension_decl): Remove.
17399 (read_declarations): Remove cases tok_{hdrext,srcext}.
17400 * src/lex.c (percent_table): Remove {header,source}_extension entries.
17401 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
17402
17403 2001-09-10 Akim Demaille <akim@epita.fr>
17404
17405 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
17406 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
17407 (AT_CHECK_OUTPUT): this.
17408 Merely check ls' exit status, its output is useless.
17409
17410 2001-09-10 Akim Demaille <akim@epita.fr>
17411
17412 * tests/calc.at: Use m4_match.
17413 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
17414
17415 2001-09-10 Marc Autret <autret_m@epita.fr>,
17416 Akim Demaille <akim@epita.fr>
17417
17418 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
17419 enum color_e.
17420 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
17421 to `normal'.
17422 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
17423 * src/lex.h: Adjust prototype.
17424 (token_t): Add `tok_undef'.
17425 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
17426 (parse_percent_token): Now returns token_t.
17427 Add default statement in switch.
17428 (lex): Separate `c' as an input variable, from the token_t result
17429 part.
17430 (unlexed): Is a token_t.
17431
17432 2001-09-10 Akim Demaille <akim@epita.fr>
17433
17434 * configure.in: Bump to 1.29a.
17435
17436 2001-09-07 Akim Demaille <akim@epita.fr>
17437
17438 Version 1.29.
17439
17440 2001-08-30 Akim Demaille <akim@epita.fr>
17441
17442 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
17443 * m4/atconfig.m4: Remove.
17444 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
17445 * tests/bison: New.
17446 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
17447 m4_if, m4_patsubst, and m4_regexp.
17448 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
17449 `input' file instead of echo.
17450
17451 2001-08-29 Akim Demaille <akim@epita.fr>
17452
17453 Bump to 1.28e.
17454
17455 2001-08-29 Akim Demaille <akim@epita.fr>
17456
17457 Version 1.28d.
17458
17459 2001-08-29 Paul Eggert <eggert@twinsun.com>
17460
17461 * src/bison.simple (yyparse): Don't take the address of an
17462 item before the start of an array, as that doesn't conform to
17463 the C Standard.
17464
17465 2001-08-29 Robert Anisko <anisko_r@epita.fr>
17466
17467 * doc/bison.texinfo (Location Tracking Calc): New node.
17468
17469 2001-08-29 Paul Eggert <eggert@twinsun.com>
17470
17471 * src/output.c (output): Do not define const, as this now
17472 causes more problems than it cures.
17473
17474 2001-08-29 Akim Demaille <akim@epita.fr>
17475
17476 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
17477 the nodes.
17478 Be sure to tag the `detailmenu'.
17479
17480 2001-08-29 Akim Demaille <akim@epita.fr>
17481
17482 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
17483 download in a tmp dir.
17484
17485 2001-08-28 Marc Autret <autret_m@epita.fr>
17486
17487 * config/depcomp: New file.
17488
17489 2001-08-28 Marc Autret <autret_m@epita.fr>
17490
17491 * doc/bison.1 (mandoc): Adjust.
17492 From Juan Manuel Guerrero.
17493
17494 2001-08-28 Marc Autret <autret_m@epita.fr>
17495
17496 * src/print_graph.c (print_state): Fix.
17497
17498 2001-08-27 Marc Autret <autret_m@epita.fr>
17499
17500 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
17501 char * members.
17502 Echo modifications to the functions prototypes.
17503 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
17504
17505 2001-08-27 Marc Autret <autret_m@epita.fr>
17506
17507 * src/vcg.c: Include `xalloc.h'.
17508 (add_colorentry): New.
17509 (add_classname): New.
17510 (add_infoname): New.
17511 * src/vcg.h: Add new prototypes.
17512
17513 2001-08-27 Akim Demaille <akim@epita.fr>
17514
17515 * Makefile.maint: Sync. again with CVS Autoconf.
17516
17517 2001-08-27 Akim Demaille <akim@epita.fr>
17518
17519 * Makefile.maint: Formatting changes.
17520 (po-update, cvs-update, update): New targets.
17521 (AMTAR): Remove.
17522
17523 2001-08-27 Akim Demaille <akim@epita.fr>
17524
17525 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17526 * Makefile.maint: Sync. with CVS Autoconf.
17527
17528 2001-08-27 Marc Autret <autret_m@epita.fr>
17529
17530 * src/vcg.h (struct infoname_s): New.
17531 (struct colorentry_s): New.
17532 (graph_s): New fields {vertical,horizontal}_order in structure.
17533 Add `infoname' field.
17534 Add `colorentry' field;
17535 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
17536 (G_HORIZONTAL_ORDER): New.
17537 (G_INFONAME): New.
17538 (G_COLORENTRY): New.
17539 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
17540 Add output of `infoname'.
17541 Add output of `colorentry'.
17542
17543 2001-08-27 Marc Autret <autret_m@epita.fr>
17544
17545 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
17546 This one shadowed a global parameter.
17547
17548 2001-08-24 Marc Autret <autret_m@epita.fr>
17549
17550 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
17551 instead of `unsigned'.
17552 (print_state): Do not call obstack_object_size () in obstack_grow ()
17553 to avoid macro variables shadowing.
17554
17555 2001-08-23 Marc Autret <autret_m@epita.fr>
17556
17557 * src/lex.c (percent_table): Typo: s/naem/name/.
17558 Add graph option.
17559 Normalize new options declarations.
17560
17561 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
17562
17563 * tests/suite.at: Exercise %header_extension and %source_extension.
17564
17565 2001-08-16 Marc Autret <autret_m@epita.fr>
17566
17567 * src/reader.c (parse_dquoted_param): New.
17568 (parse_header_extension_decl): Use it.
17569 (parse_source_extension_decl): Likewise.
17570
17571 2001-08-16 Marc Autret <autret_m@epita.fr>
17572
17573 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
17574 (get_xxxx_str): Use assert () instead of complain ().
17575 Remove return invokations in default cases.
17576 (get_decision_str): Modify default behaviour. Remove second argument.
17577 Echo modifications on calls.
17578 (output_graph): Fix.
17579
17580 2001-08-16 Marc Autret <autret_m@epita.fr>
17581
17582 * src/getargs.c (usage): Update with ``-g, --graph''.
17583
17584 2001-08-16 Marc Autret <autret_m@epita.fr>
17585
17586 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
17587 (Option Cross Key): Likewise.
17588 * doc/bison.1: Update.
17589
1c8c2190
PB
175902001-09-25 Pascal Bart <pascal.bart@epita.fr>
17591
17592 * src/output.c (output_master_parser): Don't finish action_obstack.
17593 (output_parser): Don't care about the muscle action, here.
17594 (prepare): Copy the action_obstack in the action muscle.
17595 (output): Free action_obstack.
17596
180d45ba
PB
175972001-09-23 Pascal Bart <pascal.bart@epita.fr>
17598
17599 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
17600 will contain `%union' declaration.
17601 (parse_union_decl): Delete #line directive output.
17602 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
17603 informations about %union.
17604 (parse_union_decl): Copy the union_obstack in the muscle stype.
17605 * src/bison.simple: Add new #line directive.
17606 Add typdef %%stype YYSTYPE.
17607
c51d1a19
PB
176082001-09-23 Pascal Bart <pascal.bart@epita.fr>
17609
17610 * src/bison.simple: Add new `#line' directive.
17611
6f9344da
PB
176122001-09-22 Pascal Bart <pascal.bart@epita.fr>
17613
17614 * src/bison.simple: New `#line' directive.
17615 * src/output.c (output_parser): Support new dynamic muscle input_line.
17616
652def80
MA
176172001-09-22 Marc Autret <autret_m@epita.fr>
17618
17619 * src/output.c (output_master_parser): New.
17620 (output_parser): Be more re-entrant.
17621
25b222fa
MA
176222001-09-21 Marc Autret <autret_m@epita.fr>
17623
17624 * src/reader.c (copy_definition, parse_union_decl): Update and use
17625 `linef' muscle.
17626 (copy_action): Likewise.
17627 Use obstack_1grow ().
17628 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
17629
6bc35ae5
MA
176302001-09-21 Marc Autret <autret_m@epita.fr>
17631
17632 * src/options.c (option_table): Adjust.
17633 * src/lex.c (parse_percent_token): Fix.
17634
c0629aa1
PB
176352001-09-20 Pascal Bart <pascal.bart@epita.fr>
17636
17637 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 17638
82b6d266
PB
176392001-09-20 Pascal Bart <pascal.bart@epita.fr>
17640
17641 * src/lex.c (parse_percent_token): Change type of variable `tx', which
17642 is now an option_table_struct*.
17643 (option_strcmp): New function option_strcmp.
17644 (parse_percent_token): Call option_strcmp.
17645 * src/getargs.c (xalloc.h, options.h): Include it.
17646 (getargs): Call create_long_option_table.
17647 (getargs): Free longopts at the end of the function.
17648 (shortopts): Move in options.c.
17649 * src/options.c (create_long_option_table): New function. Convert
17650 information from option_table to option structure.
17651 * src/reader.c (options.h): Include it.
17652
17653 * src/Makefile.am: Adjust.
17654 * src/options.c (option_table): Create from longopts and percent_table.
17655 * src/getargs.c (longopts): Delete.
17656 * src/lex.c (struct percent_table_struct): Delete.
17657 (percent_table): Delete.
17658 (options.h): Include it.
17659 * src/options.c: Create.
17660 * src/options.h: Create.
17661 Declare enum opt_access_e.
17662 Define struct option_table_struct.
17663
75f5aaea
MA
176642001-09-20 Marc Autret <autret_m@epita.fr>
17665
17666 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
17667 sections of Bison.
17668
f508cb0a
PB
176692001-09-19 Pascal Bart <pascal.bart@epita.fr>
17670
17671 * src/bison.simple: s/%%filename/%%skeleton.
17672 * src/muscle_tab.c (getargs.h): Include it.
17673 (muscle_init): Insert new muscle skeleton.
17674
13105fc1
PB
176752001-09-18 Pascal Bart <pascal.bart@epita.fr>
17676
17677 * src/output.c (output_parser): Delete unused variable actions_dumped.
17678
b0c4483e
PB
176792001-09-07 Pascal Bart <pascal.bart@epita.fr>
17680
17681 * src/output.c (output): Delete call to reader_output_yylsp.
17682 * src/reader.c (reader): Likewise.
ba0fe3c7 17683 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 17684
11d82f03
MA
176852001-09-02 Marc Autret <autret_m@epita.fr>
17686
17687 * src/reader.c: Include muscle_tab.h.
17688 (parse_union_decl): Update.
17689 (parse_macro_decl): Rename parse_muscle_decl.
17690 Update to use renamed functions and variable.
17691 (read_declarations, copy_action, read_additionnal_code, : Updated
17692 with correct variables and functions names.
17693 (packsymbols, reader): Likewise.
342b8b6e 17694
11d82f03 17695 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 17696
11d82f03
MA
17697 * src/output.c: Include muscle_tab.h
17698 In all functions using macro_insert, change by using muscle_insert ().
17699 (macro_obstack): Rename muscle_obstack.
17700 Echo modifications in the whole file.
17701 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
17702 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
17703 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
17704
17705 * src/muscle_tab.h: Update double inclusion macros.
17706 (macro_entry_s): Rename muscle_entry_s.
17707 Update prototypes.
342b8b6e 17708
11d82f03
MA
17709 * src/muscle_tab.c: Include muscle_tab.h.
17710 Rename macro_tabble to muscle_table.
17711 (mhash1, mhash2, mcmp): Use muscle_entry.
17712 (macro_init): Rename muscle_init. Update.
17713 (macro_insert): Rename muscle_insert. Update.
17714 (macro_find): Rename muscle_find. Update.
17715
17716 * src/main.c: Include muscle_tab.h.
17717 (main): Call muscle_init ().
17718 * src/Makefile.am (bison_SOURCES): Echo modifications.
17719
93a37297
MA
177202001-09-02 Marc Autret <autret_m@epita.fr>
17721
f753cd62 17722 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 17723
f753cd62
MA
17724 * src/muscle_tab.c, src/muscle_tab.h: Add files.
17725
177262001-09-02 Marc Autret <autret_m@epita.fr>
17727
17728 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 17729
682d48cd
PB
177302001-09-01 Pascal Bart <pascal.bart@epita.fr>
17731
342b8b6e 17732 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
17733 filename.
17734
087c8fda
MA
177352001-09-01 Marc Autret <autret_m@epita.fr>
17736
17737 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
17738 to an explicit value to activate the feature. We do it here.
17739
dda680cb
PB
177402001-08-31 Pascal Bart <pascal.bart@epita.fr>
17741
17742 * src/output.c (prepare): Delete the `filename' muscule insertion.
17743 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
17744 (parse_union_decl): Likewise.
17745 * src/macrotab.c (macro_init): Initialize filename by infile.
17746
9e644e64
MA
177472001-08-31 Marc Autret <autret_m@epita.fr>
17748
17749 * src/bison.simple (YYLSP_NEEDED): New definition.
17750 * src/output.c (prepare): Add macro insertion of `locations_flag'
17751
17da6427
PB
177522001-08-31 Pascal Bart <pascal.bart@epita.fr>
17753
17754 * src/output.c (prepare): Delete insertion of previous muscles,
17755 and insert the `prefix' muscles.
17756 * src/macrotab.c (macro_init): Likewise.
17757 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 17758 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
17759 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
17760 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 17761 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
17762 name_prefix.
17763
e8cb70b9
PB
177642001-08-31 Pascal Bart <pascal.bart@epita.fr>
17765
17766 * src/main.c (main): Standardize.
17767 * src/output.c (output_table_data, output_parser): Likewise.
17768 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
17769
63c2d5de
MA
177702001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
17771
342b8b6e 17772 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
17773 %%epilogue.
17774 * src/output.c (output): Rename %%declarations to %%prologue.
17775 * src/bison.simple: Echo modifications.
342b8b6e 17776
d8cb5183
MA
177772001-08-31 Marc Autret <autret_m@epita.fr>
17778
17779 * src/reader.c (readgram): CleanUp.
17780 (output_token_defines): Likewise.
17781 (packsymbols): Likewise.
17782 (reader): Likewise.
17783 * src/output.c (output): CPP-out useless code.
17784
6c686258
PB
177852001-08-31 Pascal Bart <pascal.bart@epita.fr>
17786
342b8b6e 17787 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
17788 output_trailers and output_headers.
17789 * src/output.h: Remove obsolete functions prototypes of output_headers
17790 and output_trailers.
17791
8f451ef7
PB
177922001-08-30 Pascal Bart <pascal.bart@epita.fr>
17793
17794 * src/main.c: Include macrotab.h.
342b8b6e 17795 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
17796 Adjust functions prototypes.
17797 * src/macrotab.c (macro_insert): Constify key and value.
17798 (macro_find): Constify key.
17799 (macro_insert): Include 'xalloc.h'
17800 (macro_insert): Use XMALLOC.
17801 (macro_find): Constify return value.
17802 * src/output.c (output_table_data): Rename table to table_data.
17803 (output_parser): Constify macro_key, macro_value.
17804
997b6fd0 178052001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
17806
17807 * src/reader.c (parse_skel_decl): New.
342b8b6e 17808 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
17809 * src/lex.h (token_t): New token `tok_skel'.
17810 * src/lex.c (percent_table): Add skeleton option entry.
17811 Standardize.
17812
ff48177d
MA
178132001-08-29 Marc Autret <autret_m@epita.fr>
17814
17815 * src/bison.simple: Add %%user_code directive at the end.
17816 * src/reader.c (read_additionnal_code): New.
17817 (reader): Use it.
17818 * src/output.c (output_program): Remove.
17819 (output): Update.
17820
b33160bf
MA
178212001-08-28 Marc Autret <autret_m@epita.fr>
17822
17823 * src/output.c (output_actions): Clean up.
4e5caae2 17824 (output_gram): CPP-out useless code.
b33160bf
MA
17825 * src/reader.c (reader): Clean up, CPP-out useless code.
17826
d1a2daf7
PB
178272001-08-28 Pascal Bart <pascal.bart@epita.fr>
17828
342b8b6e 17829 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 17830 directive.
d1a2daf7
PB
17831 * src/bison.simple: Add `%%definitions'.
17832
2b763dfe
MA
178332001-08-28 Marc Autret <autret_m@epita.fr>
17834
17835 * config/depcomp: New file.
17836
f1a87ef6
PE
178372001-08-27 Paul Eggert <eggert@twinsun.com>
17838
17839 * src/bison.simple (yyparse): Don't take the address of an
17840 item before the start of an array, as that doesn't conform to
17841 the C Standard.
17842
82e236e2
RA
178432001-08-27 Robert Anisko <robert.anisko@epita.fr>
17844
f1a87ef6 17845 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
17846 obstack. It was done too late here.
17847
17848 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
17849 completely wrong.
17850 (reader): Initialize the macro obstack here, since we need it to grow
17851 '%define' directives.
17852
17853 * src/reader.h: Declare the macro obstack as extern.
17854
b0cfa28a
RA
178552001-08-27 Robert Anisko <robert.anisko@epita.fr>
17856
17857 * src/output.c (output_parser): Fix. Store single '%' characters in
17858 the output obstack instead of throwing them away.
17859
6fc74234
AD
178602001-08-27 Akim Demaille <akim@epita.fr>
17861
17862 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17863
9c76d118
RA
178642001-08-25 Robert Anisko <robert.anisko@epita.fr>
17865
17866 * lib/Makefile.am: Adjust.
17867
a8289c62
RA
178682001-08-25 Robert Anisko <robert.anisko@epita.fr>
17869
17870 * src/bison.simple: Update and add '%%' directives.
17871
b6610515
RA
178722001-08-25 Robert Anisko <robert.anisko@epita.fr>
17873
17874 * src/reader.c (reader): Remove calls to 'output_headers' and
17875 'output_trailers'. Remove some C output.
17876 (readgram): Disable a piece of code that was writing a default
17877 definition for 'YYSTYPE'.
17878 (reader_output_yylsp): Remove.
17879 (packsymbols): Output token defintions to a macro.
17880 (copy_definition): Disable C output.
6fc74234 17881
b6610515
RA
17882 * src/reader.c (parse_macro_decl): New function used to parse macro
17883 declarations.
17884 (copy_string2): Put the body of copy_string into this new function.
17885 Add a parameter to let the caller choose whether he wants to copy the
17886 string delimiters or not.
17887 (copy_string): Be a simple call to copy_string2 with the last argument
17888 bound to true.
17889 (read_declarations): Add case for macro definition.
17890 (copy_identifier): New.
6fc74234 17891 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
17892 rather than lex.
17893
26f609ff
RA
178942001-08-25 Robert Anisko <robert.anisko@epita.fr>
17895
17896 * src/output.c (prepare): Add prefixed names.
17897 (output_parser): Output semantic actions.
17898 (output_parser): Fix bug on '%%line' directives.
6fc74234 17899
26f609ff
RA
17900 * src/output.c (output_headers): Remove. The C code printed by this
17901 function should now be in the skeletons.
17902 (output_trailers): Remove.
17903 (output): Disable call to 'reader_output_yylsp'.
17904 (output_rule_data): Do not output tables to the table obstack.
17905
17906 * src/output.c: Remove some C dedicated output.
17907 Improve the use of macro and output obstacks.
17908 (output_defines): Remove.
6fc74234 17909
26f609ff
RA
17910 * src/output.c (output_token_translations): Associate 'translate'
17911 table with a macro. No output to the table obstack.
17912 (output_gram): Same for 'rhs' and 'prhs'.
17913 (output_stos): Same for 'stos'.
17914 (output_rule_data): Same for 'r1' and 'r2'.
17915 (token_actions): Same for 'defact'.
17916 (goto_actions): Same for 'defgoto'.
17917 (output_base): Same for 'pact' and 'pgoto'.
17918 (output_table): Same for 'table'.
17919 (output_check): Same for 'check'.
6fc74234 17920
26f609ff
RA
17921 * src/output.c (output_table_data): New function.
17922 (output_short_table): Remove.
17923 (output_short_or_char_table): Remove.
6fc74234 17924
26f609ff
RA
17925 * src/output.c (output_parser): Replace most of the skeleton copy code
17926 with something new. Skeletons are now processed character by character
17927 rather than line by line, and Bison looks for '%%' macros. This is the
17928 first step in making Bison's output process (a lot) more flexible.
17929 (output_parser): Use the macro table.
17930
6f43b113
RA
179312001-08-25 Robert Anisko <robert.anisko@epita.fr>
17932
17933 * src/main.c (main): Initialize the macro table.
17934
dd3127cf
RA
179352001-08-25 Robert Anisko <robert.anisko@epita.fr>
17936
17937 * src/lex.c (percent_table): Add tok_define.
17938 * src/lex.h: Add tok_define.
17939
aa321494
RA
179402001-08-25 Robert Anisko <robert.anisko@epita.fr>
17941
17942 * src/macrotab.c: New file.
17943 * src/macrotab.h: New file.
17944 * src/Makefile.am: Update.
17945
68bd3b6b
RA
179462001-08-25 Robert Anisko <robert.anisko@epita.fr>
17947
17948 * lib/hash.c: New file.
17949 * lib/hash.h: New file.
17950 * lib/Makefile.am: Update.
17951
45f8dd1e
AD
179522001-08-15 Akim Demaille <akim@epita.fr>
17953
17954 Version 1.28c.
17955
40a64a7a 179562001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
17957
17958 * src/reader.c (readgram): Indent output macro YYSTYPE.
17959 (packsymbols): Likewise.
17960 (output_token_defines): Likewise.
17961 * src/files.c: Standardize.
17962 (compute_header_macro): New.
17963 (defines_obstack_save): New. Use compute_header_macro.
17964 (output_files): Update. Use defines_obstack_save.
17965
f9a8293a
AD
179662001-08-15 Akim Demaille <akim@epita.fr>
17967
17968 * doc/bison.texinfo (Table of Symbols): Document
17969 YYSTACK_USE_ALLOCA.
17970
150ca7a7
AD
179712001-08-15 Akim Demaille <akim@epita.fr>
17972
17973 * missing: Update from CVS Automake.
17974 * config/config.guess, config/config.sub, config/texinfo.tex:
17975 Update from gnu.org.
17976
69b5cec4
AD
179772001-08-15 Akim Demaille <akim@epita.fr>
17978
17979 * Makefile.maint: Sync with CVS Autoconf.
17980
f2b5126e
PB
179812001-08-14 Pascal Bart <pascal.bart@epita.fr>
17982
69b5cec4 17983 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
17984 `fdl.texi'.
17985 * doc/fdl.texi: Add to package.
17986
4ecbf796
MA
179872001-08-14 Marc Autret <autret_m@epita.fr>
17988
17989 Turn on %{source,header}_extension features.
17990
69b5cec4 17991 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
17992 source_extension.
17993 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 17994 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
17995 between options.
17996
95fb5662
MA
179972001-08-14 Marc Autret <autret_m@epita.fr>
17998
17999 * src/files.c (compute_base_names): Add extensions computing when
18000 `--file-prefix' used.
18001 Standardize function calls.
18002
78d09da9
MA
180032001-08-13 Marc Autret <autret_m@epita.fr>
18004
69b5cec4 18005 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
18006 defining it (defined but null disables alloca).
18007
5a009f2c
MA
180082001-08-13 Marc Autret <autret_m@epita.fr>
18009
18010 * src/bison.simple (_yy_memcpy): CPP reformat.
18011
1e41465a
PB
180122001-08-13 Pascal Bart <pascal.bart@epita.fr>
18013
18014 * tests/atconfig.in (CPPFLAGS): Fix.
18015
c67a198d
PB
180162001-08-10 Pascal Bart <pascal.bart@epita.fr>
18017
79282c6c 18018 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
18019 `gpl.texi'.
18020 * doc/gpl.texi: Add to package.
18021
09a6de7e
MA
180222001-08-10 Marc Autret <autret_m@epita.fr>
18023
18024 * src/print_graph.h: Fix.
18025 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
18026
b77b9ee0
AD
180272001-08-10 Akim Demaille <akim@epita.fr>
18028
18029 * src/system.h: Provide default declarations for stpcpy, strndup,
18030 and strnlen.
18031
3e259915
MA
180322001-08-10 Robert Anisko <anisko_r@epita.fr>
18033
18034 * doc/bison.texinfo (Locations): Update @$ stuff.
18035
ca96bc2d
MA
180362001-08-09 Robert Anisko <anisko_r@epita.fr>
18037
18038 * src/bison.simple (YYLLOC_DEFAULT): Update.
18039 (yyparse): Adjust.
18040
fdc6758b
MA
180412001-08-08 Marc Autret <autret_m@epita.fr>
18042
b77b9ee0 18043 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
18044 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
18045 Reported by Fabrice Bauzac.
957d4dbf 18046
600cad3b
MA
180472001-08-08 Marc Autret <autret_m@epita.fr>
18048
18049 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
18050 * src/vcg.c (output_node): Fix.
18051 * src/vcg.h: Cleanup.
18052 * src/print_graph.c: Add comments.
b77b9ee0 18053 (node_output_size): New global variable. Simplify the formatting of
600cad3b 18054 the VCG graph output.
b77b9ee0 18055 (print_actions): Unused code is now used. It notifies the final state
600cad3b 18056 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 18057 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
18058 blue.
18059 Get the current node name and node_obstack by argument.
18060 (node_obstack): New variable.
18061 (print_state): Manage node_obstack.
18062 (print_core): Use node_obstack given by argument.
18063 A node is not only computed here but in print_actions also.
18064 (print_graph): CPP out useless code instead of commenting it.
18065
976e528f
AD
180662001-08-07 Pascal Bart <pascal.bart@epita.fr>
18067
18068 * tests/atconfig.in (CPPFLAGS): Fix.
18069
20e8e5ca
AD
180702001-08-07 Akim Demaille <akim@epita.fr>
18071
18072 * src/print_graph.c (quote): New.
18073 (print_core): Use it.
18074
957d4dbf 180752001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 18076
3e3da797
AD
18077 * src/vcg.c (complain.h): Include it.
18078 Unepitaize `return' invocations.
c4b66126 18079 [NDEBUG] (main): Remove.
79282c6c 18080 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
18081 * src/files.c (open_files): Initialize graph_obstack.
18082 * src/print_graph.c (print_actions): CPP out useless code.
18083 (print_core): Don't output the last `\n' in labels.
18084 Use `quote'.
18085 * src/files.c (output_files): Output the VCG file.
18086 * src/main.c (main): Invoke print_graph ();
3e3da797 18087
957d4dbf 180882001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
18089
18090 Automaton VCG graph output.
18091 Using option ``-g'' or long option ``--graph'', you can generate
18092 a gram_filename.vcg file containing a VCG description of the LALR (1)
18093 automaton of your grammar.
18094
18095 * src/main.c: Call to print_graph() function.
18096 * src/getargs.h: Update.
18097 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
18098 (graph_flag): New flag.
18099 (longopts): Update.
18100 (getargs): Add case `g'.
18101 * src/files.c (graph_obstack): New obstack struct.
18102 (open_files): Initialize new obstack.
18103 (output_files): Saves graph_obstack if required.
18104 * src/files.h (graph_obstack): New extern declaration.
18105 * src/Makefile.am: Add new source files.
18106
927c1557 181072001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
18108
18109 * src/print_graph.c, src/print_graph.h (graph): New.
18110 * src/vcg.h: New file.
18111 * src/vcg.c: New file, VCG graph handling.
18112
7333d403
AD
181132001-08-06 Marc Autret <autret_m@epita.fr>
18114
18115 Add of %source_extension and %header_extension which specify
18116 the source or/and the header output file extension.
18117
18118 * src/files.c (compute_base_names): Remove initialisation of
18119 src_extension and header_extension.
18120 (compute_exts_from_gf): Update.
18121 (compute_exts_from_src): Update.
18122 (output_files): Update.
18123 * src/reader.c (parse_header_extension_decl): New.
18124 (parse_source_extension_decl): New.
18125 (read_declarations): New case statements for the new tokens.
18126 * src/lex.c (percent_table): Add entries for %source_extension
18127 and %header_extension.
18128 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
18129
84163231
AD
181302001-08-06 Marc Autret <autret_m@epita.fr>
18131
18132 * configure.in: Bump to 1.28c.
18133 * doc/bison.texinfo: Texinfo thingies.
18134
8303fc42
AD
181352001-08-04 Pascal Bart <pascal.bart@epita.fr>
18136
18137 * tests/atconfig.in (CPPFLAGS): Add.
18138 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
18139
70a84437
AD
181402001-08-03 Akim Demaille <akim@epita.fr>
18141
18142 Version 1.28b.
18143
2ce10144
AD
181442001-08-03 Akim Demaille <akim@epita.fr>
18145
18146 * tests/Makefile.am (check-local): Ship testsuite.
18147 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
18148 Include `string.h'.
18149
1e3e4bc1
AD
181502001-08-03 Akim Demaille <akim@epita.fr>
18151
18152 * configure.in: Try using -Wformat when compiling.
18153
42b45b7f
AD
181542001-08-03 Akim Demaille <akim@epita.fr>
18155
18156 * configure.in: Bump to 1.28b.
18157
8f13fe33
AD
181582001-08-03 Akim Demaille <akim@epita.fr>
18159
18160 * src/complain.c: Adjust strerror_r portability issues.
18161
b37ba92c
AD
181622001-08-03 Akim Demaille <akim@epita.fr>
18163
18164 Version 1.28a.
18165
b0ce6046
AD
181662001-08-03 Akim Demaille <akim@epita.fr>
18167
18168 * src/getargs.c, src/getarg.h (skeleton)): Constify.
18169 * src/lex.c (literalchar): Avoid name clashes on `buf'.
18170 * src/getargs.c: Include complain.h.
18171 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
18172 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
18173
d01c415b
AD
181742001-08-03 Akim Demaille <akim@epita.fr>
18175
18176 * src/reader.c (readgram): Display hidden chars in error messages.
18177
459dd1a6
AD
181782001-08-03 Akim Demaille <akim@epita.fr>
18179
18180 Update to gettext 0.10.39.
18181
53b74c0c
AD
181822001-08-03 Akim Demaille <akim@epita.fr>
18183
18184 * lib/strspn.c: New.
18185
234a3be3
AD
181862001-08-01 Marc Autret <autret_m@epita.fr>
18187
18188 * doc/bison.texinfo: Update.
18189 * doc/bison.1 (mandoc): Update.
18190 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
18191 * src/files.c: Support output files extensions computing.
18192 (src_extension): New static variable.
18193 (header_extension): New static variable.
18194 (tr): New function.
18195 (get_extension_index): New function, gets the index of an extension
18196 filename in a string.
18197 (compute_exts_from_gf): New function, computes extensions from the
18198 grammar file extension.
18199 (compute_exts_from_src): New functions, computes extensions from the
18200 C source file extension, file given by ``-o'' option.
18201 (compute_base_names): Update.
18202 (output_files): Update.
18203
847bf1f5
AD
182042001-08-01 Robert Anisko <anisko_r@epita.fr>
18205
d995fee7 18206 * doc/bison.texi: Document @$.
847bf1f5
AD
18207 (Locations): New section.
18208
d074a105
AD
182092001-07-18 Akim Demaille <akim@epita.fr>
18210
18211 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
18212 * config/prev-version.txt, config/move-if-change: New.
18213 * Makefile.am: Adjust.
18214
3419715d
AD
182152001-07-08 Pascal Bart <pascal.bart@epita.fr>
18216
18217 * src/bison.simple (yyparse): Suppress warning `comparaison
18218 between signed and unsigned'.
18219
62ab6972
AD
182202001-07-05 Pascal Bart <pascal.bart@epita.fr>
18221
18222 * src/getargs.h (raw_flag): Remove.
18223 * src/getargs.c: Die on `-r'/`--raw'.
18224 * src/lex.c (parse_percent_token): Die on `%raw'.
18225 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
18226 * tests/calc.at: Suppress test with option `--raw'.
18227
1e24cc5b
AD
182282001-07-14 Akim Demaille <akim@epita.fr>
18229
18230 * config/: New.
18231 * configure.in: Require Autoconf 2.50.
18232 Update to gettext 0.10.38.
18233
32dfccf8
AD
182342001-03-16 Akim Demaille <akim@epita.fr>
18235
18236 * doc/bison.texinfo: ANSIfy the examples.
18237
cd5bd6ac
AD
182382001-03-16 Akim Demaille <akim@epita.fr>
18239
18240 * getargs.c (skeleton): New variable.
18241 (longopts): --skeleton is a new option.
18242 (shortopts, getargs): -S is a new option.
18243 * getargs.h: Declare skeleton.
18244 * output.c (output_parser): Use it.
18245
5141b016
AD
182462001-03-16 Akim Demaille <akim@epita.fr>
18247
18248 * m4/strerror_r.m4: New.
18249 * m4/error.m4: Run AC_FUNC_STRERROR_R.
18250 * lib/error.h, lib/error.c: Update.
18251
447992b9
AD
182522001-03-16 Akim Demaille <akim@epita.fr>
18253
18254 * src/getargs.c (longopts): Clean up.
18255
274d42ce
AD
182562001-02-21 Akim Demaille <akim@epita.fr>
18257
18258 * src/reader.c (gensym): `gensym_count' is your own.
18259 Use a static buf to create the symbol name, as token_buffer is no
18260 longer a buffer.
18261
22c821f3
AD
182622001-02-08 Akim Demaille <akim@epita.fr>
18263
18264 * src/conflicts.c (conflict_report): Be sure not to append to res
18265 between two calls, which could happen if both first sprintf were
18266 skipped, but not the first cp += strlen.
18267
18569462
AD
182682001-02-08 Akim Demaille <akim@epita.fr>
18269
18270 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
18271 New, from fileutils 4.0.37.
18272 * configure.in: Require Autoconf 2.49c. I took some time before
18273 making this decision. This is the only way out for portability
18274 issues in Bison, it would mean way too much duplicate effort to
18275 import in Bison features implemented in 2.49c since 2.13.
18276 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
18277
0d8f3c8a
AD
182782001-02-02 Akim Demaille <akim@epita.fr>
18279
18280 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 18281 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 18282
f17bcd1f
AD
182832001-01-19 Akim Demaille <akim@epita.fr>
18284
18285 Get rid of the ad hoc handling of token_buffer in the scanner: use
18286 the obstacks.
18287
18288 * src/lex.c (token_obstack): New.
18289 (init_lex): Initialize it. No longer call...
18290 (grow_token_buffer): this. Remove it.
18291 Adjust all the places which used it to use the obstack.
18292
511e79b3
AD
182932001-01-19 Akim Demaille <akim@epita.fr>
18294
18295 * src/lex.h: Rename all the tokens:
18296 s/\bENDFILE\b/tok_eof/g;
18297 s/\bIDENTIFIER\b/tok_identifier/g;
18298 etc.
18299 Let them be enums, not #define, to ease debugging.
18300 Adjust all the code.
18301
0d6508ef
AD
183022001-01-18 Akim Demaille <akim@epita.fr>
18303
18304 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
18305 * src/lex.c (maxtoken, grow_token_buffer): Static.
18306
6deb4447
AD
183072001-01-18 Akim Demaille <akim@epita.fr>
18308
18309 Since we now use obstacks, more % directives can be enabled.
18310
18311 * src/lex.c (percent_table): Also accept `%yacc',
18312 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
18313 `%debug'.
18314 Handle the actions for `%semantic_parser' and `%pure_parser' here,
18315 instead of returning a token.
18316 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
18317 * src/reader.c (read_declarations): Adjust.
18318 * src/files.c (open_files): Don't call `compute_base_names', don't
18319 compute `attrsfile' since they depend upon data which might be
18320 *in* the input file now.
18321 (output_files): Do it here.
18322 * src/output.c (output_headers): Document the fact that this patch
18323 introduces a guaranteed SEGV for semantic parsers.
18324 * doc/bison.texinfo: Document them.
18325 * tests/suite.at: Exercise these %options.
18326
ff4423cc
AD
183272000-12-20 Akim Demaille <akim@epita.fr>
18328
18329 Also handle the output file (--verbose) with obstacks.
18330
18331 * files.c (foutput): Remove.
18332 (output_obstack): New.
18333 Adjust all dependencies.
18334 * src/conflicts.c: Return a string.
18335 * src/system.h (obstack_grow_string): Rename as...
18336 (obstack_sgrow): this. Be ready to work with non literals.
18337 (obstack_fgrow4): New.
18338
956dba3a
AD
183392000-12-20 Akim Demaille <akim@epita.fr>
18340
18341 * src/files.c (open_files): Fix the computation of short_base_name
18342 in the case of `-o foo.tab.c'.
18343
337bab46
AD
183442000-12-20 Akim Demaille <akim@epita.fr>
18345
18346 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
18347 (copy_dollar): Now that everything uses obstacks, get rid of the
18348 FILE * parameters.
18349
5d3214b8
AD
183502000-12-20 Akim Demaille <akim@epita.fr>
18351
18352 * src/files.c (open_files): Actually the `.output' file is based
18353 on the short_base_name, not base_name.
18354 * tests/suite.at (Checking output file names): Adjust.
18355
29092a57
AD
183562000-12-20 Akim Demaille <akim@epita.fr>
18357
18358 * src/bison.s1: Remove, we now use directly...
18359 * src/bison.simple: this.
18360 * src/Makefile.am: Use pkgdata instead of data.
18361
ea5607fd
AD
183622000-12-20 Akim Demaille <akim@epita.fr>
18363
18364 * src/files.c (guard_obstack): New.
18365 (open_files): Initialize it.
18366 (output_files): Dump it...
18367 * src/files.h: Export it.
18368 * src/reader.c (copy_guard): Use it.
18369
27110317
AD
183702000-12-19 Akim Demaille <akim@epita.fr>
18371
18372 * src/files.c (outfile, defsfile, actfile): Removed as global
18373 vars.
18374 (open_files): Don't compute them.
18375 (output_files): Adjust.
18376 (base_name, short_base_name): Be global.
18377 Adjust dependencies.
18378
19c50364
AD
183792000-12-19 Akim Demaille <akim@epita.fr>
18380
18381 * src/files.c (strsuffix): New.
18382 (stringappend): Be just like strcat but allocate.
18383 (base_names): Eve out from open_files.
18384 Try to simplify the rather hairy computation of base_name and
18385 short_base_name.
18386 (open_files): Use it.
18387 * tests/suite.at (Checking output file names): New test.
18388
573c1d9f
AD
183892000-12-19 Akim Demaille <akim@epita.fr>
18390
18391 * src/system.h (obstack_grow_literal_string): Rename as...
18392 (obstack_grow_string): this.
18393 * src/output.c (output_parser): Recognize `%% actions' instead of
18394 `$'.
18395 * src/bison.s1: s/$/%% actions/.
18396 * src/bison.hairy: Likewise.
18397
ef7ddedd
AD
183982000-12-19 Akim Demaille <akim@epita.fr>
18399
18400 * src/output.c (output_parser): Compute the `#line' lines when
18401 there are.
18402 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
18403 Suggested by Hans Aberg.
18404
ff61dabd
AD
184052000-12-19 Akim Demaille <akim@epita.fr>
18406
18407 Let the handling of the skeleton files be local to the procedures
18408 that use it.
18409
18410 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
18411 longer static.
18412 (fparser, open_extra_files): Remove.
18413 (open_files, output_files): Don't take care of fparser.
18414 * src/files.h: Adjust.
18415 * src/output.c (output_parser): Open and close the file to the
18416 skeleton.
18417 * src/reader.c (read_declarations): When %semantic_parser, open
18418 fguard.
18419
55b96341
AD
184202000-12-19 Akim Demaille <akim@epita.fr>
18421
18422 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
18423 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
18424
358c15b7
AD
184252000-12-19 Akim Demaille <akim@epita.fr>
18426
18427 * src/files.c (open_files): Yipee! We no longer need all the code
18428 looking for `/tmp' since we have no tmp file.
18429
7de3329e
AD
184302000-12-19 Akim Demaille <akim@epita.fr>
18431
18432 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
18433 New macros.
18434 * src/files.c (open_files): Less dependency on MSDOS etc.
18435
3abcd459
AD
184362000-12-14 Akim Demaille <akim@epita.fr>
18437
18438 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
18439 Provide a default definition.
18440 Use it when executing the default @ action.
18441 * src/reader.c (reader_output_yylsp): No longer include
18442 `timestamp' and `text' in the default YYLTYPE.
18443
2a91a95e
AD
184442000-12-12 Akim Demaille <akim@epita.fr>
18445
18446 * src/reader.c (copy_definition, parse_union_decl, copy_action)
18447 (copy_guard): Quote the file names.
18448 Reported by Laurent Mascherpa.
18449
14d3eb9b
AD
184502000-12-12 Akim Demaille <akim@epita.fr>
18451
18452 * src/output.c (output_headers, output_program, output): Be sure
18453 to escape special characters when outputting filenames.
18454 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
18455 (output_headers): Don't depend on them, Use ACTSTR.
18456
d7045ec6
AD
184572000-11-17 Akim Demaille <akim@epita.fr>
18458
18459 * lib/obstack.h: Formatting changes.
18460 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
18461 prevents type checking.
18462 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
18463 cast the value to (void *): assigning a `foo *' to a `void *'
18464 variable is valid.
18465 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
18466 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
18467 append characters.
18468
6fd54b73
AD
184692000-11-17 Akim Demaille <akim@epita.fr>
18470
18471 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
18472 as...
18473 (suite.m4, regression.m4, calc.m4): these.
18474 * tests/atgeneral.m4: Update from CVS Autoconf.
18475
4c50eae6
AD
184762000-11-17 Akim Demaille <akim@epita.fr>
18477
18478 * tests/regression.m4 (%union and --defines): New test,
18479 demonstrating a current bug in the obstack implementation.
18480
a35f64ea
AD
184812000-11-17 Akim Demaille <akim@epita.fr>
18482
18483 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
18484 macros.
18485 Use them to declare the variables which are global or local to
18486 `yyparse'.
18487
7de23534
AD
184882000-11-17 Akim Demaille <akim@epita.fr>
18489
18490 * acconfig.h: Remove, no longer used.
18491
aa7815f5
AD
184922000-11-07 Akim Demaille <akim@epita.fr>
18493
18494 * src: s/Copyright (C)/Copyright/g.
18495
5af1f549
AD
184962000-11-07 Akim Demaille <akim@epita.fr>
18497
18498 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
18499 defining.
18500 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
18501
553e2b22
AD
185022000-11-07 Akim Demaille <akim@epita.fr>
18503
18504 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
18505 Merge in a single CPP if/else.
18506
8a4f41d6
AD
185072000-11-07 Akim Demaille <akim@epita.fr>
18508
18509 * src/output.c (output): Remove useless variables.
18510 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
18511 argument `data' for consistency with the prototypes.
18512 Qualify it `const'.
18513 (obstack_copy, obstack_copy0): Rename the second argument as
18514 `address' for consistency. Qualify it `const'.
18515 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
18516 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
18517 `const' their input argument (`data' or `address').
18518 Adjust the corresponding macros to include `const' in casts.
18519
095a3fb5
AD
185202000-11-03 Akim Demaille <akim@epita.fr>
18521
18522 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
18523 s/PFILE1/BISON_HAIRY/.
18524 Adjust dependencies.
18525
d1cdce7c
AD
185262000-11-03 Akim Demaille <akim@epita.fr>
18527
090c5ebf 18528 For some reason, this was not applied.
d1cdce7c
AD
18529
18530 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18531 `unlink': it's no longer used.
18532
9311529b
AD
185332000-11-03 Akim Demaille <akim@epita.fr>
18534
18535 * src/files.c (skeleton_find): New function, eved out of...
18536 (open_files, open_extra_files): here.
18537
d8880f69
AD
185382000-11-03 Akim Demaille <akim@epita.fr>
18539
18540 Don't use `atexit'.
18541
18542 * src/files.c (obstack_save): New function.
18543 (done): Rename as...
18544 (output_files): this.
18545 Use `obstack_save'.
18546 * src/main.c (main): Don't use `atexit' to register `done', since
18547 it no longer has to remove tmp files, just call `output_files'
18548 when there are no errors.
18549
0dbb648e
AD
185502000-11-02 Akim Demaille <akim@epita.fr>
18551
18552 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18553 `unlink': it's no longer used.
18554 * src/files.h: Formatting changes.
18555
896fe5c1
AD
185562000-11-02 Akim Demaille <akim@epita.fr>
18557
18558 Remove the last uses of mktemp and unlink/delete.
18559
18560 * src/files.c (fdefines, ftable): Removed.
18561 (defines_ostack, table_obstack): New.
18562 Adjust dependencies of the former into uses of the latter.
18563 * src/output.c (output_short_or_char_table, output_short_table):
18564 Convert to using obstacks.
18565 * src/reader.c (copy_comment2): Accept one FILE * and two
18566 obstacks.
18567 (output_token_defines, reader_output_yylsp): Use obstacks.
18568 * src/system.h (obstack_fgrow3): New.
1f65350a 18569 * po/POTFILES.in: Adjust.
896fe5c1 18570
dd60faec
AD
185712000-11-01 Akim Demaille <akim@epita.fr>
18572
18573 Change each use of `fattrs' into a use of `attrs_obstack'.
18574
18575 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
18576 * src/files.c (fattrs): Remove.
18577 (attrs_obstack): New.
18578 Adjust all dependencies.
18579 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
18580
8c7ebe49
AD
185812000-11-01 Akim Demaille <akim@epita.fr>
18582
18583 Introduce obstacks.
18584 Change each use of `faction' into a use of `action_obstack'.
18585
18586 * lib/obstack.h, lib/obstack.c: New files.
18587 * src/files.c (faction): Remove.
18588 (action_obstack): New.
18589 Adjust all dependencies.
18590
77aee789
AD
185912000-10-20 Akim Demaille <akim@epita.fr>
18592
18593 * lib/quote.h (PARAMS): New macro. Use it.
18594
43591cec
AD
185952000-10-16 Akim Demaille <akim@epita.fr>
18596
18597 * src/output.c (output_short_or_char_table): New function.
18598 (output_short_table, output_token_translations): Use it.
18599 (goto_actions): Use output_short_table.
18600
1e9798d5
AD
186012000-10-16 Akim Demaille <akim@epita.fr>
18602
18603 * src/symtab.c (bucket_new): New function.
18604 (getsym): Use it.
18605
18606 * src/output.c (output_short_table): New argument to display the
18607 comment associated with the table.
18608 Adjust dependencies.
18609 (output_gram): Use it.
18610 (output_rule_data): Nicer output layout for YYTNAME.
18611
f282676b
AD
186122000-10-16 Akim Demaille <akim@epita.fr>
18613
18614 * src/lex.c (read_typename): New function.
18615 (lex): Use it.
18616 * src/reader.c (copy_dollar): Likewise.
18617
550a72a3
AD
186182000-10-16 Akim Demaille <akim@epita.fr>
18619
18620 * src/reader.c (copy_comment2): Expect the input stream to be on
18621 the `/' which is suspected to open a comment, instead of being
18622 called after `//' or `/*' was read.
18623 (copy_comment, copy_definition, parse_union_decl, copy_action)
18624 (copy_guard): Adjust.
18625
131e2fef
AD
186262000-10-16 Akim Demaille <akim@epita.fr>
18627
18628 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
18629 `read_signed_integer'.
18630
79282c5a
AD
186312000-10-16 Akim Demaille <akim@epita.fr>
18632
18633 * src/reader.c (copy_dollar): New function.
18634 (copy_guard, copy_action): Use it.
18635
ff4a34be
AD
186362000-10-16 Akim Demaille <akim@epita.fr>
18637
18638 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
18639 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
18640 New files, from Fileutils 4.0.27.
18641 * src/main.c (printable_version): Remove.
18642 * src/lex.c, src/reader.c: Use `quote'.
18643
186442000-10-04 Akim Demaille <akim@epita.fr>
18645
18646 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
18647
14ded682
AD
186482000-10-04 Akim Demaille <akim@epita.fr>
18649
18650 * doc/bison.texinfo: Various typos spotted by Neil Booth.
18651
8e03724b
AD
186522000-10-04 Akim Demaille <akim@epita.fr>
18653
18654 When a literal string is used to define two different tokens,
18655 `bison -v' segfaults.
18656 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
18657
18658 * tests/regression.m4: New file.
18659 Include the core of the sample provided by Piotr Gackiewicz.
18660 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
18661 properly.
18662
a9e64249
AD
186632000-10-04 Akim Demaille <akim@epita.fr>
18664
18665 * src/reader.c (parse_expect_decl): Keep `count' within the size
18666 of `buffer'.
18667 From Neil Booth.
18668
da9abf43
AD
186692000-10-02 Paul Eggert <eggert@twinsun.com>
18670
18671 * bison.s1 (yyparse): Assign the default value
18672 unconditionally, to avoid a GCC warning and make the parser a
18673 tad smaller.
18674
c33638bb
AD
186752000-10-02 Akim Demaille <akim@epita.fr>
18676
18677 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
18678 options.
18679
444c570a
AD
186802000-10-02 Akim Demaille <akim@epita.fr>
18681
18682 * src/derives.c, src/print.c, src/reduce.c: To ease the
18683 translation, move some `\n' out of the translated strings.
18684
89cab50d
AD
186852000-10-02 Akim Demaille <akim@epita.fr>
18686
18687 The location tracking mechanism is precious for parse error
18688 messages. Nevertheless, it is enabled only when `@n' is used in
18689 the grammar, which is a different issue (you can use it in error
18690 message, but not in the grammar per se). Therefore, there should
18691 be another means to enable it.
18692
18693 * src/getargs.c (getargs): Support `--locations'.
18694 (usage): Report it.
18695 * src/getargs.h (locationsflag): Export it.
18696 * src/lex.c (percent_table): Support `%locations'.
18697 * src/reader.c (yylsp_needed): Remove this variable, now replaced
18698 with `locationsflag'.
18699 * doc/bison.texinfo: Document `--locations' and `%locations'.
18700 Sort the options.
18701 * tests/calc.m4: Test it.
18702
18703 For regularity of the names, replace each
18704 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
18705 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
18706 In addition replace each `flag' with `_flag'.
18707
d6c2cba0
AD
187082000-10-02 Akim Demaille <akim@epita.fr>
18709
18710 Also test parse error messages, including with YYERROR_VERBOSE.
18711
18712 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
18713 associative).
18714 Use it to check the computations.
18715 Use it to check `nonassoc' is honored.
18716 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
18717 `--yyerror-verbose'.
18718 (_AT_CHECK_CALC): Adjust to this option.
18719 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
18720
5a35a6cb
AD
187212000-10-02 Akim Demaille <akim@epita.fr>
18722
18723 Test also `--verbose', `--defines' and `--name-prefix'. Testing
18724 the latter demonstrates a flaw in the handling of non debugging
18725 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
18726 was used in order to simplify:
18727
18728 #if YYDEBUG
18729 if (yydebug)
18730 {
18731 ...
18732 }
18733 #endif
18734
18735 into
18736
18737 if (yydebug)
18738 {
18739 ...
18740 }
18741
18742 unfortunately this leads to a CPP conflict when
18743 `--name-prefix=foo' is used since it produces `#define yydebug
18744 foodebug'.
18745
18746 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
18747 (YYDPRINTF): New macro.
18748 Spread its use.
18749 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
18750 the bison options.
18751 Also test `--verbose', `--defines' and `--name-prefix'.
18752
71da9eea
AD
187532000-10-02 Akim Demaille <akim@epita.fr>
18754
18755 Improve the readability of the produced parsers.
18756
18757 * src/bison.s1: Formatting changes.
18758 Improve the comment related to the `$' mark.
18759 (yydefault): Don't fall through to `yyresume': `goto' there.
18760 * src/output.c (output_parser): When the `$' is met, skip the end
18761 of its line.
18762 New variable, `number_of_dollar_signs', to check there's exactly
18763 one `$' in the parser skeleton.
18764
95e36146
AD
187652000-10-02 Akim Demaille <akim@epita.fr>
18766
18767 * lib/xstrdup.c: New file, from the fileutils.
18768 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
18769 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
18770 instead of strlen + xmalloc + strcpy.
18771 * src/symtab.c (copys): Remove, use xstrdup instead.
18772
d7020c20
AD
187732000-10-02 Akim Demaille <akim@epita.fr>
18774
18775 * src/gram.h (associativity): New enum type which replaces the
18776 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
18777 `right_assoc', `left_assoc' and `non_assoc'.
18778 Adjust all dependencies.
18779 * src/reader.c: Formatting changes.
18780 (LTYPESTR): Don't define it, use it as a literal in
18781 `reader_output_yylsp'.
18782 * src/symtab.h (symbol_class): New enum type which replaces the
18783 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
18784 `sunknown', `stoken and `snterm'.
18785
1916f98e
AD
187862000-10-02 Akim Demaille <akim@epita.fr>
18787
18788 * src/getargs.c (fixed_outfiles): Rename as...
18789 (yaccflag): for consistency and accuracy.
18790 Adjust dependencies.
18791
d7913476
AD
187922000-10-02 Akim Demaille <akim@epita.fr>
18793
18794 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
18795 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
18796 difficult and introduced a lot of core dump. It turns out that
18797 Bison used an implementation of `xmalloc' based on `calloc', and
18798 at various places it does depend upon the initialization to 0. I
18799 have not tried to isolate the pertinent places, and all the former
18800 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
18801 someone should address this issue.
18802
18803 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
18804 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
18805 files.
18806 Adjust dependencies.
18807 * src/warshall.h: New file.
18808 Propagate.
18809
340ef489
AD
188102000-10-02 Akim Demaille <akim@epita.fr>
18811
18812 Various anti-`extern in *.c' changes.
18813
18814 * src/system.h: Include `assert.h'.
18815
b2ca4022
AD
188162000-10-02 Akim Demaille <akim@epita.fr>
18817
18818 * src/state.h (nstates, final_state, first_state, first_shift)
18819 (first_reduction): Move their exportation from here...
18820 * src/LR0.h: to here.
18821 Adjust dependencies.
18822 * src/getargs.c (statisticsflag): New variable.
18823 Add support for `--statistics'.
18824 Adjust dependencies.
18825
18826 Remove a lot of now useless `extern' statements in most files.
18827
403b315b
AD
188282000-10-02 Akim Demaille <akim@epita.fr>
18829
18830 * src/LR0.h: New file.
18831 Propagate its use.
18832
07a58c13
AD
188332000-10-02 Akim Demaille <akim@epita.fr>
18834
18835 * src/print.h: New file.
18836 Propagate its use.
18837 * src/print.c: Formatting and ordering changes.
18838 (verbose, terse): Replace with...
18839 (print_results): this new function.
18840 Adjust dependencies.
18841
0619caf0
AD
188422000-10-02 Akim Demaille <akim@epita.fr>
18843
18844 * src/conflicts.c (conflict_report): New function.
18845 (conflict_log, verbose_conflict_log): Replace with...
18846 (print_conflicts): this function.
18847 Adjust dependencies.
18848 * src/conflicts.h: New file.
18849 Propagate its inclusion.
18850
3519ec76
AD
188512000-10-02 Akim Demaille <akim@epita.fr>
18852
18853 * src/nullable.h: New file.
18854 Propagate its inclusion.
18855 * src/nullable.c: Formatting changes.
18856
015acc48
AD
188572000-10-02 Akim Demaille <akim@epita.fr>
18858
18859 * src/reduce.h: New file.
18860 Propagate its inclusion.
18861 * src/reduce.c: Topological sort and other formatting changes.
18862 (bool, TRUE, FALSE): Move their definition to...
18863 * src/system.h: here.
18864
8963a27b
AD
188652000-10-02 Akim Demaille <akim@epita.fr>
18866
18867 * src/files.c: Formatting changes.
18868 (tryopen, tryclose, openfiles): Rename as...
18869 (xfopen, xfclose, open_files): this.
18870 (stringappend): static.
18871 * src/files.h: Complete the list of exported symbols.
18872 Propagate its use.
18873
a70083a3
AD
188742000-10-02 Akim Demaille <akim@epita.fr>
18875
18876 * src/reader.h: New file.
18877 Propagate its use instead of tedious list of `extern' and
18878 prototypes.
18879 * src/reader.c: Formatting changes, topological sort,
18880 s/register//.
18881
abadc117
AD
188822000-10-02 Akim Demaille <akim@epita.fr>
18883
18884 * src/lex.h: Prototype `lex.c' exported functions.
18885 * src/reader.c: Adjust.
18886 * src/lex.c: Formatting changes.
18887 (safegetc): Rename as...
18888 (xgetc): this.
18889
720d742f
AD
188902000-10-02 Akim Demaille <akim@epita.fr>
18891
18892 * src/lalr.h: New file.
18893 Propagate its inclusion instead of prototypes and `extern'.
18894 * src/lalr.c: Formatting changes, topological sorting etc.
18895
f2acea59
AD
188962000-10-02 Akim Demaille <akim@epita.fr>
18897
18898 * src/output.c (token_actions): Introduce a temporary array,
18899 YYDEFACT, that makes it possible for this function to use
18900 output_short_table.
18901
d019d655
AD
189022000-10-02 Akim Demaille <akim@epita.fr>
18903
18904 `user_toknums' is output as a `short[]' in `output.c', while it is
18905 defined as a `int[]' in `reader.c'. For consistency with the
18906 other output tables, `user_toknums' is now defined as a table of
18907 shorts.
18908
18909 * src/reader.c (user_toknums): Be a short table instead of an int
18910 table.
18911 Adjust dependencies.
18912
18913 Factor the short table outputs.
18914
18915 * src/output.c (output_short_table): New function.
18916 * src/output.c (output_gram, output_stos, output_rule_data)
18917 (output_base, output_table, output_check): Use it.
18918
6c89f1c1
AD
189192000-10-02 Akim Demaille <akim@epita.fr>
18920
18921 * src/output.c (output): Topological sort of the functions, in
18922 order to get rid of the `static' prototypes.
18923 No longer use `register'.
18924 * src/output.h: New file.
18925 Propagate its inclusion in files explicitly prototyping functions
18926 from output.c.
18927
d9efd181
AD
189282000-09-21 Akim Demaille <akim@epita.fr>
18929
18930 * src/atgeneral.m4: Update from Autoconf.
18931
c29240e7 189322000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
18933
18934 * src/closure.h: New file.
18935 * src/closure.c: Formatting changes, topological sort over the
18936 functions, use of closure.h.
18937 (initialize_closure, finalize_closure): Rename as...
18938 (new_closure, free_closure): these. Adjust dependencies.
18939 * src/LR0.c: Formatting changes, topological sort, use of
18940 cloture.h.
18941 (initialize_states): Rename as...
18942 (new_states): this.
18943 * src/Makefile.am (noinst_HEADERS): Adjust.
18944
499daa50
AD
189452000-09-20 Akim Demaille <akim@epita.fr>
18946
18947 * src/acconfig.h: Don't protect config.h against multiple
18948 inclusion.
18949 Don't define PARAMS.
18950 * src/system.h: Define PARAMS.
18951 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
18952 purpose of config.h. system.h must not try to fix wrong
18953 definitions in config.h.
18954
cc84fd5d
AD
189552000-09-20 Akim Demaille <akim@epita.fr>
18956
18957 * src/derives.h: New file.
18958 * src/main.c, src/derives.h: Use it.
18959 Formatting changes.
18960 * src/Makefile.am (noinst_HEADERS): Adjust.
18961
db5b3a89
AD
189622000-09-20 Akim Demaille <akim@epita.fr>
18963
18964 * tests/atgeneral.m4: Update from Autoconf.
18965 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
18966 (AT_CHECK_CALC): New macros.
18967 Use these macros to test bison with options `', `--raw',
18968 `--debug', `--yacc', `--yacc --debug'.
18969
ceed8467
AD
189702000-09-19 Akim Demaille <akim@epita.fr>
18971
18972 * src/output.c: Formatting changes.
18973 * src/machine.h: Remove, leaving its contents in...
18974 * src/system.h: here.
18975 Include stdio.h.
18976 Adjust all dependencies on stdio.h and machine.h.
18977 * src/getargs.h: New file.
18978 Let all `extern' declarations about getargs.c be replaced with
18979 inclusion of `getargs.h'.
18980 * src/Makefile.am (noinst_HEADERS): Adjust.
18981
18982 * tests/calc.m4 (yyin): Be initialized in main, not on the global
18983 scope.
18984 (yyerror): Returns void, not int.
18985 * doc/bison.texinfo: Formatting changes.
18986
05a1d24b
AD
189872000-09-19 Akim Demaille <akim@epita.fr>
18988
18989 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
18990 portable.
18991
cbd25751
AD
189922000-09-18 Akim Demaille <akim@epita.fr>
18993
18994 * configure.in: Append WARNING_CFLAGS to CFLAGS.
18995 * src/Makefile.am (INCLUDES): Don't.
18996 Be ready to fetch headers in lib/.
18997
13863333
AD
189982000-09-18 Akim Demaille <akim@epita.fr>
18999
19000 * doc/bison.texinfo: Update the copyright.
19001 ANSIfy and GNUify the examples.
19002 Remove the old menu.
19003
0d533154
AD
190042000-09-18 Akim Demaille <akim@epita.fr>
19005
19006 First set of tests: use the `calc' example from the documentation.
19007
19008 * src/bison.s1 (yyparse): Condition the code using `yytname' which
19009 is defined only when YYDEBUG is.
19010 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
19011 * src/files.c (tryopen, tryclose): Formatting changes.
19012 Move to the top and be static.
19013 * src/reader.c (read_signed_integer): Likewise.
19014 * tests/calc.m4: New file.
19015 * Makefile.am, suite.m4: Adjust.
19016 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
19017
e79137ac
AD
190182000-09-18 Akim Demaille <akim@epita.fr>
19019
19020 Add support for an Autotest test suite for Bison.
19021
19022 * m4/m4.m4, m4/atconfig.m4: New files.
19023 * m4/Makefile.am (EXTRA_DIST): Adjust.
19024 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
19025 files.
19026 * src/getargs.c: Display a more standard --version message.
19027 * src/reader.c (reader): Formatting changes.
19028 No longer depend upon VERSION_STRING.
19029 * configure.in: No longer use `dnl'.
19030 Set up the test suite and the new directory `tests/.
19031 (VERSION_STRING): Remove.
19032
27821bff
AD
190332000-04-14 Akim Demaille <akim@epita.fr>
19034
19035 * src/reader.c (copy_comment2): New function, same as former
19036 `copy_comment', but outputs into two FILE *.
19037 (copy_comment): Use it.
19038 (parse_union_decl): Use it.
19039 (get_type, parse_start_decl): Use the same `invalid' message.
19040 (parse_start_decl, parse_union_decl): Use the same `multiple'
19041 message.
19042 (parse_union_decl, copy_guard, copy_action): Use the same
19043 `unmatched' message.
19044 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
19045
cfe5fbc0
AD
190462000-03-31 Akim Demaille <akim@epita.fr>
19047
19048 * src/files.c (tryopen, tryclose): Move to the top.
19049 Be static.
19050
cb7db13e
AD
190512000-03-31 Akim Demaille <akim@epita.fr>
19052
19053 * src/main.c (main): Don't call `done', exit does it.
19054
a0f6b076
AD
190552000-03-31 Akim Demaille <akim@epita.fr>
19056
36281465
AD
19057 * allocate.c: s/return (foo)/return foo/.
19058 * lalr.c: Likewise.
19059 * LR0.c: Likewise.
19060 * output.c: Likewise.
19061 * reader.c: Likewise.
19062 * symtab.c: Likewise.
19063 * vmsgetargs.c: Likewise.
19064
190652000-03-31 Akim Demaille <akim@epita.fr>
19066
19067 Clean up the error reporting functions.
a0f6b076
AD
19068
19069 * src/report.c: New file.
19070 * src/report.h: Likewise.
19071 * src/Makefile.am: Adjust.
19072 * m4/error.m4: New file.
19073 * m4/Makefile.am: Adjust.
19074 * configure.in (jm_PREREQ_ERROR): Call it.
19075 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
19076 Remove.
19077 (fatal, fatals): Remove. All callers use complain.c::fatal.
19078 (warn, warni, warns, warnss, warnss): Remove. All callers use
19079 complain.c::complain.
19080 (toomany): Remove, use fatal instead.
19081 * src/files.c (done): No argument, use complain_message_count.
19082 * src/main.c (main): Register `done' to `atexit'.
19083
19084 * src/getargs.c (usage): More `fputs', less `fprintf'.
19085
18539825
AD
190862000-03-28 Akim Demaille <akim@epita.fr>
19087
19088 * lib/: New directory.
19089 * Makefile.am (SUBDIRS): Adjust.
19090 * configure.in: Adjust.
19091 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
19092 useless.
19093 * src/alloca.c: Moved to lib/.
19094 * src/getopt.c: Likewise.
19095 * src/getopt1.c: Likewise.
19096 * src/getopt.h: Likewise.
19097 * src/ansi2knr.c: Likewise.
19098 * src/ansi2knr.1: Likewise.
19099 * src/Makefile.am: Adjust.
19100 * lib/Makefile.am: New file.
19101
9f306f2a
AD
191022000-03-28 Akim Demaille <akim@epita.fr>
19103
19104 * src/getargs.c (usage): Refresh the help message.
19105
0ba347b6
AD
191062000-03-17 Akim Demaille <akim@epita.fr>
19107
19108 * src/getopt1.c: Updated from textutils 2.0e
19109 * src/getopt.c: Likewise.
19110 * src/getopt.h: Likewise.
19111
dbe7f271
AD
191122000-03-17 Akim Demaille <akim@epita.fr>
19113
19114 * src/Makefile.am (bison.simple): Fix the awk program: quote only
19115 the file name, not the whole `#line LINE FILE'.
19116
75bbe78d
AD
191172000-03-17 Akim Demaille <akim@epita.fr>
19118
19119 On syntax errors, report the token on which we choked.
19120
aa5fd0ee
AD
19121 * src/bison.s1 (yyparse): In the label yyerrlab, when
19122 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 19123
7b306f52
AD
191242000-03-17 Akim Demaille <akim@epita.fr>
19125
aa5fd0ee 19126 * src/reader.c (copy_at): New function.
7b306f52
AD
19127 (copy_guard): Use it.
19128 (copy_action): Use it.
19129
e87b5700
AD
191302000-03-17 Akim Demaille <akim@epita.fr>
19131
19132 Be kind to translators, save some useless translations.
19133
aa5fd0ee 19134 * src/main.c (banner): New function.
e87b5700
AD
19135 (fatal_banner): Use it.
19136 (warn_banner): Use it.
19137
ae3c3164
AD
191382000-03-17 Akim Demaille <akim@epita.fr>
19139
aa5fd0ee
AD
19140 * src/reader.c (copy_definition): Use copy_string and
19141 copy_comment. Removed now unused `match', `ended',
19142 `cplus_comment'.
ae3c3164
AD
19143 (copy_comment, copy_string): Moved, to be visible from
19144 copy_definition.
19145
4dc58e7c
AD
191462000-03-17 Akim Demaille <akim@epita.fr>
19147
aa5fd0ee
AD
19148 * src/reader.c (copy_string): Declare `static inline'. No
19149 problems with inline, since it is checked by configure.
4dc58e7c
AD
19150 (copy_comment): Likewise.
19151
0a6384c4
AD
191522000-03-17 Akim Demaille <akim@epita.fr>
19153
aa5fd0ee 19154 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 19155
3cef001a
AD
191562000-03-17 Akim Demaille <akim@epita.fr>
19157
aa5fd0ee 19158 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
19159 (copy_action): Use it. Removed now unused `match', `ended',
19160 `cplus_comment'.
19161 (copy_guard): Likewise.
19162
ca36d2ef
AD
191632000-03-17 Akim Demaille <akim@epita.fr>
19164
aa5fd0ee 19165 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
19166 (copy_action): Use it.
19167 (copy_guard): Likewise.
19168
6666f98f
AD
191692000-03-17 Akim Demaille <akim@epita.fr>
19170
19171 Change the handling of @s so that they behave exactly like $s.
19172 There is now a pseudo variable @$ (readble and writable), location
19173 of the lhs of the rule (by default ranging from the location of
19174 the first symbol of the rhs, to the location of the last symbol,
19175 or, if the rhs is empty, YYLLOC).
19176
19177 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
19178 yyval.
19179 (yyparse): When providing a default semantic action, provide a
19180 default location action.
19181 (after the $): No longer change `*YYLSP', just stack YYLOC the
19182 same way you stack YYVAL.
19183 * src/reader.c (read_declarations): Use warns.
19184 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
19185 (copy_action, case '@'): Likewise.
19186 Use a standard error message, to save useless work from
19187 translators.
19188
41aca2e0
AD
191892000-03-17 Akim Demaille <akim@epita.fr>
19190
aa5fd0ee
AD
19191 * src/bison.s1: Formatting and cosmetics changes.
19192 * src/reader.c: Likewise.
41aca2e0
AD
19193 Update the Copyright notice.
19194
dc08c1d5
AD
191952000-03-17 Akim Demaille <akim@epita.fr>
19196
aa5fd0ee
AD
19197 * src/bison.s1 (#line): All set to `#line' only, since the
19198 Makefile now handles them.
dc08c1d5 19199
9ee3c97b
AD
192002000-03-16 Akim Demaille <akim@epita.fr>
19201
19202 * src/output.c (output_rule_data): Output the documentation of
19203 some of the tables.
19204 (Copyright notice): Update.
19205 Formatting changes.
19206
0de741ca
AD
192072000-03-16 Akim Demaille <akim@epita.fr>
19208
19209 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
19210 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
19211 One `#if YYDEBUG' remains, since it uses variables which are
19212 defined only if `YYDEBUG != 0'.
19213
bb10be54
AD
192142000-03-16 Akim Demaille <akim@epita.fr>
19215
19216 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
19217 and related variables so that the similarities are highlighted.
19218
b07b484a
AD
192192000-03-16 Akim Demaille <akim@epita.fr>
19220
19221 * src/bison.s1: Properly indent CPP directives.
19222
361f60b3
AD
192232000-03-16 Akim Demaille <akim@epita.fr>
19224
19225 * src/bison.s1: Properly indent the `alloca' CPP section.
19226
8c44d3ec
AD
192272000-03-16 Akim Demaille <akim@epita.fr>
19228
19229 Do not hard code values of directories in `configure.in'.
19230 Update the `configure' tool chain.
19231
19232 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
19233 src/makefile.am.
19234 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
19235 (AC_OUTPUT): Add m4/Makefile.
19236 Bump to bison 1.28a, 1.29 has never been released.
19237 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
19238 handled via src/Makefile.am.
19239 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
19240 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
19241 autoheader.
19242 * Makefile.am (SUBDIRS): Add m4.
19243 (ACLOCAL_AM_FLAGS): New variable.
19244 (AUTOMAKE_OPTIONS): Add check-news.
19245 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
19246 the proper line number and file name.
19247 (DEFS): Propagate the location of bison library files and of the
19248 locale files.
19249 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
19250 builddir.
19251 * acinclude.m4: Remove, replaced by the directory m4.
19252 * m4/Makefile.am (EXTRA_DIST): New variable.
19253 * m4/gettext.m4: New file, from the fileutils.
19254 * m4/lcmessage.m4: Likewise
19255 * m4/progtest.m4: Likewise.
19256 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
19257
f95997e7
AD
192582000-03-10 Akim Demaille <akim@epita.fr>
19259
19260 * src/closure.c:
19261 Formatting changes of various comments.
19262 Respect the GNU coding standards at various places.
19263 Don't use `_()' when no translation is needed.
19264
192651999-12-13 Jesse Thilo <jthilo@gnu.org>
19266
19267 * src/files.c:
19268 OS/2 honors TMPDIR environment variable.
19269
192701999-12-13 Jesse Thilo <jthilo@gnu.org>
19271
19272 * doc/bison.texinfo: Tweaked spelling and grammar.
19273 Updated ISBN.
19274 Removed reference to price of printed copy.
19275 Mention BISON_SIMPLE and BISON_HAIRY.
19276
192771999-12-13 Jesse Thilo <jthilo@gnu.org>
19278
19279 * configure.in, NEWS:
19280 Bison 1.29 released.
19281
192821999-10-27 Jesse Thilo <jthilo@gnu.org>
19283
19284 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
19285 Added reference card.
19286
192871999-07-26 Jesse Thilo <jthilo@gnu.org>
19288
19289 * po/ru.po: Added Russian translation.
19290
192911999-07-26 Jesse Thilo <jthilo@gnu.org>
19292
19293 * configure.in: Added Russian translation.
19294
192951999-07-06 Jesse Thilo <jthilo@gnu.org>
19296
19297 * configure.in, NEWS, README:
19298 Released version 1.28.
19299
193001999-06-14 Jesse Thilo <jthilo@gnu.org>
19301
19302 * src/system.h:
19303 Squashed redefinition warning on some systems.
19304
19305 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
19306 Have configure build version string instead of relying on ANSI string
19307 concatentation.
19308
193091999-06-14 Jesse Thilo <jthilo@gnu.org>
19310
19311 * po/POTFILES.in: Got rid of version.c.
19312
193131999-06-14 Jesse Thilo <jthilo@gnu.org>
19314
19315 * acconfig.h, configure.in:
19316 Have configure build version string instead of relying on ANSI string
19317 concatentation.
19318
193191999-06-08 Jesse Thilo <jthilo@gnu.org>
19320
19321 * doc/bison.1:
19322 Dropped mention of `+' for long-named options.
19323
193241999-05-30 Jesse Thilo <jthilo@gnu.org>
19325
19326 * src/files.c: Added <unistd.h> for unlink().
19327
19328 * src/Makefile.am, src/system.h:
19329 I18n fixes.
19330
193311999-05-30 Jesse Thilo <jthilo@gnu.org>
19332
19333 * README: Added a FAQ list.
19334
19335 * configure.in, acconfig.h:
19336 I18n fixes.
19337
193381999-05-30 Jesse Thilo <jthilo@gnu.org>
19339
19340 * doc/FAQ, doc/Makefile.am:
19341 Added a FAQ list.
19342
193431999-05-19 Jesse Thilo <jthilo@gnu.org>
19344
19345 * src/alloc.h, src/symtab.h, src/version.c:
19346 Protected inclusion of "config.h" with HAVE_CONFIG_H.
19347
193481999-04-18 Jesse Thilo <jthilo@gnu.org>
19349
19350 * src/.cvsignore, src/Makefile.am:
19351 Reorganized: sources in `src', documentation in `doc'.
19352
19353 * src/lex.c (literalchar):
19354 fixed the code for escaping double quotes (thanks
19355 Jonathan Czisny.)
19356
193571999-04-18 Jesse Thilo <jthilo@gnu.org>
19358
19359 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
19360 Adjusted paths to reflect directory reorganization.
19361
193621999-04-18 Jesse Thilo <jthilo@gnu.org>
19363
19364 * doc/.cvsignore, doc/Makefile.am:
19365 Reorganized: sources in `src', documentation in `doc'.
19366
193671999-04-18 Jesse Thilo <jthilo@gnu.org>
19368
19369 * configure.in:
19370 Updated AC_INIT file to reflect directory reorganization.
19371
19372 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
19373 Reorganized: sources in `src', documentation in `doc'.
19374
193751999-04-13 Jesse Thilo <jthilo@gnu.org>
19376
19377 * src/allocate.c:
19378 Don't declare calloc() and realloc() if not necessary.
19379
193801999-04-13 Jesse Thilo <jthilo@gnu.org>
19381
19382 * configure.in, acconfig.h, acinclude.m4:
19383 Don't declare calloc() and realloc() if not necessary.
19384
193851999-03-23 Jesse Thilo <jthilo@gnu.org>
19386
19387 * po/.cvsignore: Added i18n support.
19388
193891999-03-23 Jesse Thilo <jthilo@gnu.org>
19390
19391 * acconfig.h, configure.in, Makefile.am:
19392 Added i18n support.
19393
193941999-03-22 Jesse Thilo <jthilo@gnu.org>
19395
19396 * src/bison.s1: Fixed #line numbers.
19397
193981999-03-15 Jesse Thilo <jthilo@gnu.org>
19399
19400 * po/es.po, po/fr.po, po/nl.po, po/de.po:
19401 Added PO files from Translation Project.
19402
194031999-03-03 Jesse Thilo <jthilo@gnu.org>
19404
19405 * Makefile.am:
19406 Added support for non-ANSI compilers (ansi2knr).
19407
194081999-02-16 Jesse Thilo <jthilo@gnu.org>
19409
19410 * configure.in: Bumped version number to 1.27.
19411
19412 * Makefile.am:
19413 Added `bison.simple' to list of files removed by `make distclean'.
19414
194151999-02-12 Jesse Thilo <jthilo@gnu.org>
19416
19417 * src/files.c, src/files.h:
19418 Defined locations of parser files in config.h instead of Makefile.
19419
194201999-02-12 Jesse Thilo <jthilo@gnu.org>
19421
19422 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
19423 Defined locations of parser files in config.h instead of Makefile.
19424
194251999-02-09 Jesse Thilo <jthilo@gnu.org>
19426
19427 * Makefile.am:
19428 Removed inappropriate use of $< macro.
19429
194301999-02-05 Jesse Thilo <jthilo@gnu.org>
19431
19432 * po/Makefile.in.in, po/POTFILES.in:
19433 Add `po' directory skeleton.
19434
194351999-01-27 Jesse Thilo <jthilo@gnu.org>
19436
19437 * README: Document help-bison list.
19438
19439 * configure.in: Add check for mkstemp().
19440
194411999-01-20 Jesse Thilo <jthilo@gnu.org>
19442
19443 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
19444 Hush a few compiler warnings.
19445
19446 * src/files.c:
19447 Add tryclose(), which verifies that fclose was successful.
19448 Hush a couple of compiler warnings.
19449
194501999-01-20 Jesse Thilo <jthilo@gnu.org>
19451
19452 * Makefile.am, OChangeLog:
19453 ChangeLog is now automatically generated. Include the old version as
19454 OChangeLog.
19455
194561999-01-14 Jesse Thilo <jthilo@gnu.org>
19457
19458 * 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:
19459 Update FSF address.
19460
194611999-01-14 Jesse Thilo <jthilo@gnu.org>
19462
19463 * doc/bison.texinfo: Fix formatting glitch.
19464
19465 * doc/bison.texinfo: Update FSF address.
19466
194671999-01-14 Jesse Thilo <jthilo@gnu.org>
19468
19469 * acconfig.h: Update FSF address.
19470
194711999-01-08 Jesse Thilo <jthilo@gnu.org>
19472
19473 * src/system.h:
19474 Don't define PACKAGE here, since config.h defines it.
19475
194761998-12-30 Jesse Thilo <jthilo@gnu.org>
19477
19478 * src/reader.c: Update copyright date.
19479
19480 * src/main.c:
19481 Ditch sprintf to statically-sized buffers in fatal/warn functions in
19482 favor of output directly to stderr (avoids buffer overruns).
19483
19484 * src/reader.c: Some checks for premature EOF.
19485
19486 * 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:
19487 Use prototypes if the compiler understands them.
19488
19489 * src/files.c: Honor TMPDIR on Unix hosts.
19490 Use prototypes if the compiler understands them.
19491
19492 * src/reader.c:
19493 Fix a couple of buffer overrun bugs.
19494 Use prototypes if the compiler understands them.
19495
19496 * src/system.h: Include unistd.h and ctype.h.
19497 Use #ifdef instead of #if for NLS symbols.
19498
194991998-12-30 Jesse Thilo <jthilo@gnu.org>
19500
19501 * doc/bison.texinfo:
19502 Delete comment "consider using @set for edition number, etc..." since
19503 we now are doing so.
19504
195051998-12-30 Jesse Thilo <jthilo@gnu.org>
19506
19507 * configure.in:
19508 Use prototypes if the compiler understands them.
19509
19510 * NEWS: Document 1.26 highlights.
19511
19512 * Makefile.am: Require Automake 1.3 or later.
19513
19514 * acconfig.h:
19515 Use prototypes if the compiler understands them.
19516
195171998-12-29 Jesse Thilo <jthilo@gnu.org>
19518
19519 * src/version.c:
19520 Use VERSION symbol from automake for version number.
19521
195221998-12-29 Jesse Thilo <jthilo@gnu.org>
19523
19524 * acconfig.h, configure.in, version.cin:
19525 Use VERSION symbol from automake for version number.
19526
195271998-11-28 Jesse Thilo <jthilo@gnu.org>
19528
19529 * Makefile.am:
19530 Distribute original version of simple parser (bison.s1), not built
19531 version (bison.simple).
19532
195331998-11-28 Jesse Thilo <jthilo@gnu.org>
19534
19535 * doc/bison.texinfo: Add info dir entry.
19536
19537 * doc/bison.texinfo:
19538 Let automake put version number into documentation.
19539
195401998-11-26 Jesse Thilo <jthilo@gnu.org>
19541
19542 * src/bison.cld, src/build.com, src/vmshlp.mar:
19543 Add non-RCS files from /gd/gnu/bison.
19544
195451998-11-26 Jesse Thilo <jthilo@gnu.org>
19546
19547 * doc/bison.1:
19548 Document the BISON_HAIRY and BISON_SIMPLE variables.
19549
195501998-11-25 Jesse Thilo <jthilo@gnu.org>
19551
19552 * src/version.c: Build version.c automatically.
19553
19554 * src/reader.c:
19555 Fix token numbering (used to start at 258, not 257).
19556
19557 * src/system.h: Include config.h.
19558
19559 * src/getargs.c: Update bug report address.
19560
19561 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
19562 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
19563
195641998-11-25 Jesse Thilo <jthilo@gnu.org>
19565
19566 * Makefile.am:
19567 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19568
19569 * configure.in, version.cin:
19570 Build version.c automatically.
19571
19572 * AUTHORS: Add AUTHORS file.
19573
19574 * README: Update bug report address.
19575
19576 * bison.simple:
19577 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19578
19579 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
19580 Add automake stuff.
19581
195821998-11-25 Jesse Thilo <jthilo@gnu.org>
19583
19584 * doc/bison.texinfo: Clean up some formatting.
19585
195861998-05-05 Richard Stallman <rms@gnu.org>
19587
19588 * doc/bison.texinfo:
19589 Explain better why to make a pure parser.
19590
195911998-01-05 Richard Stallman <rms@gnu.org>
19592
19593 * src/files.c (openfiles):
19594 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
19595 find a temporary directory, if possible. Do not unlink files while
19596 they are open.
19597
195981997-08-25 Richard Stallman <rms@gnu.org>
19599
19600 * src/reader.c (stack_offset;):
19601 Change some warni to warns.
19602
19603 * src/lex.c (literalchar): Use warns, not warni.
19604
196051997-06-28 Richard Stallman <rms@gnu.org>
19606
19607 * src/bison.s1: Add a Bison version comment.
19608
19609 * src/main.c (fatal, warn, berror):
19610 Use program_name.
19611
196121997-06-28 Richard Stallman <rms@gnu.org>
19613
19614 * Makefile.in (bison_version): New variable.
19615 (dist): Use that variable.
19616 (bison.s1): Substitute the Bison version into bison.simple.
19617
19618 * bison.simple: Add a Bison version comment.
19619
196201997-06-18 Richard Stallman <rms@gnu.org>
19621
19622 * src/main.c (fatal, warn, berror):
19623 Make error messages standard.
19624 (toomany): Improve error message text.
19625
19626 * 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:
19627 new.h renamed to alloc.h.
19628
196291997-06-18 Richard Stallman <rms@gnu.org>
19630
19631 * Makefile.in: new.h renamed to alloc.h.
19632
196331997-05-24 Richard Stallman <rms@gnu.org>
19634
19635 * src/lex.c (literalchar):
19636 Fix the code for escaping \, " and '.
19637
19638 (lex): Avoid trouble when there are many chars
19639 to discard in a char literal with just several chars in it.
19640
196411997-05-17 Richard Stallman <rms@gnu.org>
19642
19643 * src/bison.s1:
19644 Use malloc, if using alloca is troublesome.
19645 (YYSTACK_USE_ALLOCA): New flag macro.
19646 Define it for some systems and compilers.
19647 (YYSTACK_ALLOC): New macro.
19648 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19649 If it was malloc'd, free it.
19650
196511997-05-17 Richard Stallman <rms@gnu.org>
19652
19653 * bison.simple:
19654 Use malloc, if using alloca is troublesome.
19655 (YYSTACK_USE_ALLOCA): New flag macro.
19656 Define it for some systems and compilers.
19657 (YYSTACK_ALLOC): New macro.
19658 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19659 If it was malloc'd, free it.
19660
196611997-04-23 Richard Stallman <rms@gnu.org>
19662
19663 * src/bison.s1:
19664 (alloca) [__hpux]: Always define as __builtin_alloca.
19665
196661997-04-23 Richard Stallman <rms@gnu.org>
19667
19668 * bison.simple:
19669 (alloca) [__hpux]: Always define as __builtin_alloca.
19670
196711997-04-22 Richard Stallman <rms@gnu.org>
19672
19673 * src/bison.s1:
19674 [__hpux]: Include alloca.h (right for HPUX 10)
19675 instead of declaring alloca (right for HPUX 9).
19676
19677 * src/bison.s1 (__yy_memcpy):
19678 Declare arg `count' as unsigned int.
19679 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19680
196811997-04-22 Richard Stallman <rms@gnu.org>
19682
19683 * bison.simple:
19684 [__hpux]: Include alloca.h (right for HPUX 10)
19685 instead of declaring alloca (right for HPUX 9).
19686
19687 * bison.simple (__yy_memcpy):
19688 Declare arg `count' as unsigned int.
19689 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19690
196911997-01-03 Richard Stallman <rms@gnu.org>
19692
19693 * src/allocate.c: [__STDC__ or _MSC_VER]:
19694 Declare calloc and realloc to return void *.
19695
196961997-01-02 Richard Stallman <rms@gnu.org>
19697
19698 * src/system.h:
19699 [_MSC_VER]: Include stdlib.h and process.h.
19700 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
19701
19702 * src/main.c (main): Return FAILURE as a value.
19703 (printable_version): Declare arg as int, not char.
19704
197051997-01-02 Richard Stallman <rms@gnu.org>
19706
19707 * Makefile.in (dist):
19708 Explicitly check for symlinks, and copy them.
19709
197101996-12-19 Richard Stallman <rms@gnu.org>
19711
19712 * src/files.c:
19713 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
19714
197151996-12-18 Paul Eggert <eggert@gnu.org>
19716
19717 * src/bison.s1 (yyparse):
19718 If __GNUC__ and YYPARSE_PARAM are both defined,
19719 declare yyparse to have a void * argument.
19720
197211996-12-18 Paul Eggert <eggert@gnu.org>
19722
19723 * bison.simple (yyparse):
19724 If __GNUC__ and YYPARSE_PARAM are both defined,
19725 declare yyparse to have a void * argument.
19726
197271996-12-17 Richard Stallman <rms@gnu.org>
19728
19729 * src/reduce.c (nbits): Add some casts.
19730
197311996-08-12 Richard Stallman <rms@gnu.org>
19732
19733 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
19734
197351996-08-12 Richard Stallman <rms@gnu.org>
19736
19737 * bison.simple: Test _MSDOS as well as _MSDOS_.
19738
197391996-07-31 Richard Stallman <rms@gnu.org>
19740
19741 * src/bison.s1:
19742 [__sun && __i386]: Include alloca.h.
19743
197441996-07-31 Richard Stallman <rms@gnu.org>
19745
19746 * bison.simple:
19747 [__sun && __i386]: Include alloca.h.
19748
197491996-07-30 Richard Stallman <rms@gnu.org>
19750
19751 * src/bison.s1: Comment change.
19752
19753 * src/bison.s1: Test _MSDOS_, not MSDOS.
19754
197551996-07-30 Richard Stallman <rms@gnu.org>
19756
19757 * bison.simple: Comment change.
19758
19759 * bison.simple: Test _MSDOS_, not MSDOS.
19760
197611996-06-01 Richard Stallman <rms@gnu.org>
19762
19763 * 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:
19764 Insert `_' macro around many string constants.
19765
19766 * src/main.c:
19767 Insert `_' macro around many string constants.
19768
19769 (main): Call setlocale, bindtextdomain and textdomain.
19770
19771 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
19772 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
19773 [ENABLE_NLS]: Include libintl.h.
19774 [ENABLE_NLS] (gettext): Define.
19775 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
19776 (N_, PACKAGE, LOCALEDIR): New macros.
19777
197781996-06-01 Richard Stallman <rms@gnu.org>
19779
19780 * POTFILES.in: New file.
19781
19782 * Makefile.in (allocate.o):
19783 Define target explicitly.
19784
19785 * Makefile.in (CFLAGS): Set to @CFLAGS@.
19786 (LDFLAGS): Set to @LDFLAGS@.
19787 (configure): Run autoconf only if preceding `cd' succeeds.
19788 (bison.s1): Redirect output to temporary file then move the
19789 temporary to the target, rather than redirecting directly to bison.s1.
19790 (clean): Remove config.status and config.log.
19791 (distclean): Don't remove config.status here.
19792
197931996-05-12 Richard Stallman <rms@gnu.org>
19794
19795 * src/bison.s1:
19796 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19797
197981996-05-12 Richard Stallman <rms@gnu.org>
19799
19800 * bison.simple:
19801 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19802
198031996-05-11 Richard Stallman <rms@gnu.org>
19804
19805 * src/bison.s1 (__yy_memcpy):
19806 Really reorder the args, as was supposedly done on Feb 14 1995.
19807 (yyparse): Calls changed accordingly.
19808
198091996-05-11 Richard Stallman <rms@gnu.org>
19810
19811 * Makefile.in (dist): Don't use $(srcdir).
19812
19813 * bison.simple (__yy_memcpy):
19814 Really reorder the args, as was supposedly done on Feb 14 1995.
19815 (yyparse): Calls changed accordingly.
19816
198171996-01-27 Richard Stallman <rms@gnu.org>
19818
19819 * src/output.c (output_rule_data):
19820 Test YYERROR_VERBOSE in the conditional
19821 around the definition of ttyname.
19822
198231995-12-29 Richard Stallman <rms@gnu.org>
19824
19825 * src/bison.s1:
19826 Fix line numbers in #line commands.
19827
198281995-12-29 Richard Stallman <rms@gnu.org>
19829
19830 * bison.simple:
19831 Fix line numbers in #line commands.
19832
198331995-12-27 Richard Stallman <rms@gnu.org>
19834
19835 * src/bison.s1 (YYPARSE_PARAM_DECL):
19836 In C++, make it always null.
19837 (YYPARSE_PARAM_ARG): New macro.
19838 (yyparse): Use YYPARSE_PARAM_ARG.
19839
198401995-12-27 Richard Stallman <rms@gnu.org>
19841
19842 * bison.simple (YYPARSE_PARAM_DECL):
19843 In C++, make it always null.
19844 (YYPARSE_PARAM_ARG): New macro.
19845 (yyparse): Use YYPARSE_PARAM_ARG.
19846
198471995-11-29 Richard Stallman <rms@gnu.org>
19848
19849 * doc/bison.texinfo:
19850 Describe literal string tokens, %raw, %no_lines, %token_table.
19851
198521995-11-29 Daniel Hagerty <hag@gnu.org>
19853
19854 * doc/bison.texinfo: Fixed update date
19855
198561995-10-16 Richard Stallman <rms@gnu.org>
19857
19858 * src/version.c: Version 1.25.
19859
198601995-10-16 Richard Stallman <rms@gnu.org>
19861
19862 * NEWS: *** empty log message ***
19863
198641995-10-16 Richard Stallman <rms@gnu.org>
19865
19866 * doc/bison.1, doc/bison.rnh:
19867 Add new options.
19868
198691995-10-15 Richard Stallman <rms@gnu.org>
19870
19871 * src/vmsgetargs.c, src/getargs.c:
19872 Added -n, -k, and -raw switches.
19873 (noparserflag, toknumflag, rawtoknumflag): New variables.
19874
19875 * src/symtab.h (SALIAS):
19876 New #define for adding aliases to %token.
19877 (struct bucket): Added `alias' field.
19878
19879 * src/reduce.c (reduce_grammar):
19880 Revise error message.
19881 (print_notices): Remove final `.' from error message.
19882
19883 * src/reader.c (reader_output_yylsp):
19884 New function.
19885 (readgram): Use `#if 0' around code that accepted %command
19886 inside grammar rules: The documentation doesn't allow it,
19887 and it will fail since the %command processors scan for the next %.
19888 (parse_token_decl): Extended the %token
19889 declaration to allow a multi-character symbol as an alias.
19890 (parse_thong_decl): New function.
19891 (read_declarations): Added %thong declarations.
19892 (read_declarations): Handle NOOP to deal with allowing
19893 % declarations as another means to specify the flags.
19894 (readgram): Allow %prec prior to semantics embedded in a rule.
19895 (skip_to_char, read_declarations, copy_definition)
19896 (parse_token_decl, parse_start_decl, parse_type_decl)
19897 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
19898 (get_type_name, copy_guard, copy_action, readgram)
19899 (get_type, packsymbols): Revised most error messages.
19900 Changed `fatal' to `warnxxx' to avoid aborting for error.
19901 Revised and use multiple warnxxx functions to avoid using VARARGS1.
19902 (read_declarations): Improve the error message for
19903 an invalid character. Do not abort.
19904 (read_declarations, copy_guard, copy_action): Use
19905 printable_version to avoid unprintable characters in printed output.
19906 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
19907 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
19908 Allow the type of a non-terminal can be given
19909 more than once, as long as all specifications give the same type.
19910
19911 * src/output.c:
19912 (output_headers, output_trailers, output, output_gram)
19913 (output_rule_data): Implement noparserflag variable.
19914 Implement toknumflag variable.
19915 (output): Call reader_output_yylsp to output LTYPESTR.
19916
19917 * src/main.c (main):
19918 If reader sees an error, don't process the grammar.
19919 (fatals): Updated to not use VARARGS1.
19920 (printable_version, int_to_string, warn, warni, warns, warnss)
19921 (warnsss): New error reporting functions. Avoid abort for error.
19922
19923 * src/lex.h:
19924 Added THONG and NOOP for alias processing.
19925 Added SETOPT for the new code that allows setting options with %flags.
19926
19927 * src/lex.c:
19928 Include getopt.h. Add some extern decls.
19929 (safegetc): New function to deal with EOF gracefully.
19930 (literalchar); new function to deal with reading \ escapes.
19931 (lex): Use literalchar.
19932 (lex): Implemented "..." tokens.
19933 (literalchar, lex, parse_percent_token): Made tokenbuffer
19934 always contain the token. This includes growing the token
19935 buffer while reading an integer.
19936 (parse_percent_token): Replaced if-else statement with percent_table.
19937 (parse_percent_token): Added % declarations as another
19938 way to specify the flags -n, -l, and -r. Also added hooks for
19939 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
19940 major changes to files.c.
19941 (lex) Retain in the incoming stream a character following
19942 an incorrect '/'.
19943 (skip_white_space, lex): Revised most error messages
19944 and changed fatal to warn to avoid aborting.
19945 (percent_table): Added %thong declarations.
19946
19947 * src/gram.h: Comment changes.
19948
19949 * src/files.c (openfiles, open_extra_files, done):
19950 Add faction flag
19951 and actfile file. Handle noparserflag. Both for -n switch.
19952
19953 * src/conflicts.c (resolve_sr_conflict):
19954 Remove use of alloca.
19955
199561995-06-01 Jim Meyering <meyering@gnu.org>
19957
19958 * doc/bison.texinfo: *** empty log message ***
19959
199601995-05-06 Richard Stallman <rms@gnu.org>
19961
19962 * src/bison.s1: Comment change.
19963
199641995-05-06 Richard Stallman <rms@gnu.org>
19965
19966 * bison.simple: Comment change.
19967
199681995-05-03 Richard Stallman <rms@gnu.org>
19969
19970 * src/version.c: Version now 1.24.
19971
19972 * src/bison.s1: Change distribution terms.
19973
19974 * src/version.c: Version now 1.23.
19975
199761995-05-03 Richard Stallman <rms@gnu.org>
19977
19978 * doc/bison.texinfo:
19979 Rewrite "Conditions for Using Bison".
19980 Update version to 1.24.
19981
199821995-05-03 Richard Stallman <rms@gnu.org>
19983
19984 * bison.simple: Change distribution terms.
19985
199861995-02-23 Richard Stallman <rms@gnu.org>
19987
19988 * src/files.c: Test __VMS_POSIX as well as VMS.
19989
199901995-02-14 Jim Meyering <meyering@gnu.org>
19991
19992 * src/bison.s1 (__yy_memcpy):
19993 Renamed from __yy_bcopy to avoid
19994 confusion. Reverse FROM and TO arguments to be consistent with
19995 those of memcpy.
19996
199971995-02-14 Jim Meyering <meyering@gnu.org>
19998
19999 * bison.simple (__yy_memcpy):
20000 Renamed from __yy_bcopy to avoid
20001 confusion. Reverse FROM and TO arguments to be consistent with
20002 those of memcpy.
20003
200041994-11-10 David J. MacKenzie <djm@gnu.org>
20005
20006 * NEWS: reformat
20007
20008 * NEWS: New file.
20009
20010 * Makefile.in (DISTFILES): Include NEWS.
20011
20012 * Makefile.in (DISTFILES):
20013 Include install-sh, not install.sh.
20014
20015 * configure.in: Update to Autoconf v2 macro names.
20016
200171994-10-05 David J. MacKenzie <djm@gnu.org>
20018
20019 * Makefile.in: fix typo
20020
20021 * Makefile.in (prefix, exec_prefix):
20022 Let configure set them.
20023
200241994-09-28 David J. MacKenzie <djm@gnu.org>
20025
20026 * Makefile.in: Set datadir to $(prefix)/share.
20027
200281994-09-15 Richard Stallman <rms@gnu.org>
20029
20030 * src/bison.s1:
20031 Update copyright notice and GPL version.
20032
200331994-09-15 Richard Stallman <rms@gnu.org>
20034
20035 * bison.simple:
20036 Update copyright notice and GPL version.
20037
200381994-07-12 Richard Stallman <rms@gnu.org>
20039
20040 * src/reduce.c, src/reader.c:
20041 entered into RCS
20042
200431994-05-05 David J. MacKenzie <djm@gnu.org>
20044
20045 * Makefile.in: entered into RCS
20046
200471994-03-26 Richard Stallman <rms@gnu.org>
20048
20049 * src/bison.s1: entered into RCS
20050
200511994-03-26 Richard Stallman <rms@gnu.org>
20052
20053 * bison.simple: entered into RCS
20054
200551994-03-25 Richard Stallman <rms@gnu.org>
20056
20057 * src/main.c: entered into RCS
20058
200591994-03-24 Richard Stallman <rms@gnu.org>
20060
20061 * src/conflicts.c: entered into RCS
20062
200631994-01-02 Richard Stallman <rms@gnu.org>
20064
20065 * Makefile.in: *** empty log message ***
20066
200671993-11-21 Richard Stallman <rms@gnu.org>
20068
20069 * src/bison.s1: *** empty log message ***
20070
200711993-11-21 Richard Stallman <rms@gnu.org>
20072
20073 * doc/bison.texinfo: entered into RCS
20074
20075 * doc/bison.texinfo: *** empty log message ***
20076
200771993-11-21 Richard Stallman <rms@gnu.org>
20078
20079 * bison.simple: *** empty log message ***
20080
200811993-10-25 David J. MacKenzie <djm@gnu.org>
20082
20083 * doc/bison.texinfo: *** empty log message ***
20084
200851993-10-19 Richard Stallman <rms@gnu.org>
20086
20087 * src/bison.s1: *** empty log message ***
20088
200891993-10-19 Richard Stallman <rms@gnu.org>
20090
20091 * bison.simple: *** empty log message ***
20092
200931993-10-14 Richard Stallman <rms@gnu.org>
20094
20095 * src/bison.s1: *** empty log message ***
20096
200971993-10-14 Richard Stallman <rms@gnu.org>
20098
20099 * bison.simple: *** empty log message ***
20100
201011993-09-14 David J. MacKenzie <djm@gnu.org>
20102
20103 * doc/bison.texinfo: *** empty log message ***
20104
201051993-09-13 Noah Friedman <friedman@gnu.org>
20106
20107 * Makefile.in: *** empty log message ***
20108
201091993-09-10 Richard Stallman <rms@gnu.org>
20110
20111 * src/conflicts.c: *** empty log message ***
20112
20113 * src/system.h: entered into RCS
20114
201151993-09-10 Richard Stallman <rms@gnu.org>
20116
20117 * doc/bison.1: entered into RCS
20118
201191993-09-06 Noah Friedman <friedman@gnu.org>
20120
20121 * src/version.c: entered into RCS
20122
201231993-09-06 Noah Friedman <friedman@gnu.org>
20124
20125 * Makefile.in: *** empty log message ***
20126
201271993-07-30 David J. MacKenzie <djm@gnu.org>
20128
20129 * Makefile.in: *** empty log message ***
20130
201311993-07-24 Richard Stallman <rms@gnu.org>
20132
20133 * src/bison.s1: *** empty log message ***
20134
201351993-07-24 Richard Stallman <rms@gnu.org>
20136
20137 * bison.simple: *** empty log message ***
20138
201391993-07-08 David J. MacKenzie <djm@gnu.org>
20140
20141 * Makefile.in: *** empty log message ***
20142
201431993-07-04 Richard Stallman <rms@gnu.org>
20144
20145 * src/bison.s1: *** empty log message ***
20146
201471993-07-04 Richard Stallman <rms@gnu.org>
20148
20149 * bison.simple: *** empty log message ***
20150
201511993-06-26 David J. MacKenzie <djm@gnu.org>
20152
20153 * src/getargs.c: entered into RCS
20154
201551993-06-26 David J. MacKenzie <djm@gnu.org>
20156
20157 * doc/bison.texinfo: *** empty log message ***
20158
20159 * doc/bison.1: New file.
20160
201611993-06-25 Richard Stallman <rms@gnu.org>
20162
20163 * src/getargs.c: New file.
20164
201651993-06-16 Richard Stallman <rms@gnu.org>
20166
20167 * src/bison.s1: *** empty log message ***
20168
201691993-06-16 Richard Stallman <rms@gnu.org>
20170
20171 * bison.simple: *** empty log message ***
20172
201731993-06-03 Richard Stallman <rms@gnu.org>
20174
20175 * src/bison.s1: New file.
20176
201771993-06-03 Richard Stallman <rms@gnu.org>
20178
20179 * doc/bison.texinfo: *** empty log message ***
20180
201811993-06-03 Richard Stallman <rms@gnu.org>
20182
20183 * bison.simple: New file.
20184
201851993-05-19 Richard Stallman <rms@gnu.org>
20186
20187 * doc/bison.texinfo: New file.
20188
201891993-05-07 Noah Friedman <friedman@gnu.org>
20190
20191 * Makefile.in: *** empty log message ***
20192
201931993-04-28 Noah Friedman <friedman@gnu.org>
20194
20195 * src/reader.c: *** empty log message ***
20196
201971993-04-23 Noah Friedman <friedman@gnu.org>
20198
20199 * src/alloc.h: entered into RCS
20200
202011993-04-20 David J. MacKenzie <djm@gnu.org>
20202
20203 * src/version.c: *** empty log message ***
20204
20205 * src/files.c, src/allocate.c:
20206 entered into RCS
20207
20208 * src/reader.c: *** empty log message ***
20209
20210 * src/lex.c: entered into RCS
20211
20212 * src/conflicts.c: New file.
20213
20214 * src/symtab.c: entered into RCS
20215
20216 * src/alloc.h: New file.
20217
20218 * src/LR0.c: entered into RCS
20219
202201993-04-18 Noah Friedman <friedman@gnu.org>
20221
20222 * src/reader.c: New file.
20223
20224 * src/version.c: *** empty log message ***
20225
202261993-04-18 Noah Friedman <friedman@gnu.org>
20227
20228 * Makefile.in: *** empty log message ***
20229
202301993-04-17 Noah Friedman <friedman@gnu.org>
20231
20232 * Makefile.in: *** empty log message ***
20233
202341993-04-15 Richard Stallman <rms@gnu.org>
20235
20236 * src/main.c, src/files.c:
20237 New file.
20238
202391993-04-15 Noah Friedman <friedman@gnu.org>
20240
20241 * configure.in: entered into RCS
20242
20243 * configure.in: *** empty log message ***
20244
20245 * configure.in: New file.
20246
202471993-04-14 Richard Stallman <rms@gnu.org>
20248
20249 * Makefile.in: New file.
20250
202511993-04-13 Richard Stallman <rms@gnu.org>
20252
20253 * src/version.c: New file.
20254
202551993-03-25 Richard Stallman <rms@gnu.org>
20256
20257 * src/output.c: entered into RCS
20258
202591992-09-25 Richard Stallman <rms@gnu.org>
20260
20261 * configure.bat: entered into RCS
20262
202631992-06-22 Richard Stallman <rms@gnu.org>
20264
20265 * src/vmsgetargs.c: entered into RCS
20266
202671992-06-22 Richard Stallman <rms@gnu.org>
20268
20269 * doc/bison.rnh: entered into RCS
20270
202711992-04-20 David J. MacKenzie <djm@gnu.org>
20272
20273 * README: entered into RCS
20274
202751992-01-22 Richard Stallman <rms@gnu.org>
20276
20277 * src/machine.h: entered into RCS
20278
202791991-12-21 Richard Stallman <rms@gnu.org>
20280
20281 * src/lalr.c, src/closure.c:
20282 entered into RCS
20283
202841991-12-20 Richard Stallman <rms@gnu.org>
20285
20286 * src/state.h: entered into RCS
20287
202881991-12-18 Richard Stallman <rms@gnu.org>
20289
20290 * src/print.c, src/nullable.c, src/derives.c:
20291 entered into RCS
20292
202931991-11-03 David J. MacKenzie <djm@gnu.org>
20294
20295 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
20296 entered into RCS
20297
202981988-09-09 Richard Stallman <rms@gnu.org>
20299
20300 * src/bison.hairy: entered into RCS
20301
203021987-12-16 Richard Stallman <rms@gnu.org>
20303
20304 * REFERENCES: entered into RCS
dc546b0f 20305
f294a2c2 20306
04098407 20307 -----
f294a2c2 20308
04098407 20309 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
95021767
JD
20310 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
20311 Free Software Foundation, Inc.
f294a2c2 20312
04098407
PE
20313 Copying and distribution of this file, with or without
20314 modification, are permitted provided the copyright notice and this
20315 notice are preserved.
e9071366
AD
20316
20317$Id$