]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
* data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
[bison.git] / ChangeLog
... / ...
CommitLineData
12007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
4 2007-10-11 change, the child elements here are items not rules.
5 (<xsl:template match="item"): New.
6 (xsl:template match="rule"): Update for new reduced itemset.
7 (xsl:template match="point"): Remove.
8 (xsl:template match="empty"): For consistency with --graph, don't
9 output "/* empty */".
10 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
11 line-wrap, don't pass a negative value as first-line-length since this
12 won't work with the following changes.
13 (xsl:template name="line-wrap"): Simplify slightly.
14 (xsl:template name="ws-search"): Eliminate recursion.
15 * src/print_graph.c (print_core): Don't print a reduction's lookahead
16 set next to an item whose dot is not at the end of the RHS even if it
17 happens to be associated with the same rule.
18
192007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
20
21 Add %define lr.keep_unreachable_states.
22 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
23 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
24 * src/main.c (main): Implement it.
25 * tests/conflicts.at (Unreachable States After Conflict Resolution):
26 Extend to test it, and fix a typo.
27
282007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
29
30 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
31 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
32 the example .output text.
33 * tests/regression.at (Extra lookahead sets in report): Improve wording
34 of comments.
35
362007-10-17 Wojciech Polak <polak@gnu.org>
37
38 * src/print-xml.c (print_grammar): Renamed
39 <terminal> and <nonterminal> attributes:
40 "type" to "number" and "symbol" to "name".
41 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
42 Use new attribute names.
43 (xsl:template match="nonterminal"): Likewise.
44 * data/xslt/xml2xhtml.xsl: Likewise.
45
462007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
47
48 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
49 (Option Cross Key): Likewise.
50
51 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
52 next to an item whose dot is not at the end of the RHS even if it
53 happens to be associated with the same rule.
54 * src/print.c (print_core): Likewise.
55 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
56 (Resolved SR Conflicts): Update output.
57 * tests/regression.at (Extra lookahead sets in report): New test case.
58
592007-10-11 Wojciech Polak <polak@gnu.org>
60
61 * src/print-xml.c (print_core): Remove item set
62 redundancy.
63 * data/xslt/bison.xsl (bison:ruleNumber): New key.
64 Improve processing time. Suggested by Joel E. Denny.
65 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
66 Write xsl:param "required" attribute as comment.
67 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
68 (xsl:template match="rule"): Support new reduced itemset.
69 (xsl:template match="point"): Remove.
70 * data/xslt/xml2xhtml.xsl: Likewise.
71
722007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
73
74 * src/getargs.c (version): Update copyright year.
75
762007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
77
78 Make xml2dot.xsl and --graph produce the same output.
79 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
80 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
81 escaped later.
82 (xsl:template name="output-node"): Use the new escape template instead
83 of the string-replace template directly.
84 (xsl:template name="output-edge"): Likewise.
85 (xsl:template name="escape"): New, escapes backslashes and newlines in
86 addition to quotation marks.
87 * src/graphviz.c (start_graph, output_node, output_edge): Add
88 whitespace to output for legibility.
89
90 Make xml2text.xsl and --report produce the same output, and remove the
91 XML "conflicts" element since a conflict summary is easily extracted
92 from the automaton.
93 * data/xslt/bison.xsl: New.
94 (xsl:template match="state" mode="bison:count-conflicts): New.
95 * data/xslt/xml2text.xsl: Import bison.xsl.
96 (xsl:template match="bison-xml-report"): Instead of styling the
97 "conflicts" element, style the "automaton" element with mode
98 "conflicts". Unlike the former, the latter lists S/R and R/R
99 conflicts for a state on the same line.
100 (xsl:template match="conflicts"): Remove.
101 (xsl:template match="conflict"): Remove.
102 (xsl:template match="terminal"): Line-wrap the list of rules in which
103 the terminal is used.
104 (xsl:template match="nonterminal"): Likewise for nonterminals.
105 (xsl:template match="automaton" mode="conflicts"): New.
106 (xsl:template match="state" mode="conflicts"): New.
107 (xsl:template name="line-wrap"): New.
108 (xsl:template name="ws-search"): New.
109 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
110 (xsl:template match="bison-xml-report"): Instead of styling the
111 "conflicts" element, style the "automaton" element with mode
112 "conflicts."
113 (xsl:template match="conflicts"): Remove.
114 (xsl:template match="conflict"): Remove.
115 (xsl:template match="automaton" mode="conflicts"): New.
116 (xsl:template match="state" mode="conflicts): New.
117 * src/conflicts.c (conflicts_output_xml): Remove.
118 * src/conflicts.h (conflicts_output_xml): Remove prototype.
119 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
120 * src/print.c (print_grammar): Consistently wrap at the 66th column so
121 the corresponding XSLT is easier. Also, never wrap between a word and
122 the comma that follows it.
123
1242007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
125
126 Improve C++ namespace support. Discussed starting at
127 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
128 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
129 b4_namespace_close): New macros that interpret the %define variable
130 "namespace" so its value can contain "::" to indicate nested
131 namespaces.
132 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
133 the above macros.
134 * data/lalr1.cc (b4_namespace): Likewise.
135 * data/location.cc (b4_namespace): Likewise.
136 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
137 inside a new table in the general %define entry. Document `%define
138 namespace' there as well. Point the %name-prefix entry to it since it
139 explains it more completely in the case of C++.
140 (C++ Bison Interface): Mention `%define namespace' instead of
141 %name-prefix.
142 (Table of Symbols): Remove the `%define push_pull' entry. The %define
143 entry suffices.
144 * tests/c++.at (Relative namespace references): New test case.
145 (Absolute namespace references): New test case.
146 (Syntactically invalid namespace references): New test case.
147 * tests/input.at (C++ namespace reference errors): New test case.
148
1492007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
150
151 Add syncline support and location accessor to internal %define
152 interfaces.
153 * data/bison.m4 (b4_percent_define_get_loc): New.
154 (b4_percent_define_get_syncline): New.
155 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
156 (b4_percent_define_default): Record defining location as line 1 rather
157 than 0 for the sake of synchronizing #line's, and define
158 b4_percent_define_syncline(VARIABLE).
159 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
160 * src/muscle_tab.c (muscle_syncline_grow): New.
161 (muscle_code_grow): Use muscle_syncline_grow.
162 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
163 define b4_percent_define_syncline(VARIABLE).
164 (muscle_percent_define_get_loc): New.
165 (muscle_percent_define_get_syncline): New.
166 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
167 remove some unused variables.
168 (muscle_percent_define_default): Record defining location as line 1
169 rather than 0 for the sake of synchronizing #line's, and define
170 b4_percent_define_syncline(VARIABLE).
171 (muscle_percent_define_check_values): Use
172 muscle_percent_define_get_loc.
173 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
174 (muscle_percent_define_get_syncline): Prototype.
175 * tests/skeletons.at (%define Boolean variables: invalid skeleton
176 defaults): Update output for location change.
177 (Complaining during macro argument expansion): Extend to test
178 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
179
1802007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
181
182 Fix some error-reporting macro bugs.
183 * data/bison.m4 (b4_cat): New.
184 (b4_error, b4_error_at): Use b4_cat to send error directives directly
185 to stdout so they don't become arguments to other macros. Update
186 comments and add examples.
187 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
188 add examples.
189 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
190 after printing the error directive so that M4 doesn't report subsequent
191 problems that are induced by this problem.
192 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
193 instead of just in them. Recognize @\n in both places. Both expand to
194 the empty string. Needed by b4_cat.
195 * tests/skeletons.at (Complaining during macro argument expansion):
196 New test case.
197 (Fatal errors make M4 exit immediately): New test case.
198
1992007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
200
201 Implement --print-datadir.
202 * src/getargs.c (usage): Mention.
203 (PRINT_DATADIR_OPTION): New anonymous enum member.
204 (long_options): Add entry for it.
205 (getargs): Add case for it calling compute_pkgdatadir.
206 * src/output.c (output_skeleton): Encapsulate data directory
207 computation from here...
208 (prepare): ... and from here...
209 (compute_pkgdatadir): ... into this new function.
210 * src/output.h (compute_pkgdatadir): Prototype.
211
2122007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
213
214 * src/print-xml.c (escape_bufs): New static global variable
215 replacing...
216 (xml_escape_n): ... the static local variable buf here.
217 (print_xml): Free memory for escape_bufs.
218 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
219
2202007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
221
222 Replace `%push-parser' and `%push-pull-parser' with
223 `%define push_pull "push"' and `%define push_pull "both"'.
224 `%define push_pull "pull"' is the default.
225 * doc/bison.texinfo (Push Decl, Push Parser Function,
226 Pull Parser Function, Parser Create Function, Parser Delete Function):
227 Update declarations.
228 (Decl Summary, Table of Symbols): Replace %push-parser and
229 %push-pull-parser entries with a %define push_pull entry.
230 * data/bison.m4 (b4_percent_define_check_values): New macro.
231 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
232 definitions...
233 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
234 definitions...
235 * data/push.c: ... to here and compute them from the value of the
236 %define variable push_pull.
237 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
238 parsing requests here...
239 * data/yacc.c: ... hack this to switch to push.c any time
240 b4_use_push_pull_flag or the %define variable push_pull is set. This
241 will go away when we mv push.c yacc.c.
242 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
243 push parsing is not supported since unused %define variables are
244 reported anyway.
245 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
246 * src/muscle_tab.h (muscle_percent_define_check_values): Update
247 comments for consistency with b4_percent_define_check_values.
248 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
249 muscles.
250 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
251 Remove.
252 (prologue_declaration): Remove %push-parser and %push-pull-parser
253 rules.
254 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
255 * tests/calc.at: Update declarations.
256 * tests/input.at (%define enum variables): New test case.
257 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
258 declaration.
259 (Push Parsing: Multiple impure instances): Update declaration.
260 (Push Parsing: Unsupported Skeletons): New test case.
261 * tests/torture.at (Exploding the Stack Size with Alloca): Update
262 declaration.
263 (Exploding the Stack Size with Malloc): Update declaration.
264
2652007-09-24 Wojciech Polak <polak@gnu.org>
266
267 Add XSLT transformations.
268
269 * data/xslt/xml2dot.xsl: Transform XML into DOT.
270 * data/xslt/xml2text.xsl: Transform XML into plain text.
271 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
272 * data/Makefile.am (xsltdir): New variable.
273 (dist_xslt_DATA): Add xslt/*.xsl files.
274
2752007-09-23 Paul Eggert <eggert@cs.ucla.edu>
276
277 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
278 Problem reported by Wojciech Polak.
279 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
280 (xml_printf): Undo change I made on 21 September; that is,
281 indent 2 spaces, not 1.
282
2832007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
284
285 Pacify ./configure --enable-gcc-warnings.
286 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
287 `char const *' instead of `char *'.
288 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
289 local variable `sep'.
290
2912007-09-21 Paul Eggert <eggert@cs.ucla.edu>
292
293 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
294 elsewhere.
295 * src/print-xml.c: Prefer "const" after types; that's more consistent.
296 (xml_printf): Indent just 1 space for level.
297 (e_char, xlate_char): Remove.
298 (xml_escape_string): Rewrite to avoid undefined behavior (used
299 storage that was freed from the stack).
300 (xml_escape_n): Don't bother checking for subscript error.
301
3022007-09-21 Wojciech Polak <polak@gnu.org>
303
304 Add Bison XML Automaton Report.
305
306 Add support for an -x option to generate an XML report.
307 It is not documented yet.
308 * src/print-xml.c: New file.
309 * src/print-xml.h: Likewise.
310 * lib/timevar.def (TV_XML): New var.
311 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
312 * src/conflicts.c: Include print-xml.h.
313 (solved_conflicts_xml_obstack): New var.
314 (log_resolution, conflicts_solve, conflicts_free):
315 Add support for XML report.
316 (conflicts_output_val): New function.
317 * src/conflicts.h (conflicts_output_val): New decl.
318 * src/files.c (spec_xml_file): New var.
319 (compute_output_file_names, output_file_names_free): Add XML support.
320 * src/files.h (spec_xml_file): New decl.
321 * src/getargs.c (xml_flag): New var.
322 (usage, short_options, long_options, getargs): Add XML support.
323 * src/getargs.h (xml_flag): New decl.
324 * src/gram.c: Include print-xml.h.
325 (rule_lhs_print_xml, rule_rhs_print_xml):
326 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
327 New functions.
328 * src/gram.h: Declare external ones.
329 * src/main.c: Include print-xml.h.
330 (main): Add XML support.
331 * src/reduce.c: Include print-xml.h.
332 (reduce_xml): New function.
333 * src/reduce.h: Declare it.
334 * src/state.c: Include print-xml.h.
335 (state_new): Add XML support.
336 (state_rule_lookahead_tokens_print_xml): New function.
337 * src/state.h: Declare it.
338 (struct state): New member solved_conflicts_xml.
339 * src/symtab.c (symbol_class_get_string): New function.
340 * src/symtab.h: Declare it.
341
3422007-09-21 Paul Eggert <eggert@cs.ucla.edu>
343
344 * GNUmakefile: Switch to coreutils's version.
345 * bootstrap: Likewise.
346 * Makefile.cfg: Adjust to new GNUmakefile.
347 * README-hacking: Likewise.
348
349 Import from gnulib:
350
351 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
352 Bruno Haible <bruno@clisp.org>
353
354 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
355 and is a script that invokes bison. Tighten the code. Add comments.
356
3572007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
358
359 Spell "boolean" as "Boolean". Reported by Akim Demaille.
360 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
361 * doc/bison.texinfo (Decl Summary): Fix.
362 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
363 * tests/input.at (Boolean %define variables): Update output.
364 * tests/skeletons.at (%define boolean variables: invalid skeleton
365 defaults): Rename to...
366 (%define Boolean variables: invalid skeleton defaults): ... this and
367 update output.
368
3692007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
370
371 In impure push mode, don't allow more than one yypstate to be allocated
372 since multiple impure parsers would corrupt yynerrs.
373 * data/push.c (yypstate_allocated): New static global variable
374 initialized to 0.
375 (yypull_parse): If yypstate_new returns 0, don't report it as memory
376 exhaustion if yypstate_allocated is 1, but still return 2.
377 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
378 already 1. Otherwise, set it to 1.
379 (yypstate_delete): Set it to 0.
380 * tests/push.at (Push Parsing: Multiple impure instances): New test
381 case.
382
3832007-08-17 Bob Rossi <bob@brasko.net>
384
385 * doc/bison.texinfo (Push Decl): Document the push parser.
386 (Table of Symbols): Ditto.
387 (Pure Decl): Ditto.
388 (Decl Summary): Ditto.
389 (Multiple Parsers, Push Parser Function, Pull Parser Function,
390 Parser Create Function, Parser Delete Function):
391 Add new push parser symbols.
392 (Table of Symbols): Document push-parser, push-pull-parser,
393 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
394
3952007-08-15 Paul Eggert <eggert@cs.ucla.edu>
396
397 Update to GPLv3.
398 * doc/gpl-3.0.texi: New file.
399 * doc/gpl.texi: Remove.
400 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
401 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
402 * README-hacking, TODO, bootstrap, bootstrap.conf:
403 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
404 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
405 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
406 * data/lalr1.cc, data/lalr1.java, data/location.cc:
407 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
408 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
409 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
410 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
411 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
412 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
413 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
414 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
415 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
416 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
417 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
418 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
419 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
420 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
421 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
422 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
423 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
424 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
425 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
426 * src/complain.c, src/complain.h, src/conflicts.c:
427 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
428 * src/files.h, src/flex-scanner.h, src/getargs.c:
429 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
430 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
431 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
432 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
433 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
434 * src/print.c, src/print.h, src/print_graph.c:
435 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
436 * src/reduce.h, src/relation.c, src/relation.h:
437 * src/revision.h, src/scan-code.h, src/scan-code.l:
438 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
439 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
440 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
441 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
442 * tests/Makefile.am, tests/actions.at, tests/c++.at:
443 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
444 * tests/existing.at, tests/glr-regression.at:
445 * tests/headers.at, tests/input.at, tests/java.at:
446 * tests/local.at, tests/output.at, tests/push.at:
447 * tests/reduce.at, tests/regression.at, tests/sets.at:
448 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
449 * tests/torture.at:
450 Update to GPLv3.
451
4522007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
453
454 Get rid of broken %no-parser, -n, and --no-parser implementation and
455 documentation.
456 * TODO: Don't mention them.
457 * doc/bison.1: Likewise.
458 * doc/bison.texinfo (Decl Summary): Likewise.
459 (Bison Options): Likewise.
460 (Option Cross Key): Likewise.
461 * src/getargs.c (no_parser_flag): Remove global variable.
462 (usage): Don't print description of -n and --no-parser.
463 (long_options): Remove --no-parser entry here.
464 (getargs): Remove -n case in the switch here.
465 * src/getargs.h (no_parser_flag): Remove extern.
466 * tests/regression.at (Web2c Actions): Remove comment that mentions
467 --no-parser.
468
4692007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
470
471 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
472 name user variables starting with `yy'. Just pass NULL instead of a
473 dummy local &yylval to yypush_parse.
474 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
475 starting with `yy'.
476
4772007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
478
479 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
480 true since it's then always used regardless of whether yyoverflow is
481 defined. Reported by Christian Burger at
482 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
483 * THANKS: Add Christian Burger.
484
485 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
486 node names: say "Decl Summary" not "Bison Declaration Summary".
487
4882007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
489
490 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
491 determine whether this function has already complained about an invalid
492 value for a %define boolean variable, don't check whether Bison has
493 ever examined the value. As written, the check was a tautology.
494 Instead, record and check for this complaint using a separate muscle.
495
4962007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
497
498 Fix push parsing memory leak reported by Brandon Lucia at
499 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
500 * THANKS: Add Brandon Lucia.
501 * data/push.c (yypstate_delete): Free the stack if it was reallocated
502 but the parse never completed and thus freed it.
503 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
504 * tests/testsuite.at: Include push.at.
505 * test/push.at: New.
506 (Push Parsing: Memory Leak for Early Deletion): New test case.
507
5082007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
509
510 Improve handling of multiple S/R conflicts in the same state and of S/R
511 conflicts involving multiple reductions.
512 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
513 set for a state here or Bison will abort if it is reassigned on a
514 later conflicted reduction in the same state.
515 Similarly, don't finalize and assign the solved conflicts report here
516 or it will be lost if it is reassigned on a later conflicted reduction
517 in the same state.
518 (set_conflicts): Instead, assign them both here after all S/R conflicts
519 in the state have been fully examined.
520 * src/print.c (shift_set): Rename to...
521 (no_reduce_set): ... this.
522 (print_reductions): Update for rename, and add %nonassoc error action
523 tokens to no_reduce_set so that, when printing the first remaining
524 reduction on an error action token, the reduction is enclosed in
525 brackets.
526 (print_results): Update for rename.
527 * tests/conflicts.at (Solved conflicts report for multiple reductions
528 in a state): New test case.
529 (%nonassoc error actions for multiple reductions in a state): New test
530 case.
531
532 * src/main.c (main): Don't depend on C99 features.
533
5342007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
535
536 * build-aux/.cvsignore: Add compile.
537 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
538 uniwidth.
539
5402007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
541
542 * bootstrap (slurp): Create target directories that don't exist.
543 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
544
5452007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
546
547 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
548 than item number.
549 * closure.c (closure): Likewise.
550 * state.h (reductions): Comment sorting of rules.
551 (state): Comment sorting of items.
552
5532007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
554
555 Fix C++ test cases after recent Gnulib changes. Discussed starting at
556 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
557 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
558 definition in order to avoid Gnulib headers since we don't use config.h
559 here.
560 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
561 rather than AT_DATA so that config.h is included.
562
5632007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
564
565 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
566 instead of fprintf. Guard these functions with #if YYDEBUG instead of
567 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
568 and so that YYFPRINTF is guaranteed to be defined here.
569
5702007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
571
572 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
573 with...
574 (muscle_percent_define_check_values): ... this more helpful function.
575 Again, it's not used yet, but it will be.
576 * src/muscle_tab.h: Likewise.
577
578 Improve some comments in parser table construction.
579 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
580 (generate_states): Don't mention ruleset, which is internal to closure.
581 * src/closure.c (closure): Explain sorting of core and itemset, which
582 is required for this function to behave correctly.
583 * src/closure.h (closure): Mention sorting.
584
5852007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
586
587 * src/lalr.c (state_lookahead_tokens_count): For code readability,
588 move the check for disabled transitions to an aver since conflict
589 resolution hasn't happened yet.
590
591 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
592 labels a state as inconsistent just because it has error transitions.
593 The original form of this check appeared in revision 1.1 of lalr.c,
594 which was committed on 1991-12-21. Now (at least), changing the
595 consistency label on such a state appears to have no useful effect in
596 any of the places it is examined, which I enumerate below. The key
597 point to understanding each item in this enumeration is that a state
598 with an error transition is labelled consistent in the first place only
599 if it has no rules, so the check cannot matter for states that have
600 rules. (1) Labelling a state as inconsistent will cause set_conflicts
601 to try to identify its conflicts, and a state must have *rules* to have
602 conflicts. (2) Labelling a state as inconsistent will affect how
603 action_row sets the default *rule* for the state. (3) Labelling a
604 state as inconsistent will cause build_relations to add lookback edges
605 to *rules* in that state.
606 * src/state.h (struct state): Word the comment for member consistent
607 more carefully.
608
6092007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
610
611 Don't depend on C99 features.
612 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
613 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
614 * src/reader.c (check_and_convert_grammar): Fix for-loop.
615 * src/state.c (state_mark_reachable_states): Fix for-loop.
616 (state_remove_unreachable_states): Fix for-loop.
617
618 Don't widen struct state with member reachable just to temporarily
619 record reachability. Instead, use a local bitset.
620 * src/state.h (struct state): Remove member.
621 * src/state.c (state_new): Don't initialize it.
622 (state_mark_reachable_states): Rename to...
623 (state_record_reachable_states): ... this, and use bitset.
624 (state_remove_unreachable_states): Use bitset.
625
6262007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
627
628 * src/Makefile.am (yacc): Quote target action commands properly so
629 that the yacc script isn't corrupt. Reported by Hans Aberg at
630 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
631
632 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
633 the case of pure parsers. Reported by Frans Englich at
634 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
635 * THANKS: Add Frans Englich.
636
637 * NEWS (2.3a+): In the %code entry, reference section `Bison
638 Declaration Summary' from the manual now since the %code summary has
639 moved there.
640 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
641 in the rules section must be terminated by semicolons.
642
6432007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
644
645 Extend the front-end API for %define variables to more completely
646 mirror the back-end. This will be useful in the future.
647 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
648 Update comments to mention the new front-end counterparts of these
649 macros.
650 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
651 for muscle_string_decode and muscle_location_decode.
652 (muscle_string_decode): New static function.
653 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
654 (muscle_percent_define_get, muscle_percent_define_ifdef): New
655 functions.
656 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
657 muscle_percent_define_get to mimic the b4_percent_define_flag_if
658 implementation more closely.
659 (muscle_percent_define_invalid_value): New function.
660 * src/muscle_tab.h (muscle_percent_define_get,
661 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
662 Prototype.
663
6642007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
665
666 * NEWS (2.3a+): Mention yesterday's state-removal change.
667 (2.3a): Remove the %language entry, which was added after 2.3a.
668 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
669 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
670 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
671 tests/existing.at: Update copyright date.
672
6732007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
674
675 If conflict resolution makes states unreachable, remove those states,
676 report rules that are then unused, and don't report conflicts in those
677 states.
678 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
679 New global function.
680 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
681 function.
682 * src/main.c (main): After conflict resolution, remove the unreachable
683 states and update all data structures that reference states by number.
684 * src/state.c (state_new): Initialize each state's reachable member to
685 false.
686 (state_mark_reachable_states): New static function.
687 (state_remove_unreachable_states): New global function.
688 * src/state.h (struct state): Add member bool reachable.
689 (state_remove_unreachable_states): Prototype.
690 * tests/conflicts.at (Unreachable States After Conflict Resolution):
691 New test case.
692 * tests/existing.at (GNU pic Grammar): Update test case output now that
693 an unused rule is discovered.
694
6952007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
696
697 Minor code cleanup in parser table construction.
698 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
699 (new_itemsets, save_reductions): Update for rename to nitemset.
700 * src/closure.c (nritemset): Rename to...
701 (nitemset): ... this since the "r" appears to meaningless and isn't
702 used in the comments.
703 (closure): Update for rename.
704 * src/closure.h (nritemset): Update extern to...
705 (nitemset): ... this.
706 * src/lalr.c (LA): Fix a typo in comments.
707 * src/print.c (print_core): Update for rename to nitemset.
708 * src/print_graph.c (print_graph): Likewise.
709 * src/state.h: Fix some typos in header comments.
710
7112007-04-04 Paul Eggert <eggert@cs.ucla.edu>
712
713 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
714 still sticks to ASCII. Sorry!
715
716 * README-hacking: New file, taken mostly from coreutils, with changes
717 for Bison. Contains much of the contents of:
718 * README-cvs: Remove.
719 * bootstrap: Sync from gnulib.
720 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
721 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
722
7232007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
724
725 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
726 Setzer.
727 (Java Differences): Fix some typos.
728 * THANKS: Add Sebastian Setzer.
729
7302007-03-07 Paolo Bonzini <bonzini@gnu.org>
731
732 * data/java.m4 (b4_single_class_if): Remove.
733 (b4_abstract_if): Look at "%define abstract".
734 (b4_lexer_if): New.
735 (b4_union_name): Rename...
736 (b4_yystype): ... to this. Map to "%define stype".
737 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
738 b4_maybe_throws): Fix quoting.
739 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
740 * data/lalr1.java (Lexer interface): Always define.
741 (Lexer interface within parser class): Remove.
742 (YYLexer class): New, used when "%code lexer" is present.
743 (constructor): When "%code lexer" is used, pass %lex-param
744 to the lexer constructor.
745 (yylex, yyparse): Remove %lex-param from method invocations
746 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
747
748 * doc/bison.texinfo (Java Bison Interface): Mention "%define
749 abstract". Rename "%define union_name" to "%define stype".
750 Rename method names according to previous patch.
751 (Java Scanner Interface): Describe "%code lexer" instead of
752 "%pure-parser" and "%define single_class".
753 (Java Differences): Mention "%code lexer".
754
755 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
756 Include scanner here, using macros from tests/local.at.
757 (AT_DATA_CALC_Y): Remove final argument.
758 (_AT_CHECK_JAVA_CALC): Likewise.
759 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
760 of %locations and %error-verbose.
761 (main): Test with and without %lex-param.
762 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
763 (AT_BISON_OPTION_POPDEFS): Pop it.
764
7652007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
766
767 DJGPP spefic issue. Inhibit the use of disallowed characters for
768 file name genertion on Win98, WinXP, etc. These are |<>":?*\
769 and concern testsuite case 46.
770 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
771 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
772 * djgpp/config.bat: Inhibit the use of disallowed characters.
773
7742007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
775
776 Miscellaneous %define and %code cleanup.
777 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
778 values are interpreted.
779 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
780 documentation a little more.
781 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
782 muscle_percent_define_insert, muscle_percent_code_grow): New
783 functions/macros.
784 * src/muscle_tab.h (muscle_percent_define_insert,
785 muscle_percent_code_grow): Prototype.
786 * src/parse-gram.y (prologue_declaration): Use
787 muscle_percent_define_insert and muscle_percent_code_grow when parsing
788 %define and %code directives.
789
790 Make it easy to share %define boolean variables between the front-end
791 and back-end. Though not used yet, this will be useful in the future.
792 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
793 Bison uses of names rather than just skeleton uses of names.
794 (b4_percent_define_get, b4_percent_define_ifdef): Rename
795 b4_percent_define_skeleton_variables(VARIABLE) to
796 b4_percent_define_bison_variables(VARIABLE).
797 (b4_percent_code_get, b4_percent_code_ifdef): Rename
798 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
799 b4_percent_code_bison_qualifiers(QUALIFIER).
800 (b4_check_user_names_wrap): Update for renames.
801 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
802 muscle_percent_define_default): New functions mimicking
803 b4_percent_define_flag_if and b4_percent_define_default.
804
805 For %define variables, report locations for invalid values and
806 redefinitions.
807 * data/bison.m4 (b4_percent_define_flag_if): Read
808 b4_percent_define_loc(VARIABLE) to report the location of an invalid
809 value for VARIABLE.
810 (b4_percent_define_default): Save a special location in
811 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
812 must later be reported as invalid.
813 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
814 functions.
815 (muscle_percent_define_insert): Record the location of VARIABLE in
816 muscle percent_define_loc(VARIABLE), and use it to report the previous
817 location for a redefinition.
818 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
819 (muscle_percent_define_default): Update like b4_percent_define_default.
820 (muscle_grow_user_name_list): Rename to...
821 (muscle_user_name_list_grow): ... this for consistency and use
822 muscle_location_grow.
823 * src/muscle_tab.h (muscle_location_grow): Prototype.
824 * tests/input.at (%define errors): Update expected output.
825 * tests/skeletons.at (%define boolean variables: invalid skeleton
826 defaults): New test case.
827
8282007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
829
830 * src/print.c (lookahead_set, state_default_rule): Remove.
831 (print_reductions): Replace state_default_rule invocation with
832 equivalent use of yydefact, which was computed in token_actions in
833 tables.c.
834 (print_results): Don't allocate lookahead_set.
835
8362007-02-27 Paolo Bonzini <bonzini@gnu.org>
837
838 * data/lalr1.java: Prefix all private members with yy.
839
8402007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
841
842 Use YYFPRINTF instead of fprintf where appropriate. Reported by
843 Sebastien Fricker at
844 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
845 * THANKS: Add Sebastien Fricker.
846 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
847 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
848 accept a variable number of arguments.
849
8502007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
851
852 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
853
8542007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
855
856 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
857 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
858 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
859
8602007-02-11 Paul Eggert <eggert@cs.ucla.edu>
861
862 Undo my 2007-02-07 change, switching back to the c-strcase module
863 introduced in the 2007-02-03 change. Bruno Haible reported that
864 the 2007-02-07 change would be dangerous in Turkish if we add a
865 language whose name contains "i", since "i" is not lowercase "I"
866 in Turkish.
867 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
868 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
869 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
870 * m4/.cvsignore: Remove strcase.m4.
871 * src/getargs.c: Revert 2007-02-07 change, as follows.
872 Include c-strcase.h.
873 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
874
8752007-02-11 Bruno Haible <bruno@clisp.org>
876
877 Enable the Java related testsuite tests when the only Java compiler
878 found is a gcj < 4.3. Discussed at
879 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
880 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
881
8822007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
883
884 * data/Makefile.am: Update copyright date.
885 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
886 yypstate_new returns NULL.
887 (yypstate_new): Return NULL if malloc does.
888 * src/reader.c (packgram): Move translation of rule actions from the
889 beginning of packgram to...
890 (check_and_convert_grammar): ... here right before packgram is invoked
891 so it's easier to write more complete comments, and remove redundant
892 code.
893
8942007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
895
896 As in semantic actions, make @$ in %initial-action, %destructor, and
897 %printer imply %locations.
898 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
899 scanning @$.
900 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
901 (@$ in %initial-action implies %locations,
902 @$ in %destructor implies %locations,
903 @$ in %printer implies %locations): ... these new test cases.
904
9052007-02-07 Paul Eggert <eggert@cs.ucla.edu>
906
907 Undo most of the 2007-02-03 change, switching to the strcase module
908 now that gnulib strcase has been fixed.
909 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
910 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
911 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
912 * m4/.cvsignore: Add strcase.m4.
913 * src/getargs.c: Revert 2007-02-03 change, as follows.
914 Don't include c-strcase.h.
915 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
916 strcasecmp has "unspecified behavior" outside the POSIX locale,
917 but it works fine in practice if at least one argument is ASCII,
918 as is the case in Bison.
919
9202007-02-07 Paolo Bonzini <bonzini@gnu.org>
921
922 * tests/java.at: Skip tests if only one of javac/java is present.
923 Reported by Joel E. Denny.
924 * tests/atlocal.in: Adjust copyright years.
925
9262007-02-05 Paolo Bonzini <bonzini@gnu.org>
927
928 * data/lalr1.java (Stack): Work around old verifiers that disallow
929 access to the private fields of an inner class, from the outer class.
930 We can make Stack's fields public because user code doesn't have access
931 to the instance of Stack used by parse(). Reported by Paul Eggert.
932
9332007-02-03 Paul Eggert <eggert@cs.ucla.edu>
934
935 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
936 the right spot for these files?
937 * bootstrap.conf (gnulib_modules): Add c-strcase.
938 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
939 c-strncasecmp.c.
940 * src/getargs.c: Include c-strcase.h.
941 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
942 to avoid unspecified behavior.
943
9442007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
945
946 * doc/bison.texinfo (Decl Summary): Correct typo.
947
9482007-01-30 Paolo Bonzini <bonzini@gnu.org>
949
950 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
951 Complain if the value does not match empty, "true" or "false".
952 * data/c++.m4: Adjust default definitions of %define variables.
953 * data/java.m4: Adjust default definitions of %define variables.
954 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
955 to above behavior.
956 * tests/input.at (Boolean %define variables): Test new behavior.
957
9582007-01-29 Paolo Bonzini <bonzini@gnu.org>
959
960 * NEWS: Mention java.
961 * TODO: Remove things that are done.
962 * bootstrap.conf: Add javacomp-script and javaexec-script.
963 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
964
965 * data/Makefile.am: Add new files.
966 * data/java-skel.m4: New.
967 * data/java.m4: New.
968 * data/lalr1.java: New.
969
970 * doc/bison.texinfo: Put "A Complete C++ Example" under
971 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
972 under Other Languages.
973
974 * src/getargs.c (valid_languages): Add Java.
975 * src/getargs.h (struct bison_language): Update size of string fields.
976
977 * tests/Makefile.am: Add java.at.
978 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
979 * tests/java.at: New.
980 * tests/testsuite.at: Include it.
981
9822007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
983
984 Clean up.
985 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
986 at_directive_argv arguments so these no longer have to be global
987 variables. Also, update the implementation for the following changes.
988 (fail_for_at_directive_too_many_args,
989 fail_for_at_directive_too_few_args): Add at_directive_name argument.
990 (at_directive_name): Remove as at_directive_argv[0] will be used for
991 this now.
992 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
993 for the directive name.
994 (at_directive_argc, at_directive_argv): Make these local within
995 skel_lex instead of global.
996 (INITIAL): Update directive start action for above changes.
997 (SC_AT_DIRECTIVE_ARG): Rename to...
998 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
999 (SC_AT_DIRECTIVE_SKIP_WS): Update.
1000 (scan_skel): Move yylex_destroy to...
1001 (skel_scanner_free): ... here.
1002 * tests/skeletons.at (installed skeleton file name): Rename to...
1003 (installed skeleton file names): ... this.
1004
10052007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
1006
1007 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1008 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
1009 Summary" not "Directives".
1010 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
1011 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
1012 since the former is now the more complete one.
1013 (Prologue Alternatives): Likewise and do the same for %defines.
1014 (Table of Symbols): Add summary of %code, add summary of %define, and
1015 move full %code documentation to...
1016 (Decl Summary): ... here for consistency with other entries in these
1017 sections.
1018 Move %define entry in order to keep this list alphabetized.
1019 Reword %define entry a little to put less emphasis on the skeleton
1020 concept, which most users shouldn't have to think about.
1021
10222007-01-26 Paul Eggert <eggert@cs.ucla.edu>
1023
1024 Adjust to recent gnulib changes.
1025 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
1026 Add string.h, string_.h, unistd_.h, wchar_.h.
1027 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
1028 * src/system.h: Don't include <stpcpy.h>; this is now done by
1029 <string.h>.
1030
10312007-01-23 Paolo Bonzini <bonzini@gnu.org>
1032
1033 Simplify implementation of unqualified %code, implement macros for
1034 uniform treatment of boolean %define flags. Document %define.
1035 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
1036 b4_percent_code_ifdef): New.
1037 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
1038 * data/c++.m4: Define default value for global_tokens_and_yystype.
1039 * data/glr.cc: Likewise.
1040 * data/location.cc: Use b4_percent_define_flag_if.
1041
1042 * doc/bison.texinfo (Decl Summary): Document %define.
1043
1044 * src/parse-gram.y (Unqualified %code): Change muscle name to
1045 b4_percent_code().
1046 (content.opt): Default to empty.
1047
10482007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1049
1050 Implement support for relative and absolute skeleton file names.
1051 Discussed starting at
1052 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
1053 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
1054 (Bison Options): Document in --skeleton entry.
1055 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
1056 full_skeleton can't necessarily hold all of pkgdatadir.
1057 If the specified skeleton file name contains a `/', don't prepend
1058 pkgdatadir.
1059 * src/parse-gram.y (prologue_declaration): If the specified skeleton
1060 file name contains a `/', prepend the grammar file directory.
1061 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
1062 * skeletons.at: New file.
1063 (relative skeleton file names): New test case.
1064 (installed skeleton file names): New test case.
1065 * tests/testsuite.at: Include skeletons.at.
1066
1067 * bootstrap: Update copyright to 2007.
1068
10692007-01-17 Paolo Bonzini <bonzini@gnu.org>
1070
1071 * bootstrap: Remove occurrences of .#bootmp from the files.
1072
10732007-01-17 Akim Demaille <akim@epita.fr>
1074
1075 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
1076 nonterminals.
1077 Use per-type %printer.
1078
10792007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1080
1081 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
1082 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1083 djgpp/config.site, src/files.c, src/files.h, src/main.c,
1084 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
1085 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
1086 tests/glr-regression.at, tests/input.at, tests/local.at,
1087 tests/output.at, tests/torture.at: Update copyright to 2007.
1088
10892007-01-16 Akim Demaille <akim@epita.fr>
1090
1091 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
1092 error code.
1093 (Calc++ Scanner): Exit with failure if we can't open the input
1094 file.
1095 Accept "-" standing for stdin.
1096 (Calc++ Top Level): Print the result only if the parsing was
1097 successful.
1098
10992007-01-16 Akim Demaille <akim@epita.fr>
1100
1101 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
1102
11032007-01-15 Paolo Bonzini <bonzini@gnu.org>
1104 and Joel E. Denny <jdenny@ces.clemson.edu>
1105
1106 Clean up %define and %code implementation in M4 some. Most
1107 importantly, rename all related macros to be in the b4_percent_define
1108 and b4_percent_code namespaces. Also, complete support for `.' in
1109 %define variable names and %code qualifiers.
1110 * data/bison.m4 (b4_check_user_names): Check for special
1111 "SKELETON-NAMESPACE(name)" macros instead of using two nested
1112 m4_foreach loops.
1113 (b4_get_percent_define, b4_get_percent_code): Rename to...
1114 (b4_percent_define_get, b4_percent_code_get): ... these.
1115 Extend documentation with examples.
1116 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
1117 b4_percent_define_skeleton_variables and
1118 b4_percent_code_skeleton_qualifiers.
1119 Expect any value for the %define variable `foo' to be stored in the
1120 macro named `b4_percent_define(foo)'; expect any %code blocks for the
1121 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
1122 expect any unqualified %code blocks to be stored in a macro named
1123 `b4_percent_code_unqualified'.
1124 Use m4_indir so that %define variable names and %code qualifiers can
1125 contain `.', which is allowed by the grammar parser.
1126 (b4_percent_define_default): New macro to set a default value for a
1127 %define variable.
1128 (m4_wrap): Update wrapped code, and fix some underquoting.
1129 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
1130 Expect grammar uses of %define variables and %code qualifiers to be
1131 defined in b4_percent_define_user_variables and
1132 b4_percent_code_user_qualifiers.
1133 * data/c++.m4: Use b4_percent_define_default rather than
1134 m4_define_default. Fix some underquoting. Skeleton usage of %define
1135 variable define_location_comparison now implies skeleton usage of
1136 %define variable filename_type.
1137 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1138 data/push.c, data/yacc.c: Update macro names.
1139 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
1140 muscle names.
1141
11422007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1143
1144 DJGPP specific issues.
1145
1146 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
1147 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
1148
11492007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1150
1151 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
1152 run parsers in all tests so that Valgrind is invoked during
1153 maintainer-check-valgrind.
1154 (Duplicate representation of merged trees): Free all semantic values.
1155 (Duplicated user destructor for lookahead): Likewise.
1156
11572007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1158
1159 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
1160 command-line prefix.
1161 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
1162 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
1163 miss Valgrind messages.
1164 (Exploding the Stack Size with Malloc): Likewise.
1165
11662007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1167
1168 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
1169 locals. Reported by Juan Manuel Guerrero at
1170 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
1171 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
1172 Fix some indentation also.
1173 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
1174 explaining this issue.
1175
11762007-01-09 Paolo Bonzini <bonzini@gnu.org>
1177 and Joel E. Denny <jdenny@ces.clemson.edu>
1178
1179 Simplify union and prologue handling, and escape union and lex/parse
1180 params with digraphs.
1181 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
1182 values to the empty string since these are no longer guaranteed
1183 initialized by the front-end.
1184 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
1185 braces around b4_user_stype since this is no longer done by the
1186 front-end.
1187 * src/files.c, src/files.h (pre_prologue_obstack,
1188 post_prologue_obstack): Remove.
1189 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
1190 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
1191 with digraphs. This fixes lex params and parse params.
1192 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
1193 * src/output.c (prepare): Remove muscle insertion of the prologues.
1194 (output): Remove freeing of pre_prologue_obstack and
1195 post_prologue_obstack.
1196 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
1197 than prologue_augment for prologue parsing so you don't need prologue
1198 obstacks.
1199 (grammar_declaration): For %union RHS, use `braceless' instead of
1200 "{...}" so that braces are already stripped and code is escaped with
1201 digraphs.
1202 * src/reader.c (prologue_augment): Remove.
1203 (reader): Remove initialization of pre_prologue_obstack and
1204 post_prologue_obstack.
1205 * src/reader.h (prologue_augment): Remove.
1206
1207 * data/c.m4: Remove stray parenthesis.
1208
12092007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1210
1211 Remove quotes from variables names in %define directives and from
1212 qualifiers in %code directives, and restrict the characters that are
1213 allowed in them to M4-friendly ones. For %define, continue to support
1214 the quoted form as a deprecated feature. Discussed starting at
1215 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
1216 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
1217 %code.
1218 * doc/bison.texinfo (Prologue Alternatives): Update.
1219 (Decl Summary): In %defines entry, update mention of `%code requires'
1220 and `%code provides'.
1221 (C++ Location Values): Update %define uses.
1222 (Calc++ Parser Interface): Likewise.
1223 (Calc++ Parser): Likewise, and update `%code requires' uses.
1224 (Table of Symbols): Update %code documentation.
1225 * src/parse-gram.y (prologue_declaration): For %define variables, use
1226 `variable' instead of `STRING'.
1227 (grammar_declaration): For %code qualifiers, use `ID' instead of
1228 `STRING'.
1229 (variable): New nonterminal that takes an `ID' or a `STRING'.
1230 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
1231 and %define uses.
1232 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
1233 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
1234 (%define errors): Update %define uses.
1235
12362007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1237
1238 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
1239 instead of muscle_insert for %define values so that M4-special
1240 characters are replaced with digraphs.
1241 * tests/input.at (%define errors): Extend to check weird values.
1242
12432007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1244
1245 Instead of having skeletons declare all valid %define variables and
1246 %code qualifiers, provide macros that retrieve the associated values
1247 and build these lists automatically. Thus Bison will now warn when a
1248 variable or qualifier is not used by the skeleton in the current
1249 invocation regardless of whether it might sometimes be used by that
1250 skeleton in other invocations. Also, move all %define value macros to
1251 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
1252 form, which is replaced by %code.
1253 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
1254 (b4_check_user_names): ... this, and change the series of valid name
1255 arguments to a single list argument for names used in the skeleton
1256 similar to the existing list argument for names used in the grammar.
1257 Warn instead of complaining.
1258 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
1259 values and %code code, to format %code code properly, and to build
1260 lists of all %define variables and %code qualifiers used in the
1261 skeleton: b4_skeleton_percent_define_variables and
1262 b4_skeleton_percent_code_qualifiers.
1263 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
1264 Remove, and...
1265 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
1266 the skeleton names lists can finish building first. In place of
1267 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
1268 expect the lists b4_user_percent_define_variables and
1269 b4_user_percent_code_qualifiers.
1270 * data/c++.m4: Where setting default values for b4_parser_class_name,
1271 b4_location_type, b4_filename_type, b4_namespace, and
1272 b4_define_location_comparison, update their names to the
1273 b4_percent_define_ namespace.
1274 * data/glr.c: Don't use b4_check_percent_define_variables and
1275 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1276 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
1277 (b4_parser_class_name, b4_namespace): Define these using
1278 b4_get_percent_define for parser_class_name and namespace.
1279 * data/location.cc: Use b4_get_percent_define.
1280 * data/push.c: Don't use b4_check_percent_define_variables and
1281 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1282 * data/yacc.c: Likewise, and don't call m4_exit in
1283 b4_use_push_for_pull_if or m4_wrap code will never execute.
1284 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
1285 Rename to...
1286 (muscle_grow_user_name_list): ... this for consistency with the
1287 terminology used in bison.m4.
1288 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
1289 %define variable names, and rename muscle used_percent_define_variables
1290 to user_percent_define_variables.
1291 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
1292 user_percent_code_qualifiers.
1293 (content): Remove.
1294 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
1295 {CODE} form is no longer accepted.
1296 * tests/input.at (Reject bad %code qualifiers): Rename to...
1297 (Reject unused %code qualifiers): ... this, and update test output.
1298 (%define error): Update test output.
1299
13002007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
1301
1302 Check for unrecognized %define variables similar to checking for
1303 unrecognized %code qualifiers. Check for redefined %define variables.
1304 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
1305 generalizes...
1306 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
1307 (b4_check_percent_define_variables): New, also wraps it.
1308 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
1309 variables using b4_check_percent_define_variables.
1310 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
1311 all those exercised in the test suite and all those listed in the
1312 `Default values' section of c++.m4. Are there others?
1313 * data/push.c, data/yacc.c: Declare no valid %define variables.
1314 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
1315 similar to muscle_find, but it works even when the muscle stores a
1316 const value.
1317 (muscle_grow_used_name_list): New function for constructing the used
1318 name list muscles that b4_check_for_unrecognized_names requires.
1319 * src/parse-gram.y (prologue_declaration): Warn if a variable is
1320 %define'd more than once. Define the b4_used_percent_define_variables
1321 muscle with muscle_grow_used_name_list.
1322 (grammar_declaration): Abbreviate %code code with
1323 muscle_grow_used_name_list.
1324 * tests/input.at (%define errors): New.
1325
13262007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1327
1328 Provide warn_at, complain_at, and fatal_at function callbacks to the
1329 skeletons, and use this for %code qualifier complaints.
1330 * data/bison.m4 (b4_error_at): New, invoked by...
1331 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
1332 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
1333 @fatal_at(...@) directives.
1334 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
1335 qualifiers in b4_used_percent_code_qualifiers and to use
1336 b4_complain_at.
1337 * src/location.c, src/location.h (boundary_set_from_string): New global
1338 function.
1339 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
1340 function.
1341 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
1342 to b4_used_percent_code_qualifiers.
1343 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
1344 function.
1345 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
1346 (lineno): Rename to...
1347 (out_lineno): ... this so I don't misunderstand it again.
1348 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
1349 here; these newlines are in the input but not the output file.
1350 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
1351 (at_directive_perform): ... this new static function, and add handling
1352 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
1353 directives.
1354 * tests/input.at (Reject bad %code qualifiers): Update test output with
1355 locations and extend.
1356
1357 * tests/output.at (Output file name: [, Output file name: ]): Remove
1358 bogus comment about these tests failing.
1359
13602007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1361
1362 Clean up b4_check_percent_code_qualifiers a little.
1363 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
1364 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
1365 documentation and add examples.
1366 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
1367 qualifiers here.
1368
13692007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
1370
1371 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
1372 unreliable -- especially when they're hidden inside another macro.
1373 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
1374 data/c.m4: Remove m4_divert(-1).
1375 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1376 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
1377 m4_divert_push(0) and m4_divert_pop(0).
1378 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
1379 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
1380 pushed and popped by m4sugar, should be first on the stack.
1381
1382 Provide warn, complain, and fatal function callbacks to the skeletons.
1383 This provides more flexibility than m4_fatal, improves the error
1384 message format, and captures messages for translation. Discussed
1385 starting at
1386 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
1387 * data/bison.m4 (b4_error): New, invoked by...
1388 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
1389 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
1390 directives. Because these M4 macros might be called when the current
1391 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
1392 the previous removal of uses of m4_divert, which caused trouble.
1393 (b4_check_percent_code_qualifiers): Use b4_complain instead of
1394 m4_fatal to report unrecognized %code qualifiers.
1395 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
1396 push parser requests.
1397 * data/glr.c: Use b4_complain instead of m4_fatal to report
1398 non-deterministic push parser requests.
1399 Update @output usage to @output(...@) form.
1400 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
1401 report missing %defines. Update @output usage to @output(...@) form.
1402 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
1403 @output(...@) form.
1404 * src/main.c (main): Invoke skel_scanner_free.
1405 * src/scan-skel.h (skel_scanner_free): Prototype new function.
1406 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
1407 obstack_for_string from flex-scanner.h.
1408 (YY_DECL): Use to declare skel_lex static.
1409 (decode_at_digraphs): Remove; now handled in the new
1410 SC_AT_DIRECTIVE_ARG start condition.
1411 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
1412 functions.
1413 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
1414 at_directive_argv): New static globals.
1415 (INITIAL): Use fail_for_invalid_at.
1416 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
1417 recognize the start of a generalized `@directive(...@)' form and
1418 start...
1419 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
1420 directive args (using the new obstack_for_string), to decode the
1421 contained @ diagraphs, and to perform the directive. It recognizes
1422 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
1423 @output(...@).
1424 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
1425 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
1426 `@,'.
1427 (scan_skel): Initialize obstack_for_string on the first call.
1428 (skel_scanner_free): New function to free obstack_for_string.
1429 * tests/input.at (Reject bad %code qualifiers): Update test output.
1430
14312007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
1432
1433 Consolidate the 4 prologue alternative directives (%code, %requires,
1434 %provides, and %code-top) into a single %code directive with an
1435 optional qualifier field. Discussed at
1436 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
1437 * NEWS (2.3a+): Rewrite the existing entry for the prologue
1438 alternatives.
1439 * doc/bison.texinfo (Prologue Alternatives): Update.
1440 (Decl Summary): Update to %code "requires" and %code "provides".
1441 (Calc++ Parser): Update to %code "requires".
1442 (Table of Symbols): Remove entries for %requires, %provides, and
1443 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
1444 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
1445 are replaced by b4_percent_code_provides and b4_percent_code_requires,
1446 which are skeleton-specific.
1447 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
1448 declare what %code qualifiers it supports and to complain if any other
1449 qualifiers were used in the grammar.
1450 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
1451 and b4_user_code([b4_percent_code_provides]) in place of
1452 b4_user_requires and b4_user_provides.
1453 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
1454 Add b4_user_code([b4_percent_code_top]) and
1455 b4_user_code([b4_percent_code]).
1456 Invoke b4_check_percent_code_qualifiers.
1457 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
1458 PERCENT_REQUIRES): Remove.
1459 (grammar_declaration): Remove RHS's for %code-top, %provides, and
1460 %requires. Rewrite the %code RHS as the unqualified form defining the
1461 muscle b4_percent_code. Add another RHS for the qualified %code form,
1462 which defines muscles of the form b4_percent_code_QUALIFIER and the
1463 b4_used_percent_code_qualifiers muscle.
1464 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
1465 PERCENT_REQUIRES): Remove.
1466 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
1467 %code "requires" and %code "provides".
1468 * tests/input.at (Reject bad %code qualifiers): New.
1469
14702007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
1471
1472 Use the new code_props interface for destructors and printers.
1473 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
1474 printer_location members, and change the type of the destructor and
1475 printer members to code_props.
1476 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
1477 symbol_printer_get, semantic_type_destructor_set,
1478 semantic_type_printer_set, default_tagged_destructor_set,
1479 default_tagless_destructor_set, default_tagged_printer_set,
1480 default_tagless_printer_set): Use code_props in arguments and return
1481 types in place of char const * and location.
1482 (symbol_destructor_location_get, symbol_printer_location_get): Remove
1483 since the locations are now contained in the return of
1484 symbol_destructor_get and symbol_printer_get.
1485 * src/output.c (symbol_destructors_output, symbol_printers_output):
1486 Replace with...
1487 (symbol_code_props_output): ... this to eliminate duplicate code.
1488 (output_skeleton): Update to use symbol_code_props_output.
1489 * src/reader.c (symbol_should_be_used): Update use of
1490 symbol_destructor_get.
1491 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1492 Update uses of the various _destructor_set and _printer_set functions.
1493 * src/symtab.c: (default_tagged_destructor_location,
1494 default_tagless_destructor_location, default_tagged_printer_location,
1495 default_tagless_printer_location): Remove since we...
1496 (default_tagged_destructor, default_tagless_destructor,
1497 default_tagged_printer, default_tagless_printer): ... change the type
1498 of these to code_props.
1499 (symbol_new, semantic_type_new, symbol_destructor_set,
1500 semantic_type_destructor_set, symbol_destructor_get,
1501 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
1502 symbol_check_alias_consistency, default_tagged_destructor_set,
1503 default_tagless_destructor_set, default_tagged_printer_set,
1504 default_tagless_printer_set): Update.
1505 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
1506 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
1507 code_props members.
1508 (symbol_print): Use SYMBOL_CODE_PRINT.
1509
15102007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
1511
1512 Use the new code_props interface for rule actions.
1513 * src/symlist.h (symbol_list): Replace action, action_location, and
1514 used members with a code_props action_props member.
1515 * src/reader.c (symbol_should_be_used, grammar_rule_check,
1516 grammar_midrule_action, grammar_current_rule_merge_set,
1517 grammar_current_rule_symbol_append, packgram): Update.
1518 * src/scan-code.h (translate_rule_action): Remove, no longer used.
1519 * src/scan-code.l (handle_action_dollar): Update.
1520 (translate_rule_action): Remove, no longer used.
1521 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
1522
15232007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1524
1525 Use the new code_props interface in parse-gram.y.
1526 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
1527 Update all uses of translate_* functions to use the new code_props
1528 interface and to use gram_scanner_last_string_free and
1529 code_scanner_last_string_free where possible.
1530 (grammar_declaration): symbol_list_destructor_set and
1531 symbol_list_printer_set now perform the translation, so don't do it
1532 here. Use gram_scanner_last_string_free where possible.
1533 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
1534 translate_code): Remove, no longer used.
1535 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
1536 symbol_list_printer_set): Perform code translation here rather than
1537 depending on the caller to do so.
1538
1539 * src/symlist.h (struct symbol_list): Correct some documentation typos.
1540 * src/scan-gram.h (gram_last_string): Remove declaration.
1541 * src/scan-gram.l (last_string): Declare it static.
1542
15432007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1544
1545 Encapsulate code properties and related functionality for the various
1546 destructors, printers, and actions into a code_props structure and
1547 interface. This patch merely implements code_props in scan-code.h and
1548 scan-code.l. Future patches will rewrite other modules to use it.
1549 Discussed starting at
1550 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
1551 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
1552 consistently initialize const structs that have an empty location
1553 field.
1554 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
1555 to ensure consistency.
1556 * src/scan-code.h (code_props): New structure.
1557 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
1558 function, macro, and const global variable for initializing a
1559 code_props with no code.
1560 (code_props_plain_init, code_props_symbol_action_init,
1561 code_props_rule_action_init, code_props_translate_code): The rest of
1562 the new code_props functional interface. Among other things, the init
1563 functions set the code_props kind field so that
1564 code_props_translate_code will know whether to behave like
1565 translate_symbol_action, translate_rule_action, or translate_code.
1566 These old translate functions must remain until all other modules are
1567 updated to use the new code_props interface.
1568 (code_scanner_last_string_free): New function similar to
1569 gram_scanner_last_string_free.
1570 (code_scanner_free): Add documentation.
1571 * src/scan-code.l: Implement the new interface.
1572 (code_lex): Make it static, add a code_props* argument, and remove the
1573 rule argument.
1574 (last_string): New static global similar to the one in scan-gram.l.
1575 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
1576 instead of rule.
1577 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
1578 code_props since Bison may one day use this information for destructors
1579 and printers.
1580 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
1581 (handle_action_dollar): Use symbol_list_n_get and set used flag
1582 directly since symbol_list_n_used_set is removed.
1583 (translate_action): Add a code_props* argument and remove the rule,
1584 action, and location arguments. Pass the code_props* on to code_lex.
1585 (translate_rule_action, translate_symbol_action, translate_code):
1586 Rewrite as wrappers around the new code_props interface.
1587 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
1588 it would eventually need to break the encapsulation of code_props.
1589
15902007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
1591
1592 * etc/.cvsignore: New.
1593
15942007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
1595
1596 Add maintainer-push-check to run maintainer-check using push parsing in
1597 place of pull parsing where available.
1598 * Makefile.am (maintainer-push-check): New.
1599 * data/bison.m4 (b4_use_push_for_pull_if): New.
1600 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
1601 appropriately based on their existing values.
1602 (yypush_parse): Don't print push-parser-specific diagnostics if push
1603 parsing is being used in place of pull parsing.
1604 * data/yacc.c: If push parsing should replace pull parsing, redirect to
1605 push.c.
1606 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
1607 variable, and insert b4_use_push_for_pull_flag into muscles.
1608 * tests/Makefile.am (maintainer-push-check): New.
1609
16102006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
1611
1612 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
1613 (whether successful or failed) so that yypush_parse can be invoked
1614 again to start a new parse using the same yypstate.
1615 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
1616 check multiple yypull_parse invocations on the same yypstate. For pull
1617 mode, extend to check multiple yyparse invocations.
1618 (Exploding the Stack Size with Alloca): Extend to try with
1619 %push-pull-parser.
1620 (Exploding the Stack Size with Malloc): Likewise.
1621
1622 * tests/calc.at (Simple LALR Calculator): Don't specify
1623 %skeleton "push.c" since %push-pull-parser implies that now.
1624 * tests/headers.at (export YYLTYPE): Don't check for the push
1625 declarations. Otherwise, this test case can't be used to see if push
1626 mode can truly emulate pull mode.
1627 * tests/input.at (Torturing the Scanner): Likewise.
1628 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
1629 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
1630 AT_YACC_IF, which now includes the case of push mode since %skeleton
1631 need not be used for push mode. This will be more intuitive once
1632 push.c is renamed to yacc.c.
1633
16342006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
1635
1636 For push mode, convert yyparse from a macro to a function, invoke yylex
1637 instead of passing a yylexp argument to yypull_parse, and don't
1638 generate yypull_parse or yyparse unless %push-pull-parser is declared.
1639 Discussed starting at
1640 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
1641 * data/bison.m4 (b4_pull_if): New.
1642 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
1643 * data/push.c: Improve M4 quoting a little.
1644 (b4_generate_macro_args, b4_parenthesize): Remove.
1645 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
1646 any time a pull parser is requested.
1647 Don't #define this as a wrapper around yypull_parse. Instead, when
1648 both push and pull are requested, make it a function that does that
1649 same thing.
1650 (yypull_parse): If there's a b4_prefix, #define this to
1651 b4_prefix[pull_parse] when both push and pull are requested.
1652 Don't define this as a function unless both push and pull are
1653 requested.
1654 Remove the yylexp argument and hard-code yylex invocation instead.
1655 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
1656 %push-parser.
1657 * src/getargs.c (pull_parser): New global initialized to true.
1658 * getargs.h (pull_parser): extern it.
1659 * src/output.c (prepare): Insert pull_flag muscle.
1660 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
1661 (prologue_declaration): Set both push_parser and pull_parser = true for
1662 %push-pull-parser. Set push_parser = true and pull_parser = false for
1663 %push-parser.
1664 * src/scan-gram.l: Don't accept %push_parser as an alternative to
1665 %push-parser since there's no backward-compatibility concern here.
1666 Scan %push-pull-parser.
1667 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
1668 instead of %push-parser.
1669 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
1670 prototype it in the module that calls yyparse.
1671 * tests/input.at (Torturing the Scanner): Likewise.
1672 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
1673
16742006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
1675
1676 Update etc/bench.pl. Optimize push mode a little (the yyn change
1677 deserves most of the credit).
1678 * Makefile.am (SUBDIRS): Add etc subdirectory.
1679 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
1680 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
1681 yytoken, yyval, and yyloc declarations to...
1682 (yyparse or yypush_parse): ... here to improve performance. For
1683 yypush_parse invocations after the first, be sure to assign yyn its old
1684 value again.
1685 (yypstate_new): Don't bother initializing the yyresult field since the
1686 initial value isn't used.
1687 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
1688 remove the #define that, in push mode, set it to yyps->NAME.
1689 * etc/Makefile.am: New.
1690 * etc/bench.pl: Remove and build it instead from...
1691 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
1692 "tests/bison" from the build directory by default rather than just
1693 invoking "bison" from $PATH.
1694 (calc_grammar): Update push parser code: don't declare yylval globally,
1695 don't define yyparse_wrapper, and don't #define yyparse.
1696 (bench_grammar): Update to check all working combinations of yacc.c,
1697 push.c, impure, pure, pull, and push.
1698
16992006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1700
1701 For push mode, add pull wrappers around yypush_parse.
1702 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
1703 (yypull_parse): New function wrapping yypush_parse.
1704 (yyparse): New #define wrapping yypull_parse.
1705 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
1706 is declared.
1707 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
1708 prototype yylex in the module that calls yyparse, and don't prototype
1709 yyparse there. Otherwise, the yyparse expansion won't compile.
1710 * tests/input.at (Torturing the Scanner): Likewise.
1711
17122006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1713
1714 Enable push parsers to operate in impure mode. Thus, %push-parser no
1715 longer implies %pure-parser. The point of this change is to move
1716 towards being able to test the push parser code by running the entire
1717 test suite as if %push-parser had been declared.
1718 * data/push.c (yypush_parse): For impure mode, remove the
1719 yypushed_char, yypushed_val, and yypushed_loc arguments.
1720 Instead, declare these as local variables initialized to the global
1721 yychar, yylval, and yylloc.
1722 For the first yypush_parse invocation only, restore the initial values
1723 of these global variables when it's time to read a token since they
1724 have been overwritten.
1725 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
1726 %push-parser.
1727 * tests/calc.at (Simple LALR(1) Calculator): Always declare
1728 %pure-parser along with %push-parser since this test case was designed
1729 for pure push parsers.
1730 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
1731 (AT_YACC_OR_PUSH_IF): New.
1732 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
1733 add a note that it's still wrong for some cases (as it has been for a
1734 while).
1735 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
1736 %push-parser no longer implies %pure-parser.
1737
17382006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1739
1740 Remove some unnecessary differences between the pull parser code and
1741 the push parser code. This patch enables yynerrs in push mode.
1742 * data/push.c: Reformat M4 a little.
1743 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
1744 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
1745 because push mode is on. Instead, if pure mode is on, move yynerrs
1746 to...
1747 (b4_declare_parser_state_variables): ... here.
1748 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
1749 to yyps->NAME so it can be used in yypush_parse.
1750 (yypush_parse): Don't omit uses of yynerrs in push mode.
1751
17522006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1753
1754 Fix bug such that the first pushed token's value and location are
1755 sometimes overwritten (sometimes by %initial-action) before being used.
1756 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
1757 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
1758 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
1759 more closely mimic the pull parser logic.
1760 Don't copy the pushed token to yychar, yylval, and yylloc until it's
1761 time to read a token, which is after any initialization of yylval and
1762 yylloc.
1763 (gottoken): Rename label to...
1764 (yyread_pushed_token): ... for clarity and to avoid infringing on the
1765 user namespace.
1766
17672006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1768
1769 Rearrange initialization of the parser state variables so that the
1770 skeleton doesn't have to have a copy for pull mode and another for push
1771 mode. This patch also fixes at least a bug such that yylloc was not
1772 initialized (with b4_location_initial_line and
1773 b4_location_initial_column) upon calling yypush_parse. However, that
1774 initialization now overwrites the first token's location;
1775 %initial-action assigning @$ already did the same thing, and both bugs
1776 will be fixed in a later patch.
1777 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
1778 (b4_declare_parser_state_variables): Remove initialization of yytoken,
1779 yyss, yyvs, yyls, and yystacksize.
1780 (yypstate_new): Remove initialization of some yypstate fields: yystate,
1781 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
1782 yylsp.
1783 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
1784 yyps->NAME so it can be used in yypush_parse.
1785 (yyparse or yypush_parse): For yypush_parse, don't print the
1786 "Starting parse" diagnostic for invocations after the first.
1787 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
1788 yypush_parse, only do it for the first invocation.
1789 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
1790 initialization to occur in yypush_parse but only on the first
1791 invocation.
1792
17932006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1794
1795 * data/push.c: Add CPP guards around push parser declarations in both
1796 the header and the code file.
1797 In the code file, move the push parser declarations to the same place
1798 they appear in the header file.
1799 Clean up the M4 some, especially the inconsistent underquoting in
1800 some b4_c_function_def and b4_c_function_decl uses.
1801
18022006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1803
1804 Encapsulate the push parser state variables into an M4 macro so the
1805 push skeleton doesn't have to list them again for pull mode's yyparse.
1806 For push mode, remove yypush_parse's local equivalents of these
1807 variables to eliminate unnecessary copying between the two sets at
1808 run-time. This patch also fixes at least a bug related to multiple
1809 %initial-action invocations in push mode.
1810 * data/push.c (b4_declare_parser_variables): Rename to...
1811 (b4_declare_scanner_communication_variables): ... this for clarity and
1812 update both uses.
1813 (b4_declare_yyparse_variables): Remove and move its contents to the one
1814 spot where it was invoked.
1815 (b4_declare_parser_state_variables): New macro containing the parser
1816 state variables required by push mode.
1817 (struct yypstate): Replace all fields but yynew with
1818 b4_declare_parser_state_variables.
1819 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
1820 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
1821 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
1822 (yyparse or yypush_parse): For yyparse in pull mode, replace local
1823 parser state variable declarations with
1824 b4_declare_parser_state_variables.
1825 Don't initialize parser state variables when calling yypush_parse since
1826 yypstate_new already does that.
1827 Invoke the user's initial action only upon the first yypush_parse
1828 invocation.
1829 Remove all code that copies between the local parser state variables
1830 and the yypstate.
1831
18322006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1833
1834 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
1835 prevent a name collision in a future patch where these names will
1836 sometimes be #define'd.
1837 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
1838 since it no longer has the same name as the existing argument.
1839 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
1840
18412006-12-19 Paolo Bonzini <bonzini@gnu.org>
1842 and Joel E. Denny <jdenny@ces.clemson.edu>
1843
1844 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1845 that the argument is case-insensitive, and there's no `=' here.
1846 For the %skeleton entry, mention that %language is better.
1847 (Bison Options): Likewise for --language and --skeleton. Move the
1848 --skeleton entry so that the `Tuning the parser' section is sorted
1849 alphabetically on long options.
1850 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
1851 %language directive in detail here; cross-reference the %language
1852 documentation instead.
1853 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
1854 `%require "2.3b"' so that the example is always up-to-date.
1855 (Table of Symbols): Add entries for %language and %skeleton.
1856 * examples/extexi (normalize): Instead of replacing every %require
1857 argument with the current Bison version, just substitute for
1858 `@value{VERSION}'. This guarantees that we're testing what actually
1859 appears in the documentation.
1860 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
1861 rather than `@VERSION@'.
1862
18632006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1864
1865 * NEWS: Reword the %language news a bit, and put it earlier.
1866
1867 * src/getargs.c (skeleton_arg): Last arg is now location const *.
1868 Rewrite to simplify the logic.
1869 (language_argmatch): Likewise.
1870 (program_name): We now own this var.
1871 * src/getargs.h (struct bison_language): Use char[] rather than
1872 const char *.
1873
1874 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
1875 Java is supported.
1876 * src/complain.c (program_name): Remove decl; no longer needed.
1877 * src/main.c (program_name): Remove; now belongs to getargs.
1878
18792006-12-18 Paolo Bonzini <bonzini@gnu.org>
1880
1881 * NEWS: Document %language.
1882
1883 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
1884
1885 * data/c-skel.m4, data/c++-skel.m4: New files.
1886 * data/glr.c: Complain on push parsers.
1887
1888 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
1889 over %skeleton.
1890 (Decl Summary): Document %language and %skeleton.
1891 (Command line): Document -L.
1892
1893 * examples/extexi: Rewrite %require directive.
1894 * examples/calc++/Makefile.am: Pass VERSION to extexi.
1895
1896 * src/files.c (compute_exts_from_gc): Look in language structure
1897 for .y extension.
1898 (compute_file_name_parts): Check whether .tab should be added.
1899 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
1900 (language, skeleton_arg, language_argmatch): New.
1901 (long_options): Add --language.
1902 (getargs): Use skeleton_arg, add -L/--language.
1903 * src/getargs.h: Include location.h.
1904 (struct bison_language, language, skeleton_arg, language_argmatch): New.
1905 * src/output.c (prepare): Pick default skeleton from struct language.
1906 Don't dispatch C skeletons here.
1907 * src/parse-gram.y (PERCENT_LANGUAGE): New.
1908 (prologue_declaration): Add "%language" rule, use skeleton_arg.
1909 * src/scan-gram.l ("%language"): New rule.
1910
1911 * tests/calc.at: Test %skeleton and %language.
1912 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
1913 (AT_GLR_IF): Look for %skeleton "glr.cc".
1914 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
1915 (AT_YACC_IF): Reject %language.
1916
19172006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1918
1919 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
1920 since it wasn't used; only the typedef name 'semantic_type' is needed.
1921 Also, omit trailing white space.
1922
1923 * bootstrap: Sync from coreutils.
1924 (gnulib_extra_files): Add build-aux/announce.gen.
1925 (slurp): Adjust .gitignore files like .cvsignore files.
1926 * build-aux/announce-gen: Remove from CVS, since bootstrap
1927 now creates this.
1928
19292006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
1930
1931 Make %push-parser imply %pure-parser. This fixes several bugs; see
1932 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
1933 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
1934 pure_parser = true.
1935 * data/push.c: Don't bother testing b4_push_if when deciding whether
1936 to expand b4_declare_parser_variables globally.
1937 (yypush_parse): Likewise in here.
1938
1939 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
1940 (yy_reduce_print): Reformat M4 for readability.
1941
19422006-12-15 Bob Rossi <bob@brasko.net>
1943 and Joel Denny <jdenny@ces.clemson.edu>
1944
1945 * data/push.c (yypstate): Add typedef, and update all uses of
1946 struct yypstate to just yypstate.
1947 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
1948
19492006-12-14 Bob Rossi <bob@brasko.net>
1950
1951 * data/push.c (yypush_parse): Declare prototype regardless of
1952 %locations option.
1953
19542006-12-14 Bob Rossi <bob@brasko.net>
1955
1956 * data/push.c (yyparse): Remove the prototype and the #define when in
1957 push-parser mode.
1958
19592006-12-13 Bob Rossi <bob@brasko.net>
1960
1961 * data/push.c (yypstate_init): Rename to...
1962 (yypstate_new): ... this and use b4_c_function_def.
1963 (yypstate_delete): New.
1964 (yypush_parse): Change parameters yynval and yynlloc to be const.
1965 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
1966 yypstate_delete functions.
1967
19682006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
1969
1970 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
1971 strange test case titles. Reported by Bob Rossi.
1972
19732006-12-13 Paul Eggert <eggert@cs.ucla.edu>
1974
1975 * TODO: Add pointer to Sylvain Schmitz's work on static detection
1976 of potential ambiguities in GLR grammers.
1977
19782006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
1979
1980 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
1981 `bison ', use m4_index instead of m4_substr since chopping up a string
1982 containing M4-special characters causes problems here.
1983
1984 Fix a couple of bugs related to special characters in user-specified
1985 file names, and make it easier for skeletons to compute output file
1986 names with the same file name prefix as Bison-computed output file
1987 names.
1988 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
1989 b4_parser_file_name and b4_spec_defines_file instead of
1990 @output_parser_name@ and @output_header_name@, which are now redundant.
1991 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
1992 b4_parser_file_name, b4_spec_defines_file, and the new
1993 @basename(FILENAME@) instead of @output_parser_name@ and
1994 @output_header_name@, which inappropriately escaped the file names as
1995 C string literals.
1996 * src/files.c (all_but_ext): Remove static qualifier.
1997 (compute_output_file_names): Move `free (all_but_ext)' to...
1998 (output_file_names_free): ... here since all_but_ext is needed later.
1999 * src/files.h (all_but_ext): Extern.
2000 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
2001 exactly what MUSCLE_INSERT_STRING used to do.
2002 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
2003 characters are escaped properly.
2004 * src/output.c (prepare): Define muscle file_name_all_but_ext as
2005 all_but_ext.
2006 For pkgdatadir muscle, maintain previous functionality by using
2007 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
2008 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
2009 digraphs would never be expanded. Hopefully no one has M4-special
2010 characters in his Bison installation path.
2011 * src/scan-skel.l: Don't parse @output_header_name@ and
2012 @output_parser_name@ anymore since they're now redundant.
2013 In @output, use decode_at_digraphs.
2014 Parse a new @basename command that invokes last_component.
2015 (decode_at_digraphs): New.
2016 (BASE_QPUTS): Remove unused.
2017 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
2018 (Output file name): New tests.
2019
20202006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
2021
2022 Warn about output files that are generated by the skeletons and that
2023 conflict with other output files.
2024 * data/glr.c: Don't generate the header file here when glr.cc does.
2025 * src/files.c (file_names, file_names_count): New static globals.
2026 (compute_output_file_names): Invoke output_file_name_check for files
2027 not generated by the skeletons and remove existing checks.
2028 (output_file_name_check): New function that warns about conflicting
2029 output file names.
2030 (output_file_names_free): Free file_names.
2031 * src/files.h (output_file_name_check): Declare.
2032 * src/scan-skel.l: Invoke output_file_name_check for files generated by
2033 the skeletons.
2034 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
2035 (Conflicting output files): New tests.
2036
20372006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2038
2039 * doc/bison.texinfo: Fix a couple of typos.
2040
20412006-12-08 Bob Rossi <bob@brasko.net>
2042
2043 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
2044 Rename to...
2045 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
2046 update all uses.
2047 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
2048 (yypush_parse): Rename yypvars argument to yyps and remove redundant
2049 local pv.
2050 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
2051 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
2052
20532006-12-07 Bob Rossi <bob@brasko.net>
2054 and Joel Denny <jdenny@ces.clemson.edu>
2055
2056 * data/push.c (yypvarsinit): Change return type from void* to struct
2057 yypvars*. No longer cast to void* on return.
2058 (struct yypvars): Remove yylen since it need not be remembered between
2059 yypushparse invocations.
2060 (yypushparse): Don't copy between yylen and pv->yylen.
2061
20622006-12-05 Bob Rossi <bob@brasko.net>
2063
2064 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
2065 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
2066 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
2067 (struct yypvars): Remove b4_declare_parser_variables.
2068 (yypvarsinit): Remove init code for removed variables.
2069 (global scope): Do not declare b4_declare_parser_variables if
2070 push or pure mode.
2071 (yypushparse): Add b4_declare_parser_variables.
2072 Init new local variables, and remove init code for removed
2073 yypvars variables.
2074 (yyparse): Delete.
2075 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
2076 and yyparse for other modes.
2077 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
2078 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
2079 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
2080 (AT_PURE_LEX_IF): True if pure or push parser.
2081
20822006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
2083
2084 Document Yacc prologue alternatives and default %destructor's and
2085 %printer's as experimental. Don't mention Java yet. Discussed at
2086 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
2087 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
2088 (2.3a): Annotate this entry to say the old forms of these features were
2089 also experimental.
2090 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
2091 Table of Symbols): Say they're experimental. Comment out any mention
2092 of Java (we'll want this back eventually).
2093
20942006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2095
2096 Support a file name argument to %defines. Deprecate `=' in
2097 %file-prefix, %name-prefix, and %output. Discussed at
2098 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
2099 * NEWS (2.3a+): Mention.
2100 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
2101 form of %defines, and remove `=' from entries for %file-prefix,
2102 %name-prefix, and %output.
2103 * src/parse-gram.y (prologue_declaration): Implement.
2104 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
2105 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
2106 all but one occurrence of %name-prefix.
2107 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
2108 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
2109 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
2110 occurrence of each of %file-prefix and %output. Add check for %defines
2111 with argument.
2112 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
2113 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
2114 Remove the `=' from %output.
2115
21162006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
2117
2118 Don't escape $ in test case titles since Autoconf 2.61 now does that
2119 correctly.
2120 * tests/actions.at (Default %printer and %destructor are not for error
2121 or $undefined): Here.
2122 (Default %printer and %destructor are not for $accept): Here.
2123 * tests/input.at (Invalid $n and @n): Here.
2124
21252006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
2126
2127 Rename <!> to <>. Discussed starting at
2128 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
2129 * NEWS (2.3a+): Update.
2130 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
2131 Update.
2132 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
2133 * src/scan-gram.l (INITIAL): Implement.
2134 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
2135 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
2136 comment.
2137 * tests/actions.at (Default tagless %printer and %destructor,
2138 Default tagged and per-type %printer and %destructor,
2139 Default %printer and %destructor are not for error or $undefined,
2140 Default %printer and %destructor are not for $accept,
2141 Default %printer and %destructor for mid-rule values): Update.
2142 * tests/input.at (Default %printer and %destructor redeclared,
2143 Unused values with default %destructor): Update.
2144
21452006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2146
2147 Don't let %prec take a nonterminal.
2148 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
2149 token.
2150 * tests/input.at (%prec takes a token): New test checking that %prec
2151 won't take a nonterminal.
2152
21532006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2154
2155 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
2156 it was double-quoted.
2157 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
2158 grammar is maintained with Bison's highest standards.
2159 * src/getargs.c: Fix some typos in Doxygen comments.
2160
21612006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2162
2163 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
2164 later. Reported by Paul Eggert in
2165 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
2166 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
2167 * src/scan-code.l (translate_action): Don't bother invoking
2168 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
2169 (code_scanner_free): Instead of invoking
2170 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
2171 which frees more.
2172 * src/scan-gram.l (gram_scanner_free): Likewise.
2173 * src/scan-skel.l (scan_skel): Likewise.
2174
21752006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2176
2177 * src/files.c (tr): Change return type to void.
2178 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
2179 has been called previously for the same key.
2180 (muscle_find): Return storage instead of value so that
2181 --enable-gcc-warnings doesn't produce warnings that the return discards
2182 const. aver that the value and storage are the same since storage
2183 could potentially be NULL when value is not.
2184 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
2185 same as 0.
2186
21872006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2188
2189 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
2190 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
2191 us a slightly cleaner distribution, and also works.
2192 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
2193 gnulib changes.
2194
21952006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
2196 and Paul Eggert <eggert@cs.ucla.edu>
2197
2198 Don't let Bison leak memory except when it complains.
2199 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
2200 (spec_defines_file, dir_prefix): Now char *, not const char *,
2201 since they are freed.
2202 * src/files.c: Likewise.
2203 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
2204 Likewise.
2205 (tr): Now operates in-place. All uses changed.
2206 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
2207 values.
2208 (compute_file_name_parts, compute_output_file_names): Don't store
2209 read-only data in variables that will be freed.
2210 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
2211 src_extension, and header_extension.
2212 (output_file_names_free): New public function to free
2213 spec_verbose_file, spec_graph_file, spec_defines_file,
2214 parser_file_name, and dir_prefix.
2215 * src/getargs.c (getargs): Don't store read-only data in variables that
2216 will be freed.
2217 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
2218 (which previously existed but was unused), and quotearg_free.
2219 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
2220 * src/muscle_tab.c: Likewise.
2221 (muscle_entry): Make the value char const *,
2222 and add a new storage member that is char * and can be freed.
2223 (muscle_entry_free): New private function.
2224 (muscle_init): Use it instead of free.
2225 (muscle_insert, muscle_grow): Update and use new storage member.
2226 (muscle_code_grow): Free the string passed to muscle_grow
2227 since it's not needed anymore.
2228 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
2229 add a new `char *code' member.
2230 ("{...}"): Declare semantic type as code.
2231 * src/scan-code.h (translate_rule_action):
2232 (translate_symbol_action, translate_code, translate_action): Return
2233 `char const *' rather than `char *' since external code should not free
2234 these strings.
2235 * src/scan-code.l: Likewise.
2236 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
2237 which is "{...}" in the parser.
2238 * tests/Makefile.am (maintainer-check-valgrind): Set
2239 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
2240 Valgrind.
2241 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
2242 complain.
2243 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
2244 expecting a non-zero exit status sets --leak-check=summary and
2245 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
2246 this case, and we don't want to hear about it.
2247
22482006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2249
2250 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
2251 instead of from the template, to simplify configuration a bit.
2252 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
2253 and m4/wint_t.m4, as they are needed with the latest gnulib.
2254
22552006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2256
2257 Disable unset/unused mid-rule value warnings by default, and recognize
2258 --warnings=midrule-values to enable them. Discussed starting at
2259 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
2260 * NEWS (2.3a+): Mention.
2261 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
2262 warnings): Add entry for midrule-values subargument.
2263 * src/reader.c (symbol_should_be_used): Don't return true just because
2264 the value is a set/used mid-rule value unless
2265 --warnings=midrule-values was specified.
2266 * tests/input.at (Unused values, Unused values before symbol
2267 declarations): Run tests with and without --warnings=midrule-values.
2268
2269 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
2270 than LIST_FREE directly.
2271
22722006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2273
2274 Finish implementing --warnings=error, which should not be implied by
2275 --warnings=all (or by its synonyms -W and --warnings without
2276 subarguments).
2277 * src/complain.c (set_warning_issued): New function to report that
2278 warnings are being treated as errors and to record an error if so.
2279 Invoke...
2280 (warn_at, warn): ... here.
2281 * src/getargs.c (warnings_args, warnings_types): Reorder so that
2282 "error - warnings are errors" does not appear above "all - all of the
2283 above".
2284 (getargs): For -W and --warnings without subarguments, don't let
2285 FLAGS_ARGMATCH set warnings_error in warnings_flag.
2286 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
2287
22882006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2289
2290 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
2291 empty subargument list. For example: `bison --warnings= parser.y'.
2292
22932006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2294
2295 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
2296 the parser header file so that gcc doesn't warn.
2297
22982006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2299
2300 Split the default %destructor/%printer into two kinds: <*> and <!>.
2301 Discussed starting at
2302 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
2303 * NEWS (2.3a+): Mention.
2304 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
2305 previous change today related to mid-rules.
2306 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
2307 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
2308 (TYPE_TAG_ANY): Add as <*>.
2309 (TYPE_TAG_NONE): Add as <!>.
2310 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
2311 for <*> and <!>.
2312 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
2313 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
2314 * src/symlist.c (symbol_list_default_new): Split into tagged and
2315 tagless versions.
2316 (symbol_list_destructor_set, symbol_list_printer_set): Split
2317 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
2318 SYMLIST_DEFAULT_TAGLESS.
2319 * src/symlist.h: Update symbol_list_default*_new prototypes.
2320 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
2321 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
2322 * src/symtab.c (default_destructor, default_destructor_location,
2323 default_printer, default_printer_location): Split each into tagged and
2324 tagless versions.
2325 (symbol_destructor_get, symbol_destructor_location_get,
2326 symbol_printer_get, symbol_printer_location_get): Implement tagged
2327 default and tagless default cases.
2328 (default_destructor_set, default_printer_set): Split each into tagged
2329 and tagless versions.
2330 * src/symtab.h: Update prototypes.
2331 * tests/actions.at (Default %printer and %destructor): Rename to...
2332 (Default tagless %printer and %destructor): ... this, and extend.
2333 (Per-type %printer and %destructor): Rename to...
2334 (Default tagged and per-type %printer and %destructor): ... this, and
2335 extend.
2336 (Default %printer and %destructor for user-defined end token): Extend.
2337 (Default %printer and %destructor are not for error or $undefined):
2338 Update.
2339 (Default %printer and %destructor are not for $accept): Update.
2340 (Default %printer and %destructor for mid-rule values): Extend.
2341 * tests/input.at (Default %printer and %destructor redeclared): Extend.
2342 (Unused values with default %destructor): Extend.
2343
23442006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2345
2346 Don't apply the default %destructor/%printer to an unreferenced midrule
2347 value. Mentioned at
2348 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
2349 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
2350 like $@n instead of just @n so that the default %destructor/%printer
2351 logic doesn't see them as user-defined symbols.
2352 (symbol_is_dummy): Check for both forms of the name.
2353 * src/reader.c (packgram): Remove the `$' from each midrule symbol
2354 name for which the midrule value is referenced in any action.
2355 * tests/actions.at (Default %printer and %destructor for mid-rule
2356 values): New test.
2357 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
2358 for change to dummy symbol names.
2359
23602006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2361
2362 Warn about unset midrule $$ if the corresponding $n is used.
2363 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
2364 $n usage.
2365 (packgram): Before invoking grammar_rule_check on any rule, make sure
2366 all actions have already been scanned in order to set `used' flags.
2367 Otherwise, checking that a midrule's $$ is set will not always work
2368 properly because the midrule check must forward-reference the midrule's
2369 parent rule.
2370 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
2371 warning.
2372
23732006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2374
2375 More improvements to the documentation of the prologue alternatives:
2376 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
2377 Bison manual.
2378 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
2379 some text to clarify the relative importance of the new directives and
2380 to show how these directives may be viewed as code labels.
2381
23822006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
2383
2384 Similar to the recently removed %before-header, add %code-top as the
2385 alternative to the pre-prologue. Mentioned at
2386 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
2387 Also, let the prologue alternatives appear in the grammar section.
2388 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
2389 (prologue_declaration): Move the existing prologue alternatives to...
2390 (grammar_declaration): ... here and add %code-top.
2391 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
2392
2393 Clean up and extend documentation for the prologue alternatives.
2394 * NEWS (2.3a+): Describe prologue alternatives.
2395 * doc/bison.texinfo (Prologue): Move discussion of prologue
2396 alternatives to...
2397 (Prologue Alternatives): ... this new section, and extend it to discuss
2398 all 4 directives in detail.
2399 (Table of Symbols): Clean up discussion of prologue alternatives and
2400 add %code-top.
2401
24022006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2403
2404 DJGPP specific issues.
2405
2406 * djgpp/config.bat: config.hin has been moved to lib. Adjust
2407 config.bat accordingly.
2408 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
2409 * djgpp/config.site: Likewise.
2410
24112006-10-16 Paolo Bonzini <bonzini@gnu.org>
2412
2413 Replace %*-header with %provides, %requires, %code. See discussion at
2414 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
2415
2416 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
2417 (b4_user_start_header): Remove.
2418 * data/glr.c: Use new macros instead of b4_*start_header
2419 and b4_*end_header.
2420 * data/glr.cc: Likewise.
2421 * data/lalr1.cc: Likewise.
2422 * data/push.c: Likewise.
2423 * data/yacc.c: Likewise.
2424
2425 * doc/bison.texinfo: Remove %before-header, rename
2426 %{start,end,after}-header to %requires, %provides, %code.
2427
2428 * src/parse-gram.y: Likewise (also rename token names accordingly).
2429 * src/scan-gram.l: Likewise.
2430 * tests/actions.at: Likewise.
2431
24322006-10-14 Paul Eggert <eggert@cs.ucla.edu>
2433
2434 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
2435 Problem reported by Joel E. Denny.
2436
24372006-10-14 Jim Meyering <jim@meyering.net>
2438
2439 (Sync from coreutils.)
2440 Work also when the working directory (with e.g. coreutils sources)
2441 is version controlled with git, rather than CVS.
2442 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
2443 rather than CVS.
2444 In messages and comments, say e.g., "checked-out sources",
2445 rather than "CVS sources".
2446 (version_controlled_file): New function. Work for git as well as
2447 for CVS. Don't use grep's -q option.
2448 (slurp): Call it here, in place of CVS-specific code.
2449
24502006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
2451
2452 Fix testsuite for ./configure --enable-gcc-warnings:
2453 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
2454 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
2455 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
2456 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
2457 * test/regression.at (Diagnostic that expects two alternatives):
2458 Likewise.
2459
24602006-10-12 Paul Eggert <eggert@cs.ucla.edu>
2461
2462 * bootstrap.conf (gnulib_modules): Add config-h.
2463 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
2464 worry about HAVE_CONFIG_H.
2465 * lib/abitset.c: Likewise.
2466 * lib/bitset.c: Likewise.
2467 * lib/bitset_stats.c: Likewise.
2468 * lib/bitsetv-print.c: Likewise.
2469 * lib/bitsetv.c: Likewise.
2470 * lib/ebitset.c: Likewise.
2471 * lib/get-errno.c: Likewise.
2472 * lib/lbitset.c: Likewise.
2473 * lib/subpipe.c: Likewise.
2474 * lib/timevar.c: Likewise.
2475 * lib/vbitset.c: Likewise.
2476 * lib/bitset.c: Include "bitset.h" first, to test interface.
2477 * lib/bitset_stats.c: Include "bitset_stats.h" first.
2478 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
2479 * lib/bitsetv.c: Include "bitsetv.h" first.
2480 * lib/get-errno.c: Include "get-errno.h" first.
2481 * m4/.cvsignore: Add config-h.m4.
2482 * tests/actions.at (Default %printer and %destructor for ...):
2483 Adjust expected line numbers in output to reflect removal of #if
2484 HAVE_CONFIG_H lines.
2485 * tests/glr-regression.at (Missed %merge type warnings when ...):
2486 Likewise.
2487 * tests/regression.at (Braced code in declaration in rules section):
2488 Likewise.
2489 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
2490 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
2491 Include <config.h> unconditionally.
2492
2493 * bootstrap: Sync from coreutils, as follows:
2494
2495 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2496
2497 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
2498 variable was sometimes used without being initialized. This
2499 messed up the installation of the INSTALL file in some cases.
2500
2501 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2502
2503 * bootstrap (usage, main program, symlink_to_gnulib): Add option
2504 --copy. Inspired by a suggestion from Bruno Haible.
2505
2506 2006-10-03 Jim Meyering <jim@meyering.net>
2507
2508 * bootstrap: Undo last change to this file, since now gnulib-tool
2509 sticks with the automake default in generating dependencies.
2510
25112006-10-12 Paul Eggert <eggert@cs.ucla.edu>
2512
2513 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
2514 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
2515
2516 * doc/bison.1: Add copyright notice.
2517
2518 * data/glr.c: Don't include <stdarg.h>; not used.
2519
2520 * NEWS: The -g and --graph options now output graphs in Graphviz
2521 DOT format, not VCG format.
2522 * doc/bison.1: Likewise.
2523 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
2524 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
2525 of this change in
2526 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
2527 * TODO: Remove Graphviz entry.
2528 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
2529 remove vcg.c, vcg.h, vcg_defaults.h.
2530 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
2531 * src/graphviz.c, src/graphviz.h: New files.
2532 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
2533 * src/files.h: Make comment more generic.
2534 * src/main.c (main): Likewise.
2535 * src/print_graph.h: Likewise.
2536 * src/getargs.c (usage): Make usage description more generic.
2537 * src/print_graph.c: Include graphviz.h rather than vcg.h.
2538 (static_graph, fgraph): Remove. All uses changed to pass
2539 arguments instead of sharing a static var.
2540 (print_core, print_actions, print_state, print_graph):
2541 Output graphviz format rather than VCG format.
2542 * tests/.cvsignore: Remove *.vcg; add *.dot.
2543 * tests/output.at: Expect *.dot files, not *.vcg files.
2544
2545 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
2546 accommodates the 2006-10-08 change.
2547
25482006-10-11 Bob Rossi <bob@brasko.net>
2549
2550 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
2551 (b4_yyssa, b4_yyerror_range): New macros.
2552 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
2553 (yypvarsinit): Remove init of removed fields.
2554 (yypushparse): Remove use of removed fields; use new macros instead.
2555
25562006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2557
2558 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
2559 in a push parser. Reindent slightly to match yacc.c better.
2560
25612006-10-11 Bob Rossi <bob@brasko.net>
2562
2563 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
2564 yymsg_alloc fields.
2565 (yypvarsinit, yypushparse): Remove init of removed fields.
2566 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
2567
25682006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2569
2570 * THANKS: Add Paolo Bonzini and Bob Rossi.
2571
25722006-10-08 Paolo Bonzini <bonzini@gnu.org>
2573
2574 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
2575 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
2576 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
2577 b4_define_user_cde and uses): Remove.
2578 (b4_comment, b4_prefix, b4_sync_start): New.
2579 * data/bison.m4: New file, with most of the content removed from c.m4.
2580 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
2581 * src/output.c (output_skeleton): Pass bison.m4.
2582 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
2583 only if specified.
2584
25852006-10-05 Paul Eggert <eggert@cs.ucla.edu>
2586
2587 Fix test failure reported by Tom Lane in
2588 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
2589 and try to make such failures easier to catch in the future.
2590 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
2591 that's now the caller's responsibility.
2592 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
2593 Set yychar = YYEOF if it's negative.
2594 * tests/actions.at (yylex): Abort if asked to read past EOF.
2595 * tests/conflicts.at (yylex): Likewise.
2596 * tests/cxx-type.at (yylex): Likewise.
2597 * tests/glr-regression.at (yylex): Likewise.
2598 * tests/input.at (yylex): Likewise.
2599 * tests/regression.at (yylex): Likewise.
2600 * tests/torture.at (yylex): Likewise.
2601
26022006-10-01 Paul Eggert <eggert@cs.ucla.edu>
2603
2604 Fix problems with translating English-language diagnostics.
2605 * bootstrap: Fix bug introduced in recent bootstrap changes, with
2606 respect to bison-runtime pot generation. The YY_ stuff
2607 wasn't being captured.
2608 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
2609 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
2610 * runtime-po/POTFILES.in: Add data/push.c.
2611
26122006-09-29 Paul Eggert <eggert@cs.ucla.edu>
2613
2614 Merge bootstrap changes from coreutils.
2615
2616 2006-09-28 Jim Meyering <jim@meyering.net>
2617
2618 Automatically generated dependencies are important even
2619 when all of the sources in a directory come from gnulib.
2620 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
2621 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
2622
2623 2006-09-23 Jim Meyering <jim@meyering.net>
2624
2625 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
2626
2627 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2628
2629 * bootstrap: Add support for --force.
2630 (usage): New function. Describe usage less tersely.
2631 (CVS_only_file): New var.
2632
26332006-09-21 Paul Eggert <eggert@cs.ucla.edu>
2634
2635 * data/push.c (YYPUSH_MORE): Make it an enum instead.
2636 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
2637 Adjust white space and comments to match GNU style better.
2638
26392006-09-20 Bob Rossi <bob@brasko.net>
2640
2641 * data/push.c (yyresult_get): Remove function.
2642 (YYPUSH_MORE): Add #define.
2643 (yypushparse): Modify return value.
2644
26452006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2646
2647 * stamp-h.in: Remove; no longer needed.
2648 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
2649 Remove config.h, config.hin, intl (no longer created).
2650 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
2651 stamp-h1.
2652
2653 Sync bootstrap from coreutils, as follows:
2654
2655 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
2656
2657 * bootstrap (symlink_to_gnulib): New function.
2658 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
2659 to copies-of-gnulib.
2660 (cp_mark_as_generated, slurp, gnulib_files):
2661 Avoid making a copy if it's the same as the old version.
2662 (gnulib_files): Add support for this variable (used by Bison).
2663
26642006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2665
2666 * src/getargs.c (usage): Rework to use conventions similar to
2667 coreutils, to make translation a bit easier and the code a bit
2668 smaller. Problem reported by Tim Van Holder.
2669
26702006-09-15 Paul Eggert <eggert@cs.ucla.edu>
2671
2672 Use some of gnulib's new modules, taken from coreutils.
2673
2674 * bootstrap: Sync from coreutils, except add support for gnulib_files.
2675 * bootstrap.conf: New file.
2676 (gnulib_modules): Add configmake, inttypes, unistd.
2677 (XGETTEXT_OPTIONS): Add complain, complain_at,
2678 fatal, fatal_at, warn, warn_at, unexpected_end.
2679 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
2680 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
2681 (gl_EARLY): Add.
2682 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
2683 (gl_INIT): Add
2684 (GNULIB_AUTOCONF_SNIPPET): Remove.
2685 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
2686 the pickiest.
2687 * lib/.cvsignore: Add inttypes_.h.
2688 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
2689 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
2690 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
2691 no-longer-necessary initializations.
2692 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
2693 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
2694 use the unistd module.
2695 * src/system.h: Likewise.
2696 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
2697 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
2698 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
2699 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
2700 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
2701 * src/system.h: Include inttypes.h unconditionally, now that we
2702 use the inttypes module. Don't bother to include stdint.h, since
2703 inttypes.h now does that for us.
2704 (LOCALEDIR): Remove, now that we use the configmake module.
2705 * src/getargs.c: Include configmake.h.
2706 * src/main.c: Likewise.
2707 * src/output.c: Likewise.
2708 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
2709 not from $abs_top_builddir, since config.h moved.
2710
2711
2712 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
2713 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
2714
2715 * src/parse-gram.y (symbol_declaration): Don't put statements
2716 before declarations; it's not portable to C89.
2717 * src/scan-code.l (handle_action_at): Likewise.
2718
2719 * src/scan-code.l: Always initialize braces_level; the old code
2720 left it uninitialized and therefore had undefined behavior.
2721
2722 Don't attempt to redefine 'assert', since it runs afoul of
2723 systems where standard headers (mistakenly) include <assert.h>.
2724 Instead, define and use our own alternative, called 'aver'.
2725 * src/reader.c: Don't include assert.h, since we no longer
2726 use assert.
2727 * src/scan-code.l: Likewise.
2728 * src/system.h (assert): Remove, replacing with....
2729 (aver): New function, taking a bool arg. All uses changed.
2730 * src/tables.c (pack_vector): Ensure that aver arg is bool,
2731 not merely an integer.
2732
27332006-09-15 Bob Rossi <bob@brasko.net>
2734
2735 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
2736 * data/c.m4 (YYPUSH): New.
2737 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
2738 * src/getargs.c (push_parser): New var.
2739 * src/getargs.h (push_parser): New declaration.
2740 * src/output.c (prepare): Add macro insertion of `push_flag'.
2741 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
2742 (prologue_declaration): Parse %push-parser.
2743 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
2744 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
2745 list of removed lines from the traces observed.
2746 (AT_CHECK_CALC_LALR): Added push parser tests.
2747
27482006-09-13 Paul Eggert <eggert@cs.ucla.edu>
2749
2750 * NEWS: Version 2.3a.
2751 * configure.ac (AC_INIT): Likewise.
2752
2753 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
2754 "#define YYSTYPE int" that caused "make maintainer-check" to fail
2755 due to header ordering dependencies. I don't know why the #define
2756 was there.
2757
2758 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
2759 runtime cost when YYDEBUG is not defined, and so that some tests
2760 that used to fail now work. Problem and initial suggestion by
2761 Paolo Bonzini.
2762 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
2763 * data/glr.cc (b4_parser_class_name):
2764 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
2765 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
2766 (yydebug_) [YYDEBUG]: New member.
2767 (yycdebug_): Now defined only if YYDEBUG.
2768 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
2769 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
2770 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
2771 if YYYDEBUG.
2772 (debug_stream, set_debug_stream, debug_level, set_debug_level):
2773 Define only if YYDEBUG.
2774 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
2775 set_debug_level.
2776 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
2777 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
2778 AT_CHECK_CALC_GLR_CC that are working now.
2779
27802006-09-12 Paul Eggert <eggert@cs.ucla.edu>
2781
2782 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
2783 We don't need them in glr.cc, and glr.c defines them.
2784 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
2785 assumes that defining it to anything is the same as defining
2786 it to 1. Problem reported by Paolo Bonzini.
2787
27882006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
2789
2790 * data/c.m4 (b4_null, b4_case): Define.
2791 * src/output.c (prepare_symbols): Use b4_null.
2792 (user_actions_output): Use b4_case.
2793
27942006-09-11 Paul Eggert <eggert@cs.ucla.edu>
2795
2796 * data/glr.c (b4_shared_declarations): Put start-header first,
2797 before any #includes that we generate, so that feature-test
2798 macros work. Problem reported by Michael Deutschmann in
2799 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
2800 * data/lalr1.cc: Likewise.
2801 * doc/bison.texinfo (Prologue): Document that feature-test macros
2802 should be defined before any Bison declarations.
2803 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
2804 that depend on location.hh after, not before, Bison decls, since
2805 we now include location.hh after the first user prologue.
2806
2807 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
2808 Sander Brandenburg in
2809 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
2810 Also, fix minor white space and comment issues.
2811 (Prologue): Mention that it's better to define feature-test macros
2812 before Bison declarations. Problem reported by Michael Deutschmann.
2813
2814 * README-cvs: Fix typo: "&" should be "&&". Problem reported
2815 by Jim Meyering.
2816 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
2817 This adjusts to recent gnulib changes.
2818
28192006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
2820
2821 Finish implementation of per-type %destructor/%printer. Discussed
2822 starting at
2823 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
2824 and
2825 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
2826 * NEWS (2.3+): Add a description of this feature to the default
2827 %destructor/%printer description.
2828 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
2829 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2830 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
2831 list node contains a semantic type.
2832 * src/symtab.c, src/symtab.h: Extend with a table that associates
2833 semantic types with their %destructor's and %printer's.
2834 (semantic_type_from_uniqstr, semantic_type_get,
2835 semantic_type_destructor_set, semantic_type_printer_set): New functions
2836 composing the public interface of that table.
2837 (symbol_destructor_get, symbol_destructor_location_get,
2838 symbol_printer_get, symbol_printer_location_get): If there's no
2839 per-symbol %destructor/%printer, look up the per-type before trying
2840 the default.
2841 * tests/actions.at (Per-type %printer and %destructor): New test case.
2842 * tests/input.at (Default %printer and %destructor redeclared):
2843 Extend to check that multiple occurrences of %symbol-default in a
2844 single %destructor/%printer declaration is an error.
2845 (Per-type %printer and %destructor redeclared, Unused values with
2846 per-type %destructor): New test cases.
2847
28482006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
2849
2850 Require default %destructor/%printer to be declared using
2851 %symbol-default instead of an empty symbol list, and start working on
2852 new per-type %destructor/%printer. Discussed at
2853 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
2854 * NEWS (2.3+): Add %symbol-default to example.
2855 * bison.texinfo (Freeing Discarded Symbols): Likewise.
2856 (Table of Symbols): Add entry for %symbol-default.
2857 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
2858 (generic_symlist, generic_symlist_item): New nonterminals for creating
2859 a list in which each item is a symbol, semantic type, or
2860 %symbol-default.
2861 (grammar_declaration): Use generic_symlist in %destructor and %printer
2862 declarations instead of symbols.1 or an empty list.
2863 (symbol_declaration, precedence_declaration, symbols.1): Update actions
2864 for changes to symbol_list.
2865 * src/reader.c: Update for changes to symbol_list.
2866 * src/scan-code.l: Likewise.
2867 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
2868 * src/symlist.c, src/symlist.h: Extend such that a list node may
2869 represent a semantic type or a %symbol-default in addition to just an
2870 ordinary symbol. Add switched functions for setting %destructor's and
2871 %printer's.
2872 * tests/actions.at, tests/input.at: Add %symbol-default to all default
2873 %destructor/%printer declarations.
2874
28752006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
2876
2877 Whether the default %destructor/%printer applies to a particular symbol
2878 isn't a question of whether the user *declares* that symbol (in %token,
2879 for example). It's a question of whether the user by any means
2880 *defines* the symbol at all (by simply using a char token, for
2881 example). $end is defined by Bison whereas any other token with token
2882 number 0 is defined by the user. The error token is always defined by
2883 Bison regardless of whether the user declares it with %token, but we
2884 may one day let the user define error as a nonterminal instead.
2885 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
2886 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
2887 the meaning of "user-defined".
2888 * tests/actions.at (Default %printer and %destructor for user-declared
2889 end token): Rename to...
2890 (Default %printer and %destructor for user-defined end token): ...
2891 this.
2892
2893 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
2894 computation of whether to apply the default, don't maintain a list of
2895 every Bison-defined symbol. Instead, just check for a first character
2896 of '$', which a user symbol cannot have, and check for the error token.
2897
28982006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
2899
2900 Don't apply the default %destructor or %printer to the error token,
2901 $undefined, or $accept. This change fits the general rule that the
2902 default %destructor and %printer are only for user-declared symbols,
2903 and it solves several difficulties that are described in the new test
2904 cases listed below.
2905 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
2906 * tests/actions.at (Default %printer and %destructor are not for error
2907 or $undefined, Default %printer and %destructor are not for $accept):
2908 New test cases.
2909
29102006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
2911
2912 Allow %start after the first rule.
2913 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
2914 when parsing the first rule.
2915 (check_and_convert_grammar): Search for it here after all grammar
2916 declarations have been parsed. Skip midrules, which have dummy LHS
2917 nonterminals.
2918 * src/symtab.c (symbol_is_dummy): New function.
2919 * src/symtab.h (symbol_is_dummy): Declare it.
2920 * tests/input.at (%start after first rule): New test.
2921
29222006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2923
2924 Redo some of the previous commit: add back the ability to use
2925 non-aliased/undeclared string literals since it might be useful to
2926 those declaring %token-table.
2927 * src/reader.c (check_and_convert_grammar): Undo changes in previous
2928 commit: don't worry about complaints from symbols_pack.
2929 * src/symtab.c (symbol_new, symbol_class_set,
2930 symbol_check_alias_consistency): Undo changes in previous commit: count
2931 each string literal as a new symbol and token, assign it a symbol
2932 number, and don't complain about non-aliased string literals.
2933 (symbols_pack): Since symbol_make_alias still does not decrement symbol
2934 and token counts but does still set aliased tokens to the same number,
2935 symbol_pack_processor now leaves empty slots in the symbols array.
2936 Remove those slots.
2937 * tests/regression.at (Undeclared string literal): Remove test case
2938 added in previous commit since non-aliased string literals are allowed
2939 again.
2940 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
2941 remove unnecessary string literal declarations.
2942 * tests/sets.at (Firsts): Likewise.
2943
29442006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2945
2946 Don't allow an undeclared string literal, but allow a string literal to
2947 be used before its declaration.
2948 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
2949 symbols_pack complained.
2950 * src/symtab.c (symbol_new): Don't count a string literal as a new
2951 symbol.
2952 (symbol_class_set): Don't count a string literal as a new token, and
2953 don't assign it a symbol number since symbol_make_alias does that.
2954 (symbol_make_alias): It's not necessary to decrement the symbol and
2955 token counts anymore. Don't assume that an alias declaration occurs
2956 before any uses of the identifier or string, and thus don't assert that
2957 one of them has the highest symbol number so far.
2958 (symbol_check_alias_consistency): Complain if there's a string literal
2959 that wasn't declared as an alias.
2960 (symbols_pack): Bail if symbol_check_alias_consistency failed since
2961 symbol_pack asserts that every token has been assigned a symbol number
2962 although undeclared string literals have not.
2963 * tests/regression.at (String alias declared after use, Undeclared
2964 string literal): New test cases.
2965 (Characters Escapes, Web2c Actions): Declare string literals as
2966 aliases.
2967 * tests/sets.at (Firsts): Likewise.
2968
29692006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
2970
2971 In the grammar scanner, STRING_FINISH unclosed constructs and return
2972 them to the parser in order to improve error messages.
2973 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
2974 SC_BRACED_CODE, SC_PROLOGUE): Implement.
2975 * tests/input.at (Unclosed constructs): New test case.
2976 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
2977 seen.
2978
2979 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
2980 unused global.
2981
29822006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
2983
2984 Handle string aliases for character tokens correctly.
2985 * src/symtab.c (symbol_user_token_number_set): If the token has an
2986 alias, check and set its alias's user token number instead of its own,
2987 which is set to indicate the alias. Previously, every occurrence of
2988 the character token in the grammar overwrote that alias indicator with
2989 the character code.
2990 * tests/input.at (String aliases for character tokens): New test.
2991
29922006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
2993
2994 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
2995
29962006-08-11 Paul Eggert <eggert@cs.ucla.edu>
2997
2998 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
2999 to prevent failures when building on older platforms.
3000 Check for autopoint failure.
3001 Set XGETTEXT_OPTIONS to values that check for C format strings,
3002 so that translators are warned about them (this also helps
3003 prevent core dumps).
3004
3005 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
3006 function, since it simplifies our code a bit.
3007
3008 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
3009 rather than -W, so we don't get bogus warnings about sign comparisons.
3010 Add -Wpointer-arith, since that warning is useful (it reports code
3011 that does not conform to C89 and that some compilers reject).
3012 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
3013 since it's no longer needed.
3014
30152006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
3016
3017 Clean up scanners a bit.
3018 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
3019 definitions so gcc won't warn when obstack_for_string is unused.
3020 * src/scan-code.l: config.h and system.h are already #include'd by
3021 scan-code-c.c, so get rid of them here.
3022 * src/scan-gram.l: Likewise.
3023 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
3024 definitions rather than duplicating the rest of it.
3025 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
3026
30272006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
3028
3029 Suppress signed/unsigned comparison warnings for yycheck.
3030 * data/c.m4 (b4_safest_int_type): New macro.
3031 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
3032 a signed int type, cast it to b4_safest_int_type first.
3033 * data/yacc.c: Likewise.
3034 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
3035 also overwritten.
3036
30372006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3038
3039 * doc/bison.texinfo: Fix some typos.
3040
30412006-08-02 Paul Eggert <eggert@cs.ucla.edu>
3042
3043 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
3044 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
3045
3046 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
3047 the latest gnulib does this a different way.
3048 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
3049 translation was patched, so stop omitting it.
3050
30512006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3052
3053 Enable declaration of default %printer/%destructor. Make the parser
3054 use these for all user-declared grammar symbols for which the user does
3055 not declare a specific %printer/%destructor. Thus, the parser uses it
3056 for token 0 if the user declares it but not if Bison generates it as
3057 $end. Discussed starting at
3058 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
3059 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
3060 and
3061 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
3062 * NEWS (2.3+): Mention.
3063 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
3064 declare a %destructor for a mid-rule's semantic value. It's just
3065 impossible to declare one specific to it.
3066 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
3067 code. Describe default %destructor form.
3068 * src/parse-gram.y (grammar_declaration): Parse default
3069 %printer/%destructor declarations.
3070 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
3071 and symbol_destructor_location_get rather than accessing the destructor
3072 and destructor_location members of struct symbol.
3073 (symbol_printers_output): Likewise but for %printer's.
3074 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
3075 again.
3076 * src/symtab.c (default_destructor, default_destructor_location,
3077 default_printer, default_printer_location): New static global
3078 variables to record the default %destructor and %printer.
3079 (symbol_destructor_get, symbol_destructor_location_get,
3080 symbol_printer_get, symbol_printer_location_get): New functions to
3081 compute the appropriate %destructor and %printer for a symbol.
3082 (default_destructor_set, default_printer_set): New functions to set the
3083 default %destructor and %printer.
3084 * src/symtab.h: Prototype all those new functions.
3085 * tests/actions.at (Default %printer and %destructor): New test to
3086 check that the right %printer and %destructor are called, that they're
3087 not called for $end, and that $$ and @$ work correctly.
3088 (Default %printer and %destructor for user-declared end token): New
3089 test to check that the default %printer and %destructor are called for
3090 a user-declared end token.
3091 * tests/input.at (Default %printer and %destructor redeclared, Unused
3092 values with default %destructor): New tests to check related grammar
3093 warnings and errors.
3094
30952006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3096
3097 Clean up handling of %destructor for the end token (token 0).
3098 Discussed starting at
3099 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
3100 and
3101 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
3102
3103 Make the skeletons consistent in how they pop the end token and invoke
3104 its %destructor.
3105 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
3106 state, which has token number 0, since this would invoke the
3107 %destructor for the end token.
3108 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
3109 until after shifting the end token, or else it won't be popped.
3110 * data/yacc.c (yyparse): Likewise.
3111
3112 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
3113 it's the end token. Upon termination, destroy an unshifted lookahead
3114 even when it's the end token.
3115 * data/lalr1.cc (yy::parser::parse): Likewise.
3116 * data/yacc.c (yyparse): Likewise.
3117
3118 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
3119 value warnings for the end token when the user gives the end token a
3120 %destructor.
3121
3122 * tests/actions.at (Printers and Destructors): Test all the above.
3123
31242006-07-24 Paul Eggert <eggert@cs.ucla.edu>
3125
3126 Update to latest gnulib and gettext versions.
3127 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
3128 Add fopen-safer.
3129 (gnulib_files): Add m4/warning.m4. Don't worry about files
3130 overwritten by autopoint.
3131 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
3132 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
3133 rejects them.
3134 Don't use autoreconf; instead, invoke autopoint etc. by hand,
3135 so that we can remove the intl files at a better time.
3136 (intl_files_to_remove): Remove aclocal.m4, since it gets
3137 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
3138 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
3139 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
3140 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
3141 Remove datarootdir hack; no longer needed.
3142 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
3143 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
3144 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
3145 strdup.h.
3146 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
3147 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
3148
31492006-07-20 Paul Eggert <eggert@cs.ucla.edu>
3150
3151 * bootstrap: Adjust to today's change to gnulib-tool by invoking
3152 it with --assume-autoconf='latest-stable'.
3153
31542006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
3155
3156 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
3157 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
3158 YYSTYPE' and `{'.
3159 * src/muscle_tab.h (muscle_grow): Replace the header comments with
3160 those from muscle_tab.c since the old ones are misleading.
3161
31622006-07-13 Akim Demaille <akim@epita.fr>
3163
3164 Support %define "KEY" {VALUE}.
3165 * src/scan-code.h, src/scan-code.l (translate_action)
3166 (translate_rule_action, translate_symbol_action, translate_code):
3167 Return char *, not const char *.
3168 * src/parse-gram.y (declaration): Rename as...
3169 (prologue_declaration): this.
3170 (string_content): Remove this nonterminal, use STRING.
3171 (braceless, content, content.opt): New nonterminal.
3172 Use them.
3173 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
3174 as value.
3175 * src/scan-gram.l (getargs.h): Don't include it.
3176
31772006-07-12 Paul Eggert <eggert@cs.ucla.edu>
3178
3179 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
3180 rather than a for-loop that declares a local bool variable. This
3181 should work around a compatibility problem with a Cray x1e C++
3182 compiler reported by Hung Nguyen in
3183 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
3184 The for-loop was introduced in the 2004-11-17 change but I don't
3185 know why it was needed.
3186
31872006-07-12 Akim Demaille <akim@epita.fr>
3188
3189 * data/c.m4: Comment changes.
3190
31912006-07-10 Akim Demaille <akim@lrde.epita.fr>
3192
3193 * src/complain.c (error_message, ERROR_MESSAGE): New.
3194 To factor...
3195 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
3196 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
3197
31982006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3199
3200 * NEWS: Instead of %union, you can define and use your own union type
3201 YYSTYPE if your grammar contains at least one <type> tag.
3202 Your YYSTYPE need not be a macro; it can be a typedef.
3203 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
3204 (Union Decl, Decl Summary): Document this.
3205 * data/glr.c (YYSTYPE): Implement this.
3206 * data/glr.cc (YYSTYPE): Likewise.
3207 * data/lalr1.cc (YYSTYPE): Likewise.
3208 * data/yacc.c (YYSTYPE): Likewise.
3209 * src/output.c (prepare): Output tag_seen_flag.
3210 * src/parse-gram.y (declaration, grammar_declaration):
3211 Use 'union_seen' rather than 'typed' to determine whether
3212 %union has been seen, since grammars can now be typed without
3213 %union.
3214 (symbol_declaration, type.opt, symbol_def):
3215 Keep track of whether a tag has been seen.
3216 * src/reader.c (union_seen, tag_seen): New vars.
3217 (typed): remove.
3218 * src/reader.h (union_seen, tag_seen, typed): Likewise.
3219 * src/scan-code.l (untyped_var_seen): New variable.
3220 (handle_action_dollar): Adjust to above changes.
3221 (handle_action_dollar, handle_action_at):
3222 Improve overflow checking for outlandish numbers.
3223 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
3224 avoid new diagnostics generated by above changes.
3225 * tests/regression.at (YYSTYPE typedef): Add test to check
3226 for type tags without %union.
3227
3228 * src/symlist.c (symbol_list_length): Return int, not unsigned
3229 int, since callers expect int. This may need to get revisited
3230 once we have proper integer overflow checking.
3231
3232 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
3233 object is now static.
3234
3235 * src/getargs.c (flags_argmatch): Return void, not int,
3236 to pacify ./configure --enable-gcc-warnings.
3237
3238 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
3239 since last_string is already defined to FLEX_PREFIX (last_string).
3240
32412006-07-09 Akim Demaille <akim@lrde.epita.fr>
3242
3243 Implement --warnings/-W.
3244 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
3245 replaced by...
3246 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
3247 Adjust callers.
3248 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
3249 (warnings_args, warnings_types): New.
3250 (getargs, short_options, long_options): Accept -W/--warnings.
3251 Sort the options by alphabetical order, upper case letter right
3252 before its lower case.
3253
32542006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3255
3256 Change %merge result type clash warnings to errors. Discussed at
3257 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
3258 * src/reader.c (record_merge_function_type): Use complain_at.
3259 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3260 declared later): Update test case results.
3261
32622006-07-09 Akim Demaille <akim@lrde.epita.fr>
3263
3264 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
3265 to be in alphabetical order.
3266 (trace_args): Spelling fixes.
3267
32682006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3269
3270 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
3271 so they don't collide with user-defined macros.
3272 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
3273 this was never guaranteed, and now that we're using gnulib stdint,
3274 which defines int_fast16_t to long int, the problem is exposed.
3275
32762006-07-08 Paul Eggert <eggert@cs.ucla.edu>
3277
3278 * data/c.m4 (b4_basename): Simplify a bit, since we don't
3279 need the full POSIX semantics (and weren't implementing them
3280 anyway).
3281
3282 Adjust to Autoconf 2.60 and today's gnulib.
3283 * bootstrap (gnulib_modules): Add stdint.
3284 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
3285 no longer copies it.
3286 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
3287 since stdint needs the former and wcwidth (which is now required
3288 by mbswidth) needs the latter.
3289 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
3290 work around a compatibility glitch between gettext 0.14.6 and
3291 Autoconf 2.60.
3292 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
3293 Do not check for uintptr_t, since new stdint module does the right
3294 thing.
3295 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
3296 Add stdint.h, stdint_.h, wcwidth.h.
3297 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
3298 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
3299 stdint.m4, wchar_t.m4, wcwidth.m4.
3300 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
3301 usual order for ../lib/*.h files.
3302 (file_name_split): Use last_component, not base_name, to adjust
3303 to gnulib changes.
3304 * src/parse-gram.h: Include <strverscmp.h> in the usual order
3305 for ../lib/*.h files.
3306 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
3307 Define unconditionally, since we now assume the stdint module.
3308 * src/scan-skel.l: Include <dirname.h>.
3309 (BASE_QPUTS): Use last_component, not base_name.
3310 * src/system.h: Include <unlocked-io.h> in the usual order
3311 for ../lib/*.h files. Include <stdint.h> unconditionally,
3312 since we now use the stdint module.
3313 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
3314 HAVE_UINTPTR_T, since we now use the stdint module.
3315 (base_name): Remove decl, since files now include <dirname.h>
3316 to get the decl.
3317
33182006-07-08 Akim Demaille <akim@lrde.epita.fr>
3319
3320 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
3321 New, default to 1.
3322 * data/yacc.c, data/glr.c, data/location.cc: Use them.
3323 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
3324 default.
3325 * tests/calc.at: Adjust.
3326
33272006-07-08 Akim Demaille <akim@lrde.epita.fr>
3328
3329 * data/c.m4 (b4_basename): New.
3330 (b4_syncline): Also output the location of its invocation (from
3331 the skeleton).
3332 (b4_user_action, b4_define_user_action, b4_user_actions)
3333 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
3334 (b4_user_stype): New.
3335 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
3336
33372006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3338
3339 In the grammar file, the first column is 1 not 0 on the first line as
3340 on every other line.
3341 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
3342 * tests/input.at (Torturing the Scanner): Update output.
3343
3344 * src/scan-gram.l (scanner_cursor): Declare it static.
3345
33462006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3347
3348 In warnings, say "previous declaration" rather than "first
3349 declaration".
3350 * src/symtab.c (redeclaration): Do that here.
3351 * src/reader.c (record_merge_function_type): In the case of a result
3352 type clash, report the previous declaration rather than the very first
3353 one in the grammar file.
3354 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3355 declared later): Add a third declaration to check this behavior.
3356 * tests/input.at (Incompatible Aliases): Update output.
3357
33582006-06-27 Akim Demaille <akim@epita.fr>
3359
3360 * doc/Doxyfile.in: New.
3361 * doc/Makefile.am: Use it.
3362 * src/lalr.h, src/symtab.h: Initial doxygenation.
3363
33642006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3365
3366 Don't miss %merge result type warnings just because the LHS types are
3367 declared after the %merge. This continues the effort of the previous
3368 patch.
3369 * src/reader.c (get_merge_function): Don't set the merger type yet.
3370 (record_merge_function_type): New function for setting the merger type
3371 and checking for clashes.
3372 (grammar_current_rule_merge_set): Set the location of the %merge for
3373 the current rule.
3374 (packgram): Invoke record_merge_function_type for each rule now that
3375 all symbol type declarations have been parsed.
3376 * src/reader.h (merger_list.type_declaration_location): New member
3377 storing the location of the first %merge from which the type for this
3378 merging function was derived.
3379 * src/symlist.h (symbol_list.merger_declaration_location): New member
3380 storing the location of a rule's %merge, if any.
3381 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3382 declared later): New test to catch the error fixed by the above patch.
3383
33842006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3385
3386 Get action warnings (grammar_rule_check) right even when symbol
3387 declarations appear after the rules. Discussed at
3388 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
3389 and
3390 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
3391 Don't mistake the type of $$ in a midrule to be that of its parent
3392 rule's $$.
3393 * src/reader.c (grammar_current_rule_end): Don't invoke
3394 grammar_rule_check yet since not all symbol declarations may have been
3395 parsed yet.
3396 (grammar_midrule_action): Likewise.
3397 Don't record whether the midrule's $$ has been used yet since actions
3398 haven't been translated yet.
3399 Record the midrule's parent rule and its RHS index within the parent
3400 rule.
3401 (grammar_current_rule_action_append): Don't translate the action yet
3402 since not all symbol declarations may have been parsed yet and, thus,
3403 warnings about types for $$, $n, @$, and @n can't be reported yet.
3404 (packgram): Translate the action and invoke grammar_rule_check now that
3405 all symbol declarations have been parsed.
3406 * src/scan-code.l (handle_action_dollar): Now that this is invoked
3407 after parsing the entire grammar file, the symbol list here in the case
3408 of a midrule is actually the midrule's empty RHS, so reference its
3409 parent rule's RHS where necessary.
3410 On the other hand, now that you can already know it's a midrule, you
3411 aren't forced to think $$ has the same type as its parent rule's $$.
3412 (handle_action_at): In the case of a midrule, reference the parent rule
3413 where necessary.
3414 * src/symlist.c (symbol_list_new): Initialize new midrule-related
3415 members.
3416 (symbol_list_length): Now that this is invoked after all rules have
3417 been parsed, a NULL symbol (rather than a NULL symbol list node)
3418 terminates a rule. symbol_list_print already does this correctly.
3419 * src/symlist.h (symbol_list.midrule_parent_rule,
3420 symbol_list.midrule_parent_rhs_index): New members so that midrules can
3421 remember their relationships with their parents.
3422 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
3423 fixed by the above patch.
3424 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
3425 implementing...
3426 (Unused values): ... this old test case and...
3427 (Unused values before symbol declarations): ... this new test case.
3428 This one is the same as `Unused values' except that all symbol
3429 declarations appear after the rules in order to catch the rest of the
3430 errors fixed by the above patch.
3431
34322006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3433
3434 More cleanup.
3435 * src/reader.c (current_rule): Declare it static since it's no longer
3436 used outside this file.
3437 (grammar_current_rule_action_append): Remove redundant arguments from
3438 translate_rule_action invocation.
3439 * src/reader.h (current_rule): Remove this unused extern.
3440 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
3441 * src/scan-code.l (translate_rule_action): Likewise.
3442
34432006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
3444
3445 Clean up yesterday's patch.
3446 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
3447 to...
3448 * src/reader.c (grammar_current_rule_action_append): ... here for
3449 consistency with grammar_current_rule_symbol_append.
3450 * tests/regression.at (Braced code in declaration in rules section):
3451 Make yyerror and yylex static as usual.
3452
34532006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
3454
3455 Fix bug that mistakes braced code in a declaration in the rules section
3456 to be a rule action. Mentioned at
3457 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
3458 * src/scan-gram.l: Move midrule action detection from the start of the
3459 scanning of any braced code to...
3460 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
3461 action. For readability, use $2 and @2 rather than the equivalent
3462 global variables.
3463 * tests/regression.at (Braced code in declaration in rules section):
3464 New test to catch the error fixed by the above patch.
3465
3466 Work on code readability some.
3467 * src/scan-code.l (current_rule): Get rid of this misleading and
3468 redundant declaration: it's actually extern'ed in reader.h.
3469 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
3470 translate_action): Add a rule argument and use it instead of the global
3471 current_rule.
3472 (translate_rule_action): This already receives current_rule through an
3473 argument, so pass it on to translate_action instead of assigning
3474 current_rule to current_rule.
3475 (translate_symbol_action, translate_code): Pass rule = NULL to
3476 translate_action.
3477
34782006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
3479
3480 Rename %before-definitions to %start-header and %after-definitions to
3481 %end-header. Don't use these declarations to separate pre-prologue
3482 blocks from post-prologue blocks. Add new order-independent
3483 declarations %before-header and %after-header as alternatives to the
3484 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
3485 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
3486 * NEWS (2.3+): Update for these changes.
3487 * data/glr.c (b4_before_definitions): Update to...
3488 (b4_start_header): ... this.
3489 (b4_after_definitions): Update to...
3490 (b4_end_header): ... this.
3491 * data/glr.cc: Likewise.
3492 * data/lalr1.cc: Likewise.
3493 * data/yacc.c: Likewise.
3494 * doc/bison.texinfo (The prologue): Update names, and replace remaining
3495 prologue blocks with %*-header declarations.
3496 (Calc++ Parser): Likewise.
3497 (Decl Summary): Update names.
3498 (Table of Symbols): Update description.
3499 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
3500 (PERCENT_END_HEADER): ... this.
3501 (PERCENT_BEFORE_DEFINITIONS): Update to...
3502 (PERCENT_START_HEADER): ... this.
3503 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
3504 (declaration): Update token names and m4 macro names.
3505 When parsing %end-header and %start-header, invoke translate_code
3506 before muscle_code_grow, and no longer set global booleans to remember
3507 whether these declarations have been seen.
3508 Parse new %after-header and %before-header.
3509 * src/reader.c (before_definitions, after_definitions): Remove.
3510 (prologue_augment): Accept a new bool argument to specify whether to
3511 augment the pre-prologue or post-prologue.
3512 * src/reader.h (before_definitions, after_definitions): Remove these
3513 extern's.
3514 (prologue_augment): Add new bool argument.
3515 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
3516 (PERCENT_END_HEADER): ... this.
3517 (PERCENT_BEFORE_DEFINITIONS): Update to...
3518 (PERCENT_START_HEADER): ... this.
3519 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
3520 * tests/actions.at (Printers and Destructors): Update names.
3521
35222006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
3523
3524 Add comparison operators for C++ location classes. Discussed at
3525 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
3526 * data/c++.m4 (b4_define_location_comparison): New boolean %define
3527 declaration indicating whether filename_type has an operator==. If
3528 filename_type is `std::string', it defaults to `1', `0' otherwise.
3529 * data/location.cc: Iff b4_define_location_comparison is `1', add
3530 operator== and operator!= for class position and for class location.
3531
3532 Some minor fixes.
3533 * src/scan-action.l: Remove unused file.
3534 * src/symtab.c (symbol_printer_set): Use printer_location not
3535 destructor_location.
3536 * src/symtab.h (struct symbol): Replace incorrect source comment for
3537 printer members.
3538 * tests/input.at (Incompatible Aliases): Update output with correct
3539 printer location.
3540
35412006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
3542
3543 Don't put the pre-prologue in the header file. For the yacc.c code
3544 file and the glr.c header and code files, move the pre-prologue before
3545 the token definitions. Add new %before-definitions and
3546 %after-definitions to declare code that will go in both the header file
3547 and code file. Discussed at
3548 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
3549 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
3550 and
3551 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
3552 * NEWS (2.3+): Describe these changes.
3553 * data/glr.c (b4_pre_prologue): Move from within to before...
3554 (b4_shared_declarations): ... this.
3555 Add new b4_before_definitions before b4_token_enums.
3556 Add new b4_after_definitions at the end.
3557 * data/glr.cc (b4_pre_prologue): Replace with...
3558 (b4_before_definitions): ... this in the header file.
3559 (b4_after_definitions): New near the end of the header file.
3560 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
3561 code file right before including the header file.
3562 (b4_before_definitions): New in the previous position of
3563 b4_pre_prologue in the header file.
3564 (b4_after_definitions): New near the end of the header file.
3565 * data/yacc.c: Clean up some m4 quoting especially in the header file.
3566 (b4_token_enums_defines): In the code file, move to right before
3567 YYSTYPE for consistency with the header file.
3568 (b4_before_definitions): New right before b4_token_enums_defines in
3569 both the header and code file.
3570 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
3571 header and code file.
3572 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
3573 of prologues for %union dependencies.
3574 (Decl Summary): In %defines description, mention the effect of
3575 %before-definitions and %after-definitions on the header file.
3576 (Calc++ Parser): Forward declare driver in a %before-definitions rather
3577 than in the pre-prologue so that make check succeeds.
3578 (Table of Symbols): Add entries for %before-definitions and
3579 %after-definitions.
3580 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
3581 %before-definitions.
3582 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
3583 (declaration): Parse those declarations and append to
3584 b4_before_definitions and b4_after_definitions, respectively.
3585 * src/reader.c (before_definitions, after_definitions): New bools to
3586 track whether those declarations have been seen.
3587 (prologue_augment): Add to the post-prologue if %union,
3588 %before-definitions, or %after-definitions has been seen.
3589 * src/reader.h (before_definitions, after_definitions): New extern's.
3590 * src/scan-gram.l: Scan the new declarations.
3591 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
3592 prologue block in a %before-definitions or a %after-definitions based
3593 on whether the %union is declared.
3594 * tests/regression.at (Early token definitions with --yacc, Early token
3595 definitions without --yacc): Move tests for token definitions into the
3596 post-prologue since token names are no longer defined in the
3597 pre-prologue.
3598
35992006-06-20 Akim Demaille <akim@epita.fr>
3600
3601 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
3602 (symbol_get): Use it.
3603 * src/parse-gram.y: Use it.
3604
36052006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
3606
3607 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
3608 build succeeds when configured with --enable-gcc-warnings.
3609
36102006-06-19 Paul Eggert <eggert@cs.ucla.edu>
3611
3612 * src/parse-gram.y (char_name): New function.
3613 (CHAR, STRING, string_content): For %printer, properly escape.
3614 (ID): Prefer fputs to fprintf.
3615 (id): Reindent to be consistent with other rules.
3616 Properly quote char.
3617
3618 The Translation Project changed its way of publishing translations
3619 to maintainers. I haven't received any responses to my request
3620 for supporting the old way, or for documenting the new way. I
3621 have modified 'bootstrap' to use screen scraping
3622 (in this case, HTML scraping). This is unreliable and inelegant,
3623 but I don't see any better way. Yuck.
3624 * bootstrap (TP_URL, WGET_COMMAND): New vars.
3625 (get_translations): New function, which uses HTML scraping to
3626 deduce locations of latest translations.
3627 Use this function to grab both bison and bison-runtime .po files.
3628 Don't bother priming the pump for the runtime-po domain any more,
3629 as it's now translated better than bison is.
3630
36312006-06-19 Akim Demaille <akim@epita.fr>
3632
3633 * src/scan-gram.l: No longer "parse" things after `%union' until
3634 `{'. Rather, return a single "%union" token.
3635 No longer make symbols: return strings, and leave the conversion
3636 to symbols to the parser.
3637 (SC_PRE_CODE, token_type): Remove.
3638 * src/parse-gram.y (%union): New field `character'.
3639 Sort tokens.
3640 (CHAR): New token.
3641 (ID, ID_COLON): Now that the scanner no longer makes them
3642 identifiers, adjust all uses to invoke symbol_get.
3643 (id_colon): New, wraps the conversion from string to symbol.
3644 (%union): Accept a possible union_name.
3645 (symbol): Now can be a char.
3646 * data/c.m4 (b4_union_name): Leave a default value.
3647 * data/glr.c, data/yacc.c: Use it.
3648
36492006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
3650
3651 For associating token numbers with token names for "yacc.c", don't use
3652 #define statements unless `--yacc' is specified; always use enum
3653 yytokentype. Most important discussions start at:
3654 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
3655 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
3656 and
3657 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
3658 * NEWS (2.3+): Mention.
3659 * data/c.m4 (b4_yacc_if): New.
3660 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
3661 token #define's.
3662 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
3663 on token name definitions.
3664 * src/getargs.c (usage): Capitalize `Yacc' in English.
3665 * src/output.c (prepare): Define b4_yacc_flag.
3666 * tests/regression.at (Early token definitions): Test that tokens names
3667 are defined before the pre-prologue not just before the post-prologue.
3668 Remove this test case and copy to...
3669 (Early token definitions with --yacc): ... this to test #define's.
3670 (Early token definitions without --yacc): ... and this to test enums.
3671
36722006-06-11 Paul Eggert <eggert@cs.ucla.edu>
3673
3674 * NEWS: Reword the post-2.3 change to not be so optimistic about
3675 removing the old "look-ahead" spelling.
3676 Update previous look-ahead/lookahead change reports.
3677 * REFERENCES: look-ahead -> lookahead (since that's
3678 what he actually wrote).
3679 * doc/refcard.tex: look ahead -> lookahead,
3680 look-ahead -> lookahead
3681
36822006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
3683
3684 For consistency, use `lookahead' instead of `look-ahead' or
3685 `look_ahead'. Discussed starting at
3686 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
3687 and then at
3688 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
3689 * NEWS: For the next release, note the change to `--report'.
3690 * TODO, doc/bison.1: Update English.
3691 * doc/bison.texinfo: Update English.
3692 (Understanding Your Parser, Bison Options): Document as
3693 `--report=lookahead' rather than `--report=look-ahead'.
3694 * src/conflicts.c: Update English in comments.
3695 (lookahead_set): Rename from look_ahead_set.
3696 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
3697 (resolve_sr_conflict): Rename local look_ahead_tokens to
3698 lookahead_tokens, and update other uses.
3699 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
3700 count_rr_conflicts, conflicts_free): Update uses.
3701 * src/getargs.c (report_args): Move "lookahead" before alternate
3702 spellings.
3703 (report_types): Update uses.
3704 (usage): For `--report' usage description, state `lookahead' spelling
3705 rather than `look-ahead'.
3706 * src/getargs.h (report.report_lookahead_tokens): Rename from
3707 report_look_ahead_tokens.
3708 * src/lalr.c: Update English in comments.
3709 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
3710 (state_lookahead_tokens_count): Rename from
3711 state_look_ahead_tokens_count.
3712 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3713 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
3714 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3715 Update other uses.
3716 Update English in output.
3717 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
3718 * src/print.c: Update English in comments.
3719 (lookahead_set): Rename from look_ahead_set.
3720 (print_reduction): Rename argument lookahead_token from
3721 look_ahead_token.
3722 (print_core, state_default_rule, print_reductions, print_results):
3723 Update uses.
3724 * src/print_graph.c: Update English in comments.
3725 (print_core): Update uses.
3726 * src/state.c: Update English in comments.
3727 (reductions_new): Update uses.
3728 (state_rule_lookahead_tokens_print): Rename from
3729 state_rule_look_ahead_tokens_print, and update other uses.
3730 * src/state.h: Update English in comments.
3731 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
3732 (state_rule_lookahead_tokens_print): Rename from
3733 state_rule_look_ahead_tokens_print.
3734 * src/tables.c: Update English in comments.
3735 (conflict_row, action_row): Update uses.
3736 * tests/glr-regression.at
3737 (Incorrect lookahead during deterministic GLR,
3738 Incorrect lookahead during nondeterministic GLR): Rename
3739 print_look_ahead to print_lookahead.
3740 * tests/torture.at: Update English in comments.
3741 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
3742 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
3743 (Many lookahead tokens): Update uses.
3744 * data/glr.c: Update English in comments.
3745 * lalr1.cc: Likewise.
3746 * yacc.c: Likewise.
3747 * src/conflicts.h: Likewise.
3748 * src/lalr.h: Likewise.
3749 * src/main.c: Likewise.
3750 * src/output.c: Likewise.
3751 * src/parse-gram.c: Likewise.
3752 * src/tables.h: Likewise.
3753 * tests/calc.at: Likewise.
3754
37552006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
3756
3757 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
3758
37592006-06-07 Paul Eggert <eggert@cs.ucla.edu>
3760
3761 * TODO: Add request from Nelson H. F. Beebe to be able to install
3762 Bison without installing the yacc script.
3763
37642006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
3765
3766 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
3767 and yytext if they're already #define'd.
3768 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
3769 * src/scan-code-c.c: ... here.
3770 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
3771 <config.h>.
3772
37732006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
3774
3775 Get Bison to build again when configured with --enable-gcc-warnings.
3776 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
3777 missing #include's.
3778 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
3779 loc argument as it shadows a global.
3780 * src/scan-gram.l: Remove stray comma that prevents boundary_set
3781 invocation.
3782
3783 * src/.cvsignore: Add scan-code.c.
3784
37852006-06-07 Akim Demaille <akim@epita.fr>
3786
3787 * src/scan-gram.l: Move the "add a trailing ; to actions" code
3788 to...
3789 * src/scan-code.l: here.
3790 * tests/input.at (Torturing the Scanner): Fix another location
3791 error.
3792
37932006-06-07 Akim Demaille <akim@epita.fr>
3794
3795 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
3796
37972006-06-06 Akim Demaille <akim@epita.fr>
3798
3799 Extract the parsing of user actions from the grammar scanner.
3800 As a consequence, the relation between the grammar scanner and
3801 parser is much simpler. We can also split "composite tokens" back
3802 into simple tokens.
3803 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
3804 * src/scan-gram.l (add_column_width, adjust_location): Move to and
3805 rename as...
3806 * src/location.h, src/location.c (add_column_width)
3807 (location_compute): these.
3808 Fix the column count: the initial column is 0.
3809 (location_print): Be robust to ending column being 0.
3810 * src/location.h (boundary_set): New.
3811 * src/main.c: Adjust to scanner_free being renamed as
3812 gram_scanner_free.
3813 * src/output.c: Include scan-code.h.
3814 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
3815 Use boundary_set.
3816 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
3817 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
3818 which is now, again, a separate token.
3819 Adjust all dependencies.
3820 Whereever actions with $ and @ are used, use translate_code.
3821 (action): Remove this nonterminal which is now useless.
3822 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
3823 (grammar_current_rule_action_append): Use translate_code.
3824 (packgram): Bound check ruleno, itemno, and rule_length.
3825 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
3826 (last_string, last_braced_code_loc, max_left_semantic_context)
3827 (scanner_initialize, scanner_free, scanner_last_string_free)
3828 (gram_out, gram_lineno, YY_DECL_): Move to...
3829 * src/scan-gram.h: this new file.
3830 (YY_DECL): Rename as...
3831 (GRAM_DECL): this.
3832 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
3833 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
3834 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
3835 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
3836 Move these declarations, and...
3837 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
3838 these to...
3839 * src/flex-scanner.h: this new file.
3840 * src/scan-gram.l (rule_length, rule_length_overflow)
3841 (increment_rule_length): Remove.
3842 (last_braced_code_loc): Rename as...
3843 (gram_last_braced_code_loc): this.
3844 Adjust to the changes of the parser.
3845 Move all the handling of $ and @ into...
3846 * src/scan-code.l: here.
3847 * src/scan-gram.l (handle_dollar, handle_at): Remove.
3848 (handle_action_dollar, handle_action_at): Move to...
3849 * src/scan-code.l: here.
3850 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
3851 scan-code.h, scan-code-c.c, scan-gram.h.
3852 (EXTRA_bison_SOURCES): Add scan-code.l.
3853 (BUILT_SOURCES): Add scan-code.c.
3854 (yacc): Be robust to white spaces.
3855
3856 * tests/conflicts.at, tests/input.at, tests/reduce.at,
3857 * tests/regression.at: Adjust the column numbers.
3858 * tests/regression.at: Adjust the error message.
3859
38602006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3861
3862 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3863 Use Akim's wording from
3864 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
3865
38662006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3867
3868 Between Bison releases, manually append `+' to the previous Bison
3869 release number, and use that as a signal to automatically print the
3870 ChangeLog's CVS Id keyword from --version. Discussed starting at
3871 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
3872 * ChangeLog: Add Id header.
3873 * configure.ac (AC_INIT): Append `+' to `2.3'.
3874 * src/.cvsignore: Add revision.c.
3875 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
3876 (BUILT_SOURCES): Add revision.c.
3877 (revision.c): New target rule. This file defines a new global variable
3878 named revision. It initializes it with either the Id from ChangeLog
3879 or, if VERSION doesn't contain `+', with the empty string.
3880 * src/getargs.c (version): Print the value of revision.
3881 * src/revision.h: Extern revision.
3882
38832006-06-05 Paul Eggert <eggert@cs.ucla.edu>
3884
3885 * NEWS: Version 2.3.
3886 * configure.ac (AC_INIT): Likewise.
3887
38882006-05-30 Paul Eggert <eggert@cs.ucla.edu>
3889
3890 * data/glr.c (YYRECOVERING): Define to be a function-like macro
3891 with no arguments, not as an object-like macro. This is for
3892 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
3893 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
3894 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
3895 Document this.
3896
38972006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
3898
3899 * src/getargs.c (usage): Back out yesterday's modification of the
3900 --help output so that we don't have to wait for translation before
3901 releasing 2.3.
3902
39032006-05-29 Paul Eggert <eggert@cs.ucla.edu>
3904
3905 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
3906 Problem reported by Akim Demaille.
3907
39082006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3909
3910 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3911
39122006-05-26 Paul Eggert <eggert@cs.ucla.edu>
3913
3914 * data/yacc.c (yy_reduce_print): Omit trailing white space in
3915 generated source code. Problem reported by Frans Englich in
3916 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
3917
39182006-05-22 Paul Eggert <eggert@cs.ucla.edu>
3919
3920 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
3921 shell, not within 'make', so that 'make' by an ordinary builder
3922 (using GNU make) does not worry about configuring gzip. This also
3923 works around a bug reported independently by Keith Thompson and by
3924 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
3925 stderr rather than stdout, messing up the build logs.
3926
39272006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3928
3929 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
3930 to make sure that YYID will never be unused. This fixes a 'make
3931 maintainer-check' failure caused by the recent changes to the 'Trivial
3932 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
3933 not used.
3934 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
3935
39362006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3937
3938 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
3939 state before an empty RHS is always resolved here. Only the location
3940 of that state is guaranteed to be resolved, and that's enough. This
3941 fixes the remaining bug reported by Derek M. Jones in
3942 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3943 * tests/glr-regression.at (Uninitialized location when reporting
3944 ambiguity): Test the above case.
3945 Also, the embedded comments in this test case claim it checks the case
3946 of an empty RHS that has inherited the initial location. However, the
3947 corresponding LHS was already resolved, so yyresolveLocations didn't
3948 actually have reason to modify it. Fix this by forcing
3949 nondeterministic operation at the beginning of the parse.
3950
39512006-05-20 Paul Eggert <eggert@cs.ucla.edu>
3952
3953 * data/c.m4 (b4_yy_symbol_print_generate):
3954 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
3955 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
3956 of the bugs reported today by Derek M Jones in
3957 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3958 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
3959 defined to be a type name without parens or brackets.
3960 (Location Type): Similarly for YYLTYPE.
3961 * tests/regression.at (Trivial grammars): Put in a test for this
3962 bug that will be caught by 'make maintainer-check' (though not,
3963 alas, by 'make check' unless your compiler is picky).
3964
39652006-05-19 Paul Eggert <eggert@cs.ucla.edu>
3966
3967 * NEWS: Version 2.2.
3968 * configure.ac (AC_INIT): Likewise.
3969
39702006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
3971
3972 * data/glr.c (yyreportTree): Make room in yystates for the state
3973 preceding the RHS. This fixes the segmentation fault reported by Derek
3974 M. Jones in
3975 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
3976 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
3977 to the user. Reported for yyreportTree by Derek M. Jones later in the
3978 same thread.
3979 * THANKS: Add Derek M. Jones.
3980 Update my email address.
3981 Fix typo in Steve Murphy's name.
3982
39832006-05-14 Paul Eggert <eggert@cs.ucla.edu>
3984
3985 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
3986 checking against YYLAST that caused the parser to miss a potential
3987 alternative in its diagnostic.
3988 Problem reported by Maria Jose Moron Fernandez in
3989 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
3990 * data/lalr1.cc (yysyntax_error_): Likewise.
3991 * data/yacc.c (yysyntax_error): Likewise.
3992 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
3993 tokens, in case we run into an older C compiler.
3994 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
3995 Use them to check for the off-by-one error fixed above.
3996
3997 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
3998 YYSIZE_T, not size_t.
3999 * tests/regression.at (Trivial grammars): New test, to catch
4000 the error fixed by the above patch.
4001
40022006-05-14 Akim Demaille <akim@lrde.epita.fr>
4003
4004 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
4005 scheme.
4006 Reported by Steve Murphy.
4007
40082006-05-14 Akim Demaille <akim@lrde.epita.fr>
4009
4010 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
4011 * data/glr.cc: b4_location_flag is now b4_locations_flag.
4012
40132006-05-14 Akim Demaille <akim@lrde.epita.fr>
4014
4015 Implement --trace=m4.
4016 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
4017 * src/output.c (output_skeleton): When set, pass -dV to m4.
4018
4019 Factor the handling of flags in m4.
4020 * src/output.c (prepare): Rename the muscle names debug, defines,
4021 error_verbose to debug_flag, defines_flag, error_verbose_flag.
4022 * data/c.m4: Adjust.
4023 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
4024 Use b4_define_flag_if to define other b4_FLAG_if macros.
4025 (b4_location_if): As a consequence, rename as...
4026 (b4_locations_if): this, for consistency.
4027 Adjust all the skeletons.
4028
40292006-05-14 Akim Demaille <akim@lrde.epita.fr>
4030
4031 * etc/bench.pm: Shorten bench names.
4032
40332006-05-14 Akim Demaille <akim@lrde.epita.fr>
4034
4035 * src/output.h, src/output.c (error_verbose): Move to...
4036 * src/getargs.h, src/getargs.c: here.
4037 Sort the flags.
4038 Adjust dependencies.
4039
40402006-05-13 Paul Eggert <eggert@cs.ucla.edu>
4041
4042 * data/c.m4 (b4_copyright): Put the special exception for Bison
4043 skeletons here, so we don't have to put it in each skeleton. All
4044 uses changed. Suggested by Akim Demaille. Also, wrap the
4045 copyright notice, in case it is longer than 80 columns. Replace
4046 comma by newline after title.
4047
40482006-05-11 Paul Eggert <eggert@cs.ucla.edu>
4049
4050 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
4051 incompatibility, not a bug. Mention that it wasn't fixed as of
4052 flex 2.5.33.
4053
40542006-05-11 Akim Demaille <akim@lrde.epita.fr>
4055
4056 * examples/extexi: Enforce the precedence of concatenation over
4057 >>.
4058 Reported by Tommy Nordgren.
4059
40602006-05-11 Akim Demaille <akim@lrde.epita.fr>
4061
4062 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
4063 with the member "token".
4064 Reported by Martin Nylin.
4065
40662006-05-08 Paul Eggert <eggert@cs.ucla.edu>
4067
4068 * data/glr.c: Switch to Bison 2.2 special-exception language in
4069 the copyright notice. Use more-regular format for titles and
4070 copyright notices.
4071 * data/glr.cc: Likewise.
4072 * data/location.cc: Likewise.
4073 * data/yacc.cc: Likewise.
4074 * doc/bison.texinfo (Conditions): Document this.
4075 * NEWS: likewise. Upgrade version to 2.2.
4076
40772006-04-27 Akim Demaille <akim@lrde.epita.fr>
4078
4079 * data/glr.cc: Remove dead code.
4080
40812006-04-25 Paul Eggert <eggert@cs.ucla.edu>
4082
4083 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
4084 that variable and the line breaks the bootstrap. Problem reported
4085 by Juan M. Guerrero.
4086
40872006-04-24 Akim Demaille <akim@lrde.epita.fr>
4088
4089 * doc/bison.texinfo (Multiple start-symbols): New.
4090
40912006-04-24 Akim Demaille <akim@lrde.epita.fr>
4092
4093 * etc/README, etc/bench.pl: New.
4094
40952006-04-03 Akim Demaille <akim@lrde.epita.fr>
4096
4097 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
4098 rule.
4099 Reported by Mickael Labau.
4100 * tests/input.at (Torturing the Scanner): Test it.
4101
41022006-03-16 Paul Eggert <eggert@cs.ucla.edu>
4103
4104 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
4105 Problem reported by Bob Rossi.
4106
41072006-03-13 Paul Eggert <eggert@cs.ucla.edu>
4108
4109 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
4110 and didn't really work.
4111 For the index, use @ifnotinfo, not @iftex.
4112 Minor cleanups of spacing and terminology.
4113
41142006-03-12 Akim Demaille <akim@lrde.epita.fr>
4115
4116 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
4117 of AT_NAME_PREFIX when %name-prefix is not used.
4118
41192006-03-12 Akim Demaille <akim@lrde.epita.fr>
4120
4121 Apply --prefix to C++ skeletons too: they change the namespace.
4122 The test suite already exercize these cases.
4123 * data/c++.m4 (b4_namespace): New.
4124 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
4125 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
4126 * data/yacc.c, data/glr.c: Remove a useless `[]'.
4127 * doc/bison.texinfo: Document it.
4128 (Option Cross Key): Use @multitable in all formats. It looks
4129 nicer, even in TeX outputs.
4130 (Rules): Use the same code whatever the output type is.
4131 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
4132 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
4133 * tests/calc.at: Use it, instead of hard coding `yy'.
4134
41352006-03-10 Akim Demaille <akim@lrde.epita.fr>
4136
4137 * TODO: Remove dead items.
4138
41392006-03-10 Akim Demaille <akim@lrde.epita.fr>
4140
4141 * doc/FAQ: Remove, merged into...
4142 * doc/bison.texinfo (FAQ): this.
4143 * doc/Makefile.am (EXTRA_DIST): Adjust.
4144
41452006-03-10 Akim Demaille <akim@lrde.epita.fr>
4146
4147 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
4148 even if empty.
4149 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
4150 * doc/bison.texinfo (Calc++ Scanner): Use it.
4151
41522006-03-09 Paul Eggert <eggert@cs.ucla.edu>
4153
4154 Fix two nits reported by twlevo, plus one more that I discovered.
4155
4156 * src/assoc.h (assoc_to_string): Give a name to the arg, as
4157 this is the usual Bison style.
4158 * src/location.h (location_print): Likewise.
4159
4160 * src/reader.h (token_name): Likewise.
4161
41622006-03-08 Paul Eggert <eggert@cs.ucla.edu>
4163
4164 Fix some nits reported by twlevo.
4165 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
4166 and "POSIX". Use more-modern syntax for URLs. Mention C++
4167 and ask for Java. Don't hardwire OS version numbers. Add
4168 copyright notice.
4169 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
4170 * src/conflicts.c (solved_conflicts_obstack): Now static.
4171
41722006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4173
4174 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
4175 page. Say "you can use it" not "you may use it" as on the web page;
4176 we're describing capabilities not granting permission.
4177
41782006-03-06 Paul Eggert <eggert@cs.ucla.edu>
4179
4180 * data/glr.c (yyresolveLocations): Rename local variables to avoid
4181 shadowing warnings. Use usual patter for iterating through RHS.
4182 * tests/glr-regression.at
4183 (Uninitialized location when reporting ambiguity):
4184 Modify yylex so that it uses its argument, rather than trying
4185 to rely on ARGSUSED (which doesn't work for gcc with warnings).
4186 const char -> char const.
4187
4188 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
4189 Don't use tabs inside commands; it messes up 'ps'.
4190 Problem reported by twlevo.
4191
41922006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
4193
4194 * tests/glr-regression.at (Uninitialized location when reporting
4195 ambiguity): New test case.
4196 * data/glr.c (yyresolveLocations): New function, which uses
4197 YYLLOC_DEFAULT.
4198 (yyresolveValue): Invoke yyresolveLocations before reporting an
4199 ambiguity.
4200 * doc/bison.texinfo (Default Action for Locations): Note
4201 YYLLOC_DEFAULT's usage for ambiguity locations.
4202 (GLR Semantic Actions): Cross-reference those notes.
4203
42042006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
4205
4206 * tests/glr-regression.at (Leaked semantic values when reporting
4207 ambiguity): Remove unnecessary union and type declarations.
4208 (Leaked lookahead after nondeterministic parse syntax error): New test
4209 case.
4210 * data/glr.c (yyparse): Check for zero stacks remaining before
4211 attempting to shift the lookahead so that you don't lose it.
4212
42132006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4214
4215 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
4216 * tests/glr-regression.at (Leaked semantic values when reporting
4217 ambiguity): New test case.
4218 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
4219 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
4220 now unnecessary yystackp parameter.
4221 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
4222 destructors can be called.
4223
4224 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
4225 in existing testcases.
4226
42272006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4228
4229 Don't leak semantic values for parent RHS when a user action cuts the
4230 parser, and clean up related code a bit.
4231 * tests/glr-regression.at (Leaked merged semantic value if user action
4232 cuts parse): Rename to...
4233 (Leaked semantic values if user action cuts parse): ... this. Add check
4234 for leaked parent RHS values.
4235 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
4236 between an unresolved state (non-empty chain of semantic options) and
4237 an incomplete one (signaled by an empty chain).
4238 (yyresolveStates): Document the interface. Move all manipulation of a
4239 successfully or unsuccessfully resolved yyGLRState to...
4240 (yyresolveValue): ... here so that yyresolveValue always leaves a
4241 yyGLRState with consistent data and thus is easier to understand.
4242 Remove the yyvalp and yylocp parameters since they are always just
4243 taken from the yys parameter. When reporting a discarded merged value
4244 in debugging output, note that it is incompletely merged. Document the
4245 interface.
4246 (yyresolveAction): If resolving any of the RHS states fails, destroy
4247 them all rather than leaking them. Thus, as long as user actions are
4248 written to clean up the RHS correctly, yyresolveAction always cleans up
4249 the RHS of a semantic option. Document the interface.
4250
42512006-02-27 Paul Eggert <eggert@cs.ucla.edu>
4252
4253 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
4254 led to a segmentation fault in GNU Pascal. Problem reported
4255 by Waldek Hebisch.
4256
42572006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
4258
4259 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
4260 mid-rule action inside a nonterminal symbol in order to declare a
4261 destructor for its semantic value.
4262
42632006-02-16 Paul Eggert <eggert@cs.ucla.edu>
4264
4265 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
4266 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
4267 __cplusplus && ! defined _STDLIB_H && !
4268 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
4269 defined free))]: Include <stdlib.h> rather than rolling our own
4270 declarations of malloc and free, to avoid problems with
4271 incompatible declarations (using 'throw') C++'s stdlib.h. This
4272 should fix Debian bug 340012
4273 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
4274 reported by Guillaume Melquiond.
4275
42762006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4277
4278 * NEWS: Clarify symbols versus types in unused-value warnings.
4279
4280 * configure.ac (AC_INIT): Bump version number.
4281
42822006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4283
4284 * NEWS: Version 2.1a.
4285 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
4286 since C99 requires this.
4287
42882006-02-11 Paul Eggert <eggert@cs.ucla.edu>
4289
4290 * m4/c-working.m4: New file.
4291 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
4292
42932006-02-10 Paul Eggert <eggert@cs.ucla.edu>
4294
4295 * Makefile.maint: Merge from coreutils.
4296
42972006-02-09 Paul Eggert <eggert@cs.ucla.edu>
4298
4299 More portability fixes for problems summarized by Nelson H. F. Beebe.
4300
4301 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
4302 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
4303 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
4304 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
4305 messes up because C++ code is compiled in 32-bit mode but linked
4306 in 64-bit mode.
4307
43082006-02-08 Paul Eggert <eggert@cs.ucla.edu>
4309
4310 More portability fixes for problems summarized by Nelson H. F. Beebe.
4311
4312 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
4313 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
4314
4315 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
4316 nodist_PROGRAMS, since we don't need to actually compile the
4317 example if we're just doing a plain 'make'. This avoids bothering
4318 the installer unnecessarily about problems due to weird C++
4319 compilers.
4320
43212006-02-06 Paul Eggert <eggert@cs.ucla.edu>
4322
4323 More portability fixes for problems summarized by Nelson H. F. Beebe.
4324
4325 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
4326 than #include "...", and compile with -I'.'. The old method was
4327 not portable, according to Posix and the C standard, and it does
4328 not work with Sun C 5.7, where previous #line directives affect
4329 the working directory used in later #include "..." directives.
4330
43312006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4332
4333 Various DJGGP specific issues in /djgpp
4334
43352006-02-02 Paul Eggert <eggert@cs.ucla.edu>
4336
4337 More portability fixes for problems summarized by Nelson H. F. Beebe.
4338
4339 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
4340 '#include <map>' works and that you can apply ++ to iterators.
4341
43422006-02-01 Paul Eggert <eggert@cs.ucla.edu>
4343
4344 Work around portability problems summarized by Nelson H. F. Beebe in
4345 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
4346
4347 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4348 that '#include <string>' works.
4349
4350 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
4351 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
4352 "warning: sorry: semantics of inline function static data `const
4353 unsigned char translate_table[262]' are wrong (you'll wind up with
4354 multiple copies)".
4355
4356 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
4357 or, xor to not_, and_, or_, and xor_, respectively. This works
4358 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
4359 random system header somewhere that includes the equivalent of
4360 <iso646.h>.
4361
4362 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
4363 -E" works; it apparently doesn't work with PathScale EKO Compiler
4364 Suite Version 2.0.
4365
43662006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
4367
4368 During deterministic GLR operation, user actions should be able to
4369 influence the parse by changing yychar. To make this easier to fix and
4370 to make glr.c easier to evolve in general, don't maintain yytoken in
4371 parallel with yychar; just compute yytoken when needed.
4372 * tests/glr-regression.at (Incorrect lookahead during deterministic
4373 GLR): Check that setting yychar in a user action has the intended
4374 effect.
4375 * data/glr.c (yyGLRStack): Remove yytokenp member.
4376 (yyclearin): Don't set *yytokenp.
4377 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
4378 yychar rather than *yytokenp to determine the current lookahead.
4379 Compute yytoken locally when needed.
4380 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
4381 point to.
4382
4383 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
4384 after `--report' documentation.
4385
43862006-01-30 Paul Eggert <eggert@cs.ucla.edu>
4387
4388 * src/parse-gram.y (grammar_declaration): Location of printer
4389 symbol is @1, not list->location. Bug reported by twlevo.
4390 * tests/input.at (Incompatible Aliases): Adjust to above change.
4391
43922006-01-29 Paul Eggert <eggert@cs.ucla.edu>
4393
4394 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
4395 all the test at once. This makes the output easier to read in the
4396 normal case.
4397
4398 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
4399 got from <http://bro-ids.org/download.html>. The bug is that
4400 when two actions appeared in succession, the second one was
4401 scanned before the first one was added to the grammar rule
4402 as a midrule action. Bison then output the incorrect warning
4403 "parse.y:905.17-906.36: warning: unused value: $3".
4404 * src/parse-gram.y (BRACED_CODE, action): These are no longer
4405 associated with a value.
4406 (rhs): Don't invoke grammar_current_rule_action_append.
4407 (action): Invoke it here instead.
4408 * src/reader.c (grammar_midrule_action): Now extern.
4409 (grammar_current_rule_action_append): Don't invoke
4410 grammar_midrule_action; that is now the scanner's job.
4411 * src/reader.h (last_string, last_braced_code_loc):
4412 (grammar_midrule_action): New decls.
4413 * src/scan-gram.l (last_string): Now extern, sigh.
4414 (last_braced_code_loc): New extern variable.
4415 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
4416 rule already has an action.
4417 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
4418 * tests/input.at (AT_CHECK_UNUSED_VALUES):
4419 Add some tests to check that the above changes fixed the bug.
4420
44212006-01-27 Paul Eggert <eggert@cs.ucla.edu>
4422
4423 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
4424 All used changed. Check whether the symbol has a destructor,
4425 not whether it is typed.
4426 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
4427 that the values are still reported as unused. All line numbers
4428 adjusted.
4429
44302006-01-23 Paul Eggert <eggert@cs.ucla.edu>
4431
4432 Work around a bug in bro 0.8, which underparenthesizes its
4433 definition of YYLLOC_DEFAULT.
4434 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
4435 their arguments.
4436 * data/lalr1.cc: Likewise.
4437 * data/yacc.cc: Likewise.
4438
44392006-01-22 Paul Eggert <eggert@cs.ucla.edu>
4440
4441 Work around a bug in Pike 7.0, and give the Pike folks a
4442 better way to override the usual int widths.
4443 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
4444 user can override the types.
4445 (short): #undef, to work around a bug in Pike 7.0.
4446 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
4447 (union yyalloc.yyss): Use yytype_int16 rather than short.
4448 All uses changed.
4449 (yysigned_char): Remove.
4450 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
4451 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
4452 * tests/regression.at (Web2c Actions): Adjust to above changes.
4453
4454 * src/reader.c (check_and_convert_grammar): New function.
4455 (reader): Close the input file even if something went wrong during
4456 parsing. Minor file descriptor leak reported by twlevo.
4457
4458 * src/assoc.c (assoc_to_string): Use a default: abort (); case
4459 to pacify gcc -Wswitch-default.
4460 * src/scan-gram.l (adjust_location): Use a default: break; case
4461 to pacify gcc -Wswitch-default.
4462 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
4463 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4464 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4465 Move these decls to scan-skel.l, since they don't need to be
4466 visible elsewhere.
4467 * src/scan-skel.l: Accept the above decls.
4468 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
4469 is used.
4470
44712006-01-21 Paul Eggert <eggert@cs.ucla.edu>
4472
4473 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
4474 since we don't want to insist on a version number at the start
4475 of the changelog every time.
4476 * Makefile.maint: Sync from coreutils a bit better.
4477 (sc_trailing_blank): Renamed from sc_trailing_space.
4478 All uses changed.
4479 (sc_no_if_have_config_h, sc_require_config_h):
4480 (sc_prohibit_assert_without_use): New rules.
4481 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
4482 (sc_dd_max_sym_length): Fix leading spaces in rule.
4483 (sc_system_h_headers): Prefix with @.
4484 (sc_useless_cpp_parens, m4-check): Output line numbers.
4485 (changelog-check): Allow version only in head.
4486 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
4487 satisfy new Makefile.maint rule.
4488 * data/glr.c: Likewise.
4489 * data/glr.cc: Likewise.
4490 * data/lalr1.cc: Likewise.
4491 * data/yacc.c: Likewise.
4492 * lib/ebitsetv.c: Likewise.
4493 * lib/lbitset.c: Likewise.
4494 * lib/subpipe.c: Likewise.
4495 * lib/timevar.c: Likewise.
4496 * src/system.h: Likewise.
4497 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
4498 * djgpp/Makefile.maint: Add copyright notice.
4499 * djgpp/README.in: Likewise.
4500 * djgpp/config.bat: Likewise.
4501 * djgpp/config.site: Likewise.
4502 * djgpp/config_h.sed: Likewise.
4503 * djgpp/djunpack.bat: Likewise.
4504 * djgpp/config.sed: Fix copyright notice to match standard format.
4505 * djgpp/subpipe.h: Likewise.
4506 * lib/bitsetv-print.c: Likewise.
4507 * lib/bitsetv.c: Likewise.
4508 * lib/subpipe.h: Likewise.
4509 * lib/timevar.c: Likewise.
4510 * lib/timevar.h: Likewise.
4511 * djgpp/subpipe.c: Use standard recipe for config.h.
4512 * lib/abitset.c: Likewise.
4513 * lib/bitset.c: Likewise.
4514 * lib/bitset_stats.c: Likewise.
4515 * lib/bitsetv-print.c: Likewise.
4516 * lib/bitsetv.c: Likewise.
4517 * lib/ebitsetv.c: Likewise.
4518 * lib/get-errno.c: Likewise.
4519 * lib/lbitset.c: Likewise.
4520 * lib/subpipe.c: Likewise.
4521 * lib/timevar.c: Likewise.
4522 * lib/vbitset.c: Likewise.
4523 * tests/local.at: Likewise.
4524 * src/scan-gram.l: Don't include verify.h, since system.h does
4525 that for us.
4526 * .x-sc_require_config_h: New file.
4527 * .x-sc_unmarked_diagnostics: New file.
4528
45292006-01-20 Paul Eggert <eggert@cs.ucla.edu>
4530
4531 Be a bit more systematic about using 'abort'.
4532 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
4533 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
4534 Put 'default: abort ();' before some other case, to satisfy older
4535 pedantic compilers.
4536 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4537 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
4538 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
4539 * src/conflicts.c (resolve_sr_conflict): Likewise.
4540 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
4541 (get_decision_str, get_orientation_str, get_node_alignment_str):
4542 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
4543 (get_linestyle_str, get_arrowstyle_str): Likewise.
4544 * src/conflicts.c (resolve_sr_conflict):
4545 Use a default case rather than one for the one remaining enum
4546 value, to catch invalid enum values as well.
4547 * src/lalr.c (set_goto_map, map_goto):
4548 Prefer "assert (FOO);" to "if (!FOO) abort ();".
4549 * src/nullable.c (nullable_compute, token_definitions_output):
4550 Likewise.
4551 * src/reader.c (packgram, reader): Likewise.
4552 * src/state.c (transitions_to, state_new, state_reduction_find):
4553 Likewise.
4554 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
4555 (symbol_pack): Likewise.
4556 * src/tables.c (conflict_row, pack_vector): Likewise.
4557 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
4558 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
4559 * src/system.h: Don't include <assert.h>.
4560 (assert): New macro.
4561
4562 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
4563 (Destructor Decl, Parser Function, Pure Calling):
4564 Describe rules for braces inside C code more carefully.
4565
45662006-01-19 Paul Eggert <eggert@cs.ucla.edu>
4567
4568 Fix some porting glitches found by Nelson H. F. Beebe.
4569 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
4570 compilers that don't understand that abort () does not return.
4571 * src/state.c (transitions_to): Likewise.
4572 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4573 that '#include <cstdlib>' works.
4574 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
4575 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
4576 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
4577 for the benefit of some pre-C99 compilers.
4578
4579 * bootstrap: Undo changes to gnulib files that autoreconf made.
4580
4581 Minor fixups to get 'make maintainer-check' to work.
4582 * configure.ac: Don't use -Wnested-externs, as it's incompatible
4583 with the new verify.h implementation.
4584 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
4585 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
4586 * data/yacc.c (YYUSE): Likewise.
4587 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
4588 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
4589 * src/parse-gram.y (declaration): Don't pass a string constant
4590 to a function that expects char *, since GCC might complain
4591 about the constant value.
4592 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
4593 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
4594 before #defining them.
4595 * tests/glr-regression.at
4596 (Incorrectly initialized location for empty right-hand side in GLR):
4597 In yyerror, use the msg arg.
4598 (Corrupted semantic options if user action cuts parse):
4599 (Incorrect lookahead during deterministic GLR):
4600 (Incorrect lookahead during nondeterministic GLR):
4601 Don't name a local var 'index'; it shadows string.h's 'index'.
4602
46032006-01-19 Akim Demaille <akim@epita.fr>
4604
4605 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
4606 location, not just parts of it.
4607
46082006-01-18 Paul Eggert <eggert@cs.ucla.edu>
4609
4610 * NEWS: Document the fact that multiple %unions are now allowed.
4611 * doc/bison.texinfo (Union Decl): Likewise.
4612 * TODO: This feature is now implemented, so remove it from
4613 the wishlist.
4614
4615 * Makefile.maint: Merge with coreutils Makefile.maint.
4616 (CVS_LIST): Use build-aux version if available.
4617 (VERSION_REGEXP): New macro.
4618 (syntax-check-rules): Add sc_no_if_have_config_h,
4619 sc_prohibit_assert_without_use, sc_require_config_h,
4620 sc_useless_cpp_parens.
4621 (sc_obsolete_symbols): Check for O_NDELAY.
4622 (sc_dd_max_sym_length): Track coreutils.
4623 (sc_unmarked_diagnostics): Look in all files, not just *.c.
4624 (sc_useless_cpp_parens): New rule.
4625 (news-date-check): Look for version or today's date.
4626 (changelog-check): Don't require version number near head.
4627 (copyright-check): Use current year instead of hardwiring 2005.
4628 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
4629 (announcement): Add --gpg-key-ID.
4630
4631 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
4632 with "file system".
4633
4634 Avoid undefined behavior that addressed just before the start of an
4635 array. Problem reported by twlevo.
4636 * src/reader.c (packgram): Prepend a new sentinel before ritem.
4637 * src/lalr.c (build_relations): Rely on new sentinel.
4638 * src/gram.c (gram_free): Adjust to new sentinel.
4639
46402006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
4641
4642 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
4643 yylookaheadNeeds. All uses updated.
4644 (yysplitStack): Rename local yynewLookaheadStatuses to
4645 yynewLookaheadNeeds.
4646 * data/glr-regression.at (Incorrect lookahead during nondeterministic
4647 GLR): In comments, change `lookahead status' to `lookahead need'.
4648
46492006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4650
4651 * data/glr.c (yysplitStack): A little stylistic rewrite.
4652
46532006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4654
4655 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
4656
46572006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
4658
4659 * doc/bison.texinfo: Fix some typos.
4660 (GLR Semantic Actions): New subsection discussing special
4661 considerations because GLR semantic actions might be deferred.
4662 (Actions): Mention look-ahead usage of yylval.
4663 (Actions and Locations): Mention look-ahead usage of yylloc.
4664 (Special Features for Use in Actions): Add YYEOF entry and mention it
4665 in the yychar entry.
4666 In the yychar entry, remove mention of the local yychar case (pure
4667 parser) since this is irrelevant information when writing semantic
4668 actions and since it's already discussed in `Table of Symbols' where
4669 yychar is otherwise described as an external variable.
4670 In the yychar entry, don't call it the `current' look-ahead since it
4671 isn't when semantic actions are deferred.
4672 In the yychar and yyclearin entries, add note about deferred semantic
4673 actions.
4674 Add yylloc and yylval entries discussing look-ahead usage.
4675 (Look-Ahead Tokens): When discussing yychar, don't call it the
4676 `current' look-ahead, and do mention yylval and yylloc.
4677 (Error Recovery): Cross-reference `Action Features' when mentioning
4678 yyclearin.
4679 (Table of Symbols): In the yychar entry, don't call it the `current'
4680 look-ahead.
4681 In the yylloc and yylval entries, mention look-ahead usage.
4682
46832006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4684
4685 * tests/glr-regression.at: Update copyright year to 2006.
4686
46872006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4688
4689 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
4690 use during nondeterministic operation to track which stacks have
4691 actually needed the current lookahead.
4692 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
4693 Allocate, deallocate, resize, and otherwise shuffle space for
4694 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
4695 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
4696 appropriately during nondeterministic operation.
4697 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
4698 members to store the current lookahead to be used by the deferred
4699 user action.
4700 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
4701 from which the RHS is taken. Set the lookahead members of the new
4702 yySemanticOption according to the lookahead status for stack yyk.
4703 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
4704 yyaddDeferredAction.
4705 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
4706 members of yySemanticOption before invoking yyuserAction, and then set
4707 them back to their current values afterward.
4708 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
4709 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
4710 * tests/glr-regression.at: Remove `.' from the ends of recent test case
4711 titles for consistency.
4712 (Leaked merged semantic value if user action cuts parse): In order to
4713 suppress lint warnings, use arguments in merge function, and assign
4714 char value < 128 in main.
4715 (Incorrect lookahead during deterministic GLR): New test case.
4716 (Incorrect lookahead during nondeterministic GLR): New test case.
4717
47182006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4719
4720 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
4721 !yyvaluep as signal that no semantic value is available to print.
4722 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
4723 to print a semantic value.
4724
47252006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4726
4727 * tests/glr-regression.at: For consistency with my newer test cases,
4728 don't thank myself.
4729
47302006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4731
4732 * data/glr.c (yyresolveValue): When merging semantic options, if at
4733 least one user action succeeds but a later one cuts the parse, then
4734 destroy the semantic value before returning rather than leaking it.
4735 (yyresolveStates): If a user action cuts the parse and thus
4736 yyresolveValue fails, ignore the (unset) semantic value rather than
4737 corrupting the yyGLRState, and empty the semantic options list since
4738 the user actions should have called all necessary destructors.
4739 Simplify code with YYCHK.
4740 * tests/glr-regression.at (Corrupted semantic options if user action
4741 cuts parse): New test case.
4742 (Undesirable destructors if user action cuts parse): New test case.
4743 Before applying any of this patch, this test case never actually failed
4744 for me... but only because the corrupted semantic options usually
4745 masked this bug.
4746 (Leaked merged semantic value if user action cuts parse): New test
4747 case.
4748
47492006-01-05 Akim Demaille <akim@epita.fr>
4750
4751 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
4752
47532006-01-04 Paul Eggert <eggert@cs.ucla.edu>
4754
4755 * data/c.m4 (b4_c_modern): New macro, with a new provision for
4756 _MSC_VER. Problem reported by Cenzato Marco.
4757 (b4_c_function_def): Use it.
4758 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
4759 b4_c_modern.
4760 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
4761 than rolling our own.
4762
47632006-01-04 Akim Demaille <akim@epita.fr>
4764
4765 Also warn about non-used mid-rule values.
4766 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
4767 member.
4768 (symbol_list_new): Adjust.
4769 * src/reader.c (symbol_typed_p): New.
4770 (grammar_rule_check): Use it.
4771 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
4772 Check its rule.
4773 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
4774 Use it.
4775 * tests/actions.at (Exotic Dollars): Adjust.
4776
47772006-01-04 Akim Demaille <akim@epita.fr>
4778
4779 * src/reader.c (grammar_midrule_action): If $$ is set in a
4780 mid-rule, move the `used' bit to its lhs.
4781 * tests/input.at (Unused values): New.
4782 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
4783
47842006-01-03 Paul Eggert <eggert@cs.ucla.edu>
4785
4786 * doc/bison.texinfo (Bison Options): Say more accurately what
4787 --yacc does.
4788 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
4789 about declarations in the grammar when in Yacc mode, as POSIX does
4790 not require a diagnostic when the grammar uses extensions.
4791
4792 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
4793
4794 Warn about dubious constructions like "%token T T".
4795 Reported by twlevo.
4796 * src/symtab.h (struct symbol.declared): New member.
4797 * src/symtab.c (symbol_new): Initialize it to false.
4798 (symbol_class_set): New arg DECLARING, specifying whether
4799 this is a declaration that we want to warn about, if there
4800 is more than one of them. All uses changed.
4801
4802 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
4803 Allow multiple %union directives, whose contents concatenate.
4804 * src/parse-gram.y (grammar_declaration): Likewise.
4805 Use muscle_code_grow, so that we don't need stype_line any more.
4806 All uses changed.
4807
4808 * src/muscle_tab.c (muscle_grow): Fix comment.
4809
4810 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
4811 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
4812 Update copyright year to 2006.
4813
48142006-01-03 Akim Demaille <akim@epita.fr>
4815
4816 Have glr.cc pass (some of) the calc.at tests.
4817 * data/glr.cc (b4_parse_param_orig): New.
4818 (b4_parse_param): Improve its definition, and bound it more
4819 clearly in the skeleton.
4820 (b4_epilogue): Append, instead of prepending, in order to keep
4821 #line consistency.
4822 Simplify the generation of auxiliary functions: locations and
4823 purity are mandated.
4824 (b4_global_tokens_and_yystype): Honor it.
4825 * data/location.cc (c++.m4): Don't include it.
4826 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
4827 and AT_SKEL_CC_IF.
4828 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
4829 AT_LALR1_CC_IF.
4830 Be sure to initialize the first position's filename.
4831 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
4832 mandated anyway.
4833 (AT_CHECK_CALC_GLR_CC): New.
4834 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
4835
48362006-01-02 Akim Demaille <akim@epita.fr>
4837
4838 * src/output.c (output_skeleton): Don't hard wire the inclusion of
4839 c.m4.
4840 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
4841 * data/glr.cc: Do not include stack.hh.
4842
48432006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4844
4845 * data/glr.c: Reformat whitespace with tabs.
4846 (b4_lpure_formals): Remove this unused m4 macro.
4847 * tests/cxx-type.at: Reformat whitespace with tabs.
4848 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
4849 since it's a member. Rename type to isNterm for clarity.
4850
48512005-12-29 Akim <akim@sulaco.local>
4852
4853 Let glr.cc catch up with symbol_value_print.
4854 * data/glr.cc (b4_yysymprint_generate): Replace by...
4855 (b4_yy_symbol_print_generate): this.
4856 (yy_symbol_print, yy_symbol_value_print): Declare them.
4857
48582005-12-28 Paul Eggert <eggert@cs.ucla.edu>
4859
4860 * src/location.h (boundary): Note that a line or column equal
4861 to INT_MAX indicates an overflow.
4862 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
4863 (rule_length_overflow, increment_rule_length, add_column_width):
4864 New functions.
4865 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
4866 (<SC_BRACED_CODE>"}"):
4867 Use increment_rule_length rather than incrementing it by hand.
4868 (adjust_location, handle_syncline): Diagnose overflow.
4869 (handle_action_dollar, handle_action_at):
4870 Fix bug with monstrosities like $-2147483648.
4871 Remove now-unnecessary checks.
4872 (scan_integer): Verify assumptions and remove now-unnecessary checks.
4873 (convert_ucn_to_byte): Verify assumptions.
4874 (handle_syncline): New arg LOC. All callers changed.
4875 Don't store through a value derived from char const * pointer.
4876
4877 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
4878 GCC warnings.
4879
48802005-12-27 Paul Eggert <eggert@cs.ucla.edu>
4881
4882 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
4883 Remove unnecessary forward static decls.
4884
48852005-12-27 Akim Demaille <akim@epita.fr>
4886
4887 * src/reader.c (grammar_current_rule_check): Also check that $$
4888 is used.
4889 Take the rule to check as argument, hence rename as...
4890 (grammar_rule_check): this.
4891 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
4892 Rename as...
4893 (grammar_rule_begin, grammar_rule_end): these, for consistency.
4894 (grammar_midrule_action, grammar_symbol_append): Now static.
4895 * tests/torture.at (input): Don't rely on the default action
4896 being always performed.
4897 * tests/calc.at: "Set" $$ even when the action is "cut" with
4898 YYERROR or other.
4899 * tests/actions.at (Exotic Dollars): Instead of using unused
4900 values, check that the warning is issued.
4901
49022005-12-22 Paul Eggert <eggert@cs.ucla.edu>
4903
4904 * NEWS: Improve wording for unused-value warnings.
4905
49062005-12-22 Akim Demaille <akim@epita.fr>
4907
4908 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
4909 (b4_yysymprint_generate): Rename as...
4910 (b4_yy_symbol_print_generate): this.
4911 Generate yy_symbol_print instead of yysymprint.
4912 Generate also yy_symbol_value_print, and use it.
4913
49142005-12-22 Akim Demaille <akim@epita.fr>
4915
4916 * NEWS: Warn about unused values.
4917 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
4918 a `used' member.
4919 (symbol_list_n_get, symbol_list_n_used_set): New.
4920 (symbol_list_n_type_name_get): Use symbol_list_n_get.
4921 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
4922 * src/reader.c (grammar_current_rule_check): Check that values are
4923 used.
4924 * src/symtab.c (symbol_print): Accept 0.
4925 * tests/existing.at: Remove the type information.
4926 Empty the actions.
4927 Remove useless actions (beware of mid-rule actions: perl -000
4928 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
4929 * tests/actions.at (Exotic Dollars): Use unused values.
4930 * tests/calc.at: Likewise.
4931 * tests/glr-regression.at (No users destructors if stack 0 deleted):
4932 Likewise.
4933
4934 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
4935 rule_useful_p.
4936
49372005-12-21 Paul Eggert <eggert@cs.ucla.edu>
4938
4939 Undo 2005-12-01 tentative license wording change. The wording is
4940 still being reviewed by the lawyers, and we don't want to wait for
4941 them before publishing a test release. For now, revert to the
4942 previous wording.
4943 * NEWS: Undo 2005-12-01 change.
4944 * data/glr.c: Revert to previous license wording.
4945 * data/glr.cc: Likewise.
4946 * data/lalr1.cc: Likewise.
4947 * data/location.cc: Likewise.
4948 * data/yacc.c: Likewise.
4949
4950 * NEWS: Reword %destructor vs YYABORT etc.
4951 * data/glr.c: Use American spacing, for consistency.
4952 * data/glr.cc: Likewise.
4953 * data/lalr1.cc: Likewise.
4954 * data/yacc.c: Likewise.
4955 * data/yacc.c: Reformat comments slightly.
4956 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
4957 for consistency. Fix some spelling errors and reword recently-included
4958 text slightly.
4959 * tests/cxx-type.at: Cast results of malloc, for C++.
4960
49612005-12-21 Joel E. Denny <address@hidden>
4962
4963 * tests/cxx-type.at: Construct a tree, count the parents of shared
4964 nodes, and free each node once and only once. Previously, the memory
4965 for semantic values was leaked instead.
4966
49672005-12-21 Joel E. Denny <address@hidden>
4968
4969 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
4970 (yylval, yylloc): If pure, #define to yystackp->yyval and
4971 yystackp->yyloc similar to yychar and yynerrs.
4972 (yyparse): If pure, remove local yylval and yylloc. Add local
4973 yystackp to accommodate pure definitions of yylval and yylloc.
4974 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
4975 yylvalp and yyllocp to &yylval and &yylloc.
4976 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
4977 namespace. Previously, nerrs and char were missing, but lval and lloc
4978 weren't necessary.
4979 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
4980 yylvalp and yyllocp parameters since, if pure, these are now always
4981 accessible through yystackp. If not pure, they are still accessible
4982 globally.
4983 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
4984 `if (YYID (N))' to pacify lint.
4985
49862005-12-21 Akim Demaille <akim@epita.fr>
4987
4988 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
4989 destroy the RHS symbols of a rule.
4990 * data/yacc.c (yylen): Initialize to 0.
4991 Keep its value to the number of items to possibly shift.
4992 In particular, a regular successful parse that ends on YYFINAL by
4993 a (internal) YYACCEPT must not have yylen != 0.
4994 (yyerrorlab, yyreturn): Pop the RHS.
4995 Reorder a bit to emphasize the `shifting' bits of code.
4996 (YYPOPSTACK): Now accept a number of items to pop.
4997 * data/lalr1.cc: Likewise.
4998 * data/glr.c: Formatting changes.
4999 Use goto instead of fall through.
5000 * doc/bison.texinfo (Destructor Decl): Complete.
5001
50022005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5003
5004 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5005 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
5006 * djgpp/config.bat: Replace every occurence of the file name
5007 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5008 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5009 * djgpp/config.sed: Replace every occurence of the file name
5010 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5011 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5012 * djgpp/djunpack.bat: DJGPP specific file.
5013 * djgpp/fnchange.lst: DJGPP specific file.
5014 * djgpp/README.in: Add new information about how to unpack the bison
5015 source on MSDOS and other systems which have 8.3 file name restrictions
5016 using djunpack.bat and fnchange.lst.
5017
50182005-12-12 Paul Eggert <eggert@cs.ucla.edu>
5019
5020 * bootstrap (build_cvs_prefix): Remove; unused.
5021 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
5022 when getting gnulib.
5023
50242005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
5025
5026 * data/glr.c: Reorder typedef declarations for structs to match order
5027 of struct declarations.
5028 Rename yystack everywhere to yystackp except in yyparse where it's not
5029 a pointer.
5030 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
5031 consistency.
5032 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
5033 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
5034 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
5035 lint.
5036
50372005-12-09 Paul Eggert <eggert@cs.ucla.edu>
5038
5039 * tests/sets.at (Accept): Fix typos in regular expression used to
5040 sed out the final state number.
5041
5042 Work around portability problem on Solaris 10: flex-generated
5043 files include <stdio.h> before <config.h>, which messes up
5044 because the latter defines __EXTENSIONS__. Address the problem
5045 by creating two new little files that include <config.h> first,
5046 then include the flex-generated files. Rewrite everyone else
5047 to include <config.h> first, as well.
5048 * lib/timevar.c: Always include "config.h".
5049 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
5050 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
5051 (EXTRA_bison_SOURCES): New macro.
5052 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
5053 * src/system.h: Don't include config.h.
5054 * src/LR0.c: Include <config.h> first.
5055 * src/assoc.c: Likewise.
5056 * src/closure.c: Likewise.
5057 * src/complain.c: Likewise.
5058 * src/conflicts.c: Likewise.
5059 * src/derives.c: Likewise.
5060 * src/files.c: Likewise.
5061 * src/getargs.c: Likewise.
5062 * src/gram.c: Likewise.
5063 * src/lalr.c: Likewise.
5064 * src/location.c: Likewise.
5065 * src/main.c: Likewise.
5066 * src/muscle_tab.c: Likewise.
5067 * src/nullable.c: Likewise.
5068 * src/output.c: Likewise.
5069 * src/parse-gram.y: Likewise.
5070 * src/print.c: Likewise.
5071 * src/print_graph.c: Likewise.
5072 * src/reader.c: Likewise.
5073 * src/reduce.c: Likewise.
5074 * src/relation.c: Likewise.
5075 * src/state.c: Likewise.
5076 * src/symlist.c: Likewise.
5077 * src/symtab.c: Likewise.
5078 * src/tables.c: Likewise.
5079 * src/uniqstr.c: Likewise.
5080 * src/vcg.c: Likewise.
5081
5082 * src/parse-gram.y: Fix minor problems uncovered by lint.
5083 (current_lhs, current_lhs_location): Now static.
5084 (current_assoc): Remove unused variable.
5085
5086 Cleanups so that Bison-generated parsers have less lint.
5087 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
5088 Prepend /*ARGSUSED*/, for lint's sake.
5089 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
5090 definition if 'lint' is defined.
5091 (YYID): New macro (or function, if lint).
5092 All uses of /*CONSTCOND*/0 replaced by YYID(0).
5093 * data/yacc.c: Likewise.
5094 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
5095 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
5096 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
5097 is C++ only.
5098 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
5099 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
5100 Use YYID(0) rather than 0, for lint.
5101 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
5102 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
5103
51042005-12-07 Paul Eggert <eggert@cs.ucla.edu>
5105
5106 * tests/glr-regression.at
5107 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5108 Close memory leak reported by twlevo.
5109
51102005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
5111
5112 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
5113 all stacks.
5114 (yyparse): Iterate another stack in order to call user destructors.
5115 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5116 New test case.
5117 (Duplicated user destructor for lookahead): This test now is expected
5118 to succeed.
5119
51202005-12-01 Paul Eggert <eggert@cs.ucla.edu>
5121
5122 * NEWS: Document the following change.
5123 * data/yacc.c: Say "parser skeleton" rather than "file", since
5124 it's no longer just a file.
5125 * data/glr.c: Grant a special exception for C GLR parsers, that
5126 reads like the already-existing exception for C LALR(1) parsers.
5127 * data/glr.cc: Likewise.
5128 * data/lalr1.cc: Likewise.
5129 * data/location.cc: Likewise.
5130 * data/yacc.c: Reword the "written by" statement to clarify that
5131 it was the parser skeleton, not the entire output file.
5132 * data/glr.c: Written by Paul Hilfinger.
5133 * data/glr.cc: Written by Akim Demaille.
5134 * data/lalr1.cc: Likewise.
5135
51362005-11-18 Paul Eggert <eggert@cs.ucla.edu>
5137
5138 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
5139 Fix typos in previous change that broke 'make check'.
5140 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
5141 supported in C.
5142 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
5143 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
5144 We can revert this once things settle down.
5145
5146 * src/conflicts.c (conflicts_print): Don't print file name twice
5147 when %expect fails because there were no conflicts.
5148 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
5149 change.
5150 * tests/conflicts.at (%expect not enough, %expect too much):
5151 (%expect with reduce conflicts): Adjust to new behavior.
5152
51532005-11-18 Akim Demaille <akim@epita.fr>
5154
5155 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
5156 errors.
5157 * NEWS: Document this.
5158 * doc/bison.texinfo (Expect Decl): Likewise.
5159
51602005-11-16 Akim Demaille <akim@epita.fr>
5161
5162 Generalize the display of semantic values and locations in traces.
5163 * data/glr.c (yy_reduce_print): Fix indices (again).
5164 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
5165 literal integers.
5166 * data/lalr1.cc (yyreduce_print): Rename as...
5167 (yy_reduce_print): this.
5168 Display values and locations.
5169 * data/yacc.c (yy_reduce_print): Likewise.
5170 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
5171 (yysymprint): Move higher to be visible from yy_reduce_print).
5172 (yyparse): Adjust.
5173 * tests/calc.at: Adjust the expected length of the traces.
5174
51752005-11-14 Akim Demaille <akim@epita.fr>
5176
5177 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
5178 from 1 to N, while values and location start at 0.
5179 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
5180
51812005-11-14 Akim Demaille <akim@epita.fr>
5182
5183 * data/glr.c (yy_reduce_print): Fix the $ number.
5184
51852005-11-14 Akim Demaille <akim@epita.fr>
5186
5187 "Use" parse parameters.
5188 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
5189 * data/glr.c, data/glr.cc: Use them.
5190 * data/glr.c (YYUSE): Have a C++ definition that supports
5191 non-pointer types.
5192
51932005-11-14 Akim Demaille <akim@epita.fr>
5194
5195 * data/glr.c (yyexpandGLRStack): Declare only if defined.
5196
51972005-11-14 Akim Demaille <akim@epita.fr>
5198
5199 * data/glr.cc: New.
5200 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5201
52022005-11-12 Akim Demaille <akim@epita.fr>
5203
5204 Let position and location be PODs.
5205 * data/location.cc (position::initialize, location::initialize): New.
5206 (position::position, location::location): Define only if
5207 b4_location_constructors is defined.
5208 * data/lalr1.cc (b4_location_constructors): Define it for backward
5209 compatibility.
5210 * doc/bison.texinfo (Initial Action Decl): Use initialize.
5211
52122005-11-12 Akim Demaille <akim@epita.fr>
5213
5214 * data/lalr1.cc: Move the body of the ctor and dtor into the
5215 parser file (instead of the header).
5216 Wrap the implementations in a "namespace yy".
5217
52182005-11-12 Akim Demaille <akim@epita.fr>
5219
5220 Have glr.c include its header file when created.
5221 * data/glr.c (b4_shared_declarations): New.
5222 Output them verbatim in the parser if !%defines, otherwise
5223 output then in the header file, and include it instead.
5224
52252005-11-11 Akim Demaille <akim@epita.fr>
5226
5227 * data/glr.c: Comment changes.
5228
52292005-11-11 Akim Demaille <akim@epita.fr>
5230
5231 When yydebug, report semantic and location values for reductions.
5232 * data/glr.c (yy_reduce_print): Report the semantic values and the
5233 locations.
5234 (YY_REDUCE_PRINT): Adjust.
5235 (yyglrReduce): Use them.
5236 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
5237 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
5238 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
5239 traces.
5240
52412005-11-10 Akim Demaille <akim@epita.fr>
5242
5243 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
5244 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
5245 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
5246
52472005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
5248
5249 * m4/cxx.m4, examples/Makefile.am: Don't build
5250 examples/calc++ if no C++ compiler is available. (trivial change)
5251
52522005-11-09 Akim Demaille <akim@epita.fr>
5253
5254 * src/scan-skel.l: Use a couple of asserts.
5255
52562005-11-03 Akim Demaille <akim@epita.fr>
5257
5258 In some (weird) cases, the final state number is incorrect.
5259 Reported by Alexandre Duret-Lutz.
5260 * src/LR0.c (state_list_append): Remove the computation of
5261 final_state.
5262 (save_reductions): Do it here.
5263 (get_state): Alpha conversion.
5264 (generate_states): Use a for loop.
5265 * src/gram.h (item_number_is_rule_number)
5266 (item_number_is_symbol_number): New.
5267 * src/state.c: Use assert.
5268 * src/system.h: Include assert.h.
5269 * tests/sets.at (Accept): New.
5270
52712005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5272
5273 * data/glr.c (yyfill): Adjust comment.
5274 (yyresolveAction): Initialize default location properly
5275 for empty right-hand sides.
5276 (yydoAction): Ditto.
5277 Add comment explaining apparently dead code.
5278 * tests/glr-regression.at
5279 (Incorrectly initialized location for empty right-hand side in GLR):
5280 New test.
5281
52822005-10-30 Paul Eggert <eggert@cs.ucla.edu>
5283
5284 * bootstrap (cleanup_gnulib): New function. Use it to clean up
5285 gnulib when interrupted. This fixes some race conditions and
5286 works around some portability problems (one noted by Paul
5287 Hilfinger).
5288
52892005-10-22 Akim <akim@epita.fr>
5290
5291 * Makefile.cfg: Adjust to config -> build-aux.
5292 Reported by twledo.
5293
52942005-10-21 Akim Demaille <akim@epita.fr>
5295
5296 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
5297 the %parse-params.
5298 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
5299 * data/yacc.c (b4_Pure_if): Rename as...
5300 (b4_yacc_pure_if): this.
5301 (YY_SYMBOL_PRINT, yyparse): Adjust.
5302 * doc/bison.texinfo: Formatting changes.
5303
53042005-10-21 Akim Demaille <akim@epita.fr>
5305
5306 Finish the transition config -> build-aux.
5307 * configure.ac, Makefile.am: Use build-aux.
5308 * config/prev-version, config/announce-gen, config/Makefile.am:
5309 Move to...
5310 * build-aux/prev-version, build-aux/announce-gen,
5311 * build-aux/Makefile.am: here.
5312
53132005-10-14 Akim Demaille <akim@epita.fr>
5314
5315 * examples/calc++/test: Use set -x only when VERBOSE.
5316
53172005-10-13 Paul Eggert <eggert@cs.ucla.edu>
5318
5319 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
5320 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
5321
53222005-10-13 Akim Demaille <akim@epita.fr>
5323
5324 * src/scan-skel.l: Output the base name parts of the parser and
5325 header file names.
5326 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
5327 additional checks.
5328 Use this to exercise C++ outputs in subdirs.
5329 Reported by Oleg Smolsky.
5330
53312005-10-12 Paul Eggert <eggert@cs.ucla.edu>
5332
5333 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
5334 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
5335 Problem reported by John P. Hartmann.
5336 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
5337 already defined it.
5338
53392005-10-12 Akim Demaille <akim@epita.fr>
5340
5341 * src/parse-gram.y (version_check): Exit 63 to please missing
5342 (stands for "version mismatch).
5343 * tests/input.at, doc/bison.texinfo: Adjust.
5344
53452005-10-10 Paul Eggert <eggert@cs.ucla.edu>
5346
5347 Work around portability problems with Visual Age C compiler
5348 (xlc and xlC_r) reported by John P. Hartmann.
5349 * data/location.cc (initial_column, initial_line): Remove.
5350 All uses replaced by 0 and 1.
5351 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
5352 that xlc complains about.
5353 * src/scan-skel.l (skel_wrap): Likewise.
5354 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
5355 as __STDC__.
5356 * data/yacc.c (YYMODERN_C): New macro, which also looks at
5357 __STDC_VERSION__. Use it everywhere instead of looking at
5358 __STDC__ and __cplusplus.
5359
53602005-10-10 Akim Demaille <akim@epita.fr>
5361
5362 * examples/calc++/test: Be quiet unless VERBOSE.
5363
53642005-10-05 Paul Eggert <eggert@cs.ucla.edu>
5365
5366 * data/c.m4 (yydestruct, yysymprint):
5367 Use YYUSE instead of casting to void.
5368 * data/glr.c (YYUSE): New macro.
5369 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5370 Use it instead of rolling our own.
5371 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5372 (YYCHK1):
5373 Use /*CONSTCOND*/ to suppress lint warnings.
5374 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5375 (YY_STACK_PRINT): Use 'false' not '0'.
5376 (YYUSE): New macro.
5377 (yysymprint_, yydestruct_): Use it instead of rolling our own.
5378 * data/yacc.c (YYUSE): New macro.
5379 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
5380 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
5381 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
5382
5383
5384 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
5385 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
5386
53872005-10-04 Paul Eggert <eggert@cs.ucla.edu>
5388
5389 Undo the parts of the unlocked-I/O change that substituted
5390 putc or puts for printf. This might hurt performance a bit,
5391 but some people prefer the printf style.
5392 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
5393 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
5394 All uses replaced by YYFPRINTF and YYDPRINTF.
5395 * data/yacc.c: Likewise.
5396 * lib/bitset.c (bitset_print): Likewise.
5397 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
5398 putc and puts.
5399 * lib/lbitset.c (debug_lbitset): Likewise.
5400 * src/closure.c (print_firsts, print_fderives): Likewise.
5401 * src/gram.c (grammar_dump): Likewise.
5402 * src/lalr.c (look_ahead_tokens_print): Likewise.
5403 * src/output.c (escaped_output): Likewise.
5404 (user_actions_output): Break apart two printfs.
5405 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
5406 * src/reduce.c (reduce_print): Likewise.
5407 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
5408 * src/system.h: Include unlocked-io.h rathe than stdio.h.
5409
5410 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5411 Use assignments rather than casts-to-void to suppress
5412 unused-variable warnings. This pacifies 'lint'.
5413 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
5414 unused-variable warnings.
5415
54162005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5417
5418 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5419
54202005-10-02 Paul Eggert <eggert@cs.ucla.edu>
5421
5422 Use unlocked I/O for a minor performance improvement on hosts like
5423 GNU/Linux and Solaris that support unlocked I/O. The basic idea
5424 is to use the gnlib unlocked-io module, and to prefer putc and
5425 puts to printf when either will work (since the latter doesn't
5426 come in an unlocked flavor).
5427 * bootstrap (gnulib_modules): Add unlocked-io.
5428 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
5429 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
5430 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
5431 and similarly for puts and putc and printf.
5432 * data/yacc.c: Likewise.
5433 * lib/bitset.c (bitset_print): Likewise.
5434 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
5435 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
5436 to printf.
5437 * lib/lbitset.c (debug_lbitset): Likewise.
5438 * src/closure.c (print_firsts, print_fderives): Likewise.
5439 * src/gram.c (grammar_dump): Likewise.
5440 * src/lalr.c (look_ahead_tokens_print): Likewise.
5441 * src/output.c (escaped_output): Likewise.
5442 (user_actions_output): Coalesce two printfs.
5443 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
5444 * src/reduce.c (reduce_print): Likewise.
5445 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
5446 * src/system.h: Include unlocked-io.h rather than stdio.h.
5447
5448 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
5449 this confuses xgettext.
5450
54512005-10-02 Akim Demaille <akim@epita.fr>
5452
5453 * bootstrap (gnulib_modules): Add strverscmp.
5454 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
5455 * m4/.cvsignore: Add strverscmp.m4.
5456 * src/parse-gram.y (%require): New token, new rule.
5457 (version_check): New.
5458 * src/scan-gram.l (%require): Adjust.
5459 * tests/input.at (AT_REQUIRE): New.
5460 Use it.
5461 * doc/bison.texinfo (Require Decl): New.
5462 (Calc++ Parser): Use %require.
5463
54642005-10-02 Akim Demaille <akim@epita.fr>
5465
5466 * data/location.cc: New.
5467
54682005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
5469 Akim Demaille <akim@epita.fr>
5470
5471 Make sure -odir/foo.cc creates dir/location.hh etc.
5472 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
5473 (spec_file_prefix, spec_verbose_file, spec_graph_file)
5474 (spec_defines_file): Now const.
5475 (dir_prefix): New.
5476 (short_base_name): Remove.
5477 * src/files.c: Adjust.
5478 (dirname.h): Include.
5479 (base_name): Don't prototype it.
5480 (finput): Remove, duplicates gram_in.
5481 (full_base_name, short_base_name): Replace by...
5482 (all_but_ext, all_but_tab_ext): these.
5483 (compute_base_names): Rename as...
5484 (compute_file_name_parts): this.
5485 Update to compute the new variables, including dir_prefix.
5486 Adjust dependencies.
5487 * src/output.c (prepare): Output them.
5488 * src/reader.c: Adjust to use gram_in, not finput.
5489 * src/scan-skel.l (@dir_prefix@): New.
5490
54912005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5492
5493 * lib/subpipe.c: New function end_of_output_subpipe() added
5494 to allow support for non-posix systems. This is a no-op function
5495 for posix systems.
5496
5497 * lib/subpipe.h: New function end_of_output_subpipe() added
5498 to allow support for non-posix systems. This is a no-op function
5499 for posix systems.
5500
5501 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
5502 handle the lack of pipe/fork functionality on non-posix systems.
5503
5504 * djgpp/Makefile.maint: DJGPP specific file.
5505
5506 * djgpp/README.in: DJGPP specific file.
5507
5508 * djgpp/config.bat: DJGPP specific configuration file.
5509
5510 * djgpp/config.sed: DJGPP specific configuration file.
5511
5512 * djgpp/config.site: DJGPP specific configuration file.
5513
5514 * djgpp/config_h.sed: DJGPP specific configuration file.
5515
5516 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
5517
5518 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
5519
55202005-10-02 Akim Demaille <akim@epita.fr>
5521
5522 * data/location.cc: New, extract from...
5523 * data/lalr1.cc: here.
5524 (location.hh): Include it after the user prologue, in case the
5525 filename type is defined by the user.
5526 Forward declation location and position before the pre-prologue.
5527 (yyresult_): Rename as...
5528 (yyresult): this, it's a local variable, not an attribute.
5529 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
5530
55312005-10-01 Akim Demaille <akim@epita.fr>
5532
5533 * examples/extexi: Restore the #line generation.
5534
55352005-09-30 Akim Demaille <akim@epita.fr>,
5536 Alexandre Duret-Lutz <adl@gnu.org>
5537
5538 Move the token type and YYSTYPE in the parser class.
5539 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
5540 (parser::token): New, from the moved free definition of tokens.
5541 (parser::semantic_value): Now a full definition instead of an
5542 indirection to YYSTYPE.
5543 (b4_post_prologue): No longer included in the header file, but
5544 in the implementation file.
5545 * doc/bison.texi (C+ Language Interface): Update.
5546 * src/parse-gram.y: Support unary %define.
5547 * tests/actions.at: Define global_tokens_and_yystype for backward
5548 compatibility until we update the tests.
5549 * tests/calc.at: Idem.
5550 (first_line, first_column, last_line, last_column): Define for lalr1.cc
5551 to simplify the code.
5552
55532005-09-29 Paul Eggert <eggert@cs.ucla.edu>
5554
5555 Port to SunOS 4.1.4, which lacks strtoul and strerror.
5556 Ah, the good old days! Problem reported by Peter Klein.
5557 * bootstrap (gnulib_modules): Add strerror, strtoul.
5558 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
5559 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
5560
55612005-09-29 Akim Demaille <akim@epita.fr>
5562
5563 * data/c.m4 (b4_error_verbose_if): New.
5564 * data/lalr1.cc: Use it.
5565 (YYERROR_VERBOSE_IF): Remove.
5566 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
5567 parser members, replaced by...
5568 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
5569 local variables.
5570 (yysyntax_error_): Takes the state number as argument.
5571 (yyreduce_print_): Use the argument yyrule, not the former
5572 attribute yyn_.
5573
55742005-09-26 Paul Eggert <eggert@cs.ucla.edu>
5575
5576 * bootstrap (gnulib_modules): Add verify.
5577 * lib/.cvsignore: Add verify.h.
5578 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
5579 * src/system.h (verify): Remove.
5580 Include verify.h instead.
5581 * src/tables.c (tables_generate): Use new API for 'verify'.
5582
55832005-09-21 Paul Eggert <eggert@cs.ucla.edu>
5584
5585 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
5586 local variables whose names begin with 'yy'.
5587 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
5588 Trivial changes from Joel E. Denny.
5589
5590 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
5591 it itself.
5592 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
5593 don't use alloca any more.
5594
5595 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
5596 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
5597 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
5598 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
5599 to match yacc.c, to test more hosts.
5600
56012005-09-20 Paul Eggert <eggert@cs.ucla.edu>
5602
5603 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
5604 doesn't affect behavior.
5605 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
5606 Solaris, AIX, MSC.
5607 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
5608 This works a bit better with glibc, if user code has already included
5609 stdlib.h.
5610 * doc/bison.texinfo (Bison Parser): Document that users can't
5611 arbitrarily use malloc and free for other purposes. Document
5612 that <alloca.h> and <malloc.h> might be included.
5613 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
5614 user must declare alloca.
5615
5616 * HACKING (release): Forwarn the Translation Project about
5617 stable releses.
5618
56192005-09-20 Akim Demaille <akim@epita.fr>
5620
5621 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
5622
56232005-09-19 Paul Eggert <eggert@cs.ucla.edu>
5624
5625 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
5626 (YYSTACK_ALLOC_MAXIMUM): Use it.
5627 (yysyntax_error): New function.
5628 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
5629 multiple syntax errors are reported, and alloca is being used.
5630 Instead, reallocate buffers twice as big each time, so that
5631 we waste at most half the allocated memory. Start with a small
5632 (128-byte) buffer that will suffice in most cases anyway.
5633 Use yysyntax_error to do most of the work.
5634
5635 * doc/bison.texinfo (Error Reporting, Table of Symbols):
5636 yynerrs is the number of errors reported, not the number of
5637 errors encountered.
5638
5639 * tests/glr-regression.at (Duplicated user destructor for lookahead):
5640 Mark it as expected to fail.
5641 Cast result of malloc; problem reported by twlevo@xs4all.nl.
5642 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
5643 Don't start user-code symbols with "yy", to avoid name space problems.
5644
56452005-09-19 Akim Demaille <akim@epita.fr>
5646
5647 Remove the traits, failed experiment.
5648 It never proved useful, and anyway because of the current
5649 definition, it was not possible to have several specialization of
5650 this traits, making it useless.
5651 * data/lalr1.cc (yy:traits): Remove.
5652 Inline its definitions in the parser class.
5653
56542005-09-19 Akim Demaille <akim@epita.fr>
5655
5656 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
5657 least Mac OSX with a /usr/local install of gettext.
5658
56592005-09-19 Akim Demaille <akim@epita.fr>
5660
5661 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
5662 and yytoken for similarity with the other skeletons.
5663
56642005-09-19 Akim Demaille <akim@epita.fr>
5665
5666 * NEWS, configure.ac: update version number to 2.1a.
5667
56682005-09-16 Paul Eggert <eggert@cs.ucla.edu>
5669
5670 * NEWS: Version 2.1.
5671
5672 * NEWS: Remove notice of yytname change, since it was never in an
5673 official release.
5674 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
5675 diagnostic.
5676 * src/output.c (prepare): Likewise.
5677 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
5678 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
5679 is not defined. This is an awful hack, but it's enough for now.
5680 All callers changed.
5681 * tests/glr-regression-at (make_value): Args are const pointers now,
5682 to avoid GCC warning.
5683 (Duplicated user destructor for lookahead): New test. Currently
5684 skipped. It fails on my host but I'm not sure it'll always fail.
5685
56862005-09-16 Akim Demaille <akim@epita.fr>
5687
5688 * src/symtab.h (struct symbol): Declare the printer and destructor
5689 as const, to avoid accidental calls to free.
5690 (symbol_destructor_set, symbol_printer_set): Adjust.
5691 * src/symtab.c: Adjust.
5692
56932005-09-16 Akim Demaille <akim@epita.fr>
5694
5695 * data/c.m4 (b4_token_enums): New.
5696 (b4_token_defines): Rename as...
5697 (b4_token_enums_defines): this.
5698 (b4_token_defines): New, output only the #defines.
5699 * data/yacc.c, data/glr.c: Adjust.
5700 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
5701 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
5702 as default values.
5703
57042005-09-16 Akim Demaille <akim@epita.fr>
5705
5706 * data/lalr1.cc (yylex_): Remove, inline its code.
5707 (yyreport_syntax_error_): Remove, replaced by...
5708 (yysyntax_error_): this which returns a string and leaves to the
5709 caller the call to the users' error function.
5710 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
5711 Move from members of the parser object...
5712 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
5713 to local variables of the parse function.
5714
57152005-09-16 Akim Demaille <akim@epita.fr>
5716
5717 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
5718 since it's in Bison's name space.
5719
57202005-09-15 Paul Eggert <eggert@cs.ucla.edu>
5721
5722 * data/glr.c (yyresolveValue): Add default case to pacify
5723 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
5724
5725 * NEWS: Document when yyparse started to return 2.
5726 * doc/bison.texinfo (Parser Function): Document when yyparse
5727 returns 2.
5728
5729 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
5730 (b4_filename_type): Renamed back from b4_file_name_type. All uses
5731 changed.
5732 (class position): file_name -> filename (reverting). All uses changed.
5733
57342005-09-14 Paul Eggert <eggert@cs.ucla.edu>
5735
5736 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
5737 do anything if $@ exists. This reverts part of the 2005-07-07
5738 patch.
5739
57402005-09-11 Paul Eggert <eggert@cs.ucla.edu>
5741
5742 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
5743 contains obsolete information and isn't worth distributing as a
5744 separate file anyway.
5745 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
5746 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
5747 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
5748 (yyparse): Abort if user code uses longjmp to throw an unexpected
5749 value.
5750
57512005-09-09 Paul Eggert <eggert@cs.ucla.edu>
5752
5753 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
5754 Suggested by twlevo@xs4all.nl.
5755
5756 * data/glr.c (YYCHK1): Do not assume YYE is in range.
5757 This avoids a diagnostic from gcc -Wswitch-enum.
5758 Problem reported by twlevo@xs4all.nl.
5759
5760 * doc/bison.texinfo: Don't use "filename", as per GNU coding
5761 standards. Use "file name" or "file" or "name", depending on
5762 the context.
5763 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
5764 not to hack/foo.tab.c.
5765 (Calc++ Top Level): 2nd arg of main is not const.
5766 * data/glr.c: b4_filename -> b4_file_name.
5767 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
5768 All uses changed.
5769 (class position): filename -> file_name. All uses changed.
5770 * data/yacc.c: b4_filename -> b4_file_name.
5771 * lib/bitset.h: filename -> file_name in local vars.
5772 * lib/bitset_stats.c: Likewise.
5773 * src/files.c: Likewise.
5774 * src/scan-skel.l ("@output ".*\n): Likewise.
5775 * src/files.c (file_name_split): Renamed from filename_split.
5776 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
5777
57782005-09-08 Paul Eggert <eggert@cs.ucla.edu>
5779
5780 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
5781 to accommodate latest gnulib.
5782
5783 * tests/glr-regression.at (Duplicate representation of merged trees):
5784 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
5785
5786 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
5787 needed.
5788
57892005-08-26 Paul Eggert <eggert@cs.ucla.edu>
5790
5791 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
5792 All uses changed. Invoke user destructor after an error during a
5793 split parse (trivial change from Joel E. Denny).
5794
5795 * tests/glr-regression.at
5796 (User destructor after an error during a split parse): New test case.
5797 Problem reported by Joel E. Denny in:
5798 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
5799
58002005-08-25 Paul Eggert <eggert@cs.ucla.edu>
5801
5802 * README-cvs: Give URLs for recommended tools.
5803 Mention Gzip version problem, and bootstrapping issues.
5804 Remove troubleshooting section, as it's somewhat obsolete.
5805
5806 * bootstrap (no_cache): New var, to accommodate different wget
5807 variants. Use it instead of '-C off'. Problem reported by
5808 twlevo@xs4all.nl.
5809
5810 * data/glr.c (yydestroyStackItem): New function.
5811 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
5812 debugging information. Problem reported by Joel E. Denny.
5813
58142005-08-25 Akim Demaille <akim@epita.fr>
5815
5816 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
5817
58182005-08-24 Paul Eggert <eggert@cs.ucla.edu>
5819
5820 * data/glr.c (yyrecoverSyntaxError, yyreturn):
5821 Don't invoke destructor on unresolved entries.
5822 * tests/glr-regression.at
5823 (User destructor for unresolved GLR semantic value): New test case.
5824 Problem reported by Joel E. Denny in:
5825 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
5826
58272005-08-21 Paul Eggert <eggert@cs.ucla.edu>
5828
5829 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
5830 Add strnlen.c.
5831 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
5832 lib-prefix.m4, po.m4.
5833
5834 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
5835 in yydestruct diagnostic, since it might not be an error.
5836 Problem reported by Joel Denny near end of
5837 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
5838 * data/lalr1.cc (yyerturn): Likewise.
5839 * data/yacc.c (yyreturn): Likewise.
5840 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
5841
5842 * src/files.c: Remove obsolete FIXME comment.
5843
5844 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
5845 with the other templates, and to fix bogus run-on messages such
5846 as the one reported at the end of
5847 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
5848 All callers changed to avoid the newline.
5849 (yyprocessOneStack): Output two lines rather than one, to accommodate
5850 the above change. This changes the debug output format slightly.
5851
5852 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
5853 reported by Joel E. Denny in
5854 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
5855 (trivial change).
5856 * tests/glr-regression.at (Duplicate representation of merged trees):
5857 New test, from Joel E. Denny in:
5858 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
5859 * THANKS: Add Joel E. Denny.
5860
5861 * configure.ac (AC_INIT): Bump to 2.0c.
5862
58632005-07-24 Paul Eggert <eggert@cs.ucla.edu>
5864
5865 * NEWS: Version 2.0b.
5866
5867 * Makefile.am (SUBDIRS): Put examples before tests, so that
5868 "make check" doesn't finish with "All 1 tests passed".
5869
5870 * tests/regression.at (Token definitions): Don't rely on
5871 AT_PARSER_CHECK for data that contains backslashes. It currently
5872 uses 'echo', and 'echo' isn't portable if its argument contains
5873 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
5874 that the byte '\0xff' is not printable in the C locale; it is,
5875 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
5876 not printable, so use '\0x81' to test.
5877
5878 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
5879 version of GCC, since the macro is used with non-GCC compilers.
5880
5881 Fix core dump reported by Pablo De Napoli in
5882 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
5883 * tests/regression.at (Invalid inputs with {}): New test.
5884 * src/parse-gram.y (token_name): Translate type before using
5885 it as an index.
5886
5887 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
5888 the user's name space. All uses changed to __attribute__
5889 ((__unused__)).
5890 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
5891 Add __attribute__ ((__noreturn__)).
5892
5893 * etc/clcommit: Remove. We weren't using it, and it failed
5894 "make maintainer-distcheck".
5895 * Makefile.maint: Merge from coreutils.
5896 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
5897 (syntax-check-rules): Change list of rules as described below.
5898 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
5899 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
5900 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
5901 (sc_trailing_space): New rules.
5902 (sc_xalloc_h_in_src): Remove.
5903 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
5904 (sc_space_tab, sc_error_exit_success, sc_changelog):
5905 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
5906 (makefile-check, po-check, author_mark_check):
5907 (makefile_path_separator_check, copyright-check):
5908 Use grep -n, to make it easier to find violations.
5909 Use CVS_LIST and CVS_LIST_EXCEPT.
5910 (header_regexp, h_re): Remove.
5911 (dd_c): New macro.
5912 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
5913 (my-distcheck): Use more-modern GCC flags.
5914 (signatures, %.asc): Remove.
5915 (rel-files, announcement): Remove signatures.
5916 Restore old updating code, even though we don't use it, so
5917 that we're the same as coreutils.
5918 (alpha, beta, major): Depend on news-date-check.
5919 Make the upload commands.
5920
5921 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
5922 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
5923 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
5924 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
5925 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
5926 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
5927 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
5928 * tests/sets.at: Likewise.
5929
5930 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
5931 we comment out the Autoconf version number.
5932 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
5933 it's error-prone and "make maintainer-distcheck" rejects it.
5934
5935 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
5936 Indent calls to "error" to pacify "make maintainer-distcheck",
5937 when the calls are not intended to be translated.
5938 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
5939
5940 * src/Makefile.am (DEFS): Use +=, to pacify
5941 "make maintainer-distcheck".
5942 (bison_SOURCES): Add scan-skel.h.
5943 (sc_tight_scope): New rule, from coreutils.
5944
5945 * src/files.c (src_extension, header_extension):
5946 Now static, not extern.
5947 * src/getargs.c (short_options): Likewise.
5948 * src/muscle_tab.c (muscle_table): Likewise.
5949 * src/parse-gram.y (current_class, current_type, current_prec):
5950 Likewise.
5951 * src/reader.c (grammar_end, previous_rule_end): Likewise.
5952 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
5953 * src/main.c (main): Cast bindtextdomain and textdomain calls to
5954 void, to avoid warning when NLS is disabled.
5955 * src/output.c: Include scan-skel.h.
5956 (scan_skel): Remove decl, since scan-skel.h does this.
5957 (output_skeleton):
5958 Indent calls to "error" to pacify "make maintainer-distcheck".
5959 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
5960 * src/reader.h (gram_end, gram_lineno): New decls to pacify
5961 "make maintainer-distcheck".
5962 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
5963 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
5964 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
5965 (skel_lex_destroy, scan_skel): Move these decls to...
5966 * src/scan-skel.h: New file.
5967 * src/uniqstr.c (uniqstr_assert):
5968 Indent calls to "error" to pacify "make maintainer-distcheck".
5969
5970 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
5971 not @VAR@.
5972
5973 * tests/torture.at: Revamp to avoid misuse of atoi that
5974 "make maintainer-distcheck" complained about.
5975
5976 * examples/extexi (message): Don't print a message more than once,
5977 and omit line-number decoration that makes Emacs compile think
5978 that informative messages are worth worrying about.
5979
59802005-07-22 Paul Eggert <eggert@cs.ucla.edu>
5981
5982 * configure.ac: Update version number.
5983
5984 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
5985 accidentally.
5986 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
5987 autogenerated by the maintainer.
5988 * examples/calc++/.cvsignore: Add *.yy.
5989
5990 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
5991 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5992 * lib/bitsetv.c (bitsetv_alloc): Likewise.
5993
5994 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
5995
5996 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
5997 from maintainer-distcheck about casting the argument of 'free'.
5998
5999 * NEWS: Mention recent yytname changes.
6000 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
6001
6002 * bootstrap: For translations that have not yet been upgraded to
6003 the new runtime-po domain, prime the pump by extracting the
6004 relevant strings from the obsolete translations. This code can be
6005 removed once the bison-runtime domain has been translated by each
6006 team.
6007
6008 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
6009 now that token names are already quoted.
6010
6011 Fix problem reported by Anthony Heading.
6012 * data/glr.c (YYTOKEN_TABLE): New macro.
6013 (yytname): Define if YYTOKEN_TABLE.
6014 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
6015 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
6016 (YYERROR_VERBOSE): Define the same way the other skeletons do.
6017 * src/output.c (prepare_symbols): Output token_table_flag.
6018
60192005-07-21 Paul Eggert <eggert@cs.ucla.edu>
6020
6021 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
6022 again if the first call fails.
6023
6024 * data/glr.c (yytnamerr): New function.
6025 (yyreportSyntaxError): Use it to dequote most string literals.
6026 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
6027 with other skeletons. All uses changed.
6028 (yytnameerr_): New function.
6029 (yyreport_syntax_error): Use it to dequote most string literals.
6030 * data/yacc.c (yytnamerr): New function.
6031 (yyerrlab): Use it to decode most string literals.
6032 * doc/bison.texinfo (Decl Summary, Calling Convention):
6033 Clarify quoting convention of yytname.
6034 * src/output.c (prepare_symbols): Quote all names. This undoes
6035 the 2005-04-17 change, which is now accomplished (mostly) via
6036 changes in the parsers as described above.
6037 * tests/regression.at (Token definitions, Web2c Actions):
6038 Undo most 2005-04-17 change here, too.
6039
60402005-07-20 Paul Eggert <eggert@cs.ucla.edu>
6041
6042 Fix more problems reported by twlevo@xs4all.nl.
6043 * tests/cxx-type.at: Don't pipe output of ./types through sed to
6044 remove trailing spaces. This loses the exit status of ./types,
6045 and isn't needed since ./types shouldn't be emitting trailing
6046 spaces.
6047 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
6048 as the stack isn't valid in that case.
6049
6050 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6051 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6052 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6053 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
6054 is used.
6055 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
6056 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6057 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6058 Likewise.
6059
6060 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
6061 overly-picky compilers that reject 'char *foo = "bar";'.
6062
6063 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
6064 to FILE * parameter, not to stderr. This fixes a typo introduced
6065 in the 2005-07-12 change.
6066
6067 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
6068 warnings from GCC 4.
6069
6070 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
6071 (yyglrShiftDefer, yysplitStack):
6072 Remove unused parameters b4_pure_formals. All uses changed.
6073 (yyglrShift): Remove unused parameters b4_user_formals.
6074 All uses changed.
6075 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
6076
60772005-07-18 Paul Eggert <eggert@cs.ucla.edu>
6078
6079 Destructor cleanups and regularization among the three skeletons.
6080 * NEWS: Document the behavior changes.
6081 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
6082 stack before failing, as the cleanup code will do it for us now.
6083 * data/lalr1.cc (yyerrlab): Likewise.
6084 * data/glr.c (yyparse): Pop everything off the stack before
6085 freeing it, so that destructors get called properly.
6086 * data/lalr1.cc (yyreturn): Likewise.
6087 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
6088 This is more consistent.
6089 * doc/bison.texinfo (Destructor Decl): Mention more reasons
6090 why destructors might be called. 1.875 -> 2.1.
6091 (Destructor Decl, Decl Summary, Table of Symbols):
6092 Some English-language cleanups for %destructor.
6093 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6094 Add output line for destructor of start symbol.
6095 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
6096 because of that same extra output line.
6097
6098 * NEWS: Document minor wording changes in diagnostics of
6099 Bison-generated parsers.
6100 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
6101 Remove unused formals. All uses changed.
6102 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
6103 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
6104 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
6105 Rename yyoverflowab to yyexhaustedlab.
6106 When memory exhaustion occurs during syntax-error reporting,
6107 report it separately rather than in a single diagnostic; this
6108 eases translation.
6109 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
6110 (Memory Exhausted): Renamed from Parser Stack Overflow.
6111 Revamp wording slightly to prefer "memory exhaustion".
6112 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
6113
6114 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
6115
6116 Add i18n support to the GLR skeleton. Partially fix the C++
6117 skeleton; a C++ expert needs to finish this. Remove debugging
6118 msgids; there's little point to having them translated, since they
6119 can be understood only by someone who can read the
6120 (English-language) source code.
6121
6122 Generate runtime-po/bison-runtime.pot automatically, so that we
6123 don't have to worry about garbage getting in that file. We'll
6124 make sure after the next official release that old msgids don't
6125 get lost. See
6126 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
6127
6128 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
6129 Now auto-generated.
6130 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
6131 Fix typos in explanations of the runtime file.
6132 * bootstrap: Change gettext keyword from YYI18N to YY_.
6133 Use standard Makefile.in.in in runtime-po, since we'll arrange
6134 for backward-compatible bison-runtime.po files in a different way.
6135 * data/glr.c (YY_): New macro, from yacc.c.
6136 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
6137 Translate messages intended for users.
6138 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
6139 the wording in the other skeletons. We don't know that the memory
6140 is virtual.
6141 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
6142 Use same method that yacc.c uses.
6143 Don't translate debugging messages.
6144 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
6145 it doesn't work (yet), and requires C++ expertise to fix.
6146 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
6147 Move defn to a more logical place, to be consistent with other
6148 skeletons.
6149 Don't translate debugging messages.
6150 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
6151 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
6152 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
6153 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
6154
6155 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
6156 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
6157 void, not int.
6158 * tests/glr-regression.at (Badly Collapsed GLR States):
6159 Likewise.
6160 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6161 yylex should return 0 at EOF rather than aborting.
6162
6163 Improve tests for stack overflow in GLR parser.
6164 Problem reported by twlevo@xs4all.nl.
6165 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
6166 All uses removed.
6167 (yyStackOverflow): Just longjmp, but with value 2 so that caller
6168 can handle the problem.
6169 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
6170 (yyparse): New local variable yyresult to record the result.
6171 Use result of setjmp to set it, rather than storing itinto
6172 struct.
6173 (yyDone): Remove label.
6174 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
6175 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
6176 if YYABORT is used).
6177 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
6178 yyparse status; put status > 1 into diagnostic.
6179 Check that status==2 works.
6180 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
6181 Use exit status 3 for failure to open (which shouldn't happen).
6182
61832005-07-17 Paul Eggert <eggert@cs.ucla.edu>
6184
6185 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
6186 1 on syntax error; just let yyparse do its thing.
6187 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
6188 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
6189 (Exploding the Stack Size with Alloca):
6190 (Exploding the Stack Size with Malloc):
6191 Expect exit status 2, not 1, since the parser is supposed to blow
6192 its stack. Problem reported by twlevo@xs4all.nl.
6193
6194 * data/glr.c (yyparse): Don't assume that the initial calls
6195 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
6196 Print a stack-overflow message and fail instead.
6197 Initialize the line-number information before creating the stack,
6198 so that the stack-overflow message can report line zero safely.
6199
62002005-07-14 Paul Eggert <eggert@cs.ucla.edu>
6201
6202 Fix problems reported by twlevo@xs4all.nl.
6203 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
6204 (yyuserMerge): Provide a default case if b4_mergers is empty.
6205 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
6206 * tests/glr-regression.at
6207 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6208 Add casts to pacify C++ compilers.
6209 * tests/glr-regression.at (Improper merging of GLR delayed action
6210 sets): Declare yylex before using it.
6211 * tests/Makefile.am (maintainer-check-g++): Fix a stray
6212 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
6213 test for valgrind; valgrind is independent of g++.
6214 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
6215 for compatibility with POSIX 1003.1-2001 (if running coreutils).
6216 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
6217 Use a destructor, so that we can expand the stack. Change
6218 YYSTYPE to char * so that we can free it. Cast result of malloc.
6219
62202005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6221
6222 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
6223 a valgrind failure. Problem reported by twlevo@xs4all.nl.
6224
62252005-07-13 Paul Eggert <eggert@cs.ucla.edu>
6226
6227 * PACKAGING: New file, suggested by Bruno Haible and taken from
6228 similar wording in gettext's PACKAGING file.
6229 * NEWS: Mention PACKAGING.
6230 * Makefile.am (EXTRA_DIST): Add PACKAGING.
6231
62322005-07-12 Paul Eggert <eggert@cs.ucla.edu>
6233
6234 * NEWS: Document recent i18n improvements.
6235 * bootstrap: Get runtime translations into runtime-po.
6236 Create runtime-po files automatically, if possible.
6237 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
6238 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
6239 does not infringe on the user's name space.
6240 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
6241 * doc/bison.texinfo (Internationalization): Revamp the English
6242 and Texinfo syntax a bit, to try to make it clearer.
6243 (Bison Options, Option Cross Key): Mention --print-localedir.
6244 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
6245 YYENABLE_NLS. Quote a bit more.
6246 * runtime-po/.cvsignore: New file.
6247 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
6248 * runtime-po/Rules-quot: Remove; now created by bootstrap.
6249 * runtime-po/quot.sed: Likewise.
6250 * runtime-po/boldquot.sed: Likewise.
6251 * runtime-po/en@quot.header: Likewise.
6252 * runtime-po/en@boldquot.header: Likewise.
6253 * runtime-po/insert-header.sin: Likewise.
6254 * runtime-po/remove-potcdate.sin: Likewise.
6255 * runtime-po/Makevars: Likewise.
6256 * runtime-po/LINGUAS: Likewise.
6257 * runtime-po/de.po: Likewise; we will rely on the translation project
6258 to maintain this, so "bootstrap" should get it.
6259 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
6260 its value.
6261 * src/main.c (main): Bind the bison-runtime domain, too.
6262
62632005-07-12 Bruno Haible <bruno@clisp.org>
6264
6265 * data/yacc.c: Include <libintl.h> when NLS is enabled.
6266 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
6267 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
6268 * runtime-po: New directory.
6269 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
6270 $(DOMAIN).pot-update rule, so that old messages are never dropped.
6271 * runtime-po/Rules-quot: New file, copied from po/.
6272 * runtime-po/quot.sed: Likewise.
6273 * runtime-po/boldquot.sed: Likewise.
6274 * runtime-po/en@quot.header: Likewise.
6275 * runtime-po/en@boldquot.header: Likewise.
6276 * runtime-po/insert-header.sin: Likewise.
6277 * runtime-po/remove-potcdate.sin: Likewise.
6278 * runtime-po/Makevars: New file.
6279 * runtime-po/POTFILES.in: New file.
6280 * runtime-po/LINGUAS: New file.
6281 * runtime-po/bison-runtime.pot: New file.
6282 * runtime-po/de.po: New file.
6283 * m4/bison.m4: New file.
6284 * Makefile.am (SUBDIRS): Add runtime-po.
6285 (aclocaldir, aclocal_DATA): New variables.
6286 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
6287 Define aclocaldir.
6288 * src/getargs.c (usage): Document --print-localedir option.
6289 (PRINT_LOCALEDIR_OPTION): New enum item.
6290 (long_options): Add --print-localedir option.
6291 (getargs): Handle --print-localedir option.
6292 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
6293 (Internationalization): New section.
6294
62952005-07-12 Akim Demaille <akim@epita.fr>
6296
6297 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
6298 for consistency with the rest of the code.
6299 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
6300 Add separators.
6301
63022005-07-12 Akim Demaille <akim@epita.fr>
6303
6304 * src/parse-gram.y: Use %printer instead of YYPRINT.
6305
63062005-07-12 Akim Demaille <akim@epita.fr>
6307
6308 * src/symtab.h, src/symtab.c (symbol_print): New.
6309 * src/symlist.h, src/symlist.c (symbol_list_print): New.
6310 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
6311
63122005-07-12 Akim Demaille <akim@epita.fr>
6313
6314 * data/glr.c (b4_syncline): Fix (swap) the definitions of
6315 b4_at_dollar and b4_dollar_dollar.
6316
63172005-07-11 Paul Eggert <eggert@cs.ucla.edu>
6318
6319 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
6320 and Pennello's paper.
6321
63222005-07-09 Paul Eggert <eggert@cs.ucla.edu>
6323
6324 * data/yacc.c (yyparse): Undo previous patch. Instead,
6325 set yylsp[0] and yyvsp[0] only if the initial action
6326 sets yylloc and yylval, respectively.
6327
6328 * data/yacc.c (yyparse): In the initial action, set
6329 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
6330 This avoids the use of undefined variables if the initial
6331 action does not set yylloc and/or yylval.
6332
63332005-07-07 Paul Eggert <eggert@cs.ucla.edu>
6334
6335 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
6336 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
6337 Remove from CVS. These files are automatically generated.
6338 * examples/extexi: Clarify that this file is now part of Bison,
6339 not GNU M4, and that it works with any POSIX-compatible Awk.
6340 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
6341 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
6342 so that we also get calc++-parser.yy. Geneate it.
6343 Use $(AWK), not gawk, since any conforming Awk will do.
6344 Put comment before action, since older 'make' can't handle comment
6345 in action.
6346 $(BUILT_SOURCES): List all built sources, not just some of them.
6347 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
6348 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
6349 $($(calc_sources_generated)): Remove unnecessary test for existence
6350 of target. (This had a shell syntax error anyway; a stray "x".)
6351 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
6352 calc++-parser.yy.
6353 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
6354
6355 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
6356 implied by the other modules.
6357
63582005-07-06 Akim Demaille <akim@epita.fr>
6359
6360 Bind examples/calc++ to the package.
6361 * examples/calc++/Makefile: Remove, replaced by...
6362 * examples/calc++/Makefile.am: ... this new file.
6363 * examples/calc++/test: Remove input.
6364 * examples/calc++/compile: Remove.
6365 * examples/Makefile.am: New.
6366 * configure.ac, Makefile.am: Adjust.
6367 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
6368
63692005-07-05 Paul Eggert <eggert@cs.ucla.edu>
6370
6371 * data/glr.c (yyFail): Drastically simplify; since the format argument
6372 never had any % directives, we can simply pass it to yyerror.
6373 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
6374 be modified later, as that is the usual style in glr.c.
6375 Problems reported by Paul Hilfinger.
6376
6377 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
6378 and size overflow errors.
6379 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
6380 in case the user prolog sets feature-test macros like _GNU_SOURCE.
6381 (YYSIZEMAX): New macro.
6382 (yystpcpy): New function, taken from yacc.c.
6383 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
6384 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
6385 so that we don't have to maintain their signatures.
6386 (yyFail): Check for buffer overflow, by using vsnprintf rather
6387 than vsprintf. Allocate a bigger buffer if possible.
6388 Report an error if buffer allocation fails.
6389 (yyStackOverflow): New function.
6390 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
6391 the initialization was successful. It might fail if storage was
6392 exhausted.
6393 (yyexpandGLRStack): Add more checks for storage allocation failure.
6394 Use yyStackOverflow to report failures.
6395 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
6396 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
6397 Don't assume stack number fits in int.
6398 (yysplitStack): Check for storage allocation failure.
6399 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
6400 can print diagnostics on storage allocation failure. All callers
6401 changed.
6402 (yyresolveValue): Use yybool for boolean.
6403 (yyreportSyntaxError): Check for size-calculation overflow.
6404 This code is taken from yacc.c.
6405 (yyparse): Check for storage allocation errors when allocating
6406 the initial stack.
6407
64082005-07-05 Akim Demaille <akim@epita.fr>
6409
6410 Extract calc++ from the documentation.
6411 * doc/bison.texinfo (Calc++): Add the extraction marks.
6412 * examples/extexi: New, from the aborted GNU Programming 2E.
6413 Separate the different paragraph of a file with empty lines.
6414 * examples/Makefile: Use it to extract the whole calc++ example.
6415
64162005-06-24 Akim Demaille <akim@epita.fr>
6417
6418 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
6419 class typedefs.
6420
64212005-06-22 Akim Demaille <akim@epita.fr>
6422
6423 * doc/bison.texinfo (C++ Language Interface): First stab.
6424 (C++ Parsers): Remove.
6425
64262005-06-22 Akim Demaille <akim@epita.fr>
6427
6428 * data/lalr1.cc (yylex_): Honor %lex-param.
6429
64302005-06-22 Akim Demaille <akim@epita.fr>
6431
6432 Start a set of simple examples.
6433 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
6434 * examples/calc++/calc++-driver.hh,
6435 * examples/calc++/calc++-parser.yy,
6436 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
6437 * examples/calc++/compile, examples/calc++/test: New.
6438
64392005-06-09 Paul Eggert <eggert@cs.ucla.edu>
6440
6441 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
6442 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
6443 which stems from the 2005-05-27 patch.
6444
64452005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6446
6447 * data/glr.c: Modify treatment of unused parameters to permit use
6448 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
6449
64502005-05-30 Paul Eggert <eggert@cs.ucla.edu>
6451
6452 Fix infringement on user name space reported by Janos Zoltan Szabo.
6453 * data/yacc.c (yyparse): strlen -> yystrlen.
6454
64552005-05-30 Akim Demaille <akim@epita.fr>
6456
6457 * data/lalr1.cc (_): New.
6458 Translate the various messages.
6459
64602005-05-27 Paul Eggert <eggert@cs.ucla.edu>
6461
6462 Fix infringement on user name space reported by Bruno Haible.
6463 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
6464 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
6465 the user's name space.
6466 (alloca): Include <stdlib.h> to get it, if it's not built in.
6467 (YYMALLOC, YYFREE): Define only if needed.
6468 (malloc, free): Declare, but only if needed, as this infringes on
6469 the user name space.
6470
64712005-05-25 Paul Eggert <eggert@cs.ucla.edu>
6472
6473 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
6474 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
6475 with %d format.
6476 * lib/ebitset.c (min, max): Undef before defining.
6477 * lib/vbitset.c (min, max): Likewise.
6478 * lib/subpipe.c (create_subpipe): Save local variables in case
6479 vfork clobbers them.
6480
64812005-05-24 Bruno Haible <bruno@clisp.org>
6482
6483 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
6484 error message syntax used by gcc-4.0.
6485
64862005-05-23 Paul Eggert <eggert@cs.ucla.edu>
6487
6488 * README: Mention m4 1.4.3. Remove obsolete advice about
6489 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
6490
6491 * bootstrap: Remove workaround for problem I encountered with
6492 gettext 0.14.1; it seems to be fixed now.
6493
64942005-05-22 Paul Eggert <eggert@cs.ucla.edu>
6495
6496 * NEWS: Version 2.0a.
6497
6498 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
6499 the previous change.
6500
6501 Various maintainer cleanups.
6502 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
6503 conftest*, for benefit of CVS commands run at the same time as
6504 "configure". Add build-aux, since "bootstrap" now creates it and
6505 its subfiles.
6506 * Makefile.cfg (move_if_change): Remove.
6507 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
6508 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
6509 (po_repo, do-po-update, po-update, wget_files, get-targets):
6510 (config.guess-url_prefix, config.sub-url_prefix):
6511 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
6512 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
6513 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
6514 Remove.
6515 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
6516 this is now the recommended name.
6517 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
6518 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
6519 ylwrap. These files now go into build-aux.
6520 * config/move-if-change: Remove.
6521 * config/prev-version.txt: Bump from 1.75 to 2.0.
6522
6523 * bootstrap: Add stdio-safer, unistd-safer modules.
6524 Remove m4/glibc2.m4 (introduced by latest gnulib, but
6525 we don't need it).
6526 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
6527 fopen-safer.c, stdio-safer.h, unistd-safer.h.
6528 * lib/subpipe.c: Include "unistd-safer.h".
6529 (create_subpipe): Make sure all the newly-created
6530 file descriptors are > 2, so that diagnostics don't
6531 get sent down them (which might cause Bison to hang, in theory).
6532 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
6533 * src/files.c (xfopen): Use fopen_safer, not fopen.
6534
6535 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
6536 yesterday's yacc.c fix.
6537
65382005-05-21 Paul Eggert <eggert@cs.ucla.edu>
6539
6540 * data/glr.c, data/lalr1.cc: Update copyright date.
6541
6542 Fix a destructor bug reported by Wolfgang Spraul in
6543 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
6544 * data/yacc.c (yyabortlab): Don't call destructor, and
6545 don't set yychar to EMPTY.
6546 (yyoverflowlab): Don't call destructor.
6547 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
6548 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
6549 since we no longer output the message "discarding lookahead token
6550 end of input ()".
6551
65522005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6553
6554 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
6555 fix a small glitch in debugging output.
6556 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
6557 after YY_SYMBOL_PRINT where needed.
6558
6559 (struct yyGLRState): Add some comments.
6560 (struct yySemanticOption): Add some comments.
6561 (union yyGLRStackItem): Add comment.
6562
6563 (yymergeOptionSets): Correct this to properly perform the union,
6564 avoiding infinite reported by Michael Rosien.
6565 Update comment.
6566
6567 * tests/glr-regression.at: Add test for GLR merging error reported
6568 by M. Rosien.
6569
65702005-05-13 Paul Eggert <eggert@cs.ucla.edu>
6571
6572 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
6573 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
6574 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
6575 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
6576 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
6577 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
6578 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
6579 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
6580 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
6581 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
6582 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
6583 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
6584 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
6585 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
6586 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
6587 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
6588 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
6589 src/derives.h, src/files.c, src/files.h, src/getargs.c,
6590 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
6591 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
6592 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
6593 src/output.h, src/parse-gram.c, src/parse-gram.h,
6594 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
6595 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
6596 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
6597 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
6598 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
6599 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
6600 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
6601 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
6602 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
6603 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
6604 tests/reduce.at, tests/regression.at, tests/sets.at,
6605 tests/synclines.at, tests/testsuite.at, tests/torture.at:
6606 Update FSF postal mail address.
6607
66082005-05-11 Paul Eggert <eggert@cs.ucla.edu>
6609
6610 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
6611 Problem reported by Ralf Menzel.
6612
66132005-05-01 Paul Eggert <eggert@cs.ucla.edu>
6614
6615 * tests/actions.at: Test that stack overflow invokes destructors.
6616 From Marcus Holland-Moritz.
6617 * data/yacc.c (yyerrlab): Move the code that destroys the stack
6618 from here....
6619 (yyreturn): to here. That way, destructors are called properly
6620 even if the stack overflows, or the user calls YYACCEPT or
6621 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
6622 (yyoverflowlab): Destroy the lookahead.
6623
66242005-04-24 Paul Eggert <eggert@cs.ucla.edu>
6625
6626 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
6627
66282005-04-17 Paul Eggert <eggert@cs.ucla.edu>
6629
6630 * NEWS: Bison-generated C parsers no longer quote literal strings
6631 associated with tokens.
6632 * src/output.c (prepare_symbols): Don't escape strings,
6633 since users don't want to see C escapes.
6634 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
6635 in diagnostics.
6636 * tests/input.at (Torturing the Scanner): Likewise.
6637 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
6638
66392005-04-16 Paul Eggert <eggert@cs.ucla.edu>
6640
6641 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
6642 the data size is known to be too small and we can't increase it.
6643 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
6644
66452005-04-15 Paul Eggert <eggert@cs.ucla.edu>
6646
6647 * src/parse-gram.y: Include quotearg.h.
6648 (string_as_id): Quote $1 before using it as a key, since the
6649 lexer no longer quotes it for us.
6650 (string_content): Don't strip quotes, since lexer no longer
6651 quotes it for us.
6652 * src/scan-gram.l: Include quotearg.h.
6653 ("\""): Omit quote.
6654 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
6655 a key, since the rest of the lexer doesn't quote it.
6656 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
6657 * tests/regression.at (Token definitions): Check for backslashes
6658 in token strings.
6659
6660 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
6661 (YYSIZE_T): Define to unsigned long int when using an older compiler.
6662 (yyparse): Revamp code to generate long syntax error message, to
6663 make it easier to translate, and to avoid problems with arithmetic
6664 overflow. Change "virtual memory" to "memory" in diagnostic, since
6665 we don't know whether the memory is virtual.
6666
66672005-04-13 Paul Eggert <eggert@cs.ucla.edu>
6668
6669 * NEWS: Bison-generated C parsers now use the _ macro to
6670 translate strings.
6671 * data/yacc.c (_) [!defined _]: New macro.
6672 All English strings wrapped inside this macro.
6673 * doc/bison.texinfo (Bison Parser): Document _.
6674 * po/POTFILES.in: Include src/parse-gram.c, since it now
6675 includes translateable strings that parse-gram.y doesn't.
6676
66772005-04-12 Paul Eggert <eggert@cs.ucla.edu>
6678
6679 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
6680 reverting the 2004-10-11 change to this function.
6681 (symbol_check_alias_consistency): Don't call symbol_type_set
6682 if the type name is already correct.
6683 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
6684
66852005-03-25 Paul Eggert <eggert@cs.ucla.edu>
6686
6687 * tests/regression.at (Token definitions): Don't use a token named
6688 c, as that generates a "#define c ..." that runs afoul of buggy
6689 stdlib.h that uses the identifier c as a member of struct
6690 drand48_data. Problem reported by Horst Wente.
6691
66922005-03-21 Paul Eggert <eggert@cs.ucla.edu>
6693
6694 * bootstrap: Change translation URL from
6695 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
6696 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
6697 redirection glitches. Problem reported by twlevo@xs4all.nl.
6698
66992005-03-20 Paul Eggert <eggert@cs.ucla.edu>
6700
6701 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
6702 after operands; POSIX says this isn't portable for the c99 command.
6703
67042005-03-18 Paul Eggert <eggert@cs.ucla.edu>
6705
6706 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
6707 immediately if a data overrun has occurred; this may help us track
6708 down what may be a spurious failure on MacOS.
6709
67102005-03-17 Paul Eggert <eggert@cs.ucla.edu>
6711
6712 Respond to problems reported by twlevo@xs4all.nl.
6713
6714 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
6715
6716 * src/vcg.h: Comment fix.
6717 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
6718 (G_CMAX): Change to -1 instead of INT_MAX.
6719
6720 * data/yacc.c (yyparse): Omit spaces before #line.
6721
67222005-03-15 Paul Eggert <eggert@cs.ucla.edu>
6723
6724 * src/tables.c (state_number_to_vector_number): Put it inside an
6725 "#if 0", since it's not currently used. Problem reported by
6726 Roland McGrath.
6727
67282005-03-06 Paul Eggert <eggert@cs.ucla.edu>
6729
6730 * src/output.c (escaped_output): Renamed from
6731 escaped_file_name_output, since we now use it for symbol tags as
6732 well. All uses changed.
6733 (symbol_destructors_output, symbol_printers_output):
6734 Escape symbol tags too.
6735 Problem reported by Matyas Forstner in
6736 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
6737
6738 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
6739 not needed.
6740 * src/output.c (user_actions_output, token_definitions_output,
6741 symbol_destructors_output, symbol_printers_output): Likewise.
6742 * src/reader.c (prologue_augment): Likewise.
6743 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
6744
6745 * src/vcg.c (output_edge): Don't quote linestyle arg.
6746 Problem reported by twlevo@xs4all.nl.
6747
67482005-02-28 Paul Eggert <eggert@cs.ucla.edu>
6749
6750 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
6751 example, reported by Derek M Jones. Also, make the example even
6752 more outrageous, to better illustrate how bad the problem is.
6753
67542005-02-24 Paul Eggert <eggert@cs.ucla.edu>
6755
6756 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
6757 putsym. Typo reported by Sebastian Piping.
6758
67592005-02-23 Paul Eggert <eggert@cs.ucla.edu>
6760
6761 * doc/bison.texinfo (Language and Grammar): some -> same
6762 (Epilogue): int he -> in the
6763 Typos reported by Sebastian Piping via Justin Pence.
6764
67652005-02-07 Paul Eggert <eggert@cs.ucla.edu>
6766
6767 * tests/glr-regression.at (Improper handling of embedded actions
6768 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
6769 embedded actions and $-N in GLR parsers", work around an Autoconf bug
6770 with dollar signs in test names.
6771 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
6772 for a similar reason.
6773
67742005-01-28 Paul Eggert <eggert@cs.ucla.edu>
6775
6776 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
6777 wants to redefine G_VIEW.
6778
67792005-01-27 Paul Eggert <eggert@cs.ucla.edu>
6780
6781 * src/vcg.c (get_view_str): Remove case for normal_view.
6782 Problem reported by twlevo@xs4all.nl.
6783
67842005-01-24 Paul Eggert <eggert@cs.ucla.edu>
6785
6786 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
6787 Problem reported by twlevo@xs4all.nl.
6788
6789 * doc/bison.texinfo: Change @dircategory from "GNU programming
6790 tools" to "Software development". Requested by Richard Stallman
6791 via Karl Berry.
6792
67932005-01-23 Paul Eggert <eggert@cs.ucla.edu>
6794
6795 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
6796 Problem reported by twlevo@xs4all.nl.
6797
67982005-01-21 Paul Eggert <eggert@cs.ucla.edu>
6799
6800 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
6801 keyword; it's not needed with modern compilers, and it doesn't
6802 affect correctness with older compilers. Suggested by
6803 twlevo@xs4all.nl.
6804
68052005-01-17 Paul Eggert <eggert@cs.ucla.edu>
6806
6807 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
6808 gcc -Wswitch-default.
6809 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
6810 * data/yacc.c (yyparse): Likewise.
6811
68122005-01-12 Paul Eggert <eggert@cs.ucla.edu>
6813
6814 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
6815 already. Let config.h define any nonstandard values.
6816
68172005-01-10 Paul Eggert <eggert@cs.ucla.edu>
6818
6819 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
6820 for the benefit of slower hosts. Problem reported by
6821 Nelson H. F. Beebe.
6822
68232005-01-07 Paul Eggert <eggert@cs.ucla.edu>
6824
6825 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
6826 being defined and not used.
6827 * data/lalr1.cc (yyparse): Likewise.
6828 Use "if (false)" rather than "if (0)".
6829
68302005-01-05 Paul Eggert <eggert@cs.ucla.edu>
6831
6832 * TODO: Mention that we should allow NUL bytes in tokens.
6833
68342005-01-02 Paul Eggert <eggert@cs.ucla.edu>
6835
6836 * src/scan-skel.l (<<EOF>>): Don't close standard output.
6837 Problem reported by Hans Aberg.
6838
68392005-01-01 Paul Eggert <eggert@cs.ucla.edu>
6840
6841 * src/getargs.c (version): Happy new year; update overall
6842 program copyright date from 2004 to 2005.
6843
6844 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
6845 Problem reported by Hans Aberg.
6846 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
6847 (Output file names.): Add a test for the case when standard output
6848 is closed.
6849
68502004-12-26 Paul Eggert <eggert@cs.ucla.edu>
6851
6852 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
6853 to fix an oversight in the Bison 2.0 manual.
6854
68552004-12-25 Paul Eggert <eggert@cs.ucla.edu>
6856
6857 * NEWS: Version 2.0. Reformat the existing news items since
6858 1.875, so that related items are grouped together.
6859 * configure.ac (AC_INIT): Bump version to 2.0.
6860 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
6861
6862 * tests/torture.at (Exploding the Stack Size with Alloca): Set
6863 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
6864 otherwise, we're not testing alloca. Unfortunately there's no
6865 simple way to consult HAVE_ALLOCA here.
6866
6867 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
6868 for yymsg, too.
6869
6870 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
6871 hand. This avoids a warning about comparing int to size_t when
6872 GCC warnings are enabled.
6873
68742004-12-22 Paul Eggert <eggert@cs.ucla.edu>
6875
6876 * NEWS: Bison-generated parsers no longer default to using the
6877 alloca function (when available) to extend the parser stack, due
6878 to widespread problems in unchecked stack-overflow detection.
6879 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
6880 responsibility to set it to a positive value. This lets the user
6881 specify a value that is not a preprocessor constant.
6882 * data/yacc.c (YYMAXDEPTH): Likewise.
6883 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
6884 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
6885 to be a compile-time constant. However, explain the constraints on it.
6886 Also, explain the constraints on YYINITDEPTH.
6887 (Table of Symbols): Explain that alloca is no longer the default.
6888 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
6889 to 1.
6890
6891 * doc/bison.texinfo (Location Default Action): Mention that n must
6892 be zero when k is zero. Suggested by Frank Heckenbach.
6893
68942004-12-22 Akim Demaille <akim@epita.fr>
6895
6896 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
6897 (parser::state_type, parser::semantic_type, parser::location_type):
6898 Private, not public.
6899 (parser::parse): Return ints, not bool.
6900 Returning a bool introduces a problem: 0 corresponds to false, and
6901 it seems weird to return false on success. Returning true changes
6902 the conventions for yyparse.
6903 Alternatively we could return void and send an exception.
6904 There is no clear consensus (yet?).
6905 (state_stack, semantic_stack, location_stack): Rename as...
6906 (state_stack_type, semantic_stack_type, location_stack_type): these.
6907 Private, not public.
6908 * tests/c++.at: New.
6909 * tests/testsuite.at, tests/Makefile.am: Adjust.
6910
69112004-12-21 Akim Demaille <akim@epita.fr>
6912
6913 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
6914
69152004-12-21 Akim Demaille <akim@epita.fr>
6916
6917 Don't impose std::string for filenames.
6918
6919 * data/lalr1.cc (b4_filename_type): New.
6920 (position::filename): Use it.
6921 (parser.hh): Move the inclusion of stack.hh and location.hh below
6922 the user code, so that needed headers for the filename type can be
6923 included first.
6924 Forward declare them before the user code.
6925 * tests/Makefile.am (check-local, installcheck-local): Pass
6926 TESTSUITEFLAGS to the TESTSUITE.
6927
69282004-12-20 Akim Demaille <akim@epita.fr>
6929
6930 Use more STL like names: my_class instead of MyClass.
6931
6932 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
6933 (SemanticStack, SemanticType, StateStack, StateType)
6934 (TokenNumberType, Stack, Slice, Traits, Parser::location)
6935 (Parser::value): Rename as...
6936 (location_stack, location_type, rhs_number_type, semantic_stack)
6937 (semantic_type, state_stack, state_type, token_number_type, stack)
6938 (slice, traits, parser::yylloc, parser::yylval): these.
6939
6940 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
6941
69422004-12-19 Paul Eggert <eggert@cs.ucla.edu>
6943
6944 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
6945 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6946
69472004-12-17 Paul Eggert <eggert@cs.ucla.edu>
6948
6949 Remove uses of 'short int' and 'unsigned short int'. This raises
6950 some arbitrary limits. It uses more memory but nowadays that's
6951 not much of an issue.
6952
6953 This change does not affect the generated parsers; that's a different
6954 task, as some users will want to conserve memory there.
6955
6956 Ideally we should use size_t to represent all object counts, and
6957 something like ptrdiff_t to represent signed differences of object
6958 counts; but that will require more code-cleanup than I have the
6959 time to do right now.
6960
6961 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
6962 Use size_t, not int or short int, to count objects.
6963 * src/closure.c (nritemset, closure): Likewise.
6964 * src/closure.h (nritemset, closure): Likewise.
6965 * src/nullable.c (nullable_compute): Likewise.
6966 * src/print.c (print_core): Likewise.
6967 * src/print_graph.c (print_core): Likewise.
6968 * src/state.c (state_compare, state_hash): Likewise.
6969 * src/state.h (struct state): Likewise.
6970 * src/tables.c (default_goto, goto_actions): Likewise.
6971
6972 * src/gram.h (rule_number, rule): Use int, not short int.
6973 * src/output.c (prepare_rules): Likewise.
6974 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
6975 errs, reductions): Likewise.
6976 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
6977 Likewise.
6978 * src/tables.c (vector_number, tally, action_number,
6979 ACTION_NUMBER_MINIMUM): Likewise.
6980 * src/output.c (muscle_insert_short_int_table): Remove.
6981
69822004-12-17 Akim Demaille <akim@epita.fr>
6983
6984 * data/lalr1.cc: Extensive Doxygenation.
6985 (error_): Rename as...
6986 (error): this, since it is visible to the user.
6987 Adjust callers.
6988 (Parser::message): Now an automatic variable from...
6989 (Parser::yyreport_syntax_error_): here.
6990 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
6991 Parser::error.
6992 * tests/input.at: Escape $.
6993
69942004-12-16 Paul Eggert <eggert@cs.ucla.edu>
6995
6996 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
6997 Parenthesize rhs to avoid obscure problems with mistakes like
6998 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
6999 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7000 b4_rhs_location): Likewise.
7001 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7002 b4_rhs_location): Likewise.
7003
70042004-12-16 Akim Demaille <akim@epita.fr>
7005
7006 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
7007 yacc.c: be sure to stay within yycheck_.
7008 * tests/actions.at: Re-enable C++ tests.
7009
70102004-12-16 Akim Demaille <akim@epita.fr>
7011
7012 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
7013 real.
7014
70152004-12-16 Akim Demaille <akim@epita.fr>
7016
7017 Use #define to handle the %name-prefix.
7018
7019 * data/glr.c, data/yacc.c: Comment changes.
7020 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
7021 so that one can refer to yylex in the parser file, and have it
7022 renamed, as is the case with other skeletons.
7023
70242004-12-16 Akim Demaille <akim@epita.fr>
7025
7026 Move lalr1.cc internals into yy*.
7027
7028 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
7029 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
7030 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
7031 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
7032 (empty_, final_, terror_, errcode_, ntokens_)
7033 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
7034 (looka_, ilooka_, error_range_, nerrs_):
7035 Rename as...
7036 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
7037 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
7038 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
7039 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
7040 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
7041 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
7042 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
7043 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
7044 these.
7045
70462004-12-15 Paul Eggert <eggert@cs.ucla.edu>
7047
7048 Fix some problems reported by twlevo at xs4all.
7049 * src/symtab.c (symbol_new): Report an error if the input grammar
7050 contains too many symbols. This is better than calling abort() later.
7051 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
7052 (struct node, struct graph):
7053 Rename member expand to stretch. All uses changed.
7054 (struct graph): Remove member layoutalgorithm. All uses removed.
7055 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
7056 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
7057 All uses changed.
7058 (N_STRETCH): Rename from N_EXPAND. All uses changed.
7059
70602004-12-15 Akim Demaille <akim@epita.fr>
7061
7062 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
7063 Add more Doxygen comments.
7064 (symprint_, stack_print_, reduce_print_, destruct_, pop)
7065 (report_syntax_error_, translate_): Rename as...
7066 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
7067 (yypop_, yyreport_syntax_error_, yytranslate_): this.
7068
70692004-12-15 Akim Demaille <akim@epita.fr>
7070
7071 * data/lalr1.cc (lex_): Rename as...
7072 (yylex_): this.
7073 Move the trace here.
7074 Take the %name-prefix into account.
7075 Reported by Alexandre Duret-Lutz.
7076
70772004-12-15 Akim Demaille <akim@epita.fr>
7078
7079 Simplify the C++ parser constructor.
7080
7081 * data/lalr1.cc (debug_): Rename as...
7082 (yydebug_): so that the parser's internals are always in the yy*
7083 pseudo namespace.
7084 Adjust uses.
7085 (b4_parse_param_decl): Remove the leading comma as it is now only
7086 called as unique argument list.
7087 (Parser::Parser): Remove the constructor accepting a location and
7088 an initial debugging level.
7089 Remove from the other ctor the argument for the debugging level.
7090 (debug_level_type, debug_level, set_debug_level): New.
7091
7092 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
7093 constructor calls.
7094
70952004-12-15 Akim Demaille <akim@epita.fr>
7096
7097 Remove b4_root related material: failure experiment
7098 (which goal was to allow to derive from a class).
7099
7100 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
7101 definitions and uses.
7102
71032004-12-14 Paul Eggert <eggert@cs.ucla.edu>
7104
7105 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
7106 not 2, since it's not portable to subtract 1 from the start of an
7107 array. The new item 0 is never set or used. All uses changed.
7108
7109 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
7110 the default definition of YYLLOC_DEFAULT. Problem reported
7111 by Frank Heckenbach.
7112
71132004-12-12 Paul Eggert <eggert@cs.ucla.edu>
7114
7115 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
7116 the normal case and one for the error case. Just use the
7117 first one uniformly. Problem reported by Frank Heckenbach.
7118 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
7119 use exactly the same macro in both places.
7120 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
7121 so that the normal-case YYRHSLOC works for the error case too.
7122 All uses changed.
7123 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
7124 (YYLLOC_DEFAULT): Use the same macro as glr.c.
7125 * doc/bison.texinfo (Location Default Action): Don't claim that
7126 we have an array of locations. Use the same macro for both glr
7127 and lalr parsers. Mention YYRHSLOC. Mention what happens when
7128 the index is 0.
7129
71302004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7131
7132 * HACKING: Update email addresses to send announcements to.
7133
7134 * configure.ac (AC_INIT): Bump version to 1.875f.
7135
71362004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7137
7138 * NEWS: Version 1.875e.
7139 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
7140
7141 * src/scan-skel.l: Include "complain.h", for "fatal".
7142
7143 * src/relation.h (relation_print, relation_digraph):
7144 Relation sizes are of type relation_node, not size_t (this is
7145 merely a doc fix, since the two types are equivalent).
7146 (relation_transpose): Relation sizes are of type relation_node,
7147 not int.
7148 * src/relation.c: Likewise.
7149 (top, infinity): Now of type relation_node, not int.
7150 (traverse, relation_transpose): Use relation_node, not int.
7151
7152 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
7153 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
7154 (yyparse): Remove unused local introduced in 2004-10-25 patch.
7155
7156 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
7157 specifying whether the test should be skipped. Use it tp
7158 specify that the [%defines %skeleton "lalr1.cc"] tests currently
7159 fail on some hosts, and should be skipped.
7160
71612004-12-08 Paul Eggert <eggert@cs.ucla.edu>
7162
7163 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
7164 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
7165 unless otherwise specified below.
7166
7167 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
7168 to allocate kernel_base, kernel_items, kernel_size, since
7169 they needn't be initialized to 0.
7170 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
7171 * src/closure.c (new_closure): Likewise, for itemset.
7172 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
7173 * src/lalr.c (set_goto_map): Likewise, for temp_map.
7174 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
7175 (build_relations): Likewise for edge, states1, includes.
7176 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
7177 * src/reader.c (packgram): Likewise, for ritem, rules.
7178 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
7179 * src/relation.c (relation_digraph): Likewise for VERTICES.
7180 (relation_transpose): Likewise for new_R, end_R.
7181 * src/symtab.c (symbols_token_translations_init): Likewise for
7182 token_translations.
7183 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
7184 (token_actions): Likewise for yydefact, actrow, conflrow,
7185 conflict_list.
7186 (save_column): Likewise for froms[symno], tos[symno].
7187 (goto_actions): Likewise for state_count.
7188 (pack_table): Likewise for base, pos, check.
7189 (tables_generate): Likewise for width.
7190
7191 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
7192 for initial core. Just have a separate core, so we needn't worry
7193 about whether kernel_size and kernel_base are initialized.
7194
7195 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
7196 kernel_size, kernel_items): Remove unnecessary initialization.
7197 * src/conflicts.c (conflicts): Likewise.
7198 * src/derives.c (derives): Likewise.
7199 * src/muscle_tablc (muscle_insert): Likewise.
7200 * src/relation.c (relation_digraph): Likewise.
7201 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
7202 conflrow, conflict_table, conflict_list, table, check):
7203 Likewise.
7204
7205 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
7206 This is because all callers pass unsigned int.
7207 * src/closure.h (new_closure): Likewise.
7208
7209 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
7210 (build_relations): Initialize includes[i] in all cases.
7211 * src/reader.c (packgram): Always initialize rules[ruleno].prec
7212 and rules[ruleno].precsym. Initialize members in order.
7213 * src/relation.c (relation_transpose): Always initialize new_R[i]
7214 and end_R[i].
7215 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
7216
7217 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
7218 conflict_list[0] was always 0, but now it isn't initialized.
7219
7220 * src/table.c (table_grow): When conflict_table grew, the grown
7221 area wasn't cleared. Fix this.
7222
7223 * lib/.cvsignore: Add strdup.c, strdup.h.
7224 * m4/.cvsignore: Add strdup.m4.
7225
72262004-12-07 Paul Eggert <eggert@cs.ucla.edu>
7227
7228 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
7229 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
7230 GOTO_NUMBER_MAXIMUM, since we occasionally compute
7231 ngotos + 1 without checking for overflow.
7232 (build_relations): Use END_NODE, not -1, to denote end of edges.
7233 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
7234 build_relations): Use goto_number, not int, for goto numbers.
7235 * src/tables.c (save_column, default_goto): Likewise.
7236
72372004-11-23 Akim Demaille <akim@epita.fr>
7238
7239 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
7240 of #defining from yystype.
7241 Don't typedef yystype, C++ does not need it.
7242 This lets it possible to forward declare it as union.
7243
72442004-11-23 Paul Eggert <eggert@cs.ucla.edu>
7245
7246 * bootstrap (gnulib_modules): Add extensions.
7247 Problem reported by Jim Meyering.
7248
72492004-11-22 Paul Eggert <eggert@cs.ucla.edu>
7250
7251 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
7252 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
7253 src/system.h, src/tables.c: XFREE -> free, to accommodate
7254 recent change to gnulib xalloc.h.
7255 Problem reported by Jim Meyering.
7256
72572004-11-17 Akim Demaille <akim@epita.fr>
7258
7259 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
7260
72612004-11-17 Akim Demaille <akim@epita.fr>,
7262 Alexandre Duret-Lutz <adl@gnu.org>
7263
7264 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
7265 changes.
7266 (YYCDEBUG): Adjust.
7267 Use it instead of cdebug_.
7268 (Parser::debug_stream, Parser::set_debug_stream): New.
7269 (Parser::symprint_): Define cdebug_ for temporary backward
7270 compatibility.
7271 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
7272 debug_stream ().
7273
72742004-11-17 Akim Demaille <akim@epita.fr>
7275
7276 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
7277 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
7278 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
7279 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
7280
72812004-10-27 Paul Eggert <eggert@cs.ucla.edu>
7282
7283 * data/glr.c (yyloc_default): Remove; not used.
7284 Problem reported by Frank Heckenbach.
7285
72862004-10-25 Akim Demaille <akim@epita.fr>
7287
7288 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
7289 Introduce another definition to address simple location arrays.
7290 (yyGLRStack): New member: yyerror_range.
7291 (yyrecoverSyntaxError, yyparse): Update it.
7292 (yyrecoverSyntaxError): Use it when shifting the error token to
7293 have an accurate range, equivalent to the one computed by both
7294 yacc.c and lalr1.cc.
7295 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
7296 that column numbers start at column 0, as per GNU Coding
7297 Standards, the others tests, and the doc.
7298 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
7299 Adjust to the above change (first column is 0).
7300 And adjust the location of the "<error>", now covering the whole
7301 line.
7302
73032004-10-22 Akim Demaille <akim@epita.fr>
7304 and Paul Eggert <eggert@cs.ucla.edu>
7305
7306 Remove some arbitrary limits on goto numbers and relations.
7307 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
7308 initial values, since they're never used.
7309 (set_goto_map): ngotos is now unsigned, so test for overflow
7310 by seeing whether it wraps around to zero.
7311 * src/lalr.h (goto_number): Now size_t, not short int.
7312 (GOTO_NUMBER_MAXIMUM): Remove.
7313 * src/relation.c (relation_print, traverse, relation_transpose):
7314 Check for END_NODE rather than looking at sign.
7315 * src/relation.h (END_NODE): New macro.
7316 (relation_node): Now size_t, not short int.
7317
73182004-10-22 Paul Eggert <eggert@cs.ucla.edu>
7319
7320 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
7321 keyword, not an identifier. Problem reported by Baron Schwartz in
7322 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
7323
73242004-10-11 Akim Demaille <akim@epita.fr>
7325
7326 * src/symtab.c (symbol_check_alias_consistency): Also check
7327 type names, destructors, and printers.
7328 Reported by Alexandre Duret-Lutz.
7329 Recode the handling of associativity and precedence in terms
7330 of symbol_precedence_set.
7331 Accept no redeclaration at all, not even equal to the previous
7332 value.
7333 (redeclaration): New.
7334 Use it to factor redeclaration complaints.
7335 (symbol_make_alias): Don't set the type of the alias, let
7336 symbol_check_alias_consistency do it as for other features.
7337 * src/symtab.h (symbol): Add new member prec_location, and
7338 type_location.
7339 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
7340 * tests/input.at (Incompatible Aliases): New.
7341
73422004-10-09 Paul Eggert <eggert@cs.ucla.edu>
7343
7344 .cvsignore fixes to accommodate gnulib changes,
7345 and the practice of naming build directories "_build".
7346 * .cvsignore: Add "_*". Sort.
7347 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
7348 * m4/.cvsignore: Add "*_gl.m4".
7349
73502004-10-06 Akim Demaille <akim@epita.fr>
7351
7352 * src/parse-gram.y (add_param): Fix the truncation of trailing
7353 spaces.
7354
73552004-10-05 Akim Demaille <akim@epita.fr>
7356
7357 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
7358 whether the reducion was empty or not. This leaves room to
7359 improve the use of YYLLOC_DEFAULT in such a case.
7360 lalr1.cc is still experimental, so changing this is acceptable.
7361 And finally, there are probably not many users who changed the
7362 handling of locations in GLR, so changing is admissible too.
7363
7364 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
7365 empty reduction, set @$ to an empty location ending the previously
7366 stacked symbol.
7367 Adjust uses to make sure the code is triggered on empty
7368 reductions.
7369 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
7370 expected output: empty reductions have empty locations.
7371
73722004-09-29 Akim Demaille <akim@epita.fr>
7373
7374 * data/lalr1.cc: Move towards a more standard C++ coding style
7375 for templates: Class < T > -> Class<T>.
7376
73772004-09-29 Akim Demaille <akim@epita.fr>
7378
7379 * data/lalr1.cc: Reinstall the former ctor, for sake of
7380 compatibility, but warn it will be removed.
7381 Move towards a more standard C++ coding style (i.e., type *var ->
7382 type* var).
7383
73842004-09-27 Paul Eggert <eggert@cs.ucla.edu>
7385
7386 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
7387 since it's less likely to work if NULs are involved in the future.
7388
73892004-09-27 Akim Demaille <akim@epita.fr>
7390
7391 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
7392
73932004-09-27 Akim Demaille <akim@epita.fr>
7394
7395 * data/lalr1.cc (b4_parse_param_decl_1): New.
7396 (b4_parse_param_decl): Use it to have different names between attribute
7397 and argument names.
7398 (b4_cc_constructor_call): Likewise.
7399
74002004-09-24 Akim Demaille <akim@epita.fr>
7401
7402 * src/parse-gram.y (add_param): Strip the leading and trailing
7403 blanks from a formal argument declaration.
7404 (YY_LOCATION_PRINT): New.
7405
74062004-09-24 Akim Demaille <akim@epita.fr>
7407
7408 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
7409 after the location.
7410
74112004-09-24 Akim Demaille <akim@epita.fr>
7412
7413 * doc/bison.texinfo (Table of Symbols): Sort.
7414
74152004-09-21 Akim Demaille <akim@epita.fr>
7416
7417 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
7418 the useless parentheses.
7419 Suggested by Paul Eggert.
7420
74212004-09-20 Akim Demaille <akim@epita.fr>
7422
7423 Let the initial-action act on the look-ahead, and use it for the
7424 "initial push" (corresponding to an hypothetical beginning-of-file).
7425 And let lalr1.cc honor %initial-action.
7426
7427 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
7428 example.
7429 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
7430 (Parser::Parser): Remove the ctor that used to initialize it.
7431 (Parser::parse): Like in the other skeletons, issue the "starting
7432 parse" message before any action.
7433 Honor %initial-action.
7434 Initialize the stacks with the lookahead.
7435 * data/yacc.c: Let $$ and @$ in %initial-action designate the
7436 look-ahead.
7437 Push them in the stacks.
7438 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
7439
74402004-09-20 Akim Demaille <akim@epita.fr>
7441
7442 * doc/bison.texinfo (Initial Action Decl): New.
7443
74442004-09-20 Akim Demaille <akim@epita.fr>
7445
7446 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
7447 clearer criterion to define it.
7448 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
7449 When reducing on an empty RHS, use the latest stacked location as
7450 location.
7451 yylloc is not always available.
7452 * data/glr.c: Likewise.
7453 Also, honor initial-actions.
7454
74552004-09-20 Akim Demaille <akim@epita.fr>
7456
7457 * data/yacc.c (YY_LOCATION_PRINT): New.
7458 Define when we know YYLTYPE's structure, i.e., when the default
7459 YYLLOC_DEFAULT is used.
7460 * data/c.m4 (b4_yysymprint_generate): Use it.
7461 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
7462 value of the result.
7463 (error_start_): Replace with...
7464 (error_range_): this location array.
7465 This allows to replace code relying on the implementation of
7466 locations by portable code.
7467 * data/yacc.c (yylerrsp): Replace with...
7468 (yyerror_range): this.
7469 Every time a token is popped, update yyerror_range[0], to have an
7470 accurate location for the error token.
7471 * data/glr.c (YY_LOCATION_PRINT): New.
7472 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
7473 deference a pointer.
7474 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
7475 report the location in %printers.
7476
7477 * src/scan-skel.l: Instead of abort, report error messages to ease
7478 understanding skeleton scanning failures.
7479
74802004-09-16 Akim Demaille <akim@epita.fr>
7481
7482 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
7483 (iterator, const_iterator): these, to be more in the C++ spirit.
7484 Also, return reverse iterators so that when displaying the stack
7485 we display its bottom first.
7486 (Parser::stack_print_, Parser::reduce_print_): Match the messages
7487 from yacc.c.
7488 We should probably use vector here though.
7489
74902004-09-16 Akim Demaille <akim@epita.fr>
7491
7492 Have more complete shift traces.
7493
7494 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
7495 to report Shifts instead of ad hoc YYDPRINTF invocations,
7496 including for the error token.
7497 * data/lalr1.cc (symprint_): Output the location.
7498 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
7499 output the location within the %printer.
7500 Activate GLR tests, at least to make sure they compile properly.
7501 They still don't pass though.
7502 * tests/calc.at: Adjust expect verbose output, since now "Entering
7503 state..." is on a different line than the "Shifting" message.
7504
75052004-09-08 Akim Demaille <akim@epita.fr>
7506
7507 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
7508 Bison directive from the Bison file to the invocation of this
7509 macro, so that these directives are passed to
7510 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
7511 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
7512 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
7513 the extra Bison directives instead of the whole series.
7514 Change the grammar so that there are recoverable errors, and
7515 unrecoverable errors. Now we can have the parser give up before
7516 consuming the whole input. As a result we now can observe that
7517 the lookahead is freed when needed.
7518 Change the parser source to parse argv[1] instead of a hard coded
7519 string.
7520 Simplify yylex, and give a value and location to EOF.
7521 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
7522 passed directives already coded in the file.
7523 Add some tests to check the location of "error".
7524 For some tests, the C++ parser is correct, and not yacc.c.
7525 For other tests, they provide different, but unsatisfying, values,
7526 so keep the C++ value so that at least one parser is "correct"
7527 according to the test suite.
7528 (Actions after errors): Remove, this is subsumed by the
7529 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
7530
75312004-09-06 Akim Demaille <akim@epita.fr>
7532
7533 * data/lalr1.cc: Adjust the indentation of the labels.
7534 (Parser::pop): New.
7535 Use it.
7536
75372004-09-06 Akim Demaille <akim@epita.fr>
7538
7539 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
7540 argument, an informative message.
7541 Call YY_SYMBOL_PRINT.
7542 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
7543 * data/lalr1.cc (destruct_): Likewise.
7544 In addition, no longer depend on b4_yysymprint_generate and
7545 b4_yydestruct_generate to generate these functions, do it "by
7546 hand".
7547
75482004-09-03 Akim Demaille <akim@epita.fr>
7549
7550 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
7551 invoked, yydestruct the lookahead.
7552 * tests/calc.at (Calculator $1): Update the expected lengths of
7553 traces: there is an added line for the discarded lookahead.
7554 * doc/bison.texinfo (Destructor Decl): Some rewording.
7555 Define "discarded" symbols.
7556
75572004-09-02 Akim Demaille <akim@epita.fr>
7558
7559 * data/lalr1.cc (translate_, destruct_): No reason to be static.
7560
75612004-09-02 Akim Demaille <akim@epita.fr>
7562
7563 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
7564 (YYDSYMPRINTF): Rename as...
7565 (YY_SYMBOL_PRINT): this.
7566 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
7567 two.
7568 Use it instead of direct symprint_ calls.
7569 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
7570 one.
7571
75722004-09-02 Akim Demaille <akim@epita.fr>
7573
7574 * data/lalr1.cc (b4_yysymprint_generate): New.
7575 (symprint_): New member function, defined when YYDEBUG.
7576 Use it consistently instead of token/nterm debugging output by
7577 hand.
7578 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
7579 %printer calls to use cdebug_ when using lalr1.cc.
7580
75812004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
7582
7583 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
7584 with #ifdef YYDEBUG.
7585
75862004-08-26 Akim Demaille <akim@epita.fr>
7587
7588 * doc/bison.texinfo (Implementing Loops): Rename as...
7589 (Implementing Gotos/Loops): this.
7590
75912004-08-13 Paul Eggert <eggert@cs.ucla.edu>
7592
7593 Adjust to latest gnulib.
7594 * bootstrap (gnulib_modules): Add xalloc-die.
7595 Set LC_ALL=C so that file names sort consistently.
7596 Prefer the gnulib copies of gettext.m4, glibc21.m4,
7597 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
7598 uintmax_t.m4, ulonglong.m4.
7599 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
7600 po.m4 since we are now using _gl.m4 instead.
7601
76022004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
7603
7604 * src/scan-action.l: Remove. Scanning of semantic actions is
7605 handled in scan-gram.l.
7606
76072004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
7608
7609 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
7610
7611 * src/location.h (struct): The file member is a uniqstr.
7612 (equal_boundaries): Use UNIQSTR_EQ for comparison.
7613
76142004-07-22 Paul Eggert <eggert@cs.ucla.edu>
7615
7616 Fix bug with non-%union parsers that have printers or destructors,
7617 which led to a Bison core dump. Reported by Peter Fales in
7618 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
7619
7620 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
7621 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
7622 not to our own type.
7623 * src/output.c (symbol_destructors_output, symbol_printers_output):
7624 Don't assume %union.
7625 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
7626 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
7627 UNION-FLAG. All callers changed.
7628 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
7629 Use type char, not unsigned int, when declaring an array of char;
7630 this lets us remove a cast.
7631 (Printers and Destructors): Add non-%union test cases.
7632
76332004-06-21 Paul Eggert <eggert@cs.ucla.edu>
7634
7635 * doc/bison.texinfo: Minor editorial changes, mostly to the new
7636 GLR writeups. E.g., avoid frenchspacing and the future tense,
7637 change "lookahead" to "look-ahead", and change "wrt" to "with
7638 respect to".
7639
76402004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7641
7642 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
7643 New sections, split off from the GLR Parsers section. Put the new
7644 Simple GLR Parser near the start of the GLR section, for clarity.
7645 Rewrite connective text.
7646
76472004-06-21 Frank Heckenbach <frank@g-n-u.de>
7648
7649 * doc/bison.texinfo (Simple GLR Parsers): New section.
7650
76512004-06-21 Paul Eggert <eggert@cs.ucla.edu>
7652
7653 * NEWS, TODO, doc/bison.texinfo:
7654 Use "look-ahead" instead of "lookahead", to be consistent.
7655 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
7656 while we're fixing "look-ahead".
7657 * src/conflicts.c (shift_set): Renamed from shiftset.
7658 (look_ahead_set): Renamed from lookaheadset.
7659 * src/print.c: Likewise.
7660 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
7661 name for "lookahead".
7662 (report_types, usage): Likewise.
7663 * src/getargs.h (report_look_ahead_tokens): Renamed from
7664 report_lookaheads.
7665 * src/lalr.c (compute_look_ahead_tokens): Renamed from
7666 compute_lookaheads.
7667 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
7668 (look_ahead_tokens_print): Renamed from lookaheads_print.
7669 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
7670 state_rule_lookaheads_print.
7671 * src/state.h: Likewise.
7672 (reductions.look_ahead_tokens): Renamed from lookaheads.
7673 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
7674 AT_DATA_LOOKAHEADS_GRAMMAR.
7675
76762004-06-03 Paul Eggert <eggert@cs.ucla.edu>
7677
7678 * README: Update location of patched M4 distribution.
7679
76802004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
7681
7682 Don't assume the C++ compiler takes the same arguments as the C compiler
7683 (trivial change).
7684 * configure.ac (O0CXXFLAGS): New var.
7685 * tests/atlocal.in (CXXFLAGS): Use it.
7686
76872004-05-29 Paul Eggert <eggert@cs.ucla.edu>
7688
7689 Fix some "make check" problems with C++ reported by
7690 Albert Chin-A-Young for Tru64 C++ in this thread:
7691 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
7692
7693 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
7694 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7695 Output to a .cc file for C++, not to a .c file.
7696 * tests/calc.at (AT_CHECK_CALC): Likewise.
7697 * tests/regression.at (AT_CHECK_DANCER): Likewise.
7698 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
7699
77002004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
7701
7702 * tests/calc.at, tests/actions.at: Workaround for SGI
7703 C++ compiler. (trivial change)
7704
77052004-05-27 Paul Eggert <eggert@cs.ucla.edu>
7706
7707 Spent a few hours checking out which prerequisite versions the
7708 current sources actually require. I went all the way back to
7709 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
7710 a seemingly endless set of combinations of versions more recent
7711 than that. The bottom line is that the current sources require
7712 fairly recent versions of the build tools, and it'll be some work
7713 to change this.
7714 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
7715 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
7716 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
7717 Add comments explaining why those particular versions are
7718 currently needed.
7719
7720 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
7721 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
7722 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
7723
7724 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
7725 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
7726
77272004-05-26 Paul Eggert <eggert@cs.ucla.edu>
7728
7729 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
7730 0.11.5. Suggested by Bruno Haible.
7731 * bootstrap: Remove gettext version checking.
7732
7733 * doc/bison.texinfo (Decl Summary): Also mention that %union
7734 can depend on prerequisite types. Problem reported by Tim
7735 Van Holder.
7736
77372004-05-25 Paul Eggert <eggert@cs.ucla.edu>
7738
7739 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
7740 * README-alpha: Don't tell people not to package this.
7741
7742 * bootstrap: Don't assume $(...) works; use `...` instead.
7743 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
7744 gettext better.
7745
7746 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
7747 put into the -d output file, and mention what to do if YYSTYPE is
7748 defined as a macro.
7749
77502004-05-24 Paul Eggert <eggert@cs.ucla.edu>
7751
7752 Undo change made earlier today: it caused autopoint to not bring
7753 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
7754 autopoint's.
7755
7756 * bootstrap: Check that gettext version matches what's in
7757 configure.ac. Warn users to ignore robots.txt ERROR 404.
7758 * bootstrap: Undo today's earlier change (logged below).
7759 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
7760
7761 The gettext version checking is causing more trouble than it's
7762 curing; remove it. Problem reported by Paul Hilfinger.
7763
7764 * bootstrap: Issue a warning that one can expect a message
7765 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
7766 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
7767
77682004-05-23 Paul Eggert <eggert@cs.ucla.edu>
7769
7770 Ensure that the C++ compiler used for testing actually works on a
7771 simple test program; if not, skip the C++-related tests. Problem
7772 reported by Vin Shelton in:
7773 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
7774
7775 * m4/cxx.m4: New file.
7776 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
7777 * tests/atlocal.in (BISON_CXX_WORKS): Add.
7778 * tests/local.at (AT_COMPILE_CXX): Use it.
7779
77802004-05-21 Paul Eggert <eggert@cs.ucla.edu>
7781
7782 * data/glr.c (yylloc): Output this macro even if locations are not
7783 being generated, as the GLR parser needs it even in that case.
7784 Problem reported by Troy A. Johnson
7785 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
7786
7787 * configure.ac (AC_INIT): Update to 1.875e.
7788
77892004-05-21 Paul Eggert <eggert@cs.ucla.edu>
7790
7791 * NEWS: Version 1.875d.
7792 * configure.ac (AC_INIT): Likewise.
7793 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
7794
7795 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
7796 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
7797 lalr1.cc runs afoul of the first, and the last two are no longer
7798 supported by GCC 3.4.0.
7799 * README: Mention GNU m4 1.4 or later; mention m4 patches.
7800 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
7801
78022004-05-06 Paul Eggert <eggert@cs.ucla.edu>
7803
7804 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
7805 unsigned int, for compatibility with latest gnulib hash module.
7806 * src/state.c (state_hash, state_hasher): Likewise.
7807 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
7808 * src/uniqstr.c (hash_uniqstr): Likewise.
7809
78102004-05-03 Paul Eggert <eggert@cs.ucla.edu>
7811
7812 * NEWS: Unescaped newlines are no longer allowed in char & strings.
7813
7814 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
7815 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
7816 character and string literals.
7817 (unexpected_end): New function.
7818 (unexpected_eof): Use it.
7819 (unexpected_newline): New function.
7820 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
7821 actions.
7822
7823 * NEWS: Document %expect-rr.
7824
7825 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
7826 Fix typo by replacing $1 with $option.
7827 Remove more 'intl'-related files.
7828 Don't DEFUN AM_INTL_SUBDIR twice.
7829
7830 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
7831 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
7832 strtoul.c.
7833 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
7834 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
7835 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
7836 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
7837 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
7838 * src/.cvsignore: Add *.output.
7839
7840 * src/parse-gram.y: Put copyright notice inside %{ %} so it
7841 gets copied to the output file.
7842
78432004-04-28 Paul Eggert <eggert@twinsun.com>
7844
7845 Get files from the gnulib and po repositories, instead of relying
7846 on them being in our CVS. Upgrade to latest versions of gnulib
7847 and Automake.
7848
7849 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
7850 * bootstrap: Bootstrap from gnulib and po repositories.
7851 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
7852 * README-cvs: Document these changes. Remove version numbers from
7853 mentions of build tools, since they change so often. Mention Flex.
7854
7855 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
7856 (gl_USE_SYSTEM_EXTENSIONS): Add.
7857 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
7858 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
7859 does this for us.
7860 (AC_ISC_POSIX): Remove; we no longer support this
7861 ancient OS, as it gets in the way of latest Autoconf & gnulib.
7862 (AC_HEADER_STDC): Remove: we now assume C89 or better.
7863 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
7864 Do not check for C89 headers, except for locale.h which is used
7865 by the Yacc library and must port to K&R hosts.
7866 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
7867 Do not check for C89 functions, except for setlocale which is
7868 used by the Yacc library.
7869 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
7870 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
7871 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
7872 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
7873 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
7874 AM_GNU_GETTEXT): Remove; now done by:
7875 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
7876 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
7877 for us.
7878
7879 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
7880 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
7881 Define to empty, as gnulib.mk will do the rest for us.
7882 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
7883 for us.
7884 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
7885 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
7886
7887 * src/files.c: Include gnulib's xstrndup.h.
7888
7889 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
7890 (REALLOC): Use xnrealloc, for likewise.
7891 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
7892 (strnlen, memrchr): Remove decls; functions no longer used.
7893 Include <stpcpy.h>.
7894
7895 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
7896 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
7897 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
7898 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
7899 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
7900 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
7901 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
7902 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
7903 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
7904 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
7905 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
7906 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7907 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
7908 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
7909 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
7910 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
7911 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
7912 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
7913 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
7914 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
7915 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
7916 Remove, as these files are now generated automatically
7917 by bootstrap or automake.
7918
7919 * po/ChangeLog: Remove: all but one entry was a duplicate
7920 of this file, and I moved that 2000-11-02 entry here.
7921
7922 * config/.cvsignore: Add Makefile, depcomp, install-sh.
7923 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
7924 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
7925 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
7926 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
7927 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
7928 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
7929 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
7930 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
7931 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
7932 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
7933 xstrndup.h.
7934 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
7935 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
7936 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
7937 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
7938 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
7939 * src/.cvsignore: Remove *_.c.
7940
7941
7942 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
7943 support it. (The latest stable gzip doesn't.)
7944
79452004-04-27 Paul Eggert <eggert@twinsun.com>
7946
7947 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
7948 case, as stos_ is now used by destructors due to the 2004-02-09
7949 change.
7950
7951 Remove more K&R C support.
7952 * lib/libiberty.y (PARAMS): Remove. All uses removed.
7953 * lib/subpipe.c (errno): Remove decl.
7954 Include <stdlib.h> unconditionally.
7955 (EXIT_FAILURE): Remove macro.
7956 * src/complain.c (vfprintf, strerror): Remove.
7957 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
7958 unconditionally.
7959 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
7960 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
7961 (strchr, strspn, memchr): Remove decls.
7962 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
7963 unconditionally. Do not declare perror.
7964 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
7965 unconditionally.
7966
7967 * src/complain.c (_): Remove useless defn, as system.h defines this.
7968
7969 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
7970 with latest obstack.h.
7971 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
7972 to procedure types, as obstack.h now does that for us.
7973 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
7974
7975 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
7976 so that this include file can stand alone.
7977 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
7978 does this now. Include subpipe.h first after config.h, to
7979 test whether it can stand alone.
7980
7981 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
7982 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
7983 unused declaration.
7984
7985 * tests/synclines.at (%union synch line): Put a dummy member in
7986 the union, because empty unions aren't allowed in C. Caught
7987 by GCC 3.4.0.
7988
79892004-04-13 Jim Meyering <jim@meyering.net>
7990
7991 * src/conflicts.c (conflicts_print): Correct format string typo:
7992 use `%%' to produce literal `%'. (trivial change)
7993
79942004-03-30 Paul Eggert <eggert@twinsun.com>
7995
7996 * src/getargs.c (version): Update copyright year to 2004.
7997
7998 * data/c.m4 (b4_int_type): Use 'short int' rather than
7999 'short', and similarly for 'long', 'unsigned', etc.
8000 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
8001 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
8002 yy_yypstack, yydumpstack): Likewise.
8003 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
8004 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
8005 Likewise.
8006 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
8007 yy_stack_print, yyparse): Likewise.
8008 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
8009 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
8010 * lib/bitset.c (bitset_print): Likewise.
8011 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
8012 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8013 * lib/bitsetv.c (bitsetv_dump): Likewise.
8014 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
8015 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
8016 Likewise.
8017 * src/LR0.c (allocate_itemsets): Likewise.
8018 * src/gram.h (rule_number, rule): Likewise.
8019 * src/lalr.h (goto_number): Likewise.
8020 * src/nullable.c (nullable_compute): Likewise.
8021 * src/output.c (prepare_rules): Likewise.
8022 * src/relation.c (relation_print, relation_digraph): Likewise.
8023 * src/relation.h (relation_node): Likewise.
8024 * src/state.h (state_number, transitions, errs, reductions,
8025 struct state): Likewise.
8026 * src/symtab.h (symbol_number, struct symbol): Likewise.
8027 * src/tables.c (vector_number, tally, action_number,
8028 default_goto, goto_actions): Likewise.
8029 * tests/existing.at (GNU Cim Grammar): Likewise.
8030 * tests/regression.at (Web2c Actions): Likewise.
8031
8032 * src/output.c (muscle_insert_short_int_table): Renamed from
8033 muscle_insert_short_table. All uses changed.
8034
80352004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8036
8037 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
8038 (declaration): Replace expected_conflicts with expected_sr_conflicts.
8039 Add %expect-rr rule.
8040
8041 * src/scan-gram.l: Recognize %expect-rr.
8042
8043 * src/conflicts.h (expected_sr_conflicts): Rename from
8044 expected_conflicts.
8045 (expected_rr_conflicts): Declare.
8046
8047 * src/conflicts.c (expected_sr_conflicts): Rename from
8048 expected_conflicts.
8049 (expected_rr_conflicts): Define.
8050 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
8051 for GLR parsers.
8052 Use expected_sr_conflicts in place of expected_conflicts.
8053 Warn if expected_rr_conflicts used in non-GLR parser.
8054
8055 * doc/bison.texinfo: Add documentation for %expect-rr.
8056
80572004-03-08 Paul Eggert <eggert@gnu.org>
8058
8059 Add support for hex token numbers. Suggested by Odd Arild Olsen in
8060 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
8061
8062 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
8063 in lalr1.cc.
8064 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
8065 * src/scan-gram.l (scan_integer): New function.
8066 ({int}): Use it.
8067 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
8068 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
8069 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
8070 Say "long int", not "long", for uniformity with GNU style.
8071
80722004-02-25 Paul Eggert <eggert@twinsun.com>
8073
8074 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
8075 compilers. This fixes a problem with Intel's C++ compiler being
8076 chatty, reported by Guido Trentalancia in
8077 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
8078
80792004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
8080
8081 Support %destructor and merge error locations in lalr1.cc.
8082
8083 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
8084 (Parser::stos_): Define unconditionally.
8085 (Parser::destruct_): New method. Generate its body with
8086 b4_yydestruct_generate.
8087 (Parser::error_start_): New attribute.
8088 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
8089 token which are discarded.
8090 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
8091 error_start_ when erroneous token are discarded.
8092 (Parser::parse) <yyerrlab1>: Compute the location of the error
8093 token so that it covers all the discarded tokens.
8094 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
8095 it can be called with `%skeleton "lalr1.cc"', and do that.
8096
80972004-02-02 Paul Eggert <eggert@twinsun.com>
8098
8099 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
8100 $(top_srcdir)/lib and ../lib. This fixes a bug reported
8101 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
8102 There's no need to mention top_builddir since Automake does that
8103 for us.
8104 (INCLUDES): Remove, as Automake says it's obsolescent.
8105 Contents migrated into AM_CPPFLAGS as described above.
8106 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
8107
81082004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8109
8110 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
8111 (yyreportSyntaxError): Handle case where lookahead token is
8112 YYEMPTY.
8113
81142004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8115
8116 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
8117 resulting parsers are compilable with C++.
8118
81192003-12-23 Paul Eggert <eggert@twinsun.com>
8120
8121 * config/depcomp, config/install-sh: Sync with Automake 1.8.
8122 * src/output.c (output_skeleton): Rename local var.
8123 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
8124 Bison tokens, as this runs afoul of the 2003-10-07 change that
8125 disallowed NUL bytes in character constants or string literals.
8126
8127 * tests/local.at: Require Autoconf 2.59's Autotest.
8128 * tests/testsuite.at: Don't include local.at, since we now assume
8129 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
8130 including it.
8131 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
8132 multiple inclusion warnings.
8133
81342003-12-02 Akim Demaille <akim@epita.fr>
8135
8136 * doc/bison.texinfo (How Can I Reset the Parser): More about start
8137 conditions.
8138 From Bruno Haible.
8139
81402003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
8141
8142 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
8143
81442003-10-07 Paul Eggert <eggert@twinsun.com>
8145
8146 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
8147 if testsuite doesn't exist.
8148
8149 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
8150 literals, unfortunately.
8151 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
8152 Complain about NUL bytes in character constants or string literals.
8153
81542003-10-05 Paul Eggert <eggert@twinsun.com>
8155
8156 * NEWS: Don't document %no-default-prec, as it's still
8157 too experimental.
8158 * doc/bison.texinfo: Document %no-default-prec only if
8159 the defaultprec flag is set. Normally it's not.
8160
81612003-10-04 Paul Eggert <eggert@twinsun.com>
8162
8163 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
8164 non-modifiable lvalue, instead of a modifiable one.
8165 * doc/bison.texinfo (Actions): Document that $$ can
8166 be assigned to. Do not claim that $$ and $N are
8167 array element references: user code should not rely on this.
8168
81692003-10-01 Paul Eggert <eggert@twinsun.com>
8170
8171 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
8172 (grammar_declaration): Use it.
8173 * src/scan-gram.l: New token %no-default-prec.
8174 * tests/conflicts.at: Revamp tests to use %no-default-prec.
8175 * NEWS, doc/bison.texinfo: Document the above.
8176
81772003-10-01 Akim Demaille <akim@epita.fr>
8178
8179 VCG no longer supports long_straight_phase.
8180
8181 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
8182 * src/print_graph.c (print_graph): Adjust.
8183
81842003-09-30 Frank Heckenbach <frank@g-n-u.de>
8185 and Paul Eggert <eggert@twinsun.com>
8186
8187 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
8188 Table of Symbols): Document %default-prec.
8189 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
8190 (grammar_declaration): Set default_prec on %default-prec.
8191 * src/scan-gram.l (%default-prec): New token.
8192 * src/reader.h (default_prec): New flag.
8193 * src/reader.c: Likewise.
8194 (packgram): Handle it.
8195 * tests/conflicts.at (%default-prec without %prec,
8196 %default-prec with %prec, %default-prec 1): New tests.
8197
81982003-09-30 Paul Eggert <eggert@twinsun.com>
8199
8200 * tests/testsuite.at: Include local.at, not input.at, fixing
8201 a typo in the 2003-08-25 patch.
8202
82032003-08-27 Akim Demaille <akim@epita.fr>
8204
8205 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
8206 GCC warnings.
8207
82082003-08-26 Akim Demaille <akim@epita.fr>
8209
8210 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
8211 "<\#" to avoid magic from Gnus when posting parts of this script.
8212
82132003-08-26 Akim Demaille <akim@epita.fr>
8214
8215 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
8216 (Parser::parse): here.
8217 Adjust: nerrs and errstatus is now replaced by...
8218 (Parser::nerrs_, Parser::errstatus_): New.
8219
82202003-08-25 Akim Demaille <akim@epita.fr>
8221
8222 * config/announce-gen, Makefile.cfg: New.
8223 * Makefile.am: Adjust.
8224 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
8225 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
8226
82272003-08-25 Akim Demaille <akim@epita.fr>
8228
8229 When reducing initial empty rules, Bison parser read an initial
8230 location that is not defined. This results in garbage, and that
8231 affects Bison's own parser. Therefore we need (i) to extend Bison
8232 to support a means to initialize this location, and (ii) to use
8233 this CVS Bison to fix CVS Bison's parser.
8234
8235 * src/reader.h, reader.c (epilogue_augment): Remove, replace
8236 with...
8237 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
8238 * src/parse-gram.y: Adjust.
8239 (%initial-action): New.
8240 (%error-verbose): Since we require CVS Bison, there is no reason
8241 not to use it.
8242 * src/scan-gram.l: Adjust.
8243 * src/Makefile.am (YACC): New, to make sure we use our own parser.
8244 * data/yacc.c (yyparse): Use b4_initial_action.
8245
82462003-08-25 Akim Demaille <akim@epita.fr>
8247
8248 * doc/bison.texinfo: Don't promote stdout for error messages.
8249
82502003-08-25 Akim Demaille <akim@epita.fr>
8251
8252 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
8253 From Alexandre Duret-Lutz.
8254
82552003-08-25 Akim Demaille <akim@epita.fr>
8256
8257 Version 1.875c.
8258
82592003-08-25 Akim Demaille <akim@epita.fr>
8260
8261 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
8262 Use them.
8263
82642003-08-25 Akim Demaille <akim@epita.fr>
8265
8266 * data/lalr1.cc (Parser::reduce_print_): New.
8267 Use it.
8268
82692003-08-25 Akim Demaille <akim@epita.fr>
8270
8271 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
8272 error recovery loops. This patch is based on
8273 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
8274 Also, augment the similarity between lalr1.cc and yacc.c.
8275 Note: the locations of error recovery rules are not correct yet.
8276
8277 * data/lalr1.cc: Comment changes to augment the similarity between
8278 lalr1.cc and yacc.c.
8279 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
8280 (yyerrlab1): Remove, but where it used to be (now the bottom part of
8281 yyerrlab), when hitting EOF, pop the whole stack here instead of
8282 merely falling thru the default error handling mechanism.
8283 (yyerrorlab): New label, with the old contents of YYERROR,
8284 plus the following change: pop the stack of rhs corresponding
8285 to the production that invoked YYERROR. That is how Yacc
8286 behaves (required by POSIX).
8287 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
8288 fail.
8289
82902003-08-25 Akim Demaille <akim@epita.fr>
8291
8292 Tune local.at so that people can "autom4te -l autotest calc.at -o
8293 calc" for instance, to extract a sub test suite.
8294
8295 * tests/testsuite.at: Move the initialization, Autotest version
8296 requirement, and AT_TESTED invocation into...
8297 * tests/local.at: here.
8298 * tests/testsuite.at: Include it for compatibility with Autoconf
8299 2.57.
8300 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
8301 be ignore.
8302
83032003-08-04 Paul Eggert <eggert@twinsun.com>
8304
8305 Rework code slightly to avoid gcc -Wtraditional warnings.
8306 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
8307 The returned value is now stored in *YY0. All callers changed.
8308 * src/output.c (merge_output): Adjust to the above change.
8309
83102003-07-26 Paul Eggert <eggert@twinsun.com>
8311
8312 * data/glr.c (YYASSERT): New macro.
8313 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
8314 yyresolveStates, yyprocessOneStack):
8315 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
8316 Derived from a suggestion by Frank Heckenbach.
8317
83182003-07-25 Paul Eggert <eggert@twinsun.com>
8319
8320 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
8321 for portability to K&R C (after ansi2knr, presumably). See
8322 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
8323 by Frank Heckenbach, though I have omitted the structure-initialization
8324 part of his glr-knr.diff patch since I recall that the Portable
8325 C Compiler didn't require that change.
8326
8327 Let the user specify how to allocate and free memory.
8328 Derived from a suggestion by Frank Heckenbach in
8329 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
8330 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
8331 All uses of free, malloc, realloc changed to use these macros,
8332 and unnecessary casts removed.
8333 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
8334
83352003-07-06 Matthias Mann <MatthiasMann@gmx.de>
8336
8337 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
8338 use s.empty() rather than s == "" to test for empty string; see
8339 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
8340 (trivial change)
8341
83422003-06-25 Akim Demaille <akim@epita.fr>
8343
8344 * config/depcomp, config/install-sh: Update from masters.
8345
83462003-06-20 Paul Eggert <eggert@twinsun.com>
8347
8348 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
8349 and return properly parenthesized result.
8350 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
8351 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8352 Remove unnecessary parentheses from uses.
8353 * doc/bison.texinfo (Location Default Action): Describe the
8354 conventions for parentheses.
8355
83562003-06-19 Paul Eggert <eggert@twinsun.com>
8357
8358 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
8359 yyreportTree): Do not assume that size_t is the same width as int,
8360 when printing sizes. Print sizes using an unsigned format.
8361 Problem reported by Frank Heckenbach in
8362 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
8363
8364 Port to Forte Developer 7 C compiler.
8365 * data/glr.c (struct YYLTYPE): If locations are not being used,
8366 declare a single dummy member, as empty structs do not conform
8367 to the C standard.
8368 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
8369 the Forte Developer 7 C compiler complains that end-of-loop
8370 code is not reached.
8371
83722003-06-17 Paul Eggert <eggert@twinsun.com>
8373
8374 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
8375 avoid warnings from picky compilers about redefinition of PARAMS.
8376
83772003-06-17 Paul Eggert <eggert@twinsun.com>
8378
8379 Version 1.875b.
8380
8381 * NEWS: Document 1.875b.
8382
8383 * lib/bbitset.h: Do not include config.h; that's the includer's job.
8384 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
8385 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
8386 Don't use 'index' in comments, as it's a builtin fn on some hosts.
8387 * lib/bitset_stats.c: Include gettext.h unconditionally, as
8388 per recent gettext manual's suggestion.
8389 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
8390 Use prototypes, not old-style definitions.
8391 * lib/lbitset.c (lbitset_unused_clear): Likewise.
8392 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
8393 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
8394 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
8395 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
8396 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
8397 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
8398 vbitset_or_and_cmp, vbitset_copy): Likewise.
8399
8400 * lib/libiberty.h: Do not include config.h; that's the includer's job.
8401 Do not include <stdlib.h>.
8402 (PARAMS): Define unconditionally for C89.
8403 (ATTRIBUTE_NORETURN): Remove.
8404 (ATTRIBUTE_UNUSED): Define unconditionally.
8405
8406 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
8407 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8408 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
8409 * lib/vbitset.c, lib/vbitset.h: New files.
8410 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
8411 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
8412 from libbitset.
8413
8414 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
8415 `How Can I Reset @code{yyparse}', since texinfo does not allow
8416 arbitrary @ in node names.
8417
8418 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
8419 shouldn't be needed according to the gettext 0.12.1 documentation
8420 but which seem to be needed anyway: codeset.m4 glibc21.m4
8421 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8422 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
8423 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
8424
8425 * lib/.cvsignore: Add stdbool.h.
8426 * m4/.cvsignore: Add nls.m4, po.m4.
8427
8428 Upgrade to CVS gnulib.
8429 * stdbool_.h: File renamed from stdbool.h.in.
8430 * configure.ac (AM_STDBOOL_H): Invoke this instead of
8431 AC_HEADER_STDBOOL.
8432 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
8433 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
8434 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
8435 (MOSTLYCLEANFILES): New var.
8436 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
8437 (stdbool.h): New rule.
8438 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
8439 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
8440 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
8441 m4/quote.m4: Upgrade to today's gnulib.
8442
8443 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
8444 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
8445 the tests right now.
8446 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
8447 yyerror are declared before use; C99 requires this.
8448
84492003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8450
8451 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
8452 first.
8453 (yyrecoverSyntaxError): Correct the logic for setting and testing
8454 yyerrState.
8455 Correct comment on handling EOF.
8456 Allow states with only a default reduction, rather than failing
8457 (I can't quite reconstruct why these were not allowed before).
8458
8459 Fixes to avoid problem that $-N rules in GLR parsers can cause
8460 buffer overruns, corrupting state.
8461
8462 * src/output.c (prepare_rules): Output max_left_semantic_context
8463 definition.
8464 * src/reader.h (max_left_semantic_context): New variable declaration.
8465 * src/scan-gram.l (max_left_semantic_context): Define.
8466 (handle_action_dollar): Update max_left_semantic_context.
8467 * data/glr.c (YYMAXLEFT): New definition.
8468 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
8469 (yyresolveAction): Ditto.
8470
8471 Fixes to problems with location handling in GLR parsers reported by
8472 Frank Heckenbach (2003/06/05).
8473
8474 * data/glr.c (YYLTYPE): Make trivial if locations not used.
8475 (YYRHSLOC): Add parentheses, and define only if locations used.
8476 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
8477 locations not used.
8478 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
8479 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8480
8481 * tests/cxx-type.at: Exercise location information; update tests
8482 to differentiate output with and without locations.
8483 Remove forward declarations of yylex and yyerror---caused errors
8484 because default YYLTYPE not yet defined.
8485 Change semantic actions to compute strings, rather than printing
8486 them directly (to test proper passing of semantics values). Change
8487 output to prefix notation and update test data and expected results.
8488 (yylex): Track locations.
8489 (stmtMerge): Return value rather than printing, and include arguments
8490 in value.
8491
84922003-06-03 Paul Eggert <eggert@twinsun.com>
8493
8494 Avoid warnings generated by GCC 2.95.4 when Bison is
8495 configured with --enable-gcc-warnings.
8496 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
8497 yy::]b4_parser_class_name[::translate_,
8498 yy::Stack::operator[] (unsigned),
8499 yy::Stack::operator[] (unsigned) const,
8500 yy::Slice::operator[] (unsigned),
8501 yy::Slice::operator[] (unsigned) const):
8502 Rename local vars to avoid warnings.
8503 * tests/glr-regression.at (Improper handling of embedded actions
8504 and $-N in GLR parsers): Remove unused local variable from yylex.
8505 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
8506 (void) as arg when not pure, since we now assume C89 when building
8507 Bison. Pacify GCC by using parameter.
8508
85092003-06-02 Paul Eggert <eggert@twinsun.com>
8510
8511 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
8512 yy::Location::lines, yy::Location::columns): Rename arguments
8513 to avoid shadowing; this removes a warning generated by GCC 3.3.
8514
85152003-06-01 Paul Eggert <eggert@twinsun.com>
8516
8517 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
8518 to g++, as GCC 3.3 complains if you do it.
8519 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
8520 everything that WARNING_CFLAGS has, except omit warnings
8521 not suitable for C++.
8522 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
8523 * tests/atlocal.in (CXXFLAGS): New var.
8524 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
8525
8526 Fix a GLR parser bug I reported in February; see
8527 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
8528 The problem was that GLR parsers did not conform to the C standard,
8529 because actions like { $1 = $2 + $3; } expanded to expressions
8530 that invoked YYFILL in separate subexpressions, and YYFILL assigned
8531 to a local variable. The C standard says that expressions
8532 like (var = f ()) + (var = f ()) have undefined behavior.
8533 Another problem was that GCC sometimes issues warnings that
8534 yyfill and its parameters are unused.
8535
8536 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
8537 as possibly unused.
8538 (yyfill): New function.
8539 (YYFILL): Use it.
8540 (yyuserAction): Change type of yynormal to bool, so that it matches
8541 the new yyfill signature. Mark it as possibly unused.
8542
8543
8544 Follow up on a bug I reported in February, where a Bison-generated
8545 parser can loop. Provide a test case and a fix for yacc.c. I
8546 don't have a fix for lalr1.cc or for glr.c, unfortunately.
8547 The original bug report is in:
8548 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
8549
8550 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
8551 macro's size was becoming unwieldy.
8552 (yyerrlab): Do not discard an empty lookahead symbol, as this
8553 might destroy garbage.
8554 (yyerrorlab): New label, with the old contents of YYERROR,
8555 plus the following change: pop the stack of rhs corresponding
8556 to the production that invoked YYERROR. That is how Yacc
8557 behaves, and POSIX requires this behavior.
8558 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
8559 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
8560 Define 'alarm' to do nothing if unistd.h is not available.
8561 Add a new rule "exp: '-' error;" to test the above change to
8562 data/yacc.c. Use 'alarm' to abort any test taking longer than
8563 10 seconds, as it's probably looping.
8564 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
8565 Also, the new yacc.c generates two fewer diagnostics for an
8566 existing test.
8567
85682003-05-24 Paul Eggert <eggert@twinsun.com>
8569
8570 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
8571 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
8572 This fixes a problem reported by John Bowman when the Compaq/HP
8573 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
8574 -ansi -Wall -gall).
8575 * data/yacc.c (union yyalloc): Likewise.
8576 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
8577
8578 Switch from 'int' to 'bool' where that makes sense.
8579
8580 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
8581 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
8582 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
8583 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
8584 Return or accept bool, not int. All callers changed.
8585 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
8586 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
8587 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
8588 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
8589 bitset_or_and_cmp_): Likewise.
8590 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
8591 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
8592 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
8593 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
8594 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
8595 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
8596 bitset_stats_or_and_cmp): Likewise.
8597 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
8598 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
8599 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
8600 ebitset_xor_cmp): Likewise.
8601 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
8602 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
8603 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
8604 lbitset_xor_cmp): Likewise.
8605 * lib/bbitset.h: Include <stdbool.h>.
8606 (struct bitset_vtable): The following members now return bool, not
8607 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
8608 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
8609 or_and_cmp).
8610 * src/conflicts.c (count_rr_conflicts): Likewise.
8611 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
8612 All uses changed.
8613 * lib/ebitset.c (ebitset_obstack_init): Likewise.
8614 * lib/lbitset.c (lbitset_obstack_init): Likewise.
8615 * src/getargs.c (debug_flag, defines_flag, locations_flag,
8616 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
8617 graph_flag): Likewise.
8618 * src/getargs.h (debug_flag, defines_flag, locations_flag,
8619 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
8620 graph_flag): Likewise.
8621 * src/output.c (error_verbose): Likewise.
8622 * src/output.h (error_verbose): Likewise.
8623 * src/reader.c (start_flag, typed): Likewise.
8624 * src/reader.h (typed): Likewise.
8625 * src/getargs.c (LOCATIONS_OPTION): New constant.
8626 (long_options, getargs): Use it.
8627 * src/lalr.c (build_relations): Use bool, not int.
8628 * src/nullable.c (nullable_compute): Likewise.
8629 * src/print.c (print_reductions): Likewise.
8630 * src/tables.c (action_row, pack_vector): Likewise.
8631 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
8632 * src/output.c (prepare): Use it.
8633 * src/output.c (token_definitions_output,
8634 symbol_destructors_output, symbol_destructors_output): Use string,
8635 not boolean integer, to keep track of whether to output separator.
8636 * src/print_graph.c (print_core): Likewise.
8637 * src/state.c (state_rule_lookaheads_print): Likewise.
8638
8639 * config/install-sh: Sync from automake 1.7.5.
8640
86412003-05-14 Paul Eggert <eggert@twinsun.com>
8642
8643 * src/parse-gram.y (rules_or_grammar_declaration): Require a
8644 semicolon after a grammar declaration, in the interest of possible
8645 future changes to the Bison input language.
8646 Do not allow a stray semicolon at the start of the grammar.
8647 (rhses.1): Allow one or more semicolons after any rule, including
8648 just before "|" as required by POSIX.
8649 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
8650 grammar.
8651
86522003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
8653
8654 %parse-param support for lalr1.cc.
8655
8656 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
8657 b4_cc_constructor_calls, b4_cc_constructor_call,
8658 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
8659 definitions.
8660 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
8661 parse-param arguments.
8662 (yy::b4_parser_class_name): Declare instance variables to
8663 hold parse-param arguments.
8664 * tests/calc.at: s/value/semantic_value/ because value clashes
8665 with a member of yy::b4_parser_class_name. Adjust C++ code
8666 to handle %parse-param. Enable %parse-param test in C++.
8667
86682003-05-12 Paul Eggert <eggert@twinsun.com>
8669
8670 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
8671 English a bit. Fix fclose typo. Change "const char" to "char
8672 const", and use ANSI C rather than K&R for "main". Suggest
8673 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
8674 and suggest yy_switch_to_buffer.
8675
86762003-05-05 Paul Eggert <eggert@twinsun.com>
8677
8678 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
8679 C89. This avoids a diagnostic on compilers that define __STDC__
8680 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
8681 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
8682
86832003-05-03 Paul Eggert <eggert@twinsun.com>
8684
8685 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
8686 Do not overrun array bounds.
8687 This should fix a bug reported today by Olatunji Oluwabukunmi in
8688 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
8689
86902003-04-29 Akim Demaille <akim@epita.fr>
8691
8692 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
8693 * src/getargs.c, src/getargs.h: here, as bool, not int.
8694 (nondeterministic_parser): New.
8695 * src/parse-gram.y, src/scan-gram.l: Support
8696 %nondeterministic-parser.
8697 * src/output.c (prepare): Use nondeterministic_parser instead
8698 of glr_parser where appropriate.
8699 * src/tables.c (conflict_row, action_row, save_row)
8700 (token_actions, token_actions, pack_vector): Ditto.
8701
87022003-04-29 Akim Demaille <akim@epita.fr>
8703
8704 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
8705
87062003-04-29 Akim Demaille <akim@epita.fr>
8707
8708 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
8709 with %pure-parser and %locations to exercise the patch from Yakov
8710 Markovitch below.
8711
87122003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
8713
8714 * data/yacc.c: (b4_lex_param): Corrected for the case where
8715 %lex-param is provided and %pure-parser isn't.
8716
87172003-04-27 Paul Eggert <eggert@twinsun.com>
8718
8719 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
8720 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
8721 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
8722 if it is not defined.
8723 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
8724
87252003-04-26 Paul Eggert <eggert@twinsun.com>
8726
8727 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
8728 Declare to be of type suitable for the ninf value itself, not of
8729 type suitable for the corresponding table, since the latter might
8730 be unsigned but the ninf value might be negative. This fixes a
8731 bug reported by Alexandre Duret-Lutz in
8732 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
8733
8734 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
8735 invokes it. We shouldn't invoke it twice because it will attempt
8736 to put error.o in the archive twice. This fixes a glitch reported
8737 by Martin Mokrejs in
8738 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
8739
87402003-04-21 Paul Eggert <eggert@twinsun.com>
8741
8742 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
8743 to gnulib.
8744
87452003-04-21 Yakov Markovitch <Markovitch@iso.ru>
8746
8747 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
8748 Fix obvious typo that results in uncompilable GLR parsers
8749 when both %pure-parser and %locations are used. (trivial change)
8750
87512003-04-17 Paul Eggert <eggert@twinsun.com>
8752
8753 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
8754 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
8755 Do not insert the expected token via unput, as this runs afoul
8756 of a POSIX-compatibility bug in flex 2.5.31.
8757 All uses changed to BEGIN the parent state,
8758 since we no longer insert the expected token via unput.
8759 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
8760 that is no longer emitted after the above change.
8761
8762 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
8763 the first one. This change is from Paul Hilfinger, and it fixes
8764 regression reported by Werner Lemberg in
8765 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
8766
8767 (resolve_sr_conflict): Don't invoke state_errs_set
8768 unless one or more tokens have been explicitly made errors.
8769 Otherwise, the above change causes Bison to abort.
8770
8771 * tests/existing.at (GNU pic Grammar): New test case, taken from
8772 Lemberg's email.
8773
87742003-03-31 Akim Demaille <akim@epita.fr>
8775
8776 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
8777
87782003-03-31 Akim Demaille <akim@epita.fr>
8779
8780 * src/output.c (prepare_symbols): Avoid trailing spaces in the
8781 output.
8782
87832003-03-31 Akim Demaille <akim@epita.fr>
8784
8785 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
8786 From Paul Hilfinger.
8787
87882003-03-29 Akim Demaille <akim@epita.fr>
8789
8790 * m4/error.m4: Do not put under dynamic conditions some code which
8791 expansion is under static control.
8792
87932003-03-29 Akim Demaille <akim@epita.fr>
8794
8795 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
8796
87972003-03-29 Akim Demaille <akim@epita.fr>
8798
8799 * doc/bison.texinfo (Strings are Destroyed): New.
8800
88012003-03-13 Paul Eggert <eggert@twinsun.com>
8802
8803 * .cvsignore: Add configure.lineno.
8804 * src/.cvsignore: Add yacc.
8805 * tests/.cvsignore: Add testsuite.log.
8806 * doc/fdl.texi: Sync with latest FSF version.
8807
88082003-03-12 Paul Eggert <eggert@twinsun.com>
8809
8810 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
8811 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
8812 cursor, instead of leaving it undefined. This fixes a bug
8813 reported by Tim Van Holder in
8814 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
8815 * tests/input.at (Torturing the Scanner): Test the scanner on
8816 an empty input file, which was Tim Van Holder's test case.
8817
8818 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
8819 <sys/resource.h> can be included, include sys/time.h and
8820 sys/times.h first, if available. This works around the SunOS
8821 4.1.4 porting bug reported by Bruce Becker in
8822 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
8823
8824 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
8825 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
8826 AC_HEADER_SYS_WAIT.
8827
8828 Merge changes from gnulib. This was prompted because the CVS
8829 snapshot didn't build on Solaris 7 due to strnlen problems.
8830
8831 These changes need to be merged back into gnulib:
8832 * lib/hash.c: Include <stdbool.h> unconditionally.
8833 * m4/onceonly.m4 (m4_quote): New macro.
8834 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
8835 Quote AC_FOREACH variable-expansions properly.
8836 The 2003-01-03 obstack.h change also needs merging.
8837 {end of changes requiring merging}
8838
8839 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8840 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
8841 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
8842 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
8843 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
8844 New files, imported from gnulib.
8845 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
8846 above.
8847
8848 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
8849 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
8850 gnulib sources.
8851
8852 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
8853 Add.
8854 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
8855 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
8856 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
8857 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
8858 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
8859 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
8860 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
8861 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
8862 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
8863 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
8864 (jm_PREREQ_ARGMATCH): Remove.
8865 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
8866 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
8867
8868 * src/system.h: Include <stdbool.h> unconditionally.
8869
8870 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
8871 assuming at least C89 in the bitset code for some time now.
8872
88732003-03-03 Akim Demaille <akim@epita.fr>
8874
8875 * ro.po: New.
8876
88772003-03-02 Akim Demaille <akim@epita.fr>
8878
8879 * doc/bison.texinfo (Table of Symbols): Reactivate the
8880 documentation for %lex-param, and %parse-param.
8881
88822003-03-02 Akim Demaille <akim@epita.fr>
8883
8884 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
8885 generate verbose error messages.
8886 Use the number of tokens as an upper bound in yytname, as it
8887 cannot be a non terminal.
8888
88892003-03-02 Akim Demaille <akim@epita.fr>
8890
8891 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
8892 message.
8893
88942003-03-02 Akim Demaille <akim@epita.fr>
8895
8896 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
8897 Use them to exercise yycheck overrun.
8898 Based on Andrew Suffield's grammar.
8899
89002003-03-02 Akim Demaille <akim@epita.fr>
8901
8902 Create tests/local.at for Bison generic testing macros.
8903
8904 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
8905 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
8906 This new file.
8907 * tests/calc.at (AT_CHECK_CALC): Adjust.
8908 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
8909 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
8910 * tests/local.at: here.
8911 (AT_COMPILE_CXX): Tags the tests using it as c++.
8912 Ignore the test if CXX is not functional.
8913
89142003-03-01 Paul Eggert <eggert@twinsun.com>
8915
8916 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
8917 not loc->end, since loc->end might contain garbage and this leads
8918 to undefined behavior on some platforms.
8919 (id_loc, token_start): Use (IF_LINTed) initial values that do not
8920 depend on *loc, so that the reader doesn't give the the false
8921 impression that *loc is initialized.
8922 (<INITIAL>"%%"): Do not bother setting code_start, since its value
8923 does not survive the return.
8924
89252003-03-01 Akim Demaille <akim@epita.fr>
8926
8927 * src/scan-gram.l (code_start): Always initialize it when entering
8928 into yylex, as SC_EPILOGUE is activated *before* the corresponding
8929 yylex invocation. An alternative would be making it static, but
8930 then it starts with the second %%'s beginning, instead of its end.
8931
89322003-02-28 Paul Eggert <eggert@twinsun.com>
8933
8934 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
8935 around a UnixWare 7.1.1 porting bug reported by John Hughes in
8936 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
8937
89382003-02-26 Paul Eggert <eggert@twinsun.com>
8939
8940 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
8941 Remove Sequent/Pyramid discussion (nobody uses them any more).
8942 Merge VMS and MS-DOS discussion; these ports may well be dead
8943 but let's keep mentioning them for now. Put <> around email
8944 addresses. Add copyright notice.
8945
89462003-02-24 Paul Eggert <eggert@twinsun.com>
8947
8948 * data/glr.c (yy_reduce_print): yylineno -> yylno,
8949 to avoid collision with flex use of yylineno.
8950 Problem reported by Bruce Lilly in
8951 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
8952 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
8953 * data/yacc.c (yy_reduce_print): Likewise.
8954
8955 * config/depcomp: Sync with Automake 1.7.3.
8956
89572003-02-21 Akim Demaille <akim@epita.fr>
8958
8959 * data/lalr1.cc: Use temporary variables instead of casts to
8960 change integer types.
8961 Suggested by Paul Eggert.
8962
89632003-02-21 Akim Demaille <akim@epita.fr>
8964
8965 * doc/bison.texinfo: Use "location" consistently to refer to @n,
8966 to avoid confusions with lalr1.cc's notion of Position.
8967 Suggested by Paul Eggert.
8968
89692003-02-20 Akim Demaille <akim@epita.fr>
8970
8971 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
8972 before initial_columns.
8973 (location.hh): Use consistent variable names when defining the
8974 operator<<.
8975 Use "last" so that we subtract from Positions, not from unsigned.
8976
89772003-02-20 Akim Demaille <akim@epita.fr>
8978
8979 * data/lalr1.cc (position.hh): New subfile, including the extended
8980 and Doxygen'ed documentation of class Position.
8981 (location.hh): Use it.
8982 Document a` la Doxygen.
8983 With the help of Benoit Perrot.
8984
89852003-02-20 Akim Demaille <akim@epita.fr>
8986
8987 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
8988 AT_YACC_IF.
8989 Redefine AT_YYERROR_SEES_LOC_IF using it.
8990 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
8991 not defined.
8992 Don't use the location in yy::Parser::error_ and
8993 yy::Parser::print_ when not %locations.
8994 Activate more lalr1.cc tests.
8995
89962003-02-19 Akim Demaille <akim@epita.fr>
8997
8998 * data/lalr1.cc: When displaying a line number, be sure to make it
8999 an int.
9000
90012003-02-19 Akim Demaille <akim@epita.fr>
9002
9003 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
9004 Remove, useless.
9005 (YYABORT, YYACCEPT, YYERROR): New.
9006 * tests/calc.at: Renable the lalr1.cc test.
9007
90082003-02-19 Akim Demaille <akim@epita.fr>
9009
9010 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
9011 error recovery, mixing with/without pops and discarding of the
9012 lookahead.
9013 Exercise YYERROR.
9014 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
9015
90162003-02-17 Paul Eggert <eggert@twinsun.com>
9017
9018 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
9019 * tests/testsuite.at (AT_COMPILE): Use them.
9020 This fixes the testsuite problem reported by Robert Lentz in
9021 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
9022
90232003-02-12 Paul Eggert <eggert@twinsun.com>
9024
9025 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
9026 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
9027 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
9028 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
9029 Check for malloc failure, for consistency with yacc.c.
9030 (yytname_size): Remove, for consistency with yacc.c.
9031
9032 The bug still remains in data/lalr1.cc, as I didn't have time
9033 to fix it there.
9034
90352003-02-06 Akim Demaille <akim@epita.fr>
9036
9037 * configure.ac (GXX): Rename as...
9038 (CXX): this, to keep the original Autoconf semantics.
9039 Require 2.57.
9040 * data/lalr1.cc: Fix b4_copyright invocations.
9041 If YYDEBUG is not defined, don't depend upon name_ being defined.
9042 (location.hh): Include string and iostream.
9043 (Position::filename): New member.
9044 (Position::Position ()): New.
9045 (operator<< (Position)): New.
9046 (operator- (Position, int)): New.
9047 (Location::first, Location::last): Rename as...
9048 (Location::begin, Location::end): these, to mock the conventional
9049 iterator names.
9050 (operator<< (Location)): New.
9051 * tests/atlocal.in (CXX): New.
9052 * tests/testsuite.at (AT_COMPILE_CXX): New.
9053 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
9054 locations in a more synthetic way.
9055 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
9056 lalr1.cc is used.
9057 Adjust the C locations to match those from Emacs: first column is
9058 column 0.
9059 Change all the expected results.
9060 Conform to the GCS: simplify the locations when applicable.
9061 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
9062 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
9063 these CPP macros with the m4 macros new defined by...
9064 (AT_CHECK_PUSHDEFS): this, i.e.:
9065 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
9066 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
9067 New macros.
9068 (AT_CHECK_POPDEFS): Undefine them.
9069 (AT_CHECK_CALC_LALR1_CC): New.
9070 Use it for the first lalr1.cc test.
9071
90722003-02-04 Akim Demaille <akim@epita.fr>
9073
9074 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
9075 Location as is defined.
9076
90772003-02-04 Akim Demaille <akim@epita.fr>
9078
9079 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
9080 name_ being defined.
9081
90822003-02-03 Paul Eggert <eggert@twinsun.com>
9083
9084 * src/gram.h (start_symbol): Remove unused decl.
9085
9086 Use more-consistent naming conventions for local vars.
9087
9088 * src/derives.c (derives_compute): Change type of local var from
9089 int to rule_number.
9090 * src/gram.c (grammar_rules_partial_print): Likewise.
9091 * src/print.c (print_core): Likewise.
9092 * src/reduce.c (reduce_grammar_tables): Likewise.
9093
9094 * src/gram.c (grammar_dump): Change name of item_number *
9095 local var from r to rp.
9096 * src/nullable.c (nullable_compute): Likewise.
9097
9098 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
9099
9100 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
9101 for symbol or symbol_number var.
9102 * src/reader.c (grammar_start_symbol_set): Likewise.
9103 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
9104 Likewise.
9105 * src/state.c (transitions_to): Likewise.
9106 * src/state.h: Likewise.
9107 * src/tables.c (symbol_number_to_vector_number): Likewise.
9108
9109 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
9110 char * var.
9111
9112 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
9113 var.
9114
9115 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
9116 var.
9117
9118 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
9119 Use str, not s, for char * var. Use ch, not c, for character var.
9120 Use size for size var.
9121
9122 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
9123 char * var.
9124 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
9125 uniqstr var.
9126 * src/uniqstr.h: Likewise.
9127
9128 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9129 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9130 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
9131 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
9132 param to have same name as that of enum, so that we don't use
9133 "s" to stand for a non-state.
9134
91352003-02-02 Akim Demaille <akim@epita.fr>
9136
9137 * src/scan-skel.l: Scan more than one inert character per yylex
9138 invocation.
9139
91402003-02-01 Paul Eggert <eggert@twinsun.com>
9141
9142 Version 1.875a.
9143
9144 * po/LINGUAS: Add ms.
9145
91462003-01-30 Akim Demaille <akim@epita.fr>
9147
9148 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
9149
91502003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9151
9152 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
9153 of $1.
9154
9155 Changes in response to error report by S. Eken: GLR mode does not
9156 handle negative $ indices or $ indices in embedded rules correctly.
9157 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
9158
9159 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
9160 (b4_rhs_location): Ditto.
9161 (yyfill): New function to copy from stack tree into array
9162 incrementally.
9163 (yyuserAction): Modify to allow incremental move of semantic values
9164 to rhs array when in GLR mode.
9165 Define YYFILL to use in user-defined actions to fill semantic array
9166 as needed.
9167 Remove dummy use of yystack, as there is now a guaranteed use.
9168 (yydoAction): Modify to allow incremental move of semantic values
9169 to rhs array when in GLR mode.
9170 (yyresolveAction): Ditto.
9171 (yyglrShiftDefer): Update comment.
9172 (yyresolveStates): Use X == NULL for pointers, not !X.
9173 (yyglrReduce): Ditto.
9174 (yydoAction): Ditto
9175
9176 * tests/glr-regr1.at: Rename to ...
9177 * tests/glr-regression.at: Add new regression test for the problems
9178 described above (adapted from S. Eken).
9179 Update copyright notice.
9180 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
9181 * tests/Makefile.am: Ditto.
9182
91832003-01-28 Paul Eggert <eggert@twinsun.com>
9184
9185 * data/lalr1.cc: Do not use @output_header_name@ unless
9186 b4_defines_flag is set. This fixes two bugs reported by
9187 Tim Van Holder in
9188 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
9189 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
9190
91912003-01-21 Paul Eggert <eggert@twinsun.com>
9192
9193 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
9194 we don't need to worry about yyerrlab1 being reported as an
9195 "unused label" by non-GCC C compilers. The downside is that if
9196 locations are used then a couple of statements are duplicated each
9197 time YYERROR is invoked, but the upside is that the warnings
9198 should vanish.
9199 (yyerrlab1): Move code to YERROR.
9200 (yyerrlab2): Remove. Change uses back to yyerrlab1.
9201 This reverts some of the 2002-12-27 change.
9202
92032003-01-17 Paul Eggert <eggert@twinsun.com>
9204
9205 * src/output.c (symbol_printers_output): Fix typo that led
9206 to core dump. Problem reported by Antonio Rus in
9207 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
9208
92092003-01-13 Akim Demaille <akim@epita.fr>,
9210 Quoc Peyrot <chojin@lrde.epita.fr>,
9211 Robert Anisko <anisko_r@lrde.epita.fr>
9212
9213 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
9214 when the stacks contain one element, as the loop would otherwise
9215 free the last state, and then use the top state (the one we just
9216 popped). This means that the initial elements will not be freed
9217 explicitly, as is the case in yacc.c; it is not a problem, as
9218 these elements have fake values.
9219
92202003-01-11 Paul Eggert <eggert@twinsun.com>
9221
9222 * NEWS: %expect-violations are now just warnings, reverting
9223 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
9224 bootstrapping problem reported by Matthias Klose; see
9225 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
9226 * src/conflicts.c (conflicts_print): Likewise.
9227 * tests/conflicts.at (%expect not enough, %expect too much,
9228 %expect with reduce conflicts): Likewise.
9229 * doc/bison.texinfo (Expect Decl): Document this. Also mention
9230 that the warning is enabled if the number of conflicts changes
9231 (not necessarily increases).
9232
9233 * src/getargs.c (version): Update copyright year.
9234
92352003-01-09 Akim Demaille <akim@epita.fr>
9236
9237 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
9238
92392003-01-08 Paul Eggert <eggert@twinsun.com>
9240
9241 * Makefile.maint (WGETFLAGS):
9242 New macro, containing "-C off" to disable proxy caches.
9243 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
9244 (rel-check): Use $(WGET) instead of wget.
9245
92462003-01-06 Paul Eggert <eggert@twinsun.com>
9247
9248 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
9249 the GLR paper of Scott, Johnstone and Hussain.
9250
92512003-01-04 Paul Eggert <eggert@twinsun.com>
9252
9253 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
9254 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
9255 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
9256 (EXTRA_LIBRARIES): New var, for liby.a.
9257 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
9258 (EXTRA_SCRIPTS): New var, for yacc.
9259
9260 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
9261 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
9262 Problem reported by Nelson H. F. Beebe.
9263
92642003-01-03 Paul Eggert <eggert@twinsun.com>
9265
9266 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
9267 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
9268 when compiling Bison 1.875's `bitset bset = obstack_alloc
9269 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
9270
9271 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
9272 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
9273 grow to a huge size with typical invocation.
9274
9275 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
9276 Use the pattern recommended by Autoconf 2.57, except also protect
9277 against double-definition.
9278 * src/system.h: Likewise.
9279 Portability issues reported by Nelson H. F. Beebe.
9280
9281 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
9282 All uses changed. Provide a definition in both C and C++.
9283 (yytrue, yyfalse): Define even if defined (__cplusplus).
9284
9285 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
9286 Reported by Nelson H. F. Beebe.
9287
9288 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
9289
92902003-01-02 Paul Eggert <eggert@twinsun.com>
9291
9292 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
9293 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
9294 Bug reported by Nelson H. F. Beebe.
9295
92962003-01-01 Paul Eggert <eggert@twinsun.com>
9297
9298 * Version 1.875.
9299
93002002-12-30 Paul Eggert <eggert@twinsun.com>
9301
9302 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
9303 Moved here from...
9304 (<INITIAL>","): Here. This causes stray "," to be treated
9305 more uniformly.
9306
9307 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
9308 last brace in braced code when not in Yacc mode, for compatibility
9309 with Bison 1.35. This resurrects the 2001-12-15 patch to
9310 src/reader.c.
9311
9312 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
9313 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
9314
93152002-12-28 Paul Eggert <eggert@twinsun.com>
9316
9317 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
9318 that of SYM's type. This fixes Debian bug 168069, reported by
9319 Thomas Olsson.
9320
93212002-12-28 Paul Eggert <eggert@twinsun.com>
9322
9323 Version 1.75f.
9324
9325 Switch back to the Yacc style of conflict reports, undoing some
9326 of the 2002-07-30 change.
9327 * doc/bison.texinfo (Understanding): Use Yacc style for
9328 conflict reports. Also, use new way of locating rules.
9329 * src/conflicts.c (conflict_report):
9330 Renamed from conflict_report_yacc, removing the old
9331 'conflict_report'. Translate the entire conflict report at once,
9332 so that we don't assume that "," has the same interpretation in
9333 all languages.
9334 (conflicts_output): Use Yacc-style conflict report for each state,
9335 instead of our more-complicated style.
9336 (conflicts_print): Use Yacc-style conflict report, except print
9337 the input file name when not emulating Yacc.
9338 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
9339 Conflicted Reduction, %expect not enough, %expect too much,
9340 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
9341 * tests/existing.at (GNU Cim Grammar): Likewise.
9342 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
9343
9344 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
9345 fatal): Don't invoke fflush; it's not needed and it might even be
9346 harmful for stdout, as stdout might not be open.
9347 * src/reduce.c (reduce_print): Likewise.
9348
93492002-12-27 Paul Eggert <eggert@twinsun.com>
9350
9351 Fix a bug where error locations were not being recorded correctly.
9352 This problem was originally reported by Paul Hilfinger in
9353 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
9354
9355 * data/yacc.c (yyparse): New local var yylerrsp, to record the
9356 top of the location stack's error locations.
9357 (yyerrlab): Set it. When discarding a token, push its location
9358 onto yylerrsp so that we don't lose track of the error's end.
9359 (yyerrlab1): Now is only the target of YYERROR, so that we can
9360 properly record the location of the action that failed. For GCC
9361 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
9362 GCC warning about yyerrlab1 being unused if YYERROR is unused.
9363 (yyerrlab2): New label, which yyerrlab now falls through to.
9364 Compute the error's location by applying YYLLOC_DEFAULT to
9365 the locations of all the symbols that went into the error.
9366 * doc/bison.texinfo (Location Default Action): Mention that
9367 YYLLOC_DEFAULT is also invoked for syntax errors.
9368 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9369 Error locations include the locations of all the tokens that were
9370 discarded, not just the last token.
9371
93722002-12-26 Paul Eggert <eggert@twinsun.com>
9373
9374 * src/files.c: Include quote.h.
9375 (compute_output_file_names): Warn if we detect conflicting
9376 outputs to the same file. This should catch the misunderstanding
9377 exemplified by Debian Bug 165349, reported by Bruce Stephens..
9378
9379 * src/conflicts.c (conflicts_print): If the user specifies
9380 "%expect N", report an error if there are any reduce/reduce
9381 conflicts. This is what the manual says should happen.
9382 This fixes Debian bug 130890, reported by Anthony DeRobertis.
9383 * tests/conflicts.at (%expect with reduce conflicts): New test.
9384
9385 Don't use m4_include on relative file names, as it doesn't work as
9386 desired if there happens to be a file with that name under ".".
9387
9388 * m4sugar/version.m4: Remove; it was included but it wasn't used.
9389 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
9390 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
9391 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
9392 * src/output.c (output_skeleton): Use full path names when
9393 specifying a file to include; don't rely on include path, as
9394 it's unreliable when the working file contains a file with
9395 that name.
9396
93972002-12-25 Paul Eggert <eggert@twinsun.com>
9398
9399 Remove obsolete references to bison.simple and bison.hairy.
9400 Problem mentioned by Aubin Mahe in
9401 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
9402 * data/glr.c: Comment fix.
9403 * doc/bison.1: Remove references. Also, mention "yacc".
9404
9405 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
9406 with -g option.
9407
9408 * src/parse-gram.y (declaration): Use enum "report_states" rather
9409 than its numeric value 1.
9410
9411 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
9412 opening a new one. This fixes Debian bug 165349, reported by
9413 Bruce Stephens.
9414
94152002-12-24 Paul Eggert <eggert@twinsun.com>
9416
9417 Version 1.75e.
9418
9419 * Makefile.maint (cvs-update): Don't assume that the shell
9420 supports $(...), as Solaris sh doesn't.
9421
9422 * src/parse-gram.y (lloc_default): Remove test for empty
9423 nonterminals at the end, since it didn't change the result.
9424
94252002-12-24 Paul Eggert <eggert@twinsun.com>
9426
9427 If the user does not define YYSTYPE as a macro, Bison now declares it
9428 using typedef instead of defining it as a macro. POSIX requires this.
9429 For consistency, YYLTYPE is also declared instead of defined.
9430
9431 %union directives can now have a tag before the `{', e.g., the
9432 directive `%union foo {...}' now generates the C code
9433 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
9434 The default union tag is `YYSTYPE', for compatibility with Solaris 9
9435 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
9436 instead of `yyltype'.
9437
9438 `yystype' and `yyltype' are now obsolescent macros instead of being
9439 typedefs or tags; they are no longer documented and will be
9440 withdrawn in a future release.
9441
9442 * data/glr.c (b4_location_type): Remove.
9443 (YYSTYPE): Renamed from yystype.
9444 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
9445 (struct YYLTYPE): Renamed from struct yyltype.
9446 (YYLTYPE): Renamed from yyltype.
9447 (yyltype, yystype): New (and obsolescent) macros,
9448 for backward compatibility.
9449 * data/yacc.c: Likewise.
9450
9451 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
9452 does not specify a union tag. This is for compatibility with
9453 Solaris 9 yacc.
9454
9455 * src/parse-gram.y (add_param): 2nd arg is now char * not char
9456 const *, since it is now modified by stripping surrounding { }.
9457 (current_braced_code): Remove.
9458 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
9459 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
9460 trailing " {...}". Now of type <chars>.
9461 (grammar_declaration): Adjust to bundled tokens.
9462 (code_content): Remove; stripping is now done by add_param.
9463 (print_token_value): Print contents of bundled tokens.
9464 (token_name): New function.
9465
9466 * src/reader.h (braced_code, current_braced_code): Remove.
9467 (token_name): New decl.
9468
9469 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
9470 token_type, not braced_code code_kind. All uses changed.
9471 (SC_PRE_CODE): New state, for scanning after a keyword that
9472 has (or usually has) an immediately-following braced code.
9473 (token_type): New local var, to keep track of which token type
9474 to return when scanning braced code.
9475 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
9476 <INITIAL>"%parse-param", <INITIAL>"%printer",
9477 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
9478 instead of returning a token type immediately.
9479 (<INITIAL>"{"): Set token type.
9480 (<SC_BRACED_CODE>"}"): Use it.
9481 (handle_action_dollar, handle_action_at): Now returns bool
9482 indicating success. Fail if ! current_rule; this prevents a core dump.
9483 (handle_symbol_code_dollar, handle_symbol_code_at):
9484 Remove; merge body into caller.
9485 (handle_dollar, handle_at): Complain in invalid contexts.
9486
9487 * NEWS, doc/bison.texinfo: Document the above.
9488 * NEWS: Fix years and program names in copyright notice.
9489
94902002-12-17 Paul Eggert <eggert@twinsun.com>
9491
9492 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
9493 Reporting, Table of Symbols): Omit mentions of %lex-param and
9494 %parse-param from the documentation for now.
9495
94962002-12-15 Paul Eggert <eggert@twinsun.com>
9497
9498 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
9499 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
9500 lookahead symbol, and which sets yychar in parser actions) and it
9501 disagreed with the Bison documentation. Bug
9502 reported by Andrew Walrond.
9503
9504 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
9505 as the caller now does that.
9506 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
9507 (YYEMPTY): Parenthesize right hand side, since others use it.
9508 (yyparse): Don't assume that our generated code is the only code
9509 that sets yychar.
9510
95112002-12-13 Paul Eggert <eggert@twinsun.com>
9512
9513 Version 1.75d.
9514
9515 POSIX requires a "yacc" command.
9516 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
9517 (MOSTLYCLEANFILES): Add yacc.
9518 (yacc): New rule.
9519 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
9520 as an alias for bison y.
9521
9522 * po/LINGUAS: Add da.
9523
9524 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
9525 problem with latest <getopt.h>.
9526 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
9527
9528 * doc/fdl.texi: Upgrade to 1.2.
9529 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
9530 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
9531 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
9532 gnulib.
9533 * config/install-sh: Sync with autotools.
9534
9535 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
9536 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
9537 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
9538 locations are requested.
9539 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
9540 locations are requested.
9541
95422002-12-12 Paul Eggert <eggert@twinsun.com>
9543
9544 Remove unportable casts and storage allocation tricks.
9545 While we're at it, remove almost all casts, since they
9546 usually aren't needed and are a sign of trouble.
9547
9548 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
9549
9550 * src/derives.c (derives_compute): Do not subtract NTOKENS from
9551 the pointer DSET returned by malloc; this isn't portable.
9552 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
9553 Similarly for DERIVES.
9554 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
9555 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
9556 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
9557
9558 * src/derives.c (derives_compute): Do not bother invoking
9559 int_of_rule_number, since rule numbers are integers.
9560
9561 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
9562 rather than XMALLOC (char, N).
9563
9564 * src/files.c (filename_split): Rewrite to avoid cast.
9565
9566 * src/gram.h (symbol_number_as_item_number,
9567 item_number_as_symbol_number, rule_number_as_item_number,
9568 item_number_as_rule_number):
9569 Now inline functions rather than macros, to avoid casts.
9570 * src/state.h (state_number_as_int): Likewise.
9571 * src/tables.c (state_number_to_vector_number,
9572 symbol_number_to_vector_number): Likewise.
9573
9574 * src/gram.h (int_of_rule_number): Remove; no longer used.
9575
9576 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
9577 since the resulting storage is always stored into.
9578
9579 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
9580 where it's needed.
9581
9582 * src/muscle_tab.c (muscle_m4_output):
9583 Now inline. Return bool, not int.
9584 * src/state.c (state_compare): Likewise.
9585 * src/symtab.c (symbol_check_defined,
9586 symbol_check_alias_consistency, symbol_pack, symbol_translation,
9587 hash_compare_symbol, hash_symbol):
9588 Likewise.
9589 * src/uniqstr.c (uniqstr_print): Likewise.
9590 * src/muscle_tab.c (muscle_m4_output_processor):
9591 New function, to avoid casts.
9592 * src/state.c (state_comparator, stage_hasher): Likewise.
9593 * src/symtab.c (symbol_check_defined_processor,
9594 symbol_check_alias_consistency_processor, symbol_pack_processor,
9595 symbol_translation_processor, hash_symbol_comparator,
9596 hash_symbol_hasher): Likewise.
9597 * src/uniqstr.c (uniqstr_print_processor): Likewise.
9598 * src/muscle_tab.c (muscles_m4_output):
9599 Use new functions instead of casting old functions unportably.
9600 * src/state.c (state_hash_new): Likewise.
9601 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
9602 symbols_token_translations_init):
9603 Likewise.
9604 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
9605
9606 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
9607 var instead of casting to long, to avoid casts.
9608 (prepare_states): Use MALLOC rather than alloca, so that we don't
9609 have to worry about alloca.
9610 * src/state.c (state_hash_lookup): Likewise.
9611
9612 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
9613 local var instead of casting to unsigned char, to avoid casts.
9614
9615 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
9616 STATE_ALLOC): Remove.
9617 (transitions_new, errs_new, reductions_new, state_new): Use malloc
9618 rather than calloc, and use offsetof to avoid allocating slightly
9619 too much storage.
9620 (state_new): Initialize all members.
9621
9622 * src/state.c (state_hash): Use unsigned accumulator, not signed.
9623
9624 * src/symtab.c (symbol_free): Remove; unused.
9625 (symbol_get): Remove cast in lhs of assignment.
9626 (symbols_do): Now static. Accept generic arguments, not
9627 hashing-related ones.
9628
9629 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
9630 (symbol_processor): Remove.
9631 (symbols_do): Remove decl; now static.
9632
9633 * src/system.h (alloca): Remove; decl no longer needed.
9634 (<stddef.h>): Include, for offsetof.
9635 (<inttypes.>, <stdint.h>): Include if available.
9636 (uintptr_t): New type, if system lacks it.
9637 (CALLOC, MALLOC, REALLOC): New macros.
9638 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
9639 new macros.
9640
9641 * src/tables.c (table_size): Now int, to pacify GCC.
9642 (table_grow, table_ninf_remap): Use signed table size.
9643 (save_row): Don't bother initializing locals when not needed.
9644 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
9645 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
9646
9647 * src/vcg.h: Correct misspellings.
9648
9649 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
9650
9651
9652 * src/getargs.c (getargs): Don't assume EOF == -1.
9653
96542002-12-09 Paul Eggert <eggert@twinsun.com>
9655
9656 Change identifier spellings to avoid collisions with names
9657 that are reserved by POSIX.
9658
9659 Don't use names ending in _t, since POSIX reserves them.
9660 For consistency, remove _e and _s endings -- they're weren't
9661 needed to remove ambiguity. All uses changed.
9662 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
9663 turn was just renamed from struniq_t.
9664 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
9665 which in turn was just renamed from struniq_processor_t.
9666 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
9667 in turn was renamed from hash_compare_struniq_t.
9668 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
9669 (state_list): Renamed from state_list_t.
9670 * src/assoc.h (assoc): Renamed from assoc_t.
9671 * src/conflicts.c (enum conflict_resolution): Renamed from
9672 enum conflict_resolution_e.
9673 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
9674 (rule_list): Renamed from rule_list_t.
9675 * src/getargs.h (enum trace): Renamed from enum trace_e.
9676 (enum report): Renamed from enum report_e.
9677 * src/gram.h (item_number): Renamed from item_number_t.
9678 (rule_number): Renamed from rule_number_t.
9679 (struct rule_s): Remove the "rule_s" part; not used.
9680 (rule): Renamed from rule_t.
9681 (rule_filter): Renamed from rule_filter_t.
9682 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
9683 (goto_list): Renamed from goto_list_t.
9684 * src/lalr.h (goto_number): Renamed from goto_number_t.
9685 * src/location.h (location): Renamed from location_t.
9686 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
9687 and moved here from:
9688 * src/muscle_tab.h (muscle_entry_t): here.
9689 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
9690 (rule_list): Renamed from rule_list_t.
9691 * src/print_graph.c (static_graph): Renamed from graph.
9692 * src/reader.h (braced_code): Renamed from braced_code_t.
9693 Remove brace_code_e tag.
9694 * src/relation.h (relation_node): Renamed from relation_node_t.
9695 (relation_nodes): Renamed from relation_nodes_t.
9696 (relation): Renamed from relation_t.
9697 * src/state.h (state_number): Renamed from state_number_t.
9698 (struct state): Renamed from struct state_s.
9699 (state): Renamed from state_t.
9700 (transitions): Renamed from transitions_t. Unused (and
9701 misspelled) transtion_s tag removed.
9702 (errs): Renamed from errs_t. Unused errs_s tag removed.
9703 (reductions): Renamed from reductions_t. Unused tag
9704 reductions_s removed.
9705 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
9706 (struct symbol_list): Renamed from struct symbol_list_s.
9707 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
9708 (struct symbol): Renamed from struct symbol_s.
9709 (symbol): Renamed from symbol_t.
9710 * src/tables.c (vector_number): Renamed from vector_number_t.
9711 (action_number): Renamed from action_t.
9712 * src/tables.h (base_number): Renamed from base_t.
9713 * src/vcg.h (enum color): Renamed from enum color_e.
9714 (enum textmode): Renamed from enum textmode_e.
9715 (enum shape): Renamed from enum shape_e.
9716 (struct colorentry): Renamed from struct colorentry_s.
9717 (struct classname): Renamed from struct classname_s.
9718 (struct infoname): Renamed from struct infoname_s.
9719 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
9720 (enum decision): Renamed from enum decision_e.
9721 (enum orientation): Renamed from enum orientation_e.
9722 (enum alignment): Renamed from enum alignment_e.
9723 (enum arrow_mode): Renamed from enum arrow_mode_e.
9724 (enum crossing_type): Renamed from enum crossing_type_e.
9725 (enum view): Renamed from enum view_e.
9726 (struct node): Renamed from struct node_s.
9727 (node): Renamed from node_t.
9728 (enum linestyle): Renamed from enum linestyle_e.
9729 (enum arrowstyle): Renamed from enum arrowstyle_e.
9730 (struct edge): Renamed from struct edge.
9731 (edge): Renamed from edge_t.
9732 (struct graph): Renamed from struct graph_s.
9733 (graph): Renamed from graph_t.
9734 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
9735 Rename value_t -> value.
9736 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
9737 value_t_as_yystype -> value_as_yystype.
9738
9739 Don't include <errno.h> in the mainstream code, since it
9740 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
9741 * lib/get-errno.c, lib/get-errno.h: New files.
9742 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
9743 get-errno.c.
9744 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
9745 * src/output.c (output_skeleton): Likewise.
9746 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
9747 instead of errno.
9748 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
9749 Likewise.
9750 (handle_action_dollar, handle_action_at): Likewise.
9751 * src/system.h: Do not include <errno.h>.
9752 (TAB_EXT): Renamed from EXT_TAB.
9753 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
9754
9755 Avoid str[a-z]*, since <string.h> reserves that name space.
9756 Change all instances of "struniq" in names to "uniqstr", and
9757 likewise for "STRUNIQ" and "UNIQSTR".
9758 * src/uniqstr.c: Renamed from src/struniq.c.
9759 * src/uniqstr.h: Renamed from src/struniq.h.
9760 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
9761 * src/files.c (strsuffix): Remove; unused.
9762 (concat2): Renamed from stringappend. Now static.
9763 * src/files.h (strsuffix, stringappend): Remove; unused.
9764 * src/parse-gram.y (<chars>): Renamed from <string>.
9765 (<uniqstr>): Renamed from <struniq>.
9766 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
9767 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
9768 (struct graph_s.expand): Renamed from struct graph_s.stretch.
9769 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
9770 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
9771 (N_EXPAND): Renamed from N_STRETCH.
9772
9773 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
9774 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
9775 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
9776 Remove; unused.
9777 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
9778 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
9779 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
9780 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
9781 (BASE_MAXIMUM): Renamed from BASE_MAX.
9782 (BASE_MINIMUM): Renamed from BASE_MIN.
9783 (ACTION_MAX): Remove; unused.
9784 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
9785 Unnecessary casts removed from above defines.
9786
9787
9788 Fix misspelling in names.
9789 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
9790 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
9791 G_NODE_ALIGNEMENT.
9792
9793
9794 * lib/timevar.c (timevar_report): Renamed from time_report,
9795 for consistency with other names.
9796 * lib/timevar.h (timevar_report): New decl.
9797 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
9798
9799
9800 Sort include-file uses.
9801
9802 Reorder all include files under src to be in the order "system.h".
9803 then the ../lib include files in angle brackets (alphabetized),
9804 then the . include files in double-quotes (alphabetized). Fix
9805 dependency breakages encountered in this process, as follows:
9806 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
9807 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
9808 * src/state.h: Include "symtab.h".
9809
98102002-12-08 Paul Eggert <eggert@twinsun.com>
9811
9812 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
9813 since this causes problems when __file__ contains character
9814 sequences like "@" that are treated specially by src/scan-skel.l.
9815 Instead, just use the file's basename. This fixes the bug
9816 reported by Martin Mokrejs in
9817 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
9818
98192002-12-06 Paul Eggert <eggert@twinsun.com>
9820
9821 Add support for rules that do not have trailing semicolons, as
9822 POSIX requires. Improve the quality of locations in Bison
9823 diagnostics.
9824
9825 * src/location.c: Include <quotearg.h>.
9826 (empty_location): Now const.
9827 (location_print): New function. Follow the recommendation of the
9828 GNU Coding Standards for locations that span file boundaries.
9829 * src/location.h: Do not include <quotearg.h>; no longer needed.
9830 (boundary): New type.
9831 (location_t): Use it. This allows locations to span file boundaries.
9832 All member uses changed: file -> start.file or end.file (as needed),
9833 first_line -> start.line, first_column -> start.column,
9834 last_line -> end.line, last_column -> end.column.
9835 (equal_boundaries): New function.
9836 (LOCATION_RESET, LOCATION_STEP): Remove.
9837 (LOCATION_PRINT): Remove. All callers changed to use location_print.
9838 (empty_location): Now const.
9839 (location_print): New decl.
9840 * src/parse-gram.y (lloc_default): New function, which handles
9841 empty locations more accurately.
9842 (YYLLOC_DEFAULT): Use it.
9843 (%token COLON): Remove.
9844 (%token ID_COLON): New token.
9845 (rules): Use it.
9846 (declarations, rules): Remove trailing semicolon.
9847 (declaration, rules_or_grammar_declaration):
9848 Allow empty (";") declaration.
9849 (symbol_def): Remove empty actions; no longer needed.
9850 (rules_or_grammar_declaration): Remove trailing semicolon.
9851 (semi_colon.opt): Remove.
9852 * src/reader.h: Include location.h.
9853 (scanner_cursor): New decl.
9854 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
9855 rolling our own.
9856 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
9857 of *loc.
9858 (STEP): Remove. No longer needed, now that adjust_location does
9859 the work. All uses removed.
9860 (scanner_cursor): New var.
9861 (adjust_location): Renamed from extend_location. It now sets
9862 *loc and adjusts the scanner cursor. All uses changed.
9863 Don't bother testing for CR.
9864 (handle_syncline): Remove location arg; now updates scanner cursor.
9865 All callers changed.
9866 (unexpected_end_of_file): Now accepts start boundary of token or
9867 comment, not location. All callers changed. Update scanner cursor,
9868 not the location.
9869 (SC_AFTER_IDENTIFIER): New state.
9870 (context_state): Renamed from c_context. All uses changed.
9871 (id_loc, code_start, token_start): New local vars.
9872 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
9873 processing of Yacc white space and equivalents here.
9874 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
9875 instead of returning ID immediately, since we need to search for
9876 a subsequent colon.
9877 (<INITIAL>"'", "\""): Save token_start.
9878 (<INITIAL>"%{", "{", "%%"): Save code_start.
9879 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
9880 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
9881 BEGIN context_state at end, not INITIAL.
9882 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
9883 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
9884 Return correct token start.
9885 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
9886 the start of a character, string or multiline comment is found.
9887 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
9888 Reduction): Adjust reported locations to match the more-precise
9889 results now expected.
9890 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
9891 * tests/reduce.at (Useless Rules, Reduced Automaton,
9892 Underivable Rules): Likewise.
9893 * tests/regression.at (Invalid inputs): No longer `expecting ";"
9894 or "|"' now that so many other tokens are allowed by the new grammar.
9895
9896 * src/complain.h (current_file): Remove duplicate decl;
9897 current_file is now owned by files.h.
9898 * src/complain.c, src/scan-gram.l: Include files.h.
9899
99002002-12-06 Paul Eggert <eggert@twinsun.com>
9901
9902 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
9903 promotes to int; it might be unsigned int.
9904 * data/yacc.c (yy_reduce_print): Likewise.
9905
9906 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
9907 be #defined in the prologue, not in the Bison declarations.
9908 This fixes Debian Bug 102878, reported by Shaul Karl.
9909
99102002-12-02 Paul Eggert <eggert@twinsun.com>
9911
9912 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
9913 * lib/strtoul.c: New file, from gnulib.
9914 This fixes a porting bug reported by Peter Klein in
9915 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
9916
99172002-11-30 Paul Eggert <eggert@twinsun.com>
9918
9919 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
9920 and put only a forward declaration in the prologue. This is for
9921 consistency with the other scanner helper functions.
9922
9923 Type clashes now generate warnings, not errors, since it
9924 appears that POSIX may allow some grammars with type clashes.
9925 * src/reader.c (grammar_current_rule_check): Warn about
9926 type clashes instead of complaining.
9927 * tests/input.at (Type Clashes): Expect warnings, not complaints.
9928
9929 Add Yacc library, since POSIX requires it.
9930 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
9931 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
9932 * lib/main.c, lib/yyerror.c: New files.
9933
9934 gram_error can be static; it need not be extern.
9935 * src/reader.h (gram_error): Remove decl.
9936 * src/parse-gram.y (gram_error): Now static. Add static decl.
9937 (print_token_value): Omit parameter names from forward decl,
9938 for consistency.
9939
99402002-11-29 Paul Eggert <eggert@twinsun.com>
9941
9942 * doc/bison.texinfo: Emphasize that yylex and yyerror must
9943 be declared before being used. E.g., one should typically
9944 declare them in the prologue. Use GNU coding style in examples.
9945 Put "const" consistently after the type it modifies. Mention
9946 that C99 supports "inline". Mention that yyerror traditionally
9947 returns "int".
9948
9949 %parse-param and %lex-param now take just one argument, the
9950 declaration; the argument name is deduced from the declaration.
9951
9952 * doc/bison.texinfo (Parser Function, Pure Calling, Error
9953 Reporting, Table of Symbols): Document this.
9954 * src/parse-gram.y (add_param): New function.
9955 (COMMA): Remove.
9956 (declaration): Implement new rule for %parse-param and %lex-param.
9957 * src/scan-gram.l: "," now elicits a warning, rather than being
9958 a token; this is more compatible with byacc.
9959 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
9960
99612002-11-27 Paul Eggert <eggert@twinsun.com>
9962
9963 Rename identifiers to avoid real and potential collisions.
9964
9965 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
9966 to avoid collision with lex macro described by Bruce Lilly in
9967 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
9968 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9969 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
9970 * src/parse-gram.y (print_token_value): Renamed from yyprint.
9971 All uses changed.
9972 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
9973 The name "yycontrol" violates the name space rules, and this stuff
9974 wasn't being used anyway.
9975 (input): Remove action; this stuff wasn't being used.
9976 (gram_error): Rename local variable yylloc -> loc.
9977 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
9978 (YY_DECL): Don't use "yy" at start of local variables.
9979 All uses changed, e.g., yylloc -> loc.
9980 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
9981 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
9982 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
9983 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
9984
9985 * src/parse-gram.y (gram_error): loc is now const *.
9986 * src/reader.h (gram_error): Likewise.
9987
99882002-11-24 Paul Eggert <eggert@twinsun.com>
9989
9990 Version 1.75c.
9991
9992 * tests/actions.at (Actions after errors): Use an output format
9993 more similar to that of the Printers and Destructors test.
9994 Test the position of the ';' token too.
9995 (Printers and Destructors): Likewise.
9996 (Printers and Destructors: %glr-parser): Remove for now, to avoid
9997 unnecessarily alarming people when the test fails.
9998
9999 * data/yacc.c (yyerrlab1): Move this label down, so that the
10000 parser does not discard the lookahead token if the user code
10001 invokes YYERROR. This change is required for POSIX conformance.
10002
10003 * lib/error.c: Sync with gnulib.
10004
100052002-11-22 Paul Eggert <eggert@twinsun.com>
10006
10007 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
10008 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
10009 * lib/xmalloc.c: Likewise.
10010
100112002-11-20 Paul Eggert <eggert@twinsun.com>
10012
10013 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
10014
100152002-11-20 Paul Eggert <eggert@twinsun.com>
10016
10017 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
10018 should use `if (! x) abort ();' rather than `assert (x);', and
10019 anyway it's one less thing to worry about configuring.
10020
10021 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
10022 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
10023 and replace all instances of assert with abort.
10024 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10025 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
10026
10027 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
10028 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
10029 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
10030 hash_find_entry, hash_rehash, hash_insert): Likewise.
10031 * src/conflicts.c (resolve_sr_conflict): Likewise.
10032 * src/lalr.c (set_goto_map, map_goto): Likewise.
10033 * src/nullable.c (nullable_compute): Likewise.
10034 * src/output.c (prepare_rules, token_definitions_output): Likewise.
10035 * src/reader.c (packgram, reader): Likewise.
10036 * src/state.c (state_new, state_free, state_transitions_set,
10037 state_reduction_find): Likewise.
10038 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
10039 symbol_pack): Likewise.
10040 * src/tables.c (conflict_row, pack_vector): Likewise.
10041 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10042 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10043 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
10044 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
10045
10046 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
10047 (ARGMATCH_CONSTRAINT): New macro.
10048 (ARGMATCH_ASSERT): Use it.
10049
10050 * src/system.h (verify): New macro.
10051 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
10052 rather than assert.
10053 * src/tables.c (tables_generate): Likewise.
10054
10055 * src/struniq.c (struniq_assert): Now returns void, and aborts
10056 if the assertion is false.
10057 (struniq_assert_p): Remove.
10058 * src/struniq.h: Likewise.
10059
100602002-11-18 Paul Eggert <eggert@twinsun.com>
10061
10062 * data/glr.c (yygetLRActions): Replace `yyindex' with
10063 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
10064 This fixes the regression with Sun ONE Studio 7 cc that I reported in
10065 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
10066
100672002-11-18 Akim Demaille <akim@epita.fr>
10068
10069 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
10070 space.
10071 From Tim Van Holder.
10072
100732002-11-17 Paul Eggert <eggert@twinsun.com>
10074
10075 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
10076 to "SyntaxError" for consistency with my 2002-11-15 change.
10077
10078 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
10079 not define to {}, since this breaks the common use of `YYDPRINTF
10080 ((...));' if a single statement is desired (e.g. before `else').
10081 Work around GCC warnings by surrounding corresponding calls with
10082 {} if needed.
10083 (yyhasResolvedValue): Remove unused function.
10084 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
10085 loop body.
10086 (yyreportSyntaxError): Renamed from yyreportParseError.
10087 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
10088 All uses changed.
10089 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
10090 extern when possible. Remove unused initializations.
10091
100922002-11-16 Akim Demaille <akim@epita.fr>
10093
10094 Augment the similarity between GLR and LALR traces.
10095
10096 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
10097 (YY_REDUCE_PRINT): New.
10098 (yyparse): Use them.
10099 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
10100 YYDPRINT here.
10101 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
10102 state reached after the reduction/recovery, since...
10103 (yyparse, yyprocessOneStack): Report the state we are entering in.
10104
101052002-11-16 Akim Demaille <akim@epita.fr>
10106
10107 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
10108 Add support for --trace=skeleton.
10109 * src/scan-skel.l: %option debug.
10110 Scan strings of non-@ or \n instead of character by character.
10111 (scan_skel): Handle trace_skeleton.
10112 (QPUTS): New.
10113 (@output_parser_name@, @output_header_name@): ``Restore'' their
10114 support (used to be M4 macros).
10115 * data/yacc.c: Quote larger chunks, a la glr.c.
10116 * data/lalr1.cc: Likewise.
10117 The header guards are no longer available, so use some other
10118 string than `YYLSP_NEEDED'.
10119
101202002-11-16 Akim Demaille <akim@epita.fr>
10121
10122 Make the ``Printers and Destructors'' test more verbose, taking
10123 `yacc.c''s behavior as (possibly wrong) reference.
10124
10125 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
10126 instead of fprint on stdout.
10127 Set and report the last_line of the symbols.
10128 Consistently display values and locations.
10129
101302002-11-16 Paul Eggert <eggert@twinsun.com>
10131
10132 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
10133
101342002-11-15 Paul Eggert <eggert@twinsun.com>
10135
10136 * tests/actions.at (Actions after errors): New test case.
10137
10138 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
10139 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
10140 tests/action.at, tests/calc.at, tests/conflicts.at,
10141 tests/cxx-type.at, tests/regression.at:
10142 "parse error" -> "syntax error" for POSIX compatibility.
10143 "parsing stack overflow..." -> "parser stack overflow" so
10144 that code matches Bison documentation.
10145
101462002-11-15 Akim Demaille <akim@epita.fr>
10147
10148 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
10149 take two BRACED_CODE, not two string_content.
10150 Free the scanner's obstack when we are done.
10151 (code_content): New.
10152 * tests/calc.at: Adjust.
10153 * doc/bison.texinfo: Adjust.
10154 Also, make sure to include the `,' for these declarations.
10155
101562002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
10157
10158 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
10159 definition; avoids potential autoreconf problems.
10160
101612002-11-15 Akim Demaille <akim@epita.fr>
10162
10163 Always check the value returned by yyparse.
10164
10165 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
10166 returned by yyparse.
10167 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
10168 Adjust calls.
10169 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
10170 returned by yyparse.
10171
101722002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10173
10174 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
10175 on input.at test.
10176
101772002-11-14 Paul Eggert <eggert@twinsun.com>
10178
10179 * src/output.c (output_skeleton): Call xfopen instead of
10180 duplicating xfopen's body.
10181
10182 Fix bugs reported by Nelson H. F. Beebe in
10183 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
10184
10185 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
10186 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
10187 Group compiler. Instead, use "$CC -E bar.c". Include the .h
10188 file twice in the grammar, as an extra check.
10189
10190 * tests/input.at (Torturing the Scanner): Surround the
10191 backslash-newline tests with "#if 0", to make it less likely that
10192 we'll run into compiler bugs. Bring back solitary \ inside
10193 comment, but add a closing comment to work around HP C bug. Don't
10194 test backslash-newline in C character constant.
10195
101962002-11-14 Akim Demaille <akim@epita.fr>
10197
10198 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
10199 status of the compiler.
10200 Calling `exit 1' is no longer needed.
10201 Reported by Nelson H. F. Beebe.
10202
102032002-11-14 Akim Demaille <akim@epita.fr>
10204
10205 * tests/atlocal.in (CPPFLAGS): We have config.h.
10206 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
10207 New.
10208 * tests/actions.at, tests/calc.at, tests/conflicts.at,
10209 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
10210 * tests/regression.at, tests/torture.at: Use them for all the
10211 grammars that are to be compiled.
10212 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
10213 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
10214 * doc/bison.texinfo (GLR Parsers): Document `inline'.
10215
102162002-11-14 Akim Demaille <akim@epita.fr>
10217
10218 * doc/bison.texinfo: Various formatting changes (alignments in
10219 samples, additional @group/@end group, GCS in samples.
10220 Use @deffn instead of simple @table to define the directives,
10221 macros, variables etc.
10222
102232002-11-13 Paul Eggert <eggert@twinsun.com>
10224
10225 Fix some bugs reported by Albert Chin-A-Young in
10226 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
10227
10228 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
10229 -o c"; the HP C compiler chatters during compilation.
10230 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
10231 * tests/headers.at (export YYLTYPE): Likewise.
10232
10233 * tests/input.at (Torturing the Scanner): Remove lines containing
10234 solitary backslashes, as they tickle a bug in the HP C compiler.
10235
10236 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
10237 comments, since they're not portable. Use GNU coding style.
10238
102392002-11-13 Akim Demaille <akim@epita.fr>
10240
10241 * data/yacc.c: Leave bigger chunks of quoted text.
10242 (YYDSYMPRINTF): New.
10243 Use it to report symbol activities.
10244 * data/glr.c (YYDSYMPRINTF): New.
10245 Use it.
10246
102472002-11-12 Paul Eggert <eggert@twinsun.com>
10248
10249 Version 1.75b.
10250
10251 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
10252 (yyglrReduce): Return yyok, not 0.
10253 This should avoid the enumerated-type warnings reported
10254 by Nelson H. F. Beebe in
10255 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
10256
10257 * lib/bbitset.h (BITSET_INLINE): Remove.
10258 * lib/bitset.h [! BITSET_INLINE]: Remove.
10259 (bitset_set, bitset_reset, bitset_test): Rename local vars
10260 to avoid shadowing warnings by GCC.
10261
10262 * data/glr.c (inline): Remove #define. It's the user's
10263 responsibility to #define it away, just like 'const'.
10264 This fixes one of the bugs reported by Nelson H. F. Beebe in
10265 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
10266
10267 * Makefile.maint (po-check): Scan .l and .y files instead of the
10268 .c and the .h files that they generate. This fixes the bug
10269 reported by Tim Van Holder in:
10270 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
10271 Look for N_ as well as for _. Try to avoid matching #define for
10272 N_ and _.
10273 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
10274 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
10275 * src/scan-gram.l: Revamp regular expressions so that " and '
10276 do not confuse xgettext.
10277
10278 * src/struniq.h (struniq_new): Do not declare the return type
10279 to be 'const'; this violates the C standard.
10280 * src/struniq.c (struniq_new): Likewise.
10281
102822002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
10283
10284 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
10285 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
10286 linker.
10287
102882002-11-12 Akim Demaille <akim@epita.fr>
10289
10290 * Makefile.maint: Sync with Autoconf:
10291 (local_updates): New.
10292
102932002-11-12 Akim Demaille <akim@epita.fr>
10294
10295 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
10296
102972002-11-12 Akim Demaille <akim@epita.fr>
10298
10299 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
10300 locations.
10301
103022002-11-12 Akim Demaille <akim@epita.fr>
10303
10304 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
10305 not yyvalue.
10306
103072002-11-12 Akim Demaille <akim@epita.fr>
10308
10309 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
10310 Use it to test the GLR parser.
10311
103122002-11-12 Akim Demaille <akim@epita.fr>
10313
10314 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
10315 defines it.
10316 * data/glr.c (yystos): New.
10317 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
10318 (YYDSYMPRINT): New.
10319 (yyval): Don't define it, it is handled via M4.
10320 (yyrecoverParseError): Free verbosely the discarded symbols.
10321 * data/yacc.c (yysymprint): Remove, rather...
10322 (b4_yysymprint_generate): invoke.
10323 * data/c.m4 (b4_yysymprint_generate): New.
10324 Accept pointers as arguments, as opposed to the version from
10325 yacc.c.
10326 (b4_yydestruct_generate): Likewise.
10327 * tests/cations.at (Printers and Destructors): Use Bison directives
10328 instead of CPP macros.
10329 Don't rely on internal details.
10330
103312002-11-12 Akim Demaille <akim@epita.fr>
10332
10333 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
10334 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
10335 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
10336 it against YYEMPTY and so forth), work on yytoken (i.e., set
10337 it to YYEMPTY etc.).
10338 (yydestruct): Replace with a b4_yydestruct_generate invocation.
10339 (b4_symbol_actions): Remove.
10340 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
10341 for 0, end-of-input.
10342
103432002-11-12 Akim Demaille <akim@epita.fr>
10344
10345 * doc/bison.texinfo (Destructor Decl): New.
10346
103472002-11-12 Akim Demaille <akim@epita.fr>
10348
10349 * src/tables.c (tables_generate): Use free for pointers that
10350 cannot be NULL, not XFREE.
10351 (pack_vector): Use assert, not fatal, for bound violations.
10352 * src/state.c (state_new): Likewise.
10353 * src/reader.c (reader): Likewise.
10354 * src/lalr.c (set_goto_map): Likewise.
10355 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
10356 the file name.
10357
103582002-11-12 Akim Demaille <akim@epita.fr>
10359
10360 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
10361 Restore.
10362 * src/scan-gram.l (last_string): Is global to the file, not to
10363 yylex.
10364 * src/parse-gram.y (input): Don't append the epilogue here,
10365 (epilogue.opt): do it here, and free the scanner's obstack.
10366 * src/reader.c (epilogue_set): Rename as...
10367 (epilogue_augment): this.
10368 * data/c.m4 (b4_epilogue): Defaults to empty.
10369
103702002-11-12 Akim Demaille <akim@epita.fr>
10371
10372 * src/getargs.c (long_options): Remove duplicates.
10373 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
10374 Remove.
10375 * doc/bison.rnh: Remove.
10376 * doc/bison.texinfo (VMS Invocation): Remove.
10377
103782002-11-12 Akim Demaille <akim@epita.fr>
10379
10380 * src/struniq.h, src/struniq.c (struniq_t): Is const.
10381 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
10382
10383 Use struniq for symbols.
10384
10385 * src/symtab.h (symbol_t): The tag member is a struniq.
10386 (symbol_type_set): Adjust.
10387 * src/symtab.c (symbol_new): Takes a struniq.
10388 (symbol_free): Don't free the tag member.
10389 (hash_compare_symbol_t, hash_symbol_t): Rename as...
10390 (hash_compare_symbol, hash_symbol): these.
10391 Use the fact that tags as struniqs.
10392 (symbol_get): Use struniq_new.
10393 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
10394 Returns a strniq.
10395 * src/reader.h (merger_list, grammar_currentmerge_set): The name
10396 and type members are struniqs.
10397 * src/reader.c (get_merge_function)
10398 (grammar_current_rule_merge_set): Adjust.
10399 (TYPE, current_type): Are struniq.
10400
10401 Use struniq for file names.
10402
10403 * src/files.h, src/files.c (infile): Split into...
10404 (grammar_file, current_file): these.
10405 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
10406 * src/reduce.c (reduce_print): Likewise.
10407 * src/getargs.c (getargs): Likewise.
10408 * src/complain.h, src/complain.c: Likewise.
10409 * src/main.c (main): Call struniqs_new early enough to use it for
10410 file names.
10411 Don't free the input file name.
10412
104132002-11-12 Akim Demaille <akim@epita.fr>
10414
10415 * src/symtab.c (symbol_free): Remove dead deactivated code:
10416 type_name are properly removed.
10417 Don't use XFREE to free items that cannot be NULL.
10418 * src/struniq.h, src/struniq.c: New.
10419 * src/main.c (main): Initialize/free struniqs.
10420 * src/parse-gram.y (%union): Add astruniq member.
10421 (yyprint): Adjust.
10422 * src/scan-gram.l (<{tag}>): Return a struniq.
10423 Free the obstack bit that used to store it.
10424 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
10425
104262002-11-11 Paul Eggert <eggert@twinsun.com>
10427
10428 Revamp to fix many (but not all) of the C- and M4-related quoting
10429 problems. Among other things, this fixes the Bison bug reported
10430 by Jan Hubicka when processing the Bash grammar; see:
10431 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
10432
10433 Use new @ escapes consistently. Represent brackets with @{ and @}
10434 rather than @<:@ and @:>@, since this works a bit better with dumb
10435 editors like vi. Represent @ with @@, since @ is now consistently
10436 an escape. Use @oline@ and @ofile@ rather than __oline__ and
10437 __ofile__, to avoid unexpected expansions. Similarly, use @output
10438 rather than #output.
10439
10440 * data/c.m4 (b4_copyright): Omit file name from comment, since
10441 the file name could contain "*/".
10442 (b4_synclines_flag): Don't quote the 2nd argument; it should already
10443 be quoted. All uses changed.
10444
10445 * data/glr.c: Use new @ escapes consistently.
10446 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
10447 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
10448 Remove, since they couldn't handle arbitrary characters in file
10449 names.
10450 * data/lalr1.cc: Likewise.
10451 * data/yacc.c: Likewise.
10452
10453 * src/files.c (output_infix): Remove; all uses removed.
10454 * src/files.h: Likewise.
10455
10456 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
10457 mishandled funny characters in file names, and anyway it isn't
10458 needed any more.
10459 * data/yacc.c: Likewise.
10460 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
10461
10462 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
10463 * data/yacc.c: Likewise.
10464
10465 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
10466 strings now.
10467 (muscle_init): Quote filename as a C string.
10468 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
10469 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
10470 * src/output.c (escaped_file_name_output): New function.
10471 (prepare_symbols): Quote tokens for M4.
10472 (prepare): Don't insert output_infix, output_prefix,
10473 output_parser_name, output_header_name; this is now down by scan-skel.
10474 Insert skeleton as a C string.
10475
10476 * src/output.c (user_actions_output, symbol_destructors_output,
10477 symbol_printers_output): Quote filenames for C and M4.
10478 * src/reader.c (prologue_augment, epilogue_set): Likewise.
10479
10480 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
10481 escapes other than \\ and \'; this simplifies the code.
10482 (<SC_STRING>): Likewise, for \\ and \".
10483 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
10484 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
10485 Use new escapes @{ and @} for [ and ].
10486
10487 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
10488 them with auto vars.
10489 Switch to new escape scheme, where @ is the escape character uniformly.
10490 Abort if a stray escape character is found. Avoid unbounded input
10491 buffer when parsing non-escaped text.
10492
10493 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
10494 __oline__, #output, $@, and @{ do not have unintended meanings.
10495
104962002-11-09 Paul Eggert <eggert@twinsun.com>
10497
10498 Fix the test failure due to GCC warnings described in
10499 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
10500 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
10501 evaluate to 0 if it's impossible for NINF to be in the respective
10502 table.
10503 (yygetLRActions, yyrecoverParseError): Use them.
10504
10505 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
10506 counted in the token inserted at end of file. Now takes
10507 location_t *, not location_t, so that the location can be
10508 adjusted. All uses changed.
10509
10510 * tests/regression.at (Invalid inputs): Adjust wording in
10511 diagnostic to match the new behavior.
10512
10513 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
10514 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
10515 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
10516 abort ();'. This reduces the runtime of the "Many lookaheads"
10517 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
10518 GCC 3.2.
10519
105202002-11-07 Paul Eggert <eggert@twinsun.com>
10521
10522 * src/parse-gram.y (CHARACTER): Remove unused token.
10523 All uses removed.
10524
10525 * src/scan-gram.l: Remove stack option. We no longer use the
10526 stack, since the stack was never deeper than 1; instead, use the
10527 new auto var c_context to record the stacked value.
10528
10529 Remove nounput option. At an unexpected end of file, we now unput
10530 the minimal input necessary to end cleanly; this simplifies the
10531 code.
10532
10533 Avoid unbounded token sizes where this is easy.
10534
10535 (unexpected_end_of_file): New function.
10536 Use it to systematize the error message on unexpected EOF.
10537 (last-string): Now auto, not static.
10538 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
10539 (scanner_last_string_free): Remove; not used.
10540 (percent_percent_count): Move decl to just before use.
10541 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
10542 not the (never otherwised-used) CHARACTER.
10543
105442002-11-07 Akim Demaille <akim@epita.fr>
10545
10546 Let yyerror always receive the msg as last argument, so that
10547 yyerror can be variadic.
10548
10549 * data/yacc.c (b4_yyerror_args): New.
10550 Use it when calling yyerror.
10551 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
10552 Use it when calling yyerror.
10553 * doc/bison.texinfo (Error Reporting): Adjust.
10554 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
10555 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
10556
105572002-11-06 Akim Demaille <akim@epita.fr>
10558
10559 #line should have quoted strings.
10560 Ideally, this should be done by m4_quotearg.
10561
10562 * src/scan-skel.l: Include quotearg.h.
10563 Quote __ofile__.
10564 * src/output.c (symbol_printers_output)
10565 (symbol_destructors_output): Quote the file name.
10566
105672002-11-06 Akim Demaille <akim@epita.fr>
10568
10569 * tests/regression.at (Invalid inputs): Adjust to the recent
10570 messages.
10571
105722002-11-06 Akim Demaille <akim@epita.fr>
10573
10574 Restore --no-lines.
10575 Reported by Jim Kent.
10576
10577 * data/c.m4 (b4_syncline): New.
10578 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
10579 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
10580 * src/output.c (user_actions_output): Likewise.
10581 (prepare): Define 'b4_synclines_flag'.
10582 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
10583
105842002-11-06 Akim Demaille <akim@epita.fr>
10585
10586 * src/main.c (main): Free `infile'.
10587 * src/scan-gram.l (handle_syncline): New.
10588 Recognize `#line'.
10589 * src/output.c (user_actions_output, symbol_destructors_output)
10590 (symbol_printers_output): Use the location's file name, not
10591 infile.
10592 * src/reader.c (prologue_augment, epilogue_set): Likewise.
10593
105942002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10595
10596 * src/tables.c (matching_state): Don't allow states to match if
10597 either has GLR conflict entries.
10598
105992002-11-05 Paul Eggert <eggert@twinsun.com>
10600
10601 * src/scan-gram.l: Use more accurate diagnostics, e.g.
10602 "integer out of range" rather than "invalid value".
10603 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
10604 accordingly.
10605
10606 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
10607 Also, remove one static variable in the scanner.
10608
10609 * src/scan-gram.l (braces_level): Now auto, not static.
10610 Initialize to zero if the compiler is being picky.
10611 (INITIAL): Clear braces_level instead of incrementing it.
10612 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
10613 as POSIX 1003.1-2001 requires.
10614 * src/system.h (IF_LINT): New macro, taken from coreutils.
10615 * configure.ac: Define "lint" if --enable-gcc-warnings.
10616
106172002-11-05 Akim Demaille <akim@epita.fr>
10618
10619 * src/scan-gram.l: When it starts with `%', complain about the
10620 whole directive, not just that `invalid character: %'.
10621
106222002-11-04 Akim Demaille <akim@epita.fr>
10623
10624 * Makefile.maint: Update from Autoconf.
10625 (update, cvs-update, po-update, do-po-update): New.
10626
106272002-11-04 Akim Demaille <akim@epita.fr>
10628
10629 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
10630 and yyerror.
10631 Have yyerror `use' its arguments.
10632 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
10633 returns true when location & yacc & pure & parse-param.
10634 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
10635
106362002-11-04 Akim Demaille <akim@epita.fr>
10637
10638 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
10639 clashes.
10640 * src/scan-gram.l: Use [\'] instead of ['] to pacify
10641 font-lock-mode.
10642 Use complain_at.
10643 Use quote, not quote_n since LOCATION_PRINT no longer uses the
10644 slot 0.
10645
106462002-11-03 Paul Eggert <eggert@twinsun.com>
10647
10648 * src/reader.c (get_merge_function, grammar_current_rule_check):
10649 Use consistent diagnostics for reporting type name clashes.
10650 Quote the types with <>, for consistency with Yacc.
10651 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
10652
106532002-11-03 Akim Demaille <akim@epita.fr>
10654
10655 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
10656 New.
10657 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
10658 (b4_parse_param): Remove.
10659 Use b4_identification.
10660 Propagate b4_pure_args where needed to pass them to yyerror.
10661 * data/glr.m4 (b4_parse_param): Remove.
10662 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
10663 (b4_lpure_formals): New.
10664 Use b4_identification.
10665 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
10666 b4_user_formals and b4_user_args.
10667 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
10668 (yyreportAmbiguity): When using a pure parser, also need
10669 the location, and the parse-params.
10670 Adjust callers.
10671 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
10672 When using a pure parser, also need the parse-params.
10673 Adjust callers.
10674 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
10675 (%pure-parser + %parse-param) LALR and GLR parsers.
10676 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
10677 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
10678 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
10679 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
10680 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
10681 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
10682 * doc/bison.texinfo: Untabify the whole file.
10683 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
10684 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
10685 (Error Reporting): Adjust to these new directives.
10686 Document %error-verbose, deprecate YYERROR_VERBOSE.
10687
106882002-11-03 Akim Demaille <akim@epita.fr>
10689
10690 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
10691 AT_CHECK_CALC_GLR invocations to use % directives, instead of
10692 command line options.
10693 * tests/cxx-type.at: Formatting changes.
10694
106952002-11-03 Paul Eggert <eggert@twinsun.com>
10696
10697 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
10698 to count columns correctly, and to check for invalid inputs.
10699
10700 Use mbsnwidth to count columns correctly. Account for tabs, too.
10701 Include mbswidth.h.
10702 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
10703 (extend_location): New function.
10704 (YY_LINES): Remove.
10705
10706 Handle CRLF in C code rather than in Lex code.
10707 (YY_INPUT): New macro.
10708 (no_cr_read): New function.
10709
10710 Scan UCNs, even though we don't fully handle them yet.
10711 (convert_ucn_to_byte): New function.
10712
10713 Handle backslash-newline correctly in C code.
10714 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
10715 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
10716 all uses changed.
10717 (tag, splice): New EREs. Do not allow NUL or newline in tags.
10718 Use {splice} wherever C allows backslash-newline.
10719 YY_STEP after space, newline, vertical-tab.
10720 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
10721
10722 (letter, id): Don't assume ASCII; e.g., spell out a-z.
10723
10724 ({int}, handle_action_dollar, handle_action_at): Check for integer
10725 overflow.
10726
10727 (YY_STEP): Omit trailing semicolon, so that it's more like C.
10728
10729 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
10730 as well as \000. Check for UCHAR_MAX, not 255.
10731 Allow \x with an arbitrary positive number of digits, as in C.
10732 Check for overflow here.
10733 Allow \? and UCNs, for compatibility with C.
10734
10735 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
10736 with quote slot used by complain_at.
10737
10738 * tests/input.at: Add tests for backslash-newline, m4 quotes
10739 in symbols, long literals, and funny escapes in strings.
10740
10741 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
10742 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
10743 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
10744 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
10745 * m4/mbswidth.m4: New file, from GNU coreutils.
10746
10747 * doc/bison.texinfo (Grammar Outline): Document // comments.
10748 (Symbols): Document that trigraphs have no special meaning in Bison,
10749 nor is backslash-newline allowed.
10750 (Actions): Document that trigraphs have no special meaning.
10751
10752 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
10753 no longer used.
10754
107552002-11-02 Paul Eggert <eggert@twinsun.com>
10756
10757 * src/reader.c: Don't include quote.h; not needed.
10758 (get_merge_function): Reword warning to be consistent with
10759 type clash diagnostic in grammar_current_rule_check.
10760
10761 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
10762 bug in trigraph handling.
10763
10764 * src/output.c (prepare_symbols): When printing token names,
10765 escape "[" as "@<:@" and likewise for "]".
10766
10767 * src/system.h (errno): Remove declaration, as we are now
10768 assuming C89 or better, and C89 guarantees errno.
10769
107702002-10-30 Paul Eggert <eggert@twinsun.com>
10771
10772 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
10773 Check for close failures.
10774 * src/files.h (xfclose): Return void, not int, since it always
10775 returned zero.
10776 * src/files.c (xfclose): Likewise. Report I/O error if ferror
10777 indicates one.
10778 * src/output.c (output_skeleton): Use xfclose rather than fclose
10779 and ferror. xfclose now checks ferror.
10780
10781 * data/glr.c (YYLEFTMOST_STATE): Remove.
10782 (yyreportTree): Use a stack-based leftmost state. This avoids
10783 our continuing battles with bogus warnings about initializers.
10784
107852002-10-30 Akim Demaille <akim@epita.fr>
10786
10787 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
10788 #if.
10789
107902002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10791
10792 * tests/glr-regr1.at: New test for reported regressions.
10793 * tests/testsuite.at: Add glr-regr1.at test.
10794 * tests/Makefile.am: Add glr-regr1.at test.
10795
107962002-10-24 Paul Eggert <eggert@twinsun.com>
10797
10798 Version 1.75a.
10799
10800 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
10801 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
10802 we use malloc. Don't assume 'A' through 'Z' are contiguous.
10803 Don't assume strdup exists; POSIX says its an XSI extension.
10804 Check for buffer overflow on input.
10805
108062002-10-24 Akim Demaille <akim@epita.fr>
10807
10808 * src/output.c (output_skeleton): Don't disable M4sugar comments
10809 too soon: it results in comments being expanded.
10810 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
10811 first output.
10812
108132002-10-24 Akim Demaille <akim@epita.fr>
10814
10815 * data/yacc.c (m4_int_type): New.
10816 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
10817 char' as only yacc.c wants K&R portability.
10818 * data/glr.c (yysigned_char): Remove.
10819 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
10820 Reported by Quoc Peyrot.
10821
108222002-10-23 Paul Eggert <eggert@twinsun.com>
10823
10824 * src/main.c (main): With --trace=time, report times even if a
10825 non-fatal error occurs. Formerly, the times were reported in some
10826 such cases but not in others.
10827 * src/reader.c (reader): Just return if a complaint has been issued,
10828 instead of exiting, so that 'main' can report times.
10829
108302002-10-22 Akim Demaille <akim@epita.fr>
10831
10832 * src/system.h: Include sys/types.
10833 Reported by Bert Deknuydt.
10834
108352002-10-23 Paul Eggert <eggert@twinsun.com>
10836
10837 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
10838 Suggested by Art Haas.
10839
108402002-10-22 Paul Eggert <eggert@twinsun.com>
10841
10842 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
10843 decl; not needed any more.
10844 * src/main.c (main): Use return to exit, undoing yesterday's change.
10845 The last OS that we could find where this wouldn't work is
10846 SunOS 3.5, and that's too old to worry about now.
10847
10848 * data/glr.c (struct yyltype): Define members even when not
10849 doing locations. This is more consistent with yacc.c, and it
10850 works around the following bug reports:
10851 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
10852 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
10853
10854 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
10855 @acronym consistently. Standardize on "Yacc" instead of "YACC",
10856 "Algol" instead of "ALGOL". Give a bit more history about BNF.
10857
108582002-10-22 Akim Demaille <akim@epita.fr>
10859
10860 * data/README: New.
10861
108622002-10-21 Paul Eggert <eggert@twinsun.com>
10863
10864 Be consistent about 'bool'; the old code used an enum in one
10865 module and an int in another, and this violates the C standard.
10866 * m4/stdbool.m4: New file, from coreutils 4.5.3.
10867 * configure.ac (AC_HEADER_STDBOOL): Add.
10868 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
10869 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
10870 * src/symtab.c (hash_compare_symbol_t): Likewise.
10871 * src/system.h (bool, false, true): Use a definition consistent
10872 with ../lib/hash.c. All uses changed.
10873
10874 * src/complain.c (warning_issued): Renamed from warn_message_count,
10875 so that we needn't worry about integer overflow (!).
10876 Now of type bool. All uses changed.
10877 (complaint_issued): Renamed from complain_message_count; likewise.
10878
10879 * src/main.c (main): Use exit to exit with failure.
10880
10881 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
10882 rather than 1 and 0.
10883 * src/main.c (main): Likewise.
10884 * src/getargs.c (getargs): Likewise.
10885 * src/reader.c (reader): Likewise.
10886
10887 * src/getarg.c (getargs): Remove duplicate code for
10888 "Try `bison --help'".
10889
10890 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
10891 What was that "2" for?
10892
10893 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
10894 * src/getargs.c (usage): Likewise.
10895
10896 * src/getargs.c (getargs): When there are too few operands, report
10897 the last one. When there are too many, report the first extra
10898 one. This is how diffutils does it.
10899
109002002-10-20 Paul Eggert <eggert@twinsun.com>
10901
10902 Remove K&R vestiges.
10903 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
10904 * src/complain.c (VA_START): Remove. Assume prototypes.
10905 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
10906 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
10907 fatal): Assume prototypes.
10908 * src/complain.h: Assume prototypes.
10909 * src/system.h (PARAMS): Remove.
10910 Include <limits.h> unconditionally, since it's guaranteeed even
10911 for a freestanding C89 compiler.
10912 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
10913 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
10914
109152002-10-20 Akim Demaille <akim@epita.fr>
10916
10917 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
10918 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
10919 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
10920 (yyresolveStates, yyresolveAction, yyresolveStack)
10921 (yyprocessOneStack): Use them.
10922 (yy_reduce_print): New.
10923 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
10924
109252002-10-20 Akim Demaille <akim@epita.fr>
10926
10927 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
10928 arguments and output `void'.
10929 (b4_c_function): Rename as...
10930 (b4_c_function_def): this.
10931 (b4_c_function_decl, b4_c_ansi_function_def)
10932 (b4_c_ansi_function_decl): New.
10933 Change the interpretation of the arguments: before `int, foo', now
10934 `int foo, foo'.
10935 * data/yacc.c (yyparse): Prototype and define thanks to these.
10936 Adjust b4_c_function_def uses.
10937 * data/glr.c (yyparse): Likewise, but ANSI only.
10938
109392002-10-20 Akim Demaille <akim@epita.fr>
10940
10941 * src/output.c (prepare): Move the definition of `tokens_number',
10942 `nterms_number', `undef_token_number', `user_token_number_max'
10943 to...
10944 (prepare_tokens): Here.
10945 (prepare_tokens): Rename as...
10946 (prepare_symbols): this.
10947 (prepare): Move the definition of `rules_number' to...
10948 (prepare_rules): here.
10949 (prepare): Move the definition of `last', `final_state_number',
10950 `states_number' to...
10951 (prepare_states): here.
10952 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
10953
109542002-10-20 Akim Demaille <akim@epita.fr>
10955
10956 * src/tables.h, src/tables.c, src/output.c: Comment changes.
10957
109582002-10-20 Akim Demaille <akim@epita.fr>
10959
10960 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
10961 * data/c.m4: here.
10962
109632002-10-20 Akim Demaille <akim@epita.fr>
10964
10965 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
10966 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
10967 `pair'.
10968 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
10969 `name' to...
10970 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
10971 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
10972 These.
10973
109742002-10-19 Paul Eggert <eggert@twinsun.com>
10975
10976 Do not create a temporary file, as that involves security and
10977 cleanup headaches. Instead, use a pair of pipes.
10978 Derived from a suggestion by Florian Krohm.
10979 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
10980 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
10981 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
10982 (BISON_PREREQ_SUBPIPE): Add.
10983 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
10984 Add subpipe.h, subpipe.c.
10985 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
10986 * po/POTFILES.in: Add lib/subpipe.c.
10987 * src/output.c: Include "subpipe.h".
10988 (m4_invoke): Remove decl.
10989 (scan_skel): New decl.
10990 (output_skeleton): Use pipe rather than temporary file for m4 input.
10991 Check that m4sugar.m4 is readable, to avoid deadlock.
10992 Check for pipe I/O error.
10993 * src/scan-skel.l (readpipe): Remove decl.
10994 (scan_skel): New function, to be used in place of m4_invoke.
10995 Read from stream rather than file.
10996
10997 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
10998 float, as this generates a warning on Solaris 8 + GCC 3.2 with
10999 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
11000 this generates a more-accurate value anyway.
11001
11002 * lib/timevar.c (timervar_accumulate): Rename locals to
11003 avoid confusion with similarly-named more-global.
11004 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
11005
11006 * src/output.c (prepare): Use xstrdup to convert char const *
11007 to char *, to avoid GCC warning.
11008
110092002-10-19 Akim Demaille <akim@epita.fr>
11010
11011 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
11012 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
11013 Use them to have `calc.y' ready for %pure-parser.
11014 * data/yacc.c (YYLEX): Pass a yylex return type to
11015 b4_c_function_call.
11016
110172002-10-19 Akim Demaille <akim@epita.fr>
11018
11019 Prototype support of %lex-param and %parse-param.
11020
11021 * src/parse-gram.y: Add the definition of the %lex-param and
11022 %parse-param tokens, plus their rules.
11023 Drop the `_' version of %glr-parser.
11024 Add the "," token.
11025 * src/scan-gram.l (INITIAL): Scan them.
11026 * src/muscle_tab.c: Comment changes.
11027 (muscle_insert, muscle_find): Rename `pair' as `probe'.
11028 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
11029 (muscle_entry_s): The `value' member is no longer const.
11030 Adjust all dependencies.
11031 * src/muscle_tab.c (muscle_init): Adjust: use
11032 MUSCLE_INSERT_STRING.
11033 Initialize the obstack earlier.
11034 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
11035 (muscle_pair_list_grow): New.
11036 * data/c.m4 (b4_c_function_call, b4_c_args): New.
11037 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
11038 * tests/calc.at: Use %locations, not --locations.
11039 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
11040
110412002-10-19 Akim Demaille <akim@epita.fr>
11042
11043 * src/getargs.c (usage): Take status as argument and exit
11044 accordingly.
11045 Report the traditional `Try ... --help' message when status != 0.
11046 (usage, version): Don't take a FILE * as arg, it is pointless.
11047 (getargs): When there is an incorrect number of arguments, make it
11048 an error, and report it GNUlically thanks to `usage ()'.
11049
110502002-10-18 Paul Eggert <eggert@twinsun.com>
11051
11052 * data/glr.c (yyreportParseError): Don't assume that sprintf
11053 yields the length of the printed string, as this is not true
11054 on SunOS 4.1.4. Reported by Peter Klein.
11055
11056 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
11057 * tests/conflicts.at (%nonassoc and eof): Likewise.
11058 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
11059
110602002-10-17 Akim Demaille <akim@epita.fr>
11061
11062 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
11063 * src/getargs.c (trace_types, trace_args): Adjust.
11064 * src/reader.c (grammar_current_rule_prec_set)
11065 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
11066 Standardize error messages.
11067 And s/@prec/%prec/!
11068 (reader): Use trace_flag to enable scanner/parser debugging,
11069 instead of an adhoc scheme.
11070 * src/scan-gram.l: Remove trailing debugging code.
11071
110722002-10-16 Paul Eggert <eggert@twinsun.com>
11073
11074 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
11075 MUSCLE_TAB_H.
11076
11077 * NEWS: Officially drop support for building Bison with K&R C,
11078 since it didn't work anyway and it's not worth worrying about.
11079 * Makefile.maint (wget_files): Remove ansi2knr.c.
11080 (ansi2knr.c-url_prefix): Remove.
11081 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
11082 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11083 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11084
110852002-10-15 Paul Eggert <eggert@twinsun.com>
11086
11087 Stop using the "enum_" trick for K&R-style function definitions;
11088 it confused me, and I was the author! Instead, assume that people
11089 who want to use K&R C compilers (when using these modules in GCC,
11090 perhaps?) will run ansi2knr.
11091
11092 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
11093 All uses of "enum_" changed to "enum ".
11094 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11095 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11096
11097 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
11098 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
11099 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
11100 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
11101 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
11102 abitset_not, abitset_ones, abitset_or, abitset_or_and,
11103 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
11104 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
11105 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
11106 Use function prototypes; this removes the need for declaring
11107 static functions simply to provide their prototypes.
11108 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
11109 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
11110 bitset_count_, bitset_create, bitset_dump, bitset_first,
11111 bitset_free, bitset_init, bitset_last, bitset_next,
11112 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
11113 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
11114 bitset_print, bitset_release_memory, bitset_toggle_,
11115 bitset_type_choose, bitset_type_get, bitset_type_name_get,
11116 debug_bitset): Likewise.
11117 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
11118 * lib/bitset_stats.c (bitset_log_histogram_print,
11119 bitset_percent_histogram_print, bitset_stats_and,
11120 bitset_stats_and_cmp, bitset_stats_and_or,
11121 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
11122 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
11123 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
11124 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
11125 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
11126 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
11127 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
11128 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
11129 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
11130 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
11131 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
11132 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
11133 bitset_stats_zero): Likewise.
11134 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11135 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11136 bitsetv_dump, debug_bitsetv): Likewise.
11137 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
11138 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
11139 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
11140 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
11141 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
11142 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
11143 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
11144 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
11145 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
11146 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
11147 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
11148 Likewise.
11149 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
11150 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
11151 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
11152 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
11153 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
11154 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
11155 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
11156 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
11157 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
11158 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
11159 lbitset_xor_cmp, lbitset_zero): Likewise.
11160
111612002-10-14 Akim Demaille <akim@epita.fr>
11162
11163 Version 1.75.
11164
111652002-10-14 Akim Demaille <akim@epita.fr>
11166
11167 * tests/Makefile.am (maintainer-check-posix): New.
11168
111692002-10-14 Akim Demaille <akim@epita.fr>
11170
11171 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
11172 member.
11173
111742002-10-14 Akim Demaille <akim@epita.fr>
11175
11176 * src/tables.c (table_ninf_remap): base -> tab.
11177 Reported by Matt Rosing.
11178
111792002-10-14 Paul Eggert <eggert@twinsun.com>
11180
11181 * tests/action.at, tests/calc.at, tests/conflicts.at,
11182 tests/cxx-type.at, tests/headers.at, tests/input.at,
11183 tests/regression.at, tests/synclines.at, tests/torture.at:
11184 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
11185 so that the tests still work even if POSIXLY_CORRECT is set.
11186 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
11187
11188 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
11189 for portability to K&R hosts. Fix typo: signed char is guaranteed
11190 only to 127, not to 128.
11191 * data/glr.c (yysigned_char): New type.
11192 * data/yacc.c (yysigned_char): Likewise.
11193 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
11194
111952002-10-13 Paul Eggert <eggert@twinsun.com>
11196
11197 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
11198 true due to limited range of data type" warning from GCC.
11199
11200 * data/c.m4 (b4_token_defines): Protect against double-inclusion
11201 by wrapping enum yytokentype's definition inside #ifndef
11202 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
11203
112042002-10-13 Akim Demaille <akim@epita.fr>
11205
11206 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
11207 Un yy- yyrhs to avoid the name clash with the global YYRHS.
11208
112092002-10-13 Akim Demaille <akim@epita.fr>
11210
11211 * Makefile.maint: Update from Autoconf 2.54.
11212 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
11213
112142002-10-13 Akim Demaille <akim@epita.fr>
11215
11216 * src/print.c (print_state): Separate the list of solved conflicts
11217 from the other items.
11218 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
11219
112202002-10-13 Akim Demaille <akim@epita.fr>
11221
11222 Let nondeterministic skeletons be usable with deterministic
11223 tables.
11224
11225 With the patch, GAWK compiled by GCC without -O2 passes its test
11226 suite using a GLR parser driven by LALR tables. It fails with -O2
11227 because `struct stat' gives two different answers on my machine:
11228 88 (definition of an auto var) and later 96 (memset on this var).
11229 Hence the stack is badly corrumpted. The headers inclusion is to
11230 blame: if I move the awk.h inclusion before GLR's system header
11231 inclusion, the two struct stat have the same size.
11232
11233 * src/tables.c (pack_table): Always create conflict_table.
11234 (token_actions): Always create conflict_list.
11235 * data/glr.c (YYFLAG): Remove, unused.
11236
112372002-10-13 Akim Demaille <akim@epita.fr>
11238
11239 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
11240 (O0FLAGS): New.
11241 (VALGRIND, GXX): New.
11242 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
11243 * tests/bison.in: Run $PREBISON a pre-command.
11244 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
11245 (maintainer-check-g++): New.
11246 * Makefile.am (maintainer-check): New.
11247
112482002-10-13 Akim Demaille <akim@epita.fr>
11249
11250 * data/glr.c: Formatting changes.
11251 Tweak some trace messages to match yacc.c's.
11252
112532002-10-13 Akim Demaille <akim@epita.fr>
11254
11255 GLR parsers sometimes raise parse errors instead of performing the
11256 default reduction.
11257 Reported by Charles-Henry de Boysson.
11258
11259 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
11260 check the length of the traces when %glr.
11261 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
11262 GLR's traces.
11263 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
11264 Test GLR parsers.
11265 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
11266 (yyltype): Remove the yy prefix from the member names.
11267 (yytable): Complete its comment.
11268 (yygetLRActions): Map error action number from YYTABLE from
11269 YYTABLE_NINF to 0.
11270 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
11271 (which was a bug: it should have been YYTABEL_NINF, and yet it was
11272 not satisfying as we could compare an YYACTION computed from
11273 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
11274 only value for error actions.
11275 (yyreportParseError): In verbose parse error messages, don't issue
11276 `error' in the list of expected tokens.
11277 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
11278 next action to perform to match glr.c's decoding.
11279 (yytable): Complete its comment.
11280
112812002-10-13 Paul Eggert <eggert@twinsun.com>
11282
11283 Fix problem reported by Henrik Grubbstroem in
11284 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
11285 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
11286 because the Bison parser reads the second action before reducing
11287 the first one.
11288 * src/scan-gram.l (rule_length): New static var.
11289 Use it to keep track of the rule length in the scanner, since
11290 we can't expect the parser to be in lock-step sync with the scanner.
11291 (handle_action_dollar, handle_action_at): Use this var.
11292 * tests/actions.at (Exotic Dollars): Test for the problem.
11293
112942002-10-12 Paul Eggert <eggert@twinsun.com>
11295
11296 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
11297 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
11298 Include <sys/time.h> when checking for clock_t and struct tms.
11299 Use same include order as source.
11300 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
11301 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
11302
11303 * lib/timevar.c: Update copyright date and clarify comments.
11304 (get_time) [IN_GCC]: Keep the GCC version for reference.
11305
11306 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
11307 GCC version as of today, then merge Bison's changes.
11308 Change "GCC" to "Bison" in copyright notice. timevar.def's
11309 author is Akim, so change that too.
11310
11311 * src/reader.c (grammar_current_rule_check):
11312 Don't worry about the default action if $$ is untyped.
11313 Prevents bogus warnings reported by Jim Gifford in
11314 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
11315
11316 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
11317 * data/glr.c, data/lalr1.cc, data/yacc.c:
11318 Output token definitions before the first part of user declarations.
11319 Fixes compatibility problem reported by Jim Gifford for kbd in
11320 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
11321
113222002-10-11 Paul Eggert <eggert@twinsun.com>
11323
11324 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
11325 (yyparse): here. This undoes some of the 2002-07-25 change.
11326 Compatibility problem reported by Ralf S. Engelschall with
11327 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
11328
113292002-10-11 Akim Demaille <akim@epita.fr>
11330
11331 * tests/regression.at Characters Escapes): New.
11332 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
11333 characters.
11334 Reported by Jan Nieuwenhuizen.
11335
113362002-10-11 Akim Demaille <akim@epita.fr>
11337
11338 * po/id.po: New.
11339
113402002-10-10 Paul Eggert <eggert@twinsun.com>
11341
11342 Portability fixes for bitsets; this also avoids several GCC
11343 warnings.
11344
11345 * lib/abitset.c: Include <stddef.h>, for offsetof.
11346 * lib/lbitset.c: Likewise.
11347
11348 * lib/abitset.c (abitset_bytes): Return a size that is aligned
11349 properly for vectors of objects. Do not assume that adding a
11350 header size to a multiple of a word size yields a value that is
11351 properly aligned for the whole union.
11352 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11353
11354 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
11355 unique names for structures.
11356 * lib/ebitset.c (ebitset_bytes): Likewise.
11357 * lib/lbitset.c (lbitset_bytes): Likewise.
11358
11359 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
11360 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
11361 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
11362 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
11363 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
11364 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
11365 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
11366 to improve the type-checking that GCC can do.
11367 * lib/bitset.c (bitset_op4_cmp): Likewise.
11368 * lib/bitset_stats.c (bitset_stats_count,
11369 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
11370 bitset_stats_copy, bitset_stats_disjoint_p,
11371 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
11372 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
11373 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
11374 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
11375 bitset_stats_and_or_cmp, bitset_stats_andn_or,
11376 bitset_stats_andn_or_cmp, bitset_stats_or_and,
11377 bitset_stats_or_and_cmp): Likewise.
11378 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
11379 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
11380 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
11381 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
11382
11383 * lib/abitset.h: Include bitset.h, not bbitset.h.
11384 * lib/ebitset.h: Likewise.
11385 * lib/lbitset.h: Likewise.
11386
11387 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
11388 All instances of parameters of type enum bitset_opts are now of
11389 type enum_bitset_opts, to conform to the C Standard, and similarly
11390 for enum_bitset_type.
11391 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11392 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11393
11394 Do not use "struct bitset_struct" to mean different things in
11395 different modules. Not only is this confusing, it violates
11396 the C Standard, which requires that structure types in different
11397 modules must be compatible if one is to be passed to the other.
11398 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
11399 All instances of "struct bitset_struct *" replaced with "bitset".
11400 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
11401 (union bitset_union, struct abitset_struct, struct ebitset_struct,
11402 struct lbitset_struct, struct bitset_stats_struct): New types.
11403 All uses of struct bitset_struct changed to union bitset_union,
11404 etc.
11405 * lib/abitset.c (struct abitset_struct, abitset,
11406 struct bitset_struct): Remove.
11407 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
11408 struct bitset_struct): Remove.
11409 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
11410 bitset_struct): Remove.
11411 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
11412 Likewise.
11413
11414 Do not call a function of type T using a call that assumes the
11415 function is of a different type U. Standard C requires that a
11416 function must be called with a type that is compatible with its
11417 definition.
11418 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11419 New decls.
11420 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11421 New functions.
11422 * lib/ebitset.c (PFV): Remove.
11423 * lib/lbitset.c (PFV): Likewise.
11424 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
11425 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
11426 decls.
11427 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
11428 (ebitset_vtable): Use them.
11429 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
11430 lbitset_xor): New functions.
11431 (lbitset_vtable): Use them.
11432
11433 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
11434 Declare.
11435
11436 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
11437 GCC warning.
11438 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
11439 Use offsetof, for simplicity.
11440
114412002-10-06 Paul Eggert <eggert@twinsun.com>
11442
11443 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
11444 the same width as int. This reapplies a hunk of the 2002-08-12 patch
11445 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
11446 which was inadvertently undone by the 2002-09-30 patch.
11447 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
11448 the same width as int.
11449
114502002-10-04 Paul Eggert <eggert@twinsun.com>
11451
11452 Version 1.50.
11453
11454 * configure.ac (AC_INIT), NEWS: Increment version number.
11455
11456 * doc/bison.texinfo: Minor spelling, grammar, and white space
11457 fixes.
11458 (Symbols): Mention that any negative value returned from yylex
11459 signifies end-of-input. Warn about negative chars. Mention
11460 the portable Standard C character set.
11461
11462 The GNU coding standard says CFLAGS and YFLAGS are reserved
11463 for the installer to set.
11464 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
11465 * src/Makefile.am (AM_CFLAGS): Likewise.
11466 (AM_YFLAGS): Renamed from YFLAGS.
11467
11468 Fix some MAX and MIN problems.
11469 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
11470 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
11471 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
11472 * src/reader.c (reader): Use it.
11473
11474 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
11475 POSIX 1003.1-2001 has removed fgrep.
11476
114772002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
11478
11479 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
11480 interpreted as signed.
11481 * lib/ebitset.c (ebitset_list): Fix bug.
11482
114832002-10-01 Paul Eggert <eggert@twinsun.com>
11484
11485 More fixes for 64-bit hosts and large bitsets.
11486
11487 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
11488 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
11489 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
11490 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
11491 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
11492 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
11493 bitset_count_): Likewise.
11494 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
11495 bitset_first, bitset_last): Likewise.
11496 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
11497 bitset_stats_list_reverse, bitset_stats_size,
11498 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
11499 Likewise.
11500 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11501 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11502 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11503 bitsetv_reflexive_transitive_closure): Likewise.
11504 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
11505 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
11506 Likewise.
11507 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
11508 Likewise.
11509
11510 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
11511 Use size_t, not unsigned int, to count bytes.
11512 * lib/abitset.h (abitset_bytes): Likewise.
11513 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
11514 Likewise.
11515 * lib/bitset.h (bitset_bytes): Likewise.
11516 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
11517 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
11518 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11519 * lib/ebitset.c (ebitset_bytes): Likewise.
11520 * lib/ebitset.h (ebitset_bytes): Likewise.
11521 * lib/lbitset.c (lbitset_bytes): Likewise.
11522 * lib/lbitset.h (lbitset_bytes): Likewise.
11523
11524 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
11525 abitset_subset_p, abitset_disjoint_p, abitset_and,
11526 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
11527 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
11528 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
11529 abitset_or_and, abitset_or_and_cmp):
11530 Use bitset_windex instead of unsigned int.
11531 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
11532 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
11533 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
11534 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
11535 Likewise.
11536 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
11537
11538 * lib/bitset.c (bitset_print):
11539 Use proper printf formats for widths of integer types.
11540 * lib/bitset_stats.c (bitset_percent_histogram_print,
11541 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
11542 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11543 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
11544 * lib/lbitset.c (lbitset_bytes): Likewise.
11545
11546 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
11547 BITSET_SIZE_MAX): New macros.
11548 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
11549 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
11550 to BITSET_WINDEX_MAX.
11551
11552 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
11553 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
11554 since we now return the bitset_bindex type (not int).
11555
11556 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
11557 when computing sizes.
11558 * lib/ebitset.c (ebitset_elts_grow): Likewise.
11559
11560 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
11561 and avoid cast to unsigned.
11562
115632002-09-30 Akim Demaille <akim@epita.fr>
11564
11565 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11566 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
11567 Updates from Michael Hayes.
11568
115692002-09-30 Art Haas <ahaas@neosoft.com>
11570
11571 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
11572 invocations.
11573 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
11574 defined.
11575
115762002-09-27 Akim Demaille <akim@epita.fr>
11577
11578 Version 1.49c.
11579
115802002-09-27 Akim Demaille <akim@epita.fr>
11581
11582 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
11583 (Because of AC_LIBSOURCE).
11584
115852002-09-27 Akim Demaille <akim@epita.fr>
11586
11587 Playing with Autoscan.
11588
11589 * configure.ac: Remove the old LIBOBJ tweaks.
11590 (AC_REPLACE_FUNCS): Add strrchr and strtol.
11591 * lib/strrchr.c: New.
11592 * lib/strtol.c: New, from the Coreutils 4.5.1.
11593
115942002-09-27 Akim Demaille <akim@epita.fr>
11595
11596 Playing with Autoscan.
11597
11598 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
11599 * lib/Makefile.am (libbison_a_SOURCES): No longer include
11600 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
11601 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
11602 Coreutils 4.5.1.
11603
116042002-09-24 Akim Demaille <akim@epita.fr>
11605
11606 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
11607 (Frequently Asked Questions, Parser Stack Overflow): New.
11608
116092002-09-13 Akim Demaille <akim@epita.fr>
11610
11611 Playing with autoscan.
11612
11613 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
11614 * src/files.c (skeleton_find): Remove, unused.
11615 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
11616 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
11617
116182002-09-13 Akim Demaille <akim@epita.fr>
11619
11620 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
11621 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
11622
116232002-09-13 Akim Demaille <akim@epita.fr>
11624
11625 * configure.ac: Require 2.54.
11626 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
11627 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
11628 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
11629 Remove, provided by Autoconf macros.
11630
116312002-09-12 Akim Demaille <akim@epita.fr>
11632
11633 * m4/prereq.m4: Update, from Coreutils 4.5.1.
11634
116352002-09-12 Akim Demaille <akim@epita.fr>
11636
11637 * m4/prereq.m4: Update, from Fileutils 4.1.5.
11638 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
11639 Reported by Martin Mokrejs.
11640
116412002-09-10 Akim Demaille <akim@epita.fr>
11642
11643 * src/parse-gram.y: Associate a human readable string to each
11644 token type.
11645 * tests/regression.at (Invalid inputs): Adjust.
11646
116472002-09-10 Gary V. Vaughan <gary@gnu.org>
11648
11649 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
11650 with an Autoconf-2.5x style configure.ac.
11651
116522002-09-06 Paul Eggert <eggert@twinsun.com>
11653
11654 * doc/bison.texinfo (Conditions): Make explicit that the GPL
11655 exception applies only to yacc.c. This is a modification of a
11656 patch originally suggested by Akim Demaille.
11657
116582002-09-06 Akim Demaille <akim@epita.fr>
11659
11660 * data/c.m4 (b4_copyright): Move the GPL exception comment from
11661 here to...
11662 * data/yacc.c: here.
11663
11664 * data/lalr1.cc (struct yyltype): Don't define it, since we use
11665 LocationType.
11666 (b4_ltype): Default to yy::Location from location.hh.
11667
116682002-09-04 Jim Meyering <jim@meyering.net>
11669
11670 * data/yacc.c: Guard the declaration of yytoknum also with
11671 `#ifdef YYPRINT', so it is declared only when used.
11672
116732002-09-04 Akim Demaille <akim@epita.fr>
11674
11675 * configure.in: Rename as...
11676 * configure.ac: this.
11677 Bump to 1.49c.
11678
116792002-09-04 Akim Demaille <akim@epita.fr>
11680
11681 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
11682 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
11683 translate maintainer only messages.
11684
116852002-08-12 Paul Eggert <eggert@twinsun.com>
11686
11687 Version 1.49b.
11688
11689 * Makefile.am (SUBDIRS): Remove intl.
11690 (DISTCLEANFILES): Remove.
11691 * NEWS: Mention that GNU M4 is now required. Clarify what is
11692 meant by "larger grammars". Mention the pt_BR translation.
11693 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
11694 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
11695 Bump version from 0.11.2 to 0.11.5.
11696 (BISON_PREREQ_STAGE): Remove.
11697 (AM_GNU_GETTEXT): Use external gettext.
11698 (AC_OUTPUT): Remove intl/Makefile.
11699
11700 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
11701
11702 * data/glr.c: Include string.h, for strlen.
11703 (yyreportParseError): Use size_t for yysize.
11704 (yy_yypstack): No longer nested inside yypstates, as nested
11705 functions are not portable. Do not assume size_t is the
11706 same width as int.
11707 (yypstates): Do not assume that ptrdiff_t is the same width
11708 as int, and similarly for yyposn and YYINDEX.
11709
11710 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
11711
11712 * lib/Makefile.am (INCLUDES): Do not include from the intl
11713 directory, which has been removed.
11714 * src/Makefile.am (INCLUDES): Likewise.
11715
11716 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
11717 (bitsets_sources, additional_bitsets_sources, timevars_sources):
11718 New vars.
11719
11720 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
11721 * tests/Makefile.am (EXTRA_DIST): Likewise.
11722
11723 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
11724 Do not assume that bitset_windex is the same width as unsigned.
11725
11726 * lib/abitset.c (abitset_unused_clear): Do not assume that
11727 bitset_word is the same width as int.
11728 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
11729 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
11730 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
11731 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
11732 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
11733
11734 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
11735 portability to one's complement hosts!).
11736 * lib/ebitset.c (ebitset_op1): Likewise.
11737 * lib/lbitset.c (lbitset_op1): Likewise.
11738
11739 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
11740 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11741 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
11742 Sync with fileutils.
11743 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
11744 lib/gettext.h: Sync with diffutils.
11745
11746 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
11747 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
11748
11749 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
11750 PROTOTYPES to check for prototypes, and "defined __STDC__" to
11751 check for void *.
11752
11753 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
11754 size_t; the old version tried to do this but casted improperly.
11755 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
11756 (bitset_test): Now returns int, not unsigned long.
11757
11758 * lib/bitset_stats.c: Include "gettext.h".
11759 (_): New macro.
11760 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
11761 name locals "index", as it generates unnecessary warnings on some
11762 hosts that have an "index" function.
11763
11764 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
11765 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
11766 they need translation.
11767 * src/LR0.c (state_list_append, new_itemsets, get_state,
11768 append_states, generate_states): Likewise.
11769 * src/assoc.c (assoc_to_string): Likewise.
11770 * src/closure.c (print_closure, set_firsts, closure): Likewise.
11771 * src/gram.c (grammar_dump): Likewise.
11772 * src/injections.c (injections_compute): Likewise.
11773 * src/lalr.c (lookaheads_print): Likewise.
11774 * src/relation.c (relation_transpose): Likewise.
11775 * src/scan-gram.l: Likewise.
11776 * src/tables.c (table_grow, pack_vector): Likewise.
11777
11778 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
11779 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
11780 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
11781 * m4/mbstate_t.m4: Sync with fileutils.
11782 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
11783
11784 * po/LINGUAS: Add pt_BR.
11785 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
11786 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
11787 lib/timevar.c.
11788 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
11789 manual recommends.
11790 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
11791
11792 * src/complain.c (strerror_r): Remove decl; not needed.
11793 (strerror): Use same pattern as ../lib/error.c.
11794
11795 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
11796
11797 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
11798
11799 * src/main.c (main): Cast result of bindtextdomain and textdomain
11800 to void, to avoid a GCC warning when --disable-nls is in effect.
11801
11802 * src/scan-gram.l: Use strings rather than escapes when possible,
11803 to minimize the number of warnings from xgettext.
11804 (handle_action_dollar, handle_action_at): Don't use isdigit,
11805 as it mishandles negative chars and it may not work as expected
11806 outside the C locale.
11807
11808 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
11809 this is a GCC extension and is not portable to other compilers.
11810
11811 * src/system.h (alloca): Use same pattern as ../lib/error.c.
11812 Do not include <ctype.h>; no longer needed.
11813 Do not include <malloc.h>; no longer needed (and generates
11814 warnings on OpenBSD 3.0).
11815
11816 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
11817 it's not portable.
11818
11819 * tests/regression.at: Do not use 'cc -c input.c -o input';
11820 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
11821
11822 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
11823 exit status as failure, not just exit status 1. Sun C exits
11824 with status 2 sometimes.
11825
11826 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
11827 Use it for the two large tests.
11828
118292002-08-02 Akim Demaille <akim@epita.fr>
11830
11831 * src/conflicts.c (conflicts_output): Don't output rules never
11832 reduced here, since anyway that computation doesn't work.
11833 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
11834 (rule_useless_p, rule_never_reduced_p): New.
11835 (grammar_rules_partial_print): Use a filter instead of a range.
11836 Display the title only if needed.
11837 (grammar_rules_print): Adjust.
11838 (grammar_rules_never_reduced_report): New.
11839 * src/tables.c (action_row): Move the computation of rules never
11840 reduced to...
11841 (token_actions): here.
11842 * src/main.c (main): Make the parser before making the report, so
11843 that rules never reduced are computed.
11844 Call grammar_rules_never_reduced_report.
11845 * src/print.c (print_results): Report rules never reduced.
11846 * tests/conflicts.at, tests/reduce.at: Adjust.
11847
118482002-08-01 Akim Demaille <akim@epita.fr>
11849
11850 Instead of attaching lookaheads and duplicating the rules being
11851 reduced by a state, attach the lookaheads to the reductions.
11852
11853 * src/state.h (state_t): Remove the `lookaheads',
11854 `lookaheads_rule' member.
11855 (reductions_t): Add a `lookaheads' member.
11856 Use a regular array for the `rules'.
11857 * src/state.c (reductions_new): Initialize the lookaheads member
11858 to 0.
11859 (state_rule_lookaheads_print): Adjust.
11860 * src/state.h, src/state.c (state_reductions_find): New.
11861 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
11862 (count_rr_conflicts): Adjust.
11863 * src/lalr.c (LArule): Remove.
11864 (add_lookback_edge): Adjust.
11865 (state_lookaheads_count): New.
11866 (states_lookaheads_initialize): Merge into...
11867 (initialize_LA): this.
11868 (lalr_free): Adjust.
11869 * src/main.c (main): Don't free nullable and derives too early: it
11870 is used by --verbose.
11871 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
11872
118732002-08-01 Akim Demaille <akim@epita.fr>
11874
11875 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
11876 `rule_number_t**'.
11877 (set_derives, free_derives): Rename as...
11878 (derives_compute, derives_free): this.
11879 Adjust all dependencies.
11880 * src/nullable.c (set_nullable, free_nullable): Rename as...
11881 (nullable_compute, nullable_free): these.
11882 (rule_list_t): Store rule_t *, not rule_number_t.
11883 * src/state.c (state_rule_lookaheads_print): Directly compare rule
11884 pointers, instead of their numbers.
11885 * src/main.c (main): Call nullable_free, and derives_free earlier,
11886 as they were lo longer used.
11887
118882002-08-01 Akim Demaille <akim@epita.fr>
11889
11890 * lib/timevar.c (get_time): Include children time.
11891 * src/lalr.h (LA, LArule): Don't export them: used with the
11892 state_t.
11893 * src/lalr.c (LA, LArule): Static.
11894 * src/lalr.h, src/lalr.c (lalr_free): New.
11895 * src/main.c (main): Call it.
11896 * src/tables.c (pack_vector): Check whether loc is >= to the
11897 table_size, not >.
11898 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
11899 (tables_generate): do it, since that's also it which allocates
11900 them.
11901 Don't free LA and LArule, main does.
11902
119032002-07-31 Akim Demaille <akim@epita.fr>
11904
11905 Separate parser tables computation and output.
11906
11907 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
11908 (conflict_list, conflict_list_cnt, table, check, table_ninf)
11909 (yydefgoto, yydefact, high): Move to...
11910 * src/tables.h, src/tables.c: here.
11911 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
11912 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
11913 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
11914 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
11915 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
11916 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
11917 (action_row, save_row, token_actions, save_column, default_goto)
11918 (goto_actions, sort_actions, matching_state, pack_vector)
11919 (table_ninf_remap, pack_table, prepare_actions): Move to...
11920 * src/tables.c: here.
11921 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
11922 * src/output.c (token_actions, output_base, output_conflicts)
11923 (output_check): Merge into...
11924 (prepare_actions): this.
11925 (actions_output): Rename as...
11926 (user_actions_output): this.
11927 * src/main.c (main): Call tables_generate and tables_free.
11928
119292002-07-31 Akim Demaille <akim@epita.fr>
11930
11931 Steal GCC's --time-report support.
11932
11933 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
11934 stolen/adjusted from GCC.
11935 * m4/stage.m4: Remove time related checks.
11936 * m4/timevar.m4: New.
11937 * configure.in: Adjust.
11938 * src/system.h: Adjust to using timevar.h.
11939 * src/getargs.h, src/getargs.c: Support trace_time for
11940 --trace=time.
11941 * src/main.c (stage): Remove.
11942 (main): Replace `stage' invocations with timevar calls.
11943 * src/output.c: Insert pertinent timevar calls.
11944
119452002-07-31 Akim Demaille <akim@epita.fr>
11946
11947 Let --trace have arguments.
11948
11949 * src/getargs.h (enum trace_e): New.
11950 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
11951 (long_options, short_options): --trace/-T takes an optional
11952 argument.
11953 Change all the uses of trace_flag to reflect the new flags.
11954 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
11955
11956 Strengthen `stage' portability.
11957
11958 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
11959 * configure.in: Use it.
11960 Don't check for malloc.h and sys/times.h.
11961 * src/system.h: Include them when appropriate.
11962 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
11963 times and struct tms are available.
11964
119652002-07-30 Akim Demaille <akim@epita.fr>
11966
11967 In verbose parse error message, don't report `error' as an
11968 expected token.
11969 * tests/actions.at (Printers and Destructors): Adjust.
11970 * tests/calc.at (Calculator $1): Adjust.
11971 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
11972 error message, do not report the parser accepts the error token in
11973 that state.
11974
119752002-07-30 Akim Demaille <akim@epita.fr>
11976
11977 Normalize conflict related messages.
11978
11979 * src/complain.h, src/complain.c (warn, complain): New.
11980 * src/conflicts.c (conflicts_print): Use them.
11981 (conflict_report_yacc): New, extracted from...
11982 (conflicts_print): here.
11983 * tests/conflicts.at, tests/existing.at: Adjust.
11984
119852002-07-30 Akim Demaille <akim@epita.fr>
11986
11987 Report rules which are never reduced by the parser: those hidden
11988 by conflicts.
11989
11990 * src/LR0.c (save_reductions): Don't make the final state too
11991 different: save its reduction (accept) instead of having a state
11992 without any action (no shift or goto, no reduce).
11993 Note: the final state is now a ``regular'' state, i.e., the
11994 parsers now contain `reduce 0' as default reduction.
11995 Nevertheless, since they decide to `accept' when yystate =
11996 final_state, they still will not reduce rule 0.
11997 * src/print.c (print_actions, print_reduction): Adjust.
11998 * src/output.c (action_row): Track reduced rules.
11999 (token_actions): Report rules never reduced.
12000 * tests/conflicts.at, tests/regression.at: Adjust.
12001
120022002-07-30 Akim Demaille <akim@epita.fr>
12003
12004 `stage' was accidently included in a previous patch.
12005 Initiate its autoconfiscation.
12006
12007 * configure.in: Look for malloc.h and sys/times.h.
12008 * src/main.c (stage): Adjust.
12009 Report only when trace_flag.
12010
120112002-07-29 Akim Demaille <akim@epita.fr>
12012
12013 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
12014 state_number_t.
12015 (errs_t): symbol_t*, not symbol_number_t.
12016 (reductions_t): rule_t*, not rule_number_t.
12017 (FOR_EACH_SHIFT): New.
12018 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
12019 * src/print.c, src/print_graph.c: Adjust.
12020
120212002-07-29 Akim Demaille <akim@epita.fr>
12022
12023 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
12024
12025 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
12026 (endtoken, accept): these.
12027 * src/reader.c (reader): Set endtoken's default tag to "$end".
12028 Set undeftoken's tag to "$undefined" instead of "$undefined.".
12029 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
12030 Adjust.
12031
120322002-07-29 Akim Demaille <akim@epita.fr>
12033
12034 * src/reduce.c (reduce_grammar): When the language is empty,
12035 complain about the start symbol, not the axiom.
12036 Use its location.
12037 * tests/reduce.at (Empty Language): New.
12038
120392002-07-26 Akim Demaille <akim@epita.fr>
12040
12041 * src/reader.h, src/reader.c (gram_error): ... can't get
12042 yycontrol without making too strong assumptions on the parser
12043 itself.
12044 * src/output.c (prepare_tokens): Use the real 0th value of
12045 token_translations instead of `0'.
12046 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
12047 visible here.
12048 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
12049 for the time being: %locations ought to provide it to yyerror.
12050
120512002-07-25 Akim Demaille <akim@epita.fr>
12052
12053 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
12054 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
12055 * tests/regression.at (Web2c Actions): Adjust.
12056
120572002-07-25 Akim Demaille <akim@epita.fr>
12058
12059 Stop storing rules from 1 to nrules + 1.
12060
12061 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
12062 * src/nullable.c, src/output.c, src/print.c, src/reader.c
12063 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
12064 Iterate from 0 to nrules.
12065 Use rule_number_as_item_number and item_number_as_rule_number.
12066 Adjust to `derive' now containing possibly 0.
12067 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
12068 Handle the `- 1' part in rule numbers from/to item numbers.
12069 * src/conflicts.c (log_resolution): Fix the message which reversed
12070 shift and reduce.
12071 * src/output.c (action_row): Initialize default_rule to -1.
12072 (token_actions): Adjust.
12073 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
12074 expected output.
12075 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
12076
120772002-07-25 Akim Demaille <akim@epita.fr>
12078
12079 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
12080 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
12081 (b4_c_knr_arg_decl): New.
12082 * data/yacc.c: Use it to define yysymprint, yydestruct, and
12083 yyreport_parse_error.
12084
120852002-07-25 Akim Demaille <akim@epita.fr>
12086
12087 * data/yacc.c (yyreport_parse_error): New, extracted from...
12088 (yyparse): here.
12089 (yydestruct, yysymprint): Move above yyparse.
12090 Be K&R compliant.
12091
120922002-07-25 Akim Demaille <akim@epita.fr>
12093
12094 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
12095 replace...
12096 (b4_sint_type, b4_uint_type): these.
12097 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
12098 * tests/regression.at (Web2c Actions): Adjust.
12099
121002002-07-25 Akim Demaille <akim@epita.fr>
12101
12102 * src/gram.h (TIEM_NUMBER_MAX): New.
12103 (item_number_of_rule_number, rule_number_of_item_number): Rename
12104 as...
12105 (rule_number_as_item_number, item_number_as_rule_number): these.
12106 Adjust dependencies.
12107 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12108 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12109 (symbol_number_to_vector_number): New.
12110 (order): Of vector_number_t* type.
12111 (base_t, BASE_MAX, BASE_MIN): New.
12112 (froms, tos, width, pos, check): Of base_t type.
12113 (action_number_t, ACTION_MIN, ACTION_MAX): New.
12114 (actrow): Of action_number_t type.
12115 (conflrow): Of unsigned int type.
12116 (table_ninf, base_ninf): New.
12117 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
12118 (muscle_insert_int_table, muscle_insert_base_table)
12119 (muscle_insert_rule_number_table): New.
12120 (prepare_tokens): Output `toknum' as int_table.
12121 (action_row): Returns a rule_number_t.
12122 Use ACTION_MIN, not SHRT_MIN.
12123 (token_actions): yydefact is rule_number_t*.
12124 (table_ninf_remap): New.
12125 (pack_table): Use it for `base' and `table'.
12126 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
12127 replaced with...
12128 (YYPACT_NINF, YYTABLE_NINF): these.
12129 (yypact, yytable): Compute their types instead of hard-coded
12130 `short'.
12131 * tests/regression.at (Web2c Actions): Adjust.
12132
121332002-07-19 Akim Demaille <akim@epita.fr>
12134
12135 * src/scan-gram.l (id): Can start with an underscore.
12136
121372002-07-16 Akim Demaille <akim@epita.fr>
12138
12139 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
12140 Adjust all former `associativity' dependencies.
12141 * src/symtab.c (symbol_new): Default associativity is `undef', not
12142 `right'.
12143 (symbol_check_alias_consistence): Adjust.
12144
121452002-07-09 Akim Demaille <akim@epita.fr>
12146
12147 * doc/bison.texinfo: Properly set the ``header'' part.
12148 Use @dircategory ``GNU programming tools'' as per Texinfo's
12149 documentation.
12150 Use @copying.
12151
121522002-07-09 Akim Demaille <akim@epita.fr>
12153
12154 * lib/quotearg.h: Protect against multiple inclusions.
12155 * src/location.h (location_t): Add a `file' member.
12156 (LOCATION_RESET, LOCATION_PRINT): Adjust.
12157 * src/complain.c (warn_at, complain_at, fatal_at): Drop
12158 `error_one_per_line' support.
12159
121602002-07-09 Akim Demaille <akim@epita.fr>
12161
12162 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
12163 * src/reader.c (lineno): Remove.
12164 Adjust all dependencies.
12165 (get_merge_function): Take a location and use complain_at.
12166 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
12167 * tests/regression.at (Invalid inputs, Mixing %token styles):
12168 Adjust.
12169
121702002-07-09 Akim Demaille <akim@epita.fr>
12171
12172 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
12173 recovery rule, and forbid extensions when --yacc.
12174 (gram_error): Use complain_at.
12175 * src/reader.c (reader): Exit if there were parse errors.
12176
121772002-07-09 Akim Demaille <akim@epita.fr>
12178
12179 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
12180 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
12181 Reported by R Blake <blakers@mac.com>.
12182
121832002-07-09 Akim Demaille <akim@epita.fr>
12184
12185 * data/yacc.c: Output the copyright notive in the header.
12186
121872002-07-03 Akim Demaille <akim@epita.fr>
12188
12189 * src/output.c (froms, tos): Are state_number_t.
12190 (save_column): sp, sp1, and sp2 are state_number_t.
12191 (prepare): Rename `final' as `final_state_number', `nnts' as
12192 `nterms_number', `nrules' as `rules_number', `nstates' as
12193 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
12194 unused.
12195 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
12196 * data/lalr1.cc (nsym_): Remove, unused.
12197
121982002-07-03 Akim Demaille <akim@epita.fr>
12199
12200 * src/lalr.h, src/lalr.c (goto_number_t): New.
12201 * src/lalr.c (goto_list_t): New.
12202 Propagate them.
12203 * src/nullable.c (rule_list_t): New.
12204 Propagate.
12205 * src/types.h: Remove.
12206
122072002-07-03 Akim Demaille <akim@epita.fr>
12208
12209 * src/closure.c (print_fderives): Use rule_rhs_print.
12210 * src/derives.c (print_derives): Use rule_rhs_print.
12211 (rule_list_t): New, replaces `shorts'.
12212 (set_derives): Add comments.
12213 * tests/sets.at (Nullable, Firsts): Adjust.
12214
122152002-07-03 Akim Demaille <akim@epita.fr>
12216
12217 * src/output.c (prepare_actions): Free `tally' and `width'.
12218 (prepare_actions): Allocate and free `order'.
12219 * src/symtab.c (symbols_free): Free `symbols'.
12220 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
12221 * src/output.c (m4_invoke): Move to...
12222 * src/scan-skel.l: here.
12223 (<<EOF>>): Close yyout, and free its name.
12224
122252002-07-03 Akim Demaille <akim@epita.fr>
12226
12227 Fix some memory leaks, and fix a bug: state 0 was examined twice.
12228
12229 * src/LR0.c (new_state): Merge into...
12230 (state_list_append): this.
12231 (new_states): Merge into...
12232 (generate_states): here.
12233 (set_states): Don't ensure a proper `errs' state member here, do it...
12234 * src/conflicts.c (conflicts_solve): here.
12235 * src/state.h, src/state.c: Comment changes.
12236 (state_t): Rename member `shifts' as `transitions'.
12237 Adjust all dependencies.
12238 (errs_new): For consistency, also take the values as argument.
12239 (errs_dup): Remove.
12240 (state_errs_set): New.
12241 (state_reductions_set, state_transitions_set): Assert that no
12242 previous value was assigned.
12243 (state_free): New.
12244 (states_free): Use it.
12245 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
12246 temporary storage: use `errs' and `nerrs' as elsewhere.
12247 (set_conflicts): Allocate and free this `errs'.
12248
122492002-07-02 Akim Demaille <akim@epita.fr>
12250
12251 * lib/libiberty.h: New.
12252 * lib: Update the bitset implementation from upstream.
12253 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
12254 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
12255 * src/main.c: Adjust bitset stats calls.
12256
122572002-07-01 Paul Eggert <eggert@twinsun.com>
12258
12259 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
12260 char, so that negative chars don't collide with $.
12261
122622002-06-30 Akim Demaille <akim@epita.fr>
12263
12264 Have the GLR tests be `warning' checked, and fix the warnings.
12265
12266 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
12267 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
12268 (yyremoveDeletes): `yyi' and `yyj' are size_t.
12269 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
12270 (yyaddDeferredAction): static.
12271 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
12272 (yyreportParseError): yyprefix is const.
12273 yytokenp is used only when verbose.
12274 (yy__GNUC__): Replace with __GNUC__.
12275 (yypdumpstack): yyi is size_t.
12276 (yypreference): Un-yy local variables and arguments, to avoid
12277 clashes with `yyr1'. Anyway, we are not in the user name space.
12278 (yytname_size): be an int, as is compared with ints.
12279 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
12280 Use them.
12281 * tests/cxx-gram.at: Use quotation to protect $1.
12282 Use AT_COMPILE to enable warnings hunts.
12283 Prototype yylex and yyerror.
12284 `Use' argc.
12285 Include `string.h', not `strings.h'.
12286 Produce and prototype stmtMerge only when used.
12287 yylex takes a location.
12288
122892002-06-30 Akim Demaille <akim@epita.fr>
12290
12291 We spend a lot of time in quotearg, in particular when --verbose.
12292
12293 * src/symtab.c (symbol_get): Store a quoted version of the key.
12294 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
12295 Adjust all callers.
12296
122972002-06-30 Akim Demaille <akim@epita.fr>
12298
12299 * src/state.h (reductions_t): Rename member `nreds' as num.
12300 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
12301 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
12302
123032002-06-30 Akim Demaille <akim@epita.fr>
12304
12305 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
12306 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
12307 (shifts_to): Rename as...
12308 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
12309 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
12310 (TRANSITION_IS_DISABLED, transitions_to): these.
12311
123122002-06-30 Akim Demaille <akim@epita.fr>
12313
12314 * src/print.c (print_shifts, print_gotos): Merge into...
12315 (print_transitions): this.
12316 (print_transitions, print_errs, print_reductions): Align the
12317 lookaheads columns.
12318 (print_core, print_transitions, print_errs, print_state,
12319 print_grammar): Output empty lines separator before, not after.
12320 (state_default_rule_compute): Rename as...
12321 (state_default_rule): this.
12322 * tests/conflicts.at (Defaulted Conflicted Reduction),
12323 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
12324 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
12325
123262002-06-30 Akim Demaille <akim@epita.fr>
12327
12328 Display items as we display rules.
12329
12330 * src/gram.h, src/gram.c (rule_lhs_print): New.
12331 * src/gram.c (grammar_rules_partial_print): Use it.
12332 * src/print.c (print_core): Likewise.
12333 * tests/conflicts.at (Defaulted Conflicted Reduction),
12334 (Unresolved SR Conflicts): Adjust.
12335 (Unresolved SR Conflicts): Adjust and rename as...
12336 (Resolved SR Conflicts): this, as was meant.
12337 * tests/regression.at (Web2c Report): Adjust.
12338
123392002-06-30 Akim Demaille <akim@epita.fr>
12340
12341 * src/print.c (state_default_rule_compute): New, extracted from...
12342 (print_reductions): here.
12343 Pessimize, but clarify the code.
12344 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
12345
123462002-06-30 Akim Demaille <akim@epita.fr>
12347
12348 * src/output.c (action_row): Let default_rule be always a rule
12349 number.
12350
123512002-06-30 Akim Demaille <akim@epita.fr>
12352
12353 * src/closure.c (print_firsts, print_fderives, closure):
12354 Use BITSET_EXECUTE.
12355 * src/lalr.c (lookaheads_print): Likewise.
12356 * src/state.c (state_rule_lookaheads_print): Likewise.
12357 * src/print_graph.c (print_core): Likewise.
12358 * src/print.c (print_reductions): Likewise.
12359 * src/output.c (action_row): Likewise.
12360 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
12361
123622002-06-30 Akim Demaille <akim@epita.fr>
12363
12364 * src/print_graph.c: Use report_flag.
12365
123662002-06-30 Akim Demaille <akim@epita.fr>
12367
12368 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
12369 to...
12370 * src/relation.h, src/relation.c (traverse, relation_digraph)
12371 (relation_print, relation_transpose): New.
12372
123732002-06-30 Akim Demaille <akim@epita.fr>
12374
12375 * src/state.h, src/state.c (shifts_to): New.
12376 * src/lalr.c (build_relations): Use it.
12377
123782002-06-30 Akim Demaille <akim@epita.fr>
12379
12380 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
12381 (item_number_of_rule_number, rule_number_of_item_number): New.
12382 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
12383 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
12384 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
12385 Propagate their use.
12386 Much remains to be done, in particular wrt `shorts' from types.h.
12387
123882002-06-30 Akim Demaille <akim@epita.fr>
12389
12390 * src/symtab.c (symbol_new): Initialize the `printer' member.
12391
123922002-06-30 Akim Demaille <akim@epita.fr>
12393
12394 * src/LR0.c (save_reductions): Remove, replaced by...
12395 * src/state.h, src/state.c (state_reductions_set): New.
12396 (reductions, errs): Rename as...
12397 (reductions_t, errs_t): these.
12398 Adjust all dependencies.
12399
124002002-06-30 Akim Demaille <akim@epita.fr>
12401
12402 * src/LR0.c (state_list_t, state_list_append): New.
12403 (first_state, last_state): Now symbol_list_t.
12404 (this_state): Remove.
12405 (new_itemsets, append_states, save_reductions): Take a state_t as
12406 argument.
12407 (set_states, generate_states): Adjust.
12408 (save_shifts): Remove, replaced by...
12409 * src/state.h, src/state.c (state_shifts_set): New.
12410 (shifts): Rename as...
12411 (shifts_t): this.
12412 Adjust all dependencies.
12413 * src/state.h (state_t): Remove the `next' member.
12414
124152002-06-30 Akim Demaille <akim@epita.fr>
12416
12417 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
12418 escaped in slot 0.
12419
124202002-06-30 Akim Demaille <akim@epita.fr>
12421
12422 Use hash.h for the state hash table.
12423
12424 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
12425 (allocate_storage): Use state_hash_new.
12426 (free_storage): Use state_hash_free.
12427 (new_state, get_state): Adjust.
12428 * src/lalr.h, src/lalr.c (states): Move to...
12429 * src/states.h (state_t): Remove the `link' member, no longer
12430 used.
12431 * src/states.h, src/states.c: here.
12432 (state_hash_new, state_hash_free, state_hash_lookup)
12433 (state_hash_insert, states_free): New.
12434 * src/states.c (state_table, state_compare, state_hash): New.
12435 * src/output.c (output_actions): Do not free states now, since we
12436 still need to know the final_state number in `prepare', called
12437 afterwards. Do it...
12438 * src/main.c (main): here: call states_free after `output'.
12439
124402002-06-30 Akim Demaille <akim@epita.fr>
12441
12442 * src/state.h, src/state.c (state_new): New, extracted from...
12443 * src/LR0.c (new_state): here.
12444 * src/state.h (STATE_ALLOC): Move to...
12445 * src/state.c: here.
12446 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
12447 * src/state.h, src/state.c: here.
12448
124492002-06-30 Akim Demaille <akim@epita.fr>
12450
12451 * src/reader.c (gensym): Rename as...
12452 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
12453 (getsym): Rename as...
12454 (symbol_get): this.
12455
124562002-06-30 Akim Demaille <akim@epita.fr>
12457
12458 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
12459 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
12460 * src/output.c, src/print.c, src/print_graph.c: Propagate.
12461 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
12462
124632002-06-30 Akim Demaille <akim@epita.fr>
12464
12465 Make the test suite pass with warnings checked.
12466
12467 * tests/actions.at (Printers and Destructors): Improve.
12468 Avoid unsigned vs. signed issues.
12469 * tests/calc.at: Don't exercise the scanner here, do it...
12470 * tests/input.at (Torturing the Scanner): here.
12471
124722002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12473
12474 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
12475 reorganize first lines parallel to yacc.c.
12476
124772002-06-28 Akim Demaille <akim@epita.fr>
12478
12479 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
12480 (b4_token_enum, b4_token_defines): New, factored from...
12481 * data/lalr1.cc, data/yacc.c, glr.c: here.
12482
124832002-06-28 Akim Demaille <akim@epita.fr>
12484
12485 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
12486 unused variables.
12487 * src/output.c (merger_output): static.
12488
124892002-06-28 Akim Demaille <akim@epita.fr>
12490
12491 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
12492 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
12493 pacify GCC.
12494 * src/output.c (save_row): Initialize all the variables to pacify GCC.
12495
124962002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12497
12498 Accumulated changelog for new GLR parsing features.
12499
12500 * src/conflicts.c (count_total_conflicts): Change name to
12501 conflicts_total_count.
12502 * src/conflicts.h: Ditto.
12503 * src/output.c (token_actions): Use the new name.
12504 (output_conflicts): Change conflp => conflict_list_heads, and
12505 confl => conflict_list for better readability.
12506 * data/glr.c: Use the new names.
12507 * NEWS: Add self to GLR announcement.
12508
12509 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
12510
12511 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
12512 Akim Demaille.
12513
12514 * data/bison.glr: Change name to glr.c
12515 * data/glr.c: Renamed from bison.glr.
12516 * data/Makefile.am: Add glr.c
12517
12518 * src/getargs.c:
12519
12520 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
12521 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
12522
12523 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12524
12525 * data/bison.glr: Be sure to restore the
12526 current #line when returning to the skeleton contents after having
12527 exposed the input file's #line.
12528
12529 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12530
12531 * data/bison.glr: Bring up to date with changes to bison.simple.
12532
12533 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12534
12535 * data/bison.glr: Correct definitions that use b4_prefix.
12536 Various reformatting.
12537 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
12538 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
12539 yytokenp argument; now part of stack.
12540 (yychar): Define to behave as documented.
12541 (yyclearin): Ditto.
12542
12543 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12544
12545 * src/reader.h: Add declaration for free_merger_functions.
12546
12547 * src/reader.c (merge_functions): New variable.
12548 (get_merge_function): New function.
12549 (free_merger_functions): New function.
12550 (readgram): Check for %prec that is not followed by a symbol.
12551 Handle %dprec and %merge declarations.
12552 (packgram): Initialize dprec and merger fields in rules array.
12553
12554 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
12555 conflict_list_cnt, conflict_list_free): New variables.
12556 (table_grow): Also grow conflict_table.
12557 (prepare_rules): Output dprec and merger tables.
12558 (conflict_row): New function.
12559 (action_row): Output conflict lists for GLR parser. Don't use
12560 default reduction in conflicted states for GLR parser so that there
12561 are spaces for the conflict lists.
12562 (save_row): Also save conflict information.
12563 (token_actions): Allocate conflict list.
12564 (merger_output): New function.
12565 (pack_vector): Pack conflict table, too.
12566 (output_conflicts): New function to output yyconflp and yyconfl.
12567 (output_check): Allocate conflict_tos.
12568 (output_actions): Output conflict tables, also.
12569 (output_skeleton): Output b4_mergers definition.
12570 (prepare): Output b4_max_rhs_length definition.
12571 Use 'bison.glr' as default skeleton for GLR parsers.
12572
12573 * src/gram.c (glr_parser): New flag.
12574 (grammar_free): Call free_merger_functions.
12575
12576 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
12577 all pairs of conflicting reductions, rather than just all tokens
12578 causing conflicts. Needed to size conflict tables.
12579 (conflicts_output): Modify call to count_rr_conflicts for new
12580 interface.
12581 (conflicts_print): Ditto.
12582 (count_total_conflicts): New function.
12583
12584 * src/reader.h (merger_list): New type.
12585 (merge_functions): New variable.
12586
12587 * src/lex.h (tok_dprec, tok_merge): New token types.
12588
12589 * src/gram.h (rule_s): Add dprec and merger fields.
12590 (glr_parser): New flag.
12591
12592 * src/conflicts.h (count_total_conflicts): New function.
12593
12594 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
12595
12596 * doc/bison.texinfo (Generalized LR Parsing): New section.
12597 (GLR Parsers): New section.
12598 (Language and Grammar): Mention GLR parsing.
12599 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
12600 Correct typo ("tge" -> "the").
12601
12602 * data/bison.glr: New skeleton for GLR parsing.
12603
12604 * tests/cxx-gram.at: New tests for GLR parsing.
12605
12606 * tests/testsuite.at: Include cxx-gram.at.
12607
12608 * tests/Makefile.am: Add cxx-gram.at.
12609
12610 * src/parse-gram.y:
12611
12612 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
12613
12614 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
12615
126162002-06-27 Akim Demaille <akim@epita.fr>
12617
12618 * src/options.h, src/options.c: Remove.
12619 * src/getargs.c (short_options, long_options): New.
12620
126212002-06-27 Akim Demaille <akim@epita.fr>
12622
12623 * data/bison.simple, data/bison.c++: Rename as...
12624 * data/yacc.c, data/lalr1.cc: these.
12625 * doc/bison.texinfo (Environment Variables): Remove.
12626
126272002-06-25 Raja R Harinath <harinath@cs.umn.edu>
12628
12629 * src/getargs.c (report_argmatch): Initialize strtok().
12630
126312002-06-20 Akim Demaille <akim@epita.fr>
12632
12633 * data/bison.simple (b4_symbol_actions): New, replaces...
12634 (b4_symbol_destructor, b4_symbol_printer): these.
12635 (yysymprint): Be sure to call YYPRINT only for tokens, and using
12636 user token numbers.
12637
126382002-06-20 Akim Demaille <akim@epita.fr>
12639
12640 * data/bison.simple (yydestructor): Rename as...
12641 (yydestruct): this.
12642
126432002-06-20 Akim Demaille <akim@epita.fr>
12644
12645 * src/symtab.h, src/symtab.c (symbol_type_set)
12646 (symbol_destructor_set, symbol_precedence_set): The location is
12647 the last argument.
12648 Adjust all callers.
12649
126502002-06-20 Akim Demaille <akim@epita.fr>
12651
12652 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
12653 internals.
12654 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
12655 Takes a location.
12656 * src/symtab.h, src/symtab.c (symbol_class_set)
12657 (symbol_user_token_number_set): Likewise.
12658 Adjust all callers.
12659 Promote complain_at.
12660 * tests/input.at (Type Clashes): Adjust.
12661
126622002-06-20 Akim Demaille <akim@epita.fr>
12663
12664 * data/bison.simple (YYLEX): Fix the declaration when
12665 %pure-parser.
12666
126672002-06-20 Akim Demaille <akim@epita.fr>
12668
12669 * data/bison.simple (yysymprint): Don't print the token number,
12670 just its name.
12671 * tests/actions.at (Destructors): Rename as...
12672 (Printers and Destructors): this.
12673 Also exercise %printer.
12674
126752002-06-20 Akim Demaille <akim@epita.fr>
12676
12677 * data/bison.simple (YYDSYMPRINT): New.
12678 Use it to remove many of the #if YYDEBUG/if (yydebug).
12679
126802002-06-20 Akim Demaille <akim@epita.fr>
12681
12682 * src/symtab.h, src/symtab.c (symbol_t): printer and
12683 printer_location are new members.
12684 (symbol_printer_set): New.
12685 * src/parse-gram.y (PERCENT_PRINTER): New token.
12686 Handle its associated rule.
12687 * src/scan-gram.l: Adjust.
12688 (handle_destructor_at, handle_destructor_dollar): Rename as...
12689 (handle_symbol_code_at, handle_symbol_code_dollar): these.
12690 * src/output.c (symbol_printers_output): New.
12691 (output_skeleton): Call it.
12692 * data/bison.simple (yysymprint): New. Cannot be named yyprint
12693 since there are already many grammar files with a user `yyprint'.
12694 Replace the calls to YYPRINT to calls to yysymprint.
12695 * tests/calc.at: Adjust.
12696 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
12697 taking advantage of parser very internal details (stack size!).
12698
126992002-06-20 Akim Demaille <akim@epita.fr>
12700
12701 * src/scan-gram.l: Complete the scanner with the missing patterns
12702 to pacify Flex.
12703 Use `quote' and `symbol_tag_get' where appropriate.
12704
127052002-06-19 Akim Demaille <akim@epita.fr>
12706
12707 * tests/actions.at (Destructors): Augment to test locations.
12708 * data/bison.simple (yydestructor): Pass it the current location
12709 if locations are enabled.
12710 Prototype only when __STDC__ or C++.
12711 Change the argument names to move into the yy name space: there is
12712 user code here.
12713
127142002-06-19 Akim Demaille <akim@epita.fr>
12715
12716 * data/bison.simple (b4_pure_if): New.
12717 Use it instead of #ifdef YYPURE.
12718
127192002-06-19 Akim Demaille <akim@epita.fr>
12720
12721 * data/bison.simple (b4_location_if): New.
12722 Use it instead of #ifdef YYLSP_NEEDED.
12723
127242002-06-19 Akim Demaille <akim@epita.fr>
12725
12726 Prepare @$ in %destructor, but currently don't bind it in the
12727 skeleton, as %location use is not cleaned up yet.
12728
12729 * src/scan-gram.l (handle_dollar, handle_destructor_at)
12730 (handle_action_at): New.
12731 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
12732 a braced_code_t and a location as additional arguments.
12733 (handle_destructor_dollar): Instead of requiring `b4_eval', just
12734 unquote one when outputting `b4_dollar_dollar'.
12735 Adjust callers.
12736 * data/bison.simple (b4_eval): Remove.
12737 (b4_symbol_destructor): Adjust.
12738 * tests/input.at (Invalid @n): Adjust.
12739
127402002-06-19 Zack Weinberg <zack@codesourcery.com>
12741
12742 * doc/bison.texinfo: Document ability to have multiple
12743 prologue sections.
12744
127452002-06-18 Akim Demaille <akim@epita.fr>
12746
12747 * src/files.c (compute_base_names): When computing the output file
12748 names from the input file name, strip the directory part.
12749
127502002-06-18 Akim Demaille <akim@epita.fr>
12751
12752 * data/bison.simple.new: Comment changes.
12753 Reported by Andreas Schwab.
12754
127552002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
12756
12757 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
12758 there are no `label `yyoverflowlab' defined but not used' warnings
12759 when yyoverflow is defined.
12760
127612002-06-18 Akim Demaille <akim@epita.fr>
12762
12763 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
12764 new member.
12765 (symbol_destructor_set): Adjust.
12766 * src/output.c (symbol_destructors_output): Output the destructor
12767 locations.
12768 Output the symbol name.
12769 * data/bison.simple (b4_symbol_destructor): Adjust.
12770
127712002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
12772 and Akim Demaille <akim@epita.fr>
12773
12774 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
12775 what's left on the stack when the error recovery hits EOF.
12776 * tests/actions.at (Destructors): Complete to exercise this case.
12777
127782002-06-17 Akim Demaille <akim@epita.fr>
12779
12780 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
12781 arguments is really empty, not only equal to `[]'.
12782 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
12783 member.
12784 (symbol_destructor_set): New.
12785 * src/output.c (symbol_destructors_output): New.
12786 * src/reader.h (brace_code_t, current_braced_code): New.
12787 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
12788 (handle_dollar): Rename as...
12789 (handle_action_dollar): this.
12790 (handle_destructor_dollar): New.
12791 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
12792 (grammar_declaration): Use it.
12793 * data/bison.simple (yystos): Is always defined.
12794 (yydestructor): New.
12795 * tests/actions.at (Destructors): New.
12796 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
12797
127982002-06-17 Akim Demaille <akim@epita.fr>
12799
12800 * src/symlist.h, src/symlist.c (symbol_list_length): New.
12801 * src/scan-gram.l (handle_dollar, handle_at): Compute the
12802 rule_length only when needed.
12803 * src/output.c (actions_output, token_definitions_output): Output
12804 the full M4 block.
12805 * src/symtab.c: Don't access directly to the symbol tag, use
12806 symbol_tag_get.
12807 * src/parse-gram.y: Use symbol_list_free.
12808
128092002-06-17 Akim Demaille <akim@epita.fr>
12810
12811 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
12812 (symbol_list_prepend, get_type_name): Move to...
12813 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
12814 (symbol_list_prepend, symbol_list_n_type_name_get): here.
12815 Adjust all callers.
12816 (symbol_list_free): New.
12817 * src/scan-gram.l (handle_dollar): Takes a location.
12818 * tests/input.at (Invalid $n): Adjust.
12819
128202002-06-17 Akim Demaille <akim@epita.fr>
12821
12822 * src/reader.h, src/reader.c (symbol_list_new): Export it.
12823 (symbol_list_prepend): New.
12824 * src/parse-gram.y (%union): `list' is a new member.
12825 (symbols.1): New, replaces...
12826 (terms_to_prec.1, nterms_to_type.1): these.
12827 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
12828 Take a location as additional argument.
12829 Adjust all callers.
12830
128312002-06-15 Akim Demaille <akim@epita.fr>
12832
12833 * src/parse-gram.y: Move %token in the declaration section so that
12834 we don't depend upon CVS Bison.
12835
128362002-06-15 Akim Demaille <akim@epita.fr>
12837
12838 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
12839 * src/print.c (print_core): Use it.
12840
128412002-06-15 Akim Demaille <akim@epita.fr>
12842
12843 * src/conflicts.c (log_resolution): Accept the rule involved in
12844 the sr conflicts instead of the lookahead number that points to
12845 that rule.
12846 (flush_reduce): Accept the current lookahead vector as argument,
12847 instead of the index in LA.
12848 (resolve_sr_conflict): Accept the current number of lookahead
12849 bitset to consider for the STATE, instead of the index in LA.
12850 (set_conflicts): Adjust.
12851 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
12852
128532002-06-15 Akim Demaille <akim@epita.fr>
12854
12855 * src/state.h (state_t): Replace the `lookaheadsp' member, a
12856 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
12857 Adjust all dependencies.
12858 * src/lalr.c (initialize_lookaheads): Split into...
12859 (states_lookaheads_count, states_lookaheads_initialize): these.
12860 (lalr): Adjust.
12861
128622002-06-15 Akim Demaille <akim@epita.fr>
12863
12864 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
12865 out of...
12866 (grammar_rules_print): here.
12867 * src/reduce.c (reduce_output): Use it.
12868 * tests/reduce.at (Useless Rules, Reduced Automaton)
12869 (Underivable Rules): Adjust.
12870
128712002-06-15 Akim Demaille <akim@epita.fr>
12872
12873 Copy BYacc's nice way to report the grammar.
12874
12875 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
12876 New.
12877 Don't print the rules' location, it is confusing and useless.
12878 (rule_print): Use grammar_rhs_print.
12879 * src/print.c (print_grammar): Use grammar_rules_print.
12880
128812002-06-15 Akim Demaille <akim@epita.fr>
12882
12883 Complete and rationalize `useless thing' warnings.
12884
12885 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
12886 (symbol_tag_print): New.
12887 Use them everywhere in place of accessing directly the tag member.
12888 * src/gram.h, src/gram.c (rule_print): New.
12889 Use it where a rule used to be printed `by hand'.
12890 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
12891 (reduce_grammar_tables): Report the useless rules.
12892 (reduce_print): Useless things are a warning, not an error.
12893 Report it as such.
12894 * tests/reduce.at (Useless Nonterminals, Useless Rules):
12895 (Reduced Automaton, Underivable Rules): Adjust.
12896 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
12897 * tests/conflicts.at (Unresolved SR Conflicts)
12898 (Solved SR Conflicts): Adjust.
12899
129002002-06-15 Akim Demaille <akim@epita.fr>
12901
12902 Let symbols have a location.
12903
12904 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
12905 (getsym): Adjust.
12906 Adjust all callers.
12907 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
12908 Use location_t, not int.
12909 * src/symtab.c (symbol_check_defined): Take advantage of the
12910 location.
12911 * tests/regression.at (Invalid inputs): Adjust.
12912
129132002-06-15 Akim Demaille <akim@epita.fr>
12914
12915 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
12916 (input): Don't try to initialize yylloc here, do it in the
12917 scanner.
12918 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
12919 * src/gram.h (rule_t): Change line and action_line into location
12920 and action_location, of location_t type.
12921 Adjust all dependencies.
12922 * src/location.h, src/location.c (empty_location): New.
12923 * src/reader.h, src/reader.c (grammar_start_symbol_set)
12924 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
12925 (grammar_current_rule_symbol_append)
12926 (grammar_current_rule_action_append): Expect a location as argument.
12927 * src/reader.c (grammar_midrule_action): Adjust to attach an
12928 action's location as dummy symbol location.
12929 * src/symtab.h, src/symtab.c (startsymbol_location): New.
12930 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
12931 the line numbers.
12932
129332002-06-14 Akim Demaille <akim@epita.fr>
12934
12935 Grammar declarations may be found in the grammar section.
12936
12937 * src/parse-gram.y (rules_or_grammar_declaration): New.
12938 (declarations): Each declaration may end with a semicolon, not
12939 just...
12940 (grammar_declaration): `"%union"'.
12941 (grammar): Branch to rules_or_grammar_declaration.
12942
129432002-06-14 Akim Demaille <akim@epita.fr>
12944
12945 * src/main.c (main): Invoke scanner_free.
12946
129472002-06-14 Akim Demaille <akim@epita.fr>
12948
12949 * src/output.c (m4_invoke): Extracted from...
12950 (output_skeleton): here.
12951 Free tempfile.
12952
129532002-06-14 Akim Demaille <akim@epita.fr>
12954
12955 * src/parse-gram.y (directives, directive, gram)
12956 (grammar_directives, precedence_directives, precedence_directive):
12957 Rename as...
12958 (declarations, declaration, grammar, grammar_declaration)
12959 (precedence_declaration, precedence_declarator): these.
12960 (symbol_declaration): New.
12961
129622002-06-14 Akim Demaille <akim@epita.fr>
12963
12964 * src/files.c (action_obstack): Remove, unused.
12965 (output_obstack): Remove it, and all its dependencies, as it is no
12966 longer needed.
12967 * src/reader.c (epilogue_set): Build the epilogue in the
12968 muscle_obstack.
12969 * src/output.h, src/output.c (muscle_obstack): Move to...
12970 * src/muscle_tab.h, src/muscle_tab.h: here.
12971 (muscle_init): Initialize muscle_obstack.
12972 (muscle_free): New.
12973 * src/main.c (main): Call it.
12974
129752002-06-14 Akim Demaille <akim@epita.fr>
12976
12977 * src/location.h: New, extracted from...
12978 * src/reader.h: here.
12979 * src/Makefile.am (noinst_HEADERS): Merge into
12980 (bison_SOURCES): this.
12981 Add location.h.
12982 * src/parse-gram.y: Use location_t instead of Bison's.
12983 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
12984 Use location_t instead of ints.
12985
129862002-06-14 Akim Demaille <akim@epita.fr>
12987
12988 * data/bison.simple, data/bison.c++: Be sure to restore the
12989 current #line when returning to the skeleton contents after having
12990 exposed the input file's #line.
12991
129922002-06-12 Akim Demaille <akim@epita.fr>
12993
12994 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
12995 eager.
12996 * tests/actions.at (Exotic Dollars): New.
12997
129982002-06-12 Akim Demaille <akim@epita.fr>
12999
13000 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
13001 ['"/] too eagerly.
13002 * tests/input.at (Torturing the Scanner): New.
13003
130042002-06-11 Akim Demaille <akim@epita.fr>
13005
13006 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
13007 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
13008 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
13009 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
13010 * src/reader.c (reader): Use it.
13011
130122002-06-11 Akim Demaille <akim@epita.fr>
13013
13014 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
13015 Adjust all callers.
13016 (scanner_last_string_free): New.
13017
130182002-06-11 Akim Demaille <akim@epita.fr>
13019
13020 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
13021 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
13022 (last_string, YY_OBS_FREE): New.
13023 Use them when returning an ID.
13024
130252002-06-11 Akim Demaille <akim@epita.fr>
13026
13027 Have Bison grammars parsed by a Bison grammar.
13028
13029 * src/reader.c, src/reader.h (prologue_augment): New.
13030 * src/reader.c (copy_definition): Remove.
13031
13032 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
13033 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
13034 (grammar_current_rule_prec_set, grammar_current_rule_check)
13035 (grammar_current_rule_symbol_append)
13036 (grammar_current_rule_action_append): Export.
13037 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
13038 (symbol_list_action_append): Remove.
13039 Hook the routines from reader.
13040 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
13041 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
13042
13043 * src/reader.c (read_declarations): Remove, unused.
13044
13045 * src/parse-gram.y: Handle the epilogue.
13046 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
13047 (grammar_start_symbol_set): this.
13048 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
13049 * src/reader.c (readgram): Remove, unused.
13050 (reader): Adjust to insert eoftoken and axiom where appropriate.
13051
13052 * src/reader.c (copy_dollar): Replace with...
13053 * src/scan-gram.h (handle_dollar): this.
13054 * src/parse-gram.y: Remove `%thong'.
13055
13056 * src/reader.c (copy_at): Replace with...
13057 * src/scan-gram.h (handle_at): this.
13058
13059 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
13060 New.
13061
13062 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
13063 time being.
13064
13065 * src/reader.h, src/reader.c (grammar_rule_end): New.
13066
13067 * src/parse.y (current_type, current_class): New.
13068 Implement `%nterm', `%token' support.
13069 Merge `%term' into `%token'.
13070 (string_as_id): New.
13071 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
13072 type name.
13073
13074 * src/parse-gram.y: Be sure to handle properly the beginning of
13075 rules.
13076
13077 * src/parse-gram.y: Handle %type.
13078 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
13079
13080 * src/parse-gram.y: More directives support.
13081 * src/options.c: No longer handle source directives.
13082
13083 * src/parse-gram.y: Fix %output.
13084
13085 * src/parse-gram.y: Handle %union.
13086 Use the prologue locations.
13087 * src/reader.c (parse_union_decl): Remove.
13088
13089 * src/reader.h, src/reader.c (epilogue_set): New.
13090 * src/parse-gram.y: Use it.
13091
13092 * data/bison.simple, data/bison.c++: b4_stype is now either not
13093 defined, then default to int, or to the contents of %union,
13094 without `union' itself.
13095 Adjust.
13096 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
13097
13098 * src/output.c (actions_output): Don't output braces, as they are
13099 already handled by the scanner.
13100
13101 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
13102 characters to themselves.
13103
13104 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
13105 that the epilogue has a proper #line.
13106
13107 * src/parse-gram.y: Handle precedence/associativity.
13108
13109 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
13110 a terminal.
13111 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
13112 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
13113 at all to define terminals that cannot be emitted.
13114
13115 * src/scan-gram.l: Escape M4 characters.
13116
13117 * src/scan-gram.l: Working properly with escapes in user
13118 strings/characters.
13119
13120 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
13121 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
13122 grammar.
13123 Use more modest sizes, as for the time being the parser does not
13124 release memory, and therefore the process swallows a huge amount
13125 of memory.
13126
13127 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
13128 stricter %token grammar.
13129
13130 * src/symtab.h (associativity): Add `undef_assoc'.
13131 (symbol_precedence_set): Do nothing when passed an undef_assoc.
13132 * src/symtab.c (symbol_check_alias_consistence): Adjust.
13133
13134 * tests/regression.at (Invalid %directive): Remove, as it is now
13135 meaningless.
13136 (Invalid inputs): Adjust to the new error messages.
13137 (Token definitions): The new grammar doesn't allow too many
13138 eccentricities.
13139
13140 * src/lex.h, src/lex.c: Remove.
13141 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
13142 (copy_character, copy_string2, copy_string, copy_identifier)
13143 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
13144 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
13145 (parse_action): Remove.
13146 * po/POTFILES.in: Adjust.
13147
131482002-06-11 Akim Demaille <akim@epita.fr>
13149
13150 * src/reader.c (parse_action): Don't store directly into the
13151 rule's action member: return the action as a string.
13152 Don't require `rule_length' as an argument: compute it.
13153 (grammar_current_rule_symbol_append)
13154 (grammar_current_rule_action_append): New, eved out from
13155 (readgram): here.
13156 Remove `action_flag', `rulelength', unused now.
13157
131582002-06-11 Akim Demaille <akim@epita.fr>
13159
13160 * src/reader.c (grammar_current_rule_prec_set).
13161 (grammar_current_rule_check): New, eved out from...
13162 (readgram): here.
13163 Remove `xaction', `first_rhs': useless.
13164 * tests/input.at (Type clashes): New.
13165 * tests/existing.at (GNU Cim Grammar): Adjust.
13166
131672002-06-11 Akim Demaille <akim@epita.fr>
13168
13169 * src/reader.c (grammar_midrule_action): New, Eved out from
13170 (readgram): here.
13171
131722002-06-11 Akim Demaille <akim@epita.fr>
13173
13174 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
13175 New.
13176 (readgram): Use them as replacement of inlined code, crule and
13177 crule1.
13178
131792002-06-11 Akim Demaille <akim@epita.fr>
13180
13181 * src/reader.c (grammar_end, grammar_symbol_append): New.
13182 (readgram): Use them.
13183 Make the use of `p' as local as possible.
13184
131852002-06-10 Akim Demaille <akim@epita.fr>
13186
13187 GCJ's parser requires the tokens to be defined before the prologue.
13188
13189 * data/bison.simple: Output the token definition before the user's
13190 prologue.
13191 * tests/regression.at (Braces parsing, Duplicate string)
13192 (Mixing %token styles): Check the output from bison.
13193 (Early token definitions): New.
13194
131952002-06-10 Akim Demaille <akim@epita.fr>
13196
13197 * src/symtab.c (symbol_user_token_number_set): Don't complain when
13198 assigning twice the same user number to a token, so that we can
13199 use it in...
13200 * src/lex.c (lex): here.
13201 Also use `symbol_class_set' instead of hand written code.
13202 * src/reader.c (parse_assoc_decl): Likewise.
13203
132042002-06-10 Akim Demaille <akim@epita.fr>
13205
13206 * src/symtab.c, src/symtab.c (symbol_class_set)
13207 (symbol_user_token_number_set): New.
13208 * src/reader.c (parse_token_decl): Use them.
13209 Use a switch instead of ifs.
13210 Use a single argument.
13211
132122002-06-10 Akim Demaille <akim@epita.fr>
13213
13214 Remove `%thong' support as it is undocumented, unused, duplicates
13215 `%token's job, and creates useless e-mail traffic with people who
13216 want to know what it is, why it is undocumented, unused, and
13217 duplicates `%token's job.
13218
13219 * src/reader.c (parse_thong_decl): Remove.
13220 * src/options.c (option_table): Remove "thong".
13221 * src/lex.h (tok_thong): Remove.
13222
132232002-06-10 Akim Demaille <akim@epita.fr>
13224
13225 * src/symtab.c, src/symtab.c (symbol_type_set)
13226 (symbol_precedence_set): New.
13227 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
13228 (value_components_used): Remove, unused.
13229
132302002-06-09 Akim Demaille <akim@epita.fr>
13231
13232 Move symbols handling code out of the reader.
13233
13234 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
13235 (axiom): Move to...
13236 * src/symtab.h, src/symtab.c: here.
13237
13238 * src/gram.c (start_symbol): Remove: use startsymbol->number.
13239 * src/reader.c (startval): Rename as...
13240 * src/symtab.h, src/symtab.c (startsymbol): this.
13241 * src/reader.c: Adjust.
13242
13243 * src/reader.c (symbol_check_defined, symbol_make_alias)
13244 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13245 (token_translations_init)
13246 Move to...
13247 * src/symtab.c: here.
13248 * src/reader.c (packsymbols): Move to...
13249 * src/symtab.h, src/symtab.c (symbols_pack): here.
13250 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
13251 argument.
13252
132532002-06-03 Akim Demaille <akim@epita.fr>
13254
13255 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
13256 then statements.
13257
132582002-06-03 Akim Demaille <akim@epita.fr>
13259
13260 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
13261 structs with non literals.
13262 * src/scan-skel.l: never-interactive.
13263 * src/conflicts.c (enum conflict_resolution_e): No trailing
13264 comma.
13265 * src/getargs.c (usage): Split long literal strings.
13266 Reported by Hans Aberg.
13267
132682002-05-28 Akim Demaille <akim@epita.fr>
13269
13270 * data/bison.c++: Use C++ ostreams.
13271 (cdebug_): New member.
13272
132732002-05-28 Akim Demaille <akim@epita.fr>
13274
13275 * src/output.c (output_skeleton): Be sure to allocate enough room
13276 for `/' _and_ for `\0' in full_skeleton.
13277
132782002-05-28 Akim Demaille <akim@epita.fr>
13279
13280 * data/bison.c++: Catch up with bison.simple:
13281 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13282 and Paul Eggert <eggert@twinsun.com>: `error' handing.
13283 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
13284 and popping traces.
13285
132862002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13287
13288 * src/output.c (output_skeleton): Put an explicit path in front of
13289 the skeleton file name, rather than relying on the -I directory,
13290 to partially alleviate effects of having a skeleton file lying around
13291 in the current directory.
13292
132932002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13294
13295 * src/conflicts.c (log_resolution): Correct typo:
13296 obstack_printf should be obstack_fgrow1.
13297
132982002-05-26 Akim Demaille <akim@epita.fr>
13299
13300 * src/state.h (state_t): `solved_conflicts' is a new member.
13301 * src/LR0.c (new_state): Set it to 0.
13302 * src/conflicts.h, src/conflicts.c (print_conflicts)
13303 (free_conflicts, solve_conflicts): Rename as...
13304 (conflicts_print, conflicts_free, conflicts_solve): these.
13305 Adjust callers.
13306 * src/conflicts.c (enum conflict_resolution_e)
13307 (solved_conflicts_obstack): New, used by...
13308 (log_resolution): this.
13309 Adjust to attach the conflict resolution to each state.
13310 Complete the description with the precedence/associativity
13311 information.
13312 (resolve_sr_conflict): Adjust.
13313 * src/print.c (print_state): Output its solved_conflicts.
13314 * tests/conflicts.at (Unresolved SR Conflicts)
13315 (Solved SR Conflicts): Exercise --report=all.
13316
133172002-05-26 Akim Demaille <akim@epita.fr>
13318
13319 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13320 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13321 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
13322 (token_number_t, item_number_as_token_number)
13323 (token_number_as_item_number, muscle_insert_token_number_table):
13324 Rename as...
13325 (symbol_number_t, item_number_as_symbol_number)
13326 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
13327 these, since it is more appropriate.
13328
133292002-05-26 Akim Demaille <akim@epita.fr>
13330
13331 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
13332 `Error:' lines.
13333 * data/bison.simple (yystos) [YYDEBUG]: New.
13334 (yyparse) [YYDEBUG]: Display the symbols which are popped during
13335 error recovery.
13336 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
13337
133382002-05-25 Akim Demaille <akim@epita.fr>
13339
13340 * doc/bison.texinfo (Debugging): Split into...
13341 (Tracing): this new section, its former contents, and...
13342 (Understanding): this new section.
13343 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
13344 by...
13345 (report_flag): this.
13346 Adjust all dependencies.
13347 (report_args, report_types, report_argmatch): New.
13348 (usage, getargs): Report/support -r, --report.
13349 * src/options.h
13350 (struct option_table_struct): Rename as..,
13351 (struct option_table_s): this.
13352 Rename the `set_flag' member to `flag' to match with getopt_long's
13353 struct.
13354 * src/options.c (option_table): Split verbose into an entry for
13355 %verbose, and another for --verbose.
13356 Support --report/-r, so remove -r from the obsolete --raw.
13357 * src/print.c: Attach full item sets and lookaheads reports to
13358 report_flag instead of trace_flag.
13359 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
13360
133612002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13362 and Paul Eggert <eggert@twinsun.com>
13363
13364 * data/bison.simple (yyparse): Correct error handling to conform to
13365 POSIX and yacc. Specifically, after syntax error is discovered,
13366 do not reduce further before shifting the error token.
13367 Clean up the code a bit by removing the labels yyerrdefault,
13368 yyerrhandle, yyerrpop.
13369 * NEWS: Document the above.
13370
133712002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13372
13373 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
13374 type; it isn't always big enough, since it doesn't necessarily
13375 include non-terminals.
13376 (yytranslate): Expand definition of yy_token_number_type, so that
13377 the latter can be removed.
13378 (yy_token_number_type): Remove, only one use.
13379 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
13380 don't use TokenNumberType as element type.
13381
13382 * tests/regression.at: Modify expected output to agree with change
13383 to yyr1 and yytranslate.
13384
133852002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
13386
13387 * src/reader.c (parse_action): Use copy_character instead of
13388 obstack_1grow.
13389
133902002-05-13 Akim Demaille <akim@epita.fr>
13391
13392 * tests/regression.at (Token definitions): Prototype yylex and
13393 yyerror.
13394
133952002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13396
13397 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
13398 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
13399 32-bit arithmetic.
13400 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
13401
134022002-05-07 Akim Demaille <akim@epita.fr>
13403
13404 * tests/synclines.at: Be sure to prototype yylex and yyerror to
13405 avoid GCC warnings.
13406
134072002-05-07 Akim Demaille <akim@epita.fr>
13408
13409 Kill GCC warnings.
13410
13411 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
13412 over the RHS of each rule.
13413 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
13414 * src/state.h (state_t): Member `nitems' is unsigned short.
13415 * src/LR0.c (get_state): Adjust.
13416 * src/reader.c (packgram): Likewise.
13417 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
13418 `Type'.
13419 (muscle_insert_int_table): Remove, unused.
13420 (prepare_rules): Remove `max'.
13421
134222002-05-06 Akim Demaille <akim@epita.fr>
13423
13424 * src/closure.c (print_firsts): Display of the symbol tags.
13425 (bitmatrix_print): Move to...
13426 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
13427 here.
13428 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
13429
134302002-05-06 Akim Demaille <akim@epita.fr>
13431
13432 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
13433 hash_do_for_each.
13434
134352002-05-06 Akim Demaille <akim@epita.fr>
13436
13437 * src/LR0.c (new_state, get_state): Instead of using the global
13438 `kernel_size' and `kernel_base', have two new arguments:
13439 `core_size' and `core'.
13440 Adjust callers.
13441
134422002-05-06 Akim Demaille <akim@epita.fr>
13443
13444 * src/reader.c (packgram): No longer end `ritem' with a 0
13445 sentinel: it is not used.
13446
134472002-05-05 Akim Demaille <akim@epita.fr>
13448
13449 New experimental feature: display the lookaheads in the report and
13450 graph.
13451
13452 * src/print (print_core): When --trace-flag, display the rules
13453 lookaheads.
13454 * src/print_graph.c (print_core): Likewise.
13455 Swap the arguments.
13456 Adjust caller.
13457
134582002-05-05 Akim Demaille <akim@epita.fr>
13459
13460 * tests/torture.at (Many lookaheads): New test.
13461
134622002-05-05 Akim Demaille <akim@epita.fr>
13463
13464 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
13465 (GENERATE_MUSCLE_INSERT_TABLE): this.
13466 (output_int_table, output_unsigned_int_table, output_short_table)
13467 (output_token_number_table, output_item_number_table): Replace with...
13468 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
13469 (muscle_insert_short_table, muscle_insert_token_number_table)
13470 (muscle_insert_item_number_table): these.
13471 Adjust all callers.
13472 (prepare_tokens): Don't free `translations', since...
13473 * src/reader.h, src/reader.c (grammar_free): do it.
13474 Move to...
13475 * src/gram.h, src/gram.c (grammar_free): here.
13476 * data/bison.simple, data/bison.c++: b4_token_number_max is now
13477 b4_translate_max.
13478
134792002-05-05 Akim Demaille <akim@epita.fr>
13480
13481 * src/output.c (output_unsigned_int_table): New.
13482 (prepare_rules): `i' is unsigned.
13483 `prhs', `rline', `r2' are unsigned int.
13484 Rename muscle `rhs_number_max' as `rhs_max'.
13485 Output muscles `prhs_max', `rline_max', and `r2_max'.
13486 Free rline and r1.
13487 * data/bison.simple, data/bison.c++: Adjust to use these muscles
13488 to compute types instead of constant types.
13489 * tests/regression.at (Web2c Actions): Adjust.
13490
134912002-05-04 Akim Demaille <akim@epita.fr>
13492
13493 * src/symtab.h (SALIAS, SUNDEF): Rename as...
13494 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
13495 Adjust dependencies.
13496 * src/output.c (token_definitions_output): Be sure not to output a
13497 `#define 'a'' when fed with `%token 'a' "a"'.
13498 * tests/regression.at (Token definitions): New.
13499
135002002-05-03 Paul Eggert <eggert@twinsun.com>
13501
13502 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
13503 for K&R C.
13504
135052002-05-03 gettextize <bug-gnu-gettext@gnu.org>
13506
13507 * Makefile.am (SUBDIRS): Remove intl.
13508 (EXTRA_DIST): Add config/config.rpath.
13509
135102002-05-03 Akim Demaille <akim@epita.fr>
13511
13512 * data/bison.simple (m4_if): Don't output empty enums.
13513 And actually, output valid enum definitions :(.
13514
135152002-05-03 Akim Demaille <akim@epita.fr>
13516
13517 * configure.bat: Remove, completely obsolete.
13518 * Makefile.am (EXTRA_DIST): Adjust.
13519 Don't distribute config.rpath...
13520 * config/Makefile.am (EXTRA_DIST): Do it.
13521
135222002-05-03 Akim Demaille <akim@epita.fr>
13523
13524 * configure.in (GETTEXT_VERSION): New.
13525 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
13526
135272002-05-03 Akim Demaille <akim@epita.fr>
13528
13529 * data/bison.simple (b4_token_enum): New.
13530 (b4_token_defines): Use it to output tokens both as #define and
13531 enums.
13532 Suggested by Paul Eggert.
13533 * src/output.c (token_definitions_output): Don't output spurious
13534 white spaces.
13535
135362002-05-03 Akim Demaille <akim@epita.fr>
13537
13538 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
13539
135402002-05-02 Robert Anisko <robert@lrde.epita.fr>
13541
13542 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
13543 Update the stack class, give a try to deque as the default container.
13544
135452002-05-02 Akim Demaille <akim@epita.fr>
13546
13547 * data/bison.simple (yyparse): Do not implement @$ = @1.
13548 (YYLLOC_DEFAULT): Adjust to do it.
13549 * doc/bison.texinfo (Location Default Action): Fix.
13550
135512002-05-02 Akim Demaille <akim@epita.fr>
13552
13553 * src/reader.c (parse_braces): Merge into...
13554 (parse_action): this.
13555
135562002-05-02 Akim Demaille <akim@epita.fr>
13557
13558 * configure.in (ALL_LINGUAS): Remove.
13559 * po/LINGUAS, hr.po: New.
13560
135612002-05-02 Akim Demaille <akim@epita.fr>
13562
13563 Remove the so called hairy (semantic) parsers.
13564
13565 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
13566 * src/gram.h, src/gram.c (semantic_parser): Remove.
13567 (rule_t): Remove the guard and guard_line members.
13568 * src/lex.h (token_t): remove tok_guard.
13569 * src/options.c (option_table): Remove %guard and %semantic_parser
13570 support.
13571 * src/output.c, src/output.h (guards_output): Remove.
13572 (prepare): Adjust.
13573 (token_definitions_output): Don't output the `T'
13574 tokens (???).
13575 (output_skeleton): Don't output the guards.
13576 * src/files.c, src/files.c (attrsfile): Remove.
13577 * src/reader.c (symbol_list): Remove the guard and guard_line
13578 members.
13579 Adjust dependencies.
13580 (parse_guard): Remove.
13581 * data/bison.hairy: Remove.
13582 * doc/bison.texinfo (Environment Variables): Remove occurrences of
13583 BISON_HAIRY.
13584
135852002-05-02 Akim Demaille <akim@epita.fr>
13586
13587 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
13588 (parse_guard): Rename the formal argument `stack_offset' as
13589 `rule_length', which is more readable.
13590 Adjust callers.
13591 (copy_at, copy_dollar): Instead of outputting the hard coded
13592 values of $$, $n and so forth, output invocation to b4_lhs_value,
13593 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
13594 Note: this patch partially drops `semantic-parser' support: it
13595 always does `rule_length - n', where semantic parsers ought to
13596 always use `-n'.
13597 * data/bison.simple, data/bison.c++ (b4_lhs_value)
13598 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
13599
136002002-05-02 Akim Demaille <akim@epita.fr>
13601
13602 * configure.in (AC_INIT): Bump to 1.49b.
13603 (AM_INIT_AUTOMAKE): Short invocation.
13604
136052002-05-02 Akim Demaille <akim@epita.fr>
13606
13607 Version 1.49a.
13608
136092002-05-01 Akim Demaille <akim@epita.fr>
13610
13611 * src/skeleton.h: Remove.
13612
136132002-05-01 Akim Demaille <akim@epita.fr>
13614
13615 * src/skeleton.h: Fix the #endif.
13616 Reported by Magnus Fromreide.
13617
136182002-04-26 Paul Eggert <eggert@twinsun.com>
13619
13620 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
13621 Define if we define YYSTYPE and YYLTYPE, respectively.
13622 (YYCOPY): Fix [] quoting problem in the non-GCC case.
13623
136242002-04-25 Robert Anisko <robert@lrde.epita.fr>
13625
13626 * src/scan-skel.l: Postprocess quadrigraphs.
13627
13628 * src/reader.c (copy_character): New function, used to output
13629 single characters while replacing `[' and `]' with quadrigraphs, to
13630 avoid troubles with M4 quotes.
13631 (copy_comment): Output characters with copy_character.
13632 (read_additionnal_code): Likewise.
13633 (copy_string2): Likewise.
13634 (copy_definition): Likewise.
13635
13636 * tests/calc.at: Exercise M4 quoting.
13637
136382002-04-25 Akim Demaille <akim@epita.fr>
13639
13640 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
13641 between `!' and the command.
13642 Reported by Paul Eggert.
13643
136442002-04-24 Robert Anisko <robert@lrde.epita.fr>
13645
13646 * tests/calc.at: Exercise prologue splitting.
13647
13648 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
13649 `b4_post_prologue' instead of `b4_prologue'.
13650
13651 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
13652 muscles.
13653 (output): Free pre_prologue_obstack and post_prologue_obstack.
13654 * src/files.h, src/files.c (attrs_obstack): Remove.
13655 (pre_prologue_obstack, post_prologue_obstack): New.
13656 * src/reader.c (copy_definition): Add a parameter to specify the
13657 obstack to fill, instead of using attrs_obstack unconditionally.
13658 (read_declarations): Pass pre_prologue_obstack to copy_definition if
13659 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
13660
136612002-04-23 Paul Eggert <eggert@twinsun.com>
13662
13663 * data/bison.simple: Remove unnecessary commentary and white
13664 space differences from 1_29-branch.
13665 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
13666
13667 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
13668 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
13669 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
13670 constructors or destructors.
13671
13672 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
13673
136742002-04-23 Akim Demaille <akim@epita.fr>
13675
13676 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
13677 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
13678 location with columns.
13679 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
13680 All reported by Paul Eggert.
13681
136822002-04-22 Akim Demaille <akim@epita.fr>
13683
13684 * src/reduce.c (dump_grammar): Move to...
13685 * src/gram.h, src/gram.c (grammar_dump): here.
13686 Be sure to separate long item numbers.
13687 Don't read the members of a rule's prec if its nil.
13688
136892002-04-22 Akim Demaille <akim@epita.fr>
13690
13691 * src/output.c (table_size, table_grow): New.
13692 (MAXTABLE): Remove, replace uses with table_size.
13693 (pack_vector): Instead of dying when the table is too big, grow it.
13694
136952002-04-22 Akim Demaille <akim@epita.fr>
13696
13697 * data/bison.simple (yyr1): Its type is that of a token number.
13698 * data/bison.c++ (r1_): Likewise.
13699 * tests/regression.at (Web2c Actions): Adjust.
13700
137012002-04-22 Akim Demaille <akim@epita.fr>
13702
13703 * src/reader.c (token_translations_init): 256 is now the default
13704 value for the error token, i.e., it will be assigned another
13705 number if the user assigned 256 to one of her tokens.
13706 (reader): Don't force 256 to error.
13707 * doc/bison.texinfo (Symbols): Adjust.
13708 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
13709 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
13710 etc. instead of 10, 20, 30 (which was used to `jump' over error
13711 (256) and undefined (2)).
13712
137132002-04-22 Akim Demaille <akim@epita.fr>
13714
13715 Propagate more token_number_t.
13716
13717 * src/gram.h (token_number_as_item_number)
13718 (item_number_as_token_number): New.
13719 * src/output.c (GENERATE_OUTPUT_TABLE): New.
13720 Use it to create output_item_number_table and
13721 output_token_number_table.
13722 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13723 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
13724 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
13725 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
13726
137272002-04-22 Akim Demaille <akim@epita.fr>
13728
13729 * src/output.h, src/output.c (get_lines_number): Remove.
13730
137312002-04-19 Akim Demaille <akim@epita.fr>
13732
13733 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
13734 as Lex/Flex'.
13735 (Debugging): More details about enabling the debugging features.
13736 (Table of Symbols): Describe $$, $n, @$, and @n.
13737 Suggested by Tim Josling.
13738
137392002-04-19 Akim Demaille <akim@epita.fr>
13740
13741 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
13742
137432002-04-10 Akim Demaille <akim@epita.fr>
13744
13745 * src/system.h: Rely on HAVE_LIMITS_H.
13746 Suggested by Paul Eggert.
13747
137482002-04-09 Akim Demaille <akim@epita.fr>
13749
13750 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
13751 full stderr, and strip it according to the bison options, instead
13752 of composing the error message from different bits.
13753 This makes it easier to check for several error messages.
13754 Adjust all the invocations.
13755 Add an invocation exercising the error token.
13756 Add an invocation demonstrating a stupid error message.
13757 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
13758 Adjust the tests.
13759 Error message are for stderr, not stdout.
13760
137612002-04-09 Akim Demaille <akim@epita.fr>
13762
13763 * src/gram.h, src/gram.c (error_token_number): Remove, use
13764 errtoken->number.
13765 * src/reader.c (reader): Don't specify the user token number (2)
13766 for $undefined, as it uselessly prevents using it.
13767 * src/gram.h (token_number_t): Move to...
13768 * src/symtab.h: here.
13769 (state_t.number): Is a token_number_t.
13770 * src/print.c, src/reader.c: Use undeftoken->number instead of
13771 hard coded 2.
13772 (Even though this 2 is not the same as above: the number of the
13773 undeftoken remains being 2, it is its user token number which
13774 might not be 2).
13775 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
13776 `user_token_number_max'.
13777 Output `undef_token_number'.
13778 * data/bison.simple, data/bison.c++: Use them.
13779 Be sure to map invalid yylex return values to
13780 `undef_token_number'. This saves us from gratuitous SEGV.
13781
13782 * tests/conflicts.at (Solved SR Conflicts)
13783 (Unresolved SR Conflicts): Adjust.
13784 * tests/regression.at (Web2c Actions): Adjust.
13785
137862002-04-08 Akim Demaille <akim@epita.fr>
13787
13788 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
13789 Adding #line.
13790 Remove the duplicate `typedefs'.
13791 (RhsNumberType): Fix the declaration and various other typos.
13792 Use __ofile__.
13793 * data/bison.simple: Use __ofile__.
13794 * src/scan-skel.l: Handle __ofile__.
13795
137962002-04-08 Akim Demaille <akim@epita.fr>
13797
13798 * src/gram.h (item_number_t): New, the type of item numbers in
13799 RITEM. Note that it must be able to code symbol numbers as
13800 positive number, and the negation of rule numbers as negative
13801 numbers.
13802 Adjust all dependencies (pretty many).
13803 * src/reduce.c (rule): Remove this `short *' pointer: use
13804 item_number_t.
13805 * src/system.h (MINSHORT, MAXSHORT): Remove.
13806 Include `limits.h'.
13807 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
13808 (shortcpy): Remove.
13809 (MAXTABLE): Move to...
13810 * src/output.c (MAXTABLE): here.
13811 (prepare_rules): Use output_int_table to output rhs.
13812 * data/bison.simple, data/bison.c++: Adjust.
13813 * tests/torture.at (Big triangle): Move the limit from 254 to
13814 500.
13815 * tests/regression.at (Web2c Actions): Ajust.
13816
13817 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
13818 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
13819 passes, but produces negative #line number, once fixed, GCC is
13820 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
13821 C), it passes.
13822 * src/state.h (state_h): Code input lines on ints, not shorts.
13823
138242002-04-08 Akim Demaille <akim@epita.fr>
13825
13826 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
13827 and then the grammar.
13828
138292002-04-08 Akim Demaille <akim@epita.fr>
13830
13831 * src/system.h: No longer using strndup.
13832
138332002-04-07 Akim Demaille <akim@epita.fr>
13834
13835 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
13836 * src/output.c (output_table_data): Return the longest number.
13837 (prepare_tokens): Output `token_number_max').
13838 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
13839 New.
13840 Use them to define yy_token_number_type/TokenNumberType.
13841 Use this type for yytranslate.
13842 * tests/torture.at (Big triangle): Push the limit from 124 to
13843 253.
13844 * tests/regression.at (Web2c Actions): Adjust.
13845
138462002-04-07 Akim Demaille <akim@epita.fr>
13847
13848 * tests/torture.at (Big triangle): New.
13849 (GNU AWK Grammar, GNU Cim Grammar): Move to...
13850 * tests/existing.at: here.
13851
138522002-04-07 Akim Demaille <akim@epita.fr>
13853
13854 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
13855 nritems.
13856 Adjust dependencies.
13857
138582002-04-07 Akim Demaille <akim@epita.fr>
13859
13860 * src/reader.c: Normalize increments to prefix form.
13861
138622002-04-07 Akim Demaille <akim@epita.fr>
13863
13864 * src/reader.c, symtab.c: Remove debugging code.
13865
138662002-04-07 Akim Demaille <akim@epita.fr>
13867
13868 Rename all the `bucket's as `symbol_t'.
13869
13870 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
13871 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
13872 * src/symtab.c, src/symtab.h (bucket): Rename as...
13873 (symbol_t): this.
13874 (symbol_list_new, bucket_check_defined, bucket_make_alias)
13875 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
13876 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13877 (buckets_new, buckets_free, buckets_do): Rename as...
13878 (symbol_list_new, symbol_check_defined, symbol_make_alias)
13879 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13880 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
13881 (symbols_new, symbols_free, symbols_do): these.
13882
138832002-04-07 Akim Demaille <akim@epita.fr>
13884
13885 Use lib/hash for the symbol table.
13886
13887 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
13888 EOF.
13889 * src/lex.c (lex): Set the `number' member of new terminals.
13890 * src/reader.c (bucket_check_defined, bucket_make_alias)
13891 (bucket_check_alias_consistence, bucket_translation): New.
13892 (reader, grammar_free, readgram, token_translations_init)
13893 (packsymbols): Adjust.
13894 (reader): Number the predefined tokens.
13895 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
13896 for predefined tokens.
13897 * src/symtab.h (bucket): Remove all the hash table related
13898 members.
13899 * src/symtab.c (symtab): Replace by...
13900 (bucket_table): this.
13901 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13902 (buckets_new, buckets_do): New.
13903
139042002-04-07 Akim Demaille <akim@epita.fr>
13905
13906 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
13907 (start_symbol, max_user_token_number, semantic_parser)
13908 (error_token_number): Initialize.
13909 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
13910 Initialize.
13911 (reader): Don't.
13912 (errtoken, eoftoken, undeftoken, axiom): Extern.
13913
139142002-04-07 Akim Demaille <akim@epita.fr>
13915
13916 * src/gram.h (rule_s): prec and precsym are now pointers
13917 to the bucket giving the priority/associativity.
13918 Member `associativity' removed: useless.
13919 * src/reduce.c, src/conflicts.c: Adjust.
13920
139212002-04-07 Akim Demaille <akim@epita.fr>
13922
13923 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
13924 Properly escape the symbols' TAG when outputting them.
13925
139262002-04-07 Akim Demaille <akim@epita.fr>
13927
13928 * src/lalr.h (LA): Is a bitsetv, not bitset*.
13929
139302002-04-07 Akim Demaille <akim@epita.fr>
13931
13932 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
13933 (LArule): this, which is an array to rule_t*.
13934 * src/print.c, src/conflicts.c: Adjust.
13935
139362002-04-07 Akim Demaille <akim@epita.fr>
13937
13938 * src/gram.h (rule_t): Rename `number' as `user_number'.
13939 `number' is a new member.
13940 Adjust dependencies.
13941 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
13942
139432002-04-07 Akim Demaille <akim@epita.fr>
13944
13945 As a result of the previous patch, it is no longer needed
13946 to reorder ritem itself.
13947
13948 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
13949
139502002-04-07 Akim Demaille <akim@epita.fr>
13951
13952 Be sure never to walk through RITEMS, but use only data related to
13953 the rules themselves. RITEMS should be banished.
13954
13955 * src/output.c (output_token_translations): Rename as...
13956 (prepare_tokens): this.
13957 In addition to `translate', prepare the muscles `tname' and
13958 `toknum', which were handled by...
13959 (output_rule_data): this.
13960 Remove, and move the remainder of its outputs into...
13961 (prepare_rules): this new routines, which also merges content from
13962 (output_gram): this.
13963 (prepare_rules): Be sure never to walk through RITEMS.
13964 (output_stos): Rename as...
13965 (prepare_stos): this.
13966 (output): Always invoke prepare_states, after all, just don't use it
13967 in the output if you don't need it.
13968
139692002-04-07 Akim Demaille <akim@epita.fr>
13970
13971 * src/LR0.c (new_state): Display `nstates' as the name of the
13972 newly created state.
13973 Adjust to initialize first_state and last_state if needed.
13974 Be sure to distinguish the initial from the final state.
13975 (new_states): Create the itemset of the initial state, and use
13976 new_state.
13977 * src/closure.c (closure): Now that the initial state has its
13978 items properly set, there is no need for a special case when
13979 creating `ruleset'.
13980
13981 As a result, now the rule 0, reducing to $axiom, is visible in the
13982 outputs. Adjust the test suite.
13983
13984 * tests/conflicts.at (Solved SR Conflicts)
13985 (Unresolved SR Conflicts): Adjust.
13986 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
13987 * tests/conflicts.at (S/R in initial): New.
13988
139892002-04-07 Akim Demaille <akim@epita.fr>
13990
13991 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
13992 the RHS of the rules.
13993 * src/output.c (output_gram): Likewise.
13994
139952002-04-07 Akim Demaille <akim@epita.fr>
13996
13997 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
13998 bucket.
13999 Adjust all dependencies.
14000 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
14001 `number' of the buckets too.
14002 * src/gram.h: Include `symtab.h'.
14003 (associativity): Move to...
14004 * src/symtab.h: here.
14005 No longer include `gram.h'.
14006
140072002-04-07 Akim Demaille <akim@epita.fr>
14008
14009 * src/gram.h, src/gram.c (rules_rhs_length): New.
14010 (ritem_longest_rhs): Use it.
14011 * src/gram.h (rule_t): `number' is a new member.
14012 * src/reader.c (packgram): Set it.
14013 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
14014 the end of `rules', and count them out of `nrules'.
14015 (reduce_output, dump_grammar): Adjust.
14016 * src/print.c (print_grammar): It is no longer needed to check for
14017 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
14018 * tests/reduce.at (Reduced Automaton): New test.
14019
140202002-04-07 Akim Demaille <akim@epita.fr>
14021
14022 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
14023 lacking `+ 1' to nrules, Bison reported as useless a token if it
14024 was used solely to set the precedence of the last rule...
14025
140262002-04-07 Akim Demaille <akim@epita.fr>
14027
14028 * data/bison.c++, data/bison.simple: Don't output the current file
14029 name in #line, to avoid useless diffs between two identical
14030 outputs under different names.
14031
140322002-04-07 Akim Demaille <akim@epita.fr>
14033
14034 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
14035 Normalize loops to using `< nrules + 1', not `<= nrules'.
14036
140372002-04-07 Akim Demaille <akim@epita.fr>
14038
14039 * TODO: Update.
14040
140412002-04-07 Akim Demaille <akim@epita.fr>
14042
14043 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
14044 bucket.value as bucket.number.
14045
140462002-04-07 Akim Demaille <akim@epita.fr>
14047
14048 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
14049 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14050 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
14051 RHS, instead of being an index in RITEMS.
14052
140532002-04-04 Paul Eggert <eggert@twinsun.com>
14054
14055 * doc/bison.texinfo: Update copyright date.
14056 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
14057 (Symbols): Warn about running Bison in one character set,
14058 but compiling and/or running in an incompatible one.
14059 Warn about character code 256, too.
14060
140612002-04-03 Paul Eggert <eggert@twinsun.com>
14062
14063 * src/bison.data (YYSTACK_ALLOC): Depend on whether
14064 YYERROR_VERBOSE is nonzero, not whether it is defined.
14065
14066 Merge changes from bison-1_29-branch.
14067
140682002-03-20 Paul Eggert <eggert@twinsun.com>
14069
14070 Merge fixes from Debian bison_1.34-1.diff.
14071
14072 * configure.in (AC_PREREQ): 2.53.
14073
140742002-03-20 Akim Demaille <akim@epita.fr>
14075
14076 * src/conflicts.c (log_resolution): Argument `resolution' is const.
14077
140782002-03-19 Paul Eggert <eggert@twinsun.com>
14079
14080 * src/bison.simple (YYCOPY): New macro.
14081 (YYSTACK_RELOCATE): Use it.
14082 Remove Type arg; no longer needed. All callers changed.
14083 (yymemcpy): Remove; no longer needed.
14084
14085 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
14086 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14087
140882002-03-19 Akim Demaille <akim@epita.fr>
14089
14090 Test and fix the #line outputs.
14091
14092 * tests/atlocal.at (GCC): New.
14093 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
14094 (Prologue synch line, %union synch line, Postprologue synch line)
14095 (Action synch line, Epilogue synch line): New tests.
14096 * src/reader.c (parse_union_decl): Define the muscle stype_line.
14097 * data/bison.simple, data/bison.c++: Use it.
14098
140992002-03-19 Akim Demaille <akim@epita.fr>
14100
14101 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
14102 (Solved SR Conflicts, %expect not enough, %expect right)
14103 (%expect too much): Move to...
14104 * tests/conflicts.at: this new file.
14105
141062002-03-19 Akim Demaille <akim@epita.fr>
14107
14108 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14109 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
14110 that we can move to enums for instance.
14111 * src/output.c (token_definitions_output): Output a list of
14112 `token-name, token-number' instead of the #define.
14113 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
14114
141152002-03-14 Akim Demaille <akim@epita.fr>
14116
14117 Use Gettext 0.11.1.
14118
141192002-03-09 Robert Anisko <robert@lrde.epita.fr>
14120
14121 * data/bison.c++: Make the user able to add members to the generated
14122 parser by subclassing.
14123
141242002-03-05 Robert Anisko <robert@lrde.epita.fr>
14125
14126 * src/reader.c (read_additionnal_code): `c' should be an integer, not
14127 a character.
14128 Reported by Nicolas Tisserand and Nicolas Burrus.
14129
141302002-03-04 Robert Anisko <robert@lrde.epita.fr>
14131
14132 * src/reader.c: Warn about lacking semi-colons, do not complain.
14133
141342002-03-04 Robert Anisko <robert@lrde.epita.fr>
14135
14136 * data/bison.c++: Remove a debug line.
14137
141382002-03-04 Robert Anisko <robert@lrde.epita.fr>
14139
14140 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
14141 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
14142 provide a default implementation.
14143
141442002-03-04 Akim Demaille <akim@epita.fr>
14145
14146 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
14147 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
14148 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
14149 * tests/semantic.at (Parsing Guards): Similarly.
14150 * src/reader.at (readgram): Complain if the last rule is not ended
14151 with a semi-colon.
14152
141532002-03-04 Akim Demaille <akim@epita.fr>
14154
14155 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
14156 * src/closure.c: here.
14157 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
14158 RTC.
14159 * src/warshall.h, src/warshall.c: Remove.
14160 * tests/sets.at (Broken Closure): Adjust.
14161
141622002-03-04 Akim Demaille <akim@epita.fr>
14163
14164 * src/output.c (output_skeleton): tempdir is const.
14165 bytes_read is unused.
14166
141672002-03-04 Akim Demaille <akim@epita.fr>
14168
14169 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14170 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
14171 Update.
14172 From Michael Hayes.
14173
141742002-03-04 Akim Demaille <akim@epita.fr>
14175
14176 * src/closure.c (closure): `r' is unused.
14177
141782002-03-04 Akim Demaille <akim@epita.fr>
14179
14180 * tests/sets.at (Broken Closure): Add the ending `;'.
14181 * src/reader.at (readgram): Complain if a rule is not ended with a
14182 semi-colon.
14183
141842002-03-04 Akim Demaille <akim@epita.fr>
14185
14186 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
14187 (count_sr_conflicts): Use bitset_count.
14188 * src/reduce.c (inaccessable_symbols): Ditto.
14189 (bits_size): Remove.
14190 * src/warshall.h, src/warshall.c: Convert to bitsetv.
14191
141922002-03-04 Akim Demaille <akim@epita.fr>
14193
14194 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
14195 * src/reduce.c: Remove the `bitset_zero's following the
14196 `bitset_create's, as now it is performed by the latter.
14197
141982002-03-04 Akim Demaille <akim@epita.fr>
14199
14200 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
14201 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
14202 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
14203 latest sources from Michael.
14204
142052002-03-04 Akim Demaille <akim@epita.fr>
14206
14207 * src/output.c (output): Don't free the grammar.
14208 * src/reader.c (grammar_free): New.
14209 * src/main.c (main): Call it and don't free symtab here.
14210
142112002-03-04 Akim Demaille <akim@epita.fr>
14212
14213 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
14214 before returning.
14215 Reported by Benoit Perrot.
14216
142172002-03-04 Akim Demaille <akim@epita.fr>
14218
14219 Use bitset operations when possible, not loops over bits.
14220
14221 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
14222 bitset_or.
14223 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
14224 * src/reduce.c (useless_nonterminals): Formatting changes.
14225 * src/warshall.c (TC): Use bitset_or.
14226
142272002-03-04 Akim Demaille <akim@epita.fr>
14228
14229 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
14230 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
14231 Ditto.
14232
142332002-03-04 Akim Demaille <akim@epita.fr>
14234
14235 * src/lalr.c (F): Now a bitset*.
14236 Adjust all dependencies.
14237
142382002-03-04 Akim Demaille <akim@epita.fr>
14239
14240 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
14241 Adjust all dependencies.
14242
142432002-03-04 Akim Demaille <akim@epita.fr>
14244
14245 * src/L0.c, src/LR0.h (nstates): Be size_t.
14246 Adjust comparisons (signed vs unsigned).
14247 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
14248 bitset*.
14249 Adjust all dependencies.
14250
142512002-03-04 Akim Demaille <akim@epita.fr>
14252
14253 * src/closure.c (firsts): Now, also a bitset.
14254 Adjust all dependencies.
14255 (varsetsize): Remove, now unused.
14256 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
14257
142582002-03-04 Akim Demaille <akim@epita.fr>
14259
14260 * src/print.c: Convert to use bitset.h, not hand coded iterations
14261 over ints.
14262
142632002-03-04 Akim Demaille <akim@epita.fr>
14264
14265 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
14266
142672002-03-04 Akim Demaille <akim@epita.fr>
14268
14269 * src/closure.c (ruleset): Be a bitset.
14270 (rulesetsize): Remove.
14271
142722002-03-04 Akim Demaille <akim@epita.fr>
14273
14274 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14275 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
14276 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
14277 * src/closure.c (fderives): Be an array of bitsets.
14278
142792002-02-28 Robert Anisko <robert@lrde.epita.fr>
14280
14281 * data/bison.c++: Merge the two generated headers. Insert a copyright
14282 notice in each output file.
14283
142842002-02-28 Akim Demaille <akim@epita.fr>
14285
14286 * data/bison.c++: Copy the prologue of bison.simple to fetch
14287 useful M4 definitions, such as b4_header_guard.
14288
142892002-02-25 Akim Demaille <akim@epita.fr>
14290
14291 * src/getargs.c (version): Give the name of the authors, and use a
14292 translator friendly scheme for the bgr
14293 copyright notice.
14294
142952002-02-25 Akim Demaille <akim@epita.fr>
14296
14297 * src/output.c (header_output): Remove, now handled completely via
14298 M4.
14299
143002002-02-25 Akim Demaille <akim@epita.fr>
14301
14302 * m4/m4.m4: New, from CVS Autoconf.
14303 * configure.in: Invoke it.
14304 * src/output.c (output_skeleton): Use its result instead of the
14305 hard coded name.
14306
143072002-02-25 Akim Demaille <akim@epita.fr>
14308
14309 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
14310 Fileutils 4.1.5.
14311 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
14312 * src/output.c (output_skeleton): Use mkstemp to create a real
14313 temporary file.
14314 Move the filling of `skeleton' and its muscle to...
14315 (prepare): here.
14316 (output): Move the definition of the prologue muscle to...
14317 (prepare): here.
14318 * src/system.h (DEFAULT_TMPDIR): New.
14319
143202002-02-14 Paul Eggert <eggert@twinsun.com>
14321
14322 Remove the support for C++ namespace cleanliness; it was
14323 causing more problems than it was curing, since it didn't work
14324 properly on some nonstandard C++ compilers. This can wait
14325 for a proper C++ parser.
14326
14327 * NEWS: Document this.
14328 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
14329 of C++, as it's treated like C now.
14330 * src/bison.simple (YYSTD): Remove.
14331 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
14332 Treat C++ just like Standard C instead of trying to support
14333 namespace cleanliness.
14334
143352002-02-14 Akim Demaille <akim@epita.fr>
14336
14337 * tests/regression.at (else): Adjust to Andreas' change.
14338
143392002-02-14 Akim Demaille <akim@epita.fr>
14340
14341 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
14342
143432002-02-13 Andreas Schwab <schwab@suse.de>
14344
14345 * src/output.c (output_rule_data): Don't output NULL, it might
14346 not be defined yet.
14347
143482002-02-11 Robert Anisko <robert@lrde.epita.fr>
14349
14350 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
14351 (Copyright notice): Update.
14352
143532002-02-11 Akim Demaille <akim@epita.fr>
14354
14355 * tests/regression.at (%nonassoc and eof): Don't include
14356 nonportable headers.
14357
143582002-02-08 Robert Anisko <robert@lrde.epita.fr>
14359
14360 * data/bison.c++: Correct error recovery. Make the user able to
14361 initialize the starting location.
14362
143632002-02-07 Akim Demaille <akim@epita.fr>
14364
14365 * tests/input.at: New.
14366
143672002-02-07 Robert Anisko <robert@lrde.epita.fr>
14368
14369 * data/bison.c++: Replace some direct m4 expansions by constants. Be
14370 more consistent when naming methods and variables. Put preprocessor
14371 directives around tables only needed for debugging.
14372
143732002-02-07 Robert Anisko <robert@lrde.epita.fr>
14374
14375 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
14376 C++ parsers.
14377 (yy::b4_name::parse): Use print_.
14378
143792002-02-07 Robert Anisko <robert@lrde.epita.fr>
14380
14381 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
14382
143832002-02-07 Robert Anisko <robert@lrde.epita.fr>
14384
14385 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
14386 C++ parsers.
14387 (yy::b4_name::parse): Build verbose error messages, and use error_.
14388
143892002-02-06 Robert Anisko <robert@lrde.epita.fr>
14390
14391 * data/bison.c++: Fix m4 quoting in comments.
14392
143932002-02-06 Robert Anisko <robert@lrde.epita.fr>
14394
14395 * data/bison.c++: Adjust the parser code. Fix some muscles that were
14396 not expanded by m4.
14397
143982002-02-05 Akim Demaille <akim@epita.fr>
14399
14400 * data/bison.c++: Adjust to the M4 back end.
14401 More is certainly needed.
14402
144032002-02-05 Akim Demaille <akim@epita.fr>
14404
14405 Give a try to M4 as a back end.
14406
14407 * lib/readpipe.c: New, from wdiff.
14408 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
14409 BISON_HAIRY.
14410 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
14411 specific values. Now it is m4 that performs the lookup.
14412 * src/parse-skel.y: Remove.
14413 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
14414 * src/output.c (actions_output, guards_output)
14415 (token_definitions_output): No longer keeps track of the output
14416 line number, hence remove the second argument.
14417 (guards_output): Check against the guard member of a rule, not the
14418 action member.
14419 Adjust callers.
14420 (output_skeleton): Don't look for the skeleton location, let m4 do
14421 that.
14422 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
14423 file will be used.
14424 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
14425 (prepare): Given that for the time being changesyntax is not
14426 usable in M4, rename the muscles using `-' to `_'.
14427 Define `defines_flag', `output_parser_name' and `output_header_name'.
14428 * src/output.h (actions_output, guards_output)
14429 (token_definitions_output): Adjust prototypes.
14430 * src/scan-skel.l: Instead of scanning the skeletons, it now
14431 processes the output of m4: `__oline__' and `#output'.
14432 * data/bison.simple: Adjust to be used by M4(sugar).
14433 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
14434 to date.
14435 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
14436 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
14437 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
14438 shamelessly stolen from CVS Autoconf.
14439
144402002-02-05 Akim Demaille <akim@epita.fr>
14441
14442 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
14443 * configure.in: Check for the declarations of free and malloc.
14444 * src/muscle_tab.c: Adjust.
14445
144462002-02-05 Akim Demaille <akim@epita.fr>
14447
14448 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
14449 which have no values.
14450
144512002-02-05 Akim Demaille <akim@epita.fr>
14452
14453 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
14454 * data/: here.
14455
144562002-01-29 Paul Eggert <eggert@twinsun.com>
14457
14458 * src/bison.simple (YYSIZE_T): Do not define merely because
14459 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
14460 On some platforms, <alloca.h> does not declare YYSTD (size_t).
14461
144622002-01-27 Akim Demaille <akim@epita.fr>
14463
14464 Fix `%nonassoc and eof'.
14465
14466 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
14467 which were not properly copied! Replace
14468 memcpy (res->errs, src->errs, src->nerrs);
14469 with
14470 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
14471 !!!
14472 * tests/regression.at (%nonassoc and eof): Adjust to newest
14473 Autotest: `.' is not in the PATH.
14474
144752002-01-27 Akim Demaille <akim@epita.fr>
14476
14477 * tests/sets.at (AT_EXTRACT_SETS): New.
14478 (Nullable): Use it.
14479 (Firsts): New.
14480
144812002-01-26 Akim Demaille <akim@epita.fr>
14482
14483 * tests/actions.at, tests/calc.at, tests/headers.at,
14484 * tests/torture.at: Adjust to the newest Autotest which no longer
14485 forces `.' in the PATH.
14486
144872002-01-25 Akim Demaille <akim@epita.fr>
14488
14489 * tests/regression.at (%nonassoc and eof): New.
14490 Suggested by Robert Anisko.
14491
144922002-01-24 Akim Demaille <akim@epita.fr>
14493
14494 Bison dumps core when trying to complain about broken input files.
14495 Reported by Cris van Pelt.
14496
14497 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
14498 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
14499 into...
14500 (Invalid inputs): Strengthen: exercise parse_percent_token.
14501
145022002-01-24 Robert Anisko <robert.anisko@epita.fr>
14503
14504 * src/Makefile.am: Add bison.c++.
14505 * src/bison.c++: New skeleton.
14506
145072002-01-21 Paolo Bonzini <bonzini@gnu.org>
14508
14509 * po/it.po: New.
14510
145112002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
14512
14513 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
14514
145152002-01-20 Marc Autret <marc@gnu.org>
14516
14517 * src/files.c (compute_output_file_names): Fix
14518
145192002-01-20 Marc Autret <marc@gnu.org>
14520
14521 * tests/output.at: New test.
14522 * src/files.c (compute_base_names): Don't map extensions when
14523 the YACC flag is set, use defaults.
14524 Reported by Evgeny Stambulchik.
14525
145262002-01-20 Marc Autret <marc@gnu.org>
14527
14528 * src/system.h: Need to define __attribute__ away for non-GCC
14529 compilers as well (i.e., the vendor C compiler).
14530 Suggested by Albert Chin-A-Young.
14531
145322002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
14533
14534 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
14535 canonical definition.
14536 * src/system.h: Use the canonical definition for PARAMS (avoids
14537 a conflict with the macro from lib/hash.h).
14538
145392002-01-11 Akim Demaille <akim@epita.fr>
14540
14541 * configure.in: Use AC_FUNC_STRNLEN.
14542 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
14543
145442002-01-09 Akim Demaille <akim@epita.fr>
14545
14546 * src/files.c, src/files.h (output_infix): New.
14547 (tab_extension): Remove.
14548 (compute_base_names): Compute the former, drop the latter.
14549 * src/output.c (prepare): Insert the muscles `output-infix', and
14550 `output-suffix'.
14551 * src/parse-skel.y (string, string.1): New.
14552 (section.header): Use it.
14553 (section.yacc): Remove.
14554 (prefix): Remove too.
14555 * src/scan-skel.l: Adjust.
14556 * src/bison.simple, src/bison.hairy: Adjust.
14557
145582002-01-09 Akim Demaille <akim@epita.fr>
14559
14560 * configure.in (WERROR_CFLAGS): Compute it.
14561 * src/Makefile.am (CFLAGS): Pass it.
14562 * tests/atlocal.in (CFLAGS): Idem.
14563 * src/files.c: Fix a few warnings.
14564 (get_extension_index): Remove, unused.
14565
145662002-01-08 Akim Demaille <akim@epita.fr>
14567
14568 * src/getargs.c (AS_FILE_NAME): New.
14569 (getargs): Use it to convert DOSish file names.
14570 * src/files.c (base_name): Rename as full_base_name to avoid
14571 clashes with `base_name ()'.
14572 (filename_split): New.
14573 (compute_base_names): N-th rewrite, using filename_split.
14574
145752002-01-08 Akim Demaille <akim@epita.fr>
14576
14577 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
14578 New, stolen from the Fileutils 4.1.
14579 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14580 * configure.in: Check for the presence of memrchr, and of its
14581 prototype.
14582
145832002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
14584
14585 * lib/hash.h (__P): Added definition for this macro.
14586 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
14587 BUILT_SOURCES, to ensure they are generated first.
14588 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
14589 %error-verbose to allow bootstrapping with bison 1.30x.
14590
145912002-01-06 Akim Demaille <akim@epita.fr>
14592
14593 * src/reader.c (parse_braces): Don't fetch the next char, the
14594 convention is to fetch on entry.
14595 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
14596 'switch' without a following semicolon.
14597 * tests/regression.at (braces parsing): New.
14598
145992002-01-06 Akim Demaille <akim@epita.fr>
14600
14601 Bison is dead wrong in its RR conflict reports.
14602
14603 * tests/torture.at (GNU Cim Grammar): New.
14604 * src/conflicts.c (count_rr_conflicts): Fix.
14605
146062002-01-06 Akim Demaille <akim@epita.fr>
14607
14608 Creating package.m4 from configure.ac causes too many problems.
14609
14610 * tests/Makefile.am (package.m4): Create it by hand,
14611 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
14612
146132002-01-06 Akim Demaille <akim@epita.fr>
14614
14615 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
14616 skeleton.h.
14617
146182002-01-04 Paul Eggert <eggert@twinsun.com>
14619
14620 * doc/bison.texinfo (Debugging):
14621 Remove YYSTDERR; it's no longer defined or used.
14622 Also, s/cstdio.h/cstdio/.
14623
146242002-01-03 Akim Demaille <akim@epita.fr>
14625
14626 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
14627
146282002-01-03 Akim Demaille <akim@epita.fr>
14629
14630 * src/parse-skel.y (process_skeleton): Don't bind the parser's
14631 tracing code to --trace, wait for a better --trace option, with
14632 args.
14633
146342002-01-03 Akim Demaille <akim@epita.fr>
14635
14636 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
14637 The ISO C++ standard is extremely clear about it: stderr is
14638 considered a macro, not a regular symbol (see table 94 `Header
14639 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
14640 Therefore std:: does not apply to it. It still does with fprintf.
14641 Also, s/cstdio.h/cstdio/.
14642
146432002-01-03 Akim Demaille <akim@epita.fr>
14644
14645 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
14646 for non system headers.
14647
146482002-01-02 Akim Demaille <akim@epita.fr>
14649
14650 Equip the skeleton chain with location tracking, runtime trace,
14651 pure parser and scanner.
14652
14653 * src/parse-skel.y: Request a pure parser, locations, and prefix
14654 renaming.
14655 (%union): Having several members with the same type does not help
14656 type mismatches, simplify.
14657 (YYPRINT, yyprint): New.
14658 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
14659 (skel_error): this.
14660 Handle locations.
14661 * src/scan-skel.l: Adjust to these changes.
14662 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
14663 (LOCATION_PRINT, skel_control_t): New.
14664
146652001-12-30 Akim Demaille <akim@epita.fr>
14666
14667 * src/parse-skel.y: Get rid of the shift/reduce conflict:
14668 replace `gb' with BLANKS.
14669 * src/scan-skel.l: Adjust.
14670
146712001-12-30 Akim Demaille <akim@epita.fr>
14672
14673 * src/system.h: We don't need nor want bcopy.
14674 Throw away MS-DOS crap: we don't need getpid.
14675 * configure.in: We don't need strndup. It was even causing
14676 problems: because Flex includes the headers *before* us,
14677 _GNU_SOURCE is not defined by config.h, and therefore strndup was
14678 not visible.
14679 * lib/xstrndup.c: New.
14680 * src/scan-skel.l: Use it.
14681 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
14682 * src/parse-skel.y: Use %directives instead of #defines.
14683
146842001-12-30 Akim Demaille <akim@epita.fr>
14685
14686 * src/skeleton.h: New.
14687 * src/output.c (output_parser, output_master_parser): Remove, dead
14688 code.
14689 * src/output.h (get_lines_number, actions_output, guards_output)
14690 (token_definitions_output): Prototype them.
14691 * src/parse-skel.y: Add the license notice.
14692 Include output.h and skeleton.h.
14693 (process_skeleton): Returns void, and takes a single parameter.
14694 * src/scan-skel.l: Add the license notice.
14695 Include skeleton.h.
14696 Don't use %option yylineno: it seems that then Flex imagines
14697 REJECT has been used, and therefore it won't reallocate its
14698 buffers (which makes no other sense to me than a bug). It results
14699 in warnings for `unused: yy_flex_realloc'.
14700
147012001-12-30 Robert Anisko <robert.anisko@epita.fr>
14702
14703 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
14704 (MUSCLE_INSERT_PREFIX): ...to there.
14705 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
14706 (MUSCLE_INSERT_PREFIX): Move from here...
14707
14708 * src/bison.hairy: Add a section directive. Put braces around muscle
14709 names. This parser skeleton is still broken, but Bison should not
14710 choke on a bad muscle 'syntax'.
14711 * src/bison.simple: Add a section directive. Put braces around muscle
14712 names.
14713
14714 * src/files.h (strsuffix, stringappend): Add declarations.
14715 (tab_extension): Add declaration.
14716 (short_base_name): Add declaration.
14717
14718 * src/files.c (strsuffix, stringappend): No longer static. These
14719 functions are used in the skeleton parser.
14720 (tab_extension): New.
14721 (compute_base_names): Use the computations done in this function
14722 to guess if the generated parsers should have '.tab' in their
14723 names.
14724 (short_base_name): No longer static.
14725
14726 * src/output.c (output_skeleton): New.
14727 (output): Disable call to output_master_parser, and give a try to
14728 a new skeleton handling system.
14729 (guards_output, actions_output): No longer static.
14730 (token_definitions_output, get_lines_number): No longer static.
14731
14732 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
14733
14734 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
14735 parse-skel.y.
14736
14737 * src/parse-skel.y: New file.
14738 * src/scan-skel.l: New file.
14739
147402001-12-29 Akim Demaille <akim@epita.fr>
14741
14742 %name-prefix is broken.
14743
14744 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
14745 Adjust all dependencies.
14746 * tests/headers.at (export YYLTYPE): Strengthen this test: use
14747 %name-prefix.
14748
14749 Renaming yylval but not yylloc is not consistent. Now we do.
14750
14751 * src/bison.simple: Prefix yylloc if used.
14752 * doc/bison.texinfo (Decl Summary): Document that.
14753
147542001-12-29 Akim Demaille <akim@epita.fr>
14755
14756 * doc/bison.texinfo: Promote `%long-directive' over
14757 `%long_directive'.
14758 Remove all references to fixed-output-files, yacc is enough.
14759
147602001-12-29 Akim Demaille <akim@epita.fr>
14761
14762 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
14763 user prologue. These are defaults.
14764 * tests/actions.at (Mid-rule actions): Make sure the user can
14765 define YYDEBUG and YYERROR_VERBOSE.
14766
147672001-12-29 Akim Demaille <akim@epita.fr>
14768
14769 * src/output.c (header_output): Don't forget to export YYLTYPE and
14770 yylloc.
14771 * tests/headers.at (export YYLTYPE): New, make sure it does.
14772 * tests/regression.at (%union and --defines, Invalid CPP headers):
14773 Move to...
14774 * tests/headers.at: here.
14775
147762001-12-29 Akim Demaille <akim@epita.fr>
14777
14778 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
14779
147802001-12-29 Akim Demaille <akim@epita.fr>
14781
14782 * tests/actions.at (Mid-rule actions): Output on a single line
14783 instead of several.
14784
147852001-12-29 Akim Demaille <akim@epita.fr>
14786
14787 * doc/bison.texinfo: Formatting changes.
14788
147892001-12-29 Akim Demaille <akim@epita.fr>
14790
14791 Don't store the token defs in a muscle, just be ready to output it
14792 on command. Now possible via `symbols'. Fixes a memory leak.
14793
14794 * src/output.c (token_definitions_output): New.
14795 (output_parser, header_output): Use it.
14796 * src/reader.c (symbols_save): Remove.
14797
147982001-12-29 Akim Demaille <akim@epita.fr>
14799
14800 * src/bison.simple: Do not provide a default for YYSTYPE and
14801 YYLTYPE before the user's prologue. Otherwise it's hardly... a
14802 default.
14803
148042001-12-29 Akim Demaille <akim@epita.fr>
14805
14806 Mid-rule actions are simply... ignored!
14807
14808 * src/reader.c (readgram): Be sure to attach mid-rule actions to
14809 the empty-rule associated to the dummy symbol, not to the host
14810 rule.
14811 * tests/actions.at (Mid-rule actions): New.
14812
148132001-12-29 Akim Demaille <akim@epita.fr>
14814
14815 Memory leak.
14816
14817 * src/reader.c (reader): Free grammar.
14818
148192001-12-29 Akim Demaille <akim@epita.fr>
14820
14821 Memory leak.
14822
14823 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
14824 since it allocates it for each state, although only one is needed.
14825 (allocate_storage): Do it here.
14826
148272001-12-29 Akim Demaille <akim@epita.fr>
14828
14829 * src/options.h, src/options.c (create_long_option_table): Rename
14830 as...
14831 (long_option_table_new): this, with a clearer prototype.
14832 (percent_table): Remove, unused,
14833 * src/getargs.c (getargs): Adjust.
14834
148352001-12-29 Akim Demaille <akim@epita.fr>
14836
14837 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
14838 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
14839 as states.
14840
148412001-12-29 Akim Demaille <akim@epita.fr>
14842
14843 * src/lalr.c (build_relations): Rename `states' as `states1'.
14844 Sorry, I don't understand exactly what it is, no better name...
14845
148462001-12-29 Akim Demaille <akim@epita.fr>
14847
14848 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
14849 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
14850 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
14851 as rules.
14852
148532001-12-29 Akim Demaille <akim@epita.fr>
14854
14855 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
14856 ago.
14857
148582001-12-29 Akim Demaille <akim@epita.fr>
14859
14860 * src/reader.c, src/reader.h (user_toknums): Remove.
14861 Adjust all users to use symbols[i]->user_token_number.
14862
148632001-12-29 Akim Demaille <akim@epita.fr>
14864
14865 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
14866 Adjust all users to use symbols[i]->prec or ->assoc.
14867
148682001-12-29 Akim Demaille <akim@epita.fr>
14869
14870 * src/reader.c, src/reader.h (tags): Remove.
14871 Adjust all users to use symbols[i]->tag.
14872
148732001-12-29 Akim Demaille <akim@epita.fr>
14874
14875 * src/gram.h, src/gram.c (symbols): New, similar to state_table
14876 and rule_table.
14877 * src/reader.c (packsymbols): Fill this table.
14878 Drop sprec.
14879 * src/conflicts.c (resolve_sr_conflict): Adjust.
14880 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
14881 single table.
14882 Use symbols[i]->tag instead of tags[i].
14883
148842001-12-29 Akim Demaille <akim@epita.fr>
14885
14886 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
14887 In addition, put a comment in there, to replace...
14888 * tests/regression.at (%union and C comments): Remove.
14889
148902001-12-29 Akim Demaille <akim@epita.fr>
14891
14892 * tests/regression.at (Web2c Actions): Blindly move the actual
14893 output as expected output. The contents *seem* right to me, but I
14894 can't pretend reading perfectly parser tables... Nonetheless, all
14895 the other tests pass correctly, the table look OK, even though the
14896 presence of `$axiom' is to be noted: AFAICS it is useless (but
14897 harmless).
14898
148992001-12-29 Akim Demaille <akim@epita.fr>
14900
14901 * src/reader.c (readgram): Don't add the rule 0 if there were no
14902 rules read. In other words, add it _after_ having performed
14903 grammar sanity checks.
14904 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
14905
149062001-12-29 Akim Demaille <akim@epita.fr>
14907
14908 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
14909 visible, and some states have now a different number.
14910
149112001-12-29 Akim Demaille <akim@epita.fr>
14912
14913 * src/reader.c (readgram): Bind the initial rule's lineno to that
14914 of the first rule.
14915 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
14916 (Solved SR Conflicts): Adjust rule 0's line number.
14917
149182001-12-29 Akim Demaille <akim@epita.fr>
14919
14920 Fix the `GAWK Grammar' failure.
14921
14922 * src/LR0.c (final_state): Initialize to -1 so that we do compute
14923 the reductions of the first state which was mistakenly confused
14924 with the final state because precisely final_state was initialized
14925 to 0.
14926 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
14927 now noticed by Bison.
14928 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
14929 have a reduction on $default.
14930
149312001-12-29 Akim Demaille <akim@epita.fr>
14932
14933 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
14934 rule line numbers.
14935 * src/closure.c (print_closure): Likewise.
14936 * src/derives.c (print_derives): Likewise.
14937 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
14938 now.
14939
149402001-12-29 Akim Demaille <akim@epita.fr>
14941
14942 * src/lalr.c (lookaheads_print): New.
14943 (lalr): Call it when --trace-flag.
14944 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
14945 are dumped.
14946
149472001-12-29 Akim Demaille <akim@epita.fr>
14948
14949 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
14950 when walking through ritem, even via rule->rhs.
14951 * src/reduce.c (dump_grammar, useful_production, reduce_output)
14952 (useful_production, useless_nonterminals): Likewise.
14953 (reduce_grammar_tables): Likewise, plus update nritems.
14954 * src/nullable.c (set_nullable): Likewise.
14955 * src/lalr.c (build_relations): Likewise.
14956 * tests/sets.at (Nullable): Adjust.
14957 Fortunately, now, the $axiom is no longer nullable.
14958
149592001-12-29 Akim Demaille <akim@epita.fr>
14960
14961 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
14962 the 0-sentinel.
14963 * src/gram.c (ritem_longest_rhs): Likewise.
14964 * src/reduce.c (nonterminals_reduce): Likewise.
14965 * src/print_graph.c (print_graph): Likewise.
14966 * src/output.c (output_rule_data): Likewise.
14967 * src/nullable.c (set_nullable): Likewise.
14968
149692001-12-29 Akim Demaille <akim@epita.fr>
14970
14971 * src/output.c: Comment changes.
14972
149732001-12-27 Paul Eggert <eggert@twinsun.com>
14974
14975 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
14976 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
14977 Sparc, as they were causing more porting problems than the
14978 (minor) performance improvement was worth.
14979
14980 Also, catch up with 1.31's YYSTD.
14981
149822001-12-27 Akim Demaille <akim@epita.fr>
14983
14984 * src/output.c (output_gram): Rely on nritems, not the
14985 0-sentinel. See below.
14986 Use -1 as separator, not 0.
14987 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
14988 Rely on -1 as separator in yyrhs, instead of 0.
14989 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
14990 twice `Now at end of input', therefore there are two lines less to
14991 expect.
14992
149932001-12-27 Akim Demaille <akim@epita.fr>
14994
14995 * tests/regression.at (Unresolved SR Conflicts):
14996 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
14997 below.
14998
149992001-12-27 Akim Demaille <akim@epita.fr>
15000
15001 * src/LR0.c (new_state): Recognize the final state by the fact it
15002 is reached by eoftoken.
15003 (insert_start_shifting_state, insert_eof_shifting_state)
15004 (insert_accepting_state, augment_automaton): Remove, since now
15005 these states are automatically computed from the initial state.
15006 (generate_states): Adjust.
15007 * src/print.c: When reporting a rule number to the user, substract
15008 1, so that the axiom rule is rule 0, and the first user rule is 1.
15009 * src/reduce.c: Likewise.
15010 * src/print_graph.c (print_core): For the time being, just as for
15011 the report, depend upon --trace-flags to dump the full set of
15012 items.
15013 * src/reader.c (readgram): Once the grammar read, insert the rule
15014 0: `$axiom: START-SYMBOL $'.
15015 * tests/set.at: Adjust: rule 0 is now displayed, and since the
15016 number of the states has changed (the final state is no longer
15017 necessarily the last), catch up.
15018
150192001-12-27 Akim Demaille <akim@epita.fr>
15020
15021 Try to make the use of the eoftoken valid. Given that its value
15022 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
15023 is used instead of > 0 where appropriate, (ii), depend upon nritems
15024 instead of the 0-sentinel.
15025
15026 * src/gram.h, src/gram.c (nritems): New.
15027 Expected to be duplication of nitems, but for the time being...
15028 * src/reader.c (packgram): Assert nritems and nitems are equal.
15029 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
15030 * src/closure.c (print_closure, print_fderives): Likewise.
15031 * src/gram.c (ritem_print): Likewise.
15032 * src/print.c (print_core, print_grammar): Likewise.
15033 * src/print_graph.c: Likewise.
15034
150352001-12-27 Akim Demaille <akim@epita.fr>
15036
15037 * src/main.c (main): If there are complains after grammar
15038 reductions, then output the report anyway if requested, then die.
15039 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
15040 * src/reader.c (eoftoken): New.
15041 (parse_token_decl): If the token being defined has value `0', it
15042 is the eoftoken.
15043 (packsymbols): No longer hack `tags' to insert `$' by hand.
15044 Be sure to preserve the value of the eoftoken.
15045 (reader): Make sure eoftoken is defined.
15046 Initialize nsyms to 0: now eoftoken is created just like the others.
15047 * src/print.c (print_grammar): Don't special case the eof token.
15048 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
15049 lie anyway, albeit pleasant.
15050 * tests/calc.at: Exercise error messages with eoftoken.
15051 Change the grammar so that empty input is invalid.
15052 Adjust expectations.
15053 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
15054
150552001-12-27 Akim Demaille <akim@epita.fr>
15056
15057 * configure.in: Check the protos of strchr ans strspn.
15058 Replace strchr if needed.
15059 * src/system.h: Provide the protos of strchr, strspn and memchr if
15060 missing.
15061 * lib/strchr.c: New.
15062 * src/reader.c (symbols_save): Use strchr.
15063
150642001-12-27 Akim Demaille <akim@epita.fr>
15065
15066 * src/print.c, src/print_graph.c (escape): New.
15067 Use it to quote the TAGS outputs.
15068 * src/print_graph.c (print_state): Now errors are in red, and
15069 reductions in green.
15070 Prefer high to wide: output the state number on a line of its own.
15071
150722001-12-27 Akim Demaille <akim@epita.fr>
15073
15074 * src/state.h, src/state.c (reductions_new): New.
15075 * src/LR0.c (set_state_table): Let all the states have a
15076 `reductions', even if reduced to 0.
15077 (save_reductions): Adjust.
15078 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
15079 * src/print.c (print_reductions, print_actions): Adjust.
15080 * src/output.c (action_row): Adjust.
15081
150822001-12-27 Akim Demaille <akim@epita.fr>
15083
15084 * src/state.h, src/state.c (errs_new, errs_dup): New.
15085 * src/LR0.c (set_state_table): Let all the states have an errs,
15086 even if reduced to 0.
15087 * src/print.c (print_errs, print_reductions): Adjust.
15088 * src/output.c (output_actions, action_row): Adjust.
15089 * src/conflicts.c (resolve_sr_conflict): Adjust.
15090
150912001-12-27 Akim Demaille <akim@epita.fr>
15092
15093 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
15094
150952001-12-27 Akim Demaille <akim@epita.fr>
15096
15097 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
15098 * src/print.c: here.
15099 (lookaheadset, shiftset): New, used as additional storage by
15100 print_reductions.
15101 (print_results): Adjust.
15102 (print_shifts, print_gotos, print_errs): New, extracted from...
15103 (print_actions): here.
15104 * src/print_graph.c (print_actions): Remove dead code.
15105
151062001-12-27 Akim Demaille <akim@epita.fr>
15107
15108 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
15109 `$n' and `@n'.
15110
151112001-12-27 Akim Demaille <akim@epita.fr>
15112
15113 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
15114 (build_relations): Adjust.
15115
151162001-12-27 Akim Demaille <akim@epita.fr>
15117
15118 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
15119 duplication.
15120
151212001-12-27 Akim Demaille <akim@epita.fr>
15122
15123 * src/reader.c (packgram): Catch nitems overflows.
15124
151252001-12-27 Akim Demaille <akim@epita.fr>
15126
15127 * src/files.c, src/files.h (guard_obstack): Remove.
15128 * src/output.c (output): Adjust.
15129 * src/reader.c (parse_braces): New, factoring...
15130 (copy_action, copy_guard): these two which are renamed as...
15131 (parse_action, parse_guard): these.
15132 As a voluntary consequence, using braces around guards is now
15133 mandatory.
15134
151352001-12-27 Akim Demaille <akim@epita.fr>
15136
15137 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
15138 * src/reader.c (symbol_list): `guard' and `guard_line' are new
15139 members.
15140 (symbol_list_new): Adjust.
15141 (copy_action): action_line is the first line, not the last.
15142 (copy_guard): Just as for actions, store the `action' only, not
15143 the switch/case/break flesh.
15144 Don't parse the user action that might follow the guard, let...
15145 (readgram): do it, i.e., now, there can be an action after a
15146 guard.
15147 In other words the guard is just explicitly optional.
15148 (packgram): Adjust.
15149 * src/output.c (guards_output): New.
15150 (output_parser): Call it when needed.
15151 (output): Also free the guard and attrs obstacks.
15152 * src/files.c, src/files.h (obstack_save): Remove.
15153 (output_files): Remove.
15154 As a result, if one needs the former `.act' file, using an
15155 appropriate skeleton which requires actions and guards is now
15156 required.
15157 * src/main.c (main): Adjust.
15158 * tests/semantic.at: New.
15159 * tests/regression.at: Use `input.y' as input file name.
15160 Avoid 8+3 problems by requiring input.c when the test needs the
15161 parser.
15162
151632001-12-27 Akim Demaille <akim@epita.fr>
15164
15165 * src/reader.c (symbol_list_new): Be sure to initialize all the
15166 fields.
15167
151682001-12-27 Akim Demaille <akim@epita.fr>
15169
15170 All the hacks using a final pseudo state are now useless.
15171
15172 * src/LR0.c (set_state_table): state_table holds exactly nstates.
15173 * src/lalr.c (nLA): New.
15174 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
15175 instead of lookaheadsp from the pseudo state (nstate + 1).
15176
151772001-12-27 Akim Demaille <akim@epita.fr>
15178
15179 * src/output.c (action_row, token_actions): Use a state_t instead
15180 of a integer, and nlookaheads instead of the following state's
15181 lookaheadsp.
15182
151832001-12-27 Akim Demaille <akim@epita.fr>
15184
15185 * src/conflicts.c (log_resolution, flush_shift)
15186 (resolve_sr_conflict, set_conflicts, solve_conflicts)
15187 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
15188 (conflicts_print, print_reductions): Use a state_t instead of an
15189 integer when referring to a state.
15190 As much as possible, depend upon nlookaheads, instead of the
15191 `lookaheadsp' member of the following state (since lookaheads of
15192 successive states are successive, the difference between state n + 1
15193 and n served as the number of lookaheads for state n).
15194 * src/lalr.c (add_lookback_edge): Likewise.
15195 * src/print.c (print_core, print_actions, print_state)
15196 (print_results): Likewise.
15197 * src/print_graph.c (print_core, print_actions, print_state)
15198 (print_graph): Likewise.
15199 * src/conflicts.h: Adjust.
15200
152012001-12-27 Akim Demaille <akim@epita.fr>
15202
15203 * src/bison.hairy: Formatting/comment changes.
15204 ANSIfy.
15205 Remove `register' indications.
15206 Add plenty of `static'.
15207
152082001-12-27 Akim Demaille <akim@epita.fr>
15209
15210 * src/output.c (prepare): Drop the muscle `ntbase' which
15211 duplicates ntokens.
15212 * src/bison.simple: Formatting/comment changes.
15213 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
15214 is an undocumented synonym.
15215
152162001-12-22 Akim Demaille <akim@epita.fr>
15217
15218 * src/output.c (output_table_data): Change the prototype to use
15219 `int' for array ranges: some invocations do pass an int, not a
15220 short.
15221 Reported by Wayne Green.
15222
152232001-12-22 Akim Demaille <akim@epita.fr>
15224
15225 Some actions of web2c.y are improperly triggered.
15226 Reported by Mike Castle.
15227
15228 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
15229 * tests/regression.at (Web2c): Rename as...
15230 (Web2c Report): this.
15231 (Web2c Actions): New.
15232
152332001-12-22 Akim Demaille <akim@epita.fr>
15234
15235 Reductions in web2c.y are improperly reported.
15236 Reported by Mike Castle.
15237
15238 * src/conflicts.c (print_reductions): Fix.
15239 * tests/regression.at (Web2c): New.
15240
152412001-12-18 Akim Demaille <akim@epita.fr>
15242
15243 Some host fail on `assert (!"foo")', which expands to
15244 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
15245 Reported by Nelson Beebee.
15246
15247 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
15248 `#define it_succeeded 0' and `assert (it_succeeded)'.
15249
152502001-12-17 Marc Autret <autret_m@epita.fr>
15251
15252 * src/bison.simple: Don't hard code the skeleton line and filename.
15253 * src/output.c (output_parser): Rename 'line' as 'output_line'.
15254 New line counter 'skeleton_line' (skeleton-line muscle).
15255
152562001-12-17 Paul Eggert <eggert@twinsun.com>
15257
15258 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
15259 YYDEBUG must be defined to a nonzero value.
15260
15261 * src/bison.simple (yytname): Do not assume that the user defines
15262 YYDEBUG to a properly parenthesized expression.
15263
152642001-12-17 Akim Demaille <akim@epita.fr>
15265
15266 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
15267 nlookaheads is a new member.
15268 Adjust all users.
15269 * src/lalr.h (nlookaheads): Remove this orphan declaration.
15270 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
15271 state.
15272
152732001-12-17 Akim Demaille <akim@epita.fr>
15274
15275 * src/files.h, src/files.c (open_files, close_files): Remove.
15276 * src/main.c (main): Don't open/close files, nor invoke lex_free,
15277 let...
15278 * src/reader.c (reader): Do it.
15279
152802001-12-17 Akim Demaille <akim@epita.fr>
15281
15282 * src/conflicts.c (print_reductions): Formatting changes.
15283
152842001-12-17 Akim Demaille <akim@epita.fr>
15285
15286 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
15287 (flush_reduce): New.
15288 (resolve_sr_conflict): Adjust.
15289
152902001-12-17 Akim Demaille <akim@epita.fr>
15291
15292 * src/output.c (output_obstack): Be static and rename as...
15293 (format_obstack): this, to avoid any confusion with files.c's
15294 output_obstack.
15295 * src/reader.h (muscle_obstack): Move to...
15296 * src/output.h: here, since it's defined in output.c.
15297
152982001-12-17 Akim Demaille <akim@epita.fr>
15299
15300 * src/output.c (action_row, save_column, default_goto)
15301 (sort_actions, matching_state, pack_vector): Better variable
15302 locality.
15303
153042001-12-17 Akim Demaille <akim@epita.fr>
15305
15306 * src/output.c: Various formatting changes.
15307
153082001-12-17 Akim Demaille <akim@epita.fr>
15309
15310 * src/files.c (output_files): Free the output_obstack.
15311 * src/main.c (main): Call print and print_graph conditionally.
15312 * src/print.c (print): Work unconditionally.
15313 * src/print_graph.c (print_graph): Work unconditionally.
15314 * src/conflicts.c (log_resolution): Output only if verbose_flag.
15315
153162001-12-16 Marc Autret <autret_m@epita.fr>
15317
15318 * src/output.c (actions_output): Fix. When we use %no-lines,
15319 there is one less line per action.
15320
153212001-12-16 Marc Autret <autret_m@epita.fr>
15322
15323 * src/bison.simple: Remove a useless #line directive.
15324 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
15325 * src/output.c (get_lines_number): New.
15326 (output_parser): Adjust, now takes care about the lines of a
15327 output muscles.
15328 Fix line numbering.
15329 (actions_output): Computes the number of lines taken by actions.
15330 (output_master_parser): Insert new skeleton which is the name of
15331 the output parser file name.
15332
153332001-12-15 Marc Autret <autret_m@epita.fr>
15334
15335 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
15336
153372001-12-15 Marc Autret <autret_m@epita.fr>
15338
15339 * src/output.c (output_gram): Keep track of the hairy one.
15340
153412001-12-15 Akim Demaille <akim@epita.fr>
15342
15343 Make `make distcheck' work.
15344
15345 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
15346 system.h which uses libgettext.h.
15347
153482001-12-15 Akim Demaille <akim@epita.fr>
15349
15350 * src/nullable.c (set_nullable): Useless rules must be skipped,
15351 otherwise, since we range over their symbols, we might look at a
15352 nonterminal which no longer ``exists'', i.e., it is not counted in
15353 `nvars', hence we overflow our arrays.
15354
153552001-12-15 Akim Demaille <akim@epita.fr>
15356
15357 The header can also be produced directly, without any obstack!
15358 Yahoo!
15359
15360 * src/files.c, src/files.h (defines_obstack): Remove.
15361 (compute_header_macro): Global.
15362 (defines_obstack_save): Remove.
15363 * src/reader.c (parse_union_decl): No longer output to
15364 defines_obstack: its content can be found in the `stype' muscle
15365 anyway.
15366 (output_token_translations): Merge into...
15367 (symbols_output): this.
15368 Rename as...
15369 (symbols_save): this.
15370 (reader): Adjust.
15371 * src/output.c (header_output): New.
15372 (output): Call it.
15373
153742001-12-15 Akim Demaille <akim@epita.fr>
15375
15376 * src/reader.c (parse_union_decl): Instead of handling two obstack
15377 simultaneously, use one to define the `stype' muscle, and use the
15378 value of the latter to fill defines_obstack.
15379 (copy_comment): Remove.
15380 (copy_comment2): Work for a single obstack.
15381 Rename as...
15382 (copy_comment): this.
15383
153842001-12-15 Akim Demaille <akim@epita.fr>
15385
15386 * src/lex.c, src/lex.h (xgetc): No longer static.
15387 * src/reader.c (parse_union_decl): Revamp.
15388
153892001-12-15 Akim Demaille <akim@epita.fr>
15390
15391 Still making progress in separating Bison into (i) input, (ii)
15392 process, (iii) output: now we can directly output the parser file
15393 without using table_obstack at all.
15394
15395 * src/files.c, src/files.h (table_obstack): Bye bye.
15396 (parser_file_name): New.
15397 * src/files.c (compute_output_file_names): Compute it.
15398 * src/output.c (actions_output, output_parser)
15399 (output_master_parser): To a file instead of an obstack.
15400
154012001-12-15 Akim Demaille <akim@epita.fr>
15402
15403 Attach actions to rules, instead of pre-outputting them to
15404 actions_obstack.
15405
15406 * src/gram.h (rule_t): action and action_line are new members.
15407 * src/reader.c (symbol_list): Likewise.
15408 (copy_action): Save the actions within the rule.
15409 (packgram): Save them in rule_table.
15410 * src/output.c (actions_output): New.
15411 (output_parser): Use it on `%%actions'.
15412 (output_rule_data): Don't free rule_table.
15413 (output): Do it.
15414 (prepare): Don't save the `action' muscle.
15415 * src/bison.simple: s/%%action/%%actions/.
15416
154172001-12-15 Akim Demaille <akim@epita.fr>
15418
15419 * src/reader.c (copy_action): When --yacc, don't append a `;'
15420 to the user action: let it fail if lacking.
15421 Suggested by Arnold Robbins and Tom Tromey.
15422
154232001-12-14 Akim Demaille <akim@epita.fr>
15424
15425 * src/lex.c (literalchar): Simply return the char you decoded, non
15426 longer mess around with obstacks and int pointers.
15427 Adjust all callers.
15428
154292001-12-14 Akim Demaille <akim@epita.fr>
15430
15431 * src/lex.c (literalchar): Don't escape the special characters,
15432 just decode them, and keep them as char (before, eol was output as
15433 the 2 char string `\n' etc.).
15434 * src/output.c (output_rule_data): Use quotearg to output the
15435 token strings.
15436
154372001-12-13 Paul Eggert <eggert@twinsun.com>
15438
15439 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
15440 Do not infringe on the global user namespace when using C++.
15441 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
15442 All uses of `fprintf' and `stderr' changed.
15443
15444 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
15445
154462001-12-13 Akim Demaille <akim@epita.fr>
15447
15448 The computation of nullable is broken: it doesn't handle empty
15449 RHS's properly.
15450
15451 * tests/torture.at (GNU AWK Grammar): New.
15452 * tests/sets.at (Nullable): New.
15453 * src/nullable.c (set_nullable): Instead of blindly looping over
15454 `ritems', loop over the rules, and then over their rhs's.
15455
15456 Work around Autotest bugs.
15457
15458 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
15459 frame, because Autotest understand lines starting with a `+' as
15460 traces from the shell. Then, they are not processed properly.
15461 Admittedly an Autotest bug, but we don't have time to wait for
15462 Autotest to catch up.
15463 * tests/regression.at (Broken Closure): Adjust to the new table
15464 frames.
15465 Move to...
15466 * tests/sets.at: here.
15467
154682001-12-13 Akim Demaille <akim@epita.fr>
15469
15470 * src/closure.c (closure): Use nrules instead of playing tricks
15471 with BITS_PER_WORD.
15472
154732001-12-13 Akim Demaille <akim@epita.fr>
15474
15475 * src/print.c (print_actions): Output the handling of `$' as the
15476 traces do: shifting the token EOF. Before EOF was treated as a
15477 nonterminal.
15478 * tests/regression.at: Adjust some tests.
15479 * src/print_graph.c (print_core): Complete the set of items via
15480 closure. The next-to-final and final states are still unsatisfying,
15481 but that's to be addressed elsewhere.
15482 No longer output the rule numbers, but do output the state number.
15483 A single loop for the shifts + gotos is enough, but picked a
15484 distinct color for each.
15485 (print_graph): Initialize and finalize closure.
15486
154872001-12-13 Akim Demaille <akim@epita.fr>
15488
15489 * src/reader.c (readgram): Remove dead code, an strip useless
15490 braces.
15491 (get_type): Remove, unused.
15492
154932001-12-12 Akim Demaille <akim@epita.fr>
15494
15495 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
15496 on that of lib/error.c.
15497
154982001-12-12 Akim Demaille <akim@epita.fr>
15499
15500 Some hosts don't like `/' in includes.
15501
15502 * src/system.h: Include libgettext.h without qualifying the path.
15503 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
15504 $(top_srcdir).
15505
155062001-12-11 Marc Autret <autret_m@epita.fr>
15507
15508 * src/output.c (output_parser): Remove useless muscle.
15509
155102001-12-11 Marc Autret <autret_m@epita.fr>
15511
15512 * src/bison.simple: Remove #line just before %%epilogue. It
15513 is now handled in ...
15514 * src/reader.c (read_additionnal_code): Add the output of a
15515 #line for the epilogue.
15516
155172001-12-10 Marc Autret <autret_m@epita.fr>
15518
15519 * src/reader.c (copy_definition): Re-use CPP-outed code which
15520 replace precedent remove.
15521 * src/bison.simple: Remove #line before %%prologue because
15522 %%input-line is wrong at this time.
15523
155242001-12-10 Marc Autret <autret_m@epita.fr>
15525
15526 * src/reader.c (symbols_output): Clean up.
15527 * src/output.c (output_gram, output): Clean up.
15528
155292001-12-10 Akim Demaille <akim@epita.fr>
15530
15531 * src/lalr.c (initialize_lookaheads): New. Extracted from...
15532 * src/LR0.c (set_state_table): here.
15533 * src/lalr.c (lalr): Call it.
15534
155352001-12-10 Akim Demaille <akim@epita.fr>
15536
15537 * src/state.h (shifts): Remove the `number' member: shifts are
15538 attached to state, hence no longer need to be labelled with a
15539 state number.
15540
155412001-12-10 Akim Demaille <akim@epita.fr>
15542
15543 Now that states have a complete set of members, the linked list of
15544 shifts is useless: just fill directly the state's shifts member.
15545
15546 * src/state.h (shifts): Remove the `next' member.
15547 * src/LR0.c (first_state, last_state): Remove.
15548 Adjust the callers.
15549 (augment_automaton): Don't look for the shifts that must be added
15550 a shift on EOF: it is those of the state we looked for! But now,
15551 since shifts are attached, it is no longer needed to looking
15552 merely by its id: its number.
15553
155542001-12-10 Akim Demaille <akim@epita.fr>
15555
15556 * src/LR0.c (augment_automaton): Better variable locality.
15557 Remove an impossible branch: if there is a state corresponding to
15558 the start symbol being shifted, then there is shift for the start
15559 symbol from the initial state.
15560
155612001-12-10 Akim Demaille <akim@epita.fr>
15562
15563 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
15564 only when appropriate: when insert_start_shifting_state' is not
15565 invoked.
15566 * tests/regression.at (Rule Line Numbers): Adjust.
15567
155682001-12-10 Akim Demaille <akim@epita.fr>
15569
15570 * src/LR0.c (augment_automaton): Now that all states have shifts,
15571 merge the two cases addition shifts to the initial state.
15572
155732001-12-10 Akim Demaille <akim@epita.fr>
15574
15575 * src/lalr.c (set_state_table): Move to...
15576 * src/LR0.c: here.
15577 * src/lalr.c (lalr): Don't call it...
15578 * src/LR0.c (generate_states): do it.
15579 * src/LR0.h (first_state): Remove, only the table is used.
15580
155812001-12-10 Akim Demaille <akim@epita.fr>
15582
15583 * src/LR0.h (first_shift, first_reduction): Remove.
15584 * src/lalr.c: Don't use first_shift: find shifts through the
15585 states.
15586
155872001-12-10 Akim Demaille <akim@epita.fr>
15588
15589 * src/LR0.c: Attach shifts to states as soon as they are
15590 computed.
15591 * src/lalr.c (set_state_table): Instead of assigning shifts to
15592 state, just assert that the mapping was properly done.
15593
155942001-12-10 Akim Demaille <akim@epita.fr>
15595
15596 * src/LR0.c (insert_start_shift): Rename as...
15597 (insert_start_shifting_state): this.
15598 (insert_eof_shifting_state, insert_accepting_state): New.
15599 (augment_automaton): Adjust.
15600 Better locality of the variables.
15601 When looking if the start_symbol is shifted from the initial
15602 state, using `while (... symbol != start_symbol ...)' sounds
15603 better than `while (... symbol < start_symbol ...)': If fail
15604 to see how the order between symbols could be relevant!
15605
156062001-12-10 Akim Demaille <akim@epita.fr>
15607
15608 * src/getargs.h: Don't declare `spec_name_prefix' and
15609 `spec_file_prefix', declared by src/files.h.
15610 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
15611 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
15612 * src/output.c (prepare): Adjust.
15613 * src/reader.c (symbols_output): Likewise.
15614 * src/vmsgetargs.c: Vaguely adjust, but who cares?
15615
156162001-12-10 Akim Demaille <akim@epita.fr>
15617
15618 * src/muscle_tab.c (muscle_init): NULL is a better default than
15619 `"0"'.
15620
156212001-12-10 Akim Demaille <akim@epita.fr>
15622
15623 * src/reader.c (reader): Calling symbols_output once is enough.
15624
156252001-12-10 Akim Demaille <akim@epita.fr>
15626
15627 Now that states have a complete set of members, the linked list of
15628 reductions is useless: just fill directly the state's reductions
15629 member.
15630
15631 * src/state.h (struct reductions): Remove member `number' and
15632 `next'.
15633 * src/LR0.c (first_reduction, last_reduction): Remove.
15634 (save_reductions): Don't link the new reductions, store them in
15635 this_state.
15636 * src/lalr.c (set_state_table): No need to attach reductions to
15637 states, it's already done.
15638 * src/output.c (output_actions): No longer free the shifts, then
15639 the reductions, then the states: free all the states and their
15640 members.
15641
156422001-12-10 Akim Demaille <akim@epita.fr>
15643
15644 * src/options.c (OPTN, DRTV, BOTH): New.
15645 (option_table): Use them.
15646
15647 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
15648 the job of system.h.
15649 * src/options.c: Don't include stdio.h and xalloc.h for the same
15650 reasons.
15651
156522001-12-10 Akim Demaille <akim@epita.fr>
15653
15654 * src/output.c (output, prepare): Make sure the values of the
15655 muscles `action' and `prologue' are 0-terminated.
15656
156572001-12-10 Akim Demaille <akim@epita.fr>
15658
15659 Clean up GCC warnings.
15660
15661 * src/reader.c (copy_action): `buf' is not used.
15662 (parse_skel_decl): Be static.
15663 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
15664 * src/options.h (create_long_option_table): Have a real prototype.
15665 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
15666 (hash_delete_at): Return const void *.
15667 Adjust casts to preserve the const.
15668
156692001-12-10 Akim Demaille <akim@epita.fr>
15670
15671 * configure.in: Require 2.52g.
15672 M4 is not needed, but AUTOM4TE is.
15673 * m4/m4.m4: Remove.
15674 * tests/Makefile.am: Adjust.
15675
156762001-12-10 Akim Demaille <akim@epita.fr>
15677
15678 One structure for states is enough, even though theoretically
15679 there are LR(0) states and LALR(1) states.
15680
15681 * src/lalr.h (state_t): Remove.
15682 (state_table): Be state_t **, not state_t *.
15683 * src/state.h (core, CORE_ALLOC): Rename as...
15684 (state_t, STATE_ALLOC): this.
15685 Add the LALR(1) members: shifts, reductions, errs.
15686 * src/LR0.c (state_table): Rename as...
15687 (state_hash): this, to avoid name clashes with the global
15688 `state_table'.
15689 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
15690 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
15691
156922001-12-10 Akim Demaille <akim@epita.fr>
15693
15694 Bison dumps core on bash.y.
15695 Reported by Pascal Bart.
15696
15697 * src/warshall.c (bitmatrix_print): New.
15698 (TC): Use it.
15699 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
15700 j must be the outer loop.
15701 * tests/regression.at (Broken Closure): New.
15702
157032001-12-05 Akim Demaille <akim@epita.fr>
15704
15705 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
15706 its argument.
15707 Reported by Peter Hamorsky.
15708
157092001-12-05 Akim Demaille <akim@epita.fr>
15710
15711 * src/conflicts.c (err_table): Remove.
15712 (resolve_sr_conflict): Adjust.
15713 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
15714 Rename as...
15715 (state_t.reductions, state_t.shifts): this.
15716
157172001-12-05 Akim Demaille <akim@epita.fr>
15718
15719 * src/reduce.c (reduce_grammar_tables): No longer disable the
15720 removal of useless rules via CPP but via `if (0)', so that the
15721 compiler still check the code is valid.
15722 For instance, it should have noticed `rline' no longer exists: use
15723 the `line' member of rule_t.
15724 * src/gram.c (dummy, rline): Remove, unused.
15725
157262001-12-05 Akim Demaille <akim@epita.fr>
15727
15728 * src/output.c (pack_vector): Use assert, not berror.
15729 * src/main.c (berror): Remove, unused.
15730
157312001-12-05 Akim Demaille <akim@epita.fr>
15732
15733 New experimental feature: if --verbose --trace output all the
15734 items of a state, not only its kernel.
15735
15736 * src/print.c (print_core): If `trace_flag', then invoke closure
15737 before outputting the items of the state (print_core is no longer
15738 a correct name them).
15739 (print_results): Invoke new_closure/free_closure if needed.
15740
157412001-12-05 Akim Demaille <akim@epita.fr>
15742
15743 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
15744 * src/closure.c, src/closure.h (itemsetsize): Rename as...
15745 (nitemset): for consistency with the rest of the project.
15746
157472001-12-05 Akim Demaille <akim@epita.fr>
15748
15749 * src/closure.c (print_closure): Improve.
15750 (closure): Use it for printing input and output.
15751
157522001-12-05 Akim Demaille <akim@epita.fr>
15753
15754 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
15755 indexed by nonterminals.
15756
157572001-12-05 Akim Demaille <akim@epita.fr>
15758
15759 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
15760 what it was!).
15761 * src/warshall.h: Remove accidental duplication of the content.
15762
157632001-12-05 Akim Demaille <akim@epita.fr>
15764
15765 * src/closure.c (set_fderives): De-obfuscate.
15766
157672001-12-05 Akim Demaille <akim@epita.fr>
15768
15769 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
15770
157712001-12-05 Akim Demaille <akim@epita.fr>
15772
15773 * src/closure.c (set_firsts): De-obfuscate.
15774
157752001-12-05 Akim Demaille <akim@epita.fr>
15776
15777 * src/output.c (action_row): De-obfuscate
15778 using the good o' techniques: arrays not pointers, variable
15779 locality, BITISSET, RESETBIT etc.
15780
157812001-12-05 Akim Demaille <akim@epita.fr>
15782
15783 Pessimize the code to simplify it: from now on, all the states
15784 have a valid SHIFTS, which NSHIFTS is possibly 0.
15785
15786 * src/LR0.c (shifts_new): Be global and move to..
15787 * src/state.c, src/state.h: here.
15788 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
15789 * src/print_graph: Adjust.
15790
157912001-12-05 Akim Demaille <akim@epita.fr>
15792
15793 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
15794 * src/conflicts.c: Use it.
15795 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
15796 incorrectly ``simplified''.
15797
157982001-12-05 Akim Demaille <akim@epita.fr>
15799
15800 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
15801 using the good o' techniques: arrays not pointers, variable
15802 locality, BITISSET, RESETBIT etc.
15803
158042001-12-05 Akim Demaille <akim@epita.fr>
15805
15806 * src/state.h (SHIFT_SYMBOL): New.
15807 * src/conflicts.c: Use it to deobfuscate.
15808
158092001-12-05 Akim Demaille <akim@epita.fr>
15810
15811 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
15812 (print_reductions): De-obfuscate using the good o' techniques:
15813 arrays not pointers, variable locality, BITISSET.
15814
158152001-12-05 Akim Demaille <akim@epita.fr>
15816
15817 * src/conflicts.c (print_reductions): Arrays, not pointers.
15818 Use BITISSET.
15819
158202001-12-05 Akim Demaille <akim@epita.fr>
15821
15822 * src/conflicts.c (print_reductions): Pessimize, but clarify.
15823
158242001-12-05 Akim Demaille <akim@epita.fr>
15825
15826 * src/conflicts.c (print_reductions): Improve variable locality.
15827
158282001-12-05 Akim Demaille <akim@epita.fr>
15829
15830 * src/conflicts.c (print_reductions): Pessimize, but clarify.
15831
158322001-12-05 Akim Demaille <akim@epita.fr>
15833
15834 * src/conflicts.c (print_reductions): Improve variable locality.
15835
158362001-12-05 Akim Demaille <akim@epita.fr>
15837
15838 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
15839 * src/lalr.c: Use them.
15840
158412001-12-05 Akim Demaille <akim@epita.fr>
15842
15843 * src/LR0.c (augment_automaton): Formatting changes.
15844 Better variable locality.
15845
158462001-12-05 Akim Demaille <akim@epita.fr>
15847
15848 * src/lalr.c (matrix_print): New.
15849 (transpose): Use it.
15850 Use arrays instead of pointers.
15851
158522001-12-05 Akim Demaille <akim@epita.fr>
15853
15854 * src/lalr.c (maxrhs): Move to...
15855 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
15856 * src/lalr.c (build_relations): Adjust.
15857
158582001-12-05 Akim Demaille <akim@epita.fr>
15859
15860 * src/lalr.c (transpose): Free the memory allocated to the
15861 argument, as it is replaced by the results by the unique caller.
15862 (build_relations): Merely invoke transpose: it handles the memory
15863 deallocation.
15864 Improve variable locality.
15865 Avoid variables used as mere abbreviations.
15866 (compute_lookaheads): Use arrays instead of pointers.
15867
158682001-12-05 Akim Demaille <akim@epita.fr>
15869
15870 * src/lalr.c (initialize_F): Improve variable locality.
15871 Avoid variables used as mere abbreviations.
15872
158732001-12-05 Akim Demaille <akim@epita.fr>
15874
15875 * src/derives.c (print_derives): Display the ruleno.
15876 * src/lalr.c (initialize_F, transpose): Better variable locality
15877 to improve readability.
15878 Avoid variables used as mere abbreviations.
15879
158802001-12-05 Akim Demaille <akim@epita.fr>
15881
15882 * src/lalr.c (traverse): Use arrays instead of pointers.
15883
158842001-12-05 Akim Demaille <akim@epita.fr>
15885
15886 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
15887 the handling of squeue.
15888 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15889
158902001-12-05 Akim Demaille <akim@epita.fr>
15891
15892 Because useless nonterminals are now kept alive (instead of being
15893 `destroyed'), we now sometimes examine them, and store information
15894 related to them. Hence we need to know their number, and adjust
15895 memory allocations.
15896
15897 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
15898 static.
15899 * src/LR0.c (allocate_itemsets): The memory allocated to
15900 `symbol_count' was used for two different purpose: once to count
15901 the number of occurrences of each symbol, and later reassigned to
15902 `shift_symbol', containing the symbol that can be shifted from a
15903 given state.
15904 Deobfuscate, i.e., allocate, use and free `symbol_count' here
15905 only, and...
15906 (new_itemsets): Allocate `shift_symbol' here.
15907 (allocate_itemsets): symbol_count includes useless nonterminals.
15908 Make room for them.
15909 (free_storage): Use `free', not `XFREE', for pointers that cannot
15910 be null.
15911
159122001-12-05 Akim Demaille <akim@epita.fr>
15913
15914 * src/nullable.c (set_nullable): Deobfuscate the handling of
15915 ritem.
15916 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15917
159182001-12-05 Akim Demaille <akim@epita.fr>
15919
15920 * src/gram.c, src/gram.h (ritem_print): New.
15921 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
15922 (This useless function was defined only to work around VMS linkers
15923 that can't handle compilation units with variables only).
15924 * src/reduce.c (dump_grammar): Use it to trace the construction of
15925 ritem.
15926
159272001-12-04 Paul Eggert <eggert@twinsun.com>
15928
15929 * src/bison.simple (union yyalloc): Change member names
15930 to be the same as the stack names.
15931 (yyparse): yyptr is now union yyalloc *, not char *.
15932 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
15933 and may generate better code on some machines.
15934 (yystpcpy): Use prototype if __STDC__ is defined, not just
15935 if __cplusplus is defined.
15936
159372001-11-30 Akim Demaille <akim@epita.fr>
15938
15939 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
15940 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
15941 Gettext doesn't compile cleanly, and dies with -Werror.
15942 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
15943 Include WARNING_CFLAGS here.
15944 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
15945 before being defined.
15946
159472001-11-27 Paul Eggert <eggert@twinsun.com>
15948
15949 * lib/quotearg.h (quotearg_n, quotearg_n_style):
15950 First arg is int, not unsigned.
15951 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
15952 (SIZE_MAX, UINT_MAX): New macros.
15953 (quotearg_n_options): Abort if N is negative.
15954 Avoid overflow check on hosts where size_t is 64 bits and int
15955 is 32 bits, as overflow is impossible there.
15956 Fix off-by-one typo that caused unnecessary reallocation.
15957
159582001-11-29 Paul Eggert <eggert@twinsun.com>
15959
15960 Name space cleanup in generated parser.
15961
15962 * doc/bison.texinfo (Bison Parser): Discuss system headers
15963 and their effect on the user name space.
15964
15965 * src/bison.simple:
15966 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
15967 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
15968 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
15969
15970 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
15971 on user names when possible.
15972
15973 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
15974 Simplify test for whather <alloca.h> exists.
15975
15976 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
15977
15978 (<stdio.h>): Include if YYDEBUG.
15979
15980 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
15981 ! defined (yyoverflow) && ! defined (yymemcpy).
15982
15983 (yymemcpy, yyparse): Rename local variables as needed so that
15984 they all begin with 'yy'.
15985
15986 (yystrlen, yystpcpy): New functions.
15987
15988 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
15989 All uses changed.
15990
15991 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
15992 instead of relying on string.h functions. Use YYSTACK_ALLOC
15993 and YYSTACK_FREE instead of malloc and free.
15994
159952001-11-30 Akim Demaille <akim@epita.fr>
15996
15997 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
15998 before their first uses.
15999 (YYBISON, YYPURE): Move to the top of the output.
16000
160012001-11-30 Akim Demaille <akim@epita.fr>
16002
16003 * tests/reduce.at (Useless Nonterminals): Fix.
16004
160052001-11-30 Akim Demaille <akim@epita.fr>
16006
16007 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
16008 if body instead of `;' to pacify GCC's warnings.
16009
160102001-11-30 Akim Demaille <akim@epita.fr>
16011
16012 Instead of mapping the LHS of unused rules to -1, keep the LHS
16013 valid, but flag the rules as invalid.
16014
16015 * src/gram.h (rule_t): `useful' is a new member.
16016 * src/print.c (print_grammar): Adjust.
16017 * src/derives.c (set_derives): Likewise.
16018 * src/reader.c (packgram, reduce_output): Likewise.
16019 * src/reduce.c (reduce_grammar_tables): Likewise.
16020 * tests/reduce.at (Underivable Rules, Useless Rules): New.
16021
160222001-11-30 Akim Demaille <akim@epita.fr>
16023
16024 * src/reduce.c (reduce_output): Formatting changes.
16025 * src/print.c (print_results, print_grammar): Likewise.
16026 * tests/regression.at (Rule Line Numbers)
16027 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
16028
160292001-11-30 Akim Demaille <akim@epita.fr>
16030
16031 * src/reduce.c (nonterminals_reduce): Instead of throwing away
16032 useless nonterminals, move them at the end of the symbol arrays.
16033 (reduce_output): Adjust.
16034 * tests/reduce.at (Useless Nonterminals): Adjust.
16035
160362001-11-30 Akim Demaille <akim@epita.fr>
16037
16038 * src/reduce.c: Various comment/formatting changes.
16039 (nonterminals_reduce): New, extracted from...
16040 (reduce_grammar_tables): here.
16041 (reduce_grammar): Call nonterminals_reduce.
16042
160432001-11-29 Paul Eggert <eggert@twinsun.com>
16044
16045 * src/bison.simple (YYSTACK_REALLOC): Remove.
16046 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
16047 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
16048 New macros.
16049 (union yyalloc): New type.
16050 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
16051 an arbitrary restriction on hosts where size_t is wider than int.
16052
16053 (yyparse): Don't dump core if alloca or malloc fails; instead, report
16054 a parser stack overflow. Allocate just one block of memory for all
16055 three stacks, instead of allocating three blocks; this typically is
16056 faster and reduces fragmentation.
16057
16058 Do not limit the number of items in the stack to a value that fits
16059 in 'int', as this is an arbitrary limit on hosts with 64-bit
16060 size_t and 32-bit int.
16061
160622001-11-29 Marc Autret <autret_m@epita.fr>
16063
16064 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
16065 of defining YYERROR_VERBOSE.
16066 [AT_DATA]: $4 is now out of C declarations in the prologue.
16067
160682001-11-28 Marc Autret <autret_m@epita.fr>
16069
16070 * src/reader.c (parse_dquoted_param): New.
16071 (parse_skel_decl): Use it.
16072 * src/lex.h: Add its prototype.
16073 * src/lex.c (literalchar): Become not static.
16074
160752001-11-28 Marc Autret <autret_m@epita.fr>
16076
16077 * src/output.h: And put its extern declaration here.
16078 * src/output.c (error_verbose): Define here.
16079 (prepare): Echo name modification.
16080 * src/getargs.h: Clean its extern declaration.
16081 * src/getargs.c (error_verbose_flag): Remove.
16082 (getargs): Remove case 'e'.
16083 * src/options.c (option_table): 'error-verbose' is now seen as simple
16084 percent option.
16085 Include output.h.
16086
16087 * src/reader.c (read_declarations): Remove case tok_include.
16088 (parse_include_decl): Remove.
16089 * src/lex.h (token_t): Remove tok_include.
16090 * src/options.c (option_table): 'include' is now a simple command line
16091 option.
16092
160932001-11-28 Marc Autret <autret_m@epita.fr>
16094
16095 * src/bison.simple: Adjust muscle names.
16096 * src/muscle_tab.c (muscle_init): Also rename the muscles.
16097 * src/output.c (prepare): s/_/-/ for the muscles names.
16098 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
16099
161002001-11-28 Marc Autret <autret_m@epita.fr>
16101
16102 * src/bison.simple: Fix debug.
16103 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
16104
161052001-11-28 Akim Demaille <akim@epita.fr>
16106
16107 * src/LR0.c (shifts_new): New.
16108 (save_shifts, insert_start_shift, augment_automaton): Use it.
16109
161102001-11-28 Akim Demaille <akim@epita.fr>
16111
16112 * src/closure.c (closure): `b' and `ruleno' denote the same value:
16113 keep ruleno only.
16114
161152001-11-28 Akim Demaille <akim@epita.fr>
16116
16117 * src/closure.c (closure): Instead of looping over word in array
16118 then bits in words, loop over bits in array.
16119
161202001-11-28 Akim Demaille <akim@epita.fr>
16121
16122 * src/closure.c (closure): No longer optimize the special case
16123 where all the bits of `ruleset[r]' are set to 0, to make the code
16124 clearer.
16125
161262001-11-28 Akim Demaille <akim@epita.fr>
16127
16128 * src/closure.c (closure): `r' and `c' are new variables, used to
16129 de-obfuscate accesses to RULESET and CORE.
16130
161312001-11-28 Akim Demaille <akim@epita.fr>
16132
16133 * src/reduce.c (reduce_print): Use ngettext.
16134 (dump_grammar): Improve the trace accuracy.
16135
161362001-11-28 Akim Demaille <akim@epita.fr>
16137
16138 * src/reduce.c (dump_grammar): Don't translate trace messages.
16139
161402001-11-28 Akim Demaille <akim@epita.fr>
16141
16142 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
16143 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
16144 as all tags are free'ed afterwards.
16145 From Enrico Scholz.
16146
161472001-11-27 Paul Eggert <eggert@twinsun.com>
16148
16149 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
16150 use alloca when we didn't want to, and vice versa.
16151
161522001-11-27 Marc Autret <autret_m@epita.fr>
16153
16154 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
16155 initialization.
16156 * src/output.c (prepare): Remove its update.
16157
161582001-11-27 Marc Autret <autret_m@epita.fr>
16159
16160 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
16161 Use %error-verbose.
16162
161632001-11-27 Marc Autret <autret_m@epita.fr>
16164
16165 * src/bison.simple: Remove YYERROR_VERBOSE using.
16166 Use %%error_verbose.
16167 (yyparse): Likewise.
16168 * src/output.c (prepare): Give its final value.
16169 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
16170 * src/getargs.h: Add its extern declaration.
16171 * src/getargs.c (error_verbose_flag): New int.
16172 (getargs): Update to catch new case.
16173 * src/options.c (option_table): 'error-verbose' is a new option.
16174 (shortopts): Update.
16175
161762001-11-27 Akim Demaille <akim@epita.fr>
16177
16178 * src/system.h: Use intl/libgettext.h.
16179 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
16180
161812001-11-27 Akim Demaille <akim@epita.fr>
16182
16183 * tests/torture.at (Exploding the Stack Size with Malloc):
16184 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
16185
161862001-11-27 Akim Demaille <akim@epita.fr>
16187
16188 * src/files.c: Include error.h.
16189 Reported by Hans Aberg.
16190
161912001-11-26 Marc Autret <autret_m@epita.fr>
16192
16193 * src/reader.c (parse_include_decl): New, not yet implemented.
16194 (read_declarations): Add case tok_include.
16195 * src/getargs.h (include): Add its extern definition.
16196 * src/getargs.c (include): New const char *.
16197 (getargs): Add case '-I'.
16198 * src/options.c (option_table): Add include as command line and
16199 percent option.
16200 * src/lex.h (token_t): Add tok_include.
16201
162022001-11-26 Akim Demaille <akim@epita.fr>
16203
16204 * src/reader.c (readgram): Make sure rules for mid-rule actions
16205 have a lineno equal to that of their host rule.
16206 Reported by Hans Aberg.
16207 * tests/regression.at (Rule Line Numbers): New.
16208
162092001-11-26 Akim Demaille <akim@epita.fr>
16210
16211 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
16212 size_ts.
16213
162142001-11-26 Akim Demaille <akim@epita.fr>
16215
16216 * src/complain.c, src/complain.h (error): Remove, provided by
16217 lib/error.[ch].
16218
162192001-11-26 Akim Demaille <akim@epita.fr>
16220
16221 * src/reader.c (read_declarations): Don't abort on tok_illegal,
16222 issue an error message.
16223 * tests/regression.at (Invalid %directive): New.
16224 Reported by Hans Aberg.
16225
162262001-11-26 Akim Demaille <akim@epita.fr>
16227
16228 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
16229 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16230
162312001-11-26 Akim Demaille <akim@epita.fr>
16232
16233 * src/conflicts.c (conflicts_print): Don't complain at all when
16234 there are no reduce/reduce conflicts, and as many shift/reduce
16235 conflicts as expected.
16236 * tests/regression.at (%expect right): Adjust.
16237
162382001-11-23 Akim Demaille <akim@epita.fr>
16239
16240 * lib/alloca.c: Update, from fileutils.
16241
162422001-11-23 Akim Demaille <akim@epita.fr>
16243
16244 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
16245
162462001-11-23 Akim Demaille <akim@epita.fr>
16247
16248 * src/system.h: Include alloca.h.
16249 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
16250
162512001-11-23 Akim Demaille <akim@epita.fr>
16252
16253 * src/print_graph.c (print_actions): Remove `rule', unused.
16254 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
16255 pacify GCC's signed < unsigned warnings.
16256 * src/closure.c (itemsetsize): Likewise.
16257 * src/reader.c (symbol_list_new): Static.
16258
162592001-11-23 Akim Demaille <akim@epita.fr>
16260
16261 Attaching lineno to buckets is stupid, since only one copy of each
16262 symbol is kept, only the line of the first occurrence is kept too.
16263
16264 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
16265 * src/reader.c (rline_allocated): Remove, unused.
16266 (symbol_list): Have a `line' member.
16267 (symbol_list_new): New.
16268 (readgram): Use it.
16269 * src/print.c (print_grammar): Output the rule line numbers.
16270 * tests/regression.at (Solved SR Conflicts)
16271 (Unresolved SR Conflicts): Adjust.
16272 Reported by Hans Aberg.
16273
162742001-11-22 Marc Autret <autret_m@epita.fr>
16275
16276 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
16277
162782001-11-22 Marc Autret <autret_m@epita.fr>
16279
16280 * src/muscle_tab.c (muscle_init): Remove initialization of
16281 skeleton muscle.
16282 * src/output.c (output_master_parser): Do it here.
16283
162842001-11-20 Akim Demaille <akim@epita.fr>
16285
16286 * po/sv.po: New.
16287 * configure.in (ALL_LINGUAS): Adjust.
16288 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
16289 longer contains strings to translate.
16290
162912001-11-19 Akim Demaille <akim@epita.fr>
16292
16293 * src/conflicts.c (conflicts_print): Add a missing \n.
16294
162952001-11-19 Akim Demaille <akim@epita.fr>
16296
16297 * src/nullable.c (nullable_print): New.
16298 (set_nullable): Call it when tracing.
16299 Better locality of variables.
16300
163012001-11-19 Akim Demaille <akim@epita.fr>
16302
16303 * src/print.c (print_actions): Better locality of variables.
16304
163052001-11-19 Akim Demaille <akim@epita.fr>
16306
16307 * src/derives.c (print_derives): Fix and enrich.
16308 * src/closure.c (print_fderives): Likewise.
16309
163102001-11-19 Akim Demaille <akim@epita.fr>
16311
16312 * src/closure.c (itemsetend): Remove, replaced with...
16313 (itemsetsize): new.
16314
163152001-11-19 Akim Demaille <akim@epita.fr>
16316
16317 * src/LR0.c (kernel_end): Remove, replaced with...
16318 (kernel_size): new.
16319
163202001-11-19 Akim Demaille <akim@epita.fr>
16321
16322 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
16323 to clarify.
16324
163252001-11-19 Akim Demaille <akim@epita.fr>
16326
16327 * src/closure.c (closure): Use arrays instead of pointers to clarify.
16328
163292001-11-19 Akim Demaille <akim@epita.fr>
16330
16331 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
16332 trace messages.
16333 * src/LR0.c: Likewise.
16334 (allocate_itemsets): Use arrays instead of pointers to clarify.
16335
163362001-11-19 Akim Demaille <akim@epita.fr>
16337
16338 * src/getargs.c (statistics_flag): Replace with...
16339 (trace_flag): New.
16340 (longopts): Accept --trace instead of --statistics.
16341 * src/getargs.h, src/options.c: Adjust.
16342 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
16343 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
16344
163452001-11-19 Akim Demaille <akim@epita.fr>
16346
16347 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
16348 pointers to clarify the code.
16349 (save_reductions, save_shifts): Factor common parts of alternatives.
16350
163512001-11-19 Akim Demaille <akim@epita.fr>
16352
16353 * src/LR0.c (new_state, get_state): Complete TRACE code.
16354 * src/closure.c: Include `reader.h' to get `tags', needed by the
16355 trace code.
16356 Rename the conditional DEBUG as TRACE.
16357 Output consistently TRACEs to stderr, not stdout.
16358 * src/derives.c: Likewise.
16359 * src/reduce.c: (inaccessable_symbols): Using if is better style
16360 than goto.
16361 Use `#if TRACE' instead of `#if 0' for tracing code.
16362
163632001-11-19 Akim Demaille <akim@epita.fr>
16364
16365 * src/system.h (LIST_FREE, shortcpy): New.
16366 * src/LR0.c: Use them.
16367 * src/output.c (free_itemsets, free_reductions, free_shifts):
16368 Remove, replaced by LIST_FREE.
16369
163702001-11-19 Akim Demaille <akim@epita.fr>
16371
16372 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
16373 (REDUCTIONS_ALLOC): New.
16374 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
16375 allocation.
16376
163772001-11-19 Akim Demaille <akim@epita.fr>
16378
16379 * src/LR0.c (new_state): Complete trace code.
16380 * src/nullable.c (set_nullable): Don't translate traces.
16381
163822001-11-19 Akim Demaille <akim@epita.fr>
16383
16384 * src/print_graph.c (print_core): Better locality of variables.
16385 * src/print.c (print_core): Likewise.
16386
163872001-11-19 Akim Demaille <akim@epita.fr>
16388
16389 * src/vcg.c: You do the output, so you are responsible of the
16390 handling of VCG syntax, in particular: use quotearg.
16391 * src/print_graph.c: Don't.
16392 (print_actions): Don't output the actions as part of the nodes,
16393 since that's the job of the edges.
16394 (print_state): Don't output by hand: fill the node description,
16395 and ask for its output.
16396
163972001-11-19 Akim Demaille <akim@epita.fr>
16398
16399 * src/bison.simple (yyparse): When verbosely reporting an error,
16400 no longer put additional quotes around token names.
16401 * tests/calc.at: Adjust.
16402
164032001-11-19 Akim Demaille <akim@epita.fr>
16404
16405 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
16406 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
16407 * src/output.c: Adjust.
16408
164092001-11-19 Akim Demaille <akim@epita.fr>
16410
16411 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
16412 (rule_t): this.
16413 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
16414
164152001-11-19 Akim Demaille <akim@epita.fr>
16416
16417 * src/gram.h (rule_t): New.
16418 (rule_table): New.
16419 (rrhs, rlhs): Remove, part of state_t.
16420 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
16421 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16422 * src/reader.c, src/reduce.c: Adjust.
16423
164242001-11-19 Akim Demaille <akim@epita.fr>
16425
16426 * src/reader.c (symbols_output): New, extracted from...
16427 (packsymbols): Here.
16428 (reader): Call it.
16429
164302001-11-19 Akim Demaille <akim@epita.fr>
16431
16432 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
16433 (maxrhs): this new function.
16434
164352001-11-19 Akim Demaille <akim@epita.fr>
16436
16437 * src/lalr.c (F): New macro to access the variable F.
16438 Adjust.
16439
164402001-11-19 Akim Demaille <akim@epita.fr>
16441
16442 * src/lalr.h (LA): New macro to access the variable LA.
16443 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16444 * src/lalr.c: Adjust.
16445
164462001-11-19 Akim Demaille <akim@epita.fr>
16447
16448 * src/lalr.c (initialize_LA): Only initialize LA. Let...
16449 (set_state_table): handle the `lookaheads' members.
16450
164512001-11-19 Akim Demaille <akim@epita.fr>
16452
16453 * src/lalr.h (lookaheads): Removed array, whose contents is now
16454 a member of...
16455 (state_t): this structure.
16456 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16457 Adjust.
16458
164592001-11-19 Akim Demaille <akim@epita.fr>
16460
16461 * src/lalr.h (consistent): Removed array, whose contents is now
16462 a member of...
16463 (state_t): this structure.
16464 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16465 Adjust.
16466
164672001-11-19 Akim Demaille <akim@epita.fr>
16468
16469 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
16470 contents are now members of...
16471 (state_t): this structure.
16472 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16473 Adjust.
16474
164752001-11-19 Akim Demaille <akim@epita.fr>
16476
16477 * src/lalr.h (state_t): New.
16478 (state_table): Be a state_t * instead of a core **.
16479 (accessing_symbol): Remove, part of state_t.
16480 * src/lalr.c: Adjust.
16481 (set_accessing_symbol): Merge into...
16482 (set_state_table): this.
16483 * src/print_graph.c, src/conflicts.c: Adjust.
16484
164852001-11-14 Akim Demaille <akim@epita.fr>
16486
16487 * tests/calc.at, tests/output.at, tests/regression.at,
16488 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
16489 now the tests are run in private dirs, therefore AC_CLEANUP and
16490 family can be simplified to 0-ary.
16491 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
16492 use abs. path to find config.h.
16493 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
16494 stderr, there can be way too much random noise.
16495 Instead pass -Werror to GCC and rely on the exit status.
16496 Reported by Wolfram Wagner.
16497
164982001-11-14 Akim Demaille <akim@epita.fr>
16499
16500 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
16501 defined only if yyoverflow is defined, to avoid `warning: unused
16502 variable `yyvs1''.
16503 Reported by The Test Suite.
16504
165052001-11-14 Akim Demaille <akim@epita.fr>
16506
16507 * src/print.c: Include reduce.h.
16508 Reported by Hans Aberg.
16509
165102001-11-14 Akim Demaille <akim@epita.fr>
16511
16512 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
16513 Revert a previous patch: these are really const.
16514 * src/conflicts.c (conflict_report): Additional useless pair of
16515 braces to pacify GCC's warnings for `if () if () {} else {}'.
16516 * src/lex.c (parse_percent_token): Replace equal_offset with
16517 arg_offset.
16518 arg is const.
16519 Be sure to strdup `arg' when used, since there is no reason for
16520 token_buffer not to change.
16521
165222001-11-14 Akim Demaille <akim@epita.fr>
16523
16524 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
16525 definition.
16526 * src/main.c (main): Use them.
16527 Suggested by Hans Aberg.
16528
165292001-11-12 Akim Demaille <akim@epita.fr>
16530
16531 * src/system.h (ngettext): Now that we use ngettext, be sure to
16532 provide a default definition when NLS are not used.
16533
165342001-11-12 Akim Demaille <akim@epita.fr>
16535
16536 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
16537 Use @kbd to denote user input.
16538 (Language and Grammar): ANSIfy the example.
16539 Adjust its layout for info/notinfo.
16540 (Location Tracking Calc): Output error messages to stderr.
16541 Output locations in a more GNUtically correct way.
16542 Fix a couple of Englishos.
16543 Adjust @group/@end group pairs.
16544
165452001-11-12 Akim Demaille <akim@epita.fr>
16546
16547 %expect was not functioning at all.
16548
16549 * src/conflicts.c (expected_conflicts): Set to -1.
16550 (conflict_report): Use ngettext.
16551 (conflicts_print): Check %expect and make its violation an error.
16552 * doc/bison.texinfo (Expect Decl): Adjust.
16553 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
16554 * tests/regression.at (%expect not enough, %expect right)
16555 (%expect too much): New.
16556
165572001-11-12 Akim Demaille <akim@epita.fr>
16558
16559 * tests/regression.at (Conflicts): Rename as...
16560 (Unresolved SR Conflicts): this.
16561 (Solved SR Conflicts): New.
16562
165632001-11-12 Akim Demaille <akim@epita.fr>
16564
16565 * src/reduce.c (print_results): Rename as...
16566 (reduce_output): This.
16567 Output to OUT, passed as argument, instead of output_obstack.
16568 (dump_grammar): Likewise.
16569 (reduce_free): New.
16570 Also free V1.
16571 (reduce_grammar): No longer call reduce_output, since...
16572 * src/print.c (print_results): do it.
16573 * src/main.c (main): Call reduce_free;
16574
165752001-11-12 Akim Demaille <akim@epita.fr>
16576
16577 * src/conflicts.c (print_reductions): Accept OUT as argument.
16578 Output to it, not to output_obstack.
16579 * src/print.c (print_actions): Adjust.
16580
165812001-11-12 Akim Demaille <akim@epita.fr>
16582
16583 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
16584 the result instead of using...
16585 (src_total, rrc_total, src_count, rrc_count): Remove.
16586 (any_conflicts): Remove.
16587 (print_conflicts): Split into...
16588 (conflicts_print, conflicts_output): New.
16589 * src/conflicts.h: Adjust.
16590 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
16591 * src/print.c (print_grammar): Issue `\n' between two rules.
16592 * tests/regression.at (Conflicts): New.
16593 Reported by Tom Lane.
16594
165952001-11-12 Akim Demaille <akim@epita.fr>
16596
16597 * tests/regression.at (Invalid input): Remove, duplicate with
16598 ``Invalid input: 1''.
16599
166002001-11-12 Akim Demaille <akim@epita.fr>
16601
16602 * tests/torture.at (AT_DATA_STACK_TORTURE)
16603 (Exploding the Stack Size with Alloca)
16604 (Exploding the Stack Size with Malloc): New.
16605
166062001-11-12 Akim Demaille <akim@epita.fr>
16607
16608 * src/bison.simple (YYSTACK_REALLOC): New.
16609 (yyparse) [!yyoverflow]: Use it and free the old stack.
16610 Reported by Per Allansson.
16611
166122001-11-12 Pascal Bart <pascal.bart@epita.fr>
16613
16614 * src/bison.simple: Define type yystype instead of YYSTYPE, and
16615 define CPP macro, which substitute YYSTYPE by yystype.
16616 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
16617 with yyltype/YYLTYPE. This allows inclusion of the generated
16618 header within the parser if the compiler, such as GGC, accepts
16619 multiple equivalent #defines.
16620 From Akim.
16621
166222001-11-05 Akim Demaille <akim@epita.fr>
16623
16624 * src/reader.c (symbols_output): New, extracted from...
16625 (packsymbols): here.
16626 (reader): Adjust.
16627
166282001-11-05 Akim Demaille <akim@epita.fr>
16629
16630 * src/lex.c (parse_percent_token): s/quotearg/quote/.
16631
166322001-11-05 Akim Demaille <akim@epita.fr>
16633
16634 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
16635 pattern.
16636
166372001-11-05 Akim Demaille <akim@epita.fr>
16638
16639 * src/options.h (struct option_table_struct): set_flags is void*.
16640 * src/options.c (longopts): Support `--output' and `%output'.
16641 (usage): Adjust.
16642 * src/lex.h (tok_setopt): Remove, replaced with...
16643 (tok_intopt, tok_stropt): these new guys.
16644 * src/lex.c (getopt.h): Not needed.
16645 (token_buffer, unlexed_token_buffer): Not const.
16646 (percent_table): Promote `-' over `_' in directive names.
16647 Active `%name-prefix', `file-prefix', and `output'.
16648 (parse_percent_token): Accept possible arguments to directives.
16649 Promote `-' over `_' in directive names.
16650
166512001-11-04 Akim Demaille <akim@epita.fr>
16652
16653 * doc/bison.texinfo (Decl Summary): Split the list into
16654 `directives for grammars' and `directives for bison'.
16655 Sort'em.
16656 Add description of `%name-prefix', `file-prefix', and `output'.
16657 Promote `-' over `_' in directive names.
16658 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
16659 Simplify the description of `--name-prefix'.
16660 Promote `-' over `_' in directive names.
16661 Promote `--output' over `--output-file'.
16662 Fix the description of `--defines'.
16663 * tests/output.at: Exercise %file-prefix and %output.
16664
166652001-11-02 Akim Demaille <akim@epita.fr>
16666
16667 * doc/refcard.tex: Update.
16668
166692001-11-02 Akim Demaille <akim@epita.fr>
16670
16671 * src/symtab.h (SUNDEF): New.
16672 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
16673 stand for `uninitialized', instead of 0.
16674 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
16675 * src/lex.c (lex): Adjust.
16676
16677 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
16678 Number it 0.
16679 Let yylex return it instead of a plain 0.
16680 Reported by Dick Streefland.
16681
166822001-11-02 Akim Demaille <akim@epita.fr>
16683
16684 * tests/regression.at (Mixing %token styles): New test.
16685
166862001-11-02 Akim Demaille <akim@epita.fr>
16687
16688 * src/reader.c (parse_thong_decl): Formatting changes.
16689 (token_translations_init): New, extracted from...
16690 (packsymbols): Here.
16691 Adjust.
16692
166932001-11-01 Akim Demaille <akim@epita.fr>
16694
16695 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
16696 Check that `9foo.y' produces correct cpp guards.
16697 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
16698 guards.
16699 Reported by Wwp.
16700
167012001-11-01 Akim Demaille <akim@epita.fr>
16702
16703 * tests/regression.at (Invalid input: 2): New.
16704 * src/lex.c (unlexed_token_buffer): New.
16705 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
16706 too.
16707 Reported by Wwp.
16708
167092001-11-01 Akim Demaille <akim@epita.fr>
16710
16711 * tests/calc.at: Catch up with 1.30.
16712 * configure.in: Bump to 1.49a.
16713 Adjust to newer Autotest.
16714
167152001-10-19 Pascal Bart <pascal.bart@epita.fr>
16716
16717 * src/conflicts.c: Move global variables rrc_total and src_total ...
16718 (print_conflicts): here.
16719 * src/output.c (output): Free global variable user_toknums.
16720 * src/lex.c (token_obstack): Become static.
16721
167222001-10-18 Akim Demaille <akim@epita.fr>
16723
16724 * tests/atlocal.in (GCC): Add.
16725 * tests/calc.at: s/m4_match/m4_bmatch/.
16726 s/m4_patsubst/m4_bpatsubst/.
16727 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
16728 * configure.in: AC_SUBST(GCC).
16729
167302001-10-14 Marc Autret <autret_m@epita.fr>
16731
16732 * src/options.c (create_long_option_table): Fix.
16733
167342001-10-10 Akim Demaille <akim@epita.fr>
16735
16736 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
16737
167382001-10-04 Akim Demaille <akim@epita.fr>
16739
16740 * src/reader.c (parse_union_decl): Push the caracters in
16741 union_obstack, not attrs_obstack.
16742
167432001-10-04 Akim Demaille <akim@epita.fr>
16744
16745 Merge in the branch 1.29.
16746
16747 * src/reader.c (packsymbols): Use a temporary obstack for
16748 `%%tokendef', since output_stack is already used elsewhere.
16749
16750 2001-10-02 Akim Demaille <akim@epita.fr>
16751
16752 Bump 1.29d.
16753
16754 2001-10-02 Akim Demaille <akim@epita.fr>
16755
16756 Version 1.29c.
16757
16758 2001-10-02 Akim Demaille <akim@epita.fr>
16759
16760 * tests/regression.at (Invalid CPP headers): New.
16761 From Alexander Belopolsky.
16762 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
16763
16764 2001-10-02 Akim Demaille <akim@epita.fr>
16765
16766 * tests/regression.at (Invalid input): New.
16767 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
16768 Reported by Shura.
16769
16770 2001-10-02 Akim Demaille <akim@epita.fr>
16771
16772 * tests/calc.at: Now that --debug works, the tests must be adjusted.
16773
16774 2001-10-02 Akim Demaille <akim@epita.fr>
16775
16776 * src/output.c (output_parser): Assert `skeleton'.
16777 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
16778 systems.
16779 From Shura.
16780
16781 2001-10-01 Marc Autret <autret_m@epita.fr>
16782
16783 * src/lex.h: Echo modifications.
16784 * src/lex.c (unlex): Parameter is now token_t.
16785 From Hans Aberg.
16786
16787 2001-10-01 Marc Autret <autret_m@epita.fr>
16788
16789 * src/main.c: Include lex.h.
16790 From Hans Aberg.
16791
16792 2001-09-29 Akim Demaille <akim@epita.fr>
16793
16794 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
16795
16796 2001-09-28 Akim Demaille <akim@epita.fr>
16797
16798 * tests/testsuite.at: Update to newer Autotest.
16799 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
16800
16801 2001-09-27 Akim Demaille <akim@epita.fr>
16802
16803 Position independent wrapper.
16804
16805 * tests/bison: Remove.
16806 * tests/bison.in: New.
16807 * configure.in: Adjust.
16808
16809 2001-09-27 Paul Eggert <eggert@twinsun.com>
16810
16811 Port quotearg fixes from tar 1.13.24.
16812
16813 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
16814 tm to be declared.
16815 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
16816 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
16817
16818 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
16819 * m4/mbrtowc.m4: New file.
16820 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
16821 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
16822
16823 2001-09-27 Akim Demaille <akim@epita.fr>
16824
16825 Bump to 1.29c.
16826
16827 2001-09-27 Akim Demaille <akim@epita.fr>
16828
16829 Version 1.29b.
16830
16831 2001-09-25 Akim Demaille <akim@epita.fr>
16832
16833 * src/system.h: Include `xalloc.h'.
16834 Remove it from the C files.
16835 * src/files.c (output_files): Free the obstacks.
16836 * src/lex.c (init_lex): Rename as...
16837 (lex_init): this.
16838 (lex_free): New.
16839 * src/main.c (main): Use it.
16840
16841 2001-09-24 Marc Autret <autret_m@epita.fr>
16842
16843 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
16844 to output informations in fout (FILE*).
16845 (open_graph, close_graph): Likewise.
16846 (output_graph, output_edge, output_node): Likewise.
16847 * src/vcg.h: Update function prototypes.
16848 * src/print_graph.c (print_graph): Open output graph file.
16849 (print_actions): Adjust.
16850 * src/files.h: Remove extern declaration.
16851 * src/files.c: Remove graph_obstack declaration.
16852 (open_files): Remove graph_obstack initialization.
16853 (output_files): Remove graph_obstack saving.
16854
16855 2001-09-24 Marc Autret <autret_m@epita.fr>
16856
16857 * src/files.c (compute_output_file_names): Fix.
16858
16859 2001-09-24 Marc Autret <autret_m@epita.fr>,
16860 Akim Demaille <akim@epita.fr>
16861
16862 * src/reader.c (reader): Remove call to free_symtab ().
16863 * src/main.c (main): Call it here.
16864 Include symtab.h.
16865 * src/conflicts.c (initialize_conflicts): Rename as...
16866 (solve_conflicts): this.
16867 * src/print.c (print_core, print_actions, print_state)
16868 (print_grammar): Dump to a file instead a `output_obstack'.
16869 (print_results): Dump `output_obstack', and then proceed with the
16870 FILE *.
16871 * src/files.c (compute_output_file_names, close_files): New.
16872 (output_files): Adjust.
16873 * src/main.c (main): Adjust.
16874
16875 2001-09-23 Marc Autret <autret_m@epita.fr>
16876
16877 * src/files.c (compute_header_macro): Computes header macro name
16878 from spec_defines_file when given.
16879
16880 2001-09-23 Marc Autret <autret_m@epita.fr>
16881
16882 * src/files.c (output_files): Add default extensions.
16883
16884 2001-09-22 Akim Demaille <akim@epita.fr>
16885
16886 * src/conflicts.c (finalize_conflicts): Rename as...
16887 (free_conflicts): this.
16888
16889 2001-09-22 Akim Demaille <akim@epita.fr>
16890
16891 * src/gram.c (gram_free): Rename back as...
16892 (dummy): this.
16893 (output_token_translations): Free `token_translations'.
16894 * src/symtab.c (free_symtab): Free the tag field.
16895
16896 2001-09-22 Akim Demaille <akim@epita.fr>
16897
16898 Remove `translations' as it is always set to true.
16899
16900 * src/gram.h: Adjust.
16901 * src/reader.c (packsymbols, parse_token_decl): Adjust
16902 * src/print.c (print_grammar): Adjust.
16903 * src/output.c (output_token_translations): Adjust.
16904 * src/lex.c (lex): Adjust.
16905 * src/gram.c: Be sure the set pointers to NULL.
16906 (dummy): Rename as...
16907 (gram_free): this.
16908
16909 2001-09-22 Akim Demaille <akim@epita.fr>
16910
16911 * configure.in: Invoke AM_LIB_DMALLOC.
16912 * src/system.h: Use dmalloc.
16913 * src/LR0.c: Be sure to have pointers initialized to NULL.
16914 (allocate_itemsets): Allocate kernel_items only if needed.
16915
16916 2001-09-22 Akim Demaille <akim@epita.fr>
16917
16918 * configure.in: Bump to 1.29b.
16919 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
16920 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
16921 need xmalloc.c in calc.y.
16922 From Pascal Bart.
16923
16924 2001-09-21 Akim Demaille <akim@epita.fr>
16925
16926 Version 1.29a.
16927 * Makefile.maint, config/config.guess, config/config.sub,
16928 * config/missing: Update from masters.
16929 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
16930 upon package.m4.
16931 * configure.in (ALL_LINGUAS): Add `tr'.
16932
16933 2001-09-21 Akim Demaille <akim@epita.fr>
16934
16935 * tests/Makefile.am (package.m4): Move to...
16936 ($(srcdir)/$(TESTSUITE)): here.
16937
16938 2001-09-20 Akim Demaille <akim@epita.fr>
16939
16940 * src/complain.c: No longer try to be standalone: use system.h.
16941 Don't assume __STDC__ is defined to 1. Just test if it is defined.
16942 * src/complain.h: Likewise.
16943 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
16944 Remove the unused variable `n'.
16945 From Albert Chin-A-Young.
16946
16947 2001-09-18 Marc Autret <autret_m@epita.fr>
16948
16949 * doc/bison.1: Update.
16950 * doc/bison.texinfo (Bison Options): Update --defines and --graph
16951 descriptions.
16952 (Option Cross Key): Update.
16953 Add --graph.
16954
16955 2001-09-18 Marc Autret <autret_m@epita.fr>
16956
16957 * tests/regression.at: New test (comment in %union).
16958
16959 2001-09-18 Marc Autret <autret_m@epita.fr>
16960
16961 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
16962 do that.
16963 Reported by Keith Browne.
16964
16965 2001-09-18 Marc Autret <autret_m@epita.fr>
16966
16967 * tests/output.at: Add tests for --defines and --graph.
16968
16969 2001-09-18 Marc Autret <autret_m@epita.fr>
16970
16971 * tests/output.at: Removes tests of %{header,src}_extension features.
16972
16973 2001-09-18 Akim Demaille <akim@epita.fr>
16974
16975 * tests/Makefile.am (package.m4): New.
16976 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
16977 (_AT_CHECK_CALC_ERROR): Likewise.
16978 Factor the `, ' part of verbose error messages.
16979
16980 2001-09-18 Marc Autret <autret_m@epita.fr>
16981
16982 * src/getargs.c (longopts): Declare --defines and --graph as options
16983 with optional arguments.
16984 * src/files.h: Add extern declarations.
16985 * src/files.c (spec_graph_file, spec_defines_file): New.
16986 (output_files): Update.
16987 Remove CPP-outed code.
16988
16989 2001-09-18 Marc Autret <autret_m@epita.fr>
16990
16991 Turn off %{source,header}_extension feature.
16992
16993 * src/files.c (compute_exts_from_gf): Update.
16994 (compute_exts_from_src): Update.
16995 (output_files): CPP-out useless code.
16996 * src/files.h: Remove {header,source}_extension extern declarations.
16997 * src/reader.c (parse_dquoted_param): CPP-out.
16998 (parse_header_extension_decl): Remove.
16999 (parse_source_extension_decl): Remove.
17000 (read_declarations): Remove cases tok_{hdrext,srcext}.
17001 * src/lex.c (percent_table): Remove {header,source}_extension entries.
17002 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
17003
17004 2001-09-10 Akim Demaille <akim@epita.fr>
17005
17006 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
17007 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
17008 (AT_CHECK_OUTPUT): this.
17009 Merely check ls' exit status, its output is useless.
17010
17011 2001-09-10 Akim Demaille <akim@epita.fr>
17012
17013 * tests/calc.at: Use m4_match.
17014 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
17015
17016 2001-09-10 Marc Autret <autret_m@epita.fr>,
17017 Akim Demaille <akim@epita.fr>
17018
17019 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
17020 enum color_e.
17021 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
17022 to `normal'.
17023 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
17024 * src/lex.h: Adjust prototype.
17025 (token_t): Add `tok_undef'.
17026 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
17027 (parse_percent_token): Now returns token_t.
17028 Add default statement in switch.
17029 (lex): Separate `c' as an input variable, from the token_t result
17030 part.
17031 (unlexed): Is a token_t.
17032
17033 2001-09-10 Akim Demaille <akim@epita.fr>
17034
17035 * configure.in: Bump to 1.29a.
17036
17037 2001-09-07 Akim Demaille <akim@epita.fr>
17038
17039 Version 1.29.
17040
17041 2001-08-30 Akim Demaille <akim@epita.fr>
17042
17043 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
17044 * m4/atconfig.m4: Remove.
17045 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
17046 * tests/bison: New.
17047 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
17048 m4_if, m4_patsubst, and m4_regexp.
17049 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
17050 `input' file instead of echo.
17051
17052 2001-08-29 Akim Demaille <akim@epita.fr>
17053
17054 Bump to 1.28e.
17055
17056 2001-08-29 Akim Demaille <akim@epita.fr>
17057
17058 Version 1.28d.
17059
17060 2001-08-29 Paul Eggert <eggert@twinsun.com>
17061
17062 * src/bison.simple (yyparse): Don't take the address of an
17063 item before the start of an array, as that doesn't conform to
17064 the C Standard.
17065
17066 2001-08-29 Robert Anisko <anisko_r@epita.fr>
17067
17068 * doc/bison.texinfo (Location Tracking Calc): New node.
17069
17070 2001-08-29 Paul Eggert <eggert@twinsun.com>
17071
17072 * src/output.c (output): Do not define const, as this now
17073 causes more problems than it cures.
17074
17075 2001-08-29 Akim Demaille <akim@epita.fr>
17076
17077 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
17078 the nodes.
17079 Be sure to tag the `detailmenu'.
17080
17081 2001-08-29 Akim Demaille <akim@epita.fr>
17082
17083 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
17084 download in a tmp dir.
17085
17086 2001-08-28 Marc Autret <autret_m@epita.fr>
17087
17088 * config/depcomp: New file.
17089
17090 2001-08-28 Marc Autret <autret_m@epita.fr>
17091
17092 * doc/bison.1 (mandoc): Adjust.
17093 From Juan Manuel Guerrero.
17094
17095 2001-08-28 Marc Autret <autret_m@epita.fr>
17096
17097 * src/print_graph.c (print_state): Fix.
17098
17099 2001-08-27 Marc Autret <autret_m@epita.fr>
17100
17101 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
17102 char * members.
17103 Echo modifications to the functions prototypes.
17104 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
17105
17106 2001-08-27 Marc Autret <autret_m@epita.fr>
17107
17108 * src/vcg.c: Include `xalloc.h'.
17109 (add_colorentry): New.
17110 (add_classname): New.
17111 (add_infoname): New.
17112 * src/vcg.h: Add new prototypes.
17113
17114 2001-08-27 Akim Demaille <akim@epita.fr>
17115
17116 * Makefile.maint: Sync. again with CVS Autoconf.
17117
17118 2001-08-27 Akim Demaille <akim@epita.fr>
17119
17120 * Makefile.maint: Formatting changes.
17121 (po-update, cvs-update, update): New targets.
17122 (AMTAR): Remove.
17123
17124 2001-08-27 Akim Demaille <akim@epita.fr>
17125
17126 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17127 * Makefile.maint: Sync. with CVS Autoconf.
17128
17129 2001-08-27 Marc Autret <autret_m@epita.fr>
17130
17131 * src/vcg.h (struct infoname_s): New.
17132 (struct colorentry_s): New.
17133 (graph_s): New fields {vertical,horizontal}_order in structure.
17134 Add `infoname' field.
17135 Add `colorentry' field;
17136 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
17137 (G_HORIZONTAL_ORDER): New.
17138 (G_INFONAME): New.
17139 (G_COLORENTRY): New.
17140 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
17141 Add output of `infoname'.
17142 Add output of `colorentry'.
17143
17144 2001-08-27 Marc Autret <autret_m@epita.fr>
17145
17146 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
17147 This one shadowed a global parameter.
17148
17149 2001-08-24 Marc Autret <autret_m@epita.fr>
17150
17151 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
17152 instead of `unsigned'.
17153 (print_state): Do not call obstack_object_size () in obstack_grow ()
17154 to avoid macro variables shadowing.
17155
17156 2001-08-23 Marc Autret <autret_m@epita.fr>
17157
17158 * src/lex.c (percent_table): Typo: s/naem/name/.
17159 Add graph option.
17160 Normalize new options declarations.
17161
17162 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
17163
17164 * tests/suite.at: Exercise %header_extension and %source_extension.
17165
17166 2001-08-16 Marc Autret <autret_m@epita.fr>
17167
17168 * src/reader.c (parse_dquoted_param): New.
17169 (parse_header_extension_decl): Use it.
17170 (parse_source_extension_decl): Likewise.
17171
17172 2001-08-16 Marc Autret <autret_m@epita.fr>
17173
17174 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
17175 (get_xxxx_str): Use assert () instead of complain ().
17176 Remove return invokations in default cases.
17177 (get_decision_str): Modify default behaviour. Remove second argument.
17178 Echo modifications on calls.
17179 (output_graph): Fix.
17180
17181 2001-08-16 Marc Autret <autret_m@epita.fr>
17182
17183 * src/getargs.c (usage): Update with ``-g, --graph''.
17184
17185 2001-08-16 Marc Autret <autret_m@epita.fr>
17186
17187 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
17188 (Option Cross Key): Likewise.
17189 * doc/bison.1: Update.
17190
171912001-09-25 Pascal Bart <pascal.bart@epita.fr>
17192
17193 * src/output.c (output_master_parser): Don't finish action_obstack.
17194 (output_parser): Don't care about the muscle action, here.
17195 (prepare): Copy the action_obstack in the action muscle.
17196 (output): Free action_obstack.
17197
171982001-09-23 Pascal Bart <pascal.bart@epita.fr>
17199
17200 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
17201 will contain `%union' declaration.
17202 (parse_union_decl): Delete #line directive output.
17203 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
17204 informations about %union.
17205 (parse_union_decl): Copy the union_obstack in the muscle stype.
17206 * src/bison.simple: Add new #line directive.
17207 Add typdef %%stype YYSTYPE.
17208
172092001-09-23 Pascal Bart <pascal.bart@epita.fr>
17210
17211 * src/bison.simple: Add new `#line' directive.
17212
172132001-09-22 Pascal Bart <pascal.bart@epita.fr>
17214
17215 * src/bison.simple: New `#line' directive.
17216 * src/output.c (output_parser): Support new dynamic muscle input_line.
17217
172182001-09-22 Marc Autret <autret_m@epita.fr>
17219
17220 * src/output.c (output_master_parser): New.
17221 (output_parser): Be more re-entrant.
17222
172232001-09-21 Marc Autret <autret_m@epita.fr>
17224
17225 * src/reader.c (copy_definition, parse_union_decl): Update and use
17226 `linef' muscle.
17227 (copy_action): Likewise.
17228 Use obstack_1grow ().
17229 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
17230
172312001-09-21 Marc Autret <autret_m@epita.fr>
17232
17233 * src/options.c (option_table): Adjust.
17234 * src/lex.c (parse_percent_token): Fix.
17235
172362001-09-20 Pascal Bart <pascal.bart@epita.fr>
17237
17238 * src/options.c (symtab.h): Include it, need by lex.h.
17239
172402001-09-20 Pascal Bart <pascal.bart@epita.fr>
17241
17242 * src/lex.c (parse_percent_token): Change type of variable `tx', which
17243 is now an option_table_struct*.
17244 (option_strcmp): New function option_strcmp.
17245 (parse_percent_token): Call option_strcmp.
17246 * src/getargs.c (xalloc.h, options.h): Include it.
17247 (getargs): Call create_long_option_table.
17248 (getargs): Free longopts at the end of the function.
17249 (shortopts): Move in options.c.
17250 * src/options.c (create_long_option_table): New function. Convert
17251 information from option_table to option structure.
17252 * src/reader.c (options.h): Include it.
17253
17254 * src/Makefile.am: Adjust.
17255 * src/options.c (option_table): Create from longopts and percent_table.
17256 * src/getargs.c (longopts): Delete.
17257 * src/lex.c (struct percent_table_struct): Delete.
17258 (percent_table): Delete.
17259 (options.h): Include it.
17260 * src/options.c: Create.
17261 * src/options.h: Create.
17262 Declare enum opt_access_e.
17263 Define struct option_table_struct.
17264
172652001-09-20 Marc Autret <autret_m@epita.fr>
17266
17267 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
17268 sections of Bison.
17269
172702001-09-19 Pascal Bart <pascal.bart@epita.fr>
17271
17272 * src/bison.simple: s/%%filename/%%skeleton.
17273 * src/muscle_tab.c (getargs.h): Include it.
17274 (muscle_init): Insert new muscle skeleton.
17275
172762001-09-18 Pascal Bart <pascal.bart@epita.fr>
17277
17278 * src/output.c (output_parser): Delete unused variable actions_dumped.
17279
172802001-09-07 Pascal Bart <pascal.bart@epita.fr>
17281
17282 * src/output.c (output): Delete call to reader_output_yylsp.
17283 * src/reader.c (reader): Likewise.
17284 * src/reader.h: Delete declaration of reader_output_yylsp.
17285
172862001-09-02 Marc Autret <autret_m@epita.fr>
17287
17288 * src/reader.c: Include muscle_tab.h.
17289 (parse_union_decl): Update.
17290 (parse_macro_decl): Rename parse_muscle_decl.
17291 Update to use renamed functions and variable.
17292 (read_declarations, copy_action, read_additionnal_code, : Updated
17293 with correct variables and functions names.
17294 (packsymbols, reader): Likewise.
17295
17296 * src/reader.h (muscle_obstack): Extern declaration update.
17297
17298 * src/output.c: Include muscle_tab.h
17299 In all functions using macro_insert, change by using muscle_insert ().
17300 (macro_obstack): Rename muscle_obstack.
17301 Echo modifications in the whole file.
17302 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
17303 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
17304 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
17305
17306 * src/muscle_tab.h: Update double inclusion macros.
17307 (macro_entry_s): Rename muscle_entry_s.
17308 Update prototypes.
17309
17310 * src/muscle_tab.c: Include muscle_tab.h.
17311 Rename macro_tabble to muscle_table.
17312 (mhash1, mhash2, mcmp): Use muscle_entry.
17313 (macro_init): Rename muscle_init. Update.
17314 (macro_insert): Rename muscle_insert. Update.
17315 (macro_find): Rename muscle_find. Update.
17316
17317 * src/main.c: Include muscle_tab.h.
17318 (main): Call muscle_init ().
17319 * src/Makefile.am (bison_SOURCES): Echo modifications.
17320
173212001-09-02 Marc Autret <autret_m@epita.fr>
17322
17323 Now the files macro_tab.[ch] are named muscle_tab.[ch].
17324
17325 * src/muscle_tab.c, src/muscle_tab.h: Add files.
17326
173272001-09-02 Marc Autret <autret_m@epita.fr>
17328
17329 * src/macrotab.c, src/macrotab.h: Remove.
17330
173312001-09-01 Pascal Bart <pascal.bart@epita.fr>
17332
17333 * src/reader.c (copy_guard): Use muscle to specify the `#line'
17334 filename.
17335
173362001-09-01 Marc Autret <autret_m@epita.fr>
17337
17338 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
17339 to an explicit value to activate the feature. We do it here.
17340
173412001-08-31 Pascal Bart <pascal.bart@epita.fr>
17342
17343 * src/output.c (prepare): Delete the `filename' muscule insertion.
17344 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
17345 (parse_union_decl): Likewise.
17346 * src/macrotab.c (macro_init): Initialize filename by infile.
17347
173482001-08-31 Marc Autret <autret_m@epita.fr>
17349
17350 * src/bison.simple (YYLSP_NEEDED): New definition.
17351 * src/output.c (prepare): Add macro insertion of `locations_flag'
17352
173532001-08-31 Pascal Bart <pascal.bart@epita.fr>
17354
17355 * src/output.c (prepare): Delete insertion of previous muscles,
17356 and insert the `prefix' muscles.
17357 * src/macrotab.c (macro_init): Likewise.
17358 (macro_init): Initialization prefix directive by `yy'.
17359 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17360 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
17361 yylval, yydebug, yyerror, yynerrs and yyparse.
17362 New directive `#define' to substitute yydebug, ... with option
17363 name_prefix.
17364
173652001-08-31 Pascal Bart <pascal.bart@epita.fr>
17366
17367 * src/main.c (main): Standardize.
17368 * src/output.c (output_table_data, output_parser): Likewise.
17369 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
17370
173712001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
17372
17373 * src/reader.c (read_additionnal_code): Rename %%user_code to
17374 %%epilogue.
17375 * src/output.c (output): Rename %%declarations to %%prologue.
17376 * src/bison.simple: Echo modifications.
17377
173782001-08-31 Marc Autret <autret_m@epita.fr>
17379
17380 * src/reader.c (readgram): CleanUp.
17381 (output_token_defines): Likewise.
17382 (packsymbols): Likewise.
17383 (reader): Likewise.
17384 * src/output.c (output): CPP-out useless code.
17385
173862001-08-31 Pascal Bart <pascal.bart@epita.fr>
17387
17388 * src/reader.c (reader): Delete obsolete call to function
17389 output_trailers and output_headers.
17390 * src/output.h: Remove obsolete functions prototypes of output_headers
17391 and output_trailers.
17392
173932001-08-30 Pascal Bart <pascal.bart@epita.fr>
17394
17395 * src/main.c: Include macrotab.h.
17396 * src/macrotab.h (macro_entry_s): Constify fields.
17397 Adjust functions prototypes.
17398 * src/macrotab.c (macro_insert): Constify key and value.
17399 (macro_find): Constify key.
17400 (macro_insert): Include 'xalloc.h'
17401 (macro_insert): Use XMALLOC.
17402 (macro_find): Constify return value.
17403 * src/output.c (output_table_data): Rename table to table_data.
17404 (output_parser): Constify macro_key, macro_value.
17405
174062001-08-30 Marc Autret <autret_m@epita.fr>
17407
17408 * src/reader.c (parse_skel_decl): New.
17409 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
17410 * src/lex.h (token_t): New token `tok_skel'.
17411 * src/lex.c (percent_table): Add skeleton option entry.
17412 Standardize.
17413
174142001-08-29 Marc Autret <autret_m@epita.fr>
17415
17416 * src/bison.simple: Add %%user_code directive at the end.
17417 * src/reader.c (read_additionnal_code): New.
17418 (reader): Use it.
17419 * src/output.c (output_program): Remove.
17420 (output): Update.
17421
174222001-08-28 Marc Autret <autret_m@epita.fr>
17423
17424 * src/output.c (output_actions): Clean up.
17425 (output_gram): CPP-out useless code.
17426 * src/reader.c (reader): Clean up, CPP-out useless code.
17427
174282001-08-28 Pascal Bart <pascal.bart@epita.fr>
17429
17430 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
17431 directive.
17432 * src/bison.simple: Add `%%definitions'.
17433
174342001-08-28 Marc Autret <autret_m@epita.fr>
17435
17436 * config/depcomp: New file.
17437
174382001-08-27 Paul Eggert <eggert@twinsun.com>
17439
17440 * src/bison.simple (yyparse): Don't take the address of an
17441 item before the start of an array, as that doesn't conform to
17442 the C Standard.
17443
174442001-08-27 Robert Anisko <robert.anisko@epita.fr>
17445
17446 * src/output.c (output): Remove the initialization of the macro
17447 obstack. It was done too late here.
17448
17449 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
17450 completely wrong.
17451 (reader): Initialize the macro obstack here, since we need it to grow
17452 '%define' directives.
17453
17454 * src/reader.h: Declare the macro obstack as extern.
17455
174562001-08-27 Robert Anisko <robert.anisko@epita.fr>
17457
17458 * src/output.c (output_parser): Fix. Store single '%' characters in
17459 the output obstack instead of throwing them away.
17460
174612001-08-27 Akim Demaille <akim@epita.fr>
17462
17463 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17464
174652001-08-25 Robert Anisko <robert.anisko@epita.fr>
17466
17467 * lib/Makefile.am: Adjust.
17468
174692001-08-25 Robert Anisko <robert.anisko@epita.fr>
17470
17471 * src/bison.simple: Update and add '%%' directives.
17472
174732001-08-25 Robert Anisko <robert.anisko@epita.fr>
17474
17475 * src/reader.c (reader): Remove calls to 'output_headers' and
17476 'output_trailers'. Remove some C output.
17477 (readgram): Disable a piece of code that was writing a default
17478 definition for 'YYSTYPE'.
17479 (reader_output_yylsp): Remove.
17480 (packsymbols): Output token defintions to a macro.
17481 (copy_definition): Disable C output.
17482
17483 * src/reader.c (parse_macro_decl): New function used to parse macro
17484 declarations.
17485 (copy_string2): Put the body of copy_string into this new function.
17486 Add a parameter to let the caller choose whether he wants to copy the
17487 string delimiters or not.
17488 (copy_string): Be a simple call to copy_string2 with the last argument
17489 bound to true.
17490 (read_declarations): Add case for macro definition.
17491 (copy_identifier): New.
17492 (parse_macro_decl): Read macro identifiers using copy_identifier
17493 rather than lex.
17494
174952001-08-25 Robert Anisko <robert.anisko@epita.fr>
17496
17497 * src/output.c (prepare): Add prefixed names.
17498 (output_parser): Output semantic actions.
17499 (output_parser): Fix bug on '%%line' directives.
17500
17501 * src/output.c (output_headers): Remove. The C code printed by this
17502 function should now be in the skeletons.
17503 (output_trailers): Remove.
17504 (output): Disable call to 'reader_output_yylsp'.
17505 (output_rule_data): Do not output tables to the table obstack.
17506
17507 * src/output.c: Remove some C dedicated output.
17508 Improve the use of macro and output obstacks.
17509 (output_defines): Remove.
17510
17511 * src/output.c (output_token_translations): Associate 'translate'
17512 table with a macro. No output to the table obstack.
17513 (output_gram): Same for 'rhs' and 'prhs'.
17514 (output_stos): Same for 'stos'.
17515 (output_rule_data): Same for 'r1' and 'r2'.
17516 (token_actions): Same for 'defact'.
17517 (goto_actions): Same for 'defgoto'.
17518 (output_base): Same for 'pact' and 'pgoto'.
17519 (output_table): Same for 'table'.
17520 (output_check): Same for 'check'.
17521
17522 * src/output.c (output_table_data): New function.
17523 (output_short_table): Remove.
17524 (output_short_or_char_table): Remove.
17525
17526 * src/output.c (output_parser): Replace most of the skeleton copy code
17527 with something new. Skeletons are now processed character by character
17528 rather than line by line, and Bison looks for '%%' macros. This is the
17529 first step in making Bison's output process (a lot) more flexible.
17530 (output_parser): Use the macro table.
17531
175322001-08-25 Robert Anisko <robert.anisko@epita.fr>
17533
17534 * src/main.c (main): Initialize the macro table.
17535
175362001-08-25 Robert Anisko <robert.anisko@epita.fr>
17537
17538 * src/lex.c (percent_table): Add tok_define.
17539 * src/lex.h: Add tok_define.
17540
175412001-08-25 Robert Anisko <robert.anisko@epita.fr>
17542
17543 * src/macrotab.c: New file.
17544 * src/macrotab.h: New file.
17545 * src/Makefile.am: Update.
17546
175472001-08-25 Robert Anisko <robert.anisko@epita.fr>
17548
17549 * lib/hash.c: New file.
17550 * lib/hash.h: New file.
17551 * lib/Makefile.am: Update.
17552
175532001-08-15 Akim Demaille <akim@epita.fr>
17554
17555 Version 1.28c.
17556
175572001-08-15 Marc Autret <autret_m@epita.fr>
17558
17559 * src/reader.c (readgram): Indent output macro YYSTYPE.
17560 (packsymbols): Likewise.
17561 (output_token_defines): Likewise.
17562 * src/files.c: Standardize.
17563 (compute_header_macro): New.
17564 (defines_obstack_save): New. Use compute_header_macro.
17565 (output_files): Update. Use defines_obstack_save.
17566
175672001-08-15 Akim Demaille <akim@epita.fr>
17568
17569 * doc/bison.texinfo (Table of Symbols): Document
17570 YYSTACK_USE_ALLOCA.
17571
175722001-08-15 Akim Demaille <akim@epita.fr>
17573
17574 * missing: Update from CVS Automake.
17575 * config/config.guess, config/config.sub, config/texinfo.tex:
17576 Update from gnu.org.
17577
175782001-08-15 Akim Demaille <akim@epita.fr>
17579
17580 * Makefile.maint: Sync with CVS Autoconf.
17581
175822001-08-14 Pascal Bart <pascal.bart@epita.fr>
17583
17584 * doc/bison.texinfo: Include GNU Free Documentation License from
17585 `fdl.texi'.
17586 * doc/fdl.texi: Add to package.
17587
175882001-08-14 Marc Autret <autret_m@epita.fr>
17589
17590 Turn on %{source,header}_extension features.
17591
17592 * src/lex.c (percent_table): Un-CPP out header_extension and
17593 source_extension.
17594 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
17595 (compute_exts_from_src): Remove conditions. It restores priorities
17596 between options.
17597
175982001-08-14 Marc Autret <autret_m@epita.fr>
17599
17600 * src/files.c (compute_base_names): Add extensions computing when
17601 `--file-prefix' used.
17602 Standardize function calls.
17603
176042001-08-13 Marc Autret <autret_m@epita.fr>
17605
17606 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
17607 defining it (defined but null disables alloca).
17608
176092001-08-13 Marc Autret <autret_m@epita.fr>
17610
17611 * src/bison.simple (_yy_memcpy): CPP reformat.
17612
176132001-08-13 Pascal Bart <pascal.bart@epita.fr>
17614
17615 * tests/atconfig.in (CPPFLAGS): Fix.
17616
176172001-08-10 Pascal Bart <pascal.bart@epita.fr>
17618
17619 * doc/bison.texinfo: Include GNU General Public License from
17620 `gpl.texi'.
17621 * doc/gpl.texi: Add to package.
17622
176232001-08-10 Marc Autret <autret_m@epita.fr>
17624
17625 * src/print_graph.h: Fix.
17626 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
17627
176282001-08-10 Akim Demaille <akim@epita.fr>
17629
17630 * src/system.h: Provide default declarations for stpcpy, strndup,
17631 and strnlen.
17632
176332001-08-10 Robert Anisko <anisko_r@epita.fr>
17634
17635 * doc/bison.texinfo (Locations): Update @$ stuff.
17636
176372001-08-09 Robert Anisko <anisko_r@epita.fr>
17638
17639 * src/bison.simple (YYLLOC_DEFAULT): Update.
17640 (yyparse): Adjust.
17641
176422001-08-08 Marc Autret <autret_m@epita.fr>
17643
17644 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
17645 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
17646 Reported by Fabrice Bauzac.
17647
176482001-08-08 Marc Autret <autret_m@epita.fr>
17649
17650 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
17651 * src/vcg.c (output_node): Fix.
17652 * src/vcg.h: Cleanup.
17653 * src/print_graph.c: Add comments.
17654 (node_output_size): New global variable. Simplify the formatting of
17655 the VCG graph output.
17656 (print_actions): Unused code is now used. It notifies the final state
17657 and no action states in the VCG graph. It also give the reduce actions.
17658 The `shift and goto' edges are red and the `go to state' edges are
17659 blue.
17660 Get the current node name and node_obstack by argument.
17661 (node_obstack): New variable.
17662 (print_state): Manage node_obstack.
17663 (print_core): Use node_obstack given by argument.
17664 A node is not only computed here but in print_actions also.
17665 (print_graph): CPP out useless code instead of commenting it.
17666
176672001-08-07 Pascal Bart <pascal.bart@epita.fr>
17668
17669 * tests/atconfig.in (CPPFLAGS): Fix.
17670
176712001-08-07 Akim Demaille <akim@epita.fr>
17672
17673 * src/print_graph.c (quote): New.
17674 (print_core): Use it.
17675
176762001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
17677
17678 * src/vcg.c (complain.h): Include it.
17679 Unepitaize `return' invocations.
17680 [NDEBUG] (main): Remove.
17681 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
17682 * src/files.c (open_files): Initialize graph_obstack.
17683 * src/print_graph.c (print_actions): CPP out useless code.
17684 (print_core): Don't output the last `\n' in labels.
17685 Use `quote'.
17686 * src/files.c (output_files): Output the VCG file.
17687 * src/main.c (main): Invoke print_graph ();
17688
176892001-08-06 Marc Autret <autret_m@epita.fr>
17690
17691 Automaton VCG graph output.
17692 Using option ``-g'' or long option ``--graph'', you can generate
17693 a gram_filename.vcg file containing a VCG description of the LALR (1)
17694 automaton of your grammar.
17695
17696 * src/main.c: Call to print_graph() function.
17697 * src/getargs.h: Update.
17698 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
17699 (graph_flag): New flag.
17700 (longopts): Update.
17701 (getargs): Add case `g'.
17702 * src/files.c (graph_obstack): New obstack struct.
17703 (open_files): Initialize new obstack.
17704 (output_files): Saves graph_obstack if required.
17705 * src/files.h (graph_obstack): New extern declaration.
17706 * src/Makefile.am: Add new source files.
17707
177082001-08-06 Marc Autret <autret_m@epita.fr>
17709
17710 * src/print_graph.c, src/print_graph.h (graph): New.
17711 * src/vcg.h: New file.
17712 * src/vcg.c: New file, VCG graph handling.
17713
177142001-08-06 Marc Autret <autret_m@epita.fr>
17715
17716 Add of %source_extension and %header_extension which specify
17717 the source or/and the header output file extension.
17718
17719 * src/files.c (compute_base_names): Remove initialisation of
17720 src_extension and header_extension.
17721 (compute_exts_from_gf): Update.
17722 (compute_exts_from_src): Update.
17723 (output_files): Update.
17724 * src/reader.c (parse_header_extension_decl): New.
17725 (parse_source_extension_decl): New.
17726 (read_declarations): New case statements for the new tokens.
17727 * src/lex.c (percent_table): Add entries for %source_extension
17728 and %header_extension.
17729 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
17730
177312001-08-06 Marc Autret <autret_m@epita.fr>
17732
17733 * configure.in: Bump to 1.28c.
17734 * doc/bison.texinfo: Texinfo thingies.
17735
177362001-08-04 Pascal Bart <pascal.bart@epita.fr>
17737
17738 * tests/atconfig.in (CPPFLAGS): Add.
17739 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
17740
177412001-08-03 Akim Demaille <akim@epita.fr>
17742
17743 Version 1.28b.
17744
177452001-08-03 Akim Demaille <akim@epita.fr>
17746
17747 * tests/Makefile.am (check-local): Ship testsuite.
17748 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
17749 Include `string.h'.
17750
177512001-08-03 Akim Demaille <akim@epita.fr>
17752
17753 * configure.in: Try using -Wformat when compiling.
17754
177552001-08-03 Akim Demaille <akim@epita.fr>
17756
17757 * configure.in: Bump to 1.28b.
17758
177592001-08-03 Akim Demaille <akim@epita.fr>
17760
17761 * src/complain.c: Adjust strerror_r portability issues.
17762
177632001-08-03 Akim Demaille <akim@epita.fr>
17764
17765 Version 1.28a.
17766
177672001-08-03 Akim Demaille <akim@epita.fr>
17768
17769 * src/getargs.c, src/getarg.h (skeleton)): Constify.
17770 * src/lex.c (literalchar): Avoid name clashes on `buf'.
17771 * src/getargs.c: Include complain.h.
17772 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
17773 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
17774
177752001-08-03 Akim Demaille <akim@epita.fr>
17776
17777 * src/reader.c (readgram): Display hidden chars in error messages.
17778
177792001-08-03 Akim Demaille <akim@epita.fr>
17780
17781 Update to gettext 0.10.39.
17782
177832001-08-03 Akim Demaille <akim@epita.fr>
17784
17785 * lib/strspn.c: New.
17786
177872001-08-01 Marc Autret <autret_m@epita.fr>
17788
17789 * doc/bison.texinfo: Update.
17790 * doc/bison.1 (mandoc): Update.
17791 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
17792 * src/files.c: Support output files extensions computing.
17793 (src_extension): New static variable.
17794 (header_extension): New static variable.
17795 (tr): New function.
17796 (get_extension_index): New function, gets the index of an extension
17797 filename in a string.
17798 (compute_exts_from_gf): New function, computes extensions from the
17799 grammar file extension.
17800 (compute_exts_from_src): New functions, computes extensions from the
17801 C source file extension, file given by ``-o'' option.
17802 (compute_base_names): Update.
17803 (output_files): Update.
17804
178052001-08-01 Robert Anisko <anisko_r@epita.fr>
17806
17807 * doc/bison.texi: Document @$.
17808 (Locations): New section.
17809
178102001-07-18 Akim Demaille <akim@epita.fr>
17811
17812 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
17813 * config/prev-version.txt, config/move-if-change: New.
17814 * Makefile.am: Adjust.
17815
178162001-07-08 Pascal Bart <pascal.bart@epita.fr>
17817
17818 * src/bison.simple (yyparse): Suppress warning `comparaison
17819 between signed and unsigned'.
17820
178212001-07-05 Pascal Bart <pascal.bart@epita.fr>
17822
17823 * src/getargs.h (raw_flag): Remove.
17824 * src/getargs.c: Die on `-r'/`--raw'.
17825 * src/lex.c (parse_percent_token): Die on `%raw'.
17826 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
17827 * tests/calc.at: Suppress test with option `--raw'.
17828
178292001-07-14 Akim Demaille <akim@epita.fr>
17830
17831 * config/: New.
17832 * configure.in: Require Autoconf 2.50.
17833 Update to gettext 0.10.38.
17834
178352001-03-16 Akim Demaille <akim@epita.fr>
17836
17837 * doc/bison.texinfo: ANSIfy the examples.
17838
178392001-03-16 Akim Demaille <akim@epita.fr>
17840
17841 * getargs.c (skeleton): New variable.
17842 (longopts): --skeleton is a new option.
17843 (shortopts, getargs): -S is a new option.
17844 * getargs.h: Declare skeleton.
17845 * output.c (output_parser): Use it.
17846
178472001-03-16 Akim Demaille <akim@epita.fr>
17848
17849 * m4/strerror_r.m4: New.
17850 * m4/error.m4: Run AC_FUNC_STRERROR_R.
17851 * lib/error.h, lib/error.c: Update.
17852
178532001-03-16 Akim Demaille <akim@epita.fr>
17854
17855 * src/getargs.c (longopts): Clean up.
17856
178572001-02-21 Akim Demaille <akim@epita.fr>
17858
17859 * src/reader.c (gensym): `gensym_count' is your own.
17860 Use a static buf to create the symbol name, as token_buffer is no
17861 longer a buffer.
17862
178632001-02-08 Akim Demaille <akim@epita.fr>
17864
17865 * src/conflicts.c (conflict_report): Be sure not to append to res
17866 between two calls, which could happen if both first sprintf were
17867 skipped, but not the first cp += strlen.
17868
178692001-02-08 Akim Demaille <akim@epita.fr>
17870
17871 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
17872 New, from fileutils 4.0.37.
17873 * configure.in: Require Autoconf 2.49c. I took some time before
17874 making this decision. This is the only way out for portability
17875 issues in Bison, it would mean way too much duplicate effort to
17876 import in Bison features implemented in 2.49c since 2.13.
17877 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
17878
178792001-02-02 Akim Demaille <akim@epita.fr>
17880
17881 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
17882 * lib/xalloc.h, lib/xmalloc.c: Update.
17883
178842001-01-19 Akim Demaille <akim@epita.fr>
17885
17886 Get rid of the ad hoc handling of token_buffer in the scanner: use
17887 the obstacks.
17888
17889 * src/lex.c (token_obstack): New.
17890 (init_lex): Initialize it. No longer call...
17891 (grow_token_buffer): this. Remove it.
17892 Adjust all the places which used it to use the obstack.
17893
178942001-01-19 Akim Demaille <akim@epita.fr>
17895
17896 * src/lex.h: Rename all the tokens:
17897 s/\bENDFILE\b/tok_eof/g;
17898 s/\bIDENTIFIER\b/tok_identifier/g;
17899 etc.
17900 Let them be enums, not #define, to ease debugging.
17901 Adjust all the code.
17902
179032001-01-18 Akim Demaille <akim@epita.fr>
17904
17905 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
17906 * src/lex.c (maxtoken, grow_token_buffer): Static.
17907
179082001-01-18 Akim Demaille <akim@epita.fr>
17909
17910 Since we now use obstacks, more % directives can be enabled.
17911
17912 * src/lex.c (percent_table): Also accept `%yacc',
17913 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
17914 `%debug'.
17915 Handle the actions for `%semantic_parser' and `%pure_parser' here,
17916 instead of returning a token.
17917 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
17918 * src/reader.c (read_declarations): Adjust.
17919 * src/files.c (open_files): Don't call `compute_base_names', don't
17920 compute `attrsfile' since they depend upon data which might be
17921 *in* the input file now.
17922 (output_files): Do it here.
17923 * src/output.c (output_headers): Document the fact that this patch
17924 introduces a guaranteed SEGV for semantic parsers.
17925 * doc/bison.texinfo: Document them.
17926 * tests/suite.at: Exercise these %options.
17927
179282000-12-20 Akim Demaille <akim@epita.fr>
17929
17930 Also handle the output file (--verbose) with obstacks.
17931
17932 * files.c (foutput): Remove.
17933 (output_obstack): New.
17934 Adjust all dependencies.
17935 * src/conflicts.c: Return a string.
17936 * src/system.h (obstack_grow_string): Rename as...
17937 (obstack_sgrow): this. Be ready to work with non literals.
17938 (obstack_fgrow4): New.
17939
179402000-12-20 Akim Demaille <akim@epita.fr>
17941
17942 * src/files.c (open_files): Fix the computation of short_base_name
17943 in the case of `-o foo.tab.c'.
17944
179452000-12-20 Akim Demaille <akim@epita.fr>
17946
17947 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
17948 (copy_dollar): Now that everything uses obstacks, get rid of the
17949 FILE * parameters.
17950
179512000-12-20 Akim Demaille <akim@epita.fr>
17952
17953 * src/files.c (open_files): Actually the `.output' file is based
17954 on the short_base_name, not base_name.
17955 * tests/suite.at (Checking output file names): Adjust.
17956
179572000-12-20 Akim Demaille <akim@epita.fr>
17958
17959 * src/bison.s1: Remove, we now use directly...
17960 * src/bison.simple: this.
17961 * src/Makefile.am: Use pkgdata instead of data.
17962
179632000-12-20 Akim Demaille <akim@epita.fr>
17964
17965 * src/files.c (guard_obstack): New.
17966 (open_files): Initialize it.
17967 (output_files): Dump it...
17968 * src/files.h: Export it.
17969 * src/reader.c (copy_guard): Use it.
17970
179712000-12-19 Akim Demaille <akim@epita.fr>
17972
17973 * src/files.c (outfile, defsfile, actfile): Removed as global
17974 vars.
17975 (open_files): Don't compute them.
17976 (output_files): Adjust.
17977 (base_name, short_base_name): Be global.
17978 Adjust dependencies.
17979
179802000-12-19 Akim Demaille <akim@epita.fr>
17981
17982 * src/files.c (strsuffix): New.
17983 (stringappend): Be just like strcat but allocate.
17984 (base_names): Eve out from open_files.
17985 Try to simplify the rather hairy computation of base_name and
17986 short_base_name.
17987 (open_files): Use it.
17988 * tests/suite.at (Checking output file names): New test.
17989
179902000-12-19 Akim Demaille <akim@epita.fr>
17991
17992 * src/system.h (obstack_grow_literal_string): Rename as...
17993 (obstack_grow_string): this.
17994 * src/output.c (output_parser): Recognize `%% actions' instead of
17995 `$'.
17996 * src/bison.s1: s/$/%% actions/.
17997 * src/bison.hairy: Likewise.
17998
179992000-12-19 Akim Demaille <akim@epita.fr>
18000
18001 * src/output.c (output_parser): Compute the `#line' lines when
18002 there are.
18003 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
18004 Suggested by Hans Aberg.
18005
180062000-12-19 Akim Demaille <akim@epita.fr>
18007
18008 Let the handling of the skeleton files be local to the procedures
18009 that use it.
18010
18011 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
18012 longer static.
18013 (fparser, open_extra_files): Remove.
18014 (open_files, output_files): Don't take care of fparser.
18015 * src/files.h: Adjust.
18016 * src/output.c (output_parser): Open and close the file to the
18017 skeleton.
18018 * src/reader.c (read_declarations): When %semantic_parser, open
18019 fguard.
18020
180212000-12-19 Akim Demaille <akim@epita.fr>
18022
18023 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
18024 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
18025
180262000-12-19 Akim Demaille <akim@epita.fr>
18027
18028 * src/files.c (open_files): Yipee! We no longer need all the code
18029 looking for `/tmp' since we have no tmp file.
18030
180312000-12-19 Akim Demaille <akim@epita.fr>
18032
18033 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
18034 New macros.
18035 * src/files.c (open_files): Less dependency on MSDOS etc.
18036
180372000-12-14 Akim Demaille <akim@epita.fr>
18038
18039 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
18040 Provide a default definition.
18041 Use it when executing the default @ action.
18042 * src/reader.c (reader_output_yylsp): No longer include
18043 `timestamp' and `text' in the default YYLTYPE.
18044
180452000-12-12 Akim Demaille <akim@epita.fr>
18046
18047 * src/reader.c (copy_definition, parse_union_decl, copy_action)
18048 (copy_guard): Quote the file names.
18049 Reported by Laurent Mascherpa.
18050
180512000-12-12 Akim Demaille <akim@epita.fr>
18052
18053 * src/output.c (output_headers, output_program, output): Be sure
18054 to escape special characters when outputting filenames.
18055 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
18056 (output_headers): Don't depend on them, Use ACTSTR.
18057
180582000-11-17 Akim Demaille <akim@epita.fr>
18059
18060 * lib/obstack.h: Formatting changes.
18061 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
18062 prevents type checking.
18063 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
18064 cast the value to (void *): assigning a `foo *' to a `void *'
18065 variable is valid.
18066 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
18067 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
18068 append characters.
18069
180702000-11-17 Akim Demaille <akim@epita.fr>
18071
18072 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
18073 as...
18074 (suite.m4, regression.m4, calc.m4): these.
18075 * tests/atgeneral.m4: Update from CVS Autoconf.
18076
180772000-11-17 Akim Demaille <akim@epita.fr>
18078
18079 * tests/regression.m4 (%union and --defines): New test,
18080 demonstrating a current bug in the obstack implementation.
18081
180822000-11-17 Akim Demaille <akim@epita.fr>
18083
18084 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
18085 macros.
18086 Use them to declare the variables which are global or local to
18087 `yyparse'.
18088
180892000-11-17 Akim Demaille <akim@epita.fr>
18090
18091 * acconfig.h: Remove, no longer used.
18092
180932000-11-07 Akim Demaille <akim@epita.fr>
18094
18095 * src: s/Copyright (C)/Copyright/g.
18096
180972000-11-07 Akim Demaille <akim@epita.fr>
18098
18099 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
18100 defining.
18101 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
18102
181032000-11-07 Akim Demaille <akim@epita.fr>
18104
18105 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
18106 Merge in a single CPP if/else.
18107
181082000-11-07 Akim Demaille <akim@epita.fr>
18109
18110 * src/output.c (output): Remove useless variables.
18111 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
18112 argument `data' for consistency with the prototypes.
18113 Qualify it `const'.
18114 (obstack_copy, obstack_copy0): Rename the second argument as
18115 `address' for consistency. Qualify it `const'.
18116 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
18117 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
18118 `const' their input argument (`data' or `address').
18119 Adjust the corresponding macros to include `const' in casts.
18120
181212000-11-03 Akim Demaille <akim@epita.fr>
18122
18123 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
18124 s/PFILE1/BISON_HAIRY/.
18125 Adjust dependencies.
18126
181272000-11-03 Akim Demaille <akim@epita.fr>
18128
18129 For some reason, this was not applied.
18130
18131 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18132 `unlink': it's no longer used.
18133
181342000-11-03 Akim Demaille <akim@epita.fr>
18135
18136 * src/files.c (skeleton_find): New function, eved out of...
18137 (open_files, open_extra_files): here.
18138
181392000-11-03 Akim Demaille <akim@epita.fr>
18140
18141 Don't use `atexit'.
18142
18143 * src/files.c (obstack_save): New function.
18144 (done): Rename as...
18145 (output_files): this.
18146 Use `obstack_save'.
18147 * src/main.c (main): Don't use `atexit' to register `done', since
18148 it no longer has to remove tmp files, just call `output_files'
18149 when there are no errors.
18150
181512000-11-02 Akim Demaille <akim@epita.fr>
18152
18153 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18154 `unlink': it's no longer used.
18155 * src/files.h: Formatting changes.
18156
181572000-11-02 Akim Demaille <akim@epita.fr>
18158
18159 Remove the last uses of mktemp and unlink/delete.
18160
18161 * src/files.c (fdefines, ftable): Removed.
18162 (defines_ostack, table_obstack): New.
18163 Adjust dependencies of the former into uses of the latter.
18164 * src/output.c (output_short_or_char_table, output_short_table):
18165 Convert to using obstacks.
18166 * src/reader.c (copy_comment2): Accept one FILE * and two
18167 obstacks.
18168 (output_token_defines, reader_output_yylsp): Use obstacks.
18169 * src/system.h (obstack_fgrow3): New.
18170 * po/POTFILES.in: Adjust.
18171
181722000-11-01 Akim Demaille <akim@epita.fr>
18173
18174 Change each use of `fattrs' into a use of `attrs_obstack'.
18175
18176 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
18177 * src/files.c (fattrs): Remove.
18178 (attrs_obstack): New.
18179 Adjust all dependencies.
18180 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
18181
181822000-11-01 Akim Demaille <akim@epita.fr>
18183
18184 Introduce obstacks.
18185 Change each use of `faction' into a use of `action_obstack'.
18186
18187 * lib/obstack.h, lib/obstack.c: New files.
18188 * src/files.c (faction): Remove.
18189 (action_obstack): New.
18190 Adjust all dependencies.
18191
181922000-10-20 Akim Demaille <akim@epita.fr>
18193
18194 * lib/quote.h (PARAMS): New macro. Use it.
18195
181962000-10-16 Akim Demaille <akim@epita.fr>
18197
18198 * src/output.c (output_short_or_char_table): New function.
18199 (output_short_table, output_token_translations): Use it.
18200 (goto_actions): Use output_short_table.
18201
182022000-10-16 Akim Demaille <akim@epita.fr>
18203
18204 * src/symtab.c (bucket_new): New function.
18205 (getsym): Use it.
18206
18207 * src/output.c (output_short_table): New argument to display the
18208 comment associated with the table.
18209 Adjust dependencies.
18210 (output_gram): Use it.
18211 (output_rule_data): Nicer output layout for YYTNAME.
18212
182132000-10-16 Akim Demaille <akim@epita.fr>
18214
18215 * src/lex.c (read_typename): New function.
18216 (lex): Use it.
18217 * src/reader.c (copy_dollar): Likewise.
18218
182192000-10-16 Akim Demaille <akim@epita.fr>
18220
18221 * src/reader.c (copy_comment2): Expect the input stream to be on
18222 the `/' which is suspected to open a comment, instead of being
18223 called after `//' or `/*' was read.
18224 (copy_comment, copy_definition, parse_union_decl, copy_action)
18225 (copy_guard): Adjust.
18226
182272000-10-16 Akim Demaille <akim@epita.fr>
18228
18229 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
18230 `read_signed_integer'.
18231
182322000-10-16 Akim Demaille <akim@epita.fr>
18233
18234 * src/reader.c (copy_dollar): New function.
18235 (copy_guard, copy_action): Use it.
18236
182372000-10-16 Akim Demaille <akim@epita.fr>
18238
18239 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
18240 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
18241 New files, from Fileutils 4.0.27.
18242 * src/main.c (printable_version): Remove.
18243 * src/lex.c, src/reader.c: Use `quote'.
18244
182452000-10-04 Akim Demaille <akim@epita.fr>
18246
18247 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
18248
182492000-10-04 Akim Demaille <akim@epita.fr>
18250
18251 * doc/bison.texinfo: Various typos spotted by Neil Booth.
18252
182532000-10-04 Akim Demaille <akim@epita.fr>
18254
18255 When a literal string is used to define two different tokens,
18256 `bison -v' segfaults.
18257 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
18258
18259 * tests/regression.m4: New file.
18260 Include the core of the sample provided by Piotr Gackiewicz.
18261 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
18262 properly.
18263
182642000-10-04 Akim Demaille <akim@epita.fr>
18265
18266 * src/reader.c (parse_expect_decl): Keep `count' within the size
18267 of `buffer'.
18268 From Neil Booth.
18269
182702000-10-02 Paul Eggert <eggert@twinsun.com>
18271
18272 * bison.s1 (yyparse): Assign the default value
18273 unconditionally, to avoid a GCC warning and make the parser a
18274 tad smaller.
18275
182762000-10-02 Akim Demaille <akim@epita.fr>
18277
18278 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
18279 options.
18280
182812000-10-02 Akim Demaille <akim@epita.fr>
18282
18283 * src/derives.c, src/print.c, src/reduce.c: To ease the
18284 translation, move some `\n' out of the translated strings.
18285
182862000-10-02 Akim Demaille <akim@epita.fr>
18287
18288 The location tracking mechanism is precious for parse error
18289 messages. Nevertheless, it is enabled only when `@n' is used in
18290 the grammar, which is a different issue (you can use it in error
18291 message, but not in the grammar per se). Therefore, there should
18292 be another means to enable it.
18293
18294 * src/getargs.c (getargs): Support `--locations'.
18295 (usage): Report it.
18296 * src/getargs.h (locationsflag): Export it.
18297 * src/lex.c (percent_table): Support `%locations'.
18298 * src/reader.c (yylsp_needed): Remove this variable, now replaced
18299 with `locationsflag'.
18300 * doc/bison.texinfo: Document `--locations' and `%locations'.
18301 Sort the options.
18302 * tests/calc.m4: Test it.
18303
18304 For regularity of the names, replace each
18305 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
18306 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
18307 In addition replace each `flag' with `_flag'.
18308
183092000-10-02 Akim Demaille <akim@epita.fr>
18310
18311 Also test parse error messages, including with YYERROR_VERBOSE.
18312
18313 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
18314 associative).
18315 Use it to check the computations.
18316 Use it to check `nonassoc' is honored.
18317 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
18318 `--yyerror-verbose'.
18319 (_AT_CHECK_CALC): Adjust to this option.
18320 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
18321
183222000-10-02 Akim Demaille <akim@epita.fr>
18323
18324 Test also `--verbose', `--defines' and `--name-prefix'. Testing
18325 the latter demonstrates a flaw in the handling of non debugging
18326 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
18327 was used in order to simplify:
18328
18329 #if YYDEBUG
18330 if (yydebug)
18331 {
18332 ...
18333 }
18334 #endif
18335
18336 into
18337
18338 if (yydebug)
18339 {
18340 ...
18341 }
18342
18343 unfortunately this leads to a CPP conflict when
18344 `--name-prefix=foo' is used since it produces `#define yydebug
18345 foodebug'.
18346
18347 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
18348 (YYDPRINTF): New macro.
18349 Spread its use.
18350 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
18351 the bison options.
18352 Also test `--verbose', `--defines' and `--name-prefix'.
18353
183542000-10-02 Akim Demaille <akim@epita.fr>
18355
18356 Improve the readability of the produced parsers.
18357
18358 * src/bison.s1: Formatting changes.
18359 Improve the comment related to the `$' mark.
18360 (yydefault): Don't fall through to `yyresume': `goto' there.
18361 * src/output.c (output_parser): When the `$' is met, skip the end
18362 of its line.
18363 New variable, `number_of_dollar_signs', to check there's exactly
18364 one `$' in the parser skeleton.
18365
183662000-10-02 Akim Demaille <akim@epita.fr>
18367
18368 * lib/xstrdup.c: New file, from the fileutils.
18369 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
18370 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
18371 instead of strlen + xmalloc + strcpy.
18372 * src/symtab.c (copys): Remove, use xstrdup instead.
18373
183742000-10-02 Akim Demaille <akim@epita.fr>
18375
18376 * src/gram.h (associativity): New enum type which replaces the
18377 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
18378 `right_assoc', `left_assoc' and `non_assoc'.
18379 Adjust all dependencies.
18380 * src/reader.c: Formatting changes.
18381 (LTYPESTR): Don't define it, use it as a literal in
18382 `reader_output_yylsp'.
18383 * src/symtab.h (symbol_class): New enum type which replaces the
18384 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
18385 `sunknown', `stoken and `snterm'.
18386
183872000-10-02 Akim Demaille <akim@epita.fr>
18388
18389 * src/getargs.c (fixed_outfiles): Rename as...
18390 (yaccflag): for consistency and accuracy.
18391 Adjust dependencies.
18392
183932000-10-02 Akim Demaille <akim@epita.fr>
18394
18395 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
18396 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
18397 difficult and introduced a lot of core dump. It turns out that
18398 Bison used an implementation of `xmalloc' based on `calloc', and
18399 at various places it does depend upon the initialization to 0. I
18400 have not tried to isolate the pertinent places, and all the former
18401 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
18402 someone should address this issue.
18403
18404 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
18405 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
18406 files.
18407 Adjust dependencies.
18408 * src/warshall.h: New file.
18409 Propagate.
18410
184112000-10-02 Akim Demaille <akim@epita.fr>
18412
18413 Various anti-`extern in *.c' changes.
18414
18415 * src/system.h: Include `assert.h'.
18416
184172000-10-02 Akim Demaille <akim@epita.fr>
18418
18419 * src/state.h (nstates, final_state, first_state, first_shift)
18420 (first_reduction): Move their exportation from here...
18421 * src/LR0.h: to here.
18422 Adjust dependencies.
18423 * src/getargs.c (statisticsflag): New variable.
18424 Add support for `--statistics'.
18425 Adjust dependencies.
18426
18427 Remove a lot of now useless `extern' statements in most files.
18428
184292000-10-02 Akim Demaille <akim@epita.fr>
18430
18431 * src/LR0.h: New file.
18432 Propagate its use.
18433
184342000-10-02 Akim Demaille <akim@epita.fr>
18435
18436 * src/print.h: New file.
18437 Propagate its use.
18438 * src/print.c: Formatting and ordering changes.
18439 (verbose, terse): Replace with...
18440 (print_results): this new function.
18441 Adjust dependencies.
18442
184432000-10-02 Akim Demaille <akim@epita.fr>
18444
18445 * src/conflicts.c (conflict_report): New function.
18446 (conflict_log, verbose_conflict_log): Replace with...
18447 (print_conflicts): this function.
18448 Adjust dependencies.
18449 * src/conflicts.h: New file.
18450 Propagate its inclusion.
18451
184522000-10-02 Akim Demaille <akim@epita.fr>
18453
18454 * src/nullable.h: New file.
18455 Propagate its inclusion.
18456 * src/nullable.c: Formatting changes.
18457
184582000-10-02 Akim Demaille <akim@epita.fr>
18459
18460 * src/reduce.h: New file.
18461 Propagate its inclusion.
18462 * src/reduce.c: Topological sort and other formatting changes.
18463 (bool, TRUE, FALSE): Move their definition to...
18464 * src/system.h: here.
18465
184662000-10-02 Akim Demaille <akim@epita.fr>
18467
18468 * src/files.c: Formatting changes.
18469 (tryopen, tryclose, openfiles): Rename as...
18470 (xfopen, xfclose, open_files): this.
18471 (stringappend): static.
18472 * src/files.h: Complete the list of exported symbols.
18473 Propagate its use.
18474
184752000-10-02 Akim Demaille <akim@epita.fr>
18476
18477 * src/reader.h: New file.
18478 Propagate its use instead of tedious list of `extern' and
18479 prototypes.
18480 * src/reader.c: Formatting changes, topological sort,
18481 s/register//.
18482
184832000-10-02 Akim Demaille <akim@epita.fr>
18484
18485 * src/lex.h: Prototype `lex.c' exported functions.
18486 * src/reader.c: Adjust.
18487 * src/lex.c: Formatting changes.
18488 (safegetc): Rename as...
18489 (xgetc): this.
18490
184912000-10-02 Akim Demaille <akim@epita.fr>
18492
18493 * src/lalr.h: New file.
18494 Propagate its inclusion instead of prototypes and `extern'.
18495 * src/lalr.c: Formatting changes, topological sorting etc.
18496
184972000-10-02 Akim Demaille <akim@epita.fr>
18498
18499 * src/output.c (token_actions): Introduce a temporary array,
18500 YYDEFACT, that makes it possible for this function to use
18501 output_short_table.
18502
185032000-10-02 Akim Demaille <akim@epita.fr>
18504
18505 `user_toknums' is output as a `short[]' in `output.c', while it is
18506 defined as a `int[]' in `reader.c'. For consistency with the
18507 other output tables, `user_toknums' is now defined as a table of
18508 shorts.
18509
18510 * src/reader.c (user_toknums): Be a short table instead of an int
18511 table.
18512 Adjust dependencies.
18513
18514 Factor the short table outputs.
18515
18516 * src/output.c (output_short_table): New function.
18517 * src/output.c (output_gram, output_stos, output_rule_data)
18518 (output_base, output_table, output_check): Use it.
18519
185202000-10-02 Akim Demaille <akim@epita.fr>
18521
18522 * src/output.c (output): Topological sort of the functions, in
18523 order to get rid of the `static' prototypes.
18524 No longer use `register'.
18525 * src/output.h: New file.
18526 Propagate its inclusion in files explicitly prototyping functions
18527 from output.c.
18528
185292000-09-21 Akim Demaille <akim@epita.fr>
18530
18531 * src/atgeneral.m4: Update from Autoconf.
18532
185332000-09-21 Akim Demaille <akim@epita.fr>
18534
18535 * src/closure.h: New file.
18536 * src/closure.c: Formatting changes, topological sort over the
18537 functions, use of closure.h.
18538 (initialize_closure, finalize_closure): Rename as...
18539 (new_closure, free_closure): these. Adjust dependencies.
18540 * src/LR0.c: Formatting changes, topological sort, use of
18541 cloture.h.
18542 (initialize_states): Rename as...
18543 (new_states): this.
18544 * src/Makefile.am (noinst_HEADERS): Adjust.
18545
185462000-09-20 Akim Demaille <akim@epita.fr>
18547
18548 * src/acconfig.h: Don't protect config.h against multiple
18549 inclusion.
18550 Don't define PARAMS.
18551 * src/system.h: Define PARAMS.
18552 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
18553 purpose of config.h. system.h must not try to fix wrong
18554 definitions in config.h.
18555
185562000-09-20 Akim Demaille <akim@epita.fr>
18557
18558 * src/derives.h: New file.
18559 * src/main.c, src/derives.h: Use it.
18560 Formatting changes.
18561 * src/Makefile.am (noinst_HEADERS): Adjust.
18562
185632000-09-20 Akim Demaille <akim@epita.fr>
18564
18565 * tests/atgeneral.m4: Update from Autoconf.
18566 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
18567 (AT_CHECK_CALC): New macros.
18568 Use these macros to test bison with options `', `--raw',
18569 `--debug', `--yacc', `--yacc --debug'.
18570
185712000-09-19 Akim Demaille <akim@epita.fr>
18572
18573 * src/output.c: Formatting changes.
18574 * src/machine.h: Remove, leaving its contents in...
18575 * src/system.h: here.
18576 Include stdio.h.
18577 Adjust all dependencies on stdio.h and machine.h.
18578 * src/getargs.h: New file.
18579 Let all `extern' declarations about getargs.c be replaced with
18580 inclusion of `getargs.h'.
18581 * src/Makefile.am (noinst_HEADERS): Adjust.
18582
18583 * tests/calc.m4 (yyin): Be initialized in main, not on the global
18584 scope.
18585 (yyerror): Returns void, not int.
18586 * doc/bison.texinfo: Formatting changes.
18587
185882000-09-19 Akim Demaille <akim@epita.fr>
18589
18590 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
18591 portable.
18592
185932000-09-18 Akim Demaille <akim@epita.fr>
18594
18595 * configure.in: Append WARNING_CFLAGS to CFLAGS.
18596 * src/Makefile.am (INCLUDES): Don't.
18597 Be ready to fetch headers in lib/.
18598
185992000-09-18 Akim Demaille <akim@epita.fr>
18600
18601 * doc/bison.texinfo: Update the copyright.
18602 ANSIfy and GNUify the examples.
18603 Remove the old menu.
18604
186052000-09-18 Akim Demaille <akim@epita.fr>
18606
18607 First set of tests: use the `calc' example from the documentation.
18608
18609 * src/bison.s1 (yyparse): Condition the code using `yytname' which
18610 is defined only when YYDEBUG is.
18611 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
18612 * src/files.c (tryopen, tryclose): Formatting changes.
18613 Move to the top and be static.
18614 * src/reader.c (read_signed_integer): Likewise.
18615 * tests/calc.m4: New file.
18616 * Makefile.am, suite.m4: Adjust.
18617 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
18618
186192000-09-18 Akim Demaille <akim@epita.fr>
18620
18621 Add support for an Autotest test suite for Bison.
18622
18623 * m4/m4.m4, m4/atconfig.m4: New files.
18624 * m4/Makefile.am (EXTRA_DIST): Adjust.
18625 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
18626 files.
18627 * src/getargs.c: Display a more standard --version message.
18628 * src/reader.c (reader): Formatting changes.
18629 No longer depend upon VERSION_STRING.
18630 * configure.in: No longer use `dnl'.
18631 Set up the test suite and the new directory `tests/.
18632 (VERSION_STRING): Remove.
18633
186342000-04-14 Akim Demaille <akim@epita.fr>
18635
18636 * src/reader.c (copy_comment2): New function, same as former
18637 `copy_comment', but outputs into two FILE *.
18638 (copy_comment): Use it.
18639 (parse_union_decl): Use it.
18640 (get_type, parse_start_decl): Use the same `invalid' message.
18641 (parse_start_decl, parse_union_decl): Use the same `multiple'
18642 message.
18643 (parse_union_decl, copy_guard, copy_action): Use the same
18644 `unmatched' message.
18645 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
18646
186472000-03-31 Akim Demaille <akim@epita.fr>
18648
18649 * src/files.c (tryopen, tryclose): Move to the top.
18650 Be static.
18651
186522000-03-31 Akim Demaille <akim@epita.fr>
18653
18654 * src/main.c (main): Don't call `done', exit does it.
18655
186562000-03-31 Akim Demaille <akim@epita.fr>
18657
18658 * allocate.c: s/return (foo)/return foo/.
18659 * lalr.c: Likewise.
18660 * LR0.c: Likewise.
18661 * output.c: Likewise.
18662 * reader.c: Likewise.
18663 * symtab.c: Likewise.
18664 * vmsgetargs.c: Likewise.
18665
186662000-03-31 Akim Demaille <akim@epita.fr>
18667
18668 Clean up the error reporting functions.
18669
18670 * src/report.c: New file.
18671 * src/report.h: Likewise.
18672 * src/Makefile.am: Adjust.
18673 * m4/error.m4: New file.
18674 * m4/Makefile.am: Adjust.
18675 * configure.in (jm_PREREQ_ERROR): Call it.
18676 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
18677 Remove.
18678 (fatal, fatals): Remove. All callers use complain.c::fatal.
18679 (warn, warni, warns, warnss, warnss): Remove. All callers use
18680 complain.c::complain.
18681 (toomany): Remove, use fatal instead.
18682 * src/files.c (done): No argument, use complain_message_count.
18683 * src/main.c (main): Register `done' to `atexit'.
18684
18685 * src/getargs.c (usage): More `fputs', less `fprintf'.
18686
186872000-03-28 Akim Demaille <akim@epita.fr>
18688
18689 * lib/: New directory.
18690 * Makefile.am (SUBDIRS): Adjust.
18691 * configure.in: Adjust.
18692 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
18693 useless.
18694 * src/alloca.c: Moved to lib/.
18695 * src/getopt.c: Likewise.
18696 * src/getopt1.c: Likewise.
18697 * src/getopt.h: Likewise.
18698 * src/ansi2knr.c: Likewise.
18699 * src/ansi2knr.1: Likewise.
18700 * src/Makefile.am: Adjust.
18701 * lib/Makefile.am: New file.
18702
187032000-03-28 Akim Demaille <akim@epita.fr>
18704
18705 * src/getargs.c (usage): Refresh the help message.
18706
187072000-03-17 Akim Demaille <akim@epita.fr>
18708
18709 * src/getopt1.c: Updated from textutils 2.0e
18710 * src/getopt.c: Likewise.
18711 * src/getopt.h: Likewise.
18712
187132000-03-17 Akim Demaille <akim@epita.fr>
18714
18715 * src/Makefile.am (bison.simple): Fix the awk program: quote only
18716 the file name, not the whole `#line LINE FILE'.
18717
187182000-03-17 Akim Demaille <akim@epita.fr>
18719
18720 On syntax errors, report the token on which we choked.
18721
18722 * src/bison.s1 (yyparse): In the label yyerrlab, when
18723 YYERROR_VERBOSE, add yychar in msg.
18724
187252000-03-17 Akim Demaille <akim@epita.fr>
18726
18727 * src/reader.c (copy_at): New function.
18728 (copy_guard): Use it.
18729 (copy_action): Use it.
18730
187312000-03-17 Akim Demaille <akim@epita.fr>
18732
18733 Be kind to translators, save some useless translations.
18734
18735 * src/main.c (banner): New function.
18736 (fatal_banner): Use it.
18737 (warn_banner): Use it.
18738
187392000-03-17 Akim Demaille <akim@epita.fr>
18740
18741 * src/reader.c (copy_definition): Use copy_string and
18742 copy_comment. Removed now unused `match', `ended',
18743 `cplus_comment'.
18744 (copy_comment, copy_string): Moved, to be visible from
18745 copy_definition.
18746
187472000-03-17 Akim Demaille <akim@epita.fr>
18748
18749 * src/reader.c (copy_string): Declare `static inline'. No
18750 problems with inline, since it is checked by configure.
18751 (copy_comment): Likewise.
18752
187532000-03-17 Akim Demaille <akim@epita.fr>
18754
18755 * src/reader.c (packsymbols): Formatting changes.
18756
187572000-03-17 Akim Demaille <akim@epita.fr>
18758
18759 * src/reader.c (copy_comment): New function, factored out from:
18760 (copy_action): Use it. Removed now unused `match', `ended',
18761 `cplus_comment'.
18762 (copy_guard): Likewise.
18763
187642000-03-17 Akim Demaille <akim@epita.fr>
18765
18766 * src/reader.c (copy_string): New function, factored out from:
18767 (copy_action): Use it.
18768 (copy_guard): Likewise.
18769
187702000-03-17 Akim Demaille <akim@epita.fr>
18771
18772 Change the handling of @s so that they behave exactly like $s.
18773 There is now a pseudo variable @$ (readble and writable), location
18774 of the lhs of the rule (by default ranging from the location of
18775 the first symbol of the rhs, to the location of the last symbol,
18776 or, if the rhs is empty, YYLLOC).
18777
18778 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
18779 yyval.
18780 (yyparse): When providing a default semantic action, provide a
18781 default location action.
18782 (after the $): No longer change `*YYLSP', just stack YYLOC the
18783 same way you stack YYVAL.
18784 * src/reader.c (read_declarations): Use warns.
18785 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
18786 (copy_action, case '@'): Likewise.
18787 Use a standard error message, to save useless work from
18788 translators.
18789
187902000-03-17 Akim Demaille <akim@epita.fr>
18791
18792 * src/bison.s1: Formatting and cosmetics changes.
18793 * src/reader.c: Likewise.
18794 Update the Copyright notice.
18795
187962000-03-17 Akim Demaille <akim@epita.fr>
18797
18798 * src/bison.s1 (#line): All set to `#line' only, since the
18799 Makefile now handles them.
18800
188012000-03-16 Akim Demaille <akim@epita.fr>
18802
18803 * src/output.c (output_rule_data): Output the documentation of
18804 some of the tables.
18805 (Copyright notice): Update.
18806 Formatting changes.
18807
188082000-03-16 Akim Demaille <akim@epita.fr>
18809
18810 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
18811 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
18812 One `#if YYDEBUG' remains, since it uses variables which are
18813 defined only if `YYDEBUG != 0'.
18814
188152000-03-16 Akim Demaille <akim@epita.fr>
18816
18817 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
18818 and related variables so that the similarities are highlighted.
18819
188202000-03-16 Akim Demaille <akim@epita.fr>
18821
18822 * src/bison.s1: Properly indent CPP directives.
18823
188242000-03-16 Akim Demaille <akim@epita.fr>
18825
18826 * src/bison.s1: Properly indent the `alloca' CPP section.
18827
188282000-03-16 Akim Demaille <akim@epita.fr>
18829
18830 Do not hard code values of directories in `configure.in'.
18831 Update the `configure' tool chain.
18832
18833 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
18834 src/makefile.am.
18835 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
18836 (AC_OUTPUT): Add m4/Makefile.
18837 Bump to bison 1.28a, 1.29 has never been released.
18838 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
18839 handled via src/Makefile.am.
18840 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
18841 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
18842 autoheader.
18843 * Makefile.am (SUBDIRS): Add m4.
18844 (ACLOCAL_AM_FLAGS): New variable.
18845 (AUTOMAKE_OPTIONS): Add check-news.
18846 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
18847 the proper line number and file name.
18848 (DEFS): Propagate the location of bison library files and of the
18849 locale files.
18850 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
18851 builddir.
18852 * acinclude.m4: Remove, replaced by the directory m4.
18853 * m4/Makefile.am (EXTRA_DIST): New variable.
18854 * m4/gettext.m4: New file, from the fileutils.
18855 * m4/lcmessage.m4: Likewise
18856 * m4/progtest.m4: Likewise.
18857 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
18858
188592000-03-10 Akim Demaille <akim@epita.fr>
18860
18861 * src/closure.c:
18862 Formatting changes of various comments.
18863 Respect the GNU coding standards at various places.
18864 Don't use `_()' when no translation is needed.
18865
188661999-12-13 Jesse Thilo <jthilo@gnu.org>
18867
18868 * src/files.c:
18869 OS/2 honors TMPDIR environment variable.
18870
188711999-12-13 Jesse Thilo <jthilo@gnu.org>
18872
18873 * doc/bison.texinfo: Tweaked spelling and grammar.
18874 Updated ISBN.
18875 Removed reference to price of printed copy.
18876 Mention BISON_SIMPLE and BISON_HAIRY.
18877
188781999-12-13 Jesse Thilo <jthilo@gnu.org>
18879
18880 * configure.in, NEWS:
18881 Bison 1.29 released.
18882
188831999-10-27 Jesse Thilo <jthilo@gnu.org>
18884
18885 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
18886 Added reference card.
18887
188881999-07-26 Jesse Thilo <jthilo@gnu.org>
18889
18890 * po/ru.po: Added Russian translation.
18891
188921999-07-26 Jesse Thilo <jthilo@gnu.org>
18893
18894 * configure.in: Added Russian translation.
18895
188961999-07-06 Jesse Thilo <jthilo@gnu.org>
18897
18898 * configure.in, NEWS, README:
18899 Released version 1.28.
18900
189011999-06-14 Jesse Thilo <jthilo@gnu.org>
18902
18903 * src/system.h:
18904 Squashed redefinition warning on some systems.
18905
18906 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
18907 Have configure build version string instead of relying on ANSI string
18908 concatentation.
18909
189101999-06-14 Jesse Thilo <jthilo@gnu.org>
18911
18912 * po/POTFILES.in: Got rid of version.c.
18913
189141999-06-14 Jesse Thilo <jthilo@gnu.org>
18915
18916 * acconfig.h, configure.in:
18917 Have configure build version string instead of relying on ANSI string
18918 concatentation.
18919
189201999-06-08 Jesse Thilo <jthilo@gnu.org>
18921
18922 * doc/bison.1:
18923 Dropped mention of `+' for long-named options.
18924
189251999-05-30 Jesse Thilo <jthilo@gnu.org>
18926
18927 * src/files.c: Added <unistd.h> for unlink().
18928
18929 * src/Makefile.am, src/system.h:
18930 I18n fixes.
18931
189321999-05-30 Jesse Thilo <jthilo@gnu.org>
18933
18934 * README: Added a FAQ list.
18935
18936 * configure.in, acconfig.h:
18937 I18n fixes.
18938
189391999-05-30 Jesse Thilo <jthilo@gnu.org>
18940
18941 * doc/FAQ, doc/Makefile.am:
18942 Added a FAQ list.
18943
189441999-05-19 Jesse Thilo <jthilo@gnu.org>
18945
18946 * src/alloc.h, src/symtab.h, src/version.c:
18947 Protected inclusion of "config.h" with HAVE_CONFIG_H.
18948
189491999-04-18 Jesse Thilo <jthilo@gnu.org>
18950
18951 * src/.cvsignore, src/Makefile.am:
18952 Reorganized: sources in `src', documentation in `doc'.
18953
18954 * src/lex.c (literalchar):
18955 fixed the code for escaping double quotes (thanks
18956 Jonathan Czisny.)
18957
189581999-04-18 Jesse Thilo <jthilo@gnu.org>
18959
18960 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
18961 Adjusted paths to reflect directory reorganization.
18962
189631999-04-18 Jesse Thilo <jthilo@gnu.org>
18964
18965 * doc/.cvsignore, doc/Makefile.am:
18966 Reorganized: sources in `src', documentation in `doc'.
18967
189681999-04-18 Jesse Thilo <jthilo@gnu.org>
18969
18970 * configure.in:
18971 Updated AC_INIT file to reflect directory reorganization.
18972
18973 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
18974 Reorganized: sources in `src', documentation in `doc'.
18975
189761999-04-13 Jesse Thilo <jthilo@gnu.org>
18977
18978 * src/allocate.c:
18979 Don't declare calloc() and realloc() if not necessary.
18980
189811999-04-13 Jesse Thilo <jthilo@gnu.org>
18982
18983 * configure.in, acconfig.h, acinclude.m4:
18984 Don't declare calloc() and realloc() if not necessary.
18985
189861999-03-23 Jesse Thilo <jthilo@gnu.org>
18987
18988 * po/.cvsignore: Added i18n support.
18989
189901999-03-23 Jesse Thilo <jthilo@gnu.org>
18991
18992 * acconfig.h, configure.in, Makefile.am:
18993 Added i18n support.
18994
189951999-03-22 Jesse Thilo <jthilo@gnu.org>
18996
18997 * src/bison.s1: Fixed #line numbers.
18998
189991999-03-15 Jesse Thilo <jthilo@gnu.org>
19000
19001 * po/es.po, po/fr.po, po/nl.po, po/de.po:
19002 Added PO files from Translation Project.
19003
190041999-03-03 Jesse Thilo <jthilo@gnu.org>
19005
19006 * Makefile.am:
19007 Added support for non-ANSI compilers (ansi2knr).
19008
190091999-02-16 Jesse Thilo <jthilo@gnu.org>
19010
19011 * configure.in: Bumped version number to 1.27.
19012
19013 * Makefile.am:
19014 Added `bison.simple' to list of files removed by `make distclean'.
19015
190161999-02-12 Jesse Thilo <jthilo@gnu.org>
19017
19018 * src/files.c, src/files.h:
19019 Defined locations of parser files in config.h instead of Makefile.
19020
190211999-02-12 Jesse Thilo <jthilo@gnu.org>
19022
19023 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
19024 Defined locations of parser files in config.h instead of Makefile.
19025
190261999-02-09 Jesse Thilo <jthilo@gnu.org>
19027
19028 * Makefile.am:
19029 Removed inappropriate use of $< macro.
19030
190311999-02-05 Jesse Thilo <jthilo@gnu.org>
19032
19033 * po/Makefile.in.in, po/POTFILES.in:
19034 Add `po' directory skeleton.
19035
190361999-01-27 Jesse Thilo <jthilo@gnu.org>
19037
19038 * README: Document help-bison list.
19039
19040 * configure.in: Add check for mkstemp().
19041
190421999-01-20 Jesse Thilo <jthilo@gnu.org>
19043
19044 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
19045 Hush a few compiler warnings.
19046
19047 * src/files.c:
19048 Add tryclose(), which verifies that fclose was successful.
19049 Hush a couple of compiler warnings.
19050
190511999-01-20 Jesse Thilo <jthilo@gnu.org>
19052
19053 * Makefile.am, OChangeLog:
19054 ChangeLog is now automatically generated. Include the old version as
19055 OChangeLog.
19056
190571999-01-14 Jesse Thilo <jthilo@gnu.org>
19058
19059 * 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:
19060 Update FSF address.
19061
190621999-01-14 Jesse Thilo <jthilo@gnu.org>
19063
19064 * doc/bison.texinfo: Fix formatting glitch.
19065
19066 * doc/bison.texinfo: Update FSF address.
19067
190681999-01-14 Jesse Thilo <jthilo@gnu.org>
19069
19070 * acconfig.h: Update FSF address.
19071
190721999-01-08 Jesse Thilo <jthilo@gnu.org>
19073
19074 * src/system.h:
19075 Don't define PACKAGE here, since config.h defines it.
19076
190771998-12-30 Jesse Thilo <jthilo@gnu.org>
19078
19079 * src/reader.c: Update copyright date.
19080
19081 * src/main.c:
19082 Ditch sprintf to statically-sized buffers in fatal/warn functions in
19083 favor of output directly to stderr (avoids buffer overruns).
19084
19085 * src/reader.c: Some checks for premature EOF.
19086
19087 * 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:
19088 Use prototypes if the compiler understands them.
19089
19090 * src/files.c: Honor TMPDIR on Unix hosts.
19091 Use prototypes if the compiler understands them.
19092
19093 * src/reader.c:
19094 Fix a couple of buffer overrun bugs.
19095 Use prototypes if the compiler understands them.
19096
19097 * src/system.h: Include unistd.h and ctype.h.
19098 Use #ifdef instead of #if for NLS symbols.
19099
191001998-12-30 Jesse Thilo <jthilo@gnu.org>
19101
19102 * doc/bison.texinfo:
19103 Delete comment "consider using @set for edition number, etc..." since
19104 we now are doing so.
19105
191061998-12-30 Jesse Thilo <jthilo@gnu.org>
19107
19108 * configure.in:
19109 Use prototypes if the compiler understands them.
19110
19111 * NEWS: Document 1.26 highlights.
19112
19113 * Makefile.am: Require Automake 1.3 or later.
19114
19115 * acconfig.h:
19116 Use prototypes if the compiler understands them.
19117
191181998-12-29 Jesse Thilo <jthilo@gnu.org>
19119
19120 * src/version.c:
19121 Use VERSION symbol from automake for version number.
19122
191231998-12-29 Jesse Thilo <jthilo@gnu.org>
19124
19125 * acconfig.h, configure.in, version.cin:
19126 Use VERSION symbol from automake for version number.
19127
191281998-11-28 Jesse Thilo <jthilo@gnu.org>
19129
19130 * Makefile.am:
19131 Distribute original version of simple parser (bison.s1), not built
19132 version (bison.simple).
19133
191341998-11-28 Jesse Thilo <jthilo@gnu.org>
19135
19136 * doc/bison.texinfo: Add info dir entry.
19137
19138 * doc/bison.texinfo:
19139 Let automake put version number into documentation.
19140
191411998-11-26 Jesse Thilo <jthilo@gnu.org>
19142
19143 * src/bison.cld, src/build.com, src/vmshlp.mar:
19144 Add non-RCS files from /gd/gnu/bison.
19145
191461998-11-26 Jesse Thilo <jthilo@gnu.org>
19147
19148 * doc/bison.1:
19149 Document the BISON_HAIRY and BISON_SIMPLE variables.
19150
191511998-11-25 Jesse Thilo <jthilo@gnu.org>
19152
19153 * src/version.c: Build version.c automatically.
19154
19155 * src/reader.c:
19156 Fix token numbering (used to start at 258, not 257).
19157
19158 * src/system.h: Include config.h.
19159
19160 * src/getargs.c: Update bug report address.
19161
19162 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
19163 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
19164
191651998-11-25 Jesse Thilo <jthilo@gnu.org>
19166
19167 * Makefile.am:
19168 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19169
19170 * configure.in, version.cin:
19171 Build version.c automatically.
19172
19173 * AUTHORS: Add AUTHORS file.
19174
19175 * README: Update bug report address.
19176
19177 * bison.simple:
19178 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19179
19180 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
19181 Add automake stuff.
19182
191831998-11-25 Jesse Thilo <jthilo@gnu.org>
19184
19185 * doc/bison.texinfo: Clean up some formatting.
19186
191871998-05-05 Richard Stallman <rms@gnu.org>
19188
19189 * doc/bison.texinfo:
19190 Explain better why to make a pure parser.
19191
191921998-01-05 Richard Stallman <rms@gnu.org>
19193
19194 * src/files.c (openfiles):
19195 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
19196 find a temporary directory, if possible. Do not unlink files while
19197 they are open.
19198
191991997-08-25 Richard Stallman <rms@gnu.org>
19200
19201 * src/reader.c (stack_offset;):
19202 Change some warni to warns.
19203
19204 * src/lex.c (literalchar): Use warns, not warni.
19205
192061997-06-28 Richard Stallman <rms@gnu.org>
19207
19208 * src/bison.s1: Add a Bison version comment.
19209
19210 * src/main.c (fatal, warn, berror):
19211 Use program_name.
19212
192131997-06-28 Richard Stallman <rms@gnu.org>
19214
19215 * Makefile.in (bison_version): New variable.
19216 (dist): Use that variable.
19217 (bison.s1): Substitute the Bison version into bison.simple.
19218
19219 * bison.simple: Add a Bison version comment.
19220
192211997-06-18 Richard Stallman <rms@gnu.org>
19222
19223 * src/main.c (fatal, warn, berror):
19224 Make error messages standard.
19225 (toomany): Improve error message text.
19226
19227 * 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:
19228 new.h renamed to alloc.h.
19229
192301997-06-18 Richard Stallman <rms@gnu.org>
19231
19232 * Makefile.in: new.h renamed to alloc.h.
19233
192341997-05-24 Richard Stallman <rms@gnu.org>
19235
19236 * src/lex.c (literalchar):
19237 Fix the code for escaping \, " and '.
19238
19239 (lex): Avoid trouble when there are many chars
19240 to discard in a char literal with just several chars in it.
19241
192421997-05-17 Richard Stallman <rms@gnu.org>
19243
19244 * src/bison.s1:
19245 Use malloc, if using alloca is troublesome.
19246 (YYSTACK_USE_ALLOCA): New flag macro.
19247 Define it for some systems and compilers.
19248 (YYSTACK_ALLOC): New macro.
19249 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19250 If it was malloc'd, free it.
19251
192521997-05-17 Richard Stallman <rms@gnu.org>
19253
19254 * bison.simple:
19255 Use malloc, if using alloca is troublesome.
19256 (YYSTACK_USE_ALLOCA): New flag macro.
19257 Define it for some systems and compilers.
19258 (YYSTACK_ALLOC): New macro.
19259 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19260 If it was malloc'd, free it.
19261
192621997-04-23 Richard Stallman <rms@gnu.org>
19263
19264 * src/bison.s1:
19265 (alloca) [__hpux]: Always define as __builtin_alloca.
19266
192671997-04-23 Richard Stallman <rms@gnu.org>
19268
19269 * bison.simple:
19270 (alloca) [__hpux]: Always define as __builtin_alloca.
19271
192721997-04-22 Richard Stallman <rms@gnu.org>
19273
19274 * src/bison.s1:
19275 [__hpux]: Include alloca.h (right for HPUX 10)
19276 instead of declaring alloca (right for HPUX 9).
19277
19278 * src/bison.s1 (__yy_memcpy):
19279 Declare arg `count' as unsigned int.
19280 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19281
192821997-04-22 Richard Stallman <rms@gnu.org>
19283
19284 * bison.simple:
19285 [__hpux]: Include alloca.h (right for HPUX 10)
19286 instead of declaring alloca (right for HPUX 9).
19287
19288 * bison.simple (__yy_memcpy):
19289 Declare arg `count' as unsigned int.
19290 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19291
192921997-01-03 Richard Stallman <rms@gnu.org>
19293
19294 * src/allocate.c: [__STDC__ or _MSC_VER]:
19295 Declare calloc and realloc to return void *.
19296
192971997-01-02 Richard Stallman <rms@gnu.org>
19298
19299 * src/system.h:
19300 [_MSC_VER]: Include stdlib.h and process.h.
19301 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
19302
19303 * src/main.c (main): Return FAILURE as a value.
19304 (printable_version): Declare arg as int, not char.
19305
193061997-01-02 Richard Stallman <rms@gnu.org>
19307
19308 * Makefile.in (dist):
19309 Explicitly check for symlinks, and copy them.
19310
193111996-12-19 Richard Stallman <rms@gnu.org>
19312
19313 * src/files.c:
19314 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
19315
193161996-12-18 Paul Eggert <eggert@gnu.org>
19317
19318 * src/bison.s1 (yyparse):
19319 If __GNUC__ and YYPARSE_PARAM are both defined,
19320 declare yyparse to have a void * argument.
19321
193221996-12-18 Paul Eggert <eggert@gnu.org>
19323
19324 * bison.simple (yyparse):
19325 If __GNUC__ and YYPARSE_PARAM are both defined,
19326 declare yyparse to have a void * argument.
19327
193281996-12-17 Richard Stallman <rms@gnu.org>
19329
19330 * src/reduce.c (nbits): Add some casts.
19331
193321996-08-12 Richard Stallman <rms@gnu.org>
19333
19334 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
19335
193361996-08-12 Richard Stallman <rms@gnu.org>
19337
19338 * bison.simple: Test _MSDOS as well as _MSDOS_.
19339
193401996-07-31 Richard Stallman <rms@gnu.org>
19341
19342 * src/bison.s1:
19343 [__sun && __i386]: Include alloca.h.
19344
193451996-07-31 Richard Stallman <rms@gnu.org>
19346
19347 * bison.simple:
19348 [__sun && __i386]: Include alloca.h.
19349
193501996-07-30 Richard Stallman <rms@gnu.org>
19351
19352 * src/bison.s1: Comment change.
19353
19354 * src/bison.s1: Test _MSDOS_, not MSDOS.
19355
193561996-07-30 Richard Stallman <rms@gnu.org>
19357
19358 * bison.simple: Comment change.
19359
19360 * bison.simple: Test _MSDOS_, not MSDOS.
19361
193621996-06-01 Richard Stallman <rms@gnu.org>
19363
19364 * 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:
19365 Insert `_' macro around many string constants.
19366
19367 * src/main.c:
19368 Insert `_' macro around many string constants.
19369
19370 (main): Call setlocale, bindtextdomain and textdomain.
19371
19372 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
19373 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
19374 [ENABLE_NLS]: Include libintl.h.
19375 [ENABLE_NLS] (gettext): Define.
19376 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
19377 (N_, PACKAGE, LOCALEDIR): New macros.
19378
193791996-06-01 Richard Stallman <rms@gnu.org>
19380
19381 * POTFILES.in: New file.
19382
19383 * Makefile.in (allocate.o):
19384 Define target explicitly.
19385
19386 * Makefile.in (CFLAGS): Set to @CFLAGS@.
19387 (LDFLAGS): Set to @LDFLAGS@.
19388 (configure): Run autoconf only if preceding `cd' succeeds.
19389 (bison.s1): Redirect output to temporary file then move the
19390 temporary to the target, rather than redirecting directly to bison.s1.
19391 (clean): Remove config.status and config.log.
19392 (distclean): Don't remove config.status here.
19393
193941996-05-12 Richard Stallman <rms@gnu.org>
19395
19396 * src/bison.s1:
19397 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19398
193991996-05-12 Richard Stallman <rms@gnu.org>
19400
19401 * bison.simple:
19402 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19403
194041996-05-11 Richard Stallman <rms@gnu.org>
19405
19406 * src/bison.s1 (__yy_memcpy):
19407 Really reorder the args, as was supposedly done on Feb 14 1995.
19408 (yyparse): Calls changed accordingly.
19409
194101996-05-11 Richard Stallman <rms@gnu.org>
19411
19412 * Makefile.in (dist): Don't use $(srcdir).
19413
19414 * bison.simple (__yy_memcpy):
19415 Really reorder the args, as was supposedly done on Feb 14 1995.
19416 (yyparse): Calls changed accordingly.
19417
194181996-01-27 Richard Stallman <rms@gnu.org>
19419
19420 * src/output.c (output_rule_data):
19421 Test YYERROR_VERBOSE in the conditional
19422 around the definition of ttyname.
19423
194241995-12-29 Richard Stallman <rms@gnu.org>
19425
19426 * src/bison.s1:
19427 Fix line numbers in #line commands.
19428
194291995-12-29 Richard Stallman <rms@gnu.org>
19430
19431 * bison.simple:
19432 Fix line numbers in #line commands.
19433
194341995-12-27 Richard Stallman <rms@gnu.org>
19435
19436 * src/bison.s1 (YYPARSE_PARAM_DECL):
19437 In C++, make it always null.
19438 (YYPARSE_PARAM_ARG): New macro.
19439 (yyparse): Use YYPARSE_PARAM_ARG.
19440
194411995-12-27 Richard Stallman <rms@gnu.org>
19442
19443 * bison.simple (YYPARSE_PARAM_DECL):
19444 In C++, make it always null.
19445 (YYPARSE_PARAM_ARG): New macro.
19446 (yyparse): Use YYPARSE_PARAM_ARG.
19447
194481995-11-29 Richard Stallman <rms@gnu.org>
19449
19450 * doc/bison.texinfo:
19451 Describe literal string tokens, %raw, %no_lines, %token_table.
19452
194531995-11-29 Daniel Hagerty <hag@gnu.org>
19454
19455 * doc/bison.texinfo: Fixed update date
19456
194571995-10-16 Richard Stallman <rms@gnu.org>
19458
19459 * src/version.c: Version 1.25.
19460
194611995-10-16 Richard Stallman <rms@gnu.org>
19462
19463 * NEWS: *** empty log message ***
19464
194651995-10-16 Richard Stallman <rms@gnu.org>
19466
19467 * doc/bison.1, doc/bison.rnh:
19468 Add new options.
19469
194701995-10-15 Richard Stallman <rms@gnu.org>
19471
19472 * src/vmsgetargs.c, src/getargs.c:
19473 Added -n, -k, and -raw switches.
19474 (noparserflag, toknumflag, rawtoknumflag): New variables.
19475
19476 * src/symtab.h (SALIAS):
19477 New #define for adding aliases to %token.
19478 (struct bucket): Added `alias' field.
19479
19480 * src/reduce.c (reduce_grammar):
19481 Revise error message.
19482 (print_notices): Remove final `.' from error message.
19483
19484 * src/reader.c (reader_output_yylsp):
19485 New function.
19486 (readgram): Use `#if 0' around code that accepted %command
19487 inside grammar rules: The documentation doesn't allow it,
19488 and it will fail since the %command processors scan for the next %.
19489 (parse_token_decl): Extended the %token
19490 declaration to allow a multi-character symbol as an alias.
19491 (parse_thong_decl): New function.
19492 (read_declarations): Added %thong declarations.
19493 (read_declarations): Handle NOOP to deal with allowing
19494 % declarations as another means to specify the flags.
19495 (readgram): Allow %prec prior to semantics embedded in a rule.
19496 (skip_to_char, read_declarations, copy_definition)
19497 (parse_token_decl, parse_start_decl, parse_type_decl)
19498 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
19499 (get_type_name, copy_guard, copy_action, readgram)
19500 (get_type, packsymbols): Revised most error messages.
19501 Changed `fatal' to `warnxxx' to avoid aborting for error.
19502 Revised and use multiple warnxxx functions to avoid using VARARGS1.
19503 (read_declarations): Improve the error message for
19504 an invalid character. Do not abort.
19505 (read_declarations, copy_guard, copy_action): Use
19506 printable_version to avoid unprintable characters in printed output.
19507 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
19508 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
19509 Allow the type of a non-terminal can be given
19510 more than once, as long as all specifications give the same type.
19511
19512 * src/output.c:
19513 (output_headers, output_trailers, output, output_gram)
19514 (output_rule_data): Implement noparserflag variable.
19515 Implement toknumflag variable.
19516 (output): Call reader_output_yylsp to output LTYPESTR.
19517
19518 * src/main.c (main):
19519 If reader sees an error, don't process the grammar.
19520 (fatals): Updated to not use VARARGS1.
19521 (printable_version, int_to_string, warn, warni, warns, warnss)
19522 (warnsss): New error reporting functions. Avoid abort for error.
19523
19524 * src/lex.h:
19525 Added THONG and NOOP for alias processing.
19526 Added SETOPT for the new code that allows setting options with %flags.
19527
19528 * src/lex.c:
19529 Include getopt.h. Add some extern decls.
19530 (safegetc): New function to deal with EOF gracefully.
19531 (literalchar); new function to deal with reading \ escapes.
19532 (lex): Use literalchar.
19533 (lex): Implemented "..." tokens.
19534 (literalchar, lex, parse_percent_token): Made tokenbuffer
19535 always contain the token. This includes growing the token
19536 buffer while reading an integer.
19537 (parse_percent_token): Replaced if-else statement with percent_table.
19538 (parse_percent_token): Added % declarations as another
19539 way to specify the flags -n, -l, and -r. Also added hooks for
19540 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
19541 major changes to files.c.
19542 (lex) Retain in the incoming stream a character following
19543 an incorrect '/'.
19544 (skip_white_space, lex): Revised most error messages
19545 and changed fatal to warn to avoid aborting.
19546 (percent_table): Added %thong declarations.
19547
19548 * src/gram.h: Comment changes.
19549
19550 * src/files.c (openfiles, open_extra_files, done):
19551 Add faction flag
19552 and actfile file. Handle noparserflag. Both for -n switch.
19553
19554 * src/conflicts.c (resolve_sr_conflict):
19555 Remove use of alloca.
19556
195571995-06-01 Jim Meyering <meyering@gnu.org>
19558
19559 * doc/bison.texinfo: *** empty log message ***
19560
195611995-05-06 Richard Stallman <rms@gnu.org>
19562
19563 * src/bison.s1: Comment change.
19564
195651995-05-06 Richard Stallman <rms@gnu.org>
19566
19567 * bison.simple: Comment change.
19568
195691995-05-03 Richard Stallman <rms@gnu.org>
19570
19571 * src/version.c: Version now 1.24.
19572
19573 * src/bison.s1: Change distribution terms.
19574
19575 * src/version.c: Version now 1.23.
19576
195771995-05-03 Richard Stallman <rms@gnu.org>
19578
19579 * doc/bison.texinfo:
19580 Rewrite "Conditions for Using Bison".
19581 Update version to 1.24.
19582
195831995-05-03 Richard Stallman <rms@gnu.org>
19584
19585 * bison.simple: Change distribution terms.
19586
195871995-02-23 Richard Stallman <rms@gnu.org>
19588
19589 * src/files.c: Test __VMS_POSIX as well as VMS.
19590
195911995-02-14 Jim Meyering <meyering@gnu.org>
19592
19593 * src/bison.s1 (__yy_memcpy):
19594 Renamed from __yy_bcopy to avoid
19595 confusion. Reverse FROM and TO arguments to be consistent with
19596 those of memcpy.
19597
195981995-02-14 Jim Meyering <meyering@gnu.org>
19599
19600 * bison.simple (__yy_memcpy):
19601 Renamed from __yy_bcopy to avoid
19602 confusion. Reverse FROM and TO arguments to be consistent with
19603 those of memcpy.
19604
196051994-11-10 David J. MacKenzie <djm@gnu.org>
19606
19607 * NEWS: reformat
19608
19609 * NEWS: New file.
19610
19611 * Makefile.in (DISTFILES): Include NEWS.
19612
19613 * Makefile.in (DISTFILES):
19614 Include install-sh, not install.sh.
19615
19616 * configure.in: Update to Autoconf v2 macro names.
19617
196181994-10-05 David J. MacKenzie <djm@gnu.org>
19619
19620 * Makefile.in: fix typo
19621
19622 * Makefile.in (prefix, exec_prefix):
19623 Let configure set them.
19624
196251994-09-28 David J. MacKenzie <djm@gnu.org>
19626
19627 * Makefile.in: Set datadir to $(prefix)/share.
19628
196291994-09-15 Richard Stallman <rms@gnu.org>
19630
19631 * src/bison.s1:
19632 Update copyright notice and GPL version.
19633
196341994-09-15 Richard Stallman <rms@gnu.org>
19635
19636 * bison.simple:
19637 Update copyright notice and GPL version.
19638
196391994-07-12 Richard Stallman <rms@gnu.org>
19640
19641 * src/reduce.c, src/reader.c:
19642 entered into RCS
19643
196441994-05-05 David J. MacKenzie <djm@gnu.org>
19645
19646 * Makefile.in: entered into RCS
19647
196481994-03-26 Richard Stallman <rms@gnu.org>
19649
19650 * src/bison.s1: entered into RCS
19651
196521994-03-26 Richard Stallman <rms@gnu.org>
19653
19654 * bison.simple: entered into RCS
19655
196561994-03-25 Richard Stallman <rms@gnu.org>
19657
19658 * src/main.c: entered into RCS
19659
196601994-03-24 Richard Stallman <rms@gnu.org>
19661
19662 * src/conflicts.c: entered into RCS
19663
196641994-01-02 Richard Stallman <rms@gnu.org>
19665
19666 * Makefile.in: *** empty log message ***
19667
196681993-11-21 Richard Stallman <rms@gnu.org>
19669
19670 * src/bison.s1: *** empty log message ***
19671
196721993-11-21 Richard Stallman <rms@gnu.org>
19673
19674 * doc/bison.texinfo: entered into RCS
19675
19676 * doc/bison.texinfo: *** empty log message ***
19677
196781993-11-21 Richard Stallman <rms@gnu.org>
19679
19680 * bison.simple: *** empty log message ***
19681
196821993-10-25 David J. MacKenzie <djm@gnu.org>
19683
19684 * doc/bison.texinfo: *** empty log message ***
19685
196861993-10-19 Richard Stallman <rms@gnu.org>
19687
19688 * src/bison.s1: *** empty log message ***
19689
196901993-10-19 Richard Stallman <rms@gnu.org>
19691
19692 * bison.simple: *** empty log message ***
19693
196941993-10-14 Richard Stallman <rms@gnu.org>
19695
19696 * src/bison.s1: *** empty log message ***
19697
196981993-10-14 Richard Stallman <rms@gnu.org>
19699
19700 * bison.simple: *** empty log message ***
19701
197021993-09-14 David J. MacKenzie <djm@gnu.org>
19703
19704 * doc/bison.texinfo: *** empty log message ***
19705
197061993-09-13 Noah Friedman <friedman@gnu.org>
19707
19708 * Makefile.in: *** empty log message ***
19709
197101993-09-10 Richard Stallman <rms@gnu.org>
19711
19712 * src/conflicts.c: *** empty log message ***
19713
19714 * src/system.h: entered into RCS
19715
197161993-09-10 Richard Stallman <rms@gnu.org>
19717
19718 * doc/bison.1: entered into RCS
19719
197201993-09-06 Noah Friedman <friedman@gnu.org>
19721
19722 * src/version.c: entered into RCS
19723
197241993-09-06 Noah Friedman <friedman@gnu.org>
19725
19726 * Makefile.in: *** empty log message ***
19727
197281993-07-30 David J. MacKenzie <djm@gnu.org>
19729
19730 * Makefile.in: *** empty log message ***
19731
197321993-07-24 Richard Stallman <rms@gnu.org>
19733
19734 * src/bison.s1: *** empty log message ***
19735
197361993-07-24 Richard Stallman <rms@gnu.org>
19737
19738 * bison.simple: *** empty log message ***
19739
197401993-07-08 David J. MacKenzie <djm@gnu.org>
19741
19742 * Makefile.in: *** empty log message ***
19743
197441993-07-04 Richard Stallman <rms@gnu.org>
19745
19746 * src/bison.s1: *** empty log message ***
19747
197481993-07-04 Richard Stallman <rms@gnu.org>
19749
19750 * bison.simple: *** empty log message ***
19751
197521993-06-26 David J. MacKenzie <djm@gnu.org>
19753
19754 * src/getargs.c: entered into RCS
19755
197561993-06-26 David J. MacKenzie <djm@gnu.org>
19757
19758 * doc/bison.texinfo: *** empty log message ***
19759
19760 * doc/bison.1: New file.
19761
197621993-06-25 Richard Stallman <rms@gnu.org>
19763
19764 * src/getargs.c: New file.
19765
197661993-06-16 Richard Stallman <rms@gnu.org>
19767
19768 * src/bison.s1: *** empty log message ***
19769
197701993-06-16 Richard Stallman <rms@gnu.org>
19771
19772 * bison.simple: *** empty log message ***
19773
197741993-06-03 Richard Stallman <rms@gnu.org>
19775
19776 * src/bison.s1: New file.
19777
197781993-06-03 Richard Stallman <rms@gnu.org>
19779
19780 * doc/bison.texinfo: *** empty log message ***
19781
197821993-06-03 Richard Stallman <rms@gnu.org>
19783
19784 * bison.simple: New file.
19785
197861993-05-19 Richard Stallman <rms@gnu.org>
19787
19788 * doc/bison.texinfo: New file.
19789
197901993-05-07 Noah Friedman <friedman@gnu.org>
19791
19792 * Makefile.in: *** empty log message ***
19793
197941993-04-28 Noah Friedman <friedman@gnu.org>
19795
19796 * src/reader.c: *** empty log message ***
19797
197981993-04-23 Noah Friedman <friedman@gnu.org>
19799
19800 * src/alloc.h: entered into RCS
19801
198021993-04-20 David J. MacKenzie <djm@gnu.org>
19803
19804 * src/version.c: *** empty log message ***
19805
19806 * src/files.c, src/allocate.c:
19807 entered into RCS
19808
19809 * src/reader.c: *** empty log message ***
19810
19811 * src/lex.c: entered into RCS
19812
19813 * src/conflicts.c: New file.
19814
19815 * src/symtab.c: entered into RCS
19816
19817 * src/alloc.h: New file.
19818
19819 * src/LR0.c: entered into RCS
19820
198211993-04-18 Noah Friedman <friedman@gnu.org>
19822
19823 * src/reader.c: New file.
19824
19825 * src/version.c: *** empty log message ***
19826
198271993-04-18 Noah Friedman <friedman@gnu.org>
19828
19829 * Makefile.in: *** empty log message ***
19830
198311993-04-17 Noah Friedman <friedman@gnu.org>
19832
19833 * Makefile.in: *** empty log message ***
19834
198351993-04-15 Richard Stallman <rms@gnu.org>
19836
19837 * src/main.c, src/files.c:
19838 New file.
19839
198401993-04-15 Noah Friedman <friedman@gnu.org>
19841
19842 * configure.in: entered into RCS
19843
19844 * configure.in: *** empty log message ***
19845
19846 * configure.in: New file.
19847
198481993-04-14 Richard Stallman <rms@gnu.org>
19849
19850 * Makefile.in: New file.
19851
198521993-04-13 Richard Stallman <rms@gnu.org>
19853
19854 * src/version.c: New file.
19855
198561993-03-25 Richard Stallman <rms@gnu.org>
19857
19858 * src/output.c: entered into RCS
19859
198601992-09-25 Richard Stallman <rms@gnu.org>
19861
19862 * configure.bat: entered into RCS
19863
198641992-06-22 Richard Stallman <rms@gnu.org>
19865
19866 * src/vmsgetargs.c: entered into RCS
19867
198681992-06-22 Richard Stallman <rms@gnu.org>
19869
19870 * doc/bison.rnh: entered into RCS
19871
198721992-04-20 David J. MacKenzie <djm@gnu.org>
19873
19874 * README: entered into RCS
19875
198761992-01-22 Richard Stallman <rms@gnu.org>
19877
19878 * src/machine.h: entered into RCS
19879
198801991-12-21 Richard Stallman <rms@gnu.org>
19881
19882 * src/lalr.c, src/closure.c:
19883 entered into RCS
19884
198851991-12-20 Richard Stallman <rms@gnu.org>
19886
19887 * src/state.h: entered into RCS
19888
198891991-12-18 Richard Stallman <rms@gnu.org>
19890
19891 * src/print.c, src/nullable.c, src/derives.c:
19892 entered into RCS
19893
198941991-11-03 David J. MacKenzie <djm@gnu.org>
19895
19896 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
19897 entered into RCS
19898
198991988-09-09 Richard Stallman <rms@gnu.org>
19900
19901 * src/bison.hairy: entered into RCS
19902
199031987-12-16 Richard Stallman <rms@gnu.org>
19904
19905 * REFERENCES: entered into RCS
19906
19907
19908 -----
19909
19910 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
19911 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
19912 Free Software Foundation, Inc.
19913
19914 Copying and distribution of this file, with or without
19915 modification, are permitted provided the copyright notice and this
19916 notice are preserved.
19917
19918$Id$