]> git.saurik.com Git - bison.git/blame - ChangeLog
* src/print-xml.c (print_core): Remove item set
[bison.git] / ChangeLog
CommitLineData
4c20d18d
WP
12007-10-11 Wojciech Polak <polak@gnu.org>
2
3 * src/print-xml.c (print_core): Remove item set
4 redundancy.
5 * data/xslt/bison.xsl (bison:ruleNumber): New key.
6 Improve processing time. Suggested by Joel E. Denny.
7 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
8 Write xsl:param "required" attribute as comment.
9 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
10 (xsl:template match="rule"): Support new reduced itemset.
11 (xsl:template match="point"): Remove.
12 * data/xslt/xml2xhtml.xsl: Likewise.
13
f506ad1c
JD
142007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
15
16 * src/getargs.c (version): Update copyright year.
17
21f1b063
JD
182007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
19
20 Make xml2dot.xsl and --graph produce the same output.
21 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
22 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
23 escaped later.
24 (xsl:template name="output-node"): Use the new escape template instead
25 of the string-replace template directly.
26 (xsl:template name="output-edge"): Likewise.
27 (xsl:template name="escape"): New, escapes backslashes and newlines in
28 addition to quotation marks.
29 * src/graphviz.c (start_graph, output_node, output_edge): Add
30 whitespace to output for legibility.
31
32 Make xml2text.xsl and --report produce the same output, and remove the
33 XML "conflicts" element since a conflict summary is easily extracted
34 from the automaton.
35 * data/xslt/bison.xsl: New.
36 (xsl:template match="state" mode="bison:count-conflicts): New.
37 * data/xslt/xml2text.xsl: Import bison.xsl.
38 (xsl:template match="bison-xml-report"): Instead of styling the
39 "conflicts" element, style the "automaton" element with mode
40 "conflicts". Unlike the former, the latter lists S/R and R/R
41 conflicts for a state on the same line.
42 (xsl:template match="conflicts"): Remove.
43 (xsl:template match="conflict"): Remove.
44 (xsl:template match="terminal"): Line-wrap the list of rules in which
45 the terminal is used.
46 (xsl:template match="nonterminal"): Likewise for nonterminals.
47 (xsl:template match="automaton" mode="conflicts"): New.
48 (xsl:template match="state" mode="conflicts"): New.
49 (xsl:template name="line-wrap"): New.
50 (xsl:template name="ws-search"): New.
51 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
52 (xsl:template match="bison-xml-report"): Instead of styling the
53 "conflicts" element, style the "automaton" element with mode
54 "conflicts."
55 (xsl:template match="conflicts"): Remove.
56 (xsl:template match="conflict"): Remove.
57 (xsl:template match="automaton" mode="conflicts"): New.
58 (xsl:template match="state" mode="conflicts): New.
59 * src/conflicts.c (conflicts_output_xml): Remove.
60 * src/conflicts.h (conflicts_output_xml): Remove prototype.
61 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
62 * src/print.c (print_grammar): Consistently wrap at the 66th column so
63 the corresponding XSLT is easier. Also, never wrap between a word and
64 the comma that follows it.
65
793fbca5
JD
662007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
67
68 Improve C++ namespace support. Discussed starting at
69 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
70 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
71 b4_namespace_close): New macros that interpret the %define variable
72 "namespace" so its value can contain "::" to indicate nested
73 namespaces.
74 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
75 the above macros.
76 * data/lalr1.cc (b4_namespace): Likewise.
77 * data/location.cc (b4_namespace): Likewise.
78 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
79 inside a new table in the general %define entry. Document `%define
80 namespace' there as well. Point the %name-prefix entry to it since it
81 explains it more completely in the case of C++.
82 (C++ Bison Interface): Mention `%define namespace' instead of
83 %name-prefix.
84 (Table of Symbols): Remove the `%define push_pull' entry. The %define
85 entry suffices.
86 * tests/c++.at (Relative namespace references): New test case.
87 (Absolute namespace references): New test case.
88 (Syntactically invalid namespace references): New test case.
89 * tests/input.at (C++ namespace reference errors): New test case.
90
35b8730d
JD
912007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
92
93 Add syncline support and location accessor to internal %define
94 interfaces.
95 * data/bison.m4 (b4_percent_define_get_loc): New.
96 (b4_percent_define_get_syncline): New.
97 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
98 (b4_percent_define_default): Record defining location as line 1 rather
99 than 0 for the sake of synchronizing #line's, and define
100 b4_percent_define_syncline(VARIABLE).
101 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
102 * src/muscle_tab.c (muscle_syncline_grow): New.
103 (muscle_code_grow): Use muscle_syncline_grow.
104 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
105 define b4_percent_define_syncline(VARIABLE).
106 (muscle_percent_define_get_loc): New.
107 (muscle_percent_define_get_syncline): New.
108 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
109 remove some unused variables.
110 (muscle_percent_define_default): Record defining location as line 1
111 rather than 0 for the sake of synchronizing #line's, and define
112 b4_percent_define_syncline(VARIABLE).
113 (muscle_percent_define_check_values): Use
114 muscle_percent_define_get_loc.
115 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
116 (muscle_percent_define_get_syncline): Prototype.
117 * tests/skeletons.at (%define Boolean variables: invalid skeleton
118 defaults): Update output for location change.
119 (Complaining during macro argument expansion): Extend to test
120 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
121
7dc4a694
JD
1222007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
123
124 Fix some error-reporting macro bugs.
125 * data/bison.m4 (b4_cat): New.
126 (b4_error, b4_error_at): Use b4_cat to send error directives directly
127 to stdout so they don't become arguments to other macros. Update
128 comments and add examples.
129 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
130 add examples.
131 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
132 after printing the error directive so that M4 doesn't report subsequent
133 problems that are induced by this problem.
134 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
135 instead of just in them. Recognize @\n in both places. Both expand to
136 the empty string. Needed by b4_cat.
137 * tests/skeletons.at (Complaining during macro argument expansion):
138 New test case.
139 (Fatal errors make M4 exit immediately): New test case.
140
d4bd2295
JD
1412007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
142
143 Implement --print-datadir.
144 * src/getargs.c (usage): Mention.
145 (PRINT_DATADIR_OPTION): New anonymous enum member.
146 (long_options): Add entry for it.
147 (getargs): Add case for it calling compute_pkgdatadir.
148 * src/output.c (output_skeleton): Encapsulate data directory
149 computation from here...
150 (prepare): ... and from here...
151 (compute_pkgdatadir): ... into this new function.
152 * src/output.h (compute_pkgdatadir): Prototype.
153
34cdeddf
JD
1542007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
155
156 * src/print-xml.c (escape_bufs): New static global variable
157 replacing...
158 (xml_escape_n): ... the static local variable buf here.
159 (print_xml): Free memory for escape_bufs.
160 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
161
d782395d
JD
1622007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
163
164 Replace `%push-parser' and `%push-pull-parser' with
165 `%define push_pull "push"' and `%define push_pull "both"'.
166 `%define push_pull "pull"' is the default.
167 * doc/bison.texinfo (Push Decl, Push Parser Function,
168 Pull Parser Function, Parser Create Function, Parser Delete Function):
169 Update declarations.
170 (Decl Summary, Table of Symbols): Replace %push-parser and
171 %push-pull-parser entries with a %define push_pull entry.
172 * data/bison.m4 (b4_percent_define_check_values): New macro.
173 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
174 definitions...
175 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
176 definitions...
177 * data/push.c: ... to here and compute them from the value of the
178 %define variable push_pull.
179 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
180 parsing requests here...
181 * data/yacc.c: ... hack this to switch to push.c any time
182 b4_use_push_pull_flag or the %define variable push_pull is set. This
183 will go away when we mv push.c yacc.c.
184 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
185 push parsing is not supported since unused %define variables are
186 reported anyway.
187 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
188 * src/muscle_tab.h (muscle_percent_define_check_values): Update
189 comments for consistency with b4_percent_define_check_values.
190 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
191 muscles.
192 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
193 Remove.
194 (prologue_declaration): Remove %push-parser and %push-pull-parser
195 rules.
196 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
197 * tests/calc.at: Update declarations.
198 * tests/input.at (%define enum variables): New test case.
199 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
200 declaration.
201 (Push Parsing: Multiple impure instances): Update declaration.
202 (Push Parsing: Unsupported Skeletons): New test case.
203 * tests/torture.at (Exploding the Stack Size with Alloca): Update
204 declaration.
205 (Exploding the Stack Size with Malloc): Update declaration.
206
3f999f78
WP
2072007-09-24 Wojciech Polak <polak@gnu.org>
208
209 Add XSLT transformations.
210
211 * data/xslt/xml2dot.xsl: Transform XML into DOT.
212 * data/xslt/xml2text.xsl: Transform XML into plain text.
213 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
214 * data/Makefile.am (xsltdir): New variable.
215 (dist_xslt_DATA): Add xslt/*.xsl files.
216
a4f75309
PE
2172007-09-23 Paul Eggert <eggert@cs.ucla.edu>
218
219 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
220 Problem reported by Wojciech Polak.
221 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
222 (xml_printf): Undo change I made on 21 September; that is,
223 indent 2 spaces, not 1.
224
ad5feac4
JD
2252007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
226
227 Pacify ./configure --enable-gcc-warnings.
228 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
229 `char const *' instead of `char *'.
230 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
231 local variable `sep'.
232
41d7a5f2
PE
2332007-09-21 Paul Eggert <eggert@cs.ucla.edu>
234
235 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
236 elsewhere.
237 * src/print-xml.c: Prefer "const" after types; that's more consistent.
238 (xml_printf): Indent just 1 space for level.
239 (e_char, xlate_char): Remove.
240 (xml_escape_string): Rewrite to avoid undefined behavior (used
241 storage that was freed from the stack).
242 (xml_escape_n): Don't bother checking for subscript error.
243
3f999f78
WP
2442007-09-21 Wojciech Polak <polak@gnu.org>
245
246 Add Bison XML Automaton Report.
41d7a5f2
PE
247
248 Add support for an -x option to generate an XML report.
249 It is not documented yet.
250 * src/print-xml.c: New file.
251 * src/print-xml.h: Likewise.
252 * lib/timevar.def (TV_XML): New var.
253 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
254 * src/conflicts.c: Include print-xml.h.
255 (solved_conflicts_xml_obstack): New var.
256 (log_resolution, conflicts_solve, conflicts_free):
257 Add support for XML report.
258 (conflicts_output_val): New function.
259 * src/conflicts.h (conflicts_output_val): New decl.
260 * src/files.c (spec_xml_file): New var.
261 (compute_output_file_names, output_file_names_free): Add XML support.
262 * src/files.h (spec_xml_file): New decl.
263 * src/getargs.c (xml_flag): New var.
264 (usage, short_options, long_options, getargs): Add XML support.
265 * src/getargs.h (xml_flag): New decl.
266 * src/gram.c: Include print-xml.h.
267 (rule_lhs_print_xml, rule_rhs_print_xml):
268 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
269 New functions.
270 * src/gram.h: Declare external ones.
271 * src/main.c: Include print-xml.h.
272 (main): Add XML support.
273 * src/reduce.c: Include print-xml.h.
274 (reduce_xml): New function.
275 * src/reduce.h: Declare it.
276 * src/state.c: Include print-xml.h.
277 (state_new): Add XML support.
278 (state_rule_lookahead_tokens_print_xml): New function.
279 * src/state.h: Declare it.
280 (struct state): New member solved_conflicts_xml.
281 * src/symtab.c (symbol_class_get_string): New function.
282 * src/symtab.h: Declare it.
283
6d8e724d
PE
2842007-09-21 Paul Eggert <eggert@cs.ucla.edu>
285
286 * GNUmakefile: Switch to coreutils's version.
287 * bootstrap: Likewise.
288 * Makefile.cfg: Adjust to new GNUmakefile.
289 * README-hacking: Likewise.
290
291 Import from gnulib:
292
293 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
294 Bruno Haible <bruno@clisp.org>
295
296 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
297 and is a script that invokes bison. Tighten the code. Add comments.
298
922bdd7f
JD
2992007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
300
301 Spell "boolean" as "Boolean". Reported by Akim Demaille.
302 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
303 * doc/bison.texinfo (Decl Summary): Fix.
304 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
305 * tests/input.at (Boolean %define variables): Update output.
306 * tests/skeletons.at (%define boolean variables: invalid skeleton
307 defaults): Rename to...
308 (%define Boolean variables: invalid skeleton defaults): ... this and
309 update output.
310
1b17b01d
JD
3112007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
312
313 In impure push mode, don't allow more than one yypstate to be allocated
314 since multiple impure parsers would corrupt yynerrs.
315 * data/push.c (yypstate_allocated): New static global variable
316 initialized to 0.
317 (yypull_parse): If yypstate_new returns 0, don't report it as memory
318 exhaustion if yypstate_allocated is 1, but still return 2.
319 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
320 already 1. Otherwise, set it to 1.
321 (yypstate_delete): Set it to 0.
322 * tests/push.at (Push Parsing: Multiple impure instances): New test
323 case.
324
9987d1b3
JD
3252007-08-17 Bob Rossi <bob@brasko.net>
326
327 * doc/bison.texinfo (Push Decl): Document the push parser.
328 (Table of Symbols): Ditto.
329 (Pure Decl): Ditto.
330 (Decl Summary): Ditto.
331 (Multiple Parsers, Push Parser Function, Pull Parser Function,
332 Parser Create Function, Parser Delete Function):
333 Add new push parser symbols.
334 (Table of Symbols): Document push-parser, push-pull-parser,
335 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
336
f16b0819
PE
3372007-08-15 Paul Eggert <eggert@cs.ucla.edu>
338
339 Update to GPLv3.
340 * doc/gpl-3.0.texi: New file.
341 * doc/gpl.texi: Remove.
342 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
343 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
344 * README-hacking, TODO, bootstrap, bootstrap.conf:
345 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
346 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
347 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
348 * data/lalr1.cc, data/lalr1.java, data/location.cc:
349 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
350 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
351 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
352 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
353 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
354 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
355 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
356 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
357 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
358 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
359 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
360 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
361 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
362 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
363 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
364 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
365 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
366 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
367 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
368 * src/complain.c, src/complain.h, src/conflicts.c:
369 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
370 * src/files.h, src/flex-scanner.h, src/getargs.c:
371 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
372 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
373 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
374 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
375 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
376 * src/print.c, src/print.h, src/print_graph.c:
377 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
378 * src/reduce.h, src/relation.c, src/relation.h:
379 * src/revision.h, src/scan-code.h, src/scan-code.l:
380 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
381 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
382 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
383 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
384 * tests/Makefile.am, tests/actions.at, tests/c++.at:
385 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
386 * tests/existing.at, tests/glr-regression.at:
387 * tests/headers.at, tests/input.at, tests/java.at:
388 * tests/local.at, tests/output.at, tests/push.at:
389 * tests/reduce.at, tests/regression.at, tests/sets.at:
390 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
391 * tests/torture.at:
392 Update to GPLv3.
393
728c4be2
JD
3942007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
395
396 Get rid of broken %no-parser, -n, and --no-parser implementation and
397 documentation.
398 * TODO: Don't mention them.
399 * doc/bison.1: Likewise.
400 * doc/bison.texinfo (Decl Summary): Likewise.
401 (Bison Options): Likewise.
402 (Option Cross Key): Likewise.
403 * src/getargs.c (no_parser_flag): Remove global variable.
404 (usage): Don't print description of -n and --no-parser.
405 (long_options): Remove --no-parser entry here.
406 (getargs): Remove -n case in the switch here.
407 * src/getargs.h (no_parser_flag): Remove extern.
408 * tests/regression.at (Web2c Actions): Remove comment that mentions
409 --no-parser.
410
5d31a216
JD
4112007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
412
413 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
414 name user variables starting with `yy'. Just pass NULL instead of a
415 dummy local &yylval to yypush_parse.
416 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
417 starting with `yy'.
418
a2ea208d
JD
4192007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
420
421 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
422 true since it's then always used regardless of whether yyoverflow is
423 defined. Reported by Christian Burger at
424 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
425 * THANKS: Add Christian Burger.
426
91661ebb
JD
427 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
428 node names: say "Decl Summary" not "Bison Declaration Summary".
429
cbd50549
JD
4302007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
431
432 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
433 determine whether this function has already complained about an invalid
434 value for a %define boolean variable, don't check whether Bison has
435 ever examined the value. As written, the check was a tautology.
436 Instead, record and check for this complaint using a separate muscle.
437
eb1b0740
JD
4382007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
439
440 Fix push parsing memory leak reported by Brandon Lucia at
441 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
442 * THANKS: Add Brandon Lucia.
443 * data/push.c (yypstate_delete): Free the stack if it was reallocated
444 but the parse never completed and thus freed it.
445 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
446 * tests/testsuite.at: Include push.at.
447 * test/push.at: New.
448 (Push Parsing: Memory Leak for Early Deletion): New test case.
449
9d774aff
JD
4502007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
451
452 Improve handling of multiple S/R conflicts in the same state and of S/R
453 conflicts involving multiple reductions.
454 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
455 set for a state here or Bison will abort if it is reassigned on a
456 later conflicted reduction in the same state.
457 Similarly, don't finalize and assign the solved conflicts report here
458 or it will be lost if it is reassigned on a later conflicted reduction
459 in the same state.
460 (set_conflicts): Instead, assign them both here after all S/R conflicts
461 in the state have been fully examined.
462 * src/print.c (shift_set): Rename to...
463 (no_reduce_set): ... this.
464 (print_reductions): Update for rename, and add %nonassoc error action
465 tokens to no_reduce_set so that, when printing the first remaining
466 reduction on an error action token, the reduction is enclosed in
467 brackets.
468 (print_results): Update for rename.
469 * tests/conflicts.at (Solved conflicts report for multiple reductions
470 in a state): New test case.
471 (%nonassoc error actions for multiple reductions in a state): New test
472 case.
473
474 * src/main.c (main): Don't depend on C99 features.
475
10159d2a
JD
4762007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
477
478 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
479 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
480 uniwidth.
10159d2a 481
953b3935
JD
4822007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
483
484 * bootstrap (slurp): Create target directories that don't exist.
485 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
486
6ce2d93a
JD
4872007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
488
489 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
490 than item number.
491 * closure.c (closure): Likewise.
492 * state.h (reductions): Comment sorting of rules.
493 (state): Comment sorting of items.
494
ce3448d5
JD
4952007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
496
497 Fix C++ test cases after recent Gnulib changes. Discussed starting at
498 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
499 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
500 definition in order to avoid Gnulib headers since we don't use config.h
501 here.
502 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
503 rather than AT_DATA so that config.h is included.
504
8a86eef0
JD
5052007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
506
507 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
508 instead of fprintf. Guard these functions with #if YYDEBUG instead of
509 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
510 and so that YYFPRINTF is guaranteed to be defined here.
511
b1a81613
JD
5122007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
513
514 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
515 with...
516 (muscle_percent_define_check_values): ... this more helpful function.
517 Again, it's not used yet, but it will be.
518 * src/muscle_tab.h: Likewise.
519
71b61d4d
JD
520 Improve some comments in parser table construction.
521 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
522 (generate_states): Don't mention ruleset, which is internal to closure.
523 * src/closure.c (closure): Explain sorting of core and itemset, which
524 is required for this function to behave correctly.
525 * src/closure.h (closure): Mention sorting.
526
2a6b783d
JD
5272007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
528
529 * src/lalr.c (state_lookahead_tokens_count): For code readability,
530 move the check for disabled transitions to an aver since conflict
531 resolution hasn't happened yet.
532
533 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
534 labels a state as inconsistent just because it has error transitions.
535 The original form of this check appeared in revision 1.1 of lalr.c,
536 which was committed on 1991-12-21. Now (at least), changing the
537 consistency label on such a state appears to have no useful effect in
538 any of the places it is examined, which I enumerate below. The key
539 point to understanding each item in this enumeration is that a state
540 with an error transition is labelled consistent in the first place only
541 if it has no rules, so the check cannot matter for states that have
542 rules. (1) Labelling a state as inconsistent will cause set_conflicts
543 to try to identify its conflicts, and a state must have *rules* to have
544 conflicts. (2) Labelling a state as inconsistent will affect how
545 action_row sets the default *rule* for the state. (3) Labelling a
546 state as inconsistent will cause build_relations to add lookback edges
547 to *rules* in that state.
548 * src/state.h (struct state): Word the comment for member consistent
549 more carefully.
550
14462c2b
JD
5512007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
552
553 Don't depend on C99 features.
554 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
555 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
556 * src/reader.c (check_and_convert_grammar): Fix for-loop.
557 * src/state.c (state_mark_reachable_states): Fix for-loop.
558 (state_remove_unreachable_states): Fix for-loop.
559
560 Don't widen struct state with member reachable just to temporarily
561 record reachability. Instead, use a local bitset.
562 * src/state.h (struct state): Remove member.
563 * src/state.c (state_new): Don't initialize it.
564 (state_mark_reachable_states): Rename to...
565 (state_record_reachable_states): ... this, and use bitset.
566 (state_remove_unreachable_states): Use bitset.
567
5a43d418
JD
5682007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
569
570 * src/Makefile.am (yacc): Quote target action commands properly so
571 that the yacc script isn't corrupt. Reported by Hans Aberg at
572 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
573
0c650a20
JD
574 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
575 the case of pure parsers. Reported by Frans Englich at
576 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
577 * THANKS: Add Frans Englich.
578
61fee93e
JD
579 * NEWS (2.3a+): In the %code entry, reference section `Bison
580 Declaration Summary' from the manual now since the %code summary has
581 moved there.
582 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
583 in the rules section must be terminated by semicolons.
584
f124d423
JD
5852007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
586
587 Extend the front-end API for %define variables to more completely
588 mirror the back-end. This will be useful in the future.
589 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
590 Update comments to mention the new front-end counterparts of these
591 macros.
592 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
593 for muscle_string_decode and muscle_location_decode.
594 (muscle_string_decode): New static function.
595 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
596 (muscle_percent_define_get, muscle_percent_define_ifdef): New
597 functions.
598 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
599 muscle_percent_define_get to mimic the b4_percent_define_flag_if
600 implementation more closely.
601 (muscle_percent_define_invalid_value): New function.
602 * src/muscle_tab.h (muscle_percent_define_get,
603 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
604 Prototype.
605
75ad86ee
JD
6062007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
607
608 * NEWS (2.3a+): Mention yesterday's state-removal change.
609 (2.3a): Remove the %language entry, which was added after 2.3a.
610 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
611 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
612 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
613 tests/existing.at: Update copyright date.
614
5967f0cf
JD
6152007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
616
617 If conflict resolution makes states unreachable, remove those states,
618 report rules that are then unused, and don't report conflicts in those
619 states.
620 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
621 New global function.
622 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
623 function.
624 * src/main.c (main): After conflict resolution, remove the unreachable
625 states and update all data structures that reference states by number.
626 * src/state.c (state_new): Initialize each state's reachable member to
627 false.
628 (state_mark_reachable_states): New static function.
629 (state_remove_unreachable_states): New global function.
630 * src/state.h (struct state): Add member bool reachable.
631 (state_remove_unreachable_states): Prototype.
632 * tests/conflicts.at (Unreachable States After Conflict Resolution):
633 New test case.
634 * tests/existing.at (GNU pic Grammar): Update test case output now that
635 an unused rule is discovered.
636
b09f4f48
JD
6372007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
638
639 Minor code cleanup in parser table construction.
640 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
641 (new_itemsets, save_reductions): Update for rename to nitemset.
642 * src/closure.c (nritemset): Rename to...
643 (nitemset): ... this since the "r" appears to meaningless and isn't
644 used in the comments.
645 (closure): Update for rename.
646 * src/closure.h (nritemset): Update extern to...
647 (nitemset): ... this.
648 * src/lalr.c (LA): Fix a typo in comments.
649 * src/print.c (print_core): Update for rename to nitemset.
650 * src/print_graph.c (print_graph): Likewise.
651 * src/state.h: Fix some typos in header comments.
652
bbb44d83
PE
6532007-04-04 Paul Eggert <eggert@cs.ucla.edu>
654
9b33de72
PE
655 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
656 still sticks to ASCII. Sorry!
657
bbb44d83
PE
658 * README-hacking: New file, taken mostly from coreutils, with changes
659 for Bison. Contains much of the contents of:
660 * README-cvs: Remove.
661 * bootstrap: Sync from gnulib.
662 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
663 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
664
29553547
JD
6652007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
666
667 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
668 Setzer.
669 (Java Differences): Fix some typos.
670 * THANKS: Add Sebastian Setzer.
671
01b477c6
PB
6722007-03-07 Paolo Bonzini <bonzini@gnu.org>
673
674 * data/java.m4 (b4_single_class_if): Remove.
675 (b4_abstract_if): Look at "%define abstract".
676 (b4_lexer_if): New.
677 (b4_union_name): Rename...
678 (b4_yystype): ... to this. Map to "%define stype".
679 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
680 b4_maybe_throws): Fix quoting.
681 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
682 * data/lalr1.java (Lexer interface): Always define.
683 (Lexer interface within parser class): Remove.
684 (YYLexer class): New, used when "%code lexer" is present.
685 (constructor): When "%code lexer" is used, pass %lex-param
686 to the lexer constructor.
687 (yylex, yyparse): Remove %lex-param from method invocations
688 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
689
690 * doc/bison.texinfo (Java Bison Interface): Mention "%define
691 abstract". Rename "%define union_name" to "%define stype".
692 Rename method names according to previous patch.
693 (Java Scanner Interface): Describe "%code lexer" instead of
694 "%pure-parser" and "%define single_class".
695 (Java Differences): Mention "%code lexer".
696
697 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
698 Include scanner here, using macros from tests/local.at.
699 (AT_DATA_CALC_Y): Remove final argument.
700 (_AT_CHECK_JAVA_CALC): Likewise.
701 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
702 of %locations and %error-verbose.
703 (main): Test with and without %lex-param.
704 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
705 (AT_BISON_OPTION_POPDEFS): Pop it.
706
122bea3a
JMG
7072007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
708
709 DJGPP spefic issue. Inhibit the use of disallowed characters for
710 file name genertion on Win98, WinXP, etc. These are |<>":?*\
711 and concern testsuite case 46.
712 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
713 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
714 * djgpp/config.bat: Inhibit the use of disallowed characters.
715
9611cfa2
JD
7162007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
717
718 Miscellaneous %define and %code cleanup.
719 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
720 values are interpreted.
721 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
722 documentation a little more.
723 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
724 muscle_percent_define_insert, muscle_percent_code_grow): New
725 functions/macros.
726 * src/muscle_tab.h (muscle_percent_define_insert,
727 muscle_percent_code_grow): Prototype.
728 * src/parse-gram.y (prologue_declaration): Use
729 muscle_percent_define_insert and muscle_percent_code_grow when parsing
730 %define and %code directives.
731
732 Make it easy to share %define boolean variables between the front-end
733 and back-end. Though not used yet, this will be useful in the future.
734 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
735 Bison uses of names rather than just skeleton uses of names.
736 (b4_percent_define_get, b4_percent_define_ifdef): Rename
737 b4_percent_define_skeleton_variables(VARIABLE) to
738 b4_percent_define_bison_variables(VARIABLE).
739 (b4_percent_code_get, b4_percent_code_ifdef): Rename
740 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
741 b4_percent_code_bison_qualifiers(QUALIFIER).
742 (b4_check_user_names_wrap): Update for renames.
743 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
744 muscle_percent_define_default): New functions mimicking
745 b4_percent_define_flag_if and b4_percent_define_default.
746
747 For %define variables, report locations for invalid values and
bbb44d83 748 redefinitions.
9611cfa2
JD
749 * data/bison.m4 (b4_percent_define_flag_if): Read
750 b4_percent_define_loc(VARIABLE) to report the location of an invalid
751 value for VARIABLE.
752 (b4_percent_define_default): Save a special location in
753 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
754 must later be reported as invalid.
755 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
756 functions.
757 (muscle_percent_define_insert): Record the location of VARIABLE in
758 muscle percent_define_loc(VARIABLE), and use it to report the previous
759 location for a redefinition.
760 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
761 (muscle_percent_define_default): Update like b4_percent_define_default.
762 (muscle_grow_user_name_list): Rename to...
763 (muscle_user_name_list_grow): ... this for consistency and use
764 muscle_location_grow.
765 * src/muscle_tab.h (muscle_location_grow): Prototype.
766 * tests/input.at (%define errors): Update expected output.
767 * tests/skeletons.at (%define boolean variables: invalid skeleton
768 defaults): New test case.
769
0bf92491
JD
7702007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
771
772 * src/print.c (lookahead_set, state_default_rule): Remove.
773 (print_reductions): Replace state_default_rule invocation with
774 equivalent use of yydefact, which was computed in token_actions in
775 tables.c.
776 (print_results): Don't allocate lookahead_set.
777
d3b12988
PB
7782007-02-27 Paolo Bonzini <bonzini@gnu.org>
779
780 * data/lalr1.java: Prefix all private members with yy.
781
f57a7536
JD
7822007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
783
784 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 785 Sebastien Fricker at
f57a7536 786 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 787 * THANKS: Add Sebastien Fricker.
f57a7536
JD
788 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
789 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
790 accept a variable number of arguments.
791
6404a5bf
JD
7922007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
793
794 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
795
e4e09639
JMG
7962007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
797
798 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
799 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
800 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
801
d7e0a1a7
PE
8022007-02-11 Paul Eggert <eggert@cs.ucla.edu>
803
804 Undo my 2007-02-07 change, switching back to the c-strcase module
805 introduced in the 2007-02-03 change. Bruno Haible reported that
806 the 2007-02-07 change would be dangerous in Turkish if we add a
807 language whose name contains "i", since "i" is not lowercase "I"
808 in Turkish.
809 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
810 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
811 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
812 * m4/.cvsignore: Remove strcase.m4.
813 * src/getargs.c: Revert 2007-02-07 change, as follows.
814 Include c-strcase.h.
815 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
816
deee93a1
JD
8172007-02-11 Bruno Haible <bruno@clisp.org>
818
819 Enable the Java related testsuite tests when the only Java compiler
820 found is a gcj < 4.3. Discussed at
821 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
822 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
823
574add85
JD
8242007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
825
826 * data/Makefile.am: Update copyright date.
827 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
828 yypstate_new returns NULL.
829 (yypstate_new): Return NULL if malloc does.
830 * src/reader.c (packgram): Move translation of rule actions from the
831 beginning of packgram to...
832 (check_and_convert_grammar): ... here right before packgram is invoked
833 so it's easier to write more complete comments, and remove redundant
834 code.
835
e785ccf7
JD
8362007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
837
838 As in semantic actions, make @$ in %initial-action, %destructor, and
839 %printer imply %locations.
840 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
841 scanning @$.
842 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
843 (@$ in %initial-action implies %locations,
844 @$ in %destructor implies %locations,
845 @$ in %printer implies %locations): ... these new test cases.
846
1cfe1ed7
PE
8472007-02-07 Paul Eggert <eggert@cs.ucla.edu>
848
849 Undo most of the 2007-02-03 change, switching to the strcase module
850 now that gnulib strcase has been fixed.
851 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
852 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
853 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
854 * m4/.cvsignore: Add strcase.m4.
855 * src/getargs.c: Revert 2007-02-03 change, as follows.
856 Don't include c-strcase.h.
857 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
858 strcasecmp has "unspecified behavior" outside the POSIX locale,
859 but it works fine in practice if at least one argument is ASCII,
860 as is the case in Bison.
861
0049ec86
PB
8622007-02-07 Paolo Bonzini <bonzini@gnu.org>
863
864 * tests/java.at: Skip tests if only one of javac/java is present.
865 Reported by Joel E. Denny.
866 * tests/atlocal.in: Adjust copyright years.
867
8682007-02-05 Paolo Bonzini <bonzini@gnu.org>
869
870 * data/lalr1.java (Stack): Work around old verifiers that disallow
871 access to the private fields of an inner class, from the outer class.
872 We can make Stack's fields public because user code doesn't have access
873 to the instance of Stack used by parse(). Reported by Paul Eggert.
874
2c2b7220
PE
8752007-02-03 Paul Eggert <eggert@cs.ucla.edu>
876
877 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
878 the right spot for these files?
879 * bootstrap.conf (gnulib_modules): Add c-strcase.
880 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
881 c-strncasecmp.c.
882 * src/getargs.c: Include c-strcase.h.
883 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
884 to avoid unspecified behavior.
885
b2b81dae
JD
8862007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
887
888 * doc/bison.texinfo (Decl Summary): Correct typo.
889
c1d19e10
PB
8902007-01-30 Paolo Bonzini <bonzini@gnu.org>
891
892 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
893 Complain if the value does not match empty, "true" or "false".
894 * data/c++.m4: Adjust default definitions of %define variables.
895 * data/java.m4: Adjust default definitions of %define variables.
896 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
897 to above behavior.
898 * tests/input.at (Boolean %define variables): Test new behavior.
899
8405b70c
PB
9002007-01-29 Paolo Bonzini <bonzini@gnu.org>
901
902 * NEWS: Mention java.
903 * TODO: Remove things that are done.
904 * bootstrap.conf: Add javacomp-script and javaexec-script.
905 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
906
907 * data/Makefile.am: Add new files.
908 * data/java-skel.m4: New.
909 * data/java.m4: New.
910 * data/lalr1.java: New.
911
912 * doc/bison.texinfo: Put "A Complete C++ Example" under
913 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
914 under Other Languages.
915
916 * src/getargs.c (valid_languages): Add Java.
917 * src/getargs.h (struct bison_language): Update size of string fields.
918
919 * tests/Makefile.am: Add java.at.
920 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
921 * tests/java.at: New.
922 * tests/testsuite.at: Include it.
923
3eb82471
JD
9242007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
925
926 Clean up.
927 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
928 at_directive_argv arguments so these no longer have to be global
929 variables. Also, update the implementation for the following changes.
930 (fail_for_at_directive_too_many_args,
931 fail_for_at_directive_too_few_args): Add at_directive_name argument.
932 (at_directive_name): Remove as at_directive_argv[0] will be used for
933 this now.
934 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
935 for the directive name.
936 (at_directive_argc, at_directive_argv): Make these local within
937 skel_lex instead of global.
938 (INITIAL): Update directive start action for above changes.
939 (SC_AT_DIRECTIVE_ARG): Rename to...
940 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
941 (SC_AT_DIRECTIVE_SKIP_WS): Update.
942 (scan_skel): Move yylex_destroy to...
943 (skel_scanner_free): ... here.
944 * tests/skeletons.at (installed skeleton file name): Rename to...
945 (installed skeleton file names): ... this.
946
148d66d8
JD
9472007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
948
949 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
950 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
951 Summary" not "Directives".
952 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
953 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
954 since the former is now the more complete one.
955 (Prologue Alternatives): Likewise and do the same for %defines.
956 (Table of Symbols): Add summary of %code, add summary of %define, and
957 move full %code documentation to...
958 (Decl Summary): ... here for consistency with other entries in these
959 sections.
960 Move %define entry in order to keep this list alphabetized.
961 Reword %define entry a little to put less emphasis on the skeleton
962 concept, which most users shouldn't have to think about.
963
665f0c24
PE
9642007-01-26 Paul Eggert <eggert@cs.ucla.edu>
965
966 Adjust to recent gnulib changes.
967 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
968 Add string.h, string_.h, unistd_.h, wchar_.h.
969 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
970 * src/system.h: Don't include <stpcpy.h>; this is now done by
971 <string.h>.
972
592d0b1e
PB
9732007-01-23 Paolo Bonzini <bonzini@gnu.org>
974
975 Simplify implementation of unqualified %code, implement macros for
976 uniform treatment of boolean %define flags. Document %define.
977 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
978 b4_percent_code_ifdef): New.
979 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
980 * data/c++.m4: Define default value for global_tokens_and_yystype.
981 * data/glr.cc: Likewise.
982 * data/location.cc: Use b4_percent_define_flag_if.
983
148d66d8 984 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
985
986 * src/parse-gram.y (Unqualified %code): Change muscle name to
987 b4_percent_code().
988 (content.opt): Default to empty.
989
a7867f53
JD
9902007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
991
992 Implement support for relative and absolute skeleton file names.
993 Discussed starting at
994 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
995 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
996 (Bison Options): Document in --skeleton entry.
997 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
998 full_skeleton can't necessarily hold all of pkgdatadir.
999 If the specified skeleton file name contains a `/', don't prepend
1000 pkgdatadir.
1001 * src/parse-gram.y (prologue_declaration): If the specified skeleton
1002 file name contains a `/', prepend the grammar file directory.
1003 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
1004 * skeletons.at: New file.
1005 (relative skeleton file names): New test case.
1006 (installed skeleton file names): New test case.
1007 * tests/testsuite.at: Include skeletons.at.
1008
1009 * bootstrap: Update copyright to 2007.
1010
830c9b18
PB
10112007-01-17 Paolo Bonzini <bonzini@gnu.org>
1012
1013 * bootstrap: Remove occurrences of .#bootmp from the files.
1014
a8c2e813
AD
10152007-01-17 Akim Demaille <akim@epita.fr>
1016
1017 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
1018 nonterminals.
1019 Use per-type %printer.
1020
279cabb6
JD
10212007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1022
1023 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
1024 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1025 djgpp/config.site, src/files.c, src/files.h, src/main.c,
1026 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
1027 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
1028 tests/glr-regression.at, tests/input.at, tests/local.at,
1029 tests/output.at, tests/torture.at: Update copyright to 2007.
1030
bb32f4f2
AD
10312007-01-16 Akim Demaille <akim@epita.fr>
1032
1033 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
1034 error code.
1035 (Calc++ Scanner): Exit with failure if we can't open the input
1036 file.
1037 Accept "-" standing for stdin.
1038 (Calc++ Top Level): Print the result only if the parsing was
1039 successful.
1040
7cff04b5
AD
10412007-01-16 Akim Demaille <akim@epita.fr>
1042
1043 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
1044
a4e25e1d
JD
10452007-01-15 Paolo Bonzini <bonzini@gnu.org>
1046 and Joel E. Denny <jdenny@ces.clemson.edu>
1047
1048 Clean up %define and %code implementation in M4 some. Most
1049 importantly, rename all related macros to be in the b4_percent_define
1050 and b4_percent_code namespaces. Also, complete support for `.' in
1051 %define variable names and %code qualifiers.
1052 * data/bison.m4 (b4_check_user_names): Check for special
1053 "SKELETON-NAMESPACE(name)" macros instead of using two nested
1054 m4_foreach loops.
1055 (b4_get_percent_define, b4_get_percent_code): Rename to...
1056 (b4_percent_define_get, b4_percent_code_get): ... these.
1057 Extend documentation with examples.
1058 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
1059 b4_percent_define_skeleton_variables and
1060 b4_percent_code_skeleton_qualifiers.
1061 Expect any value for the %define variable `foo' to be stored in the
1062 macro named `b4_percent_define(foo)'; expect any %code blocks for the
1063 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
1064 expect any unqualified %code blocks to be stored in a macro named
1065 `b4_percent_code_unqualified'.
1066 Use m4_indir so that %define variable names and %code qualifiers can
1067 contain `.', which is allowed by the grammar parser.
1068 (b4_percent_define_default): New macro to set a default value for a
1069 %define variable.
1070 (m4_wrap): Update wrapped code, and fix some underquoting.
1071 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
1072 Expect grammar uses of %define variables and %code qualifiers to be
1073 defined in b4_percent_define_user_variables and
1074 b4_percent_code_user_qualifiers.
1075 * data/c++.m4: Use b4_percent_define_default rather than
1076 m4_define_default. Fix some underquoting. Skeleton usage of %define
1077 variable define_location_comparison now implies skeleton usage of
1078 %define variable filename_type.
1079 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1080 data/push.c, data/yacc.c: Update macro names.
1081 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
1082 muscle names.
1083
e37c665c
JMG
10842007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1085
1086 DJGPP specific issues.
1087
1088 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
1089 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
1090
7d2d521f
JD
10912007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1092
1093 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
1094 run parsers in all tests so that Valgrind is invoked during
1095 maintainer-check-valgrind.
1096 (Duplicate representation of merged trees): Free all semantic values.
1097 (Duplicated user destructor for lookahead): Likewise.
1098
e0ac9b4b
JD
10992007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1100
1101 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
1102 command-line prefix.
1103 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
1104 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
1105 miss Valgrind messages.
1106 (Exploding the Stack Size with Malloc): Likewise.
1107
78143faa
JD
11082007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1109
1110 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
1111 locals. Reported by Juan Manuel Guerrero at
1112 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
1113 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
1114 Fix some indentation also.
1115 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
1116 explaining this issue.
1117
7ecec4dd
JD
11182007-01-09 Paolo Bonzini <bonzini@gnu.org>
1119 and Joel E. Denny <jdenny@ces.clemson.edu>
1120
1121 Simplify union and prologue handling, and escape union and lex/parse
1122 params with digraphs.
1123 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
1124 values to the empty string since these are no longer guaranteed
1125 initialized by the front-end.
1126 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
1127 braces around b4_user_stype since this is no longer done by the
1128 front-end.
1129 * src/files.c, src/files.h (pre_prologue_obstack,
1130 post_prologue_obstack): Remove.
1131 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
1132 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
1133 with digraphs. This fixes lex params and parse params.
1134 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
1135 * src/output.c (prepare): Remove muscle insertion of the prologues.
1136 (output): Remove freeing of pre_prologue_obstack and
1137 post_prologue_obstack.
1138 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
1139 than prologue_augment for prologue parsing so you don't need prologue
1140 obstacks.
5c80250c
JD
1141 (grammar_declaration): For %union RHS, use `braceless' instead of
1142 "{...}" so that braces are already stripped and code is escaped with
1143 digraphs.
7ecec4dd
JD
1144 * src/reader.c (prologue_augment): Remove.
1145 (reader): Remove initialization of pre_prologue_obstack and
1146 post_prologue_obstack.
1147 * src/reader.h (prologue_augment): Remove.
1148
1149 * data/c.m4: Remove stray parenthesis.
1150
16dc6a9e
JD
11512007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1152
1153 Remove quotes from variables names in %define directives and from
1154 qualifiers in %code directives, and restrict the characters that are
1155 allowed in them to M4-friendly ones. For %define, continue to support
1156 the quoted form as a deprecated feature. Discussed starting at
1157 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
1158 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
1159 %code.
1160 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
1161 (Decl Summary): In %defines entry, update mention of `%code requires'
1162 and `%code provides'.
16dc6a9e
JD
1163 (C++ Location Values): Update %define uses.
1164 (Calc++ Parser Interface): Likewise.
1165 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 1166 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
1167 * src/parse-gram.y (prologue_declaration): For %define variables, use
1168 `variable' instead of `STRING'.
1169 (grammar_declaration): For %code qualifiers, use `ID' instead of
1170 `STRING'.
1171 (variable): New nonterminal that takes an `ID' or a `STRING'.
1172 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
1173 and %define uses.
1174 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
1175 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
1176 (%define errors): Update %define uses.
1177
e9813cd4
JD
11782007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1179
1180 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
1181 instead of muscle_insert for %define values so that M4-special
1182 characters are replaced with digraphs.
1183 * tests/input.at (%define errors): Extend to check weird values.
1184
6afc30cc
JD
11852007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1186
1187 Instead of having skeletons declare all valid %define variables and
1188 %code qualifiers, provide macros that retrieve the associated values
1189 and build these lists automatically. Thus Bison will now warn when a
1190 variable or qualifier is not used by the skeleton in the current
1191 invocation regardless of whether it might sometimes be used by that
1192 skeleton in other invocations. Also, move all %define value macros to
1193 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
1194 form, which is replaced by %code.
1195 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
1196 (b4_check_user_names): ... this, and change the series of valid name
1197 arguments to a single list argument for names used in the skeleton
1198 similar to the existing list argument for names used in the grammar.
1199 Warn instead of complaining.
1200 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
1201 values and %code code, to format %code code properly, and to build
1202 lists of all %define variables and %code qualifiers used in the
1203 skeleton: b4_skeleton_percent_define_variables and
1204 b4_skeleton_percent_code_qualifiers.
1205 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
1206 Remove, and...
1207 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
1208 the skeleton names lists can finish building first. In place of
1209 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
1210 expect the lists b4_user_percent_define_variables and
1211 b4_user_percent_code_qualifiers.
1212 * data/c++.m4: Where setting default values for b4_parser_class_name,
1213 b4_location_type, b4_filename_type, b4_namespace, and
1214 b4_define_location_comparison, update their names to the
1215 b4_percent_define_ namespace.
1216 * data/glr.c: Don't use b4_check_percent_define_variables and
1217 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1218 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
1219 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 1220 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
1221 * data/location.cc: Use b4_get_percent_define.
1222 * data/push.c: Don't use b4_check_percent_define_variables and
1223 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1224 * data/yacc.c: Likewise, and don't call m4_exit in
1225 b4_use_push_for_pull_if or m4_wrap code will never execute.
1226 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
1227 Rename to...
1228 (muscle_grow_user_name_list): ... this for consistency with the
1229 terminology used in bison.m4.
1230 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
1231 %define variable names, and rename muscle used_percent_define_variables
1232 to user_percent_define_variables.
1233 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
1234 user_percent_code_qualifiers.
1235 (content): Remove.
1236 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
1237 {CODE} form is no longer accepted.
1238 * tests/input.at (Reject bad %code qualifiers): Rename to...
1239 (Reject unused %code qualifiers): ... this, and update test output.
1240 (%define error): Update test output.
1241
7eb8a0bc
JD
12422007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
1243
1244 Check for unrecognized %define variables similar to checking for
1245 unrecognized %code qualifiers. Check for redefined %define variables.
1246 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
1247 generalizes...
1248 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
1249 (b4_check_percent_define_variables): New, also wraps it.
1250 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
1251 variables using b4_check_percent_define_variables.
1252 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
1253 all those exercised in the test suite and all those listed in the
1254 `Default values' section of c++.m4. Are there others?
1255 * data/push.c, data/yacc.c: Declare no valid %define variables.
1256 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
1257 similar to muscle_find, but it works even when the muscle stores a
1258 const value.
1259 (muscle_grow_used_name_list): New function for constructing the used
1260 name list muscles that b4_check_for_unrecognized_names requires.
1261 * src/parse-gram.y (prologue_declaration): Warn if a variable is
1262 %define'd more than once. Define the b4_used_percent_define_variables
1263 muscle with muscle_grow_used_name_list.
1264 (grammar_declaration): Abbreviate %code code with
1265 muscle_grow_used_name_list.
1266 * tests/input.at (%define errors): New.
1267
3fc65ead
JD
12682007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1269
1270 Provide warn_at, complain_at, and fatal_at function callbacks to the
1271 skeletons, and use this for %code qualifier complaints.
1272 * data/bison.m4 (b4_error_at): New, invoked by...
1273 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
1274 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
1275 @fatal_at(...@) directives.
1276 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
1277 qualifiers in b4_used_percent_code_qualifiers and to use
1278 b4_complain_at.
1279 * src/location.c, src/location.h (boundary_set_from_string): New global
1280 function.
1281 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
1282 function.
1283 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
1284 to b4_used_percent_code_qualifiers.
1285 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
1286 function.
1287 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
1288 (lineno): Rename to...
1289 (out_lineno): ... this so I don't misunderstand it again.
1290 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
1291 here; these newlines are in the input but not the output file.
1292 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
1293 (at_directive_perform): ... this new static function, and add handling
1294 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
1295 directives.
1296 * tests/input.at (Reject bad %code qualifiers): Update test output with
1297 locations and extend.
1298
1299 * tests/output.at (Output file name: [, Output file name: ]): Remove
1300 bogus comment about these tests failing.
1301
1c7b7e1d
JD
13022007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1303
1304 Clean up b4_check_percent_code_qualifiers a little.
1305 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
1306 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
1307 documentation and add examples.
1308 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
1309 qualifiers here.
1310
08af01c2
JD
13112007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
1312
1313 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
1314 unreliable -- especially when they're hidden inside another macro.
1315 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
1316 data/c.m4: Remove m4_divert(-1).
1317 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1318 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
1319 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 1320 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
1321 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
1322 pushed and popped by m4sugar, should be first on the stack.
1323
1324 Provide warn, complain, and fatal function callbacks to the skeletons.
1325 This provides more flexibility than m4_fatal, improves the error
1326 message format, and captures messages for translation. Discussed
1327 starting at
1328 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
1329 * data/bison.m4 (b4_error): New, invoked by...
1330 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
1331 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
1332 directives. Because these M4 macros might be called when the current
1333 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
1334 the previous removal of uses of m4_divert, which caused trouble.
1335 (b4_check_percent_code_qualifiers): Use b4_complain instead of
1336 m4_fatal to report unrecognized %code qualifiers.
1337 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
1338 push parser requests.
1339 * data/glr.c: Use b4_complain instead of m4_fatal to report
1340 non-deterministic push parser requests.
1341 Update @output usage to @output(...@) form.
1342 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
1343 report missing %defines. Update @output usage to @output(...@) form.
1344 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
1345 @output(...@) form.
1346 * src/main.c (main): Invoke skel_scanner_free.
1347 * src/scan-skel.h (skel_scanner_free): Prototype new function.
1348 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
1349 obstack_for_string from flex-scanner.h.
1350 (YY_DECL): Use to declare skel_lex static.
1351 (decode_at_digraphs): Remove; now handled in the new
1352 SC_AT_DIRECTIVE_ARG start condition.
1353 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
1354 functions.
1355 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
1356 at_directive_argv): New static globals.
1357 (INITIAL): Use fail_for_invalid_at.
1358 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
1359 recognize the start of a generalized `@directive(...@)' form and
1360 start...
1361 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
1362 directive args (using the new obstack_for_string), to decode the
1363 contained @ diagraphs, and to perform the directive. It recognizes
1364 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
1365 @output(...@).
1366 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
1367 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
1368 `@,'.
1369 (scan_skel): Initialize obstack_for_string on the first call.
1370 (skel_scanner_free): New function to free obstack_for_string.
1371 * tests/input.at (Reject bad %code qualifiers): Update test output.
1372
8e0a5e9e
JD
13732007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
1374
1375 Consolidate the 4 prologue alternative directives (%code, %requires,
1376 %provides, and %code-top) into a single %code directive with an
1377 optional qualifier field. Discussed at
1378 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
1379 * NEWS (2.3a+): Rewrite the existing entry for the prologue
1380 alternatives.
1381 * doc/bison.texinfo (Prologue Alternatives): Update.
1382 (Decl Summary): Update to %code "requires" and %code "provides".
1383 (Calc++ Parser): Update to %code "requires".
148d66d8 1384 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
1385 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
1386 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
1387 are replaced by b4_percent_code_provides and b4_percent_code_requires,
1388 which are skeleton-specific.
1389 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
1390 declare what %code qualifiers it supports and to complain if any other
1391 qualifiers were used in the grammar.
1392 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
1393 and b4_user_code([b4_percent_code_provides]) in place of
1394 b4_user_requires and b4_user_provides.
1395 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
1396 Add b4_user_code([b4_percent_code_top]) and
1397 b4_user_code([b4_percent_code]).
1398 Invoke b4_check_percent_code_qualifiers.
1399 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
1400 PERCENT_REQUIRES): Remove.
1401 (grammar_declaration): Remove RHS's for %code-top, %provides, and
1402 %requires. Rewrite the %code RHS as the unqualified form defining the
1403 muscle b4_percent_code. Add another RHS for the qualified %code form,
1404 which defines muscles of the form b4_percent_code_QUALIFIER and the
1405 b4_used_percent_code_qualifiers muscle.
1406 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
1407 PERCENT_REQUIRES): Remove.
1408 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
1409 %code "requires" and %code "provides".
1410 * tests/input.at (Reject bad %code qualifiers): New.
1411
95021767
JD
14122007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
1413
1414 Use the new code_props interface for destructors and printers.
1415 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
1416 printer_location members, and change the type of the destructor and
1417 printer members to code_props.
1418 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
1419 symbol_printer_get, semantic_type_destructor_set,
1420 semantic_type_printer_set, default_tagged_destructor_set,
1421 default_tagless_destructor_set, default_tagged_printer_set,
1422 default_tagless_printer_set): Use code_props in arguments and return
1423 types in place of char const * and location.
1424 (symbol_destructor_location_get, symbol_printer_location_get): Remove
1425 since the locations are now contained in the return of
1426 symbol_destructor_get and symbol_printer_get.
1427 * src/output.c (symbol_destructors_output, symbol_printers_output):
1428 Replace with...
1429 (symbol_code_props_output): ... this to eliminate duplicate code.
1430 (output_skeleton): Update to use symbol_code_props_output.
1431 * src/reader.c (symbol_should_be_used): Update use of
1432 symbol_destructor_get.
1433 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1434 Update uses of the various _destructor_set and _printer_set functions.
1435 * src/symtab.c: (default_tagged_destructor_location,
1436 default_tagless_destructor_location, default_tagged_printer_location,
1437 default_tagless_printer_location): Remove since we...
1438 (default_tagged_destructor, default_tagless_destructor,
1439 default_tagged_printer, default_tagless_printer): ... change the type
1440 of these to code_props.
1441 (symbol_new, semantic_type_new, symbol_destructor_set,
1442 semantic_type_destructor_set, symbol_destructor_get,
1443 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
1444 symbol_check_alias_consistency, default_tagged_destructor_set,
1445 default_tagless_destructor_set, default_tagged_printer_set,
1446 default_tagless_printer_set): Update.
1447 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
1448 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
1449 code_props members.
1450 (symbol_print): Use SYMBOL_CODE_PRINT.
1451
f6857bbf
JD
14522007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
1453
1454 Use the new code_props interface for rule actions.
1455 * src/symlist.h (symbol_list): Replace action, action_location, and
1456 used members with a code_props action_props member.
1457 * src/reader.c (symbol_should_be_used, grammar_rule_check,
1458 grammar_midrule_action, grammar_current_rule_merge_set,
1459 grammar_current_rule_symbol_append, packgram): Update.
1460 * src/scan-code.h (translate_rule_action): Remove, no longer used.
1461 * src/scan-code.l (handle_action_dollar): Update.
1462 (translate_rule_action): Remove, no longer used.
1463 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
1464
7c0c6181
JD
14652007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1466
1467 Use the new code_props interface in parse-gram.y.
1468 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
1469 Update all uses of translate_* functions to use the new code_props
1470 interface and to use gram_scanner_last_string_free and
1471 code_scanner_last_string_free where possible.
1472 (grammar_declaration): symbol_list_destructor_set and
1473 symbol_list_printer_set now perform the translation, so don't do it
1474 here. Use gram_scanner_last_string_free where possible.
1475 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
1476 translate_code): Remove, no longer used.
1477 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
1478 symbol_list_printer_set): Perform code translation here rather than
1479 depending on the caller to do so.
1480
1481 * src/symlist.h (struct symbol_list): Correct some documentation typos.
1482 * src/scan-gram.h (gram_last_string): Remove declaration.
1483 * src/scan-gram.l (last_string): Declare it static.
1484
28e52c0d
JD
14852007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1486
1487 Encapsulate code properties and related functionality for the various
1488 destructors, printers, and actions into a code_props structure and
1489 interface. This patch merely implements code_props in scan-code.h and
1490 scan-code.l. Future patches will rewrite other modules to use it.
1491 Discussed starting at
1492 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
1493 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
1494 consistently initialize const structs that have an empty location
1495 field.
1496 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
1497 to ensure consistency.
1498 * src/scan-code.h (code_props): New structure.
1499 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
1500 function, macro, and const global variable for initializing a
1501 code_props with no code.
1502 (code_props_plain_init, code_props_symbol_action_init,
1503 code_props_rule_action_init, code_props_translate_code): The rest of
1504 the new code_props functional interface. Among other things, the init
1505 functions set the code_props kind field so that
1506 code_props_translate_code will know whether to behave like
1507 translate_symbol_action, translate_rule_action, or translate_code.
1508 These old translate functions must remain until all other modules are
1509 updated to use the new code_props interface.
1510 (code_scanner_last_string_free): New function similar to
1511 gram_scanner_last_string_free.
1512 (code_scanner_free): Add documentation.
1513 * src/scan-code.l: Implement the new interface.
1514 (code_lex): Make it static, add a code_props* argument, and remove the
1515 rule argument.
1516 (last_string): New static global similar to the one in scan-gram.l.
1517 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
1518 instead of rule.
1519 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
1520 code_props since Bison may one day use this information for destructors
1521 and printers.
1522 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
1523 (handle_action_dollar): Use symbol_list_n_get and set used flag
1524 directly since symbol_list_n_used_set is removed.
1525 (translate_action): Add a code_props* argument and remove the rule,
1526 action, and location arguments. Pass the code_props* on to code_lex.
1527 (translate_rule_action, translate_symbol_action, translate_code):
1528 Rewrite as wrappers around the new code_props interface.
1529 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
1530 it would eventually need to break the encapsulation of code_props.
1531
96034983
JD
15322007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
1533
1534 * etc/.cvsignore: New.
1535
945e396c
JD
15362007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
1537
1538 Add maintainer-push-check to run maintainer-check using push parsing in
1539 place of pull parsing where available.
1540 * Makefile.am (maintainer-push-check): New.
1541 * data/bison.m4 (b4_use_push_for_pull_if): New.
1542 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
1543 appropriately based on their existing values.
1544 (yypush_parse): Don't print push-parser-specific diagnostics if push
1545 parsing is being used in place of pull parsing.
1546 * data/yacc.c: If push parsing should replace pull parsing, redirect to
1547 push.c.
1548 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
1549 variable, and insert b4_use_push_for_pull_flag into muscles.
1550 * tests/Makefile.am (maintainer-push-check): New.
1551
7d596384
JD
15522006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
1553
1554 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
1555 (whether successful or failed) so that yypush_parse can be invoked
1556 again to start a new parse using the same yypstate.
1557 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
1558 check multiple yypull_parse invocations on the same yypstate. For pull
1559 mode, extend to check multiple yyparse invocations.
1560 (Exploding the Stack Size with Alloca): Extend to try with
1561 %push-pull-parser.
1562 (Exploding the Stack Size with Malloc): Likewise.
1563
1564 * tests/calc.at (Simple LALR Calculator): Don't specify
1565 %skeleton "push.c" since %push-pull-parser implies that now.
1566 * tests/headers.at (export YYLTYPE): Don't check for the push
1567 declarations. Otherwise, this test case can't be used to see if push
1568 mode can truly emulate pull mode.
1569 * tests/input.at (Torturing the Scanner): Likewise.
1570 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
1571 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
1572 AT_YACC_IF, which now includes the case of push mode since %skeleton
1573 need not be used for push mode. This will be more intuitive once
1574 push.c is renamed to yacc.c.
1575
7172e23e
JD
15762006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
1577
1578 For push mode, convert yyparse from a macro to a function, invoke yylex
1579 instead of passing a yylexp argument to yypull_parse, and don't
1580 generate yypull_parse or yyparse unless %push-pull-parser is declared.
1581 Discussed starting at
1582 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
1583 * data/bison.m4 (b4_pull_if): New.
1584 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
1585 * data/push.c: Improve M4 quoting a little.
1586 (b4_generate_macro_args, b4_parenthesize): Remove.
1587 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
1588 any time a pull parser is requested.
1589 Don't #define this as a wrapper around yypull_parse. Instead, when
1590 both push and pull are requested, make it a function that does that
1591 same thing.
1592 (yypull_parse): If there's a b4_prefix, #define this to
1593 b4_prefix[pull_parse] when both push and pull are requested.
1594 Don't define this as a function unless both push and pull are
1595 requested.
1596 Remove the yylexp argument and hard-code yylex invocation instead.
1597 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
1598 %push-parser.
1599 * src/getargs.c (pull_parser): New global initialized to true.
1600 * getargs.h (pull_parser): extern it.
1601 * src/output.c (prepare): Insert pull_flag muscle.
1602 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
1603 (prologue_declaration): Set both push_parser and pull_parser = true for
1604 %push-pull-parser. Set push_parser = true and pull_parser = false for
1605 %push-parser.
1606 * src/scan-gram.l: Don't accept %push_parser as an alternative to
1607 %push-parser since there's no backward-compatibility concern here.
1608 Scan %push-pull-parser.
1609 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
1610 instead of %push-parser.
1611 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
1612 prototype it in the module that calls yyparse.
1613 * tests/input.at (Torturing the Scanner): Likewise.
1614 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
1615
2e7944cb
JD
16162006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
1617
1618 Update etc/bench.pl. Optimize push mode a little (the yyn change
1619 deserves most of the credit).
1620 * Makefile.am (SUBDIRS): Add etc subdirectory.
1621 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
1622 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
1623 yytoken, yyval, and yyloc declarations to...
1624 (yyparse or yypush_parse): ... here to improve performance. For
1625 yypush_parse invocations after the first, be sure to assign yyn its old
1626 value again.
1627 (yypstate_new): Don't bother initializing the yyresult field since the
1628 initial value isn't used.
1629 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
1630 remove the #define that, in push mode, set it to yyps->NAME.
1631 * etc/Makefile.am: New.
1632 * etc/bench.pl: Remove and build it instead from...
1633 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
1634 "tests/bison" from the build directory by default rather than just
1635 invoking "bison" from $PATH.
1636 (calc_grammar): Update push parser code: don't declare yylval globally,
1637 don't define yyparse_wrapper, and don't #define yyparse.
1638 (bench_grammar): Update to check all working combinations of yacc.c,
1639 push.c, impure, pure, pull, and push.
1640
c3d50342
JD
16412006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1642
1643 For push mode, add pull wrappers around yypush_parse.
1644 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
1645 (yypull_parse): New function wrapping yypush_parse.
1646 (yyparse): New #define wrapping yypull_parse.
1647 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
1648 is declared.
1649 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
1650 prototype yylex in the module that calls yyparse, and don't prototype
1651 yyparse there. Otherwise, the yyparse expansion won't compile.
1652 * tests/input.at (Torturing the Scanner): Likewise.
1653
94ebeba5
JD
16542006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1655
1656 Enable push parsers to operate in impure mode. Thus, %push-parser no
1657 longer implies %pure-parser. The point of this change is to move
1658 towards being able to test the push parser code by running the entire
1659 test suite as if %push-parser had been declared.
1660 * data/push.c (yypush_parse): For impure mode, remove the
1661 yypushed_char, yypushed_val, and yypushed_loc arguments.
1662 Instead, declare these as local variables initialized to the global
1663 yychar, yylval, and yylloc.
1664 For the first yypush_parse invocation only, restore the initial values
1665 of these global variables when it's time to read a token since they
1666 have been overwritten.
1667 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
1668 %push-parser.
1669 * tests/calc.at (Simple LALR(1) Calculator): Always declare
1670 %pure-parser along with %push-parser since this test case was designed
1671 for pure push parsers.
1672 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
1673 (AT_YACC_OR_PUSH_IF): New.
1674 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
1675 add a note that it's still wrong for some cases (as it has been for a
1676 while).
1677 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
1678 %push-parser no longer implies %pure-parser.
1679
a0633178
JD
16802006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1681
1682 Remove some unnecessary differences between the pull parser code and
1683 the push parser code. This patch enables yynerrs in push mode.
1684 * data/push.c: Reformat M4 a little.
1685 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
1686 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
1687 because push mode is on. Instead, if pure mode is on, move yynerrs
1688 to...
1689 (b4_declare_parser_state_variables): ... here.
1690 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
1691 to yyps->NAME so it can be used in yypush_parse.
1692 (yypush_parse): Don't omit uses of yynerrs in push mode.
1693
8646b6a3
JD
16942006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1695
1696 Fix bug such that the first pushed token's value and location are
1697 sometimes overwritten (sometimes by %initial-action) before being used.
1698 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
1699 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
1700 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
1701 more closely mimic the pull parser logic.
1702 Don't copy the pushed token to yychar, yylval, and yylloc until it's
1703 time to read a token, which is after any initialization of yylval and
1704 yylloc.
1705 (gottoken): Rename label to...
1706 (yyread_pushed_token): ... for clarity and to avoid infringing on the
1707 user namespace.
1708
9baf4d74
JD
17092006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1710
1711 Rearrange initialization of the parser state variables so that the
1712 skeleton doesn't have to have a copy for pull mode and another for push
1713 mode. This patch also fixes at least a bug such that yylloc was not
1714 initialized (with b4_location_initial_line and
1715 b4_location_initial_column) upon calling yypush_parse. However, that
1716 initialization now overwrites the first token's location;
1717 %initial-action assigning @$ already did the same thing, and both bugs
1718 will be fixed in a later patch.
1719 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
1720 (b4_declare_parser_state_variables): Remove initialization of yytoken,
1721 yyss, yyvs, yyls, and yystacksize.
1722 (yypstate_new): Remove initialization of some yypstate fields: yystate,
1723 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
1724 yylsp.
1725 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
1726 yyps->NAME so it can be used in yypush_parse.
1727 (yyparse or yypush_parse): For yypush_parse, don't print the
1728 "Starting parse" diagnostic for invocations after the first.
1729 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
1730 yypush_parse, only do it for the first invocation.
1731 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
1732 initialization to occur in yypush_parse but only on the first
1733 invocation.
1734
23522164
JD
17352006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1736
1737 * data/push.c: Add CPP guards around push parser declarations in both
1738 the header and the code file.
1739 In the code file, move the push parser declarations to the same place
1740 they appear in the header file.
1741 Clean up the M4 some, especially the inconsistent underquoting in
1742 some b4_c_function_def and b4_c_function_decl uses.
1743
bb010fe5
JD
17442006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1745
1746 Encapsulate the push parser state variables into an M4 macro so the
1747 push skeleton doesn't have to list them again for pull mode's yyparse.
1748 For push mode, remove yypush_parse's local equivalents of these
1749 variables to eliminate unnecessary copying between the two sets at
1750 run-time. This patch also fixes at least a bug related to multiple
1751 %initial-action invocations in push mode.
1752 * data/push.c (b4_declare_parser_variables): Rename to...
1753 (b4_declare_scanner_communication_variables): ... this for clarity and
1754 update both uses.
1755 (b4_declare_yyparse_variables): Remove and move its contents to the one
1756 spot where it was invoked.
1757 (b4_declare_parser_state_variables): New macro containing the parser
1758 state variables required by push mode.
1759 (struct yypstate): Replace all fields but yynew with
1760 b4_declare_parser_state_variables.
1761 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
1762 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
1763 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
1764 (yyparse or yypush_parse): For yyparse in pull mode, replace local
1765 parser state variable declarations with
1766 b4_declare_parser_state_variables.
1767 Don't initialize parser state variables when calling yypush_parse since
1768 yypstate_new already does that.
1769 Invoke the user's initial action only upon the first yypush_parse
1770 invocation.
1771 Remove all code that copies between the local parser state variables
1772 and the yypstate.
1773
2d212f8c
JD
17742006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
1775
1776 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
1777 prevent a name collision in a future patch where these names will
1778 sometimes be #define'd.
1779 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
1780 since it no longer has the same name as the existing argument.
1781 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
1782
e6e704dc
JD
17832006-12-19 Paolo Bonzini <bonzini@gnu.org>
1784 and Joel E. Denny <jdenny@ces.clemson.edu>
1785
1786 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
1787 that the argument is case-insensitive, and there's no `=' here.
1788 For the %skeleton entry, mention that %language is better.
1789 (Bison Options): Likewise for --language and --skeleton. Move the
1790 --skeleton entry so that the `Tuning the parser' section is sorted
1791 alphabetically on long options.
1792 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
1793 %language directive in detail here; cross-reference the %language
1794 documentation instead.
1795 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
1796 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 1797 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
1798 * examples/extexi (normalize): Instead of replacing every %require
1799 argument with the current Bison version, just substitute for
1800 `@value{VERSION}'. This guarantees that we're testing what actually
1801 appears in the documentation.
1802 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
1803 rather than `@VERSION@'.
1804
0e021770
PE
18052006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1806
fd575f05
PE
1807 * NEWS: Reword the %language news a bit, and put it earlier.
1808
0e021770
PE
1809 * src/getargs.c (skeleton_arg): Last arg is now location const *.
1810 Rewrite to simplify the logic.
1811 (language_argmatch): Likewise.
fd575f05
PE
1812 (program_name): We now own this var.
1813 * src/getargs.h (struct bison_language): Use char[] rather than
1814 const char *.
0e021770
PE
1815
1816 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
1817 Java is supported.
1818 * src/complain.c (program_name): Remove decl; no longer needed.
1819 * src/main.c (program_name): Remove; now belongs to getargs.
1820
18212006-12-18 Paolo Bonzini <bonzini@gnu.org>
1822
1823 * NEWS: Document %language.
1824
1825 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
1826
1827 * data/c-skel.m4, data/c++-skel.m4: New files.
1828 * data/glr.c: Complain on push parsers.
1829
1830 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
1831 over %skeleton.
148d66d8 1832 (Decl Summary): Document %language and %skeleton.
0e021770
PE
1833 (Command line): Document -L.
1834
1835 * examples/extexi: Rewrite %require directive.
1836 * examples/calc++/Makefile.am: Pass VERSION to extexi.
1837
1838 * src/files.c (compute_exts_from_gc): Look in language structure
1839 for .y extension.
1840 (compute_file_name_parts): Check whether .tab should be added.
1841 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
1842 (language, skeleton_arg, language_argmatch): New.
1843 (long_options): Add --language.
1844 (getargs): Use skeleton_arg, add -L/--language.
1845 * src/getargs.h: Include location.h.
1846 (struct bison_language, language, skeleton_arg, language_argmatch): New.
1847 * src/output.c (prepare): Pick default skeleton from struct language.
1848 Don't dispatch C skeletons here.
1849 * src/parse-gram.y (PERCENT_LANGUAGE): New.
1850 (prologue_declaration): Add "%language" rule, use skeleton_arg.
1851 * src/scan-gram.l ("%language"): New rule.
1852
1853 * tests/calc.at: Test %skeleton and %language.
1854 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
1855 (AT_GLR_IF): Look for %skeleton "glr.cc".
1856 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
1857 (AT_YACC_IF): Reject %language.
1858
5691bf57
PE
18592006-12-18 Paul Eggert <eggert@cs.ucla.edu>
1860
db06f0ce
PE
1861 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
1862 since it wasn't used; only the typedef name 'semantic_type' is needed.
1863 Also, omit trailing white space.
1864
5691bf57
PE
1865 * bootstrap: Sync from coreutils.
1866 (gnulib_extra_files): Add build-aux/announce.gen.
1867 (slurp): Adjust .gitignore files like .cvsignore files.
1868 * build-aux/announce-gen: Remove from CVS, since bootstrap
1869 now creates this.
1870
791934e4
JD
18712006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
1872
1873 Make %push-parser imply %pure-parser. This fixes several bugs; see
1874 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
1875 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
1876 pure_parser = true.
1877 * data/push.c: Don't bother testing b4_push_if when deciding whether
1878 to expand b4_declare_parser_variables globally.
1879 (yypush_parse): Likewise in here.
1880
1881 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
1882 (yy_reduce_print): Reformat M4 for readability.
1883
ee5abb37
JD
18842006-12-15 Bob Rossi <bob@brasko.net>
1885 and Joel Denny <jdenny@ces.clemson.edu>
1886
1887 * data/push.c (yypstate): Add typedef, and update all uses of
1888 struct yypstate to just yypstate.
1889 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
1890
16ca01f9
JD
18912006-12-14 Bob Rossi <bob@brasko.net>
1892
1893 * data/push.c (yypush_parse): Declare prototype regardless of
1894 %locations option.
1895
ab8e7e1a
JD
18962006-12-14 Bob Rossi <bob@brasko.net>
1897
1898 * data/push.c (yyparse): Remove the prototype and the #define when in
1899 push-parser mode.
1900
9bf32be3
JD
19012006-12-13 Bob Rossi <bob@brasko.net>
1902
1903 * data/push.c (yypstate_init): Rename to...
1904 (yypstate_new): ... this and use b4_c_function_def.
1905 (yypstate_delete): New.
1906 (yypush_parse): Change parameters yynval and yynlloc to be const.
1907 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
1908 yypstate_delete functions.
1909
f02e2948
JD
19102006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
1911
1912 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
1913 strange test case titles. Reported by Bob Rossi.
1914
38eb7751
PE
19152006-12-13 Paul Eggert <eggert@cs.ucla.edu>
1916
1917 * TODO: Add pointer to Sylvain Schmitz's work on static detection
1918 of potential ambiguities in GLR grammers.
1919
bd9d212b
JD
19202006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
1921
1922 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
1923 `bison ', use m4_index instead of m4_substr since chopping up a string
1924 containing M4-special characters causes problems here.
1925
1926 Fix a couple of bugs related to special characters in user-specified
1927 file names, and make it easier for skeletons to compute output file
1928 names with the same file name prefix as Bison-computed output file
1929 names.
1930 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
1931 b4_parser_file_name and b4_spec_defines_file instead of
1932 @output_parser_name@ and @output_header_name@, which are now redundant.
1933 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
1934 b4_parser_file_name, b4_spec_defines_file, and the new
1935 @basename(FILENAME@) instead of @output_parser_name@ and
1936 @output_header_name@, which inappropriately escaped the file names as
1937 C string literals.
1938 * src/files.c (all_but_ext): Remove static qualifier.
1939 (compute_output_file_names): Move `free (all_but_ext)' to...
1940 (output_file_names_free): ... here since all_but_ext is needed later.
1941 * src/files.h (all_but_ext): Extern.
1942 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
1943 exactly what MUSCLE_INSERT_STRING used to do.
1944 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
1945 characters are escaped properly.
1946 * src/output.c (prepare): Define muscle file_name_all_but_ext as
1947 all_but_ext.
1948 For pkgdatadir muscle, maintain previous functionality by using
1949 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
1950 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
1951 digraphs would never be expanded. Hopefully no one has M4-special
1952 characters in his Bison installation path.
1953 * src/scan-skel.l: Don't parse @output_header_name@ and
1954 @output_parser_name@ anymore since they're now redundant.
1955 In @output, use decode_at_digraphs.
1956 Parse a new @basename command that invokes last_component.
1957 (decode_at_digraphs): New.
1958 (BASE_QPUTS): Remove unused.
1959 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
1960 (Output file name): New tests.
1961
3f7ca628
JD
19622006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
1963
1964 Warn about output files that are generated by the skeletons and that
1965 conflict with other output files.
1966 * data/glr.c: Don't generate the header file here when glr.cc does.
1967 * src/files.c (file_names, file_names_count): New static globals.
1968 (compute_output_file_names): Invoke output_file_name_check for files
1969 not generated by the skeletons and remove existing checks.
1970 (output_file_name_check): New function that warns about conflicting
1971 output file names.
1972 (output_file_names_free): Free file_names.
1973 * src/files.h (output_file_name_check): Declare.
1974 * src/scan-skel.l: Invoke output_file_name_check for files generated by
1975 the skeletons.
1976 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
1977 (Conflicting output files): New tests.
1978
178e123e
PE
19792006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
1980
1981 * doc/bison.texinfo: Fix a couple of typos.
1982
19832006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
1984
1985 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
1986 Rename to...
1987 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
1988 update all uses.
1989 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
1990 (yypush_parse): Rename yypvars argument to yyps and remove redundant
1991 local pv.
1992 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
1993 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
1994
ea17f233
JD
19952006-12-07 Bob Rossi <bob@brasko.net>
1996 and Joel Denny <jdenny@ces.clemson.edu>
1997
1998 * data/push.c (yypvarsinit): Change return type from void* to struct
1999 yypvars*. No longer cast to void* on return.
2000 (struct yypvars): Remove yylen since it need not be remembered between
2001 yypushparse invocations.
2002 (yypushparse): Don't copy between yylen and pv->yylen.
2003
55a30bda
JD
20042006-12-05 Bob Rossi <bob@brasko.net>
2005
2006 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
2007 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
2008 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
2009 (struct yypvars): Remove b4_declare_parser_variables.
2010 (yypvarsinit): Remove init code for removed variables.
2011 (global scope): Do not declare b4_declare_parser_variables if
2012 push or pure mode.
2013 (yypushparse): Add b4_declare_parser_variables.
2014 Init new local variables, and remove init code for removed
2015 yypvars variables.
2016 (yyparse): Delete.
2017 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
2018 and yyparse for other modes.
2019 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
2020 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
2021 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
2022 (AT_PURE_LEX_IF): True if pure or push parser.
2023
85894313
JD
20242006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
2025
2026 Document Yacc prologue alternatives and default %destructor's and
2027 %printer's as experimental. Don't mention Java yet. Discussed at
2028 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
2029 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
2030 (2.3a): Annotate this entry to say the old forms of these features were
2031 also experimental.
2032 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 2033 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
2034 of Java (we'll want this back eventually).
2035
02975b9a
JD
20362006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2037
2038 Support a file name argument to %defines. Deprecate `=' in
2039 %file-prefix, %name-prefix, and %output. Discussed at
2040 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
2041 * NEWS (2.3a+): Mention.
148d66d8 2042 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
2043 form of %defines, and remove `=' from entries for %file-prefix,
2044 %name-prefix, and %output.
2045 * src/parse-gram.y (prologue_declaration): Implement.
2046 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
2047 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
2048 all but one occurrence of %name-prefix.
2049 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
2050 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
2051 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
2052 occurrence of each of %file-prefix and %output. Add check for %defines
2053 with argument.
2054 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
2055 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
2056 Remove the `=' from %output.
2057
287b314e
JD
20582006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
2059
2060 Don't escape $ in test case titles since Autoconf 2.61 now does that
2061 correctly.
2062 * tests/actions.at (Default %printer and %destructor are not for error
2063 or $undefined): Here.
2064 (Default %printer and %destructor are not for $accept): Here.
2065 * tests/input.at (Invalid $n and @n): Here.
2066
3ebecc24
JD
20672006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
2068
2069 Rename <!> to <>. Discussed starting at
2070 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
2071 * NEWS (2.3a+): Update.
148d66d8 2072 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
2073 Update.
2074 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
2075 * src/scan-gram.l (INITIAL): Implement.
2076 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
2077 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
2078 comment.
2079 * tests/actions.at (Default tagless %printer and %destructor,
2080 Default tagged and per-type %printer and %destructor,
2081 Default %printer and %destructor are not for error or $undefined,
2082 Default %printer and %destructor are not for $accept,
2083 Default %printer and %destructor for mid-rule values): Update.
2084 * tests/input.at (Default %printer and %destructor redeclared,
2085 Unused values with default %destructor): Update.
2086
26b8a438
JD
20872006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2088
2089 Don't let %prec take a nonterminal.
2090 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
2091 token.
2092 * tests/input.at (%prec takes a token): New test checking that %prec
2093 won't take a nonterminal.
2094
07c39ae9
JD
20952006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2096
405d53b7
JD
2097 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
2098 it was double-quoted.
07c39ae9
JD
2099 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
2100 grammar is maintained with Bison's highest standards.
2101 * src/getargs.c: Fix some typos in Doxygen comments.
2102
580b8926
JD
21032006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2104
2105 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
2106 later. Reported by Paul Eggert in
2107 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
2108 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
2109 * src/scan-code.l (translate_action): Don't bother invoking
2110 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
2111 (code_scanner_free): Instead of invoking
2112 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
2113 which frees more.
2114 * src/scan-gram.l (gram_scanner_free): Likewise.
2115 * src/scan-skel.l (scan_skel): Likewise.
2116
4502eadc
JD
21172006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2118
2119 * src/files.c (tr): Change return type to void.
2120 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
2121 has been called previously for the same key.
2122 (muscle_find): Return storage instead of value so that
2123 --enable-gcc-warnings doesn't produce warnings that the return discards
2124 const. aver that the value and storage are the same since storage
2125 could potentially be NULL when value is not.
2126 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
2127 same as 0.
2128
7746c8f6
PE
21292006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2130
2131 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
2132 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
2133 us a slightly cleaner distribution, and also works.
2134 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
2135 gnulib changes.
2136
eb095650
PE
21372006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
2138 and Paul Eggert <eggert@cs.ucla.edu>
2139
2140 Don't let Bison leak memory except when it complains.
2141 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
2142 (spec_defines_file, dir_prefix): Now char *, not const char *,
2143 since they are freed.
2144 * src/files.c: Likewise.
2145 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
2146 Likewise.
2147 (tr): Now operates in-place. All uses changed.
2148 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
2149 values.
2150 (compute_file_name_parts, compute_output_file_names): Don't store
2151 read-only data in variables that will be freed.
2152 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
2153 src_extension, and header_extension.
2154 (output_file_names_free): New public function to free
2155 spec_verbose_file, spec_graph_file, spec_defines_file,
2156 parser_file_name, and dir_prefix.
2157 * src/getargs.c (getargs): Don't store read-only data in variables that
2158 will be freed.
2159 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
2160 (which previously existed but was unused), and quotearg_free.
2161 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
2162 * src/muscle_tab.c: Likewise.
2163 (muscle_entry): Make the value char const *,
2164 and add a new storage member that is char * and can be freed.
2165 (muscle_entry_free): New private function.
2166 (muscle_init): Use it instead of free.
2167 (muscle_insert, muscle_grow): Update and use new storage member.
2168 (muscle_code_grow): Free the string passed to muscle_grow
2169 since it's not needed anymore.
2170 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
2171 add a new `char *code' member.
2172 ("{...}"): Declare semantic type as code.
2173 * src/scan-code.h (translate_rule_action):
2174 (translate_symbol_action, translate_code, translate_action): Return
2175 `char const *' rather than `char *' since external code should not free
2176 these strings.
2177 * src/scan-code.l: Likewise.
2178 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
2179 which is "{...}" in the parser.
2180 * tests/Makefile.am (maintainer-check-valgrind): Set
2181 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
2182 Valgrind.
2183 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
2184 complain.
2185 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
2186 expecting a non-zero exit status sets --leak-check=summary and
2187 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
2188 this case, and we don't want to hear about it.
2189
ac564be4
PE
21902006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2191
2192 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
2193 instead of from the template, to simplify configuration a bit.
2194 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
2195 and m4/wint_t.m4, as they are needed with the latest gnulib.
2196
17bd8a73
JD
21972006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2198
2199 Disable unset/unused mid-rule value warnings by default, and recognize
2200 --warnings=midrule-values to enable them. Discussed starting at
2201 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
2202 * NEWS (2.3a+): Mention.
2203 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
2204 warnings): Add entry for midrule-values subargument.
2205 * src/reader.c (symbol_should_be_used): Don't return true just because
2206 the value is a set/used mid-rule value unless
2207 --warnings=midrule-values was specified.
2208 * tests/input.at (Unused values, Unused values before symbol
2209 declarations): Run tests with and without --warnings=midrule-values.
2210
2211 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
2212 than LIST_FREE directly.
2213
89eb3c76
JD
22142006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2215
2216 Finish implementing --warnings=error, which should not be implied by
2217 --warnings=all (or by its synonyms -W and --warnings without
2218 subarguments).
2219 * src/complain.c (set_warning_issued): New function to report that
2220 warnings are being treated as errors and to record an error if so.
2221 Invoke...
2222 (warn_at, warn): ... here.
2223 * src/getargs.c (warnings_args, warnings_types): Reorder so that
2224 "error - warnings are errors" does not appear above "all - all of the
2225 above".
2226 (getargs): For -W and --warnings without subarguments, don't let
2227 FLAGS_ARGMATCH set warnings_error in warnings_flag.
2228 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
2229
ba7560e2
JD
22302006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2231
2232 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
2233 empty subargument list. For example: `bison --warnings= parser.y'.
2234
31283fc3
JD
22352006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2236
2237 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
2238 the parser header file so that gcc doesn't warn.
2239
12e35840
JD
22402006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2241
2242 Split the default %destructor/%printer into two kinds: <*> and <!>.
2243 Discussed starting at
2244 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
2245 * NEWS (2.3a+): Mention.
2246 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
2247 previous change today related to mid-rules.
148d66d8 2248 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 2249 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
2250 (TYPE_TAG_ANY): Add as <*>.
2251 (TYPE_TAG_NONE): Add as <!>.
2252 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
2253 for <*> and <!>.
2254 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
2255 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
2256 * src/symlist.c (symbol_list_default_new): Split into tagged and
2257 tagless versions.
2258 (symbol_list_destructor_set, symbol_list_printer_set): Split
2259 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
2260 SYMLIST_DEFAULT_TAGLESS.
2261 * src/symlist.h: Update symbol_list_default*_new prototypes.
2262 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
2263 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
2264 * src/symtab.c (default_destructor, default_destructor_location,
2265 default_printer, default_printer_location): Split each into tagged and
2266 tagless versions.
2267 (symbol_destructor_get, symbol_destructor_location_get,
2268 symbol_printer_get, symbol_printer_location_get): Implement tagged
2269 default and tagless default cases.
2270 (default_destructor_set, default_printer_set): Split each into tagged
2271 and tagless versions.
2272 * src/symtab.h: Update prototypes.
2273 * tests/actions.at (Default %printer and %destructor): Rename to...
2274 (Default tagless %printer and %destructor): ... this, and extend.
2275 (Per-type %printer and %destructor): Rename to...
2276 (Default tagged and per-type %printer and %destructor): ... this, and
2277 extend.
2278 (Default %printer and %destructor for user-defined end token): Extend.
2279 (Default %printer and %destructor are not for error or $undefined):
2280 Update.
2281 (Default %printer and %destructor are not for $accept): Update.
2282 (Default %printer and %destructor for mid-rule values): Extend.
2283 * tests/input.at (Default %printer and %destructor redeclared): Extend.
2284 (Unused values with default %destructor): Extend.
2285
f91b1629
JD
22862006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2287
2288 Don't apply the default %destructor/%printer to an unreferenced midrule
2289 value. Mentioned at
2290 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
2291 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
2292 like $@n instead of just @n so that the default %destructor/%printer
2293 logic doesn't see them as user-defined symbols.
2294 (symbol_is_dummy): Check for both forms of the name.
2295 * src/reader.c (packgram): Remove the `$' from each midrule symbol
2296 name for which the midrule value is referenced in any action.
2297 * tests/actions.at (Default %printer and %destructor for mid-rule
2298 values): New test.
2299 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
2300 for change to dummy symbol names.
2301
519d0004
JD
23022006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2303
2304 Warn about unset midrule $$ if the corresponding $n is used.
2305 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
2306 $n usage.
2307 (packgram): Before invoking grammar_rule_check on any rule, make sure
2308 all actions have already been scanned in order to set `used' flags.
2309 Otherwise, checking that a midrule's $$ is set will not always work
2310 properly because the midrule check must forward-reference the midrule's
2311 parent rule.
2312 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
2313 warning.
2314
a501eca9
JD
23152006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2316
2317 More improvements to the documentation of the prologue alternatives:
2318 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
2319 Bison manual.
2320 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
2321 some text to clarify the relative importance of the new directives and
2322 to show how these directives may be viewed as code labels.
2323
2cbe6b7f
JD
23242006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
2325
2326 Similar to the recently removed %before-header, add %code-top as the
2327 alternative to the pre-prologue. Mentioned at
2328 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
2329 Also, let the prologue alternatives appear in the grammar section.
2330 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
2331 (prologue_declaration): Move the existing prologue alternatives to...
2332 (grammar_declaration): ... here and add %code-top.
2333 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
2334
2335 Clean up and extend documentation for the prologue alternatives.
2336 * NEWS (2.3a+): Describe prologue alternatives.
2337 * doc/bison.texinfo (Prologue): Move discussion of prologue
2338 alternatives to...
2339 (Prologue Alternatives): ... this new section, and extend it to discuss
2340 all 4 directives in detail.
148d66d8
JD
2341 (Table of Symbols): Clean up discussion of prologue alternatives and
2342 add %code-top.
2cbe6b7f 2343
e557d3ea
JMG
23442006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2345
2346 DJGPP specific issues.
2347
2348 * djgpp/config.bat: config.hin has been moved to lib. Adjust
2349 config.bat accordingly.
2350 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
2351 * djgpp/config.site: Likewise.
2352
136a0f76
PB
23532006-10-16 Paolo Bonzini <bonzini@gnu.org>
2354
27bd5d67
PB
2355 Replace %*-header with %provides, %requires, %code. See discussion at
2356 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
2357
136a0f76
PB
2358 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
2359 (b4_user_start_header): Remove.
2360 * data/glr.c: Use new macros instead of b4_*start_header
2361 and b4_*end_header.
2362 * data/glr.cc: Likewise.
2363 * data/lalr1.cc: Likewise.
2364 * data/push.c: Likewise.
2365 * data/yacc.c: Likewise.
2366
2367 * doc/bison.texinfo: Remove %before-header, rename
2368 %{start,end,after}-header to %requires, %provides, %code.
2369
2370 * src/parse-gram.y: Likewise (also rename token names accordingly).
2371 * src/scan-gram.l: Likewise.
2372 * tests/actions.at: Likewise.
2373
10f429ef
PE
23742006-10-14 Paul Eggert <eggert@cs.ucla.edu>
2375
2376 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
2377 Problem reported by Joel E. Denny.
2378
23792006-10-14 Jim Meyering <jim@meyering.net>
2380
2381 (Sync from coreutils.)
2382 Work also when the working directory (with e.g. coreutils sources)
2383 is version controlled with git, rather than CVS.
2384 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
2385 rather than CVS.
2386 In messages and comments, say e.g., "checked-out sources",
2387 rather than "CVS sources".
2388 (version_controlled_file): New function. Work for git as well as
2389 for CVS. Don't use grep's -q option.
2390 (slurp): Call it here, in place of CVS-specific code.
2391
c4bd5bf7
JD
23922006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
2393
2394 Fix testsuite for ./configure --enable-gcc-warnings:
2395 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
2396 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
2397 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
2398 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
2399 * test/regression.at (Diagnostic that expects two alternatives):
2400 Likewise.
2401
46356ea4
PE
24022006-10-12 Paul Eggert <eggert@cs.ucla.edu>
2403
231ed89a
PE
2404 * bootstrap.conf (gnulib_modules): Add config-h.
2405 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
2406 worry about HAVE_CONFIG_H.
2407 * lib/abitset.c: Likewise.
2408 * lib/bitset.c: Likewise.
2409 * lib/bitset_stats.c: Likewise.
2410 * lib/bitsetv-print.c: Likewise.
2411 * lib/bitsetv.c: Likewise.
2412 * lib/ebitset.c: Likewise.
2413 * lib/get-errno.c: Likewise.
2414 * lib/lbitset.c: Likewise.
2415 * lib/subpipe.c: Likewise.
2416 * lib/timevar.c: Likewise.
2417 * lib/vbitset.c: Likewise.
2418 * lib/bitset.c: Include "bitset.h" first, to test interface.
2419 * lib/bitset_stats.c: Include "bitset_stats.h" first.
2420 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
2421 * lib/bitsetv.c: Include "bitsetv.h" first.
2422 * lib/get-errno.c: Include "get-errno.h" first.
2423 * m4/.cvsignore: Add config-h.m4.
2424 * tests/actions.at (Default %printer and %destructor for ...):
2425 Adjust expected line numbers in output to reflect removal of #if
2426 HAVE_CONFIG_H lines.
2427 * tests/glr-regression.at (Missed %merge type warnings when ...):
2428 Likewise.
2429 * tests/regression.at (Braced code in declaration in rules section):
2430 Likewise.
2431 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
2432 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
2433 Include <config.h> unconditionally.
2434
46356ea4
PE
2435 * bootstrap: Sync from coreutils, as follows:
2436
2437 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2438
2439 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
2440 variable was sometimes used without being initialized. This
2441 messed up the installation of the INSTALL file in some cases.
2442
2443 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2444
2445 * bootstrap (usage, main program, symlink_to_gnulib): Add option
2446 --copy. Inspired by a suggestion from Bruno Haible.
2447
2448 2006-10-03 Jim Meyering <jim@meyering.net>
2449
2450 * bootstrap: Undo last change to this file, since now gnulib-tool
2451 sticks with the automake default in generating dependencies.
2452
dd4bf078
PE
24532006-10-12 Paul Eggert <eggert@cs.ucla.edu>
2454
cf2a5f7c
PE
2455 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
2456 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
2457
2458 * doc/bison.1: Add copyright notice.
2459
2460 * data/glr.c: Don't include <stdarg.h>; not used.
2461
35fe0834
PE
2462 * NEWS: The -g and --graph options now output graphs in Graphviz
2463 DOT format, not VCG format.
2464 * doc/bison.1: Likewise.
2465 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
2466 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
2467 of this change in
2468 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
2469 * TODO: Remove Graphviz entry.
2470 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
2471 remove vcg.c, vcg.h, vcg_defaults.h.
2472 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
2473 * src/graphviz.c, src/graphviz.h: New files.
2474 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
2475 * src/files.h: Make comment more generic.
2476 * src/main.c (main): Likewise.
2477 * src/print_graph.h: Likewise.
2478 * src/getargs.c (usage): Make usage description more generic.
2479 * src/print_graph.c: Include graphviz.h rather than vcg.h.
2480 (static_graph, fgraph): Remove. All uses changed to pass
2481 arguments instead of sharing a static var.
2482 (print_core, print_actions, print_state, print_graph):
2483 Output graphviz format rather than VCG format.
2484 * tests/.cvsignore: Remove *.vcg; add *.dot.
2485 * tests/output.at: Expect *.dot files, not *.vcg files.
2486
dd4bf078
PE
2487 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
2488 accommodates the 2006-10-08 change.
2489
efdd7421
PE
24902006-10-11 Bob Rossi <bob@brasko.net>
2491
2492 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
2493 (b4_yyssa, b4_yyerror_range): New macros.
2494 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
2495 (yypvarsinit): Remove init of removed fields.
2496 (yypushparse): Remove use of removed fields; use new macros instead.
2497
96a1981a
PE
24982006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2499
2500 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
2501 in a push parser. Reindent slightly to match yacc.c better.
2502
25032006-10-11 Bob Rossi <bob@brasko.net>
2504
46356ea4
PE
2505 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
2506 yymsg_alloc fields.
2507 (yypvarsinit, yypushparse): Remove init of removed fields.
2508 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 2509
c1630a8b
PE
25102006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2511
2512 * THANKS: Add Paolo Bonzini and Bob Rossi.
2513
90b9908d
PB
25142006-10-08 Paolo Bonzini <bonzini@gnu.org>
2515
2516 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
2517 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
2518 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
2519 b4_define_user_cde and uses): Remove.
2520 (b4_comment, b4_prefix, b4_sync_start): New.
2521 * data/bison.m4: New file, with most of the content removed from c.m4.
2522 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
2523 * src/output.c (output_skeleton): Pass bison.m4.
2524 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
2525 only if specified.
2526
cf806753
PE
25272006-10-05 Paul Eggert <eggert@cs.ucla.edu>
2528
2529 Fix test failure reported by Tom Lane in
2530 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
2531 and try to make such failures easier to catch in the future.
2532 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
2533 that's now the caller's responsibility.
2534 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
2535 Set yychar = YYEOF if it's negative.
2536 * tests/actions.at (yylex): Abort if asked to read past EOF.
2537 * tests/conflicts.at (yylex): Likewise.
2538 * tests/cxx-type.at (yylex): Likewise.
2539 * tests/glr-regression.at (yylex): Likewise.
2540 * tests/input.at (yylex): Likewise.
2541 * tests/regression.at (yylex): Likewise.
2542 * tests/torture.at (yylex): Likewise.
2543
0e2f006a
PE
25442006-10-01 Paul Eggert <eggert@cs.ucla.edu>
2545
2546 Fix problems with translating English-language diagnostics.
2547 * bootstrap: Fix bug introduced in recent bootstrap changes, with
2548 respect to bison-runtime pot generation. The YY_ stuff
2549 wasn't being captured.
2550 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
2551 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
2552 * runtime-po/POTFILES.in: Add data/push.c.
2553
e3ddc1e3
PE
25542006-09-29 Paul Eggert <eggert@cs.ucla.edu>
2555
2556 Merge bootstrap changes from coreutils.
2557
2558 2006-09-28 Jim Meyering <jim@meyering.net>
2559
2560 Automatically generated dependencies are important even
2561 when all of the sources in a directory come from gnulib.
2562 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
2563 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
2564
2565 2006-09-23 Jim Meyering <jim@meyering.net>
2566
2567 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
2568
2569 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2570
2571 * bootstrap: Add support for --force.
2572 (usage): New function. Describe usage less tersely.
2573 (CVS_only_file): New var.
2574
01e972b3
PE
25752006-09-21 Paul Eggert <eggert@cs.ucla.edu>
2576
2577 * data/push.c (YYPUSH_MORE): Make it an enum instead.
2578 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
2579 Adjust white space and comments to match GNU style better.
2580
c63d3e90
PE
25812006-09-20 Bob Rossi <bob@brasko.net>
2582
2583 * data/push.c (yyresult_get): Remove function.
2584 (YYPUSH_MORE): Add #define.
2585 (yypushparse): Modify return value.
2586
e70f46d1
PE
25872006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2588
2589 * stamp-h.in: Remove; no longer needed.
2590 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
2591 Remove config.h, config.hin, intl (no longer created).
2592 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
2593 stamp-h1.
2594
2595 Sync bootstrap from coreutils, as follows:
2596
2597 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
2598
2599 * bootstrap (symlink_to_gnulib): New function.
2600 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
2601 to copies-of-gnulib.
2602 (cp_mark_as_generated, slurp, gnulib_files):
2603 Avoid making a copy if it's the same as the old version.
2604 (gnulib_files): Add support for this variable (used by Bison).
2605
a92be413
PE
26062006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2607
2608 * src/getargs.c (usage): Rework to use conventions similar to
2609 coreutils, to make translation a bit easier and the code a bit
2610 smaller. Problem reported by Tim Van Holder.
2611
4f82b42a
PE
26122006-09-15 Paul Eggert <eggert@cs.ucla.edu>
2613
3b2942e6
PE
2614 Use some of gnulib's new modules, taken from coreutils.
2615
2616 * bootstrap: Sync from coreutils, except add support for gnulib_files.
2617 * bootstrap.conf: New file.
2618 (gnulib_modules): Add configmake, inttypes, unistd.
2619 (XGETTEXT_OPTIONS): Add complain, complain_at,
2620 fatal, fatal_at, warn, warn_at, unexpected_end.
2621 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
2622 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
2623 (gl_EARLY): Add.
2624 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
2625 (gl_INIT): Add
2626 (GNULIB_AUTOCONF_SNIPPET): Remove.
2627 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
2628 the pickiest.
2629 * lib/.cvsignore: Add inttypes_.h.
2630 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
2631 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
2632 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
2633 no-longer-necessary initializations.
2634 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
2635 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
2636 use the unistd module.
2637 * src/system.h: Likewise.
2638 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
2639 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
2640 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
2641 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
2642 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
2643 * src/system.h: Include inttypes.h unconditionally, now that we
2644 use the inttypes module. Don't bother to include stdint.h, since
2645 inttypes.h now does that for us.
2646 (LOCALEDIR): Remove, now that we use the configmake module.
2647 * src/getargs.c: Include configmake.h.
2648 * src/main.c: Likewise.
2649 * src/output.c: Likewise.
2650 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
2651 not from $abs_top_builddir, since config.h moved.
2652
2653
4f82b42a
PE
2654 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
2655 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
2656
2657 * src/parse-gram.y (symbol_declaration): Don't put statements
2658 before declarations; it's not portable to C89.
2659 * src/scan-code.l (handle_action_at): Likewise.
2660
2661 * src/scan-code.l: Always initialize braces_level; the old code
2662 left it uninitialized and therefore had undefined behavior.
2663
2664 Don't attempt to redefine 'assert', since it runs afoul of
2665 systems where standard headers (mistakenly) include <assert.h>.
2666 Instead, define and use our own alternative, called 'aver'.
2667 * src/reader.c: Don't include assert.h, since we no longer
2668 use assert.
2669 * src/scan-code.l: Likewise.
2670 * src/system.h (assert): Remove, replacing with....
2671 (aver): New function, taking a bool arg. All uses changed.
2672 * src/tables.c (pack_vector): Ensure that aver arg is bool,
2673 not merely an integer.
2674
31c10e38
PE
26752006-09-15 Bob Rossi <bob@brasko.net>
2676
2677 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
2678 * data/c.m4 (YYPUSH): New.
2679 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
2680 * src/getargs.c (push_parser): New var.
2681 * src/getargs.h (push_parser): New declaration.
2682 * src/output.c (prepare): Add macro insertion of `push_flag'.
2683 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
2684 (prologue_declaration): Parse %push-parser.
2685 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
2686 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
2687 list of removed lines from the traces observed.
2688 (AT_CHECK_CALC_LALR): Added push parser tests.
2689
fa7b79c0
PE
26902006-09-13 Paul Eggert <eggert@cs.ucla.edu>
2691
21fe08ca
PE
2692 * NEWS: Version 2.3a.
2693 * configure.ac (AC_INIT): Likewise.
2694
e8ec4d9b
PE
2695 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
2696 "#define YYSTYPE int" that caused "make maintainer-check" to fail
2697 due to header ordering dependencies. I don't know why the #define
2698 was there.
2699
fa7b79c0
PE
2700 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
2701 runtime cost when YYDEBUG is not defined, and so that some tests
2702 that used to fail now work. Problem and initial suggestion by
2703 Paolo Bonzini.
2704 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
2705 * data/glr.cc (b4_parser_class_name):
2706 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
2707 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
2708 (yydebug_) [YYDEBUG]: New member.
2709 (yycdebug_): Now defined only if YYDEBUG.
2710 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
2711 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
2712 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
2713 if YYYDEBUG.
2714 (debug_stream, set_debug_stream, debug_level, set_debug_level):
2715 Define only if YYDEBUG.
2716 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
2717 set_debug_level.
2718 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
2719 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
2720 AT_CHECK_CALC_GLR_CC that are working now.
2721
4ec13d60
PE
27222006-09-12 Paul Eggert <eggert@cs.ucla.edu>
2723
2724 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
2725 We don't need them in glr.cc, and glr.c defines them.
2726 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
2727 assumes that defining it to anything is the same as defining
2728 it to 1. Problem reported by Paolo Bonzini.
2729
8e1687ae
PE
27302006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
2731
2732 * data/c.m4 (b4_null, b4_case): Define.
2733 * src/output.c (prepare_symbols): Use b4_null.
2734 (user_actions_output): Use b4_case.
2735
3dc5e96b
PE
27362006-09-11 Paul Eggert <eggert@cs.ucla.edu>
2737
aef3da86
PE
2738 * data/glr.c (b4_shared_declarations): Put start-header first,
2739 before any #includes that we generate, so that feature-test
2740 macros work. Problem reported by Michael Deutschmann in
2741 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
2742 * data/lalr1.cc: Likewise.
2743 * doc/bison.texinfo (Prologue): Document that feature-test macros
2744 should be defined before any Bison declarations.
2745 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
2746 that depend on location.hh after, not before, Bison decls, since
2747 we now include location.hh after the first user prologue.
2748
3dc5e96b
PE
2749 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
2750 Sander Brandenburg in
2751 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
2752 Also, fix minor white space and comment issues.
aef3da86
PE
2753 (Prologue): Mention that it's better to define feature-test macros
2754 before Bison declarations. Problem reported by Michael Deutschmann.
2755
2756 * README-cvs: Fix typo: "&" should be "&&". Problem reported
2757 by Jim Meyering.
2758 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
2759 This adjusts to recent gnulib changes.
3dc5e96b 2760
b2a0b7ca
JD
27612006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
2762
2763 Finish implementation of per-type %destructor/%printer. Discussed
2764 starting at
2765 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
2766 and
2767 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
2768 * NEWS (2.3+): Add a description of this feature to the default
2769 %destructor/%printer description.
2770 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
2771 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2772 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
2773 list node contains a semantic type.
2774 * src/symtab.c, src/symtab.h: Extend with a table that associates
2775 semantic types with their %destructor's and %printer's.
2776 (semantic_type_from_uniqstr, semantic_type_get,
2777 semantic_type_destructor_set, semantic_type_printer_set): New functions
2778 composing the public interface of that table.
2779 (symbol_destructor_get, symbol_destructor_location_get,
2780 symbol_printer_get, symbol_printer_location_get): If there's no
2781 per-symbol %destructor/%printer, look up the per-type before trying
2782 the default.
2783 * tests/actions.at (Per-type %printer and %destructor): New test case.
2784 * tests/input.at (Default %printer and %destructor redeclared):
2785 Extend to check that multiple occurrences of %symbol-default in a
2786 single %destructor/%printer declaration is an error.
2787 (Per-type %printer and %destructor redeclared, Unused values with
2788 per-type %destructor): New test cases.
2789
3be03b13
JD
27902006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
2791
2792 Require default %destructor/%printer to be declared using
2793 %symbol-default instead of an empty symbol list, and start working on
2794 new per-type %destructor/%printer. Discussed at
2795 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
2796 * NEWS (2.3+): Add %symbol-default to example.
2797 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 2798 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
2799 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
2800 (generic_symlist, generic_symlist_item): New nonterminals for creating
2801 a list in which each item is a symbol, semantic type, or
2802 %symbol-default.
2803 (grammar_declaration): Use generic_symlist in %destructor and %printer
2804 declarations instead of symbols.1 or an empty list.
2805 (symbol_declaration, precedence_declaration, symbols.1): Update actions
2806 for changes to symbol_list.
2807 * src/reader.c: Update for changes to symbol_list.
2808 * src/scan-code.l: Likewise.
2809 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
2810 * src/symlist.c, src/symlist.h: Extend such that a list node may
2811 represent a semantic type or a %symbol-default in addition to just an
2812 ordinary symbol. Add switched functions for setting %destructor's and
2813 %printer's.
2814 * tests/actions.at, tests/input.at: Add %symbol-default to all default
2815 %destructor/%printer declarations.
2816
3508ce36
JD
28172006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
2818
2819 Whether the default %destructor/%printer applies to a particular symbol
2820 isn't a question of whether the user *declares* that symbol (in %token,
2821 for example). It's a question of whether the user by any means
2822 *defines* the symbol at all (by simply using a char token, for
2823 example). $end is defined by Bison whereas any other token with token
2824 number 0 is defined by the user. The error token is always defined by
2825 Bison regardless of whether the user declares it with %token, but we
2826 may one day let the user define error as a nonterminal instead.
2827 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
2828 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
2829 the meaning of "user-defined".
2830 * tests/actions.at (Default %printer and %destructor for user-declared
2831 end token): Rename to...
2832 (Default %printer and %destructor for user-defined end token): ...
2833 this.
2834
2835 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
2836 computation of whether to apply the default, don't maintain a list of
2837 every Bison-defined symbol. Instead, just check for a first character
2838 of '$', which a user symbol cannot have, and check for the error token.
2839
9350499c
JD
28402006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
2841
2842 Don't apply the default %destructor or %printer to the error token,
2843 $undefined, or $accept. This change fits the general rule that the
2844 default %destructor and %printer are only for user-declared symbols,
2845 and it solves several difficulties that are described in the new test
2846 cases listed below.
2847 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
2848 * tests/actions.at (Default %printer and %destructor are not for error
2849 or $undefined, Default %printer and %destructor are not for $accept):
2850 New test cases.
2851
4d7370cb
JD
28522006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
2853
2854 Allow %start after the first rule.
2855 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
2856 when parsing the first rule.
2857 (check_and_convert_grammar): Search for it here after all grammar
2858 declarations have been parsed. Skip midrules, which have dummy LHS
2859 nonterminals.
2860 * src/symtab.c (symbol_is_dummy): New function.
2861 * src/symtab.h (symbol_is_dummy): Declare it.
2862 * tests/input.at (%start after first rule): New test.
2863
6d0ef4ec
JD
28642006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2865
2866 Redo some of the previous commit: add back the ability to use
2867 non-aliased/undeclared string literals since it might be useful to
2868 those declaring %token-table.
2869 * src/reader.c (check_and_convert_grammar): Undo changes in previous
2870 commit: don't worry about complaints from symbols_pack.
2871 * src/symtab.c (symbol_new, symbol_class_set,
2872 symbol_check_alias_consistency): Undo changes in previous commit: count
2873 each string literal as a new symbol and token, assign it a symbol
2874 number, and don't complain about non-aliased string literals.
2875 (symbols_pack): Since symbol_make_alias still does not decrement symbol
2876 and token counts but does still set aliased tokens to the same number,
2877 symbol_pack_processor now leaves empty slots in the symbols array.
2878 Remove those slots.
2879 * tests/regression.at (Undeclared string literal): Remove test case
2880 added in previous commit since non-aliased string literals are allowed
2881 again.
2882 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
2883 remove unnecessary string literal declarations.
2884 * tests/sets.at (Firsts): Likewise.
2885
965537bc
JD
28862006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
2887
2888 Don't allow an undeclared string literal, but allow a string literal to
2889 be used before its declaration.
2890 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
2891 symbols_pack complained.
2892 * src/symtab.c (symbol_new): Don't count a string literal as a new
2893 symbol.
2894 (symbol_class_set): Don't count a string literal as a new token, and
2895 don't assign it a symbol number since symbol_make_alias does that.
2896 (symbol_make_alias): It's not necessary to decrement the symbol and
2897 token counts anymore. Don't assume that an alias declaration occurs
2898 before any uses of the identifier or string, and thus don't assert that
2899 one of them has the highest symbol number so far.
2900 (symbol_check_alias_consistency): Complain if there's a string literal
2901 that wasn't declared as an alias.
2902 (symbols_pack): Bail if symbol_check_alias_consistency failed since
2903 symbol_pack asserts that every token has been assigned a symbol number
2904 although undeclared string literals have not.
2905 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 2906 string literal): New test cases.
965537bc
JD
2907 (Characters Escapes, Web2c Actions): Declare string literals as
2908 aliases.
2909 * tests/sets.at (Firsts): Likewise.
2910
47aee066
JD
29112006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
2912
2913 In the grammar scanner, STRING_FINISH unclosed constructs and return
2914 them to the parser in order to improve error messages.
2915 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
2916 SC_BRACED_CODE, SC_PROLOGUE): Implement.
2917 * tests/input.at (Unclosed constructs): New test case.
2918 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
2919 seen.
2920
2921 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
2922 unused global.
2923
1f6b3679
JD
29242006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
2925
2926 Handle string aliases for character tokens correctly.
2927 * src/symtab.c (symbol_user_token_number_set): If the token has an
2928 alias, check and set its alias's user token number instead of its own,
2929 which is set to indicate the alias. Previously, every occurrence of
2930 the character token in the grammar overwrote that alias indicator with
2931 the character code.
2932 * tests/input.at (String aliases for character tokens): New test.
2933
219741d8
JD
29342006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
2935
2936 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
2937
11daa4e7
PE
29382006-08-11 Paul Eggert <eggert@cs.ucla.edu>
2939
2940 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
2941 to prevent failures when building on older platforms.
2942 Check for autopoint failure.
2943 Set XGETTEXT_OPTIONS to values that check for C format strings,
2944 so that translators are warned about them (this also helps
2945 prevent core dumps).
2946
2947 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
2948 function, since it simplifies our code a bit.
2949
2950 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
2951 rather than -W, so we don't get bogus warnings about sign comparisons.
2952 Add -Wpointer-arith, since that warning is useful (it reports code
2953 that does not conform to C89 and that some compilers reject).
2954 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
2955 since it's no longer needed.
2956
f9bfc42a
JD
29572006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
2958
2959 Clean up scanners a bit.
2960 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
2961 definitions so gcc won't warn when obstack_for_string is unused.
2962 * src/scan-code.l: config.h and system.h are already #include'd by
2963 scan-code-c.c, so get rid of them here.
2964 * src/scan-gram.l: Likewise.
2965 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
2966 definitions rather than duplicating the rest of it.
2967 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
2968
06e8700a
JD
29692006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
2970
2971 Suppress signed/unsigned comparison warnings for yycheck.
2972 * data/c.m4 (b4_safest_int_type): New macro.
2973 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
2974 a signed int type, cast it to b4_safest_int_type first.
2975 * data/yacc.c: Likewise.
2976 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
2977 also overwritten.
2978
9c437126
PE
29792006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
2980
2981 * doc/bison.texinfo: Fix some typos.
2982
284d8a13
PE
29832006-08-02 Paul Eggert <eggert@cs.ucla.edu>
2984
2985 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
2986 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
2987
2988 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
2989 the latest gnulib does this a different way.
2990 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
2991 translation was patched, so stop omitting it.
2992
ec5479ce
JD
29932006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
2994
2995 Enable declaration of default %printer/%destructor. Make the parser
2996 use these for all user-declared grammar symbols for which the user does
2997 not declare a specific %printer/%destructor. Thus, the parser uses it
2998 for token 0 if the user declares it but not if Bison generates it as
2999 $end. Discussed starting at
3000 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
3001 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
3002 and
3003 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
3004 * NEWS (2.3+): Mention.
3005 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
3006 declare a %destructor for a mid-rule's semantic value. It's just
3007 impossible to declare one specific to it.
3008 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
3009 code. Describe default %destructor form.
3010 * src/parse-gram.y (grammar_declaration): Parse default
3011 %printer/%destructor declarations.
3012 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
3013 and symbol_destructor_location_get rather than accessing the destructor
3014 and destructor_location members of struct symbol.
3015 (symbol_printers_output): Likewise but for %printer's.
3016 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
3017 again.
3018 * src/symtab.c (default_destructor, default_destructor_location,
3019 default_printer, default_printer_location): New static global
3020 variables to record the default %destructor and %printer.
3021 (symbol_destructor_get, symbol_destructor_location_get,
3022 symbol_printer_get, symbol_printer_location_get): New functions to
3023 compute the appropriate %destructor and %printer for a symbol.
3024 (default_destructor_set, default_printer_set): New functions to set the
3025 default %destructor and %printer.
3026 * src/symtab.h: Prototype all those new functions.
3027 * tests/actions.at (Default %printer and %destructor): New test to
3028 check that the right %printer and %destructor are called, that they're
3029 not called for $end, and that $$ and @$ work correctly.
3030 (Default %printer and %destructor for user-declared end token): New
3031 test to check that the default %printer and %destructor are called for
3032 a user-declared end token.
3033 * tests/input.at (Default %printer and %destructor redeclared, Unused
3034 values with default %destructor): New tests to check related grammar
3035 warnings and errors.
3036
868d2d96
JD
30372006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3038
3039 Clean up handling of %destructor for the end token (token 0).
3040 Discussed starting at
3041 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
3042 and
3043 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
3044
3045 Make the skeletons consistent in how they pop the end token and invoke
3046 its %destructor.
3047 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
3048 state, which has token number 0, since this would invoke the
3049 %destructor for the end token.
3050 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
3051 until after shifting the end token, or else it won't be popped.
3052 * data/yacc.c (yyparse): Likewise.
3053
3054 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
3055 it's the end token. Upon termination, destroy an unshifted lookahead
3056 even when it's the end token.
3057 * data/lalr1.cc (yy::parser::parse): Likewise.
3058 * data/yacc.c (yyparse): Likewise.
3059
3060 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
3061 value warnings for the end token when the user gives the end token a
3062 %destructor.
3063
3064 * tests/actions.at (Printers and Destructors): Test all the above.
3065
62a9592d
PE
30662006-07-24 Paul Eggert <eggert@cs.ucla.edu>
3067
3068 Update to latest gnulib and gettext versions.
3069 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
3070 Add fopen-safer.
3071 (gnulib_files): Add m4/warning.m4. Don't worry about files
3072 overwritten by autopoint.
3073 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
3074 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
3075 rejects them.
3076 Don't use autoreconf; instead, invoke autopoint etc. by hand,
3077 so that we can remove the intl files at a better time.
3078 (intl_files_to_remove): Remove aclocal.m4, since it gets
3079 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
3080 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
3081 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
3082 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
3083 Remove datarootdir hack; no longer needed.
3084 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
3085 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
3086 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
3087 strdup.h.
3088 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
3089 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
3090
10d6970f
PE
30912006-07-20 Paul Eggert <eggert@cs.ucla.edu>
3092
3093 * bootstrap: Adjust to today's change to gnulib-tool by invoking
3094 it with --assume-autoconf='latest-stable'.
3095
50a33993
JD
30962006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
3097
3098 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
3099 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
3100 YYSTYPE' and `{'.
3101 * src/muscle_tab.h (muscle_grow): Replace the header comments with
3102 those from muscle_tab.c since the old ones are misleading.
3103
2ce4ed68
AD
31042006-07-13 Akim Demaille <akim@epita.fr>
3105
3106 Support %define "KEY" {VALUE}.
3107 * src/scan-code.h, src/scan-code.l (translate_action)
3108 (translate_rule_action, translate_symbol_action, translate_code):
3109 Return char *, not const char *.
3110 * src/parse-gram.y (declaration): Rename as...
3111 (prologue_declaration): this.
3112 (string_content): Remove this nonterminal, use STRING.
3113 (braceless, content, content.opt): New nonterminal.
3114 Use them.
3115 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
3116 as value.
3117 * src/scan-gram.l (getargs.h): Don't include it.
3118
db7e5eb5
PE
31192006-07-12 Paul Eggert <eggert@cs.ucla.edu>
3120
3121 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
3122 rather than a for-loop that declares a local bool variable. This
3123 should work around a compatibility problem with a Cray x1e C++
3124 compiler reported by Hung Nguyen in
3125 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
3126 The for-loop was introduced in the 2004-11-17 change but I don't
3127 know why it was needed.
3128
a5d80ba5
AD
31292006-07-12 Akim Demaille <akim@epita.fr>
3130
3131 * data/c.m4: Comment changes.
3132
23eb2a69
AD
31332006-07-10 Akim Demaille <akim@lrde.epita.fr>
3134
3135 * src/complain.c (error_message, ERROR_MESSAGE): New.
3136 To factor...
3137 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
3138 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
3139
ddc8ede1
PE
31402006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3141
3142 * NEWS: Instead of %union, you can define and use your own union type
3143 YYSTYPE if your grammar contains at least one <type> tag.
3144 Your YYSTYPE need not be a macro; it can be a typedef.
3145 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
3146 (Union Decl, Decl Summary): Document this.
3147 * data/glr.c (YYSTYPE): Implement this.
3148 * data/glr.cc (YYSTYPE): Likewise.
3149 * data/lalr1.cc (YYSTYPE): Likewise.
3150 * data/yacc.c (YYSTYPE): Likewise.
3151 * src/output.c (prepare): Output tag_seen_flag.
3152 * src/parse-gram.y (declaration, grammar_declaration):
3153 Use 'union_seen' rather than 'typed' to determine whether
3154 %union has been seen, since grammars can now be typed without
3155 %union.
3156 (symbol_declaration, type.opt, symbol_def):
3157 Keep track of whether a tag has been seen.
3158 * src/reader.c (union_seen, tag_seen): New vars.
3159 (typed): remove.
3160 * src/reader.h (union_seen, tag_seen, typed): Likewise.
3161 * src/scan-code.l (untyped_var_seen): New variable.
3162 (handle_action_dollar): Adjust to above changes.
3163 (handle_action_dollar, handle_action_at):
3164 Improve overflow checking for outlandish numbers.
3165 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
3166 avoid new diagnostics generated by above changes.
3167 * tests/regression.at (YYSTYPE typedef): Add test to check
3168 for type tags without %union.
3169
3170 * src/symlist.c (symbol_list_length): Return int, not unsigned
3171 int, since callers expect int. This may need to get revisited
3172 once we have proper integer overflow checking.
3173
3174 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
3175 object is now static.
3176
3177 * src/getargs.c (flags_argmatch): Return void, not int,
3178 to pacify ./configure --enable-gcc-warnings.
3179
3180 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
3181 since last_string is already defined to FLEX_PREFIX (last_string).
3182
7b42569e
AD
31832006-07-09 Akim Demaille <akim@lrde.epita.fr>
3184
3185 Implement --warnings/-W.
3186 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
3187 replaced by...
3188 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
3189 Adjust callers.
3190 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
3191 (warnings_args, warnings_types): New.
3192 (getargs, short_options, long_options): Accept -W/--warnings.
3193 Sort the options by alphabetical order, upper case letter right
3194 before its lower case.
3195
3b452f4e
JD
31962006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3197
3198 Change %merge result type clash warnings to errors. Discussed at
3199 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
3200 * src/reader.c (record_merge_function_type): Use complain_at.
3201 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3202 declared later): Update test case results.
3203
b8a41559
AD
32042006-07-09 Akim Demaille <akim@lrde.epita.fr>
3205
3206 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
3207 to be in alphabetical order.
3208 (trace_args): Spelling fixes.
3209
cd9e1ba2
PE
32102006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3211
3212 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
3213 so they don't collide with user-defined macros.
3214 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
3215 this was never guaranteed, and now that we're using gnulib stdint,
3216 which defines int_fast16_t to long int, the problem is exposed.
3217
cb48f191
PE
32182006-07-08 Paul Eggert <eggert@cs.ucla.edu>
3219
b8445a15
PE
3220 * data/c.m4 (b4_basename): Simplify a bit, since we don't
3221 need the full POSIX semantics (and weren't implementing them
3222 anyway).
3223
cb48f191
PE
3224 Adjust to Autoconf 2.60 and today's gnulib.
3225 * bootstrap (gnulib_modules): Add stdint.
3226 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
3227 no longer copies it.
3228 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
3229 since stdint needs the former and wcwidth (which is now required
3230 by mbswidth) needs the latter.
3231 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
3232 work around a compatibility glitch between gettext 0.14.6 and
3233 Autoconf 2.60.
3234 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
3235 Do not check for uintptr_t, since new stdint module does the right
3236 thing.
3237 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
3238 Add stdint.h, stdint_.h, wcwidth.h.
3239 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
3240 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
3241 stdint.m4, wchar_t.m4, wcwidth.m4.
3242 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
3243 usual order for ../lib/*.h files.
3244 (file_name_split): Use last_component, not base_name, to adjust
3245 to gnulib changes.
3246 * src/parse-gram.h: Include <strverscmp.h> in the usual order
3247 for ../lib/*.h files.
3248 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
3249 Define unconditionally, since we now assume the stdint module.
3250 * src/scan-skel.l: Include <dirname.h>.
3251 (BASE_QPUTS): Use last_component, not base_name.
3252 * src/system.h: Include <unlocked-io.h> in the usual order
3253 for ../lib/*.h files. Include <stdint.h> unconditionally,
3254 since we now use the stdint module.
3255 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
3256 HAVE_UINTPTR_T, since we now use the stdint module.
3257 (base_name): Remove decl, since files now include <dirname.h>
3258 to get the decl.
3259
cd48d21d
AD
32602006-07-08 Akim Demaille <akim@lrde.epita.fr>
3261
3262 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
3263 New, default to 1.
3264 * data/yacc.c, data/glr.c, data/location.cc: Use them.
3265 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
3266 default.
3267 * tests/calc.at: Adjust.
3268
8ec0a172
AD
32692006-07-08 Akim Demaille <akim@lrde.epita.fr>
3270
b8445a15 3271 * data/c.m4 (b4_basename): New.
8ec0a172
AD
3272 (b4_syncline): Also output the location of its invocation (from
3273 the skeleton).
3274 (b4_user_action, b4_define_user_action, b4_user_actions)
3275 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
3276 (b4_user_stype): New.
3277 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
3278
4a678af8
JD
32792006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3280
3281 In the grammar file, the first column is 1 not 0 on the first line as
3282 on every other line.
3283 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
3284 * tests/input.at (Torturing the Scanner): Update output.
3285
3286 * src/scan-gram.l (scanner_cursor): Declare it static.
3287
dd60572a
JD
32882006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3289
3290 In warnings, say "previous declaration" rather than "first
3291 declaration".
3292 * src/symtab.c (redeclaration): Do that here.
3293 * src/reader.c (record_merge_function_type): In the case of a result
3294 type clash, report the previous declaration rather than the very first
3295 one in the grammar file.
3296 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3297 declared later): Add a third declaration to check this behavior.
3298 * tests/input.at (Incompatible Aliases): Update output.
3299
2073e1b6
AD
33002006-06-27 Akim Demaille <akim@epita.fr>
3301
3302 * doc/Doxyfile.in: New.
3303 * doc/Makefile.am: Use it.
3304 * src/lalr.h, src/symtab.h: Initial doxygenation.
3305
8ee5b538
JD
33062006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3307
3308 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
3309 declared after the %merge. This continues the effort of the previous
3310 patch.
8ee5b538
JD
3311 * src/reader.c (get_merge_function): Don't set the merger type yet.
3312 (record_merge_function_type): New function for setting the merger type
3313 and checking for clashes.
3314 (grammar_current_rule_merge_set): Set the location of the %merge for
3315 the current rule.
3316 (packgram): Invoke record_merge_function_type for each rule now that
3317 all symbol type declarations have been parsed.
3318 * src/reader.h (merger_list.type_declaration_location): New member
3319 storing the location of the first %merge from which the type for this
3320 merging function was derived.
3321 * src/symlist.h (symbol_list.merger_declaration_location): New member
3322 storing the location of a rule's %merge, if any.
3323 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3324 declared later): New test to catch the error fixed by the above patch.
3325
ffa4ba3a
JD
33262006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3327
3328 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
3329 declarations appear after the rules. Discussed at
3330 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
3331 and
3332 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
3333 Don't mistake the type of $$ in a midrule to be that of its parent
3334 rule's $$.
ffa4ba3a
JD
3335 * src/reader.c (grammar_current_rule_end): Don't invoke
3336 grammar_rule_check yet since not all symbol declarations may have been
3337 parsed yet.
3338 (grammar_midrule_action): Likewise.
3339 Don't record whether the midrule's $$ has been used yet since actions
3340 haven't been translated yet.
3341 Record the midrule's parent rule and its RHS index within the parent
3342 rule.
3343 (grammar_current_rule_action_append): Don't translate the action yet
3344 since not all symbol declarations may have been parsed yet and, thus,
3345 warnings about types for $$, $n, @$, and @n can't be reported yet.
3346 (packgram): Translate the action and invoke grammar_rule_check now that
3347 all symbol declarations have been parsed.
3348 * src/scan-code.l (handle_action_dollar): Now that this is invoked
3349 after parsing the entire grammar file, the symbol list here in the case
3350 of a midrule is actually the midrule's empty RHS, so reference its
3351 parent rule's RHS where necessary.
3352 On the other hand, now that you can already know it's a midrule, you
3353 aren't forced to think $$ has the same type as its parent rule's $$.
3354 (handle_action_at): In the case of a midrule, reference the parent rule
3355 where necessary.
3356 * src/symlist.c (symbol_list_new): Initialize new midrule-related
3357 members.
3358 (symbol_list_length): Now that this is invoked after all rules have
3359 been parsed, a NULL symbol (rather than a NULL symbol list node)
3360 terminates a rule. symbol_list_print already does this correctly.
3361 * src/symlist.h (symbol_list.midrule_parent_rule,
3362 symbol_list.midrule_parent_rhs_index): New members so that midrules can
3363 remember their relationships with their parents.
3364 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
3365 fixed by the above patch.
3366 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
3367 implementing...
3368 (Unused values): ... this old test case and...
3369 (Unused values before symbol declarations): ... this new test case.
3370 This one is the same as `Unused values' except that all symbol
3371 declarations appear after the rules in order to catch the rest of the
3372 errors fixed by the above patch.
3373
e256e17f
JD
33742006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3375
300a1930
JD
3376 More cleanup.
3377 * src/reader.c (current_rule): Declare it static since it's no longer
3378 used outside this file.
3379 (grammar_current_rule_action_append): Remove redundant arguments from
3380 translate_rule_action invocation.
3381 * src/reader.h (current_rule): Remove this unused extern.
3382 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
3383 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 3384
381ecb06
JD
33852006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
3386
3387 Clean up yesterday's patch.
3388 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
3389 to...
3390 * src/reader.c (grammar_current_rule_action_append): ... here for
3391 consistency with grammar_current_rule_symbol_append.
3392 * tests/regression.at (Braced code in declaration in rules section):
3393 Make yyerror and yylex static as usual.
3394
4210cd0b
JD
33952006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
3396
3397 Fix bug that mistakes braced code in a declaration in the rules section
3398 to be a rule action. Mentioned at
3399 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
3400 * src/scan-gram.l: Move midrule action detection from the start of the
3401 scanning of any braced code to...
3402 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
3403 action. For readability, use $2 and @2 rather than the equivalent
3404 global variables.
3405 * tests/regression.at (Braced code in declaration in rules section):
3406 New test to catch the error fixed by the above patch.
3407
3408 Work on code readability some.
3409 * src/scan-code.l (current_rule): Get rid of this misleading and
3410 redundant declaration: it's actually extern'ed in reader.h.
3411 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
3412 translate_action): Add a rule argument and use it instead of the global
3413 current_rule.
3414 (translate_rule_action): This already receives current_rule through an
3415 argument, so pass it on to translate_action instead of assigning
3416 current_rule to current_rule.
3417 (translate_symbol_action, translate_code): Pass rule = NULL to
3418 translate_action.
3419
34f98f46
JD
34202006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
3421
3422 Rename %before-definitions to %start-header and %after-definitions to
3423 %end-header. Don't use these declarations to separate pre-prologue
3424 blocks from post-prologue blocks. Add new order-independent
3425 declarations %before-header and %after-header as alternatives to the
3426 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
3427 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
3428 * NEWS (2.3+): Update for these changes.
3429 * data/glr.c (b4_before_definitions): Update to...
3430 (b4_start_header): ... this.
3431 (b4_after_definitions): Update to...
3432 (b4_end_header): ... this.
3433 * data/glr.cc: Likewise.
3434 * data/lalr1.cc: Likewise.
3435 * data/yacc.c: Likewise.
3436 * doc/bison.texinfo (The prologue): Update names, and replace remaining
3437 prologue blocks with %*-header declarations.
3438 (Calc++ Parser): Likewise.
91661ebb 3439 (Decl Summary): Update names.
148d66d8 3440 (Table of Symbols): Update description.
34f98f46
JD
3441 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
3442 (PERCENT_END_HEADER): ... this.
3443 (PERCENT_BEFORE_DEFINITIONS): Update to...
3444 (PERCENT_START_HEADER): ... this.
3445 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
3446 (declaration): Update token names and m4 macro names.
3447 When parsing %end-header and %start-header, invoke translate_code
3448 before muscle_code_grow, and no longer set global booleans to remember
3449 whether these declarations have been seen.
3450 Parse new %after-header and %before-header.
3451 * src/reader.c (before_definitions, after_definitions): Remove.
3452 (prologue_augment): Accept a new bool argument to specify whether to
3453 augment the pre-prologue or post-prologue.
3454 * src/reader.h (before_definitions, after_definitions): Remove these
3455 extern's.
3456 (prologue_augment): Add new bool argument.
3457 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
3458 (PERCENT_END_HEADER): ... this.
3459 (PERCENT_BEFORE_DEFINITIONS): Update to...
3460 (PERCENT_START_HEADER): ... this.
3461 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
3462 * tests/actions.at (Printers and Destructors): Update names.
3463
31b2b07e
JD
34642006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
3465
3466 Add comparison operators for C++ location classes. Discussed at
3467 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
3468 * data/c++.m4 (b4_define_location_comparison): New boolean %define
3469 declaration indicating whether filename_type has an operator==. If
3470 filename_type is `std::string', it defaults to `1', `0' otherwise.
3471 * data/location.cc: Iff b4_define_location_comparison is `1', add
3472 operator== and operator!= for class position and for class location.
3473
3474 Some minor fixes.
3475 * src/scan-action.l: Remove unused file.
3476 * src/symtab.c (symbol_printer_set): Use printer_location not
3477 destructor_location.
3478 * src/symtab.h (struct symbol): Replace incorrect source comment for
3479 printer members.
3480 * tests/input.at (Incompatible Aliases): Update output with correct
3481 printer location.
3482
9bc0dd67
JD
34832006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
3484
3485 Don't put the pre-prologue in the header file. For the yacc.c code
3486 file and the glr.c header and code files, move the pre-prologue before
3487 the token definitions. Add new %before-definitions and
3488 %after-definitions to declare code that will go in both the header file
3489 and code file. Discussed at
3490 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
3491 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
3492 and
3493 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
3494 * NEWS (2.3+): Describe these changes.
3495 * data/glr.c (b4_pre_prologue): Move from within to before...
3496 (b4_shared_declarations): ... this.
3497 Add new b4_before_definitions before b4_token_enums.
3498 Add new b4_after_definitions at the end.
3499 * data/glr.cc (b4_pre_prologue): Replace with...
3500 (b4_before_definitions): ... this in the header file.
3501 (b4_after_definitions): New near the end of the header file.
3502 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
3503 code file right before including the header file.
3504 (b4_before_definitions): New in the previous position of
3505 b4_pre_prologue in the header file.
3506 (b4_after_definitions): New near the end of the header file.
3507 * data/yacc.c: Clean up some m4 quoting especially in the header file.
3508 (b4_token_enums_defines): In the code file, move to right before
3509 YYSTYPE for consistency with the header file.
3510 (b4_before_definitions): New right before b4_token_enums_defines in
3511 both the header and code file.
3512 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
3513 header and code file.
3514 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
3515 of prologues for %union dependencies.
91661ebb
JD
3516 (Decl Summary): In %defines description, mention the effect of
3517 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
3518 (Calc++ Parser): Forward declare driver in a %before-definitions rather
3519 than in the pre-prologue so that make check succeeds.
148d66d8 3520 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
3521 %after-definitions.
3522 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
3523 %before-definitions.
3524 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
3525 (declaration): Parse those declarations and append to
3526 b4_before_definitions and b4_after_definitions, respectively.
3527 * src/reader.c (before_definitions, after_definitions): New bools to
3528 track whether those declarations have been seen.
3529 (prologue_augment): Add to the post-prologue if %union,
3530 %before-definitions, or %after-definitions has been seen.
3531 * src/reader.h (before_definitions, after_definitions): New extern's.
3532 * src/scan-gram.l: Scan the new declarations.
3533 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
3534 prologue block in a %before-definitions or a %after-definitions based
3535 on whether the %union is declared.
3536 * tests/regression.at (Early token definitions with --yacc, Early token
3537 definitions without --yacc): Move tests for token definitions into the
3538 post-prologue since token names are no longer defined in the
3539 pre-prologue.
3540
203b9274
AD
35412006-06-20 Akim Demaille <akim@epita.fr>
3542
3543 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
3544 (symbol_get): Use it.
3545 * src/parse-gram.y: Use it.
3546
a7ee59cf
JD
35472006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
3548
3549 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
3550 build succeeds when configured with --enable-gcc-warnings.
3551
5a2baae7
PE
35522006-06-19 Paul Eggert <eggert@cs.ucla.edu>
3553
33ad1a9c
PE
3554 * src/parse-gram.y (char_name): New function.
3555 (CHAR, STRING, string_content): For %printer, properly escape.
3556 (ID): Prefer fputs to fprintf.
3557 (id): Reindent to be consistent with other rules.
3558 Properly quote char.
3559
5a2baae7
PE
3560 The Translation Project changed its way of publishing translations
3561 to maintainers. I haven't received any responses to my request
3562 for supporting the old way, or for documenting the new way. I
3563 have modified 'bootstrap' to use screen scraping
3564 (in this case, HTML scraping). This is unreliable and inelegant,
3565 but I don't see any better way. Yuck.
3566 * bootstrap (TP_URL, WGET_COMMAND): New vars.
3567 (get_translations): New function, which uses HTML scraping to
3568 deduce locations of latest translations.
3569 Use this function to grab both bison and bison-runtime .po files.
3570 Don't bother priming the pump for the runtime-po domain any more,
3571 as it's now translated better than bison is.
3572
58d7a1a1
AD
35732006-06-19 Akim Demaille <akim@epita.fr>
3574
3575 * src/scan-gram.l: No longer "parse" things after `%union' until
3576 `{'. Rather, return a single "%union" token.
3577 No longer make symbols: return strings, and leave the conversion
3578 to symbols to the parser.
3579 (SC_PRE_CODE, token_type): Remove.
3580 * src/parse-gram.y (%union): New field `character'.
3581 Sort tokens.
3582 (CHAR): New token.
3583 (ID, ID_COLON): Now that the scanner no longer makes them
3584 identifiers, adjust all uses to invoke symbol_get.
3585 (id_colon): New, wraps the conversion from string to symbol.
3586 (%union): Accept a possible union_name.
3587 (symbol): Now can be a char.
3588 * data/c.m4 (b4_union_name): Leave a default value.
3589 * data/glr.c, data/yacc.c: Use it.
3590
b931235e
JD
35912006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
3592
3593 For associating token numbers with token names for "yacc.c", don't use
3594 #define statements unless `--yacc' is specified; always use enum
3595 yytokentype. Most important discussions start at:
3596 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
3597 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
3598 and
3599 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
3600 * NEWS (2.3+): Mention.
3601 * data/c.m4 (b4_yacc_if): New.
3602 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
3603 token #define's.
3604 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
3605 on token name definitions.
3606 * src/getargs.c (usage): Capitalize `Yacc' in English.
3607 * src/output.c (prepare): Define b4_yacc_flag.
3608 * tests/regression.at (Early token definitions): Test that tokens names
3609 are defined before the pre-prologue not just before the post-prologue.
3610 Remove this test case and copy to...
3611 (Early token definitions with --yacc): ... this to test #define's.
3612 (Early token definitions without --yacc): ... and this to test enums.
3613
9e6e7ed2
PE
36142006-06-11 Paul Eggert <eggert@cs.ucla.edu>
3615
3616 * NEWS: Reword the post-2.3 change to not be so optimistic about
3617 removing the old "look-ahead" spelling.
3618 Update previous look-ahead/lookahead change reports.
3619 * REFERENCES: look-ahead -> lookahead (since that's
3620 what he actually wrote).
3621 * doc/refcard.tex: look ahead -> lookahead,
3622 look-ahead -> lookahead
3623
742e4900
JD
36242006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
3625
3626 For consistency, use `lookahead' instead of `look-ahead' or
3627 `look_ahead'. Discussed starting at
3628 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
3629 and then at
3630 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
3631 * NEWS: For the next release, note the change to `--report'.
3632 * TODO, doc/bison.1: Update English.
3633 * doc/bison.texinfo: Update English.
3634 (Understanding Your Parser, Bison Options): Document as
3635 `--report=lookahead' rather than `--report=look-ahead'.
3636 * src/conflicts.c: Update English in comments.
3637 (lookahead_set): Rename from look_ahead_set.
3638 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
3639 (resolve_sr_conflict): Rename local look_ahead_tokens to
3640 lookahead_tokens, and update other uses.
3641 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
3642 count_rr_conflicts, conflicts_free): Update uses.
3643 * src/getargs.c (report_args): Move "lookahead" before alternate
3644 spellings.
3645 (report_types): Update uses.
3646 (usage): For `--report' usage description, state `lookahead' spelling
3647 rather than `look-ahead'.
3648 * src/getargs.h (report.report_lookahead_tokens): Rename from
3649 report_look_ahead_tokens.
3650 * src/lalr.c: Update English in comments.
3651 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
3652 (state_lookahead_tokens_count): Rename from
3653 state_look_ahead_tokens_count.
3654 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3655 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
3656 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3657 Update other uses.
3658 Update English in output.
3659 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
3660 * src/print.c: Update English in comments.
3661 (lookahead_set): Rename from look_ahead_set.
3662 (print_reduction): Rename argument lookahead_token from
3663 look_ahead_token.
3664 (print_core, state_default_rule, print_reductions, print_results):
3665 Update uses.
3666 * src/print_graph.c: Update English in comments.
3667 (print_core): Update uses.
3668 * src/state.c: Update English in comments.
3669 (reductions_new): Update uses.
3670 (state_rule_lookahead_tokens_print): Rename from
3671 state_rule_look_ahead_tokens_print, and update other uses.
3672 * src/state.h: Update English in comments.
3673 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
3674 (state_rule_lookahead_tokens_print): Rename from
3675 state_rule_look_ahead_tokens_print.
3676 * src/tables.c: Update English in comments.
3677 (conflict_row, action_row): Update uses.
3678 * tests/glr-regression.at
3679 (Incorrect lookahead during deterministic GLR,
3680 Incorrect lookahead during nondeterministic GLR): Rename
3681 print_look_ahead to print_lookahead.
3682 * tests/torture.at: Update English in comments.
3683 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
3684 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
3685 (Many lookahead tokens): Update uses.
3686 * data/glr.c: Update English in comments.
3687 * lalr1.cc: Likewise.
3688 * yacc.c: Likewise.
3689 * src/conflicts.h: Likewise.
3690 * src/lalr.h: Likewise.
3691 * src/main.c: Likewise.
3692 * src/output.c: Likewise.
3693 * src/parse-gram.c: Likewise.
3694 * src/tables.h: Likewise.
3695 * tests/calc.at: Likewise.
3696
3c40d0b5
JD
36972006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
3698
3699 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
3700
5d278082
PE
37012006-06-07 Paul Eggert <eggert@cs.ucla.edu>
3702
3703 * TODO: Add request from Nelson H. F. Beebe to be able to install
3704 Bison without installing the yacc script.
3705
9e668899
JD
37062006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
3707
3708 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
3709 and yytext if they're already #define'd.
3710 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
3711 * src/scan-code-c.c: ... here.
3712 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
3713 <config.h>.
3714
0c8e079f
JD
37152006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
3716
3717 Get Bison to build again when configured with --enable-gcc-warnings.
3718 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
3719 missing #include's.
3720 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
3721 loc argument as it shadows a global.
3722 * src/scan-gram.l: Remove stray comma that prevents boundary_set
3723 invocation.
3724
3725 * src/.cvsignore: Add scan-code.c.
3726
2346344a
AD
37272006-06-07 Akim Demaille <akim@epita.fr>
3728
3729 * src/scan-gram.l: Move the "add a trailing ; to actions" code
3730 to...
3731 * src/scan-code.l: here.
3732 * tests/input.at (Torturing the Scanner): Fix another location
3733 error.
3734
4862bdfd
AD
37352006-06-07 Akim Demaille <akim@epita.fr>
3736
3737 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
3738
e9071366
AD
37392006-06-06 Akim Demaille <akim@epita.fr>
3740
3741 Extract the parsing of user actions from the grammar scanner.
3742 As a consequence, the relation between the grammar scanner and
3743 parser is much simpler. We can also split "composite tokens" back
3744 into simple tokens.
3745 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
3746 * src/scan-gram.l (add_column_width, adjust_location): Move to and
3747 rename as...
3748 * src/location.h, src/location.c (add_column_width)
3749 (location_compute): these.
3750 Fix the column count: the initial column is 0.
3751 (location_print): Be robust to ending column being 0.
3752 * src/location.h (boundary_set): New.
3753 * src/main.c: Adjust to scanner_free being renamed as
3754 gram_scanner_free.
3755 * src/output.c: Include scan-code.h.
3756 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
3757 Use boundary_set.
3758 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
3759 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
3760 which is now, again, a separate token.
3761 Adjust all dependencies.
3762 Whereever actions with $ and @ are used, use translate_code.
3763 (action): Remove this nonterminal which is now useless.
3764 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
3765 (grammar_current_rule_action_append): Use translate_code.
3766 (packgram): Bound check ruleno, itemno, and rule_length.
3767 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
3768 (last_string, last_braced_code_loc, max_left_semantic_context)
3769 (scanner_initialize, scanner_free, scanner_last_string_free)
3770 (gram_out, gram_lineno, YY_DECL_): Move to...
3771 * src/scan-gram.h: this new file.
3772 (YY_DECL): Rename as...
3773 (GRAM_DECL): this.
3774 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
3775 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
3776 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
3777 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
3778 Move these declarations, and...
3779 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
3780 these to...
3781 * src/flex-scanner.h: this new file.
3782 * src/scan-gram.l (rule_length, rule_length_overflow)
3783 (increment_rule_length): Remove.
3784 (last_braced_code_loc): Rename as...
3785 (gram_last_braced_code_loc): this.
3786 Adjust to the changes of the parser.
3787 Move all the handling of $ and @ into...
3788 * src/scan-code.l: here.
3789 * src/scan-gram.l (handle_dollar, handle_at): Remove.
3790 (handle_action_dollar, handle_action_at): Move to...
3791 * src/scan-code.l: here.
3792 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
3793 scan-code.h, scan-code-c.c, scan-gram.h.
3794 (EXTRA_bison_SOURCES): Add scan-code.l.
3795 (BUILT_SOURCES): Add scan-code.c.
3796 (yacc): Be robust to white spaces.
3797
3798 * tests/conflicts.at, tests/input.at, tests/reduce.at,
3799 * tests/regression.at: Adjust the column numbers.
3800 * tests/regression.at: Adjust the error message.
7891a7c4 3801
184e42f0
JD
38022006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3803
3804 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3805 Use Akim's wording from
3806 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
3807
7891a7c4
JD
38082006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
3809
3810 Between Bison releases, manually append `+' to the previous Bison
3811 release number, and use that as a signal to automatically print the
3812 ChangeLog's CVS Id keyword from --version. Discussed starting at
3813 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
3814 * ChangeLog: Add Id header.
3815 * configure.ac (AC_INIT): Append `+' to `2.3'.
3816 * src/.cvsignore: Add revision.c.
3817 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
3818 (BUILT_SOURCES): Add revision.c.
3819 (revision.c): New target rule. This file defines a new global variable
3820 named revision. It initializes it with either the Id from ChangeLog
3821 or, if VERSION doesn't contain `+', with the empty string.
3822 * src/getargs.c (version): Print the value of revision.
3823 * src/revision.h: Extern revision.
3824
4ad3ed84
PE
38252006-06-05 Paul Eggert <eggert@cs.ucla.edu>
3826
3827 * NEWS: Version 2.3.
3828 * configure.ac (AC_INIT): Likewise.
3829
02103984
PE
38302006-05-30 Paul Eggert <eggert@cs.ucla.edu>
3831
3832 * data/glr.c (YYRECOVERING): Define to be a function-like macro
3833 with no arguments, not as an object-like macro. This is for
3834 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
3835 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
3836 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
3837 Document this.
3838
2c08afa5
JD
38392006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
3840
3841 * src/getargs.c (usage): Back out yesterday's modification of the
3842 --help output so that we don't have to wait for translation before
3843 releasing 2.3.
3844
6077da58
PE
38452006-05-29 Paul Eggert <eggert@cs.ucla.edu>
3846
3847 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
3848 Problem reported by Akim Demaille.
3849
2a26b6c2
JD
38502006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
3851
3852 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
3853
aefef0d6
PE
38542006-05-26 Paul Eggert <eggert@cs.ucla.edu>
3855
3856 * data/yacc.c (yy_reduce_print): Omit trailing white space in
3857 generated source code. Problem reported by Frans Englich in
3858 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
3859
fcd8e201
PE
38602006-05-22 Paul Eggert <eggert@cs.ucla.edu>
3861
3862 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
3863 shell, not within 'make', so that 'make' by an ordinary builder
3864 (using GNU make) does not worry about configuring gzip. This also
3865 works around a bug reported independently by Keith Thompson and by
3866 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
3867 stderr rather than stdout, messing up the build logs.
3868
7b5cdcbd
JD
38692006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3870
3871 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
3872 to make sure that YYID will never be unused. This fixes a 'make
3873 maintainer-check' failure caused by the recent changes to the 'Trivial
3874 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
3875 not used.
3876 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
3877
5ad0a449
JD
38782006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
3879
3880 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
3881 state before an empty RHS is always resolved here. Only the location
3882 of that state is guaranteed to be resolved, and that's enough. This
3883 fixes the remaining bug reported by Derek M. Jones in
3884 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3885 * tests/glr-regression.at (Uninitialized location when reporting
3886 ambiguity): Test the above case.
3887 Also, the embedded comments in this test case claim it checks the case
3888 of an empty RHS that has inherited the initial location. However, the
3889 corresponding LHS was already resolved, so yyresolveLocations didn't
3890 actually have reason to modify it. Fix this by forcing
3891 nondeterministic operation at the beginning of the parse.
3892
50cce58e
PE
38932006-05-20 Paul Eggert <eggert@cs.ucla.edu>
3894
3895 * data/c.m4 (b4_yy_symbol_print_generate):
3896 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
3897 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
3898 of the bugs reported today by Derek M Jones in
3899 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
3900 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
3901 defined to be a type name without parens or brackets.
3902 (Location Type): Similarly for YYLTYPE.
3903 * tests/regression.at (Trivial grammars): Put in a test for this
3904 bug that will be caught by 'make maintainer-check' (though not,
3905 alas, by 'make check' unless your compiler is picky).
3906
ab8d9dc5
PE
39072006-05-19 Paul Eggert <eggert@cs.ucla.edu>
3908
0d2c8934 3909 * NEWS: Version 2.2.
ab8d9dc5
PE
3910 * configure.ac (AC_INIT): Likewise.
3911
9138c575
JD
39122006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
3913
3914 * data/glr.c (yyreportTree): Make room in yystates for the state
3915 preceding the RHS. This fixes the segmentation fault reported by Derek
3916 M. Jones in
3917 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
3918 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
3919 to the user. Reported for yyreportTree by Derek M. Jones later in the
3920 same thread.
3921 * THANKS: Add Derek M. Jones.
3922 Update my email address.
3923 Fix typo in Steve Murphy's name.
3924
276f48df
PE
39252006-05-14 Paul Eggert <eggert@cs.ucla.edu>
3926
d6645148
PE
3927 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
3928 checking against YYLAST that caused the parser to miss a potential
3929 alternative in its diagnostic.
3930 Problem reported by Maria Jose Moron Fernandez in
3931 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
3932 * data/lalr1.cc (yysyntax_error_): Likewise.
3933 * data/yacc.c (yysyntax_error): Likewise.
3934 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
3935 tokens, in case we run into an older C compiler.
3936 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
3937 Use them to check for the off-by-one error fixed above.
3938
276f48df
PE
3939 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
3940 YYSIZE_T, not size_t.
3941 * tests/regression.at (Trivial grammars): New test, to catch
3942 the error fixed by the above patch.
3943
cd8b5791
AD
39442006-05-14 Akim Demaille <akim@lrde.epita.fr>
3945
3946 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
3947 scheme.
3948 Reported by Steve Murphy.
3949
34376418
AD
39502006-05-14 Akim Demaille <akim@lrde.epita.fr>
3951
3952 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
3953 * data/glr.cc: b4_location_flag is now b4_locations_flag.
3954
327afc7c
AD
39552006-05-14 Akim Demaille <akim@lrde.epita.fr>
3956
3957 Implement --trace=m4.
3958 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
3959 * src/output.c (output_skeleton): When set, pass -dV to m4.
3960
3961 Factor the handling of flags in m4.
3962 * src/output.c (prepare): Rename the muscle names debug, defines,
3963 error_verbose to debug_flag, defines_flag, error_verbose_flag.
3964 * data/c.m4: Adjust.
3965 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
3966 Use b4_define_flag_if to define other b4_FLAG_if macros.
3967 (b4_location_if): As a consequence, rename as...
3968 (b4_locations_if): this, for consistency.
3969 Adjust all the skeletons.
3970
ba9ecd19
AD
39712006-05-14 Akim Demaille <akim@lrde.epita.fr>
3972
3973 * etc/bench.pm: Shorten bench names.
3974
4e83ea15
AD
39752006-05-14 Akim Demaille <akim@lrde.epita.fr>
3976
3977 * src/output.h, src/output.c (error_verbose): Move to...
3978 * src/getargs.h, src/getargs.c: here.
3979 Sort the flags.
3980 Adjust dependencies.
3981
6e93d810
PE
39822006-05-13 Paul Eggert <eggert@cs.ucla.edu>
3983
3984 * data/c.m4 (b4_copyright): Put the special exception for Bison
3985 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
3986 uses changed. Suggested by Akim Demaille. Also, wrap the
3987 copyright notice, in case it is longer than 80 columns. Replace
3988 comma by newline after title.
6e93d810 3989
eaea13f5
PE
39902006-05-11 Paul Eggert <eggert@cs.ucla.edu>
3991
3992 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
3993 incompatibility, not a bug. Mention that it wasn't fixed as of
3994 flex 2.5.33.
3995
3cf084ec
AD
39962006-05-11 Akim Demaille <akim@lrde.epita.fr>
3997
3998 * examples/extexi: Enforce the precedence of concatenation over
3999 >>.
0a9f1c7d 4000 Reported by Tommy Nordgren.
3cf084ec 4001
32c96bd7
AD
40022006-05-11 Akim Demaille <akim@lrde.epita.fr>
4003
4004 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
4005 with the member "token".
f94705b2 4006 Reported by Martin Nylin.
32c96bd7 4007
eaea13f5
PE
40082006-05-08 Paul Eggert <eggert@cs.ucla.edu>
4009
4010 * data/glr.c: Switch to Bison 2.2 special-exception language in
4011 the copyright notice. Use more-regular format for titles and
4012 copyright notices.
4013 * data/glr.cc: Likewise.
4014 * data/location.cc: Likewise.
4015 * data/yacc.cc: Likewise.
4016 * doc/bison.texinfo (Conditions): Document this.
4017 * NEWS: likewise. Upgrade version to 2.2.
4018
6e2d1146
AD
40192006-04-27 Akim Demaille <akim@lrde.epita.fr>
4020
4021 * data/glr.cc: Remove dead code.
4022
47671055
PE
40232006-04-25 Paul Eggert <eggert@cs.ucla.edu>
4024
4025 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
4026 that variable and the line breaks the bootstrap. Problem reported
4027 by Juan M. Guerrero.
4028
ed2e6384
AD
40292006-04-24 Akim Demaille <akim@lrde.epita.fr>
4030
4031 * doc/bison.texinfo (Multiple start-symbols): New.
4032
3cedc2dc
AD
40332006-04-24 Akim Demaille <akim@lrde.epita.fr>
4034
4035 * etc/README, etc/bench.pl: New.
4036
b2ddc3f3
AD
40372006-04-03 Akim Demaille <akim@lrde.epita.fr>
4038
4039 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
4040 rule.
4041 Reported by Mickael Labau.
4042 * tests/input.at (Torturing the Scanner): Test it.
4043
91e3ac9a
PE
40442006-03-16 Paul Eggert <eggert@cs.ucla.edu>
4045
4046 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
4047 Problem reported by Bob Rossi.
4048
40492006-03-13 Paul Eggert <eggert@cs.ucla.edu>
4050
4051 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
4052 and didn't really work.
4053 For the index, use @ifnotinfo, not @iftex.
4054 Minor cleanups of spacing and terminology.
4055
5cf61e93
AD
40562006-03-12 Akim Demaille <akim@lrde.epita.fr>
4057
4058 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
4059 of AT_NAME_PREFIX when %name-prefix is not used.
4060
aa08666d
AD
40612006-03-12 Akim Demaille <akim@lrde.epita.fr>
4062
4063 Apply --prefix to C++ skeletons too: they change the namespace.
4064 The test suite already exercize these cases.
4065 * data/c++.m4 (b4_namespace): New.
4066 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
4067 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
4068 * data/yacc.c, data/glr.c: Remove a useless `[]'.
4069 * doc/bison.texinfo: Document it.
4070 (Option Cross Key): Use @multitable in all formats. It looks
4071 nicer, even in TeX outputs.
4072 (Rules): Use the same code whatever the output type is.
4073 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
4074 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
4075 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 4076
45567173
AD
40772006-03-10 Akim Demaille <akim@lrde.epita.fr>
4078
4079 * TODO: Remove dead items.
4080
e9d8f881 40812006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
4082
4083 * doc/FAQ: Remove, merged into...
4084 * doc/bison.texinfo (FAQ): this.
4085 * doc/Makefile.am (EXTRA_DIST): Adjust.
4086
c095d689
AD
40872006-03-10 Akim Demaille <akim@lrde.epita.fr>
4088
4089 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
4090 even if empty.
4091 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
4092 * doc/bison.texinfo (Calc++ Scanner): Use it.
4093
6e0f8287
PE
40942006-03-09 Paul Eggert <eggert@cs.ucla.edu>
4095
4096 Fix two nits reported by twlevo, plus one more that I discovered.
4097
4098 * src/assoc.h (assoc_to_string): Give a name to the arg, as
4099 this is the usual Bison style.
4100 * src/location.h (location_print): Likewise.
4101
4102 * src/reader.h (token_name): Likewise.
4103
d6b771c3
PE
41042006-03-08 Paul Eggert <eggert@cs.ucla.edu>
4105
4106 Fix some nits reported by twlevo.
4107 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
4108 and "POSIX". Use more-modern syntax for URLs. Mention C++
4109 and ask for Java. Don't hardwire OS version numbers. Add
4110 copyright notice.
4111 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
4112 * src/conflicts.c (solved_conflicts_obstack): Now static.
4113
1e137b71
JD
41142006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4115
4116 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
4117 page. Say "you can use it" not "you may use it" as on the web page;
4118 we're describing capabilities not granting permission.
4119
73f2e47e
PE
41202006-03-06 Paul Eggert <eggert@cs.ucla.edu>
4121
6d05403d
PE
4122 * data/glr.c (yyresolveLocations): Rename local variables to avoid
4123 shadowing warnings. Use usual patter for iterating through RHS.
4124 * tests/glr-regression.at
4125 (Uninitialized location when reporting ambiguity):
4126 Modify yylex so that it uses its argument, rather than trying
4127 to rely on ARGSUSED (which doesn't work for gcc with warnings).
4128 const char -> char const.
4129
73f2e47e
PE
4130 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
4131 Don't use tabs inside commands; it messes up 'ps'.
4132 Problem reported by twlevo.
4133
8710fc41
JD
41342006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
4135
4136 * tests/glr-regression.at (Uninitialized location when reporting
4137 ambiguity): New test case.
4138 * data/glr.c (yyresolveLocations): New function, which uses
4139 YYLLOC_DEFAULT.
4140 (yyresolveValue): Invoke yyresolveLocations before reporting an
4141 ambiguity.
4142 * doc/bison.texinfo (Default Action for Locations): Note
4143 YYLLOC_DEFAULT's usage for ambiguity locations.
4144 (GLR Semantic Actions): Cross-reference those notes.
4145
ae952af2
JD
41462006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
4147
4148 * tests/glr-regression.at (Leaked semantic values when reporting
4149 ambiguity): Remove unnecessary union and type declarations.
4150 (Leaked lookahead after nondeterministic parse syntax error): New test
4151 case.
4152 * data/glr.c (yyparse): Check for zero stacks remaining before
4153 attempting to shift the lookahead so that you don't lose it.
4154
35ee866a
JD
41552006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4156
4157 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
4158 * tests/glr-regression.at (Leaked semantic values when reporting
4159 ambiguity): New test case.
4160 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
4161 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
4162 now unnecessary yystackp parameter.
4163 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
4164 destructors can be called.
4165
4166 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
4167 in existing testcases.
4168
520181ab
JD
41692006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4170
4171 Don't leak semantic values for parent RHS when a user action cuts the
4172 parser, and clean up related code a bit.
4173 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
4174 cuts parse): Rename to...
4175 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
4176 for leaked parent RHS values.
4177 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
4178 between an unresolved state (non-empty chain of semantic options) and
4179 an incomplete one (signaled by an empty chain).
ae952af2 4180 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
4181 successfully or unsuccessfully resolved yyGLRState to...
4182 (yyresolveValue): ... here so that yyresolveValue always leaves a
4183 yyGLRState with consistent data and thus is easier to understand.
4184 Remove the yyvalp and yylocp parameters since they are always just
4185 taken from the yys parameter. When reporting a discarded merged value
4186 in debugging output, note that it is incompletely merged. Document the
4187 interface.
4188 (yyresolveAction): If resolving any of the RHS states fails, destroy
4189 them all rather than leaking them. Thus, as long as user actions are
4190 written to clean up the RHS correctly, yyresolveAction always cleans up
4191 the RHS of a semantic option. Document the interface.
4192
18d9185c
PE
41932006-02-27 Paul Eggert <eggert@cs.ucla.edu>
4194
4195 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
4196 led to a segmentation fault in GNU Pascal. Problem reported
4197 by Waldek Hebisch.
4198
841a7737
JD
41992006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
4200
4201 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
4202 mid-rule action inside a nonterminal symbol in order to declare a
4203 destructor for its semantic value.
4204
fc3f467f
PE
42052006-02-16 Paul Eggert <eggert@cs.ucla.edu>
4206
4207 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
4208 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
4209 __cplusplus && ! defined _STDLIB_H && !
4210 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
4211 defined free))]: Include <stdlib.h> rather than rolling our own
4212 declarations of malloc and free, to avoid problems with
4213 incompatible declarations (using 'throw') C++'s stdlib.h. This
4214 should fix Debian bug 340012
4215 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
4216 reported by Guillaume Melquiond.
4217
a3af26dd
PE
42182006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4219
4d7bc38c
PE
4220 * NEWS: Clarify symbols versus types in unused-value warnings.
4221
a3af26dd
PE
4222 * configure.ac (AC_INIT): Bump version number.
4223
4e26c69e
PE
42242006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4225
4226 * NEWS: Version 2.1a.
4227 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
4228 since C99 requires this.
4229
498e897c
PE
42302006-02-11 Paul Eggert <eggert@cs.ucla.edu>
4231
4232 * m4/c-working.m4: New file.
4233 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
4234
57bb17ca
PE
42352006-02-10 Paul Eggert <eggert@cs.ucla.edu>
4236
4237 * Makefile.maint: Merge from coreutils.
4238
0be105dc
PE
42392006-02-09 Paul Eggert <eggert@cs.ucla.edu>
4240
4241 More portability fixes for problems summarized by Nelson H. F. Beebe.
4242
4243 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
4244 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
4245 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
4246 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
4247 messes up because C++ code is compiled in 32-bit mode but linked
4248 in 64-bit mode.
4249
6fc0c024
PE
42502006-02-08 Paul Eggert <eggert@cs.ucla.edu>
4251
4252 More portability fixes for problems summarized by Nelson H. F. Beebe.
4253
7870f699
PE
4254 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
4255 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
4256
6fc0c024
PE
4257 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
4258 nodist_PROGRAMS, since we don't need to actually compile the
4259 example if we're just doing a plain 'make'. This avoids bothering
4260 the installer unnecessarily about problems due to weird C++
4261 compilers.
4262
fe6c2fde
PE
42632006-02-06 Paul Eggert <eggert@cs.ucla.edu>
4264
4265 More portability fixes for problems summarized by Nelson H. F. Beebe.
4266
4267 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
4268 than #include "...", and compile with -I'.'. The old method was
4269 not portable, according to Posix and the C standard, and it does
4270 not work with Sun C 5.7, where previous #line directives affect
4271 the working directory used in later #include "..." directives.
4272
927b425b
JMG
42732006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4274
4275 Various DJGGP specific issues in /djgpp
4276
d9735e9e
PE
42772006-02-02 Paul Eggert <eggert@cs.ucla.edu>
4278
4279 More portability fixes for problems summarized by Nelson H. F. Beebe.
4280
4281 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
4282 '#include <map>' works and that you can apply ++ to iterators.
4283
5a6755af
PE
42842006-02-01 Paul Eggert <eggert@cs.ucla.edu>
4285
67a0dc4f
PE
4286 Work around portability problems summarized by Nelson H. F. Beebe in
4287 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
4288
8c86f0ef
PE
4289 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4290 that '#include <string>' works.
4291
de35dd59
PE
4292 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
4293 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
4294 "warning: sorry: semantics of inline function static data `const
4295 unsigned char translate_table[262]' are wrong (you'll wind up with
4296 multiple copies)".
4297
67a0dc4f
PE
4298 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
4299 or, xor to not_, and_, or_, and xor_, respectively. This works
4300 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
4301 random system header somewhere that includes the equivalent of
4302 <iso646.h>.
4303
5a6755af
PE
4304 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
4305 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 4306 Suite Version 2.0.
5a6755af 4307
3f001415
JD
43082006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
4309
4310 During deterministic GLR operation, user actions should be able to
4311 influence the parse by changing yychar. To make this easier to fix and
4312 to make glr.c easier to evolve in general, don't maintain yytoken in
4313 parallel with yychar; just compute yytoken when needed.
4314 * tests/glr-regression.at (Incorrect lookahead during deterministic
4315 GLR): Check that setting yychar in a user action has the intended
4316 effect.
4317 * data/glr.c (yyGLRStack): Remove yytokenp member.
4318 (yyclearin): Don't set *yytokenp.
4319 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
4320 yychar rather than *yytokenp to determine the current lookahead.
4321 Compute yytoken locally when needed.
4322 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
4323 point to.
4324
4325 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
4326 after `--report' documentation.
4327
e2a8c0f5
PE
43282006-01-30 Paul Eggert <eggert@cs.ucla.edu>
4329
4330 * src/parse-gram.y (grammar_declaration): Location of printer
4331 symbol is @1, not list->location. Bug reported by twlevo.
4332 * tests/input.at (Incompatible Aliases): Adjust to above change.
4333
6b702268
PE
43342006-01-29 Paul Eggert <eggert@cs.ucla.edu>
4335
27622431
PE
4336 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
4337 all the test at once. This makes the output easier to read in the
4338 normal case.
4339
6b702268
PE
4340 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
4341 got from <http://bro-ids.org/download.html>. The bug is that
4342 when two actions appeared in succession, the second one was
4343 scanned before the first one was added to the grammar rule
4344 as a midrule action. Bison then output the incorrect warning
4345 "parse.y:905.17-906.36: warning: unused value: $3".
4346 * src/parse-gram.y (BRACED_CODE, action): These are no longer
4347 associated with a value.
4348 (rhs): Don't invoke grammar_current_rule_action_append.
4349 (action): Invoke it here instead.
4350 * src/reader.c (grammar_midrule_action): Now extern.
4351 (grammar_current_rule_action_append): Don't invoke
4352 grammar_midrule_action; that is now the scanner's job.
4353 * src/reader.h (last_string, last_braced_code_loc):
4354 (grammar_midrule_action): New decls.
4355 * src/scan-gram.l (last_string): Now extern, sigh.
4356 (last_braced_code_loc): New extern variable.
4357 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
4358 rule already has an action.
4359 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
4360 * tests/input.at (AT_CHECK_UNUSED_VALUES):
4361 Add some tests to check that the above changes fixed the bug.
4362
d40ba6c2
PE
43632006-01-27 Paul Eggert <eggert@cs.ucla.edu>
4364
4365 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
4366 All used changed. Check whether the symbol has a destructor,
4367 not whether it is typed.
4368 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
4369 that the values are still reported as unused. All line numbers
4370 adjusted.
4371
401aace6
PE
43722006-01-23 Paul Eggert <eggert@cs.ucla.edu>
4373
4374 Work around a bug in bro 0.8, which underparenthesizes its
4375 definition of YYLLOC_DEFAULT.
4376 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
4377 their arguments.
4378 * data/lalr1.cc: Likewise.
4379 * data/yacc.cc: Likewise.
4380
06f01bc4
PE
43812006-01-22 Paul Eggert <eggert@cs.ucla.edu>
4382
401aace6
PE
4383 Work around a bug in Pike 7.0, and give the Pike folks a
4384 better way to override the usual int widths.
4385 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
4386 user can override the types.
4387 (short): #undef, to work around a bug in Pike 7.0.
4388 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
4389 (union yyalloc.yyss): Use yytype_int16 rather than short.
4390 All uses changed.
4391 (yysigned_char): Remove.
4392 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
4393 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
4394 * tests/regression.at (Web2c Actions): Adjust to above changes.
4395
4396 * src/reader.c (check_and_convert_grammar): New function.
4397 (reader): Close the input file even if something went wrong during
4398 parsing. Minor file descriptor leak reported by twlevo.
4399
06f01bc4
PE
4400 * src/assoc.c (assoc_to_string): Use a default: abort (); case
4401 to pacify gcc -Wswitch-default.
4402 * src/scan-gram.l (adjust_location): Use a default: break; case
4403 to pacify gcc -Wswitch-default.
4404 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
4405 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4406 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4407 Move these decls to scan-skel.l, since they don't need to be
4408 visible elsewhere.
4409 * src/scan-skel.l: Accept the above decls.
4410 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
4411 is used.
4412
02650b7f
PE
44132006-01-21 Paul Eggert <eggert@cs.ucla.edu>
4414
4415 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
4416 since we don't want to insist on a version number at the start
4417 of the changelog every time.
4418 * Makefile.maint: Sync from coreutils a bit better.
4419 (sc_trailing_blank): Renamed from sc_trailing_space.
4420 All uses changed.
4421 (sc_no_if_have_config_h, sc_require_config_h):
4422 (sc_prohibit_assert_without_use): New rules.
4423 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
4424 (sc_dd_max_sym_length): Fix leading spaces in rule.
4425 (sc_system_h_headers): Prefix with @.
4426 (sc_useless_cpp_parens, m4-check): Output line numbers.
4427 (changelog-check): Allow version only in head.
4428 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
4429 satisfy new Makefile.maint rule.
4430 * data/glr.c: Likewise.
4431 * data/glr.cc: Likewise.
4432 * data/lalr1.cc: Likewise.
4433 * data/yacc.c: Likewise.
4434 * lib/ebitsetv.c: Likewise.
4435 * lib/lbitset.c: Likewise.
4436 * lib/subpipe.c: Likewise.
4437 * lib/timevar.c: Likewise.
4438 * src/system.h: Likewise.
4439 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
4440 * djgpp/Makefile.maint: Add copyright notice.
4441 * djgpp/README.in: Likewise.
4442 * djgpp/config.bat: Likewise.
4443 * djgpp/config.site: Likewise.
4444 * djgpp/config_h.sed: Likewise.
4445 * djgpp/djunpack.bat: Likewise.
4446 * djgpp/config.sed: Fix copyright notice to match standard format.
4447 * djgpp/subpipe.h: Likewise.
4448 * lib/bitsetv-print.c: Likewise.
4449 * lib/bitsetv.c: Likewise.
4450 * lib/subpipe.h: Likewise.
4451 * lib/timevar.c: Likewise.
4452 * lib/timevar.h: Likewise.
4453 * djgpp/subpipe.c: Use standard recipe for config.h.
4454 * lib/abitset.c: Likewise.
4455 * lib/bitset.c: Likewise.
4456 * lib/bitset_stats.c: Likewise.
4457 * lib/bitsetv-print.c: Likewise.
4458 * lib/bitsetv.c: Likewise.
4459 * lib/ebitsetv.c: Likewise.
4460 * lib/get-errno.c: Likewise.
4461 * lib/lbitset.c: Likewise.
4462 * lib/subpipe.c: Likewise.
4463 * lib/timevar.c: Likewise.
4464 * lib/vbitset.c: Likewise.
4465 * tests/local.at: Likewise.
4466 * src/scan-gram.l: Don't include verify.h, since system.h does
4467 that for us.
4468 * .x-sc_require_config_h: New file.
4469 * .x-sc_unmarked_diagnostics: New file.
4470
287c78f6
PE
44712006-01-20 Paul Eggert <eggert@cs.ucla.edu>
4472
287c78f6
PE
4473 Be a bit more systematic about using 'abort'.
4474 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
4475 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
4476 Put 'default: abort ();' before some other case, to satisfy older
4477 pedantic compilers.
4478 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4479 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
4480 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
4481 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
4482 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
4483 (get_decision_str, get_orientation_str, get_node_alignment_str):
4484 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
4485 (get_linestyle_str, get_arrowstyle_str): Likewise.
4486 * src/conflicts.c (resolve_sr_conflict):
4487 Use a default case rather than one for the one remaining enum
4488 value, to catch invalid enum values as well.
4489 * src/lalr.c (set_goto_map, map_goto):
4490 Prefer "assert (FOO);" to "if (!FOO) abort ();".
4491 * src/nullable.c (nullable_compute, token_definitions_output):
4492 Likewise.
4493 * src/reader.c (packgram, reader): Likewise.
4494 * src/state.c (transitions_to, state_new, state_reduction_find):
4495 Likewise.
4496 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
4497 (symbol_pack): Likewise.
4498 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
4499 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
4500 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
4501 * src/system.h: Don't include <assert.h>.
4502 (assert): New macro.
4503
4504 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
4505 (Destructor Decl, Parser Function, Pure Calling):
4506 Describe rules for braces inside C code more carefully.
287c78f6 4507
c66dfadd
PE
45082006-01-19 Paul Eggert <eggert@cs.ucla.edu>
4509
c21493b8
PE
4510 Fix some porting glitches found by Nelson H. F. Beebe.
4511 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
4512 compilers that don't understand that abort () does not return.
4513 * src/state.c (transitions_to): Likewise.
4514 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4515 that '#include <cstdlib>' works.
4516 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
4517 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
4518 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
4519 for the benefit of some pre-C99 compilers.
4520
b6e3facf
PE
4521 * bootstrap: Undo changes to gnulib files that autoreconf made.
4522
c66dfadd
PE
4523 Minor fixups to get 'make maintainer-check' to work.
4524 * configure.ac: Don't use -Wnested-externs, as it's incompatible
4525 with the new verify.h implementation.
4526 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
4527 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
4528 * data/yacc.c (YYUSE): Likewise.
4529 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
4530 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
4531 * src/parse-gram.y (declaration): Don't pass a string constant
4532 to a function that expects char *, since GCC might complain
4533 about the constant value.
4534 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
4535 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
4536 before #defining them.
4537 * tests/glr-regression.at
4538 (Incorrectly initialized location for empty right-hand side in GLR):
4539 In yyerror, use the msg arg.
4540 (Corrupted semantic options if user action cuts parse):
4541 (Incorrect lookahead during deterministic GLR):
4542 (Incorrect lookahead during nondeterministic GLR):
4543 Don't name a local var 'index'; it shadows string.h's 'index'.
4544
ed94ef2a
AD
45452006-01-19 Akim Demaille <akim@epita.fr>
4546
4547 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
4548 location, not just parts of it.
4549
e9ad4aec
PE
45502006-01-18 Paul Eggert <eggert@cs.ucla.edu>
4551
d6ca7905
PE
4552 * NEWS: Document the fact that multiple %unions are now allowed.
4553 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
4554 * TODO: This feature is now implemented, so remove it from
4555 the wishlist.
d6ca7905 4556
ef1b70e0
PE
4557 * Makefile.maint: Merge with coreutils Makefile.maint.
4558 (CVS_LIST): Use build-aux version if available.
4559 (VERSION_REGEXP): New macro.
4560 (syntax-check-rules): Add sc_no_if_have_config_h,
4561 sc_prohibit_assert_without_use, sc_require_config_h,
4562 sc_useless_cpp_parens.
4563 (sc_obsolete_symbols): Check for O_NDELAY.
4564 (sc_dd_max_sym_length): Track coreutils.
4565 (sc_unmarked_diagnostics): Look in all files, not just *.c.
4566 (sc_useless_cpp_parens): New rule.
4567 (news-date-check): Look for version or today's date.
4568 (changelog-check): Don't require version number near head.
4569 (copyright-check): Use current year instead of hardwiring 2005.
4570 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
4571 (announcement): Add --gpg-key-ID.
4572
4573 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
4574 with "file system".
4575
2073ce56 4576 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
4577 array. Problem reported by twlevo.
4578 * src/reader.c (packgram): Prepend a new sentinel before ritem.
4579 * src/lalr.c (build_relations): Rely on new sentinel.
4580 * src/gram.c (gram_free): Adjust to new sentinel.
4581
b7691f15
JD
45822006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
4583
4584 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
4585 yylookaheadNeeds. All uses updated.
4586 (yysplitStack): Rename local yynewLookaheadStatuses to
4587 yynewLookaheadNeeds.
4588 * data/glr-regression.at (Incorrect lookahead during nondeterministic
4589 GLR): In comments, change `lookahead status' to `lookahead need'.
4590
ddee1b06
PH
45912006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4592
4593 * data/glr.c (yysplitStack): A little stylistic rewrite.
4594
12f4614d
PH
45952006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4596
4597 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
4598
32c29292
JD
45992006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
4600
4601 * doc/bison.texinfo: Fix some typos.
4602 (GLR Semantic Actions): New subsection discussing special
4603 considerations because GLR semantic actions might be deferred.
4604 (Actions): Mention look-ahead usage of yylval.
4605 (Actions and Locations): Mention look-ahead usage of yylloc.
4606 (Special Features for Use in Actions): Add YYEOF entry and mention it
4607 in the yychar entry.
4608 In the yychar entry, remove mention of the local yychar case (pure
4609 parser) since this is irrelevant information when writing semantic
148d66d8 4610 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
4611 yychar is otherwise described as an external variable.
4612 In the yychar entry, don't call it the `current' look-ahead since it
4613 isn't when semantic actions are deferred.
4614 In the yychar and yyclearin entries, add note about deferred semantic
4615 actions.
4616 Add yylloc and yylval entries discussing look-ahead usage.
4617 (Look-Ahead Tokens): When discussing yychar, don't call it the
4618 `current' look-ahead, and do mention yylval and yylloc.
4619 (Error Recovery): Cross-reference `Action Features' when mentioning
4620 yyclearin.
148d66d8 4621 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
4622 look-ahead.
4623 In the yylloc and yylval entries, mention look-ahead usage.
4624
de366a2f 46252006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
4626
4627 * tests/glr-regression.at: Update copyright year to 2006.
4628
bf70fa87
JD
46292006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4630
4631 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
4632 use during nondeterministic operation to track which stacks have
4633 actually needed the current lookahead.
4634 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
4635 Allocate, deallocate, resize, and otherwise shuffle space for
4636 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
4637 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
4638 appropriately during nondeterministic operation.
4639 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
4640 members to store the current lookahead to be used by the deferred
4641 user action.
4642 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
4643 from which the RHS is taken. Set the lookahead members of the new
4644 yySemanticOption according to the lookahead status for stack yyk.
4645 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
4646 yyaddDeferredAction.
4647 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
4648 members of yySemanticOption before invoking yyuserAction, and then set
4649 them back to their current values afterward.
4650 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
4651 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
4652 * tests/glr-regression.at: Remove `.' from the ends of recent test case
4653 titles for consistency.
4654 (Leaked merged semantic value if user action cuts parse): In order to
4655 suppress lint warnings, use arguments in merge function, and assign
4656 char value < 128 in main.
4657 (Incorrect lookahead during deterministic GLR): New test case.
4658 (Incorrect lookahead during nondeterministic GLR): New test case.
4659
05449a2c
JD
46602006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4661
de366a2f 4662 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
4663 !yyvaluep as signal that no semantic value is available to print.
4664 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
4665 to print a semantic value.
4666
4158e0a1 46672006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 4668
4158e0a1
JD
4669 * tests/glr-regression.at: For consistency with my newer test cases,
4670 don't thank myself.
4671
d659304d
JD
46722006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4673
4674 * data/glr.c (yyresolveValue): When merging semantic options, if at
4675 least one user action succeeds but a later one cuts the parse, then
4676 destroy the semantic value before returning rather than leaking it.
4677 (yyresolveStates): If a user action cuts the parse and thus
4678 yyresolveValue fails, ignore the (unset) semantic value rather than
4679 corrupting the yyGLRState, and empty the semantic options list since
4680 the user actions should have called all necessary destructors.
4681 Simplify code with YYCHK.
4682 * tests/glr-regression.at (Corrupted semantic options if user action
4683 cuts parse): New test case.
4684 (Undesirable destructors if user action cuts parse): New test case.
4685 Before applying any of this patch, this test case never actually failed
4686 for me... but only because the corrupted semantic options usually
4687 masked this bug.
4688 (Leaked merged semantic value if user action cuts parse): New test
4689 case.
4690
6ec2c0f2
AD
46912006-01-05 Akim Demaille <akim@epita.fr>
4692
4693 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
4694
1b9c21fb
PE
46952006-01-04 Paul Eggert <eggert@cs.ucla.edu>
4696
4697 * data/c.m4 (b4_c_modern): New macro, with a new provision for
4698 _MSC_VER. Problem reported by Cenzato Marco.
4699 (b4_c_function_def): Use it.
4700 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
4701 b4_c_modern.
4702 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
4703 than rolling our own.
4704
84866159
AD
47052006-01-04 Akim Demaille <akim@epita.fr>
4706
4707 Also warn about non-used mid-rule values.
4708 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
4709 member.
4710 (symbol_list_new): Adjust.
4711 * src/reader.c (symbol_typed_p): New.
4712 (grammar_rule_check): Use it.
4713 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
4714 Check its rule.
4715 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
4716 Use it.
4717 * tests/actions.at (Exotic Dollars): Adjust.
4718
378f4bd8
AD
47192006-01-04 Akim Demaille <akim@epita.fr>
4720
4721 * src/reader.c (grammar_midrule_action): If $$ is set in a
4722 mid-rule, move the `used' bit to its lhs.
4723 * tests/input.at (Unused values): New.
4724 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
4725
e2a21b6f
PE
47262006-01-03 Paul Eggert <eggert@cs.ucla.edu>
4727
54662697
PE
4728 * doc/bison.texinfo (Bison Options): Say more accurately what
4729 --yacc does.
4730 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
4731 about declarations in the grammar when in Yacc mode, as POSIX does
4732 not require a diagnostic when the grammar uses extensions.
4733
4734 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
4735
073f9288
PE
4736 Warn about dubious constructions like "%token T T".
4737 Reported by twlevo.
4738 * src/symtab.h (struct symbol.declared): New member.
4739 * src/symtab.c (symbol_new): Initialize it to false.
4740 (symbol_class_set): New arg DECLARING, specifying whether
4741 this is a declaration that we want to warn about, if there
4742 is more than one of them. All uses changed.
4743
1221b78a
PE
4744 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
4745 Allow multiple %union directives, whose contents concatenate.
4746 * src/parse-gram.y (grammar_declaration): Likewise.
4747 Use muscle_code_grow, so that we don't need stype_line any more.
4748 All uses changed.
4749
4750 * src/muscle_tab.c (muscle_grow): Fix comment.
4751
e2a21b6f
PE
4752 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
4753 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
4754 Update copyright year to 2006.
4755
8f7e3cf9
AD
47562006-01-03 Akim Demaille <akim@epita.fr>
4757
4758 Have glr.cc pass (some of) the calc.at tests.
4759 * data/glr.cc (b4_parse_param_orig): New.
4760 (b4_parse_param): Improve its definition, and bound it more
4761 clearly in the skeleton.
4762 (b4_epilogue): Append, instead of prepending, in order to keep
4763 #line consistency.
4764 Simplify the generation of auxiliary functions: locations and
4765 purity are mandated.
4766 (b4_global_tokens_and_yystype): Honor it.
4767 * data/location.cc (c++.m4): Don't include it.
4768 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
4769 and AT_SKEL_CC_IF.
4770 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
4771 AT_LALR1_CC_IF.
4772 Be sure to initialize the first position's filename.
4773 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
4774 mandated anyway.
4775 (AT_CHECK_CALC_GLR_CC): New.
4776 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
4777
3953ed88
AD
47782006-01-02 Akim Demaille <akim@epita.fr>
4779
4780 * src/output.c (output_skeleton): Don't hard wire the inclusion of
4781 c.m4.
0a96ba81 4782 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
4783 * data/glr.cc: Do not include stack.hh.
4784
9ecafbbf
AD
47852006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
4786
4787 * data/glr.c: Reformat whitespace with tabs.
4788 (b4_lpure_formals): Remove this unused m4 macro.
4789 * tests/cxx-type.at: Reformat whitespace with tabs.
4790 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
4791 since it's a member. Rename type to isNterm for clarity.
4792
c4d497a0
AD
47932005-12-29 Akim <akim@sulaco.local>
4794
4795 Let glr.cc catch up with symbol_value_print.
4796 * data/glr.cc (b4_yysymprint_generate): Replace by...
4797 (b4_yy_symbol_print_generate): this.
4798 (yy_symbol_print, yy_symbol_value_print): Declare them.
4799
4517da37
PE
48002005-12-28 Paul Eggert <eggert@cs.ucla.edu>
4801
4802 * src/location.h (boundary): Note that a line or column equal
4803 to INT_MAX indicates an overflow.
4804 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
4805 (rule_length_overflow, increment_rule_length, add_column_width):
4806 New functions.
4807 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
4808 (<SC_BRACED_CODE>"}"):
4809 Use increment_rule_length rather than incrementing it by hand.
4810 (adjust_location, handle_syncline): Diagnose overflow.
4811 (handle_action_dollar, handle_action_at):
4812 Fix bug with monstrosities like $-2147483648.
4813 Remove now-unnecessary checks.
4814 (scan_integer): Verify assumptions and remove now-unnecessary checks.
4815 (convert_ucn_to_byte): Verify assumptions.
4816 (handle_syncline): New arg LOC. All callers changed.
4817 Don't store through a value derived from char const * pointer.
4818
4819 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
4820 GCC warnings.
4821
e3233bf6
PE
48222005-12-27 Paul Eggert <eggert@cs.ucla.edu>
4823
4824 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
4825 Remove unnecessary forward static decls.
4826
8f3596a6
AD
48272005-12-27 Akim Demaille <akim@epita.fr>
4828
4829 * src/reader.c (grammar_current_rule_check): Also check that $$
4830 is used.
4831 Take the rule to check as argument, hence rename as...
4832 (grammar_rule_check): this.
4833 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
4834 Rename as...
4835 (grammar_rule_begin, grammar_rule_end): these, for consistency.
4836 (grammar_midrule_action, grammar_symbol_append): Now static.
4837 * tests/torture.at (input): Don't rely on the default action
4838 being always performed.
4839 * tests/calc.at: "Set" $$ even when the action is "cut" with
4840 YYERROR or other.
4841 * tests/actions.at (Exotic Dollars): Instead of using unused
4842 values, check that the warning is issued.
4843
721be13c
PE
48442005-12-22 Paul Eggert <eggert@cs.ucla.edu>
4845
4846 * NEWS: Improve wording for unused-value warnings.
4847
a0af42fc
AD
48482005-12-22 Akim Demaille <akim@epita.fr>
4849
4850 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
4851 (b4_yysymprint_generate): Rename as...
4852 (b4_yy_symbol_print_generate): this.
4853 Generate yy_symbol_print instead of yysymprint.
4854 Generate also yy_symbol_value_print, and use it.
4855
affac613
AD
48562005-12-22 Akim Demaille <akim@epita.fr>
4857
721be13c 4858 * NEWS: Warn about unused values.
affac613
AD
4859 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
4860 a `used' member.
4861 (symbol_list_n_get, symbol_list_n_used_set): New.
4862 (symbol_list_n_type_name_get): Use symbol_list_n_get.
4863 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
4864 * src/reader.c (grammar_current_rule_check): Check that values are
4865 used.
4866 * src/symtab.c (symbol_print): Accept 0.
4867 * tests/existing.at: Remove the type information.
4868 Empty the actions.
4869 Remove useless actions (beware of mid-rule actions: perl -000
4870 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
4871 * tests/actions.at (Exotic Dollars): Use unused values.
4872 * tests/calc.at: Likewise.
4873 * tests/glr-regression.at (No users destructors if stack 0 deleted):
4874 Likewise.
4875
4876 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
4877 rule_useful_p.
4878
9d9b8b70
PE
48792005-12-21 Paul Eggert <eggert@cs.ucla.edu>
4880
8bb4c753
PE
4881 Undo 2005-12-01 tentative license wording change. The wording is
4882 still being reviewed by the lawyers, and we don't want to wait for
4883 them before publishing a test release. For now, revert to the
4884 previous wording.
4885 * NEWS: Undo 2005-12-01 change.
4886 * data/glr.c: Revert to previous license wording.
4887 * data/glr.cc: Likewise.
4888 * data/lalr1.cc: Likewise.
4889 * data/location.cc: Likewise.
4890 * data/yacc.c: Likewise.
4891
9d9b8b70
PE
4892 * NEWS: Reword %destructor vs YYABORT etc.
4893 * data/glr.c: Use American spacing, for consistency.
4894 * data/glr.cc: Likewise.
4895 * data/lalr1.cc: Likewise.
4896 * data/yacc.c: Likewise.
4897 * data/yacc.c: Reformat comments slightly.
4898 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
4899 for consistency. Fix some spelling errors and reword recently-included
4900 text slightly.
4901 * tests/cxx-type.at: Cast results of malloc, for C++.
4902
2c3b392a
AD
49032005-12-21 Joel E. Denny <address@hidden>
4904
4905 * tests/cxx-type.at: Construct a tree, count the parents of shared
4906 nodes, and free each node once and only once. Previously, the memory
4907 for semantic values was leaked instead.
4908
d6cff4dc
AD
49092005-12-21 Joel E. Denny <address@hidden>
4910
4911 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
4912 (yylval, yylloc): If pure, #define to yystackp->yyval and
4913 yystackp->yyloc similar to yychar and yynerrs.
4914 (yyparse): If pure, remove local yylval and yylloc. Add local
4915 yystackp to accommodate pure definitions of yylval and yylloc.
4916 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
4917 yylvalp and yyllocp to &yylval and &yylloc.
4918 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
4919 namespace. Previously, nerrs and char were missing, but lval and lloc
4920 weren't necessary.
4921 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
4922 yylvalp and yyllocp parameters since, if pure, these are now always
4923 accessible through yystackp. If not pure, they are still accessible
4924 globally.
4925 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
4926 `if (YYID (N))' to pacify lint.
4927
a85284cf
AD
49282005-12-21 Akim Demaille <akim@epita.fr>
4929
4930 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
4931 destroy the RHS symbols of a rule.
4932 * data/yacc.c (yylen): Initialize to 0.
4933 Keep its value to the number of items to possibly shift.
4934 In particular, a regular successful parse that ends on YYFINAL by
4935 a (internal) YYACCEPT must not have yylen != 0.
4936 (yyerrorlab, yyreturn): Pop the RHS.
4937 Reorder a bit to emphasize the `shifting' bits of code.
4938 (YYPOPSTACK): Now accept a number of items to pop.
4939 * data/lalr1.cc: Likewise.
4940 * data/glr.c: Formatting changes.
4941 Use goto instead of fall through.
4942 * doc/bison.texinfo (Destructor Decl): Complete.
4943
d508c281
JMG
49442005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4945
4946 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
4947 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
4948 * djgpp/config.bat: Replace every occurence of the file name
4949 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
4950 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
4951 * djgpp/config.sed: Replace every occurence of the file name
4952 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
4953 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
4954 * djgpp/djunpack.bat: DJGPP specific file.
4955 * djgpp/fnchange.lst: DJGPP specific file.
4956 * djgpp/README.in: Add new information about how to unpack the bison
4957 source on MSDOS and other systems which have 8.3 file name restrictions
4958 using djunpack.bat and fnchange.lst.
4959
3e7a2cd9
PE
49602005-12-12 Paul Eggert <eggert@cs.ucla.edu>
4961
4962 * bootstrap (build_cvs_prefix): Remove; unused.
4963 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
4964 when getting gnulib.
4965
49662005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
4967
4968 * data/glr.c: Reorder typedef declarations for structs to match order
4969 of struct declarations.
4970 Rename yystack everywhere to yystackp except in yyparse where it's not
4971 a pointer.
4972 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
4973 consistency.
4974 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
4975 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
4976 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
4977 lint.
4978
877519f8
PE
49792005-12-09 Paul Eggert <eggert@cs.ucla.edu>
4980
0eca5a39
PE
4981 * tests/sets.at (Accept): Fix typos in regular expression used to
4982 sed out the final state number.
4983
2cec9080
PE
4984 Work around portability problem on Solaris 10: flex-generated
4985 files include <stdio.h> before <config.h>, which messes up
4986 because the latter defines __EXTENSIONS__. Address the problem
4987 by creating two new little files that include <config.h> first,
4988 then include the flex-generated files. Rewrite everyone else
4989 to include <config.h> first, as well.
4990 * lib/timevar.c: Always include "config.h".
4991 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
4992 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
4993 (EXTRA_bison_SOURCES): New macro.
4994 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
4995 * src/system.h: Don't include config.h.
4996 * src/LR0.c: Include <config.h> first.
4997 * src/assoc.c: Likewise.
4998 * src/closure.c: Likewise.
4999 * src/complain.c: Likewise.
5000 * src/conflicts.c: Likewise.
5001 * src/derives.c: Likewise.
5002 * src/files.c: Likewise.
5003 * src/getargs.c: Likewise.
5004 * src/gram.c: Likewise.
5005 * src/lalr.c: Likewise.
5006 * src/location.c: Likewise.
5007 * src/main.c: Likewise.
5008 * src/muscle_tab.c: Likewise.
5009 * src/nullable.c: Likewise.
5010 * src/output.c: Likewise.
5011 * src/parse-gram.y: Likewise.
5012 * src/print.c: Likewise.
5013 * src/print_graph.c: Likewise.
5014 * src/reader.c: Likewise.
5015 * src/reduce.c: Likewise.
5016 * src/relation.c: Likewise.
5017 * src/state.c: Likewise.
5018 * src/symlist.c: Likewise.
5019 * src/symtab.c: Likewise.
5020 * src/tables.c: Likewise.
5021 * src/uniqstr.c: Likewise.
5022 * src/vcg.c: Likewise.
5023
877519f8
PE
5024 * src/parse-gram.y: Fix minor problems uncovered by lint.
5025 (current_lhs, current_lhs_location): Now static.
5026 (current_assoc): Remove unused variable.
5027
5028 Cleanups so that Bison-generated parsers have less lint.
5029 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
5030 Prepend /*ARGSUSED*/, for lint's sake.
5031 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
5032 definition if 'lint' is defined.
5033 (YYID): New macro (or function, if lint).
5034 All uses of /*CONSTCOND*/0 replaced by YYID(0).
5035 * data/yacc.c: Likewise.
5036 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
5037 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
5038 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
5039 is C++ only.
5040 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
5041 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
5042 Use YYID(0) rather than 0, for lint.
5043 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
5044 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
5045
f5228370
PE
50462005-12-07 Paul Eggert <eggert@cs.ucla.edu>
5047
5048 * tests/glr-regression.at
5049 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5050 Close memory leak reported by twlevo.
5051
69ce078b
PE
50522005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
5053
6ff99711
PE
5054 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
5055 all stacks.
5056 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
5057 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5058 New test case.
5059 (Duplicated user destructor for lookahead): This test now is expected
5060 to succeed.
5061
af3412cd
PE
50622005-12-01 Paul Eggert <eggert@cs.ucla.edu>
5063
32b5b719 5064 * NEWS: Document the following change.
af3412cd
PE
5065 * data/yacc.c: Say "parser skeleton" rather than "file", since
5066 it's no longer just a file.
5067 * data/glr.c: Grant a special exception for C GLR parsers, that
5068 reads like the already-existing exception for C LALR(1) parsers.
5069 * data/glr.cc: Likewise.
5070 * data/lalr1.cc: Likewise.
5071 * data/location.cc: Likewise.
5072 * data/yacc.c: Reword the "written by" statement to clarify that
5073 it was the parser skeleton, not the entire output file.
5074 * data/glr.c: Written by Paul Hilfinger.
5075 * data/glr.cc: Written by Akim Demaille.
5076 * data/lalr1.cc: Likewise.
5077
035aa4a0
PE
50782005-11-18 Paul Eggert <eggert@cs.ucla.edu>
5079
d9963c85
PE
5080 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
5081 Fix typos in previous change that broke 'make check'.
5082 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
5083 supported in C.
5084 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
5085 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
5086 We can revert this once things settle down.
5087
035aa4a0
PE
5088 * src/conflicts.c (conflicts_print): Don't print file name twice
5089 when %expect fails because there were no conflicts.
5090 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
5091 change.
5092 * tests/conflicts.at (%expect not enough, %expect too much):
5093 (%expect with reduce conflicts): Adjust to new behavior.
5094
50952005-11-18 Akim Demaille <akim@epita.fr>
5096
5097 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
5098 errors.
5099 * NEWS: Document this.
5100 * doc/bison.texinfo (Expect Decl): Likewise.
5101
d1ff7a7c
AD
51022005-11-16 Akim Demaille <akim@epita.fr>
5103
5104 Generalize the display of semantic values and locations in traces.
5105 * data/glr.c (yy_reduce_print): Fix indices (again).
5106 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
5107 literal integers.
5108 * data/lalr1.cc (yyreduce_print): Rename as...
5109 (yy_reduce_print): this.
5110 Display values and locations.
5111 * data/yacc.c (yy_reduce_print): Likewise.
5112 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
5113 (yysymprint): Move higher to be visible from yy_reduce_print).
5114 (yyparse): Adjust.
5115 * tests/calc.at: Adjust the expected length of the traces.
5116
6de5398d
AD
51172005-11-14 Akim Demaille <akim@epita.fr>
5118
5119 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
5120 from 1 to N, while values and location start at 0.
5121 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
5122
a1373f55
AD
51232005-11-14 Akim Demaille <akim@epita.fr>
5124
5125 * data/glr.c (yy_reduce_print): Fix the $ number.
5126
613d8952
AD
51272005-11-14 Akim Demaille <akim@epita.fr>
5128
5129 "Use" parse parameters.
5130 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
5131 * data/glr.c, data/glr.cc: Use them.
5132 * data/glr.c (YYUSE): Have a C++ definition that supports
5133 non-pointer types.
5134
b2741627
AD
51352005-11-14 Akim Demaille <akim@epita.fr>
5136
5137 * data/glr.c (yyexpandGLRStack): Declare only if defined.
5138
5059b5c8
AD
51392005-11-14 Akim Demaille <akim@epita.fr>
5140
42249483
AD
5141 * data/glr.cc: New.
5142 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 5143
4626a15d
AD
51442005-11-12 Akim Demaille <akim@epita.fr>
5145
5146 Let position and location be PODs.
5147 * data/location.cc (position::initialize, location::initialize): New.
5148 (position::position, location::location): Define only if
5149 b4_location_constructors is defined.
5150 * data/lalr1.cc (b4_location_constructors): Define it for backward
5151 compatibility.
5152 * doc/bison.texinfo (Initial Action Decl): Use initialize.
5153
51542005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
5155
5156 * data/lalr1.cc: Move the body of the ctor and dtor into the
5157 parser file (instead of the header).
5158 Wrap the implementations in a "namespace yy".
5159
51602005-11-12 Akim Demaille <akim@epita.fr>
5161
5162 Have glr.c include its header file when created.
5163 * data/glr.c (b4_shared_declarations): New.
5164 Output them verbatim in the parser if !%defines, otherwise
5165 output then in the header file, and include it instead.
5166
1989d947
AD
51672005-11-11 Akim Demaille <akim@epita.fr>
5168
5169 * data/glr.c: Comment changes.
5170
51712005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
5172
5173 When yydebug, report semantic and location values for reductions.
5174 * data/glr.c (yy_reduce_print): Report the semantic values and the
5175 locations.
5176 (YY_REDUCE_PRINT): Adjust.
5177 (yyglrReduce): Use them.
5178 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
5179 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
5180 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
5181 traces.
5182
02998094
AD
51832005-11-10 Akim Demaille <akim@epita.fr>
5184
5185 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
5186 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
5187 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
5188
5210672f
PE
51892005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
5190
5191 * m4/cxx.m4, examples/Makefile.am: Don't build
5192 examples/calc++ if no C++ compiler is available. (trivial change)
5193
a8991a1d
AD
51942005-11-09 Akim Demaille <akim@epita.fr>
5195
5196 * src/scan-skel.l: Use a couple of asserts.
5197
36b5e963
AD
51982005-11-03 Akim Demaille <akim@epita.fr>
5199
5200 In some (weird) cases, the final state number is incorrect.
5201 Reported by Alexandre Duret-Lutz.
5202 * src/LR0.c (state_list_append): Remove the computation of
5203 final_state.
5204 (save_reductions): Do it here.
5205 (get_state): Alpha conversion.
5206 (generate_states): Use a for loop.
5207 * src/gram.h (item_number_is_rule_number)
5208 (item_number_is_symbol_number): New.
5209 * src/state.c: Use assert.
5210 * src/system.h: Include assert.h.
5211 * tests/sets.at (Accept): New.
5212
44e7ead1
PH
52132005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5214
5215 * data/glr.c (yyfill): Adjust comment.
36b5e963 5216 (yyresolveAction): Initialize default location properly
44e7ead1
PH
5217 for empty right-hand sides.
5218 (yydoAction): Ditto.
5219 Add comment explaining apparently dead code.
36b5e963
AD
5220 * tests/glr-regression.at
5221 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 5222 New test.
36b5e963 5223
e10a80ee
PE
52242005-10-30 Paul Eggert <eggert@cs.ucla.edu>
5225
5226 * bootstrap (cleanup_gnulib): New function. Use it to clean up
5227 gnulib when interrupted. This fixes some race conditions and
5228 works around some portability problems (one noted by Paul
5229 Hilfinger).
5230
067b32ee
AD
52312005-10-22 Akim <akim@epita.fr>
5232
5233 * Makefile.cfg: Adjust to config -> build-aux.
5234 Reported by twledo.
5235
4b367315
AD
52362005-10-21 Akim Demaille <akim@epita.fr>
5237
5238 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
5239 the %parse-params.
5240 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
5241 * data/yacc.c (b4_Pure_if): Rename as...
5242 (b4_yacc_pure_if): this.
5243 (YY_SYMBOL_PRINT, yyparse): Adjust.
5244 * doc/bison.texinfo: Formatting changes.
5245
24cc23d9
AD
52462005-10-21 Akim Demaille <akim@epita.fr>
5247
5248 Finish the transition config -> build-aux.
5249 * configure.ac, Makefile.am: Use build-aux.
5250 * config/prev-version, config/announce-gen, config/Makefile.am:
5251 Move to...
5252 * build-aux/prev-version, build-aux/announce-gen,
5253 * build-aux/Makefile.am: here.
5254
d4476375
AD
52552005-10-14 Akim Demaille <akim@epita.fr>
5256
5257 * examples/calc++/test: Use set -x only when VERBOSE.
5258
302c0aee
PE
52592005-10-13 Paul Eggert <eggert@cs.ucla.edu>
5260
5261 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
5262 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
5263
7625ec2c
AD
52642005-10-13 Akim Demaille <akim@epita.fr>
5265
5266 * src/scan-skel.l: Output the base name parts of the parser and
5267 header file names.
302c0aee 5268 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
5269 additional checks.
5270 Use this to exercise C++ outputs in subdirs.
5271 Reported by Oleg Smolsky.
5272
ba0fe3c7
PE
52732005-10-12 Paul Eggert <eggert@cs.ucla.edu>
5274
5275 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
5276 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
5277 Problem reported by John P. Hartmann.
5278 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
5279 already defined it.
5280
9b8a5ce0
AD
52812005-10-12 Akim Demaille <akim@epita.fr>
5282
5283 * src/parse-gram.y (version_check): Exit 63 to please missing
5284 (stands for "version mismatch).
5285 * tests/input.at, doc/bison.texinfo: Adjust.
5286
4f6e011e
PE
52872005-10-10 Paul Eggert <eggert@cs.ucla.edu>
5288
5289 Work around portability problems with Visual Age C compiler
5290 (xlc and xlC_r) reported by John P. Hartmann.
5291 * data/location.cc (initial_column, initial_line): Remove.
5292 All uses replaced by 0 and 1.
5293 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
5294 that xlc complains about.
5295 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 5296 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 5297 as __STDC__.
4d7aa45e
PE
5298 * data/yacc.c (YYMODERN_C): New macro, which also looks at
5299 __STDC_VERSION__. Use it everywhere instead of looking at
5300 __STDC__ and __cplusplus.
4f6e011e 5301
a1b3bf8c
AD
53022005-10-10 Akim Demaille <akim@epita.fr>
5303
5304 * examples/calc++/test: Be quiet unless VERBOSE.
5305
412e44aa
PE
53062005-10-05 Paul Eggert <eggert@cs.ucla.edu>
5307
2a4647a3
PE
5308 * data/c.m4 (yydestruct, yysymprint):
5309 Use YYUSE instead of casting to void.
5310 * data/glr.c (YYUSE): New macro.
5311 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5312 Use it instead of rolling our own.
5313 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5314 (YYCHK1):
5315 Use /*CONSTCOND*/ to suppress lint warnings.
5316 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5317 (YY_STACK_PRINT): Use 'false' not '0'.
5318 (YYUSE): New macro.
5319 (yysymprint_, yydestruct_): Use it instead of rolling our own.
5320 * data/yacc.c (YYUSE): New macro.
5321 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
5322 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
5323 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
5324
5325
412e44aa
PE
5326 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
5327 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
5328
88c6637f
PE
53292005-10-04 Paul Eggert <eggert@cs.ucla.edu>
5330
2f4f028d
PE
5331 Undo the parts of the unlocked-I/O change that substituted
5332 putc or puts for printf. This might hurt performance a bit,
5333 but some people prefer the printf style.
5334 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
5335 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
5336 All uses replaced by YYFPRINTF and YYDPRINTF.
5337 * data/yacc.c: Likewise.
5338 * lib/bitset.c (bitset_print): Likewise.
5339 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
5340 putc and puts.
5341 * lib/lbitset.c (debug_lbitset): Likewise.
5342 * src/closure.c (print_firsts, print_fderives): Likewise.
5343 * src/gram.c (grammar_dump): Likewise.
5344 * src/lalr.c (look_ahead_tokens_print): Likewise.
5345 * src/output.c (escaped_output): Likewise.
5346 (user_actions_output): Break apart two printfs.
5347 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
5348 * src/reduce.c (reduce_print): Likewise.
5349 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
5350 * src/system.h: Include unlocked-io.h rathe than stdio.h.
5351
88c6637f
PE
5352 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5353 Use assignments rather than casts-to-void to suppress
5354 unused-variable warnings. This pacifies 'lint'.
5355 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
5356 unused-variable warnings.
5357
fb32e373
JMG
53582005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5359
5360 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5361
edb8f44f
PE
53622005-10-02 Paul Eggert <eggert@cs.ucla.edu>
5363
fb9c0b33
PE
5364 Use unlocked I/O for a minor performance improvement on hosts like
5365 GNU/Linux and Solaris that support unlocked I/O. The basic idea
5366 is to use the gnlib unlocked-io module, and to prefer putc and
5367 puts to printf when either will work (since the latter doesn't
5368 come in an unlocked flavor).
5369 * bootstrap (gnulib_modules): Add unlocked-io.
5370 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
5371 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
5372 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
5373 and similarly for puts and putc and printf.
5374 * data/yacc.c: Likewise.
5375 * lib/bitset.c (bitset_print): Likewise.
5376 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
5377 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
5378 to printf.
5379 * lib/lbitset.c (debug_lbitset): Likewise.
5380 * src/closure.c (print_firsts, print_fderives): Likewise.
5381 * src/gram.c (grammar_dump): Likewise.
5382 * src/lalr.c (look_ahead_tokens_print): Likewise.
5383 * src/output.c (escaped_output): Likewise.
5384 (user_actions_output): Coalesce two printfs.
2f4f028d 5385 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
5386 * src/reduce.c (reduce_print): Likewise.
5387 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 5388 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 5389
edb8f44f
PE
5390 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
5391 this confuses xgettext.
5392
b50d2359
AD
53932005-10-02 Akim Demaille <akim@epita.fr>
5394
5395 * bootstrap (gnulib_modules): Add strverscmp.
5396 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
5397 * m4/.cvsignore: Add strverscmp.m4.
5398 * src/parse-gram.y (%require): New token, new rule.
5399 (version_check): New.
5400 * src/scan-gram.l (%require): Adjust.
5401 * tests/input.at (AT_REQUIRE): New.
5402 Use it.
5403 * doc/bison.texinfo (Require Decl): New.
5404 (Calc++ Parser): Use %require.
5405
21667f64
AD
54062005-10-02 Akim Demaille <akim@epita.fr>
5407
5408 * data/location.cc: New.
5409
2b81e969
AD
54102005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
5411 Akim Demaille <akim@epita.fr>
5412
5413 Make sure -odir/foo.cc creates dir/location.hh etc.
5414 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
5415 (spec_file_prefix, spec_verbose_file, spec_graph_file)
5416 (spec_defines_file): Now const.
5417 (dir_prefix): New.
5418 (short_base_name): Remove.
5419 * src/files.c: Adjust.
5420 (dirname.h): Include.
5421 (base_name): Don't prototype it.
5422 (finput): Remove, duplicates gram_in.
5423 (full_base_name, short_base_name): Replace by...
5424 (all_but_ext, all_but_tab_ext): these.
5425 (compute_base_names): Rename as...
5426 (compute_file_name_parts): this.
5427 Update to compute the new variables, including dir_prefix.
5428 Adjust dependencies.
5429 * src/output.c (prepare): Output them.
5430 * src/reader.c: Adjust to use gram_in, not finput.
5431 * src/scan-skel.l (@dir_prefix@): New.
5432
ad6a9b97
JMG
54332005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5434
5435 * lib/subpipe.c: New function end_of_output_subpipe() added
5436 to allow support for non-posix systems. This is a no-op function
5437 for posix systems.
5438
5439 * lib/subpipe.h: New function end_of_output_subpipe() added
5440 to allow support for non-posix systems. This is a no-op function
5441 for posix systems.
5442
5443 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
5444 handle the lack of pipe/fork functionality on non-posix systems.
5445
5446 * djgpp/Makefile.maint: DJGPP specific file.
5447
5448 * djgpp/README.in: DJGPP specific file.
5449
5450 * djgpp/config.bat: DJGPP specific configuration file.
5451
5452 * djgpp/config.sed: DJGPP specific configuration file.
5453
5454 * djgpp/config.site: DJGPP specific configuration file.
5455
5456 * djgpp/config_h.sed: DJGPP specific configuration file.
5457
5458 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
5459
5460 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
5461
fc695704
AD
54622005-10-02 Akim Demaille <akim@epita.fr>
5463
5464 * data/location.cc: New, extract from...
5465 * data/lalr1.cc: here.
5466 (location.hh): Include it after the user prologue, in case the
5467 filename type is defined by the user.
5468 Forward declation location and position before the pre-prologue.
5469 (yyresult_): Rename as...
5470 (yyresult): this, it's a local variable, not an attribute.
5471 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
5472
54732005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
5474
5475 * examples/extexi: Restore the #line generation.
5476
fb9712a9
AD
54772005-09-30 Akim Demaille <akim@epita.fr>,
5478 Alexandre Duret-Lutz <adl@gnu.org>
5479
5480 Move the token type and YYSTYPE in the parser class.
5481 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
5482 (parser::token): New, from the moved free definition of tokens.
5483 (parser::semantic_value): Now a full definition instead of an
5484 indirection to YYSTYPE.
5485 (b4_post_prologue): No longer included in the header file, but
5486 in the implementation file.
5487 * doc/bison.texi (C+ Language Interface): Update.
5488 * src/parse-gram.y: Support unary %define.
5489 * tests/actions.at: Define global_tokens_and_yystype for backward
5490 compatibility until we update the tests.
5491 * tests/calc.at: Idem.
5492 (first_line, first_column, last_line, last_column): Define for lalr1.cc
5493 to simplify the code.
5494
55f0c7b1
PE
54952005-09-29 Paul Eggert <eggert@cs.ucla.edu>
5496
5497 Port to SunOS 4.1.4, which lacks strtoul and strerror.
5498 Ah, the good old days! Problem reported by Peter Klein.
5499 * bootstrap (gnulib_modules): Add strerror, strtoul.
5500 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
5501 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
5502
fb9712a9 55032005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
5504
5505 * data/c.m4 (b4_error_verbose_if): New.
5506 * data/lalr1.cc: Use it.
5507 (YYERROR_VERBOSE_IF): Remove.
5508 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
5509 parser members, replaced by...
5510 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
5511 local variables.
5512 (yysyntax_error_): Takes the state number as argument.
5513 (yyreduce_print_): Use the argument yyrule, not the former
5514 attribute yyn_.
5515
8a6f72f3
PE
55162005-09-26 Paul Eggert <eggert@cs.ucla.edu>
5517
5518 * bootstrap (gnulib_modules): Add verify.
5519 * lib/.cvsignore: Add verify.h.
5520 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
5521 * src/system.h (verify): Remove.
5522 Include verify.h instead.
5523 * src/tables.c (tables_generate): Use new API for 'verify'.
5524
0d50976f
PE
55252005-09-21 Paul Eggert <eggert@cs.ucla.edu>
5526
ebc3737e
PE
5527 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
5528 local variables whose names begin with 'yy'.
5529 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
5530 Trivial changes from Joel E. Denny.
5531
0d50976f
PE
5532 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
5533 it itself.
5534 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
5535 don't use alloca any more.
5536
5537 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
5538 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 5539 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
5540 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
5541 to match yacc.c, to test more hosts.
5542
a05b79df
PE
55432005-09-20 Paul Eggert <eggert@cs.ucla.edu>
5544
55289366
PE
5545 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
5546 doesn't affect behavior.
5547 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
5548 Solaris, AIX, MSC.
5549 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
5550 This works a bit better with glibc, if user code has already included
5551 stdlib.h.
5552 * doc/bison.texinfo (Bison Parser): Document that users can't
5553 arbitrarily use malloc and free for other purposes. Document
5554 that <alloca.h> and <malloc.h> might be included.
5555 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
5556 user must declare alloca.
5557
a05b79df
PE
5558 * HACKING (release): Forwarn the Translation Project about
5559 stable releses.
5560
3ab2ca22
AD
55612005-09-20 Akim Demaille <akim@epita.fr>
5562
5563 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
5564
a9739e7c
PE
55652005-09-19 Paul Eggert <eggert@cs.ucla.edu>
5566
a702593e
PE
5567 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
5568 (YYSTACK_ALLOC_MAXIMUM): Use it.
5569 (yysyntax_error): New function.
5570 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
5571 multiple syntax errors are reported, and alloca is being used.
5572 Instead, reallocate buffers twice as big each time, so that
5573 we waste at most half the allocated memory. Start with a small
5574 (128-byte) buffer that will suffice in most cases anyway.
5575 Use yysyntax_error to do most of the work.
5576
5577 * doc/bison.texinfo (Error Reporting, Table of Symbols):
5578 yynerrs is the number of errors reported, not the number of
5579 errors encountered.
5580
a9739e7c
PE
5581 * tests/glr-regression.at (Duplicated user destructor for lookahead):
5582 Mark it as expected to fail.
5583 Cast result of malloc; problem reported by twlevo@xs4all.nl.
5584 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
5585 Don't start user-code symbols with "yy", to avoid name space problems.
5586
f479c6c6
AD
55872005-09-19 Akim Demaille <akim@epita.fr>
5588
5589 Remove the traits, failed experiment.
5590 It never proved useful, and anyway because of the current
5591 definition, it was not possible to have several specialization of
5592 this traits, making it useless.
5593 * data/lalr1.cc (yy:traits): Remove.
5594 Inline its definitions in the parser class.
5595
e2586f82
AD
55962005-09-19 Akim Demaille <akim@epita.fr>
5597
5598 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
5599 least Mac OSX with a /usr/local install of gettext.
5600
2e8cf949
AD
56012005-09-19 Akim Demaille <akim@epita.fr>
5602
5603 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
5604 and yytoken for similarity with the other skeletons.
5605
c7fb0b90
AD
56062005-09-19 Akim Demaille <akim@epita.fr>
5607
4e26c69e 5608 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 5609
1bd0deda
PE
56102005-09-16 Paul Eggert <eggert@cs.ucla.edu>
5611
5612 * NEWS: Version 2.1.
5613
5614 * NEWS: Remove notice of yytname change, since it was never in an
5615 official release.
5616 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
5617 diagnostic.
5618 * src/output.c (prepare): Likewise.
5619 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
5620 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
5621 is not defined. This is an awful hack, but it's enough for now.
5622 All callers changed.
5623 * tests/glr-regression-at (make_value): Args are const pointers now,
5624 to avoid GCC warning.
5625 (Duplicated user destructor for lookahead): New test. Currently
5626 skipped. It fails on my host but I'm not sure it'll always fail.
5627
56282005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
5629
5630 * src/symtab.h (struct symbol): Declare the printer and destructor
5631 as const, to avoid accidental calls to free.
5632 (symbol_destructor_set, symbol_printer_set): Adjust.
5633 * src/symtab.c: Adjust.
5634
1bd0deda 56352005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
5636
5637 * data/c.m4 (b4_token_enums): New.
5638 (b4_token_defines): Rename as...
5639 (b4_token_enums_defines): this.
5640 (b4_token_defines): New, output only the #defines.
5641 * data/yacc.c, data/glr.c: Adjust.
5642 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
5643 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
5644 as default values.
5645
dbcdae2d
AD
56462005-09-16 Akim Demaille <akim@epita.fr>
5647
5648 * data/lalr1.cc (yylex_): Remove, inline its code.
5649 (yyreport_syntax_error_): Remove, replaced by...
5650 (yysyntax_error_): this which returns a string and leaves to the
5651 caller the call to the users' error function.
5652 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
5653 Move from members of the parser object...
5654 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
5655 to local variables of the parse function.
5656
70d8f291
AD
56572005-09-16 Akim Demaille <akim@epita.fr>
5658
5659 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
5660 since it's in Bison's name space.
5661
b47dbebe
PE
56622005-09-15 Paul Eggert <eggert@cs.ucla.edu>
5663
ae199bf1
PE
5664 * data/glr.c (yyresolveValue): Add default case to pacify
5665 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
5666
b47dbebe
PE
5667 * NEWS: Document when yyparse started to return 2.
5668 * doc/bison.texinfo (Parser Function): Document when yyparse
5669 returns 2.
5670
5671 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
5672 (b4_filename_type): Renamed back from b4_file_name_type. All uses
5673 changed.
5674 (class position): file_name -> filename (reverting). All uses changed.
5675
56762005-09-14 Paul Eggert <eggert@cs.ucla.edu>
5677
5678 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
5679 do anything if $@ exists. This reverts part of the 2005-07-07
5680 patch.
5681
00292f66
PE
56822005-09-11 Paul Eggert <eggert@cs.ucla.edu>
5683
5684 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
5685 contains obsolete information and isn't worth distributing as a
5686 separate file anyway.
5687 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
5688 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
5689 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
5690 (yyparse): Abort if user code uses longjmp to throw an unexpected
5691 value.
5692
a420f962
PE
56932005-09-09 Paul Eggert <eggert@cs.ucla.edu>
5694
00292f66
PE
5695 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
5696 Suggested by twlevo@xs4all.nl.
5697
127287e9
PE
5698 * data/glr.c (YYCHK1): Do not assume YYE is in range.
5699 This avoids a diagnostic from gcc -Wswitch-enum.
5700 Problem reported by twlevo@xs4all.nl.
5701
a420f962
PE
5702 * doc/bison.texinfo: Don't use "filename", as per GNU coding
5703 standards. Use "file name" or "file" or "name", depending on
5704 the context.
5705 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
5706 not to hack/foo.tab.c.
5707 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
5708 * data/glr.c: b4_filename -> b4_file_name.
5709 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
5710 All uses changed.
5711 (class position): filename -> file_name. All uses changed.
5712 * data/yacc.c: b4_filename -> b4_file_name.
5713 * lib/bitset.h: filename -> file_name in local vars.
5714 * lib/bitset_stats.c: Likewise.
5715 * src/files.c: Likewise.
5716 * src/scan-skel.l ("@output ".*\n): Likewise.
5717 * src/files.c (file_name_split): Renamed from filename_split.
5718 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
5719
57202005-09-08 Paul Eggert <eggert@cs.ucla.edu>
5721
5722 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
5723 to accommodate latest gnulib.
5724
5725 * tests/glr-regression.at (Duplicate representation of merged trees):
5726 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
5727
5728 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
5729 needed.
5730
42a6501d
PE
57312005-08-26 Paul Eggert <eggert@cs.ucla.edu>
5732
5733 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
5734 All uses changed. Invoke user destructor after an error during a
5735 split parse (trivial change from Joel E. Denny).
5736
5737 * tests/glr-regression.at
5738 (User destructor after an error during a split parse): New test case.
5739 Problem reported by Joel E. Denny in:
5740 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
5741
ef9a1faf
PE
57422005-08-25 Paul Eggert <eggert@cs.ucla.edu>
5743
5b4aaf78
PE
5744 * README-cvs: Give URLs for recommended tools.
5745 Mention Gzip version problem, and bootstrapping issues.
5746 Remove troubleshooting section, as it's somewhat obsolete.
5747
b5240ba5
PE
5748 * bootstrap (no_cache): New var, to accommodate different wget
5749 variants. Use it instead of '-C off'. Problem reported by
5750 twlevo@xs4all.nl.
5751
ef9a1faf
PE
5752 * data/glr.c (yydestroyStackItem): New function.
5753 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
5754 debugging information. Problem reported by Joel E. Denny.
5755
e6efa9da
AD
57562005-08-25 Akim Demaille <akim@epita.fr>
5757
5758 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
5759
adc90f13
PE
57602005-08-24 Paul Eggert <eggert@cs.ucla.edu>
5761
5762 * data/glr.c (yyrecoverSyntaxError, yyreturn):
5763 Don't invoke destructor on unresolved entries.
5764 * tests/glr-regression.at
5765 (User destructor for unresolved GLR semantic value): New test case.
5766 Problem reported by Joel E. Denny in:
5767 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
5768
f9315de5
PE
57692005-08-21 Paul Eggert <eggert@cs.ucla.edu>
5770
15d29c1f
PE
5771 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
5772 Add strnlen.c.
5773 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
5774 lib-prefix.m4, po.m4.
5775
dd5f2af2
PE
5776 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
5777 in yydestruct diagnostic, since it might not be an error.
5778 Problem reported by Joel Denny near end of
5779 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 5780 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
5781 * data/yacc.c (yyreturn): Likewise.
5782 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
5783
5784 * src/files.c: Remove obsolete FIXME comment.
5785
5786 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
5787 with the other templates, and to fix bogus run-on messages such
5788 as the one reported at the end of
5789 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
5790 All callers changed to avoid the newline.
5791 (yyprocessOneStack): Output two lines rather than one, to accommodate
5792 the above change. This changes the debug output format slightly.
5793
f9315de5
PE
5794 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
5795 reported by Joel E. Denny in
5796 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
5797 (trivial change).
5798 * tests/glr-regression.at (Duplicate representation of merged trees):
5799 New test, from Joel E. Denny in:
5800 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
5801 * THANKS: Add Joel E. Denny.
5802
5803 * configure.ac (AC_INIT): Bump to 2.0c.
5804
04098407
PE
58052005-07-24 Paul Eggert <eggert@cs.ucla.edu>
5806
5807 * NEWS: Version 2.0b.
5808
ca5d2013
PE
5809 * Makefile.am (SUBDIRS): Put examples before tests, so that
5810 "make check" doesn't finish with "All 1 tests passed".
5811
3d54b576
PE
5812 * tests/regression.at (Token definitions): Don't rely on
5813 AT_PARSER_CHECK for data that contains backslashes. It currently
5814 uses 'echo', and 'echo' isn't portable if its argument contains
5815 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
5816 that the byte '\0xff' is not printable in the C locale; it is,
5817 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
5818 not printable, so use '\0x81' to test.
5819
d53ae497
PE
5820 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
5821 version of GCC, since the macro is used with non-GCC compilers.
5822
fc01665e
PE
5823 Fix core dump reported by Pablo De Napoli in
5824 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
5825 * tests/regression.at (Invalid inputs with {}): New test.
5826 * src/parse-gram.y (token_name): Translate type before using
5827 it as an index.
5828
04098407
PE
5829 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
5830 the user's name space. All uses changed to __attribute__
5831 ((__unused__)).
5832 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
5833 Add __attribute__ ((__noreturn__)).
5834
5835 * etc/clcommit: Remove. We weren't using it, and it failed
5836 "make maintainer-distcheck".
5837 * Makefile.maint: Merge from coreutils.
5838 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
5839 (syntax-check-rules): Change list of rules as described below.
5840 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
5841 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
5842 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
5843 (sc_trailing_space): New rules.
5844 (sc_xalloc_h_in_src): Remove.
5845 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
5846 (sc_space_tab, sc_error_exit_success, sc_changelog):
5847 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
5848 (makefile-check, po-check, author_mark_check):
5849 (makefile_path_separator_check, copyright-check):
5850 Use grep -n, to make it easier to find violations.
5851 Use CVS_LIST and CVS_LIST_EXCEPT.
5852 (header_regexp, h_re): Remove.
5853 (dd_c): New macro.
5854 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
5855 (my-distcheck): Use more-modern GCC flags.
5856 (signatures, %.asc): Remove.
5857 (rel-files, announcement): Remove signatures.
5858 Restore old updating code, even though we don't use it, so
5859 that we're the same as coreutils.
5860 (alpha, beta, major): Depend on news-date-check.
5861 Make the upload commands.
5862
5863 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
5864 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
5865 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
5866 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
5867 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
5868 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
5869 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
5870 * tests/sets.at: Likewise.
5871
5872 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
5873 we comment out the Autoconf version number.
5874 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
5875 it's error-prone and "make maintainer-distcheck" rejects it.
5876
5877 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
5878 Indent calls to "error" to pacify "make maintainer-distcheck",
5879 when the calls are not intended to be translated.
5880 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
5881
5882 * src/Makefile.am (DEFS): Use +=, to pacify
5883 "make maintainer-distcheck".
5884 (bison_SOURCES): Add scan-skel.h.
5885 (sc_tight_scope): New rule, from coreutils.
5886
5887 * src/files.c (src_extension, header_extension):
5888 Now static, not extern.
5889 * src/getargs.c (short_options): Likewise.
5890 * src/muscle_tab.c (muscle_table): Likewise.
5891 * src/parse-gram.y (current_class, current_type, current_prec):
5892 Likewise.
5893 * src/reader.c (grammar_end, previous_rule_end): Likewise.
5894 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
5895 * src/main.c (main): Cast bindtextdomain and textdomain calls to
5896 void, to avoid warning when NLS is disabled.
5897 * src/output.c: Include scan-skel.h.
5898 (scan_skel): Remove decl, since scan-skel.h does this.
5899 (output_skeleton):
5900 Indent calls to "error" to pacify "make maintainer-distcheck".
5901 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
5902 * src/reader.h (gram_end, gram_lineno): New decls to pacify
5903 "make maintainer-distcheck".
5904 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
5905 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
5906 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
5907 (skel_lex_destroy, scan_skel): Move these decls to...
5908 * src/scan-skel.h: New file.
5909 * src/uniqstr.c (uniqstr_assert):
5910 Indent calls to "error" to pacify "make maintainer-distcheck".
5911
5912 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
5913 not @VAR@.
5914
5915 * tests/torture.at: Revamp to avoid misuse of atoi that
5916 "make maintainer-distcheck" complained about.
5917
5918 * examples/extexi (message): Don't print a message more than once,
5919 and omit line-number decoration that makes Emacs compile think
5920 that informative messages are worth worrying about.
5921
59222005-07-22 Paul Eggert <eggert@cs.ucla.edu>
5923
5924 * configure.ac: Update version number.
5925
5926 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
5927 accidentally.
5928 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
5929 autogenerated by the maintainer.
5930 * examples/calc++/.cvsignore: Add *.yy.
5931
5932 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
5933 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5934 * lib/bitsetv.c (bitsetv_alloc): Likewise.
5935
5936 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
5937
5938 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
5939 from maintainer-distcheck about casting the argument of 'free'.
5940
5941 * NEWS: Mention recent yytname changes.
5942 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
5943
5944 * bootstrap: For translations that have not yet been upgraded to
5945 the new runtime-po domain, prime the pump by extracting the
5946 relevant strings from the obsolete translations. This code can be
5947 removed once the bison-runtime domain has been translated by each
5948 team.
5949
5950 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
5951 now that token names are already quoted.
5952
5953 Fix problem reported by Anthony Heading.
5954 * data/glr.c (YYTOKEN_TABLE): New macro.
5955 (yytname): Define if YYTOKEN_TABLE.
5956 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
5957 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
5958 (YYERROR_VERBOSE): Define the same way the other skeletons do.
5959 * src/output.c (prepare_symbols): Output token_table_flag.
5960
0ffda363
PE
59612005-07-21 Paul Eggert <eggert@cs.ucla.edu>
5962
5963 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
5964 again if the first call fails.
5965
5966 * data/glr.c (yytnamerr): New function.
5967 (yyreportSyntaxError): Use it to dequote most string literals.
5968 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
5969 with other skeletons. All uses changed.
5970 (yytnameerr_): New function.
5971 (yyreport_syntax_error): Use it to dequote most string literals.
5972 * data/yacc.c (yytnamerr): New function.
5973 (yyerrlab): Use it to decode most string literals.
5974 * doc/bison.texinfo (Decl Summary, Calling Convention):
5975 Clarify quoting convention of yytname.
5976 * src/output.c (prepare_symbols): Quote all names. This undoes
5977 the 2005-04-17 change, which is now accomplished (mostly) via
5978 changes in the parsers as described above.
5979 * tests/regression.at (Token definitions, Web2c Actions):
5980 Undo most 2005-04-17 change here, too.
5981
59822005-07-20 Paul Eggert <eggert@cs.ucla.edu>
5983
5984 Fix more problems reported by twlevo@xs4all.nl.
5985 * tests/cxx-type.at: Don't pipe output of ./types through sed to
5986 remove trailing spaces. This loses the exit status of ./types,
5987 and isn't needed since ./types shouldn't be emitting trailing
5988 spaces.
5989 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
5990 as the stack isn't valid in that case.
5991
5992 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
5993 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
5994 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
5995 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
5996 is used.
5997 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
5998 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5999 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6000 Likewise.
6001
6002 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
6003 overly-picky compilers that reject 'char *foo = "bar";'.
6004
6005 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
6006 to FILE * parameter, not to stderr. This fixes a typo introduced
6007 in the 2005-07-12 change.
6008
6009 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
6010 warnings from GCC 4.
6011
6012 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
6013 (yyglrShiftDefer, yysplitStack):
6014 Remove unused parameters b4_pure_formals. All uses changed.
6015 (yyglrShift): Remove unused parameters b4_user_formals.
6016 All uses changed.
6017 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
6018
6100a9aa
PE
60192005-07-18 Paul Eggert <eggert@cs.ucla.edu>
6020
258b75ca
PE
6021 Destructor cleanups and regularization among the three skeletons.
6022 * NEWS: Document the behavior changes.
6023 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
6024 stack before failing, as the cleanup code will do it for us now.
6025 * data/lalr1.cc (yyerrlab): Likewise.
6026 * data/glr.c (yyparse): Pop everything off the stack before
6027 freeing it, so that destructors get called properly.
6028 * data/lalr1.cc (yyreturn): Likewise.
6029 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
6030 This is more consistent.
6031 * doc/bison.texinfo (Destructor Decl): Mention more reasons
6032 why destructors might be called. 1.875 -> 2.1.
6033 (Destructor Decl, Decl Summary, Table of Symbols):
6034 Some English-language cleanups for %destructor.
6035 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6036 Add output line for destructor of start symbol.
6037 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
6038 because of that same extra output line.
6039
1a059451
PE
6040 * NEWS: Document minor wording changes in diagnostics of
6041 Bison-generated parsers.
6042 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
6043 Remove unused formals. All uses changed.
6044 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
6045 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
6046 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
6047 Rename yyoverflowab to yyexhaustedlab.
6048 When memory exhaustion occurs during syntax-error reporting,
6049 report it separately rather than in a single diagnostic; this
6050 eases translation.
6051 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
6052 (Memory Exhausted): Renamed from Parser Stack Overflow.
6053 Revamp wording slightly to prefer "memory exhaustion".
6054 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
6055
97460c78
PE
6056 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
6057
30757c8c
PE
6058 Add i18n support to the GLR skeleton. Partially fix the C++
6059 skeleton; a C++ expert needs to finish this. Remove debugging
6060 msgids; there's little point to having them translated, since they
6061 can be understood only by someone who can read the
6062 (English-language) source code.
6063
6064 Generate runtime-po/bison-runtime.pot automatically, so that we
6065 don't have to worry about garbage getting in that file. We'll
6066 make sure after the next official release that old msgids don't
6067 get lost. See
6068 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
6069
6070 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
6071 Now auto-generated.
6072 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
6073 Fix typos in explanations of the runtime file.
6074 * bootstrap: Change gettext keyword from YYI18N to YY_.
6075 Use standard Makefile.in.in in runtime-po, since we'll arrange
6076 for backward-compatible bison-runtime.po files in a different way.
6077 * data/glr.c (YY_): New macro, from yacc.c.
6078 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
6079 Translate messages intended for users.
6080 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
6081 the wording in the other skeletons. We don't know that the memory
6082 is virtual.
6083 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
6084 Use same method that yacc.c uses.
6085 Don't translate debugging messages.
6086 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
6087 it doesn't work (yet), and requires C++ expertise to fix.
6088 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
6089 Move defn to a more logical place, to be consistent with other
6090 skeletons.
6091 Don't translate debugging messages.
6092 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
6093 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
6094 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
6095 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
6096
ac8c5689
PE
6097 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
6098 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
6099 void, not int.
6100 * tests/glr-regression.at (Badly Collapsed GLR States):
6101 Likewise.
6102 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6103 yylex should return 0 at EOF rather than aborting.
6104
6100a9aa
PE
6105 Improve tests for stack overflow in GLR parser.
6106 Problem reported by twlevo@xs4all.nl.
6107 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
6108 All uses removed.
6109 (yyStackOverflow): Just longjmp, but with value 2 so that caller
6110 can handle the problem.
6111 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
6112 (yyparse): New local variable yyresult to record the result.
6113 Use result of setjmp to set it, rather than storing itinto
6114 struct.
6115 (yyDone): Remove label.
6116 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
6117 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
6118 if YYABORT is used).
6119 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
6120 yyparse status; put status > 1 into diagnostic.
6121 Check that status==2 works.
6122 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
6123 Use exit status 3 for failure to open (which shouldn't happen).
6124
15f40952
PE
61252005-07-17 Paul Eggert <eggert@cs.ucla.edu>
6126
67fd79c4
PE
6127 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
6128 1 on syntax error; just let yyparse do its thing.
6129 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
6130 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
6131 (Exploding the Stack Size with Alloca):
6132 (Exploding the Stack Size with Malloc):
6133 Expect exit status 2, not 1, since the parser is supposed to blow
6134 its stack. Problem reported by twlevo@xs4all.nl.
6135
15f40952
PE
6136 * data/glr.c (yyparse): Don't assume that the initial calls
6137 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
6138 Print a stack-overflow message and fail instead.
6139 Initialize the line-number information before creating the stack,
6140 so that the stack-overflow message can report line zero safely.
6141
f32c66b5
PE
61422005-07-14 Paul Eggert <eggert@cs.ucla.edu>
6143
a22ff96f 6144 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
6145 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
6146 (yyuserMerge): Provide a default case if b4_mergers is empty.
6147 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
6148 * tests/glr-regression.at
6149 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 6150 Add casts to pacify C++ compilers.
1beb0b24
PE
6151 * tests/glr-regression.at (Improper merging of GLR delayed action
6152 sets): Declare yylex before using it.
f32c66b5 6153 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
6154 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
6155 test for valgrind; valgrind is independent of g++.
6156 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
6157 for compatibility with POSIX 1003.1-2001 (if running coreutils).
6158 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
6159 Use a destructor, so that we can expand the stack. Change
6160 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 6161
d741bd1b
PE
61622005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6163
6164 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
6165 a valgrind failure. Problem reported by twlevo@xs4all.nl.
6166
0410a6e0
PE
61672005-07-13 Paul Eggert <eggert@cs.ucla.edu>
6168
6169 * PACKAGING: New file, suggested by Bruno Haible and taken from
6170 similar wording in gettext's PACKAGING file.
6171 * NEWS: Mention PACKAGING.
6172 * Makefile.am (EXTRA_DIST): Add PACKAGING.
6173
f7ab6a50
PE
61742005-07-12 Paul Eggert <eggert@cs.ucla.edu>
6175
baf785db 6176 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
6177 * bootstrap: Get runtime translations into runtime-po.
6178 Create runtime-po files automatically, if possible.
6179 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
6180 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
6181 does not infringe on the user's name space.
6182 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
6183 * doc/bison.texinfo (Internationalization): Revamp the English
6184 and Texinfo syntax a bit, to try to make it clearer.
6185 (Bison Options, Option Cross Key): Mention --print-localedir.
6186 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
6187 YYENABLE_NLS. Quote a bit more.
6188 * runtime-po/.cvsignore: New file.
6189 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
6190 * runtime-po/Rules-quot: Remove; now created by bootstrap.
6191 * runtime-po/quot.sed: Likewise.
6192 * runtime-po/boldquot.sed: Likewise.
6193 * runtime-po/en@quot.header: Likewise.
6194 * runtime-po/en@boldquot.header: Likewise.
6195 * runtime-po/insert-header.sin: Likewise.
6196 * runtime-po/remove-potcdate.sin: Likewise.
6197 * runtime-po/Makevars: Likewise.
6198 * runtime-po/LINGUAS: Likewise.
6199 * runtime-po/de.po: Likewise; we will rely on the translation project
6200 to maintain this, so "bootstrap" should get it.
0410a6e0 6201 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
6202 its value.
6203 * src/main.c (main): Bind the bison-runtime domain, too.
6204
62052005-07-12 Bruno Haible <bruno@clisp.org>
6206
6207 * data/yacc.c: Include <libintl.h> when NLS is enabled.
6208 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
6209 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
6210 * runtime-po: New directory.
6211 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
6212 $(DOMAIN).pot-update rule, so that old messages are never dropped.
6213 * runtime-po/Rules-quot: New file, copied from po/.
6214 * runtime-po/quot.sed: Likewise.
6215 * runtime-po/boldquot.sed: Likewise.
6216 * runtime-po/en@quot.header: Likewise.
6217 * runtime-po/en@boldquot.header: Likewise.
6218 * runtime-po/insert-header.sin: Likewise.
6219 * runtime-po/remove-potcdate.sin: Likewise.
6220 * runtime-po/Makevars: New file.
6221 * runtime-po/POTFILES.in: New file.
6222 * runtime-po/LINGUAS: New file.
6223 * runtime-po/bison-runtime.pot: New file.
6224 * runtime-po/de.po: New file.
6225 * m4/bison.m4: New file.
6226 * Makefile.am (SUBDIRS): Add runtime-po.
6227 (aclocaldir, aclocal_DATA): New variables.
6228 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
6229 Define aclocaldir.
6230 * src/getargs.c (usage): Document --print-localedir option.
6231 (PRINT_LOCALEDIR_OPTION): New enum item.
6232 (long_options): Add --print-localedir option.
6233 (getargs): Handle --print-localedir option.
6234 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
6235 (Internationalization): New section.
6236
22dda0f0
AD
62372005-07-12 Akim Demaille <akim@epita.fr>
6238
6239 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
6240 for consistency with the rest of the code.
6241 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
6242 Add separators.
6243
82b248ad
AD
62442005-07-12 Akim Demaille <akim@epita.fr>
6245
6246 * src/parse-gram.y: Use %printer instead of YYPRINT.
6247
fa0e9314
AD
62482005-07-12 Akim Demaille <akim@epita.fr>
6249
867a3e00
AD
6250 * src/symtab.h, src/symtab.c (symbol_print): New.
6251 * src/symlist.h, src/symlist.c (symbol_list_print): New.
6252 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
6253
62542005-07-12 Akim Demaille <akim@epita.fr>
6255
6256 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
6257 b4_at_dollar and b4_dollar_dollar.
6258
e054b190
PE
62592005-07-11 Paul Eggert <eggert@cs.ucla.edu>
6260
6261 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
6262 and Pennello's paper.
6263
34160ec4
PE
62642005-07-09 Paul Eggert <eggert@cs.ucla.edu>
6265
407d4a75
PE
6266 * data/yacc.c (yyparse): Undo previous patch. Instead,
6267 set yylsp[0] and yyvsp[0] only if the initial action
6268 sets yylloc and yylval, respectively.
6269
34160ec4
PE
6270 * data/yacc.c (yyparse): In the initial action, set
6271 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
6272 This avoids the use of undefined variables if the initial
6273 action does not set yylloc and/or yylval.
6274
c3d5a4a7
PE
62752005-07-07 Paul Eggert <eggert@cs.ucla.edu>
6276
b34d96c1
PE
6277 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
6278 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
6279 Remove from CVS. These files are automatically generated.
6280 * examples/extexi: Clarify that this file is now part of Bison,
6281 not GNU M4, and that it works with any POSIX-compatible Awk.
6282 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
6283 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
6284 so that we also get calc++-parser.yy. Geneate it.
6285 Use $(AWK), not gawk, since any conforming Awk will do.
6286 Put comment before action, since older 'make' can't handle comment
6287 in action.
6288 $(BUILT_SOURCES): List all built sources, not just some of them.
6289 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
6290 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
6291 $($(calc_sources_generated)): Remove unnecessary test for existence
6292 of target. (This had a shell syntax error anyway; a stray "x".)
6293 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
6294 calc++-parser.yy.
6295 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
6296
c3d5a4a7
PE
6297 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
6298 implied by the other modules.
6299
828c373b
AD
63002005-07-06 Akim Demaille <akim@epita.fr>
6301
6302 Bind examples/calc++ to the package.
6303 * examples/calc++/Makefile: Remove, replaced by...
6304 * examples/calc++/Makefile.am: ... this new file.
6305 * examples/calc++/test: Remove input.
6306 * examples/calc++/compile: Remove.
6307 * examples/Makefile.am: New.
6308 * configure.ac, Makefile.am: Adjust.
6309 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
6310
63cb01d6
PE
63112005-07-05 Paul Eggert <eggert@cs.ucla.edu>
6312
fd2df2ed
PE
6313 * data/glr.c (yyFail): Drastically simplify; since the format argument
6314 never had any % directives, we can simply pass it to yyerror.
6315 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
6316 be modified later, as that is the usual style in glr.c.
6317 Problems reported by Paul Hilfinger.
6318
63cb01d6
PE
6319 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
6320 and size overflow errors.
6321 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
6322 in case the user prolog sets feature-test macros like _GNU_SOURCE.
6323 (YYSIZEMAX): New macro.
6324 (yystpcpy): New function, taken from yacc.c.
6325 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
6326 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
6327 so that we don't have to maintain their signatures.
6328 (yyFail): Check for buffer overflow, by using vsnprintf rather
6329 than vsprintf. Allocate a bigger buffer if possible.
6330 Report an error if buffer allocation fails.
6331 (yyStackOverflow): New function.
6332 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
6333 the initialization was successful. It might fail if storage was
6334 exhausted.
6335 (yyexpandGLRStack): Add more checks for storage allocation failure.
6336 Use yyStackOverflow to report failures.
6337 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
6338 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
6339 Don't assume stack number fits in int.
6340 (yysplitStack): Check for storage allocation failure.
6341 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
6342 can print diagnostics on storage allocation failure. All callers
6343 changed.
6344 (yyresolveValue): Use yybool for boolean.
6345 (yyreportSyntaxError): Check for size-calculation overflow.
6346 This code is taken from yacc.c.
6347 (yyparse): Check for storage allocation errors when allocating
6348 the initial stack.
6349
1c59e0a1
AD
63502005-07-05 Akim Demaille <akim@epita.fr>
6351
6352 Extract calc++ from the documentation.
6353 * doc/bison.texinfo (Calc++): Add the extraction marks.
6354 * examples/extexi: New, from the aborted GNU Programming 2E.
6355 Separate the different paragraph of a file with empty lines.
6356 * examples/Makefile: Use it to extract the whole calc++ example.
6357
8a0adb01
AD
63582005-06-24 Akim Demaille <akim@epita.fr>
6359
6360 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
6361 class typedefs.
6362
12545799
AD
63632005-06-22 Akim Demaille <akim@epita.fr>
6364
6365 * doc/bison.texinfo (C++ Language Interface): First stab.
6366 (C++ Parsers): Remove.
6367
99be0235
AD
63682005-06-22 Akim Demaille <akim@epita.fr>
6369
6370 * data/lalr1.cc (yylex_): Honor %lex-param.
6371
0ffd4fd1
AD
63722005-06-22 Akim Demaille <akim@epita.fr>
6373
6374 Start a set of simple examples.
6375 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
6376 * examples/calc++/calc++-driver.hh,
6377 * examples/calc++/calc++-parser.yy,
6378 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
6379 * examples/calc++/compile, examples/calc++/test: New.
6380
0925ebb4
PE
63812005-06-09 Paul Eggert <eggert@cs.ucla.edu>
6382
6383 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
6384 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
6385 which stems from the 2005-05-27 patch.
6386
43d3b664
PH
63872005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6388
6389 * data/glr.c: Modify treatment of unused parameters to permit use
6390 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
6391
3062864d
PE
63922005-05-30 Paul Eggert <eggert@cs.ucla.edu>
6393
6394 Fix infringement on user name space reported by Janos Zoltan Szabo.
6395 * data/yacc.c (yyparse): strlen -> yystrlen.
6396
989b5b8e
AD
63972005-05-30 Akim Demaille <akim@epita.fr>
6398
6399 * data/lalr1.cc (_): New.
6400 Translate the various messages.
6401
bedf57f5
PE
64022005-05-27 Paul Eggert <eggert@cs.ucla.edu>
6403
6404 Fix infringement on user name space reported by Bruno Haible.
6405 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
6406 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
6407 the user's name space.
6408 (alloca): Include <stdlib.h> to get it, if it's not built in.
6409 (YYMALLOC, YYFREE): Define only if needed.
6410 (malloc, free): Declare, but only if needed, as this infringes on
6411 the user name space.
6412
4d1801f1
PE
64132005-05-25 Paul Eggert <eggert@cs.ucla.edu>
6414
6415 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
6416 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
6417 with %d format.
6418 * lib/ebitset.c (min, max): Undef before defining.
6419 * lib/vbitset.c (min, max): Likewise.
6420 * lib/subpipe.c (create_subpipe): Save local variables in case
6421 vfork clobbers them.
6422
64232005-05-24 Bruno Haible <bruno@clisp.org>
6424
6425 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
6426 error message syntax used by gcc-4.0.
6427
b94a9e1e
PE
64282005-05-23 Paul Eggert <eggert@cs.ucla.edu>
6429
85ac3861
PE
6430 * README: Mention m4 1.4.3. Remove obsolete advice about
6431 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
6432
b94a9e1e
PE
6433 * bootstrap: Remove workaround for problem I encountered with
6434 gettext 0.14.1; it seems to be fixed now.
6435
51c30d21
PE
64362005-05-22 Paul Eggert <eggert@cs.ucla.edu>
6437
009ce67d
PE
6438 * NEWS: Version 2.0a.
6439
f2a97c62
PE
6440 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
6441 the previous change.
6442
c8775f93
PE
6443 Various maintainer cleanups.
6444 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
6445 conftest*, for benefit of CVS commands run at the same time as
6446 "configure". Add build-aux, since "bootstrap" now creates it and
6447 its subfiles.
6448 * Makefile.cfg (move_if_change): Remove.
6449 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
6450 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
6451 (po_repo, do-po-update, po-update, wget_files, get-targets):
6452 (config.guess-url_prefix, config.sub-url_prefix):
6453 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
6454 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
6455 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
6456 Remove.
6457 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
6458 this is now the recommended name.
6459 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
6460 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
6461 ylwrap. These files now go into build-aux.
6462 * config/move-if-change: Remove.
6463 * config/prev-version.txt: Bump from 1.75 to 2.0.
6464
3ea5f0ec
PE
6465 * bootstrap: Add stdio-safer, unistd-safer modules.
6466 Remove m4/glibc2.m4 (introduced by latest gnulib, but
6467 we don't need it).
6468 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
6469 fopen-safer.c, stdio-safer.h, unistd-safer.h.
6470 * lib/subpipe.c: Include "unistd-safer.h".
6471 (create_subpipe): Make sure all the newly-created
6472 file descriptors are > 2, so that diagnostics don't
6473 get sent down them (which might cause Bison to hang, in theory).
6474 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
6475 * src/files.c (xfopen): Use fopen_safer, not fopen.
6476
51c30d21
PE
6477 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
6478 yesterday's yacc.c fix.
6479
cea1469d
PE
64802005-05-21 Paul Eggert <eggert@cs.ucla.edu>
6481
3ea5f0ec
PE
6482 * data/glr.c, data/lalr1.cc: Update copyright date.
6483
cea1469d
PE
6484 Fix a destructor bug reported by Wolfgang Spraul in
6485 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
6486 * data/yacc.c (yyabortlab): Don't call destructor, and
6487 don't set yychar to EMPTY.
6488 (yyoverflowlab): Don't call destructor.
6489 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
6490 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
6491 since we no longer output the message "discarding lookahead token
6492 end of input ()".
6493
5e6f62f2
PH
64942005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6495
6496 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
6497 fix a small glitch in debugging output.
6498 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
6499 after YY_SYMBOL_PRINT where needed.
6500
6501 (struct yyGLRState): Add some comments.
6502 (struct yySemanticOption): Add some comments.
6503 (union yyGLRStackItem): Add comment.
6504
6505 (yymergeOptionSets): Correct this to properly perform the union,
6506 avoiding infinite reported by Michael Rosien.
6507 Update comment.
6508
6509 * tests/glr-regression.at: Add test for GLR merging error reported
6510 by M. Rosien.
cea1469d 6511
0fb669f9
PE
65122005-05-13 Paul Eggert <eggert@cs.ucla.edu>
6513
6514 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
6515 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
6516 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
6517 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
6518 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
6519 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
6520 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
6521 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
6522 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
6523 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
6524 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
6525 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
6526 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
6527 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
6528 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
6529 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
6530 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
6531 src/derives.h, src/files.c, src/files.h, src/getargs.c,
6532 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
6533 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
6534 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
6535 src/output.h, src/parse-gram.c, src/parse-gram.h,
6536 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
6537 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
6538 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
6539 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
6540 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
6541 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
6542 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
6543 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
6544 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
6545 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
6546 tests/reduce.at, tests/regression.at, tests/sets.at,
6547 tests/synclines.at, tests/testsuite.at, tests/torture.at:
6548 Update FSF postal mail address.
6549
51f4735e
PE
65502005-05-11 Paul Eggert <eggert@cs.ucla.edu>
6551
6552 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
6553 Problem reported by Ralf Menzel.
6554
80ce3401
PE
65552005-05-01 Paul Eggert <eggert@cs.ucla.edu>
6556
6557 * tests/actions.at: Test that stack overflow invokes destructors.
6558 From Marcus Holland-Moritz.
6559 * data/yacc.c (yyerrlab): Move the code that destroys the stack
6560 from here....
6561 (yyreturn): to here. That way, destructors are called properly
6562 even if the stack overflows, or the user calls YYACCEPT or
6563 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
6564 (yyoverflowlab): Destroy the lookahead.
6565
65662005-04-24 Paul Eggert <eggert@cs.ucla.edu>
6567
6568 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
6569
72f000b0
PE
65702005-04-17 Paul Eggert <eggert@cs.ucla.edu>
6571
6572 * NEWS: Bison-generated C parsers no longer quote literal strings
6573 associated with tokens.
6574 * src/output.c (prepare_symbols): Don't escape strings,
6575 since users don't want to see C escapes.
6576 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
6577 in diagnostics.
c19683bb 6578 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
6579 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
6580
1094323f
PE
65812005-04-16 Paul Eggert <eggert@cs.ucla.edu>
6582
6583 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
6584 the data size is known to be too small and we can't increase it.
6585 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
6586
ca407bdf
PE
65872005-04-15 Paul Eggert <eggert@cs.ucla.edu>
6588
6589 * src/parse-gram.y: Include quotearg.h.
6590 (string_as_id): Quote $1 before using it as a key, since the
6591 lexer no longer quotes it for us.
6592 (string_content): Don't strip quotes, since lexer no longer
6593 quotes it for us.
6594 * src/scan-gram.l: Include quotearg.h.
6595 ("\""): Omit quote.
6596 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
6597 a key, since the rest of the lexer doesn't quote it.
6598 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
6599 * tests/regression.at (Token definitions): Check for backslashes
6600 in token strings.
6601
6602 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
6603 (YYSIZE_T): Define to unsigned long int when using an older compiler.
6604 (yyparse): Revamp code to generate long syntax error message, to
6605 make it easier to translate, and to avoid problems with arithmetic
6606 overflow. Change "virtual memory" to "memory" in diagnostic, since
6607 we don't know whether the memory is virtual.
6608
1ce59070
PE
66092005-04-13 Paul Eggert <eggert@cs.ucla.edu>
6610
6611 * NEWS: Bison-generated C parsers now use the _ macro to
6612 translate strings.
6613 * data/yacc.c (_) [!defined _]: New macro.
6614 All English strings wrapped inside this macro.
6615 * doc/bison.texinfo (Bison Parser): Document _.
6616 * po/POTFILES.in: Include src/parse-gram.c, since it now
6617 includes translateable strings that parse-gram.y doesn't.
6618
a749a695
PE
66192005-04-12 Paul Eggert <eggert@cs.ucla.edu>
6620
6621 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
6622 reverting the 2004-10-11 change to this function.
6623 (symbol_check_alias_consistency): Don't call symbol_type_set
6624 if the type name is already correct.
6625 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
6626
8fb1053b
PE
66272005-03-25 Paul Eggert <eggert@cs.ucla.edu>
6628
6629 * tests/regression.at (Token definitions): Don't use a token named
6630 c, as that generates a "#define c ..." that runs afoul of buggy
6631 stdlib.h that uses the identifier c as a member of struct
6632 drand48_data. Problem reported by Horst Wente.
6633
ff498c4a
PE
66342005-03-21 Paul Eggert <eggert@cs.ucla.edu>
6635
6636 * bootstrap: Change translation URL from
6637 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
6638 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
6639 redirection glitches. Problem reported by twlevo@xs4all.nl.
6640
65211d70
PE
66412005-03-20 Paul Eggert <eggert@cs.ucla.edu>
6642
6643 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
6644 after operands; POSIX says this isn't portable for the c99 command.
6645
9577fb1f
PE
66462005-03-18 Paul Eggert <eggert@cs.ucla.edu>
6647
6648 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
6649 immediately if a data overrun has occurred; this may help us track
6650 down what may be a spurious failure on MacOS.
6651
78b178f7
PE
66522005-03-17 Paul Eggert <eggert@cs.ucla.edu>
6653
a2599d0f
PE
6654 Respond to problems reported by twlevo@xs4all.nl.
6655
6656 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
6657
78b178f7
PE
6658 * src/vcg.h: Comment fix.
6659 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
6660 (G_CMAX): Change to -1 instead of INT_MAX.
6661
6662 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 6663
7296e729
PE
66642005-03-15 Paul Eggert <eggert@cs.ucla.edu>
6665
6666 * src/tables.c (state_number_to_vector_number): Put it inside an
6667 "#if 0", since it's not currently used. Problem reported by
6668 Roland McGrath.
6669
05ac60f3
PE
66702005-03-06 Paul Eggert <eggert@cs.ucla.edu>
6671
6672 * src/output.c (escaped_output): Renamed from
6673 escaped_file_name_output, since we now use it for symbol tags as
6674 well. All uses changed.
6675 (symbol_destructors_output, symbol_printers_output):
6676 Escape symbol tags too.
6677 Problem reported by Matyas Forstner in
6678 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
6679
6680 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
6681 not needed.
6682 * src/output.c (user_actions_output, token_definitions_output,
6683 symbol_destructors_output, symbol_printers_output): Likewise.
6684 * src/reader.c (prologue_augment): Likewise.
6685 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
6686
6687 * src/vcg.c (output_edge): Don't quote linestyle arg.
6688 Problem reported by twlevo@xs4all.nl.
6689
7eb453ac
PE
66902005-02-28 Paul Eggert <eggert@cs.ucla.edu>
6691
6692 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
6693 example, reported by Derek M Jones. Also, make the example even
6694 more outrageous, to better illustrate how bad the problem is.
6695
4c04c52a
PE
66962005-02-24 Paul Eggert <eggert@cs.ucla.edu>
6697
6698 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
6699 putsym. Typo reported by Sebastian Piping.
6700
a61e1620
PE
67012005-02-23 Paul Eggert <eggert@cs.ucla.edu>
6702
6703 * doc/bison.texinfo (Language and Grammar): some -> same
6704 (Epilogue): int he -> in the
6705 Typos reported by Sebastian Piping via Justin Pence.
6706
9ec93868
PE
67072005-02-07 Paul Eggert <eggert@cs.ucla.edu>
6708
6709 * tests/glr-regression.at (Improper handling of embedded actions
6710 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
6711 embedded actions and $-N in GLR parsers", work around an Autoconf bug
6712 with dollar signs in test names.
6713 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
6714 for a similar reason.
6715
73ce7e7e
PE
67162005-01-28 Paul Eggert <eggert@cs.ucla.edu>
6717
6718 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
6719 wants to redefine G_VIEW.
6720
2e72b98e
PE
67212005-01-27 Paul Eggert <eggert@cs.ucla.edu>
6722
6723 * src/vcg.c (get_view_str): Remove case for normal_view.
6724 Problem reported by twlevo@xs4all.nl.
6725
e0d634e5
PE
67262005-01-24 Paul Eggert <eggert@cs.ucla.edu>
6727
ccf830a4
PE
6728 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
6729 Problem reported by twlevo@xs4all.nl.
6730
e0d634e5
PE
6731 * doc/bison.texinfo: Change @dircategory from "GNU programming
6732 tools" to "Software development". Requested by Richard Stallman
6733 via Karl Berry.
6734
7bbc8cb0
PE
67352005-01-23 Paul Eggert <eggert@cs.ucla.edu>
6736
6737 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
6738 Problem reported by twlevo@xs4all.nl.
6739
08b770bc
PE
67402005-01-21 Paul Eggert <eggert@cs.ucla.edu>
6741
6742 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
6743 keyword; it's not needed with modern compilers, and it doesn't
6744 affect correctness with older compilers. Suggested by
6745 twlevo@xs4all.nl.
6746
95f22ad2
PE
67472005-01-17 Paul Eggert <eggert@cs.ucla.edu>
6748
6749 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
6750 gcc -Wswitch-default.
6751 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
6752 * data/yacc.c (yyparse): Likewise.
6753
d229d15c
PE
67542005-01-12 Paul Eggert <eggert@cs.ucla.edu>
6755
6756 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
6757 already. Let config.h define any nonstandard values.
6758
ecadd90f
PE
67592005-01-10 Paul Eggert <eggert@cs.ucla.edu>
6760
6761 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
6762 for the benefit of slower hosts. Problem reported by
6763 Nelson H. F. Beebe.
6764
213744b5
PE
67652005-01-07 Paul Eggert <eggert@cs.ucla.edu>
6766
6767 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
6768 being defined and not used.
6769 * data/lalr1.cc (yyparse): Likewise.
6770 Use "if (false)" rather than "if (0)".
6771
249d3236
PE
67722005-01-05 Paul Eggert <eggert@cs.ucla.edu>
6773
6774 * TODO: Mention that we should allow NUL bytes in tokens.
6775
987cc1fb
PE
67762005-01-02 Paul Eggert <eggert@cs.ucla.edu>
6777
6778 * src/scan-skel.l (<<EOF>>): Don't close standard output.
6779 Problem reported by Hans Aberg.
6780
08fe02d9
PE
67812005-01-01 Paul Eggert <eggert@cs.ucla.edu>
6782
6783 * src/getargs.c (version): Happy new year; update overall
6784 program copyright date from 2004 to 2005.
6785
6786 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
6787 Problem reported by Hans Aberg.
6788 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
6789 (Output file names.): Add a test for the case when standard output
6790 is closed.
6791
010c0266
PE
67922004-12-26 Paul Eggert <eggert@cs.ucla.edu>
6793
6794 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
6795 to fix an oversight in the Bison 2.0 manual.
6796
da12206a
PE
67972004-12-25 Paul Eggert <eggert@cs.ucla.edu>
6798
6799 * NEWS: Version 2.0. Reformat the existing news items since
6800 1.875, so that related items are grouped together.
3a4734aa 6801 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
6802 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
6803
c935d934
PE
6804 * tests/torture.at (Exploding the Stack Size with Alloca): Set
6805 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
6806 otherwise, we're not testing alloca. Unfortunately there's no
6807 simple way to consult HAVE_ALLOCA here.
6808
da12206a
PE
6809 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
6810 for yymsg, too.
6811
6812 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
6813 hand. This avoids a warning about comparing int to size_t when
6814 GCC warnings are enabled.
6815
0a2c5137
PE
68162004-12-22 Paul Eggert <eggert@cs.ucla.edu>
6817
d7e14fc0
PE
6818 * NEWS: Bison-generated parsers no longer default to using the
6819 alloca function (when available) to extend the parser stack, due
6820 to widespread problems in unchecked stack-overflow detection.
6821 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
6822 responsibility to set it to a positive value. This lets the user
6823 specify a value that is not a preprocessor constant.
6824 * data/yacc.c (YYMAXDEPTH): Likewise.
6825 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
6826 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
6827 to be a compile-time constant. However, explain the constraints on it.
6828 Also, explain the constraints on YYINITDEPTH.
6829 (Table of Symbols): Explain that alloca is no longer the default.
6830 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
6831 to 1.
6832
0a2c5137
PE
6833 * doc/bison.texinfo (Location Default Action): Mention that n must
6834 be zero when k is zero. Suggested by Frank Heckenbach.
6835
e019c247
AD
68362004-12-22 Akim Demaille <akim@epita.fr>
6837
6838 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
6839 (parser::state_type, parser::semantic_type, parser::location_type):
6840 Private, not public.
6841 (parser::parse): Return ints, not bool.
6842 Returning a bool introduces a problem: 0 corresponds to false, and
6843 it seems weird to return false on success. Returning true changes
6844 the conventions for yyparse.
6845 Alternatively we could return void and send an exception.
6846 There is no clear consensus (yet?).
6847 (state_stack, semantic_stack, location_stack): Rename as...
6848 (state_stack_type, semantic_stack_type, location_stack_type): these.
6849 Private, not public.
6850 * tests/c++.at: New.
6851 * tests/testsuite.at, tests/Makefile.am: Adjust.
6852
72731bb7
AD
68532004-12-21 Akim Demaille <akim@epita.fr>
6854
6855 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
6856
9a0d8bec
AD
68572004-12-21 Akim Demaille <akim@epita.fr>
6858
6859 Don't impose std::string for filenames.
6860
6861 * data/lalr1.cc (b4_filename_type): New.
6862 (position::filename): Use it.
6863 (parser.hh): Move the inclusion of stack.hh and location.hh below
6864 the user code, so that needed headers for the filename type can be
6865 included first.
72731bb7
AD
6866 Forward declare them before the user code.
6867 * tests/Makefile.am (check-local, installcheck-local): Pass
6868 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 6869
99880de5
AD
68702004-12-20 Akim Demaille <akim@epita.fr>
6871
6872 Use more STL like names: my_class instead of MyClass.
6873
6874 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
6875 (SemanticStack, SemanticType, StateStack, StateType)
6876 (TokenNumberType, Stack, Slice, Traits, Parser::location)
6877 (Parser::value): Rename as...
6878 (location_stack, location_type, rhs_number_type, semantic_stack)
6879 (semantic_type, state_stack, state_type, token_number_type, stack)
6880 (slice, traits, parser::yylloc, parser::yylval): these.
6881
6882 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
6883
9bec482e
PE
68842004-12-19 Paul Eggert <eggert@cs.ucla.edu>
6885
6886 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
6887 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
6888
f6fbd3da
PE
68892004-12-17 Paul Eggert <eggert@cs.ucla.edu>
6890
6891 Remove uses of 'short int' and 'unsigned short int'. This raises
6892 some arbitrary limits. It uses more memory but nowadays that's
6893 not much of an issue.
6894
6895 This change does not affect the generated parsers; that's a different
6896 task, as some users will want to conserve memory there.
6897
6898 Ideally we should use size_t to represent all object counts, and
6899 something like ptrdiff_t to represent signed differences of object
6900 counts; but that will require more code-cleanup than I have the
6901 time to do right now.
6902
6903 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
6904 Use size_t, not int or short int, to count objects.
6905 * src/closure.c (nritemset, closure): Likewise.
6906 * src/closure.h (nritemset, closure): Likewise.
6907 * src/nullable.c (nullable_compute): Likewise.
6908 * src/print.c (print_core): Likewise.
6909 * src/print_graph.c (print_core): Likewise.
6910 * src/state.c (state_compare, state_hash): Likewise.
6911 * src/state.h (struct state): Likewise.
6912 * src/tables.c (default_goto, goto_actions): Likewise.
6913
6914 * src/gram.h (rule_number, rule): Use int, not short int.
6915 * src/output.c (prepare_rules): Likewise.
6916 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
6917 errs, reductions): Likewise.
6918 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
6919 Likewise.
6920 * src/tables.c (vector_number, tally, action_number,
6921 ACTION_NUMBER_MINIMUM): Likewise.
6922 * src/output.c (muscle_insert_short_int_table): Remove.
6923
efeed023
AD
69242004-12-17 Akim Demaille <akim@epita.fr>
6925
6926 * data/lalr1.cc: Extensive Doxygenation.
6927 (error_): Rename as...
6928 (error): this, since it is visible to the user.
6929 Adjust callers.
6930 (Parser::message): Now an automatic variable from...
6931 (Parser::yyreport_syntax_error_): here.
6932 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
6933 Parser::error.
6934 * tests/input.at: Escape $.
6935
bc82c5a5
PE
69362004-12-16 Paul Eggert <eggert@cs.ucla.edu>
6937
6938 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
6939 Parenthesize rhs to avoid obscure problems with mistakes like
6940 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
6941 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
6942 b4_rhs_location): Likewise.
6943 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
6944 b4_rhs_location): Likewise.
6945
fd19f271
AD
69462004-12-16 Akim Demaille <akim@epita.fr>
6947
6948 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
6949 yacc.c: be sure to stay within yycheck_.
6950 * tests/actions.at: Re-enable C++ tests.
6951
10454ea4
AD
69522004-12-16 Akim Demaille <akim@epita.fr>
6953
6954 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
6955 real.
6956
c5b95ccf
AD
69572004-12-16 Akim Demaille <akim@epita.fr>
6958
6959 Use #define to handle the %name-prefix.
6960
6961 * data/glr.c, data/yacc.c: Comment changes.
6962 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
6963 so that one can refer to yylex in the parser file, and have it
6964 renamed, as is the case with other skeletons.
6965
617a8f12
AD
69662004-12-16 Akim Demaille <akim@epita.fr>
6967
6968 Move lalr1.cc internals into yy*.
6969
6970 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
6971 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
6972 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
6973 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
6974 (empty_, final_, terror_, errcode_, ntokens_)
6975 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
6976 (looka_, ilooka_, error_range_, nerrs_):
6977 Rename as...
6978 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
6979 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
6980 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
6981 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
6982 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
6983 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
6984 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
6985 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
6986 these.
6987
1e547e6e
PE
69882004-12-15 Paul Eggert <eggert@cs.ucla.edu>
6989
6990 Fix some problems reported by twlevo at xs4all.
6991 * src/symtab.c (symbol_new): Report an error if the input grammar
6992 contains too many symbols. This is better than calling abort() later.
6993 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
6994 (struct node, struct graph):
6995 Rename member expand to stretch. All uses changed.
6996 (struct graph): Remove member layoutalgorithm. All uses removed.
6997 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
6998 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
6999 All uses changed.
7000 (N_STRETCH): Rename from N_EXPAND. All uses changed.
7001
735d6bd4
AD
70022004-12-15 Akim Demaille <akim@epita.fr>
7003
7004 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
7005 Add more Doxygen comments.
7006 (symprint_, stack_print_, reduce_print_, destruct_, pop)
7007 (report_syntax_error_, translate_): Rename as...
7008 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
7009 (yypop_, yyreport_syntax_error_, yytranslate_): this.
7010
2e1f5829
AD
70112004-12-15 Akim Demaille <akim@epita.fr>
7012
7013 * data/lalr1.cc (lex_): Rename as...
7014 (yylex_): this.
7015 Move the trace here.
7016 Take the %name-prefix into account.
7017 Reported by Alexandre Duret-Lutz.
7018
a3cb6248
AD
70192004-12-15 Akim Demaille <akim@epita.fr>
7020
7021 Simplify the C++ parser constructor.
7022
7023 * data/lalr1.cc (debug_): Rename as...
7024 (yydebug_): so that the parser's internals are always in the yy*
7025 pseudo namespace.
7026 Adjust uses.
7027 (b4_parse_param_decl): Remove the leading comma as it is now only
7028 called as unique argument list.
7029 (Parser::Parser): Remove the constructor accepting a location and
7030 an initial debugging level.
7031 Remove from the other ctor the argument for the debugging level.
7032 (debug_level_type, debug_level, set_debug_level): New.
7033
7034 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
7035 constructor calls.
7036
07fed891
AD
70372004-12-15 Akim Demaille <akim@epita.fr>
7038
7039 Remove b4_root related material: failure experiment
a3cb6248 7040 (which goal was to allow to derive from a class).
07fed891
AD
7041
7042 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
7043 definitions and uses.
7044
e603eaa5
PE
70452004-12-14 Paul Eggert <eggert@cs.ucla.edu>
7046
7047 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
7048 not 2, since it's not portable to subtract 1 from the start of an
7049 array. The new item 0 is never set or used. All uses changed.
7050
7051 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
7052 the default definition of YYLLOC_DEFAULT. Problem reported
7053 by Frank Heckenbach.
7054
fafb007d
PE
70552004-12-12 Paul Eggert <eggert@cs.ucla.edu>
7056
7057 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
7058 the normal case and one for the error case. Just use the
7059 first one uniformly. Problem reported by Frank Heckenbach.
7060 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
7061 use exactly the same macro in both places.
7062 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
7063 so that the normal-case YYRHSLOC works for the error case too.
7064 All uses changed.
7065 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
7066 (YYLLOC_DEFAULT): Use the same macro as glr.c.
7067 * doc/bison.texinfo (Location Default Action): Don't claim that
7068 we have an array of locations. Use the same macro for both glr
7069 and lalr parsers. Mention YYRHSLOC. Mention what happens when
7070 the index is 0.
7071
48814dcd
PE
70722004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7073
a4e1a53b
PE
7074 * HACKING: Update email addresses to send announcements to.
7075
48814dcd
PE
7076 * configure.ac (AC_INIT): Bump version to 1.875f.
7077
337116ba
PE
70782004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7079
7080 * NEWS: Version 1.875e.
7081 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
7082
7083 * src/scan-skel.l: Include "complain.h", for "fatal".
7084
7085 * src/relation.h (relation_print, relation_digraph):
7086 Relation sizes are of type relation_node, not size_t (this is
7087 merely a doc fix, since the two types are equivalent).
7088 (relation_transpose): Relation sizes are of type relation_node,
7089 not int.
7090 * src/relation.c: Likewise.
7091 (top, infinity): Now of type relation_node, not int.
7092 (traverse, relation_transpose): Use relation_node, not int.
7093
7094 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
7095 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
7096 (yyparse): Remove unused local introduced in 2004-10-25 patch.
7097
7098 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 7099 specifying whether the test should be skipped. Use it tp
337116ba 7100 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 7101 fail on some hosts, and should be skipped.
337116ba 7102
da2a7671
PE
71032004-12-08 Paul Eggert <eggert@cs.ucla.edu>
7104
7105 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
7106 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
7107 unless otherwise specified below.
7108
7109 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
7110 to allocate kernel_base, kernel_items, kernel_size, since
7111 they needn't be initialized to 0.
7112 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
7113 * src/closure.c (new_closure): Likewise, for itemset.
7114 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
7115 * src/lalr.c (set_goto_map): Likewise, for temp_map.
7116 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
7117 (build_relations): Likewise for edge, states1, includes.
7118 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
7119 * src/reader.c (packgram): Likewise, for ritem, rules.
7120 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
7121 * src/relation.c (relation_digraph): Likewise for VERTICES.
7122 (relation_transpose): Likewise for new_R, end_R.
7123 * src/symtab.c (symbols_token_translations_init): Likewise for
7124 token_translations.
7125 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
7126 (token_actions): Likewise for yydefact, actrow, conflrow,
7127 conflict_list.
7128 (save_column): Likewise for froms[symno], tos[symno].
7129 (goto_actions): Likewise for state_count.
7130 (pack_table): Likewise for base, pos, check.
7131 (tables_generate): Likewise for width.
7132
7133 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
7134 for initial core. Just have a separate core, so we needn't worry
7135 about whether kernel_size and kernel_base are initialized.
7136
7137 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
7138 kernel_size, kernel_items): Remove unnecessary initialization.
7139 * src/conflicts.c (conflicts): Likewise.
7140 * src/derives.c (derives): Likewise.
7141 * src/muscle_tablc (muscle_insert): Likewise.
7142 * src/relation.c (relation_digraph): Likewise.
7143 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
7144 conflrow, conflict_table, conflict_list, table, check):
7145 Likewise.
7146
7147 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
7148 This is because all callers pass unsigned int.
7149 * src/closure.h (new_closure): Likewise.
7150
7151 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
7152 (build_relations): Initialize includes[i] in all cases.
7153 * src/reader.c (packgram): Always initialize rules[ruleno].prec
7154 and rules[ruleno].precsym. Initialize members in order.
7155 * src/relation.c (relation_transpose): Always initialize new_R[i]
7156 and end_R[i].
7157 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
7158
7159 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
7160 conflict_list[0] was always 0, but now it isn't initialized.
7161
7162 * src/table.c (table_grow): When conflict_table grew, the grown
7163 area wasn't cleared. Fix this.
7164
7165 * lib/.cvsignore: Add strdup.c, strdup.h.
7166 * m4/.cvsignore: Add strdup.m4.
7167
00baeeac
PE
71682004-12-07 Paul Eggert <eggert@cs.ucla.edu>
7169
7170 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
7171 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
7172 GOTO_NUMBER_MAXIMUM, since we occasionally compute
7173 ngotos + 1 without checking for overflow.
7174 (build_relations): Use END_NODE, not -1, to denote end of edges.
7175 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
7176 build_relations): Use goto_number, not int, for goto numbers.
7177 * src/tables.c (save_column, default_goto): Likewise.
7178
be3d9d42
AD
71792004-11-23 Akim Demaille <akim@epita.fr>
7180
7181 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
7182 of #defining from yystype.
7183 Don't typedef yystype, C++ does not need it.
7184 This lets it possible to forward declare it as union.
7185
78e526d5
PE
71862004-11-23 Paul Eggert <eggert@cs.ucla.edu>
7187
7188 * bootstrap (gnulib_modules): Add extensions.
7189 Problem reported by Jim Meyering.
7190
afbb696d
PE
71912004-11-22 Paul Eggert <eggert@cs.ucla.edu>
7192
7193 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
7194 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
7195 src/system.h, src/tables.c: XFREE -> free, to accommodate
7196 recent change to gnulib xalloc.h.
78e526d5 7197 Problem reported by Jim Meyering.
afbb696d 7198
c1f8f16a
AD
71992004-11-17 Akim Demaille <akim@epita.fr>
7200
7201 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
7202
db7e5eb5 72032004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
7204 Alexandre Duret-Lutz <adl@gnu.org>
7205
7206 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
7207 changes.
7208 (YYCDEBUG): Adjust.
7209 Use it instead of cdebug_.
7210 (Parser::debug_stream, Parser::set_debug_stream): New.
7211 (Parser::symprint_): Define cdebug_ for temporary backward
7212 compatibility.
7213 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
7214 debug_stream ().
7215
68e11668
AD
72162004-11-17 Akim Demaille <akim@epita.fr>
7217
7218 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
7219 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
7220 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
7221 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
7222
97cbc73e
PE
72232004-10-27 Paul Eggert <eggert@cs.ucla.edu>
7224
7225 * data/glr.c (yyloc_default): Remove; not used.
7226 Problem reported by Frank Heckenbach.
7227
e342c3be
AD
72282004-10-25 Akim Demaille <akim@epita.fr>
7229
7230 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
7231 Introduce another definition to address simple location arrays.
7232 (yyGLRStack): New member: yyerror_range.
7233 (yyrecoverSyntaxError, yyparse): Update it.
7234 (yyrecoverSyntaxError): Use it when shifting the error token to
7235 have an accurate range, equivalent to the one computed by both
7236 yacc.c and lalr1.cc.
7237 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
7238 that column numbers start at column 0, as per GNU Coding
7239 Standards, the others tests, and the doc.
7240 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
7241 Adjust to the above change (first column is 0).
7242 And adjust the location of the "<error>", now covering the whole
7243 line.
7244
93602feb 72452004-10-22 Akim Demaille <akim@epita.fr>
04098407 7246 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
7247
7248 Remove some arbitrary limits on goto numbers and relations.
7249 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
7250 initial values, since they're never used.
7251 (set_goto_map): ngotos is now unsigned, so test for overflow
7252 by seeing whether it wraps around to zero.
7253 * src/lalr.h (goto_number): Now size_t, not short int.
7254 (GOTO_NUMBER_MAXIMUM): Remove.
7255 * src/relation.c (relation_print, traverse, relation_transpose):
7256 Check for END_NODE rather than looking at sign.
7257 * src/relation.h (END_NODE): New macro.
7258 (relation_node): Now size_t, not short int.
7259
dba08b04
PE
72602004-10-22 Paul Eggert <eggert@cs.ucla.edu>
7261
7262 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
7263 keyword, not an identifier. Problem reported by Baron Schwartz in
7264 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
7265
df09ef2e
AD
72662004-10-11 Akim Demaille <akim@epita.fr>
7267
7268 * src/symtab.c (symbol_check_alias_consistency): Also check
7269 type names, destructors, and printers.
7270 Reported by Alexandre Duret-Lutz.
7271 Recode the handling of associativity and precedence in terms
7272 of symbol_precedence_set.
7273 Accept no redeclaration at all, not even equal to the previous
7274 value.
7275 (redeclaration): New.
7276 Use it to factor redeclaration complaints.
7277 (symbol_make_alias): Don't set the type of the alias, let
7278 symbol_check_alias_consistency do it as for other features.
7279 * src/symtab.h (symbol): Add new member prec_location, and
7280 type_location.
7281 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
7282 * tests/input.at (Incompatible Aliases): New.
7283
146bc99d
PE
72842004-10-09 Paul Eggert <eggert@cs.ucla.edu>
7285
7286 .cvsignore fixes to accommodate gnulib changes,
7287 and the practice of naming build directories "_build".
7288 * .cvsignore: Add "_*". Sort.
7289 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
7290 * m4/.cvsignore: Add "*_gl.m4".
7291
e503aa60
AD
72922004-10-06 Akim Demaille <akim@epita.fr>
7293
7294 * src/parse-gram.y (add_param): Fix the truncation of trailing
7295 spaces.
7296
b4a20338
AD
72972004-10-05 Akim Demaille <akim@epita.fr>
7298
7299 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
7300 whether the reducion was empty or not. This leaves room to
7301 improve the use of YYLLOC_DEFAULT in such a case.
7302 lalr1.cc is still experimental, so changing this is acceptable.
7303 And finally, there are probably not many users who changed the
7304 handling of locations in GLR, so changing is admissible too.
7305
7306 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
7307 empty reduction, set @$ to an empty location ending the previously
7308 stacked symbol.
7309 Adjust uses to make sure the code is triggered on empty
7310 reductions.
7311 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
7312 expected output: empty reductions have empty locations.
7313
f85a5e6f
AD
73142004-09-29 Akim Demaille <akim@epita.fr>
7315
7316 * data/lalr1.cc: Move towards a more standard C++ coding style
7317 for templates: Class < T > -> Class<T>.
7318
b203fc2c
AD
73192004-09-29 Akim Demaille <akim@epita.fr>
7320
7321 * data/lalr1.cc: Reinstall the former ctor, for sake of
7322 compatibility, but warn it will be removed.
7323 Move towards a more standard C++ coding style (i.e., type *var ->
7324 type* var).
7325
5b7e1e73
PE
73262004-09-27 Paul Eggert <eggert@cs.ucla.edu>
7327
3fee967f
PE
7328 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
7329 since it's less likely to work if NULs are involved in the future.
5b7e1e73 7330
0dcca5c2
AD
73312004-09-27 Akim Demaille <akim@epita.fr>
7332
7333 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
7334
6dde1c82
AD
73352004-09-27 Akim Demaille <akim@epita.fr>
7336
7337 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 7338 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
7339 and argument names.
7340 (b4_cc_constructor_call): Likewise.
7341
b233d555
AD
73422004-09-24 Akim Demaille <akim@epita.fr>
7343
7344 * src/parse-gram.y (add_param): Strip the leading and trailing
7345 blanks from a formal argument declaration.
7346 (YY_LOCATION_PRINT): New.
7347
619404e3
AD
73482004-09-24 Akim Demaille <akim@epita.fr>
7349
7350 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
7351 after the location.
7352
dd8d9022
AD
73532004-09-24 Akim Demaille <akim@epita.fr>
7354
7355 * doc/bison.texinfo (Table of Symbols): Sort.
7356
0092f063
AD
73572004-09-21 Akim Demaille <akim@epita.fr>
7358
7359 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
7360 the useless parentheses.
7361 Suggested by Paul Eggert.
7362
451364ed
AD
73632004-09-20 Akim Demaille <akim@epita.fr>
7364
7365 Let the initial-action act on the look-ahead, and use it for the
7366 "initial push" (corresponding to an hypothetical beginning-of-file).
7367 And let lalr1.cc honor %initial-action.
7368
7369 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
7370 example.
7371 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
7372 (Parser::Parser): Remove the ctor that used to initialize it.
7373 (Parser::parse): Like in the other skeletons, issue the "starting
7374 parse" message before any action.
7375 Honor %initial-action.
7376 Initialize the stacks with the lookahead.
7377 * data/yacc.c: Let $$ and @$ in %initial-action designate the
7378 look-ahead.
7379 Push them in the stacks.
7380 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
7381
18d192f0
AD
73822004-09-20 Akim Demaille <akim@epita.fr>
7383
7384 * doc/bison.texinfo (Initial Action Decl): New.
7385
b8458aa5
AD
73862004-09-20 Akim Demaille <akim@epita.fr>
7387
7388 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
7389 clearer criterion to define it.
7390 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
7391 When reducing on an empty RHS, use the latest stacked location as
7392 location.
7393 yylloc is not always available.
7394 * data/glr.c: Likewise.
7395 Also, honor initial-actions.
7396
3fc16193
AD
73972004-09-20 Akim Demaille <akim@epita.fr>
7398
7399 * data/yacc.c (YY_LOCATION_PRINT): New.
7400 Define when we know YYLTYPE's structure, i.e., when the default
7401 YYLLOC_DEFAULT is used.
7402 * data/c.m4 (b4_yysymprint_generate): Use it.
7403 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
7404 value of the result.
7405 (error_start_): Replace with...
7406 (error_range_): this location array.
7407 This allows to replace code relying on the implementation of
7408 locations by portable code.
7409 * data/yacc.c (yylerrsp): Replace with...
7410 (yyerror_range): this.
7411 Every time a token is popped, update yyerror_range[0], to have an
7412 accurate location for the error token.
7413 * data/glr.c (YY_LOCATION_PRINT): New.
7414 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
7415 deference a pointer.
7416 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
7417 report the location in %printers.
7418
7419 * src/scan-skel.l: Instead of abort, report error messages to ease
7420 understanding skeleton scanning failures.
7421
ecfe33e7
AD
74222004-09-16 Akim Demaille <akim@epita.fr>
7423
7424 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
7425 (iterator, const_iterator): these, to be more in the C++ spirit.
7426 Also, return reverse iterators so that when displaying the stack
7427 we display its bottom first.
7428 (Parser::stack_print_, Parser::reduce_print_): Match the messages
7429 from yacc.c.
7430 We should probably use vector here though.
7431
1576d44d
AD
74322004-09-16 Akim Demaille <akim@epita.fr>
7433
7434 Have more complete shift traces.
7435
7436 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
7437 to report Shifts instead of ad hoc YYDPRINTF invocations,
7438 including for the error token.
7439 * data/lalr1.cc (symprint_): Output the location.
7440 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
7441 output the location within the %printer.
7442 Activate GLR tests, at least to make sure they compile properly.
7443 They still don't pass though.
7444 * tests/calc.at: Adjust expect verbose output, since now "Entering
7445 state..." is on a different line than the "Shifting" message.
7446
9c66f418
AD
74472004-09-08 Akim Demaille <akim@epita.fr>
7448
7449 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
7450 Bison directive from the Bison file to the invocation of this
7451 macro, so that these directives are passed to
7452 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
7453 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
7454 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
7455 the extra Bison directives instead of the whole series.
7456 Change the grammar so that there are recoverable errors, and
7457 unrecoverable errors. Now we can have the parser give up before
7458 consuming the whole input. As a result we now can observe that
7459 the lookahead is freed when needed.
7460 Change the parser source to parse argv[1] instead of a hard coded
7461 string.
7462 Simplify yylex, and give a value and location to EOF.
7463 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
7464 passed directives already coded in the file.
7465 Add some tests to check the location of "error".
7466 For some tests, the C++ parser is correct, and not yacc.c.
7467 For other tests, they provide different, but unsatisfying, values,
7468 so keep the C++ value so that at least one parser is "correct"
7469 according to the test suite.
7470 (Actions after errors): Remove, this is subsumed by the
7471 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
7472
52d5733f
AD
74732004-09-06 Akim Demaille <akim@epita.fr>
7474
7475 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 7476 (Parser::pop): New.
52d5733f
AD
7477 Use it.
7478
a0e68930
AD
74792004-09-06 Akim Demaille <akim@epita.fr>
7480
7481 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
7482 argument, an informative message.
7483 Call YY_SYMBOL_PRINT.
7484 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
7485 * data/lalr1.cc (destruct_): Likewise.
7486 In addition, no longer depend on b4_yysymprint_generate and
7487 b4_yydestruct_generate to generate these functions, do it "by
7488 hand".
7489
e757bb10
AD
74902004-09-03 Akim Demaille <akim@epita.fr>
7491
7492 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
7493 invoked, yydestruct the lookahead.
7494 * tests/calc.at (Calculator $1): Update the expected lengths of
7495 traces: there is an added line for the discarded lookahead.
7496 * doc/bison.texinfo (Destructor Decl): Some rewording.
7497 Define "discarded" symbols.
7498
0fe1f06d
AD
74992004-09-02 Akim Demaille <akim@epita.fr>
7500
7501 * data/lalr1.cc (translate_, destruct_): No reason to be static.
7502
284acc8b
AD
75032004-09-02 Akim Demaille <akim@epita.fr>
7504
7505 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
7506 (YYDSYMPRINTF): Rename as...
7507 (YY_SYMBOL_PRINT): this.
7508 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
7509 two.
7510 Use it instead of direct symprint_ calls.
7511 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
7512 one.
7513
a5eb1ed2
AD
75142004-09-02 Akim Demaille <akim@epita.fr>
7515
b7c72fe1
AD
7516 * data/lalr1.cc (b4_yysymprint_generate): New.
7517 (symprint_): New member function, defined when YYDEBUG.
7518 Use it consistently instead of token/nterm debugging output by
7519 hand.
a5eb1ed2
AD
7520 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
7521 %printer calls to use cdebug_ when using lalr1.cc.
7522
417141dd
AD
75232004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
7524
7525 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
7526 with #ifdef YYDEBUG.
7527
2fa09258
AD
75282004-08-26 Akim Demaille <akim@epita.fr>
7529
7530 * doc/bison.texinfo (Implementing Loops): Rename as...
7531 (Implementing Gotos/Loops): this.
7532
9378b508
PE
75332004-08-13 Paul Eggert <eggert@cs.ucla.edu>
7534
7535 Adjust to latest gnulib.
7536 * bootstrap (gnulib_modules): Add xalloc-die.
7537 Set LC_ALL=C so that file names sort consistently.
7538 Prefer the gnulib copies of gettext.m4, glibc21.m4,
7539 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
7540 uintmax_t.m4, ulonglong.m4.
7541 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
7542 po.m4 since we are now using _gl.m4 instead.
7543
87a8ad5c
PE
75442004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
7545
7546 * src/scan-action.l: Remove. Scanning of semantic actions is
7547 handled in scan-gram.l.
7548
dca81a78
PE
75492004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
7550
7551 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
7552
7553 * src/location.h (struct): The file member is a uniqstr.
7554 (equal_boundaries): Use UNIQSTR_EQ for comparison.
7555
c9cbf7c5
PE
75562004-07-22 Paul Eggert <eggert@cs.ucla.edu>
7557
7558 Fix bug with non-%union parsers that have printers or destructors,
7559 which led to a Bison core dump. Reported by Peter Fales in
7560 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 7561
c9cbf7c5
PE
7562 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
7563 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
7564 not to our own type.
7565 * src/output.c (symbol_destructors_output, symbol_printers_output):
7566 Don't assume %union.
7567 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
7568 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
7569 UNION-FLAG. All callers changed.
7570 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
7571 Use type char, not unsigned int, when declaring an array of char;
7572 this lets us remove a cast.
7573 (Printers and Destructors): Add non-%union test cases.
7574
fa7e68c3
PE
75752004-06-21 Paul Eggert <eggert@cs.ucla.edu>
7576
7577 * doc/bison.texinfo: Minor editorial changes, mostly to the new
7578 GLR writeups. E.g., avoid frenchspacing and the future tense,
7579 change "lookahead" to "look-ahead", and change "wrt" to "with
7580 respect to".
2fa09258 7581
fa7e68c3
PE
75822004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7583
7584 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
7585 New sections, split off from the GLR Parsers section. Put the new
7586 Simple GLR Parser near the start of the GLR section, for clarity.
7587 Rewrite connective text.
7588
99a9344e
PE
75892004-06-21 Frank Heckenbach <frank@g-n-u.de>
7590
7591 * doc/bison.texinfo (Simple GLR Parsers): New section.
7592
8dd162d3
PE
75932004-06-21 Paul Eggert <eggert@cs.ucla.edu>
7594
7595 * NEWS, TODO, doc/bison.texinfo:
7596 Use "look-ahead" instead of "lookahead", to be consistent.
7597 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
7598 while we're fixing "look-ahead".
7599 * src/conflicts.c (shift_set): Renamed from shiftset.
7600 (look_ahead_set): Renamed from lookaheadset.
7601 * src/print.c: Likewise.
7602 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
7603 name for "lookahead".
7604 (report_types, usage): Likewise.
7605 * src/getargs.h (report_look_ahead_tokens): Renamed from
7606 report_lookaheads.
7607 * src/lalr.c (compute_look_ahead_tokens): Renamed from
7608 compute_lookaheads.
7609 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
7610 (look_ahead_tokens_print): Renamed from lookaheads_print.
7611 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
7612 state_rule_lookaheads_print.
7613 * src/state.h: Likewise.
7614 (reductions.look_ahead_tokens): Renamed from lookaheads.
7615 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
7616 AT_DATA_LOOKAHEADS_GRAMMAR.
7617
57a90331
PE
76182004-06-03 Paul Eggert <eggert@cs.ucla.edu>
7619
7620 * README: Update location of patched M4 distribution.
7621
8ed3234a
PE
76222004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
7623
7624 Don't assume the C++ compiler takes the same arguments as the C compiler
7625 (trivial change).
7626 * configure.ac (O0CXXFLAGS): New var.
7627 * tests/atlocal.in (CXXFLAGS): Use it.
7628
07971983
PE
76292004-05-29 Paul Eggert <eggert@cs.ucla.edu>
7630
7631 Fix some "make check" problems with C++ reported by
7632 Albert Chin-A-Young for Tru64 C++ in this thread:
7633 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
7634
7635 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
7636 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7637 Output to a .cc file for C++, not to a .c file.
7638 * tests/calc.at (AT_CHECK_CALC): Likewise.
7639 * tests/regression.at (AT_CHECK_DANCER): Likewise.
7640 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
7641
29058652
PE
76422004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
7643
7644 * tests/calc.at, tests/actions.at: Workaround for SGI
7645 C++ compiler. (trivial change)
7646
62cb8a99
PE
76472004-05-27 Paul Eggert <eggert@cs.ucla.edu>
7648
fd418816
PE
7649 Spent a few hours checking out which prerequisite versions the
7650 current sources actually require. I went all the way back to
7651 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
7652 a seemingly endless set of combinations of versions more recent
7653 than that. The bottom line is that the current sources require
7654 fairly recent versions of the build tools, and it'll be some work
7655 to change this.
7656 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
7657 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
7658 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
7659 Add comments explaining why those particular versions are
7660 currently needed.
2fa09258 7661
62cb8a99
PE
7662 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
7663 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 7664 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
7665
7666 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
7667 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
7668
caa52c10
PE
76692004-05-26 Paul Eggert <eggert@cs.ucla.edu>
7670
7671 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
7672 0.11.5. Suggested by Bruno Haible.
7673 * bootstrap: Remove gettext version checking.
7674
7675 * doc/bison.texinfo (Decl Summary): Also mention that %union
7676 can depend on prerequisite types. Problem reported by Tim
7677 Van Holder.
7678
4bfd5e4e
PE
76792004-05-25 Paul Eggert <eggert@cs.ucla.edu>
7680
2cef3017
PE
7681 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
7682 * README-alpha: Don't tell people not to package this.
7683
b9c85d5c
PE
7684 * bootstrap: Don't assume $(...) works; use `...` instead.
7685 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
7686 gettext better.
7687
4bfd5e4e
PE
7688 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
7689 put into the -d output file, and mention what to do if YYSTYPE is
7690 defined as a macro.
7691
6a36ff94
PE
76922004-05-24 Paul Eggert <eggert@cs.ucla.edu>
7693
6712933e
PE
7694 Undo change made earlier today: it caused autopoint to not bring
7695 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
7696 autopoint's.
7697
7698 * bootstrap: Check that gettext version matches what's in
7699 configure.ac. Warn users to ignore robots.txt ERROR 404.
7700 * bootstrap: Undo today's earlier change (logged below).
7701 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 7702
6a36ff94
PE
7703 The gettext version checking is causing more trouble than it's
7704 curing; remove it. Problem reported by Paul Hilfinger.
7705
7706 * bootstrap: Issue a warning that one can expect a message
7707 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
7708 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
7709
209ea708
PE
77102004-05-23 Paul Eggert <eggert@cs.ucla.edu>
7711
7712 Ensure that the C++ compiler used for testing actually works on a
7713 simple test program; if not, skip the C++-related tests. Problem
7714 reported by Vin Shelton in:
161a71f3 7715 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
7716
7717 * m4/cxx.m4: New file.
7718 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
7719 * tests/atlocal.in (BISON_CXX_WORKS): Add.
7720 * tests/local.at (AT_COMPILE_CXX): Use it.
7721
41ca2549
PE
77222004-05-21 Paul Eggert <eggert@cs.ucla.edu>
7723
383e69dc
PE
7724 * data/glr.c (yylloc): Output this macro even if locations are not
7725 being generated, as the GLR parser needs it even in that case.
7726 Problem reported by Troy A. Johnson
7727 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
7728
41ca2549
PE
7729 * configure.ac (AC_INIT): Update to 1.875e.
7730
e476c87d
PE
77312004-05-21 Paul Eggert <eggert@cs.ucla.edu>
7732
7733 * NEWS: Version 1.875d.
7734 * configure.ac (AC_INIT): Likewise.
7735 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
7736
7737 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
7738 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
7739 lalr1.cc runs afoul of the first, and the last two are no longer
7740 supported by GCC 3.4.0.
7741 * README: Mention GNU m4 1.4 or later; mention m4 patches.
7742 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
7743
233a88ad
PE
77442004-05-06 Paul Eggert <eggert@cs.ucla.edu>
7745
7746 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
7747 unsigned int, for compatibility with latest gnulib hash module.
7748 * src/state.c (state_hash, state_hasher): Likewise.
7749 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
7750 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 7751
12ffdd28
PE
77522004-05-03 Paul Eggert <eggert@cs.ucla.edu>
7753
7754 * NEWS: Unescaped newlines are no longer allowed in char & strings.
7755
7756 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
7757 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
7758 character and string literals.
7759 (unexpected_end): New function.
7760 (unexpected_eof): Use it.
7761 (unexpected_newline): New function.
7762 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
7763 actions.
e476c87d 7764
12ffdd28
PE
7765 * NEWS: Document %expect-rr.
7766
7767 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
7768 Fix typo by replacing $1 with $option.
7769 Remove more 'intl'-related files.
9668e2be 7770 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
7771
7772 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
7773 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
7774 strtoul.c.
7775 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
7776 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
7777 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
7778 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
7779 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
7780 * src/.cvsignore: Add *.output.
7781
7782 * src/parse-gram.y: Put copyright notice inside %{ %} so it
7783 gets copied to the output file.
e476c87d 7784
1f65350a
PE
77852004-04-28 Paul Eggert <eggert@twinsun.com>
7786
7787 Get files from the gnulib and po repositories, instead of relying
7788 on them being in our CVS. Upgrade to latest versions of gnulib
7789 and Automake.
7790
7791 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
7792 * bootstrap: Bootstrap from gnulib and po repositories.
7793 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
7794 * README-cvs: Document these changes. Remove version numbers from
7795 mentions of build tools, since they change so often. Mention Flex.
7796
7797 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
7798 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
7799 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
7800 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 7801 does this for us.
12ffdd28
PE
7802 (AC_ISC_POSIX): Remove; we no longer support this
7803 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
7804 (AC_HEADER_STDC): Remove: we now assume C89 or better.
7805 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
7806 Do not check for C89 headers, except for locale.h which is used
7807 by the Yacc library and must port to K&R hosts.
7808 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
7809 Do not check for C89 functions, except for setlocale which is
7810 used by the Yacc library.
7811 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
7812 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
7813 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
7814 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
7815 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
7816 AM_GNU_GETTEXT): Remove; now done by:
7817 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
7818 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
7819 for us.
7820
7821 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
7822 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
7823 Define to empty, as gnulib.mk will do the rest for us.
7824 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
7825 for us.
7826 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
7827 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
7828
7829 * src/files.c: Include gnulib's xstrndup.h.
7830
7831 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
7832 (REALLOC): Use xnrealloc, for likewise.
7833 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
7834 (strnlen, memrchr): Remove decls; functions no longer used.
7835 Include <stpcpy.h>.
7836
7837 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
7838 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
7839 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
7840 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
7841 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
7842 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
7843 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
7844 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
7845 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
7846 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
7847 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
7848 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
7849 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
7850 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
7851 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
7852 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
7853 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
7854 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
7855 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
7856 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
7857 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
7858 Remove, as these files are now generated automatically
7859 by bootstrap or automake.
7860
7861 * po/ChangeLog: Remove: all but one entry was a duplicate
7862 of this file, and I moved that 2000-11-02 entry here.
7863
7864 * config/.cvsignore: Add Makefile, depcomp, install-sh.
7865 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
7866 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
7867 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
7868 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
7869 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
7870 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
7871 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
7872 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
7873 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
7874 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
7875 xstrndup.h.
7876 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
7877 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
7878 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
7879 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
7880 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
7881 * src/.cvsignore: Remove *_.c.
7882
7883
7884 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
7885 support it. (The latest stable gzip doesn't.)
7886
78872004-04-27 Paul Eggert <eggert@twinsun.com>
7888
7889 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
7890 case, as stos_ is now used by destructors due to the 2004-02-09
7891 change.
7892
7893 Remove more K&R C support.
7894 * lib/libiberty.y (PARAMS): Remove. All uses removed.
7895 * lib/subpipe.c (errno): Remove decl.
7896 Include <stdlib.h> unconditionally.
7897 (EXIT_FAILURE): Remove macro.
7898 * src/complain.c (vfprintf, strerror): Remove.
7899 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
7900 unconditionally.
7901 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
7902 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
7903 (strchr, strspn, memchr): Remove decls.
7904 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
7905 unconditionally. Do not declare perror.
7906 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
7907 unconditionally.
7908
7909 * src/complain.c (_): Remove useless defn, as system.h defines this.
7910
7911 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
7912 with latest obstack.h.
7913 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
7914 to procedure types, as obstack.h now does that for us.
7915 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
7916
7917 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
7918 so that this include file can stand alone.
7919 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
7920 does this now. Include subpipe.h first after config.h, to
7921 test whether it can stand alone.
7922
7923 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
7924 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
7925 unused declaration.
7926
7927 * tests/synclines.at (%union synch line): Put a dummy member in
7928 the union, because empty unions aren't allowed in C. Caught
7929 by GCC 3.4.0.
7930
4f16766c
PE
79312004-04-13 Jim Meyering <jim@meyering.net>
7932
7933 * src/conflicts.c (conflicts_print): Correct format string typo:
7934 use `%%' to produce literal `%'. (trivial change)
7935
779e7ceb
PE
79362004-03-30 Paul Eggert <eggert@twinsun.com>
7937
7938 * src/getargs.c (version): Update copyright year to 2004.
7939
7940 * data/c.m4 (b4_int_type): Use 'short int' rather than
7941 'short', and similarly for 'long', 'unsigned', etc.
7942 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
7943 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
7944 yy_yypstack, yydumpstack): Likewise.
7945 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
7946 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
7947 Likewise.
7948 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
7949 yy_stack_print, yyparse): Likewise.
7950 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
7951 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
7952 * lib/bitset.c (bitset_print): Likewise.
7953 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
7954 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
7955 * lib/bitsetv.c (bitsetv_dump): Likewise.
7956 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
7957 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
7958 Likewise.
7959 * src/LR0.c (allocate_itemsets): Likewise.
7960 * src/gram.h (rule_number, rule): Likewise.
7961 * src/lalr.h (goto_number): Likewise.
7962 * src/nullable.c (nullable_compute): Likewise.
7963 * src/output.c (prepare_rules): Likewise.
7964 * src/relation.c (relation_print, relation_digraph): Likewise.
7965 * src/relation.h (relation_node): Likewise.
7966 * src/state.h (state_number, transitions, errs, reductions,
7967 struct state): Likewise.
7968 * src/symtab.h (symbol_number, struct symbol): Likewise.
7969 * src/tables.c (vector_number, tally, action_number,
7970 default_goto, goto_actions): Likewise.
7971 * tests/existing.at (GNU Cim Grammar): Likewise.
7972 * tests/regression.at (Web2c Actions): Likewise.
7973
7974 * src/output.c (muscle_insert_short_int_table): Renamed from
7975 muscle_insert_short_table. All uses changed.
7976
d6328241
PH
79772004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7978
7979 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
7980 (declaration): Replace expected_conflicts with expected_sr_conflicts.
7981 Add %expect-rr rule.
4f16766c 7982
d6328241
PH
7983 * src/scan-gram.l: Recognize %expect-rr.
7984
4f16766c 7985 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 7986 expected_conflicts.
4f16766c 7987 (expected_rr_conflicts): Declare.
d6328241
PH
7988
7989 * src/conflicts.c (expected_sr_conflicts): Rename from
7990 expected_conflicts.
7991 (expected_rr_conflicts): Define.
7992 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
7993 for GLR parsers.
7994 Use expected_sr_conflicts in place of expected_conflicts.
7995 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 7996
d6328241 7997 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 7998
1452af69
PE
79992004-03-08 Paul Eggert <eggert@gnu.org>
8000
8001 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 8002 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
8003
8004 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
8005 in lalr1.cc.
8006 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
8007 * src/scan-gram.l (scan_integer): New function.
8008 ({int}): Use it.
8009 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
8010 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
8011 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
8012 Say "long int", not "long", for uniformity with GNU style.
8013
006d217d
PE
80142004-02-25 Paul Eggert <eggert@twinsun.com>
8015
8016 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
8017 compilers. This fixes a problem with Intel's C++ compiler being
8018 chatty, reported by Guido Trentalancia in
161a71f3 8019 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 8020
c2729758
ADL
80212004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
8022
8023 Support %destructor and merge error locations in lalr1.cc.
8024
8025 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
8026 (Parser::stos_): Define unconditionally.
8027 (Parser::destruct_): New method. Generate its body with
8028 b4_yydestruct_generate.
8029 (Parser::error_start_): New attribute.
8030 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
8031 token which are discarded.
8032 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
8033 error_start_ when erroneous token are discarded.
8034 (Parser::parse) <yyerrlab1>: Compute the location of the error
8035 token so that it covers all the discarded tokens.
8036 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
8037 it can be called with `%skeleton "lalr1.cc"', and do that.
8038
dd0e0635
PE
80392004-02-02 Paul Eggert <eggert@twinsun.com>
8040
8041 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
8042 $(top_srcdir)/lib and ../lib. This fixes a bug reported
8043 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
8044 There's no need to mention top_builddir since Automake does that
8045 for us.
8046 (INCLUDES): Remove, as Automake says it's obsolescent.
8047 Contents migrated into AM_CPPFLAGS as described above.
8048 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
8049
80502004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8051
8052 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
8053 (yyreportSyntaxError): Handle case where lookahead token is
8054 YYEMPTY.
8055
be16239b
PH
80562004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8057
8058 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
8059 resulting parsers are compilable with C++.
8060
5fa90832
PE
80612003-12-23 Paul Eggert <eggert@twinsun.com>
8062
8063 * config/depcomp, config/install-sh: Sync with Automake 1.8.
8064 * src/output.c (output_skeleton): Rename local var.
8065 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
8066 Bison tokens, as this runs afoul of the 2003-10-07 change that
8067 disallowed NUL bytes in character constants or string literals.
8068
8069 * tests/local.at: Require Autoconf 2.59's Autotest.
8070 * tests/testsuite.at: Don't include local.at, since we now assume
8071 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
8072 including it.
8073 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
8074 multiple inclusion warnings.
dd0e0635 8075
b165c324
AD
80762003-12-02 Akim Demaille <akim@epita.fr>
8077
8078 * doc/bison.texinfo (How Can I Reset the Parser): More about start
8079 conditions.
8080 From Bruno Haible.
8081
26e06a21
ADL
80822003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
8083
8084 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
8085
92ac3705
PE
80862003-10-07 Paul Eggert <eggert@twinsun.com>
8087
6a5ecb38
PE
8088 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
8089 if testsuite doesn't exist.
8090
92ac3705
PE
8091 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
8092 literals, unfortunately.
8093 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
8094 Complain about NUL bytes in character constants or string literals.
8095
91d2c560
PE
80962003-10-05 Paul Eggert <eggert@twinsun.com>
8097
8098 * NEWS: Don't document %no-default-prec, as it's still
8099 too experimental.
8100 * doc/bison.texinfo: Document %no-default-prec only if
8101 the defaultprec flag is set. Normally it's not.
8102
0cc3da3a
PE
81032003-10-04 Paul Eggert <eggert@twinsun.com>
8104
8105 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
8106 non-modifiable lvalue, instead of a modifiable one.
8107 * doc/bison.texinfo (Actions): Document that $$ can
8108 be assigned to. Do not claim that $$ and $N are
8109 array element references: user code should not rely on this.
8110
22fccf95
PE
81112003-10-01 Paul Eggert <eggert@twinsun.com>
8112
8113 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
8114 (grammar_declaration): Use it.
8115 * src/scan-gram.l: New token %no-default-prec.
8116 * tests/conflicts.at: Revamp tests to use %no-default-prec.
8117 * NEWS, doc/bison.texinfo: Document the above.
8118
fc8f2965
AD
81192003-10-01 Akim Demaille <akim@epita.fr>
8120
8121 VCG no longer supports long_straight_phase.
8122
8123 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
8124 * src/print_graph.c (print_graph): Adjust.
8125
39a06c25
PE
81262003-09-30 Frank Heckenbach <frank@g-n-u.de>
8127 and Paul Eggert <eggert@twinsun.com>
8128
8129 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
8130 Table of Symbols): Document %default-prec.
8131 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
8132 (grammar_declaration): Set default_prec on %default-prec.
8133 * src/scan-gram.l (%default-prec): New token.
8134 * src/reader.h (default_prec): New flag.
8135 * src/reader.c: Likewise.
8136 (packgram): Handle it.
8137 * tests/conflicts.at (%default-prec without %prec,
8138 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 8139
39a06c25
PE
81402003-09-30 Paul Eggert <eggert@twinsun.com>
8141
8142 * tests/testsuite.at: Include local.at, not input.at, fixing
8143 a typo in the 2003-08-25 patch.
8144
62b6aef9
AD
81452003-08-27 Akim Demaille <akim@epita.fr>
8146
8147 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
8148 GCC warnings.
8149
89e1cc61
AD
81502003-08-26 Akim Demaille <akim@epita.fr>
8151
8152 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
8153 "<\#" to avoid magic from Gnus when posting parts of this script.
8154
a08460b0
AD
81552003-08-26 Akim Demaille <akim@epita.fr>
8156
8157 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
8158 (Parser::parse): here.
8159 Adjust: nerrs and errstatus is now replaced by...
8160 (Parser::nerrs_, Parser::errstatus_): New.
8161
603f1cfd
AD
81622003-08-25 Akim Demaille <akim@epita.fr>
8163
8164 * config/announce-gen, Makefile.cfg: New.
8165 * Makefile.am: Adjust.
8166 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
8167 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
8168
cd3684cf
AD
81692003-08-25 Akim Demaille <akim@epita.fr>
8170
8171 When reducing initial empty rules, Bison parser read an initial
8172 location that is not defined. This results in garbage, and that
8173 affects Bison's own parser. Therefore we need (i) to extend Bison
8174 to support a means to initialize this location, and (ii) to use
8175 this CVS Bison to fix CVS Bison's parser.
8176
8177 * src/reader.h, reader.c (epilogue_augment): Remove, replace
8178 with...
8179 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
8180 * src/parse-gram.y: Adjust.
8181 (%initial-action): New.
8182 (%error-verbose): Since we require CVS Bison, there is no reason
8183 not to use it.
8184 * src/scan-gram.l: Adjust.
8185 * src/Makefile.am (YACC): New, to make sure we use our own parser.
8186 * data/yacc.c (yyparse): Use b4_initial_action.
8187
4e03e201
AD
81882003-08-25 Akim Demaille <akim@epita.fr>
8189
8190 * doc/bison.texinfo: Don't promote stdout for error messages.
8191
8c182d05
AD
81922003-08-25 Akim Demaille <akim@epita.fr>
8193
8194 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
8195 From Alexandre Duret-Lutz.
8196
6a60c4cf
PE
81972003-08-25 Akim Demaille <akim@epita.fr>
8198
8199 Version 1.875c.
8200
25f66e1a
AD
82012003-08-25 Akim Demaille <akim@epita.fr>
8202
8203 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
8204 Use them.
8205
5348bfbe
AD
82062003-08-25 Akim Demaille <akim@epita.fr>
8207
8208 * data/lalr1.cc (Parser::reduce_print_): New.
8209 Use it.
8210
47301314
AD
82112003-08-25 Akim Demaille <akim@epita.fr>
8212
8213 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
8214 error recovery loops. This patch is based on
161a71f3 8215 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
8216 Also, augment the similarity between lalr1.cc and yacc.c.
8217 Note: the locations of error recovery rules are not correct yet.
8218
8219 * data/lalr1.cc: Comment changes to augment the similarity between
8220 lalr1.cc and yacc.c.
8221 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
8222 (yyerrlab1): Remove, but where it used to be (now the bottom part of
8223 yyerrlab), when hitting EOF, pop the whole stack here instead of
8224 merely falling thru the default error handling mechanism.
8225 (yyerrorlab): New label, with the old contents of YYERROR,
8226 plus the following change: pop the stack of rhs corresponding
8227 to the production that invoked YYERROR. That is how Yacc
8228 behaves (required by POSIX).
8229 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
8230 fail.
8231
1f7a61ff
AD
82322003-08-25 Akim Demaille <akim@epita.fr>
8233
8234 Tune local.at so that people can "autom4te -l autotest calc.at -o
8235 calc" for instance, to extract a sub test suite.
8236
8237 * tests/testsuite.at: Move the initialization, Autotest version
8238 requirement, and AT_TESTED invocation into...
8239 * tests/local.at: here.
8240 * tests/testsuite.at: Include it for compatibility with Autoconf
8241 2.57.
8242 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
8243 be ignore.
8244
327b5b56
PE
82452003-08-04 Paul Eggert <eggert@twinsun.com>
8246
8247 Rework code slightly to avoid gcc -Wtraditional warnings.
8248 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
8249 The returned value is now stored in *YY0. All callers changed.
8250 * src/output.c (merge_output): Adjust to the above change.
8251
0051e3ed
PE
82522003-07-26 Paul Eggert <eggert@twinsun.com>
8253
8254 * data/glr.c (YYASSERT): New macro.
8255 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
8256 yyresolveStates, yyprocessOneStack):
8257 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
8258 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 8259
137437c6
PE
82602003-07-25 Paul Eggert <eggert@twinsun.com>
8261
5b620e06
PE
8262 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
8263 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 8264 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
8265 by Frank Heckenbach, though I have omitted the structure-initialization
8266 part of his glr-knr.diff patch since I recall that the Portable
8267 C Compiler didn't require that change.
8268
137437c6
PE
8269 Let the user specify how to allocate and free memory.
8270 Derived from a suggestion by Frank Heckenbach in
161a71f3 8271 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
8272 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
8273 All uses of free, malloc, realloc changed to use these macros,
8274 and unnecessary casts removed.
8275 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
8276
ddb85ca5
PE
82772003-07-06 Matthias Mann <MatthiasMann@gmx.de>
8278
8279 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
8280 use s.empty() rather than s == "" to test for empty string; see
161a71f3 8281 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
8282 (trivial change)
8283
39910e09
AD
82842003-06-25 Akim Demaille <akim@epita.fr>
8285
8286 * config/depcomp, config/install-sh: Update from masters.
8287
0ae99356
PE
82882003-06-20 Paul Eggert <eggert@twinsun.com>
8289
8290 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
8291 and return properly parenthesized result.
8292 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
8293 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8294 Remove unnecessary parentheses from uses.
8295 * doc/bison.texinfo (Location Default Action): Describe the
8296 conventions for parentheses.
8297
cd05d13c
PE
82982003-06-19 Paul Eggert <eggert@twinsun.com>
8299
81fd08ca
PE
8300 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
8301 yyreportTree): Do not assume that size_t is the same width as int,
8302 when printing sizes. Print sizes using an unsigned format.
8303 Problem reported by Frank Heckenbach in
161a71f3 8304 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 8305
cd05d13c
PE
8306 Port to Forte Developer 7 C compiler.
8307 * data/glr.c (struct YYLTYPE): If locations are not being used,
8308 declare a single dummy member, as empty structs do not conform
8309 to the C standard.
8310 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
8311 the Forte Developer 7 C compiler complains that end-of-loop
8312 code is not reached.
8313
4dcf140b
PE
83142003-06-17 Paul Eggert <eggert@twinsun.com>
8315
8316 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
8317 avoid warnings from picky compilers about redefinition of PARAMS.
8318
8dd76bee
PE
83192003-06-17 Paul Eggert <eggert@twinsun.com>
8320
8321 Version 1.875b.
8322
8323 * NEWS: Document 1.875b.
8324
8325 * lib/bbitset.h: Do not include config.h; that's the includer's job.
8326 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
8327 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
8328 Don't use 'index' in comments, as it's a builtin fn on some hosts.
8329 * lib/bitset_stats.c: Include gettext.h unconditionally, as
8330 per recent gettext manual's suggestion.
8331 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
8332 Use prototypes, not old-style definitions.
8333 * lib/lbitset.c (lbitset_unused_clear): Likewise.
8334 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
8335 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
8336 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
8337 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
8338 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
8339 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
8340 vbitset_or_and_cmp, vbitset_copy): Likewise.
8341
8342 * lib/libiberty.h: Do not include config.h; that's the includer's job.
8343 Do not include <stdlib.h>.
8344 (PARAMS): Define unconditionally for C89.
8345 (ATTRIBUTE_NORETURN): Remove.
8346 (ATTRIBUTE_UNUSED): Define unconditionally.
8347
8348 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 8349 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
8350 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
8351 * lib/vbitset.c, lib/vbitset.h: New files.
8352 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
8353 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
8354 from libbitset.
8355
8356 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
8357 `How Can I Reset @code{yyparse}', since texinfo does not allow
8358 arbitrary @ in node names.
8359
8360 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
8361 shouldn't be needed according to the gettext 0.12.1 documentation
8362 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 8363 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 8364 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 8365 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 8366
8dd76bee
PE
8367 * lib/.cvsignore: Add stdbool.h.
8368 * m4/.cvsignore: Add nls.m4, po.m4.
8369
8370 Upgrade to CVS gnulib.
8371 * stdbool_.h: File renamed from stdbool.h.in.
8372 * configure.ac (AM_STDBOOL_H): Invoke this instead of
8373 AC_HEADER_STDBOOL.
8374 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
8375 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
8376 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
8377 (MOSTLYCLEANFILES): New var.
8378 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
8379 (stdbool.h): New rule.
8380 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
8381 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
8382 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
8383 m4/quote.m4: Upgrade to today's gnulib.
8384
8385 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
8386 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
8387 the tests right now.
8388 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
8389 yyerror are declared before use; C99 requires this.
8390
25005f6a
PH
83912003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8392
8393 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
8394 first.
8395 (yyrecoverSyntaxError): Correct the logic for setting and testing
8396 yyerrState.
8397 Correct comment on handling EOF.
8398 Allow states with only a default reduction, rather than failing
8dd76bee 8399 (I can't quite reconstruct why these were not allowed before).
25005f6a 8400
137437c6 8401 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 8402 buffer overruns, corrupting state.
8dd76bee
PE
8403
8404 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
8405 definition.
8406 * src/reader.h (max_left_semantic_context): New variable declaration.
8407 * src/scan-gram.l (max_left_semantic_context): Define.
8408 (handle_action_dollar): Update max_left_semantic_context.
8409 * data/glr.c (YYMAXLEFT): New definition.
8410 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
8411 (yyresolveAction): Ditto.
8412
8413 Fixes to problems with location handling in GLR parsers reported by
8414 Frank Heckenbach (2003/06/05).
8415
8416 * data/glr.c (YYLTYPE): Make trivial if locations not used.
8417 (YYRHSLOC): Add parentheses, and define only if locations used.
8418 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
8419 locations not used.
8420 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
8421 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 8422
25005f6a
PH
8423 * tests/cxx-type.at: Exercise location information; update tests
8424 to differentiate output with and without locations.
8dd76bee 8425 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
8426 because default YYLTYPE not yet defined.
8427 Change semantic actions to compute strings, rather than printing
8428 them directly (to test proper passing of semantics values). Change
8429 output to prefix notation and update test data and expected results.
8430 (yylex): Track locations.
8431 (stmtMerge): Return value rather than printing, and include arguments
8432 in value.
8dd76bee 8433
711f40b7
PE
84342003-06-03 Paul Eggert <eggert@twinsun.com>
8435
8436 Avoid warnings generated by GCC 2.95.4 when Bison is
8437 configured with --enable-gcc-warnings.
8438 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
8439 yy::]b4_parser_class_name[::translate_,
8440 yy::Stack::operator[] (unsigned),
8441 yy::Stack::operator[] (unsigned) const,
8442 yy::Slice::operator[] (unsigned),
8443 yy::Slice::operator[] (unsigned) const):
8444 Rename local vars to avoid warnings.
8445 * tests/glr-regression.at (Improper handling of embedded actions
8446 and $-N in GLR parsers): Remove unused local variable from yylex.
8447 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
8448 (void) as arg when not pure, since we now assume C89 when building
8449 Bison. Pacify GCC by using parameter.
8450
ac695f7d
PE
84512003-06-02 Paul Eggert <eggert@twinsun.com>
8452
8453 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
8454 yy::Location::lines, yy::Location::columns): Rename arguments
8455 to avoid shadowing; this removes a warning generated by GCC 3.3.
8456
26ec81e0
PE
84572003-06-01 Paul Eggert <eggert@twinsun.com>
8458
8459 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
8460 to g++, as GCC 3.3 complains if you do it.
8461 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
8462 everything that WARNING_CFLAGS has, except omit warnings
8463 not suitable for C++.
8464 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
8465 * tests/atlocal.in (CXXFLAGS): New var.
8466 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
8467
8468 Fix a GLR parser bug I reported in February; see
161a71f3 8469 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
8470 The problem was that GLR parsers did not conform to the C standard,
8471 because actions like { $1 = $2 + $3; } expanded to expressions
8472 that invoked YYFILL in separate subexpressions, and YYFILL assigned
8473 to a local variable. The C standard says that expressions
8474 like (var = f ()) + (var = f ()) have undefined behavior.
8475 Another problem was that GCC sometimes issues warnings that
8476 yyfill and its parameters are unused.
8477
8478 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
8479 as possibly unused.
8480 (yyfill): New function.
8481 (YYFILL): Use it.
8482 (yyuserAction): Change type of yynormal to bool, so that it matches
8483 the new yyfill signature. Mark it as possibly unused.
8484
8485
8486 Follow up on a bug I reported in February, where a Bison-generated
8487 parser can loop. Provide a test case and a fix for yacc.c. I
8488 don't have a fix for lalr1.cc or for glr.c, unfortunately.
8489 The original bug report is in:
161a71f3 8490 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
8491
8492 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
8493 macro's size was becoming unwieldy.
8494 (yyerrlab): Do not discard an empty lookahead symbol, as this
8495 might destroy garbage.
8496 (yyerrorlab): New label, with the old contents of YYERROR,
8497 plus the following change: pop the stack of rhs corresponding
8498 to the production that invoked YYERROR. That is how Yacc
8499 behaves, and POSIX requires this behavior.
8500 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
8501 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
8502 Define 'alarm' to do nothing if unistd.h is not available.
8503 Add a new rule "exp: '-' error;" to test the above change to
8504 data/yacc.c. Use 'alarm' to abort any test taking longer than
8505 10 seconds, as it's probably looping.
8506 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
8507 Also, the new yacc.c generates two fewer diagnostics for an
8508 existing test.
8509
d0829076
PE
85102003-05-24 Paul Eggert <eggert@twinsun.com>
8511
c6ae27df
PE
8512 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
8513 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
8514 This fixes a problem reported by John Bowman when the Compaq/HP
8515 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
8516 -ansi -Wall -gall).
8517 * data/yacc.c (union yyalloc): Likewise.
8518 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 8519
d0829076
PE
8520 Switch from 'int' to 'bool' where that makes sense.
8521
8522 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
8523 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
8524 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
8525 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
8526 Return or accept bool, not int. All callers changed.
8527 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
8528 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
8529 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
8530 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
8531 bitset_or_and_cmp_): Likewise.
8532 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
8533 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
8534 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
8535 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
8536 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
8537 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
8538 bitset_stats_or_and_cmp): Likewise.
8539 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
8540 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
8541 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
8542 ebitset_xor_cmp): Likewise.
8543 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
8544 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
8545 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
8546 lbitset_xor_cmp): Likewise.
8547 * lib/bbitset.h: Include <stdbool.h>.
8548 (struct bitset_vtable): The following members now return bool, not
8549 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
8550 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
8551 or_and_cmp).
8552 * src/conflicts.c (count_rr_conflicts): Likewise.
8553 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
8554 All uses changed.
8555 * lib/ebitset.c (ebitset_obstack_init): Likewise.
8556 * lib/lbitset.c (lbitset_obstack_init): Likewise.
8557 * src/getargs.c (debug_flag, defines_flag, locations_flag,
8558 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
8559 graph_flag): Likewise.
8560 * src/getargs.h (debug_flag, defines_flag, locations_flag,
8561 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
8562 graph_flag): Likewise.
8563 * src/output.c (error_verbose): Likewise.
8564 * src/output.h (error_verbose): Likewise.
8565 * src/reader.c (start_flag, typed): Likewise.
8566 * src/reader.h (typed): Likewise.
8567 * src/getargs.c (LOCATIONS_OPTION): New constant.
8568 (long_options, getargs): Use it.
8569 * src/lalr.c (build_relations): Use bool, not int.
8570 * src/nullable.c (nullable_compute): Likewise.
8571 * src/print.c (print_reductions): Likewise.
8572 * src/tables.c (action_row, pack_vector): Likewise.
8573 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
8574 * src/output.c (prepare): Use it.
8575 * src/output.c (token_definitions_output,
8576 symbol_destructors_output, symbol_destructors_output): Use string,
8577 not boolean integer, to keep track of whether to output separator.
8578 * src/print_graph.c (print_core): Likewise.
8579 * src/state.c (state_rule_lookaheads_print): Likewise.
8580
8581 * config/install-sh: Sync from automake 1.7.5.
8582
6b2584b7
PE
85832003-05-14 Paul Eggert <eggert@twinsun.com>
8584
8585 * src/parse-gram.y (rules_or_grammar_declaration): Require a
8586 semicolon after a grammar declaration, in the interest of possible
8587 future changes to the Bison input language.
8588 Do not allow a stray semicolon at the start of the grammar.
8589 (rhses.1): Allow one or more semicolons after any rule, including
8590 just before "|" as required by POSIX.
8591 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
8592 grammar.
8593
caf37a36
ADL
85942003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
8595
8596 %parse-param support for lalr1.cc.
8597
8598 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
8599 b4_cc_constructor_calls, b4_cc_constructor_call,
8600 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
8601 definitions.
8602 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
8603 parse-param arguments.
8604 (yy::b4_parser_class_name): Declare instance variables to
8605 hold parse-param arguments.
8606 * tests/calc.at: s/value/semantic_value/ because value clashes
8607 with a member of yy::b4_parser_class_name. Adjust C++ code
8608 to handle %parse-param. Enable %parse-param test in C++.
8609
3ab37077
PE
86102003-05-12 Paul Eggert <eggert@twinsun.com>
8611
8612 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
8613 English a bit. Fix fclose typo. Change "const char" to "char
8614 const", and use ANSI C rather than K&R for "main". Suggest
8615 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
8616 and suggest yy_switch_to_buffer.
8617
86182003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
8619
8620 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
8621 C89. This avoids a diagnostic on compilers that define __STDC__
8622 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 8623 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 8624
e743727f
PE
86252003-05-03 Paul Eggert <eggert@twinsun.com>
8626
8627 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
8628 Do not overrun array bounds.
8629 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 8630 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 8631
916708d5
AD
86322003-04-29 Akim Demaille <akim@epita.fr>
8633
8634 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
8635 * src/getargs.c, src/getargs.h: here, as bool, not int.
8636 (nondeterministic_parser): New.
8637 * src/parse-gram.y, src/scan-gram.l: Support
8638 %nondeterministic-parser.
8639 * src/output.c (prepare): Use nondeterministic_parser instead
8640 of glr_parser where appropriate.
8641 * src/tables.c (conflict_row, action_row, save_row)
8642 (token_actions, token_actions, pack_vector): Ditto.
8643
a06ea4aa
AD
86442003-04-29 Akim Demaille <akim@epita.fr>
8645
8646 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
8647
211074ca
AD
86482003-04-29 Akim Demaille <akim@epita.fr>
8649
8650 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
8651 with %pure-parser and %locations to exercise the patch from Yakov
8652 Markovitch below.
8653
6175ffe3
PE
86542003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
8655
8656 * data/yacc.c: (b4_lex_param): Corrected for the case where
8657 %lex-param is provided and %pure-parser isn't.
8658
b1e95857
PE
86592003-04-27 Paul Eggert <eggert@twinsun.com>
8660
8661 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 8662 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
8663 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
8664 if it is not defined.
8665 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
8666
acda9df6
PE
86672003-04-26 Paul Eggert <eggert@twinsun.com>
8668
3470c57b
PE
8669 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
8670 Declare to be of type suitable for the ninf value itself, not of
8671 type suitable for the corresponding table, since the latter might
8672 be unsigned but the ninf value might be negative. This fixes a
8673 bug reported by Alexandre Duret-Lutz in
161a71f3 8674 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 8675
acda9df6
PE
8676 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
8677 invokes it. We shouldn't invoke it twice because it will attempt
8678 to put error.o in the archive twice. This fixes a glitch reported
8679 by Martin Mokrejs in
161a71f3 8680 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 8681
b5250f26
PE
86822003-04-21 Paul Eggert <eggert@twinsun.com>
8683
8684 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
8685 to gnulib.
8686
089ac0f1
PE
86872003-04-21 Yakov Markovitch <Markovitch@iso.ru>
8688
8689 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
8690 Fix obvious typo that results in uncompilable GLR parsers
8691 when both %pure-parser and %locations are used. (trivial change)
8692
5ededac6
PE
86932003-04-17 Paul Eggert <eggert@twinsun.com>
8694
1b8f2fff
PE
8695 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
8696 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
8697 Do not insert the expected token via unput, as this runs afoul
8698 of a POSIX-compatibility bug in flex 2.5.31.
8699 All uses changed to BEGIN the parent state,
8700 since we no longer insert the expected token via unput.
8701 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
8702 that is no longer emitted after the above change.
8703
5ededac6
PE
8704 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
8705 the first one. This change is from Paul Hilfinger, and it fixes
8706 regression reported by Werner Lemberg in
161a71f3 8707 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
8708
8709 (resolve_sr_conflict): Don't invoke state_errs_set
8710 unless one or more tokens have been explicitly made errors.
8711 Otherwise, the above change causes Bison to abort.
8712
8713 * tests/existing.at (GNU pic Grammar): New test case, taken from
8714 Lemberg's email.
8715
b8be9132
AD
87162003-03-31 Akim Demaille <akim@epita.fr>
8717
8718 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
8719
d423d460
AD
87202003-03-31 Akim Demaille <akim@epita.fr>
8721
8722 * src/output.c (prepare_symbols): Avoid trailing spaces in the
8723 output.
8724
c7e441b4
AD
87252003-03-31 Akim Demaille <akim@epita.fr>
8726
8727 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
8728 From Paul Hilfinger.
8729
231897ad
AD
87302003-03-29 Akim Demaille <akim@epita.fr>
8731
8732 * m4/error.m4: Do not put under dynamic conditions some code which
8733 expansion is under static control.
8734
5b066063
AD
87352003-03-29 Akim Demaille <akim@epita.fr>
8736
8737 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
8738
22a74fec
AD
87392003-03-29 Akim Demaille <akim@epita.fr>
8740
8741 * doc/bison.texinfo (Strings are Destroyed): New.
8742
0eee27e7
PE
87432003-03-13 Paul Eggert <eggert@twinsun.com>
8744
8745 * .cvsignore: Add configure.lineno.
8746 * src/.cvsignore: Add yacc.
8747 * tests/.cvsignore: Add testsuite.log.
8748 * doc/fdl.texi: Sync with latest FSF version.
8749
f61aad93
PE
87502003-03-12 Paul Eggert <eggert@twinsun.com>
8751
537636c7
PE
8752 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
8753 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
8754 cursor, instead of leaving it undefined. This fixes a bug
8755 reported by Tim Van Holder in
161a71f3 8756 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
8757 * tests/input.at (Torturing the Scanner): Test the scanner on
8758 an empty input file, which was Tim Van Holder's test case.
8759
8760 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
8761 <sys/resource.h> can be included, include sys/time.h and
8762 sys/times.h first, if available. This works around the SunOS
8763 4.1.4 porting bug reported by Bruce Becker in
161a71f3 8764 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
8765
8766 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
8767 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
8768 AC_HEADER_SYS_WAIT.
8769
f61aad93
PE
8770 Merge changes from gnulib. This was prompted because the CVS
8771 snapshot didn't build on Solaris 7 due to strnlen problems.
8772
8773 These changes need to be merged back into gnulib:
8774 * lib/hash.c: Include <stdbool.h> unconditionally.
8775 * m4/onceonly.m4 (m4_quote): New macro.
8776 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
8777 Quote AC_FOREACH variable-expansions properly.
8778 The 2003-01-03 obstack.h change also needs merging.
8779 {end of changes requiring merging}
5b066063 8780
f61aad93
PE
8781 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8782 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
8783 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
8784 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
8785 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
8786 New files, imported from gnulib.
8787 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
8788 above.
8789
8790 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
8791 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
8792 gnulib sources.
8793
8794 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
8795 Add.
8796 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
8797 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
8798 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
8799 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
8800 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
8801 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
8802 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
8803 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
8804 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
8805 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
8806 (jm_PREREQ_ARGMATCH): Remove.
8807 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
8808 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
8809
8810 * src/system.h: Include <stdbool.h> unconditionally.
8811
8812 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
8813 assuming at least C89 in the bitset code for some time now.
8814
d2ffe116
AD
88152003-03-03 Akim Demaille <akim@epita.fr>
8816
8817 * ro.po: New.
8818
052826fd
AD
88192003-03-02 Akim Demaille <akim@epita.fr>
8820
8821 * doc/bison.texinfo (Table of Symbols): Reactivate the
8822 documentation for %lex-param, and %parse-param.
8823
c4749565
AD
88242003-03-02 Akim Demaille <akim@epita.fr>
8825
8826 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
8827 generate verbose error messages.
8828 Use the number of tokens as an upper bound in yytname, as it
8829 cannot be a non terminal.
8830
d5286af1
AD
88312003-03-02 Akim Demaille <akim@epita.fr>
8832
8833 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
8834 message.
8835
22e304a6
AD
88362003-03-02 Akim Demaille <akim@epita.fr>
8837
22e304a6
AD
8838 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
8839 Use them to exercise yycheck overrun.
8840 Based on Andrew Suffield's grammar.
8841
67a25fed
AD
88422003-03-02 Akim Demaille <akim@epita.fr>
8843
8844 Create tests/local.at for Bison generic testing macros.
8845
8846 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
8847 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
8848 This new file.
8849 * tests/calc.at (AT_CHECK_CALC): Adjust.
8850 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
8851 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
8852 * tests/local.at: here.
8853 (AT_COMPILE_CXX): Tags the tests using it as c++.
8854 Ignore the test if CXX is not functional.
8855
9c2b381f
PE
88562003-03-01 Paul Eggert <eggert@twinsun.com>
8857
8858 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
8859 not loc->end, since loc->end might contain garbage and this leads
8860 to undefined behavior on some platforms.
8861 (id_loc, token_start): Use (IF_LINTed) initial values that do not
8862 depend on *loc, so that the reader doesn't give the the false
8863 impression that *loc is initialized.
8864 (<INITIAL>"%%"): Do not bother setting code_start, since its value
8865 does not survive the return.
8866
0433ba88
AD
88672003-03-01 Akim Demaille <akim@epita.fr>
8868
8869 * src/scan-gram.l (code_start): Always initialize it when entering
8870 into yylex, as SC_EPILOGUE is activated *before* the corresponding
8871 yylex invocation. An alternative would be making it static, but
8872 then it starts with the second %%'s beginning, instead of its end.
8873
b305ea69
PE
88742003-02-28 Paul Eggert <eggert@twinsun.com>
8875
8876 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
8877 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 8878 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 8879
c3d25e01
PE
88802003-02-26 Paul Eggert <eggert@twinsun.com>
8881
8882 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
8883 Remove Sequent/Pyramid discussion (nobody uses them any more).
8884 Merge VMS and MS-DOS discussion; these ports may well be dead
8885 but let's keep mentioning them for now. Put <> around email
8886 addresses. Add copyright notice.
8887
c267ffbc
PE
88882003-02-24 Paul Eggert <eggert@twinsun.com>
8889
8890 * data/glr.c (yy_reduce_print): yylineno -> yylno,
8891 to avoid collision with flex use of yylineno.
8892 Problem reported by Bruce Lilly in
161a71f3 8893 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
8894 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
8895 * data/yacc.c (yy_reduce_print): Likewise.
8896
8897 * config/depcomp: Sync with Automake 1.7.3.
8898
f939fc12
AD
88992003-02-21 Akim Demaille <akim@epita.fr>
8900
8901 * data/lalr1.cc: Use temporary variables instead of casts to
8902 change integer types.
8903 Suggested by Paul Eggert.
8904
95923bd6
AD
89052003-02-21 Akim Demaille <akim@epita.fr>
8906
8907 * doc/bison.texinfo: Use "location" consistently to refer to @n,
8908 to avoid confusions with lalr1.cc's notion of Position.
8909 Suggested by Paul Eggert.
8910
2cdc240e
AD
89112003-02-20 Akim Demaille <akim@epita.fr>
8912
8913 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
8914 before initial_columns.
8915 (location.hh): Use consistent variable names when defining the
8916 operator<<.
8917 Use "last" so that we subtract from Positions, not from unsigned.
8918
5d003116
AD
89192003-02-20 Akim Demaille <akim@epita.fr>
8920
8921 * data/lalr1.cc (position.hh): New subfile, including the extended
8922 and Doxygen'ed documentation of class Position.
8923 (location.hh): Use it.
8924 Document a` la Doxygen.
ba1ecc07 8925 With the help of Benoit Perrot.
5d003116 8926
d02b25f9
AD
89272003-02-20 Akim Demaille <akim@epita.fr>
8928
8929 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
8930 AT_YACC_IF.
8931 Redefine AT_YYERROR_SEES_LOC_IF using it.
8932 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
8933 not defined.
8934 Don't use the location in yy::Parser::error_ and
8935 yy::Parser::print_ when not %locations.
8936 Activate more lalr1.cc tests.
8937
0d1c3a04
AD
89382003-02-19 Akim Demaille <akim@epita.fr>
8939
8940 * data/lalr1.cc: When displaying a line number, be sure to make it
8941 an int.
8942
60a777aa
AD
89432003-02-19 Akim Demaille <akim@epita.fr>
8944
8945 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
8946 Remove, useless.
8947 (YYABORT, YYACCEPT, YYERROR): New.
8948 * tests/calc.at: Renable the lalr1.cc test.
8949
0b86fc41
AD
89502003-02-19 Akim Demaille <akim@epita.fr>
8951
8952 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
8953 error recovery, mixing with/without pops and discarding of the
8954 lookahead.
8955 Exercise YYERROR.
8956 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
8957
da99a5dc
PE
89582003-02-17 Paul Eggert <eggert@twinsun.com>
8959
8960 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
8961 * tests/testsuite.at (AT_COMPILE): Use them.
8962 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 8963 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 8964
93b8c255
PE
89652003-02-12 Paul Eggert <eggert@twinsun.com>
8966
8967 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
8968 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 8969 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
8970 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
8971 Check for malloc failure, for consistency with yacc.c.
8972 (yytname_size): Remove, for consistency with yacc.c.
8973
8974 The bug still remains in data/lalr1.cc, as I didn't have time
8975 to fix it there.
8976
7548fed2
AD
89772003-02-06 Akim Demaille <akim@epita.fr>
8978
8979 * configure.ac (GXX): Rename as...
8980 (CXX): this, to keep the original Autoconf semantics.
8981 Require 2.57.
8982 * data/lalr1.cc: Fix b4_copyright invocations.
8983 If YYDEBUG is not defined, don't depend upon name_ being defined.
8984 (location.hh): Include string and iostream.
8985 (Position::filename): New member.
8986 (Position::Position ()): New.
8987 (operator<< (Position)): New.
8988 (operator- (Position, int)): New.
8989 (Location::first, Location::last): Rename as...
8990 (Location::begin, Location::end): these, to mock the conventional
8991 iterator names.
8992 (operator<< (Location)): New.
8993 * tests/atlocal.in (CXX): New.
8994 * tests/testsuite.at (AT_COMPILE_CXX): New.
8995 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
8996 locations in a more synthetic way.
8997 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
8998 lalr1.cc is used.
8999 Adjust the C locations to match those from Emacs: first column is
9000 column 0.
9001 Change all the expected results.
9002 Conform to the GCS: simplify the locations when applicable.
9003 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
9004 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
9005 these CPP macros with the m4 macros new defined by...
9006 (AT_CHECK_PUSHDEFS): this, i.e.:
9007 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 9008 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
9009 New macros.
9010 (AT_CHECK_POPDEFS): Undefine them.
9011 (AT_CHECK_CALC_LALR1_CC): New.
9012 Use it for the first lalr1.cc test.
9013
43a176ef
AD
90142003-02-04 Akim Demaille <akim@epita.fr>
9015
9016 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
9017 Location as is defined.
9018
fc049e9c
AD
90192003-02-04 Akim Demaille <akim@epita.fr>
9020
9021 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
9022 name_ being defined.
9023
a737b216
PE
90242003-02-03 Paul Eggert <eggert@twinsun.com>
9025
9026 * src/gram.h (start_symbol): Remove unused decl.
9027
9028 Use more-consistent naming conventions for local vars.
9029
9030 * src/derives.c (derives_compute): Change type of local var from
9031 int to rule_number.
9032 * src/gram.c (grammar_rules_partial_print): Likewise.
9033 * src/print.c (print_core): Likewise.
9034 * src/reduce.c (reduce_grammar_tables): Likewise.
9035
9036 * src/gram.c (grammar_dump): Change name of item_number *
9037 local var from r to rp.
9038 * src/nullable.c (nullable_compute): Likewise.
9039
9040 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
9041
9042 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
9043 for symbol or symbol_number var.
9044 * src/reader.c (grammar_start_symbol_set): Likewise.
9045 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
9046 Likewise.
9047 * src/state.c (transitions_to): Likewise.
9048 * src/state.h: Likewise.
9049 * src/tables.c (symbol_number_to_vector_number): Likewise.
9050
9051 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
9052 char * var.
9053
9054 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
9055 var.
9056
9057 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
9058 var.
9059
9060 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
9061 Use str, not s, for char * var. Use ch, not c, for character var.
9062 Use size for size var.
9063
9064 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
9065 char * var.
9066 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
9067 uniqstr var.
9068 * src/uniqstr.h: Likewise.
9069
9070 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9071 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9072 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
9073 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
9074 param to have same name as that of enum, so that we don't use
9075 "s" to stand for a non-state.
9076
68e93ad5
AD
90772003-02-02 Akim Demaille <akim@epita.fr>
9078
9079 * src/scan-skel.l: Scan more than one inert character per yylex
9080 invocation.
9081
92898986
PE
90822003-02-01 Paul Eggert <eggert@twinsun.com>
9083
9084 Version 1.875a.
9085
1d9d5d71
PE
9086 * po/LINGUAS: Add ms.
9087
0435d061
AD
90882003-01-30 Akim Demaille <akim@epita.fr>
9089
9090 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
9091
6029a57f
PH
90922003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9093
9094 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
9095 of $1.
0435d061
AD
9096
9097 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 9098 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 9099 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 9100
6029a57f
PH
9101 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
9102 (b4_rhs_location): Ditto.
0435d061 9103 (yyfill): New function to copy from stack tree into array
6029a57f 9104 incrementally.
0435d061
AD
9105 (yyuserAction): Modify to allow incremental move of semantic values
9106 to rhs array when in GLR mode.
9107 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
9108 as needed.
9109 Remove dummy use of yystack, as there is now a guaranteed use.
9110 (yydoAction): Modify to allow incremental move of semantic values
9111 to rhs array when in GLR mode.
9112 (yyresolveAction): Ditto.
9113 (yyglrShiftDefer): Update comment.
0435d061 9114 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
9115 (yyglrReduce): Ditto.
9116 (yydoAction): Ditto
0435d061 9117
6029a57f
PH
9118 * tests/glr-regr1.at: Rename to ...
9119 * tests/glr-regression.at: Add new regression test for the problems
9120 described above (adapted from S. Eken).
9121 Update copyright notice.
9122 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
9123 * tests/Makefile.am: Ditto.
9124
6cee6297
PE
91252003-01-28 Paul Eggert <eggert@twinsun.com>
9126
9127 * data/lalr1.cc: Do not use @output_header_name@ unless
9128 b4_defines_flag is set. This fixes two bugs reported by
9129 Tim Van Holder in
161a71f3
PE
9130 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
9131 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 9132
b2a836b5
PE
91332003-01-21 Paul Eggert <eggert@twinsun.com>
9134
9135 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
9136 we don't need to worry about yyerrlab1 being reported as an
9137 "unused label" by non-GCC C compilers. The downside is that if
9138 locations are used then a couple of statements are duplicated each
9139 time YYERROR is invoked, but the upside is that the warnings
9140 should vanish.
9141 (yyerrlab1): Move code to YERROR.
9142 (yyerrlab2): Remove. Change uses back to yyerrlab1.
9143 This reverts some of the 2002-12-27 change.
9144
4196b931
PE
91452003-01-17 Paul Eggert <eggert@twinsun.com>
9146
9147 * src/output.c (symbol_printers_output): Fix typo that led
9148 to core dump. Problem reported by Antonio Rus in
161a71f3 9149 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 9150
3ae831b4
AD
91512003-01-13 Akim Demaille <akim@epita.fr>,
9152 Quoc Peyrot <chojin@lrde.epita.fr>,
9153 Robert Anisko <anisko_r@lrde.epita.fr>
9154
9155 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
9156 when the stacks contain one element, as the loop would otherwise
9157 free the last state, and then use the top state (the one we just
9158 popped). This means that the initial elements will not be freed
9159 explicitly, as is the case in yacc.c; it is not a problem, as
9160 these elements have fake values.
9161
e3aa65c5
PE
91622003-01-11 Paul Eggert <eggert@twinsun.com>
9163
9164 * NEWS: %expect-violations are now just warnings, reverting
9165 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
9166 bootstrapping problem reported by Matthias Klose; see
161a71f3 9167 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
9168 * src/conflicts.c (conflicts_print): Likewise.
9169 * tests/conflicts.at (%expect not enough, %expect too much,
9170 %expect with reduce conflicts): Likewise.
9171 * doc/bison.texinfo (Expect Decl): Document this. Also mention
9172 that the warning is enabled if the number of conflicts changes
9173 (not necessarily increases).
9174
9175 * src/getargs.c (version): Update copyright year.
9176
f0057011
AD
91772003-01-09 Akim Demaille <akim@epita.fr>
9178
9179 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
9180
1ee6d2a0
PE
91812003-01-08 Paul Eggert <eggert@twinsun.com>
9182
9183 * Makefile.maint (WGETFLAGS):
9184 New macro, containing "-C off" to disable proxy caches.
9185 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
9186 (rel-check): Use $(WGET) instead of wget.
9187
d4fd77c4
PE
91882003-01-06 Paul Eggert <eggert@twinsun.com>
9189
9190 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
9191 the GLR paper of Scott, Johnstone and Hussain.
9192
464c6927
PE
91932003-01-04 Paul Eggert <eggert@twinsun.com>
9194
d600ee67
PE
9195 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
9196 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
9197 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
9198 (EXTRA_LIBRARIES): New var, for liby.a.
9199 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
9200 (EXTRA_SCRIPTS): New var, for yacc.
9201
464c6927
PE
9202 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
9203 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
9204 Problem reported by Nelson H. F. Beebe.
9205
92062003-01-03 Paul Eggert <eggert@twinsun.com>
9207
9208 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
9209 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
9210 when compiling Bison 1.875's `bitset bset = obstack_alloc
9211 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
9212
9213 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
9214 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
9215 grow to a huge size with typical invocation.
d600ee67 9216
464c6927
PE
9217 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
9218 Use the pattern recommended by Autoconf 2.57, except also protect
9219 against double-definition.
9220 * src/system.h: Likewise.
9221 Portability issues reported by Nelson H. F. Beebe.
d600ee67 9222
464c6927
PE
9223 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
9224 All uses changed. Provide a definition in both C and C++.
9225 (yytrue, yyfalse): Define even if defined (__cplusplus).
9226
9227 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
9228 Reported by Nelson H. F. Beebe.
d600ee67 9229
464c6927
PE
9230 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
9231
0f42c7d5
PE
92322003-01-02 Paul Eggert <eggert@twinsun.com>
9233
9234 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
9235 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
9236 Bug reported by Nelson H. F. Beebe.
9237
dc546b0f
PE
92382003-01-01 Paul Eggert <eggert@twinsun.com>
9239
9240 * Version 1.875.
9241
2c09b6a7
PE
92422002-12-30 Paul Eggert <eggert@twinsun.com>
9243
9244 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
9245 Moved here from...
9246 (<INITIAL>","): Here. This causes stray "," to be treated
9247 more uniformly.
9248
dc546b0f 9249 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
9250 last brace in braced code when not in Yacc mode, for compatibility
9251 with Bison 1.35. This resurrects the 2001-12-15 patch to
9252 src/reader.c.
9253
9254 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
9255 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
9256
535c0f63
PE
92572002-12-28 Paul Eggert <eggert@twinsun.com>
9258
9259 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
9260 that of SYM's type. This fixes Debian bug 168069, reported by
9261 Thomas Olsson.
d600ee67 9262
963fcc17
PE
92632002-12-28 Paul Eggert <eggert@twinsun.com>
9264
9265 Version 1.75f.
9266
9267 Switch back to the Yacc style of conflict reports, undoing some
9268 of the 2002-07-30 change.
9269 * doc/bison.texinfo (Understanding): Use Yacc style for
9270 conflict reports. Also, use new way of locating rules.
9271 * src/conflicts.c (conflict_report):
9272 Renamed from conflict_report_yacc, removing the old
9273 'conflict_report'. Translate the entire conflict report at once,
9274 so that we don't assume that "," has the same interpretation in
9275 all languages.
9276 (conflicts_output): Use Yacc-style conflict report for each state,
9277 instead of our more-complicated style.
9278 (conflicts_print): Use Yacc-style conflict report, except print
9279 the input file name when not emulating Yacc.
9280 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
9281 Conflicted Reduction, %expect not enough, %expect too much,
9282 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
9283 * tests/existing.at (GNU Cim Grammar): Likewise.
9284 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
9285
9286 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
9287 fatal): Don't invoke fflush; it's not needed and it might even be
9288 harmful for stdout, as stdout might not be open.
9289 * src/reduce.c (reduce_print): Likewise.
9290
b1efe548
PE
92912002-12-27 Paul Eggert <eggert@twinsun.com>
9292
9293 Fix a bug where error locations were not being recorded correctly.
9294 This problem was originally reported by Paul Hilfinger in
161a71f3 9295 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
9296
9297 * data/yacc.c (yyparse): New local var yylerrsp, to record the
9298 top of the location stack's error locations.
9299 (yyerrlab): Set it. When discarding a token, push its location
9300 onto yylerrsp so that we don't lose track of the error's end.
9301 (yyerrlab1): Now is only the target of YYERROR, so that we can
9302 properly record the location of the action that failed. For GCC
9303 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
9304 GCC warning about yyerrlab1 being unused if YYERROR is unused.
9305 (yyerrlab2): New label, which yyerrlab now falls through to.
9306 Compute the error's location by applying YYLLOC_DEFAULT to
9307 the locations of all the symbols that went into the error.
9308 * doc/bison.texinfo (Location Default Action): Mention that
9309 YYLLOC_DEFAULT is also invoked for syntax errors.
9310 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9311 Error locations include the locations of all the tokens that were
9312 discarded, not just the last token.
d600ee67 9313
983c5c2c
PE
93142002-12-26 Paul Eggert <eggert@twinsun.com>
9315
b1efe548
PE
9316 * src/files.c: Include quote.h.
9317 (compute_output_file_names): Warn if we detect conflicting
9318 outputs to the same file. This should catch the misunderstanding
9319 exemplified by Debian Bug 165349, reported by Bruce Stephens..
9320
9321 * src/conflicts.c (conflicts_print): If the user specifies
9322 "%expect N", report an error if there are any reduce/reduce
9323 conflicts. This is what the manual says should happen.
9324 This fixes Debian bug 130890, reported by Anthony DeRobertis.
9325 * tests/conflicts.at (%expect with reduce conflicts): New test.
9326
983c5c2c
PE
9327 Don't use m4_include on relative file names, as it doesn't work as
9328 desired if there happens to be a file with that name under ".".
d600ee67 9329
983c5c2c
PE
9330 * m4sugar/version.m4: Remove; it was included but it wasn't used.
9331 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
9332 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
9333 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
9334 * src/output.c (output_skeleton): Use full path names when
9335 specifying a file to include; don't rely on include path, as
9336 it's unreliable when the working file contains a file with
9337 that name.
d600ee67 9338
983c5c2c
PE
93392002-12-25 Paul Eggert <eggert@twinsun.com>
9340
9341 Remove obsolete references to bison.simple and bison.hairy.
9342 Problem mentioned by Aubin Mahe in
161a71f3 9343 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
9344 * data/glr.c: Comment fix.
9345 * doc/bison.1: Remove references. Also, mention "yacc".
9346
9347 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
9348 with -g option.
9349
9350 * src/parse-gram.y (declaration): Use enum "report_states" rather
9351 than its numeric value 1.
9352
9353 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
9354 opening a new one. This fixes Debian bug 165349, reported by
9355 Bruce Stephens.
9356
23f2d9dc
PE
93572002-12-24 Paul Eggert <eggert@twinsun.com>
9358
9359 Version 1.75e.
9360
9361 * Makefile.maint (cvs-update): Don't assume that the shell
9362 supports $(...), as Solaris sh doesn't.
9363
9364 * src/parse-gram.y (lloc_default): Remove test for empty
9365 nonterminals at the end, since it didn't change the result.
9366
93672002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
9368
9369 If the user does not define YYSTYPE as a macro, Bison now declares it
9370 using typedef instead of defining it as a macro. POSIX requires this.
9371 For consistency, YYLTYPE is also declared instead of defined.
9372
9373 %union directives can now have a tag before the `{', e.g., the
9374 directive `%union foo {...}' now generates the C code
9375 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
9376 The default union tag is `YYSTYPE', for compatibility with Solaris 9
9377 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
9378 instead of `yyltype'.
9379
9380 `yystype' and `yyltype' are now obsolescent macros instead of being
9381 typedefs or tags; they are no longer documented and will be
9382 withdrawn in a future release.
9383
9384 * data/glr.c (b4_location_type): Remove.
9385 (YYSTYPE): Renamed from yystype.
9386 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
9387 (struct YYLTYPE): Renamed from struct yyltype.
9388 (YYLTYPE): Renamed from yyltype.
9389 (yyltype, yystype): New (and obsolescent) macros,
9390 for backward compatibility.
9391 * data/yacc.c: Likewise.
9392
9393 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
9394 does not specify a union tag. This is for compatibility with
9395 Solaris 9 yacc.
9396
9397 * src/parse-gram.y (add_param): 2nd arg is now char * not char
9398 const *, since it is now modified by stripping surrounding { }.
9399 (current_braced_code): Remove.
9400 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
9401 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
9402 trailing " {...}". Now of type <chars>.
9403 (grammar_declaration): Adjust to bundled tokens.
9404 (code_content): Remove; stripping is now done by add_param.
9405 (print_token_value): Print contents of bundled tokens.
9406 (token_name): New function.
9407
9408 * src/reader.h (braced_code, current_braced_code): Remove.
9409 (token_name): New decl.
9410
9411 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
9412 token_type, not braced_code code_kind. All uses changed.
9413 (SC_PRE_CODE): New state, for scanning after a keyword that
9414 has (or usually has) an immediately-following braced code.
9415 (token_type): New local var, to keep track of which token type
9416 to return when scanning braced code.
9417 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 9418 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
9419 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
9420 instead of returning a token type immediately.
9421 (<INITIAL>"{"): Set token type.
9422 (<SC_BRACED_CODE>"}"): Use it.
9423 (handle_action_dollar, handle_action_at): Now returns bool
9424 indicating success. Fail if ! current_rule; this prevents a core dump.
9425 (handle_symbol_code_dollar, handle_symbol_code_at):
9426 Remove; merge body into caller.
9427 (handle_dollar, handle_at): Complain in invalid contexts.
9428
9429 * NEWS, doc/bison.texinfo: Document the above.
9430 * NEWS: Fix years and program names in copyright notice.
9431
879ca4f8
PE
94322002-12-17 Paul Eggert <eggert@twinsun.com>
9433
9434 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
9435 Reporting, Table of Symbols): Omit mentions of %lex-param and
9436 %parse-param from the documentation for now.
9437
1c5fe69d
PE
94382002-12-15 Paul Eggert <eggert@twinsun.com>
9439
9440 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
9441 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
9442 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
9443 disagreed with the Bison documentation. Bug
9444 reported by Andrew Walrond.
d600ee67 9445
1c5fe69d
PE
9446 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
9447 as the caller now does that.
9448 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
9449 (YYEMPTY): Parenthesize right hand side, since others use it.
9450 (yyparse): Don't assume that our generated code is the only code
9451 that sets yychar.
9452
d1de5372
PE
94532002-12-13 Paul Eggert <eggert@twinsun.com>
9454
9455 Version 1.75d.
9456
9457 POSIX requires a "yacc" command.
9458 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
9459 (MOSTLYCLEANFILES): Add yacc.
9460 (yacc): New rule.
1c5fe69d 9461 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
9462 as an alias for bison y.
9463
9464 * po/LINGUAS: Add da.
d600ee67 9465
d1de5372
PE
9466 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
9467 problem with latest <getopt.h>.
9468 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
9469
9470 * doc/fdl.texi: Upgrade to 1.2.
9471 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
9472 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
9473 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
9474 gnulib.
9475 * config/install-sh: Sync with autotools.
9476
9477 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 9478 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
9479 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
9480 locations are requested.
9481 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
9482 locations are requested.
9483
d0f3fe23
PE
94842002-12-12 Paul Eggert <eggert@twinsun.com>
9485
9486 Remove unportable casts and storage allocation tricks.
9487 While we're at it, remove almost all casts, since they
9488 usually aren't needed and are a sign of trouble.
9489
9490 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
9491
9492 * src/derives.c (derives_compute): Do not subtract NTOKENS from
9493 the pointer DSET returned by malloc; this isn't portable.
9494 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
9495 Similarly for DERIVES.
9496 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
9497 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
9498 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
9499
9500 * src/derives.c (derives_compute): Do not bother invoking
9501 int_of_rule_number, since rule numbers are integers.
9502
9503 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
9504 rather than XMALLOC (char, N).
9505
9506 * src/files.c (filename_split): Rewrite to avoid cast.
9507
9508 * src/gram.h (symbol_number_as_item_number,
9509 item_number_as_symbol_number, rule_number_as_item_number,
9510 item_number_as_rule_number):
9511 Now inline functions rather than macros, to avoid casts.
9512 * src/state.h (state_number_as_int): Likewise.
9513 * src/tables.c (state_number_to_vector_number,
9514 symbol_number_to_vector_number): Likewise.
9515
9516 * src/gram.h (int_of_rule_number): Remove; no longer used.
9517
9518 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
9519 since the resulting storage is always stored into.
9520
9521 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
9522 where it's needed.
9523
9524 * src/muscle_tab.c (muscle_m4_output):
9525 Now inline. Return bool, not int.
9526 * src/state.c (state_compare): Likewise.
9527 * src/symtab.c (symbol_check_defined,
9528 symbol_check_alias_consistency, symbol_pack, symbol_translation,
9529 hash_compare_symbol, hash_symbol):
9530 Likewise.
9531 * src/uniqstr.c (uniqstr_print): Likewise.
9532 * src/muscle_tab.c (muscle_m4_output_processor):
9533 New function, to avoid casts.
9534 * src/state.c (state_comparator, stage_hasher): Likewise.
9535 * src/symtab.c (symbol_check_defined_processor,
9536 symbol_check_alias_consistency_processor, symbol_pack_processor,
9537 symbol_translation_processor, hash_symbol_comparator,
9538 hash_symbol_hasher): Likewise.
9539 * src/uniqstr.c (uniqstr_print_processor): Likewise.
9540 * src/muscle_tab.c (muscles_m4_output):
9541 Use new functions instead of casting old functions unportably.
9542 * src/state.c (state_hash_new): Likewise.
9543 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
9544 symbols_token_translations_init):
9545 Likewise.
9546 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
9547
9548 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
9549 var instead of casting to long, to avoid casts.
9550 (prepare_states): Use MALLOC rather than alloca, so that we don't
9551 have to worry about alloca.
9552 * src/state.c (state_hash_lookup): Likewise.
9553
9554 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
9555 local var instead of casting to unsigned char, to avoid casts.
9556
9557 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
9558 STATE_ALLOC): Remove.
9559 (transitions_new, errs_new, reductions_new, state_new): Use malloc
9560 rather than calloc, and use offsetof to avoid allocating slightly
9561 too much storage.
9562 (state_new): Initialize all members.
9563
9564 * src/state.c (state_hash): Use unsigned accumulator, not signed.
9565
9566 * src/symtab.c (symbol_free): Remove; unused.
9567 (symbol_get): Remove cast in lhs of assignment.
9568 (symbols_do): Now static. Accept generic arguments, not
9569 hashing-related ones.
9570
9571 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
9572 (symbol_processor): Remove.
9573 (symbols_do): Remove decl; now static.
9574
9575 * src/system.h (alloca): Remove; decl no longer needed.
9576 (<stddef.h>): Include, for offsetof.
9577 (<inttypes.>, <stdint.h>): Include if available.
9578 (uintptr_t): New type, if system lacks it.
9579 (CALLOC, MALLOC, REALLOC): New macros.
9580 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
9581 new macros.
9582
9583 * src/tables.c (table_size): Now int, to pacify GCC.
9584 (table_grow, table_ninf_remap): Use signed table size.
9585 (save_row): Don't bother initializing locals when not needed.
9586 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
9587 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
9588
9589 * src/vcg.h: Correct misspellings.
9590
9591 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
9592
9593
9594 * src/getargs.c (getargs): Don't assume EOF == -1.
9595
26b4a969
PE
95962002-12-09 Paul Eggert <eggert@twinsun.com>
9597
9598 Change identifier spellings to avoid collisions with names
9599 that are reserved by POSIX.
9600
9601 Don't use names ending in _t, since POSIX reserves them.
9602 For consistency, remove _e and _s endings -- they're weren't
9603 needed to remove ambiguity. All uses changed.
9604 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
9605 turn was just renamed from struniq_t.
9606 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
9607 which in turn was just renamed from struniq_processor_t.
9608 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
9609 in turn was renamed from hash_compare_struniq_t.
9610 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
9611 (state_list): Renamed from state_list_t.
9612 * src/assoc.h (assoc): Renamed from assoc_t.
9613 * src/conflicts.c (enum conflict_resolution): Renamed from
9614 enum conflict_resolution_e.
9615 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
9616 (rule_list): Renamed from rule_list_t.
9617 * src/getargs.h (enum trace): Renamed from enum trace_e.
9618 (enum report): Renamed from enum report_e.
9619 * src/gram.h (item_number): Renamed from item_number_t.
9620 (rule_number): Renamed from rule_number_t.
9621 (struct rule_s): Remove the "rule_s" part; not used.
9622 (rule): Renamed from rule_t.
9623 (rule_filter): Renamed from rule_filter_t.
9624 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
9625 (goto_list): Renamed from goto_list_t.
9626 * src/lalr.h (goto_number): Renamed from goto_number_t.
9627 * src/location.h (location): Renamed from location_t.
9628 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
9629 and moved here from:
9630 * src/muscle_tab.h (muscle_entry_t): here.
9631 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
9632 (rule_list): Renamed from rule_list_t.
9633 * src/print_graph.c (static_graph): Renamed from graph.
9634 * src/reader.h (braced_code): Renamed from braced_code_t.
9635 Remove brace_code_e tag.
9636 * src/relation.h (relation_node): Renamed from relation_node_t.
9637 (relation_nodes): Renamed from relation_nodes_t.
9638 (relation): Renamed from relation_t.
9639 * src/state.h (state_number): Renamed from state_number_t.
9640 (struct state): Renamed from struct state_s.
9641 (state): Renamed from state_t.
9642 (transitions): Renamed from transitions_t. Unused (and
9643 misspelled) transtion_s tag removed.
9644 (errs): Renamed from errs_t. Unused errs_s tag removed.
9645 (reductions): Renamed from reductions_t. Unused tag
9646 reductions_s removed.
9647 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
9648 (struct symbol_list): Renamed from struct symbol_list_s.
9649 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
9650 (struct symbol): Renamed from struct symbol_s.
9651 (symbol): Renamed from symbol_t.
9652 * src/tables.c (vector_number): Renamed from vector_number_t.
9653 (action_number): Renamed from action_t.
9654 * src/tables.h (base_number): Renamed from base_t.
9655 * src/vcg.h (enum color): Renamed from enum color_e.
9656 (enum textmode): Renamed from enum textmode_e.
9657 (enum shape): Renamed from enum shape_e.
9658 (struct colorentry): Renamed from struct colorentry_s.
9659 (struct classname): Renamed from struct classname_s.
9660 (struct infoname): Renamed from struct infoname_s.
9661 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
9662 (enum decision): Renamed from enum decision_e.
9663 (enum orientation): Renamed from enum orientation_e.
9664 (enum alignment): Renamed from enum alignment_e.
9665 (enum arrow_mode): Renamed from enum arrow_mode_e.
9666 (enum crossing_type): Renamed from enum crossing_type_e.
9667 (enum view): Renamed from enum view_e.
9668 (struct node): Renamed from struct node_s.
9669 (node): Renamed from node_t.
9670 (enum linestyle): Renamed from enum linestyle_e.
9671 (enum arrowstyle): Renamed from enum arrowstyle_e.
9672 (struct edge): Renamed from struct edge.
9673 (edge): Renamed from edge_t.
9674 (struct graph): Renamed from struct graph_s.
9675 (graph): Renamed from graph_t.
9676 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
9677 Rename value_t -> value.
9678 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
9679 value_t_as_yystype -> value_as_yystype.
9680
9681 Don't include <errno.h> in the mainstream code, since it
9682 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
9683 * lib/get-errno.c, lib/get-errno.h: New files.
9684 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
9685 get-errno.c.
9686 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
9687 * src/output.c (output_skeleton): Likewise.
9688 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
9689 instead of errno.
9690 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
9691 Likewise.
9692 (handle_action_dollar, handle_action_at): Likewise.
9693 * src/system.h: Do not include <errno.h>.
9694 (TAB_EXT): Renamed from EXT_TAB.
9695 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
9696
9697 Avoid str[a-z]*, since <string.h> reserves that name space.
9698 Change all instances of "struniq" in names to "uniqstr", and
9699 likewise for "STRUNIQ" and "UNIQSTR".
9700 * src/uniqstr.c: Renamed from src/struniq.c.
9701 * src/uniqstr.h: Renamed from src/struniq.h.
9702 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
9703 * src/files.c (strsuffix): Remove; unused.
9704 (concat2): Renamed from stringappend. Now static.
9705 * src/files.h (strsuffix, stringappend): Remove; unused.
9706 * src/parse-gram.y (<chars>): Renamed from <string>.
9707 (<uniqstr>): Renamed from <struniq>.
9708 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
9709 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
9710 (struct graph_s.expand): Renamed from struct graph_s.stretch.
9711 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
9712 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
9713 (N_EXPAND): Renamed from N_STRETCH.
9714
9715 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
9716 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
9717 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
9718 Remove; unused.
9719 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
9720 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
9721 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
9722 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
9723 (BASE_MAXIMUM): Renamed from BASE_MAX.
9724 (BASE_MINIMUM): Renamed from BASE_MIN.
9725 (ACTION_MAX): Remove; unused.
9726 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
9727 Unnecessary casts removed from above defines.
9728
9729
9730 Fix misspelling in names.
9731 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
9732 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
9733 G_NODE_ALIGNEMENT.
9734
9735
9736 * lib/timevar.c (timevar_report): Renamed from time_report,
9737 for consistency with other names.
9738 * lib/timevar.h (timevar_report): New decl.
9739 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
9740
9741
9742 Sort include-file uses.
9743
9744 Reorder all include files under src to be in the order "system.h".
9745 then the ../lib include files in angle brackets (alphabetized),
9746 then the . include files in double-quotes (alphabetized). Fix
9747 dependency breakages encountered in this process, as follows:
9748 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
9749 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
9750 * src/state.h: Include "symtab.h".
9751
996b1c7e
PE
97522002-12-08 Paul Eggert <eggert@twinsun.com>
9753
9754 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
9755 since this causes problems when __file__ contains character
9756 sequences like "@" that are treated specially by src/scan-skel.l.
9757 Instead, just use the file's basename. This fixes the bug
9758 reported by Martin Mokrejs in
161a71f3 9759 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 9760
e19c4e5d
PE
97612002-12-06 Paul Eggert <eggert@twinsun.com>
9762
9763 Add support for rules that do not have trailing semicolons, as
9764 POSIX requires. Improve the quality of locations in Bison
9765 diagnostics.
26b4a969 9766
e19c4e5d
PE
9767 * src/location.c: Include <quotearg.h>.
9768 (empty_location): Now const.
9769 (location_print): New function. Follow the recommendation of the
9770 GNU Coding Standards for locations that span file boundaries.
9771 * src/location.h: Do not include <quotearg.h>; no longer needed.
9772 (boundary): New type.
9773 (location_t): Use it. This allows locations to span file boundaries.
9774 All member uses changed: file -> start.file or end.file (as needed),
9775 first_line -> start.line, first_column -> start.column,
9776 last_line -> end.line, last_column -> end.column.
9777 (equal_boundaries): New function.
9778 (LOCATION_RESET, LOCATION_STEP): Remove.
9779 (LOCATION_PRINT): Remove. All callers changed to use location_print.
9780 (empty_location): Now const.
9781 (location_print): New decl.
9782 * src/parse-gram.y (lloc_default): New function, which handles
9783 empty locations more accurately.
9784 (YYLLOC_DEFAULT): Use it.
9785 (%token COLON): Remove.
9786 (%token ID_COLON): New token.
26b4a969 9787 (rules): Use it.
e19c4e5d
PE
9788 (declarations, rules): Remove trailing semicolon.
9789 (declaration, rules_or_grammar_declaration):
9790 Allow empty (";") declaration.
9791 (symbol_def): Remove empty actions; no longer needed.
9792 (rules_or_grammar_declaration): Remove trailing semicolon.
9793 (semi_colon.opt): Remove.
9794 * src/reader.h: Include location.h.
9795 (scanner_cursor): New decl.
9796 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
9797 rolling our own.
9798 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
9799 of *loc.
9800 (STEP): Remove. No longer needed, now that adjust_location does
9801 the work. All uses removed.
9802 (scanner_cursor): New var.
9803 (adjust_location): Renamed from extend_location. It now sets
9804 *loc and adjusts the scanner cursor. All uses changed.
9805 Don't bother testing for CR.
9806 (handle_syncline): Remove location arg; now updates scanner cursor.
9807 All callers changed.
9808 (unexpected_end_of_file): Now accepts start boundary of token or
9809 comment, not location. All callers changed. Update scanner cursor,
9810 not the location.
9811 (SC_AFTER_IDENTIFIER): New state.
9812 (context_state): Renamed from c_context. All uses changed.
9813 (id_loc, code_start, token_start): New local vars.
9814 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
9815 processing of Yacc white space and equivalents here.
9816 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
9817 instead of returning ID immediately, since we need to search for
9818 a subsequent colon.
9819 (<INITIAL>"'", "\""): Save token_start.
9820 (<INITIAL>"%{", "{", "%%"): Save code_start.
9821 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
9822 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
9823 BEGIN context_state at end, not INITIAL.
9824 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
9825 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
9826 Return correct token start.
9827 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
9828 the start of a character, string or multiline comment is found.
9829 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
9830 Reduction): Adjust reported locations to match the more-precise
9831 results now expected.
9832 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
9833 * tests/reduce.at (Useless Rules, Reduced Automaton,
9834 Underivable Rules): Likewise.
9835 * tests/regression.at (Invalid inputs): No longer `expecting ";"
9836 or "|"' now that so many other tokens are allowed by the new grammar.
9837
9838 * src/complain.h (current_file): Remove duplicate decl;
9839 current_file is now owned by files.h.
9840 * src/complain.c, src/scan-gram.l: Include files.h.
9841
98422002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 9843
e19c4e5d
PE
9844 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
9845 promotes to int; it might be unsigned int.
9846 * data/yacc.c (yy_reduce_print): Likewise.
9847
9848 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
9849 be #defined in the prologue, not in the Bison declarations.
9850 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 9851
b64755e3
PE
98522002-12-02 Paul Eggert <eggert@twinsun.com>
9853
9854 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
9855 * lib/strtoul.c: New file, from gnulib.
9856 This fixes a porting bug reported by Peter Klein in
161a71f3 9857 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 9858
6e746484
PE
98592002-11-30 Paul Eggert <eggert@twinsun.com>
9860
b64755e3
PE
9861 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
9862 and put only a forward declaration in the prologue. This is for
9863 consistency with the other scanner helper functions.
9864
6ba55592
PE
9865 Type clashes now generate warnings, not errors, since it
9866 appears that POSIX may allow some grammars with type clashes.
9867 * src/reader.c (grammar_current_rule_check): Warn about
9868 type clashes instead of complaining.
9869 * tests/input.at (Type Clashes): Expect warnings, not complaints.
9870
6e746484
PE
9871 Add Yacc library, since POSIX requires it.
9872 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
9873 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
9874 * lib/main.c, lib/yyerror.c: New files.
9875
9876 gram_error can be static; it need not be extern.
9877 * src/reader.h (gram_error): Remove decl.
9878 * src/parse-gram.y (gram_error): Now static. Add static decl.
9879 (print_token_value): Omit parameter names from forward decl,
9880 for consistency.
9881
88510f9c
PE
98822002-11-29 Paul Eggert <eggert@twinsun.com>
9883
6e746484
PE
9884 * doc/bison.texinfo: Emphasize that yylex and yyerror must
9885 be declared before being used. E.g., one should typically
9886 declare them in the prologue. Use GNU coding style in examples.
9887 Put "const" consistently after the type it modifies. Mention
9888 that C99 supports "inline". Mention that yyerror traditionally
9889 returns "int".
9890
88510f9c
PE
9891 %parse-param and %lex-param now take just one argument, the
9892 declaration; the argument name is deduced from the declaration.
9893
9894 * doc/bison.texinfo (Parser Function, Pure Calling, Error
9895 Reporting, Table of Symbols): Document this.
9896 * src/parse-gram.y (add_param): New function.
9897 (COMMA): Remove.
9898 (declaration): Implement new rule for %parse-param and %lex-param.
9899 * src/scan-gram.l: "," now elicits a warning, rather than being
9900 a token; this is more compatible with byacc.
9901 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
9902
bb92250c
PE
99032002-11-27 Paul Eggert <eggert@twinsun.com>
9904
9905 Rename identifiers to avoid real and potential collisions.
9906
9907 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
9908 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 9909 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
9910 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
9911 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
9912 * src/parse-gram.y (print_token_value): Renamed from yyprint.
9913 All uses changed.
9914 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
9915 The name "yycontrol" violates the name space rules, and this stuff
9916 wasn't being used anyway.
9917 (input): Remove action; this stuff wasn't being used.
9918 (gram_error): Rename local variable yylloc -> loc.
9919 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
9920 (YY_DECL): Don't use "yy" at start of local variables.
9921 All uses changed, e.g., yylloc -> loc.
9922 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
9923 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
9924 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
9925 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
9926
9927 * src/parse-gram.y (gram_error): loc is now const *.
9928 * src/reader.h (gram_error): Likewise.
9929
3af4feb2
PE
99302002-11-24 Paul Eggert <eggert@twinsun.com>
9931
9932 Version 1.75c.
9933
9934 * tests/actions.at (Actions after errors): Use an output format
9935 more similar to that of the Printers and Destructors test.
9936 Test the position of the ';' token too.
9937 (Printers and Destructors): Likewise.
9938 (Printers and Destructors: %glr-parser): Remove for now, to avoid
9939 unnecessarily alarming people when the test fails.
9940
9941 * data/yacc.c (yyerrlab1): Move this label down, so that the
9942 parser does not discard the lookahead token if the user code
9943 invokes YYERROR. This change is required for POSIX conformance.
9944
9945 * lib/error.c: Sync with gnulib.
9946
99472002-11-22 Paul Eggert <eggert@twinsun.com>
9948
9949 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
9950 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
9951 * lib/xmalloc.c: Likewise.
26b4a969 9952
58004308
PE
99532002-11-20 Paul Eggert <eggert@twinsun.com>
9954
9955 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
9956
99572002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 9958
58004308
PE
9959 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
9960 should use `if (! x) abort ();' rather than `assert (x);', and
9961 anyway it's one less thing to worry about configuring.
9962
9963 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
9964 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
9965 and replace all instances of assert with abort.
9966 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
9967 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
9968
9969 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
9970 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
9971 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
9972 hash_find_entry, hash_rehash, hash_insert): Likewise.
9973 * src/conflicts.c (resolve_sr_conflict): Likewise.
9974 * src/lalr.c (set_goto_map, map_goto): Likewise.
9975 * src/nullable.c (nullable_compute): Likewise.
9976 * src/output.c (prepare_rules, token_definitions_output): Likewise.
9977 * src/reader.c (packgram, reader): Likewise.
9978 * src/state.c (state_new, state_free, state_transitions_set,
9979 state_reduction_find): Likewise.
9980 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
9981 symbol_pack): Likewise.
9982 * src/tables.c (conflict_row, pack_vector): Likewise.
9983 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9984 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9985 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
9986 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
9987
9988 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
9989 (ARGMATCH_CONSTRAINT): New macro.
9990 (ARGMATCH_ASSERT): Use it.
9991
9992 * src/system.h (verify): New macro.
9993 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
9994 rather than assert.
9995 * src/tables.c (tables_generate): Likewise.
9996
9997 * src/struniq.c (struniq_assert): Now returns void, and aborts
9998 if the assertion is false.
9999 (struniq_assert_p): Remove.
10000 * src/struniq.h: Likewise.
10001
76ae8198
PE
100022002-11-18 Paul Eggert <eggert@twinsun.com>
10003
10004 * data/glr.c (yygetLRActions): Replace `yyindex' with
10005 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
10006 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 10007 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 10008
d3c4e709
AD
100092002-11-18 Akim Demaille <akim@epita.fr>
10010
10011 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
10012 space.
10013 From Tim Van Holder.
10014
8d8a7238
PE
100152002-11-17 Paul Eggert <eggert@twinsun.com>
10016
10017 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
10018 to "SyntaxError" for consistency with my 2002-11-15 change.
10019
10020 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
10021 not define to {}, since this breaks the common use of `YYDPRINTF
10022 ((...));' if a single statement is desired (e.g. before `else').
10023 Work around GCC warnings by surrounding corresponding calls with
10024 {} if needed.
10025 (yyhasResolvedValue): Remove unused function.
10026 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
10027 loop body.
10028 (yyreportSyntaxError): Renamed from yyreportParseError.
10029 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
10030 All uses changed.
10031 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
10032 extern when possible. Remove unused initializations.
10033
b0937b22
AD
100342002-11-16 Akim Demaille <akim@epita.fr>
10035
10036 Augment the similarity between GLR and LALR traces.
10037
10038 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
10039 (YY_REDUCE_PRINT): New.
10040 (yyparse): Use them.
10041 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
10042 YYDPRINT here.
10043 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
10044 state reached after the reduction/recovery, since...
10045 (yyparse, yyprocessOneStack): Report the state we are entering in.
10046
c5e3e510
AD
100472002-11-16 Akim Demaille <akim@epita.fr>
10048
10049 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
10050 Add support for --trace=skeleton.
10051 * src/scan-skel.l: %option debug.
10052 Scan strings of non-@ or \n instead of character by character.
10053 (scan_skel): Handle trace_skeleton.
10054 (QPUTS): New.
10055 (@output_parser_name@, @output_header_name@): ``Restore'' their
10056 support (used to be M4 macros).
10057 * data/yacc.c: Quote larger chunks, a la glr.c.
10058 * data/lalr1.cc: Likewise.
10059 The header guards are no longer available, so use some other
10060 string than `YYLSP_NEEDED'.
10061
4c6cc1db
AD
100622002-11-16 Akim Demaille <akim@epita.fr>
10063
10064 Make the ``Printers and Destructors'' test more verbose, taking
10065 `yacc.c''s behavior as (possibly wrong) reference.
10066
10067 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
10068 instead of fprint on stdout.
10069 Set and report the last_line of the symbols.
10070 Consistently display values and locations.
10071
6d9e8019
PE
100722002-11-16 Paul Eggert <eggert@twinsun.com>
10073
10074 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
10075
6e649e65
PE
100762002-11-15 Paul Eggert <eggert@twinsun.com>
10077
b25d88f6
PE
10078 * tests/actions.at (Actions after errors): New test case.
10079
6e649e65
PE
10080 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
10081 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
10082 tests/action.at, tests/calc.at, tests/conflicts.at,
10083 tests/cxx-type.at, tests/regression.at:
10084 "parse error" -> "syntax error" for POSIX compatibility.
10085 "parsing stack overflow..." -> "parser stack overflow" so
10086 that code matches Bison documentation.
10087
0f39aab9
AD
100882002-11-15 Akim Demaille <akim@epita.fr>
10089
10090 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
10091 take two BRACED_CODE, not two string_content.
10092 Free the scanner's obstack when we are done.
10093 (code_content): New.
10094 * tests/calc.at: Adjust.
10095 * doc/bison.texinfo: Adjust.
10096 Also, make sure to include the `,' for these declarations.
10097
761c1926
AD
100982002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
10099
10100 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
10101 definition; avoids potential autoreconf problems.
10102
b0f98b10
AD
101032002-11-15 Akim Demaille <akim@epita.fr>
10104
10105 Always check the value returned by yyparse.
10106
10107 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
10108 returned by yyparse.
10109 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
10110 Adjust calls.
10111 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
10112 returned by yyparse.
10113
970785f1
PH
101142002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10115
10116 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
10117 on input.at test.
10118
8fcc7db1
PE
101192002-11-14 Paul Eggert <eggert@twinsun.com>
10120
7ec1b48e
PE
10121 * src/output.c (output_skeleton): Call xfopen instead of
10122 duplicating xfopen's body.
10123
cfff7583 10124 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 10125 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 10126
8fcc7db1
PE
10127 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
10128 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
10129 Group compiler. Instead, use "$CC -E bar.c". Include the .h
10130 file twice in the grammar, as an extra check.
10131
10132 * tests/input.at (Torturing the Scanner): Surround the
10133 backslash-newline tests with "#if 0", to make it less likely that
10134 we'll run into compiler bugs. Bring back solitary \ inside
10135 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 10136 test backslash-newline in C character constant.
8fcc7db1 10137
4e8d992c
AD
101382002-11-14 Akim Demaille <akim@epita.fr>
10139
10140 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
10141 status of the compiler.
f32b346d 10142 Calling `exit 1' is no longer needed.
4e8d992c
AD
10143 Reported by Nelson H. F. Beebe.
10144
9501dc6e
AD
101452002-11-14 Akim Demaille <akim@epita.fr>
10146
10147 * tests/atlocal.in (CPPFLAGS): We have config.h.
10148 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
10149 New.
10150 * tests/actions.at, tests/calc.at, tests/conflicts.at,
10151 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
10152 * tests/regression.at, tests/torture.at: Use them for all the
10153 grammars that are to be compiled.
10154 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
10155 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
10156 * doc/bison.texinfo (GLR Parsers): Document `inline'.
10157
18b519c0
AD
101582002-11-14 Akim Demaille <akim@epita.fr>
10159
10160 * doc/bison.texinfo: Various formatting changes (alignments in
10161 samples, additional @group/@end group, GCS in samples.
10162 Use @deffn instead of simple @table to define the directives,
10163 macros, variables etc.
10164
9a86cdb9
PE
101652002-11-13 Paul Eggert <eggert@twinsun.com>
10166
daa33def 10167 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 10168 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 10169
daa33def 10170 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 10171 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
10172 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
10173 * tests/headers.at (export YYLTYPE): Likewise.
10174
10175 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 10176 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 10177
9a86cdb9
PE
10178 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
10179 comments, since they're not portable. Use GNU coding style.
10180
9c1e26bd
AD
101812002-11-13 Akim Demaille <akim@epita.fr>
10182
10183 * data/yacc.c: Leave bigger chunks of quoted text.
10184 (YYDSYMPRINTF): New.
10185 Use it to report symbol activities.
10186 * data/glr.c (YYDSYMPRINTF): New.
10187 Use it.
10188
87f721cc
PE
101892002-11-12 Paul Eggert <eggert@twinsun.com>
10190
10191 Version 1.75b.
10192
10193 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
10194 (yyglrReduce): Return yyok, not 0.
10195 This should avoid the enumerated-type warnings reported
464c6927 10196 by Nelson H. F. Beebe in
161a71f3 10197 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
10198
10199 * lib/bbitset.h (BITSET_INLINE): Remove.
10200 * lib/bitset.h [! BITSET_INLINE]: Remove.
10201 (bitset_set, bitset_reset, bitset_test): Rename local vars
10202 to avoid shadowing warnings by GCC.
10203
10204 * data/glr.c (inline): Remove #define. It's the user's
10205 responsibility to #define it away, just like 'const'.
464c6927 10206 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 10207 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 10208
87f721cc
PE
10209 * Makefile.maint (po-check): Scan .l and .y files instead of the
10210 .c and the .h files that they generate. This fixes the bug
10211 reported by Tim Van Holder in:
161a71f3 10212 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
10213 Look for N_ as well as for _. Try to avoid matching #define for
10214 N_ and _.
10215 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
10216 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
10217 * src/scan-gram.l: Revamp regular expressions so that " and '
10218 do not confuse xgettext.
10219
10220 * src/struniq.h (struniq_new): Do not declare the return type
10221 to be 'const'; this violates the C standard.
10222 * src/struniq.c (struniq_new): Likewise.
10223
be14ade5
AD
102242002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
10225
10226 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
10227 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
10228 linker.
10229
05291fbc
AD
102302002-11-12 Akim Demaille <akim@epita.fr>
10231
10232 * Makefile.maint: Sync with Autoconf:
10233 (local_updates): New.
10234
1f5fd52e
AD
102352002-11-12 Akim Demaille <akim@epita.fr>
10236
10237 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
10238
283f1e64
AD
102392002-11-12 Akim Demaille <akim@epita.fr>
10240
10241 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
10242 locations.
10243
886b69d1
AD
102442002-11-12 Akim Demaille <akim@epita.fr>
10245
10246 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
10247 not yyvalue.
10248
3df37415
AD
102492002-11-12 Akim Demaille <akim@epita.fr>
10250
10251 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
10252 Use it to test the GLR parser.
10253
7bd6c77e
AD
102542002-11-12 Akim Demaille <akim@epita.fr>
10255
10256 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
10257 defines it.
10258 * data/glr.c (yystos): New.
10259 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
10260 (YYDSYMPRINT): New.
10261 (yyval): Don't define it, it is handled via M4.
10262 (yyrecoverParseError): Free verbosely the discarded symbols.
10263 * data/yacc.c (yysymprint): Remove, rather...
10264 (b4_yysymprint_generate): invoke.
10265 * data/c.m4 (b4_yysymprint_generate): New.
10266 Accept pointers as arguments, as opposed to the version from
10267 yacc.c.
10268 (b4_yydestruct_generate): Likewise.
10269 * tests/cations.at (Printers and Destructors): Use Bison directives
10270 instead of CPP macros.
10271 Don't rely on internal details.
10272
b0400cc6
AD
102732002-11-12 Akim Demaille <akim@epita.fr>
10274
10275 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
10276 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
10277 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
10278 it against YYEMPTY and so forth), work on yytoken (i.e., set
10279 it to YYEMPTY etc.).
10280 (yydestruct): Replace with a b4_yydestruct_generate invocation.
10281 (b4_symbol_actions): Remove.
10282 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
10283 for 0, end-of-input.
10284
72f889cc
AD
102852002-11-12 Akim Demaille <akim@epita.fr>
10286
10287 * doc/bison.texinfo (Destructor Decl): New.
10288
b1ae9233
AD
102892002-11-12 Akim Demaille <akim@epita.fr>
10290
10291 * src/tables.c (tables_generate): Use free for pointers that
10292 cannot be NULL, not XFREE.
10293 (pack_vector): Use assert, not fatal, for bound violations.
10294 * src/state.c (state_new): Likewise.
10295 * src/reader.c (reader): Likewise.
10296 * src/lalr.c (set_goto_map): Likewise.
72f889cc 10297 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
10298 the file name.
10299
7ec2d4cd
AD
103002002-11-12 Akim Demaille <akim@epita.fr>
10301
10302 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
10303 Restore.
10304 * src/scan-gram.l (last_string): Is global to the file, not to
10305 yylex.
10306 * src/parse-gram.y (input): Don't append the epilogue here,
10307 (epilogue.opt): do it here, and free the scanner's obstack.
10308 * src/reader.c (epilogue_set): Rename as...
10309 (epilogue_augment): this.
10310 * data/c.m4 (b4_epilogue): Defaults to empty.
10311
573a6cd3
AD
103122002-11-12 Akim Demaille <akim@epita.fr>
10313
10314 * src/getargs.c (long_options): Remove duplicates.
10315 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
10316 Remove.
10317 * doc/bison.rnh: Remove.
10318 * doc/bison.texinfo (VMS Invocation): Remove.
10319
95612cfa
AD
103202002-11-12 Akim Demaille <akim@epita.fr>
10321
10322 * src/struniq.h, src/struniq.c (struniq_t): Is const.
10323 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
10324
10325 Use struniq for symbols.
10326
10327 * src/symtab.h (symbol_t): The tag member is a struniq.
10328 (symbol_type_set): Adjust.
10329 * src/symtab.c (symbol_new): Takes a struniq.
10330 (symbol_free): Don't free the tag member.
10331 (hash_compare_symbol_t, hash_symbol_t): Rename as...
10332 (hash_compare_symbol, hash_symbol): these.
10333 Use the fact that tags as struniqs.
10334 (symbol_get): Use struniq_new.
10335 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
10336 Returns a strniq.
10337 * src/reader.h (merger_list, grammar_currentmerge_set): The name
10338 and type members are struniqs.
10339 * src/reader.c (get_merge_function)
10340 (grammar_current_rule_merge_set): Adjust.
10341 (TYPE, current_type): Are struniq.
10342
10343 Use struniq for file names.
10344
10345 * src/files.h, src/files.c (infile): Split into...
10346 (grammar_file, current_file): these.
10347 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
10348 * src/reduce.c (reduce_print): Likewise.
10349 * src/getargs.c (getargs): Likewise.
10350 * src/complain.h, src/complain.c: Likewise.
10351 * src/main.c (main): Call struniqs_new early enough to use it for
10352 file names.
10353 Don't free the input file name.
10354
3e6656f9
AD
103552002-11-12 Akim Demaille <akim@epita.fr>
10356
10357 * src/symtab.c (symbol_free): Remove dead deactivated code:
10358 type_name are properly removed.
10359 Don't use XFREE to free items that cannot be NULL.
10360 * src/struniq.h, src/struniq.c: New.
10361 * src/main.c (main): Initialize/free struniqs.
10362 * src/parse-gram.y (%union): Add astruniq member.
10363 (yyprint): Adjust.
10364 * src/scan-gram.l (<{tag}>): Return a struniq.
10365 Free the obstack bit that used to store it.
10366 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
10367
7672019c
PE
103682002-11-11 Paul Eggert <eggert@twinsun.com>
10369
10370 Revamp to fix many (but not all) of the C- and M4-related quoting
10371 problems. Among other things, this fixes the Bison bug reported
10372 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 10373 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
10374
10375 Use new @ escapes consistently. Represent brackets with @{ and @}
10376 rather than @<:@ and @:>@, since this works a bit better with dumb
10377 editors like vi. Represent @ with @@, since @ is now consistently
10378 an escape. Use @oline@ and @ofile@ rather than __oline__ and
10379 __ofile__, to avoid unexpected expansions. Similarly, use @output
10380 rather than #output.
10381
10382 * data/c.m4 (b4_copyright): Omit file name from comment, since
10383 the file name could contain "*/".
10384 (b4_synclines_flag): Don't quote the 2nd argument; it should already
10385 be quoted. All uses changed.
10386
10387 * data/glr.c: Use new @ escapes consistently.
10388 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
10389 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
10390 Remove, since they couldn't handle arbitrary characters in file
10391 names.
10392 * data/lalr1.cc: Likewise.
10393 * data/yacc.c: Likewise.
10394
10395 * src/files.c (output_infix): Remove; all uses removed.
10396 * src/files.h: Likewise.
10397
10398 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
10399 mishandled funny characters in file names, and anyway it isn't
10400 needed any more.
10401 * data/yacc.c: Likewise.
10402 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
10403
10404 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
10405 * data/yacc.c: Likewise.
10406
10407 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
10408 strings now.
10409 (muscle_init): Quote filename as a C string.
10410 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
10411 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
10412 * src/output.c (escaped_file_name_output): New function.
10413 (prepare_symbols): Quote tokens for M4.
10414 (prepare): Don't insert output_infix, output_prefix,
10415 output_parser_name, output_header_name; this is now down by scan-skel.
10416 Insert skeleton as a C string.
10417
10418 * src/output.c (user_actions_output, symbol_destructors_output,
10419 symbol_printers_output): Quote filenames for C and M4.
10420 * src/reader.c (prologue_augment, epilogue_set): Likewise.
10421
10422 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
10423 escapes other than \\ and \'; this simplifies the code.
10424 (<SC_STRING>): Likewise, for \\ and \".
10425 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
10426 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
10427 Use new escapes @{ and @} for [ and ].
10428
10429 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
10430 them with auto vars.
10431 Switch to new escape scheme, where @ is the escape character uniformly.
10432 Abort if a stray escape character is found. Avoid unbounded input
10433 buffer when parsing non-escaped text.
10434
10435 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
10436 __oline__, #output, $@, and @{ do not have unintended meanings.
10437
acea4f3b
PE
104382002-11-09 Paul Eggert <eggert@twinsun.com>
10439
10440 Fix the test failure due to GCC warnings described in
161a71f3 10441 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
10442 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
10443 evaluate to 0 if it's impossible for NINF to be in the respective
10444 table.
10445 (yygetLRActions, yyrecoverParseError): Use them.
10446
10447 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
10448 counted in the token inserted at end of file. Now takes
10449 location_t *, not location_t, so that the location can be
10450 adjusted. All uses changed.
10451
10452 * tests/regression.at (Invalid inputs): Adjust wording in
10453 diagnostic to match the new behavior.
10454
10455 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
10456 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
10457 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
10458 abort ();'. This reduces the runtime of the "Many lookaheads"
10459 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
10460 GCC 3.2.
10461
20ef1ad5
PE
104622002-11-07 Paul Eggert <eggert@twinsun.com>
10463
10464 * src/parse-gram.y (CHARACTER): Remove unused token.
10465 All uses removed.
10466
10467 * src/scan-gram.l: Remove stack option. We no longer use the
10468 stack, since the stack was never deeper than 1; instead, use the
10469 new auto var c_context to record the stacked value.
10470
10471 Remove nounput option. At an unexpected end of file, we now unput
10472 the minimal input necessary to end cleanly; this simplifies the
10473 code.
10474
10475 Avoid unbounded token sizes where this is easy.
10476
10477 (unexpected_end_of_file): New function.
10478 Use it to systematize the error message on unexpected EOF.
10479 (last-string): Now auto, not static.
10480 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
10481 (scanner_last_string_free): Remove; not used.
10482 (percent_percent_count): Move decl to just before use.
10483 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
10484 not the (never otherwised-used) CHARACTER.
10485
93724f13
AD
104862002-11-07 Akim Demaille <akim@epita.fr>
10487
10488 Let yyerror always receive the msg as last argument, so that
10489 yyerror can be variadic.
10490
10491 * data/yacc.c (b4_yyerror_args): New.
10492 Use it when calling yyerror.
10493 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
10494 Use it when calling yyerror.
10495 * doc/bison.texinfo (Error Reporting): Adjust.
10496 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
10497 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
10498
6e40b4eb
AD
104992002-11-06 Akim Demaille <akim@epita.fr>
10500
10501 #line should have quoted strings.
10502 Ideally, this should be done by m4_quotearg.
10503
10504 * src/scan-skel.l: Include quotearg.h.
10505 Quote __ofile__.
10506 * src/output.c (symbol_printers_output)
10507 (symbol_destructors_output): Quote the file name.
10508
2dfbfc12
AD
105092002-11-06 Akim Demaille <akim@epita.fr>
10510
10511 * tests/regression.at (Invalid inputs): Adjust to the recent
10512 messages.
10513
437c2d80
AD
105142002-11-06 Akim Demaille <akim@epita.fr>
10515
10516 Restore --no-lines.
10517 Reported by Jim Kent.
10518
10519 * data/c.m4 (b4_syncline): New.
10520 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
10521 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
10522 * src/output.c (user_actions_output): Likewise.
10523 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 10524 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 10525
900c5db5
AD
105262002-11-06 Akim Demaille <akim@epita.fr>
10527
10528 * src/main.c (main): Free `infile'.
10529 * src/scan-gram.l (handle_syncline): New.
10530 Recognize `#line'.
10531 * src/output.c (user_actions_output, symbol_destructors_output)
10532 (symbol_printers_output): Use the location's file name, not
10533 infile.
10534 * src/reader.c (prologue_augment, epilogue_set): Likewise.
10535
e183b123 105362002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 10537
e183b123 10538 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 10539 either has GLR conflict entries.
e183b123 10540
193eb6b7
PE
105412002-11-05 Paul Eggert <eggert@twinsun.com>
10542
e183b123
PE
10543 * src/scan-gram.l: Use more accurate diagnostics, e.g.
10544 "integer out of range" rather than "invalid value".
10545 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
10546 accordingly.
10547
193eb6b7
PE
10548 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
10549 Also, remove one static variable in the scanner.
10550
10551 * src/scan-gram.l (braces_level): Now auto, not static.
10552 Initialize to zero if the compiler is being picky.
10553 (INITIAL): Clear braces_level instead of incrementing it.
10554 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
10555 as POSIX 1003.1-2001 requires.
10556 * src/system.h (IF_LINT): New macro, taken from coreutils.
10557 * configure.ac: Define "lint" if --enable-gcc-warnings.
10558
29c01725
AD
105592002-11-05 Akim Demaille <akim@epita.fr>
10560
10561 * src/scan-gram.l: When it starts with `%', complain about the
10562 whole directive, not just that `invalid character: %'.
10563
8aeac3ca
AD
105642002-11-04 Akim Demaille <akim@epita.fr>
10565
10566 * Makefile.maint: Update from Autoconf.
10567 (update, cvs-update, po-update, do-po-update): New.
10568
793a58bb
AD
105692002-11-04 Akim Demaille <akim@epita.fr>
10570
10571 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
10572 and yyerror.
10573 Have yyerror `use' its arguments.
10574 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
10575 returns true when location & yacc & pure & parse-param.
10576 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
10577
c4d720cd
AD
105782002-11-04 Akim Demaille <akim@epita.fr>
10579
10580 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
10581 clashes.
10582 * src/scan-gram.l: Use [\'] instead of ['] to pacify
10583 font-lock-mode.
10584 Use complain_at.
10585 Use quote, not quote_n since LOCATION_PRINT no longer uses the
10586 slot 0.
10587
613a0dc5
PE
105882002-11-03 Paul Eggert <eggert@twinsun.com>
10589
10590 * src/reader.c (get_merge_function, grammar_current_rule_check):
10591 Use consistent diagnostics for reporting type name clashes.
10592 Quote the types with <>, for consistency with Yacc.
10593 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
10594
2a8d363a
AD
105952002-11-03 Akim Demaille <akim@epita.fr>
10596
10597 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
10598 New.
10599 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
10600 (b4_parse_param): Remove.
10601 Use b4_identification.
10602 Propagate b4_pure_args where needed to pass them to yyerror.
10603 * data/glr.m4 (b4_parse_param): Remove.
10604 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
10605 (b4_lpure_formals): New.
10606 Use b4_identification.
10607 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
10608 b4_user_formals and b4_user_args.
10609 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
10610 (yyreportAmbiguity): When using a pure parser, also need
10611 the location, and the parse-params.
10612 Adjust callers.
10613 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
10614 When using a pure parser, also need the parse-params.
10615 Adjust callers.
10616 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
10617 (%pure-parser + %parse-param) LALR and GLR parsers.
10618 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
10619 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
10620 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
10621 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
10622 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
10623 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
10624 * doc/bison.texinfo: Untabify the whole file.
10625 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
10626 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
10627 (Error Reporting): Adjust to these new directives.
10628 Document %error-verbose, deprecate YYERROR_VERBOSE.
10629
9e32add8
AD
106302002-11-03 Akim Demaille <akim@epita.fr>
10631
10632 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
10633 AT_CHECK_CALC_GLR invocations to use % directives, instead of
10634 command line options.
10635 * tests/cxx-type.at: Formatting changes.
10636
b02d90a5
PE
106372002-11-03 Paul Eggert <eggert@twinsun.com>
10638
10639 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
10640 to count columns correctly, and to check for invalid inputs.
9e32add8 10641
b02d90a5
PE
10642 Use mbsnwidth to count columns correctly. Account for tabs, too.
10643 Include mbswidth.h.
10644 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
10645 (extend_location): New function.
10646 (YY_LINES): Remove.
10647
10648 Handle CRLF in C code rather than in Lex code.
10649 (YY_INPUT): New macro.
10650 (no_cr_read): New function.
10651
10652 Scan UCNs, even though we don't fully handle them yet.
10653 (convert_ucn_to_byte): New function.
10654
10655 Handle backslash-newline correctly in C code.
10656 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
10657 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
10658 all uses changed.
10659 (tag, splice): New EREs. Do not allow NUL or newline in tags.
10660 Use {splice} wherever C allows backslash-newline.
10661 YY_STEP after space, newline, vertical-tab.
10662 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 10663
b02d90a5
PE
10664 (letter, id): Don't assume ASCII; e.g., spell out a-z.
10665
10666 ({int}, handle_action_dollar, handle_action_at): Check for integer
10667 overflow.
9e32add8 10668
b02d90a5
PE
10669 (YY_STEP): Omit trailing semicolon, so that it's more like C.
10670
10671 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
10672 as well as \000. Check for UCHAR_MAX, not 255.
10673 Allow \x with an arbitrary positive number of digits, as in C.
10674 Check for overflow here.
10675 Allow \? and UCNs, for compatibility with C.
10676
10677 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
10678 with quote slot used by complain_at.
10679
10680 * tests/input.at: Add tests for backslash-newline, m4 quotes
10681 in symbols, long literals, and funny escapes in strings.
10682
10683 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
10684 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
10685 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
10686 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
10687 * m4/mbswidth.m4: New file, from GNU coreutils.
10688
10689 * doc/bison.texinfo (Grammar Outline): Document // comments.
10690 (Symbols): Document that trigraphs have no special meaning in Bison,
10691 nor is backslash-newline allowed.
10692 (Actions): Document that trigraphs have no special meaning.
10693
10694 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
10695 no longer used.
10696
106972002-11-02 Paul Eggert <eggert@twinsun.com>
10698
10699 * src/reader.c: Don't include quote.h; not needed.
10700 (get_merge_function): Reword warning to be consistent with
10701 type clash diagnostic in grammar_current_rule_check.
10702
10703 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
10704 bug in trigraph handling.
10705
10706 * src/output.c (prepare_symbols): When printing token names,
10707 escape "[" as "@<:@" and likewise for "]".
10708
10709 * src/system.h (errno): Remove declaration, as we are now
10710 assuming C89 or better, and C89 guarantees errno.
10711
762b212b
PE
107122002-10-30 Paul Eggert <eggert@twinsun.com>
10713
10714 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
10715 Check for close failures.
10716 * src/files.h (xfclose): Return void, not int, since it always
10717 returned zero.
10718 * src/files.c (xfclose): Likewise. Report I/O error if ferror
10719 indicates one.
10720 * src/output.c (output_skeleton): Use xfclose rather than fclose
10721 and ferror. xfclose now checks ferror.
10722
10723 * data/glr.c (YYLEFTMOST_STATE): Remove.
10724 (yyreportTree): Use a stack-based leftmost state. This avoids
10725 our continuing battles with bogus warnings about initializers.
10726
56100c60
AD
107272002-10-30 Akim Demaille <akim@epita.fr>
10728
10729 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
10730 #if.
10731
51b4a04c
PH
107322002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10733
10734 * tests/glr-regr1.at: New test for reported regressions.
10735 * tests/testsuite.at: Add glr-regr1.at test.
10736 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 10737
bf1ebda2
PE
107382002-10-24 Paul Eggert <eggert@twinsun.com>
10739
5c16c6b1
PE
10740 Version 1.75a.
10741
bf1ebda2
PE
10742 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
10743 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
10744 we use malloc. Don't assume 'A' through 'Z' are contiguous.
10745 Don't assume strdup exists; POSIX says its an XSI extension.
10746 Check for buffer overflow on input.
10747
b526ee61
AD
107482002-10-24 Akim Demaille <akim@epita.fr>
10749
10750 * src/output.c (output_skeleton): Don't disable M4sugar comments
10751 too soon: it results in comments being expanded.
10752 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
10753 first output.
10754
f1886bb2
AD
107552002-10-24 Akim Demaille <akim@epita.fr>
10756
10757 * data/yacc.c (m4_int_type): New.
10758 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
10759 char' as only yacc.c wants K&R portability.
10760 * data/glr.c (yysigned_char): Remove.
10761 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
10762 Reported by Quoc Peyrot.
10763
c5576256
PE
107642002-10-23 Paul Eggert <eggert@twinsun.com>
10765
10766 * src/main.c (main): With --trace=time, report times even if a
10767 non-fatal error occurs. Formerly, the times were reported in some
10768 such cases but not in others.
10769 * src/reader.c (reader): Just return if a complaint has been issued,
10770 instead of exiting, so that 'main' can report times.
10771
27b0ffea
AD
107722002-10-22 Akim Demaille <akim@epita.fr>
10773
10774 * src/system.h: Include sys/types.
10775 Reported by Bert Deknuydt.
10776
223a7883
PE
107772002-10-23 Paul Eggert <eggert@twinsun.com>
10778
10779 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
10780 Suggested by Art Haas.
10781
107822002-10-22 Paul Eggert <eggert@twinsun.com>
10783
10784 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
10785 decl; not needed any more.
10786 * src/main.c (main): Use return to exit, undoing yesterday's change.
10787 The last OS that we could find where this wouldn't work is
10788 SunOS 3.5, and that's too old to worry about now.
10789
10790 * data/glr.c (struct yyltype): Define members even when not
10791 doing locations. This is more consistent with yacc.c, and it
10792 works around the following bug reports:
161a71f3
PE
10793 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
10794 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 10795
223a7883
PE
10796 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
10797 @acronym consistently. Standardize on "Yacc" instead of "YACC",
10798 "Algol" instead of "ALGOL". Give a bit more history about BNF.
10799
8b76775a
AD
108002002-10-22 Akim Demaille <akim@epita.fr>
10801
10802 * data/README: New.
10803
6db10d14
PE
108042002-10-21 Paul Eggert <eggert@twinsun.com>
10805
10806 Be consistent about 'bool'; the old code used an enum in one
10807 module and an int in another, and this violates the C standard.
10808 * m4/stdbool.m4: New file, from coreutils 4.5.3.
10809 * configure.ac (AC_HEADER_STDBOOL): Add.
10810 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
10811 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
10812 * src/symtab.c (hash_compare_symbol_t): Likewise.
10813 * src/system.h (bool, false, true): Use a definition consistent
10814 with ../lib/hash.c. All uses changed.
10815
10816 * src/complain.c (warning_issued): Renamed from warn_message_count,
10817 so that we needn't worry about integer overflow (!).
10818 Now of type bool. All uses changed.
10819 (complaint_issued): Renamed from complain_message_count; likewise.
10820
10821 * src/main.c (main): Use exit to exit with failure.
27b0ffea 10822
6db10d14
PE
10823 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
10824 rather than 1 and 0.
10825 * src/main.c (main): Likewise.
10826 * src/getargs.c (getargs): Likewise.
10827 * src/reader.c (reader): Likewise.
10828
10829 * src/getarg.c (getargs): Remove duplicate code for
10830 "Try `bison --help'".
10831
10832 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
10833 What was that "2" for?
10834
10835 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
10836 * src/getargs.c (usage): Likewise.
10837
10838 * src/getargs.c (getargs): When there are too few operands, report
10839 the last one. When there are too many, report the first extra
10840 one. This is how diffutils does it.
10841
92a060fd
PE
108422002-10-20 Paul Eggert <eggert@twinsun.com>
10843
10844 Remove K&R vestiges.
10845 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
10846 * src/complain.c (VA_START): Remove. Assume prototypes.
10847 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
10848 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
10849 fatal): Assume prototypes.
10850 * src/complain.h: Assume prototypes.
10851 * src/system.h (PARAMS): Remove.
10852 Include <limits.h> unconditionally, since it's guaranteeed even
10853 for a freestanding C89 compiler.
10854 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
10855 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 10856
e7cb57c0
AD
108572002-10-20 Akim Demaille <akim@epita.fr>
10858
10859 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
10860 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
10861 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
10862 (yyresolveStates, yyresolveAction, yyresolveStack)
10863 (yyprocessOneStack): Use them.
10864 (yy_reduce_print): New.
10865 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
10866
0245f82d
AD
108672002-10-20 Akim Demaille <akim@epita.fr>
10868
10869 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
10870 arguments and output `void'.
10871 (b4_c_function): Rename as...
10872 (b4_c_function_def): this.
10873 (b4_c_function_decl, b4_c_ansi_function_def)
10874 (b4_c_ansi_function_decl): New.
10875 Change the interpretation of the arguments: before `int, foo', now
10876 `int foo, foo'.
10877 * data/yacc.c (yyparse): Prototype and define thanks to these.
10878 Adjust b4_c_function_def uses.
10879 * data/glr.c (yyparse): Likewise, but ANSI only.
10880
39912f52
AD
108812002-10-20 Akim Demaille <akim@epita.fr>
10882
10883 * src/output.c (prepare): Move the definition of `tokens_number',
10884 `nterms_number', `undef_token_number', `user_token_number_max'
10885 to...
10886 (prepare_tokens): Here.
10887 (prepare_tokens): Rename as...
10888 (prepare_symbols): this.
10889 (prepare): Move the definition of `rules_number' to...
10890 (prepare_rules): here.
10891 (prepare): Move the definition of `last', `final_state_number',
10892 `states_number' to...
10893 (prepare_states): here.
10894 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
10895
20c1e2ad
AD
108962002-10-20 Akim Demaille <akim@epita.fr>
10897
10898 * src/tables.h, src/tables.c, src/output.c: Comment changes.
10899
21964f43
AD
109002002-10-20 Akim Demaille <akim@epita.fr>
10901
10902 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
10903 * data/c.m4: here.
10904
66d30cd4
AD
109052002-10-20 Akim Demaille <akim@epita.fr>
10906
10907 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
10908 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
10909 `pair'.
10910 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
10911 `name' to...
10912 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
10913 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
10914 These.
10915
95f2c9fe
PE
109162002-10-19 Paul Eggert <eggert@twinsun.com>
10917
10918 Do not create a temporary file, as that involves security and
10919 cleanup headaches. Instead, use a pair of pipes.
10920 Derived from a suggestion by Florian Krohm.
10921 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
10922 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
10923 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
10924 (BISON_PREREQ_SUBPIPE): Add.
10925 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
10926 Add subpipe.h, subpipe.c.
10927 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
10928 * po/POTFILES.in: Add lib/subpipe.c.
10929 * src/output.c: Include "subpipe.h".
10930 (m4_invoke): Remove decl.
10931 (scan_skel): New decl.
10932 (output_skeleton): Use pipe rather than temporary file for m4 input.
10933 Check that m4sugar.m4 is readable, to avoid deadlock.
10934 Check for pipe I/O error.
10935 * src/scan-skel.l (readpipe): Remove decl.
10936 (scan_skel): New function, to be used in place of m4_invoke.
10937 Read from stream rather than file.
66d30cd4 10938
95f2c9fe
PE
10939 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
10940 float, as this generates a warning on Solaris 8 + GCC 3.2 with
10941 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
10942 this generates a more-accurate value anyway.
10943
10944 * lib/timevar.c (timervar_accumulate): Rename locals to
10945 avoid confusion with similarly-named more-global.
10946 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
10947
10948 * src/output.c (prepare): Use xstrdup to convert char const *
10949 to char *, to avoid GCC warning.
10950
c19988b7
AD
109512002-10-19 Akim Demaille <akim@epita.fr>
10952
10953 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
10954 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
10955 Use them to have `calc.y' ready for %pure-parser.
10956 * data/yacc.c (YYLEX): Pass a yylex return type to
10957 b4_c_function_call.
10958
ae7453f2
AD
109592002-10-19 Akim Demaille <akim@epita.fr>
10960
10961 Prototype support of %lex-param and %parse-param.
10962
10963 * src/parse-gram.y: Add the definition of the %lex-param and
10964 %parse-param tokens, plus their rules.
10965 Drop the `_' version of %glr-parser.
10966 Add the "," token.
10967 * src/scan-gram.l (INITIAL): Scan them.
10968 * src/muscle_tab.c: Comment changes.
10969 (muscle_insert, muscle_find): Rename `pair' as `probe'.
10970 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
10971 (muscle_entry_s): The `value' member is no longer const.
10972 Adjust all dependencies.
10973 * src/muscle_tab.c (muscle_init): Adjust: use
10974 MUSCLE_INSERT_STRING.
10975 Initialize the obstack earlier.
10976 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
10977 (muscle_pair_list_grow): New.
10978 * data/c.m4 (b4_c_function_call, b4_c_args): New.
10979 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
10980 * tests/calc.at: Use %locations, not --locations.
10981 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
10982
0e575721
AD
109832002-10-19 Akim Demaille <akim@epita.fr>
10984
10985 * src/getargs.c (usage): Take status as argument and exit
10986 accordingly.
10987 Report the traditional `Try ... --help' message when status != 0.
10988 (usage, version): Don't take a FILE * as arg, it is pointless.
10989 (getargs): When there is an incorrect number of arguments, make it
10990 an error, and report it GNUlically thanks to `usage ()'.
10991
724ce7f5
PE
109922002-10-18 Paul Eggert <eggert@twinsun.com>
10993
3a781eb2
PE
10994 * data/glr.c (yyreportParseError): Don't assume that sprintf
10995 yields the length of the printed string, as this is not true
10996 on SunOS 4.1.4. Reported by Peter Klein.
10997
724ce7f5
PE
10998 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
10999 * tests/conflicts.at (%nonassoc and eof): Likewise.
11000 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
11001
473d0a75
AD
110022002-10-17 Akim Demaille <akim@epita.fr>
11003
11004 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
11005 * src/getargs.c (trace_types, trace_args): Adjust.
11006 * src/reader.c (grammar_current_rule_prec_set)
11007 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
11008 Standardize error messages.
11009 And s/@prec/%prec/!
11010 (reader): Use trace_flag to enable scanner/parser debugging,
11011 instead of an adhoc scheme.
11012 * src/scan-gram.l: Remove trailing debugging code.
11013
e76d2469
PE
110142002-10-16 Paul Eggert <eggert@twinsun.com>
11015
93e2236a
PE
11016 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
11017 MUSCLE_TAB_H.
11018
e76d2469
PE
11019 * NEWS: Officially drop support for building Bison with K&R C,
11020 since it didn't work anyway and it's not worth worrying about.
11021 * Makefile.maint (wget_files): Remove ansi2knr.c.
11022 (ansi2knr.c-url_prefix): Remove.
11023 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
11024 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11025 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11026
5bd1c419
PE
110272002-10-15 Paul Eggert <eggert@twinsun.com>
11028
11029 Stop using the "enum_" trick for K&R-style function definitions;
11030 it confused me, and I was the author! Instead, assume that people
11031 who want to use K&R C compilers (when using these modules in GCC,
11032 perhaps?) will run ansi2knr.
11033
11034 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
11035 All uses of "enum_" changed to "enum ".
11036 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11037 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 11038
5bd1c419
PE
11039 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
11040 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
11041 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
11042 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
11043 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
11044 abitset_not, abitset_ones, abitset_or, abitset_or_and,
11045 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
11046 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
11047 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
11048 Use function prototypes; this removes the need for declaring
11049 static functions simply to provide their prototypes.
11050 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
11051 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
11052 bitset_count_, bitset_create, bitset_dump, bitset_first,
11053 bitset_free, bitset_init, bitset_last, bitset_next,
11054 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
11055 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
11056 bitset_print, bitset_release_memory, bitset_toggle_,
11057 bitset_type_choose, bitset_type_get, bitset_type_name_get,
11058 debug_bitset): Likewise.
11059 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
11060 * lib/bitset_stats.c (bitset_log_histogram_print,
11061 bitset_percent_histogram_print, bitset_stats_and,
11062 bitset_stats_and_cmp, bitset_stats_and_or,
11063 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
11064 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
11065 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
11066 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
11067 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
11068 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
11069 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
11070 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
11071 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
11072 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
11073 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
11074 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
11075 bitset_stats_zero): Likewise.
11076 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11077 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11078 bitsetv_dump, debug_bitsetv): Likewise.
11079 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
11080 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
11081 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
11082 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
11083 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
11084 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
11085 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
11086 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
11087 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
11088 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
11089 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
11090 Likewise.
11091 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
11092 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
11093 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
11094 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
11095 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
11096 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
11097 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
11098 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
11099 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
11100 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
11101 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 11102
ae26e1f0
AD
111032002-10-14 Akim Demaille <akim@epita.fr>
11104
11105 Version 1.75.
11106
d43baf71
AD
111072002-10-14 Akim Demaille <akim@epita.fr>
11108
11109 * tests/Makefile.am (maintainer-check-posix): New.
11110
7ebc83e3
AD
111112002-10-14 Akim Demaille <akim@epita.fr>
11112
11113 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
11114 member.
11115
05846dae
AD
111162002-10-14 Akim Demaille <akim@epita.fr>
11117
11118 * src/tables.c (table_ninf_remap): base -> tab.
11119 Reported by Matt Rosing.
11120
1318e37d
PE
111212002-10-14 Paul Eggert <eggert@twinsun.com>
11122
447fbb17
PE
11123 * tests/action.at, tests/calc.at, tests/conflicts.at,
11124 tests/cxx-type.at, tests/headers.at, tests/input.at,
11125 tests/regression.at, tests/synclines.at, tests/torture.at:
11126 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
11127 so that the tests still work even if POSIXLY_CORRECT is set.
11128 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 11129
1318e37d
PE
11130 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
11131 for portability to K&R hosts. Fix typo: signed char is guaranteed
11132 only to 127, not to 128.
11133 * data/glr.c (yysigned_char): New type.
11134 * data/yacc.c (yysigned_char): Likewise.
11135 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
11136
cc0f0794
PE
111372002-10-13 Paul Eggert <eggert@twinsun.com>
11138
5038f418
PE
11139 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
11140 true due to limited range of data type" warning from GCC.
11141
cc0f0794
PE
11142 * data/c.m4 (b4_token_defines): Protect against double-inclusion
11143 by wrapping enum yytokentype's definition inside #ifndef
11144 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
11145
6fed0802
AD
111462002-10-13 Akim Demaille <akim@epita.fr>
11147
11148 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
11149 Un yy- yyrhs to avoid the name clash with the global YYRHS.
11150
32f0598d
AD
111512002-10-13 Akim Demaille <akim@epita.fr>
11152
11153 * Makefile.maint: Update from Autoconf 2.54.
11154 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
11155
7ea9a33f
AD
111562002-10-13 Akim Demaille <akim@epita.fr>
11157
11158 * src/print.c (print_state): Separate the list of solved conflicts
11159 from the other items.
11160 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
11161
ea99527d
AD
111622002-10-13 Akim Demaille <akim@epita.fr>
11163
11164 Let nondeterministic skeletons be usable with deterministic
11165 tables.
11166
11167 With the patch, GAWK compiled by GCC without -O2 passes its test
11168 suite using a GLR parser driven by LALR tables. It fails with -O2
11169 because `struct stat' gives two different answers on my machine:
11170 88 (definition of an auto var) and later 96 (memset on this var).
11171 Hence the stack is badly corrumpted. The headers inclusion is to
11172 blame: if I move the awk.h inclusion before GLR's system header
11173 inclusion, the two struct stat have the same size.
11174
11175 * src/tables.c (pack_table): Always create conflict_table.
11176 (token_actions): Always create conflict_list.
11177 * data/glr.c (YYFLAG): Remove, unused.
11178
f377f69f
AD
111792002-10-13 Akim Demaille <akim@epita.fr>
11180
11181 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
11182 (O0FLAGS): New.
11183 (VALGRIND, GXX): New.
11184 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
11185 * tests/bison.in: Run $PREBISON a pre-command.
11186 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
11187 (maintainer-check-g++): New.
11188 * Makefile.am (maintainer-check): New.
11189
2a1fe6ed
AD
111902002-10-13 Akim Demaille <akim@epita.fr>
11191
11192 * data/glr.c: Formatting changes.
11193 Tweak some trace messages to match yacc.c's.
11194
f50adbbd
AD
111952002-10-13 Akim Demaille <akim@epita.fr>
11196
11197 GLR parsers sometimes raise parse errors instead of performing the
11198 default reduction.
11199 Reported by Charles-Henry de Boysson.
11200
11201 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 11202 check the length of the traces when %glr.
f50adbbd
AD
11203 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
11204 GLR's traces.
11205 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
11206 Test GLR parsers.
11207 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
11208 (yyltype): Remove the yy prefix from the member names.
11209 (yytable): Complete its comment.
11210 (yygetLRActions): Map error action number from YYTABLE from
11211 YYTABLE_NINF to 0.
11212 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
11213 (which was a bug: it should have been YYTABEL_NINF, and yet it was
11214 not satisfying as we could compare an YYACTION computed from
11215 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
11216 only value for error actions.
11217 (yyreportParseError): In verbose parse error messages, don't issue
11218 `error' in the list of expected tokens.
11219 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
11220 next action to perform to match glr.c's decoding.
11221 (yytable): Complete its comment.
11222
bcbad5b9
PE
112232002-10-13 Paul Eggert <eggert@twinsun.com>
11224
11225 Fix problem reported by Henrik Grubbstroem in
161a71f3 11226 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
11227 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
11228 because the Bison parser reads the second action before reducing
11229 the first one.
11230 * src/scan-gram.l (rule_length): New static var.
11231 Use it to keep track of the rule length in the scanner, since
11232 we can't expect the parser to be in lock-step sync with the scanner.
11233 (handle_action_dollar, handle_action_at): Use this var.
11234 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 11235
14904b89
PE
112362002-10-12 Paul Eggert <eggert@twinsun.com>
11237
1fe611e5
PE
11238 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
11239 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
11240 Include <sys/time.h> when checking for clock_t and struct tms.
11241 Use same include order as source.
11242 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 11243 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 11244
1fe611e5
PE
11245 * lib/timevar.c: Update copyright date and clarify comments.
11246 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 11247
1fe611e5
PE
11248 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
11249 GCC version as of today, then merge Bison's changes.
11250 Change "GCC" to "Bison" in copyright notice. timevar.def's
11251 author is Akim, so change that too.
11252
98194095
PE
11253 * src/reader.c (grammar_current_rule_check):
11254 Don't worry about the default action if $$ is untyped.
11255 Prevents bogus warnings reported by Jim Gifford in
161a71f3 11256 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 11257
14904b89
PE
11258 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
11259 * data/glr.c, data/lalr1.cc, data/yacc.c:
11260 Output token definitions before the first part of user declarations.
11261 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 11262 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 11263
ff6dca18
PE
112642002-10-11 Paul Eggert <eggert@twinsun.com>
11265
11266 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
11267 (yyparse): here. This undoes some of the 2002-07-25 change.
11268 Compatibility problem reported by Ralf S. Engelschall with
11269 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
11270
eb714592
AD
112712002-10-11 Akim Demaille <akim@epita.fr>
11272
11273 * tests/regression.at Characters Escapes): New.
11274 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
11275 characters.
11276 Reported by Jan Nieuwenhuizen.
11277
b7195100
AD
112782002-10-11 Akim Demaille <akim@epita.fr>
11279
11280 * po/id.po: New.
11281
f28a0f2d
PE
112822002-10-10 Paul Eggert <eggert@twinsun.com>
11283
11284 Portability fixes for bitsets; this also avoids several GCC
11285 warnings.
11286
11287 * lib/abitset.c: Include <stddef.h>, for offsetof.
11288 * lib/lbitset.c: Likewise.
11289
11290 * lib/abitset.c (abitset_bytes): Return a size that is aligned
11291 properly for vectors of objects. Do not assume that adding a
11292 header size to a multiple of a word size yields a value that is
11293 properly aligned for the whole union.
11294 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11295
11296 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
11297 unique names for structures.
11298 * lib/ebitset.c (ebitset_bytes): Likewise.
11299 * lib/lbitset.c (lbitset_bytes): Likewise.
11300
11301 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
11302 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
11303 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
11304 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
11305 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
11306 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
11307 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
11308 to improve the type-checking that GCC can do.
11309 * lib/bitset.c (bitset_op4_cmp): Likewise.
11310 * lib/bitset_stats.c (bitset_stats_count,
11311 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
11312 bitset_stats_copy, bitset_stats_disjoint_p,
11313 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
11314 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
11315 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
11316 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
11317 bitset_stats_and_or_cmp, bitset_stats_andn_or,
11318 bitset_stats_andn_or_cmp, bitset_stats_or_and,
11319 bitset_stats_or_and_cmp): Likewise.
11320 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
11321 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
11322 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
11323 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
11324
11325 * lib/abitset.h: Include bitset.h, not bbitset.h.
11326 * lib/ebitset.h: Likewise.
11327 * lib/lbitset.h: Likewise.
11328
11329 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
11330 All instances of parameters of type enum bitset_opts are now of
11331 type enum_bitset_opts, to conform to the C Standard, and similarly
11332 for enum_bitset_type.
11333 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11334 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11335
11336 Do not use "struct bitset_struct" to mean different things in
11337 different modules. Not only is this confusing, it violates
11338 the C Standard, which requires that structure types in different
11339 modules must be compatible if one is to be passed to the other.
11340 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
11341 All instances of "struct bitset_struct *" replaced with "bitset".
11342 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
11343 (union bitset_union, struct abitset_struct, struct ebitset_struct,
11344 struct lbitset_struct, struct bitset_stats_struct): New types.
11345 All uses of struct bitset_struct changed to union bitset_union,
11346 etc.
ba0fe3c7 11347 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
11348 struct bitset_struct): Remove.
11349 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
11350 struct bitset_struct): Remove.
11351 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
11352 bitset_struct): Remove.
11353 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
11354 Likewise.
11355
11356 Do not call a function of type T using a call that assumes the
11357 function is of a different type U. Standard C requires that a
11358 function must be called with a type that is compatible with its
11359 definition.
11360 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11361 New decls.
11362 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11363 New functions.
11364 * lib/ebitset.c (PFV): Remove.
11365 * lib/lbitset.c (PFV): Likewise.
11366 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
11367 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
11368 decls.
11369 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
11370 (ebitset_vtable): Use them.
11371 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
11372 lbitset_xor): New functions.
11373 (lbitset_vtable): Use them.
11374
11375 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
11376 Declare.
11377
11378 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
11379 GCC warning.
11380 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
11381 Use offsetof, for simplicity.
11382
6fbe4984
PE
113832002-10-06 Paul Eggert <eggert@twinsun.com>
11384
11385 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
11386 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 11387 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
11388 which was inadvertently undone by the 2002-09-30 patch.
11389 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
11390 the same width as int.
11391
420f93c8
PE
113922002-10-04 Paul Eggert <eggert@twinsun.com>
11393
11394 Version 1.50.
11395
11396 * configure.ac (AC_INIT), NEWS: Increment version number.
11397
11398 * doc/bison.texinfo: Minor spelling, grammar, and white space
11399 fixes.
11400 (Symbols): Mention that any negative value returned from yylex
11401 signifies end-of-input. Warn about negative chars. Mention
11402 the portable Standard C character set.
11403
11404 The GNU coding standard says CFLAGS and YFLAGS are reserved
11405 for the installer to set.
11406 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
11407 * src/Makefile.am (AM_CFLAGS): Likewise.
11408 (AM_YFLAGS): Renamed from YFLAGS.
11409
11410 Fix some MAX and MIN problems.
11411 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
11412 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
11413 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
11414 * src/reader.c (reader): Use it.
11415
11416 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
11417 POSIX 1003.1-2001 has removed fgrep.
11418
114192002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
11420
11421 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
11422 interpreted as signed.
11423 * lib/ebitset.c (ebitset_list): Fix bug.
11424
ff68026d
PE
114252002-10-01 Paul Eggert <eggert@twinsun.com>
11426
11427 More fixes for 64-bit hosts and large bitsets.
11428
11429 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
11430 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
11431 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
11432 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
11433 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
11434 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
11435 bitset_count_): Likewise.
11436 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
11437 bitset_first, bitset_last): Likewise.
11438 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
11439 bitset_stats_list_reverse, bitset_stats_size,
11440 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
11441 Likewise.
11442 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11443 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11444 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11445 bitsetv_reflexive_transitive_closure): Likewise.
11446 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
11447 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
11448 Likewise.
11449 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
11450 Likewise.
420f93c8 11451
ff68026d
PE
11452 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
11453 Use size_t, not unsigned int, to count bytes.
11454 * lib/abitset.h (abitset_bytes): Likewise.
11455 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
11456 Likewise.
11457 * lib/bitset.h (bitset_bytes): Likewise.
11458 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
11459 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
11460 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11461 * lib/ebitset.c (ebitset_bytes): Likewise.
11462 * lib/ebitset.h (ebitset_bytes): Likewise.
11463 * lib/lbitset.c (lbitset_bytes): Likewise.
11464 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 11465
ff68026d
PE
11466 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
11467 abitset_subset_p, abitset_disjoint_p, abitset_and,
11468 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
11469 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
11470 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
11471 abitset_or_and, abitset_or_and_cmp):
11472 Use bitset_windex instead of unsigned int.
11473 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
11474 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
11475 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
11476 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
11477 Likewise.
11478 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 11479
ff68026d
PE
11480 * lib/bitset.c (bitset_print):
11481 Use proper printf formats for widths of integer types.
11482 * lib/bitset_stats.c (bitset_percent_histogram_print,
11483 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
11484 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11485 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
11486 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 11487
ff68026d
PE
11488 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
11489 BITSET_SIZE_MAX): New macros.
11490 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
11491 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
11492 to BITSET_WINDEX_MAX.
11493
11494 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
11495 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
11496 since we now return the bitset_bindex type (not int).
11497
11498 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
11499 when computing sizes.
11500 * lib/ebitset.c (ebitset_elts_grow): Likewise.
11501
11502 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
11503 and avoid cast to unsigned.
11504
6aa452a6
AD
115052002-09-30 Akim Demaille <akim@epita.fr>
11506
11507 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11508 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
11509 Updates from Michael Hayes.
11510
927f7817
AD
115112002-09-30 Art Haas <ahaas@neosoft.com>
11512
11513 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
11514 invocations.
11515 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
11516 defined.
11517
9738f41e
AD
115182002-09-27 Akim Demaille <akim@epita.fr>
11519
11520 Version 1.49c.
11521
a5c75d7f
AD
115222002-09-27 Akim Demaille <akim@epita.fr>
11523
11524 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
11525 (Because of AC_LIBSOURCE).
11526
8280e179
AD
115272002-09-27 Akim Demaille <akim@epita.fr>
11528
11529 Playing with Autoscan.
11530
11531 * configure.ac: Remove the old LIBOBJ tweaks.
11532 (AC_REPLACE_FUNCS): Add strrchr and strtol.
11533 * lib/strrchr.c: New.
11534 * lib/strtol.c: New, from the Coreutils 4.5.1.
11535
ae64af35
AD
115362002-09-27 Akim Demaille <akim@epita.fr>
11537
11538 Playing with Autoscan.
11539
11540 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
11541 * lib/Makefile.am (libbison_a_SOURCES): No longer include
11542 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
11543 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
11544 Coreutils 4.5.1.
11545
d1a1114f
AD
115462002-09-24 Akim Demaille <akim@epita.fr>
11547
11548 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
11549 (Frequently Asked Questions, Parser Stack Overflow): New.
11550
b906441c
AD
115512002-09-13 Akim Demaille <akim@epita.fr>
11552
11553 Playing with autoscan.
11554
11555 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
11556 * src/files.c (skeleton_find): Remove, unused.
11557 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
11558 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
11559
bd701811
AD
115602002-09-13 Akim Demaille <akim@epita.fr>
11561
11562 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
11563 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
11564
e0a13e7b
AD
115652002-09-13 Akim Demaille <akim@epita.fr>
11566
11567 * configure.ac: Require 2.54.
11568 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
11569 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
11570 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
11571 Remove, provided by Autoconf macros.
11572
c97011bf
AD
115732002-09-12 Akim Demaille <akim@epita.fr>
11574
11575 * m4/prereq.m4: Update, from Coreutils 4.5.1.
11576
d862b1be
AD
115772002-09-12 Akim Demaille <akim@epita.fr>
11578
11579 * m4/prereq.m4: Update, from Fileutils 4.1.5.
11580 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
11581 Reported by Martin Mokrejs.
11582
3d38c03a
AD
115832002-09-10 Akim Demaille <akim@epita.fr>
11584
11585 * src/parse-gram.y: Associate a human readable string to each
11586 token type.
11587 * tests/regression.at (Invalid inputs): Adjust.
11588
b6347355
AD
115892002-09-10 Gary V. Vaughan <gary@gnu.org>
11590
11591 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
11592 with an Autoconf-2.5x style configure.ac.
11593
09ba4ab2
PE
115942002-09-06 Paul Eggert <eggert@twinsun.com>
11595
11596 * doc/bison.texinfo (Conditions): Make explicit that the GPL
11597 exception applies only to yacc.c. This is a modification of a
11598 patch originally suggested by Akim Demaille.
11599
21846f69
AD
116002002-09-06 Akim Demaille <akim@epita.fr>
11601
09ba4ab2
PE
11602 * data/c.m4 (b4_copyright): Move the GPL exception comment from
11603 here to...
11604 * data/yacc.c: here.
11605
21846f69
AD
11606 * data/lalr1.cc (struct yyltype): Don't define it, since we use
11607 LocationType.
11608 (b4_ltype): Default to yy::Location from location.hh.
11609
c0ad8bf3
AD
116102002-09-04 Jim Meyering <jim@meyering.net>
11611
11612 * data/yacc.c: Guard the declaration of yytoknum also with
11613 `#ifdef YYPRINT', so it is declared only when used.
11614
3a93251e
AD
116152002-09-04 Akim Demaille <akim@epita.fr>
11616
11617 * configure.in: Rename as...
11618 * configure.ac: this.
11619 Bump to 1.49c.
11620
427c0dda
AD
116212002-09-04 Akim Demaille <akim@epita.fr>
11622
11623 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
11624 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
11625 translate maintainer only messages.
11626
6a254321
PE
116272002-08-12 Paul Eggert <eggert@twinsun.com>
11628
645e30d1
PE
11629 Version 1.49b.
11630
6a254321
PE
11631 * Makefile.am (SUBDIRS): Remove intl.
11632 (DISTCLEANFILES): Remove.
11633 * NEWS: Mention that GNU M4 is now required. Clarify what is
11634 meant by "larger grammars". Mention the pt_BR translation.
11635 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
11636 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
11637 Bump version from 0.11.2 to 0.11.5.
11638 (BISON_PREREQ_STAGE): Remove.
11639 (AM_GNU_GETTEXT): Use external gettext.
11640 (AC_OUTPUT): Remove intl/Makefile.
11641
11642 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
11643
11644 * data/glr.c: Include string.h, for strlen.
11645 (yyreportParseError): Use size_t for yysize.
11646 (yy_yypstack): No longer nested inside yypstates, as nested
11647 functions are not portable. Do not assume size_t is the
11648 same width as int.
11649 (yypstates): Do not assume that ptrdiff_t is the same width
11650 as int, and similarly for yyposn and YYINDEX.
11651
11652 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
11653
11654 * lib/Makefile.am (INCLUDES): Do not include from the intl
11655 directory, which has been removed.
11656 * src/Makefile.am (INCLUDES): Likewise.
11657
11658 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
11659 (bitsets_sources, additional_bitsets_sources, timevars_sources):
11660 New vars.
11661
11662 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
11663 * tests/Makefile.am (EXTRA_DIST): Likewise.
11664
11665 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
11666 Do not assume that bitset_windex is the same width as unsigned.
11667
11668 * lib/abitset.c (abitset_unused_clear): Do not assume that
11669 bitset_word is the same width as int.
11670 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
11671 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
11672 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
11673 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
11674 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
11675
11676 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
11677 portability to one's complement hosts!).
11678 * lib/ebitset.c (ebitset_op1): Likewise.
11679 * lib/lbitset.c (lbitset_op1): Likewise.
11680
11681 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
11682 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11683 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
11684 Sync with fileutils.
11685 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
11686 lib/gettext.h: Sync with diffutils.
11687
11688 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
11689 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
11690
11691 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
11692 PROTOTYPES to check for prototypes, and "defined __STDC__" to
11693 check for void *.
11694
11695 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
11696 size_t; the old version tried to do this but casted improperly.
11697 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
11698 (bitset_test): Now returns int, not unsigned long.
11699
11700 * lib/bitset_stats.c: Include "gettext.h".
11701 (_): New macro.
11702 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
11703 name locals "index", as it generates unnecessary warnings on some
11704 hosts that have an "index" function.
11705
11706 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
11707 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
11708 they need translation.
11709 * src/LR0.c (state_list_append, new_itemsets, get_state,
11710 append_states, generate_states): Likewise.
11711 * src/assoc.c (assoc_to_string): Likewise.
11712 * src/closure.c (print_closure, set_firsts, closure): Likewise.
11713 * src/gram.c (grammar_dump): Likewise.
11714 * src/injections.c (injections_compute): Likewise.
11715 * src/lalr.c (lookaheads_print): Likewise.
11716 * src/relation.c (relation_transpose): Likewise.
11717 * src/scan-gram.l: Likewise.
11718 * src/tables.c (table_grow, pack_vector): Likewise.
11719
11720 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
11721 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
11722 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
11723 * m4/mbstate_t.m4: Sync with fileutils.
11724 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
11725
11726 * po/LINGUAS: Add pt_BR.
11727 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
11728 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
11729 lib/timevar.c.
11730 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
11731 manual recommends.
11732 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
11733
11734 * src/complain.c (strerror_r): Remove decl; not needed.
11735 (strerror): Use same pattern as ../lib/error.c.
11736
11737 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
11738
11739 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
11740
11741 * src/main.c (main): Cast result of bindtextdomain and textdomain
11742 to void, to avoid a GCC warning when --disable-nls is in effect.
11743
11744 * src/scan-gram.l: Use strings rather than escapes when possible,
11745 to minimize the number of warnings from xgettext.
11746 (handle_action_dollar, handle_action_at): Don't use isdigit,
11747 as it mishandles negative chars and it may not work as expected
11748 outside the C locale.
11749
11750 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
11751 this is a GCC extension and is not portable to other compilers.
11752
11753 * src/system.h (alloca): Use same pattern as ../lib/error.c.
11754 Do not include <ctype.h>; no longer needed.
11755 Do not include <malloc.h>; no longer needed (and generates
11756 warnings on OpenBSD 3.0).
11757
11758 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
11759 it's not portable.
11760
11761 * tests/regression.at: Do not use 'cc -c input.c -o input';
11762 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
11763
11764 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
11765 exit status as failure, not just exit status 1. Sun C exits
11766 with status 2 sometimes.
11767
11768 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
11769 Use it for the two large tests.
11770
c8f002c7
AD
117712002-08-02 Akim Demaille <akim@epita.fr>
11772
11773 * src/conflicts.c (conflicts_output): Don't output rules never
11774 reduced here, since anyway that computation doesn't work.
11775 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
11776 (rule_useless_p, rule_never_reduced_p): New.
11777 (grammar_rules_partial_print): Use a filter instead of a range.
11778 Display the title only if needed.
11779 (grammar_rules_print): Adjust.
11780 (grammar_rules_never_reduced_report): New.
11781 * src/tables.c (action_row): Move the computation of rules never
11782 reduced to...
11783 (token_actions): here.
11784 * src/main.c (main): Make the parser before making the report, so
11785 that rules never reduced are computed.
11786 Call grammar_rules_never_reduced_report.
11787 * src/print.c (print_results): Report rules never reduced.
11788 * tests/conflicts.at, tests/reduce.at: Adjust.
11789
cd08e51e
AD
117902002-08-01 Akim Demaille <akim@epita.fr>
11791
11792 Instead of attaching lookaheads and duplicating the rules being
11793 reduced by a state, attach the lookaheads to the reductions.
11794
11795 * src/state.h (state_t): Remove the `lookaheads',
11796 `lookaheads_rule' member.
11797 (reductions_t): Add a `lookaheads' member.
11798 Use a regular array for the `rules'.
11799 * src/state.c (reductions_new): Initialize the lookaheads member
11800 to 0.
11801 (state_rule_lookaheads_print): Adjust.
11802 * src/state.h, src/state.c (state_reductions_find): New.
11803 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
11804 (count_rr_conflicts): Adjust.
11805 * src/lalr.c (LArule): Remove.
11806 (add_lookback_edge): Adjust.
11807 (state_lookaheads_count): New.
11808 (states_lookaheads_initialize): Merge into...
11809 (initialize_LA): this.
11810 (lalr_free): Adjust.
11811 * src/main.c (main): Don't free nullable and derives too early: it
11812 is used by --verbose.
11813 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
11814
bb0027a9
AD
118152002-08-01 Akim Demaille <akim@epita.fr>
11816
11817 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
11818 `rule_number_t**'.
11819 (set_derives, free_derives): Rename as...
11820 (derives_compute, derives_free): this.
11821 Adjust all dependencies.
11822 * src/nullable.c (set_nullable, free_nullable): Rename as...
11823 (nullable_compute, nullable_free): these.
11824 (rule_list_t): Store rule_t *, not rule_number_t.
11825 * src/state.c (state_rule_lookaheads_print): Directly compare rule
11826 pointers, instead of their numbers.
11827 * src/main.c (main): Call nullable_free, and derives_free earlier,
11828 as they were lo longer used.
11829
3325ddc4
AD
118302002-08-01 Akim Demaille <akim@epita.fr>
11831
11832 * lib/timevar.c (get_time): Include children time.
11833 * src/lalr.h (LA, LArule): Don't export them: used with the
11834 state_t.
11835 * src/lalr.c (LA, LArule): Static.
11836 * src/lalr.h, src/lalr.c (lalr_free): New.
11837 * src/main.c (main): Call it.
11838 * src/tables.c (pack_vector): Check whether loc is >= to the
11839 table_size, not >.
11840 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
11841 (tables_generate): do it, since that's also it which allocates
11842 them.
11843 Don't free LA and LArule, main does.
11844
c6f1a33c
AD
118452002-07-31 Akim Demaille <akim@epita.fr>
11846
11847 Separate parser tables computation and output.
11848
11849 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
11850 (conflict_list, conflict_list_cnt, table, check, table_ninf)
11851 (yydefgoto, yydefact, high): Move to...
11852 * src/tables.h, src/tables.c: here.
11853 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
11854 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
11855 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
11856 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
11857 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
11858 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
11859 (action_row, save_row, token_actions, save_column, default_goto)
11860 (goto_actions, sort_actions, matching_state, pack_vector)
11861 (table_ninf_remap, pack_table, prepare_actions): Move to...
11862 * src/tables.c: here.
11863 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
11864 * src/output.c (token_actions, output_base, output_conflicts)
11865 (output_check): Merge into...
11866 (prepare_actions): this.
11867 (actions_output): Rename as...
11868 (user_actions_output): this.
11869 * src/main.c (main): Call tables_generate and tables_free.
11870
1509d42f
AD
118712002-07-31 Akim Demaille <akim@epita.fr>
11872
11873 Steal GCC's --time-report support.
11874
11875 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
11876 stolen/adjusted from GCC.
11877 * m4/stage.m4: Remove time related checks.
11878 * m4/timevar.m4: New.
11879 * configure.in: Adjust.
11880 * src/system.h: Adjust to using timevar.h.
11881 * src/getargs.h, src/getargs.c: Support trace_time for
11882 --trace=time.
11883 * src/main.c (stage): Remove.
11884 (main): Replace `stage' invocations with timevar calls.
11885 * src/output.c: Insert pertinent timevar calls.
11886
273a74fa
AD
118872002-07-31 Akim Demaille <akim@epita.fr>
11888
11889 Let --trace have arguments.
11890
11891 * src/getargs.h (enum trace_e): New.
11892 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
11893 (long_options, short_options): --trace/-T takes an optional
11894 argument.
11895 Change all the uses of trace_flag to reflect the new flags.
11896 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
11897
11898 Strengthen `stage' portability.
11899
11900 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
11901 * configure.in: Use it.
11902 Don't check for malloc.h and sys/times.h.
11903 * src/system.h: Include them when appropriate.
11904 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
11905 times and struct tms are available.
11906
217598da
AD
119072002-07-30 Akim Demaille <akim@epita.fr>
11908
11909 In verbose parse error message, don't report `error' as an
11910 expected token.
11911 * tests/actions.at (Printers and Destructors): Adjust.
11912 * tests/calc.at (Calculator $1): Adjust.
11913 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
11914 error message, do not report the parser accepts the error token in
11915 that state.
11916
52489d44
AD
119172002-07-30 Akim Demaille <akim@epita.fr>
11918
11919 Normalize conflict related messages.
11920
11921 * src/complain.h, src/complain.c (warn, complain): New.
11922 * src/conflicts.c (conflicts_print): Use them.
11923 (conflict_report_yacc): New, extracted from...
11924 (conflicts_print): here.
11925 * tests/conflicts.at, tests/existing.at: Adjust.
11926
e8832397
AD
119272002-07-30 Akim Demaille <akim@epita.fr>
11928
11929 Report rules which are never reduced by the parser: those hidden
11930 by conflicts.
11931
11932 * src/LR0.c (save_reductions): Don't make the final state too
11933 different: save its reduction (accept) instead of having a state
11934 without any action (no shift or goto, no reduce).
11935 Note: the final state is now a ``regular'' state, i.e., the
11936 parsers now contain `reduce 0' as default reduction.
11937 Nevertheless, since they decide to `accept' when yystate =
11938 final_state, they still will not reduce rule 0.
11939 * src/print.c (print_actions, print_reduction): Adjust.
11940 * src/output.c (action_row): Track reduced rules.
11941 (token_actions): Report rules never reduced.
11942 * tests/conflicts.at, tests/regression.at: Adjust.
11943
caf23d24
AD
119442002-07-30 Akim Demaille <akim@epita.fr>
11945
11946 `stage' was accidently included in a previous patch.
11947 Initiate its autoconfiscation.
11948
11949 * configure.in: Look for malloc.h and sys/times.h.
11950 * src/main.c (stage): Adjust.
11951 Report only when trace_flag.
11952
640748ee
AD
119532002-07-29 Akim Demaille <akim@epita.fr>
11954
11955 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
11956 state_number_t.
11957 (errs_t): symbol_t*, not symbol_number_t.
11958 (reductions_t): rule_t*, not rule_number_t.
11959 (FOR_EACH_SHIFT): New.
11960 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
11961 * src/print.c, src/print_graph.c: Adjust.
11962
88bce5a2
AD
119632002-07-29 Akim Demaille <akim@epita.fr>
11964
11965 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
11966
11967 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
11968 (endtoken, accept): these.
11969 * src/reader.c (reader): Set endtoken's default tag to "$end".
11970 Set undeftoken's tag to "$undefined" instead of "$undefined.".
11971 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
11972 Adjust.
11973
1bfb97db
AD
119742002-07-29 Akim Demaille <akim@epita.fr>
11975
11976 * src/reduce.c (reduce_grammar): When the language is empty,
11977 complain about the start symbol, not the axiom.
11978 Use its location.
11979 * tests/reduce.at (Empty Language): New.
11980
fc5734fe
AD
119812002-07-26 Akim Demaille <akim@epita.fr>
11982
11983 * src/reader.h, src/reader.c (gram_error): ... can't get
11984 yycontrol without making too strong assumptions on the parser
11985 itself.
11986 * src/output.c (prepare_tokens): Use the real 0th value of
11987 token_translations instead of `0'.
11988 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
11989 visible here.
11990 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
11991 for the time being: %locations ought to provide it to yyerror.
11992
3650b4b8
AD
119932002-07-25 Akim Demaille <akim@epita.fr>
11994
11995 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
11996 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
11997 * tests/regression.at (Web2c Actions): Adjust.
11998
4b3d3a8e
AD
119992002-07-25 Akim Demaille <akim@epita.fr>
12000
12001 Stop storing rules from 1 to nrules + 1.
12002
12003 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
12004 * src/nullable.c, src/output.c, src/print.c, src/reader.c
12005 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
12006 Iterate from 0 to nrules.
12007 Use rule_number_as_item_number and item_number_as_rule_number.
12008 Adjust to `derive' now containing possibly 0.
12009 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
12010 Handle the `- 1' part in rule numbers from/to item numbers.
12011 * src/conflicts.c (log_resolution): Fix the message which reversed
12012 shift and reduce.
12013 * src/output.c (action_row): Initialize default_rule to -1.
12014 (token_actions): Adjust.
12015 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
12016 expected output.
12017 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
12018
4a2a22f4
AD
120192002-07-25 Akim Demaille <akim@epita.fr>
12020
12021 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
12022 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
12023 (b4_c_knr_arg_decl): New.
12024 * data/yacc.c: Use it to define yysymprint, yydestruct, and
12025 yyreport_parse_error.
12026
b8df3223
AD
120272002-07-25 Akim Demaille <akim@epita.fr>
12028
12029 * data/yacc.c (yyreport_parse_error): New, extracted from...
12030 (yyparse): here.
12031 (yydestruct, yysymprint): Move above yyparse.
12032 Be K&R compliant.
12033
a762e609
AD
120342002-07-25 Akim Demaille <akim@epita.fr>
12035
12036 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
12037 replace...
12038 (b4_sint_type, b4_uint_type): these.
12039 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
12040 * tests/regression.at (Web2c Actions): Adjust.
12041
12b0043a
AD
120422002-07-25 Akim Demaille <akim@epita.fr>
12043
12044 * src/gram.h (TIEM_NUMBER_MAX): New.
12045 (item_number_of_rule_number, rule_number_of_item_number): Rename
12046 as...
12047 (rule_number_as_item_number, item_number_as_rule_number): these.
12048 Adjust dependencies.
12049 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12050 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12051 (symbol_number_to_vector_number): New.
12052 (order): Of vector_number_t* type.
12053 (base_t, BASE_MAX, BASE_MIN): New.
12054 (froms, tos, width, pos, check): Of base_t type.
12055 (action_number_t, ACTION_MIN, ACTION_MAX): New.
12056 (actrow): Of action_number_t type.
12057 (conflrow): Of unsigned int type.
12058 (table_ninf, base_ninf): New.
12059 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
12060 (muscle_insert_int_table, muscle_insert_base_table)
12061 (muscle_insert_rule_number_table): New.
12062 (prepare_tokens): Output `toknum' as int_table.
12063 (action_row): Returns a rule_number_t.
12064 Use ACTION_MIN, not SHRT_MIN.
12065 (token_actions): yydefact is rule_number_t*.
12066 (table_ninf_remap): New.
12067 (pack_table): Use it for `base' and `table'.
12068 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
12069 replaced with...
12070 (YYPACT_NINF, YYTABLE_NINF): these.
12071 (yypact, yytable): Compute their types instead of hard-coded
12072 `short'.
12073 * tests/regression.at (Web2c Actions): Adjust.
12074
5dde258a
AD
120752002-07-19 Akim Demaille <akim@epita.fr>
12076
12077 * src/scan-gram.l (id): Can start with an underscore.
12078
a945ec39
AD
120792002-07-16 Akim Demaille <akim@epita.fr>
12080
12081 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
12082 Adjust all former `associativity' dependencies.
12083 * src/symtab.c (symbol_new): Default associativity is `undef', not
12084 `right'.
12085 (symbol_check_alias_consistence): Adjust.
12086
fae437e8
AD
120872002-07-09 Akim Demaille <akim@epita.fr>
12088
12089 * doc/bison.texinfo: Properly set the ``header'' part.
12090 Use @dircategory ``GNU programming tools'' as per Texinfo's
12091 documentation.
12092 Use @copying.
12093
1a715ef2
AD
120942002-07-09 Akim Demaille <akim@epita.fr>
12095
12096 * lib/quotearg.h: Protect against multiple inclusions.
12097 * src/location.h (location_t): Add a `file' member.
12098 (LOCATION_RESET, LOCATION_PRINT): Adjust.
12099 * src/complain.c (warn_at, complain_at, fatal_at): Drop
12100 `error_one_per_line' support.
12101
a5d50994
AD
121022002-07-09 Akim Demaille <akim@epita.fr>
12103
12104 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
12105 * src/reader.c (lineno): Remove.
12106 Adjust all dependencies.
12107 (get_merge_function): Take a location and use complain_at.
12108 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
12109 * tests/regression.at (Invalid inputs, Mixing %token styles):
12110 Adjust.
12111
b275314e
AD
121122002-07-09 Akim Demaille <akim@epita.fr>
12113
12114 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
12115 recovery rule, and forbid extensions when --yacc.
12116 (gram_error): Use complain_at.
12117 * src/reader.c (reader): Exit if there were parse errors.
12118
865b9df1
AD
121192002-07-09 Akim Demaille <akim@epita.fr>
12120
12121 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
12122 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
12123 Reported by R Blake <blakers@mac.com>.
12124
c76e14da
AD
121252002-07-09 Akim Demaille <akim@epita.fr>
12126
12127 * data/yacc.c: Output the copyright notive in the header.
12128
7db2ed2d
AD
121292002-07-03 Akim Demaille <akim@epita.fr>
12130
12131 * src/output.c (froms, tos): Are state_number_t.
12132 (save_column): sp, sp1, and sp2 are state_number_t.
12133 (prepare): Rename `final' as `final_state_number', `nnts' as
12134 `nterms_number', `nrules' as `rules_number', `nstates' as
12135 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
12136 unused.
12137 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
12138 * data/lalr1.cc (nsym_): Remove, unused.
12139
e68e0410
AD
121402002-07-03 Akim Demaille <akim@epita.fr>
12141
12142 * src/lalr.h, src/lalr.c (goto_number_t): New.
12143 * src/lalr.c (goto_list_t): New.
12144 Propagate them.
12145 * src/nullable.c (rule_list_t): New.
12146 Propagate.
12147 * src/types.h: Remove.
12148
e1a4f3a4
AD
121492002-07-03 Akim Demaille <akim@epita.fr>
12150
12151 * src/closure.c (print_fderives): Use rule_rhs_print.
12152 * src/derives.c (print_derives): Use rule_rhs_print.
12153 (rule_list_t): New, replaces `shorts'.
12154 (set_derives): Add comments.
12155 * tests/sets.at (Nullable, Firsts): Adjust.
12156
536545f3
AD
121572002-07-03 Akim Demaille <akim@epita.fr>
12158
12159 * src/output.c (prepare_actions): Free `tally' and `width'.
12160 (prepare_actions): Allocate and free `order'.
12161 * src/symtab.c (symbols_free): Free `symbols'.
12162 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
12163 * src/output.c (m4_invoke): Move to...
12164 * src/scan-skel.l: here.
12165 (<<EOF>>): Close yyout, and free its name.
12166
8b752b00
AD
121672002-07-03 Akim Demaille <akim@epita.fr>
12168
12169 Fix some memory leaks, and fix a bug: state 0 was examined twice.
12170
12171 * src/LR0.c (new_state): Merge into...
12172 (state_list_append): this.
12173 (new_states): Merge into...
12174 (generate_states): here.
12175 (set_states): Don't ensure a proper `errs' state member here, do it...
12176 * src/conflicts.c (conflicts_solve): here.
12177 * src/state.h, src/state.c: Comment changes.
12178 (state_t): Rename member `shifts' as `transitions'.
12179 Adjust all dependencies.
12180 (errs_new): For consistency, also take the values as argument.
12181 (errs_dup): Remove.
12182 (state_errs_set): New.
12183 (state_reductions_set, state_transitions_set): Assert that no
12184 previous value was assigned.
12185 (state_free): New.
12186 (states_free): Use it.
12187 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
12188 temporary storage: use `errs' and `nerrs' as elsewhere.
12189 (set_conflicts): Allocate and free this `errs'.
12190
613f5e1a
AD
121912002-07-02 Akim Demaille <akim@epita.fr>
12192
12193 * lib/libiberty.h: New.
12194 * lib: Update the bitset implementation from upstream.
12195 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
12196 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
12197 * src/main.c: Adjust bitset stats calls.
12198
26e0cadc
PE
121992002-07-01 Paul Eggert <eggert@twinsun.com>
12200
12201 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
12202 char, so that negative chars don't collide with $.
12203
1154cced
AD
122042002-06-30 Akim Demaille <akim@epita.fr>
12205
12206 Have the GLR tests be `warning' checked, and fix the warnings.
12207
12208 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
12209 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
12210 (yyremoveDeletes): `yyi' and `yyj' are size_t.
12211 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
12212 (yyaddDeferredAction): static.
12213 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
12214 (yyreportParseError): yyprefix is const.
12215 yytokenp is used only when verbose.
12216 (yy__GNUC__): Replace with __GNUC__.
12217 (yypdumpstack): yyi is size_t.
12218 (yypreference): Un-yy local variables and arguments, to avoid
12219 clashes with `yyr1'. Anyway, we are not in the user name space.
12220 (yytname_size): be an int, as is compared with ints.
12221 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
12222 Use them.
12223 * tests/cxx-gram.at: Use quotation to protect $1.
12224 Use AT_COMPILE to enable warnings hunts.
12225 Prototype yylex and yyerror.
12226 `Use' argc.
12227 Include `string.h', not `strings.h'.
12228 Produce and prototype stmtMerge only when used.
12229 yylex takes a location.
12230
97650f4e
AD
122312002-06-30 Akim Demaille <akim@epita.fr>
12232
12233 We spend a lot of time in quotearg, in particular when --verbose.
12234
12235 * src/symtab.c (symbol_get): Store a quoted version of the key.
12236 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
12237 Adjust all callers.
12238
d2576365
AD
122392002-06-30 Akim Demaille <akim@epita.fr>
12240
12241 * src/state.h (reductions_t): Rename member `nreds' as num.
12242 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
12243 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
12244
ccaf65bc
AD
122452002-06-30 Akim Demaille <akim@epita.fr>
12246
12247 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
12248 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
12249 (shifts_to): Rename as...
12250 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
12251 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
12252 (TRANSITION_IS_DISABLED, transitions_to): these.
12253
87675353
AD
122542002-06-30 Akim Demaille <akim@epita.fr>
12255
12256 * src/print.c (print_shifts, print_gotos): Merge into...
12257 (print_transitions): this.
12258 (print_transitions, print_errs, print_reductions): Align the
12259 lookaheads columns.
12260 (print_core, print_transitions, print_errs, print_state,
12261 print_grammar): Output empty lines separator before, not after.
12262 (state_default_rule_compute): Rename as...
12263 (state_default_rule): this.
12264 * tests/conflicts.at (Defaulted Conflicted Reduction),
12265 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
12266 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
12267
ce4ccb4b
AD
122682002-06-30 Akim Demaille <akim@epita.fr>
12269
12270 Display items as we display rules.
12271
12272 * src/gram.h, src/gram.c (rule_lhs_print): New.
12273 * src/gram.c (grammar_rules_partial_print): Use it.
12274 * src/print.c (print_core): Likewise.
12275 * tests/conflicts.at (Defaulted Conflicted Reduction),
12276 (Unresolved SR Conflicts): Adjust.
12277 (Unresolved SR Conflicts): Adjust and rename as...
12278 (Resolved SR Conflicts): this, as was meant.
12279 * tests/regression.at (Web2c Report): Adjust.
12280
bc933ef1
AD
122812002-06-30 Akim Demaille <akim@epita.fr>
12282
12283 * src/print.c (state_default_rule_compute): New, extracted from...
12284 (print_reductions): here.
12285 Pessimize, but clarify the code.
12286 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
12287
53d4308d
AD
122882002-06-30 Akim Demaille <akim@epita.fr>
12289
12290 * src/output.c (action_row): Let default_rule be always a rule
12291 number.
12292
574fb2d5
AD
122932002-06-30 Akim Demaille <akim@epita.fr>
12294
12295 * src/closure.c (print_firsts, print_fderives, closure):
12296 Use BITSET_EXECUTE.
12297 * src/lalr.c (lookaheads_print): Likewise.
12298 * src/state.c (state_rule_lookaheads_print): Likewise.
12299 * src/print_graph.c (print_core): Likewise.
12300 * src/print.c (print_reductions): Likewise.
12301 * src/output.c (action_row): Likewise.
12302 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
12303
05811fd7
AD
123042002-06-30 Akim Demaille <akim@epita.fr>
12305
12306 * src/print_graph.c: Use report_flag.
12307
0e4d5753
AD
123082002-06-30 Akim Demaille <akim@epita.fr>
12309
12310 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
12311 to...
12312 * src/relation.h, src/relation.c (traverse, relation_digraph)
12313 (relation_print, relation_transpose): New.
12314
24c7d800
AD
123152002-06-30 Akim Demaille <akim@epita.fr>
12316
12317 * src/state.h, src/state.c (shifts_to): New.
12318 * src/lalr.c (build_relations): Use it.
12319
9222837b
AD
123202002-06-30 Akim Demaille <akim@epita.fr>
12321
12322 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
12323 (item_number_of_rule_number, rule_number_of_item_number): New.
12324 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
12325 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
12326 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
12327 Propagate their use.
12328 Much remains to be done, in particular wrt `shorts' from types.h.
12329
260008e5
AD
123302002-06-30 Akim Demaille <akim@epita.fr>
12331
12332 * src/symtab.c (symbol_new): Initialize the `printer' member.
12333
8a731ca8
AD
123342002-06-30 Akim Demaille <akim@epita.fr>
12335
12336 * src/LR0.c (save_reductions): Remove, replaced by...
12337 * src/state.h, src/state.c (state_reductions_set): New.
12338 (reductions, errs): Rename as...
12339 (reductions_t, errs_t): these.
12340 Adjust all dependencies.
12341
32e1e0a4
AD
123422002-06-30 Akim Demaille <akim@epita.fr>
12343
12344 * src/LR0.c (state_list_t, state_list_append): New.
12345 (first_state, last_state): Now symbol_list_t.
12346 (this_state): Remove.
12347 (new_itemsets, append_states, save_reductions): Take a state_t as
12348 argument.
12349 (set_states, generate_states): Adjust.
12350 (save_shifts): Remove, replaced by...
12351 * src/state.h, src/state.c (state_shifts_set): New.
12352 (shifts): Rename as...
12353 (shifts_t): this.
12354 Adjust all dependencies.
12355 * src/state.h (state_t): Remove the `next' member.
12356
e5fb6710
AD
123572002-06-30 Akim Demaille <akim@epita.fr>
12358
12359 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
12360 escaped in slot 0.
12361
c7ca99d4
AD
123622002-06-30 Akim Demaille <akim@epita.fr>
12363
12364 Use hash.h for the state hash table.
12365
12366 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
12367 (allocate_storage): Use state_hash_new.
12368 (free_storage): Use state_hash_free.
12369 (new_state, get_state): Adjust.
12370 * src/lalr.h, src/lalr.c (states): Move to...
12371 * src/states.h (state_t): Remove the `link' member, no longer
12372 used.
12373 * src/states.h, src/states.c: here.
12374 (state_hash_new, state_hash_free, state_hash_lookup)
12375 (state_hash_insert, states_free): New.
12376 * src/states.c (state_table, state_compare, state_hash): New.
12377 * src/output.c (output_actions): Do not free states now, since we
12378 still need to know the final_state number in `prepare', called
12379 afterwards. Do it...
12380 * src/main.c (main): here: call states_free after `output'.
12381
df0e7316
AD
123822002-06-30 Akim Demaille <akim@epita.fr>
12383
12384 * src/state.h, src/state.c (state_new): New, extracted from...
12385 * src/LR0.c (new_state): here.
12386 * src/state.h (STATE_ALLOC): Move to...
12387 * src/state.c: here.
12388 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
12389 * src/state.h, src/state.c: here.
12390
39f41916
AD
123912002-06-30 Akim Demaille <akim@epita.fr>
12392
12393 * src/reader.c (gensym): Rename as...
12394 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
12395 (getsym): Rename as...
12396 (symbol_get): this.
12397
d57650a5
AD
123982002-06-30 Akim Demaille <akim@epita.fr>
12399
12400 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
12401 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
12402 * src/output.c, src/print.c, src/print_graph.c: Propagate.
12403 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
12404
5a08f1ce
AD
124052002-06-30 Akim Demaille <akim@epita.fr>
12406
12407 Make the test suite pass with warnings checked.
12408
12409 * tests/actions.at (Printers and Destructors): Improve.
12410 Avoid unsigned vs. signed issues.
12411 * tests/calc.at: Don't exercise the scanner here, do it...
12412 * tests/input.at (Torturing the Scanner): here.
12413
720623af
PH
124142002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12415
88e7e941 12416 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
12417 reorganize first lines parallel to yacc.c.
12418
fb8135fa
AD
124192002-06-28 Akim Demaille <akim@epita.fr>
12420
12421 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
12422 (b4_token_enum, b4_token_defines): New, factored from...
12423 * data/lalr1.cc, data/yacc.c, glr.c: here.
12424
41442480
AD
124252002-06-28 Akim Demaille <akim@epita.fr>
12426
12427 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
12428 unused variables.
12429 * src/output.c (merger_output): static.
12430
e0e5bf84
AD
124312002-06-28 Akim Demaille <akim@epita.fr>
12432
ba0fe3c7 12433 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
12434 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
12435 pacify GCC.
12436 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 12437
676385e2
PH
124382002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12439
12440 Accumulated changelog for new GLR parsing features.
12441
6a254321 12442 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
12443 conflicts_total_count.
12444 * src/conflicts.h: Ditto.
12445 * src/output.c (token_actions): Use the new name.
12446 (output_conflicts): Change conflp => conflict_list_heads, and
12447 confl => conflict_list for better readability.
12448 * data/glr.c: Use the new names.
12449 * NEWS: Add self to GLR announcement.
e0e5bf84 12450
676385e2
PH
12451 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
12452
12453 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
12454 Akim Demaille.
12455
12456 * data/bison.glr: Change name to glr.c
12457 * data/glr.c: Renamed from bison.glr.
12458 * data/Makefile.am: Add glr.c
e0e5bf84
AD
12459
12460 * src/getargs.c:
12461
676385e2 12462 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 12463 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 12464
676385e2
PH
12465 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12466
12467 * data/bison.glr: Be sure to restore the
12468 current #line when returning to the skeleton contents after having
12469 exposed the input file's #line.
12470
12471 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12472
12473 * data/bison.glr: Bring up to date with changes to bison.simple.
12474
12475 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12476
12477 * data/bison.glr: Correct definitions that use b4_prefix.
12478 Various reformatting.
12479 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
12480 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
12481 yytokenp argument; now part of stack.
12482 (yychar): Define to behave as documented.
12483 (yyclearin): Ditto.
e0e5bf84 12484
676385e2
PH
12485 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12486
12487 * src/reader.h: Add declaration for free_merger_functions.
12488
12489 * src/reader.c (merge_functions): New variable.
12490 (get_merge_function): New function.
12491 (free_merger_functions): New function.
12492 (readgram): Check for %prec that is not followed by a symbol.
12493 Handle %dprec and %merge declarations.
12494 (packgram): Initialize dprec and merger fields in rules array.
12495
12496 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
12497 conflict_list_cnt, conflict_list_free): New variables.
12498 (table_grow): Also grow conflict_table.
e0e5bf84 12499 (prepare_rules): Output dprec and merger tables.
676385e2 12500 (conflict_row): New function.
e0e5bf84 12501 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
12502 default reduction in conflicted states for GLR parser so that there
12503 are spaces for the conflict lists.
12504 (save_row): Also save conflict information.
12505 (token_actions): Allocate conflict list.
12506 (merger_output): New function.
12507 (pack_vector): Pack conflict table, too.
12508 (output_conflicts): New function to output yyconflp and yyconfl.
12509 (output_check): Allocate conflict_tos.
12510 (output_actions): Output conflict tables, also.
12511 (output_skeleton): Output b4_mergers definition.
12512 (prepare): Output b4_max_rhs_length definition.
12513 Use 'bison.glr' as default skeleton for GLR parsers.
12514
12515 * src/gram.c (glr_parser): New flag.
12516 (grammar_free): Call free_merger_functions.
12517
12518 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
12519 all pairs of conflicting reductions, rather than just all tokens
12520 causing conflicts. Needed to size conflict tables.
e0e5bf84 12521 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
12522 interface.
12523 (conflicts_print): Ditto.
12524 (count_total_conflicts): New function.
12525
12526 * src/reader.h (merger_list): New type.
12527 (merge_functions): New variable.
12528
12529 * src/lex.h (tok_dprec, tok_merge): New token types.
12530
12531 * src/gram.h (rule_s): Add dprec and merger fields.
12532 (glr_parser): New flag.
12533
12534 * src/conflicts.h (count_total_conflicts): New function.
12535
12536 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
12537
12538 * doc/bison.texinfo (Generalized LR Parsing): New section.
12539 (GLR Parsers): New section.
12540 (Language and Grammar): Mention GLR parsing.
12541 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
12542 Correct typo ("tge" -> "the").
12543
12544 * data/bison.glr: New skeleton for GLR parsing.
12545
12546 * tests/cxx-gram.at: New tests for GLR parsing.
12547
12548 * tests/testsuite.at: Include cxx-gram.at.
12549
12550 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 12551
676385e2
PH
12552 * src/parse-gram.y:
12553
12554 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
12555
12556 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 12557
b5480d74 125582002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
12559
12560 * src/options.h, src/options.c: Remove.
12561 * src/getargs.c (short_options, long_options): New.
12562
60491a94
AD
125632002-06-27 Akim Demaille <akim@epita.fr>
12564
12565 * data/bison.simple, data/bison.c++: Rename as...
12566 * data/yacc.c, data/lalr1.cc: these.
12567 * doc/bison.texinfo (Environment Variables): Remove.
12568
9be0c25b
AD
125692002-06-25 Raja R Harinath <harinath@cs.umn.edu>
12570
12571 * src/getargs.c (report_argmatch): Initialize strtok().
12572
1ae72863
AD
125732002-06-20 Akim Demaille <akim@epita.fr>
12574
12575 * data/bison.simple (b4_symbol_actions): New, replaces...
12576 (b4_symbol_destructor, b4_symbol_printer): these.
12577 (yysymprint): Be sure to call YYPRINT only for tokens, and using
12578 user token numbers.
12579
87542d29
AD
125802002-06-20 Akim Demaille <akim@epita.fr>
12581
12582 * data/bison.simple (yydestructor): Rename as...
12583 (yydestruct): this.
12584
1a31ed21
AD
125852002-06-20 Akim Demaille <akim@epita.fr>
12586
12587 * src/symtab.h, src/symtab.c (symbol_type_set)
12588 (symbol_destructor_set, symbol_precedence_set): The location is
12589 the last argument.
12590 Adjust all callers.
12591
e776192e
AD
125922002-06-20 Akim Demaille <akim@epita.fr>
12593
12594 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
12595 internals.
12596 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
12597 Takes a location.
12598 * src/symtab.h, src/symtab.c (symbol_class_set)
12599 (symbol_user_token_number_set): Likewise.
12600 Adjust all callers.
12601 Promote complain_at.
12602 * tests/input.at (Type Clashes): Adjust.
12603
5c1180b3
AD
126042002-06-20 Akim Demaille <akim@epita.fr>
12605
12606 * data/bison.simple (YYLEX): Fix the declaration when
12607 %pure-parser.
12608
e3170060
AD
126092002-06-20 Akim Demaille <akim@epita.fr>
12610
12611 * data/bison.simple (yysymprint): Don't print the token number,
12612 just its name.
12613 * tests/actions.at (Destructors): Rename as...
12614 (Printers and Destructors): this.
12615 Also exercise %printer.
12616
253862fd
AD
126172002-06-20 Akim Demaille <akim@epita.fr>
12618
12619 * data/bison.simple (YYDSYMPRINT): New.
12620 Use it to remove many of the #if YYDEBUG/if (yydebug).
12621
366eea36
AD
126222002-06-20 Akim Demaille <akim@epita.fr>
12623
12624 * src/symtab.h, src/symtab.c (symbol_t): printer and
12625 printer_location are new members.
12626 (symbol_printer_set): New.
12627 * src/parse-gram.y (PERCENT_PRINTER): New token.
12628 Handle its associated rule.
12629 * src/scan-gram.l: Adjust.
12630 (handle_destructor_at, handle_destructor_dollar): Rename as...
12631 (handle_symbol_code_at, handle_symbol_code_dollar): these.
12632 * src/output.c (symbol_printers_output): New.
12633 (output_skeleton): Call it.
12634 * data/bison.simple (yysymprint): New. Cannot be named yyprint
12635 since there are already many grammar files with a user `yyprint'.
12636 Replace the calls to YYPRINT to calls to yysymprint.
12637 * tests/calc.at: Adjust.
12638 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
12639 taking advantage of parser very internal details (stack size!).
12640
4f25ebb0
AD
126412002-06-20 Akim Demaille <akim@epita.fr>
12642
12643 * src/scan-gram.l: Complete the scanner with the missing patterns
12644 to pacify Flex.
12645 Use `quote' and `symbol_tag_get' where appropriate.
12646
93b68a0e
AD
126472002-06-19 Akim Demaille <akim@epita.fr>
12648
12649 * tests/actions.at (Destructors): Augment to test locations.
12650 * data/bison.simple (yydestructor): Pass it the current location
12651 if locations are enabled.
12652 Prototype only when __STDC__ or C++.
12653 Change the argument names to move into the yy name space: there is
12654 user code here.
12655
58612f1d
AD
126562002-06-19 Akim Demaille <akim@epita.fr>
12657
74310291
AD
12658 * data/bison.simple (b4_pure_if): New.
12659 Use it instead of #ifdef YYPURE.
12660
126612002-06-19 Akim Demaille <akim@epita.fr>
12662
12663 * data/bison.simple (b4_location_if): New.
58612f1d
AD
12664 Use it instead of #ifdef YYLSP_NEEDED.
12665
f25bfb75
AD
126662002-06-19 Akim Demaille <akim@epita.fr>
12667
12668 Prepare @$ in %destructor, but currently don't bind it in the
12669 skeleton, as %location use is not cleaned up yet.
12670
12671 * src/scan-gram.l (handle_dollar, handle_destructor_at)
12672 (handle_action_at): New.
12673 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
12674 a braced_code_t and a location as additional arguments.
12675 (handle_destructor_dollar): Instead of requiring `b4_eval', just
12676 unquote one when outputting `b4_dollar_dollar'.
12677 Adjust callers.
12678 * data/bison.simple (b4_eval): Remove.
12679 (b4_symbol_destructor): Adjust.
12680 * tests/input.at (Invalid @n): Adjust.
12681
c732d2c6
AD
126822002-06-19 Zack Weinberg <zack@codesourcery.com>
12683
12684 * doc/bison.texinfo: Document ability to have multiple
12685 prologue sections.
12686
8c165d89
AD
126872002-06-18 Akim Demaille <akim@epita.fr>
12688
12689 * src/files.c (compute_base_names): When computing the output file
12690 names from the input file name, strip the directory part.
12691
ca98bf57
AD
126922002-06-18 Akim Demaille <akim@epita.fr>
12693
12694 * data/bison.simple.new: Comment changes.
12695 Reported by Andreas Schwab.
12696
0bfb02ff
AD
126972002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
12698
12699 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
12700 there are no `label `yyoverflowlab' defined but not used' warnings
12701 when yyoverflow is defined.
12702
24c0aad7
AD
127032002-06-18 Akim Demaille <akim@epita.fr>
12704
12705 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
12706 new member.
12707 (symbol_destructor_set): Adjust.
12708 * src/output.c (symbol_destructors_output): Output the destructor
12709 locations.
12710 Output the symbol name.
12711 * data/bison.simple (b4_symbol_destructor): Adjust.
12712
5719c109
AD
127132002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
12714 and Akim Demaille <akim@epita.fr>
12715
12716 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
12717 what's left on the stack when the error recovery hits EOF.
12718 * tests/actions.at (Destructors): Complete to exercise this case.
12719
9280d3ef
AD
127202002-06-17 Akim Demaille <akim@epita.fr>
12721
12722 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
12723 arguments is really empty, not only equal to `[]'.
12724 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
12725 member.
12726 (symbol_destructor_set): New.
12727 * src/output.c (symbol_destructors_output): New.
12728 * src/reader.h (brace_code_t, current_braced_code): New.
12729 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
12730 (handle_dollar): Rename as...
12731 (handle_action_dollar): this.
12732 (handle_destructor_dollar): New.
12733 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
12734 (grammar_declaration): Use it.
12735 * data/bison.simple (yystos): Is always defined.
12736 (yydestructor): New.
12737 * tests/actions.at (Destructors): New.
12738 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
12739
dafdc66f
AD
127402002-06-17 Akim Demaille <akim@epita.fr>
12741
12742 * src/symlist.h, src/symlist.c (symbol_list_length): New.
12743 * src/scan-gram.l (handle_dollar, handle_at): Compute the
12744 rule_length only when needed.
12745 * src/output.c (actions_output, token_definitions_output): Output
12746 the full M4 block.
12747 * src/symtab.c: Don't access directly to the symbol tag, use
12748 symbol_tag_get.
12749 * src/parse-gram.y: Use symbol_list_free.
12750
56c47203
AD
127512002-06-17 Akim Demaille <akim@epita.fr>
12752
12753 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
12754 (symbol_list_prepend, get_type_name): Move to...
12755 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
12756 (symbol_list_prepend, symbol_list_n_type_name_get): here.
12757 Adjust all callers.
12758 (symbol_list_free): New.
12759 * src/scan-gram.l (handle_dollar): Takes a location.
12760 * tests/input.at (Invalid $n): Adjust.
12761
1e0bab92
AD
127622002-06-17 Akim Demaille <akim@epita.fr>
12763
12764 * src/reader.h, src/reader.c (symbol_list_new): Export it.
12765 (symbol_list_prepend): New.
12766 * src/parse-gram.y (%union): `list' is a new member.
12767 (symbols.1): New, replaces...
12768 (terms_to_prec.1, nterms_to_type.1): these.
12769 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
12770 Take a location as additional argument.
12771 Adjust all callers.
12772
04e60654
AD
127732002-06-15 Akim Demaille <akim@epita.fr>
12774
12775 * src/parse-gram.y: Move %token in the declaration section so that
12776 we don't depend upon CVS Bison.
12777
10e5b8bd
AD
127782002-06-15 Akim Demaille <akim@epita.fr>
12779
12780 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
12781 * src/print.c (print_core): Use it.
12782
9801d40c
AD
127832002-06-15 Akim Demaille <akim@epita.fr>
12784
12785 * src/conflicts.c (log_resolution): Accept the rule involved in
12786 the sr conflicts instead of the lookahead number that points to
12787 that rule.
12788 (flush_reduce): Accept the current lookahead vector as argument,
12789 instead of the index in LA.
12790 (resolve_sr_conflict): Accept the current number of lookahead
12791 bitset to consider for the STATE, instead of the index in LA.
12792 (set_conflicts): Adjust.
12793 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
12794
c0263492
AD
127952002-06-15 Akim Demaille <akim@epita.fr>
12796
12797 * src/state.h (state_t): Replace the `lookaheadsp' member, a
12798 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
12799 Adjust all dependencies.
12800 * src/lalr.c (initialize_lookaheads): Split into...
12801 (states_lookaheads_count, states_lookaheads_initialize): these.
12802 (lalr): Adjust.
12803
9757c359
AD
128042002-06-15 Akim Demaille <akim@epita.fr>
12805
12806 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
12807 out of...
12808 (grammar_rules_print): here.
12809 * src/reduce.c (reduce_output): Use it.
12810 * tests/reduce.at (Useless Rules, Reduced Automaton)
12811 (Underivable Rules): Adjust.
12812
6b98e4b5
AD
128132002-06-15 Akim Demaille <akim@epita.fr>
12814
12815 Copy BYacc's nice way to report the grammar.
12816
12817 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
12818 New.
12819 Don't print the rules' location, it is confusing and useless.
12820 (rule_print): Use grammar_rhs_print.
12821 * src/print.c (print_grammar): Use grammar_rules_print.
12822
6b98e4b5
AD
128232002-06-15 Akim Demaille <akim@epita.fr>
12824
12825 Complete and rationalize `useless thing' warnings.
12826
12827 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
12828 (symbol_tag_print): New.
12829 Use them everywhere in place of accessing directly the tag member.
12830 * src/gram.h, src/gram.c (rule_print): New.
12831 Use it where a rule used to be printed `by hand'.
12832 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
12833 (reduce_grammar_tables): Report the useless rules.
12834 (reduce_print): Useless things are a warning, not an error.
12835 Report it as such.
12836 * tests/reduce.at (Useless Nonterminals, Useless Rules):
12837 (Reduced Automaton, Underivable Rules): Adjust.
12838 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
12839 * tests/conflicts.at (Unresolved SR Conflicts)
12840 (Solved SR Conflicts): Adjust.
12841
ee000ba4
AD
128422002-06-15 Akim Demaille <akim@epita.fr>
12843
12844 Let symbols have a location.
12845
12846 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
12847 (getsym): Adjust.
12848 Adjust all callers.
12849 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
12850 Use location_t, not int.
12851 * src/symtab.c (symbol_check_defined): Take advantage of the
12852 location.
12853 * tests/regression.at (Invalid inputs): Adjust.
12854
8efe435c
AD
128552002-06-15 Akim Demaille <akim@epita.fr>
12856
12857 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
12858 (input): Don't try to initialize yylloc here, do it in the
12859 scanner.
12860 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
12861 * src/gram.h (rule_t): Change line and action_line into location
12862 and action_location, of location_t type.
12863 Adjust all dependencies.
12864 * src/location.h, src/location.c (empty_location): New.
12865 * src/reader.h, src/reader.c (grammar_start_symbol_set)
12866 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
12867 (grammar_current_rule_symbol_append)
12868 (grammar_current_rule_action_append): Expect a location as argument.
12869 * src/reader.c (grammar_midrule_action): Adjust to attach an
12870 action's location as dummy symbol location.
12871 * src/symtab.h, src/symtab.c (startsymbol_location): New.
12872 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
12873 the line numbers.
12874
1921f1d7
AD
128752002-06-14 Akim Demaille <akim@epita.fr>
12876
12877 Grammar declarations may be found in the grammar section.
12878
12879 * src/parse-gram.y (rules_or_grammar_declaration): New.
12880 (declarations): Each declaration may end with a semicolon, not
12881 just...
12882 (grammar_declaration): `"%union"'.
12883 (grammar): Branch to rules_or_grammar_declaration.
12884
4515534c
AD
128852002-06-14 Akim Demaille <akim@epita.fr>
12886
12887 * src/main.c (main): Invoke scanner_free.
12888
f958596b
AD
128892002-06-14 Akim Demaille <akim@epita.fr>
12890
12891 * src/output.c (m4_invoke): Extracted from...
12892 (output_skeleton): here.
12893 Free tempfile.
12894
2c569025
AD
128952002-06-14 Akim Demaille <akim@epita.fr>
12896
12897 * src/parse-gram.y (directives, directive, gram)
12898 (grammar_directives, precedence_directives, precedence_directive):
12899 Rename as...
12900 (declarations, declaration, grammar, grammar_declaration)
12901 (precedence_declaration, precedence_declarator): these.
12902 (symbol_declaration): New.
12903
592e8d4d
AD
129042002-06-14 Akim Demaille <akim@epita.fr>
12905
12906 * src/files.c (action_obstack): Remove, unused.
12907 (output_obstack): Remove it, and all its dependencies, as it is no
12908 longer needed.
12909 * src/reader.c (epilogue_set): Build the epilogue in the
12910 muscle_obstack.
12911 * src/output.h, src/output.c (muscle_obstack): Move to...
12912 * src/muscle_tab.h, src/muscle_tab.h: here.
12913 (muscle_init): Initialize muscle_obstack.
12914 (muscle_free): New.
12915 * src/main.c (main): Call it.
12916
0c15323d
AD
129172002-06-14 Akim Demaille <akim@epita.fr>
12918
12919 * src/location.h: New, extracted from...
12920 * src/reader.h: here.
12921 * src/Makefile.am (noinst_HEADERS): Merge into
12922 (bison_SOURCES): this.
12923 Add location.h.
12924 * src/parse-gram.y: Use location_t instead of Bison's.
12925 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
12926 Use location_t instead of ints.
12927
e96c9728
AD
129282002-06-14 Akim Demaille <akim@epita.fr>
12929
12930 * data/bison.simple, data/bison.c++: Be sure to restore the
12931 current #line when returning to the skeleton contents after having
12932 exposed the input file's #line.
12933
75d1fe16
AD
129342002-06-12 Akim Demaille <akim@epita.fr>
12935
12936 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
12937 eager.
12938 * tests/actions.at (Exotic Dollars): New.
12939
6c35d22c
AD
129402002-06-12 Akim Demaille <akim@epita.fr>
12941
12942 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
12943 ['"/] too eagerly.
12944 * tests/input.at (Torturing the Scanner): New.
12945
1d6412ad
AD
129462002-06-11 Akim Demaille <akim@epita.fr>
12947
12948 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
12949 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
12950 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
12951 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
12952 * src/reader.c (reader): Use it.
12953
4cdb01db
AD
129542002-06-11 Akim Demaille <akim@epita.fr>
12955
12956 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
12957 Adjust all callers.
12958 (scanner_last_string_free): New.
12959
44995b2e
AD
129602002-06-11 Akim Demaille <akim@epita.fr>
12961
12962 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
12963 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
12964 (last_string, YY_OBS_FREE): New.
12965 Use them when returning an ID.
12966
e9955c83
AD
129672002-06-11 Akim Demaille <akim@epita.fr>
12968
12969 Have Bison grammars parsed by a Bison grammar.
12970
12971 * src/reader.c, src/reader.h (prologue_augment): New.
12972 * src/reader.c (copy_definition): Remove.
12973
12974 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
12975 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
12976 (grammar_current_rule_prec_set, grammar_current_rule_check)
12977 (grammar_current_rule_symbol_append)
12978 (grammar_current_rule_action_append): Export.
12979 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
12980 (symbol_list_action_append): Remove.
12981 Hook the routines from reader.
12982 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
12983 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
12984
12985 * src/reader.c (read_declarations): Remove, unused.
12986
12987 * src/parse-gram.y: Handle the epilogue.
12988 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
12989 (grammar_start_symbol_set): this.
12990 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
12991 * src/reader.c (readgram): Remove, unused.
12992 (reader): Adjust to insert eoftoken and axiom where appropriate.
12993
12994 * src/reader.c (copy_dollar): Replace with...
12995 * src/scan-gram.h (handle_dollar): this.
12996 * src/parse-gram.y: Remove `%thong'.
12997
12998 * src/reader.c (copy_at): Replace with...
12999 * src/scan-gram.h (handle_at): this.
13000
13001 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
13002 New.
13003
13004 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
13005 time being.
13006
13007 * src/reader.h, src/reader.c (grammar_rule_end): New.
13008
13009 * src/parse.y (current_type, current_class): New.
13010 Implement `%nterm', `%token' support.
13011 Merge `%term' into `%token'.
13012 (string_as_id): New.
13013 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
13014 type name.
13015
13016 * src/parse-gram.y: Be sure to handle properly the beginning of
13017 rules.
13018
13019 * src/parse-gram.y: Handle %type.
13020 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
13021
13022 * src/parse-gram.y: More directives support.
13023 * src/options.c: No longer handle source directives.
13024
13025 * src/parse-gram.y: Fix %output.
13026
13027 * src/parse-gram.y: Handle %union.
13028 Use the prologue locations.
13029 * src/reader.c (parse_union_decl): Remove.
13030
13031 * src/reader.h, src/reader.c (epilogue_set): New.
13032 * src/parse-gram.y: Use it.
13033
13034 * data/bison.simple, data/bison.c++: b4_stype is now either not
13035 defined, then default to int, or to the contents of %union,
13036 without `union' itself.
13037 Adjust.
13038 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
13039
13040 * src/output.c (actions_output): Don't output braces, as they are
13041 already handled by the scanner.
13042
13043 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
13044 characters to themselves.
13045
13046 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
13047 that the epilogue has a proper #line.
13048
13049 * src/parse-gram.y: Handle precedence/associativity.
13050
13051 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
13052 a terminal.
13053 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
13054 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
13055 at all to define terminals that cannot be emitted.
13056
13057 * src/scan-gram.l: Escape M4 characters.
13058
13059 * src/scan-gram.l: Working properly with escapes in user
13060 strings/characters.
13061
13062 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
13063 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
13064 grammar.
13065 Use more modest sizes, as for the time being the parser does not
13066 release memory, and therefore the process swallows a huge amount
13067 of memory.
13068
13069 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
13070 stricter %token grammar.
13071
13072 * src/symtab.h (associativity): Add `undef_assoc'.
13073 (symbol_precedence_set): Do nothing when passed an undef_assoc.
13074 * src/symtab.c (symbol_check_alias_consistence): Adjust.
13075
13076 * tests/regression.at (Invalid %directive): Remove, as it is now
13077 meaningless.
13078 (Invalid inputs): Adjust to the new error messages.
13079 (Token definitions): The new grammar doesn't allow too many
13080 eccentricities.
13081
13082 * src/lex.h, src/lex.c: Remove.
13083 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
13084 (copy_character, copy_string2, copy_string, copy_identifier)
13085 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
13086 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
13087 (parse_action): Remove.
13088 * po/POTFILES.in: Adjust.
13089
2e047461
AD
130902002-06-11 Akim Demaille <akim@epita.fr>
13091
cd05d13c 13092 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
13093 rule's action member: return the action as a string.
13094 Don't require `rule_length' as an argument: compute it.
13095 (grammar_current_rule_symbol_append)
13096 (grammar_current_rule_action_append): New, eved out from
13097 (readgram): here.
13098 Remove `action_flag', `rulelength', unused now.
13099
9af3fbce
AD
131002002-06-11 Akim Demaille <akim@epita.fr>
13101
13102 * src/reader.c (grammar_current_rule_prec_set).
13103 (grammar_current_rule_check): New, eved out from...
13104 (readgram): here.
13105 Remove `xaction', `first_rhs': useless.
13106 * tests/input.at (Type clashes): New.
13107 * tests/existing.at (GNU Cim Grammar): Adjust.
13108
1485e106
AD
131092002-06-11 Akim Demaille <akim@epita.fr>
13110
13111 * src/reader.c (grammar_midrule_action): New, Eved out from
13112 (readgram): here.
13113
da4160c3
AD
131142002-06-11 Akim Demaille <akim@epita.fr>
13115
13116 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
13117 New.
13118 (readgram): Use them as replacement of inlined code, crule and
13119 crule1.
13120
f6d0f937
AD
131212002-06-11 Akim Demaille <akim@epita.fr>
13122
13123 * src/reader.c (grammar_end, grammar_symbol_append): New.
13124 (readgram): Use them.
13125 Make the use of `p' as local as possible.
13126
69078d4b
AD
131272002-06-10 Akim Demaille <akim@epita.fr>
13128
13129 GCJ's parser requires the tokens to be defined before the prologue.
13130
13131 * data/bison.simple: Output the token definition before the user's
13132 prologue.
13133 * tests/regression.at (Braces parsing, Duplicate string)
13134 (Mixing %token styles): Check the output from bison.
13135 (Early token definitions): New.
13136
5e424082
AD
131372002-06-10 Akim Demaille <akim@epita.fr>
13138
13139 * src/symtab.c (symbol_user_token_number_set): Don't complain when
13140 assigning twice the same user number to a token, so that we can
13141 use it in...
13142 * src/lex.c (lex): here.
13143 Also use `symbol_class_set' instead of hand written code.
13144 * src/reader.c (parse_assoc_decl): Likewise.
13145
44536b35
AD
131462002-06-10 Akim Demaille <akim@epita.fr>
13147
13148 * src/symtab.c, src/symtab.c (symbol_class_set)
13149 (symbol_user_token_number_set): New.
13150 * src/reader.c (parse_token_decl): Use them.
13151 Use a switch instead of ifs.
13152 Use a single argument.
13153
8b9f2372
AD
131542002-06-10 Akim Demaille <akim@epita.fr>
13155
13156 Remove `%thong' support as it is undocumented, unused, duplicates
13157 `%token's job, and creates useless e-mail traffic with people who
13158 want to know what it is, why it is undocumented, unused, and
13159 duplicates `%token's job.
13160
13161 * src/reader.c (parse_thong_decl): Remove.
13162 * src/options.c (option_table): Remove "thong".
13163 * src/lex.h (tok_thong): Remove.
13164
3ae2b51f
AD
131652002-06-10 Akim Demaille <akim@epita.fr>
13166
13167 * src/symtab.c, src/symtab.c (symbol_type_set)
13168 (symbol_precedence_set): New.
13169 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
13170 (value_components_used): Remove, unused.
13171
2f1afb73
AD
131722002-06-09 Akim Demaille <akim@epita.fr>
13173
13174 Move symbols handling code out of the reader.
13175
13176 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
13177 (axiom): Move to...
13178 * src/symtab.h, src/symtab.c: here.
13179
13180 * src/gram.c (start_symbol): Remove: use startsymbol->number.
13181 * src/reader.c (startval): Rename as...
13182 * src/symtab.h, src/symtab.c (startsymbol): this.
13183 * src/reader.c: Adjust.
13184
13185 * src/reader.c (symbol_check_defined, symbol_make_alias)
13186 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13187 (token_translations_init)
13188 Move to...
13189 * src/symtab.c: here.
13190 * src/reader.c (packsymbols): Move to...
13191 * src/symtab.h, src/symtab.c (symbols_pack): here.
13192 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
13193 argument.
13194
e9bca3ad
AD
131952002-06-03 Akim Demaille <akim@epita.fr>
13196
13197 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
13198 then statements.
13199
86eff183
AD
132002002-06-03 Akim Demaille <akim@epita.fr>
13201
13202 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
13203 structs with non literals.
13204 * src/scan-skel.l: never-interactive.
13205 * src/conflicts.c (enum conflict_resolution_e): No trailing
13206 comma.
13207 * src/getargs.c (usage): Split long literal strings.
13208 Reported by Hans Aberg.
13209
717be197
AD
132102002-05-28 Akim Demaille <akim@epita.fr>
13211
13212 * data/bison.c++: Use C++ ostreams.
13213 (cdebug_): New member.
13214
670ddffd
AD
132152002-05-28 Akim Demaille <akim@epita.fr>
13216
13217 * src/output.c (output_skeleton): Be sure to allocate enough room
13218 for `/' _and_ for `\0' in full_skeleton.
13219
769b430f
AD
132202002-05-28 Akim Demaille <akim@epita.fr>
13221
13222 * data/bison.c++: Catch up with bison.simple:
13223 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13224 and Paul Eggert <eggert@twinsun.com>: `error' handing.
13225 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
13226 and popping traces.
13227
7067cb36
PH
132282002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13229
13230 * src/output.c (output_skeleton): Put an explicit path in front of
13231 the skeleton file name, rather than relying on the -I directory,
13232 to partially alleviate effects of having a skeleton file lying around
13233 in the current directory.
769b430f 13234
4a713ec2
PH
132352002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13236
769b430f 13237 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
13238 obstack_printf should be obstack_fgrow1.
13239
b408954b
AD
132402002-05-26 Akim Demaille <akim@epita.fr>
13241
13242 * src/state.h (state_t): `solved_conflicts' is a new member.
13243 * src/LR0.c (new_state): Set it to 0.
13244 * src/conflicts.h, src/conflicts.c (print_conflicts)
13245 (free_conflicts, solve_conflicts): Rename as...
13246 (conflicts_print, conflicts_free, conflicts_solve): these.
13247 Adjust callers.
13248 * src/conflicts.c (enum conflict_resolution_e)
13249 (solved_conflicts_obstack): New, used by...
13250 (log_resolution): this.
13251 Adjust to attach the conflict resolution to each state.
13252 Complete the description with the precedence/associativity
13253 information.
13254 (resolve_sr_conflict): Adjust.
13255 * src/print.c (print_state): Output its solved_conflicts.
13256 * tests/conflicts.at (Unresolved SR Conflicts)
13257 (Solved SR Conflicts): Exercise --report=all.
13258
a49aecd5
AD
132592002-05-26 Akim Demaille <akim@epita.fr>
13260
13261 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13262 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13263 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
13264 (token_number_t, item_number_as_token_number)
13265 (token_number_as_item_number, muscle_insert_token_number_table):
13266 Rename as...
13267 (symbol_number_t, item_number_as_symbol_number)
13268 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
13269 these, since it is more appropriate.
13270
5504898e
AD
132712002-05-26 Akim Demaille <akim@epita.fr>
13272
13273 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
13274 `Error:' lines.
13275 * data/bison.simple (yystos) [YYDEBUG]: New.
13276 (yyparse) [YYDEBUG]: Display the symbols which are popped during
13277 error recovery.
13278 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
13279
ec3bc396
AD
132802002-05-25 Akim Demaille <akim@epita.fr>
13281
13282 * doc/bison.texinfo (Debugging): Split into...
13283 (Tracing): this new section, its former contents, and...
13284 (Understanding): this new section.
13285 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
13286 by...
13287 (report_flag): this.
13288 Adjust all dependencies.
13289 (report_args, report_types, report_argmatch): New.
13290 (usage, getargs): Report/support -r, --report.
13291 * src/options.h
13292 (struct option_table_struct): Rename as..,
13293 (struct option_table_s): this.
13294 Rename the `set_flag' member to `flag' to match with getopt_long's
13295 struct.
13296 * src/options.c (option_table): Split verbose into an entry for
13297 %verbose, and another for --verbose.
13298 Support --report/-r, so remove -r from the obsolete --raw.
13299 * src/print.c: Attach full item sets and lookaheads reports to
13300 report_flag instead of trace_flag.
13301 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
13302
78df8250
PE
133032002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13304 and Paul Eggert <eggert@twinsun.com>
769b430f 13305
78df8250
PE
13306 * data/bison.simple (yyparse): Correct error handling to conform to
13307 POSIX and yacc. Specifically, after syntax error is discovered,
13308 do not reduce further before shifting the error token.
13309 Clean up the code a bit by removing the labels yyerrdefault,
13310 yyerrhandle, yyerrpop.
13311 * NEWS: Document the above.
13312
c0c9ea05
PH
133132002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13314
13315 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
13316 type; it isn't always big enough, since it doesn't necessarily
13317 include non-terminals.
769b430f 13318 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
13319 the latter can be removed.
13320 (yy_token_number_type): Remove, only one use.
13321 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
13322 don't use TokenNumberType as element type.
769b430f 13323
c0c9ea05
PH
13324 * tests/regression.at: Modify expected output to agree with change
13325 to yyr1 and yytranslate.
769b430f 13326
6390a83f
FK
133272002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
13328
13329 * src/reader.c (parse_action): Use copy_character instead of
13330 obstack_1grow.
13331
db7c8e9a
AD
133322002-05-13 Akim Demaille <akim@epita.fr>
13333
13334 * tests/regression.at (Token definitions): Prototype yylex and
13335 yyerror.
13336
fcc61800
PH
133372002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13338
158c687b 13339 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
13340 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
13341 32-bit arithmetic.
13342 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
13343
5683e9b2
AD
133442002-05-07 Akim Demaille <akim@epita.fr>
13345
13346 * tests/synclines.at: Be sure to prototype yylex and yyerror to
13347 avoid GCC warnings.
13348
0c2d3f4c
AD
133492002-05-07 Akim Demaille <akim@epita.fr>
13350
13351 Kill GCC warnings.
13352
13353 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
13354 over the RHS of each rule.
13355 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
13356 * src/state.h (state_t): Member `nitems' is unsigned short.
13357 * src/LR0.c (get_state): Adjust.
13358 * src/reader.c (packgram): Likewise.
13359 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
13360 `Type'.
13361 (muscle_insert_int_table): Remove, unused.
13362 (prepare_rules): Remove `max'.
13363
1565b720
AD
133642002-05-06 Akim Demaille <akim@epita.fr>
13365
13366 * src/closure.c (print_firsts): Display of the symbol tags.
13367 (bitmatrix_print): Move to...
13368 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
13369 here.
13370 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
13371
cfaee611
AD
133722002-05-06 Akim Demaille <akim@epita.fr>
13373
13374 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
13375 hash_do_for_each.
13376
458be8e0
AD
133772002-05-06 Akim Demaille <akim@epita.fr>
13378
13379 * src/LR0.c (new_state, get_state): Instead of using the global
13380 `kernel_size' and `kernel_base', have two new arguments:
13381 `core_size' and `core'.
13382 Adjust callers.
13383
a900a624
AD
133842002-05-06 Akim Demaille <akim@epita.fr>
13385
13386 * src/reader.c (packgram): No longer end `ritem' with a 0
13387 sentinel: it is not used.
13388
d4e7d3a1
AD
133892002-05-05 Akim Demaille <akim@epita.fr>
13390
13391 New experimental feature: display the lookaheads in the report and
13392 graph.
13393
13394 * src/print (print_core): When --trace-flag, display the rules
13395 lookaheads.
13396 * src/print_graph.c (print_core): Likewise.
13397 Swap the arguments.
13398 Adjust caller.
13399
39ceb25b
AD
134002002-05-05 Akim Demaille <akim@epita.fr>
13401
13402 * tests/torture.at (Many lookaheads): New test.
13403
5372019f
AD
134042002-05-05 Akim Demaille <akim@epita.fr>
13405
13406 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
13407 (GENERATE_MUSCLE_INSERT_TABLE): this.
13408 (output_int_table, output_unsigned_int_table, output_short_table)
13409 (output_token_number_table, output_item_number_table): Replace with...
13410 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
13411 (muscle_insert_short_table, muscle_insert_token_number_table)
13412 (muscle_insert_item_number_table): these.
13413 Adjust all callers.
13414 (prepare_tokens): Don't free `translations', since...
13415 * src/reader.h, src/reader.c (grammar_free): do it.
13416 Move to...
13417 * src/gram.h, src/gram.c (grammar_free): here.
13418 * data/bison.simple, data/bison.c++: b4_token_number_max is now
13419 b4_translate_max.
13420
5df5f6d5
AD
134212002-05-05 Akim Demaille <akim@epita.fr>
13422
13423 * src/output.c (output_unsigned_int_table): New.
13424 (prepare_rules): `i' is unsigned.
13425 `prhs', `rline', `r2' are unsigned int.
13426 Rename muscle `rhs_number_max' as `rhs_max'.
13427 Output muscles `prhs_max', `rline_max', and `r2_max'.
13428 Free rline and r1.
13429 * data/bison.simple, data/bison.c++: Adjust to use these muscles
13430 to compute types instead of constant types.
13431 * tests/regression.at (Web2c Actions): Adjust.
13432
b87f8b21
AD
134332002-05-04 Akim Demaille <akim@epita.fr>
13434
13435 * src/symtab.h (SALIAS, SUNDEF): Rename as...
13436 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
13437 Adjust dependencies.
13438 * src/output.c (token_definitions_output): Be sure not to output a
13439 `#define 'a'' when fed with `%token 'a' "a"'.
13440 * tests/regression.at (Token definitions): New.
13441
8bb936e4
PE
134422002-05-03 Paul Eggert <eggert@twinsun.com>
13443
13444 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
13445 for K&R C.
13446
134472002-05-03 gettextize <bug-gnu-gettext@gnu.org>
13448
13449 * Makefile.am (SUBDIRS): Remove intl.
13450 (EXTRA_DIST): Add config/config.rpath.
13451
53c71a12
AD
134522002-05-03 Akim Demaille <akim@epita.fr>
13453
13454 * data/bison.simple (m4_if): Don't output empty enums.
13455 And actually, output valid enum definitions :(.
13456
289dd0cf
AD
134572002-05-03 Akim Demaille <akim@epita.fr>
13458
13459 * configure.bat: Remove, completely obsolete.
13460 * Makefile.am (EXTRA_DIST): Adjust.
13461 Don't distribute config.rpath...
13462 * config/Makefile.am (EXTRA_DIST): Do it.
13463
db85e524
AD
134642002-05-03 Akim Demaille <akim@epita.fr>
13465
13466 * configure.in (GETTEXT_VERSION): New.
13467 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
13468
83ccf991
AD
134692002-05-03 Akim Demaille <akim@epita.fr>
13470
13471 * data/bison.simple (b4_token_enum): New.
13472 (b4_token_defines): Use it to output tokens both as #define and
13473 enums.
13474 Suggested by Paul Eggert.
13475 * src/output.c (token_definitions_output): Don't output spurious
13476 white spaces.
13477
1f418995
AD
134782002-05-03 Akim Demaille <akim@epita.fr>
13479
13480 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
13481
45119f04
RA
134822002-05-02 Robert Anisko <robert@lrde.epita.fr>
13483
13484 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
13485 Update the stack class, give a try to deque as the default container.
13486
b2d52318
AD
134872002-05-02 Akim Demaille <akim@epita.fr>
13488
13489 * data/bison.simple (yyparse): Do not implement @$ = @1.
13490 (YYLLOC_DEFAULT): Adjust to do it.
13491 * doc/bison.texinfo (Location Default Action): Fix.
13492
3a8b4109
AD
134932002-05-02 Akim Demaille <akim@epita.fr>
13494
13495 * src/reader.c (parse_braces): Merge into...
13496 (parse_action): this.
13497
84614e13
AD
134982002-05-02 Akim Demaille <akim@epita.fr>
13499
13500 * configure.in (ALL_LINGUAS): Remove.
13501 * po/LINGUAS, hr.po: New.
13502
fdbcd8e2
AD
135032002-05-02 Akim Demaille <akim@epita.fr>
13504
13505 Remove the so called hairy (semantic) parsers.
13506
13507 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
13508 * src/gram.h, src/gram.c (semantic_parser): Remove.
13509 (rule_t): Remove the guard and guard_line members.
13510 * src/lex.h (token_t): remove tok_guard.
13511 * src/options.c (option_table): Remove %guard and %semantic_parser
13512 support.
13513 * src/output.c, src/output.h (guards_output): Remove.
13514 (prepare): Adjust.
13515 (token_definitions_output): Don't output the `T'
13516 tokens (???).
13517 (output_skeleton): Don't output the guards.
13518 * src/files.c, src/files.c (attrsfile): Remove.
13519 * src/reader.c (symbol_list): Remove the guard and guard_line
13520 members.
13521 Adjust dependencies.
13522 (parse_guard): Remove.
13523 * data/bison.hairy: Remove.
13524 * doc/bison.texinfo (Environment Variables): Remove occurrences of
13525 BISON_HAIRY.
13526
82b6cb3f
AD
135272002-05-02 Akim Demaille <akim@epita.fr>
13528
13529 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
13530 (parse_guard): Rename the formal argument `stack_offset' as
13531 `rule_length', which is more readable.
13532 Adjust callers.
13533 (copy_at, copy_dollar): Instead of outputting the hard coded
13534 values of $$, $n and so forth, output invocation to b4_lhs_value,
13535 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
13536 Note: this patch partially drops `semantic-parser' support: it
13537 always does `rule_length - n', where semantic parsers ought to
13538 always use `-n'.
82b6cb3f
AD
13539 * data/bison.simple, data/bison.c++ (b4_lhs_value)
13540 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
13541
6cbfbcc5
AD
135422002-05-02 Akim Demaille <akim@epita.fr>
13543
13544 * configure.in (AC_INIT): Bump to 1.49b.
13545 (AM_INIT_AUTOMAKE): Short invocation.
13546
b8548114
AD
135472002-05-02 Akim Demaille <akim@epita.fr>
13548
13549 Version 1.49a.
13550
c20cd1fa
AD
135512002-05-01 Akim Demaille <akim@epita.fr>
13552
13553 * src/skeleton.h: Remove.
13554
8a9566d4
AD
135552002-05-01 Akim Demaille <akim@epita.fr>
13556
13557 * src/skeleton.h: Fix the #endif.
13558 Reported by Magnus Fromreide.
13559
8c6d399a
PE
135602002-04-26 Paul Eggert <eggert@twinsun.com>
13561
13562 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
13563 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 13564 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 13565
2b7ed18a
RA
135662002-04-25 Robert Anisko <robert@lrde.epita.fr>
13567
13568 * src/scan-skel.l: Postprocess quadrigraphs.
13569
13570 * src/reader.c (copy_character): New function, used to output
13571 single characters while replacing `[' and `]' with quadrigraphs, to
13572 avoid troubles with M4 quotes.
13573 (copy_comment): Output characters with copy_character.
13574 (read_additionnal_code): Likewise.
13575 (copy_string2): Likewise.
13576 (copy_definition): Likewise.
13577
13578 * tests/calc.at: Exercise M4 quoting.
13579
34a89c50
AD
135802002-04-25 Akim Demaille <akim@epita.fr>
13581
13582 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
13583 between `!' and the command.
13584 Reported by Paul Eggert.
13585
0dd1580a
RA
135862002-04-24 Robert Anisko <robert@lrde.epita.fr>
13587
13588 * tests/calc.at: Exercise prologue splitting.
13589
13590 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
13591 `b4_post_prologue' instead of `b4_prologue'.
13592
13593 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
13594 muscles.
13595 (output): Free pre_prologue_obstack and post_prologue_obstack.
13596 * src/files.h, src/files.c (attrs_obstack): Remove.
13597 (pre_prologue_obstack, post_prologue_obstack): New.
13598 * src/reader.c (copy_definition): Add a parameter to specify the
13599 obstack to fill, instead of using attrs_obstack unconditionally.
13600 (read_declarations): Pass pre_prologue_obstack to copy_definition if
13601 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
13602
83c1796f
PE
136032002-04-23 Paul Eggert <eggert@twinsun.com>
13604
13605 * data/bison.simple: Remove unnecessary commentary and white
13606 space differences from 1_29-branch.
13607 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
13608
13609 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
13610 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
13611 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
13612 constructors or destructors.
13613
13614 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
13615
1207eeac
AD
136162002-04-23 Akim Demaille <akim@epita.fr>
13617
13618 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
13619 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
13620 location with columns.
13621 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
13622 All reported by Paul Eggert.
13623
78ab8f67
AD
136242002-04-22 Akim Demaille <akim@epita.fr>
13625
13626 * src/reduce.c (dump_grammar): Move to...
13627 * src/gram.h, src/gram.c (grammar_dump): here.
13628 Be sure to separate long item numbers.
13629 Don't read the members of a rule's prec if its nil.
13630
133c20e2
AD
136312002-04-22 Akim Demaille <akim@epita.fr>
13632
13633 * src/output.c (table_size, table_grow): New.
13634 (MAXTABLE): Remove, replace uses with table_size.
13635 (pack_vector): Instead of dying when the table is too big, grow it.
13636
9515e8a7
AD
136372002-04-22 Akim Demaille <akim@epita.fr>
13638
13639 * data/bison.simple (yyr1): Its type is that of a token number.
13640 * data/bison.c++ (r1_): Likewise.
13641 * tests/regression.at (Web2c Actions): Adjust.
13642
23c5a174
AD
136432002-04-22 Akim Demaille <akim@epita.fr>
13644
13645 * src/reader.c (token_translations_init): 256 is now the default
13646 value for the error token, i.e., it will be assigned another
13647 number if the user assigned 256 to one of her tokens.
13648 (reader): Don't force 256 to error.
13649 * doc/bison.texinfo (Symbols): Adjust.
13650 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
13651 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
13652 etc. instead of 10, 20, 30 (which was used to `jump' over error
13653 (256) and undefined (2)).
13654
5fbb0954
AD
136552002-04-22 Akim Demaille <akim@epita.fr>
13656
13657 Propagate more token_number_t.
13658
13659 * src/gram.h (token_number_as_item_number)
13660 (item_number_as_token_number): New.
13661 * src/output.c (GENERATE_OUTPUT_TABLE): New.
13662 Use it to create output_item_number_table and
13663 output_token_number_table.
13664 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13665 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
13666 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
13667 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
13668
4f940944
AD
136692002-04-22 Akim Demaille <akim@epita.fr>
13670
13671 * src/output.h, src/output.c (get_lines_number): Remove.
13672
3ded9a63
AD
136732002-04-19 Akim Demaille <akim@epita.fr>
13674
13675 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
13676 as Lex/Flex'.
13677 (Debugging): More details about enabling the debugging features.
13678 (Table of Symbols): Describe $$, $n, @$, and @n.
13679 Suggested by Tim Josling.
13680
e0c471a9
AD
136812002-04-19 Akim Demaille <akim@epita.fr>
13682
13683 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
13684
fecc10cd
AD
136852002-04-10 Akim Demaille <akim@epita.fr>
13686
13687 * src/system.h: Rely on HAVE_LIMITS_H.
13688 Suggested by Paul Eggert.
13689
51dec47b
AD
136902002-04-09 Akim Demaille <akim@epita.fr>
13691
13692 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
13693 full stderr, and strip it according to the bison options, instead
13694 of composing the error message from different bits.
13695 This makes it easier to check for several error messages.
13696 Adjust all the invocations.
13697 Add an invocation exercising the error token.
13698 Add an invocation demonstrating a stupid error message.
13699 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
13700 Adjust the tests.
13701 Error message are for stderr, not stdout.
13702
007a50a4
AD
137032002-04-09 Akim Demaille <akim@epita.fr>
13704
13705 * src/gram.h, src/gram.c (error_token_number): Remove, use
13706 errtoken->number.
13707 * src/reader.c (reader): Don't specify the user token number (2)
13708 for $undefined, as it uselessly prevents using it.
13709 * src/gram.h (token_number_t): Move to...
13710 * src/symtab.h: here.
13711 (state_t.number): Is a token_number_t.
13712 * src/print.c, src/reader.c: Use undeftoken->number instead of
13713 hard coded 2.
13714 (Even though this 2 is not the same as above: the number of the
13715 undeftoken remains being 2, it is its user token number which
13716 might not be 2).
13717 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
13718 `user_token_number_max'.
13719 Output `undef_token_number'.
13720 * data/bison.simple, data/bison.c++: Use them.
13721 Be sure to map invalid yylex return values to
13722 `undef_token_number'. This saves us from gratuitous SEGV.
13723
13724 * tests/conflicts.at (Solved SR Conflicts)
13725 (Unresolved SR Conflicts): Adjust.
13726 * tests/regression.at (Web2c Actions): Adjust.
13727
06446ccf
AD
137282002-04-08 Akim Demaille <akim@epita.fr>
13729
13730 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
13731 Adding #line.
13732 Remove the duplicate `typedefs'.
13733 (RhsNumberType): Fix the declaration and various other typos.
13734 Use __ofile__.
13735 * data/bison.simple: Use __ofile__.
13736 * src/scan-skel.l: Handle __ofile__.
13737
62a3e4f0
AD
137382002-04-08 Akim Demaille <akim@epita.fr>
13739
13740 * src/gram.h (item_number_t): New, the type of item numbers in
13741 RITEM. Note that it must be able to code symbol numbers as
13742 positive number, and the negation of rule numbers as negative
13743 numbers.
13744 Adjust all dependencies (pretty many).
13745 * src/reduce.c (rule): Remove this `short *' pointer: use
13746 item_number_t.
13747 * src/system.h (MINSHORT, MAXSHORT): Remove.
13748 Include `limits.h'.
13749 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
13750 (shortcpy): Remove.
13751 (MAXTABLE): Move to...
13752 * src/output.c (MAXTABLE): here.
13753 (prepare_rules): Use output_int_table to output rhs.
13754 * data/bison.simple, data/bison.c++: Adjust.
13755 * tests/torture.at (Big triangle): Move the limit from 254 to
13756 500.
13757 * tests/regression.at (Web2c Actions): Ajust.
13758
13759 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
13760 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
13761 passes, but produces negative #line number, once fixed, GCC is
13762 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
13763 C), it passes.
13764 * src/state.h (state_h): Code input lines on ints, not shorts.
13765
bb88b0fc
AD
137662002-04-08 Akim Demaille <akim@epita.fr>
13767
13768 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
13769 and then the grammar.
13770
9a636f47
AD
137712002-04-08 Akim Demaille <akim@epita.fr>
13772
13773 * src/system.h: No longer using strndup.
13774
680e8701
AD
137752002-04-07 Akim Demaille <akim@epita.fr>
13776
13777 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
13778 * src/output.c (output_table_data): Return the longest number.
13779 (prepare_tokens): Output `token_number_max').
13780 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
13781 New.
13782 Use them to define yy_token_number_type/TokenNumberType.
13783 Use this type for yytranslate.
13784 * tests/torture.at (Big triangle): Push the limit from 124 to
13785 253.
13786 * tests/regression.at (Web2c Actions): Adjust.
13787
817e9f41
AD
137882002-04-07 Akim Demaille <akim@epita.fr>
13789
13790 * tests/torture.at (Big triangle): New.
13791 (GNU AWK Grammar, GNU Cim Grammar): Move to...
13792 * tests/existing.at: here.
13793
5123689b
AD
137942002-04-07 Akim Demaille <akim@epita.fr>
13795
13796 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
13797 nritems.
13798 Adjust dependencies.
13799
f3849179
AD
138002002-04-07 Akim Demaille <akim@epita.fr>
13801
13802 * src/reader.c: Normalize increments to prefix form.
13803
bd02036a
AD
138042002-04-07 Akim Demaille <akim@epita.fr>
13805
13806 * src/reader.c, symtab.c: Remove debugging code.
13807
db8837cb
AD
138082002-04-07 Akim Demaille <akim@epita.fr>
13809
13810 Rename all the `bucket's as `symbol_t'.
13811
13812 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
13813 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
13814 * src/symtab.c, src/symtab.h (bucket): Rename as...
13815 (symbol_t): this.
13816 (symbol_list_new, bucket_check_defined, bucket_make_alias)
13817 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
13818 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13819 (buckets_new, buckets_free, buckets_do): Rename as...
13820 (symbol_list_new, symbol_check_defined, symbol_make_alias)
13821 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13822 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
13823 (symbols_new, symbols_free, symbols_do): these.
13824
72a23c97
AD
138252002-04-07 Akim Demaille <akim@epita.fr>
13826
13827 Use lib/hash for the symbol table.
13828
13829 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
13830 EOF.
13831 * src/lex.c (lex): Set the `number' member of new terminals.
13832 * src/reader.c (bucket_check_defined, bucket_make_alias)
13833 (bucket_check_alias_consistence, bucket_translation): New.
13834 (reader, grammar_free, readgram, token_translations_init)
13835 (packsymbols): Adjust.
13836 (reader): Number the predefined tokens.
13837 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
13838 for predefined tokens.
13839 * src/symtab.h (bucket): Remove all the hash table related
13840 members.
13841 * src/symtab.c (symtab): Replace by...
13842 (bucket_table): this.
13843 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
13844 (buckets_new, buckets_do): New.
13845
280a38c3
AD
138462002-04-07 Akim Demaille <akim@epita.fr>
13847
13848 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
13849 (start_symbol, max_user_token_number, semantic_parser)
13850 (error_token_number): Initialize.
13851 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
13852 Initialize.
13853 (reader): Don't.
13854 (errtoken, eoftoken, undeftoken, axiom): Extern.
13855
03b31c0c
AD
138562002-04-07 Akim Demaille <akim@epita.fr>
13857
13858 * src/gram.h (rule_s): prec and precsym are now pointers
13859 to the bucket giving the priority/associativity.
13860 Member `associativity' removed: useless.
13861 * src/reduce.c, src/conflicts.c: Adjust.
13862
8b3df748
AD
138632002-04-07 Akim Demaille <akim@epita.fr>
13864
13865 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
13866 Properly escape the symbols' TAG when outputting them.
13867
e601aa1d
AD
138682002-04-07 Akim Demaille <akim@epita.fr>
13869
13870 * src/lalr.h (LA): Is a bitsetv, not bitset*.
13871
b0299a2e
AD
138722002-04-07 Akim Demaille <akim@epita.fr>
13873
13874 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
13875 (LArule): this, which is an array to rule_t*.
13876 * src/print.c, src/conflicts.c: Adjust.
13877
d7e1f00c
AD
138782002-04-07 Akim Demaille <akim@epita.fr>
13879
13880 * src/gram.h (rule_t): Rename `number' as `user_number'.
13881 `number' is a new member.
13882 Adjust dependencies.
13883 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
13884
cc9305dd
AD
138852002-04-07 Akim Demaille <akim@epita.fr>
13886
13887 As a result of the previous patch, it is no longer needed
13888 to reorder ritem itself.
13889
13890 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
13891
b0940840
AD
138922002-04-07 Akim Demaille <akim@epita.fr>
13893
13894 Be sure never to walk through RITEMS, but use only data related to
13895 the rules themselves. RITEMS should be banished.
13896
13897 * src/output.c (output_token_translations): Rename as...
13898 (prepare_tokens): this.
13899 In addition to `translate', prepare the muscles `tname' and
13900 `toknum', which were handled by...
13901 (output_rule_data): this.
13902 Remove, and move the remainder of its outputs into...
13903 (prepare_rules): this new routines, which also merges content from
13904 (output_gram): this.
13905 (prepare_rules): Be sure never to walk through RITEMS.
13906 (output_stos): Rename as...
13907 (prepare_stos): this.
13908 (output): Always invoke prepare_states, after all, just don't use it
13909 in the output if you don't need it.
13910
643a5994
AD
139112002-04-07 Akim Demaille <akim@epita.fr>
13912
13913 * src/LR0.c (new_state): Display `nstates' as the name of the
13914 newly created state.
13915 Adjust to initialize first_state and last_state if needed.
13916 Be sure to distinguish the initial from the final state.
13917 (new_states): Create the itemset of the initial state, and use
13918 new_state.
13919 * src/closure.c (closure): Now that the initial state has its
13920 items properly set, there is no need for a special case when
13921 creating `ruleset'.
13922
13923 As a result, now the rule 0, reducing to $axiom, is visible in the
13924 outputs. Adjust the test suite.
13925
13926 * tests/conflicts.at (Solved SR Conflicts)
13927 (Unresolved SR Conflicts): Adjust.
13928 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
13929 * tests/conflicts.at (S/R in initial): New.
13930
b4c4ccc2
AD
139312002-04-07 Akim Demaille <akim@epita.fr>
13932
13933 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
13934 the RHS of the rules.
13935 * src/output.c (output_gram): Likewise.
13936
bba97eb2
AD
139372002-04-07 Akim Demaille <akim@epita.fr>
13938
13939 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
13940 bucket.
13941 Adjust all dependencies.
13942 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
13943 `number' of the buckets too.
13944 * src/gram.h: Include `symtab.h'.
13945 (associativity): Move to...
13946 * src/symtab.h: here.
13947 No longer include `gram.h'.
13948
c3b407f4
AD
139492002-04-07 Akim Demaille <akim@epita.fr>
13950
13951 * src/gram.h, src/gram.c (rules_rhs_length): New.
13952 (ritem_longest_rhs): Use it.
13953 * src/gram.h (rule_t): `number' is a new member.
13954 * src/reader.c (packgram): Set it.
13955 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
13956 the end of `rules', and count them out of `nrules'.
13957 (reduce_output, dump_grammar): Adjust.
13958 * src/print.c (print_grammar): It is no longer needed to check for
13959 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
13960 * tests/reduce.at (Reduced Automaton): New test.
13961
11652ab3
AD
139622002-04-07 Akim Demaille <akim@epita.fr>
13963
13964 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
13965 lacking `+ 1' to nrules, Bison reported as useless a token if it
13966 was used solely to set the precedence of the last rule...
13967
26b23c1a
AD
139682002-04-07 Akim Demaille <akim@epita.fr>
13969
13970 * data/bison.c++, data/bison.simple: Don't output the current file
13971 name in #line, to avoid useless diffs between two identical
13972 outputs under different names.
13973
18bcecb0
AD
139742002-04-07 Akim Demaille <akim@epita.fr>
13975
13976 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
13977 Normalize loops to using `< nrules + 1', not `<= nrules'.
13978
fa770c86
AD
139792002-04-07 Akim Demaille <akim@epita.fr>
13980
13981 * TODO: Update.
13982
d9b739c3
AD
139832002-04-07 Akim Demaille <akim@epita.fr>
13984
13985 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
13986 bucket.value as bucket.number.
13987
99013900
AD
139882002-04-07 Akim Demaille <akim@epita.fr>
13989
13990 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
13991 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13992 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
13993 RHS, instead of being an index in RITEMS.
13994
e966383b
PE
139952002-04-04 Paul Eggert <eggert@twinsun.com>
13996
13997 * doc/bison.texinfo: Update copyright date.
13998 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
13999 (Symbols): Warn about running Bison in one character set,
14000 but compiling and/or running in an incompatible one.
14001 Warn about character code 256, too.
14002
140032002-04-03 Paul Eggert <eggert@twinsun.com>
14004
14005 * src/bison.data (YYSTACK_ALLOC): Depend on whether
14006 YYERROR_VERBOSE is nonzero, not whether it is defined.
14007
14008 Merge changes from bison-1_29-branch.
c307773e 14009
8d6c48b9
PE
140102002-03-20 Paul Eggert <eggert@twinsun.com>
14011
14012 Merge fixes from Debian bison_1.34-1.diff.
14013
14014 * configure.in (AC_PREREQ): 2.53.
14015
e53c6322
AD
140162002-03-20 Akim Demaille <akim@epita.fr>
14017
14018 * src/conflicts.c (log_resolution): Argument `resolution' is const.
14019
9ffbeca7
PE
140202002-03-19 Paul Eggert <eggert@twinsun.com>
14021
21db0b2a
PE
14022 * src/bison.simple (YYCOPY): New macro.
14023 (YYSTACK_RELOCATE): Use it.
14024 Remove Type arg; no longer needed. All callers changed.
14025 (yymemcpy): Remove; no longer needed.
14026
9ffbeca7
PE
14027 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
14028 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14029
642cb8f8
AD
140302002-03-19 Akim Demaille <akim@epita.fr>
14031
14032 Test and fix the #line outputs.
14033
14034 * tests/atlocal.at (GCC): New.
14035 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 14036 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
14037 (Action synch line, Epilogue synch line): New tests.
14038 * src/reader.c (parse_union_decl): Define the muscle stype_line.
14039 * data/bison.simple, data/bison.c++: Use it.
14040
3c31a486
AD
140412002-03-19 Akim Demaille <akim@epita.fr>
14042
14043 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
14044 (Solved SR Conflicts, %expect not enough, %expect right)
14045 (%expect too much): Move to...
14046 * tests/conflicts.at: this new file.
14047
0d8bed56
AD
140482002-03-19 Akim Demaille <akim@epita.fr>
14049
14050 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14051 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
14052 that we can move to enums for instance.
14053 * src/output.c (token_definitions_output): Output a list of
14054 `token-name, token-number' instead of the #define.
14055 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
14056
9208d17f
AD
140572002-03-14 Akim Demaille <akim@epita.fr>
14058
14059 Use Gettext 0.11.1.
14060
af27eacb
RA
140612002-03-09 Robert Anisko <robert@lrde.epita.fr>
14062
14063 * data/bison.c++: Make the user able to add members to the generated
14064 parser by subclassing.
14065
9101a310
RA
140662002-03-05 Robert Anisko <robert@lrde.epita.fr>
14067
14068 * src/reader.c (read_additionnal_code): `c' should be an integer, not
14069 a character.
14070 Reported by Nicolas Tisserand and Nicolas Burrus.
14071
fff9bf0b
RA
140722002-03-04 Robert Anisko <robert@lrde.epita.fr>
14073
14074 * src/reader.c: Warn about lacking semi-colons, do not complain.
14075
64dba31e
RA
140762002-03-04 Robert Anisko <robert@lrde.epita.fr>
14077
14078 * data/bison.c++: Remove a debug line.
14079
374f5a14
RA
140802002-03-04 Robert Anisko <robert@lrde.epita.fr>
14081
14082 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
14083 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
14084 provide a default implementation.
14085
bfcf1f3a
AD
140862002-03-04 Akim Demaille <akim@epita.fr>
14087
14088 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
14089 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
14090 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
14091 * tests/semantic.at (Parsing Guards): Similarly.
14092 * src/reader.at (readgram): Complain if the last rule is not ended
14093 with a semi-colon.
14094
65ccf9fc
AD
140952002-03-04 Akim Demaille <akim@epita.fr>
14096
14097 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
14098 * src/closure.c: here.
14099 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
14100 RTC.
14101 * src/warshall.h, src/warshall.c: Remove.
14102 * tests/sets.at (Broken Closure): Adjust.
14103
d0039cbc
AD
141042002-03-04 Akim Demaille <akim@epita.fr>
14105
14106 * src/output.c (output_skeleton): tempdir is const.
14107 bytes_read is unused.
14108
345cea78
AD
141092002-03-04 Akim Demaille <akim@epita.fr>
14110
14111 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14112 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
14113 Update.
14114 From Michael Hayes.
14115
564801f7
AD
141162002-03-04 Akim Demaille <akim@epita.fr>
14117
14118 * src/closure.c (closure): `r' is unused.
14119
e5352bc7
AD
141202002-03-04 Akim Demaille <akim@epita.fr>
14121
14122 * tests/sets.at (Broken Closure): Add the ending `;'.
14123 * src/reader.at (readgram): Complain if a rule is not ended with a
14124 semi-colon.
14125
914feea9
AD
141262002-03-04 Akim Demaille <akim@epita.fr>
14127
14128 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
14129 (count_sr_conflicts): Use bitset_count.
14130 * src/reduce.c (inaccessable_symbols): Ditto.
14131 (bits_size): Remove.
14132 * src/warshall.h, src/warshall.c: Convert to bitsetv.
14133
f0250de6
AD
141342002-03-04 Akim Demaille <akim@epita.fr>
14135
14136 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
14137 * src/reduce.c: Remove the `bitset_zero's following the
14138 `bitset_create's, as now it is performed by the latter.
14139
ef017502
AD
141402002-03-04 Akim Demaille <akim@epita.fr>
14141
14142 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
14143 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
14144 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
14145 latest sources from Michael.
14146
76514394
AD
141472002-03-04 Akim Demaille <akim@epita.fr>
14148
14149 * src/output.c (output): Don't free the grammar.
14150 * src/reader.c (grammar_free): New.
14151 * src/main.c (main): Call it and don't free symtab here.
14152
55024580
AD
141532002-03-04 Akim Demaille <akim@epita.fr>
14154
14155 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
14156 before returning.
14157 Reported by Benoit Perrot.
14158
f9abaa2c
AD
141592002-03-04 Akim Demaille <akim@epita.fr>
14160
14161 Use bitset operations when possible, not loops over bits.
14162
14163 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
14164 bitset_or.
14165 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
14166 * src/reduce.c (useless_nonterminals): Formatting changes.
14167 * src/warshall.c (TC): Use bitset_or.
14168
0e721e75
AD
141692002-03-04 Akim Demaille <akim@epita.fr>
14170
14171 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
14172 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
14173 Ditto.
14174
0fb1ffb1
AD
141752002-03-04 Akim Demaille <akim@epita.fr>
14176
14177 * src/lalr.c (F): Now a bitset*.
14178 Adjust all dependencies.
14179
b86796bf
AD
141802002-03-04 Akim Demaille <akim@epita.fr>
14181
14182 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
14183 Adjust all dependencies.
14184
602bbf31
AD
141852002-03-04 Akim Demaille <akim@epita.fr>
14186
14187 * src/L0.c, src/LR0.h (nstates): Be size_t.
14188 Adjust comparisons (signed vs unsigned).
14189 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
14190 bitset*.
14191 Adjust all dependencies.
14192
d8a0245c
AD
141932002-03-04 Akim Demaille <akim@epita.fr>
14194
14195 * src/closure.c (firsts): Now, also a bitset.
14196 Adjust all dependencies.
14197 (varsetsize): Remove, now unused.
14198 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
14199
34ba9743
AD
142002002-03-04 Akim Demaille <akim@epita.fr>
14201
14202 * src/print.c: Convert to use bitset.h, not hand coded iterations
14203 over ints.
14204
ed86e78c
AD
142052002-03-04 Akim Demaille <akim@epita.fr>
14206
14207 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
14208
dfdb1797
AD
142092002-03-04 Akim Demaille <akim@epita.fr>
14210
14211 * src/closure.c (ruleset): Be a bitset.
14212 (rulesetsize): Remove.
14213
7086e707
AD
142142002-03-04 Akim Demaille <akim@epita.fr>
14215
14216 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14217 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
14218 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
14219 * src/closure.c (fderives): Be an array of bitsets.
14220
98254360
RA
142212002-02-28 Robert Anisko <robert@lrde.epita.fr>
14222
14223 * data/bison.c++: Merge the two generated headers. Insert a copyright
14224 notice in each output file.
14225
a75c057f
AD
142262002-02-28 Akim Demaille <akim@epita.fr>
14227
14228 * data/bison.c++: Copy the prologue of bison.simple to fetch
14229 useful M4 definitions, such as b4_header_guard.
14230
06b00abc
AD
142312002-02-25 Akim Demaille <akim@epita.fr>
14232
14233 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
14234 translator friendly scheme for the bgr
14235 copyright notice.
06b00abc 14236
70e7d534
AD
142372002-02-25 Akim Demaille <akim@epita.fr>
14238
14239 * src/output.c (header_output): Remove, now handled completely via
14240 M4.
14241
abe017f6
AD
142422002-02-25 Akim Demaille <akim@epita.fr>
14243
14244 * m4/m4.m4: New, from CVS Autoconf.
14245 * configure.in: Invoke it.
14246 * src/output.c (output_skeleton): Use its result instead of the
14247 hard coded name.
14248
381fb12e
AD
142492002-02-25 Akim Demaille <akim@epita.fr>
14250
14251 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
14252 Fileutils 4.1.5.
14253 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
14254 * src/output.c (output_skeleton): Use mkstemp to create a real
14255 temporary file.
14256 Move the filling of `skeleton' and its muscle to...
14257 (prepare): here.
14258 (output): Move the definition of the prologue muscle to...
14259 (prepare): here.
14260 * src/system.h (DEFAULT_TMPDIR): New.
14261
6f38107f
PE
142622002-02-14 Paul Eggert <eggert@twinsun.com>
14263
14264 Remove the support for C++ namespace cleanliness; it was
14265 causing more problems than it was curing, since it didn't work
14266 properly on some nonstandard C++ compilers. This can wait
14267 for a proper C++ parser.
14268
14269 * NEWS: Document this.
14270 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
14271 of C++, as it's treated like C now.
14272 * src/bison.simple (YYSTD): Remove.
14273 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
14274 Treat C++ just like Standard C instead of trying to support
14275 namespace cleanliness.
14276
80cce3da
AD
142772002-02-14 Akim Demaille <akim@epita.fr>
14278
14279 * tests/regression.at (else): Adjust to Andreas' change.
14280
842e8679
AD
142812002-02-14 Akim Demaille <akim@epita.fr>
14282
14283 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
14284
4bda3f10
AD
142852002-02-13 Andreas Schwab <schwab@suse.de>
14286
14287 * src/output.c (output_rule_data): Don't output NULL, it might
14288 not be defined yet.
14289
4162fa07 142902002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 14291
4162fa07
RA
14292 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
14293 (Copyright notice): Update.
b418ecd8 14294
bd16a5dc
AD
142952002-02-11 Akim Demaille <akim@epita.fr>
14296
14297 * tests/regression.at (%nonassoc and eof): Don't include
14298 nonportable headers.
14299
8d69a1a3
RA
143002002-02-08 Robert Anisko <robert@lrde.epita.fr>
14301
14302 * data/bison.c++: Correct error recovery. Make the user able to
14303 initialize the starting location.
14304
9b2d0677
AD
143052002-02-07 Akim Demaille <akim@epita.fr>
14306
14307 * tests/input.at: New.
14308
69e2658b
RA
143092002-02-07 Robert Anisko <robert@lrde.epita.fr>
14310
14311 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 14312 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
14313 directives around tables only needed for debugging.
14314
4aacc3a7
RA
143152002-02-07 Robert Anisko <robert@lrde.epita.fr>
14316
14317 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
14318 C++ parsers.
14319 (yy::b4_name::parse): Use print_.
14320
762a801e
RA
143212002-02-07 Robert Anisko <robert@lrde.epita.fr>
14322
14323 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
14324
4bb2bc3f
RA
143252002-02-07 Robert Anisko <robert@lrde.epita.fr>
14326
14327 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
14328 C++ parsers.
14329 (yy::b4_name::parse): Build verbose error messages, and use error_.
14330
6b45a3ca
RA
143312002-02-06 Robert Anisko <robert@lrde.epita.fr>
14332
14333 * data/bison.c++: Fix m4 quoting in comments.
14334
50997c6e
RA
143352002-02-06 Robert Anisko <robert@lrde.epita.fr>
14336
14337 * data/bison.c++: Adjust the parser code. Fix some muscles that were
14338 not expanded by m4.
14339
3f3eed27
AD
143402002-02-05 Akim Demaille <akim@epita.fr>
14341
14342 * data/bison.c++: Adjust to the M4 back end.
14343 More is certainly needed.
14344
be2a1a68
AD
143452002-02-05 Akim Demaille <akim@epita.fr>
14346
14347 Give a try to M4 as a back end.
14348
14349 * lib/readpipe.c: New, from wdiff.
14350 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
14351 BISON_HAIRY.
14352 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
14353 specific values. Now it is m4 that performs the lookup.
14354 * src/parse-skel.y: Remove.
14355 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
14356 * src/output.c (actions_output, guards_output)
14357 (token_definitions_output): No longer keeps track of the output
14358 line number, hence remove the second argument.
14359 (guards_output): Check against the guard member of a rule, not the
14360 action member.
14361 Adjust callers.
14362 (output_skeleton): Don't look for the skeleton location, let m4 do
14363 that.
14364 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
14365 file will be used.
14366 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
14367 (prepare): Given that for the time being changesyntax is not
14368 usable in M4, rename the muscles using `-' to `_'.
14369 Define `defines_flag', `output_parser_name' and `output_header_name'.
14370 * src/output.h (actions_output, guards_output)
14371 (token_definitions_output): Adjust prototypes.
14372 * src/scan-skel.l: Instead of scanning the skeletons, it now
14373 processes the output of m4: `__oline__' and `#output'.
14374 * data/bison.simple: Adjust to be used by M4(sugar).
14375 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
14376 to date.
14377 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
14378 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
14379 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
14380 shamelessly stolen from CVS Autoconf.
14381
beda758b
AD
143822002-02-05 Akim Demaille <akim@epita.fr>
14383
14384 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
14385 * configure.in: Check for the declarations of free and malloc.
14386 * src/muscle_tab.c: Adjust.
14387
5ece6d43
AD
143882002-02-05 Akim Demaille <akim@epita.fr>
14389
14390 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
14391 which have no values.
14392
5bb18f9a
AD
143932002-02-05 Akim Demaille <akim@epita.fr>
14394
14395 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
14396 * data/: here.
14397
894dd62e
PE
143982002-01-29 Paul Eggert <eggert@twinsun.com>
14399
14400 * src/bison.simple (YYSIZE_T): Do not define merely because
14401 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
14402 On some platforms, <alloca.h> does not declare YYSTD (size_t).
14403
82841af7
AD
144042002-01-27 Akim Demaille <akim@epita.fr>
14405
14406 Fix `%nonassoc and eof'.
14407
14408 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
14409 which were not properly copied! Replace
14410 memcpy (res->errs, src->errs, src->nerrs);
14411 with
14412 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
14413 !!!
14414 * tests/regression.at (%nonassoc and eof): Adjust to newest
14415 Autotest: `.' is not in the PATH.
14416
318b76e9
AD
144172002-01-27 Akim Demaille <akim@epita.fr>
14418
14419 * tests/sets.at (AT_EXTRACT_SETS): New.
14420 (Nullable): Use it.
14421 (Firsts): New.
14422
30d2f3d5
AD
144232002-01-26 Akim Demaille <akim@epita.fr>
14424
14425 * tests/actions.at, tests/calc.at, tests/headers.at,
14426 * tests/torture.at: Adjust to the newest Autotest which no longer
14427 forces `.' in the PATH.
14428
30f8c395
AD
144292002-01-25 Akim Demaille <akim@epita.fr>
14430
14431 * tests/regression.at (%nonassoc and eof): New.
14432 Suggested by Robert Anisko.
14433
29ae55f1
AD
144342002-01-24 Akim Demaille <akim@epita.fr>
14435
14436 Bison dumps core when trying to complain about broken input files.
14437 Reported by Cris van Pelt.
14438
14439 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
14440 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
14441 into...
14442 (Invalid inputs): Strengthen: exercise parse_percent_token.
14443
2b548aa6
RA
144442002-01-24 Robert Anisko <robert.anisko@epita.fr>
14445
14446 * src/Makefile.am: Add bison.c++.
14447 * src/bison.c++: New skeleton.
14448
bb0146c2
AD
144492002-01-21 Paolo Bonzini <bonzini@gnu.org>
14450
14451 * po/it.po: New.
14452
bec30531
AD
144532002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
14454
14455 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
14456
fc6edc45
MA
144572002-01-20 Marc Autret <marc@gnu.org>
14458
14459 * src/files.c (compute_output_file_names): Fix
14460
5e5d5415
MA
144612002-01-20 Marc Autret <marc@gnu.org>
14462
14463 * tests/output.at: New test.
14464 * src/files.c (compute_base_names): Don't map extensions when
14465 the YACC flag is set, use defaults.
14466 Reported by Evgeny Stambulchik.
14467
44ea3fbd
MA
144682002-01-20 Marc Autret <marc@gnu.org>
14469
ba0fe3c7
PE
14470 * src/system.h: Need to define __attribute__ away for non-GCC
14471 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
14472 Suggested by Albert Chin-A-Young.
14473
338963d1
TVH
144742002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
14475
14476 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
14477 canonical definition.
14478 * src/system.h: Use the canonical definition for PARAMS (avoids
14479 a conflict with the macro from lib/hash.h).
14480
c57b2479
AD
144812002-01-11 Akim Demaille <akim@epita.fr>
14482
14483 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 14484 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 14485
b85810ae
AD
144862002-01-09 Akim Demaille <akim@epita.fr>
14487
14488 * src/files.c, src/files.h (output_infix): New.
14489 (tab_extension): Remove.
14490 (compute_base_names): Compute the former, drop the latter.
14491 * src/output.c (prepare): Insert the muscles `output-infix', and
14492 `output-suffix'.
14493 * src/parse-skel.y (string, string.1): New.
14494 (section.header): Use it.
14495 (section.yacc): Remove.
14496 (prefix): Remove too.
14497 * src/scan-skel.l: Adjust.
14498 * src/bison.simple, src/bison.hairy: Adjust.
14499
cae60122
AD
145002002-01-09 Akim Demaille <akim@epita.fr>
14501
14502 * configure.in (WERROR_CFLAGS): Compute it.
14503 * src/Makefile.am (CFLAGS): Pass it.
14504 * tests/atlocal.in (CFLAGS): Idem.
14505 * src/files.c: Fix a few warnings.
14506 (get_extension_index): Remove, unused.
14507
ae404801
AD
145082002-01-08 Akim Demaille <akim@epita.fr>
14509
14510 * src/getargs.c (AS_FILE_NAME): New.
14511 (getargs): Use it to convert DOSish file names.
14512 * src/files.c (base_name): Rename as full_base_name to avoid
14513 clashes with `base_name ()'.
14514 (filename_split): New.
14515 (compute_base_names): N-th rewrite, using filename_split.
14516
22312b71
AD
145172002-01-08 Akim Demaille <akim@epita.fr>
14518
14519 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
14520 New, stolen from the Fileutils 4.1.
14521 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14522 * configure.in: Check for the presence of memrchr, and of its
14523 prototype.
14524
a67cef01
TVH
145252002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
14526
14527 * lib/hash.h (__P): Added definition for this macro.
14528 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
14529 BUILT_SOURCES, to ensure they are generated first.
14530 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
14531 %error-verbose to allow bootstrapping with bison 1.30x.
14532
2b25d624
AD
145332002-01-06 Akim Demaille <akim@epita.fr>
14534
14535 * src/reader.c (parse_braces): Don't fetch the next char, the
14536 convention is to fetch on entry.
14537 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
14538 'switch' without a following semicolon.
14539 * tests/regression.at (braces parsing): New.
14540
3460813b
AD
145412002-01-06 Akim Demaille <akim@epita.fr>
14542
14543 Bison is dead wrong in its RR conflict reports.
14544
14545 * tests/torture.at (GNU Cim Grammar): New.
14546 * src/conflicts.c (count_rr_conflicts): Fix.
14547
73784c64
AD
145482002-01-06 Akim Demaille <akim@epita.fr>
14549
14550 Creating package.m4 from configure.ac causes too many problems.
14551
14552 * tests/Makefile.am (package.m4): Create it by hand,
14553 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
14554
25d81090
AD
145552002-01-06 Akim Demaille <akim@epita.fr>
14556
14557 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
14558 skeleton.h.
14559
a9b8959e
PE
145602002-01-04 Paul Eggert <eggert@twinsun.com>
14561
14562 * doc/bison.texinfo (Debugging):
14563 Remove YYSTDERR; it's no longer defined or used.
14564 Also, s/cstdio.h/cstdio/.
14565
25d81090
AD
145662002-01-03 Akim Demaille <akim@epita.fr>
14567
14568 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
14569
1109455c
AD
145702002-01-03 Akim Demaille <akim@epita.fr>
14571
14572 * src/parse-skel.y (process_skeleton): Don't bind the parser's
14573 tracing code to --trace, wait for a better --trace option, with
14574 args.
14575
7ea5e977
AD
145762002-01-03 Akim Demaille <akim@epita.fr>
14577
14578 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
14579 The ISO C++ standard is extremely clear about it: stderr is
14580 considered a macro, not a regular symbol (see table 94 `Header
14581 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
14582 Therefore std:: does not apply to it. It still does with fprintf.
14583 Also, s/cstdio.h/cstdio/.
14584
fab5b110
AD
145852002-01-03 Akim Demaille <akim@epita.fr>
14586
14587 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
14588 for non system headers.
14589
aed7fd9b
AD
145902002-01-02 Akim Demaille <akim@epita.fr>
14591
14592 Equip the skeleton chain with location tracking, runtime trace,
14593 pure parser and scanner.
14594
14595 * src/parse-skel.y: Request a pure parser, locations, and prefix
14596 renaming.
14597 (%union): Having several members with the same type does not help
14598 type mismatches, simplify.
14599 (YYPRINT, yyprint): New.
14600 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
14601 (skel_error): this.
14602 Handle locations.
14603 * src/scan-skel.l: Adjust to these changes.
14604 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
14605 (LOCATION_PRINT, skel_control_t): New.
14606
24fad99e
AD
146072001-12-30 Akim Demaille <akim@epita.fr>
14608
14609 * src/parse-skel.y: Get rid of the shift/reduce conflict:
14610 replace `gb' with BLANKS.
14611 * src/scan-skel.l: Adjust.
14612
a4b36db4
AD
146132001-12-30 Akim Demaille <akim@epita.fr>
14614
14615 * src/system.h: We don't need nor want bcopy.
14616 Throw away MS-DOS crap: we don't need getpid.
14617 * configure.in: We don't need strndup. It was even causing
14618 problems: because Flex includes the headers *before* us,
14619 _GNU_SOURCE is not defined by config.h, and therefore strndup was
14620 not visible.
14621 * lib/xstrndup.c: New.
14622 * src/scan-skel.l: Use it.
14623 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
14624 * src/parse-skel.y: Use %directives instead of #defines.
14625
1239777d
AD
146262001-12-30 Akim Demaille <akim@epita.fr>
14627
14628 * src/skeleton.h: New.
14629 * src/output.c (output_parser, output_master_parser): Remove, dead
14630 code.
14631 * src/output.h (get_lines_number, actions_output, guards_output)
14632 (token_definitions_output): Prototype them.
14633 * src/parse-skel.y: Add the license notice.
14634 Include output.h and skeleton.h.
14635 (process_skeleton): Returns void, and takes a single parameter.
14636 * src/scan-skel.l: Add the license notice.
14637 Include skeleton.h.
14638 Don't use %option yylineno: it seems that then Flex imagines
14639 REJECT has been used, and therefore it won't reallocate its
14640 buffers (which makes no other sense to me than a bug). It results
14641 in warnings for `unused: yy_flex_realloc'.
14642
9b3add5b
RA
146432001-12-30 Robert Anisko <robert.anisko@epita.fr>
14644
14645 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
14646 (MUSCLE_INSERT_PREFIX): ...to there.
14647 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
14648 (MUSCLE_INSERT_PREFIX): Move from here...
14649
14650 * src/bison.hairy: Add a section directive. Put braces around muscle
14651 names. This parser skeleton is still broken, but Bison should not
14652 choke on a bad muscle 'syntax'.
14653 * src/bison.simple: Add a section directive. Put braces around muscle
14654 names.
14655
14656 * src/files.h (strsuffix, stringappend): Add declarations.
14657 (tab_extension): Add declaration.
14658 (short_base_name): Add declaration.
14659
14660 * src/files.c (strsuffix, stringappend): No longer static. These
14661 functions are used in the skeleton parser.
14662 (tab_extension): New.
14663 (compute_base_names): Use the computations done in this function
fab5b110 14664 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
14665 names.
14666 (short_base_name): No longer static.
14667
14668 * src/output.c (output_skeleton): New.
14669 (output): Disable call to output_master_parser, and give a try to
14670 a new skeleton handling system.
14671 (guards_output, actions_output): No longer static.
14672 (token_definitions_output, get_lines_number): No longer static.
14673
14674 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
14675
fab5b110 14676 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
14677 parse-skel.y.
14678
14679 * src/parse-skel.y: New file.
14680 * src/scan-skel.l: New file.
14681
b5b61c61
AD
146822001-12-29 Akim Demaille <akim@epita.fr>
14683
14684 %name-prefix is broken.
14685
14686 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
14687 Adjust all dependencies.
14688 * tests/headers.at (export YYLTYPE): Strengthen this test: use
14689 %name-prefix.
14690
14691 Renaming yylval but not yylloc is not consistent. Now we do.
14692
14693 * src/bison.simple: Prefix yylloc if used.
14694 * doc/bison.texinfo (Decl Summary): Document that.
14695
8c9a50be
AD
146962001-12-29 Akim Demaille <akim@epita.fr>
14697
14698 * doc/bison.texinfo: Promote `%long-directive' over
14699 `%long_directive'.
14700 Remove all references to fixed-output-files, yacc is enough.
14701
d99361e6
AD
147022001-12-29 Akim Demaille <akim@epita.fr>
14703
14704 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
14705 user prologue. These are defaults.
14706 * tests/actions.at (Mid-rule actions): Make sure the user can
14707 define YYDEBUG and YYERROR_VERBOSE.
14708
b9cecb91
AD
147092001-12-29 Akim Demaille <akim@epita.fr>
14710
14711 * src/output.c (header_output): Don't forget to export YYLTYPE and
14712 yylloc.
14713 * tests/headers.at (export YYLTYPE): New, make sure it does.
14714 * tests/regression.at (%union and --defines, Invalid CPP headers):
14715 Move to...
14716 * tests/headers.at: here.
14717
aea13e97
AD
147182001-12-29 Akim Demaille <akim@epita.fr>
14719
14720 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
14721
931394cb
AD
147222001-12-29 Akim Demaille <akim@epita.fr>
14723
14724 * tests/actions.at (Mid-rule actions): Output on a single line
14725 instead of several.
14726
704a47c4
AD
147272001-12-29 Akim Demaille <akim@epita.fr>
14728
14729 * doc/bison.texinfo: Formatting changes.
14730
091e20bb
AD
147312001-12-29 Akim Demaille <akim@epita.fr>
14732
14733 Don't store the token defs in a muscle, just be ready to output it
14734 on command. Now possible via `symbols'. Fixes a memory leak.
14735
14736 * src/output.c (token_definitions_output): New.
14737 (output_parser, header_output): Use it.
14738 * src/reader.c (symbols_save): Remove.
14739
cce71710
AD
147402001-12-29 Akim Demaille <akim@epita.fr>
14741
14742 * src/bison.simple: Do not provide a default for YYSTYPE and
14743 YYLTYPE before the user's prologue. Otherwise it's hardly... a
14744 default.
14745
82c035a8
AD
147462001-12-29 Akim Demaille <akim@epita.fr>
14747
14748 Mid-rule actions are simply... ignored!
14749
14750 * src/reader.c (readgram): Be sure to attach mid-rule actions to
14751 the empty-rule associated to the dummy symbol, not to the host
14752 rule.
14753 * tests/actions.at (Mid-rule actions): New.
14754
8419d367
AD
147552001-12-29 Akim Demaille <akim@epita.fr>
14756
14757 Memory leak.
14758
14759 * src/reader.c (reader): Free grammar.
14760
375d5806
AD
147612001-12-29 Akim Demaille <akim@epita.fr>
14762
14763 Memory leak.
14764
14765 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
14766 since it allocates it for each state, although only one is needed.
14767 (allocate_storage): Do it here.
14768
f51cb8ff
AD
147692001-12-29 Akim Demaille <akim@epita.fr>
14770
14771 * src/options.h, src/options.c (create_long_option_table): Rename
14772 as...
14773 (long_option_table_new): this, with a clearer prototype.
14774 (percent_table): Remove, unused,
14775 * src/getargs.c (getargs): Adjust.
14776
29e88316
AD
147772001-12-29 Akim Demaille <akim@epita.fr>
14778
14779 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
14780 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
14781 as states.
14782
b9f71f19
AD
147832001-12-29 Akim Demaille <akim@epita.fr>
14784
14785 * src/lalr.c (build_relations): Rename `states' as `states1'.
14786 Sorry, I don't understand exactly what it is, no better name...
14787
1a2b5d37
AD
147882001-12-29 Akim Demaille <akim@epita.fr>
14789
14790 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
14791 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
14792 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
14793 as rules.
14794
1cca533e
AD
147952001-12-29 Akim Demaille <akim@epita.fr>
14796
14797 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
14798 ago.
14799
c03ae966
AD
148002001-12-29 Akim Demaille <akim@epita.fr>
14801
14802 * src/reader.c, src/reader.h (user_toknums): Remove.
14803 Adjust all users to use symbols[i]->user_token_number.
14804
5a670b1e
AD
148052001-12-29 Akim Demaille <akim@epita.fr>
14806
14807 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
14808 Adjust all users to use symbols[i]->prec or ->assoc.
14809
ad949da9
AD
148102001-12-29 Akim Demaille <akim@epita.fr>
14811
14812 * src/reader.c, src/reader.h (tags): Remove.
14813 Adjust all users to use symbols[i]->tag.
14814
0e78e603
AD
148152001-12-29 Akim Demaille <akim@epita.fr>
14816
14817 * src/gram.h, src/gram.c (symbols): New, similar to state_table
14818 and rule_table.
14819 * src/reader.c (packsymbols): Fill this table.
14820 Drop sprec.
14821 * src/conflicts.c (resolve_sr_conflict): Adjust.
14822 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
14823 single table.
14824 Use symbols[i]->tag instead of tags[i].
14825
213e640e
AD
148262001-12-29 Akim Demaille <akim@epita.fr>
14827
14828 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
14829 In addition, put a comment in there, to replace...
14830 * tests/regression.at (%union and C comments): Remove.
14831
e7b8bef1
AD
148322001-12-29 Akim Demaille <akim@epita.fr>
14833
14834 * tests/regression.at (Web2c Actions): Blindly move the actual
14835 output as expected output. The contents *seem* right to me, but I
14836 can't pretend reading perfectly parser tables... Nonetheless, all
14837 the other tests pass correctly, the table look OK, even though the
14838 presence of `$axiom' is to be noted: AFAICS it is useless (but
14839 harmless).
14840
b68e7744
AD
148412001-12-29 Akim Demaille <akim@epita.fr>
14842
14843 * src/reader.c (readgram): Don't add the rule 0 if there were no
14844 rules read. In other words, add it _after_ having performed
14845 grammar sanity checks.
14846 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
14847
78d5bae9
AD
148482001-12-29 Akim Demaille <akim@epita.fr>
14849
14850 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
14851 visible, and some states have now a different number.
14852
ff442794
AD
148532001-12-29 Akim Demaille <akim@epita.fr>
14854
14855 * src/reader.c (readgram): Bind the initial rule's lineno to that
14856 of the first rule.
14857 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
14858 (Solved SR Conflicts): Adjust rule 0's line number.
14859
610ab194
AD
148602001-12-29 Akim Demaille <akim@epita.fr>
14861
14862 Fix the `GAWK Grammar' failure.
14863
14864 * src/LR0.c (final_state): Initialize to -1 so that we do compute
14865 the reductions of the first state which was mistakenly confused
14866 with the final state because precisely final_state was initialized
14867 to 0.
14868 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
14869 now noticed by Bison.
14870 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
14871 have a reduction on $default.
14872
29d29c8f
AD
148732001-12-29 Akim Demaille <akim@epita.fr>
14874
14875 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
14876 rule line numbers.
14877 * src/closure.c (print_closure): Likewise.
14878 * src/derives.c (print_derives): Likewise.
14879 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
14880 now.
14881
7c6b64d0
AD
148822001-12-29 Akim Demaille <akim@epita.fr>
14883
14884 * src/lalr.c (lookaheads_print): New.
14885 (lalr): Call it when --trace-flag.
14886 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
14887 are dumped.
14888
3d4daee3
AD
148892001-12-29 Akim Demaille <akim@epita.fr>
14890
14891 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
14892 when walking through ritem, even via rule->rhs.
14893 * src/reduce.c (dump_grammar, useful_production, reduce_output)
14894 (useful_production, useless_nonterminals): Likewise.
14895 (reduce_grammar_tables): Likewise, plus update nritems.
14896 * src/nullable.c (set_nullable): Likewise.
14897 * src/lalr.c (build_relations): Likewise.
14898 * tests/sets.at (Nullable): Adjust.
14899 Fortunately, now, the $axiom is no longer nullable.
14900
9e7f6bbd
AD
149012001-12-29 Akim Demaille <akim@epita.fr>
14902
14903 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
14904 the 0-sentinel.
14905 * src/gram.c (ritem_longest_rhs): Likewise.
14906 * src/reduce.c (nonterminals_reduce): Likewise.
14907 * src/print_graph.c (print_graph): Likewise.
14908 * src/output.c (output_rule_data): Likewise.
14909 * src/nullable.c (set_nullable): Likewise.
14910
255ef638
AD
149112001-12-29 Akim Demaille <akim@epita.fr>
14912
14913 * src/output.c: Comment changes.
14914
0d8a7363
AD
149152001-12-27 Paul Eggert <eggert@twinsun.com>
14916
14917 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
14918 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
14919 Sparc, as they were causing more porting problems than the
14920 (minor) performance improvement was worth.
14921
14922 Also, catch up with 1.31's YYSTD.
14923
3db472b9
AD
149242001-12-27 Akim Demaille <akim@epita.fr>
14925
14926 * src/output.c (output_gram): Rely on nritems, not the
14927 0-sentinel. See below.
14928 Use -1 as separator, not 0.
14929 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
14930 Rely on -1 as separator in yyrhs, instead of 0.
14931 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
14932 twice `Now at end of input', therefore there are two lines less to
14933 expect.
14934
b365aa05
AD
149352001-12-27 Akim Demaille <akim@epita.fr>
14936
14937 * tests/regression.at (Unresolved SR Conflicts):
14938 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
14939 below.
14940
30171f79
AD
149412001-12-27 Akim Demaille <akim@epita.fr>
14942
14943 * src/LR0.c (new_state): Recognize the final state by the fact it
14944 is reached by eoftoken.
14945 (insert_start_shifting_state, insert_eof_shifting_state)
14946 (insert_accepting_state, augment_automaton): Remove, since now
14947 these states are automatically computed from the initial state.
14948 (generate_states): Adjust.
14949 * src/print.c: When reporting a rule number to the user, substract
14950 1, so that the axiom rule is rule 0, and the first user rule is 1.
14951 * src/reduce.c: Likewise.
14952 * src/print_graph.c (print_core): For the time being, just as for
14953 the report, depend upon --trace-flags to dump the full set of
14954 items.
14955 * src/reader.c (readgram): Once the grammar read, insert the rule
14956 0: `$axiom: START-SYMBOL $'.
14957 * tests/set.at: Adjust: rule 0 is now displayed, and since the
14958 number of the states has changed (the final state is no longer
14959 necessarily the last), catch up.
14960
75142d45
AD
149612001-12-27 Akim Demaille <akim@epita.fr>
14962
14963 Try to make the use of the eoftoken valid. Given that its value
14964 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
14965 is used instead of > 0 where appropriate, (ii), depend upon nritems
14966 instead of the 0-sentinel.
14967
14968 * src/gram.h, src/gram.c (nritems): New.
14969 Expected to be duplication of nitems, but for the time being...
14970 * src/reader.c (packgram): Assert nritems and nitems are equal.
14971 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
14972 * src/closure.c (print_closure, print_fderives): Likewise.
14973 * src/gram.c (ritem_print): Likewise.
14974 * src/print.c (print_core, print_grammar): Likewise.
14975 * src/print_graph.c: Likewise.
14976
b7c49edf
AD
149772001-12-27 Akim Demaille <akim@epita.fr>
14978
14979 * src/main.c (main): If there are complains after grammar
14980 reductions, then output the report anyway if requested, then die.
14981 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
14982 * src/reader.c (eoftoken): New.
14983 (parse_token_decl): If the token being defined has value `0', it
14984 is the eoftoken.
14985 (packsymbols): No longer hack `tags' to insert `$' by hand.
14986 Be sure to preserve the value of the eoftoken.
14987 (reader): Make sure eoftoken is defined.
14988 Initialize nsyms to 0: now eoftoken is created just like the others.
14989 * src/print.c (print_grammar): Don't special case the eof token.
14990 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
14991 lie anyway, albeit pleasant.
14992 * tests/calc.at: Exercise error messages with eoftoken.
14993 Change the grammar so that empty input is invalid.
14994 Adjust expectations.
14995 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
14996
ec2da99f
AD
149972001-12-27 Akim Demaille <akim@epita.fr>
14998
14999 * configure.in: Check the protos of strchr ans strspn.
15000 Replace strchr if needed.
15001 * src/system.h: Provide the protos of strchr, strspn and memchr if
15002 missing.
15003 * lib/strchr.c: New.
15004 * src/reader.c (symbols_save): Use strchr.
15005
8adfa272
AD
150062001-12-27 Akim Demaille <akim@epita.fr>
15007
15008 * src/print.c, src/print_graph.c (escape): New.
15009 Use it to quote the TAGS outputs.
15010 * src/print_graph.c (print_state): Now errors are in red, and
15011 reductions in green.
15012 Prefer high to wide: output the state number on a line of its own.
15013
80dac38c
AD
150142001-12-27 Akim Demaille <akim@epita.fr>
15015
15016 * src/state.h, src/state.c (reductions_new): New.
15017 * src/LR0.c (set_state_table): Let all the states have a
15018 `reductions', even if reduced to 0.
15019 (save_reductions): Adjust.
15020 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
15021 * src/print.c (print_reductions, print_actions): Adjust.
15022 * src/output.c (action_row): Adjust.
15023
2cec70b9
AD
150242001-12-27 Akim Demaille <akim@epita.fr>
15025
15026 * src/state.h, src/state.c (errs_new, errs_dup): New.
15027 * src/LR0.c (set_state_table): Let all the states have an errs,
15028 even if reduced to 0.
15029 * src/print.c (print_errs, print_reductions): Adjust.
15030 * src/output.c (output_actions, action_row): Adjust.
15031 * src/conflicts.c (resolve_sr_conflict): Adjust.
15032
13ca549a
AD
150332001-12-27 Akim Demaille <akim@epita.fr>
15034
15035 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
15036
5092aba5
AD
150372001-12-27 Akim Demaille <akim@epita.fr>
15038
15039 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
15040 * src/print.c: here.
15041 (lookaheadset, shiftset): New, used as additional storage by
15042 print_reductions.
15043 (print_results): Adjust.
15044 (print_shifts, print_gotos, print_errs): New, extracted from...
15045 (print_actions): here.
15046 * src/print_graph.c (print_actions): Remove dead code.
15047
11e2beca
AD
150482001-12-27 Akim Demaille <akim@epita.fr>
15049
15050 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
15051 `$n' and `@n'.
15052
dac3c910
AD
150532001-12-27 Akim Demaille <akim@epita.fr>
15054
15055 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
15056 (build_relations): Adjust.
15057
d0b0fefa
AD
150582001-12-27 Akim Demaille <akim@epita.fr>
15059
15060 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
15061 duplication.
15062
adc8c848
AD
150632001-12-27 Akim Demaille <akim@epita.fr>
15064
15065 * src/reader.c (packgram): Catch nitems overflows.
15066
14d293ac
AD
150672001-12-27 Akim Demaille <akim@epita.fr>
15068
15069 * src/files.c, src/files.h (guard_obstack): Remove.
15070 * src/output.c (output): Adjust.
15071 * src/reader.c (parse_braces): New, factoring...
15072 (copy_action, copy_guard): these two which are renamed as...
15073 (parse_action, parse_guard): these.
15074 As a voluntary consequence, using braces around guards is now
15075 mandatory.
15076
f499b062
AD
150772001-12-27 Akim Demaille <akim@epita.fr>
15078
15079 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
15080 * src/reader.c (symbol_list): `guard' and `guard_line' are new
15081 members.
15082 (symbol_list_new): Adjust.
15083 (copy_action): action_line is the first line, not the last.
15084 (copy_guard): Just as for actions, store the `action' only, not
15085 the switch/case/break flesh.
15086 Don't parse the user action that might follow the guard, let...
15087 (readgram): do it, i.e., now, there can be an action after a
15088 guard.
15089 In other words the guard is just explicitly optional.
15090 (packgram): Adjust.
15091 * src/output.c (guards_output): New.
15092 (output_parser): Call it when needed.
15093 (output): Also free the guard and attrs obstacks.
15094 * src/files.c, src/files.h (obstack_save): Remove.
15095 (output_files): Remove.
15096 As a result, if one needs the former `.act' file, using an
15097 appropriate skeleton which requires actions and guards is now
15098 required.
15099 * src/main.c (main): Adjust.
15100 * tests/semantic.at: New.
15101 * tests/regression.at: Use `input.y' as input file name.
15102 Avoid 8+3 problems by requiring input.c when the test needs the
15103 parser.
15104
d945f5cd
AD
151052001-12-27 Akim Demaille <akim@epita.fr>
15106
15107 * src/reader.c (symbol_list_new): Be sure to initialize all the
15108 fields.
15109
d200e455
AD
151102001-12-27 Akim Demaille <akim@epita.fr>
15111
15112 All the hacks using a final pseudo state are now useless.
15113
15114 * src/LR0.c (set_state_table): state_table holds exactly nstates.
15115 * src/lalr.c (nLA): New.
15116 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
15117 instead of lookaheadsp from the pseudo state (nstate + 1).
15118
f9507c28
AD
151192001-12-27 Akim Demaille <akim@epita.fr>
15120
15121 * src/output.c (action_row, token_actions): Use a state_t instead
15122 of a integer, and nlookaheads instead of the following state's
15123 lookaheadsp.
15124
065fbd27
AD
151252001-12-27 Akim Demaille <akim@epita.fr>
15126
15127 * src/conflicts.c (log_resolution, flush_shift)
15128 (resolve_sr_conflict, set_conflicts, solve_conflicts)
15129 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
15130 (conflicts_print, print_reductions): Use a state_t instead of an
15131 integer when referring to a state.
15132 As much as possible, depend upon nlookaheads, instead of the
15133 `lookaheadsp' member of the following state (since lookaheads of
15134 successive states are successive, the difference between state n + 1
15135 and n served as the number of lookaheads for state n).
15136 * src/lalr.c (add_lookback_edge): Likewise.
15137 * src/print.c (print_core, print_actions, print_state)
15138 (print_results): Likewise.
15139 * src/print_graph.c (print_core, print_actions, print_state)
15140 (print_graph): Likewise.
15141 * src/conflicts.h: Adjust.
15142
1b177bd7
AD
151432001-12-27 Akim Demaille <akim@epita.fr>
15144
15145 * src/bison.hairy: Formatting/comment changes.
15146 ANSIfy.
15147 Remove `register' indications.
15148 Add plenty of `static'.
15149
7742ddeb
AD
151502001-12-27 Akim Demaille <akim@epita.fr>
15151
15152 * src/output.c (prepare): Drop the muscle `ntbase' which
15153 duplicates ntokens.
15154 * src/bison.simple: Formatting/comment changes.
15155 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
15156 is an undocumented synonym.
15157
1fa14068
AD
151582001-12-22 Akim Demaille <akim@epita.fr>
15159
15160 * src/output.c (output_table_data): Change the prototype to use
15161 `int' for array ranges: some invocations do pass an int, not a
15162 short.
15163 Reported by Wayne Green.
15164
b9752825
AD
151652001-12-22 Akim Demaille <akim@epita.fr>
15166
15167 Some actions of web2c.y are improperly triggered.
15168 Reported by Mike Castle.
15169
15170 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
15171 * tests/regression.at (Web2c): Rename as...
15172 (Web2c Report): this.
15173 (Web2c Actions): New.
15174
776209d6
AD
151752001-12-22 Akim Demaille <akim@epita.fr>
15176
15177 Reductions in web2c.y are improperly reported.
15178 Reported by Mike Castle.
15179
15180 * src/conflicts.c (print_reductions): Fix.
15181 * tests/regression.at (Web2c): New.
15182
275fc3ad
AD
151832001-12-18 Akim Demaille <akim@epita.fr>
15184
15185 Some host fail on `assert (!"foo")', which expands to
15186 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
15187 Reported by Nelson Beebee.
15188
15189 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
15190 `#define it_succeeded 0' and `assert (it_succeeded)'.
15191
897668ee
MA
151922001-12-17 Marc Autret <autret_m@epita.fr>
15193
15194 * src/bison.simple: Don't hard code the skeleton line and filename.
15195 * src/output.c (output_parser): Rename 'line' as 'output_line'.
15196 New line counter 'skeleton_line' (skeleton-line muscle).
15197
ab3399e0
PE
151982001-12-17 Paul Eggert <eggert@twinsun.com>
15199
15200 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
15201 YYDEBUG must be defined to a nonzero value.
15202
15203 * src/bison.simple (yytname): Do not assume that the user defines
15204 YYDEBUG to a properly parenthesized expression.
15205
3877f72b
AD
152062001-12-17 Akim Demaille <akim@epita.fr>
15207
15208 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
15209 nlookaheads is a new member.
15210 Adjust all users.
15211 * src/lalr.h (nlookaheads): Remove this orphan declaration.
15212 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
15213 state.
776209d6 15214
331dbc1b
AD
152152001-12-17 Akim Demaille <akim@epita.fr>
15216
15217 * src/files.h, src/files.c (open_files, close_files): Remove.
15218 * src/main.c (main): Don't open/close files, nor invoke lex_free,
15219 let...
15220 * src/reader.c (reader): Do it.
776209d6 15221
be750e4c
AD
152222001-12-17 Akim Demaille <akim@epita.fr>
15223
15224 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 15225
709ae8c6
AD
152262001-12-17 Akim Demaille <akim@epita.fr>
15227
15228 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
15229 (flush_reduce): New.
15230 (resolve_sr_conflict): Adjust.
776209d6 15231
f87685c3
AD
152322001-12-17 Akim Demaille <akim@epita.fr>
15233
15234 * src/output.c (output_obstack): Be static and rename as...
15235 (format_obstack): this, to avoid any confusion with files.c's
15236 output_obstack.
15237 * src/reader.h (muscle_obstack): Move to...
15238 * src/output.h: here, since it's defined in output.c.
15239
837491d8
AD
152402001-12-17 Akim Demaille <akim@epita.fr>
15241
15242 * src/output.c (action_row, save_column, default_goto)
15243 (sort_actions, matching_state, pack_vector): Better variable
15244 locality.
15245
796d61fb
AD
152462001-12-17 Akim Demaille <akim@epita.fr>
15247
15248 * src/output.c: Various formatting changes.
776209d6 15249
64d15509
AD
152502001-12-17 Akim Demaille <akim@epita.fr>
15251
15252 * src/files.c (output_files): Free the output_obstack.
15253 * src/main.c (main): Call print and print_graph conditionally.
15254 * src/print.c (print): Work unconditionally.
15255 * src/print_graph.c (print_graph): Work unconditionally.
15256 * src/conflicts.c (log_resolution): Output only if verbose_flag.
15257
fbc8ecb7
MA
152582001-12-16 Marc Autret <autret_m@epita.fr>
15259
15260 * src/output.c (actions_output): Fix. When we use %no-lines,
15261 there is one less line per action.
15262
f0440388
MA
152632001-12-16 Marc Autret <autret_m@epita.fr>
15264
15265 * src/bison.simple: Remove a useless #line directive.
15266 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
15267 * src/output.c (get_lines_number): New.
776209d6 15268 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
15269 output muscles.
15270 Fix line numbering.
15271 (actions_output): Computes the number of lines taken by actions.
15272 (output_master_parser): Insert new skeleton which is the name of
15273 the output parser file name.
15274
a79986b8
MA
152752001-12-15 Marc Autret <autret_m@epita.fr>
15276
15277 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
15278
4ec8e00f
MA
152792001-12-15 Marc Autret <autret_m@epita.fr>
15280
15281 * src/output.c (output_gram): Keep track of the hairy one.
15282
1a4648ff
AD
152832001-12-15 Akim Demaille <akim@epita.fr>
15284
15285 Make `make distcheck' work.
15286
15287 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
15288 system.h which uses libgettext.h.
15289
9c2c67e6
AD
152902001-12-15 Akim Demaille <akim@epita.fr>
15291
15292 * src/nullable.c (set_nullable): Useless rules must be skipped,
15293 otherwise, since we range over their symbols, we might look at a
15294 nonterminal which no longer ``exists'', i.e., it is not counted in
15295 `nvars', hence we overflow our arrays.
15296
93ede233
AD
152972001-12-15 Akim Demaille <akim@epita.fr>
15298
15299 The header can also be produced directly, without any obstack!
15300 Yahoo!
15301
15302 * src/files.c, src/files.h (defines_obstack): Remove.
15303 (compute_header_macro): Global.
15304 (defines_obstack_save): Remove.
15305 * src/reader.c (parse_union_decl): No longer output to
15306 defines_obstack: its content can be found in the `stype' muscle
15307 anyway.
15308 (output_token_translations): Merge into...
15309 (symbols_output): this.
15310 Rename as...
15311 (symbols_save): this.
15312 (reader): Adjust.
15313 * src/output.c (header_output): New.
15314 (output): Call it.
15315
2666f928
AD
153162001-12-15 Akim Demaille <akim@epita.fr>
15317
15318 * src/reader.c (parse_union_decl): Instead of handling two obstack
15319 simultaneously, use one to define the `stype' muscle, and use the
15320 value of the latter to fill defines_obstack.
15321 (copy_comment): Remove.
15322 (copy_comment2): Work for a single obstack.
15323 Rename as...
15324 (copy_comment): this.
15325
428046f8
AD
153262001-12-15 Akim Demaille <akim@epita.fr>
15327
15328 * src/lex.c, src/lex.h (xgetc): No longer static.
15329 * src/reader.c (parse_union_decl): Revamp.
15330
ea52d706
AD
153312001-12-15 Akim Demaille <akim@epita.fr>
15332
15333 Still making progress in separating Bison into (i) input, (ii)
15334 process, (iii) output: now we can directly output the parser file
15335 without using table_obstack at all.
15336
15337 * src/files.c, src/files.h (table_obstack): Bye bye.
15338 (parser_file_name): New.
15339 * src/files.c (compute_output_file_names): Compute it.
15340 * src/output.c (actions_output, output_parser)
15341 (output_master_parser): To a file instead of an obstack.
15342
3f96f4dc
AD
153432001-12-15 Akim Demaille <akim@epita.fr>
15344
15345 Attach actions to rules, instead of pre-outputting them to
15346 actions_obstack.
15347
15348 * src/gram.h (rule_t): action and action_line are new members.
15349 * src/reader.c (symbol_list): Likewise.
15350 (copy_action): Save the actions within the rule.
15351 (packgram): Save them in rule_table.
15352 * src/output.c (actions_output): New.
15353 (output_parser): Use it on `%%actions'.
15354 (output_rule_data): Don't free rule_table.
15355 (output): Do it.
15356 (prepare): Don't save the `action' muscle.
15357 * src/bison.simple: s/%%action/%%actions/.
15358
51576fb3
AD
153592001-12-15 Akim Demaille <akim@epita.fr>
15360
15361 * src/reader.c (copy_action): When --yacc, don't append a `;'
15362 to the user action: let it fail if lacking.
dee049eb 15363 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 15364
2648a72d
AD
153652001-12-14 Akim Demaille <akim@epita.fr>
15366
15367 * src/lex.c (literalchar): Simply return the char you decoded, non
15368 longer mess around with obstacks and int pointers.
15369 Adjust all callers.
15370
92790e5b
AD
153712001-12-14 Akim Demaille <akim@epita.fr>
15372
15373 * src/lex.c (literalchar): Don't escape the special characters,
15374 just decode them, and keep them as char (before, eol was output as
15375 the 2 char string `\n' etc.).
15376 * src/output.c (output_rule_data): Use quotearg to output the
15377 token strings.
15378
927c1557
PE
153792001-12-13 Paul Eggert <eggert@twinsun.com>
15380
15381 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
15382 Do not infringe on the global user namespace when using C++.
15383 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
15384 All uses of `fprintf' and `stderr' changed.
15385
15386 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
15387
ed8e1f68
AD
153882001-12-13 Akim Demaille <akim@epita.fr>
15389
15390 The computation of nullable is broken: it doesn't handle empty
15391 RHS's properly.
15392
15393 * tests/torture.at (GNU AWK Grammar): New.
15394 * tests/sets.at (Nullable): New.
15395 * src/nullable.c (set_nullable): Instead of blindly looping over
15396 `ritems', loop over the rules, and then over their rhs's.
15397
15398 Work around Autotest bugs.
15399
15400 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
15401 frame, because Autotest understand lines starting with a `+' as
15402 traces from the shell. Then, they are not processed properly.
15403 Admittedly an Autotest bug, but we don't have time to wait for
15404 Autotest to catch up.
15405 * tests/regression.at (Broken Closure): Adjust to the new table
15406 frames.
15407 Move to...
15408 * tests/sets.at: here.
15409
cb581495
AD
154102001-12-13 Akim Demaille <akim@epita.fr>
15411
15412 * src/closure.c (closure): Use nrules instead of playing tricks
15413 with BITS_PER_WORD.
15414
2e729273
AD
154152001-12-13 Akim Demaille <akim@epita.fr>
15416
15417 * src/print.c (print_actions): Output the handling of `$' as the
15418 traces do: shifting the token EOF. Before EOF was treated as a
15419 nonterminal.
15420 * tests/regression.at: Adjust some tests.
15421 * src/print_graph.c (print_core): Complete the set of items via
15422 closure. The next-to-final and final states are still unsatisfying,
15423 but that's to be addressed elsewhere.
15424 No longer output the rule numbers, but do output the state number.
15425 A single loop for the shifts + gotos is enough, but picked a
15426 distinct color for each.
15427 (print_graph): Initialize and finalize closure.
15428
107f7dfb
AD
154292001-12-13 Akim Demaille <akim@epita.fr>
15430
15431 * src/reader.c (readgram): Remove dead code, an strip useless
15432 braces.
15433 (get_type): Remove, unused.
15434
9b53a24f
AD
154352001-12-12 Akim Demaille <akim@epita.fr>
15436
15437 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
15438 on that of lib/error.c.
15439
dbfb6dcd
AD
154402001-12-12 Akim Demaille <akim@epita.fr>
15441
15442 Some hosts don't like `/' in includes.
15443
15444 * src/system.h: Include libgettext.h without qualifying the path.
15445 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
15446 $(top_srcdir).
15447
c25fb648
MA
154482001-12-11 Marc Autret <autret_m@epita.fr>
15449
15450 * src/output.c (output_parser): Remove useless muscle.
15451
710ddc4f
MA
154522001-12-11 Marc Autret <autret_m@epita.fr>
15453
15454 * src/bison.simple: Remove #line just before %%epilogue. It
15455 is now handled in ...
15456 * src/reader.c (read_additionnal_code): Add the output of a
15457 #line for the epilogue.
15458
e83d80b8
MA
154592001-12-10 Marc Autret <autret_m@epita.fr>
15460
927c1557 15461 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
15462 replace precedent remove.
15463 * src/bison.simple: Remove #line before %%prologue because
15464 %%input-line is wrong at this time.
15465
971d5158
MA
154662001-12-10 Marc Autret <autret_m@epita.fr>
15467
15468 * src/reader.c (symbols_output): Clean up.
927c1557 15469 * src/output.c (output_gram, output): Clean up.
971d5158 15470
5edafffd
AD
154712001-12-10 Akim Demaille <akim@epita.fr>
15472
15473 * src/lalr.c (initialize_lookaheads): New. Extracted from...
15474 * src/LR0.c (set_state_table): here.
15475 * src/lalr.c (lalr): Call it.
15476
0279f8e9
AD
154772001-12-10 Akim Demaille <akim@epita.fr>
15478
15479 * src/state.h (shifts): Remove the `number' member: shifts are
15480 attached to state, hence no longer need to be labelled with a
15481 state number.
15482
190c4f5f
AD
154832001-12-10 Akim Demaille <akim@epita.fr>
15484
15485 Now that states have a complete set of members, the linked list of
15486 shifts is useless: just fill directly the state's shifts member.
15487
15488 * src/state.h (shifts): Remove the `next' member.
15489 * src/LR0.c (first_state, last_state): Remove.
15490 Adjust the callers.
15491 (augment_automaton): Don't look for the shifts that must be added
15492 a shift on EOF: it is those of the state we looked for! But now,
15493 since shifts are attached, it is no longer needed to looking
15494 merely by its id: its number.
15495
2a73b93d
AD
154962001-12-10 Akim Demaille <akim@epita.fr>
15497
15498 * src/LR0.c (augment_automaton): Better variable locality.
15499 Remove an impossible branch: if there is a state corresponding to
15500 the start symbol being shifted, then there is shift for the start
15501 symbol from the initial state.
15502
74392f6a
AD
155032001-12-10 Akim Demaille <akim@epita.fr>
15504
15505 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
15506 only when appropriate: when insert_start_shifting_state' is not
15507 invoked.
15508 * tests/regression.at (Rule Line Numbers): Adjust.
15509
37c82725
AD
155102001-12-10 Akim Demaille <akim@epita.fr>
15511
15512 * src/LR0.c (augment_automaton): Now that all states have shifts,
15513 merge the two cases addition shifts to the initial state.
15514
6a164e0c
AD
155152001-12-10 Akim Demaille <akim@epita.fr>
15516
15517 * src/lalr.c (set_state_table): Move to...
15518 * src/LR0.c: here.
15519 * src/lalr.c (lalr): Don't call it...
15520 * src/LR0.c (generate_states): do it.
15521 * src/LR0.h (first_state): Remove, only the table is used.
15522
7215de24
AD
155232001-12-10 Akim Demaille <akim@epita.fr>
15524
15525 * src/LR0.h (first_shift, first_reduction): Remove.
15526 * src/lalr.c: Don't use first_shift: find shifts through the
15527 states.
15528
80e25d4d
AD
155292001-12-10 Akim Demaille <akim@epita.fr>
15530
15531 * src/LR0.c: Attach shifts to states as soon as they are
15532 computed.
15533 * src/lalr.c (set_state_table): Instead of assigning shifts to
15534 state, just assert that the mapping was properly done.
15535
0ab3728b
AD
155362001-12-10 Akim Demaille <akim@epita.fr>
15537
15538 * src/LR0.c (insert_start_shift): Rename as...
15539 (insert_start_shifting_state): this.
15540 (insert_eof_shifting_state, insert_accepting_state): New.
15541 (augment_automaton): Adjust.
15542 Better locality of the variables.
15543 When looking if the start_symbol is shifted from the initial
15544 state, using `while (... symbol != start_symbol ...)' sounds
15545 better than `while (... symbol < start_symbol ...)': If fail
15546 to see how the order between symbols could be relevant!
15547
78af9bbc
AD
155482001-12-10 Akim Demaille <akim@epita.fr>
15549
15550 * src/getargs.h: Don't declare `spec_name_prefix' and
15551 `spec_file_prefix', declared by src/files.h.
15552 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
15553 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
15554 * src/output.c (prepare): Adjust.
15555 * src/reader.c (symbols_output): Likewise.
15556 * src/vmsgetargs.c: Vaguely adjust, but who cares?
15557
bdef2a41
AD
155582001-12-10 Akim Demaille <akim@epita.fr>
15559
15560 * src/muscle_tab.c (muscle_init): NULL is a better default than
15561 `"0"'.
15562
3735969c
AD
155632001-12-10 Akim Demaille <akim@epita.fr>
15564
15565 * src/reader.c (reader): Calling symbols_output once is enough.
15566
49701457
AD
155672001-12-10 Akim Demaille <akim@epita.fr>
15568
15569 Now that states have a complete set of members, the linked list of
15570 reductions is useless: just fill directly the state's reductions
15571 member.
15572
15573 * src/state.h (struct reductions): Remove member `number' and
15574 `next'.
15575 * src/LR0.c (first_reduction, last_reduction): Remove.
15576 (save_reductions): Don't link the new reductions, store them in
15577 this_state.
15578 * src/lalr.c (set_state_table): No need to attach reductions to
15579 states, it's already done.
15580 * src/output.c (output_actions): No longer free the shifts, then
15581 the reductions, then the states: free all the states and their
15582 members.
15583
0edad749
AD
155842001-12-10 Akim Demaille <akim@epita.fr>
15585
15586 * src/options.c (OPTN, DRTV, BOTH): New.
15587 (option_table): Use them.
15588
0edad749
AD
15589 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
15590 the job of system.h.
15591 * src/options.c: Don't include stdio.h and xalloc.h for the same
15592 reasons.
15593
5449dd0f
AD
155942001-12-10 Akim Demaille <akim@epita.fr>
15595
15596 * src/output.c (output, prepare): Make sure the values of the
15597 muscles `action' and `prologue' are 0-terminated.
15598
a870c567
AD
155992001-12-10 Akim Demaille <akim@epita.fr>
15600
15601 Clean up GCC warnings.
15602
15603 * src/reader.c (copy_action): `buf' is not used.
15604 (parse_skel_decl): Be static.
15605 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
15606 * src/options.h (create_long_option_table): Have a real prototype.
15607 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
15608 (hash_delete_at): Return const void *.
15609 Adjust casts to preserve the const.
15610
80df8768
AD
156112001-12-10 Akim Demaille <akim@epita.fr>
15612
15613 * configure.in: Require 2.52g.
15614 M4 is not needed, but AUTOM4TE is.
15615 * m4/m4.m4: Remove.
15616 * tests/Makefile.am: Adjust.
15617
f693ad14
AD
156182001-12-10 Akim Demaille <akim@epita.fr>
15619
15620 One structure for states is enough, even though theoretically
15621 there are LR(0) states and LALR(1) states.
15622
15623 * src/lalr.h (state_t): Remove.
15624 (state_table): Be state_t **, not state_t *.
15625 * src/state.h (core, CORE_ALLOC): Rename as...
15626 (state_t, STATE_ALLOC): this.
15627 Add the LALR(1) members: shifts, reductions, errs.
15628 * src/LR0.c (state_table): Rename as...
15629 (state_hash): this, to avoid name clashes with the global
15630 `state_table'.
15631 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
15632 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
15633
74ffbcb6
AD
156342001-12-10 Akim Demaille <akim@epita.fr>
15635
15636 Bison dumps core on bash.y.
15637 Reported by Pascal Bart.
15638
15639 * src/warshall.c (bitmatrix_print): New.
15640 (TC): Use it.
ba0fe3c7 15641 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
15642 j must be the outer loop.
15643 * tests/regression.at (Broken Closure): New.
15644
07708e19
AD
156452001-12-05 Akim Demaille <akim@epita.fr>
15646
15647 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
15648 its argument.
ba1ecc07 15649 Reported by Peter Hamorsky.
07708e19 15650
92b16366
AD
156512001-12-05 Akim Demaille <akim@epita.fr>
15652
15653 * src/conflicts.c (err_table): Remove.
15654 (resolve_sr_conflict): Adjust.
15655 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
15656 Rename as...
15657 (state_t.reductions, state_t.shifts): this.
15658
076ab033
AD
156592001-12-05 Akim Demaille <akim@epita.fr>
15660
15661 * src/reduce.c (reduce_grammar_tables): No longer disable the
15662 removal of useless rules via CPP but via `if (0)', so that the
15663 compiler still check the code is valid.
15664 For instance, it should have noticed `rline' no longer exists: use
15665 the `line' member of rule_t.
15666 * src/gram.c (dummy, rline): Remove, unused.
15667
3843c413
AD
156682001-12-05 Akim Demaille <akim@epita.fr>
15669
15670 * src/output.c (pack_vector): Use assert, not berror.
15671 * src/main.c (berror): Remove, unused.
15672
43168960
AD
156732001-12-05 Akim Demaille <akim@epita.fr>
15674
15675 New experimental feature: if --verbose --trace output all the
15676 items of a state, not only its kernel.
15677
15678 * src/print.c (print_core): If `trace_flag', then invoke closure
15679 before outputting the items of the state (print_core is no longer
15680 a correct name them).
15681 (print_results): Invoke new_closure/free_closure if needed.
15682
b2872512
AD
156832001-12-05 Akim Demaille <akim@epita.fr>
15684
15685 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
15686 * src/closure.c, src/closure.h (itemsetsize): Rename as...
15687 (nitemset): for consistency with the rest of the project.
15688
23cbcc6c
AD
156892001-12-05 Akim Demaille <akim@epita.fr>
15690
15691 * src/closure.c (print_closure): Improve.
15692 (closure): Use it for printing input and output.
15693
03ec521c
AD
156942001-12-05 Akim Demaille <akim@epita.fr>
15695
15696 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
15697 indexed by nonterminals.
15698
3a7456dd
AD
156992001-12-05 Akim Demaille <akim@epita.fr>
15700
15701 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
15702 what it was!).
15703 * src/warshall.h: Remove accidental duplication of the content.
15704
1cbcf2e7
AD
157052001-12-05 Akim Demaille <akim@epita.fr>
15706
15707 * src/closure.c (set_fderives): De-obfuscate.
15708
84182270
AD
157092001-12-05 Akim Demaille <akim@epita.fr>
15710
15711 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
15712
3f6f053c
AD
157132001-12-05 Akim Demaille <akim@epita.fr>
15714
15715 * src/closure.c (set_firsts): De-obfuscate.
15716
7a5350ba
AD
157172001-12-05 Akim Demaille <akim@epita.fr>
15718
15719 * src/output.c (action_row): De-obfuscate
15720 using the good o' techniques: arrays not pointers, variable
15721 locality, BITISSET, RESETBIT etc.
15722
d954473d
AD
157232001-12-05 Akim Demaille <akim@epita.fr>
15724
15725 Pessimize the code to simplify it: from now on, all the states
15726 have a valid SHIFTS, which NSHIFTS is possibly 0.
15727
15728 * src/LR0.c (shifts_new): Be global and move to..
15729 * src/state.c, src/state.h: here.
15730 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
15731 * src/print_graph: Adjust.
15732
9839bbe5
AD
157332001-12-05 Akim Demaille <akim@epita.fr>
15734
15735 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
15736 * src/conflicts.c: Use it.
15737 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
15738 incorrectly ``simplified''.
15739
9f136c07
AD
157402001-12-05 Akim Demaille <akim@epita.fr>
15741
15742 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
15743 using the good o' techniques: arrays not pointers, variable
15744 locality, BITISSET, RESETBIT etc.
15745
b608206e
AD
157462001-12-05 Akim Demaille <akim@epita.fr>
15747
15748 * src/state.h (SHIFT_SYMBOL): New.
15749 * src/conflicts.c: Use it to deobfuscate.
15750
52afa962
AD
157512001-12-05 Akim Demaille <akim@epita.fr>
15752
15753 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
15754 (print_reductions): De-obfuscate using the good o' techniques:
15755 arrays not pointers, variable locality, BITISSET.
15756
e74dc321
AD
157572001-12-05 Akim Demaille <akim@epita.fr>
15758
15759 * src/conflicts.c (print_reductions): Arrays, not pointers.
15760 Use BITISSET.
15761
768fca83
AD
157622001-12-05 Akim Demaille <akim@epita.fr>
15763
15764 * src/conflicts.c (print_reductions): Pessimize, but clarify.
15765
a17e599f
AD
157662001-12-05 Akim Demaille <akim@epita.fr>
15767
15768 * src/conflicts.c (print_reductions): Improve variable locality.
15769
a04bc341
AD
157702001-12-05 Akim Demaille <akim@epita.fr>
15771
15772 * src/conflicts.c (print_reductions): Pessimize, but clarify.
15773
c8ea038e
AD
157742001-12-05 Akim Demaille <akim@epita.fr>
15775
15776 * src/conflicts.c (print_reductions): Improve variable locality.
15777
aa2aab3c
AD
157782001-12-05 Akim Demaille <akim@epita.fr>
15779
15780 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
15781 * src/lalr.c: Use them.
15782
b178c8cc
AD
157832001-12-05 Akim Demaille <akim@epita.fr>
15784
15785 * src/LR0.c (augment_automaton): Formatting changes.
15786 Better variable locality.
15787
f67d13aa
AD
157882001-12-05 Akim Demaille <akim@epita.fr>
15789
15790 * src/lalr.c (matrix_print): New.
15791 (transpose): Use it.
15792 Use arrays instead of pointers.
15793
c2713865
AD
157942001-12-05 Akim Demaille <akim@epita.fr>
15795
15796 * src/lalr.c (maxrhs): Move to...
15797 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
15798 * src/lalr.c (build_relations): Adjust.
15799
9887c18a
AD
158002001-12-05 Akim Demaille <akim@epita.fr>
15801
15802 * src/lalr.c (transpose): Free the memory allocated to the
15803 argument, as it is replaced by the results by the unique caller.
15804 (build_relations): Merely invoke transpose: it handles the memory
15805 deallocation.
15806 Improve variable locality.
15807 Avoid variables used as mere abbreviations.
15808 (compute_lookaheads): Use arrays instead of pointers.
15809
4d4f699c
AD
158102001-12-05 Akim Demaille <akim@epita.fr>
15811
15812 * src/lalr.c (initialize_F): Improve variable locality.
15813 Avoid variables used as mere abbreviations.
15814
80a69750
AD
158152001-12-05 Akim Demaille <akim@epita.fr>
15816
15817 * src/derives.c (print_derives): Display the ruleno.
15818 * src/lalr.c (initialize_F, transpose): Better variable locality
15819 to improve readability.
15820 Avoid variables used as mere abbreviations.
15821
fe961097
AD
158222001-12-05 Akim Demaille <akim@epita.fr>
15823
15824 * src/lalr.c (traverse): Use arrays instead of pointers.
15825
e3e4e814
AD
158262001-12-05 Akim Demaille <akim@epita.fr>
15827
15828 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
15829 the handling of squeue.
15830 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15831
630e182b
AD
158322001-12-05 Akim Demaille <akim@epita.fr>
15833
15834 Because useless nonterminals are now kept alive (instead of being
15835 `destroyed'), we now sometimes examine them, and store information
15836 related to them. Hence we need to know their number, and adjust
15837 memory allocations.
15838
15839 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
15840 static.
15841 * src/LR0.c (allocate_itemsets): The memory allocated to
15842 `symbol_count' was used for two different purpose: once to count
15843 the number of occurrences of each symbol, and later reassigned to
15844 `shift_symbol', containing the symbol that can be shifted from a
15845 given state.
15846 Deobfuscate, i.e., allocate, use and free `symbol_count' here
15847 only, and...
15848 (new_itemsets): Allocate `shift_symbol' here.
15849 (allocate_itemsets): symbol_count includes useless nonterminals.
15850 Make room for them.
15851 (free_storage): Use `free', not `XFREE', for pointers that cannot
15852 be null.
15853
81b51460
AD
158542001-12-05 Akim Demaille <akim@epita.fr>
15855
15856 * src/nullable.c (set_nullable): Deobfuscate the handling of
15857 ritem.
15858 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
15859
3067fbef
AD
158602001-12-05 Akim Demaille <akim@epita.fr>
15861
15862 * src/gram.c, src/gram.h (ritem_print): New.
15863 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
15864 (This useless function was defined only to work around VMS linkers
15865 that can't handle compilation units with variables only).
15866 * src/reduce.c (dump_grammar): Use it to trace the construction of
15867 ritem.
15868
c2bea5f9
PE
158692001-12-04 Paul Eggert <eggert@twinsun.com>
15870
7d27c823
PE
15871 * src/bison.simple (union yyalloc): Change member names
15872 to be the same as the stack names.
15873 (yyparse): yyptr is now union yyalloc *, not char *.
15874 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
15875 and may generate better code on some machines.
c2bea5f9
PE
15876 (yystpcpy): Use prototype if __STDC__ is defined, not just
15877 if __cplusplus is defined.
35687a9d 15878
2c8a9dfa
AD
158792001-11-30 Akim Demaille <akim@epita.fr>
15880
15881 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
15882 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
15883 Gettext doesn't compile cleanly, and dies with -Werror.
15884 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
15885 Include WARNING_CFLAGS here.
15886 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
15887 before being defined.
15888
f4e421e6
AD
158892001-11-27 Paul Eggert <eggert@twinsun.com>
15890
15891 * lib/quotearg.h (quotearg_n, quotearg_n_style):
15892 First arg is int, not unsigned.
15893 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
15894 (SIZE_MAX, UINT_MAX): New macros.
15895 (quotearg_n_options): Abort if N is negative.
15896 Avoid overflow check on hosts where size_t is 64 bits and int
15897 is 32 bits, as overflow is impossible there.
15898 Fix off-by-one typo that caused unnecessary reallocation.
15899
7093d0f5
AD
159002001-11-29 Paul Eggert <eggert@twinsun.com>
15901
15902 Name space cleanup in generated parser.
15903
15904 * doc/bison.texinfo (Bison Parser): Discuss system headers
15905 and their effect on the user name space.
15906
15907 * src/bison.simple:
15908 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
15909 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
15910 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
15911
15912 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
15913 on user names when possible.
15914
15915 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
15916 Simplify test for whather <alloca.h> exists.
15917
15918 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
15919
15920 (<stdio.h>): Include if YYDEBUG.
15921
15922 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
15923 ! defined (yyoverflow) && ! defined (yymemcpy).
15924
15925 (yymemcpy, yyparse): Rename local variables as needed so that
15926 they all begin with 'yy'.
15927
15928 (yystrlen, yystpcpy): New functions.
15929
15930 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
15931 All uses changed.
15932
15933 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
15934 instead of relying on string.h functions. Use YYSTACK_ALLOC
15935 and YYSTACK_FREE instead of malloc and free.
15936
fd51e5ff
AD
159372001-11-30 Akim Demaille <akim@epita.fr>
15938
15939 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
15940 before their first uses.
15941 (YYBISON, YYPURE): Move to the top of the output.
15942
7d13ff5f
AD
159432001-11-30 Akim Demaille <akim@epita.fr>
15944
15945 * tests/reduce.at (Useless Nonterminals): Fix.
15946
892a3995
AD
159472001-11-30 Akim Demaille <akim@epita.fr>
15948
15949 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
15950 if body instead of `;' to pacify GCC's warnings.
15951
68f1e3ed
AD
159522001-11-30 Akim Demaille <akim@epita.fr>
15953
15954 Instead of mapping the LHS of unused rules to -1, keep the LHS
15955 valid, but flag the rules as invalid.
15956
15957 * src/gram.h (rule_t): `useful' is a new member.
15958 * src/print.c (print_grammar): Adjust.
15959 * src/derives.c (set_derives): Likewise.
15960 * src/reader.c (packgram, reduce_output): Likewise.
15961 * src/reduce.c (reduce_grammar_tables): Likewise.
15962 * tests/reduce.at (Underivable Rules, Useless Rules): New.
15963
d2d1b42b
AD
159642001-11-30 Akim Demaille <akim@epita.fr>
15965
15966 * src/reduce.c (reduce_output): Formatting changes.
15967 * src/print.c (print_results, print_grammar): Likewise.
15968 * tests/regression.at (Rule Line Numbers)
15969 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
15970
760b53a8
AD
159712001-11-30 Akim Demaille <akim@epita.fr>
15972
15973 * src/reduce.c (nonterminals_reduce): Instead of throwing away
15974 useless nonterminals, move them at the end of the symbol arrays.
15975 (reduce_output): Adjust.
15976 * tests/reduce.at (Useless Nonterminals): Adjust.
15977
00238958
AD
159782001-11-30 Akim Demaille <akim@epita.fr>
15979
15980 * src/reduce.c: Various comment/formatting changes.
15981 (nonterminals_reduce): New, extracted from...
15982 (reduce_grammar_tables): here.
15983 (reduce_grammar): Call nonterminals_reduce.
15984
396452de
PE
159852001-11-29 Paul Eggert <eggert@twinsun.com>
15986
15987 * src/bison.simple (YYSTACK_REALLOC): Remove.
15988 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
15989 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
15990 New macros.
15991 (union yyalloc): New type.
15992 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
15993 an arbitrary restriction on hosts where size_t is wider than int.
15994
15995 (yyparse): Don't dump core if alloca or malloc fails; instead, report
15996 a parser stack overflow. Allocate just one block of memory for all
15997 three stacks, instead of allocating three blocks; this typically is
15998 faster and reduces fragmentation.
15999
16000 Do not limit the number of items in the stack to a value that fits
16001 in 'int', as this is an arbitrary limit on hosts with 64-bit
16002 size_t and 32-bit int.
16003
147e184c
MA
160042001-11-29 Marc Autret <autret_m@epita.fr>
16005
16006 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
16007 of defining YYERROR_VERBOSE.
16008 [AT_DATA]: $4 is now out of C declarations in the prologue.
16009
426cf563
MA
160102001-11-28 Marc Autret <autret_m@epita.fr>
16011
16012 * src/reader.c (parse_dquoted_param): New.
16013 (parse_skel_decl): Use it.
16014 * src/lex.h: Add its prototype.
16015 * src/lex.c (literalchar): Become not static.
16016
c7925b99
MA
160172001-11-28 Marc Autret <autret_m@epita.fr>
16018
16019 * src/output.h: And put its extern declaration here.
16020 * src/output.c (error_verbose): Define here.
16021 (prepare): Echo name modification.
16022 * src/getargs.h: Clean its extern declaration.
16023 * src/getargs.c (error_verbose_flag): Remove.
16024 (getargs): Remove case 'e'.
16025 * src/options.c (option_table): 'error-verbose' is now seen as simple
16026 percent option.
16027 Include output.h.
16028
16029 * src/reader.c (read_declarations): Remove case tok_include.
16030 (parse_include_decl): Remove.
16031 * src/lex.h (token_t): Remove tok_include.
16032 * src/options.c (option_table): 'include' is now a simple command line
16033 option.
16034
5b5d1929
MA
160352001-11-28 Marc Autret <autret_m@epita.fr>
16036
16037 * src/bison.simple: Adjust muscle names.
16038 * src/muscle_tab.c (muscle_init): Also rename the muscles.
16039 * src/output.c (prepare): s/_/-/ for the muscles names.
16040 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
16041
8850be4b
MA
160422001-11-28 Marc Autret <autret_m@epita.fr>
16043
16044 * src/bison.simple: Fix debug.
16045 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
16046
4a38e613
AD
160472001-11-28 Akim Demaille <akim@epita.fr>
16048
16049 * src/LR0.c (shifts_new): New.
16050 (save_shifts, insert_start_shift, augment_automaton): Use it.
16051
4b35e1c1
AD
160522001-11-28 Akim Demaille <akim@epita.fr>
16053
16054 * src/closure.c (closure): `b' and `ruleno' denote the same value:
16055 keep ruleno only.
16056
d2b04478
AD
160572001-11-28 Akim Demaille <akim@epita.fr>
16058
16059 * src/closure.c (closure): Instead of looping over word in array
16060 then bits in words, loop over bits in array.
16061
2c4c30aa
AD
160622001-11-28 Akim Demaille <akim@epita.fr>
16063
16064 * src/closure.c (closure): No longer optimize the special case
16065 where all the bits of `ruleset[r]' are set to 0, to make the code
16066 clearer.
16067
576890b7
AD
160682001-11-28 Akim Demaille <akim@epita.fr>
16069
16070 * src/closure.c (closure): `r' and `c' are new variables, used to
16071 de-obfuscate accesses to RULESET and CORE.
16072
cb487d7d
AD
160732001-11-28 Akim Demaille <akim@epita.fr>
16074
16075 * src/reduce.c (reduce_print): Use ngettext.
16076 (dump_grammar): Improve the trace accuracy.
16077
6013d43f
AD
160782001-11-28 Akim Demaille <akim@epita.fr>
16079
16080 * src/reduce.c (dump_grammar): Don't translate trace messages.
16081
cb4956ee
AD
160822001-11-28 Akim Demaille <akim@epita.fr>
16083
16084 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
16085 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
16086 as all tags are free'ed afterwards.
16087 From Enrico Scholz.
16088
648185ab
PE
160892001-11-27 Paul Eggert <eggert@twinsun.com>
16090
16091 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
16092 use alloca when we didn't want to, and vice versa.
16093
68254a03
MA
160942001-11-27 Marc Autret <autret_m@epita.fr>
16095
9113b58f
AD
16096 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
16097 initialization.
68254a03
MA
16098 * src/output.c (prepare): Remove its update.
16099
04d843a2
MA
161002001-11-27 Marc Autret <autret_m@epita.fr>
16101
16102 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
16103 Use %error-verbose.
16104
d2079671 161052001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
16106
16107 * src/bison.simple: Remove YYERROR_VERBOSE using.
16108 Use %%error_verbose.
16109 (yyparse): Likewise.
16110 * src/output.c (prepare): Give its final value.
16111 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
16112 * src/getargs.h: Add its extern declaration.
16113 * src/getargs.c (error_verbose_flag): New int.
16114 (getargs): Update to catch new case.
16115 * src/options.c (option_table): 'error-verbose' is a new option.
16116 (shortopts): Update.
16117
e0327bc8
AD
161182001-11-27 Akim Demaille <akim@epita.fr>
16119
16120 * src/system.h: Use intl/libgettext.h.
16121 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
16122
000f1a3c
AD
161232001-11-27 Akim Demaille <akim@epita.fr>
16124
16125 * tests/torture.at (Exploding the Stack Size with Malloc):
16126 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
16127
26cfe0be
AD
161282001-11-27 Akim Demaille <akim@epita.fr>
16129
16130 * src/files.c: Include error.h.
16131 Reported by Hans Aberg.
16132
f6bd5427
MA
161332001-11-26 Marc Autret <autret_m@epita.fr>
16134
d2079671 16135 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
16136 (read_declarations): Add case tok_include.
16137 * src/getargs.h (include): Add its extern definition.
16138 * src/getargs.c (include): New const char *.
16139 (getargs): Add case '-I'.
16140 * src/options.c (option_table): Add include as command line and
16141 percent option.
16142 * src/lex.h (token_t): Add tok_include.
16143
2ca209c1
AD
161442001-11-26 Akim Demaille <akim@epita.fr>
16145
16146 * src/reader.c (readgram): Make sure rules for mid-rule actions
16147 have a lineno equal to that of their host rule.
16148 Reported by Hans Aberg.
16149 * tests/regression.at (Rule Line Numbers): New.
16150
0e41b407
AD
161512001-11-26 Akim Demaille <akim@epita.fr>
16152
16153 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
16154 size_ts.
16155
161562001-11-26 Akim Demaille <akim@epita.fr>
16157
16158 * src/complain.c, src/complain.h (error): Remove, provided by
16159 lib/error.[ch].
16160
e0c40012
AD
161612001-11-26 Akim Demaille <akim@epita.fr>
16162
16163 * src/reader.c (read_declarations): Don't abort on tok_illegal,
16164 issue an error message.
16165 * tests/regression.at (Invalid %directive): New.
16166 Reported by Hans Aberg.
16167
5e147124
AD
161682001-11-26 Akim Demaille <akim@epita.fr>
16169
16170 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
16171 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16172
a034c8b8
AD
161732001-11-26 Akim Demaille <akim@epita.fr>
16174
16175 * src/conflicts.c (conflicts_print): Don't complain at all when
16176 there are no reduce/reduce conflicts, and as many shift/reduce
16177 conflicts as expected.
16178 * tests/regression.at (%expect right): Adjust.
16179
c64a20f3
AD
161802001-11-23 Akim Demaille <akim@epita.fr>
16181
16182 * lib/alloca.c: Update, from fileutils.
16183
5b0d29bb
AD
161842001-11-23 Akim Demaille <akim@epita.fr>
16185
16186 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
16187
722c4bfe
AD
161882001-11-23 Akim Demaille <akim@epita.fr>
16189
16190 * src/system.h: Include alloca.h.
16191 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
16192
6255b435
AD
161932001-11-23 Akim Demaille <akim@epita.fr>
16194
16195 * src/print_graph.c (print_actions): Remove `rule', unused.
16196 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
16197 pacify GCC's signed < unsigned warnings.
16198 * src/closure.c (itemsetsize): Likewise.
16199 * src/reader.c (symbol_list_new): Static.
16200
b29b2ed5
AD
162012001-11-23 Akim Demaille <akim@epita.fr>
16202
16203 Attaching lineno to buckets is stupid, since only one copy of each
16204 symbol is kept, only the line of the first occurrence is kept too.
16205
16206 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
16207 * src/reader.c (rline_allocated): Remove, unused.
16208 (symbol_list): Have a `line' member.
16209 (symbol_list_new): New.
16210 (readgram): Use it.
16211 * src/print.c (print_grammar): Output the rule line numbers.
16212 * tests/regression.at (Solved SR Conflicts)
16213 (Unresolved SR Conflicts): Adjust.
16214 Reported by Hans Aberg.
16215
a81b1d4a
MA
162162001-11-22 Marc Autret <autret_m@epita.fr>
16217
16218 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
16219
c1ecb3c1
MA
162202001-11-22 Marc Autret <autret_m@epita.fr>
16221
16222 * src/muscle_tab.c (muscle_init): Remove initialization of
16223 skeleton muscle.
16224 * src/output.c (output_master_parser): Do it here.
16225
fbe01355
AD
162262001-11-20 Akim Demaille <akim@epita.fr>
16227
16228 * po/sv.po: New.
16229 * configure.in (ALL_LINGUAS): Adjust.
16230 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
16231 longer contains strings to translate.
16232
81e895c0
AD
162332001-11-19 Akim Demaille <akim@epita.fr>
16234
16235 * src/conflicts.c (conflicts_print): Add a missing \n.
16236
6bb1878b
AD
162372001-11-19 Akim Demaille <akim@epita.fr>
16238
16239 * src/nullable.c (nullable_print): New.
16240 (set_nullable): Call it when tracing.
16241 Better locality of variables.
16242
d9ec2d07
AD
162432001-11-19 Akim Demaille <akim@epita.fr>
16244
16245 * src/print.c (print_actions): Better locality of variables.
16246
720e5c1b
AD
162472001-11-19 Akim Demaille <akim@epita.fr>
16248
16249 * src/derives.c (print_derives): Fix and enrich.
16250 * src/closure.c (print_fderives): Likewise.
16251
fb908786
AD
162522001-11-19 Akim Demaille <akim@epita.fr>
16253
16254 * src/closure.c (itemsetend): Remove, replaced with...
16255 (itemsetsize): new.
16256
125ecb56
AD
162572001-11-19 Akim Demaille <akim@epita.fr>
16258
16259 * src/LR0.c (kernel_end): Remove, replaced with...
16260 (kernel_size): new.
16261
d8cf039f
AD
162622001-11-19 Akim Demaille <akim@epita.fr>
16263
16264 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
16265 to clarify.
16266
7bec0760
AD
162672001-11-19 Akim Demaille <akim@epita.fr>
16268
16269 * src/closure.c (closure): Use arrays instead of pointers to clarify.
16270
c87d4863
AD
162712001-11-19 Akim Demaille <akim@epita.fr>
16272
16273 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
16274 trace messages.
16275 * src/LR0.c: Likewise.
16276 (allocate_itemsets): Use arrays instead of pointers to clarify.
16277
9bfe901c
AD
162782001-11-19 Akim Demaille <akim@epita.fr>
16279
16280 * src/getargs.c (statistics_flag): Replace with...
16281 (trace_flag): New.
16282 (longopts): Accept --trace instead of --statistics.
16283 * src/getargs.h, src/options.c: Adjust.
16284 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
16285 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
16286
97db7bd4
AD
162872001-11-19 Akim Demaille <akim@epita.fr>
16288
cc72668c 16289 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
16290 pointers to clarify the code.
16291 (save_reductions, save_shifts): Factor common parts of alternatives.
16292
2c5f66ed
AD
162932001-11-19 Akim Demaille <akim@epita.fr>
16294
16295 * src/LR0.c (new_state, get_state): Complete TRACE code.
16296 * src/closure.c: Include `reader.h' to get `tags', needed by the
16297 trace code.
16298 Rename the conditional DEBUG as TRACE.
16299 Output consistently TRACEs to stderr, not stdout.
16300 * src/derives.c: Likewise.
16301 * src/reduce.c: (inaccessable_symbols): Using if is better style
16302 than goto.
16303 Use `#if TRACE' instead of `#if 0' for tracing code.
16304
300f275f
AD
163052001-11-19 Akim Demaille <akim@epita.fr>
16306
16307 * src/system.h (LIST_FREE, shortcpy): New.
16308 * src/LR0.c: Use them.
16309 * src/output.c (free_itemsets, free_reductions, free_shifts):
16310 Remove, replaced by LIST_FREE.
16311
f59c437a
AD
163122001-11-19 Akim Demaille <akim@epita.fr>
16313
16314 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
16315 (REDUCTIONS_ALLOC): New.
16316 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
16317 allocation.
16318
6986fd9e
AD
163192001-11-19 Akim Demaille <akim@epita.fr>
16320
16321 * src/LR0.c (new_state): Complete trace code.
16322 * src/nullable.c (set_nullable): Don't translate traces.
16323
4bc30f78
AD
163242001-11-19 Akim Demaille <akim@epita.fr>
16325
16326 * src/print_graph.c (print_core): Better locality of variables.
16327 * src/print.c (print_core): Likewise.
16328
08a946e0
AD
163292001-11-19 Akim Demaille <akim@epita.fr>
16330
16331 * src/vcg.c: You do the output, so you are responsible of the
16332 handling of VCG syntax, in particular: use quotearg.
16333 * src/print_graph.c: Don't.
16334 (print_actions): Don't output the actions as part of the nodes,
16335 since that's the job of the edges.
16336 (print_state): Don't output by hand: fill the node description,
9bfe901c 16337 and ask for its output.
08a946e0 16338
f0473484
AD
163392001-11-19 Akim Demaille <akim@epita.fr>
16340
cc72668c
AD
16341 * src/bison.simple (yyparse): When verbosely reporting an error,
16342 no longer put additional quotes around token names.
f0473484
AD
16343 * tests/calc.at: Adjust.
16344
e41dc700
AD
163452001-11-19 Akim Demaille <akim@epita.fr>
16346
16347 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
16348 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
16349 * src/output.c: Adjust.
16350
652a871c
AD
163512001-11-19 Akim Demaille <akim@epita.fr>
16352
16353 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
16354 (rule_t): this.
16355 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
16356
b2ed6e58
AD
163572001-11-19 Akim Demaille <akim@epita.fr>
16358
16359 * src/gram.h (rule_t): New.
16360 (rule_table): New.
16361 (rrhs, rlhs): Remove, part of state_t.
16362 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
16363 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16364 * src/reader.c, src/reduce.c: Adjust.
16365
edad7067
AD
163662001-11-19 Akim Demaille <akim@epita.fr>
16367
16368 * src/reader.c (symbols_output): New, extracted from...
16369 (packsymbols): Here.
16370 (reader): Call it.
16371
3feec034
AD
163722001-11-19 Akim Demaille <akim@epita.fr>
16373
16374 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
16375 (maxrhs): this new function.
16376
ddcd5fdf
AD
163772001-11-19 Akim Demaille <akim@epita.fr>
16378
cc72668c 16379 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
16380 Adjust.
16381
bb527fc2
AD
163822001-11-19 Akim Demaille <akim@epita.fr>
16383
cc72668c 16384 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
16385 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16386 * src/lalr.c: Adjust.
16387
a845a697
AD
163882001-11-19 Akim Demaille <akim@epita.fr>
16389
16390 * src/lalr.c (initialize_LA): Only initialize LA. Let...
16391 (set_state_table): handle the `lookaheads' members.
16392
f004bf6a
AD
163932001-11-19 Akim Demaille <akim@epita.fr>
16394
cc72668c
AD
16395 * src/lalr.h (lookaheads): Removed array, whose contents is now
16396 a member of...
f004bf6a
AD
16397 (state_t): this structure.
16398 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16399 Adjust.
16400
de326cc0
AD
164012001-11-19 Akim Demaille <akim@epita.fr>
16402
cc72668c
AD
16403 * src/lalr.h (consistent): Removed array, whose contents is now
16404 a member of...
de326cc0
AD
16405 (state_t): this structure.
16406 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16407 Adjust.
16408
90b4416b
AD
164092001-11-19 Akim Demaille <akim@epita.fr>
16410
cc72668c
AD
16411 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
16412 contents are now members of...
90b4416b
AD
16413 (state_t): this structure.
16414 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16415 Adjust.
16416
9703cc49
AD
164172001-11-19 Akim Demaille <akim@epita.fr>
16418
16419 * src/lalr.h (state_t): New.
16420 (state_table): Be a state_t * instead of a core **.
16421 (accessing_symbol): Remove, part of state_t.
16422 * src/lalr.c: Adjust.
16423 (set_accessing_symbol): Merge into...
16424 (set_state_table): this.
16425 * src/print_graph.c, src/conflicts.c: Adjust.
16426
d803322e
AD
164272001-11-14 Akim Demaille <akim@epita.fr>
16428
16429 * tests/calc.at, tests/output.at, tests/regression.at,
16430 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
16431 now the tests are run in private dirs, therefore AC_CLEANUP and
16432 family can be simplified to 0-ary.
16433 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
16434 use abs. path to find config.h.
16435 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
16436 stderr, there can be way too much random noise.
16437 Instead pass -Werror to GCC and rely on the exit status.
16438 Reported by Wolfram Wagner.
16439
3d76b07d
AD
164402001-11-14 Akim Demaille <akim@epita.fr>
16441
16442 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
16443 defined only if yyoverflow is defined, to avoid `warning: unused
16444 variable `yyvs1''.
16445 Reported by The Test Suite.
16446
09b503c8
AD
164472001-11-14 Akim Demaille <akim@epita.fr>
16448
16449 * src/print.c: Include reduce.h.
16450 Reported by Hans Aberg.
16451
164522001-11-14 Akim Demaille <akim@epita.fr>
16453
16454 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
16455 Revert a previous patch: these are really const.
16456 * src/conflicts.c (conflict_report): Additional useless pair of
16457 braces to pacify GCC's warnings for `if () if () {} else {}'.
16458 * src/lex.c (parse_percent_token): Replace equal_offset with
16459 arg_offset.
16460 arg is const.
16461 Be sure to strdup `arg' when used, since there is no reason for
16462 token_buffer not to change.
16463
0f37a994
AD
164642001-11-14 Akim Demaille <akim@epita.fr>
16465
16466 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
16467 definition.
16468 * src/main.c (main): Use them.
16469 Suggested by Hans Aberg.
16470
d39d93b8
AD
164712001-11-12 Akim Demaille <akim@epita.fr>
16472
16473 * src/system.h (ngettext): Now that we use ngettext, be sure to
16474 provide a default definition when NLS are not used.
16475
9edcd895
AD
164762001-11-12 Akim Demaille <akim@epita.fr>
16477
16478 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
16479 Use @kbd to denote user input.
16480 (Language and Grammar): ANSIfy the example.
16481 Adjust its layout for info/notinfo.
16482 (Location Tracking Calc): Output error messages to stderr.
16483 Output locations in a more GNUtically correct way.
16484 Fix a couple of Englishos.
16485 Adjust @group/@end group pairs.
16486
7da99ede
AD
164872001-11-12 Akim Demaille <akim@epita.fr>
16488
e3aa65c5 16489 %expect was not functioning at all.
7da99ede
AD
16490
16491 * src/conflicts.c (expected_conflicts): Set to -1.
16492 (conflict_report): Use ngettext.
16493 (conflicts_print): Check %expect and make its violation an error.
16494 * doc/bison.texinfo (Expect Decl): Adjust.
16495 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
16496 * tests/regression.at (%expect not enough, %expect right)
16497 (%expect too much): New.
16498
ba9dda1a
AD
164992001-11-12 Akim Demaille <akim@epita.fr>
16500
16501 * tests/regression.at (Conflicts): Rename as...
16502 (Unresolved SR Conflicts): this.
16503 (Solved SR Conflicts): New.
16504
337c5bd1
AD
165052001-11-12 Akim Demaille <akim@epita.fr>
16506
16507 * src/reduce.c (print_results): Rename as...
16508 (reduce_output): This.
16509 Output to OUT, passed as argument, instead of output_obstack.
16510 (dump_grammar): Likewise.
16511 (reduce_free): New.
16512 Also free V1.
16513 (reduce_grammar): No longer call reduce_output, since...
16514 * src/print.c (print_results): do it.
16515 * src/main.c (main): Call reduce_free;
16516
c73a41af
AD
165172001-11-12 Akim Demaille <akim@epita.fr>
16518
16519 * src/conflicts.c (print_reductions): Accept OUT as argument.
16520 Output to it, not to output_obstack.
16521 * src/print.c (print_actions): Adjust.
16522
0df87bb6
AD
165232001-11-12 Akim Demaille <akim@epita.fr>
16524
16525 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
16526 the result instead of using...
16527 (src_total, rrc_total, src_count, rrc_count): Remove.
16528 (any_conflicts): Remove.
16529 (print_conflicts): Split into...
16530 (conflicts_print, conflicts_output): New.
16531 * src/conflicts.h: Adjust.
16532 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 16533 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
16534 * tests/regression.at (Conflicts): New.
16535 Reported by Tom Lane.
16536
e4d3d4de
AD
165372001-11-12 Akim Demaille <akim@epita.fr>
16538
16539 * tests/regression.at (Invalid input): Remove, duplicate with
16540 ``Invalid input: 1''.
16541
6d7d248e
AD
165422001-11-12 Akim Demaille <akim@epita.fr>
16543
16544 * tests/torture.at (AT_DATA_STACK_TORTURE)
16545 (Exploding the Stack Size with Alloca)
16546 (Exploding the Stack Size with Malloc): New.
16547
e9e4c321
AD
165482001-11-12 Akim Demaille <akim@epita.fr>
16549
16550 * src/bison.simple (YYSTACK_REALLOC): New.
16551 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 16552 Reported by Per Allansson.
e9e4c321 16553
5f7e0832
AD
165542001-11-12 Pascal Bart <pascal.bart@epita.fr>
16555
16556 * src/bison.simple: Define type yystype instead of YYSTYPE, and
16557 define CPP macro, which substitute YYSTYPE by yystype.
16558 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
16559 with yyltype/YYLTYPE. This allows inclusion of the generated
16560 header within the parser if the compiler, such as GGC, accepts
16561 multiple equivalent #defines.
16562 From Akim.
16563
e3f1699f
AD
165642001-11-05 Akim Demaille <akim@epita.fr>
16565
16566 * src/reader.c (symbols_output): New, extracted from...
16567 (packsymbols): here.
16568 (reader): Adjust.
16569
65be0866
AD
165702001-11-05 Akim Demaille <akim@epita.fr>
16571
16572 * src/lex.c (parse_percent_token): s/quotearg/quote/.
16573
e4d910bf
AD
165742001-11-05 Akim Demaille <akim@epita.fr>
16575
16576 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
16577 pattern.
16578
951366c1
AD
165792001-11-05 Akim Demaille <akim@epita.fr>
16580
16581 * src/options.h (struct option_table_struct): set_flags is void*.
16582 * src/options.c (longopts): Support `--output' and `%output'.
16583 (usage): Adjust.
16584 * src/lex.h (tok_setopt): Remove, replaced with...
16585 (tok_intopt, tok_stropt): these new guys.
16586 * src/lex.c (getopt.h): Not needed.
16587 (token_buffer, unlexed_token_buffer): Not const.
16588 (percent_table): Promote `-' over `_' in directive names.
16589 Active `%name-prefix', `file-prefix', and `output'.
16590 (parse_percent_token): Accept possible arguments to directives.
16591 Promote `-' over `_' in directive names.
16592
d8988b2f
AD
165932001-11-04 Akim Demaille <akim@epita.fr>
16594
16595 * doc/bison.texinfo (Decl Summary): Split the list into
16596 `directives for grammars' and `directives for bison'.
16597 Sort'em.
16598 Add description of `%name-prefix', `file-prefix', and `output'.
16599 Promote `-' over `_' in directive names.
16600 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
16601 Simplify the description of `--name-prefix'.
16602 Promote `-' over `_' in directive names.
16603 Promote `--output' over `--output-file'.
16604 Fix the description of `--defines'.
16605 * tests/output.at: Exercise %file-prefix and %output.
16606
6468d18e
AD
166072001-11-02 Akim Demaille <akim@epita.fr>
16608
16609 * doc/refcard.tex: Update.
16610
6b7e85b9
AD
166112001-11-02 Akim Demaille <akim@epita.fr>
16612
16613 * src/symtab.h (SUNDEF): New.
16614 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
16615 stand for `uninitialized', instead of 0.
16616 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
16617 * src/lex.c (lex): Adjust.
16618
16619 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
16620 Number it 0.
16621 Let yylex return it instead of a plain 0.
16622 Reported by Dick Streefland.
16623
cd5aafcf
AD
166242001-11-02 Akim Demaille <akim@epita.fr>
16625
16626 * tests/regression.at (Mixing %token styles): New test.
16627
037ca2f1
AD
166282001-11-02 Akim Demaille <akim@epita.fr>
16629
16630 * src/reader.c (parse_thong_decl): Formatting changes.
16631 (token_translations_init): New, extracted from...
16632 (packsymbols): Here.
16633 Adjust.
16634
270a173c
AD
166352001-11-01 Akim Demaille <akim@epita.fr>
16636
16637 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
16638 Check that `9foo.y' produces correct cpp guards.
16639 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
16640 guards.
16641 Reported by Wwp.
16642
561f9a30
AD
166432001-11-01 Akim Demaille <akim@epita.fr>
16644
16645 * tests/regression.at (Invalid input: 2): New.
16646 * src/lex.c (unlexed_token_buffer): New.
16647 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
16648 too.
16649 Reported by Wwp.
16650
f987e9d2
AD
166512001-11-01 Akim Demaille <akim@epita.fr>
16652
16653 * tests/calc.at: Catch up with 1.30.
16654 * configure.in: Bump to 1.49a.
16655 Adjust to newer Autotest.
16656
0846f581
PB
166572001-10-19 Pascal Bart <pascal.bart@epita.fr>
16658
16659 * src/conflicts.c: Move global variables rrc_total and src_total ...
16660 (print_conflicts): here.
16661 * src/output.c (output): Free global variable user_toknums.
16662 * src/lex.c (token_obstack): Become static.
16663
3c1a79b3
AD
166642001-10-18 Akim Demaille <akim@epita.fr>
16665
16666 * tests/atlocal.in (GCC): Add.
16667 * tests/calc.at: s/m4_match/m4_bmatch/.
16668 s/m4_patsubst/m4_bpatsubst/.
16669 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
16670 * configure.in: AC_SUBST(GCC).
16671
5d52e7d0
MA
166722001-10-14 Marc Autret <autret_m@epita.fr>
16673
16674 * src/options.c (create_long_option_table): Fix.
16675
631aa1d3
AD
166762001-10-10 Akim Demaille <akim@epita.fr>
16677
16678 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
16679
f6ec6d13
AD
166802001-10-04 Akim Demaille <akim@epita.fr>
16681
16682 * src/reader.c (parse_union_decl): Push the caracters in
16683 union_obstack, not attrs_obstack.
16684
342b8b6e
AD
166852001-10-04 Akim Demaille <akim@epita.fr>
16686
16687 Merge in the branch 1.29.
16688
16689 * src/reader.c (packsymbols): Use a temporary obstack for
16690 `%%tokendef', since output_stack is already used elsewhere.
16691
16692 2001-10-02 Akim Demaille <akim@epita.fr>
16693
16694 Bump 1.29d.
16695
16696 2001-10-02 Akim Demaille <akim@epita.fr>
16697
16698 Version 1.29c.
16699
16700 2001-10-02 Akim Demaille <akim@epita.fr>
16701
16702 * tests/regression.at (Invalid CPP headers): New.
16703 From Alexander Belopolsky.
16704 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
16705
16706 2001-10-02 Akim Demaille <akim@epita.fr>
16707
16708 * tests/regression.at (Invalid input): New.
16709 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
16710 Reported by Shura.
16711
16712 2001-10-02 Akim Demaille <akim@epita.fr>
16713
16714 * tests/calc.at: Now that --debug works, the tests must be adjusted.
16715
16716 2001-10-02 Akim Demaille <akim@epita.fr>
16717
16718 * src/output.c (output_parser): Assert `skeleton'.
16719 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
16720 systems.
16721 From Shura.
16722
16723 2001-10-01 Marc Autret <autret_m@epita.fr>
16724
16725 * src/lex.h: Echo modifications.
16726 * src/lex.c (unlex): Parameter is now token_t.
16727 From Hans Aberg.
16728
16729 2001-10-01 Marc Autret <autret_m@epita.fr>
16730
16731 * src/main.c: Include lex.h.
16732 From Hans Aberg.
16733
16734 2001-09-29 Akim Demaille <akim@epita.fr>
16735
16736 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
16737
16738 2001-09-28 Akim Demaille <akim@epita.fr>
16739
16740 * tests/testsuite.at: Update to newer Autotest.
16741 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
16742
16743 2001-09-27 Akim Demaille <akim@epita.fr>
16744
16745 Position independent wrapper.
16746
16747 * tests/bison: Remove.
16748 * tests/bison.in: New.
16749 * configure.in: Adjust.
16750
16751 2001-09-27 Paul Eggert <eggert@twinsun.com>
16752
16753 Port quotearg fixes from tar 1.13.24.
16754
16755 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
16756 tm to be declared.
16757 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
16758 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
16759
16760 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
16761 * m4/mbrtowc.m4: New file.
16762 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
16763 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
16764
16765 2001-09-27 Akim Demaille <akim@epita.fr>
16766
16767 Bump to 1.29c.
16768
16769 2001-09-27 Akim Demaille <akim@epita.fr>
16770
16771 Version 1.29b.
16772
16773 2001-09-25 Akim Demaille <akim@epita.fr>
16774
16775 * src/system.h: Include `xalloc.h'.
16776 Remove it from the C files.
16777 * src/files.c (output_files): Free the obstacks.
16778 * src/lex.c (init_lex): Rename as...
16779 (lex_init): this.
16780 (lex_free): New.
16781 * src/main.c (main): Use it.
16782
16783 2001-09-24 Marc Autret <autret_m@epita.fr>
16784
16785 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
16786 to output informations in fout (FILE*).
16787 (open_graph, close_graph): Likewise.
16788 (output_graph, output_edge, output_node): Likewise.
16789 * src/vcg.h: Update function prototypes.
16790 * src/print_graph.c (print_graph): Open output graph file.
16791 (print_actions): Adjust.
16792 * src/files.h: Remove extern declaration.
16793 * src/files.c: Remove graph_obstack declaration.
16794 (open_files): Remove graph_obstack initialization.
16795 (output_files): Remove graph_obstack saving.
16796
16797 2001-09-24 Marc Autret <autret_m@epita.fr>
16798
16799 * src/files.c (compute_output_file_names): Fix.
16800
16801 2001-09-24 Marc Autret <autret_m@epita.fr>,
16802 Akim Demaille <akim@epita.fr>
16803
16804 * src/reader.c (reader): Remove call to free_symtab ().
16805 * src/main.c (main): Call it here.
16806 Include symtab.h.
16807 * src/conflicts.c (initialize_conflicts): Rename as...
16808 (solve_conflicts): this.
16809 * src/print.c (print_core, print_actions, print_state)
16810 (print_grammar): Dump to a file instead a `output_obstack'.
16811 (print_results): Dump `output_obstack', and then proceed with the
16812 FILE *.
16813 * src/files.c (compute_output_file_names, close_files): New.
16814 (output_files): Adjust.
16815 * src/main.c (main): Adjust.
16816
16817 2001-09-23 Marc Autret <autret_m@epita.fr>
16818
16819 * src/files.c (compute_header_macro): Computes header macro name
16820 from spec_defines_file when given.
16821
16822 2001-09-23 Marc Autret <autret_m@epita.fr>
16823
16824 * src/files.c (output_files): Add default extensions.
16825
16826 2001-09-22 Akim Demaille <akim@epita.fr>
16827
16828 * src/conflicts.c (finalize_conflicts): Rename as...
16829 (free_conflicts): this.
16830
16831 2001-09-22 Akim Demaille <akim@epita.fr>
16832
16833 * src/gram.c (gram_free): Rename back as...
16834 (dummy): this.
16835 (output_token_translations): Free `token_translations'.
16836 * src/symtab.c (free_symtab): Free the tag field.
16837
16838 2001-09-22 Akim Demaille <akim@epita.fr>
16839
16840 Remove `translations' as it is always set to true.
16841
16842 * src/gram.h: Adjust.
16843 * src/reader.c (packsymbols, parse_token_decl): Adjust
16844 * src/print.c (print_grammar): Adjust.
16845 * src/output.c (output_token_translations): Adjust.
16846 * src/lex.c (lex): Adjust.
16847 * src/gram.c: Be sure the set pointers to NULL.
16848 (dummy): Rename as...
16849 (gram_free): this.
16850
16851 2001-09-22 Akim Demaille <akim@epita.fr>
16852
16853 * configure.in: Invoke AM_LIB_DMALLOC.
16854 * src/system.h: Use dmalloc.
16855 * src/LR0.c: Be sure to have pointers initialized to NULL.
16856 (allocate_itemsets): Allocate kernel_items only if needed.
16857
16858 2001-09-22 Akim Demaille <akim@epita.fr>
16859
16860 * configure.in: Bump to 1.29b.
16861 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
16862 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
16863 need xmalloc.c in calc.y.
16864 From Pascal Bart.
16865
16866 2001-09-21 Akim Demaille <akim@epita.fr>
16867
16868 Version 1.29a.
16869 * Makefile.maint, config/config.guess, config/config.sub,
16870 * config/missing: Update from masters.
16871 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
16872 upon package.m4.
16873 * configure.in (ALL_LINGUAS): Add `tr'.
16874
16875 2001-09-21 Akim Demaille <akim@epita.fr>
16876
16877 * tests/Makefile.am (package.m4): Move to...
16878 ($(srcdir)/$(TESTSUITE)): here.
16879
16880 2001-09-20 Akim Demaille <akim@epita.fr>
16881
16882 * src/complain.c: No longer try to be standalone: use system.h.
16883 Don't assume __STDC__ is defined to 1. Just test if it is defined.
16884 * src/complain.h: Likewise.
16885 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
16886 Remove the unused variable `n'.
16887 From Albert Chin-A-Young.
16888
16889 2001-09-18 Marc Autret <autret_m@epita.fr>
16890
16891 * doc/bison.1: Update.
16892 * doc/bison.texinfo (Bison Options): Update --defines and --graph
16893 descriptions.
16894 (Option Cross Key): Update.
16895 Add --graph.
16896
16897 2001-09-18 Marc Autret <autret_m@epita.fr>
16898
16899 * tests/regression.at: New test (comment in %union).
16900
16901 2001-09-18 Marc Autret <autret_m@epita.fr>
16902
16903 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
16904 do that.
16905 Reported by Keith Browne.
16906
16907 2001-09-18 Marc Autret <autret_m@epita.fr>
16908
16909 * tests/output.at: Add tests for --defines and --graph.
16910
16911 2001-09-18 Marc Autret <autret_m@epita.fr>
16912
16913 * tests/output.at: Removes tests of %{header,src}_extension features.
16914
16915 2001-09-18 Akim Demaille <akim@epita.fr>
16916
16917 * tests/Makefile.am (package.m4): New.
16918 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
16919 (_AT_CHECK_CALC_ERROR): Likewise.
16920 Factor the `, ' part of verbose error messages.
16921
16922 2001-09-18 Marc Autret <autret_m@epita.fr>
16923
16924 * src/getargs.c (longopts): Declare --defines and --graph as options
16925 with optional arguments.
16926 * src/files.h: Add extern declarations.
16927 * src/files.c (spec_graph_file, spec_defines_file): New.
16928 (output_files): Update.
16929 Remove CPP-outed code.
16930
16931 2001-09-18 Marc Autret <autret_m@epita.fr>
16932
16933 Turn off %{source,header}_extension feature.
16934
16935 * src/files.c (compute_exts_from_gf): Update.
16936 (compute_exts_from_src): Update.
16937 (output_files): CPP-out useless code.
16938 * src/files.h: Remove {header,source}_extension extern declarations.
16939 * src/reader.c (parse_dquoted_param): CPP-out.
16940 (parse_header_extension_decl): Remove.
16941 (parse_source_extension_decl): Remove.
16942 (read_declarations): Remove cases tok_{hdrext,srcext}.
16943 * src/lex.c (percent_table): Remove {header,source}_extension entries.
16944 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
16945
16946 2001-09-10 Akim Demaille <akim@epita.fr>
16947
16948 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
16949 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
16950 (AT_CHECK_OUTPUT): this.
16951 Merely check ls' exit status, its output is useless.
16952
16953 2001-09-10 Akim Demaille <akim@epita.fr>
16954
16955 * tests/calc.at: Use m4_match.
16956 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
16957
16958 2001-09-10 Marc Autret <autret_m@epita.fr>,
16959 Akim Demaille <akim@epita.fr>
16960
16961 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
16962 enum color_e.
16963 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
16964 to `normal'.
16965 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
16966 * src/lex.h: Adjust prototype.
16967 (token_t): Add `tok_undef'.
16968 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
16969 (parse_percent_token): Now returns token_t.
16970 Add default statement in switch.
16971 (lex): Separate `c' as an input variable, from the token_t result
16972 part.
16973 (unlexed): Is a token_t.
16974
16975 2001-09-10 Akim Demaille <akim@epita.fr>
16976
16977 * configure.in: Bump to 1.29a.
16978
16979 2001-09-07 Akim Demaille <akim@epita.fr>
16980
16981 Version 1.29.
16982
16983 2001-08-30 Akim Demaille <akim@epita.fr>
16984
16985 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
16986 * m4/atconfig.m4: Remove.
16987 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
16988 * tests/bison: New.
16989 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
16990 m4_if, m4_patsubst, and m4_regexp.
16991 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
16992 `input' file instead of echo.
16993
16994 2001-08-29 Akim Demaille <akim@epita.fr>
16995
16996 Bump to 1.28e.
16997
16998 2001-08-29 Akim Demaille <akim@epita.fr>
16999
17000 Version 1.28d.
17001
17002 2001-08-29 Paul Eggert <eggert@twinsun.com>
17003
17004 * src/bison.simple (yyparse): Don't take the address of an
17005 item before the start of an array, as that doesn't conform to
17006 the C Standard.
17007
17008 2001-08-29 Robert Anisko <anisko_r@epita.fr>
17009
17010 * doc/bison.texinfo (Location Tracking Calc): New node.
17011
17012 2001-08-29 Paul Eggert <eggert@twinsun.com>
17013
17014 * src/output.c (output): Do not define const, as this now
17015 causes more problems than it cures.
17016
17017 2001-08-29 Akim Demaille <akim@epita.fr>
17018
17019 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
17020 the nodes.
17021 Be sure to tag the `detailmenu'.
17022
17023 2001-08-29 Akim Demaille <akim@epita.fr>
17024
17025 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
17026 download in a tmp dir.
17027
17028 2001-08-28 Marc Autret <autret_m@epita.fr>
17029
17030 * config/depcomp: New file.
17031
17032 2001-08-28 Marc Autret <autret_m@epita.fr>
17033
17034 * doc/bison.1 (mandoc): Adjust.
17035 From Juan Manuel Guerrero.
17036
17037 2001-08-28 Marc Autret <autret_m@epita.fr>
17038
17039 * src/print_graph.c (print_state): Fix.
17040
17041 2001-08-27 Marc Autret <autret_m@epita.fr>
17042
17043 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
17044 char * members.
17045 Echo modifications to the functions prototypes.
17046 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
17047
17048 2001-08-27 Marc Autret <autret_m@epita.fr>
17049
17050 * src/vcg.c: Include `xalloc.h'.
17051 (add_colorentry): New.
17052 (add_classname): New.
17053 (add_infoname): New.
17054 * src/vcg.h: Add new prototypes.
17055
17056 2001-08-27 Akim Demaille <akim@epita.fr>
17057
17058 * Makefile.maint: Sync. again with CVS Autoconf.
17059
17060 2001-08-27 Akim Demaille <akim@epita.fr>
17061
17062 * Makefile.maint: Formatting changes.
17063 (po-update, cvs-update, update): New targets.
17064 (AMTAR): Remove.
17065
17066 2001-08-27 Akim Demaille <akim@epita.fr>
17067
17068 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17069 * Makefile.maint: Sync. with CVS Autoconf.
17070
17071 2001-08-27 Marc Autret <autret_m@epita.fr>
17072
17073 * src/vcg.h (struct infoname_s): New.
17074 (struct colorentry_s): New.
17075 (graph_s): New fields {vertical,horizontal}_order in structure.
17076 Add `infoname' field.
17077 Add `colorentry' field;
17078 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
17079 (G_HORIZONTAL_ORDER): New.
17080 (G_INFONAME): New.
17081 (G_COLORENTRY): New.
17082 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
17083 Add output of `infoname'.
17084 Add output of `colorentry'.
17085
17086 2001-08-27 Marc Autret <autret_m@epita.fr>
17087
17088 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
17089 This one shadowed a global parameter.
17090
17091 2001-08-24 Marc Autret <autret_m@epita.fr>
17092
17093 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
17094 instead of `unsigned'.
17095 (print_state): Do not call obstack_object_size () in obstack_grow ()
17096 to avoid macro variables shadowing.
17097
17098 2001-08-23 Marc Autret <autret_m@epita.fr>
17099
17100 * src/lex.c (percent_table): Typo: s/naem/name/.
17101 Add graph option.
17102 Normalize new options declarations.
17103
17104 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
17105
17106 * tests/suite.at: Exercise %header_extension and %source_extension.
17107
17108 2001-08-16 Marc Autret <autret_m@epita.fr>
17109
17110 * src/reader.c (parse_dquoted_param): New.
17111 (parse_header_extension_decl): Use it.
17112 (parse_source_extension_decl): Likewise.
17113
17114 2001-08-16 Marc Autret <autret_m@epita.fr>
17115
17116 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
17117 (get_xxxx_str): Use assert () instead of complain ().
17118 Remove return invokations in default cases.
17119 (get_decision_str): Modify default behaviour. Remove second argument.
17120 Echo modifications on calls.
17121 (output_graph): Fix.
17122
17123 2001-08-16 Marc Autret <autret_m@epita.fr>
17124
17125 * src/getargs.c (usage): Update with ``-g, --graph''.
17126
17127 2001-08-16 Marc Autret <autret_m@epita.fr>
17128
17129 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
17130 (Option Cross Key): Likewise.
17131 * doc/bison.1: Update.
17132
1c8c2190
PB
171332001-09-25 Pascal Bart <pascal.bart@epita.fr>
17134
17135 * src/output.c (output_master_parser): Don't finish action_obstack.
17136 (output_parser): Don't care about the muscle action, here.
17137 (prepare): Copy the action_obstack in the action muscle.
17138 (output): Free action_obstack.
17139
180d45ba
PB
171402001-09-23 Pascal Bart <pascal.bart@epita.fr>
17141
17142 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
17143 will contain `%union' declaration.
17144 (parse_union_decl): Delete #line directive output.
17145 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
17146 informations about %union.
17147 (parse_union_decl): Copy the union_obstack in the muscle stype.
17148 * src/bison.simple: Add new #line directive.
17149 Add typdef %%stype YYSTYPE.
17150
c51d1a19
PB
171512001-09-23 Pascal Bart <pascal.bart@epita.fr>
17152
17153 * src/bison.simple: Add new `#line' directive.
17154
6f9344da
PB
171552001-09-22 Pascal Bart <pascal.bart@epita.fr>
17156
17157 * src/bison.simple: New `#line' directive.
17158 * src/output.c (output_parser): Support new dynamic muscle input_line.
17159
652def80
MA
171602001-09-22 Marc Autret <autret_m@epita.fr>
17161
17162 * src/output.c (output_master_parser): New.
17163 (output_parser): Be more re-entrant.
17164
25b222fa
MA
171652001-09-21 Marc Autret <autret_m@epita.fr>
17166
17167 * src/reader.c (copy_definition, parse_union_decl): Update and use
17168 `linef' muscle.
17169 (copy_action): Likewise.
17170 Use obstack_1grow ().
17171 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
17172
6bc35ae5
MA
171732001-09-21 Marc Autret <autret_m@epita.fr>
17174
17175 * src/options.c (option_table): Adjust.
17176 * src/lex.c (parse_percent_token): Fix.
17177
c0629aa1
PB
171782001-09-20 Pascal Bart <pascal.bart@epita.fr>
17179
17180 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 17181
82b6d266
PB
171822001-09-20 Pascal Bart <pascal.bart@epita.fr>
17183
17184 * src/lex.c (parse_percent_token): Change type of variable `tx', which
17185 is now an option_table_struct*.
17186 (option_strcmp): New function option_strcmp.
17187 (parse_percent_token): Call option_strcmp.
17188 * src/getargs.c (xalloc.h, options.h): Include it.
17189 (getargs): Call create_long_option_table.
17190 (getargs): Free longopts at the end of the function.
17191 (shortopts): Move in options.c.
17192 * src/options.c (create_long_option_table): New function. Convert
17193 information from option_table to option structure.
17194 * src/reader.c (options.h): Include it.
17195
17196 * src/Makefile.am: Adjust.
17197 * src/options.c (option_table): Create from longopts and percent_table.
17198 * src/getargs.c (longopts): Delete.
17199 * src/lex.c (struct percent_table_struct): Delete.
17200 (percent_table): Delete.
17201 (options.h): Include it.
17202 * src/options.c: Create.
17203 * src/options.h: Create.
17204 Declare enum opt_access_e.
17205 Define struct option_table_struct.
17206
75f5aaea
MA
172072001-09-20 Marc Autret <autret_m@epita.fr>
17208
17209 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
17210 sections of Bison.
17211
f508cb0a
PB
172122001-09-19 Pascal Bart <pascal.bart@epita.fr>
17213
17214 * src/bison.simple: s/%%filename/%%skeleton.
17215 * src/muscle_tab.c (getargs.h): Include it.
17216 (muscle_init): Insert new muscle skeleton.
17217
13105fc1
PB
172182001-09-18 Pascal Bart <pascal.bart@epita.fr>
17219
17220 * src/output.c (output_parser): Delete unused variable actions_dumped.
17221
b0c4483e
PB
172222001-09-07 Pascal Bart <pascal.bart@epita.fr>
17223
17224 * src/output.c (output): Delete call to reader_output_yylsp.
17225 * src/reader.c (reader): Likewise.
ba0fe3c7 17226 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 17227
11d82f03
MA
172282001-09-02 Marc Autret <autret_m@epita.fr>
17229
17230 * src/reader.c: Include muscle_tab.h.
17231 (parse_union_decl): Update.
17232 (parse_macro_decl): Rename parse_muscle_decl.
17233 Update to use renamed functions and variable.
17234 (read_declarations, copy_action, read_additionnal_code, : Updated
17235 with correct variables and functions names.
17236 (packsymbols, reader): Likewise.
342b8b6e 17237
11d82f03 17238 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 17239
11d82f03
MA
17240 * src/output.c: Include muscle_tab.h
17241 In all functions using macro_insert, change by using muscle_insert ().
17242 (macro_obstack): Rename muscle_obstack.
17243 Echo modifications in the whole file.
17244 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
17245 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
17246 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
17247
17248 * src/muscle_tab.h: Update double inclusion macros.
17249 (macro_entry_s): Rename muscle_entry_s.
17250 Update prototypes.
342b8b6e 17251
11d82f03
MA
17252 * src/muscle_tab.c: Include muscle_tab.h.
17253 Rename macro_tabble to muscle_table.
17254 (mhash1, mhash2, mcmp): Use muscle_entry.
17255 (macro_init): Rename muscle_init. Update.
17256 (macro_insert): Rename muscle_insert. Update.
17257 (macro_find): Rename muscle_find. Update.
17258
17259 * src/main.c: Include muscle_tab.h.
17260 (main): Call muscle_init ().
17261 * src/Makefile.am (bison_SOURCES): Echo modifications.
17262
93a37297
MA
172632001-09-02 Marc Autret <autret_m@epita.fr>
17264
f753cd62 17265 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 17266
f753cd62
MA
17267 * src/muscle_tab.c, src/muscle_tab.h: Add files.
17268
172692001-09-02 Marc Autret <autret_m@epita.fr>
17270
17271 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 17272
682d48cd
PB
172732001-09-01 Pascal Bart <pascal.bart@epita.fr>
17274
342b8b6e 17275 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
17276 filename.
17277
087c8fda
MA
172782001-09-01 Marc Autret <autret_m@epita.fr>
17279
17280 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
17281 to an explicit value to activate the feature. We do it here.
17282
dda680cb
PB
172832001-08-31 Pascal Bart <pascal.bart@epita.fr>
17284
17285 * src/output.c (prepare): Delete the `filename' muscule insertion.
17286 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
17287 (parse_union_decl): Likewise.
17288 * src/macrotab.c (macro_init): Initialize filename by infile.
17289
9e644e64
MA
172902001-08-31 Marc Autret <autret_m@epita.fr>
17291
17292 * src/bison.simple (YYLSP_NEEDED): New definition.
17293 * src/output.c (prepare): Add macro insertion of `locations_flag'
17294
17da6427
PB
172952001-08-31 Pascal Bart <pascal.bart@epita.fr>
17296
17297 * src/output.c (prepare): Delete insertion of previous muscles,
17298 and insert the `prefix' muscles.
17299 * src/macrotab.c (macro_init): Likewise.
17300 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 17301 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
17302 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
17303 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 17304 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
17305 name_prefix.
17306
e8cb70b9
PB
173072001-08-31 Pascal Bart <pascal.bart@epita.fr>
17308
17309 * src/main.c (main): Standardize.
17310 * src/output.c (output_table_data, output_parser): Likewise.
17311 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
17312
63c2d5de
MA
173132001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
17314
342b8b6e 17315 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
17316 %%epilogue.
17317 * src/output.c (output): Rename %%declarations to %%prologue.
17318 * src/bison.simple: Echo modifications.
342b8b6e 17319
d8cb5183
MA
173202001-08-31 Marc Autret <autret_m@epita.fr>
17321
17322 * src/reader.c (readgram): CleanUp.
17323 (output_token_defines): Likewise.
17324 (packsymbols): Likewise.
17325 (reader): Likewise.
17326 * src/output.c (output): CPP-out useless code.
17327
6c686258
PB
173282001-08-31 Pascal Bart <pascal.bart@epita.fr>
17329
342b8b6e 17330 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
17331 output_trailers and output_headers.
17332 * src/output.h: Remove obsolete functions prototypes of output_headers
17333 and output_trailers.
17334
8f451ef7
PB
173352001-08-30 Pascal Bart <pascal.bart@epita.fr>
17336
17337 * src/main.c: Include macrotab.h.
342b8b6e 17338 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
17339 Adjust functions prototypes.
17340 * src/macrotab.c (macro_insert): Constify key and value.
17341 (macro_find): Constify key.
17342 (macro_insert): Include 'xalloc.h'
17343 (macro_insert): Use XMALLOC.
17344 (macro_find): Constify return value.
17345 * src/output.c (output_table_data): Rename table to table_data.
17346 (output_parser): Constify macro_key, macro_value.
17347
997b6fd0 173482001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
17349
17350 * src/reader.c (parse_skel_decl): New.
342b8b6e 17351 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
17352 * src/lex.h (token_t): New token `tok_skel'.
17353 * src/lex.c (percent_table): Add skeleton option entry.
17354 Standardize.
17355
ff48177d
MA
173562001-08-29 Marc Autret <autret_m@epita.fr>
17357
17358 * src/bison.simple: Add %%user_code directive at the end.
17359 * src/reader.c (read_additionnal_code): New.
17360 (reader): Use it.
17361 * src/output.c (output_program): Remove.
17362 (output): Update.
17363
b33160bf
MA
173642001-08-28 Marc Autret <autret_m@epita.fr>
17365
17366 * src/output.c (output_actions): Clean up.
4e5caae2 17367 (output_gram): CPP-out useless code.
b33160bf
MA
17368 * src/reader.c (reader): Clean up, CPP-out useless code.
17369
d1a2daf7
PB
173702001-08-28 Pascal Bart <pascal.bart@epita.fr>
17371
342b8b6e 17372 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 17373 directive.
d1a2daf7
PB
17374 * src/bison.simple: Add `%%definitions'.
17375
2b763dfe
MA
173762001-08-28 Marc Autret <autret_m@epita.fr>
17377
17378 * config/depcomp: New file.
17379
f1a87ef6
PE
173802001-08-27 Paul Eggert <eggert@twinsun.com>
17381
17382 * src/bison.simple (yyparse): Don't take the address of an
17383 item before the start of an array, as that doesn't conform to
17384 the C Standard.
17385
82e236e2
RA
173862001-08-27 Robert Anisko <robert.anisko@epita.fr>
17387
f1a87ef6 17388 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
17389 obstack. It was done too late here.
17390
17391 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
17392 completely wrong.
17393 (reader): Initialize the macro obstack here, since we need it to grow
17394 '%define' directives.
17395
17396 * src/reader.h: Declare the macro obstack as extern.
17397
b0cfa28a
RA
173982001-08-27 Robert Anisko <robert.anisko@epita.fr>
17399
17400 * src/output.c (output_parser): Fix. Store single '%' characters in
17401 the output obstack instead of throwing them away.
17402
6fc74234
AD
174032001-08-27 Akim Demaille <akim@epita.fr>
17404
17405 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17406
9c76d118
RA
174072001-08-25 Robert Anisko <robert.anisko@epita.fr>
17408
17409 * lib/Makefile.am: Adjust.
17410
a8289c62
RA
174112001-08-25 Robert Anisko <robert.anisko@epita.fr>
17412
17413 * src/bison.simple: Update and add '%%' directives.
17414
b6610515
RA
174152001-08-25 Robert Anisko <robert.anisko@epita.fr>
17416
17417 * src/reader.c (reader): Remove calls to 'output_headers' and
17418 'output_trailers'. Remove some C output.
17419 (readgram): Disable a piece of code that was writing a default
17420 definition for 'YYSTYPE'.
17421 (reader_output_yylsp): Remove.
17422 (packsymbols): Output token defintions to a macro.
17423 (copy_definition): Disable C output.
6fc74234 17424
b6610515
RA
17425 * src/reader.c (parse_macro_decl): New function used to parse macro
17426 declarations.
17427 (copy_string2): Put the body of copy_string into this new function.
17428 Add a parameter to let the caller choose whether he wants to copy the
17429 string delimiters or not.
17430 (copy_string): Be a simple call to copy_string2 with the last argument
17431 bound to true.
17432 (read_declarations): Add case for macro definition.
17433 (copy_identifier): New.
6fc74234 17434 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
17435 rather than lex.
17436
26f609ff
RA
174372001-08-25 Robert Anisko <robert.anisko@epita.fr>
17438
17439 * src/output.c (prepare): Add prefixed names.
17440 (output_parser): Output semantic actions.
17441 (output_parser): Fix bug on '%%line' directives.
6fc74234 17442
26f609ff
RA
17443 * src/output.c (output_headers): Remove. The C code printed by this
17444 function should now be in the skeletons.
17445 (output_trailers): Remove.
17446 (output): Disable call to 'reader_output_yylsp'.
17447 (output_rule_data): Do not output tables to the table obstack.
17448
17449 * src/output.c: Remove some C dedicated output.
17450 Improve the use of macro and output obstacks.
17451 (output_defines): Remove.
6fc74234 17452
26f609ff
RA
17453 * src/output.c (output_token_translations): Associate 'translate'
17454 table with a macro. No output to the table obstack.
17455 (output_gram): Same for 'rhs' and 'prhs'.
17456 (output_stos): Same for 'stos'.
17457 (output_rule_data): Same for 'r1' and 'r2'.
17458 (token_actions): Same for 'defact'.
17459 (goto_actions): Same for 'defgoto'.
17460 (output_base): Same for 'pact' and 'pgoto'.
17461 (output_table): Same for 'table'.
17462 (output_check): Same for 'check'.
6fc74234 17463
26f609ff
RA
17464 * src/output.c (output_table_data): New function.
17465 (output_short_table): Remove.
17466 (output_short_or_char_table): Remove.
6fc74234 17467
26f609ff
RA
17468 * src/output.c (output_parser): Replace most of the skeleton copy code
17469 with something new. Skeletons are now processed character by character
17470 rather than line by line, and Bison looks for '%%' macros. This is the
17471 first step in making Bison's output process (a lot) more flexible.
17472 (output_parser): Use the macro table.
17473
6f43b113
RA
174742001-08-25 Robert Anisko <robert.anisko@epita.fr>
17475
17476 * src/main.c (main): Initialize the macro table.
17477
dd3127cf
RA
174782001-08-25 Robert Anisko <robert.anisko@epita.fr>
17479
17480 * src/lex.c (percent_table): Add tok_define.
17481 * src/lex.h: Add tok_define.
17482
aa321494
RA
174832001-08-25 Robert Anisko <robert.anisko@epita.fr>
17484
17485 * src/macrotab.c: New file.
17486 * src/macrotab.h: New file.
17487 * src/Makefile.am: Update.
17488
68bd3b6b
RA
174892001-08-25 Robert Anisko <robert.anisko@epita.fr>
17490
17491 * lib/hash.c: New file.
17492 * lib/hash.h: New file.
17493 * lib/Makefile.am: Update.
17494
45f8dd1e
AD
174952001-08-15 Akim Demaille <akim@epita.fr>
17496
17497 Version 1.28c.
17498
40a64a7a 174992001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
17500
17501 * src/reader.c (readgram): Indent output macro YYSTYPE.
17502 (packsymbols): Likewise.
17503 (output_token_defines): Likewise.
17504 * src/files.c: Standardize.
17505 (compute_header_macro): New.
17506 (defines_obstack_save): New. Use compute_header_macro.
17507 (output_files): Update. Use defines_obstack_save.
17508
f9a8293a
AD
175092001-08-15 Akim Demaille <akim@epita.fr>
17510
17511 * doc/bison.texinfo (Table of Symbols): Document
17512 YYSTACK_USE_ALLOCA.
17513
150ca7a7
AD
175142001-08-15 Akim Demaille <akim@epita.fr>
17515
17516 * missing: Update from CVS Automake.
17517 * config/config.guess, config/config.sub, config/texinfo.tex:
17518 Update from gnu.org.
17519
69b5cec4
AD
175202001-08-15 Akim Demaille <akim@epita.fr>
17521
17522 * Makefile.maint: Sync with CVS Autoconf.
17523
f2b5126e
PB
175242001-08-14 Pascal Bart <pascal.bart@epita.fr>
17525
69b5cec4 17526 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
17527 `fdl.texi'.
17528 * doc/fdl.texi: Add to package.
17529
4ecbf796
MA
175302001-08-14 Marc Autret <autret_m@epita.fr>
17531
17532 Turn on %{source,header}_extension features.
17533
69b5cec4 17534 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
17535 source_extension.
17536 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 17537 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
17538 between options.
17539
95fb5662
MA
175402001-08-14 Marc Autret <autret_m@epita.fr>
17541
17542 * src/files.c (compute_base_names): Add extensions computing when
17543 `--file-prefix' used.
17544 Standardize function calls.
17545
78d09da9
MA
175462001-08-13 Marc Autret <autret_m@epita.fr>
17547
69b5cec4 17548 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
17549 defining it (defined but null disables alloca).
17550
5a009f2c
MA
175512001-08-13 Marc Autret <autret_m@epita.fr>
17552
17553 * src/bison.simple (_yy_memcpy): CPP reformat.
17554
1e41465a
PB
175552001-08-13 Pascal Bart <pascal.bart@epita.fr>
17556
17557 * tests/atconfig.in (CPPFLAGS): Fix.
17558
c67a198d
PB
175592001-08-10 Pascal Bart <pascal.bart@epita.fr>
17560
79282c6c 17561 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
17562 `gpl.texi'.
17563 * doc/gpl.texi: Add to package.
17564
09a6de7e
MA
175652001-08-10 Marc Autret <autret_m@epita.fr>
17566
17567 * src/print_graph.h: Fix.
17568 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
17569
b77b9ee0
AD
175702001-08-10 Akim Demaille <akim@epita.fr>
17571
17572 * src/system.h: Provide default declarations for stpcpy, strndup,
17573 and strnlen.
17574
3e259915
MA
175752001-08-10 Robert Anisko <anisko_r@epita.fr>
17576
17577 * doc/bison.texinfo (Locations): Update @$ stuff.
17578
ca96bc2d
MA
175792001-08-09 Robert Anisko <anisko_r@epita.fr>
17580
17581 * src/bison.simple (YYLLOC_DEFAULT): Update.
17582 (yyparse): Adjust.
17583
fdc6758b
MA
175842001-08-08 Marc Autret <autret_m@epita.fr>
17585
b77b9ee0 17586 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
17587 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
17588 Reported by Fabrice Bauzac.
957d4dbf 17589
600cad3b
MA
175902001-08-08 Marc Autret <autret_m@epita.fr>
17591
17592 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
17593 * src/vcg.c (output_node): Fix.
17594 * src/vcg.h: Cleanup.
17595 * src/print_graph.c: Add comments.
b77b9ee0 17596 (node_output_size): New global variable. Simplify the formatting of
600cad3b 17597 the VCG graph output.
b77b9ee0 17598 (print_actions): Unused code is now used. It notifies the final state
600cad3b 17599 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 17600 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
17601 blue.
17602 Get the current node name and node_obstack by argument.
17603 (node_obstack): New variable.
17604 (print_state): Manage node_obstack.
17605 (print_core): Use node_obstack given by argument.
17606 A node is not only computed here but in print_actions also.
17607 (print_graph): CPP out useless code instead of commenting it.
17608
976e528f
AD
176092001-08-07 Pascal Bart <pascal.bart@epita.fr>
17610
17611 * tests/atconfig.in (CPPFLAGS): Fix.
17612
20e8e5ca
AD
176132001-08-07 Akim Demaille <akim@epita.fr>
17614
17615 * src/print_graph.c (quote): New.
17616 (print_core): Use it.
17617
957d4dbf 176182001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 17619
3e3da797
AD
17620 * src/vcg.c (complain.h): Include it.
17621 Unepitaize `return' invocations.
c4b66126 17622 [NDEBUG] (main): Remove.
79282c6c 17623 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
17624 * src/files.c (open_files): Initialize graph_obstack.
17625 * src/print_graph.c (print_actions): CPP out useless code.
17626 (print_core): Don't output the last `\n' in labels.
17627 Use `quote'.
17628 * src/files.c (output_files): Output the VCG file.
17629 * src/main.c (main): Invoke print_graph ();
3e3da797 17630
957d4dbf 176312001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
17632
17633 Automaton VCG graph output.
17634 Using option ``-g'' or long option ``--graph'', you can generate
17635 a gram_filename.vcg file containing a VCG description of the LALR (1)
17636 automaton of your grammar.
17637
17638 * src/main.c: Call to print_graph() function.
17639 * src/getargs.h: Update.
17640 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
17641 (graph_flag): New flag.
17642 (longopts): Update.
17643 (getargs): Add case `g'.
17644 * src/files.c (graph_obstack): New obstack struct.
17645 (open_files): Initialize new obstack.
17646 (output_files): Saves graph_obstack if required.
17647 * src/files.h (graph_obstack): New extern declaration.
17648 * src/Makefile.am: Add new source files.
17649
927c1557 176502001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
17651
17652 * src/print_graph.c, src/print_graph.h (graph): New.
17653 * src/vcg.h: New file.
17654 * src/vcg.c: New file, VCG graph handling.
17655
7333d403
AD
176562001-08-06 Marc Autret <autret_m@epita.fr>
17657
17658 Add of %source_extension and %header_extension which specify
17659 the source or/and the header output file extension.
17660
17661 * src/files.c (compute_base_names): Remove initialisation of
17662 src_extension and header_extension.
17663 (compute_exts_from_gf): Update.
17664 (compute_exts_from_src): Update.
17665 (output_files): Update.
17666 * src/reader.c (parse_header_extension_decl): New.
17667 (parse_source_extension_decl): New.
17668 (read_declarations): New case statements for the new tokens.
17669 * src/lex.c (percent_table): Add entries for %source_extension
17670 and %header_extension.
17671 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
17672
84163231
AD
176732001-08-06 Marc Autret <autret_m@epita.fr>
17674
17675 * configure.in: Bump to 1.28c.
17676 * doc/bison.texinfo: Texinfo thingies.
17677
8303fc42
AD
176782001-08-04 Pascal Bart <pascal.bart@epita.fr>
17679
17680 * tests/atconfig.in (CPPFLAGS): Add.
17681 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
17682
70a84437
AD
176832001-08-03 Akim Demaille <akim@epita.fr>
17684
17685 Version 1.28b.
17686
2ce10144
AD
176872001-08-03 Akim Demaille <akim@epita.fr>
17688
17689 * tests/Makefile.am (check-local): Ship testsuite.
17690 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
17691 Include `string.h'.
17692
1e3e4bc1
AD
176932001-08-03 Akim Demaille <akim@epita.fr>
17694
17695 * configure.in: Try using -Wformat when compiling.
17696
42b45b7f
AD
176972001-08-03 Akim Demaille <akim@epita.fr>
17698
17699 * configure.in: Bump to 1.28b.
17700
8f13fe33
AD
177012001-08-03 Akim Demaille <akim@epita.fr>
17702
17703 * src/complain.c: Adjust strerror_r portability issues.
17704
b37ba92c
AD
177052001-08-03 Akim Demaille <akim@epita.fr>
17706
17707 Version 1.28a.
17708
b0ce6046
AD
177092001-08-03 Akim Demaille <akim@epita.fr>
17710
17711 * src/getargs.c, src/getarg.h (skeleton)): Constify.
17712 * src/lex.c (literalchar): Avoid name clashes on `buf'.
17713 * src/getargs.c: Include complain.h.
17714 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
17715 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
17716
d01c415b
AD
177172001-08-03 Akim Demaille <akim@epita.fr>
17718
17719 * src/reader.c (readgram): Display hidden chars in error messages.
17720
459dd1a6
AD
177212001-08-03 Akim Demaille <akim@epita.fr>
17722
17723 Update to gettext 0.10.39.
17724
53b74c0c
AD
177252001-08-03 Akim Demaille <akim@epita.fr>
17726
17727 * lib/strspn.c: New.
17728
234a3be3
AD
177292001-08-01 Marc Autret <autret_m@epita.fr>
17730
17731 * doc/bison.texinfo: Update.
17732 * doc/bison.1 (mandoc): Update.
17733 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
17734 * src/files.c: Support output files extensions computing.
17735 (src_extension): New static variable.
17736 (header_extension): New static variable.
17737 (tr): New function.
17738 (get_extension_index): New function, gets the index of an extension
17739 filename in a string.
17740 (compute_exts_from_gf): New function, computes extensions from the
17741 grammar file extension.
17742 (compute_exts_from_src): New functions, computes extensions from the
17743 C source file extension, file given by ``-o'' option.
17744 (compute_base_names): Update.
17745 (output_files): Update.
17746
847bf1f5
AD
177472001-08-01 Robert Anisko <anisko_r@epita.fr>
17748
d995fee7 17749 * doc/bison.texi: Document @$.
847bf1f5
AD
17750 (Locations): New section.
17751
d074a105
AD
177522001-07-18 Akim Demaille <akim@epita.fr>
17753
17754 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
17755 * config/prev-version.txt, config/move-if-change: New.
17756 * Makefile.am: Adjust.
17757
3419715d
AD
177582001-07-08 Pascal Bart <pascal.bart@epita.fr>
17759
17760 * src/bison.simple (yyparse): Suppress warning `comparaison
17761 between signed and unsigned'.
17762
62ab6972
AD
177632001-07-05 Pascal Bart <pascal.bart@epita.fr>
17764
17765 * src/getargs.h (raw_flag): Remove.
17766 * src/getargs.c: Die on `-r'/`--raw'.
17767 * src/lex.c (parse_percent_token): Die on `%raw'.
17768 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
17769 * tests/calc.at: Suppress test with option `--raw'.
17770
1e24cc5b
AD
177712001-07-14 Akim Demaille <akim@epita.fr>
17772
17773 * config/: New.
17774 * configure.in: Require Autoconf 2.50.
17775 Update to gettext 0.10.38.
17776
32dfccf8
AD
177772001-03-16 Akim Demaille <akim@epita.fr>
17778
17779 * doc/bison.texinfo: ANSIfy the examples.
17780
cd5bd6ac
AD
177812001-03-16 Akim Demaille <akim@epita.fr>
17782
17783 * getargs.c (skeleton): New variable.
17784 (longopts): --skeleton is a new option.
17785 (shortopts, getargs): -S is a new option.
17786 * getargs.h: Declare skeleton.
17787 * output.c (output_parser): Use it.
17788
5141b016
AD
177892001-03-16 Akim Demaille <akim@epita.fr>
17790
17791 * m4/strerror_r.m4: New.
17792 * m4/error.m4: Run AC_FUNC_STRERROR_R.
17793 * lib/error.h, lib/error.c: Update.
17794
447992b9
AD
177952001-03-16 Akim Demaille <akim@epita.fr>
17796
17797 * src/getargs.c (longopts): Clean up.
17798
274d42ce
AD
177992001-02-21 Akim Demaille <akim@epita.fr>
17800
17801 * src/reader.c (gensym): `gensym_count' is your own.
17802 Use a static buf to create the symbol name, as token_buffer is no
17803 longer a buffer.
17804
22c821f3
AD
178052001-02-08 Akim Demaille <akim@epita.fr>
17806
17807 * src/conflicts.c (conflict_report): Be sure not to append to res
17808 between two calls, which could happen if both first sprintf were
17809 skipped, but not the first cp += strlen.
17810
18569462
AD
178112001-02-08 Akim Demaille <akim@epita.fr>
17812
17813 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
17814 New, from fileutils 4.0.37.
17815 * configure.in: Require Autoconf 2.49c. I took some time before
17816 making this decision. This is the only way out for portability
17817 issues in Bison, it would mean way too much duplicate effort to
17818 import in Bison features implemented in 2.49c since 2.13.
17819 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
17820
0d8f3c8a
AD
178212001-02-02 Akim Demaille <akim@epita.fr>
17822
17823 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 17824 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 17825
f17bcd1f
AD
178262001-01-19 Akim Demaille <akim@epita.fr>
17827
17828 Get rid of the ad hoc handling of token_buffer in the scanner: use
17829 the obstacks.
17830
17831 * src/lex.c (token_obstack): New.
17832 (init_lex): Initialize it. No longer call...
17833 (grow_token_buffer): this. Remove it.
17834 Adjust all the places which used it to use the obstack.
17835
511e79b3
AD
178362001-01-19 Akim Demaille <akim@epita.fr>
17837
17838 * src/lex.h: Rename all the tokens:
17839 s/\bENDFILE\b/tok_eof/g;
17840 s/\bIDENTIFIER\b/tok_identifier/g;
17841 etc.
17842 Let them be enums, not #define, to ease debugging.
17843 Adjust all the code.
17844
0d6508ef
AD
178452001-01-18 Akim Demaille <akim@epita.fr>
17846
17847 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
17848 * src/lex.c (maxtoken, grow_token_buffer): Static.
17849
6deb4447
AD
178502001-01-18 Akim Demaille <akim@epita.fr>
17851
17852 Since we now use obstacks, more % directives can be enabled.
17853
17854 * src/lex.c (percent_table): Also accept `%yacc',
17855 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
17856 `%debug'.
17857 Handle the actions for `%semantic_parser' and `%pure_parser' here,
17858 instead of returning a token.
17859 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
17860 * src/reader.c (read_declarations): Adjust.
17861 * src/files.c (open_files): Don't call `compute_base_names', don't
17862 compute `attrsfile' since they depend upon data which might be
17863 *in* the input file now.
17864 (output_files): Do it here.
17865 * src/output.c (output_headers): Document the fact that this patch
17866 introduces a guaranteed SEGV for semantic parsers.
17867 * doc/bison.texinfo: Document them.
17868 * tests/suite.at: Exercise these %options.
17869
ff4423cc
AD
178702000-12-20 Akim Demaille <akim@epita.fr>
17871
17872 Also handle the output file (--verbose) with obstacks.
17873
17874 * files.c (foutput): Remove.
17875 (output_obstack): New.
17876 Adjust all dependencies.
17877 * src/conflicts.c: Return a string.
17878 * src/system.h (obstack_grow_string): Rename as...
17879 (obstack_sgrow): this. Be ready to work with non literals.
17880 (obstack_fgrow4): New.
17881
956dba3a
AD
178822000-12-20 Akim Demaille <akim@epita.fr>
17883
17884 * src/files.c (open_files): Fix the computation of short_base_name
17885 in the case of `-o foo.tab.c'.
17886
337bab46
AD
178872000-12-20 Akim Demaille <akim@epita.fr>
17888
17889 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
17890 (copy_dollar): Now that everything uses obstacks, get rid of the
17891 FILE * parameters.
17892
5d3214b8
AD
178932000-12-20 Akim Demaille <akim@epita.fr>
17894
17895 * src/files.c (open_files): Actually the `.output' file is based
17896 on the short_base_name, not base_name.
17897 * tests/suite.at (Checking output file names): Adjust.
17898
29092a57
AD
178992000-12-20 Akim Demaille <akim@epita.fr>
17900
17901 * src/bison.s1: Remove, we now use directly...
17902 * src/bison.simple: this.
17903 * src/Makefile.am: Use pkgdata instead of data.
17904
ea5607fd
AD
179052000-12-20 Akim Demaille <akim@epita.fr>
17906
17907 * src/files.c (guard_obstack): New.
17908 (open_files): Initialize it.
17909 (output_files): Dump it...
17910 * src/files.h: Export it.
17911 * src/reader.c (copy_guard): Use it.
17912
27110317
AD
179132000-12-19 Akim Demaille <akim@epita.fr>
17914
17915 * src/files.c (outfile, defsfile, actfile): Removed as global
17916 vars.
17917 (open_files): Don't compute them.
17918 (output_files): Adjust.
17919 (base_name, short_base_name): Be global.
17920 Adjust dependencies.
17921
19c50364
AD
179222000-12-19 Akim Demaille <akim@epita.fr>
17923
17924 * src/files.c (strsuffix): New.
17925 (stringappend): Be just like strcat but allocate.
17926 (base_names): Eve out from open_files.
17927 Try to simplify the rather hairy computation of base_name and
17928 short_base_name.
17929 (open_files): Use it.
17930 * tests/suite.at (Checking output file names): New test.
17931
573c1d9f
AD
179322000-12-19 Akim Demaille <akim@epita.fr>
17933
17934 * src/system.h (obstack_grow_literal_string): Rename as...
17935 (obstack_grow_string): this.
17936 * src/output.c (output_parser): Recognize `%% actions' instead of
17937 `$'.
17938 * src/bison.s1: s/$/%% actions/.
17939 * src/bison.hairy: Likewise.
17940
ef7ddedd
AD
179412000-12-19 Akim Demaille <akim@epita.fr>
17942
17943 * src/output.c (output_parser): Compute the `#line' lines when
17944 there are.
17945 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
17946 Suggested by Hans Aberg.
17947
ff61dabd
AD
179482000-12-19 Akim Demaille <akim@epita.fr>
17949
17950 Let the handling of the skeleton files be local to the procedures
17951 that use it.
17952
17953 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
17954 longer static.
17955 (fparser, open_extra_files): Remove.
17956 (open_files, output_files): Don't take care of fparser.
17957 * src/files.h: Adjust.
17958 * src/output.c (output_parser): Open and close the file to the
17959 skeleton.
17960 * src/reader.c (read_declarations): When %semantic_parser, open
17961 fguard.
17962
55b96341
AD
179632000-12-19 Akim Demaille <akim@epita.fr>
17964
17965 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
17966 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
17967
358c15b7
AD
179682000-12-19 Akim Demaille <akim@epita.fr>
17969
17970 * src/files.c (open_files): Yipee! We no longer need all the code
17971 looking for `/tmp' since we have no tmp file.
17972
7de3329e
AD
179732000-12-19 Akim Demaille <akim@epita.fr>
17974
17975 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
17976 New macros.
17977 * src/files.c (open_files): Less dependency on MSDOS etc.
17978
3abcd459
AD
179792000-12-14 Akim Demaille <akim@epita.fr>
17980
17981 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
17982 Provide a default definition.
17983 Use it when executing the default @ action.
17984 * src/reader.c (reader_output_yylsp): No longer include
17985 `timestamp' and `text' in the default YYLTYPE.
17986
2a91a95e
AD
179872000-12-12 Akim Demaille <akim@epita.fr>
17988
17989 * src/reader.c (copy_definition, parse_union_decl, copy_action)
17990 (copy_guard): Quote the file names.
17991 Reported by Laurent Mascherpa.
17992
14d3eb9b
AD
179932000-12-12 Akim Demaille <akim@epita.fr>
17994
17995 * src/output.c (output_headers, output_program, output): Be sure
17996 to escape special characters when outputting filenames.
17997 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
17998 (output_headers): Don't depend on them, Use ACTSTR.
17999
d7045ec6
AD
180002000-11-17 Akim Demaille <akim@epita.fr>
18001
18002 * lib/obstack.h: Formatting changes.
18003 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
18004 prevents type checking.
18005 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
18006 cast the value to (void *): assigning a `foo *' to a `void *'
18007 variable is valid.
18008 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
18009 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
18010 append characters.
18011
6fd54b73
AD
180122000-11-17 Akim Demaille <akim@epita.fr>
18013
18014 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
18015 as...
18016 (suite.m4, regression.m4, calc.m4): these.
18017 * tests/atgeneral.m4: Update from CVS Autoconf.
18018
4c50eae6
AD
180192000-11-17 Akim Demaille <akim@epita.fr>
18020
18021 * tests/regression.m4 (%union and --defines): New test,
18022 demonstrating a current bug in the obstack implementation.
18023
a35f64ea
AD
180242000-11-17 Akim Demaille <akim@epita.fr>
18025
18026 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
18027 macros.
18028 Use them to declare the variables which are global or local to
18029 `yyparse'.
18030
7de23534
AD
180312000-11-17 Akim Demaille <akim@epita.fr>
18032
18033 * acconfig.h: Remove, no longer used.
18034
aa7815f5
AD
180352000-11-07 Akim Demaille <akim@epita.fr>
18036
18037 * src: s/Copyright (C)/Copyright/g.
18038
5af1f549
AD
180392000-11-07 Akim Demaille <akim@epita.fr>
18040
18041 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
18042 defining.
18043 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
18044
553e2b22
AD
180452000-11-07 Akim Demaille <akim@epita.fr>
18046
18047 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
18048 Merge in a single CPP if/else.
18049
8a4f41d6
AD
180502000-11-07 Akim Demaille <akim@epita.fr>
18051
18052 * src/output.c (output): Remove useless variables.
18053 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
18054 argument `data' for consistency with the prototypes.
18055 Qualify it `const'.
18056 (obstack_copy, obstack_copy0): Rename the second argument as
18057 `address' for consistency. Qualify it `const'.
18058 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
18059 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
18060 `const' their input argument (`data' or `address').
18061 Adjust the corresponding macros to include `const' in casts.
18062
095a3fb5
AD
180632000-11-03 Akim Demaille <akim@epita.fr>
18064
18065 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
18066 s/PFILE1/BISON_HAIRY/.
18067 Adjust dependencies.
18068
d1cdce7c
AD
180692000-11-03 Akim Demaille <akim@epita.fr>
18070
090c5ebf 18071 For some reason, this was not applied.
d1cdce7c
AD
18072
18073 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18074 `unlink': it's no longer used.
18075
9311529b
AD
180762000-11-03 Akim Demaille <akim@epita.fr>
18077
18078 * src/files.c (skeleton_find): New function, eved out of...
18079 (open_files, open_extra_files): here.
18080
d8880f69
AD
180812000-11-03 Akim Demaille <akim@epita.fr>
18082
18083 Don't use `atexit'.
18084
18085 * src/files.c (obstack_save): New function.
18086 (done): Rename as...
18087 (output_files): this.
18088 Use `obstack_save'.
18089 * src/main.c (main): Don't use `atexit' to register `done', since
18090 it no longer has to remove tmp files, just call `output_files'
18091 when there are no errors.
18092
0dbb648e
AD
180932000-11-02 Akim Demaille <akim@epita.fr>
18094
18095 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18096 `unlink': it's no longer used.
18097 * src/files.h: Formatting changes.
18098
896fe5c1
AD
180992000-11-02 Akim Demaille <akim@epita.fr>
18100
18101 Remove the last uses of mktemp and unlink/delete.
18102
18103 * src/files.c (fdefines, ftable): Removed.
18104 (defines_ostack, table_obstack): New.
18105 Adjust dependencies of the former into uses of the latter.
18106 * src/output.c (output_short_or_char_table, output_short_table):
18107 Convert to using obstacks.
18108 * src/reader.c (copy_comment2): Accept one FILE * and two
18109 obstacks.
18110 (output_token_defines, reader_output_yylsp): Use obstacks.
18111 * src/system.h (obstack_fgrow3): New.
1f65350a 18112 * po/POTFILES.in: Adjust.
896fe5c1 18113
dd60faec
AD
181142000-11-01 Akim Demaille <akim@epita.fr>
18115
18116 Change each use of `fattrs' into a use of `attrs_obstack'.
18117
18118 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
18119 * src/files.c (fattrs): Remove.
18120 (attrs_obstack): New.
18121 Adjust all dependencies.
18122 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
18123
8c7ebe49
AD
181242000-11-01 Akim Demaille <akim@epita.fr>
18125
18126 Introduce obstacks.
18127 Change each use of `faction' into a use of `action_obstack'.
18128
18129 * lib/obstack.h, lib/obstack.c: New files.
18130 * src/files.c (faction): Remove.
18131 (action_obstack): New.
18132 Adjust all dependencies.
18133
77aee789
AD
181342000-10-20 Akim Demaille <akim@epita.fr>
18135
18136 * lib/quote.h (PARAMS): New macro. Use it.
18137
43591cec
AD
181382000-10-16 Akim Demaille <akim@epita.fr>
18139
18140 * src/output.c (output_short_or_char_table): New function.
18141 (output_short_table, output_token_translations): Use it.
18142 (goto_actions): Use output_short_table.
18143
1e9798d5
AD
181442000-10-16 Akim Demaille <akim@epita.fr>
18145
18146 * src/symtab.c (bucket_new): New function.
18147 (getsym): Use it.
18148
18149 * src/output.c (output_short_table): New argument to display the
18150 comment associated with the table.
18151 Adjust dependencies.
18152 (output_gram): Use it.
18153 (output_rule_data): Nicer output layout for YYTNAME.
18154
f282676b
AD
181552000-10-16 Akim Demaille <akim@epita.fr>
18156
18157 * src/lex.c (read_typename): New function.
18158 (lex): Use it.
18159 * src/reader.c (copy_dollar): Likewise.
18160
550a72a3
AD
181612000-10-16 Akim Demaille <akim@epita.fr>
18162
18163 * src/reader.c (copy_comment2): Expect the input stream to be on
18164 the `/' which is suspected to open a comment, instead of being
18165 called after `//' or `/*' was read.
18166 (copy_comment, copy_definition, parse_union_decl, copy_action)
18167 (copy_guard): Adjust.
18168
131e2fef
AD
181692000-10-16 Akim Demaille <akim@epita.fr>
18170
18171 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
18172 `read_signed_integer'.
18173
79282c5a
AD
181742000-10-16 Akim Demaille <akim@epita.fr>
18175
18176 * src/reader.c (copy_dollar): New function.
18177 (copy_guard, copy_action): Use it.
18178
ff4a34be
AD
181792000-10-16 Akim Demaille <akim@epita.fr>
18180
18181 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
18182 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
18183 New files, from Fileutils 4.0.27.
18184 * src/main.c (printable_version): Remove.
18185 * src/lex.c, src/reader.c: Use `quote'.
18186
181872000-10-04 Akim Demaille <akim@epita.fr>
18188
18189 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
18190
14ded682
AD
181912000-10-04 Akim Demaille <akim@epita.fr>
18192
18193 * doc/bison.texinfo: Various typos spotted by Neil Booth.
18194
8e03724b
AD
181952000-10-04 Akim Demaille <akim@epita.fr>
18196
18197 When a literal string is used to define two different tokens,
18198 `bison -v' segfaults.
18199 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
18200
18201 * tests/regression.m4: New file.
18202 Include the core of the sample provided by Piotr Gackiewicz.
18203 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
18204 properly.
18205
a9e64249
AD
182062000-10-04 Akim Demaille <akim@epita.fr>
18207
18208 * src/reader.c (parse_expect_decl): Keep `count' within the size
18209 of `buffer'.
18210 From Neil Booth.
18211
da9abf43
AD
182122000-10-02 Paul Eggert <eggert@twinsun.com>
18213
18214 * bison.s1 (yyparse): Assign the default value
18215 unconditionally, to avoid a GCC warning and make the parser a
18216 tad smaller.
18217
c33638bb
AD
182182000-10-02 Akim Demaille <akim@epita.fr>
18219
18220 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
18221 options.
18222
444c570a
AD
182232000-10-02 Akim Demaille <akim@epita.fr>
18224
18225 * src/derives.c, src/print.c, src/reduce.c: To ease the
18226 translation, move some `\n' out of the translated strings.
18227
89cab50d
AD
182282000-10-02 Akim Demaille <akim@epita.fr>
18229
18230 The location tracking mechanism is precious for parse error
18231 messages. Nevertheless, it is enabled only when `@n' is used in
18232 the grammar, which is a different issue (you can use it in error
18233 message, but not in the grammar per se). Therefore, there should
18234 be another means to enable it.
18235
18236 * src/getargs.c (getargs): Support `--locations'.
18237 (usage): Report it.
18238 * src/getargs.h (locationsflag): Export it.
18239 * src/lex.c (percent_table): Support `%locations'.
18240 * src/reader.c (yylsp_needed): Remove this variable, now replaced
18241 with `locationsflag'.
18242 * doc/bison.texinfo: Document `--locations' and `%locations'.
18243 Sort the options.
18244 * tests/calc.m4: Test it.
18245
18246 For regularity of the names, replace each
18247 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
18248 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
18249 In addition replace each `flag' with `_flag'.
18250
d6c2cba0
AD
182512000-10-02 Akim Demaille <akim@epita.fr>
18252
18253 Also test parse error messages, including with YYERROR_VERBOSE.
18254
18255 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
18256 associative).
18257 Use it to check the computations.
18258 Use it to check `nonassoc' is honored.
18259 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
18260 `--yyerror-verbose'.
18261 (_AT_CHECK_CALC): Adjust to this option.
18262 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
18263
5a35a6cb
AD
182642000-10-02 Akim Demaille <akim@epita.fr>
18265
18266 Test also `--verbose', `--defines' and `--name-prefix'. Testing
18267 the latter demonstrates a flaw in the handling of non debugging
18268 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
18269 was used in order to simplify:
18270
18271 #if YYDEBUG
18272 if (yydebug)
18273 {
18274 ...
18275 }
18276 #endif
18277
18278 into
18279
18280 if (yydebug)
18281 {
18282 ...
18283 }
18284
18285 unfortunately this leads to a CPP conflict when
18286 `--name-prefix=foo' is used since it produces `#define yydebug
18287 foodebug'.
18288
18289 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
18290 (YYDPRINTF): New macro.
18291 Spread its use.
18292 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
18293 the bison options.
18294 Also test `--verbose', `--defines' and `--name-prefix'.
18295
71da9eea
AD
182962000-10-02 Akim Demaille <akim@epita.fr>
18297
18298 Improve the readability of the produced parsers.
18299
18300 * src/bison.s1: Formatting changes.
18301 Improve the comment related to the `$' mark.
18302 (yydefault): Don't fall through to `yyresume': `goto' there.
18303 * src/output.c (output_parser): When the `$' is met, skip the end
18304 of its line.
18305 New variable, `number_of_dollar_signs', to check there's exactly
18306 one `$' in the parser skeleton.
18307
95e36146
AD
183082000-10-02 Akim Demaille <akim@epita.fr>
18309
18310 * lib/xstrdup.c: New file, from the fileutils.
18311 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
18312 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
18313 instead of strlen + xmalloc + strcpy.
18314 * src/symtab.c (copys): Remove, use xstrdup instead.
18315
d7020c20
AD
183162000-10-02 Akim Demaille <akim@epita.fr>
18317
18318 * src/gram.h (associativity): New enum type which replaces the
18319 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
18320 `right_assoc', `left_assoc' and `non_assoc'.
18321 Adjust all dependencies.
18322 * src/reader.c: Formatting changes.
18323 (LTYPESTR): Don't define it, use it as a literal in
18324 `reader_output_yylsp'.
18325 * src/symtab.h (symbol_class): New enum type which replaces the
18326 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
18327 `sunknown', `stoken and `snterm'.
18328
1916f98e
AD
183292000-10-02 Akim Demaille <akim@epita.fr>
18330
18331 * src/getargs.c (fixed_outfiles): Rename as...
18332 (yaccflag): for consistency and accuracy.
18333 Adjust dependencies.
18334
d7913476
AD
183352000-10-02 Akim Demaille <akim@epita.fr>
18336
18337 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
18338 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
18339 difficult and introduced a lot of core dump. It turns out that
18340 Bison used an implementation of `xmalloc' based on `calloc', and
18341 at various places it does depend upon the initialization to 0. I
18342 have not tried to isolate the pertinent places, and all the former
18343 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
18344 someone should address this issue.
18345
18346 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
18347 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
18348 files.
18349 Adjust dependencies.
18350 * src/warshall.h: New file.
18351 Propagate.
18352
340ef489
AD
183532000-10-02 Akim Demaille <akim@epita.fr>
18354
18355 Various anti-`extern in *.c' changes.
18356
18357 * src/system.h: Include `assert.h'.
18358
b2ca4022
AD
183592000-10-02 Akim Demaille <akim@epita.fr>
18360
18361 * src/state.h (nstates, final_state, first_state, first_shift)
18362 (first_reduction): Move their exportation from here...
18363 * src/LR0.h: to here.
18364 Adjust dependencies.
18365 * src/getargs.c (statisticsflag): New variable.
18366 Add support for `--statistics'.
18367 Adjust dependencies.
18368
18369 Remove a lot of now useless `extern' statements in most files.
18370
403b315b
AD
183712000-10-02 Akim Demaille <akim@epita.fr>
18372
18373 * src/LR0.h: New file.
18374 Propagate its use.
18375
07a58c13
AD
183762000-10-02 Akim Demaille <akim@epita.fr>
18377
18378 * src/print.h: New file.
18379 Propagate its use.
18380 * src/print.c: Formatting and ordering changes.
18381 (verbose, terse): Replace with...
18382 (print_results): this new function.
18383 Adjust dependencies.
18384
0619caf0
AD
183852000-10-02 Akim Demaille <akim@epita.fr>
18386
18387 * src/conflicts.c (conflict_report): New function.
18388 (conflict_log, verbose_conflict_log): Replace with...
18389 (print_conflicts): this function.
18390 Adjust dependencies.
18391 * src/conflicts.h: New file.
18392 Propagate its inclusion.
18393
3519ec76
AD
183942000-10-02 Akim Demaille <akim@epita.fr>
18395
18396 * src/nullable.h: New file.
18397 Propagate its inclusion.
18398 * src/nullable.c: Formatting changes.
18399
015acc48
AD
184002000-10-02 Akim Demaille <akim@epita.fr>
18401
18402 * src/reduce.h: New file.
18403 Propagate its inclusion.
18404 * src/reduce.c: Topological sort and other formatting changes.
18405 (bool, TRUE, FALSE): Move their definition to...
18406 * src/system.h: here.
18407
8963a27b
AD
184082000-10-02 Akim Demaille <akim@epita.fr>
18409
18410 * src/files.c: Formatting changes.
18411 (tryopen, tryclose, openfiles): Rename as...
18412 (xfopen, xfclose, open_files): this.
18413 (stringappend): static.
18414 * src/files.h: Complete the list of exported symbols.
18415 Propagate its use.
18416
a70083a3
AD
184172000-10-02 Akim Demaille <akim@epita.fr>
18418
18419 * src/reader.h: New file.
18420 Propagate its use instead of tedious list of `extern' and
18421 prototypes.
18422 * src/reader.c: Formatting changes, topological sort,
18423 s/register//.
18424
abadc117
AD
184252000-10-02 Akim Demaille <akim@epita.fr>
18426
18427 * src/lex.h: Prototype `lex.c' exported functions.
18428 * src/reader.c: Adjust.
18429 * src/lex.c: Formatting changes.
18430 (safegetc): Rename as...
18431 (xgetc): this.
18432
720d742f
AD
184332000-10-02 Akim Demaille <akim@epita.fr>
18434
18435 * src/lalr.h: New file.
18436 Propagate its inclusion instead of prototypes and `extern'.
18437 * src/lalr.c: Formatting changes, topological sorting etc.
18438
f2acea59
AD
184392000-10-02 Akim Demaille <akim@epita.fr>
18440
18441 * src/output.c (token_actions): Introduce a temporary array,
18442 YYDEFACT, that makes it possible for this function to use
18443 output_short_table.
18444
d019d655
AD
184452000-10-02 Akim Demaille <akim@epita.fr>
18446
18447 `user_toknums' is output as a `short[]' in `output.c', while it is
18448 defined as a `int[]' in `reader.c'. For consistency with the
18449 other output tables, `user_toknums' is now defined as a table of
18450 shorts.
18451
18452 * src/reader.c (user_toknums): Be a short table instead of an int
18453 table.
18454 Adjust dependencies.
18455
18456 Factor the short table outputs.
18457
18458 * src/output.c (output_short_table): New function.
18459 * src/output.c (output_gram, output_stos, output_rule_data)
18460 (output_base, output_table, output_check): Use it.
18461
6c89f1c1
AD
184622000-10-02 Akim Demaille <akim@epita.fr>
18463
18464 * src/output.c (output): Topological sort of the functions, in
18465 order to get rid of the `static' prototypes.
18466 No longer use `register'.
18467 * src/output.h: New file.
18468 Propagate its inclusion in files explicitly prototyping functions
18469 from output.c.
18470
d9efd181
AD
184712000-09-21 Akim Demaille <akim@epita.fr>
18472
18473 * src/atgeneral.m4: Update from Autoconf.
18474
c29240e7 184752000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
18476
18477 * src/closure.h: New file.
18478 * src/closure.c: Formatting changes, topological sort over the
18479 functions, use of closure.h.
18480 (initialize_closure, finalize_closure): Rename as...
18481 (new_closure, free_closure): these. Adjust dependencies.
18482 * src/LR0.c: Formatting changes, topological sort, use of
18483 cloture.h.
18484 (initialize_states): Rename as...
18485 (new_states): this.
18486 * src/Makefile.am (noinst_HEADERS): Adjust.
18487
499daa50
AD
184882000-09-20 Akim Demaille <akim@epita.fr>
18489
18490 * src/acconfig.h: Don't protect config.h against multiple
18491 inclusion.
18492 Don't define PARAMS.
18493 * src/system.h: Define PARAMS.
18494 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
18495 purpose of config.h. system.h must not try to fix wrong
18496 definitions in config.h.
18497
cc84fd5d
AD
184982000-09-20 Akim Demaille <akim@epita.fr>
18499
18500 * src/derives.h: New file.
18501 * src/main.c, src/derives.h: Use it.
18502 Formatting changes.
18503 * src/Makefile.am (noinst_HEADERS): Adjust.
18504
db5b3a89
AD
185052000-09-20 Akim Demaille <akim@epita.fr>
18506
18507 * tests/atgeneral.m4: Update from Autoconf.
18508 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
18509 (AT_CHECK_CALC): New macros.
18510 Use these macros to test bison with options `', `--raw',
18511 `--debug', `--yacc', `--yacc --debug'.
18512
ceed8467
AD
185132000-09-19 Akim Demaille <akim@epita.fr>
18514
18515 * src/output.c: Formatting changes.
18516 * src/machine.h: Remove, leaving its contents in...
18517 * src/system.h: here.
18518 Include stdio.h.
18519 Adjust all dependencies on stdio.h and machine.h.
18520 * src/getargs.h: New file.
18521 Let all `extern' declarations about getargs.c be replaced with
18522 inclusion of `getargs.h'.
18523 * src/Makefile.am (noinst_HEADERS): Adjust.
18524
18525 * tests/calc.m4 (yyin): Be initialized in main, not on the global
18526 scope.
18527 (yyerror): Returns void, not int.
18528 * doc/bison.texinfo: Formatting changes.
18529
05a1d24b
AD
185302000-09-19 Akim Demaille <akim@epita.fr>
18531
18532 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
18533 portable.
18534
cbd25751
AD
185352000-09-18 Akim Demaille <akim@epita.fr>
18536
18537 * configure.in: Append WARNING_CFLAGS to CFLAGS.
18538 * src/Makefile.am (INCLUDES): Don't.
18539 Be ready to fetch headers in lib/.
18540
13863333
AD
185412000-09-18 Akim Demaille <akim@epita.fr>
18542
18543 * doc/bison.texinfo: Update the copyright.
18544 ANSIfy and GNUify the examples.
18545 Remove the old menu.
18546
0d533154
AD
185472000-09-18 Akim Demaille <akim@epita.fr>
18548
18549 First set of tests: use the `calc' example from the documentation.
18550
18551 * src/bison.s1 (yyparse): Condition the code using `yytname' which
18552 is defined only when YYDEBUG is.
18553 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
18554 * src/files.c (tryopen, tryclose): Formatting changes.
18555 Move to the top and be static.
18556 * src/reader.c (read_signed_integer): Likewise.
18557 * tests/calc.m4: New file.
18558 * Makefile.am, suite.m4: Adjust.
18559 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
18560
e79137ac
AD
185612000-09-18 Akim Demaille <akim@epita.fr>
18562
18563 Add support for an Autotest test suite for Bison.
18564
18565 * m4/m4.m4, m4/atconfig.m4: New files.
18566 * m4/Makefile.am (EXTRA_DIST): Adjust.
18567 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
18568 files.
18569 * src/getargs.c: Display a more standard --version message.
18570 * src/reader.c (reader): Formatting changes.
18571 No longer depend upon VERSION_STRING.
18572 * configure.in: No longer use `dnl'.
18573 Set up the test suite and the new directory `tests/.
18574 (VERSION_STRING): Remove.
18575
27821bff
AD
185762000-04-14 Akim Demaille <akim@epita.fr>
18577
18578 * src/reader.c (copy_comment2): New function, same as former
18579 `copy_comment', but outputs into two FILE *.
18580 (copy_comment): Use it.
18581 (parse_union_decl): Use it.
18582 (get_type, parse_start_decl): Use the same `invalid' message.
18583 (parse_start_decl, parse_union_decl): Use the same `multiple'
18584 message.
18585 (parse_union_decl, copy_guard, copy_action): Use the same
18586 `unmatched' message.
18587 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
18588
cfe5fbc0
AD
185892000-03-31 Akim Demaille <akim@epita.fr>
18590
18591 * src/files.c (tryopen, tryclose): Move to the top.
18592 Be static.
18593
cb7db13e
AD
185942000-03-31 Akim Demaille <akim@epita.fr>
18595
18596 * src/main.c (main): Don't call `done', exit does it.
18597
a0f6b076
AD
185982000-03-31 Akim Demaille <akim@epita.fr>
18599
36281465
AD
18600 * allocate.c: s/return (foo)/return foo/.
18601 * lalr.c: Likewise.
18602 * LR0.c: Likewise.
18603 * output.c: Likewise.
18604 * reader.c: Likewise.
18605 * symtab.c: Likewise.
18606 * vmsgetargs.c: Likewise.
18607
186082000-03-31 Akim Demaille <akim@epita.fr>
18609
18610 Clean up the error reporting functions.
a0f6b076
AD
18611
18612 * src/report.c: New file.
18613 * src/report.h: Likewise.
18614 * src/Makefile.am: Adjust.
18615 * m4/error.m4: New file.
18616 * m4/Makefile.am: Adjust.
18617 * configure.in (jm_PREREQ_ERROR): Call it.
18618 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
18619 Remove.
18620 (fatal, fatals): Remove. All callers use complain.c::fatal.
18621 (warn, warni, warns, warnss, warnss): Remove. All callers use
18622 complain.c::complain.
18623 (toomany): Remove, use fatal instead.
18624 * src/files.c (done): No argument, use complain_message_count.
18625 * src/main.c (main): Register `done' to `atexit'.
18626
18627 * src/getargs.c (usage): More `fputs', less `fprintf'.
18628
18539825
AD
186292000-03-28 Akim Demaille <akim@epita.fr>
18630
18631 * lib/: New directory.
18632 * Makefile.am (SUBDIRS): Adjust.
18633 * configure.in: Adjust.
18634 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
18635 useless.
18636 * src/alloca.c: Moved to lib/.
18637 * src/getopt.c: Likewise.
18638 * src/getopt1.c: Likewise.
18639 * src/getopt.h: Likewise.
18640 * src/ansi2knr.c: Likewise.
18641 * src/ansi2knr.1: Likewise.
18642 * src/Makefile.am: Adjust.
18643 * lib/Makefile.am: New file.
18644
9f306f2a
AD
186452000-03-28 Akim Demaille <akim@epita.fr>
18646
18647 * src/getargs.c (usage): Refresh the help message.
18648
0ba347b6
AD
186492000-03-17 Akim Demaille <akim@epita.fr>
18650
18651 * src/getopt1.c: Updated from textutils 2.0e
18652 * src/getopt.c: Likewise.
18653 * src/getopt.h: Likewise.
18654
dbe7f271
AD
186552000-03-17 Akim Demaille <akim@epita.fr>
18656
18657 * src/Makefile.am (bison.simple): Fix the awk program: quote only
18658 the file name, not the whole `#line LINE FILE'.
18659
75bbe78d
AD
186602000-03-17 Akim Demaille <akim@epita.fr>
18661
18662 On syntax errors, report the token on which we choked.
18663
aa5fd0ee
AD
18664 * src/bison.s1 (yyparse): In the label yyerrlab, when
18665 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 18666
7b306f52
AD
186672000-03-17 Akim Demaille <akim@epita.fr>
18668
aa5fd0ee 18669 * src/reader.c (copy_at): New function.
7b306f52
AD
18670 (copy_guard): Use it.
18671 (copy_action): Use it.
18672
e87b5700
AD
186732000-03-17 Akim Demaille <akim@epita.fr>
18674
18675 Be kind to translators, save some useless translations.
18676
aa5fd0ee 18677 * src/main.c (banner): New function.
e87b5700
AD
18678 (fatal_banner): Use it.
18679 (warn_banner): Use it.
18680
ae3c3164
AD
186812000-03-17 Akim Demaille <akim@epita.fr>
18682
aa5fd0ee
AD
18683 * src/reader.c (copy_definition): Use copy_string and
18684 copy_comment. Removed now unused `match', `ended',
18685 `cplus_comment'.
ae3c3164
AD
18686 (copy_comment, copy_string): Moved, to be visible from
18687 copy_definition.
18688
4dc58e7c
AD
186892000-03-17 Akim Demaille <akim@epita.fr>
18690
aa5fd0ee
AD
18691 * src/reader.c (copy_string): Declare `static inline'. No
18692 problems with inline, since it is checked by configure.
4dc58e7c
AD
18693 (copy_comment): Likewise.
18694
0a6384c4
AD
186952000-03-17 Akim Demaille <akim@epita.fr>
18696
aa5fd0ee 18697 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 18698
3cef001a
AD
186992000-03-17 Akim Demaille <akim@epita.fr>
18700
aa5fd0ee 18701 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
18702 (copy_action): Use it. Removed now unused `match', `ended',
18703 `cplus_comment'.
18704 (copy_guard): Likewise.
18705
ca36d2ef
AD
187062000-03-17 Akim Demaille <akim@epita.fr>
18707
aa5fd0ee 18708 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
18709 (copy_action): Use it.
18710 (copy_guard): Likewise.
18711
6666f98f
AD
187122000-03-17 Akim Demaille <akim@epita.fr>
18713
18714 Change the handling of @s so that they behave exactly like $s.
18715 There is now a pseudo variable @$ (readble and writable), location
18716 of the lhs of the rule (by default ranging from the location of
18717 the first symbol of the rhs, to the location of the last symbol,
18718 or, if the rhs is empty, YYLLOC).
18719
18720 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
18721 yyval.
18722 (yyparse): When providing a default semantic action, provide a
18723 default location action.
18724 (after the $): No longer change `*YYLSP', just stack YYLOC the
18725 same way you stack YYVAL.
18726 * src/reader.c (read_declarations): Use warns.
18727 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
18728 (copy_action, case '@'): Likewise.
18729 Use a standard error message, to save useless work from
18730 translators.
18731
41aca2e0
AD
187322000-03-17 Akim Demaille <akim@epita.fr>
18733
aa5fd0ee
AD
18734 * src/bison.s1: Formatting and cosmetics changes.
18735 * src/reader.c: Likewise.
41aca2e0
AD
18736 Update the Copyright notice.
18737
dc08c1d5
AD
187382000-03-17 Akim Demaille <akim@epita.fr>
18739
aa5fd0ee
AD
18740 * src/bison.s1 (#line): All set to `#line' only, since the
18741 Makefile now handles them.
dc08c1d5 18742
9ee3c97b
AD
187432000-03-16 Akim Demaille <akim@epita.fr>
18744
18745 * src/output.c (output_rule_data): Output the documentation of
18746 some of the tables.
18747 (Copyright notice): Update.
18748 Formatting changes.
18749
0de741ca
AD
187502000-03-16 Akim Demaille <akim@epita.fr>
18751
18752 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
18753 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
18754 One `#if YYDEBUG' remains, since it uses variables which are
18755 defined only if `YYDEBUG != 0'.
18756
bb10be54
AD
187572000-03-16 Akim Demaille <akim@epita.fr>
18758
18759 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
18760 and related variables so that the similarities are highlighted.
18761
b07b484a
AD
187622000-03-16 Akim Demaille <akim@epita.fr>
18763
18764 * src/bison.s1: Properly indent CPP directives.
18765
361f60b3
AD
187662000-03-16 Akim Demaille <akim@epita.fr>
18767
18768 * src/bison.s1: Properly indent the `alloca' CPP section.
18769
8c44d3ec
AD
187702000-03-16 Akim Demaille <akim@epita.fr>
18771
18772 Do not hard code values of directories in `configure.in'.
18773 Update the `configure' tool chain.
18774
18775 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
18776 src/makefile.am.
18777 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
18778 (AC_OUTPUT): Add m4/Makefile.
18779 Bump to bison 1.28a, 1.29 has never been released.
18780 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
18781 handled via src/Makefile.am.
18782 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
18783 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
18784 autoheader.
18785 * Makefile.am (SUBDIRS): Add m4.
18786 (ACLOCAL_AM_FLAGS): New variable.
18787 (AUTOMAKE_OPTIONS): Add check-news.
18788 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
18789 the proper line number and file name.
18790 (DEFS): Propagate the location of bison library files and of the
18791 locale files.
18792 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
18793 builddir.
18794 * acinclude.m4: Remove, replaced by the directory m4.
18795 * m4/Makefile.am (EXTRA_DIST): New variable.
18796 * m4/gettext.m4: New file, from the fileutils.
18797 * m4/lcmessage.m4: Likewise
18798 * m4/progtest.m4: Likewise.
18799 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
18800
f95997e7
AD
188012000-03-10 Akim Demaille <akim@epita.fr>
18802
18803 * src/closure.c:
18804 Formatting changes of various comments.
18805 Respect the GNU coding standards at various places.
18806 Don't use `_()' when no translation is needed.
18807
188081999-12-13 Jesse Thilo <jthilo@gnu.org>
18809
18810 * src/files.c:
18811 OS/2 honors TMPDIR environment variable.
18812
188131999-12-13 Jesse Thilo <jthilo@gnu.org>
18814
18815 * doc/bison.texinfo: Tweaked spelling and grammar.
18816 Updated ISBN.
18817 Removed reference to price of printed copy.
18818 Mention BISON_SIMPLE and BISON_HAIRY.
18819
188201999-12-13 Jesse Thilo <jthilo@gnu.org>
18821
18822 * configure.in, NEWS:
18823 Bison 1.29 released.
18824
188251999-10-27 Jesse Thilo <jthilo@gnu.org>
18826
18827 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
18828 Added reference card.
18829
188301999-07-26 Jesse Thilo <jthilo@gnu.org>
18831
18832 * po/ru.po: Added Russian translation.
18833
188341999-07-26 Jesse Thilo <jthilo@gnu.org>
18835
18836 * configure.in: Added Russian translation.
18837
188381999-07-06 Jesse Thilo <jthilo@gnu.org>
18839
18840 * configure.in, NEWS, README:
18841 Released version 1.28.
18842
188431999-06-14 Jesse Thilo <jthilo@gnu.org>
18844
18845 * src/system.h:
18846 Squashed redefinition warning on some systems.
18847
18848 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
18849 Have configure build version string instead of relying on ANSI string
18850 concatentation.
18851
188521999-06-14 Jesse Thilo <jthilo@gnu.org>
18853
18854 * po/POTFILES.in: Got rid of version.c.
18855
188561999-06-14 Jesse Thilo <jthilo@gnu.org>
18857
18858 * acconfig.h, configure.in:
18859 Have configure build version string instead of relying on ANSI string
18860 concatentation.
18861
188621999-06-08 Jesse Thilo <jthilo@gnu.org>
18863
18864 * doc/bison.1:
18865 Dropped mention of `+' for long-named options.
18866
188671999-05-30 Jesse Thilo <jthilo@gnu.org>
18868
18869 * src/files.c: Added <unistd.h> for unlink().
18870
18871 * src/Makefile.am, src/system.h:
18872 I18n fixes.
18873
188741999-05-30 Jesse Thilo <jthilo@gnu.org>
18875
18876 * README: Added a FAQ list.
18877
18878 * configure.in, acconfig.h:
18879 I18n fixes.
18880
188811999-05-30 Jesse Thilo <jthilo@gnu.org>
18882
18883 * doc/FAQ, doc/Makefile.am:
18884 Added a FAQ list.
18885
188861999-05-19 Jesse Thilo <jthilo@gnu.org>
18887
18888 * src/alloc.h, src/symtab.h, src/version.c:
18889 Protected inclusion of "config.h" with HAVE_CONFIG_H.
18890
188911999-04-18 Jesse Thilo <jthilo@gnu.org>
18892
18893 * src/.cvsignore, src/Makefile.am:
18894 Reorganized: sources in `src', documentation in `doc'.
18895
18896 * src/lex.c (literalchar):
18897 fixed the code for escaping double quotes (thanks
18898 Jonathan Czisny.)
18899
189001999-04-18 Jesse Thilo <jthilo@gnu.org>
18901
18902 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
18903 Adjusted paths to reflect directory reorganization.
18904
189051999-04-18 Jesse Thilo <jthilo@gnu.org>
18906
18907 * doc/.cvsignore, doc/Makefile.am:
18908 Reorganized: sources in `src', documentation in `doc'.
18909
189101999-04-18 Jesse Thilo <jthilo@gnu.org>
18911
18912 * configure.in:
18913 Updated AC_INIT file to reflect directory reorganization.
18914
18915 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
18916 Reorganized: sources in `src', documentation in `doc'.
18917
189181999-04-13 Jesse Thilo <jthilo@gnu.org>
18919
18920 * src/allocate.c:
18921 Don't declare calloc() and realloc() if not necessary.
18922
189231999-04-13 Jesse Thilo <jthilo@gnu.org>
18924
18925 * configure.in, acconfig.h, acinclude.m4:
18926 Don't declare calloc() and realloc() if not necessary.
18927
189281999-03-23 Jesse Thilo <jthilo@gnu.org>
18929
18930 * po/.cvsignore: Added i18n support.
18931
189321999-03-23 Jesse Thilo <jthilo@gnu.org>
18933
18934 * acconfig.h, configure.in, Makefile.am:
18935 Added i18n support.
18936
189371999-03-22 Jesse Thilo <jthilo@gnu.org>
18938
18939 * src/bison.s1: Fixed #line numbers.
18940
189411999-03-15 Jesse Thilo <jthilo@gnu.org>
18942
18943 * po/es.po, po/fr.po, po/nl.po, po/de.po:
18944 Added PO files from Translation Project.
18945
189461999-03-03 Jesse Thilo <jthilo@gnu.org>
18947
18948 * Makefile.am:
18949 Added support for non-ANSI compilers (ansi2knr).
18950
189511999-02-16 Jesse Thilo <jthilo@gnu.org>
18952
18953 * configure.in: Bumped version number to 1.27.
18954
18955 * Makefile.am:
18956 Added `bison.simple' to list of files removed by `make distclean'.
18957
189581999-02-12 Jesse Thilo <jthilo@gnu.org>
18959
18960 * src/files.c, src/files.h:
18961 Defined locations of parser files in config.h instead of Makefile.
18962
189631999-02-12 Jesse Thilo <jthilo@gnu.org>
18964
18965 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
18966 Defined locations of parser files in config.h instead of Makefile.
18967
189681999-02-09 Jesse Thilo <jthilo@gnu.org>
18969
18970 * Makefile.am:
18971 Removed inappropriate use of $< macro.
18972
189731999-02-05 Jesse Thilo <jthilo@gnu.org>
18974
18975 * po/Makefile.in.in, po/POTFILES.in:
18976 Add `po' directory skeleton.
18977
189781999-01-27 Jesse Thilo <jthilo@gnu.org>
18979
18980 * README: Document help-bison list.
18981
18982 * configure.in: Add check for mkstemp().
18983
189841999-01-20 Jesse Thilo <jthilo@gnu.org>
18985
18986 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
18987 Hush a few compiler warnings.
18988
18989 * src/files.c:
18990 Add tryclose(), which verifies that fclose was successful.
18991 Hush a couple of compiler warnings.
18992
189931999-01-20 Jesse Thilo <jthilo@gnu.org>
18994
18995 * Makefile.am, OChangeLog:
18996 ChangeLog is now automatically generated. Include the old version as
18997 OChangeLog.
18998
189991999-01-14 Jesse Thilo <jthilo@gnu.org>
19000
19001 * 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:
19002 Update FSF address.
19003
190041999-01-14 Jesse Thilo <jthilo@gnu.org>
19005
19006 * doc/bison.texinfo: Fix formatting glitch.
19007
19008 * doc/bison.texinfo: Update FSF address.
19009
190101999-01-14 Jesse Thilo <jthilo@gnu.org>
19011
19012 * acconfig.h: Update FSF address.
19013
190141999-01-08 Jesse Thilo <jthilo@gnu.org>
19015
19016 * src/system.h:
19017 Don't define PACKAGE here, since config.h defines it.
19018
190191998-12-30 Jesse Thilo <jthilo@gnu.org>
19020
19021 * src/reader.c: Update copyright date.
19022
19023 * src/main.c:
19024 Ditch sprintf to statically-sized buffers in fatal/warn functions in
19025 favor of output directly to stderr (avoids buffer overruns).
19026
19027 * src/reader.c: Some checks for premature EOF.
19028
19029 * 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:
19030 Use prototypes if the compiler understands them.
19031
19032 * src/files.c: Honor TMPDIR on Unix hosts.
19033 Use prototypes if the compiler understands them.
19034
19035 * src/reader.c:
19036 Fix a couple of buffer overrun bugs.
19037 Use prototypes if the compiler understands them.
19038
19039 * src/system.h: Include unistd.h and ctype.h.
19040 Use #ifdef instead of #if for NLS symbols.
19041
190421998-12-30 Jesse Thilo <jthilo@gnu.org>
19043
19044 * doc/bison.texinfo:
19045 Delete comment "consider using @set for edition number, etc..." since
19046 we now are doing so.
19047
190481998-12-30 Jesse Thilo <jthilo@gnu.org>
19049
19050 * configure.in:
19051 Use prototypes if the compiler understands them.
19052
19053 * NEWS: Document 1.26 highlights.
19054
19055 * Makefile.am: Require Automake 1.3 or later.
19056
19057 * acconfig.h:
19058 Use prototypes if the compiler understands them.
19059
190601998-12-29 Jesse Thilo <jthilo@gnu.org>
19061
19062 * src/version.c:
19063 Use VERSION symbol from automake for version number.
19064
190651998-12-29 Jesse Thilo <jthilo@gnu.org>
19066
19067 * acconfig.h, configure.in, version.cin:
19068 Use VERSION symbol from automake for version number.
19069
190701998-11-28 Jesse Thilo <jthilo@gnu.org>
19071
19072 * Makefile.am:
19073 Distribute original version of simple parser (bison.s1), not built
19074 version (bison.simple).
19075
190761998-11-28 Jesse Thilo <jthilo@gnu.org>
19077
19078 * doc/bison.texinfo: Add info dir entry.
19079
19080 * doc/bison.texinfo:
19081 Let automake put version number into documentation.
19082
190831998-11-26 Jesse Thilo <jthilo@gnu.org>
19084
19085 * src/bison.cld, src/build.com, src/vmshlp.mar:
19086 Add non-RCS files from /gd/gnu/bison.
19087
190881998-11-26 Jesse Thilo <jthilo@gnu.org>
19089
19090 * doc/bison.1:
19091 Document the BISON_HAIRY and BISON_SIMPLE variables.
19092
190931998-11-25 Jesse Thilo <jthilo@gnu.org>
19094
19095 * src/version.c: Build version.c automatically.
19096
19097 * src/reader.c:
19098 Fix token numbering (used to start at 258, not 257).
19099
19100 * src/system.h: Include config.h.
19101
19102 * src/getargs.c: Update bug report address.
19103
19104 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
19105 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
19106
191071998-11-25 Jesse Thilo <jthilo@gnu.org>
19108
19109 * Makefile.am:
19110 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19111
19112 * configure.in, version.cin:
19113 Build version.c automatically.
19114
19115 * AUTHORS: Add AUTHORS file.
19116
19117 * README: Update bug report address.
19118
19119 * bison.simple:
19120 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19121
19122 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
19123 Add automake stuff.
19124
191251998-11-25 Jesse Thilo <jthilo@gnu.org>
19126
19127 * doc/bison.texinfo: Clean up some formatting.
19128
191291998-05-05 Richard Stallman <rms@gnu.org>
19130
19131 * doc/bison.texinfo:
19132 Explain better why to make a pure parser.
19133
191341998-01-05 Richard Stallman <rms@gnu.org>
19135
19136 * src/files.c (openfiles):
19137 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
19138 find a temporary directory, if possible. Do not unlink files while
19139 they are open.
19140
191411997-08-25 Richard Stallman <rms@gnu.org>
19142
19143 * src/reader.c (stack_offset;):
19144 Change some warni to warns.
19145
19146 * src/lex.c (literalchar): Use warns, not warni.
19147
191481997-06-28 Richard Stallman <rms@gnu.org>
19149
19150 * src/bison.s1: Add a Bison version comment.
19151
19152 * src/main.c (fatal, warn, berror):
19153 Use program_name.
19154
191551997-06-28 Richard Stallman <rms@gnu.org>
19156
19157 * Makefile.in (bison_version): New variable.
19158 (dist): Use that variable.
19159 (bison.s1): Substitute the Bison version into bison.simple.
19160
19161 * bison.simple: Add a Bison version comment.
19162
191631997-06-18 Richard Stallman <rms@gnu.org>
19164
19165 * src/main.c (fatal, warn, berror):
19166 Make error messages standard.
19167 (toomany): Improve error message text.
19168
19169 * 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:
19170 new.h renamed to alloc.h.
19171
191721997-06-18 Richard Stallman <rms@gnu.org>
19173
19174 * Makefile.in: new.h renamed to alloc.h.
19175
191761997-05-24 Richard Stallman <rms@gnu.org>
19177
19178 * src/lex.c (literalchar):
19179 Fix the code for escaping \, " and '.
19180
19181 (lex): Avoid trouble when there are many chars
19182 to discard in a char literal with just several chars in it.
19183
191841997-05-17 Richard Stallman <rms@gnu.org>
19185
19186 * src/bison.s1:
19187 Use malloc, if using alloca is troublesome.
19188 (YYSTACK_USE_ALLOCA): New flag macro.
19189 Define it for some systems and compilers.
19190 (YYSTACK_ALLOC): New macro.
19191 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19192 If it was malloc'd, free it.
19193
191941997-05-17 Richard Stallman <rms@gnu.org>
19195
19196 * bison.simple:
19197 Use malloc, if using alloca is troublesome.
19198 (YYSTACK_USE_ALLOCA): New flag macro.
19199 Define it for some systems and compilers.
19200 (YYSTACK_ALLOC): New macro.
19201 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19202 If it was malloc'd, free it.
19203
192041997-04-23 Richard Stallman <rms@gnu.org>
19205
19206 * src/bison.s1:
19207 (alloca) [__hpux]: Always define as __builtin_alloca.
19208
192091997-04-23 Richard Stallman <rms@gnu.org>
19210
19211 * bison.simple:
19212 (alloca) [__hpux]: Always define as __builtin_alloca.
19213
192141997-04-22 Richard Stallman <rms@gnu.org>
19215
19216 * src/bison.s1:
19217 [__hpux]: Include alloca.h (right for HPUX 10)
19218 instead of declaring alloca (right for HPUX 9).
19219
19220 * src/bison.s1 (__yy_memcpy):
19221 Declare arg `count' as unsigned int.
19222 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19223
192241997-04-22 Richard Stallman <rms@gnu.org>
19225
19226 * bison.simple:
19227 [__hpux]: Include alloca.h (right for HPUX 10)
19228 instead of declaring alloca (right for HPUX 9).
19229
19230 * bison.simple (__yy_memcpy):
19231 Declare arg `count' as unsigned int.
19232 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19233
192341997-01-03 Richard Stallman <rms@gnu.org>
19235
19236 * src/allocate.c: [__STDC__ or _MSC_VER]:
19237 Declare calloc and realloc to return void *.
19238
192391997-01-02 Richard Stallman <rms@gnu.org>
19240
19241 * src/system.h:
19242 [_MSC_VER]: Include stdlib.h and process.h.
19243 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
19244
19245 * src/main.c (main): Return FAILURE as a value.
19246 (printable_version): Declare arg as int, not char.
19247
192481997-01-02 Richard Stallman <rms@gnu.org>
19249
19250 * Makefile.in (dist):
19251 Explicitly check for symlinks, and copy them.
19252
192531996-12-19 Richard Stallman <rms@gnu.org>
19254
19255 * src/files.c:
19256 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
19257
192581996-12-18 Paul Eggert <eggert@gnu.org>
19259
19260 * src/bison.s1 (yyparse):
19261 If __GNUC__ and YYPARSE_PARAM are both defined,
19262 declare yyparse to have a void * argument.
19263
192641996-12-18 Paul Eggert <eggert@gnu.org>
19265
19266 * bison.simple (yyparse):
19267 If __GNUC__ and YYPARSE_PARAM are both defined,
19268 declare yyparse to have a void * argument.
19269
192701996-12-17 Richard Stallman <rms@gnu.org>
19271
19272 * src/reduce.c (nbits): Add some casts.
19273
192741996-08-12 Richard Stallman <rms@gnu.org>
19275
19276 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
19277
192781996-08-12 Richard Stallman <rms@gnu.org>
19279
19280 * bison.simple: Test _MSDOS as well as _MSDOS_.
19281
192821996-07-31 Richard Stallman <rms@gnu.org>
19283
19284 * src/bison.s1:
19285 [__sun && __i386]: Include alloca.h.
19286
192871996-07-31 Richard Stallman <rms@gnu.org>
19288
19289 * bison.simple:
19290 [__sun && __i386]: Include alloca.h.
19291
192921996-07-30 Richard Stallman <rms@gnu.org>
19293
19294 * src/bison.s1: Comment change.
19295
19296 * src/bison.s1: Test _MSDOS_, not MSDOS.
19297
192981996-07-30 Richard Stallman <rms@gnu.org>
19299
19300 * bison.simple: Comment change.
19301
19302 * bison.simple: Test _MSDOS_, not MSDOS.
19303
193041996-06-01 Richard Stallman <rms@gnu.org>
19305
19306 * 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:
19307 Insert `_' macro around many string constants.
19308
19309 * src/main.c:
19310 Insert `_' macro around many string constants.
19311
19312 (main): Call setlocale, bindtextdomain and textdomain.
19313
19314 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
19315 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
19316 [ENABLE_NLS]: Include libintl.h.
19317 [ENABLE_NLS] (gettext): Define.
19318 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
19319 (N_, PACKAGE, LOCALEDIR): New macros.
19320
193211996-06-01 Richard Stallman <rms@gnu.org>
19322
19323 * POTFILES.in: New file.
19324
19325 * Makefile.in (allocate.o):
19326 Define target explicitly.
19327
19328 * Makefile.in (CFLAGS): Set to @CFLAGS@.
19329 (LDFLAGS): Set to @LDFLAGS@.
19330 (configure): Run autoconf only if preceding `cd' succeeds.
19331 (bison.s1): Redirect output to temporary file then move the
19332 temporary to the target, rather than redirecting directly to bison.s1.
19333 (clean): Remove config.status and config.log.
19334 (distclean): Don't remove config.status here.
19335
193361996-05-12 Richard Stallman <rms@gnu.org>
19337
19338 * src/bison.s1:
19339 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19340
193411996-05-12 Richard Stallman <rms@gnu.org>
19342
19343 * bison.simple:
19344 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19345
193461996-05-11 Richard Stallman <rms@gnu.org>
19347
19348 * src/bison.s1 (__yy_memcpy):
19349 Really reorder the args, as was supposedly done on Feb 14 1995.
19350 (yyparse): Calls changed accordingly.
19351
193521996-05-11 Richard Stallman <rms@gnu.org>
19353
19354 * Makefile.in (dist): Don't use $(srcdir).
19355
19356 * bison.simple (__yy_memcpy):
19357 Really reorder the args, as was supposedly done on Feb 14 1995.
19358 (yyparse): Calls changed accordingly.
19359
193601996-01-27 Richard Stallman <rms@gnu.org>
19361
19362 * src/output.c (output_rule_data):
19363 Test YYERROR_VERBOSE in the conditional
19364 around the definition of ttyname.
19365
193661995-12-29 Richard Stallman <rms@gnu.org>
19367
19368 * src/bison.s1:
19369 Fix line numbers in #line commands.
19370
193711995-12-29 Richard Stallman <rms@gnu.org>
19372
19373 * bison.simple:
19374 Fix line numbers in #line commands.
19375
193761995-12-27 Richard Stallman <rms@gnu.org>
19377
19378 * src/bison.s1 (YYPARSE_PARAM_DECL):
19379 In C++, make it always null.
19380 (YYPARSE_PARAM_ARG): New macro.
19381 (yyparse): Use YYPARSE_PARAM_ARG.
19382
193831995-12-27 Richard Stallman <rms@gnu.org>
19384
19385 * bison.simple (YYPARSE_PARAM_DECL):
19386 In C++, make it always null.
19387 (YYPARSE_PARAM_ARG): New macro.
19388 (yyparse): Use YYPARSE_PARAM_ARG.
19389
193901995-11-29 Richard Stallman <rms@gnu.org>
19391
19392 * doc/bison.texinfo:
19393 Describe literal string tokens, %raw, %no_lines, %token_table.
19394
193951995-11-29 Daniel Hagerty <hag@gnu.org>
19396
19397 * doc/bison.texinfo: Fixed update date
19398
193991995-10-16 Richard Stallman <rms@gnu.org>
19400
19401 * src/version.c: Version 1.25.
19402
194031995-10-16 Richard Stallman <rms@gnu.org>
19404
19405 * NEWS: *** empty log message ***
19406
194071995-10-16 Richard Stallman <rms@gnu.org>
19408
19409 * doc/bison.1, doc/bison.rnh:
19410 Add new options.
19411
194121995-10-15 Richard Stallman <rms@gnu.org>
19413
19414 * src/vmsgetargs.c, src/getargs.c:
19415 Added -n, -k, and -raw switches.
19416 (noparserflag, toknumflag, rawtoknumflag): New variables.
19417
19418 * src/symtab.h (SALIAS):
19419 New #define for adding aliases to %token.
19420 (struct bucket): Added `alias' field.
19421
19422 * src/reduce.c (reduce_grammar):
19423 Revise error message.
19424 (print_notices): Remove final `.' from error message.
19425
19426 * src/reader.c (reader_output_yylsp):
19427 New function.
19428 (readgram): Use `#if 0' around code that accepted %command
19429 inside grammar rules: The documentation doesn't allow it,
19430 and it will fail since the %command processors scan for the next %.
19431 (parse_token_decl): Extended the %token
19432 declaration to allow a multi-character symbol as an alias.
19433 (parse_thong_decl): New function.
19434 (read_declarations): Added %thong declarations.
19435 (read_declarations): Handle NOOP to deal with allowing
19436 % declarations as another means to specify the flags.
19437 (readgram): Allow %prec prior to semantics embedded in a rule.
19438 (skip_to_char, read_declarations, copy_definition)
19439 (parse_token_decl, parse_start_decl, parse_type_decl)
19440 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
19441 (get_type_name, copy_guard, copy_action, readgram)
19442 (get_type, packsymbols): Revised most error messages.
19443 Changed `fatal' to `warnxxx' to avoid aborting for error.
19444 Revised and use multiple warnxxx functions to avoid using VARARGS1.
19445 (read_declarations): Improve the error message for
19446 an invalid character. Do not abort.
19447 (read_declarations, copy_guard, copy_action): Use
19448 printable_version to avoid unprintable characters in printed output.
19449 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
19450 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
19451 Allow the type of a non-terminal can be given
19452 more than once, as long as all specifications give the same type.
19453
19454 * src/output.c:
19455 (output_headers, output_trailers, output, output_gram)
19456 (output_rule_data): Implement noparserflag variable.
19457 Implement toknumflag variable.
19458 (output): Call reader_output_yylsp to output LTYPESTR.
19459
19460 * src/main.c (main):
19461 If reader sees an error, don't process the grammar.
19462 (fatals): Updated to not use VARARGS1.
19463 (printable_version, int_to_string, warn, warni, warns, warnss)
19464 (warnsss): New error reporting functions. Avoid abort for error.
19465
19466 * src/lex.h:
19467 Added THONG and NOOP for alias processing.
19468 Added SETOPT for the new code that allows setting options with %flags.
19469
19470 * src/lex.c:
19471 Include getopt.h. Add some extern decls.
19472 (safegetc): New function to deal with EOF gracefully.
19473 (literalchar); new function to deal with reading \ escapes.
19474 (lex): Use literalchar.
19475 (lex): Implemented "..." tokens.
19476 (literalchar, lex, parse_percent_token): Made tokenbuffer
19477 always contain the token. This includes growing the token
19478 buffer while reading an integer.
19479 (parse_percent_token): Replaced if-else statement with percent_table.
19480 (parse_percent_token): Added % declarations as another
19481 way to specify the flags -n, -l, and -r. Also added hooks for
19482 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
19483 major changes to files.c.
19484 (lex) Retain in the incoming stream a character following
19485 an incorrect '/'.
19486 (skip_white_space, lex): Revised most error messages
19487 and changed fatal to warn to avoid aborting.
19488 (percent_table): Added %thong declarations.
19489
19490 * src/gram.h: Comment changes.
19491
19492 * src/files.c (openfiles, open_extra_files, done):
19493 Add faction flag
19494 and actfile file. Handle noparserflag. Both for -n switch.
19495
19496 * src/conflicts.c (resolve_sr_conflict):
19497 Remove use of alloca.
19498
194991995-06-01 Jim Meyering <meyering@gnu.org>
19500
19501 * doc/bison.texinfo: *** empty log message ***
19502
195031995-05-06 Richard Stallman <rms@gnu.org>
19504
19505 * src/bison.s1: Comment change.
19506
195071995-05-06 Richard Stallman <rms@gnu.org>
19508
19509 * bison.simple: Comment change.
19510
195111995-05-03 Richard Stallman <rms@gnu.org>
19512
19513 * src/version.c: Version now 1.24.
19514
19515 * src/bison.s1: Change distribution terms.
19516
19517 * src/version.c: Version now 1.23.
19518
195191995-05-03 Richard Stallman <rms@gnu.org>
19520
19521 * doc/bison.texinfo:
19522 Rewrite "Conditions for Using Bison".
19523 Update version to 1.24.
19524
195251995-05-03 Richard Stallman <rms@gnu.org>
19526
19527 * bison.simple: Change distribution terms.
19528
195291995-02-23 Richard Stallman <rms@gnu.org>
19530
19531 * src/files.c: Test __VMS_POSIX as well as VMS.
19532
195331995-02-14 Jim Meyering <meyering@gnu.org>
19534
19535 * src/bison.s1 (__yy_memcpy):
19536 Renamed from __yy_bcopy to avoid
19537 confusion. Reverse FROM and TO arguments to be consistent with
19538 those of memcpy.
19539
195401995-02-14 Jim Meyering <meyering@gnu.org>
19541
19542 * bison.simple (__yy_memcpy):
19543 Renamed from __yy_bcopy to avoid
19544 confusion. Reverse FROM and TO arguments to be consistent with
19545 those of memcpy.
19546
195471994-11-10 David J. MacKenzie <djm@gnu.org>
19548
19549 * NEWS: reformat
19550
19551 * NEWS: New file.
19552
19553 * Makefile.in (DISTFILES): Include NEWS.
19554
19555 * Makefile.in (DISTFILES):
19556 Include install-sh, not install.sh.
19557
19558 * configure.in: Update to Autoconf v2 macro names.
19559
195601994-10-05 David J. MacKenzie <djm@gnu.org>
19561
19562 * Makefile.in: fix typo
19563
19564 * Makefile.in (prefix, exec_prefix):
19565 Let configure set them.
19566
195671994-09-28 David J. MacKenzie <djm@gnu.org>
19568
19569 * Makefile.in: Set datadir to $(prefix)/share.
19570
195711994-09-15 Richard Stallman <rms@gnu.org>
19572
19573 * src/bison.s1:
19574 Update copyright notice and GPL version.
19575
195761994-09-15 Richard Stallman <rms@gnu.org>
19577
19578 * bison.simple:
19579 Update copyright notice and GPL version.
19580
195811994-07-12 Richard Stallman <rms@gnu.org>
19582
19583 * src/reduce.c, src/reader.c:
19584 entered into RCS
19585
195861994-05-05 David J. MacKenzie <djm@gnu.org>
19587
19588 * Makefile.in: entered into RCS
19589
195901994-03-26 Richard Stallman <rms@gnu.org>
19591
19592 * src/bison.s1: entered into RCS
19593
195941994-03-26 Richard Stallman <rms@gnu.org>
19595
19596 * bison.simple: entered into RCS
19597
195981994-03-25 Richard Stallman <rms@gnu.org>
19599
19600 * src/main.c: entered into RCS
19601
196021994-03-24 Richard Stallman <rms@gnu.org>
19603
19604 * src/conflicts.c: entered into RCS
19605
196061994-01-02 Richard Stallman <rms@gnu.org>
19607
19608 * Makefile.in: *** empty log message ***
19609
196101993-11-21 Richard Stallman <rms@gnu.org>
19611
19612 * src/bison.s1: *** empty log message ***
19613
196141993-11-21 Richard Stallman <rms@gnu.org>
19615
19616 * doc/bison.texinfo: entered into RCS
19617
19618 * doc/bison.texinfo: *** empty log message ***
19619
196201993-11-21 Richard Stallman <rms@gnu.org>
19621
19622 * bison.simple: *** empty log message ***
19623
196241993-10-25 David J. MacKenzie <djm@gnu.org>
19625
19626 * doc/bison.texinfo: *** empty log message ***
19627
196281993-10-19 Richard Stallman <rms@gnu.org>
19629
19630 * src/bison.s1: *** empty log message ***
19631
196321993-10-19 Richard Stallman <rms@gnu.org>
19633
19634 * bison.simple: *** empty log message ***
19635
196361993-10-14 Richard Stallman <rms@gnu.org>
19637
19638 * src/bison.s1: *** empty log message ***
19639
196401993-10-14 Richard Stallman <rms@gnu.org>
19641
19642 * bison.simple: *** empty log message ***
19643
196441993-09-14 David J. MacKenzie <djm@gnu.org>
19645
19646 * doc/bison.texinfo: *** empty log message ***
19647
196481993-09-13 Noah Friedman <friedman@gnu.org>
19649
19650 * Makefile.in: *** empty log message ***
19651
196521993-09-10 Richard Stallman <rms@gnu.org>
19653
19654 * src/conflicts.c: *** empty log message ***
19655
19656 * src/system.h: entered into RCS
19657
196581993-09-10 Richard Stallman <rms@gnu.org>
19659
19660 * doc/bison.1: entered into RCS
19661
196621993-09-06 Noah Friedman <friedman@gnu.org>
19663
19664 * src/version.c: entered into RCS
19665
196661993-09-06 Noah Friedman <friedman@gnu.org>
19667
19668 * Makefile.in: *** empty log message ***
19669
196701993-07-30 David J. MacKenzie <djm@gnu.org>
19671
19672 * Makefile.in: *** empty log message ***
19673
196741993-07-24 Richard Stallman <rms@gnu.org>
19675
19676 * src/bison.s1: *** empty log message ***
19677
196781993-07-24 Richard Stallman <rms@gnu.org>
19679
19680 * bison.simple: *** empty log message ***
19681
196821993-07-08 David J. MacKenzie <djm@gnu.org>
19683
19684 * Makefile.in: *** empty log message ***
19685
196861993-07-04 Richard Stallman <rms@gnu.org>
19687
19688 * src/bison.s1: *** empty log message ***
19689
196901993-07-04 Richard Stallman <rms@gnu.org>
19691
19692 * bison.simple: *** empty log message ***
19693
196941993-06-26 David J. MacKenzie <djm@gnu.org>
19695
19696 * src/getargs.c: entered into RCS
19697
196981993-06-26 David J. MacKenzie <djm@gnu.org>
19699
19700 * doc/bison.texinfo: *** empty log message ***
19701
19702 * doc/bison.1: New file.
19703
197041993-06-25 Richard Stallman <rms@gnu.org>
19705
19706 * src/getargs.c: New file.
19707
197081993-06-16 Richard Stallman <rms@gnu.org>
19709
19710 * src/bison.s1: *** empty log message ***
19711
197121993-06-16 Richard Stallman <rms@gnu.org>
19713
19714 * bison.simple: *** empty log message ***
19715
197161993-06-03 Richard Stallman <rms@gnu.org>
19717
19718 * src/bison.s1: New file.
19719
197201993-06-03 Richard Stallman <rms@gnu.org>
19721
19722 * doc/bison.texinfo: *** empty log message ***
19723
197241993-06-03 Richard Stallman <rms@gnu.org>
19725
19726 * bison.simple: New file.
19727
197281993-05-19 Richard Stallman <rms@gnu.org>
19729
19730 * doc/bison.texinfo: New file.
19731
197321993-05-07 Noah Friedman <friedman@gnu.org>
19733
19734 * Makefile.in: *** empty log message ***
19735
197361993-04-28 Noah Friedman <friedman@gnu.org>
19737
19738 * src/reader.c: *** empty log message ***
19739
197401993-04-23 Noah Friedman <friedman@gnu.org>
19741
19742 * src/alloc.h: entered into RCS
19743
197441993-04-20 David J. MacKenzie <djm@gnu.org>
19745
19746 * src/version.c: *** empty log message ***
19747
19748 * src/files.c, src/allocate.c:
19749 entered into RCS
19750
19751 * src/reader.c: *** empty log message ***
19752
19753 * src/lex.c: entered into RCS
19754
19755 * src/conflicts.c: New file.
19756
19757 * src/symtab.c: entered into RCS
19758
19759 * src/alloc.h: New file.
19760
19761 * src/LR0.c: entered into RCS
19762
197631993-04-18 Noah Friedman <friedman@gnu.org>
19764
19765 * src/reader.c: New file.
19766
19767 * src/version.c: *** empty log message ***
19768
197691993-04-18 Noah Friedman <friedman@gnu.org>
19770
19771 * Makefile.in: *** empty log message ***
19772
197731993-04-17 Noah Friedman <friedman@gnu.org>
19774
19775 * Makefile.in: *** empty log message ***
19776
197771993-04-15 Richard Stallman <rms@gnu.org>
19778
19779 * src/main.c, src/files.c:
19780 New file.
19781
197821993-04-15 Noah Friedman <friedman@gnu.org>
19783
19784 * configure.in: entered into RCS
19785
19786 * configure.in: *** empty log message ***
19787
19788 * configure.in: New file.
19789
197901993-04-14 Richard Stallman <rms@gnu.org>
19791
19792 * Makefile.in: New file.
19793
197941993-04-13 Richard Stallman <rms@gnu.org>
19795
19796 * src/version.c: New file.
19797
197981993-03-25 Richard Stallman <rms@gnu.org>
19799
19800 * src/output.c: entered into RCS
19801
198021992-09-25 Richard Stallman <rms@gnu.org>
19803
19804 * configure.bat: entered into RCS
19805
198061992-06-22 Richard Stallman <rms@gnu.org>
19807
19808 * src/vmsgetargs.c: entered into RCS
19809
198101992-06-22 Richard Stallman <rms@gnu.org>
19811
19812 * doc/bison.rnh: entered into RCS
19813
198141992-04-20 David J. MacKenzie <djm@gnu.org>
19815
19816 * README: entered into RCS
19817
198181992-01-22 Richard Stallman <rms@gnu.org>
19819
19820 * src/machine.h: entered into RCS
19821
198221991-12-21 Richard Stallman <rms@gnu.org>
19823
19824 * src/lalr.c, src/closure.c:
19825 entered into RCS
19826
198271991-12-20 Richard Stallman <rms@gnu.org>
19828
19829 * src/state.h: entered into RCS
19830
198311991-12-18 Richard Stallman <rms@gnu.org>
19832
19833 * src/print.c, src/nullable.c, src/derives.c:
19834 entered into RCS
19835
198361991-11-03 David J. MacKenzie <djm@gnu.org>
19837
19838 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
19839 entered into RCS
19840
198411988-09-09 Richard Stallman <rms@gnu.org>
19842
19843 * src/bison.hairy: entered into RCS
19844
198451987-12-16 Richard Stallman <rms@gnu.org>
19846
19847 * REFERENCES: entered into RCS
dc546b0f 19848
f294a2c2 19849
04098407 19850 -----
f294a2c2 19851
04098407 19852 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
95021767
JD
19853 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
19854 Free Software Foundation, Inc.
f294a2c2 19855
04098407
PE
19856 Copying and distribution of this file, with or without
19857 modification, are permitted provided the copyright notice and this
19858 notice are preserved.
e9071366
AD
19859
19860$Id$