]> git.saurik.com Git - bison.git/blob - ChangeLog
b99b41f0c1376278e1f3bb5bdcb2f6c00f78e5f2
[bison.git] / ChangeLog
1 2007-11-26 Akim Demaille <akim@epita.fr>
2
3 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
4
5 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
6
7 In the XML output, list useless and unused symbols and rules with the
8 useful ones and add a "usefulness" attribute. Discussed starting at
9 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
10 * src/gram.c (grammar_rules_partial_print_xml): Remove.
11 (grammar_rules_print_xml): Print all rules instead of just those
12 useful in the grammar, and add a "usefulness" attribute.
13 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
14 * src/print-xml.c (print_rules_useless_in_parser): Remove.
15 (print_grammar): Print all nonterminals instead of just useful ones,
16 and add a "usefulness" attribute to nonterminals and terminals.
17 (print_xml): Don't print a separate "reductions" or
18 "rules-useless-in-parser" element.
19 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
20 (reduce_xml): Remove.
21 (reduce_token_unused_in_grammar): New.
22 (reduce_nonterminal_useless_in_grammar): New.
23 * src/reduce.h (reduce_xml): Remove prototype.
24 (reduce_token_unused_in_grammar): Add prototype.
25 (reduce_nonterminal_useless_in_grammar): Add prototype.
26 * data/xslt/xml2text.xsl: Update for XML changes.
27 * data/xslt/xml2xhtml.xsl: Update for XML changes.
28 * tests/reduce.at (Useless Terminals): Update output.
29 (Useless Rules): Update output.
30 (Reduced Automaton): Update output.
31
32 Say "Terminals unused in grammar" instead of "Unused terminals".
33 * NEWS (2.3a+): Update.
34 * doc/bison.texinfo (Understanding): Update example output.
35 * src/reduce.c (reduce_output): Implement.
36 * data/xslt/xml2text.xsl: Implement.
37 * data/xslt/xml2xhtml.xsl: Implement.
38
39 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
40
41 Accept --report-file=FILE to override the default `.output' filename.
42 * NEWS (2.3a+): Mention.
43 * doc/bison.texinfo (Bison Options): Add an entry.
44 * src/files.c (compute_output_file_names): Don't override
45 spec_verbose_file if already set.
46 * src/getargs.c (usage): Document --report-file.
47 (REPORT_FILE_OPTION): New anonymous enum member.
48 (long_options): Add entry for it.
49 (getargs): Add case for it setting spec_verbose_file.
50
51 * build-aux/cross-options.pl: Don't record a short option just because
52 there's an arg.
53 * doc/.cvsignore: Add yacc.1.
54
55 2007-11-14 Akim Demaille <akim@epita.fr>
56
57 * doc/yacc.1.in: New.
58 * configure.ac, doc/Makefile.am: Adjust.
59 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
60 config.h symbol.
61 Use AC_SUBST for assignments too.
62 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
63
64 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
65
66 * src/gram.c: Remove comments that duplicate comments in gram.h.
67
68 When reporting useless rules and nonterminals, say "useless in grammar"
69 instead of "useless", and say "useless in parser" instead of "never
70 reduced". Discussed starting at
71 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
72 * NEWS (2.3a+): Mention this change.
73 * data/xslt/xml2text.xsl: Update output text and expected input XML
74 element names to match changes below.
75 * data/xslt/xml2xhtml.xsl: Likewise.
76 (xsl:template match="bison-xml-report"): Add missing entry in Table of
77 Contents: "Rules useless in parser due to conflicts".
78 * doc/bison.texinfo (Decl Summary): Reword a little.
79 (Understanding): Update example output for changes below.
80 * src/gram.c: (rule_useful_p): Rename to...
81 (rule_useful_in_grammar_p): ... this.
82 (rule_useless_p): Rename to...
83 (rule_useless_in_grammar_p): ... this.
84 (rule_never_reduced_p): Rename to...
85 (rule_useless_in_parser_p): ... this.
86 (grammar_rules_print): Update for renames.
87 (grammar_rules_print_xml): Update for renames.
88 (grammar_rules_never_reduced_report): Rename to...
89 (grammar_rules_useless_report): ... this since it is used for either
90 kind of useless rule.
91 * src/gram.h: Reword comments and update function names in prototypes.
92 * src/main.c (main): Say "rule useless in parser due to conflicts".
93 * src/print-xml.c (print_rules_never_reduced): Rename to...
94 (print_rules_useless_in_parser): ... this, and rename output XML
95 element "rules-never-reduced" to "rules-useless-in-parser".
96 (print_xml): Update for rename.
97 * src/print.c (print_results): Say "Rules useless in parser due to
98 conflicts".
99 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
100 (nonterminals_reduce): Say "nonterminal useless in grammar".
101 (reduce_output): Say "Nonterminals useless in grammar".
102 Say "Rules useless in grammar".
103 (reduce_xml): Rename output XML element "useless" to
104 "useless-in-grammar".
105 (reduce_print): Don't report the count of grammatically useless rules
106 as "rules never reduced" just because %yacc is specified.
107 In the correct report of this count, say nonterminal(s) and rule(s)
108 "useless in grammar".
109 * tests/conflicts.at (S/R in initial): Update expected output.
110 (Defaulted Conflicted Reduction): Likewise.
111 (Unreachable States After Conflict Resolution): Likewise.
112 * tests/existing.at (GNU pic Grammar): Likewise.
113 * tests/reduce.at (Useless Nonterminals): Likewise.
114 (Useless Rules): Likewise.
115 (Reduced Automaton): Likewise.
116 (Underivable Rules): Likewise.
117 (Empty Language): Likewise.
118
119 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
120
121 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
122 here document and before the EOF so that BSD's implementation of Bourne
123 shell doesn't parse the delimiter as part of the here document.
124 * doc/.cvsignore: Add cross-options.texi.
125 * src/getargs.c (usage): Add a blank line after the warning categories.
126
127 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
128
129 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
130
131 2007-11-05 Akim Demaille <akim@epita.fr>
132
133 Remove Id: from bison.1.
134 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
135 (perl -0777 -pi -e 's/\.PP\nId): New.
136 (.x.1): Use it to ignore the version control revision.
137
138 2007-11-05 Akim Demaille <demaille@gostai.com>
139
140 * build-aux/Makefile.am: Ship cross-options.pl.
141 * doc/Makefile.am: Always refer to cross-options.texi with
142 $(srcdir).
143 (MAINTAINERCLEANFILES): Add it.
144
145 2007-11-04 Akim Demaille <demaille@gostai.com>
146
147 Generate the long/short option cross-table.
148 * build-aux/cross-options.pl: New.
149 * doc/Makefile.am (cross-options.texi): New.
150 * doc/bison.texinfo: Use it.
151
152 2007-11-04 Akim Demaille <demaille@gostai.com>
153
154 Generate bison.1 using help2man.
155 * doc/common.x, doc/bison.x: New.
156 * doc/Makefile.am (bison.1, .x.1): New.
157 The code is taken from autoconf-2.61/man/Makefile.am.
158 * configure.ac: Look for help2man.
159
160 2007-11-04 Akim Demaille <demaille@gostai.com>
161
162 Complete --help.
163 * src/getargs.c (usage): Document -W, make it clear that -d,
164 -g and -x have optional arguments.
165
166 2007-11-04 Akim Demaille <demaille@gostai.com>
167
168 Find sha1sum when named gsha1sum.
169 * bootstrap (find_tool): New.
170 ($SHA1SUM): New.
171
172 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
173
174 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
175 at
176 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
177 * NEWS (2.3a+): Mention.
178 * data/bison.m4 (b4_pure_if): Don't define it here.
179 * data/c.m4 (b4_identification): Depend on individual skeletons to
180 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
181 values of the %define variables api.pure or api.push_pull. Define
182 YYPURE, YYPUSH, and YYPULL accordingly.
183 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
184 glr.cc has already defined b4_pure_flag.
185 * data/push.c: Define b4_pure_if based on `%define api.pure'.
186 Remove YYPUSH and YYPULL since they're back in b4_identification again.
187 * data/yacc.c Define b4_pure_if based on `%define api.pure'.
188 * doc/bison.texinfo (Pure Decl): Update.
189 (Push Decl): Update.
190 (Decl Summary): Add api.pure to %define entry.
191 In %pure-parser entry, say it's deprecated and reference %define.
192 (Pure Calling): Update.
193 (Error Reporting): Update.
194 (C++ Scanner Interface): Update.
195 (How Can I Reset the Parser): Update.
196 (Table of Symbols): In %pure-parser entry, say it's deprecated and
197 reference %define.
198 * src/getargs.c (pure_parser): Remove global variable.
199 * src/getargs.h (pure_parser): Remove extern.
200 * src/output.c (prepare): Don't define pure_flag muscle.
201 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
202 wrapper around `%define api.pure'.
203 * tests/calc.at (Simple LALR Calculator): Update.
204 (Simple GLR Calculator): Update.
205 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
206 Update.
207 (GLR: Resolve ambiguity, pure, locations): Update.
208 (GLR: Merge conflicting parses, pure, no locations): Update.
209 (GLR: Merge conflicting parses, pure, locations): Update.
210 * tests/glr-regression.at (Uninitialized location when reporting
211 ambiguity): Update
212 * tests/input.at (Unused %define api.pure): New test case.
213 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
214 AT_PURE_IF and AT_PURE_AND_LOC_IF.
215 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
216
217 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
218
219 %define push_pull -> %define api.push_pull. Discussed starting at
220 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
221 * data/push.c: Expect the new name.
222 * data/yacc.c: Likewise.
223 * doc/bison.texinfo (Push Decl): Update.
224 (Decl Summary): Update %define entry.
225 (Push Parser Function): Update.
226 (Pull Parser Function): Update.
227 (Parser Create Function): Update.
228 (Parser Delete Function): Update.
229 * tests/calc.at (Simple LALR Calculator): Update.
230 * tests/input.at (%define enum variables): Update.
231 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
232 (Push Parsing: Multiple impure instances): Update.
233 (Push Parsing: Unsupported Skeletons): Update.
234 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
235 (Exploding the Stack Size with Malloc): Update.
236
237 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
238 other entries some.
239
240 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
241
242 For the XML output's terminal element, rename @number to @token-number,
243 and add @symbol-number. In the nonterminal element, rename @number to
244 @symbol-number. Discussed starting at
245 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
246 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
247 renames.
248 (xsl:template match="nonterminal"): Likewise.
249 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
250 (xsl:template match="nonterminal"): Likewise.
251 * src/print-xml.c (print_grammar): Implement.
252
253 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
254
255 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
256 2007-10-11 change, the child elements here are items not rules.
257 (<xsl:template match="item"): New.
258 (xsl:template match="rule"): Update for new reduced itemset.
259 (xsl:template match="point"): Remove.
260 (xsl:template match="empty"): For consistency with --graph, don't
261 output "/* empty */".
262 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
263 line-wrap, don't pass a negative value as first-line-length since this
264 won't work with the following changes.
265 (xsl:template name="line-wrap"): Simplify slightly.
266 (xsl:template name="ws-search"): Eliminate recursion.
267 * src/print_graph.c (print_core): Don't print a reduction's lookahead
268 set next to an item whose dot is not at the end of the RHS even if it
269 happens to be associated with the same rule.
270
271 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
272
273 Add %define lr.keep_unreachable_states.
274 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
275 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
276 * src/main.c (main): Implement it.
277 * tests/conflicts.at (Unreachable States After Conflict Resolution):
278 Extend to test it, and fix a typo.
279
280 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
281
282 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
283 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
284 the example .output text.
285 * tests/regression.at (Extra lookahead sets in report): Improve wording
286 of comments.
287
288 2007-10-17 Wojciech Polak <polak@gnu.org>
289
290 * src/print-xml.c (print_grammar): Renamed
291 <terminal> and <nonterminal> attributes:
292 "type" to "number" and "symbol" to "name".
293 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
294 Use new attribute names.
295 (xsl:template match="nonterminal"): Likewise.
296 * data/xslt/xml2xhtml.xsl: Likewise.
297
298 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
299
300 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
301 (Option Cross Key): Likewise.
302
303 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
304 next to an item whose dot is not at the end of the RHS even if it
305 happens to be associated with the same rule.
306 * src/print.c (print_core): Likewise.
307 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
308 (Resolved SR Conflicts): Update output.
309 * tests/regression.at (Extra lookahead sets in report): New test case.
310
311 2007-10-11 Wojciech Polak <polak@gnu.org>
312
313 * src/print-xml.c (print_core): Remove item set
314 redundancy.
315 * data/xslt/bison.xsl (bison:ruleNumber): New key.
316 Improve processing time. Suggested by Joel E. Denny.
317 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
318 Write xsl:param "required" attribute as comment.
319 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
320 (xsl:template match="rule"): Support new reduced itemset.
321 (xsl:template match="point"): Remove.
322 * data/xslt/xml2xhtml.xsl: Likewise.
323
324 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
325
326 * src/getargs.c (version): Update copyright year.
327
328 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
329
330 Make xml2dot.xsl and --graph produce the same output.
331 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
332 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
333 escaped later.
334 (xsl:template name="output-node"): Use the new escape template instead
335 of the string-replace template directly.
336 (xsl:template name="output-edge"): Likewise.
337 (xsl:template name="escape"): New, escapes backslashes and newlines in
338 addition to quotation marks.
339 * src/graphviz.c (start_graph, output_node, output_edge): Add
340 whitespace to output for legibility.
341
342 Make xml2text.xsl and --report produce the same output, and remove the
343 XML "conflicts" element since a conflict summary is easily extracted
344 from the automaton.
345 * data/xslt/bison.xsl: New.
346 (xsl:template match="state" mode="bison:count-conflicts): New.
347 * data/xslt/xml2text.xsl: Import bison.xsl.
348 (xsl:template match="bison-xml-report"): Instead of styling the
349 "conflicts" element, style the "automaton" element with mode
350 "conflicts". Unlike the former, the latter lists S/R and R/R
351 conflicts for a state on the same line.
352 (xsl:template match="conflicts"): Remove.
353 (xsl:template match="conflict"): Remove.
354 (xsl:template match="terminal"): Line-wrap the list of rules in which
355 the terminal is used.
356 (xsl:template match="nonterminal"): Likewise for nonterminals.
357 (xsl:template match="automaton" mode="conflicts"): New.
358 (xsl:template match="state" mode="conflicts"): New.
359 (xsl:template name="line-wrap"): New.
360 (xsl:template name="ws-search"): New.
361 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
362 (xsl:template match="bison-xml-report"): Instead of styling the
363 "conflicts" element, style the "automaton" element with mode
364 "conflicts."
365 (xsl:template match="conflicts"): Remove.
366 (xsl:template match="conflict"): Remove.
367 (xsl:template match="automaton" mode="conflicts"): New.
368 (xsl:template match="state" mode="conflicts): New.
369 * src/conflicts.c (conflicts_output_xml): Remove.
370 * src/conflicts.h (conflicts_output_xml): Remove prototype.
371 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
372 * src/print.c (print_grammar): Consistently wrap at the 66th column so
373 the corresponding XSLT is easier. Also, never wrap between a word and
374 the comma that follows it.
375
376 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
377
378 Improve C++ namespace support. Discussed starting at
379 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
380 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
381 b4_namespace_close): New macros that interpret the %define variable
382 "namespace" so its value can contain "::" to indicate nested
383 namespaces.
384 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
385 the above macros.
386 * data/lalr1.cc (b4_namespace): Likewise.
387 * data/location.cc (b4_namespace): Likewise.
388 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
389 inside a new table in the general %define entry. Document `%define
390 namespace' there as well. Point the %name-prefix entry to it since it
391 explains it more completely in the case of C++.
392 (C++ Bison Interface): Mention `%define namespace' instead of
393 %name-prefix.
394 (Table of Symbols): Remove the `%define push_pull' entry. The %define
395 entry suffices.
396 * tests/c++.at (Relative namespace references): New test case.
397 (Absolute namespace references): New test case.
398 (Syntactically invalid namespace references): New test case.
399 * tests/input.at (C++ namespace reference errors): New test case.
400
401 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
402
403 Add syncline support and location accessor to internal %define
404 interfaces.
405 * data/bison.m4 (b4_percent_define_get_loc): New.
406 (b4_percent_define_get_syncline): New.
407 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
408 (b4_percent_define_default): Record defining location as line 1 rather
409 than 0 for the sake of synchronizing #line's, and define
410 b4_percent_define_syncline(VARIABLE).
411 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
412 * src/muscle_tab.c (muscle_syncline_grow): New.
413 (muscle_code_grow): Use muscle_syncline_grow.
414 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
415 define b4_percent_define_syncline(VARIABLE).
416 (muscle_percent_define_get_loc): New.
417 (muscle_percent_define_get_syncline): New.
418 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
419 remove some unused variables.
420 (muscle_percent_define_default): Record defining location as line 1
421 rather than 0 for the sake of synchronizing #line's, and define
422 b4_percent_define_syncline(VARIABLE).
423 (muscle_percent_define_check_values): Use
424 muscle_percent_define_get_loc.
425 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
426 (muscle_percent_define_get_syncline): Prototype.
427 * tests/skeletons.at (%define Boolean variables: invalid skeleton
428 defaults): Update output for location change.
429 (Complaining during macro argument expansion): Extend to test
430 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
431
432 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
433
434 Fix some error-reporting macro bugs.
435 * data/bison.m4 (b4_cat): New.
436 (b4_error, b4_error_at): Use b4_cat to send error directives directly
437 to stdout so they don't become arguments to other macros. Update
438 comments and add examples.
439 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
440 add examples.
441 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
442 after printing the error directive so that M4 doesn't report subsequent
443 problems that are induced by this problem.
444 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
445 instead of just in them. Recognize @\n in both places. Both expand to
446 the empty string. Needed by b4_cat.
447 * tests/skeletons.at (Complaining during macro argument expansion):
448 New test case.
449 (Fatal errors make M4 exit immediately): New test case.
450
451 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
452
453 Implement --print-datadir.
454 * src/getargs.c (usage): Mention.
455 (PRINT_DATADIR_OPTION): New anonymous enum member.
456 (long_options): Add entry for it.
457 (getargs): Add case for it calling compute_pkgdatadir.
458 * src/output.c (output_skeleton): Encapsulate data directory
459 computation from here...
460 (prepare): ... and from here...
461 (compute_pkgdatadir): ... into this new function.
462 * src/output.h (compute_pkgdatadir): Prototype.
463
464 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
465
466 * src/print-xml.c (escape_bufs): New static global variable
467 replacing...
468 (xml_escape_n): ... the static local variable buf here.
469 (print_xml): Free memory for escape_bufs.
470 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
471
472 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
473
474 Replace `%push-parser' and `%push-pull-parser' with
475 `%define push_pull "push"' and `%define push_pull "both"'.
476 `%define push_pull "pull"' is the default.
477 * doc/bison.texinfo (Push Decl, Push Parser Function,
478 Pull Parser Function, Parser Create Function, Parser Delete Function):
479 Update declarations.
480 (Decl Summary, Table of Symbols): Replace %push-parser and
481 %push-pull-parser entries with a %define push_pull entry.
482 * data/bison.m4 (b4_percent_define_check_values): New macro.
483 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
484 definitions...
485 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
486 definitions...
487 * data/push.c: ... to here and compute them from the value of the
488 %define variable push_pull.
489 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
490 parsing requests here...
491 * data/yacc.c: ... hack this to switch to push.c any time
492 b4_use_push_pull_flag or the %define variable push_pull is set. This
493 will go away when we mv push.c yacc.c.
494 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
495 push parsing is not supported since unused %define variables are
496 reported anyway.
497 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
498 * src/muscle_tab.h (muscle_percent_define_check_values): Update
499 comments for consistency with b4_percent_define_check_values.
500 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
501 muscles.
502 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
503 Remove.
504 (prologue_declaration): Remove %push-parser and %push-pull-parser
505 rules.
506 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
507 * tests/calc.at: Update declarations.
508 * tests/input.at (%define enum variables): New test case.
509 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
510 declaration.
511 (Push Parsing: Multiple impure instances): Update declaration.
512 (Push Parsing: Unsupported Skeletons): New test case.
513 * tests/torture.at (Exploding the Stack Size with Alloca): Update
514 declaration.
515 (Exploding the Stack Size with Malloc): Update declaration.
516
517 2007-09-24 Wojciech Polak <polak@gnu.org>
518
519 Add XSLT transformations.
520
521 * data/xslt/xml2dot.xsl: Transform XML into DOT.
522 * data/xslt/xml2text.xsl: Transform XML into plain text.
523 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
524 * data/Makefile.am (xsltdir): New variable.
525 (dist_xslt_DATA): Add xslt/*.xsl files.
526
527 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
528
529 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
530 Problem reported by Wojciech Polak.
531 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
532 (xml_printf): Undo change I made on 21 September; that is,
533 indent 2 spaces, not 1.
534
535 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
536
537 Pacify ./configure --enable-gcc-warnings.
538 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
539 `char const *' instead of `char *'.
540 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
541 local variable `sep'.
542
543 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
544
545 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
546 elsewhere.
547 * src/print-xml.c: Prefer "const" after types; that's more consistent.
548 (xml_printf): Indent just 1 space for level.
549 (e_char, xlate_char): Remove.
550 (xml_escape_string): Rewrite to avoid undefined behavior (used
551 storage that was freed from the stack).
552 (xml_escape_n): Don't bother checking for subscript error.
553
554 2007-09-21 Wojciech Polak <polak@gnu.org>
555
556 Add Bison XML Automaton Report.
557
558 Add support for an -x option to generate an XML report.
559 It is not documented yet.
560 * src/print-xml.c: New file.
561 * src/print-xml.h: Likewise.
562 * lib/timevar.def (TV_XML): New var.
563 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
564 * src/conflicts.c: Include print-xml.h.
565 (solved_conflicts_xml_obstack): New var.
566 (log_resolution, conflicts_solve, conflicts_free):
567 Add support for XML report.
568 (conflicts_output_val): New function.
569 * src/conflicts.h (conflicts_output_val): New decl.
570 * src/files.c (spec_xml_file): New var.
571 (compute_output_file_names, output_file_names_free): Add XML support.
572 * src/files.h (spec_xml_file): New decl.
573 * src/getargs.c (xml_flag): New var.
574 (usage, short_options, long_options, getargs): Add XML support.
575 * src/getargs.h (xml_flag): New decl.
576 * src/gram.c: Include print-xml.h.
577 (rule_lhs_print_xml, rule_rhs_print_xml):
578 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
579 New functions.
580 * src/gram.h: Declare external ones.
581 * src/main.c: Include print-xml.h.
582 (main): Add XML support.
583 * src/reduce.c: Include print-xml.h.
584 (reduce_xml): New function.
585 * src/reduce.h: Declare it.
586 * src/state.c: Include print-xml.h.
587 (state_new): Add XML support.
588 (state_rule_lookahead_tokens_print_xml): New function.
589 * src/state.h: Declare it.
590 (struct state): New member solved_conflicts_xml.
591 * src/symtab.c (symbol_class_get_string): New function.
592 * src/symtab.h: Declare it.
593
594 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
595
596 * GNUmakefile: Switch to coreutils's version.
597 * bootstrap: Likewise.
598 * Makefile.cfg: Adjust to new GNUmakefile.
599 * README-hacking: Likewise.
600
601 Import from gnulib:
602
603 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
604 Bruno Haible <bruno@clisp.org>
605
606 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
607 and is a script that invokes bison. Tighten the code. Add comments.
608
609 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
610
611 Spell "boolean" as "Boolean". Reported by Akim Demaille.
612 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
613 * doc/bison.texinfo (Decl Summary): Fix.
614 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
615 * tests/input.at (Boolean %define variables): Update output.
616 * tests/skeletons.at (%define boolean variables: invalid skeleton
617 defaults): Rename to...
618 (%define Boolean variables: invalid skeleton defaults): ... this and
619 update output.
620
621 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
622
623 In impure push mode, don't allow more than one yypstate to be allocated
624 since multiple impure parsers would corrupt yynerrs.
625 * data/push.c (yypstate_allocated): New static global variable
626 initialized to 0.
627 (yypull_parse): If yypstate_new returns 0, don't report it as memory
628 exhaustion if yypstate_allocated is 1, but still return 2.
629 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
630 already 1. Otherwise, set it to 1.
631 (yypstate_delete): Set it to 0.
632 * tests/push.at (Push Parsing: Multiple impure instances): New test
633 case.
634
635 2007-08-17 Bob Rossi <bob@brasko.net>
636
637 * doc/bison.texinfo (Push Decl): Document the push parser.
638 (Table of Symbols): Ditto.
639 (Pure Decl): Ditto.
640 (Decl Summary): Ditto.
641 (Multiple Parsers, Push Parser Function, Pull Parser Function,
642 Parser Create Function, Parser Delete Function):
643 Add new push parser symbols.
644 (Table of Symbols): Document push-parser, push-pull-parser,
645 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
646
647 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
648
649 Update to GPLv3.
650 * doc/gpl-3.0.texi: New file.
651 * doc/gpl.texi: Remove.
652 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
653 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
654 * README-hacking, TODO, bootstrap, bootstrap.conf:
655 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
656 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
657 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
658 * data/lalr1.cc, data/lalr1.java, data/location.cc:
659 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
660 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
661 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
662 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
663 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
664 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
665 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
666 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
667 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
668 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
669 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
670 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
671 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
672 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
673 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
674 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
675 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
676 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
677 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
678 * src/complain.c, src/complain.h, src/conflicts.c:
679 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
680 * src/files.h, src/flex-scanner.h, src/getargs.c:
681 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
682 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
683 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
684 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
685 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
686 * src/print.c, src/print.h, src/print_graph.c:
687 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
688 * src/reduce.h, src/relation.c, src/relation.h:
689 * src/revision.h, src/scan-code.h, src/scan-code.l:
690 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
691 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
692 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
693 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
694 * tests/Makefile.am, tests/actions.at, tests/c++.at:
695 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
696 * tests/existing.at, tests/glr-regression.at:
697 * tests/headers.at, tests/input.at, tests/java.at:
698 * tests/local.at, tests/output.at, tests/push.at:
699 * tests/reduce.at, tests/regression.at, tests/sets.at:
700 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
701 * tests/torture.at:
702 Update to GPLv3.
703
704 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
705
706 Get rid of broken %no-parser, -n, and --no-parser implementation and
707 documentation.
708 * TODO: Don't mention them.
709 * doc/bison.1: Likewise.
710 * doc/bison.texinfo (Decl Summary): Likewise.
711 (Bison Options): Likewise.
712 (Option Cross Key): Likewise.
713 * src/getargs.c (no_parser_flag): Remove global variable.
714 (usage): Don't print description of -n and --no-parser.
715 (long_options): Remove --no-parser entry here.
716 (getargs): Remove -n case in the switch here.
717 * src/getargs.h (no_parser_flag): Remove extern.
718 * tests/regression.at (Web2c Actions): Remove comment that mentions
719 --no-parser.
720
721 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
722
723 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
724 name user variables starting with `yy'. Just pass NULL instead of a
725 dummy local &yylval to yypush_parse.
726 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
727 starting with `yy'.
728
729 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
730
731 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
732 true since it's then always used regardless of whether yyoverflow is
733 defined. Reported by Christian Burger at
734 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
735 * THANKS: Add Christian Burger.
736
737 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
738 node names: say "Decl Summary" not "Bison Declaration Summary".
739
740 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
741
742 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
743 determine whether this function has already complained about an invalid
744 value for a %define boolean variable, don't check whether Bison has
745 ever examined the value. As written, the check was a tautology.
746 Instead, record and check for this complaint using a separate muscle.
747
748 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
749
750 Fix push parsing memory leak reported by Brandon Lucia at
751 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
752 * THANKS: Add Brandon Lucia.
753 * data/push.c (yypstate_delete): Free the stack if it was reallocated
754 but the parse never completed and thus freed it.
755 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
756 * tests/testsuite.at: Include push.at.
757 * test/push.at: New.
758 (Push Parsing: Memory Leak for Early Deletion): New test case.
759
760 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
761
762 Improve handling of multiple S/R conflicts in the same state and of S/R
763 conflicts involving multiple reductions.
764 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
765 set for a state here or Bison will abort if it is reassigned on a
766 later conflicted reduction in the same state.
767 Similarly, don't finalize and assign the solved conflicts report here
768 or it will be lost if it is reassigned on a later conflicted reduction
769 in the same state.
770 (set_conflicts): Instead, assign them both here after all S/R conflicts
771 in the state have been fully examined.
772 * src/print.c (shift_set): Rename to...
773 (no_reduce_set): ... this.
774 (print_reductions): Update for rename, and add %nonassoc error action
775 tokens to no_reduce_set so that, when printing the first remaining
776 reduction on an error action token, the reduction is enclosed in
777 brackets.
778 (print_results): Update for rename.
779 * tests/conflicts.at (Solved conflicts report for multiple reductions
780 in a state): New test case.
781 (%nonassoc error actions for multiple reductions in a state): New test
782 case.
783
784 * src/main.c (main): Don't depend on C99 features.
785
786 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
787
788 * build-aux/.cvsignore: Add compile.
789 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
790 uniwidth.
791
792 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
793
794 * bootstrap (slurp): Create target directories that don't exist.
795 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
796
797 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
798
799 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
800 than item number.
801 * closure.c (closure): Likewise.
802 * state.h (reductions): Comment sorting of rules.
803 (state): Comment sorting of items.
804
805 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
806
807 Fix C++ test cases after recent Gnulib changes. Discussed starting at
808 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
809 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
810 definition in order to avoid Gnulib headers since we don't use config.h
811 here.
812 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
813 rather than AT_DATA so that config.h is included.
814
815 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
816
817 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
818 instead of fprintf. Guard these functions with #if YYDEBUG instead of
819 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
820 and so that YYFPRINTF is guaranteed to be defined here.
821
822 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
823
824 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
825 with...
826 (muscle_percent_define_check_values): ... this more helpful function.
827 Again, it's not used yet, but it will be.
828 * src/muscle_tab.h: Likewise.
829
830 Improve some comments in parser table construction.
831 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
832 (generate_states): Don't mention ruleset, which is internal to closure.
833 * src/closure.c (closure): Explain sorting of core and itemset, which
834 is required for this function to behave correctly.
835 * src/closure.h (closure): Mention sorting.
836
837 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
838
839 * src/lalr.c (state_lookahead_tokens_count): For code readability,
840 move the check for disabled transitions to an aver since conflict
841 resolution hasn't happened yet.
842
843 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
844 labels a state as inconsistent just because it has error transitions.
845 The original form of this check appeared in revision 1.1 of lalr.c,
846 which was committed on 1991-12-21. Now (at least), changing the
847 consistency label on such a state appears to have no useful effect in
848 any of the places it is examined, which I enumerate below. The key
849 point to understanding each item in this enumeration is that a state
850 with an error transition is labelled consistent in the first place only
851 if it has no rules, so the check cannot matter for states that have
852 rules. (1) Labelling a state as inconsistent will cause set_conflicts
853 to try to identify its conflicts, and a state must have *rules* to have
854 conflicts. (2) Labelling a state as inconsistent will affect how
855 action_row sets the default *rule* for the state. (3) Labelling a
856 state as inconsistent will cause build_relations to add lookback edges
857 to *rules* in that state.
858 * src/state.h (struct state): Word the comment for member consistent
859 more carefully.
860
861 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
862
863 Don't depend on C99 features.
864 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
865 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
866 * src/reader.c (check_and_convert_grammar): Fix for-loop.
867 * src/state.c (state_mark_reachable_states): Fix for-loop.
868 (state_remove_unreachable_states): Fix for-loop.
869
870 Don't widen struct state with member reachable just to temporarily
871 record reachability. Instead, use a local bitset.
872 * src/state.h (struct state): Remove member.
873 * src/state.c (state_new): Don't initialize it.
874 (state_mark_reachable_states): Rename to...
875 (state_record_reachable_states): ... this, and use bitset.
876 (state_remove_unreachable_states): Use bitset.
877
878 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
879
880 * src/Makefile.am (yacc): Quote target action commands properly so
881 that the yacc script isn't corrupt. Reported by Hans Aberg at
882 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
883
884 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
885 the case of pure parsers. Reported by Frans Englich at
886 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
887 * THANKS: Add Frans Englich.
888
889 * NEWS (2.3a+): In the %code entry, reference section `Bison
890 Declaration Summary' from the manual now since the %code summary has
891 moved there.
892 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
893 in the rules section must be terminated by semicolons.
894
895 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
896
897 Extend the front-end API for %define variables to more completely
898 mirror the back-end. This will be useful in the future.
899 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
900 Update comments to mention the new front-end counterparts of these
901 macros.
902 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
903 for muscle_string_decode and muscle_location_decode.
904 (muscle_string_decode): New static function.
905 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
906 (muscle_percent_define_get, muscle_percent_define_ifdef): New
907 functions.
908 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
909 muscle_percent_define_get to mimic the b4_percent_define_flag_if
910 implementation more closely.
911 (muscle_percent_define_invalid_value): New function.
912 * src/muscle_tab.h (muscle_percent_define_get,
913 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
914 Prototype.
915
916 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
917
918 * NEWS (2.3a+): Mention yesterday's state-removal change.
919 (2.3a): Remove the %language entry, which was added after 2.3a.
920 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
921 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
922 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
923 tests/existing.at: Update copyright date.
924
925 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
926
927 If conflict resolution makes states unreachable, remove those states,
928 report rules that are then unused, and don't report conflicts in those
929 states.
930 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
931 New global function.
932 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
933 function.
934 * src/main.c (main): After conflict resolution, remove the unreachable
935 states and update all data structures that reference states by number.
936 * src/state.c (state_new): Initialize each state's reachable member to
937 false.
938 (state_mark_reachable_states): New static function.
939 (state_remove_unreachable_states): New global function.
940 * src/state.h (struct state): Add member bool reachable.
941 (state_remove_unreachable_states): Prototype.
942 * tests/conflicts.at (Unreachable States After Conflict Resolution):
943 New test case.
944 * tests/existing.at (GNU pic Grammar): Update test case output now that
945 an unused rule is discovered.
946
947 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
948
949 Minor code cleanup in parser table construction.
950 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
951 (new_itemsets, save_reductions): Update for rename to nitemset.
952 * src/closure.c (nritemset): Rename to...
953 (nitemset): ... this since the "r" appears to meaningless and isn't
954 used in the comments.
955 (closure): Update for rename.
956 * src/closure.h (nritemset): Update extern to...
957 (nitemset): ... this.
958 * src/lalr.c (LA): Fix a typo in comments.
959 * src/print.c (print_core): Update for rename to nitemset.
960 * src/print_graph.c (print_graph): Likewise.
961 * src/state.h: Fix some typos in header comments.
962
963 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
964
965 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
966 still sticks to ASCII. Sorry!
967
968 * README-hacking: New file, taken mostly from coreutils, with changes
969 for Bison. Contains much of the contents of:
970 * README-cvs: Remove.
971 * bootstrap: Sync from gnulib.
972 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
973 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
974
975 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
976
977 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
978 Setzer.
979 (Java Differences): Fix some typos.
980 * THANKS: Add Sebastian Setzer.
981
982 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
983
984 * data/java.m4 (b4_single_class_if): Remove.
985 (b4_abstract_if): Look at "%define abstract".
986 (b4_lexer_if): New.
987 (b4_union_name): Rename...
988 (b4_yystype): ... to this. Map to "%define stype".
989 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
990 b4_maybe_throws): Fix quoting.
991 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
992 * data/lalr1.java (Lexer interface): Always define.
993 (Lexer interface within parser class): Remove.
994 (YYLexer class): New, used when "%code lexer" is present.
995 (constructor): When "%code lexer" is used, pass %lex-param
996 to the lexer constructor.
997 (yylex, yyparse): Remove %lex-param from method invocations
998 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
999
1000 * doc/bison.texinfo (Java Bison Interface): Mention "%define
1001 abstract". Rename "%define union_name" to "%define stype".
1002 Rename method names according to previous patch.
1003 (Java Scanner Interface): Describe "%code lexer" instead of
1004 "%pure-parser" and "%define single_class".
1005 (Java Differences): Mention "%code lexer".
1006
1007 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
1008 Include scanner here, using macros from tests/local.at.
1009 (AT_DATA_CALC_Y): Remove final argument.
1010 (_AT_CHECK_JAVA_CALC): Likewise.
1011 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
1012 of %locations and %error-verbose.
1013 (main): Test with and without %lex-param.
1014 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
1015 (AT_BISON_OPTION_POPDEFS): Pop it.
1016
1017 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1018
1019 DJGPP spefic issue. Inhibit the use of disallowed characters for
1020 file name genertion on Win98, WinXP, etc. These are |<>":?*\
1021 and concern testsuite case 46.
1022 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
1023 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
1024 * djgpp/config.bat: Inhibit the use of disallowed characters.
1025
1026 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
1027
1028 Miscellaneous %define and %code cleanup.
1029 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
1030 values are interpreted.
1031 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
1032 documentation a little more.
1033 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
1034 muscle_percent_define_insert, muscle_percent_code_grow): New
1035 functions/macros.
1036 * src/muscle_tab.h (muscle_percent_define_insert,
1037 muscle_percent_code_grow): Prototype.
1038 * src/parse-gram.y (prologue_declaration): Use
1039 muscle_percent_define_insert and muscle_percent_code_grow when parsing
1040 %define and %code directives.
1041
1042 Make it easy to share %define boolean variables between the front-end
1043 and back-end. Though not used yet, this will be useful in the future.
1044 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
1045 Bison uses of names rather than just skeleton uses of names.
1046 (b4_percent_define_get, b4_percent_define_ifdef): Rename
1047 b4_percent_define_skeleton_variables(VARIABLE) to
1048 b4_percent_define_bison_variables(VARIABLE).
1049 (b4_percent_code_get, b4_percent_code_ifdef): Rename
1050 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
1051 b4_percent_code_bison_qualifiers(QUALIFIER).
1052 (b4_check_user_names_wrap): Update for renames.
1053 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
1054 muscle_percent_define_default): New functions mimicking
1055 b4_percent_define_flag_if and b4_percent_define_default.
1056
1057 For %define variables, report locations for invalid values and
1058 redefinitions.
1059 * data/bison.m4 (b4_percent_define_flag_if): Read
1060 b4_percent_define_loc(VARIABLE) to report the location of an invalid
1061 value for VARIABLE.
1062 (b4_percent_define_default): Save a special location in
1063 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
1064 must later be reported as invalid.
1065 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
1066 functions.
1067 (muscle_percent_define_insert): Record the location of VARIABLE in
1068 muscle percent_define_loc(VARIABLE), and use it to report the previous
1069 location for a redefinition.
1070 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
1071 (muscle_percent_define_default): Update like b4_percent_define_default.
1072 (muscle_grow_user_name_list): Rename to...
1073 (muscle_user_name_list_grow): ... this for consistency and use
1074 muscle_location_grow.
1075 * src/muscle_tab.h (muscle_location_grow): Prototype.
1076 * tests/input.at (%define errors): Update expected output.
1077 * tests/skeletons.at (%define boolean variables: invalid skeleton
1078 defaults): New test case.
1079
1080 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
1081
1082 * src/print.c (lookahead_set, state_default_rule): Remove.
1083 (print_reductions): Replace state_default_rule invocation with
1084 equivalent use of yydefact, which was computed in token_actions in
1085 tables.c.
1086 (print_results): Don't allocate lookahead_set.
1087
1088 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
1089
1090 * data/lalr1.java: Prefix all private members with yy.
1091
1092 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
1093
1094 Use YYFPRINTF instead of fprintf where appropriate. Reported by
1095 Sebastien Fricker at
1096 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
1097 * THANKS: Add Sebastien Fricker.
1098 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
1099 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
1100 accept a variable number of arguments.
1101
1102 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1103
1104 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
1105
1106 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1107
1108 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
1109 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
1110 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
1111
1112 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
1113
1114 Undo my 2007-02-07 change, switching back to the c-strcase module
1115 introduced in the 2007-02-03 change. Bruno Haible reported that
1116 the 2007-02-07 change would be dangerous in Turkish if we add a
1117 language whose name contains "i", since "i" is not lowercase "I"
1118 in Turkish.
1119 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
1120 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
1121 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
1122 * m4/.cvsignore: Remove strcase.m4.
1123 * src/getargs.c: Revert 2007-02-07 change, as follows.
1124 Include c-strcase.h.
1125 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
1126
1127 2007-02-11 Bruno Haible <bruno@clisp.org>
1128
1129 Enable the Java related testsuite tests when the only Java compiler
1130 found is a gcj < 4.3. Discussed at
1131 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
1132 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
1133
1134 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
1135
1136 * data/Makefile.am: Update copyright date.
1137 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
1138 yypstate_new returns NULL.
1139 (yypstate_new): Return NULL if malloc does.
1140 * src/reader.c (packgram): Move translation of rule actions from the
1141 beginning of packgram to...
1142 (check_and_convert_grammar): ... here right before packgram is invoked
1143 so it's easier to write more complete comments, and remove redundant
1144 code.
1145
1146 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
1147
1148 As in semantic actions, make @$ in %initial-action, %destructor, and
1149 %printer imply %locations.
1150 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
1151 scanning @$.
1152 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
1153 (@$ in %initial-action implies %locations,
1154 @$ in %destructor implies %locations,
1155 @$ in %printer implies %locations): ... these new test cases.
1156
1157 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
1158
1159 Undo most of the 2007-02-03 change, switching to the strcase module
1160 now that gnulib strcase has been fixed.
1161 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
1162 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
1163 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
1164 * m4/.cvsignore: Add strcase.m4.
1165 * src/getargs.c: Revert 2007-02-03 change, as follows.
1166 Don't include c-strcase.h.
1167 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
1168 strcasecmp has "unspecified behavior" outside the POSIX locale,
1169 but it works fine in practice if at least one argument is ASCII,
1170 as is the case in Bison.
1171
1172 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
1173
1174 * tests/java.at: Skip tests if only one of javac/java is present.
1175 Reported by Joel E. Denny.
1176 * tests/atlocal.in: Adjust copyright years.
1177
1178 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
1179
1180 * data/lalr1.java (Stack): Work around old verifiers that disallow
1181 access to the private fields of an inner class, from the outer class.
1182 We can make Stack's fields public because user code doesn't have access
1183 to the instance of Stack used by parse(). Reported by Paul Eggert.
1184
1185 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
1186
1187 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
1188 the right spot for these files?
1189 * bootstrap.conf (gnulib_modules): Add c-strcase.
1190 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
1191 c-strncasecmp.c.
1192 * src/getargs.c: Include c-strcase.h.
1193 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
1194 to avoid unspecified behavior.
1195
1196 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
1197
1198 * doc/bison.texinfo (Decl Summary): Correct typo.
1199
1200 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
1201
1202 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
1203 Complain if the value does not match empty, "true" or "false".
1204 * data/c++.m4: Adjust default definitions of %define variables.
1205 * data/java.m4: Adjust default definitions of %define variables.
1206 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
1207 to above behavior.
1208 * tests/input.at (Boolean %define variables): Test new behavior.
1209
1210 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
1211
1212 * NEWS: Mention java.
1213 * TODO: Remove things that are done.
1214 * bootstrap.conf: Add javacomp-script and javaexec-script.
1215 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
1216
1217 * data/Makefile.am: Add new files.
1218 * data/java-skel.m4: New.
1219 * data/java.m4: New.
1220 * data/lalr1.java: New.
1221
1222 * doc/bison.texinfo: Put "A Complete C++ Example" under
1223 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
1224 under Other Languages.
1225
1226 * src/getargs.c (valid_languages): Add Java.
1227 * src/getargs.h (struct bison_language): Update size of string fields.
1228
1229 * tests/Makefile.am: Add java.at.
1230 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
1231 * tests/java.at: New.
1232 * tests/testsuite.at: Include it.
1233
1234 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
1235
1236 Clean up.
1237 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
1238 at_directive_argv arguments so these no longer have to be global
1239 variables. Also, update the implementation for the following changes.
1240 (fail_for_at_directive_too_many_args,
1241 fail_for_at_directive_too_few_args): Add at_directive_name argument.
1242 (at_directive_name): Remove as at_directive_argv[0] will be used for
1243 this now.
1244 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
1245 for the directive name.
1246 (at_directive_argc, at_directive_argv): Make these local within
1247 skel_lex instead of global.
1248 (INITIAL): Update directive start action for above changes.
1249 (SC_AT_DIRECTIVE_ARG): Rename to...
1250 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
1251 (SC_AT_DIRECTIVE_SKIP_WS): Update.
1252 (scan_skel): Move yylex_destroy to...
1253 (skel_scanner_free): ... here.
1254 * tests/skeletons.at (installed skeleton file name): Rename to...
1255 (installed skeleton file names): ... this.
1256
1257 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
1258
1259 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1260 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
1261 Summary" not "Directives".
1262 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
1263 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
1264 since the former is now the more complete one.
1265 (Prologue Alternatives): Likewise and do the same for %defines.
1266 (Table of Symbols): Add summary of %code, add summary of %define, and
1267 move full %code documentation to...
1268 (Decl Summary): ... here for consistency with other entries in these
1269 sections.
1270 Move %define entry in order to keep this list alphabetized.
1271 Reword %define entry a little to put less emphasis on the skeleton
1272 concept, which most users shouldn't have to think about.
1273
1274 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
1275
1276 Adjust to recent gnulib changes.
1277 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
1278 Add string.h, string_.h, unistd_.h, wchar_.h.
1279 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
1280 * src/system.h: Don't include <stpcpy.h>; this is now done by
1281 <string.h>.
1282
1283 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
1284
1285 Simplify implementation of unqualified %code, implement macros for
1286 uniform treatment of boolean %define flags. Document %define.
1287 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
1288 b4_percent_code_ifdef): New.
1289 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
1290 * data/c++.m4: Define default value for global_tokens_and_yystype.
1291 * data/glr.cc: Likewise.
1292 * data/location.cc: Use b4_percent_define_flag_if.
1293
1294 * doc/bison.texinfo (Decl Summary): Document %define.
1295
1296 * src/parse-gram.y (Unqualified %code): Change muscle name to
1297 b4_percent_code().
1298 (content.opt): Default to empty.
1299
1300 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1301
1302 Implement support for relative and absolute skeleton file names.
1303 Discussed starting at
1304 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
1305 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
1306 (Bison Options): Document in --skeleton entry.
1307 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
1308 full_skeleton can't necessarily hold all of pkgdatadir.
1309 If the specified skeleton file name contains a `/', don't prepend
1310 pkgdatadir.
1311 * src/parse-gram.y (prologue_declaration): If the specified skeleton
1312 file name contains a `/', prepend the grammar file directory.
1313 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
1314 * skeletons.at: New file.
1315 (relative skeleton file names): New test case.
1316 (installed skeleton file names): New test case.
1317 * tests/testsuite.at: Include skeletons.at.
1318
1319 * bootstrap: Update copyright to 2007.
1320
1321 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
1322
1323 * bootstrap: Remove occurrences of .#bootmp from the files.
1324
1325 2007-01-17 Akim Demaille <akim@epita.fr>
1326
1327 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
1328 nonterminals.
1329 Use per-type %printer.
1330
1331 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1332
1333 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
1334 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1335 djgpp/config.site, src/files.c, src/files.h, src/main.c,
1336 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
1337 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
1338 tests/glr-regression.at, tests/input.at, tests/local.at,
1339 tests/output.at, tests/torture.at: Update copyright to 2007.
1340
1341 2007-01-16 Akim Demaille <akim@epita.fr>
1342
1343 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
1344 error code.
1345 (Calc++ Scanner): Exit with failure if we can't open the input
1346 file.
1347 Accept "-" standing for stdin.
1348 (Calc++ Top Level): Print the result only if the parsing was
1349 successful.
1350
1351 2007-01-16 Akim Demaille <akim@epita.fr>
1352
1353 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
1354
1355 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
1356 and Joel E. Denny <jdenny@ces.clemson.edu>
1357
1358 Clean up %define and %code implementation in M4 some. Most
1359 importantly, rename all related macros to be in the b4_percent_define
1360 and b4_percent_code namespaces. Also, complete support for `.' in
1361 %define variable names and %code qualifiers.
1362 * data/bison.m4 (b4_check_user_names): Check for special
1363 "SKELETON-NAMESPACE(name)" macros instead of using two nested
1364 m4_foreach loops.
1365 (b4_get_percent_define, b4_get_percent_code): Rename to...
1366 (b4_percent_define_get, b4_percent_code_get): ... these.
1367 Extend documentation with examples.
1368 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
1369 b4_percent_define_skeleton_variables and
1370 b4_percent_code_skeleton_qualifiers.
1371 Expect any value for the %define variable `foo' to be stored in the
1372 macro named `b4_percent_define(foo)'; expect any %code blocks for the
1373 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
1374 expect any unqualified %code blocks to be stored in a macro named
1375 `b4_percent_code_unqualified'.
1376 Use m4_indir so that %define variable names and %code qualifiers can
1377 contain `.', which is allowed by the grammar parser.
1378 (b4_percent_define_default): New macro to set a default value for a
1379 %define variable.
1380 (m4_wrap): Update wrapped code, and fix some underquoting.
1381 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
1382 Expect grammar uses of %define variables and %code qualifiers to be
1383 defined in b4_percent_define_user_variables and
1384 b4_percent_code_user_qualifiers.
1385 * data/c++.m4: Use b4_percent_define_default rather than
1386 m4_define_default. Fix some underquoting. Skeleton usage of %define
1387 variable define_location_comparison now implies skeleton usage of
1388 %define variable filename_type.
1389 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1390 data/push.c, data/yacc.c: Update macro names.
1391 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
1392 muscle names.
1393
1394 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1395
1396 DJGPP specific issues.
1397
1398 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
1399 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
1400
1401 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1402
1403 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
1404 run parsers in all tests so that Valgrind is invoked during
1405 maintainer-check-valgrind.
1406 (Duplicate representation of merged trees): Free all semantic values.
1407 (Duplicated user destructor for lookahead): Likewise.
1408
1409 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1410
1411 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
1412 command-line prefix.
1413 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
1414 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
1415 miss Valgrind messages.
1416 (Exploding the Stack Size with Malloc): Likewise.
1417
1418 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1419
1420 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
1421 locals. Reported by Juan Manuel Guerrero at
1422 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
1423 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
1424 Fix some indentation also.
1425 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
1426 explaining this issue.
1427
1428 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
1429 and Joel E. Denny <jdenny@ces.clemson.edu>
1430
1431 Simplify union and prologue handling, and escape union and lex/parse
1432 params with digraphs.
1433 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
1434 values to the empty string since these are no longer guaranteed
1435 initialized by the front-end.
1436 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
1437 braces around b4_user_stype since this is no longer done by the
1438 front-end.
1439 * src/files.c, src/files.h (pre_prologue_obstack,
1440 post_prologue_obstack): Remove.
1441 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
1442 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
1443 with digraphs. This fixes lex params and parse params.
1444 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
1445 * src/output.c (prepare): Remove muscle insertion of the prologues.
1446 (output): Remove freeing of pre_prologue_obstack and
1447 post_prologue_obstack.
1448 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
1449 than prologue_augment for prologue parsing so you don't need prologue
1450 obstacks.
1451 (grammar_declaration): For %union RHS, use `braceless' instead of
1452 "{...}" so that braces are already stripped and code is escaped with
1453 digraphs.
1454 * src/reader.c (prologue_augment): Remove.
1455 (reader): Remove initialization of pre_prologue_obstack and
1456 post_prologue_obstack.
1457 * src/reader.h (prologue_augment): Remove.
1458
1459 * data/c.m4: Remove stray parenthesis.
1460
1461 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1462
1463 Remove quotes from variables names in %define directives and from
1464 qualifiers in %code directives, and restrict the characters that are
1465 allowed in them to M4-friendly ones. For %define, continue to support
1466 the quoted form as a deprecated feature. Discussed starting at
1467 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
1468 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
1469 %code.
1470 * doc/bison.texinfo (Prologue Alternatives): Update.
1471 (Decl Summary): In %defines entry, update mention of `%code requires'
1472 and `%code provides'.
1473 (C++ Location Values): Update %define uses.
1474 (Calc++ Parser Interface): Likewise.
1475 (Calc++ Parser): Likewise, and update `%code requires' uses.
1476 (Table of Symbols): Update %code documentation.
1477 * src/parse-gram.y (prologue_declaration): For %define variables, use
1478 `variable' instead of `STRING'.
1479 (grammar_declaration): For %code qualifiers, use `ID' instead of
1480 `STRING'.
1481 (variable): New nonterminal that takes an `ID' or a `STRING'.
1482 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
1483 and %define uses.
1484 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
1485 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
1486 (%define errors): Update %define uses.
1487
1488 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1489
1490 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
1491 instead of muscle_insert for %define values so that M4-special
1492 characters are replaced with digraphs.
1493 * tests/input.at (%define errors): Extend to check weird values.
1494
1495 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1496
1497 Instead of having skeletons declare all valid %define variables and
1498 %code qualifiers, provide macros that retrieve the associated values
1499 and build these lists automatically. Thus Bison will now warn when a
1500 variable or qualifier is not used by the skeleton in the current
1501 invocation regardless of whether it might sometimes be used by that
1502 skeleton in other invocations. Also, move all %define value macros to
1503 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
1504 form, which is replaced by %code.
1505 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
1506 (b4_check_user_names): ... this, and change the series of valid name
1507 arguments to a single list argument for names used in the skeleton
1508 similar to the existing list argument for names used in the grammar.
1509 Warn instead of complaining.
1510 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
1511 values and %code code, to format %code code properly, and to build
1512 lists of all %define variables and %code qualifiers used in the
1513 skeleton: b4_skeleton_percent_define_variables and
1514 b4_skeleton_percent_code_qualifiers.
1515 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
1516 Remove, and...
1517 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
1518 the skeleton names lists can finish building first. In place of
1519 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
1520 expect the lists b4_user_percent_define_variables and
1521 b4_user_percent_code_qualifiers.
1522 * data/c++.m4: Where setting default values for b4_parser_class_name,
1523 b4_location_type, b4_filename_type, b4_namespace, and
1524 b4_define_location_comparison, update their names to the
1525 b4_percent_define_ namespace.
1526 * data/glr.c: Don't use b4_check_percent_define_variables and
1527 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1528 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
1529 (b4_parser_class_name, b4_namespace): Define these using
1530 b4_get_percent_define for parser_class_name and namespace.
1531 * data/location.cc: Use b4_get_percent_define.
1532 * data/push.c: Don't use b4_check_percent_define_variables and
1533 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1534 * data/yacc.c: Likewise, and don't call m4_exit in
1535 b4_use_push_for_pull_if or m4_wrap code will never execute.
1536 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
1537 Rename to...
1538 (muscle_grow_user_name_list): ... this for consistency with the
1539 terminology used in bison.m4.
1540 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
1541 %define variable names, and rename muscle used_percent_define_variables
1542 to user_percent_define_variables.
1543 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
1544 user_percent_code_qualifiers.
1545 (content): Remove.
1546 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
1547 {CODE} form is no longer accepted.
1548 * tests/input.at (Reject bad %code qualifiers): Rename to...
1549 (Reject unused %code qualifiers): ... this, and update test output.
1550 (%define error): Update test output.
1551
1552 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
1553
1554 Check for unrecognized %define variables similar to checking for
1555 unrecognized %code qualifiers. Check for redefined %define variables.
1556 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
1557 generalizes...
1558 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
1559 (b4_check_percent_define_variables): New, also wraps it.
1560 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
1561 variables using b4_check_percent_define_variables.
1562 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
1563 all those exercised in the test suite and all those listed in the
1564 `Default values' section of c++.m4. Are there others?
1565 * data/push.c, data/yacc.c: Declare no valid %define variables.
1566 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
1567 similar to muscle_find, but it works even when the muscle stores a
1568 const value.
1569 (muscle_grow_used_name_list): New function for constructing the used
1570 name list muscles that b4_check_for_unrecognized_names requires.
1571 * src/parse-gram.y (prologue_declaration): Warn if a variable is
1572 %define'd more than once. Define the b4_used_percent_define_variables
1573 muscle with muscle_grow_used_name_list.
1574 (grammar_declaration): Abbreviate %code code with
1575 muscle_grow_used_name_list.
1576 * tests/input.at (%define errors): New.
1577
1578 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1579
1580 Provide warn_at, complain_at, and fatal_at function callbacks to the
1581 skeletons, and use this for %code qualifier complaints.
1582 * data/bison.m4 (b4_error_at): New, invoked by...
1583 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
1584 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
1585 @fatal_at(...@) directives.
1586 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
1587 qualifiers in b4_used_percent_code_qualifiers and to use
1588 b4_complain_at.
1589 * src/location.c, src/location.h (boundary_set_from_string): New global
1590 function.
1591 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
1592 function.
1593 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
1594 to b4_used_percent_code_qualifiers.
1595 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
1596 function.
1597 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
1598 (lineno): Rename to...
1599 (out_lineno): ... this so I don't misunderstand it again.
1600 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
1601 here; these newlines are in the input but not the output file.
1602 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
1603 (at_directive_perform): ... this new static function, and add handling
1604 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
1605 directives.
1606 * tests/input.at (Reject bad %code qualifiers): Update test output with
1607 locations and extend.
1608
1609 * tests/output.at (Output file name: [, Output file name: ]): Remove
1610 bogus comment about these tests failing.
1611
1612 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1613
1614 Clean up b4_check_percent_code_qualifiers a little.
1615 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
1616 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
1617 documentation and add examples.
1618 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
1619 qualifiers here.
1620
1621 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
1622
1623 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
1624 unreliable -- especially when they're hidden inside another macro.
1625 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
1626 data/c.m4: Remove m4_divert(-1).
1627 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1628 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
1629 m4_divert_push(0) and m4_divert_pop(0).
1630 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
1631 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
1632 pushed and popped by m4sugar, should be first on the stack.
1633
1634 Provide warn, complain, and fatal function callbacks to the skeletons.
1635 This provides more flexibility than m4_fatal, improves the error
1636 message format, and captures messages for translation. Discussed
1637 starting at
1638 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
1639 * data/bison.m4 (b4_error): New, invoked by...
1640 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
1641 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
1642 directives. Because these M4 macros might be called when the current
1643 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
1644 the previous removal of uses of m4_divert, which caused trouble.
1645 (b4_check_percent_code_qualifiers): Use b4_complain instead of
1646 m4_fatal to report unrecognized %code qualifiers.
1647 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
1648 push parser requests.
1649 * data/glr.c: Use b4_complain instead of m4_fatal to report
1650 non-deterministic push parser requests.
1651 Update @output usage to @output(...@) form.
1652 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
1653 report missing %defines. Update @output usage to @output(...@) form.
1654 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
1655 @output(...@) form.
1656 * src/main.c (main): Invoke skel_scanner_free.
1657 * src/scan-skel.h (skel_scanner_free): Prototype new function.
1658 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
1659 obstack_for_string from flex-scanner.h.
1660 (YY_DECL): Use to declare skel_lex static.
1661 (decode_at_digraphs): Remove; now handled in the new
1662 SC_AT_DIRECTIVE_ARG start condition.
1663 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
1664 functions.
1665 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
1666 at_directive_argv): New static globals.
1667 (INITIAL): Use fail_for_invalid_at.
1668 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
1669 recognize the start of a generalized `@directive(...@)' form and
1670 start...
1671 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
1672 directive args (using the new obstack_for_string), to decode the
1673 contained @ diagraphs, and to perform the directive. It recognizes
1674 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
1675 @output(...@).
1676 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
1677 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
1678 `@,'.
1679 (scan_skel): Initialize obstack_for_string on the first call.
1680 (skel_scanner_free): New function to free obstack_for_string.
1681 * tests/input.at (Reject bad %code qualifiers): Update test output.
1682
1683 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
1684
1685 Consolidate the 4 prologue alternative directives (%code, %requires,
1686 %provides, and %code-top) into a single %code directive with an
1687 optional qualifier field. Discussed at
1688 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
1689 * NEWS (2.3a+): Rewrite the existing entry for the prologue
1690 alternatives.
1691 * doc/bison.texinfo (Prologue Alternatives): Update.
1692 (Decl Summary): Update to %code "requires" and %code "provides".
1693 (Calc++ Parser): Update to %code "requires".
1694 (Table of Symbols): Remove entries for %requires, %provides, and
1695 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
1696 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
1697 are replaced by b4_percent_code_provides and b4_percent_code_requires,
1698 which are skeleton-specific.
1699 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
1700 declare what %code qualifiers it supports and to complain if any other
1701 qualifiers were used in the grammar.
1702 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
1703 and b4_user_code([b4_percent_code_provides]) in place of
1704 b4_user_requires and b4_user_provides.
1705 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
1706 Add b4_user_code([b4_percent_code_top]) and
1707 b4_user_code([b4_percent_code]).
1708 Invoke b4_check_percent_code_qualifiers.
1709 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
1710 PERCENT_REQUIRES): Remove.
1711 (grammar_declaration): Remove RHS's for %code-top, %provides, and
1712 %requires. Rewrite the %code RHS as the unqualified form defining the
1713 muscle b4_percent_code. Add another RHS for the qualified %code form,
1714 which defines muscles of the form b4_percent_code_QUALIFIER and the
1715 b4_used_percent_code_qualifiers muscle.
1716 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
1717 PERCENT_REQUIRES): Remove.
1718 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
1719 %code "requires" and %code "provides".
1720 * tests/input.at (Reject bad %code qualifiers): New.
1721
1722 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
1723
1724 Use the new code_props interface for destructors and printers.
1725 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
1726 printer_location members, and change the type of the destructor and
1727 printer members to code_props.
1728 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
1729 symbol_printer_get, semantic_type_destructor_set,
1730 semantic_type_printer_set, default_tagged_destructor_set,
1731 default_tagless_destructor_set, default_tagged_printer_set,
1732 default_tagless_printer_set): Use code_props in arguments and return
1733 types in place of char const * and location.
1734 (symbol_destructor_location_get, symbol_printer_location_get): Remove
1735 since the locations are now contained in the return of
1736 symbol_destructor_get and symbol_printer_get.
1737 * src/output.c (symbol_destructors_output, symbol_printers_output):
1738 Replace with...
1739 (symbol_code_props_output): ... this to eliminate duplicate code.
1740 (output_skeleton): Update to use symbol_code_props_output.
1741 * src/reader.c (symbol_should_be_used): Update use of
1742 symbol_destructor_get.
1743 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
1744 Update uses of the various _destructor_set and _printer_set functions.
1745 * src/symtab.c: (default_tagged_destructor_location,
1746 default_tagless_destructor_location, default_tagged_printer_location,
1747 default_tagless_printer_location): Remove since we...
1748 (default_tagged_destructor, default_tagless_destructor,
1749 default_tagged_printer, default_tagless_printer): ... change the type
1750 of these to code_props.
1751 (symbol_new, semantic_type_new, symbol_destructor_set,
1752 semantic_type_destructor_set, symbol_destructor_get,
1753 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
1754 symbol_check_alias_consistency, default_tagged_destructor_set,
1755 default_tagless_destructor_set, default_tagged_printer_set,
1756 default_tagless_printer_set): Update.
1757 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
1758 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
1759 code_props members.
1760 (symbol_print): Use SYMBOL_CODE_PRINT.
1761
1762 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
1763
1764 Use the new code_props interface for rule actions.
1765 * src/symlist.h (symbol_list): Replace action, action_location, and
1766 used members with a code_props action_props member.
1767 * src/reader.c (symbol_should_be_used, grammar_rule_check,
1768 grammar_midrule_action, grammar_current_rule_merge_set,
1769 grammar_current_rule_symbol_append, packgram): Update.
1770 * src/scan-code.h (translate_rule_action): Remove, no longer used.
1771 * src/scan-code.l (handle_action_dollar): Update.
1772 (translate_rule_action): Remove, no longer used.
1773 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
1774
1775 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1776
1777 Use the new code_props interface in parse-gram.y.
1778 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
1779 Update all uses of translate_* functions to use the new code_props
1780 interface and to use gram_scanner_last_string_free and
1781 code_scanner_last_string_free where possible.
1782 (grammar_declaration): symbol_list_destructor_set and
1783 symbol_list_printer_set now perform the translation, so don't do it
1784 here. Use gram_scanner_last_string_free where possible.
1785 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
1786 translate_code): Remove, no longer used.
1787 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
1788 symbol_list_printer_set): Perform code translation here rather than
1789 depending on the caller to do so.
1790
1791 * src/symlist.h (struct symbol_list): Correct some documentation typos.
1792 * src/scan-gram.h (gram_last_string): Remove declaration.
1793 * src/scan-gram.l (last_string): Declare it static.
1794
1795 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
1796
1797 Encapsulate code properties and related functionality for the various
1798 destructors, printers, and actions into a code_props structure and
1799 interface. This patch merely implements code_props in scan-code.h and
1800 scan-code.l. Future patches will rewrite other modules to use it.
1801 Discussed starting at
1802 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
1803 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
1804 consistently initialize const structs that have an empty location
1805 field.
1806 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
1807 to ensure consistency.
1808 * src/scan-code.h (code_props): New structure.
1809 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
1810 function, macro, and const global variable for initializing a
1811 code_props with no code.
1812 (code_props_plain_init, code_props_symbol_action_init,
1813 code_props_rule_action_init, code_props_translate_code): The rest of
1814 the new code_props functional interface. Among other things, the init
1815 functions set the code_props kind field so that
1816 code_props_translate_code will know whether to behave like
1817 translate_symbol_action, translate_rule_action, or translate_code.
1818 These old translate functions must remain until all other modules are
1819 updated to use the new code_props interface.
1820 (code_scanner_last_string_free): New function similar to
1821 gram_scanner_last_string_free.
1822 (code_scanner_free): Add documentation.
1823 * src/scan-code.l: Implement the new interface.
1824 (code_lex): Make it static, add a code_props* argument, and remove the
1825 rule argument.
1826 (last_string): New static global similar to the one in scan-gram.l.
1827 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
1828 instead of rule.
1829 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
1830 code_props since Bison may one day use this information for destructors
1831 and printers.
1832 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
1833 (handle_action_dollar): Use symbol_list_n_get and set used flag
1834 directly since symbol_list_n_used_set is removed.
1835 (translate_action): Add a code_props* argument and remove the rule,
1836 action, and location arguments. Pass the code_props* on to code_lex.
1837 (translate_rule_action, translate_symbol_action, translate_code):
1838 Rewrite as wrappers around the new code_props interface.
1839 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
1840 it would eventually need to break the encapsulation of code_props.
1841
1842 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
1843
1844 * etc/.cvsignore: New.
1845
1846 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
1847
1848 Add maintainer-push-check to run maintainer-check using push parsing in
1849 place of pull parsing where available.
1850 * Makefile.am (maintainer-push-check): New.
1851 * data/bison.m4 (b4_use_push_for_pull_if): New.
1852 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
1853 appropriately based on their existing values.
1854 (yypush_parse): Don't print push-parser-specific diagnostics if push
1855 parsing is being used in place of pull parsing.
1856 * data/yacc.c: If push parsing should replace pull parsing, redirect to
1857 push.c.
1858 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
1859 variable, and insert b4_use_push_for_pull_flag into muscles.
1860 * tests/Makefile.am (maintainer-push-check): New.
1861
1862 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
1863
1864 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
1865 (whether successful or failed) so that yypush_parse can be invoked
1866 again to start a new parse using the same yypstate.
1867 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
1868 check multiple yypull_parse invocations on the same yypstate. For pull
1869 mode, extend to check multiple yyparse invocations.
1870 (Exploding the Stack Size with Alloca): Extend to try with
1871 %push-pull-parser.
1872 (Exploding the Stack Size with Malloc): Likewise.
1873
1874 * tests/calc.at (Simple LALR Calculator): Don't specify
1875 %skeleton "push.c" since %push-pull-parser implies that now.
1876 * tests/headers.at (export YYLTYPE): Don't check for the push
1877 declarations. Otherwise, this test case can't be used to see if push
1878 mode can truly emulate pull mode.
1879 * tests/input.at (Torturing the Scanner): Likewise.
1880 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
1881 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
1882 AT_YACC_IF, which now includes the case of push mode since %skeleton
1883 need not be used for push mode. This will be more intuitive once
1884 push.c is renamed to yacc.c.
1885
1886 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
1887
1888 For push mode, convert yyparse from a macro to a function, invoke yylex
1889 instead of passing a yylexp argument to yypull_parse, and don't
1890 generate yypull_parse or yyparse unless %push-pull-parser is declared.
1891 Discussed starting at
1892 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
1893 * data/bison.m4 (b4_pull_if): New.
1894 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
1895 * data/push.c: Improve M4 quoting a little.
1896 (b4_generate_macro_args, b4_parenthesize): Remove.
1897 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
1898 any time a pull parser is requested.
1899 Don't #define this as a wrapper around yypull_parse. Instead, when
1900 both push and pull are requested, make it a function that does that
1901 same thing.
1902 (yypull_parse): If there's a b4_prefix, #define this to
1903 b4_prefix[pull_parse] when both push and pull are requested.
1904 Don't define this as a function unless both push and pull are
1905 requested.
1906 Remove the yylexp argument and hard-code yylex invocation instead.
1907 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
1908 %push-parser.
1909 * src/getargs.c (pull_parser): New global initialized to true.
1910 * getargs.h (pull_parser): extern it.
1911 * src/output.c (prepare): Insert pull_flag muscle.
1912 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
1913 (prologue_declaration): Set both push_parser and pull_parser = true for
1914 %push-pull-parser. Set push_parser = true and pull_parser = false for
1915 %push-parser.
1916 * src/scan-gram.l: Don't accept %push_parser as an alternative to
1917 %push-parser since there's no backward-compatibility concern here.
1918 Scan %push-pull-parser.
1919 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
1920 instead of %push-parser.
1921 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
1922 prototype it in the module that calls yyparse.
1923 * tests/input.at (Torturing the Scanner): Likewise.
1924 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
1925
1926 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
1927
1928 Update etc/bench.pl. Optimize push mode a little (the yyn change
1929 deserves most of the credit).
1930 * Makefile.am (SUBDIRS): Add etc subdirectory.
1931 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
1932 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
1933 yytoken, yyval, and yyloc declarations to...
1934 (yyparse or yypush_parse): ... here to improve performance. For
1935 yypush_parse invocations after the first, be sure to assign yyn its old
1936 value again.
1937 (yypstate_new): Don't bother initializing the yyresult field since the
1938 initial value isn't used.
1939 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
1940 remove the #define that, in push mode, set it to yyps->NAME.
1941 * etc/Makefile.am: New.
1942 * etc/bench.pl: Remove and build it instead from...
1943 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
1944 "tests/bison" from the build directory by default rather than just
1945 invoking "bison" from $PATH.
1946 (calc_grammar): Update push parser code: don't declare yylval globally,
1947 don't define yyparse_wrapper, and don't #define yyparse.
1948 (bench_grammar): Update to check all working combinations of yacc.c,
1949 push.c, impure, pure, pull, and push.
1950
1951 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1952
1953 For push mode, add pull wrappers around yypush_parse.
1954 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
1955 (yypull_parse): New function wrapping yypush_parse.
1956 (yyparse): New #define wrapping yypull_parse.
1957 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
1958 is declared.
1959 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
1960 prototype yylex in the module that calls yyparse, and don't prototype
1961 yyparse there. Otherwise, the yyparse expansion won't compile.
1962 * tests/input.at (Torturing the Scanner): Likewise.
1963
1964 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
1965
1966 Enable push parsers to operate in impure mode. Thus, %push-parser no
1967 longer implies %pure-parser. The point of this change is to move
1968 towards being able to test the push parser code by running the entire
1969 test suite as if %push-parser had been declared.
1970 * data/push.c (yypush_parse): For impure mode, remove the
1971 yypushed_char, yypushed_val, and yypushed_loc arguments.
1972 Instead, declare these as local variables initialized to the global
1973 yychar, yylval, and yylloc.
1974 For the first yypush_parse invocation only, restore the initial values
1975 of these global variables when it's time to read a token since they
1976 have been overwritten.
1977 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
1978 %push-parser.
1979 * tests/calc.at (Simple LALR(1) Calculator): Always declare
1980 %pure-parser along with %push-parser since this test case was designed
1981 for pure push parsers.
1982 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
1983 (AT_YACC_OR_PUSH_IF): New.
1984 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
1985 add a note that it's still wrong for some cases (as it has been for a
1986 while).
1987 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
1988 %push-parser no longer implies %pure-parser.
1989
1990 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
1991
1992 Remove some unnecessary differences between the pull parser code and
1993 the push parser code. This patch enables yynerrs in push mode.
1994 * data/push.c: Reformat M4 a little.
1995 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
1996 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
1997 because push mode is on. Instead, if pure mode is on, move yynerrs
1998 to...
1999 (b4_declare_parser_state_variables): ... here.
2000 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
2001 to yyps->NAME so it can be used in yypush_parse.
2002 (yypush_parse): Don't omit uses of yynerrs in push mode.
2003
2004 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2005
2006 Fix bug such that the first pushed token's value and location are
2007 sometimes overwritten (sometimes by %initial-action) before being used.
2008 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
2009 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
2010 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
2011 more closely mimic the pull parser logic.
2012 Don't copy the pushed token to yychar, yylval, and yylloc until it's
2013 time to read a token, which is after any initialization of yylval and
2014 yylloc.
2015 (gottoken): Rename label to...
2016 (yyread_pushed_token): ... for clarity and to avoid infringing on the
2017 user namespace.
2018
2019 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2020
2021 Rearrange initialization of the parser state variables so that the
2022 skeleton doesn't have to have a copy for pull mode and another for push
2023 mode. This patch also fixes at least a bug such that yylloc was not
2024 initialized (with b4_location_initial_line and
2025 b4_location_initial_column) upon calling yypush_parse. However, that
2026 initialization now overwrites the first token's location;
2027 %initial-action assigning @$ already did the same thing, and both bugs
2028 will be fixed in a later patch.
2029 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
2030 (b4_declare_parser_state_variables): Remove initialization of yytoken,
2031 yyss, yyvs, yyls, and yystacksize.
2032 (yypstate_new): Remove initialization of some yypstate fields: yystate,
2033 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
2034 yylsp.
2035 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
2036 yyps->NAME so it can be used in yypush_parse.
2037 (yyparse or yypush_parse): For yypush_parse, don't print the
2038 "Starting parse" diagnostic for invocations after the first.
2039 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
2040 yypush_parse, only do it for the first invocation.
2041 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
2042 initialization to occur in yypush_parse but only on the first
2043 invocation.
2044
2045 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2046
2047 * data/push.c: Add CPP guards around push parser declarations in both
2048 the header and the code file.
2049 In the code file, move the push parser declarations to the same place
2050 they appear in the header file.
2051 Clean up the M4 some, especially the inconsistent underquoting in
2052 some b4_c_function_def and b4_c_function_decl uses.
2053
2054 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2055
2056 Encapsulate the push parser state variables into an M4 macro so the
2057 push skeleton doesn't have to list them again for pull mode's yyparse.
2058 For push mode, remove yypush_parse's local equivalents of these
2059 variables to eliminate unnecessary copying between the two sets at
2060 run-time. This patch also fixes at least a bug related to multiple
2061 %initial-action invocations in push mode.
2062 * data/push.c (b4_declare_parser_variables): Rename to...
2063 (b4_declare_scanner_communication_variables): ... this for clarity and
2064 update both uses.
2065 (b4_declare_yyparse_variables): Remove and move its contents to the one
2066 spot where it was invoked.
2067 (b4_declare_parser_state_variables): New macro containing the parser
2068 state variables required by push mode.
2069 (struct yypstate): Replace all fields but yynew with
2070 b4_declare_parser_state_variables.
2071 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
2072 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
2073 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
2074 (yyparse or yypush_parse): For yyparse in pull mode, replace local
2075 parser state variable declarations with
2076 b4_declare_parser_state_variables.
2077 Don't initialize parser state variables when calling yypush_parse since
2078 yypstate_new already does that.
2079 Invoke the user's initial action only upon the first yypush_parse
2080 invocation.
2081 Remove all code that copies between the local parser state variables
2082 and the yypstate.
2083
2084 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2085
2086 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
2087 prevent a name collision in a future patch where these names will
2088 sometimes be #define'd.
2089 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
2090 since it no longer has the same name as the existing argument.
2091 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
2092
2093 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
2094 and Joel E. Denny <jdenny@ces.clemson.edu>
2095
2096 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2097 that the argument is case-insensitive, and there's no `=' here.
2098 For the %skeleton entry, mention that %language is better.
2099 (Bison Options): Likewise for --language and --skeleton. Move the
2100 --skeleton entry so that the `Tuning the parser' section is sorted
2101 alphabetically on long options.
2102 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
2103 %language directive in detail here; cross-reference the %language
2104 documentation instead.
2105 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
2106 `%require "2.3b"' so that the example is always up-to-date.
2107 (Table of Symbols): Add entries for %language and %skeleton.
2108 * examples/extexi (normalize): Instead of replacing every %require
2109 argument with the current Bison version, just substitute for
2110 `@value{VERSION}'. This guarantees that we're testing what actually
2111 appears in the documentation.
2112 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
2113 rather than `@VERSION@'.
2114
2115 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2116
2117 * NEWS: Reword the %language news a bit, and put it earlier.
2118
2119 * src/getargs.c (skeleton_arg): Last arg is now location const *.
2120 Rewrite to simplify the logic.
2121 (language_argmatch): Likewise.
2122 (program_name): We now own this var.
2123 * src/getargs.h (struct bison_language): Use char[] rather than
2124 const char *.
2125
2126 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
2127 Java is supported.
2128 * src/complain.c (program_name): Remove decl; no longer needed.
2129 * src/main.c (program_name): Remove; now belongs to getargs.
2130
2131 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
2132
2133 * NEWS: Document %language.
2134
2135 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
2136
2137 * data/c-skel.m4, data/c++-skel.m4: New files.
2138 * data/glr.c: Complain on push parsers.
2139
2140 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
2141 over %skeleton.
2142 (Decl Summary): Document %language and %skeleton.
2143 (Command line): Document -L.
2144
2145 * examples/extexi: Rewrite %require directive.
2146 * examples/calc++/Makefile.am: Pass VERSION to extexi.
2147
2148 * src/files.c (compute_exts_from_gc): Look in language structure
2149 for .y extension.
2150 (compute_file_name_parts): Check whether .tab should be added.
2151 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
2152 (language, skeleton_arg, language_argmatch): New.
2153 (long_options): Add --language.
2154 (getargs): Use skeleton_arg, add -L/--language.
2155 * src/getargs.h: Include location.h.
2156 (struct bison_language, language, skeleton_arg, language_argmatch): New.
2157 * src/output.c (prepare): Pick default skeleton from struct language.
2158 Don't dispatch C skeletons here.
2159 * src/parse-gram.y (PERCENT_LANGUAGE): New.
2160 (prologue_declaration): Add "%language" rule, use skeleton_arg.
2161 * src/scan-gram.l ("%language"): New rule.
2162
2163 * tests/calc.at: Test %skeleton and %language.
2164 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
2165 (AT_GLR_IF): Look for %skeleton "glr.cc".
2166 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
2167 (AT_YACC_IF): Reject %language.
2168
2169 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2170
2171 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
2172 since it wasn't used; only the typedef name 'semantic_type' is needed.
2173 Also, omit trailing white space.
2174
2175 * bootstrap: Sync from coreutils.
2176 (gnulib_extra_files): Add build-aux/announce.gen.
2177 (slurp): Adjust .gitignore files like .cvsignore files.
2178 * build-aux/announce-gen: Remove from CVS, since bootstrap
2179 now creates this.
2180
2181 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
2182
2183 Make %push-parser imply %pure-parser. This fixes several bugs; see
2184 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
2185 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
2186 pure_parser = true.
2187 * data/push.c: Don't bother testing b4_push_if when deciding whether
2188 to expand b4_declare_parser_variables globally.
2189 (yypush_parse): Likewise in here.
2190
2191 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
2192 (yy_reduce_print): Reformat M4 for readability.
2193
2194 2006-12-15 Bob Rossi <bob@brasko.net>
2195 and Joel Denny <jdenny@ces.clemson.edu>
2196
2197 * data/push.c (yypstate): Add typedef, and update all uses of
2198 struct yypstate to just yypstate.
2199 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
2200
2201 2006-12-14 Bob Rossi <bob@brasko.net>
2202
2203 * data/push.c (yypush_parse): Declare prototype regardless of
2204 %locations option.
2205
2206 2006-12-14 Bob Rossi <bob@brasko.net>
2207
2208 * data/push.c (yyparse): Remove the prototype and the #define when in
2209 push-parser mode.
2210
2211 2006-12-13 Bob Rossi <bob@brasko.net>
2212
2213 * data/push.c (yypstate_init): Rename to...
2214 (yypstate_new): ... this and use b4_c_function_def.
2215 (yypstate_delete): New.
2216 (yypush_parse): Change parameters yynval and yynlloc to be const.
2217 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
2218 yypstate_delete functions.
2219
2220 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
2221
2222 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
2223 strange test case titles. Reported by Bob Rossi.
2224
2225 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
2226
2227 * TODO: Add pointer to Sylvain Schmitz's work on static detection
2228 of potential ambiguities in GLR grammers.
2229
2230 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
2231
2232 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
2233 `bison ', use m4_index instead of m4_substr since chopping up a string
2234 containing M4-special characters causes problems here.
2235
2236 Fix a couple of bugs related to special characters in user-specified
2237 file names, and make it easier for skeletons to compute output file
2238 names with the same file name prefix as Bison-computed output file
2239 names.
2240 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
2241 b4_parser_file_name and b4_spec_defines_file instead of
2242 @output_parser_name@ and @output_header_name@, which are now redundant.
2243 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
2244 b4_parser_file_name, b4_spec_defines_file, and the new
2245 @basename(FILENAME@) instead of @output_parser_name@ and
2246 @output_header_name@, which inappropriately escaped the file names as
2247 C string literals.
2248 * src/files.c (all_but_ext): Remove static qualifier.
2249 (compute_output_file_names): Move `free (all_but_ext)' to...
2250 (output_file_names_free): ... here since all_but_ext is needed later.
2251 * src/files.h (all_but_ext): Extern.
2252 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
2253 exactly what MUSCLE_INSERT_STRING used to do.
2254 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
2255 characters are escaped properly.
2256 * src/output.c (prepare): Define muscle file_name_all_but_ext as
2257 all_but_ext.
2258 For pkgdatadir muscle, maintain previous functionality by using
2259 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
2260 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
2261 digraphs would never be expanded. Hopefully no one has M4-special
2262 characters in his Bison installation path.
2263 * src/scan-skel.l: Don't parse @output_header_name@ and
2264 @output_parser_name@ anymore since they're now redundant.
2265 In @output, use decode_at_digraphs.
2266 Parse a new @basename command that invokes last_component.
2267 (decode_at_digraphs): New.
2268 (BASE_QPUTS): Remove unused.
2269 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
2270 (Output file name): New tests.
2271
2272 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
2273
2274 Warn about output files that are generated by the skeletons and that
2275 conflict with other output files.
2276 * data/glr.c: Don't generate the header file here when glr.cc does.
2277 * src/files.c (file_names, file_names_count): New static globals.
2278 (compute_output_file_names): Invoke output_file_name_check for files
2279 not generated by the skeletons and remove existing checks.
2280 (output_file_name_check): New function that warns about conflicting
2281 output file names.
2282 (output_file_names_free): Free file_names.
2283 * src/files.h (output_file_name_check): Declare.
2284 * src/scan-skel.l: Invoke output_file_name_check for files generated by
2285 the skeletons.
2286 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
2287 (Conflicting output files): New tests.
2288
2289 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2290
2291 * doc/bison.texinfo: Fix a couple of typos.
2292
2293 2006-12-08 Bob Rossi <bob@brasko.net>
2294
2295 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
2296 Rename to...
2297 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
2298 update all uses.
2299 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
2300 (yypush_parse): Rename yypvars argument to yyps and remove redundant
2301 local pv.
2302 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
2303 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
2304
2305 2006-12-07 Bob Rossi <bob@brasko.net>
2306 and Joel Denny <jdenny@ces.clemson.edu>
2307
2308 * data/push.c (yypvarsinit): Change return type from void* to struct
2309 yypvars*. No longer cast to void* on return.
2310 (struct yypvars): Remove yylen since it need not be remembered between
2311 yypushparse invocations.
2312 (yypushparse): Don't copy between yylen and pv->yylen.
2313
2314 2006-12-05 Bob Rossi <bob@brasko.net>
2315
2316 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
2317 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
2318 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
2319 (struct yypvars): Remove b4_declare_parser_variables.
2320 (yypvarsinit): Remove init code for removed variables.
2321 (global scope): Do not declare b4_declare_parser_variables if
2322 push or pure mode.
2323 (yypushparse): Add b4_declare_parser_variables.
2324 Init new local variables, and remove init code for removed
2325 yypvars variables.
2326 (yyparse): Delete.
2327 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
2328 and yyparse for other modes.
2329 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
2330 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
2331 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
2332 (AT_PURE_LEX_IF): True if pure or push parser.
2333
2334 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
2335
2336 Document Yacc prologue alternatives and default %destructor's and
2337 %printer's as experimental. Don't mention Java yet. Discussed at
2338 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
2339 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
2340 (2.3a): Annotate this entry to say the old forms of these features were
2341 also experimental.
2342 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
2343 Table of Symbols): Say they're experimental. Comment out any mention
2344 of Java (we'll want this back eventually).
2345
2346 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2347
2348 Support a file name argument to %defines. Deprecate `=' in
2349 %file-prefix, %name-prefix, and %output. Discussed at
2350 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
2351 * NEWS (2.3a+): Mention.
2352 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
2353 form of %defines, and remove `=' from entries for %file-prefix,
2354 %name-prefix, and %output.
2355 * src/parse-gram.y (prologue_declaration): Implement.
2356 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
2357 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
2358 all but one occurrence of %name-prefix.
2359 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
2360 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
2361 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
2362 occurrence of each of %file-prefix and %output. Add check for %defines
2363 with argument.
2364 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
2365 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
2366 Remove the `=' from %output.
2367
2368 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
2369
2370 Don't escape $ in test case titles since Autoconf 2.61 now does that
2371 correctly.
2372 * tests/actions.at (Default %printer and %destructor are not for error
2373 or $undefined): Here.
2374 (Default %printer and %destructor are not for $accept): Here.
2375 * tests/input.at (Invalid $n and @n): Here.
2376
2377 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
2378
2379 Rename <!> to <>. Discussed starting at
2380 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
2381 * NEWS (2.3a+): Update.
2382 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
2383 Update.
2384 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
2385 * src/scan-gram.l (INITIAL): Implement.
2386 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
2387 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
2388 comment.
2389 * tests/actions.at (Default tagless %printer and %destructor,
2390 Default tagged and per-type %printer and %destructor,
2391 Default %printer and %destructor are not for error or $undefined,
2392 Default %printer and %destructor are not for $accept,
2393 Default %printer and %destructor for mid-rule values): Update.
2394 * tests/input.at (Default %printer and %destructor redeclared,
2395 Unused values with default %destructor): Update.
2396
2397 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2398
2399 Don't let %prec take a nonterminal.
2400 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
2401 token.
2402 * tests/input.at (%prec takes a token): New test checking that %prec
2403 won't take a nonterminal.
2404
2405 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2406
2407 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
2408 it was double-quoted.
2409 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
2410 grammar is maintained with Bison's highest standards.
2411 * src/getargs.c: Fix some typos in Doxygen comments.
2412
2413 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2414
2415 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
2416 later. Reported by Paul Eggert in
2417 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
2418 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
2419 * src/scan-code.l (translate_action): Don't bother invoking
2420 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
2421 (code_scanner_free): Instead of invoking
2422 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
2423 which frees more.
2424 * src/scan-gram.l (gram_scanner_free): Likewise.
2425 * src/scan-skel.l (scan_skel): Likewise.
2426
2427 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2428
2429 * src/files.c (tr): Change return type to void.
2430 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
2431 has been called previously for the same key.
2432 (muscle_find): Return storage instead of value so that
2433 --enable-gcc-warnings doesn't produce warnings that the return discards
2434 const. aver that the value and storage are the same since storage
2435 could potentially be NULL when value is not.
2436 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
2437 same as 0.
2438
2439 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2440
2441 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
2442 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
2443 us a slightly cleaner distribution, and also works.
2444 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
2445 gnulib changes.
2446
2447 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
2448 and Paul Eggert <eggert@cs.ucla.edu>
2449
2450 Don't let Bison leak memory except when it complains.
2451 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
2452 (spec_defines_file, dir_prefix): Now char *, not const char *,
2453 since they are freed.
2454 * src/files.c: Likewise.
2455 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
2456 Likewise.
2457 (tr): Now operates in-place. All uses changed.
2458 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
2459 values.
2460 (compute_file_name_parts, compute_output_file_names): Don't store
2461 read-only data in variables that will be freed.
2462 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
2463 src_extension, and header_extension.
2464 (output_file_names_free): New public function to free
2465 spec_verbose_file, spec_graph_file, spec_defines_file,
2466 parser_file_name, and dir_prefix.
2467 * src/getargs.c (getargs): Don't store read-only data in variables that
2468 will be freed.
2469 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
2470 (which previously existed but was unused), and quotearg_free.
2471 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
2472 * src/muscle_tab.c: Likewise.
2473 (muscle_entry): Make the value char const *,
2474 and add a new storage member that is char * and can be freed.
2475 (muscle_entry_free): New private function.
2476 (muscle_init): Use it instead of free.
2477 (muscle_insert, muscle_grow): Update and use new storage member.
2478 (muscle_code_grow): Free the string passed to muscle_grow
2479 since it's not needed anymore.
2480 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
2481 add a new `char *code' member.
2482 ("{...}"): Declare semantic type as code.
2483 * src/scan-code.h (translate_rule_action):
2484 (translate_symbol_action, translate_code, translate_action): Return
2485 `char const *' rather than `char *' since external code should not free
2486 these strings.
2487 * src/scan-code.l: Likewise.
2488 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
2489 which is "{...}" in the parser.
2490 * tests/Makefile.am (maintainer-check-valgrind): Set
2491 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
2492 Valgrind.
2493 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
2494 complain.
2495 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
2496 expecting a non-zero exit status sets --leak-check=summary and
2497 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
2498 this case, and we don't want to hear about it.
2499
2500 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2501
2502 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
2503 instead of from the template, to simplify configuration a bit.
2504 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
2505 and m4/wint_t.m4, as they are needed with the latest gnulib.
2506
2507 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2508
2509 Disable unset/unused mid-rule value warnings by default, and recognize
2510 --warnings=midrule-values to enable them. Discussed starting at
2511 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
2512 * NEWS (2.3a+): Mention.
2513 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
2514 warnings): Add entry for midrule-values subargument.
2515 * src/reader.c (symbol_should_be_used): Don't return true just because
2516 the value is a set/used mid-rule value unless
2517 --warnings=midrule-values was specified.
2518 * tests/input.at (Unused values, Unused values before symbol
2519 declarations): Run tests with and without --warnings=midrule-values.
2520
2521 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
2522 than LIST_FREE directly.
2523
2524 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2525
2526 Finish implementing --warnings=error, which should not be implied by
2527 --warnings=all (or by its synonyms -W and --warnings without
2528 subarguments).
2529 * src/complain.c (set_warning_issued): New function to report that
2530 warnings are being treated as errors and to record an error if so.
2531 Invoke...
2532 (warn_at, warn): ... here.
2533 * src/getargs.c (warnings_args, warnings_types): Reorder so that
2534 "error - warnings are errors" does not appear above "all - all of the
2535 above".
2536 (getargs): For -W and --warnings without subarguments, don't let
2537 FLAGS_ARGMATCH set warnings_error in warnings_flag.
2538 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
2539
2540 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2541
2542 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
2543 empty subargument list. For example: `bison --warnings= parser.y'.
2544
2545 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2546
2547 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
2548 the parser header file so that gcc doesn't warn.
2549
2550 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2551
2552 Split the default %destructor/%printer into two kinds: <*> and <!>.
2553 Discussed starting at
2554 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
2555 * NEWS (2.3a+): Mention.
2556 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
2557 previous change today related to mid-rules.
2558 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
2559 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
2560 (TYPE_TAG_ANY): Add as <*>.
2561 (TYPE_TAG_NONE): Add as <!>.
2562 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
2563 for <*> and <!>.
2564 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
2565 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
2566 * src/symlist.c (symbol_list_default_new): Split into tagged and
2567 tagless versions.
2568 (symbol_list_destructor_set, symbol_list_printer_set): Split
2569 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
2570 SYMLIST_DEFAULT_TAGLESS.
2571 * src/symlist.h: Update symbol_list_default*_new prototypes.
2572 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
2573 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
2574 * src/symtab.c (default_destructor, default_destructor_location,
2575 default_printer, default_printer_location): Split each into tagged and
2576 tagless versions.
2577 (symbol_destructor_get, symbol_destructor_location_get,
2578 symbol_printer_get, symbol_printer_location_get): Implement tagged
2579 default and tagless default cases.
2580 (default_destructor_set, default_printer_set): Split each into tagged
2581 and tagless versions.
2582 * src/symtab.h: Update prototypes.
2583 * tests/actions.at (Default %printer and %destructor): Rename to...
2584 (Default tagless %printer and %destructor): ... this, and extend.
2585 (Per-type %printer and %destructor): Rename to...
2586 (Default tagged and per-type %printer and %destructor): ... this, and
2587 extend.
2588 (Default %printer and %destructor for user-defined end token): Extend.
2589 (Default %printer and %destructor are not for error or $undefined):
2590 Update.
2591 (Default %printer and %destructor are not for $accept): Update.
2592 (Default %printer and %destructor for mid-rule values): Extend.
2593 * tests/input.at (Default %printer and %destructor redeclared): Extend.
2594 (Unused values with default %destructor): Extend.
2595
2596 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2597
2598 Don't apply the default %destructor/%printer to an unreferenced midrule
2599 value. Mentioned at
2600 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
2601 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
2602 like $@n instead of just @n so that the default %destructor/%printer
2603 logic doesn't see them as user-defined symbols.
2604 (symbol_is_dummy): Check for both forms of the name.
2605 * src/reader.c (packgram): Remove the `$' from each midrule symbol
2606 name for which the midrule value is referenced in any action.
2607 * tests/actions.at (Default %printer and %destructor for mid-rule
2608 values): New test.
2609 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
2610 for change to dummy symbol names.
2611
2612 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2613
2614 Warn about unset midrule $$ if the corresponding $n is used.
2615 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
2616 $n usage.
2617 (packgram): Before invoking grammar_rule_check on any rule, make sure
2618 all actions have already been scanned in order to set `used' flags.
2619 Otherwise, checking that a midrule's $$ is set will not always work
2620 properly because the midrule check must forward-reference the midrule's
2621 parent rule.
2622 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
2623 warning.
2624
2625 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2626
2627 More improvements to the documentation of the prologue alternatives:
2628 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
2629 Bison manual.
2630 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
2631 some text to clarify the relative importance of the new directives and
2632 to show how these directives may be viewed as code labels.
2633
2634 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
2635
2636 Similar to the recently removed %before-header, add %code-top as the
2637 alternative to the pre-prologue. Mentioned at
2638 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
2639 Also, let the prologue alternatives appear in the grammar section.
2640 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
2641 (prologue_declaration): Move the existing prologue alternatives to...
2642 (grammar_declaration): ... here and add %code-top.
2643 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
2644
2645 Clean up and extend documentation for the prologue alternatives.
2646 * NEWS (2.3a+): Describe prologue alternatives.
2647 * doc/bison.texinfo (Prologue): Move discussion of prologue
2648 alternatives to...
2649 (Prologue Alternatives): ... this new section, and extend it to discuss
2650 all 4 directives in detail.
2651 (Table of Symbols): Clean up discussion of prologue alternatives and
2652 add %code-top.
2653
2654 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2655
2656 DJGPP specific issues.
2657
2658 * djgpp/config.bat: config.hin has been moved to lib. Adjust
2659 config.bat accordingly.
2660 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
2661 * djgpp/config.site: Likewise.
2662
2663 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
2664
2665 Replace %*-header with %provides, %requires, %code. See discussion at
2666 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
2667
2668 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
2669 (b4_user_start_header): Remove.
2670 * data/glr.c: Use new macros instead of b4_*start_header
2671 and b4_*end_header.
2672 * data/glr.cc: Likewise.
2673 * data/lalr1.cc: Likewise.
2674 * data/push.c: Likewise.
2675 * data/yacc.c: Likewise.
2676
2677 * doc/bison.texinfo: Remove %before-header, rename
2678 %{start,end,after}-header to %requires, %provides, %code.
2679
2680 * src/parse-gram.y: Likewise (also rename token names accordingly).
2681 * src/scan-gram.l: Likewise.
2682 * tests/actions.at: Likewise.
2683
2684 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
2685
2686 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
2687 Problem reported by Joel E. Denny.
2688
2689 2006-10-14 Jim Meyering <jim@meyering.net>
2690
2691 (Sync from coreutils.)
2692 Work also when the working directory (with e.g. coreutils sources)
2693 is version controlled with git, rather than CVS.
2694 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
2695 rather than CVS.
2696 In messages and comments, say e.g., "checked-out sources",
2697 rather than "CVS sources".
2698 (version_controlled_file): New function. Work for git as well as
2699 for CVS. Don't use grep's -q option.
2700 (slurp): Call it here, in place of CVS-specific code.
2701
2702 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
2703
2704 Fix testsuite for ./configure --enable-gcc-warnings:
2705 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
2706 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
2707 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
2708 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
2709 * test/regression.at (Diagnostic that expects two alternatives):
2710 Likewise.
2711
2712 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
2713
2714 * bootstrap.conf (gnulib_modules): Add config-h.
2715 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
2716 worry about HAVE_CONFIG_H.
2717 * lib/abitset.c: Likewise.
2718 * lib/bitset.c: Likewise.
2719 * lib/bitset_stats.c: Likewise.
2720 * lib/bitsetv-print.c: Likewise.
2721 * lib/bitsetv.c: Likewise.
2722 * lib/ebitset.c: Likewise.
2723 * lib/get-errno.c: Likewise.
2724 * lib/lbitset.c: Likewise.
2725 * lib/subpipe.c: Likewise.
2726 * lib/timevar.c: Likewise.
2727 * lib/vbitset.c: Likewise.
2728 * lib/bitset.c: Include "bitset.h" first, to test interface.
2729 * lib/bitset_stats.c: Include "bitset_stats.h" first.
2730 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
2731 * lib/bitsetv.c: Include "bitsetv.h" first.
2732 * lib/get-errno.c: Include "get-errno.h" first.
2733 * m4/.cvsignore: Add config-h.m4.
2734 * tests/actions.at (Default %printer and %destructor for ...):
2735 Adjust expected line numbers in output to reflect removal of #if
2736 HAVE_CONFIG_H lines.
2737 * tests/glr-regression.at (Missed %merge type warnings when ...):
2738 Likewise.
2739 * tests/regression.at (Braced code in declaration in rules section):
2740 Likewise.
2741 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
2742 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
2743 Include <config.h> unconditionally.
2744
2745 * bootstrap: Sync from coreutils, as follows:
2746
2747 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2748
2749 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
2750 variable was sometimes used without being initialized. This
2751 messed up the installation of the INSTALL file in some cases.
2752
2753 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2754
2755 * bootstrap (usage, main program, symlink_to_gnulib): Add option
2756 --copy. Inspired by a suggestion from Bruno Haible.
2757
2758 2006-10-03 Jim Meyering <jim@meyering.net>
2759
2760 * bootstrap: Undo last change to this file, since now gnulib-tool
2761 sticks with the automake default in generating dependencies.
2762
2763 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
2764
2765 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
2766 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
2767
2768 * doc/bison.1: Add copyright notice.
2769
2770 * data/glr.c: Don't include <stdarg.h>; not used.
2771
2772 * NEWS: The -g and --graph options now output graphs in Graphviz
2773 DOT format, not VCG format.
2774 * doc/bison.1: Likewise.
2775 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
2776 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
2777 of this change in
2778 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
2779 * TODO: Remove Graphviz entry.
2780 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
2781 remove vcg.c, vcg.h, vcg_defaults.h.
2782 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
2783 * src/graphviz.c, src/graphviz.h: New files.
2784 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
2785 * src/files.h: Make comment more generic.
2786 * src/main.c (main): Likewise.
2787 * src/print_graph.h: Likewise.
2788 * src/getargs.c (usage): Make usage description more generic.
2789 * src/print_graph.c: Include graphviz.h rather than vcg.h.
2790 (static_graph, fgraph): Remove. All uses changed to pass
2791 arguments instead of sharing a static var.
2792 (print_core, print_actions, print_state, print_graph):
2793 Output graphviz format rather than VCG format.
2794 * tests/.cvsignore: Remove *.vcg; add *.dot.
2795 * tests/output.at: Expect *.dot files, not *.vcg files.
2796
2797 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
2798 accommodates the 2006-10-08 change.
2799
2800 2006-10-11 Bob Rossi <bob@brasko.net>
2801
2802 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
2803 (b4_yyssa, b4_yyerror_range): New macros.
2804 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
2805 (yypvarsinit): Remove init of removed fields.
2806 (yypushparse): Remove use of removed fields; use new macros instead.
2807
2808 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
2809
2810 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
2811 in a push parser. Reindent slightly to match yacc.c better.
2812
2813 2006-10-11 Bob Rossi <bob@brasko.net>
2814
2815 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
2816 yymsg_alloc fields.
2817 (yypvarsinit, yypushparse): Remove init of removed fields.
2818 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
2819
2820 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
2821
2822 * THANKS: Add Paolo Bonzini and Bob Rossi.
2823
2824 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
2825
2826 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
2827 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
2828 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
2829 b4_define_user_cde and uses): Remove.
2830 (b4_comment, b4_prefix, b4_sync_start): New.
2831 * data/bison.m4: New file, with most of the content removed from c.m4.
2832 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
2833 * src/output.c (output_skeleton): Pass bison.m4.
2834 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
2835 only if specified.
2836
2837 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
2838
2839 Fix test failure reported by Tom Lane in
2840 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
2841 and try to make such failures easier to catch in the future.
2842 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
2843 that's now the caller's responsibility.
2844 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
2845 Set yychar = YYEOF if it's negative.
2846 * tests/actions.at (yylex): Abort if asked to read past EOF.
2847 * tests/conflicts.at (yylex): Likewise.
2848 * tests/cxx-type.at (yylex): Likewise.
2849 * tests/glr-regression.at (yylex): Likewise.
2850 * tests/input.at (yylex): Likewise.
2851 * tests/regression.at (yylex): Likewise.
2852 * tests/torture.at (yylex): Likewise.
2853
2854 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
2855
2856 Fix problems with translating English-language diagnostics.
2857 * bootstrap: Fix bug introduced in recent bootstrap changes, with
2858 respect to bison-runtime pot generation. The YY_ stuff
2859 wasn't being captured.
2860 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
2861 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
2862 * runtime-po/POTFILES.in: Add data/push.c.
2863
2864 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
2865
2866 Merge bootstrap changes from coreutils.
2867
2868 2006-09-28 Jim Meyering <jim@meyering.net>
2869
2870 Automatically generated dependencies are important even
2871 when all of the sources in a directory come from gnulib.
2872 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
2873 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
2874
2875 2006-09-23 Jim Meyering <jim@meyering.net>
2876
2877 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
2878
2879 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2880
2881 * bootstrap: Add support for --force.
2882 (usage): New function. Describe usage less tersely.
2883 (CVS_only_file): New var.
2884
2885 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
2886
2887 * data/push.c (YYPUSH_MORE): Make it an enum instead.
2888 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
2889 Adjust white space and comments to match GNU style better.
2890
2891 2006-09-20 Bob Rossi <bob@brasko.net>
2892
2893 * data/push.c (yyresult_get): Remove function.
2894 (YYPUSH_MORE): Add #define.
2895 (yypushparse): Modify return value.
2896
2897 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2898
2899 * stamp-h.in: Remove; no longer needed.
2900 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
2901 Remove config.h, config.hin, intl (no longer created).
2902 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
2903 stamp-h1.
2904
2905 Sync bootstrap from coreutils, as follows:
2906
2907 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
2908
2909 * bootstrap (symlink_to_gnulib): New function.
2910 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
2911 to copies-of-gnulib.
2912 (cp_mark_as_generated, slurp, gnulib_files):
2913 Avoid making a copy if it's the same as the old version.
2914 (gnulib_files): Add support for this variable (used by Bison).
2915
2916 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
2917
2918 * src/getargs.c (usage): Rework to use conventions similar to
2919 coreutils, to make translation a bit easier and the code a bit
2920 smaller. Problem reported by Tim Van Holder.
2921
2922 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
2923
2924 Use some of gnulib's new modules, taken from coreutils.
2925
2926 * bootstrap: Sync from coreutils, except add support for gnulib_files.
2927 * bootstrap.conf: New file.
2928 (gnulib_modules): Add configmake, inttypes, unistd.
2929 (XGETTEXT_OPTIONS): Add complain, complain_at,
2930 fatal, fatal_at, warn, warn_at, unexpected_end.
2931 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
2932 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
2933 (gl_EARLY): Add.
2934 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
2935 (gl_INIT): Add
2936 (GNULIB_AUTOCONF_SNIPPET): Remove.
2937 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
2938 the pickiest.
2939 * lib/.cvsignore: Add inttypes_.h.
2940 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
2941 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
2942 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
2943 no-longer-necessary initializations.
2944 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
2945 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
2946 use the unistd module.
2947 * src/system.h: Likewise.
2948 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
2949 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
2950 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
2951 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
2952 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
2953 * src/system.h: Include inttypes.h unconditionally, now that we
2954 use the inttypes module. Don't bother to include stdint.h, since
2955 inttypes.h now does that for us.
2956 (LOCALEDIR): Remove, now that we use the configmake module.
2957 * src/getargs.c: Include configmake.h.
2958 * src/main.c: Likewise.
2959 * src/output.c: Likewise.
2960 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
2961 not from $abs_top_builddir, since config.h moved.
2962
2963
2964 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
2965 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
2966
2967 * src/parse-gram.y (symbol_declaration): Don't put statements
2968 before declarations; it's not portable to C89.
2969 * src/scan-code.l (handle_action_at): Likewise.
2970
2971 * src/scan-code.l: Always initialize braces_level; the old code
2972 left it uninitialized and therefore had undefined behavior.
2973
2974 Don't attempt to redefine 'assert', since it runs afoul of
2975 systems where standard headers (mistakenly) include <assert.h>.
2976 Instead, define and use our own alternative, called 'aver'.
2977 * src/reader.c: Don't include assert.h, since we no longer
2978 use assert.
2979 * src/scan-code.l: Likewise.
2980 * src/system.h (assert): Remove, replacing with....
2981 (aver): New function, taking a bool arg. All uses changed.
2982 * src/tables.c (pack_vector): Ensure that aver arg is bool,
2983 not merely an integer.
2984
2985 2006-09-15 Bob Rossi <bob@brasko.net>
2986
2987 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
2988 * data/c.m4 (YYPUSH): New.
2989 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
2990 * src/getargs.c (push_parser): New var.
2991 * src/getargs.h (push_parser): New declaration.
2992 * src/output.c (prepare): Add macro insertion of `push_flag'.
2993 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
2994 (prologue_declaration): Parse %push-parser.
2995 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
2996 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
2997 list of removed lines from the traces observed.
2998 (AT_CHECK_CALC_LALR): Added push parser tests.
2999
3000 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
3001
3002 * NEWS: Version 2.3a.
3003 * configure.ac (AC_INIT): Likewise.
3004
3005 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
3006 "#define YYSTYPE int" that caused "make maintainer-check" to fail
3007 due to header ordering dependencies. I don't know why the #define
3008 was there.
3009
3010 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
3011 runtime cost when YYDEBUG is not defined, and so that some tests
3012 that used to fail now work. Problem and initial suggestion by
3013 Paolo Bonzini.
3014 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
3015 * data/glr.cc (b4_parser_class_name):
3016 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
3017 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
3018 (yydebug_) [YYDEBUG]: New member.
3019 (yycdebug_): Now defined only if YYDEBUG.
3020 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
3021 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
3022 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
3023 if YYYDEBUG.
3024 (debug_stream, set_debug_stream, debug_level, set_debug_level):
3025 Define only if YYDEBUG.
3026 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
3027 set_debug_level.
3028 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
3029 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
3030 AT_CHECK_CALC_GLR_CC that are working now.
3031
3032 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
3033
3034 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
3035 We don't need them in glr.cc, and glr.c defines them.
3036 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
3037 assumes that defining it to anything is the same as defining
3038 it to 1. Problem reported by Paolo Bonzini.
3039
3040 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
3041
3042 * data/c.m4 (b4_null, b4_case): Define.
3043 * src/output.c (prepare_symbols): Use b4_null.
3044 (user_actions_output): Use b4_case.
3045
3046 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
3047
3048 * data/glr.c (b4_shared_declarations): Put start-header first,
3049 before any #includes that we generate, so that feature-test
3050 macros work. Problem reported by Michael Deutschmann in
3051 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
3052 * data/lalr1.cc: Likewise.
3053 * doc/bison.texinfo (Prologue): Document that feature-test macros
3054 should be defined before any Bison declarations.
3055 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
3056 that depend on location.hh after, not before, Bison decls, since
3057 we now include location.hh after the first user prologue.
3058
3059 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
3060 Sander Brandenburg in
3061 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
3062 Also, fix minor white space and comment issues.
3063 (Prologue): Mention that it's better to define feature-test macros
3064 before Bison declarations. Problem reported by Michael Deutschmann.
3065
3066 * README-cvs: Fix typo: "&" should be "&&". Problem reported
3067 by Jim Meyering.
3068 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
3069 This adjusts to recent gnulib changes.
3070
3071 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3072
3073 Finish implementation of per-type %destructor/%printer. Discussed
3074 starting at
3075 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
3076 and
3077 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
3078 * NEWS (2.3+): Add a description of this feature to the default
3079 %destructor/%printer description.
3080 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
3081 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3082 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
3083 list node contains a semantic type.
3084 * src/symtab.c, src/symtab.h: Extend with a table that associates
3085 semantic types with their %destructor's and %printer's.
3086 (semantic_type_from_uniqstr, semantic_type_get,
3087 semantic_type_destructor_set, semantic_type_printer_set): New functions
3088 composing the public interface of that table.
3089 (symbol_destructor_get, symbol_destructor_location_get,
3090 symbol_printer_get, symbol_printer_location_get): If there's no
3091 per-symbol %destructor/%printer, look up the per-type before trying
3092 the default.
3093 * tests/actions.at (Per-type %printer and %destructor): New test case.
3094 * tests/input.at (Default %printer and %destructor redeclared):
3095 Extend to check that multiple occurrences of %symbol-default in a
3096 single %destructor/%printer declaration is an error.
3097 (Per-type %printer and %destructor redeclared, Unused values with
3098 per-type %destructor): New test cases.
3099
3100 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3101
3102 Require default %destructor/%printer to be declared using
3103 %symbol-default instead of an empty symbol list, and start working on
3104 new per-type %destructor/%printer. Discussed at
3105 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
3106 * NEWS (2.3+): Add %symbol-default to example.
3107 * bison.texinfo (Freeing Discarded Symbols): Likewise.
3108 (Table of Symbols): Add entry for %symbol-default.
3109 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
3110 (generic_symlist, generic_symlist_item): New nonterminals for creating
3111 a list in which each item is a symbol, semantic type, or
3112 %symbol-default.
3113 (grammar_declaration): Use generic_symlist in %destructor and %printer
3114 declarations instead of symbols.1 or an empty list.
3115 (symbol_declaration, precedence_declaration, symbols.1): Update actions
3116 for changes to symbol_list.
3117 * src/reader.c: Update for changes to symbol_list.
3118 * src/scan-code.l: Likewise.
3119 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
3120 * src/symlist.c, src/symlist.h: Extend such that a list node may
3121 represent a semantic type or a %symbol-default in addition to just an
3122 ordinary symbol. Add switched functions for setting %destructor's and
3123 %printer's.
3124 * tests/actions.at, tests/input.at: Add %symbol-default to all default
3125 %destructor/%printer declarations.
3126
3127 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
3128
3129 Whether the default %destructor/%printer applies to a particular symbol
3130 isn't a question of whether the user *declares* that symbol (in %token,
3131 for example). It's a question of whether the user by any means
3132 *defines* the symbol at all (by simply using a char token, for
3133 example). $end is defined by Bison whereas any other token with token
3134 number 0 is defined by the user. The error token is always defined by
3135 Bison regardless of whether the user declares it with %token, but we
3136 may one day let the user define error as a nonterminal instead.
3137 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
3138 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
3139 the meaning of "user-defined".
3140 * tests/actions.at (Default %printer and %destructor for user-declared
3141 end token): Rename to...
3142 (Default %printer and %destructor for user-defined end token): ...
3143 this.
3144
3145 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
3146 computation of whether to apply the default, don't maintain a list of
3147 every Bison-defined symbol. Instead, just check for a first character
3148 of '$', which a user symbol cannot have, and check for the error token.
3149
3150 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
3151
3152 Don't apply the default %destructor or %printer to the error token,
3153 $undefined, or $accept. This change fits the general rule that the
3154 default %destructor and %printer are only for user-declared symbols,
3155 and it solves several difficulties that are described in the new test
3156 cases listed below.
3157 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
3158 * tests/actions.at (Default %printer and %destructor are not for error
3159 or $undefined, Default %printer and %destructor are not for $accept):
3160 New test cases.
3161
3162 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
3163
3164 Allow %start after the first rule.
3165 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
3166 when parsing the first rule.
3167 (check_and_convert_grammar): Search for it here after all grammar
3168 declarations have been parsed. Skip midrules, which have dummy LHS
3169 nonterminals.
3170 * src/symtab.c (symbol_is_dummy): New function.
3171 * src/symtab.h (symbol_is_dummy): Declare it.
3172 * tests/input.at (%start after first rule): New test.
3173
3174 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3175
3176 Redo some of the previous commit: add back the ability to use
3177 non-aliased/undeclared string literals since it might be useful to
3178 those declaring %token-table.
3179 * src/reader.c (check_and_convert_grammar): Undo changes in previous
3180 commit: don't worry about complaints from symbols_pack.
3181 * src/symtab.c (symbol_new, symbol_class_set,
3182 symbol_check_alias_consistency): Undo changes in previous commit: count
3183 each string literal as a new symbol and token, assign it a symbol
3184 number, and don't complain about non-aliased string literals.
3185 (symbols_pack): Since symbol_make_alias still does not decrement symbol
3186 and token counts but does still set aliased tokens to the same number,
3187 symbol_pack_processor now leaves empty slots in the symbols array.
3188 Remove those slots.
3189 * tests/regression.at (Undeclared string literal): Remove test case
3190 added in previous commit since non-aliased string literals are allowed
3191 again.
3192 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
3193 remove unnecessary string literal declarations.
3194 * tests/sets.at (Firsts): Likewise.
3195
3196 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3197
3198 Don't allow an undeclared string literal, but allow a string literal to
3199 be used before its declaration.
3200 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
3201 symbols_pack complained.
3202 * src/symtab.c (symbol_new): Don't count a string literal as a new
3203 symbol.
3204 (symbol_class_set): Don't count a string literal as a new token, and
3205 don't assign it a symbol number since symbol_make_alias does that.
3206 (symbol_make_alias): It's not necessary to decrement the symbol and
3207 token counts anymore. Don't assume that an alias declaration occurs
3208 before any uses of the identifier or string, and thus don't assert that
3209 one of them has the highest symbol number so far.
3210 (symbol_check_alias_consistency): Complain if there's a string literal
3211 that wasn't declared as an alias.
3212 (symbols_pack): Bail if symbol_check_alias_consistency failed since
3213 symbol_pack asserts that every token has been assigned a symbol number
3214 although undeclared string literals have not.
3215 * tests/regression.at (String alias declared after use, Undeclared
3216 string literal): New test cases.
3217 (Characters Escapes, Web2c Actions): Declare string literals as
3218 aliases.
3219 * tests/sets.at (Firsts): Likewise.
3220
3221 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
3222
3223 In the grammar scanner, STRING_FINISH unclosed constructs and return
3224 them to the parser in order to improve error messages.
3225 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
3226 SC_BRACED_CODE, SC_PROLOGUE): Implement.
3227 * tests/input.at (Unclosed constructs): New test case.
3228 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
3229 seen.
3230
3231 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
3232 unused global.
3233
3234 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
3235
3236 Handle string aliases for character tokens correctly.
3237 * src/symtab.c (symbol_user_token_number_set): If the token has an
3238 alias, check and set its alias's user token number instead of its own,
3239 which is set to indicate the alias. Previously, every occurrence of
3240 the character token in the grammar overwrote that alias indicator with
3241 the character code.
3242 * tests/input.at (String aliases for character tokens): New test.
3243
3244 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
3245
3246 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
3247
3248 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
3249
3250 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
3251 to prevent failures when building on older platforms.
3252 Check for autopoint failure.
3253 Set XGETTEXT_OPTIONS to values that check for C format strings,
3254 so that translators are warned about them (this also helps
3255 prevent core dumps).
3256
3257 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
3258 function, since it simplifies our code a bit.
3259
3260 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
3261 rather than -W, so we don't get bogus warnings about sign comparisons.
3262 Add -Wpointer-arith, since that warning is useful (it reports code
3263 that does not conform to C89 and that some compilers reject).
3264 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
3265 since it's no longer needed.
3266
3267 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
3268
3269 Clean up scanners a bit.
3270 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
3271 definitions so gcc won't warn when obstack_for_string is unused.
3272 * src/scan-code.l: config.h and system.h are already #include'd by
3273 scan-code-c.c, so get rid of them here.
3274 * src/scan-gram.l: Likewise.
3275 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
3276 definitions rather than duplicating the rest of it.
3277 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
3278
3279 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
3280
3281 Suppress signed/unsigned comparison warnings for yycheck.
3282 * data/c.m4 (b4_safest_int_type): New macro.
3283 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
3284 a signed int type, cast it to b4_safest_int_type first.
3285 * data/yacc.c: Likewise.
3286 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
3287 also overwritten.
3288
3289 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3290
3291 * doc/bison.texinfo: Fix some typos.
3292
3293 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
3294
3295 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
3296 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
3297
3298 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
3299 the latest gnulib does this a different way.
3300 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
3301 translation was patched, so stop omitting it.
3302
3303 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3304
3305 Enable declaration of default %printer/%destructor. Make the parser
3306 use these for all user-declared grammar symbols for which the user does
3307 not declare a specific %printer/%destructor. Thus, the parser uses it
3308 for token 0 if the user declares it but not if Bison generates it as
3309 $end. Discussed starting at
3310 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
3311 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
3312 and
3313 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
3314 * NEWS (2.3+): Mention.
3315 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
3316 declare a %destructor for a mid-rule's semantic value. It's just
3317 impossible to declare one specific to it.
3318 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
3319 code. Describe default %destructor form.
3320 * src/parse-gram.y (grammar_declaration): Parse default
3321 %printer/%destructor declarations.
3322 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
3323 and symbol_destructor_location_get rather than accessing the destructor
3324 and destructor_location members of struct symbol.
3325 (symbol_printers_output): Likewise but for %printer's.
3326 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
3327 again.
3328 * src/symtab.c (default_destructor, default_destructor_location,
3329 default_printer, default_printer_location): New static global
3330 variables to record the default %destructor and %printer.
3331 (symbol_destructor_get, symbol_destructor_location_get,
3332 symbol_printer_get, symbol_printer_location_get): New functions to
3333 compute the appropriate %destructor and %printer for a symbol.
3334 (default_destructor_set, default_printer_set): New functions to set the
3335 default %destructor and %printer.
3336 * src/symtab.h: Prototype all those new functions.
3337 * tests/actions.at (Default %printer and %destructor): New test to
3338 check that the right %printer and %destructor are called, that they're
3339 not called for $end, and that $$ and @$ work correctly.
3340 (Default %printer and %destructor for user-declared end token): New
3341 test to check that the default %printer and %destructor are called for
3342 a user-declared end token.
3343 * tests/input.at (Default %printer and %destructor redeclared, Unused
3344 values with default %destructor): New tests to check related grammar
3345 warnings and errors.
3346
3347 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3348
3349 Clean up handling of %destructor for the end token (token 0).
3350 Discussed starting at
3351 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
3352 and
3353 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
3354
3355 Make the skeletons consistent in how they pop the end token and invoke
3356 its %destructor.
3357 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
3358 state, which has token number 0, since this would invoke the
3359 %destructor for the end token.
3360 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
3361 until after shifting the end token, or else it won't be popped.
3362 * data/yacc.c (yyparse): Likewise.
3363
3364 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
3365 it's the end token. Upon termination, destroy an unshifted lookahead
3366 even when it's the end token.
3367 * data/lalr1.cc (yy::parser::parse): Likewise.
3368 * data/yacc.c (yyparse): Likewise.
3369
3370 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
3371 value warnings for the end token when the user gives the end token a
3372 %destructor.
3373
3374 * tests/actions.at (Printers and Destructors): Test all the above.
3375
3376 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
3377
3378 Update to latest gnulib and gettext versions.
3379 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
3380 Add fopen-safer.
3381 (gnulib_files): Add m4/warning.m4. Don't worry about files
3382 overwritten by autopoint.
3383 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
3384 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
3385 rejects them.
3386 Don't use autoreconf; instead, invoke autopoint etc. by hand,
3387 so that we can remove the intl files at a better time.
3388 (intl_files_to_remove): Remove aclocal.m4, since it gets
3389 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
3390 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
3391 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
3392 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
3393 Remove datarootdir hack; no longer needed.
3394 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
3395 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
3396 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
3397 strdup.h.
3398 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
3399 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
3400
3401 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
3402
3403 * bootstrap: Adjust to today's change to gnulib-tool by invoking
3404 it with --assume-autoconf='latest-stable'.
3405
3406 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
3407
3408 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
3409 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
3410 YYSTYPE' and `{'.
3411 * src/muscle_tab.h (muscle_grow): Replace the header comments with
3412 those from muscle_tab.c since the old ones are misleading.
3413
3414 2006-07-13 Akim Demaille <akim@epita.fr>
3415
3416 Support %define "KEY" {VALUE}.
3417 * src/scan-code.h, src/scan-code.l (translate_action)
3418 (translate_rule_action, translate_symbol_action, translate_code):
3419 Return char *, not const char *.
3420 * src/parse-gram.y (declaration): Rename as...
3421 (prologue_declaration): this.
3422 (string_content): Remove this nonterminal, use STRING.
3423 (braceless, content, content.opt): New nonterminal.
3424 Use them.
3425 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
3426 as value.
3427 * src/scan-gram.l (getargs.h): Don't include it.
3428
3429 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
3430
3431 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
3432 rather than a for-loop that declares a local bool variable. This
3433 should work around a compatibility problem with a Cray x1e C++
3434 compiler reported by Hung Nguyen in
3435 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
3436 The for-loop was introduced in the 2004-11-17 change but I don't
3437 know why it was needed.
3438
3439 2006-07-12 Akim Demaille <akim@epita.fr>
3440
3441 * data/c.m4: Comment changes.
3442
3443 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
3444
3445 * src/complain.c (error_message, ERROR_MESSAGE): New.
3446 To factor...
3447 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
3448 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
3449
3450 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3451
3452 * NEWS: Instead of %union, you can define and use your own union type
3453 YYSTYPE if your grammar contains at least one <type> tag.
3454 Your YYSTYPE need not be a macro; it can be a typedef.
3455 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
3456 (Union Decl, Decl Summary): Document this.
3457 * data/glr.c (YYSTYPE): Implement this.
3458 * data/glr.cc (YYSTYPE): Likewise.
3459 * data/lalr1.cc (YYSTYPE): Likewise.
3460 * data/yacc.c (YYSTYPE): Likewise.
3461 * src/output.c (prepare): Output tag_seen_flag.
3462 * src/parse-gram.y (declaration, grammar_declaration):
3463 Use 'union_seen' rather than 'typed' to determine whether
3464 %union has been seen, since grammars can now be typed without
3465 %union.
3466 (symbol_declaration, type.opt, symbol_def):
3467 Keep track of whether a tag has been seen.
3468 * src/reader.c (union_seen, tag_seen): New vars.
3469 (typed): remove.
3470 * src/reader.h (union_seen, tag_seen, typed): Likewise.
3471 * src/scan-code.l (untyped_var_seen): New variable.
3472 (handle_action_dollar): Adjust to above changes.
3473 (handle_action_dollar, handle_action_at):
3474 Improve overflow checking for outlandish numbers.
3475 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
3476 avoid new diagnostics generated by above changes.
3477 * tests/regression.at (YYSTYPE typedef): Add test to check
3478 for type tags without %union.
3479
3480 * src/symlist.c (symbol_list_length): Return int, not unsigned
3481 int, since callers expect int. This may need to get revisited
3482 once we have proper integer overflow checking.
3483
3484 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
3485 object is now static.
3486
3487 * src/getargs.c (flags_argmatch): Return void, not int,
3488 to pacify ./configure --enable-gcc-warnings.
3489
3490 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
3491 since last_string is already defined to FLEX_PREFIX (last_string).
3492
3493 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
3494
3495 Implement --warnings/-W.
3496 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
3497 replaced by...
3498 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
3499 Adjust callers.
3500 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
3501 (warnings_args, warnings_types): New.
3502 (getargs, short_options, long_options): Accept -W/--warnings.
3503 Sort the options by alphabetical order, upper case letter right
3504 before its lower case.
3505
3506 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3507
3508 Change %merge result type clash warnings to errors. Discussed at
3509 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
3510 * src/reader.c (record_merge_function_type): Use complain_at.
3511 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3512 declared later): Update test case results.
3513
3514 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
3515
3516 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
3517 to be in alphabetical order.
3518 (trace_args): Spelling fixes.
3519
3520 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3521
3522 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
3523 so they don't collide with user-defined macros.
3524 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
3525 this was never guaranteed, and now that we're using gnulib stdint,
3526 which defines int_fast16_t to long int, the problem is exposed.
3527
3528 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
3529
3530 * data/c.m4 (b4_basename): Simplify a bit, since we don't
3531 need the full POSIX semantics (and weren't implementing them
3532 anyway).
3533
3534 Adjust to Autoconf 2.60 and today's gnulib.
3535 * bootstrap (gnulib_modules): Add stdint.
3536 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
3537 no longer copies it.
3538 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
3539 since stdint needs the former and wcwidth (which is now required
3540 by mbswidth) needs the latter.
3541 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
3542 work around a compatibility glitch between gettext 0.14.6 and
3543 Autoconf 2.60.
3544 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
3545 Do not check for uintptr_t, since new stdint module does the right
3546 thing.
3547 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
3548 Add stdint.h, stdint_.h, wcwidth.h.
3549 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
3550 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
3551 stdint.m4, wchar_t.m4, wcwidth.m4.
3552 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
3553 usual order for ../lib/*.h files.
3554 (file_name_split): Use last_component, not base_name, to adjust
3555 to gnulib changes.
3556 * src/parse-gram.h: Include <strverscmp.h> in the usual order
3557 for ../lib/*.h files.
3558 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
3559 Define unconditionally, since we now assume the stdint module.
3560 * src/scan-skel.l: Include <dirname.h>.
3561 (BASE_QPUTS): Use last_component, not base_name.
3562 * src/system.h: Include <unlocked-io.h> in the usual order
3563 for ../lib/*.h files. Include <stdint.h> unconditionally,
3564 since we now use the stdint module.
3565 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
3566 HAVE_UINTPTR_T, since we now use the stdint module.
3567 (base_name): Remove decl, since files now include <dirname.h>
3568 to get the decl.
3569
3570 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
3571
3572 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
3573 New, default to 1.
3574 * data/yacc.c, data/glr.c, data/location.cc: Use them.
3575 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
3576 default.
3577 * tests/calc.at: Adjust.
3578
3579 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
3580
3581 * data/c.m4 (b4_basename): New.
3582 (b4_syncline): Also output the location of its invocation (from
3583 the skeleton).
3584 (b4_user_action, b4_define_user_action, b4_user_actions)
3585 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
3586 (b4_user_stype): New.
3587 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
3588
3589 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3590
3591 In the grammar file, the first column is 1 not 0 on the first line as
3592 on every other line.
3593 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
3594 * tests/input.at (Torturing the Scanner): Update output.
3595
3596 * src/scan-gram.l (scanner_cursor): Declare it static.
3597
3598 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3599
3600 In warnings, say "previous declaration" rather than "first
3601 declaration".
3602 * src/symtab.c (redeclaration): Do that here.
3603 * src/reader.c (record_merge_function_type): In the case of a result
3604 type clash, report the previous declaration rather than the very first
3605 one in the grammar file.
3606 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3607 declared later): Add a third declaration to check this behavior.
3608 * tests/input.at (Incompatible Aliases): Update output.
3609
3610 2006-06-27 Akim Demaille <akim@epita.fr>
3611
3612 * doc/Doxyfile.in: New.
3613 * doc/Makefile.am: Use it.
3614 * src/lalr.h, src/symtab.h: Initial doxygenation.
3615
3616 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3617
3618 Don't miss %merge result type warnings just because the LHS types are
3619 declared after the %merge. This continues the effort of the previous
3620 patch.
3621 * src/reader.c (get_merge_function): Don't set the merger type yet.
3622 (record_merge_function_type): New function for setting the merger type
3623 and checking for clashes.
3624 (grammar_current_rule_merge_set): Set the location of the %merge for
3625 the current rule.
3626 (packgram): Invoke record_merge_function_type for each rule now that
3627 all symbol type declarations have been parsed.
3628 * src/reader.h (merger_list.type_declaration_location): New member
3629 storing the location of the first %merge from which the type for this
3630 merging function was derived.
3631 * src/symlist.h (symbol_list.merger_declaration_location): New member
3632 storing the location of a rule's %merge, if any.
3633 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3634 declared later): New test to catch the error fixed by the above patch.
3635
3636 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3637
3638 Get action warnings (grammar_rule_check) right even when symbol
3639 declarations appear after the rules. Discussed at
3640 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
3641 and
3642 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
3643 Don't mistake the type of $$ in a midrule to be that of its parent
3644 rule's $$.
3645 * src/reader.c (grammar_current_rule_end): Don't invoke
3646 grammar_rule_check yet since not all symbol declarations may have been
3647 parsed yet.
3648 (grammar_midrule_action): Likewise.
3649 Don't record whether the midrule's $$ has been used yet since actions
3650 haven't been translated yet.
3651 Record the midrule's parent rule and its RHS index within the parent
3652 rule.
3653 (grammar_current_rule_action_append): Don't translate the action yet
3654 since not all symbol declarations may have been parsed yet and, thus,
3655 warnings about types for $$, $n, @$, and @n can't be reported yet.
3656 (packgram): Translate the action and invoke grammar_rule_check now that
3657 all symbol declarations have been parsed.
3658 * src/scan-code.l (handle_action_dollar): Now that this is invoked
3659 after parsing the entire grammar file, the symbol list here in the case
3660 of a midrule is actually the midrule's empty RHS, so reference its
3661 parent rule's RHS where necessary.
3662 On the other hand, now that you can already know it's a midrule, you
3663 aren't forced to think $$ has the same type as its parent rule's $$.
3664 (handle_action_at): In the case of a midrule, reference the parent rule
3665 where necessary.
3666 * src/symlist.c (symbol_list_new): Initialize new midrule-related
3667 members.
3668 (symbol_list_length): Now that this is invoked after all rules have
3669 been parsed, a NULL symbol (rather than a NULL symbol list node)
3670 terminates a rule. symbol_list_print already does this correctly.
3671 * src/symlist.h (symbol_list.midrule_parent_rule,
3672 symbol_list.midrule_parent_rhs_index): New members so that midrules can
3673 remember their relationships with their parents.
3674 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
3675 fixed by the above patch.
3676 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
3677 implementing...
3678 (Unused values): ... this old test case and...
3679 (Unused values before symbol declarations): ... this new test case.
3680 This one is the same as `Unused values' except that all symbol
3681 declarations appear after the rules in order to catch the rest of the
3682 errors fixed by the above patch.
3683
3684 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3685
3686 More cleanup.
3687 * src/reader.c (current_rule): Declare it static since it's no longer
3688 used outside this file.
3689 (grammar_current_rule_action_append): Remove redundant arguments from
3690 translate_rule_action invocation.
3691 * src/reader.h (current_rule): Remove this unused extern.
3692 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
3693 * src/scan-code.l (translate_rule_action): Likewise.
3694
3695 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
3696
3697 Clean up yesterday's patch.
3698 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
3699 to...
3700 * src/reader.c (grammar_current_rule_action_append): ... here for
3701 consistency with grammar_current_rule_symbol_append.
3702 * tests/regression.at (Braced code in declaration in rules section):
3703 Make yyerror and yylex static as usual.
3704
3705 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
3706
3707 Fix bug that mistakes braced code in a declaration in the rules section
3708 to be a rule action. Mentioned at
3709 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
3710 * src/scan-gram.l: Move midrule action detection from the start of the
3711 scanning of any braced code to...
3712 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
3713 action. For readability, use $2 and @2 rather than the equivalent
3714 global variables.
3715 * tests/regression.at (Braced code in declaration in rules section):
3716 New test to catch the error fixed by the above patch.
3717
3718 Work on code readability some.
3719 * src/scan-code.l (current_rule): Get rid of this misleading and
3720 redundant declaration: it's actually extern'ed in reader.h.
3721 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
3722 translate_action): Add a rule argument and use it instead of the global
3723 current_rule.
3724 (translate_rule_action): This already receives current_rule through an
3725 argument, so pass it on to translate_action instead of assigning
3726 current_rule to current_rule.
3727 (translate_symbol_action, translate_code): Pass rule = NULL to
3728 translate_action.
3729
3730 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
3731
3732 Rename %before-definitions to %start-header and %after-definitions to
3733 %end-header. Don't use these declarations to separate pre-prologue
3734 blocks from post-prologue blocks. Add new order-independent
3735 declarations %before-header and %after-header as alternatives to the
3736 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
3737 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
3738 * NEWS (2.3+): Update for these changes.
3739 * data/glr.c (b4_before_definitions): Update to...
3740 (b4_start_header): ... this.
3741 (b4_after_definitions): Update to...
3742 (b4_end_header): ... this.
3743 * data/glr.cc: Likewise.
3744 * data/lalr1.cc: Likewise.
3745 * data/yacc.c: Likewise.
3746 * doc/bison.texinfo (The prologue): Update names, and replace remaining
3747 prologue blocks with %*-header declarations.
3748 (Calc++ Parser): Likewise.
3749 (Decl Summary): Update names.
3750 (Table of Symbols): Update description.
3751 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
3752 (PERCENT_END_HEADER): ... this.
3753 (PERCENT_BEFORE_DEFINITIONS): Update to...
3754 (PERCENT_START_HEADER): ... this.
3755 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
3756 (declaration): Update token names and m4 macro names.
3757 When parsing %end-header and %start-header, invoke translate_code
3758 before muscle_code_grow, and no longer set global booleans to remember
3759 whether these declarations have been seen.
3760 Parse new %after-header and %before-header.
3761 * src/reader.c (before_definitions, after_definitions): Remove.
3762 (prologue_augment): Accept a new bool argument to specify whether to
3763 augment the pre-prologue or post-prologue.
3764 * src/reader.h (before_definitions, after_definitions): Remove these
3765 extern's.
3766 (prologue_augment): Add new bool argument.
3767 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
3768 (PERCENT_END_HEADER): ... this.
3769 (PERCENT_BEFORE_DEFINITIONS): Update to...
3770 (PERCENT_START_HEADER): ... this.
3771 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
3772 * tests/actions.at (Printers and Destructors): Update names.
3773
3774 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
3775
3776 Add comparison operators for C++ location classes. Discussed at
3777 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
3778 * data/c++.m4 (b4_define_location_comparison): New boolean %define
3779 declaration indicating whether filename_type has an operator==. If
3780 filename_type is `std::string', it defaults to `1', `0' otherwise.
3781 * data/location.cc: Iff b4_define_location_comparison is `1', add
3782 operator== and operator!= for class position and for class location.
3783
3784 Some minor fixes.
3785 * src/scan-action.l: Remove unused file.
3786 * src/symtab.c (symbol_printer_set): Use printer_location not
3787 destructor_location.
3788 * src/symtab.h (struct symbol): Replace incorrect source comment for
3789 printer members.
3790 * tests/input.at (Incompatible Aliases): Update output with correct
3791 printer location.
3792
3793 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
3794
3795 Don't put the pre-prologue in the header file. For the yacc.c code
3796 file and the glr.c header and code files, move the pre-prologue before
3797 the token definitions. Add new %before-definitions and
3798 %after-definitions to declare code that will go in both the header file
3799 and code file. Discussed at
3800 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
3801 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
3802 and
3803 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
3804 * NEWS (2.3+): Describe these changes.
3805 * data/glr.c (b4_pre_prologue): Move from within to before...
3806 (b4_shared_declarations): ... this.
3807 Add new b4_before_definitions before b4_token_enums.
3808 Add new b4_after_definitions at the end.
3809 * data/glr.cc (b4_pre_prologue): Replace with...
3810 (b4_before_definitions): ... this in the header file.
3811 (b4_after_definitions): New near the end of the header file.
3812 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
3813 code file right before including the header file.
3814 (b4_before_definitions): New in the previous position of
3815 b4_pre_prologue in the header file.
3816 (b4_after_definitions): New near the end of the header file.
3817 * data/yacc.c: Clean up some m4 quoting especially in the header file.
3818 (b4_token_enums_defines): In the code file, move to right before
3819 YYSTYPE for consistency with the header file.
3820 (b4_before_definitions): New right before b4_token_enums_defines in
3821 both the header and code file.
3822 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
3823 header and code file.
3824 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
3825 of prologues for %union dependencies.
3826 (Decl Summary): In %defines description, mention the effect of
3827 %before-definitions and %after-definitions on the header file.
3828 (Calc++ Parser): Forward declare driver in a %before-definitions rather
3829 than in the pre-prologue so that make check succeeds.
3830 (Table of Symbols): Add entries for %before-definitions and
3831 %after-definitions.
3832 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
3833 %before-definitions.
3834 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
3835 (declaration): Parse those declarations and append to
3836 b4_before_definitions and b4_after_definitions, respectively.
3837 * src/reader.c (before_definitions, after_definitions): New bools to
3838 track whether those declarations have been seen.
3839 (prologue_augment): Add to the post-prologue if %union,
3840 %before-definitions, or %after-definitions has been seen.
3841 * src/reader.h (before_definitions, after_definitions): New extern's.
3842 * src/scan-gram.l: Scan the new declarations.
3843 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
3844 prologue block in a %before-definitions or a %after-definitions based
3845 on whether the %union is declared.
3846 * tests/regression.at (Early token definitions with --yacc, Early token
3847 definitions without --yacc): Move tests for token definitions into the
3848 post-prologue since token names are no longer defined in the
3849 pre-prologue.
3850
3851 2006-06-20 Akim Demaille <akim@epita.fr>
3852
3853 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
3854 (symbol_get): Use it.
3855 * src/parse-gram.y: Use it.
3856
3857 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
3858
3859 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
3860 build succeeds when configured with --enable-gcc-warnings.
3861
3862 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
3863
3864 * src/parse-gram.y (char_name): New function.
3865 (CHAR, STRING, string_content): For %printer, properly escape.
3866 (ID): Prefer fputs to fprintf.
3867 (id): Reindent to be consistent with other rules.
3868 Properly quote char.
3869
3870 The Translation Project changed its way of publishing translations
3871 to maintainers. I haven't received any responses to my request
3872 for supporting the old way, or for documenting the new way. I
3873 have modified 'bootstrap' to use screen scraping
3874 (in this case, HTML scraping). This is unreliable and inelegant,
3875 but I don't see any better way. Yuck.
3876 * bootstrap (TP_URL, WGET_COMMAND): New vars.
3877 (get_translations): New function, which uses HTML scraping to
3878 deduce locations of latest translations.
3879 Use this function to grab both bison and bison-runtime .po files.
3880 Don't bother priming the pump for the runtime-po domain any more,
3881 as it's now translated better than bison is.
3882
3883 2006-06-19 Akim Demaille <akim@epita.fr>
3884
3885 * src/scan-gram.l: No longer "parse" things after `%union' until
3886 `{'. Rather, return a single "%union" token.
3887 No longer make symbols: return strings, and leave the conversion
3888 to symbols to the parser.
3889 (SC_PRE_CODE, token_type): Remove.
3890 * src/parse-gram.y (%union): New field `character'.
3891 Sort tokens.
3892 (CHAR): New token.
3893 (ID, ID_COLON): Now that the scanner no longer makes them
3894 identifiers, adjust all uses to invoke symbol_get.
3895 (id_colon): New, wraps the conversion from string to symbol.
3896 (%union): Accept a possible union_name.
3897 (symbol): Now can be a char.
3898 * data/c.m4 (b4_union_name): Leave a default value.
3899 * data/glr.c, data/yacc.c: Use it.
3900
3901 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
3902
3903 For associating token numbers with token names for "yacc.c", don't use
3904 #define statements unless `--yacc' is specified; always use enum
3905 yytokentype. Most important discussions start at:
3906 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
3907 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
3908 and
3909 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
3910 * NEWS (2.3+): Mention.
3911 * data/c.m4 (b4_yacc_if): New.
3912 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
3913 token #define's.
3914 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
3915 on token name definitions.
3916 * src/getargs.c (usage): Capitalize `Yacc' in English.
3917 * src/output.c (prepare): Define b4_yacc_flag.
3918 * tests/regression.at (Early token definitions): Test that tokens names
3919 are defined before the pre-prologue not just before the post-prologue.
3920 Remove this test case and copy to...
3921 (Early token definitions with --yacc): ... this to test #define's.
3922 (Early token definitions without --yacc): ... and this to test enums.
3923
3924 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
3925
3926 * NEWS: Reword the post-2.3 change to not be so optimistic about
3927 removing the old "look-ahead" spelling.
3928 Update previous look-ahead/lookahead change reports.
3929 * REFERENCES: look-ahead -> lookahead (since that's
3930 what he actually wrote).
3931 * doc/refcard.tex: look ahead -> lookahead,
3932 look-ahead -> lookahead
3933
3934 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
3935
3936 For consistency, use `lookahead' instead of `look-ahead' or
3937 `look_ahead'. Discussed starting at
3938 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
3939 and then at
3940 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
3941 * NEWS: For the next release, note the change to `--report'.
3942 * TODO, doc/bison.1: Update English.
3943 * doc/bison.texinfo: Update English.
3944 (Understanding Your Parser, Bison Options): Document as
3945 `--report=lookahead' rather than `--report=look-ahead'.
3946 * src/conflicts.c: Update English in comments.
3947 (lookahead_set): Rename from look_ahead_set.
3948 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
3949 (resolve_sr_conflict): Rename local look_ahead_tokens to
3950 lookahead_tokens, and update other uses.
3951 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
3952 count_rr_conflicts, conflicts_free): Update uses.
3953 * src/getargs.c (report_args): Move "lookahead" before alternate
3954 spellings.
3955 (report_types): Update uses.
3956 (usage): For `--report' usage description, state `lookahead' spelling
3957 rather than `look-ahead'.
3958 * src/getargs.h (report.report_lookahead_tokens): Rename from
3959 report_look_ahead_tokens.
3960 * src/lalr.c: Update English in comments.
3961 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
3962 (state_lookahead_tokens_count): Rename from
3963 state_look_ahead_tokens_count.
3964 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3965 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
3966 Rename local n_look_ahead_tokens to n_lookahead_tokens.
3967 Update other uses.
3968 Update English in output.
3969 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
3970 * src/print.c: Update English in comments.
3971 (lookahead_set): Rename from look_ahead_set.
3972 (print_reduction): Rename argument lookahead_token from
3973 look_ahead_token.
3974 (print_core, state_default_rule, print_reductions, print_results):
3975 Update uses.
3976 * src/print_graph.c: Update English in comments.
3977 (print_core): Update uses.
3978 * src/state.c: Update English in comments.
3979 (reductions_new): Update uses.
3980 (state_rule_lookahead_tokens_print): Rename from
3981 state_rule_look_ahead_tokens_print, and update other uses.
3982 * src/state.h: Update English in comments.
3983 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
3984 (state_rule_lookahead_tokens_print): Rename from
3985 state_rule_look_ahead_tokens_print.
3986 * src/tables.c: Update English in comments.
3987 (conflict_row, action_row): Update uses.
3988 * tests/glr-regression.at
3989 (Incorrect lookahead during deterministic GLR,
3990 Incorrect lookahead during nondeterministic GLR): Rename
3991 print_look_ahead to print_lookahead.
3992 * tests/torture.at: Update English in comments.
3993 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
3994 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
3995 (Many lookahead tokens): Update uses.
3996 * data/glr.c: Update English in comments.
3997 * lalr1.cc: Likewise.
3998 * yacc.c: Likewise.
3999 * src/conflicts.h: Likewise.
4000 * src/lalr.h: Likewise.
4001 * src/main.c: Likewise.
4002 * src/output.c: Likewise.
4003 * src/parse-gram.c: Likewise.
4004 * src/tables.h: Likewise.
4005 * tests/calc.at: Likewise.
4006
4007 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
4008
4009 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
4010
4011 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
4012
4013 * TODO: Add request from Nelson H. F. Beebe to be able to install
4014 Bison without installing the yacc script.
4015
4016 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4017
4018 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
4019 and yytext if they're already #define'd.
4020 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
4021 * src/scan-code-c.c: ... here.
4022 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
4023 <config.h>.
4024
4025 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4026
4027 Get Bison to build again when configured with --enable-gcc-warnings.
4028 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
4029 missing #include's.
4030 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
4031 loc argument as it shadows a global.
4032 * src/scan-gram.l: Remove stray comma that prevents boundary_set
4033 invocation.
4034
4035 * src/.cvsignore: Add scan-code.c.
4036
4037 2006-06-07 Akim Demaille <akim@epita.fr>
4038
4039 * src/scan-gram.l: Move the "add a trailing ; to actions" code
4040 to...
4041 * src/scan-code.l: here.
4042 * tests/input.at (Torturing the Scanner): Fix another location
4043 error.
4044
4045 2006-06-07 Akim Demaille <akim@epita.fr>
4046
4047 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
4048
4049 2006-06-06 Akim Demaille <akim@epita.fr>
4050
4051 Extract the parsing of user actions from the grammar scanner.
4052 As a consequence, the relation between the grammar scanner and
4053 parser is much simpler. We can also split "composite tokens" back
4054 into simple tokens.
4055 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
4056 * src/scan-gram.l (add_column_width, adjust_location): Move to and
4057 rename as...
4058 * src/location.h, src/location.c (add_column_width)
4059 (location_compute): these.
4060 Fix the column count: the initial column is 0.
4061 (location_print): Be robust to ending column being 0.
4062 * src/location.h (boundary_set): New.
4063 * src/main.c: Adjust to scanner_free being renamed as
4064 gram_scanner_free.
4065 * src/output.c: Include scan-code.h.
4066 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
4067 Use boundary_set.
4068 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
4069 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
4070 which is now, again, a separate token.
4071 Adjust all dependencies.
4072 Whereever actions with $ and @ are used, use translate_code.
4073 (action): Remove this nonterminal which is now useless.
4074 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
4075 (grammar_current_rule_action_append): Use translate_code.
4076 (packgram): Bound check ruleno, itemno, and rule_length.
4077 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
4078 (last_string, last_braced_code_loc, max_left_semantic_context)
4079 (scanner_initialize, scanner_free, scanner_last_string_free)
4080 (gram_out, gram_lineno, YY_DECL_): Move to...
4081 * src/scan-gram.h: this new file.
4082 (YY_DECL): Rename as...
4083 (GRAM_DECL): this.
4084 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
4085 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4086 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4087 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4088 Move these declarations, and...
4089 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
4090 these to...
4091 * src/flex-scanner.h: this new file.
4092 * src/scan-gram.l (rule_length, rule_length_overflow)
4093 (increment_rule_length): Remove.
4094 (last_braced_code_loc): Rename as...
4095 (gram_last_braced_code_loc): this.
4096 Adjust to the changes of the parser.
4097 Move all the handling of $ and @ into...
4098 * src/scan-code.l: here.
4099 * src/scan-gram.l (handle_dollar, handle_at): Remove.
4100 (handle_action_dollar, handle_action_at): Move to...
4101 * src/scan-code.l: here.
4102 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
4103 scan-code.h, scan-code-c.c, scan-gram.h.
4104 (EXTRA_bison_SOURCES): Add scan-code.l.
4105 (BUILT_SOURCES): Add scan-code.c.
4106 (yacc): Be robust to white spaces.
4107
4108 * tests/conflicts.at, tests/input.at, tests/reduce.at,
4109 * tests/regression.at: Adjust the column numbers.
4110 * tests/regression.at: Adjust the error message.
4111
4112 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4113
4114 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4115 Use Akim's wording from
4116 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
4117
4118 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4119
4120 Between Bison releases, manually append `+' to the previous Bison
4121 release number, and use that as a signal to automatically print the
4122 ChangeLog's CVS Id keyword from --version. Discussed starting at
4123 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
4124 * ChangeLog: Add Id header.
4125 * configure.ac (AC_INIT): Append `+' to `2.3'.
4126 * src/.cvsignore: Add revision.c.
4127 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
4128 (BUILT_SOURCES): Add revision.c.
4129 (revision.c): New target rule. This file defines a new global variable
4130 named revision. It initializes it with either the Id from ChangeLog
4131 or, if VERSION doesn't contain `+', with the empty string.
4132 * src/getargs.c (version): Print the value of revision.
4133 * src/revision.h: Extern revision.
4134
4135 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
4136
4137 * NEWS: Version 2.3.
4138 * configure.ac (AC_INIT): Likewise.
4139
4140 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
4141
4142 * data/glr.c (YYRECOVERING): Define to be a function-like macro
4143 with no arguments, not as an object-like macro. This is for
4144 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
4145 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
4146 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
4147 Document this.
4148
4149 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
4150
4151 * src/getargs.c (usage): Back out yesterday's modification of the
4152 --help output so that we don't have to wait for translation before
4153 releasing 2.3.
4154
4155 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
4156
4157 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
4158 Problem reported by Akim Demaille.
4159
4160 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4161
4162 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4163
4164 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
4165
4166 * data/yacc.c (yy_reduce_print): Omit trailing white space in
4167 generated source code. Problem reported by Frans Englich in
4168 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
4169
4170 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
4171
4172 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
4173 shell, not within 'make', so that 'make' by an ordinary builder
4174 (using GNU make) does not worry about configuring gzip. This also
4175 works around a bug reported independently by Keith Thompson and by
4176 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
4177 stderr rather than stdout, messing up the build logs.
4178
4179 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4180
4181 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
4182 to make sure that YYID will never be unused. This fixes a 'make
4183 maintainer-check' failure caused by the recent changes to the 'Trivial
4184 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
4185 not used.
4186 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
4187
4188 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4189
4190 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
4191 state before an empty RHS is always resolved here. Only the location
4192 of that state is guaranteed to be resolved, and that's enough. This
4193 fixes the remaining bug reported by Derek M. Jones in
4194 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4195 * tests/glr-regression.at (Uninitialized location when reporting
4196 ambiguity): Test the above case.
4197 Also, the embedded comments in this test case claim it checks the case
4198 of an empty RHS that has inherited the initial location. However, the
4199 corresponding LHS was already resolved, so yyresolveLocations didn't
4200 actually have reason to modify it. Fix this by forcing
4201 nondeterministic operation at the beginning of the parse.
4202
4203 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
4204
4205 * data/c.m4 (b4_yy_symbol_print_generate):
4206 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
4207 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
4208 of the bugs reported today by Derek M Jones in
4209 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4210 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
4211 defined to be a type name without parens or brackets.
4212 (Location Type): Similarly for YYLTYPE.
4213 * tests/regression.at (Trivial grammars): Put in a test for this
4214 bug that will be caught by 'make maintainer-check' (though not,
4215 alas, by 'make check' unless your compiler is picky).
4216
4217 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
4218
4219 * NEWS: Version 2.2.
4220 * configure.ac (AC_INIT): Likewise.
4221
4222 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
4223
4224 * data/glr.c (yyreportTree): Make room in yystates for the state
4225 preceding the RHS. This fixes the segmentation fault reported by Derek
4226 M. Jones in
4227 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
4228 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
4229 to the user. Reported for yyreportTree by Derek M. Jones later in the
4230 same thread.
4231 * THANKS: Add Derek M. Jones.
4232 Update my email address.
4233 Fix typo in Steve Murphy's name.
4234
4235 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
4236
4237 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
4238 checking against YYLAST that caused the parser to miss a potential
4239 alternative in its diagnostic.
4240 Problem reported by Maria Jose Moron Fernandez in
4241 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
4242 * data/lalr1.cc (yysyntax_error_): Likewise.
4243 * data/yacc.c (yysyntax_error): Likewise.
4244 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
4245 tokens, in case we run into an older C compiler.
4246 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
4247 Use them to check for the off-by-one error fixed above.
4248
4249 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
4250 YYSIZE_T, not size_t.
4251 * tests/regression.at (Trivial grammars): New test, to catch
4252 the error fixed by the above patch.
4253
4254 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4255
4256 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
4257 scheme.
4258 Reported by Steve Murphy.
4259
4260 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4261
4262 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
4263 * data/glr.cc: b4_location_flag is now b4_locations_flag.
4264
4265 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4266
4267 Implement --trace=m4.
4268 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
4269 * src/output.c (output_skeleton): When set, pass -dV to m4.
4270
4271 Factor the handling of flags in m4.
4272 * src/output.c (prepare): Rename the muscle names debug, defines,
4273 error_verbose to debug_flag, defines_flag, error_verbose_flag.
4274 * data/c.m4: Adjust.
4275 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
4276 Use b4_define_flag_if to define other b4_FLAG_if macros.
4277 (b4_location_if): As a consequence, rename as...
4278 (b4_locations_if): this, for consistency.
4279 Adjust all the skeletons.
4280
4281 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4282
4283 * etc/bench.pm: Shorten bench names.
4284
4285 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4286
4287 * src/output.h, src/output.c (error_verbose): Move to...
4288 * src/getargs.h, src/getargs.c: here.
4289 Sort the flags.
4290 Adjust dependencies.
4291
4292 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
4293
4294 * data/c.m4 (b4_copyright): Put the special exception for Bison
4295 skeletons here, so we don't have to put it in each skeleton. All
4296 uses changed. Suggested by Akim Demaille. Also, wrap the
4297 copyright notice, in case it is longer than 80 columns. Replace
4298 comma by newline after title.
4299
4300 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
4301
4302 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
4303 incompatibility, not a bug. Mention that it wasn't fixed as of
4304 flex 2.5.33.
4305
4306 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
4307
4308 * examples/extexi: Enforce the precedence of concatenation over
4309 >>.
4310 Reported by Tommy Nordgren.
4311
4312 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
4313
4314 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
4315 with the member "token".
4316 Reported by Martin Nylin.
4317
4318 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
4319
4320 * data/glr.c: Switch to Bison 2.2 special-exception language in
4321 the copyright notice. Use more-regular format for titles and
4322 copyright notices.
4323 * data/glr.cc: Likewise.
4324 * data/location.cc: Likewise.
4325 * data/yacc.cc: Likewise.
4326 * doc/bison.texinfo (Conditions): Document this.
4327 * NEWS: likewise. Upgrade version to 2.2.
4328
4329 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
4330
4331 * data/glr.cc: Remove dead code.
4332
4333 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
4334
4335 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
4336 that variable and the line breaks the bootstrap. Problem reported
4337 by Juan M. Guerrero.
4338
4339 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
4340
4341 * doc/bison.texinfo (Multiple start-symbols): New.
4342
4343 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
4344
4345 * etc/README, etc/bench.pl: New.
4346
4347 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
4348
4349 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
4350 rule.
4351 Reported by Mickael Labau.
4352 * tests/input.at (Torturing the Scanner): Test it.
4353
4354 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
4355
4356 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
4357 Problem reported by Bob Rossi.
4358
4359 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
4360
4361 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
4362 and didn't really work.
4363 For the index, use @ifnotinfo, not @iftex.
4364 Minor cleanups of spacing and terminology.
4365
4366 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
4367
4368 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
4369 of AT_NAME_PREFIX when %name-prefix is not used.
4370
4371 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
4372
4373 Apply --prefix to C++ skeletons too: they change the namespace.
4374 The test suite already exercize these cases.
4375 * data/c++.m4 (b4_namespace): New.
4376 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
4377 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
4378 * data/yacc.c, data/glr.c: Remove a useless `[]'.
4379 * doc/bison.texinfo: Document it.
4380 (Option Cross Key): Use @multitable in all formats. It looks
4381 nicer, even in TeX outputs.
4382 (Rules): Use the same code whatever the output type is.
4383 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
4384 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
4385 * tests/calc.at: Use it, instead of hard coding `yy'.
4386
4387 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
4388
4389 * TODO: Remove dead items.
4390
4391 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
4392
4393 * doc/FAQ: Remove, merged into...
4394 * doc/bison.texinfo (FAQ): this.
4395 * doc/Makefile.am (EXTRA_DIST): Adjust.
4396
4397 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
4398
4399 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
4400 even if empty.
4401 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
4402 * doc/bison.texinfo (Calc++ Scanner): Use it.
4403
4404 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
4405
4406 Fix two nits reported by twlevo, plus one more that I discovered.
4407
4408 * src/assoc.h (assoc_to_string): Give a name to the arg, as
4409 this is the usual Bison style.
4410 * src/location.h (location_print): Likewise.
4411
4412 * src/reader.h (token_name): Likewise.
4413
4414 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
4415
4416 Fix some nits reported by twlevo.
4417 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
4418 and "POSIX". Use more-modern syntax for URLs. Mention C++
4419 and ask for Java. Don't hardwire OS version numbers. Add
4420 copyright notice.
4421 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
4422 * src/conflicts.c (solved_conflicts_obstack): Now static.
4423
4424 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4425
4426 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
4427 page. Say "you can use it" not "you may use it" as on the web page;
4428 we're describing capabilities not granting permission.
4429
4430 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
4431
4432 * data/glr.c (yyresolveLocations): Rename local variables to avoid
4433 shadowing warnings. Use usual patter for iterating through RHS.
4434 * tests/glr-regression.at
4435 (Uninitialized location when reporting ambiguity):
4436 Modify yylex so that it uses its argument, rather than trying
4437 to rely on ARGSUSED (which doesn't work for gcc with warnings).
4438 const char -> char const.
4439
4440 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
4441 Don't use tabs inside commands; it messes up 'ps'.
4442 Problem reported by twlevo.
4443
4444 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
4445
4446 * tests/glr-regression.at (Uninitialized location when reporting
4447 ambiguity): New test case.
4448 * data/glr.c (yyresolveLocations): New function, which uses
4449 YYLLOC_DEFAULT.
4450 (yyresolveValue): Invoke yyresolveLocations before reporting an
4451 ambiguity.
4452 * doc/bison.texinfo (Default Action for Locations): Note
4453 YYLLOC_DEFAULT's usage for ambiguity locations.
4454 (GLR Semantic Actions): Cross-reference those notes.
4455
4456 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
4457
4458 * tests/glr-regression.at (Leaked semantic values when reporting
4459 ambiguity): Remove unnecessary union and type declarations.
4460 (Leaked lookahead after nondeterministic parse syntax error): New test
4461 case.
4462 * data/glr.c (yyparse): Check for zero stacks remaining before
4463 attempting to shift the lookahead so that you don't lose it.
4464
4465 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4466
4467 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
4468 * tests/glr-regression.at (Leaked semantic values when reporting
4469 ambiguity): New test case.
4470 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
4471 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
4472 now unnecessary yystackp parameter.
4473 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
4474 destructors can be called.
4475
4476 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
4477 in existing testcases.
4478
4479 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4480
4481 Don't leak semantic values for parent RHS when a user action cuts the
4482 parser, and clean up related code a bit.
4483 * tests/glr-regression.at (Leaked merged semantic value if user action
4484 cuts parse): Rename to...
4485 (Leaked semantic values if user action cuts parse): ... this. Add check
4486 for leaked parent RHS values.
4487 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
4488 between an unresolved state (non-empty chain of semantic options) and
4489 an incomplete one (signaled by an empty chain).
4490 (yyresolveStates): Document the interface. Move all manipulation of a
4491 successfully or unsuccessfully resolved yyGLRState to...
4492 (yyresolveValue): ... here so that yyresolveValue always leaves a
4493 yyGLRState with consistent data and thus is easier to understand.
4494 Remove the yyvalp and yylocp parameters since they are always just
4495 taken from the yys parameter. When reporting a discarded merged value
4496 in debugging output, note that it is incompletely merged. Document the
4497 interface.
4498 (yyresolveAction): If resolving any of the RHS states fails, destroy
4499 them all rather than leaking them. Thus, as long as user actions are
4500 written to clean up the RHS correctly, yyresolveAction always cleans up
4501 the RHS of a semantic option. Document the interface.
4502
4503 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
4504
4505 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
4506 led to a segmentation fault in GNU Pascal. Problem reported
4507 by Waldek Hebisch.
4508
4509 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
4510
4511 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
4512 mid-rule action inside a nonterminal symbol in order to declare a
4513 destructor for its semantic value.
4514
4515 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
4516
4517 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
4518 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
4519 __cplusplus && ! defined _STDLIB_H && !
4520 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
4521 defined free))]: Include <stdlib.h> rather than rolling our own
4522 declarations of malloc and free, to avoid problems with
4523 incompatible declarations (using 'throw') C++'s stdlib.h. This
4524 should fix Debian bug 340012
4525 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
4526 reported by Guillaume Melquiond.
4527
4528 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4529
4530 * NEWS: Clarify symbols versus types in unused-value warnings.
4531
4532 * configure.ac (AC_INIT): Bump version number.
4533
4534 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4535
4536 * NEWS: Version 2.1a.
4537 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
4538 since C99 requires this.
4539
4540 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
4541
4542 * m4/c-working.m4: New file.
4543 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
4544
4545 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
4546
4547 * Makefile.maint: Merge from coreutils.
4548
4549 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
4550
4551 More portability fixes for problems summarized by Nelson H. F. Beebe.
4552
4553 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
4554 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
4555 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
4556 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
4557 messes up because C++ code is compiled in 32-bit mode but linked
4558 in 64-bit mode.
4559
4560 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
4561
4562 More portability fixes for problems summarized by Nelson H. F. Beebe.
4563
4564 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
4565 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
4566
4567 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
4568 nodist_PROGRAMS, since we don't need to actually compile the
4569 example if we're just doing a plain 'make'. This avoids bothering
4570 the installer unnecessarily about problems due to weird C++
4571 compilers.
4572
4573 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
4574
4575 More portability fixes for problems summarized by Nelson H. F. Beebe.
4576
4577 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
4578 than #include "...", and compile with -I'.'. The old method was
4579 not portable, according to Posix and the C standard, and it does
4580 not work with Sun C 5.7, where previous #line directives affect
4581 the working directory used in later #include "..." directives.
4582
4583 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4584
4585 Various DJGGP specific issues in /djgpp
4586
4587 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
4588
4589 More portability fixes for problems summarized by Nelson H. F. Beebe.
4590
4591 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
4592 '#include <map>' works and that you can apply ++ to iterators.
4593
4594 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
4595
4596 Work around portability problems summarized by Nelson H. F. Beebe in
4597 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
4598
4599 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4600 that '#include <string>' works.
4601
4602 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
4603 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
4604 "warning: sorry: semantics of inline function static data `const
4605 unsigned char translate_table[262]' are wrong (you'll wind up with
4606 multiple copies)".
4607
4608 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
4609 or, xor to not_, and_, or_, and xor_, respectively. This works
4610 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
4611 random system header somewhere that includes the equivalent of
4612 <iso646.h>.
4613
4614 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
4615 -E" works; it apparently doesn't work with PathScale EKO Compiler
4616 Suite Version 2.0.
4617
4618 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
4619
4620 During deterministic GLR operation, user actions should be able to
4621 influence the parse by changing yychar. To make this easier to fix and
4622 to make glr.c easier to evolve in general, don't maintain yytoken in
4623 parallel with yychar; just compute yytoken when needed.
4624 * tests/glr-regression.at (Incorrect lookahead during deterministic
4625 GLR): Check that setting yychar in a user action has the intended
4626 effect.
4627 * data/glr.c (yyGLRStack): Remove yytokenp member.
4628 (yyclearin): Don't set *yytokenp.
4629 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
4630 yychar rather than *yytokenp to determine the current lookahead.
4631 Compute yytoken locally when needed.
4632 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
4633 point to.
4634
4635 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
4636 after `--report' documentation.
4637
4638 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
4639
4640 * src/parse-gram.y (grammar_declaration): Location of printer
4641 symbol is @1, not list->location. Bug reported by twlevo.
4642 * tests/input.at (Incompatible Aliases): Adjust to above change.
4643
4644 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
4645
4646 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
4647 all the test at once. This makes the output easier to read in the
4648 normal case.
4649
4650 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
4651 got from <http://bro-ids.org/download.html>. The bug is that
4652 when two actions appeared in succession, the second one was
4653 scanned before the first one was added to the grammar rule
4654 as a midrule action. Bison then output the incorrect warning
4655 "parse.y:905.17-906.36: warning: unused value: $3".
4656 * src/parse-gram.y (BRACED_CODE, action): These are no longer
4657 associated with a value.
4658 (rhs): Don't invoke grammar_current_rule_action_append.
4659 (action): Invoke it here instead.
4660 * src/reader.c (grammar_midrule_action): Now extern.
4661 (grammar_current_rule_action_append): Don't invoke
4662 grammar_midrule_action; that is now the scanner's job.
4663 * src/reader.h (last_string, last_braced_code_loc):
4664 (grammar_midrule_action): New decls.
4665 * src/scan-gram.l (last_string): Now extern, sigh.
4666 (last_braced_code_loc): New extern variable.
4667 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
4668 rule already has an action.
4669 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
4670 * tests/input.at (AT_CHECK_UNUSED_VALUES):
4671 Add some tests to check that the above changes fixed the bug.
4672
4673 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
4674
4675 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
4676 All used changed. Check whether the symbol has a destructor,
4677 not whether it is typed.
4678 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
4679 that the values are still reported as unused. All line numbers
4680 adjusted.
4681
4682 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
4683
4684 Work around a bug in bro 0.8, which underparenthesizes its
4685 definition of YYLLOC_DEFAULT.
4686 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
4687 their arguments.
4688 * data/lalr1.cc: Likewise.
4689 * data/yacc.cc: Likewise.
4690
4691 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
4692
4693 Work around a bug in Pike 7.0, and give the Pike folks a
4694 better way to override the usual int widths.
4695 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
4696 user can override the types.
4697 (short): #undef, to work around a bug in Pike 7.0.
4698 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
4699 (union yyalloc.yyss): Use yytype_int16 rather than short.
4700 All uses changed.
4701 (yysigned_char): Remove.
4702 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
4703 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
4704 * tests/regression.at (Web2c Actions): Adjust to above changes.
4705
4706 * src/reader.c (check_and_convert_grammar): New function.
4707 (reader): Close the input file even if something went wrong during
4708 parsing. Minor file descriptor leak reported by twlevo.
4709
4710 * src/assoc.c (assoc_to_string): Use a default: abort (); case
4711 to pacify gcc -Wswitch-default.
4712 * src/scan-gram.l (adjust_location): Use a default: break; case
4713 to pacify gcc -Wswitch-default.
4714 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
4715 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
4716 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
4717 Move these decls to scan-skel.l, since they don't need to be
4718 visible elsewhere.
4719 * src/scan-skel.l: Accept the above decls.
4720 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
4721 is used.
4722
4723 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
4724
4725 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
4726 since we don't want to insist on a version number at the start
4727 of the changelog every time.
4728 * Makefile.maint: Sync from coreutils a bit better.
4729 (sc_trailing_blank): Renamed from sc_trailing_space.
4730 All uses changed.
4731 (sc_no_if_have_config_h, sc_require_config_h):
4732 (sc_prohibit_assert_without_use): New rules.
4733 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
4734 (sc_dd_max_sym_length): Fix leading spaces in rule.
4735 (sc_system_h_headers): Prefix with @.
4736 (sc_useless_cpp_parens, m4-check): Output line numbers.
4737 (changelog-check): Allow version only in head.
4738 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
4739 satisfy new Makefile.maint rule.
4740 * data/glr.c: Likewise.
4741 * data/glr.cc: Likewise.
4742 * data/lalr1.cc: Likewise.
4743 * data/yacc.c: Likewise.
4744 * lib/ebitsetv.c: Likewise.
4745 * lib/lbitset.c: Likewise.
4746 * lib/subpipe.c: Likewise.
4747 * lib/timevar.c: Likewise.
4748 * src/system.h: Likewise.
4749 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
4750 * djgpp/Makefile.maint: Add copyright notice.
4751 * djgpp/README.in: Likewise.
4752 * djgpp/config.bat: Likewise.
4753 * djgpp/config.site: Likewise.
4754 * djgpp/config_h.sed: Likewise.
4755 * djgpp/djunpack.bat: Likewise.
4756 * djgpp/config.sed: Fix copyright notice to match standard format.
4757 * djgpp/subpipe.h: Likewise.
4758 * lib/bitsetv-print.c: Likewise.
4759 * lib/bitsetv.c: Likewise.
4760 * lib/subpipe.h: Likewise.
4761 * lib/timevar.c: Likewise.
4762 * lib/timevar.h: Likewise.
4763 * djgpp/subpipe.c: Use standard recipe for config.h.
4764 * lib/abitset.c: Likewise.
4765 * lib/bitset.c: Likewise.
4766 * lib/bitset_stats.c: Likewise.
4767 * lib/bitsetv-print.c: Likewise.
4768 * lib/bitsetv.c: Likewise.
4769 * lib/ebitsetv.c: Likewise.
4770 * lib/get-errno.c: Likewise.
4771 * lib/lbitset.c: Likewise.
4772 * lib/subpipe.c: Likewise.
4773 * lib/timevar.c: Likewise.
4774 * lib/vbitset.c: Likewise.
4775 * tests/local.at: Likewise.
4776 * src/scan-gram.l: Don't include verify.h, since system.h does
4777 that for us.
4778 * .x-sc_require_config_h: New file.
4779 * .x-sc_unmarked_diagnostics: New file.
4780
4781 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
4782
4783 Be a bit more systematic about using 'abort'.
4784 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
4785 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
4786 Put 'default: abort ();' before some other case, to satisfy older
4787 pedantic compilers.
4788 * lib/bitset_stats.c (bitset_stats_init): Likewise.
4789 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
4790 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
4791 * src/conflicts.c (resolve_sr_conflict): Likewise.
4792 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
4793 (get_decision_str, get_orientation_str, get_node_alignment_str):
4794 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
4795 (get_linestyle_str, get_arrowstyle_str): Likewise.
4796 * src/conflicts.c (resolve_sr_conflict):
4797 Use a default case rather than one for the one remaining enum
4798 value, to catch invalid enum values as well.
4799 * src/lalr.c (set_goto_map, map_goto):
4800 Prefer "assert (FOO);" to "if (!FOO) abort ();".
4801 * src/nullable.c (nullable_compute, token_definitions_output):
4802 Likewise.
4803 * src/reader.c (packgram, reader): Likewise.
4804 * src/state.c (transitions_to, state_new, state_reduction_find):
4805 Likewise.
4806 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
4807 (symbol_pack): Likewise.
4808 * src/tables.c (conflict_row, pack_vector): Likewise.
4809 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
4810 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
4811 * src/system.h: Don't include <assert.h>.
4812 (assert): New macro.
4813
4814 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
4815 (Destructor Decl, Parser Function, Pure Calling):
4816 Describe rules for braces inside C code more carefully.
4817
4818 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
4819
4820 Fix some porting glitches found by Nelson H. F. Beebe.
4821 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
4822 compilers that don't understand that abort () does not return.
4823 * src/state.c (transitions_to): Likewise.
4824 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4825 that '#include <cstdlib>' works.
4826 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
4827 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
4828 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
4829 for the benefit of some pre-C99 compilers.
4830
4831 * bootstrap: Undo changes to gnulib files that autoreconf made.
4832
4833 Minor fixups to get 'make maintainer-check' to work.
4834 * configure.ac: Don't use -Wnested-externs, as it's incompatible
4835 with the new verify.h implementation.
4836 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
4837 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
4838 * data/yacc.c (YYUSE): Likewise.
4839 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
4840 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
4841 * src/parse-gram.y (declaration): Don't pass a string constant
4842 to a function that expects char *, since GCC might complain
4843 about the constant value.
4844 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
4845 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
4846 before #defining them.
4847 * tests/glr-regression.at
4848 (Incorrectly initialized location for empty right-hand side in GLR):
4849 In yyerror, use the msg arg.
4850 (Corrupted semantic options if user action cuts parse):
4851 (Incorrect lookahead during deterministic GLR):
4852 (Incorrect lookahead during nondeterministic GLR):
4853 Don't name a local var 'index'; it shadows string.h's 'index'.
4854
4855 2006-01-19 Akim Demaille <akim@epita.fr>
4856
4857 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
4858 location, not just parts of it.
4859
4860 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
4861
4862 * NEWS: Document the fact that multiple %unions are now allowed.
4863 * doc/bison.texinfo (Union Decl): Likewise.
4864 * TODO: This feature is now implemented, so remove it from
4865 the wishlist.
4866
4867 * Makefile.maint: Merge with coreutils Makefile.maint.
4868 (CVS_LIST): Use build-aux version if available.
4869 (VERSION_REGEXP): New macro.
4870 (syntax-check-rules): Add sc_no_if_have_config_h,
4871 sc_prohibit_assert_without_use, sc_require_config_h,
4872 sc_useless_cpp_parens.
4873 (sc_obsolete_symbols): Check for O_NDELAY.
4874 (sc_dd_max_sym_length): Track coreutils.
4875 (sc_unmarked_diagnostics): Look in all files, not just *.c.
4876 (sc_useless_cpp_parens): New rule.
4877 (news-date-check): Look for version or today's date.
4878 (changelog-check): Don't require version number near head.
4879 (copyright-check): Use current year instead of hardwiring 2005.
4880 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
4881 (announcement): Add --gpg-key-ID.
4882
4883 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
4884 with "file system".
4885
4886 Avoid undefined behavior that addressed just before the start of an
4887 array. Problem reported by twlevo.
4888 * src/reader.c (packgram): Prepend a new sentinel before ritem.
4889 * src/lalr.c (build_relations): Rely on new sentinel.
4890 * src/gram.c (gram_free): Adjust to new sentinel.
4891
4892 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
4893
4894 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
4895 yylookaheadNeeds. All uses updated.
4896 (yysplitStack): Rename local yynewLookaheadStatuses to
4897 yynewLookaheadNeeds.
4898 * data/glr-regression.at (Incorrect lookahead during nondeterministic
4899 GLR): In comments, change `lookahead status' to `lookahead need'.
4900
4901 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4902
4903 * data/glr.c (yysplitStack): A little stylistic rewrite.
4904
4905 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
4906
4907 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
4908
4909 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
4910
4911 * doc/bison.texinfo: Fix some typos.
4912 (GLR Semantic Actions): New subsection discussing special
4913 considerations because GLR semantic actions might be deferred.
4914 (Actions): Mention look-ahead usage of yylval.
4915 (Actions and Locations): Mention look-ahead usage of yylloc.
4916 (Special Features for Use in Actions): Add YYEOF entry and mention it
4917 in the yychar entry.
4918 In the yychar entry, remove mention of the local yychar case (pure
4919 parser) since this is irrelevant information when writing semantic
4920 actions and since it's already discussed in `Table of Symbols' where
4921 yychar is otherwise described as an external variable.
4922 In the yychar entry, don't call it the `current' look-ahead since it
4923 isn't when semantic actions are deferred.
4924 In the yychar and yyclearin entries, add note about deferred semantic
4925 actions.
4926 Add yylloc and yylval entries discussing look-ahead usage.
4927 (Look-Ahead Tokens): When discussing yychar, don't call it the
4928 `current' look-ahead, and do mention yylval and yylloc.
4929 (Error Recovery): Cross-reference `Action Features' when mentioning
4930 yyclearin.
4931 (Table of Symbols): In the yychar entry, don't call it the `current'
4932 look-ahead.
4933 In the yylloc and yylval entries, mention look-ahead usage.
4934
4935 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
4936
4937 * tests/glr-regression.at: Update copyright year to 2006.
4938
4939 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4940
4941 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
4942 use during nondeterministic operation to track which stacks have
4943 actually needed the current lookahead.
4944 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
4945 Allocate, deallocate, resize, and otherwise shuffle space for
4946 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
4947 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
4948 appropriately during nondeterministic operation.
4949 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
4950 members to store the current lookahead to be used by the deferred
4951 user action.
4952 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
4953 from which the RHS is taken. Set the lookahead members of the new
4954 yySemanticOption according to the lookahead status for stack yyk.
4955 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
4956 yyaddDeferredAction.
4957 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
4958 members of yySemanticOption before invoking yyuserAction, and then set
4959 them back to their current values afterward.
4960 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
4961 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
4962 * tests/glr-regression.at: Remove `.' from the ends of recent test case
4963 titles for consistency.
4964 (Leaked merged semantic value if user action cuts parse): In order to
4965 suppress lint warnings, use arguments in merge function, and assign
4966 char value < 128 in main.
4967 (Incorrect lookahead during deterministic GLR): New test case.
4968 (Incorrect lookahead during nondeterministic GLR): New test case.
4969
4970 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4971
4972 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
4973 !yyvaluep as signal that no semantic value is available to print.
4974 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
4975 to print a semantic value.
4976
4977 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
4978
4979 * tests/glr-regression.at: For consistency with my newer test cases,
4980 don't thank myself.
4981
4982 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
4983
4984 * data/glr.c (yyresolveValue): When merging semantic options, if at
4985 least one user action succeeds but a later one cuts the parse, then
4986 destroy the semantic value before returning rather than leaking it.
4987 (yyresolveStates): If a user action cuts the parse and thus
4988 yyresolveValue fails, ignore the (unset) semantic value rather than
4989 corrupting the yyGLRState, and empty the semantic options list since
4990 the user actions should have called all necessary destructors.
4991 Simplify code with YYCHK.
4992 * tests/glr-regression.at (Corrupted semantic options if user action
4993 cuts parse): New test case.
4994 (Undesirable destructors if user action cuts parse): New test case.
4995 Before applying any of this patch, this test case never actually failed
4996 for me... but only because the corrupted semantic options usually
4997 masked this bug.
4998 (Leaked merged semantic value if user action cuts parse): New test
4999 case.
5000
5001 2006-01-05 Akim Demaille <akim@epita.fr>
5002
5003 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
5004
5005 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
5006
5007 * data/c.m4 (b4_c_modern): New macro, with a new provision for
5008 _MSC_VER. Problem reported by Cenzato Marco.
5009 (b4_c_function_def): Use it.
5010 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
5011 b4_c_modern.
5012 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
5013 than rolling our own.
5014
5015 2006-01-04 Akim Demaille <akim@epita.fr>
5016
5017 Also warn about non-used mid-rule values.
5018 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
5019 member.
5020 (symbol_list_new): Adjust.
5021 * src/reader.c (symbol_typed_p): New.
5022 (grammar_rule_check): Use it.
5023 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
5024 Check its rule.
5025 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
5026 Use it.
5027 * tests/actions.at (Exotic Dollars): Adjust.
5028
5029 2006-01-04 Akim Demaille <akim@epita.fr>
5030
5031 * src/reader.c (grammar_midrule_action): If $$ is set in a
5032 mid-rule, move the `used' bit to its lhs.
5033 * tests/input.at (Unused values): New.
5034 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
5035
5036 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
5037
5038 * doc/bison.texinfo (Bison Options): Say more accurately what
5039 --yacc does.
5040 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
5041 about declarations in the grammar when in Yacc mode, as POSIX does
5042 not require a diagnostic when the grammar uses extensions.
5043
5044 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
5045
5046 Warn about dubious constructions like "%token T T".
5047 Reported by twlevo.
5048 * src/symtab.h (struct symbol.declared): New member.
5049 * src/symtab.c (symbol_new): Initialize it to false.
5050 (symbol_class_set): New arg DECLARING, specifying whether
5051 this is a declaration that we want to warn about, if there
5052 is more than one of them. All uses changed.
5053
5054 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
5055 Allow multiple %union directives, whose contents concatenate.
5056 * src/parse-gram.y (grammar_declaration): Likewise.
5057 Use muscle_code_grow, so that we don't need stype_line any more.
5058 All uses changed.
5059
5060 * src/muscle_tab.c (muscle_grow): Fix comment.
5061
5062 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
5063 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
5064 Update copyright year to 2006.
5065
5066 2006-01-03 Akim Demaille <akim@epita.fr>
5067
5068 Have glr.cc pass (some of) the calc.at tests.
5069 * data/glr.cc (b4_parse_param_orig): New.
5070 (b4_parse_param): Improve its definition, and bound it more
5071 clearly in the skeleton.
5072 (b4_epilogue): Append, instead of prepending, in order to keep
5073 #line consistency.
5074 Simplify the generation of auxiliary functions: locations and
5075 purity are mandated.
5076 (b4_global_tokens_and_yystype): Honor it.
5077 * data/location.cc (c++.m4): Don't include it.
5078 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
5079 and AT_SKEL_CC_IF.
5080 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
5081 AT_LALR1_CC_IF.
5082 Be sure to initialize the first position's filename.
5083 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
5084 mandated anyway.
5085 (AT_CHECK_CALC_GLR_CC): New.
5086 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
5087
5088 2006-01-02 Akim Demaille <akim@epita.fr>
5089
5090 * src/output.c (output_skeleton): Don't hard wire the inclusion of
5091 c.m4.
5092 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
5093 * data/glr.cc: Do not include stack.hh.
5094
5095 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5096
5097 * data/glr.c: Reformat whitespace with tabs.
5098 (b4_lpure_formals): Remove this unused m4 macro.
5099 * tests/cxx-type.at: Reformat whitespace with tabs.
5100 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
5101 since it's a member. Rename type to isNterm for clarity.
5102
5103 2005-12-29 Akim <akim@sulaco.local>
5104
5105 Let glr.cc catch up with symbol_value_print.
5106 * data/glr.cc (b4_yysymprint_generate): Replace by...
5107 (b4_yy_symbol_print_generate): this.
5108 (yy_symbol_print, yy_symbol_value_print): Declare them.
5109
5110 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
5111
5112 * src/location.h (boundary): Note that a line or column equal
5113 to INT_MAX indicates an overflow.
5114 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
5115 (rule_length_overflow, increment_rule_length, add_column_width):
5116 New functions.
5117 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
5118 (<SC_BRACED_CODE>"}"):
5119 Use increment_rule_length rather than incrementing it by hand.
5120 (adjust_location, handle_syncline): Diagnose overflow.
5121 (handle_action_dollar, handle_action_at):
5122 Fix bug with monstrosities like $-2147483648.
5123 Remove now-unnecessary checks.
5124 (scan_integer): Verify assumptions and remove now-unnecessary checks.
5125 (convert_ucn_to_byte): Verify assumptions.
5126 (handle_syncline): New arg LOC. All callers changed.
5127 Don't store through a value derived from char const * pointer.
5128
5129 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
5130 GCC warnings.
5131
5132 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
5133
5134 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
5135 Remove unnecessary forward static decls.
5136
5137 2005-12-27 Akim Demaille <akim@epita.fr>
5138
5139 * src/reader.c (grammar_current_rule_check): Also check that $$
5140 is used.
5141 Take the rule to check as argument, hence rename as...
5142 (grammar_rule_check): this.
5143 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
5144 Rename as...
5145 (grammar_rule_begin, grammar_rule_end): these, for consistency.
5146 (grammar_midrule_action, grammar_symbol_append): Now static.
5147 * tests/torture.at (input): Don't rely on the default action
5148 being always performed.
5149 * tests/calc.at: "Set" $$ even when the action is "cut" with
5150 YYERROR or other.
5151 * tests/actions.at (Exotic Dollars): Instead of using unused
5152 values, check that the warning is issued.
5153
5154 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
5155
5156 * NEWS: Improve wording for unused-value warnings.
5157
5158 2005-12-22 Akim Demaille <akim@epita.fr>
5159
5160 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
5161 (b4_yysymprint_generate): Rename as...
5162 (b4_yy_symbol_print_generate): this.
5163 Generate yy_symbol_print instead of yysymprint.
5164 Generate also yy_symbol_value_print, and use it.
5165
5166 2005-12-22 Akim Demaille <akim@epita.fr>
5167
5168 * NEWS: Warn about unused values.
5169 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
5170 a `used' member.
5171 (symbol_list_n_get, symbol_list_n_used_set): New.
5172 (symbol_list_n_type_name_get): Use symbol_list_n_get.
5173 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
5174 * src/reader.c (grammar_current_rule_check): Check that values are
5175 used.
5176 * src/symtab.c (symbol_print): Accept 0.
5177 * tests/existing.at: Remove the type information.
5178 Empty the actions.
5179 Remove useless actions (beware of mid-rule actions: perl -000
5180 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
5181 * tests/actions.at (Exotic Dollars): Use unused values.
5182 * tests/calc.at: Likewise.
5183 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5184 Likewise.
5185
5186 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
5187 rule_useful_p.
5188
5189 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
5190
5191 Undo 2005-12-01 tentative license wording change. The wording is
5192 still being reviewed by the lawyers, and we don't want to wait for
5193 them before publishing a test release. For now, revert to the
5194 previous wording.
5195 * NEWS: Undo 2005-12-01 change.
5196 * data/glr.c: Revert to previous license wording.
5197 * data/glr.cc: Likewise.
5198 * data/lalr1.cc: Likewise.
5199 * data/location.cc: Likewise.
5200 * data/yacc.c: Likewise.
5201
5202 * NEWS: Reword %destructor vs YYABORT etc.
5203 * data/glr.c: Use American spacing, for consistency.
5204 * data/glr.cc: Likewise.
5205 * data/lalr1.cc: Likewise.
5206 * data/yacc.c: Likewise.
5207 * data/yacc.c: Reformat comments slightly.
5208 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
5209 for consistency. Fix some spelling errors and reword recently-included
5210 text slightly.
5211 * tests/cxx-type.at: Cast results of malloc, for C++.
5212
5213 2005-12-21 Joel E. Denny <address@hidden>
5214
5215 * tests/cxx-type.at: Construct a tree, count the parents of shared
5216 nodes, and free each node once and only once. Previously, the memory
5217 for semantic values was leaked instead.
5218
5219 2005-12-21 Joel E. Denny <address@hidden>
5220
5221 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
5222 (yylval, yylloc): If pure, #define to yystackp->yyval and
5223 yystackp->yyloc similar to yychar and yynerrs.
5224 (yyparse): If pure, remove local yylval and yylloc. Add local
5225 yystackp to accommodate pure definitions of yylval and yylloc.
5226 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
5227 yylvalp and yyllocp to &yylval and &yylloc.
5228 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
5229 namespace. Previously, nerrs and char were missing, but lval and lloc
5230 weren't necessary.
5231 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
5232 yylvalp and yyllocp parameters since, if pure, these are now always
5233 accessible through yystackp. If not pure, they are still accessible
5234 globally.
5235 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
5236 `if (YYID (N))' to pacify lint.
5237
5238 2005-12-21 Akim Demaille <akim@epita.fr>
5239
5240 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
5241 destroy the RHS symbols of a rule.
5242 * data/yacc.c (yylen): Initialize to 0.
5243 Keep its value to the number of items to possibly shift.
5244 In particular, a regular successful parse that ends on YYFINAL by
5245 a (internal) YYACCEPT must not have yylen != 0.
5246 (yyerrorlab, yyreturn): Pop the RHS.
5247 Reorder a bit to emphasize the `shifting' bits of code.
5248 (YYPOPSTACK): Now accept a number of items to pop.
5249 * data/lalr1.cc: Likewise.
5250 * data/glr.c: Formatting changes.
5251 Use goto instead of fall through.
5252 * doc/bison.texinfo (Destructor Decl): Complete.
5253
5254 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5255
5256 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5257 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
5258 * djgpp/config.bat: Replace every occurence of the file name
5259 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5260 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5261 * djgpp/config.sed: Replace every occurence of the file name
5262 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5263 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5264 * djgpp/djunpack.bat: DJGPP specific file.
5265 * djgpp/fnchange.lst: DJGPP specific file.
5266 * djgpp/README.in: Add new information about how to unpack the bison
5267 source on MSDOS and other systems which have 8.3 file name restrictions
5268 using djunpack.bat and fnchange.lst.
5269
5270 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
5271
5272 * bootstrap (build_cvs_prefix): Remove; unused.
5273 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
5274 when getting gnulib.
5275
5276 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
5277
5278 * data/glr.c: Reorder typedef declarations for structs to match order
5279 of struct declarations.
5280 Rename yystack everywhere to yystackp except in yyparse where it's not
5281 a pointer.
5282 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
5283 consistency.
5284 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
5285 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
5286 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
5287 lint.
5288
5289 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
5290
5291 * tests/sets.at (Accept): Fix typos in regular expression used to
5292 sed out the final state number.
5293
5294 Work around portability problem on Solaris 10: flex-generated
5295 files include <stdio.h> before <config.h>, which messes up
5296 because the latter defines __EXTENSIONS__. Address the problem
5297 by creating two new little files that include <config.h> first,
5298 then include the flex-generated files. Rewrite everyone else
5299 to include <config.h> first, as well.
5300 * lib/timevar.c: Always include "config.h".
5301 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
5302 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
5303 (EXTRA_bison_SOURCES): New macro.
5304 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
5305 * src/system.h: Don't include config.h.
5306 * src/LR0.c: Include <config.h> first.
5307 * src/assoc.c: Likewise.
5308 * src/closure.c: Likewise.
5309 * src/complain.c: Likewise.
5310 * src/conflicts.c: Likewise.
5311 * src/derives.c: Likewise.
5312 * src/files.c: Likewise.
5313 * src/getargs.c: Likewise.
5314 * src/gram.c: Likewise.
5315 * src/lalr.c: Likewise.
5316 * src/location.c: Likewise.
5317 * src/main.c: Likewise.
5318 * src/muscle_tab.c: Likewise.
5319 * src/nullable.c: Likewise.
5320 * src/output.c: Likewise.
5321 * src/parse-gram.y: Likewise.
5322 * src/print.c: Likewise.
5323 * src/print_graph.c: Likewise.
5324 * src/reader.c: Likewise.
5325 * src/reduce.c: Likewise.
5326 * src/relation.c: Likewise.
5327 * src/state.c: Likewise.
5328 * src/symlist.c: Likewise.
5329 * src/symtab.c: Likewise.
5330 * src/tables.c: Likewise.
5331 * src/uniqstr.c: Likewise.
5332 * src/vcg.c: Likewise.
5333
5334 * src/parse-gram.y: Fix minor problems uncovered by lint.
5335 (current_lhs, current_lhs_location): Now static.
5336 (current_assoc): Remove unused variable.
5337
5338 Cleanups so that Bison-generated parsers have less lint.
5339 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
5340 Prepend /*ARGSUSED*/, for lint's sake.
5341 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
5342 definition if 'lint' is defined.
5343 (YYID): New macro (or function, if lint).
5344 All uses of /*CONSTCOND*/0 replaced by YYID(0).
5345 * data/yacc.c: Likewise.
5346 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
5347 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
5348 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
5349 is C++ only.
5350 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
5351 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
5352 Use YYID(0) rather than 0, for lint.
5353 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
5354 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
5355
5356 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
5357
5358 * tests/glr-regression.at
5359 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5360 Close memory leak reported by twlevo.
5361
5362 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
5363
5364 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
5365 all stacks.
5366 (yyparse): Iterate another stack in order to call user destructors.
5367 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5368 New test case.
5369 (Duplicated user destructor for lookahead): This test now is expected
5370 to succeed.
5371
5372 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
5373
5374 * NEWS: Document the following change.
5375 * data/yacc.c: Say "parser skeleton" rather than "file", since
5376 it's no longer just a file.
5377 * data/glr.c: Grant a special exception for C GLR parsers, that
5378 reads like the already-existing exception for C LALR(1) parsers.
5379 * data/glr.cc: Likewise.
5380 * data/lalr1.cc: Likewise.
5381 * data/location.cc: Likewise.
5382 * data/yacc.c: Reword the "written by" statement to clarify that
5383 it was the parser skeleton, not the entire output file.
5384 * data/glr.c: Written by Paul Hilfinger.
5385 * data/glr.cc: Written by Akim Demaille.
5386 * data/lalr1.cc: Likewise.
5387
5388 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
5389
5390 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
5391 Fix typos in previous change that broke 'make check'.
5392 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
5393 supported in C.
5394 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
5395 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
5396 We can revert this once things settle down.
5397
5398 * src/conflicts.c (conflicts_print): Don't print file name twice
5399 when %expect fails because there were no conflicts.
5400 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
5401 change.
5402 * tests/conflicts.at (%expect not enough, %expect too much):
5403 (%expect with reduce conflicts): Adjust to new behavior.
5404
5405 2005-11-18 Akim Demaille <akim@epita.fr>
5406
5407 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
5408 errors.
5409 * NEWS: Document this.
5410 * doc/bison.texinfo (Expect Decl): Likewise.
5411
5412 2005-11-16 Akim Demaille <akim@epita.fr>
5413
5414 Generalize the display of semantic values and locations in traces.
5415 * data/glr.c (yy_reduce_print): Fix indices (again).
5416 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
5417 literal integers.
5418 * data/lalr1.cc (yyreduce_print): Rename as...
5419 (yy_reduce_print): this.
5420 Display values and locations.
5421 * data/yacc.c (yy_reduce_print): Likewise.
5422 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
5423 (yysymprint): Move higher to be visible from yy_reduce_print).
5424 (yyparse): Adjust.
5425 * tests/calc.at: Adjust the expected length of the traces.
5426
5427 2005-11-14 Akim Demaille <akim@epita.fr>
5428
5429 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
5430 from 1 to N, while values and location start at 0.
5431 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
5432
5433 2005-11-14 Akim Demaille <akim@epita.fr>
5434
5435 * data/glr.c (yy_reduce_print): Fix the $ number.
5436
5437 2005-11-14 Akim Demaille <akim@epita.fr>
5438
5439 "Use" parse parameters.
5440 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
5441 * data/glr.c, data/glr.cc: Use them.
5442 * data/glr.c (YYUSE): Have a C++ definition that supports
5443 non-pointer types.
5444
5445 2005-11-14 Akim Demaille <akim@epita.fr>
5446
5447 * data/glr.c (yyexpandGLRStack): Declare only if defined.
5448
5449 2005-11-14 Akim Demaille <akim@epita.fr>
5450
5451 * data/glr.cc: New.
5452 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5453
5454 2005-11-12 Akim Demaille <akim@epita.fr>
5455
5456 Let position and location be PODs.
5457 * data/location.cc (position::initialize, location::initialize): New.
5458 (position::position, location::location): Define only if
5459 b4_location_constructors is defined.
5460 * data/lalr1.cc (b4_location_constructors): Define it for backward
5461 compatibility.
5462 * doc/bison.texinfo (Initial Action Decl): Use initialize.
5463
5464 2005-11-12 Akim Demaille <akim@epita.fr>
5465
5466 * data/lalr1.cc: Move the body of the ctor and dtor into the
5467 parser file (instead of the header).
5468 Wrap the implementations in a "namespace yy".
5469
5470 2005-11-12 Akim Demaille <akim@epita.fr>
5471
5472 Have glr.c include its header file when created.
5473 * data/glr.c (b4_shared_declarations): New.
5474 Output them verbatim in the parser if !%defines, otherwise
5475 output then in the header file, and include it instead.
5476
5477 2005-11-11 Akim Demaille <akim@epita.fr>
5478
5479 * data/glr.c: Comment changes.
5480
5481 2005-11-11 Akim Demaille <akim@epita.fr>
5482
5483 When yydebug, report semantic and location values for reductions.
5484 * data/glr.c (yy_reduce_print): Report the semantic values and the
5485 locations.
5486 (YY_REDUCE_PRINT): Adjust.
5487 (yyglrReduce): Use them.
5488 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
5489 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
5490 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
5491 traces.
5492
5493 2005-11-10 Akim Demaille <akim@epita.fr>
5494
5495 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
5496 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
5497 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
5498
5499 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
5500
5501 * m4/cxx.m4, examples/Makefile.am: Don't build
5502 examples/calc++ if no C++ compiler is available. (trivial change)
5503
5504 2005-11-09 Akim Demaille <akim@epita.fr>
5505
5506 * src/scan-skel.l: Use a couple of asserts.
5507
5508 2005-11-03 Akim Demaille <akim@epita.fr>
5509
5510 In some (weird) cases, the final state number is incorrect.
5511 Reported by Alexandre Duret-Lutz.
5512 * src/LR0.c (state_list_append): Remove the computation of
5513 final_state.
5514 (save_reductions): Do it here.
5515 (get_state): Alpha conversion.
5516 (generate_states): Use a for loop.
5517 * src/gram.h (item_number_is_rule_number)
5518 (item_number_is_symbol_number): New.
5519 * src/state.c: Use assert.
5520 * src/system.h: Include assert.h.
5521 * tests/sets.at (Accept): New.
5522
5523 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5524
5525 * data/glr.c (yyfill): Adjust comment.
5526 (yyresolveAction): Initialize default location properly
5527 for empty right-hand sides.
5528 (yydoAction): Ditto.
5529 Add comment explaining apparently dead code.
5530 * tests/glr-regression.at
5531 (Incorrectly initialized location for empty right-hand side in GLR):
5532 New test.
5533
5534 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
5535
5536 * bootstrap (cleanup_gnulib): New function. Use it to clean up
5537 gnulib when interrupted. This fixes some race conditions and
5538 works around some portability problems (one noted by Paul
5539 Hilfinger).
5540
5541 2005-10-22 Akim <akim@epita.fr>
5542
5543 * Makefile.cfg: Adjust to config -> build-aux.
5544 Reported by twledo.
5545
5546 2005-10-21 Akim Demaille <akim@epita.fr>
5547
5548 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
5549 the %parse-params.
5550 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
5551 * data/yacc.c (b4_Pure_if): Rename as...
5552 (b4_yacc_pure_if): this.
5553 (YY_SYMBOL_PRINT, yyparse): Adjust.
5554 * doc/bison.texinfo: Formatting changes.
5555
5556 2005-10-21 Akim Demaille <akim@epita.fr>
5557
5558 Finish the transition config -> build-aux.
5559 * configure.ac, Makefile.am: Use build-aux.
5560 * config/prev-version, config/announce-gen, config/Makefile.am:
5561 Move to...
5562 * build-aux/prev-version, build-aux/announce-gen,
5563 * build-aux/Makefile.am: here.
5564
5565 2005-10-14 Akim Demaille <akim@epita.fr>
5566
5567 * examples/calc++/test: Use set -x only when VERBOSE.
5568
5569 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
5570
5571 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
5572 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
5573
5574 2005-10-13 Akim Demaille <akim@epita.fr>
5575
5576 * src/scan-skel.l: Output the base name parts of the parser and
5577 header file names.
5578 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
5579 additional checks.
5580 Use this to exercise C++ outputs in subdirs.
5581 Reported by Oleg Smolsky.
5582
5583 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
5584
5585 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
5586 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
5587 Problem reported by John P. Hartmann.
5588 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
5589 already defined it.
5590
5591 2005-10-12 Akim Demaille <akim@epita.fr>
5592
5593 * src/parse-gram.y (version_check): Exit 63 to please missing
5594 (stands for "version mismatch).
5595 * tests/input.at, doc/bison.texinfo: Adjust.
5596
5597 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
5598
5599 Work around portability problems with Visual Age C compiler
5600 (xlc and xlC_r) reported by John P. Hartmann.
5601 * data/location.cc (initial_column, initial_line): Remove.
5602 All uses replaced by 0 and 1.
5603 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
5604 that xlc complains about.
5605 * src/scan-skel.l (skel_wrap): Likewise.
5606 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
5607 as __STDC__.
5608 * data/yacc.c (YYMODERN_C): New macro, which also looks at
5609 __STDC_VERSION__. Use it everywhere instead of looking at
5610 __STDC__ and __cplusplus.
5611
5612 2005-10-10 Akim Demaille <akim@epita.fr>
5613
5614 * examples/calc++/test: Be quiet unless VERBOSE.
5615
5616 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
5617
5618 * data/c.m4 (yydestruct, yysymprint):
5619 Use YYUSE instead of casting to void.
5620 * data/glr.c (YYUSE): New macro.
5621 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5622 Use it instead of rolling our own.
5623 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5624 (YYCHK1):
5625 Use /*CONSTCOND*/ to suppress lint warnings.
5626 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5627 (YY_STACK_PRINT): Use 'false' not '0'.
5628 (YYUSE): New macro.
5629 (yysymprint_, yydestruct_): Use it instead of rolling our own.
5630 * data/yacc.c (YYUSE): New macro.
5631 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
5632 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
5633 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
5634
5635
5636 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
5637 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
5638
5639 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
5640
5641 Undo the parts of the unlocked-I/O change that substituted
5642 putc or puts for printf. This might hurt performance a bit,
5643 but some people prefer the printf style.
5644 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
5645 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
5646 All uses replaced by YYFPRINTF and YYDPRINTF.
5647 * data/yacc.c: Likewise.
5648 * lib/bitset.c (bitset_print): Likewise.
5649 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
5650 putc and puts.
5651 * lib/lbitset.c (debug_lbitset): Likewise.
5652 * src/closure.c (print_firsts, print_fderives): Likewise.
5653 * src/gram.c (grammar_dump): Likewise.
5654 * src/lalr.c (look_ahead_tokens_print): Likewise.
5655 * src/output.c (escaped_output): Likewise.
5656 (user_actions_output): Break apart two printfs.
5657 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
5658 * src/reduce.c (reduce_print): Likewise.
5659 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
5660 * src/system.h: Include unlocked-io.h rathe than stdio.h.
5661
5662 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5663 Use assignments rather than casts-to-void to suppress
5664 unused-variable warnings. This pacifies 'lint'.
5665 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
5666 unused-variable warnings.
5667
5668 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5669
5670 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5671
5672 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
5673
5674 Use unlocked I/O for a minor performance improvement on hosts like
5675 GNU/Linux and Solaris that support unlocked I/O. The basic idea
5676 is to use the gnlib unlocked-io module, and to prefer putc and
5677 puts to printf when either will work (since the latter doesn't
5678 come in an unlocked flavor).
5679 * bootstrap (gnulib_modules): Add unlocked-io.
5680 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
5681 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
5682 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
5683 and similarly for puts and putc and printf.
5684 * data/yacc.c: Likewise.
5685 * lib/bitset.c (bitset_print): Likewise.
5686 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
5687 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
5688 to printf.
5689 * lib/lbitset.c (debug_lbitset): Likewise.
5690 * src/closure.c (print_firsts, print_fderives): Likewise.
5691 * src/gram.c (grammar_dump): Likewise.
5692 * src/lalr.c (look_ahead_tokens_print): Likewise.
5693 * src/output.c (escaped_output): Likewise.
5694 (user_actions_output): Coalesce two printfs.
5695 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
5696 * src/reduce.c (reduce_print): Likewise.
5697 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
5698 * src/system.h: Include unlocked-io.h rather than stdio.h.
5699
5700 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
5701 this confuses xgettext.
5702
5703 2005-10-02 Akim Demaille <akim@epita.fr>
5704
5705 * bootstrap (gnulib_modules): Add strverscmp.
5706 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
5707 * m4/.cvsignore: Add strverscmp.m4.
5708 * src/parse-gram.y (%require): New token, new rule.
5709 (version_check): New.
5710 * src/scan-gram.l (%require): Adjust.
5711 * tests/input.at (AT_REQUIRE): New.
5712 Use it.
5713 * doc/bison.texinfo (Require Decl): New.
5714 (Calc++ Parser): Use %require.
5715
5716 2005-10-02 Akim Demaille <akim@epita.fr>
5717
5718 * data/location.cc: New.
5719
5720 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
5721 Akim Demaille <akim@epita.fr>
5722
5723 Make sure -odir/foo.cc creates dir/location.hh etc.
5724 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
5725 (spec_file_prefix, spec_verbose_file, spec_graph_file)
5726 (spec_defines_file): Now const.
5727 (dir_prefix): New.
5728 (short_base_name): Remove.
5729 * src/files.c: Adjust.
5730 (dirname.h): Include.
5731 (base_name): Don't prototype it.
5732 (finput): Remove, duplicates gram_in.
5733 (full_base_name, short_base_name): Replace by...
5734 (all_but_ext, all_but_tab_ext): these.
5735 (compute_base_names): Rename as...
5736 (compute_file_name_parts): this.
5737 Update to compute the new variables, including dir_prefix.
5738 Adjust dependencies.
5739 * src/output.c (prepare): Output them.
5740 * src/reader.c: Adjust to use gram_in, not finput.
5741 * src/scan-skel.l (@dir_prefix@): New.
5742
5743 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5744
5745 * lib/subpipe.c: New function end_of_output_subpipe() added
5746 to allow support for non-posix systems. This is a no-op function
5747 for posix systems.
5748
5749 * lib/subpipe.h: New function end_of_output_subpipe() added
5750 to allow support for non-posix systems. This is a no-op function
5751 for posix systems.
5752
5753 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
5754 handle the lack of pipe/fork functionality on non-posix systems.
5755
5756 * djgpp/Makefile.maint: DJGPP specific file.
5757
5758 * djgpp/README.in: DJGPP specific file.
5759
5760 * djgpp/config.bat: DJGPP specific configuration file.
5761
5762 * djgpp/config.sed: DJGPP specific configuration file.
5763
5764 * djgpp/config.site: DJGPP specific configuration file.
5765
5766 * djgpp/config_h.sed: DJGPP specific configuration file.
5767
5768 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
5769
5770 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
5771
5772 2005-10-02 Akim Demaille <akim@epita.fr>
5773
5774 * data/location.cc: New, extract from...
5775 * data/lalr1.cc: here.
5776 (location.hh): Include it after the user prologue, in case the
5777 filename type is defined by the user.
5778 Forward declation location and position before the pre-prologue.
5779 (yyresult_): Rename as...
5780 (yyresult): this, it's a local variable, not an attribute.
5781 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
5782
5783 2005-10-01 Akim Demaille <akim@epita.fr>
5784
5785 * examples/extexi: Restore the #line generation.
5786
5787 2005-09-30 Akim Demaille <akim@epita.fr>,
5788 Alexandre Duret-Lutz <adl@gnu.org>
5789
5790 Move the token type and YYSTYPE in the parser class.
5791 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
5792 (parser::token): New, from the moved free definition of tokens.
5793 (parser::semantic_value): Now a full definition instead of an
5794 indirection to YYSTYPE.
5795 (b4_post_prologue): No longer included in the header file, but
5796 in the implementation file.
5797 * doc/bison.texi (C+ Language Interface): Update.
5798 * src/parse-gram.y: Support unary %define.
5799 * tests/actions.at: Define global_tokens_and_yystype for backward
5800 compatibility until we update the tests.
5801 * tests/calc.at: Idem.
5802 (first_line, first_column, last_line, last_column): Define for lalr1.cc
5803 to simplify the code.
5804
5805 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
5806
5807 Port to SunOS 4.1.4, which lacks strtoul and strerror.
5808 Ah, the good old days! Problem reported by Peter Klein.
5809 * bootstrap (gnulib_modules): Add strerror, strtoul.
5810 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
5811 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
5812
5813 2005-09-29 Akim Demaille <akim@epita.fr>
5814
5815 * data/c.m4 (b4_error_verbose_if): New.
5816 * data/lalr1.cc: Use it.
5817 (YYERROR_VERBOSE_IF): Remove.
5818 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
5819 parser members, replaced by...
5820 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
5821 local variables.
5822 (yysyntax_error_): Takes the state number as argument.
5823 (yyreduce_print_): Use the argument yyrule, not the former
5824 attribute yyn_.
5825
5826 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
5827
5828 * bootstrap (gnulib_modules): Add verify.
5829 * lib/.cvsignore: Add verify.h.
5830 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
5831 * src/system.h (verify): Remove.
5832 Include verify.h instead.
5833 * src/tables.c (tables_generate): Use new API for 'verify'.
5834
5835 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
5836
5837 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
5838 local variables whose names begin with 'yy'.
5839 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
5840 Trivial changes from Joel E. Denny.
5841
5842 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
5843 it itself.
5844 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
5845 don't use alloca any more.
5846
5847 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
5848 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
5849 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
5850 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
5851 to match yacc.c, to test more hosts.
5852
5853 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
5854
5855 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
5856 doesn't affect behavior.
5857 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
5858 Solaris, AIX, MSC.
5859 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
5860 This works a bit better with glibc, if user code has already included
5861 stdlib.h.
5862 * doc/bison.texinfo (Bison Parser): Document that users can't
5863 arbitrarily use malloc and free for other purposes. Document
5864 that <alloca.h> and <malloc.h> might be included.
5865 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
5866 user must declare alloca.
5867
5868 * HACKING (release): Forwarn the Translation Project about
5869 stable releses.
5870
5871 2005-09-20 Akim Demaille <akim@epita.fr>
5872
5873 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
5874
5875 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
5876
5877 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
5878 (YYSTACK_ALLOC_MAXIMUM): Use it.
5879 (yysyntax_error): New function.
5880 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
5881 multiple syntax errors are reported, and alloca is being used.
5882 Instead, reallocate buffers twice as big each time, so that
5883 we waste at most half the allocated memory. Start with a small
5884 (128-byte) buffer that will suffice in most cases anyway.
5885 Use yysyntax_error to do most of the work.
5886
5887 * doc/bison.texinfo (Error Reporting, Table of Symbols):
5888 yynerrs is the number of errors reported, not the number of
5889 errors encountered.
5890
5891 * tests/glr-regression.at (Duplicated user destructor for lookahead):
5892 Mark it as expected to fail.
5893 Cast result of malloc; problem reported by twlevo@xs4all.nl.
5894 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
5895 Don't start user-code symbols with "yy", to avoid name space problems.
5896
5897 2005-09-19 Akim Demaille <akim@epita.fr>
5898
5899 Remove the traits, failed experiment.
5900 It never proved useful, and anyway because of the current
5901 definition, it was not possible to have several specialization of
5902 this traits, making it useless.
5903 * data/lalr1.cc (yy:traits): Remove.
5904 Inline its definitions in the parser class.
5905
5906 2005-09-19 Akim Demaille <akim@epita.fr>
5907
5908 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
5909 least Mac OSX with a /usr/local install of gettext.
5910
5911 2005-09-19 Akim Demaille <akim@epita.fr>
5912
5913 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
5914 and yytoken for similarity with the other skeletons.
5915
5916 2005-09-19 Akim Demaille <akim@epita.fr>
5917
5918 * NEWS, configure.ac: update version number to 2.1a.
5919
5920 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
5921
5922 * NEWS: Version 2.1.
5923
5924 * NEWS: Remove notice of yytname change, since it was never in an
5925 official release.
5926 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
5927 diagnostic.
5928 * src/output.c (prepare): Likewise.
5929 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
5930 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
5931 is not defined. This is an awful hack, but it's enough for now.
5932 All callers changed.
5933 * tests/glr-regression-at (make_value): Args are const pointers now,
5934 to avoid GCC warning.
5935 (Duplicated user destructor for lookahead): New test. Currently
5936 skipped. It fails on my host but I'm not sure it'll always fail.
5937
5938 2005-09-16 Akim Demaille <akim@epita.fr>
5939
5940 * src/symtab.h (struct symbol): Declare the printer and destructor
5941 as const, to avoid accidental calls to free.
5942 (symbol_destructor_set, symbol_printer_set): Adjust.
5943 * src/symtab.c: Adjust.
5944
5945 2005-09-16 Akim Demaille <akim@epita.fr>
5946
5947 * data/c.m4 (b4_token_enums): New.
5948 (b4_token_defines): Rename as...
5949 (b4_token_enums_defines): this.
5950 (b4_token_defines): New, output only the #defines.
5951 * data/yacc.c, data/glr.c: Adjust.
5952 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
5953 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
5954 as default values.
5955
5956 2005-09-16 Akim Demaille <akim@epita.fr>
5957
5958 * data/lalr1.cc (yylex_): Remove, inline its code.
5959 (yyreport_syntax_error_): Remove, replaced by...
5960 (yysyntax_error_): this which returns a string and leaves to the
5961 caller the call to the users' error function.
5962 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
5963 Move from members of the parser object...
5964 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
5965 to local variables of the parse function.
5966
5967 2005-09-16 Akim Demaille <akim@epita.fr>
5968
5969 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
5970 since it's in Bison's name space.
5971
5972 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
5973
5974 * data/glr.c (yyresolveValue): Add default case to pacify
5975 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
5976
5977 * NEWS: Document when yyparse started to return 2.
5978 * doc/bison.texinfo (Parser Function): Document when yyparse
5979 returns 2.
5980
5981 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
5982 (b4_filename_type): Renamed back from b4_file_name_type. All uses
5983 changed.
5984 (class position): file_name -> filename (reverting). All uses changed.
5985
5986 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
5987
5988 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
5989 do anything if $@ exists. This reverts part of the 2005-07-07
5990 patch.
5991
5992 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
5993
5994 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
5995 contains obsolete information and isn't worth distributing as a
5996 separate file anyway.
5997 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
5998 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
5999 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
6000 (yyparse): Abort if user code uses longjmp to throw an unexpected
6001 value.
6002
6003 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
6004
6005 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
6006 Suggested by twlevo@xs4all.nl.
6007
6008 * data/glr.c (YYCHK1): Do not assume YYE is in range.
6009 This avoids a diagnostic from gcc -Wswitch-enum.
6010 Problem reported by twlevo@xs4all.nl.
6011
6012 * doc/bison.texinfo: Don't use "filename", as per GNU coding
6013 standards. Use "file name" or "file" or "name", depending on
6014 the context.
6015 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
6016 not to hack/foo.tab.c.
6017 (Calc++ Top Level): 2nd arg of main is not const.
6018 * data/glr.c: b4_filename -> b4_file_name.
6019 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
6020 All uses changed.
6021 (class position): filename -> file_name. All uses changed.
6022 * data/yacc.c: b4_filename -> b4_file_name.
6023 * lib/bitset.h: filename -> file_name in local vars.
6024 * lib/bitset_stats.c: Likewise.
6025 * src/files.c: Likewise.
6026 * src/scan-skel.l ("@output ".*\n): Likewise.
6027 * src/files.c (file_name_split): Renamed from filename_split.
6028 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
6029
6030 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
6031
6032 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
6033 to accommodate latest gnulib.
6034
6035 * tests/glr-regression.at (Duplicate representation of merged trees):
6036 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
6037
6038 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
6039 needed.
6040
6041 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
6042
6043 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
6044 All uses changed. Invoke user destructor after an error during a
6045 split parse (trivial change from Joel E. Denny).
6046
6047 * tests/glr-regression.at
6048 (User destructor after an error during a split parse): New test case.
6049 Problem reported by Joel E. Denny in:
6050 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
6051
6052 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
6053
6054 * README-cvs: Give URLs for recommended tools.
6055 Mention Gzip version problem, and bootstrapping issues.
6056 Remove troubleshooting section, as it's somewhat obsolete.
6057
6058 * bootstrap (no_cache): New var, to accommodate different wget
6059 variants. Use it instead of '-C off'. Problem reported by
6060 twlevo@xs4all.nl.
6061
6062 * data/glr.c (yydestroyStackItem): New function.
6063 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
6064 debugging information. Problem reported by Joel E. Denny.
6065
6066 2005-08-25 Akim Demaille <akim@epita.fr>
6067
6068 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
6069
6070 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
6071
6072 * data/glr.c (yyrecoverSyntaxError, yyreturn):
6073 Don't invoke destructor on unresolved entries.
6074 * tests/glr-regression.at
6075 (User destructor for unresolved GLR semantic value): New test case.
6076 Problem reported by Joel E. Denny in:
6077 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
6078
6079 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
6080
6081 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
6082 Add strnlen.c.
6083 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
6084 lib-prefix.m4, po.m4.
6085
6086 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
6087 in yydestruct diagnostic, since it might not be an error.
6088 Problem reported by Joel Denny near end of
6089 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6090 * data/lalr1.cc (yyerturn): Likewise.
6091 * data/yacc.c (yyreturn): Likewise.
6092 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
6093
6094 * src/files.c: Remove obsolete FIXME comment.
6095
6096 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
6097 with the other templates, and to fix bogus run-on messages such
6098 as the one reported at the end of
6099 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6100 All callers changed to avoid the newline.
6101 (yyprocessOneStack): Output two lines rather than one, to accommodate
6102 the above change. This changes the debug output format slightly.
6103
6104 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
6105 reported by Joel E. Denny in
6106 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
6107 (trivial change).
6108 * tests/glr-regression.at (Duplicate representation of merged trees):
6109 New test, from Joel E. Denny in:
6110 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
6111 * THANKS: Add Joel E. Denny.
6112
6113 * configure.ac (AC_INIT): Bump to 2.0c.
6114
6115 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
6116
6117 * NEWS: Version 2.0b.
6118
6119 * Makefile.am (SUBDIRS): Put examples before tests, so that
6120 "make check" doesn't finish with "All 1 tests passed".
6121
6122 * tests/regression.at (Token definitions): Don't rely on
6123 AT_PARSER_CHECK for data that contains backslashes. It currently
6124 uses 'echo', and 'echo' isn't portable if its argument contains
6125 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
6126 that the byte '\0xff' is not printable in the C locale; it is,
6127 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
6128 not printable, so use '\0x81' to test.
6129
6130 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
6131 version of GCC, since the macro is used with non-GCC compilers.
6132
6133 Fix core dump reported by Pablo De Napoli in
6134 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
6135 * tests/regression.at (Invalid inputs with {}): New test.
6136 * src/parse-gram.y (token_name): Translate type before using
6137 it as an index.
6138
6139 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
6140 the user's name space. All uses changed to __attribute__
6141 ((__unused__)).
6142 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
6143 Add __attribute__ ((__noreturn__)).
6144
6145 * etc/clcommit: Remove. We weren't using it, and it failed
6146 "make maintainer-distcheck".
6147 * Makefile.maint: Merge from coreutils.
6148 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
6149 (syntax-check-rules): Change list of rules as described below.
6150 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
6151 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
6152 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
6153 (sc_trailing_space): New rules.
6154 (sc_xalloc_h_in_src): Remove.
6155 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
6156 (sc_space_tab, sc_error_exit_success, sc_changelog):
6157 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
6158 (makefile-check, po-check, author_mark_check):
6159 (makefile_path_separator_check, copyright-check):
6160 Use grep -n, to make it easier to find violations.
6161 Use CVS_LIST and CVS_LIST_EXCEPT.
6162 (header_regexp, h_re): Remove.
6163 (dd_c): New macro.
6164 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
6165 (my-distcheck): Use more-modern GCC flags.
6166 (signatures, %.asc): Remove.
6167 (rel-files, announcement): Remove signatures.
6168 Restore old updating code, even though we don't use it, so
6169 that we're the same as coreutils.
6170 (alpha, beta, major): Depend on news-date-check.
6171 Make the upload commands.
6172
6173 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
6174 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
6175 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
6176 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
6177 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
6178 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
6179 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
6180 * tests/sets.at: Likewise.
6181
6182 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
6183 we comment out the Autoconf version number.
6184 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
6185 it's error-prone and "make maintainer-distcheck" rejects it.
6186
6187 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
6188 Indent calls to "error" to pacify "make maintainer-distcheck",
6189 when the calls are not intended to be translated.
6190 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
6191
6192 * src/Makefile.am (DEFS): Use +=, to pacify
6193 "make maintainer-distcheck".
6194 (bison_SOURCES): Add scan-skel.h.
6195 (sc_tight_scope): New rule, from coreutils.
6196
6197 * src/files.c (src_extension, header_extension):
6198 Now static, not extern.
6199 * src/getargs.c (short_options): Likewise.
6200 * src/muscle_tab.c (muscle_table): Likewise.
6201 * src/parse-gram.y (current_class, current_type, current_prec):
6202 Likewise.
6203 * src/reader.c (grammar_end, previous_rule_end): Likewise.
6204 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
6205 * src/main.c (main): Cast bindtextdomain and textdomain calls to
6206 void, to avoid warning when NLS is disabled.
6207 * src/output.c: Include scan-skel.h.
6208 (scan_skel): Remove decl, since scan-skel.h does this.
6209 (output_skeleton):
6210 Indent calls to "error" to pacify "make maintainer-distcheck".
6211 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
6212 * src/reader.h (gram_end, gram_lineno): New decls to pacify
6213 "make maintainer-distcheck".
6214 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
6215 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
6216 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
6217 (skel_lex_destroy, scan_skel): Move these decls to...
6218 * src/scan-skel.h: New file.
6219 * src/uniqstr.c (uniqstr_assert):
6220 Indent calls to "error" to pacify "make maintainer-distcheck".
6221
6222 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
6223 not @VAR@.
6224
6225 * tests/torture.at: Revamp to avoid misuse of atoi that
6226 "make maintainer-distcheck" complained about.
6227
6228 * examples/extexi (message): Don't print a message more than once,
6229 and omit line-number decoration that makes Emacs compile think
6230 that informative messages are worth worrying about.
6231
6232 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
6233
6234 * configure.ac: Update version number.
6235
6236 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
6237 accidentally.
6238 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
6239 autogenerated by the maintainer.
6240 * examples/calc++/.cvsignore: Add *.yy.
6241
6242 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
6243 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6244 * lib/bitsetv.c (bitsetv_alloc): Likewise.
6245
6246 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
6247
6248 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
6249 from maintainer-distcheck about casting the argument of 'free'.
6250
6251 * NEWS: Mention recent yytname changes.
6252 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
6253
6254 * bootstrap: For translations that have not yet been upgraded to
6255 the new runtime-po domain, prime the pump by extracting the
6256 relevant strings from the obsolete translations. This code can be
6257 removed once the bison-runtime domain has been translated by each
6258 team.
6259
6260 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
6261 now that token names are already quoted.
6262
6263 Fix problem reported by Anthony Heading.
6264 * data/glr.c (YYTOKEN_TABLE): New macro.
6265 (yytname): Define if YYTOKEN_TABLE.
6266 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
6267 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
6268 (YYERROR_VERBOSE): Define the same way the other skeletons do.
6269 * src/output.c (prepare_symbols): Output token_table_flag.
6270
6271 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
6272
6273 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
6274 again if the first call fails.
6275
6276 * data/glr.c (yytnamerr): New function.
6277 (yyreportSyntaxError): Use it to dequote most string literals.
6278 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
6279 with other skeletons. All uses changed.
6280 (yytnameerr_): New function.
6281 (yyreport_syntax_error): Use it to dequote most string literals.
6282 * data/yacc.c (yytnamerr): New function.
6283 (yyerrlab): Use it to decode most string literals.
6284 * doc/bison.texinfo (Decl Summary, Calling Convention):
6285 Clarify quoting convention of yytname.
6286 * src/output.c (prepare_symbols): Quote all names. This undoes
6287 the 2005-04-17 change, which is now accomplished (mostly) via
6288 changes in the parsers as described above.
6289 * tests/regression.at (Token definitions, Web2c Actions):
6290 Undo most 2005-04-17 change here, too.
6291
6292 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
6293
6294 Fix more problems reported by twlevo@xs4all.nl.
6295 * tests/cxx-type.at: Don't pipe output of ./types through sed to
6296 remove trailing spaces. This loses the exit status of ./types,
6297 and isn't needed since ./types shouldn't be emitting trailing
6298 spaces.
6299 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
6300 as the stack isn't valid in that case.
6301
6302 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6303 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6304 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6305 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
6306 is used.
6307 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
6308 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6309 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6310 Likewise.
6311
6312 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
6313 overly-picky compilers that reject 'char *foo = "bar";'.
6314
6315 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
6316 to FILE * parameter, not to stderr. This fixes a typo introduced
6317 in the 2005-07-12 change.
6318
6319 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
6320 warnings from GCC 4.
6321
6322 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
6323 (yyglrShiftDefer, yysplitStack):
6324 Remove unused parameters b4_pure_formals. All uses changed.
6325 (yyglrShift): Remove unused parameters b4_user_formals.
6326 All uses changed.
6327 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
6328
6329 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
6330
6331 Destructor cleanups and regularization among the three skeletons.
6332 * NEWS: Document the behavior changes.
6333 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
6334 stack before failing, as the cleanup code will do it for us now.
6335 * data/lalr1.cc (yyerrlab): Likewise.
6336 * data/glr.c (yyparse): Pop everything off the stack before
6337 freeing it, so that destructors get called properly.
6338 * data/lalr1.cc (yyreturn): Likewise.
6339 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
6340 This is more consistent.
6341 * doc/bison.texinfo (Destructor Decl): Mention more reasons
6342 why destructors might be called. 1.875 -> 2.1.
6343 (Destructor Decl, Decl Summary, Table of Symbols):
6344 Some English-language cleanups for %destructor.
6345 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6346 Add output line for destructor of start symbol.
6347 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
6348 because of that same extra output line.
6349
6350 * NEWS: Document minor wording changes in diagnostics of
6351 Bison-generated parsers.
6352 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
6353 Remove unused formals. All uses changed.
6354 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
6355 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
6356 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
6357 Rename yyoverflowab to yyexhaustedlab.
6358 When memory exhaustion occurs during syntax-error reporting,
6359 report it separately rather than in a single diagnostic; this
6360 eases translation.
6361 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
6362 (Memory Exhausted): Renamed from Parser Stack Overflow.
6363 Revamp wording slightly to prefer "memory exhaustion".
6364 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
6365
6366 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
6367
6368 Add i18n support to the GLR skeleton. Partially fix the C++
6369 skeleton; a C++ expert needs to finish this. Remove debugging
6370 msgids; there's little point to having them translated, since they
6371 can be understood only by someone who can read the
6372 (English-language) source code.
6373
6374 Generate runtime-po/bison-runtime.pot automatically, so that we
6375 don't have to worry about garbage getting in that file. We'll
6376 make sure after the next official release that old msgids don't
6377 get lost. See
6378 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
6379
6380 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
6381 Now auto-generated.
6382 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
6383 Fix typos in explanations of the runtime file.
6384 * bootstrap: Change gettext keyword from YYI18N to YY_.
6385 Use standard Makefile.in.in in runtime-po, since we'll arrange
6386 for backward-compatible bison-runtime.po files in a different way.
6387 * data/glr.c (YY_): New macro, from yacc.c.
6388 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
6389 Translate messages intended for users.
6390 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
6391 the wording in the other skeletons. We don't know that the memory
6392 is virtual.
6393 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
6394 Use same method that yacc.c uses.
6395 Don't translate debugging messages.
6396 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
6397 it doesn't work (yet), and requires C++ expertise to fix.
6398 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
6399 Move defn to a more logical place, to be consistent with other
6400 skeletons.
6401 Don't translate debugging messages.
6402 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
6403 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
6404 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
6405 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
6406
6407 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
6408 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
6409 void, not int.
6410 * tests/glr-regression.at (Badly Collapsed GLR States):
6411 Likewise.
6412 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6413 yylex should return 0 at EOF rather than aborting.
6414
6415 Improve tests for stack overflow in GLR parser.
6416 Problem reported by twlevo@xs4all.nl.
6417 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
6418 All uses removed.
6419 (yyStackOverflow): Just longjmp, but with value 2 so that caller
6420 can handle the problem.
6421 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
6422 (yyparse): New local variable yyresult to record the result.
6423 Use result of setjmp to set it, rather than storing itinto
6424 struct.
6425 (yyDone): Remove label.
6426 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
6427 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
6428 if YYABORT is used).
6429 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
6430 yyparse status; put status > 1 into diagnostic.
6431 Check that status==2 works.
6432 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
6433 Use exit status 3 for failure to open (which shouldn't happen).
6434
6435 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
6436
6437 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
6438 1 on syntax error; just let yyparse do its thing.
6439 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
6440 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
6441 (Exploding the Stack Size with Alloca):
6442 (Exploding the Stack Size with Malloc):
6443 Expect exit status 2, not 1, since the parser is supposed to blow
6444 its stack. Problem reported by twlevo@xs4all.nl.
6445
6446 * data/glr.c (yyparse): Don't assume that the initial calls
6447 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
6448 Print a stack-overflow message and fail instead.
6449 Initialize the line-number information before creating the stack,
6450 so that the stack-overflow message can report line zero safely.
6451
6452 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
6453
6454 Fix problems reported by twlevo@xs4all.nl.
6455 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
6456 (yyuserMerge): Provide a default case if b4_mergers is empty.
6457 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
6458 * tests/glr-regression.at
6459 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6460 Add casts to pacify C++ compilers.
6461 * tests/glr-regression.at (Improper merging of GLR delayed action
6462 sets): Declare yylex before using it.
6463 * tests/Makefile.am (maintainer-check-g++): Fix a stray
6464 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
6465 test for valgrind; valgrind is independent of g++.
6466 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
6467 for compatibility with POSIX 1003.1-2001 (if running coreutils).
6468 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
6469 Use a destructor, so that we can expand the stack. Change
6470 YYSTYPE to char * so that we can free it. Cast result of malloc.
6471
6472 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6473
6474 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
6475 a valgrind failure. Problem reported by twlevo@xs4all.nl.
6476
6477 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
6478
6479 * PACKAGING: New file, suggested by Bruno Haible and taken from
6480 similar wording in gettext's PACKAGING file.
6481 * NEWS: Mention PACKAGING.
6482 * Makefile.am (EXTRA_DIST): Add PACKAGING.
6483
6484 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
6485
6486 * NEWS: Document recent i18n improvements.
6487 * bootstrap: Get runtime translations into runtime-po.
6488 Create runtime-po files automatically, if possible.
6489 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
6490 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
6491 does not infringe on the user's name space.
6492 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
6493 * doc/bison.texinfo (Internationalization): Revamp the English
6494 and Texinfo syntax a bit, to try to make it clearer.
6495 (Bison Options, Option Cross Key): Mention --print-localedir.
6496 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
6497 YYENABLE_NLS. Quote a bit more.
6498 * runtime-po/.cvsignore: New file.
6499 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
6500 * runtime-po/Rules-quot: Remove; now created by bootstrap.
6501 * runtime-po/quot.sed: Likewise.
6502 * runtime-po/boldquot.sed: Likewise.
6503 * runtime-po/en@quot.header: Likewise.
6504 * runtime-po/en@boldquot.header: Likewise.
6505 * runtime-po/insert-header.sin: Likewise.
6506 * runtime-po/remove-potcdate.sin: Likewise.
6507 * runtime-po/Makevars: Likewise.
6508 * runtime-po/LINGUAS: Likewise.
6509 * runtime-po/de.po: Likewise; we will rely on the translation project
6510 to maintain this, so "bootstrap" should get it.
6511 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
6512 its value.
6513 * src/main.c (main): Bind the bison-runtime domain, too.
6514
6515 2005-07-12 Bruno Haible <bruno@clisp.org>
6516
6517 * data/yacc.c: Include <libintl.h> when NLS is enabled.
6518 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
6519 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
6520 * runtime-po: New directory.
6521 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
6522 $(DOMAIN).pot-update rule, so that old messages are never dropped.
6523 * runtime-po/Rules-quot: New file, copied from po/.
6524 * runtime-po/quot.sed: Likewise.
6525 * runtime-po/boldquot.sed: Likewise.
6526 * runtime-po/en@quot.header: Likewise.
6527 * runtime-po/en@boldquot.header: Likewise.
6528 * runtime-po/insert-header.sin: Likewise.
6529 * runtime-po/remove-potcdate.sin: Likewise.
6530 * runtime-po/Makevars: New file.
6531 * runtime-po/POTFILES.in: New file.
6532 * runtime-po/LINGUAS: New file.
6533 * runtime-po/bison-runtime.pot: New file.
6534 * runtime-po/de.po: New file.
6535 * m4/bison.m4: New file.
6536 * Makefile.am (SUBDIRS): Add runtime-po.
6537 (aclocaldir, aclocal_DATA): New variables.
6538 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
6539 Define aclocaldir.
6540 * src/getargs.c (usage): Document --print-localedir option.
6541 (PRINT_LOCALEDIR_OPTION): New enum item.
6542 (long_options): Add --print-localedir option.
6543 (getargs): Handle --print-localedir option.
6544 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
6545 (Internationalization): New section.
6546
6547 2005-07-12 Akim Demaille <akim@epita.fr>
6548
6549 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
6550 for consistency with the rest of the code.
6551 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
6552 Add separators.
6553
6554 2005-07-12 Akim Demaille <akim@epita.fr>
6555
6556 * src/parse-gram.y: Use %printer instead of YYPRINT.
6557
6558 2005-07-12 Akim Demaille <akim@epita.fr>
6559
6560 * src/symtab.h, src/symtab.c (symbol_print): New.
6561 * src/symlist.h, src/symlist.c (symbol_list_print): New.
6562 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
6563
6564 2005-07-12 Akim Demaille <akim@epita.fr>
6565
6566 * data/glr.c (b4_syncline): Fix (swap) the definitions of
6567 b4_at_dollar and b4_dollar_dollar.
6568
6569 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
6570
6571 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
6572 and Pennello's paper.
6573
6574 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
6575
6576 * data/yacc.c (yyparse): Undo previous patch. Instead,
6577 set yylsp[0] and yyvsp[0] only if the initial action
6578 sets yylloc and yylval, respectively.
6579
6580 * data/yacc.c (yyparse): In the initial action, set
6581 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
6582 This avoids the use of undefined variables if the initial
6583 action does not set yylloc and/or yylval.
6584
6585 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
6586
6587 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
6588 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
6589 Remove from CVS. These files are automatically generated.
6590 * examples/extexi: Clarify that this file is now part of Bison,
6591 not GNU M4, and that it works with any POSIX-compatible Awk.
6592 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
6593 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
6594 so that we also get calc++-parser.yy. Geneate it.
6595 Use $(AWK), not gawk, since any conforming Awk will do.
6596 Put comment before action, since older 'make' can't handle comment
6597 in action.
6598 $(BUILT_SOURCES): List all built sources, not just some of them.
6599 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
6600 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
6601 $($(calc_sources_generated)): Remove unnecessary test for existence
6602 of target. (This had a shell syntax error anyway; a stray "x".)
6603 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
6604 calc++-parser.yy.
6605 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
6606
6607 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
6608 implied by the other modules.
6609
6610 2005-07-06 Akim Demaille <akim@epita.fr>
6611
6612 Bind examples/calc++ to the package.
6613 * examples/calc++/Makefile: Remove, replaced by...
6614 * examples/calc++/Makefile.am: ... this new file.
6615 * examples/calc++/test: Remove input.
6616 * examples/calc++/compile: Remove.
6617 * examples/Makefile.am: New.
6618 * configure.ac, Makefile.am: Adjust.
6619 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
6620
6621 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
6622
6623 * data/glr.c (yyFail): Drastically simplify; since the format argument
6624 never had any % directives, we can simply pass it to yyerror.
6625 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
6626 be modified later, as that is the usual style in glr.c.
6627 Problems reported by Paul Hilfinger.
6628
6629 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
6630 and size overflow errors.
6631 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
6632 in case the user prolog sets feature-test macros like _GNU_SOURCE.
6633 (YYSIZEMAX): New macro.
6634 (yystpcpy): New function, taken from yacc.c.
6635 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
6636 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
6637 so that we don't have to maintain their signatures.
6638 (yyFail): Check for buffer overflow, by using vsnprintf rather
6639 than vsprintf. Allocate a bigger buffer if possible.
6640 Report an error if buffer allocation fails.
6641 (yyStackOverflow): New function.
6642 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
6643 the initialization was successful. It might fail if storage was
6644 exhausted.
6645 (yyexpandGLRStack): Add more checks for storage allocation failure.
6646 Use yyStackOverflow to report failures.
6647 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
6648 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
6649 Don't assume stack number fits in int.
6650 (yysplitStack): Check for storage allocation failure.
6651 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
6652 can print diagnostics on storage allocation failure. All callers
6653 changed.
6654 (yyresolveValue): Use yybool for boolean.
6655 (yyreportSyntaxError): Check for size-calculation overflow.
6656 This code is taken from yacc.c.
6657 (yyparse): Check for storage allocation errors when allocating
6658 the initial stack.
6659
6660 2005-07-05 Akim Demaille <akim@epita.fr>
6661
6662 Extract calc++ from the documentation.
6663 * doc/bison.texinfo (Calc++): Add the extraction marks.
6664 * examples/extexi: New, from the aborted GNU Programming 2E.
6665 Separate the different paragraph of a file with empty lines.
6666 * examples/Makefile: Use it to extract the whole calc++ example.
6667
6668 2005-06-24 Akim Demaille <akim@epita.fr>
6669
6670 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
6671 class typedefs.
6672
6673 2005-06-22 Akim Demaille <akim@epita.fr>
6674
6675 * doc/bison.texinfo (C++ Language Interface): First stab.
6676 (C++ Parsers): Remove.
6677
6678 2005-06-22 Akim Demaille <akim@epita.fr>
6679
6680 * data/lalr1.cc (yylex_): Honor %lex-param.
6681
6682 2005-06-22 Akim Demaille <akim@epita.fr>
6683
6684 Start a set of simple examples.
6685 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
6686 * examples/calc++/calc++-driver.hh,
6687 * examples/calc++/calc++-parser.yy,
6688 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
6689 * examples/calc++/compile, examples/calc++/test: New.
6690
6691 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
6692
6693 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
6694 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
6695 which stems from the 2005-05-27 patch.
6696
6697 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
6698
6699 * data/glr.c: Modify treatment of unused parameters to permit use
6700 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
6701
6702 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
6703
6704 Fix infringement on user name space reported by Janos Zoltan Szabo.
6705 * data/yacc.c (yyparse): strlen -> yystrlen.
6706
6707 2005-05-30 Akim Demaille <akim@epita.fr>
6708
6709 * data/lalr1.cc (_): New.
6710 Translate the various messages.
6711
6712 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
6713
6714 Fix infringement on user name space reported by Bruno Haible.
6715 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
6716 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
6717 the user's name space.
6718 (alloca): Include <stdlib.h> to get it, if it's not built in.
6719 (YYMALLOC, YYFREE): Define only if needed.
6720 (malloc, free): Declare, but only if needed, as this infringes on
6721 the user name space.
6722
6723 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
6724
6725 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
6726 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
6727 with %d format.
6728 * lib/ebitset.c (min, max): Undef before defining.
6729 * lib/vbitset.c (min, max): Likewise.
6730 * lib/subpipe.c (create_subpipe): Save local variables in case
6731 vfork clobbers them.
6732
6733 2005-05-24 Bruno Haible <bruno@clisp.org>
6734
6735 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
6736 error message syntax used by gcc-4.0.
6737
6738 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
6739
6740 * README: Mention m4 1.4.3. Remove obsolete advice about
6741 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
6742
6743 * bootstrap: Remove workaround for problem I encountered with
6744 gettext 0.14.1; it seems to be fixed now.
6745
6746 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
6747
6748 * NEWS: Version 2.0a.
6749
6750 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
6751 the previous change.
6752
6753 Various maintainer cleanups.
6754 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
6755 conftest*, for benefit of CVS commands run at the same time as
6756 "configure". Add build-aux, since "bootstrap" now creates it and
6757 its subfiles.
6758 * Makefile.cfg (move_if_change): Remove.
6759 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
6760 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
6761 (po_repo, do-po-update, po-update, wget_files, get-targets):
6762 (config.guess-url_prefix, config.sub-url_prefix):
6763 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
6764 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
6765 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
6766 Remove.
6767 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
6768 this is now the recommended name.
6769 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
6770 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
6771 ylwrap. These files now go into build-aux.
6772 * config/move-if-change: Remove.
6773 * config/prev-version.txt: Bump from 1.75 to 2.0.
6774
6775 * bootstrap: Add stdio-safer, unistd-safer modules.
6776 Remove m4/glibc2.m4 (introduced by latest gnulib, but
6777 we don't need it).
6778 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
6779 fopen-safer.c, stdio-safer.h, unistd-safer.h.
6780 * lib/subpipe.c: Include "unistd-safer.h".
6781 (create_subpipe): Make sure all the newly-created
6782 file descriptors are > 2, so that diagnostics don't
6783 get sent down them (which might cause Bison to hang, in theory).
6784 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
6785 * src/files.c (xfopen): Use fopen_safer, not fopen.
6786
6787 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
6788 yesterday's yacc.c fix.
6789
6790 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
6791
6792 * data/glr.c, data/lalr1.cc: Update copyright date.
6793
6794 Fix a destructor bug reported by Wolfgang Spraul in
6795 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
6796 * data/yacc.c (yyabortlab): Don't call destructor, and
6797 don't set yychar to EMPTY.
6798 (yyoverflowlab): Don't call destructor.
6799 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
6800 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
6801 since we no longer output the message "discarding lookahead token
6802 end of input ()".
6803
6804 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6805
6806 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
6807 fix a small glitch in debugging output.
6808 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
6809 after YY_SYMBOL_PRINT where needed.
6810
6811 (struct yyGLRState): Add some comments.
6812 (struct yySemanticOption): Add some comments.
6813 (union yyGLRStackItem): Add comment.
6814
6815 (yymergeOptionSets): Correct this to properly perform the union,
6816 avoiding infinite reported by Michael Rosien.
6817 Update comment.
6818
6819 * tests/glr-regression.at: Add test for GLR merging error reported
6820 by M. Rosien.
6821
6822 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
6823
6824 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
6825 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
6826 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
6827 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
6828 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
6829 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
6830 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
6831 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
6832 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
6833 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
6834 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
6835 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
6836 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
6837 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
6838 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
6839 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
6840 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
6841 src/derives.h, src/files.c, src/files.h, src/getargs.c,
6842 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
6843 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
6844 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
6845 src/output.h, src/parse-gram.c, src/parse-gram.h,
6846 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
6847 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
6848 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
6849 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
6850 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
6851 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
6852 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
6853 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
6854 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
6855 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
6856 tests/reduce.at, tests/regression.at, tests/sets.at,
6857 tests/synclines.at, tests/testsuite.at, tests/torture.at:
6858 Update FSF postal mail address.
6859
6860 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
6861
6862 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
6863 Problem reported by Ralf Menzel.
6864
6865 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
6866
6867 * tests/actions.at: Test that stack overflow invokes destructors.
6868 From Marcus Holland-Moritz.
6869 * data/yacc.c (yyerrlab): Move the code that destroys the stack
6870 from here....
6871 (yyreturn): to here. That way, destructors are called properly
6872 even if the stack overflows, or the user calls YYACCEPT or
6873 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
6874 (yyoverflowlab): Destroy the lookahead.
6875
6876 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
6877
6878 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
6879
6880 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
6881
6882 * NEWS: Bison-generated C parsers no longer quote literal strings
6883 associated with tokens.
6884 * src/output.c (prepare_symbols): Don't escape strings,
6885 since users don't want to see C escapes.
6886 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
6887 in diagnostics.
6888 * tests/input.at (Torturing the Scanner): Likewise.
6889 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
6890
6891 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
6892
6893 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
6894 the data size is known to be too small and we can't increase it.
6895 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
6896
6897 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
6898
6899 * src/parse-gram.y: Include quotearg.h.
6900 (string_as_id): Quote $1 before using it as a key, since the
6901 lexer no longer quotes it for us.
6902 (string_content): Don't strip quotes, since lexer no longer
6903 quotes it for us.
6904 * src/scan-gram.l: Include quotearg.h.
6905 ("\""): Omit quote.
6906 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
6907 a key, since the rest of the lexer doesn't quote it.
6908 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
6909 * tests/regression.at (Token definitions): Check for backslashes
6910 in token strings.
6911
6912 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
6913 (YYSIZE_T): Define to unsigned long int when using an older compiler.
6914 (yyparse): Revamp code to generate long syntax error message, to
6915 make it easier to translate, and to avoid problems with arithmetic
6916 overflow. Change "virtual memory" to "memory" in diagnostic, since
6917 we don't know whether the memory is virtual.
6918
6919 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
6920
6921 * NEWS: Bison-generated C parsers now use the _ macro to
6922 translate strings.
6923 * data/yacc.c (_) [!defined _]: New macro.
6924 All English strings wrapped inside this macro.
6925 * doc/bison.texinfo (Bison Parser): Document _.
6926 * po/POTFILES.in: Include src/parse-gram.c, since it now
6927 includes translateable strings that parse-gram.y doesn't.
6928
6929 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
6930
6931 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
6932 reverting the 2004-10-11 change to this function.
6933 (symbol_check_alias_consistency): Don't call symbol_type_set
6934 if the type name is already correct.
6935 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
6936
6937 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
6938
6939 * tests/regression.at (Token definitions): Don't use a token named
6940 c, as that generates a "#define c ..." that runs afoul of buggy
6941 stdlib.h that uses the identifier c as a member of struct
6942 drand48_data. Problem reported by Horst Wente.
6943
6944 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
6945
6946 * bootstrap: Change translation URL from
6947 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
6948 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
6949 redirection glitches. Problem reported by twlevo@xs4all.nl.
6950
6951 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
6952
6953 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
6954 after operands; POSIX says this isn't portable for the c99 command.
6955
6956 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
6957
6958 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
6959 immediately if a data overrun has occurred; this may help us track
6960 down what may be a spurious failure on MacOS.
6961
6962 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
6963
6964 Respond to problems reported by twlevo@xs4all.nl.
6965
6966 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
6967
6968 * src/vcg.h: Comment fix.
6969 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
6970 (G_CMAX): Change to -1 instead of INT_MAX.
6971
6972 * data/yacc.c (yyparse): Omit spaces before #line.
6973
6974 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
6975
6976 * src/tables.c (state_number_to_vector_number): Put it inside an
6977 "#if 0", since it's not currently used. Problem reported by
6978 Roland McGrath.
6979
6980 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
6981
6982 * src/output.c (escaped_output): Renamed from
6983 escaped_file_name_output, since we now use it for symbol tags as
6984 well. All uses changed.
6985 (symbol_destructors_output, symbol_printers_output):
6986 Escape symbol tags too.
6987 Problem reported by Matyas Forstner in
6988 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
6989
6990 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
6991 not needed.
6992 * src/output.c (user_actions_output, token_definitions_output,
6993 symbol_destructors_output, symbol_printers_output): Likewise.
6994 * src/reader.c (prologue_augment): Likewise.
6995 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
6996
6997 * src/vcg.c (output_edge): Don't quote linestyle arg.
6998 Problem reported by twlevo@xs4all.nl.
6999
7000 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
7001
7002 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
7003 example, reported by Derek M Jones. Also, make the example even
7004 more outrageous, to better illustrate how bad the problem is.
7005
7006 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
7007
7008 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
7009 putsym. Typo reported by Sebastian Piping.
7010
7011 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
7012
7013 * doc/bison.texinfo (Language and Grammar): some -> same
7014 (Epilogue): int he -> in the
7015 Typos reported by Sebastian Piping via Justin Pence.
7016
7017 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
7018
7019 * tests/glr-regression.at (Improper handling of embedded actions
7020 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
7021 embedded actions and $-N in GLR parsers", work around an Autoconf bug
7022 with dollar signs in test names.
7023 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
7024 for a similar reason.
7025
7026 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
7027
7028 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
7029 wants to redefine G_VIEW.
7030
7031 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
7032
7033 * src/vcg.c (get_view_str): Remove case for normal_view.
7034 Problem reported by twlevo@xs4all.nl.
7035
7036 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
7037
7038 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
7039 Problem reported by twlevo@xs4all.nl.
7040
7041 * doc/bison.texinfo: Change @dircategory from "GNU programming
7042 tools" to "Software development". Requested by Richard Stallman
7043 via Karl Berry.
7044
7045 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
7046
7047 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
7048 Problem reported by twlevo@xs4all.nl.
7049
7050 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
7051
7052 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
7053 keyword; it's not needed with modern compilers, and it doesn't
7054 affect correctness with older compilers. Suggested by
7055 twlevo@xs4all.nl.
7056
7057 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
7058
7059 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
7060 gcc -Wswitch-default.
7061 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7062 * data/yacc.c (yyparse): Likewise.
7063
7064 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
7065
7066 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
7067 already. Let config.h define any nonstandard values.
7068
7069 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
7070
7071 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
7072 for the benefit of slower hosts. Problem reported by
7073 Nelson H. F. Beebe.
7074
7075 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
7076
7077 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
7078 being defined and not used.
7079 * data/lalr1.cc (yyparse): Likewise.
7080 Use "if (false)" rather than "if (0)".
7081
7082 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
7083
7084 * TODO: Mention that we should allow NUL bytes in tokens.
7085
7086 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
7087
7088 * src/scan-skel.l (<<EOF>>): Don't close standard output.
7089 Problem reported by Hans Aberg.
7090
7091 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
7092
7093 * src/getargs.c (version): Happy new year; update overall
7094 program copyright date from 2004 to 2005.
7095
7096 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
7097 Problem reported by Hans Aberg.
7098 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
7099 (Output file names.): Add a test for the case when standard output
7100 is closed.
7101
7102 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
7103
7104 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
7105 to fix an oversight in the Bison 2.0 manual.
7106
7107 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
7108
7109 * NEWS: Version 2.0. Reformat the existing news items since
7110 1.875, so that related items are grouped together.
7111 * configure.ac (AC_INIT): Bump version to 2.0.
7112 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
7113
7114 * tests/torture.at (Exploding the Stack Size with Alloca): Set
7115 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
7116 otherwise, we're not testing alloca. Unfortunately there's no
7117 simple way to consult HAVE_ALLOCA here.
7118
7119 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
7120 for yymsg, too.
7121
7122 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
7123 hand. This avoids a warning about comparing int to size_t when
7124 GCC warnings are enabled.
7125
7126 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
7127
7128 * NEWS: Bison-generated parsers no longer default to using the
7129 alloca function (when available) to extend the parser stack, due
7130 to widespread problems in unchecked stack-overflow detection.
7131 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
7132 responsibility to set it to a positive value. This lets the user
7133 specify a value that is not a preprocessor constant.
7134 * data/yacc.c (YYMAXDEPTH): Likewise.
7135 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
7136 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
7137 to be a compile-time constant. However, explain the constraints on it.
7138 Also, explain the constraints on YYINITDEPTH.
7139 (Table of Symbols): Explain that alloca is no longer the default.
7140 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
7141 to 1.
7142
7143 * doc/bison.texinfo (Location Default Action): Mention that n must
7144 be zero when k is zero. Suggested by Frank Heckenbach.
7145
7146 2004-12-22 Akim Demaille <akim@epita.fr>
7147
7148 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
7149 (parser::state_type, parser::semantic_type, parser::location_type):
7150 Private, not public.
7151 (parser::parse): Return ints, not bool.
7152 Returning a bool introduces a problem: 0 corresponds to false, and
7153 it seems weird to return false on success. Returning true changes
7154 the conventions for yyparse.
7155 Alternatively we could return void and send an exception.
7156 There is no clear consensus (yet?).
7157 (state_stack, semantic_stack, location_stack): Rename as...
7158 (state_stack_type, semantic_stack_type, location_stack_type): these.
7159 Private, not public.
7160 * tests/c++.at: New.
7161 * tests/testsuite.at, tests/Makefile.am: Adjust.
7162
7163 2004-12-21 Akim Demaille <akim@epita.fr>
7164
7165 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
7166
7167 2004-12-21 Akim Demaille <akim@epita.fr>
7168
7169 Don't impose std::string for filenames.
7170
7171 * data/lalr1.cc (b4_filename_type): New.
7172 (position::filename): Use it.
7173 (parser.hh): Move the inclusion of stack.hh and location.hh below
7174 the user code, so that needed headers for the filename type can be
7175 included first.
7176 Forward declare them before the user code.
7177 * tests/Makefile.am (check-local, installcheck-local): Pass
7178 TESTSUITEFLAGS to the TESTSUITE.
7179
7180 2004-12-20 Akim Demaille <akim@epita.fr>
7181
7182 Use more STL like names: my_class instead of MyClass.
7183
7184 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
7185 (SemanticStack, SemanticType, StateStack, StateType)
7186 (TokenNumberType, Stack, Slice, Traits, Parser::location)
7187 (Parser::value): Rename as...
7188 (location_stack, location_type, rhs_number_type, semantic_stack)
7189 (semantic_type, state_stack, state_type, token_number_type, stack)
7190 (slice, traits, parser::yylloc, parser::yylval): these.
7191
7192 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
7193
7194 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
7195
7196 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
7197 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7198
7199 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
7200
7201 Remove uses of 'short int' and 'unsigned short int'. This raises
7202 some arbitrary limits. It uses more memory but nowadays that's
7203 not much of an issue.
7204
7205 This change does not affect the generated parsers; that's a different
7206 task, as some users will want to conserve memory there.
7207
7208 Ideally we should use size_t to represent all object counts, and
7209 something like ptrdiff_t to represent signed differences of object
7210 counts; but that will require more code-cleanup than I have the
7211 time to do right now.
7212
7213 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
7214 Use size_t, not int or short int, to count objects.
7215 * src/closure.c (nritemset, closure): Likewise.
7216 * src/closure.h (nritemset, closure): Likewise.
7217 * src/nullable.c (nullable_compute): Likewise.
7218 * src/print.c (print_core): Likewise.
7219 * src/print_graph.c (print_core): Likewise.
7220 * src/state.c (state_compare, state_hash): Likewise.
7221 * src/state.h (struct state): Likewise.
7222 * src/tables.c (default_goto, goto_actions): Likewise.
7223
7224 * src/gram.h (rule_number, rule): Use int, not short int.
7225 * src/output.c (prepare_rules): Likewise.
7226 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
7227 errs, reductions): Likewise.
7228 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
7229 Likewise.
7230 * src/tables.c (vector_number, tally, action_number,
7231 ACTION_NUMBER_MINIMUM): Likewise.
7232 * src/output.c (muscle_insert_short_int_table): Remove.
7233
7234 2004-12-17 Akim Demaille <akim@epita.fr>
7235
7236 * data/lalr1.cc: Extensive Doxygenation.
7237 (error_): Rename as...
7238 (error): this, since it is visible to the user.
7239 Adjust callers.
7240 (Parser::message): Now an automatic variable from...
7241 (Parser::yyreport_syntax_error_): here.
7242 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
7243 Parser::error.
7244 * tests/input.at: Escape $.
7245
7246 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
7247
7248 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
7249 Parenthesize rhs to avoid obscure problems with mistakes like
7250 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
7251 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7252 b4_rhs_location): Likewise.
7253 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7254 b4_rhs_location): Likewise.
7255
7256 2004-12-16 Akim Demaille <akim@epita.fr>
7257
7258 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
7259 yacc.c: be sure to stay within yycheck_.
7260 * tests/actions.at: Re-enable C++ tests.
7261
7262 2004-12-16 Akim Demaille <akim@epita.fr>
7263
7264 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
7265 real.
7266
7267 2004-12-16 Akim Demaille <akim@epita.fr>
7268
7269 Use #define to handle the %name-prefix.
7270
7271 * data/glr.c, data/yacc.c: Comment changes.
7272 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
7273 so that one can refer to yylex in the parser file, and have it
7274 renamed, as is the case with other skeletons.
7275
7276 2004-12-16 Akim Demaille <akim@epita.fr>
7277
7278 Move lalr1.cc internals into yy*.
7279
7280 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
7281 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
7282 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
7283 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
7284 (empty_, final_, terror_, errcode_, ntokens_)
7285 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
7286 (looka_, ilooka_, error_range_, nerrs_):
7287 Rename as...
7288 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
7289 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
7290 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
7291 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
7292 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
7293 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
7294 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
7295 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
7296 these.
7297
7298 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
7299
7300 Fix some problems reported by twlevo at xs4all.
7301 * src/symtab.c (symbol_new): Report an error if the input grammar
7302 contains too many symbols. This is better than calling abort() later.
7303 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
7304 (struct node, struct graph):
7305 Rename member expand to stretch. All uses changed.
7306 (struct graph): Remove member layoutalgorithm. All uses removed.
7307 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
7308 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
7309 All uses changed.
7310 (N_STRETCH): Rename from N_EXPAND. All uses changed.
7311
7312 2004-12-15 Akim Demaille <akim@epita.fr>
7313
7314 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
7315 Add more Doxygen comments.
7316 (symprint_, stack_print_, reduce_print_, destruct_, pop)
7317 (report_syntax_error_, translate_): Rename as...
7318 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
7319 (yypop_, yyreport_syntax_error_, yytranslate_): this.
7320
7321 2004-12-15 Akim Demaille <akim@epita.fr>
7322
7323 * data/lalr1.cc (lex_): Rename as...
7324 (yylex_): this.
7325 Move the trace here.
7326 Take the %name-prefix into account.
7327 Reported by Alexandre Duret-Lutz.
7328
7329 2004-12-15 Akim Demaille <akim@epita.fr>
7330
7331 Simplify the C++ parser constructor.
7332
7333 * data/lalr1.cc (debug_): Rename as...
7334 (yydebug_): so that the parser's internals are always in the yy*
7335 pseudo namespace.
7336 Adjust uses.
7337 (b4_parse_param_decl): Remove the leading comma as it is now only
7338 called as unique argument list.
7339 (Parser::Parser): Remove the constructor accepting a location and
7340 an initial debugging level.
7341 Remove from the other ctor the argument for the debugging level.
7342 (debug_level_type, debug_level, set_debug_level): New.
7343
7344 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
7345 constructor calls.
7346
7347 2004-12-15 Akim Demaille <akim@epita.fr>
7348
7349 Remove b4_root related material: failure experiment
7350 (which goal was to allow to derive from a class).
7351
7352 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
7353 definitions and uses.
7354
7355 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
7356
7357 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
7358 not 2, since it's not portable to subtract 1 from the start of an
7359 array. The new item 0 is never set or used. All uses changed.
7360
7361 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
7362 the default definition of YYLLOC_DEFAULT. Problem reported
7363 by Frank Heckenbach.
7364
7365 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
7366
7367 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
7368 the normal case and one for the error case. Just use the
7369 first one uniformly. Problem reported by Frank Heckenbach.
7370 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
7371 use exactly the same macro in both places.
7372 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
7373 so that the normal-case YYRHSLOC works for the error case too.
7374 All uses changed.
7375 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
7376 (YYLLOC_DEFAULT): Use the same macro as glr.c.
7377 * doc/bison.texinfo (Location Default Action): Don't claim that
7378 we have an array of locations. Use the same macro for both glr
7379 and lalr parsers. Mention YYRHSLOC. Mention what happens when
7380 the index is 0.
7381
7382 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7383
7384 * HACKING: Update email addresses to send announcements to.
7385
7386 * configure.ac (AC_INIT): Bump version to 1.875f.
7387
7388 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7389
7390 * NEWS: Version 1.875e.
7391 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
7392
7393 * src/scan-skel.l: Include "complain.h", for "fatal".
7394
7395 * src/relation.h (relation_print, relation_digraph):
7396 Relation sizes are of type relation_node, not size_t (this is
7397 merely a doc fix, since the two types are equivalent).
7398 (relation_transpose): Relation sizes are of type relation_node,
7399 not int.
7400 * src/relation.c: Likewise.
7401 (top, infinity): Now of type relation_node, not int.
7402 (traverse, relation_transpose): Use relation_node, not int.
7403
7404 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
7405 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
7406 (yyparse): Remove unused local introduced in 2004-10-25 patch.
7407
7408 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
7409 specifying whether the test should be skipped. Use it tp
7410 specify that the [%defines %skeleton "lalr1.cc"] tests currently
7411 fail on some hosts, and should be skipped.
7412
7413 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
7414
7415 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
7416 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
7417 unless otherwise specified below.
7418
7419 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
7420 to allocate kernel_base, kernel_items, kernel_size, since
7421 they needn't be initialized to 0.
7422 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
7423 * src/closure.c (new_closure): Likewise, for itemset.
7424 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
7425 * src/lalr.c (set_goto_map): Likewise, for temp_map.
7426 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
7427 (build_relations): Likewise for edge, states1, includes.
7428 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
7429 * src/reader.c (packgram): Likewise, for ritem, rules.
7430 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
7431 * src/relation.c (relation_digraph): Likewise for VERTICES.
7432 (relation_transpose): Likewise for new_R, end_R.
7433 * src/symtab.c (symbols_token_translations_init): Likewise for
7434 token_translations.
7435 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
7436 (token_actions): Likewise for yydefact, actrow, conflrow,
7437 conflict_list.
7438 (save_column): Likewise for froms[symno], tos[symno].
7439 (goto_actions): Likewise for state_count.
7440 (pack_table): Likewise for base, pos, check.
7441 (tables_generate): Likewise for width.
7442
7443 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
7444 for initial core. Just have a separate core, so we needn't worry
7445 about whether kernel_size and kernel_base are initialized.
7446
7447 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
7448 kernel_size, kernel_items): Remove unnecessary initialization.
7449 * src/conflicts.c (conflicts): Likewise.
7450 * src/derives.c (derives): Likewise.
7451 * src/muscle_tablc (muscle_insert): Likewise.
7452 * src/relation.c (relation_digraph): Likewise.
7453 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
7454 conflrow, conflict_table, conflict_list, table, check):
7455 Likewise.
7456
7457 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
7458 This is because all callers pass unsigned int.
7459 * src/closure.h (new_closure): Likewise.
7460
7461 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
7462 (build_relations): Initialize includes[i] in all cases.
7463 * src/reader.c (packgram): Always initialize rules[ruleno].prec
7464 and rules[ruleno].precsym. Initialize members in order.
7465 * src/relation.c (relation_transpose): Always initialize new_R[i]
7466 and end_R[i].
7467 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
7468
7469 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
7470 conflict_list[0] was always 0, but now it isn't initialized.
7471
7472 * src/table.c (table_grow): When conflict_table grew, the grown
7473 area wasn't cleared. Fix this.
7474
7475 * lib/.cvsignore: Add strdup.c, strdup.h.
7476 * m4/.cvsignore: Add strdup.m4.
7477
7478 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
7479
7480 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
7481 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
7482 GOTO_NUMBER_MAXIMUM, since we occasionally compute
7483 ngotos + 1 without checking for overflow.
7484 (build_relations): Use END_NODE, not -1, to denote end of edges.
7485 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
7486 build_relations): Use goto_number, not int, for goto numbers.
7487 * src/tables.c (save_column, default_goto): Likewise.
7488
7489 2004-11-23 Akim Demaille <akim@epita.fr>
7490
7491 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
7492 of #defining from yystype.
7493 Don't typedef yystype, C++ does not need it.
7494 This lets it possible to forward declare it as union.
7495
7496 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
7497
7498 * bootstrap (gnulib_modules): Add extensions.
7499 Problem reported by Jim Meyering.
7500
7501 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
7502
7503 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
7504 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
7505 src/system.h, src/tables.c: XFREE -> free, to accommodate
7506 recent change to gnulib xalloc.h.
7507 Problem reported by Jim Meyering.
7508
7509 2004-11-17 Akim Demaille <akim@epita.fr>
7510
7511 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
7512
7513 2004-11-17 Akim Demaille <akim@epita.fr>,
7514 Alexandre Duret-Lutz <adl@gnu.org>
7515
7516 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
7517 changes.
7518 (YYCDEBUG): Adjust.
7519 Use it instead of cdebug_.
7520 (Parser::debug_stream, Parser::set_debug_stream): New.
7521 (Parser::symprint_): Define cdebug_ for temporary backward
7522 compatibility.
7523 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
7524 debug_stream ().
7525
7526 2004-11-17 Akim Demaille <akim@epita.fr>
7527
7528 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
7529 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
7530 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
7531 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
7532
7533 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
7534
7535 * data/glr.c (yyloc_default): Remove; not used.
7536 Problem reported by Frank Heckenbach.
7537
7538 2004-10-25 Akim Demaille <akim@epita.fr>
7539
7540 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
7541 Introduce another definition to address simple location arrays.
7542 (yyGLRStack): New member: yyerror_range.
7543 (yyrecoverSyntaxError, yyparse): Update it.
7544 (yyrecoverSyntaxError): Use it when shifting the error token to
7545 have an accurate range, equivalent to the one computed by both
7546 yacc.c and lalr1.cc.
7547 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
7548 that column numbers start at column 0, as per GNU Coding
7549 Standards, the others tests, and the doc.
7550 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
7551 Adjust to the above change (first column is 0).
7552 And adjust the location of the "<error>", now covering the whole
7553 line.
7554
7555 2004-10-22 Akim Demaille <akim@epita.fr>
7556 and Paul Eggert <eggert@cs.ucla.edu>
7557
7558 Remove some arbitrary limits on goto numbers and relations.
7559 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
7560 initial values, since they're never used.
7561 (set_goto_map): ngotos is now unsigned, so test for overflow
7562 by seeing whether it wraps around to zero.
7563 * src/lalr.h (goto_number): Now size_t, not short int.
7564 (GOTO_NUMBER_MAXIMUM): Remove.
7565 * src/relation.c (relation_print, traverse, relation_transpose):
7566 Check for END_NODE rather than looking at sign.
7567 * src/relation.h (END_NODE): New macro.
7568 (relation_node): Now size_t, not short int.
7569
7570 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
7571
7572 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
7573 keyword, not an identifier. Problem reported by Baron Schwartz in
7574 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
7575
7576 2004-10-11 Akim Demaille <akim@epita.fr>
7577
7578 * src/symtab.c (symbol_check_alias_consistency): Also check
7579 type names, destructors, and printers.
7580 Reported by Alexandre Duret-Lutz.
7581 Recode the handling of associativity and precedence in terms
7582 of symbol_precedence_set.
7583 Accept no redeclaration at all, not even equal to the previous
7584 value.
7585 (redeclaration): New.
7586 Use it to factor redeclaration complaints.
7587 (symbol_make_alias): Don't set the type of the alias, let
7588 symbol_check_alias_consistency do it as for other features.
7589 * src/symtab.h (symbol): Add new member prec_location, and
7590 type_location.
7591 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
7592 * tests/input.at (Incompatible Aliases): New.
7593
7594 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
7595
7596 .cvsignore fixes to accommodate gnulib changes,
7597 and the practice of naming build directories "_build".
7598 * .cvsignore: Add "_*". Sort.
7599 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
7600 * m4/.cvsignore: Add "*_gl.m4".
7601
7602 2004-10-06 Akim Demaille <akim@epita.fr>
7603
7604 * src/parse-gram.y (add_param): Fix the truncation of trailing
7605 spaces.
7606
7607 2004-10-05 Akim Demaille <akim@epita.fr>
7608
7609 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
7610 whether the reducion was empty or not. This leaves room to
7611 improve the use of YYLLOC_DEFAULT in such a case.
7612 lalr1.cc is still experimental, so changing this is acceptable.
7613 And finally, there are probably not many users who changed the
7614 handling of locations in GLR, so changing is admissible too.
7615
7616 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
7617 empty reduction, set @$ to an empty location ending the previously
7618 stacked symbol.
7619 Adjust uses to make sure the code is triggered on empty
7620 reductions.
7621 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
7622 expected output: empty reductions have empty locations.
7623
7624 2004-09-29 Akim Demaille <akim@epita.fr>
7625
7626 * data/lalr1.cc: Move towards a more standard C++ coding style
7627 for templates: Class < T > -> Class<T>.
7628
7629 2004-09-29 Akim Demaille <akim@epita.fr>
7630
7631 * data/lalr1.cc: Reinstall the former ctor, for sake of
7632 compatibility, but warn it will be removed.
7633 Move towards a more standard C++ coding style (i.e., type *var ->
7634 type* var).
7635
7636 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
7637
7638 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
7639 since it's less likely to work if NULs are involved in the future.
7640
7641 2004-09-27 Akim Demaille <akim@epita.fr>
7642
7643 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
7644
7645 2004-09-27 Akim Demaille <akim@epita.fr>
7646
7647 * data/lalr1.cc (b4_parse_param_decl_1): New.
7648 (b4_parse_param_decl): Use it to have different names between attribute
7649 and argument names.
7650 (b4_cc_constructor_call): Likewise.
7651
7652 2004-09-24 Akim Demaille <akim@epita.fr>
7653
7654 * src/parse-gram.y (add_param): Strip the leading and trailing
7655 blanks from a formal argument declaration.
7656 (YY_LOCATION_PRINT): New.
7657
7658 2004-09-24 Akim Demaille <akim@epita.fr>
7659
7660 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
7661 after the location.
7662
7663 2004-09-24 Akim Demaille <akim@epita.fr>
7664
7665 * doc/bison.texinfo (Table of Symbols): Sort.
7666
7667 2004-09-21 Akim Demaille <akim@epita.fr>
7668
7669 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
7670 the useless parentheses.
7671 Suggested by Paul Eggert.
7672
7673 2004-09-20 Akim Demaille <akim@epita.fr>
7674
7675 Let the initial-action act on the look-ahead, and use it for the
7676 "initial push" (corresponding to an hypothetical beginning-of-file).
7677 And let lalr1.cc honor %initial-action.
7678
7679 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
7680 example.
7681 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
7682 (Parser::Parser): Remove the ctor that used to initialize it.
7683 (Parser::parse): Like in the other skeletons, issue the "starting
7684 parse" message before any action.
7685 Honor %initial-action.
7686 Initialize the stacks with the lookahead.
7687 * data/yacc.c: Let $$ and @$ in %initial-action designate the
7688 look-ahead.
7689 Push them in the stacks.
7690 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
7691
7692 2004-09-20 Akim Demaille <akim@epita.fr>
7693
7694 * doc/bison.texinfo (Initial Action Decl): New.
7695
7696 2004-09-20 Akim Demaille <akim@epita.fr>
7697
7698 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
7699 clearer criterion to define it.
7700 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
7701 When reducing on an empty RHS, use the latest stacked location as
7702 location.
7703 yylloc is not always available.
7704 * data/glr.c: Likewise.
7705 Also, honor initial-actions.
7706
7707 2004-09-20 Akim Demaille <akim@epita.fr>
7708
7709 * data/yacc.c (YY_LOCATION_PRINT): New.
7710 Define when we know YYLTYPE's structure, i.e., when the default
7711 YYLLOC_DEFAULT is used.
7712 * data/c.m4 (b4_yysymprint_generate): Use it.
7713 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
7714 value of the result.
7715 (error_start_): Replace with...
7716 (error_range_): this location array.
7717 This allows to replace code relying on the implementation of
7718 locations by portable code.
7719 * data/yacc.c (yylerrsp): Replace with...
7720 (yyerror_range): this.
7721 Every time a token is popped, update yyerror_range[0], to have an
7722 accurate location for the error token.
7723 * data/glr.c (YY_LOCATION_PRINT): New.
7724 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
7725 deference a pointer.
7726 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
7727 report the location in %printers.
7728
7729 * src/scan-skel.l: Instead of abort, report error messages to ease
7730 understanding skeleton scanning failures.
7731
7732 2004-09-16 Akim Demaille <akim@epita.fr>
7733
7734 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
7735 (iterator, const_iterator): these, to be more in the C++ spirit.
7736 Also, return reverse iterators so that when displaying the stack
7737 we display its bottom first.
7738 (Parser::stack_print_, Parser::reduce_print_): Match the messages
7739 from yacc.c.
7740 We should probably use vector here though.
7741
7742 2004-09-16 Akim Demaille <akim@epita.fr>
7743
7744 Have more complete shift traces.
7745
7746 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
7747 to report Shifts instead of ad hoc YYDPRINTF invocations,
7748 including for the error token.
7749 * data/lalr1.cc (symprint_): Output the location.
7750 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
7751 output the location within the %printer.
7752 Activate GLR tests, at least to make sure they compile properly.
7753 They still don't pass though.
7754 * tests/calc.at: Adjust expect verbose output, since now "Entering
7755 state..." is on a different line than the "Shifting" message.
7756
7757 2004-09-08 Akim Demaille <akim@epita.fr>
7758
7759 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
7760 Bison directive from the Bison file to the invocation of this
7761 macro, so that these directives are passed to
7762 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
7763 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
7764 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
7765 the extra Bison directives instead of the whole series.
7766 Change the grammar so that there are recoverable errors, and
7767 unrecoverable errors. Now we can have the parser give up before
7768 consuming the whole input. As a result we now can observe that
7769 the lookahead is freed when needed.
7770 Change the parser source to parse argv[1] instead of a hard coded
7771 string.
7772 Simplify yylex, and give a value and location to EOF.
7773 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
7774 passed directives already coded in the file.
7775 Add some tests to check the location of "error".
7776 For some tests, the C++ parser is correct, and not yacc.c.
7777 For other tests, they provide different, but unsatisfying, values,
7778 so keep the C++ value so that at least one parser is "correct"
7779 according to the test suite.
7780 (Actions after errors): Remove, this is subsumed by the
7781 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
7782
7783 2004-09-06 Akim Demaille <akim@epita.fr>
7784
7785 * data/lalr1.cc: Adjust the indentation of the labels.
7786 (Parser::pop): New.
7787 Use it.
7788
7789 2004-09-06 Akim Demaille <akim@epita.fr>
7790
7791 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
7792 argument, an informative message.
7793 Call YY_SYMBOL_PRINT.
7794 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
7795 * data/lalr1.cc (destruct_): Likewise.
7796 In addition, no longer depend on b4_yysymprint_generate and
7797 b4_yydestruct_generate to generate these functions, do it "by
7798 hand".
7799
7800 2004-09-03 Akim Demaille <akim@epita.fr>
7801
7802 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
7803 invoked, yydestruct the lookahead.
7804 * tests/calc.at (Calculator $1): Update the expected lengths of
7805 traces: there is an added line for the discarded lookahead.
7806 * doc/bison.texinfo (Destructor Decl): Some rewording.
7807 Define "discarded" symbols.
7808
7809 2004-09-02 Akim Demaille <akim@epita.fr>
7810
7811 * data/lalr1.cc (translate_, destruct_): No reason to be static.
7812
7813 2004-09-02 Akim Demaille <akim@epita.fr>
7814
7815 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
7816 (YYDSYMPRINTF): Rename as...
7817 (YY_SYMBOL_PRINT): this.
7818 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
7819 two.
7820 Use it instead of direct symprint_ calls.
7821 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
7822 one.
7823
7824 2004-09-02 Akim Demaille <akim@epita.fr>
7825
7826 * data/lalr1.cc (b4_yysymprint_generate): New.
7827 (symprint_): New member function, defined when YYDEBUG.
7828 Use it consistently instead of token/nterm debugging output by
7829 hand.
7830 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
7831 %printer calls to use cdebug_ when using lalr1.cc.
7832
7833 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
7834
7835 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
7836 with #ifdef YYDEBUG.
7837
7838 2004-08-26 Akim Demaille <akim@epita.fr>
7839
7840 * doc/bison.texinfo (Implementing Loops): Rename as...
7841 (Implementing Gotos/Loops): this.
7842
7843 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
7844
7845 Adjust to latest gnulib.
7846 * bootstrap (gnulib_modules): Add xalloc-die.
7847 Set LC_ALL=C so that file names sort consistently.
7848 Prefer the gnulib copies of gettext.m4, glibc21.m4,
7849 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
7850 uintmax_t.m4, ulonglong.m4.
7851 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
7852 po.m4 since we are now using _gl.m4 instead.
7853
7854 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
7855
7856 * src/scan-action.l: Remove. Scanning of semantic actions is
7857 handled in scan-gram.l.
7858
7859 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
7860
7861 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
7862
7863 * src/location.h (struct): The file member is a uniqstr.
7864 (equal_boundaries): Use UNIQSTR_EQ for comparison.
7865
7866 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
7867
7868 Fix bug with non-%union parsers that have printers or destructors,
7869 which led to a Bison core dump. Reported by Peter Fales in
7870 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
7871
7872 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
7873 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
7874 not to our own type.
7875 * src/output.c (symbol_destructors_output, symbol_printers_output):
7876 Don't assume %union.
7877 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
7878 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
7879 UNION-FLAG. All callers changed.
7880 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
7881 Use type char, not unsigned int, when declaring an array of char;
7882 this lets us remove a cast.
7883 (Printers and Destructors): Add non-%union test cases.
7884
7885 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
7886
7887 * doc/bison.texinfo: Minor editorial changes, mostly to the new
7888 GLR writeups. E.g., avoid frenchspacing and the future tense,
7889 change "lookahead" to "look-ahead", and change "wrt" to "with
7890 respect to".
7891
7892 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7893
7894 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
7895 New sections, split off from the GLR Parsers section. Put the new
7896 Simple GLR Parser near the start of the GLR section, for clarity.
7897 Rewrite connective text.
7898
7899 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
7900
7901 * doc/bison.texinfo (Simple GLR Parsers): New section.
7902
7903 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
7904
7905 * NEWS, TODO, doc/bison.texinfo:
7906 Use "look-ahead" instead of "lookahead", to be consistent.
7907 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
7908 while we're fixing "look-ahead".
7909 * src/conflicts.c (shift_set): Renamed from shiftset.
7910 (look_ahead_set): Renamed from lookaheadset.
7911 * src/print.c: Likewise.
7912 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
7913 name for "lookahead".
7914 (report_types, usage): Likewise.
7915 * src/getargs.h (report_look_ahead_tokens): Renamed from
7916 report_lookaheads.
7917 * src/lalr.c (compute_look_ahead_tokens): Renamed from
7918 compute_lookaheads.
7919 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
7920 (look_ahead_tokens_print): Renamed from lookaheads_print.
7921 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
7922 state_rule_lookaheads_print.
7923 * src/state.h: Likewise.
7924 (reductions.look_ahead_tokens): Renamed from lookaheads.
7925 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
7926 AT_DATA_LOOKAHEADS_GRAMMAR.
7927
7928 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
7929
7930 * README: Update location of patched M4 distribution.
7931
7932 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
7933
7934 Don't assume the C++ compiler takes the same arguments as the C compiler
7935 (trivial change).
7936 * configure.ac (O0CXXFLAGS): New var.
7937 * tests/atlocal.in (CXXFLAGS): Use it.
7938
7939 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
7940
7941 Fix some "make check" problems with C++ reported by
7942 Albert Chin-A-Young for Tru64 C++ in this thread:
7943 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
7944
7945 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
7946 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
7947 Output to a .cc file for C++, not to a .c file.
7948 * tests/calc.at (AT_CHECK_CALC): Likewise.
7949 * tests/regression.at (AT_CHECK_DANCER): Likewise.
7950 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
7951
7952 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
7953
7954 * tests/calc.at, tests/actions.at: Workaround for SGI
7955 C++ compiler. (trivial change)
7956
7957 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
7958
7959 Spent a few hours checking out which prerequisite versions the
7960 current sources actually require. I went all the way back to
7961 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
7962 a seemingly endless set of combinations of versions more recent
7963 than that. The bottom line is that the current sources require
7964 fairly recent versions of the build tools, and it'll be some work
7965 to change this.
7966 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
7967 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
7968 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
7969 Add comments explaining why those particular versions are
7970 currently needed.
7971
7972 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
7973 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
7974 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
7975
7976 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
7977 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
7978
7979 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
7980
7981 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
7982 0.11.5. Suggested by Bruno Haible.
7983 * bootstrap: Remove gettext version checking.
7984
7985 * doc/bison.texinfo (Decl Summary): Also mention that %union
7986 can depend on prerequisite types. Problem reported by Tim
7987 Van Holder.
7988
7989 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
7990
7991 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
7992 * README-alpha: Don't tell people not to package this.
7993
7994 * bootstrap: Don't assume $(...) works; use `...` instead.
7995 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
7996 gettext better.
7997
7998 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
7999 put into the -d output file, and mention what to do if YYSTYPE is
8000 defined as a macro.
8001
8002 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
8003
8004 Undo change made earlier today: it caused autopoint to not bring
8005 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
8006 autopoint's.
8007
8008 * bootstrap: Check that gettext version matches what's in
8009 configure.ac. Warn users to ignore robots.txt ERROR 404.
8010 * bootstrap: Undo today's earlier change (logged below).
8011 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
8012
8013 The gettext version checking is causing more trouble than it's
8014 curing; remove it. Problem reported by Paul Hilfinger.
8015
8016 * bootstrap: Issue a warning that one can expect a message
8017 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
8018 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
8019
8020 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
8021
8022 Ensure that the C++ compiler used for testing actually works on a
8023 simple test program; if not, skip the C++-related tests. Problem
8024 reported by Vin Shelton in:
8025 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
8026
8027 * m4/cxx.m4: New file.
8028 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
8029 * tests/atlocal.in (BISON_CXX_WORKS): Add.
8030 * tests/local.at (AT_COMPILE_CXX): Use it.
8031
8032 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8033
8034 * data/glr.c (yylloc): Output this macro even if locations are not
8035 being generated, as the GLR parser needs it even in that case.
8036 Problem reported by Troy A. Johnson
8037 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
8038
8039 * configure.ac (AC_INIT): Update to 1.875e.
8040
8041 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8042
8043 * NEWS: Version 1.875d.
8044 * configure.ac (AC_INIT): Likewise.
8045 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
8046
8047 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
8048 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
8049 lalr1.cc runs afoul of the first, and the last two are no longer
8050 supported by GCC 3.4.0.
8051 * README: Mention GNU m4 1.4 or later; mention m4 patches.
8052 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
8053
8054 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
8055
8056 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
8057 unsigned int, for compatibility with latest gnulib hash module.
8058 * src/state.c (state_hash, state_hasher): Likewise.
8059 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
8060 * src/uniqstr.c (hash_uniqstr): Likewise.
8061
8062 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
8063
8064 * NEWS: Unescaped newlines are no longer allowed in char & strings.
8065
8066 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
8067 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
8068 character and string literals.
8069 (unexpected_end): New function.
8070 (unexpected_eof): Use it.
8071 (unexpected_newline): New function.
8072 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
8073 actions.
8074
8075 * NEWS: Document %expect-rr.
8076
8077 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
8078 Fix typo by replacing $1 with $option.
8079 Remove more 'intl'-related files.
8080 Don't DEFUN AM_INTL_SUBDIR twice.
8081
8082 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
8083 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
8084 strtoul.c.
8085 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
8086 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
8087 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
8088 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
8089 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
8090 * src/.cvsignore: Add *.output.
8091
8092 * src/parse-gram.y: Put copyright notice inside %{ %} so it
8093 gets copied to the output file.
8094
8095 2004-04-28 Paul Eggert <eggert@twinsun.com>
8096
8097 Get files from the gnulib and po repositories, instead of relying
8098 on them being in our CVS. Upgrade to latest versions of gnulib
8099 and Automake.
8100
8101 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
8102 * bootstrap: Bootstrap from gnulib and po repositories.
8103 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
8104 * README-cvs: Document these changes. Remove version numbers from
8105 mentions of build tools, since they change so often. Mention Flex.
8106
8107 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
8108 (gl_USE_SYSTEM_EXTENSIONS): Add.
8109 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
8110 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
8111 does this for us.
8112 (AC_ISC_POSIX): Remove; we no longer support this
8113 ancient OS, as it gets in the way of latest Autoconf & gnulib.
8114 (AC_HEADER_STDC): Remove: we now assume C89 or better.
8115 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
8116 Do not check for C89 headers, except for locale.h which is used
8117 by the Yacc library and must port to K&R hosts.
8118 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
8119 Do not check for C89 functions, except for setlocale which is
8120 used by the Yacc library.
8121 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
8122 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
8123 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
8124 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
8125 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
8126 AM_GNU_GETTEXT): Remove; now done by:
8127 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
8128 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
8129 for us.
8130
8131 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
8132 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
8133 Define to empty, as gnulib.mk will do the rest for us.
8134 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
8135 for us.
8136 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
8137 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
8138
8139 * src/files.c: Include gnulib's xstrndup.h.
8140
8141 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
8142 (REALLOC): Use xnrealloc, for likewise.
8143 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
8144 (strnlen, memrchr): Remove decls; functions no longer used.
8145 Include <stpcpy.h>.
8146
8147 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
8148 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
8149 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
8150 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
8151 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
8152 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
8153 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
8154 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
8155 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
8156 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
8157 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
8158 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8159 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
8160 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
8161 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
8162 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
8163 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
8164 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
8165 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
8166 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
8167 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
8168 Remove, as these files are now generated automatically
8169 by bootstrap or automake.
8170
8171 * po/ChangeLog: Remove: all but one entry was a duplicate
8172 of this file, and I moved that 2000-11-02 entry here.
8173
8174 * config/.cvsignore: Add Makefile, depcomp, install-sh.
8175 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
8176 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
8177 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
8178 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
8179 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
8180 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
8181 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
8182 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
8183 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
8184 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
8185 xstrndup.h.
8186 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
8187 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
8188 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
8189 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
8190 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
8191 * src/.cvsignore: Remove *_.c.
8192
8193
8194 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
8195 support it. (The latest stable gzip doesn't.)
8196
8197 2004-04-27 Paul Eggert <eggert@twinsun.com>
8198
8199 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
8200 case, as stos_ is now used by destructors due to the 2004-02-09
8201 change.
8202
8203 Remove more K&R C support.
8204 * lib/libiberty.y (PARAMS): Remove. All uses removed.
8205 * lib/subpipe.c (errno): Remove decl.
8206 Include <stdlib.h> unconditionally.
8207 (EXIT_FAILURE): Remove macro.
8208 * src/complain.c (vfprintf, strerror): Remove.
8209 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
8210 unconditionally.
8211 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
8212 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
8213 (strchr, strspn, memchr): Remove decls.
8214 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
8215 unconditionally. Do not declare perror.
8216 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
8217 unconditionally.
8218
8219 * src/complain.c (_): Remove useless defn, as system.h defines this.
8220
8221 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
8222 with latest obstack.h.
8223 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
8224 to procedure types, as obstack.h now does that for us.
8225 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
8226
8227 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
8228 so that this include file can stand alone.
8229 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
8230 does this now. Include subpipe.h first after config.h, to
8231 test whether it can stand alone.
8232
8233 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
8234 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
8235 unused declaration.
8236
8237 * tests/synclines.at (%union synch line): Put a dummy member in
8238 the union, because empty unions aren't allowed in C. Caught
8239 by GCC 3.4.0.
8240
8241 2004-04-13 Jim Meyering <jim@meyering.net>
8242
8243 * src/conflicts.c (conflicts_print): Correct format string typo:
8244 use `%%' to produce literal `%'. (trivial change)
8245
8246 2004-03-30 Paul Eggert <eggert@twinsun.com>
8247
8248 * src/getargs.c (version): Update copyright year to 2004.
8249
8250 * data/c.m4 (b4_int_type): Use 'short int' rather than
8251 'short', and similarly for 'long', 'unsigned', etc.
8252 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
8253 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
8254 yy_yypstack, yydumpstack): Likewise.
8255 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
8256 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
8257 Likewise.
8258 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
8259 yy_stack_print, yyparse): Likewise.
8260 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
8261 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
8262 * lib/bitset.c (bitset_print): Likewise.
8263 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
8264 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8265 * lib/bitsetv.c (bitsetv_dump): Likewise.
8266 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
8267 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
8268 Likewise.
8269 * src/LR0.c (allocate_itemsets): Likewise.
8270 * src/gram.h (rule_number, rule): Likewise.
8271 * src/lalr.h (goto_number): Likewise.
8272 * src/nullable.c (nullable_compute): Likewise.
8273 * src/output.c (prepare_rules): Likewise.
8274 * src/relation.c (relation_print, relation_digraph): Likewise.
8275 * src/relation.h (relation_node): Likewise.
8276 * src/state.h (state_number, transitions, errs, reductions,
8277 struct state): Likewise.
8278 * src/symtab.h (symbol_number, struct symbol): Likewise.
8279 * src/tables.c (vector_number, tally, action_number,
8280 default_goto, goto_actions): Likewise.
8281 * tests/existing.at (GNU Cim Grammar): Likewise.
8282 * tests/regression.at (Web2c Actions): Likewise.
8283
8284 * src/output.c (muscle_insert_short_int_table): Renamed from
8285 muscle_insert_short_table. All uses changed.
8286
8287 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8288
8289 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
8290 (declaration): Replace expected_conflicts with expected_sr_conflicts.
8291 Add %expect-rr rule.
8292
8293 * src/scan-gram.l: Recognize %expect-rr.
8294
8295 * src/conflicts.h (expected_sr_conflicts): Rename from
8296 expected_conflicts.
8297 (expected_rr_conflicts): Declare.
8298
8299 * src/conflicts.c (expected_sr_conflicts): Rename from
8300 expected_conflicts.
8301 (expected_rr_conflicts): Define.
8302 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
8303 for GLR parsers.
8304 Use expected_sr_conflicts in place of expected_conflicts.
8305 Warn if expected_rr_conflicts used in non-GLR parser.
8306
8307 * doc/bison.texinfo: Add documentation for %expect-rr.
8308
8309 2004-03-08 Paul Eggert <eggert@gnu.org>
8310
8311 Add support for hex token numbers. Suggested by Odd Arild Olsen in
8312 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
8313
8314 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
8315 in lalr1.cc.
8316 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
8317 * src/scan-gram.l (scan_integer): New function.
8318 ({int}): Use it.
8319 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
8320 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
8321 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
8322 Say "long int", not "long", for uniformity with GNU style.
8323
8324 2004-02-25 Paul Eggert <eggert@twinsun.com>
8325
8326 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
8327 compilers. This fixes a problem with Intel's C++ compiler being
8328 chatty, reported by Guido Trentalancia in
8329 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
8330
8331 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
8332
8333 Support %destructor and merge error locations in lalr1.cc.
8334
8335 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
8336 (Parser::stos_): Define unconditionally.
8337 (Parser::destruct_): New method. Generate its body with
8338 b4_yydestruct_generate.
8339 (Parser::error_start_): New attribute.
8340 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
8341 token which are discarded.
8342 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
8343 error_start_ when erroneous token are discarded.
8344 (Parser::parse) <yyerrlab1>: Compute the location of the error
8345 token so that it covers all the discarded tokens.
8346 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
8347 it can be called with `%skeleton "lalr1.cc"', and do that.
8348
8349 2004-02-02 Paul Eggert <eggert@twinsun.com>
8350
8351 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
8352 $(top_srcdir)/lib and ../lib. This fixes a bug reported
8353 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
8354 There's no need to mention top_builddir since Automake does that
8355 for us.
8356 (INCLUDES): Remove, as Automake says it's obsolescent.
8357 Contents migrated into AM_CPPFLAGS as described above.
8358 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
8359
8360 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8361
8362 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
8363 (yyreportSyntaxError): Handle case where lookahead token is
8364 YYEMPTY.
8365
8366 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8367
8368 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
8369 resulting parsers are compilable with C++.
8370
8371 2003-12-23 Paul Eggert <eggert@twinsun.com>
8372
8373 * config/depcomp, config/install-sh: Sync with Automake 1.8.
8374 * src/output.c (output_skeleton): Rename local var.
8375 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
8376 Bison tokens, as this runs afoul of the 2003-10-07 change that
8377 disallowed NUL bytes in character constants or string literals.
8378
8379 * tests/local.at: Require Autoconf 2.59's Autotest.
8380 * tests/testsuite.at: Don't include local.at, since we now assume
8381 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
8382 including it.
8383 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
8384 multiple inclusion warnings.
8385
8386 2003-12-02 Akim Demaille <akim@epita.fr>
8387
8388 * doc/bison.texinfo (How Can I Reset the Parser): More about start
8389 conditions.
8390 From Bruno Haible.
8391
8392 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
8393
8394 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
8395
8396 2003-10-07 Paul Eggert <eggert@twinsun.com>
8397
8398 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
8399 if testsuite doesn't exist.
8400
8401 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
8402 literals, unfortunately.
8403 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
8404 Complain about NUL bytes in character constants or string literals.
8405
8406 2003-10-05 Paul Eggert <eggert@twinsun.com>
8407
8408 * NEWS: Don't document %no-default-prec, as it's still
8409 too experimental.
8410 * doc/bison.texinfo: Document %no-default-prec only if
8411 the defaultprec flag is set. Normally it's not.
8412
8413 2003-10-04 Paul Eggert <eggert@twinsun.com>
8414
8415 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
8416 non-modifiable lvalue, instead of a modifiable one.
8417 * doc/bison.texinfo (Actions): Document that $$ can
8418 be assigned to. Do not claim that $$ and $N are
8419 array element references: user code should not rely on this.
8420
8421 2003-10-01 Paul Eggert <eggert@twinsun.com>
8422
8423 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
8424 (grammar_declaration): Use it.
8425 * src/scan-gram.l: New token %no-default-prec.
8426 * tests/conflicts.at: Revamp tests to use %no-default-prec.
8427 * NEWS, doc/bison.texinfo: Document the above.
8428
8429 2003-10-01 Akim Demaille <akim@epita.fr>
8430
8431 VCG no longer supports long_straight_phase.
8432
8433 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
8434 * src/print_graph.c (print_graph): Adjust.
8435
8436 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
8437 and Paul Eggert <eggert@twinsun.com>
8438
8439 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
8440 Table of Symbols): Document %default-prec.
8441 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
8442 (grammar_declaration): Set default_prec on %default-prec.
8443 * src/scan-gram.l (%default-prec): New token.
8444 * src/reader.h (default_prec): New flag.
8445 * src/reader.c: Likewise.
8446 (packgram): Handle it.
8447 * tests/conflicts.at (%default-prec without %prec,
8448 %default-prec with %prec, %default-prec 1): New tests.
8449
8450 2003-09-30 Paul Eggert <eggert@twinsun.com>
8451
8452 * tests/testsuite.at: Include local.at, not input.at, fixing
8453 a typo in the 2003-08-25 patch.
8454
8455 2003-08-27 Akim Demaille <akim@epita.fr>
8456
8457 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
8458 GCC warnings.
8459
8460 2003-08-26 Akim Demaille <akim@epita.fr>
8461
8462 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
8463 "<\#" to avoid magic from Gnus when posting parts of this script.
8464
8465 2003-08-26 Akim Demaille <akim@epita.fr>
8466
8467 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
8468 (Parser::parse): here.
8469 Adjust: nerrs and errstatus is now replaced by...
8470 (Parser::nerrs_, Parser::errstatus_): New.
8471
8472 2003-08-25 Akim Demaille <akim@epita.fr>
8473
8474 * config/announce-gen, Makefile.cfg: New.
8475 * Makefile.am: Adjust.
8476 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
8477 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
8478
8479 2003-08-25 Akim Demaille <akim@epita.fr>
8480
8481 When reducing initial empty rules, Bison parser read an initial
8482 location that is not defined. This results in garbage, and that
8483 affects Bison's own parser. Therefore we need (i) to extend Bison
8484 to support a means to initialize this location, and (ii) to use
8485 this CVS Bison to fix CVS Bison's parser.
8486
8487 * src/reader.h, reader.c (epilogue_augment): Remove, replace
8488 with...
8489 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
8490 * src/parse-gram.y: Adjust.
8491 (%initial-action): New.
8492 (%error-verbose): Since we require CVS Bison, there is no reason
8493 not to use it.
8494 * src/scan-gram.l: Adjust.
8495 * src/Makefile.am (YACC): New, to make sure we use our own parser.
8496 * data/yacc.c (yyparse): Use b4_initial_action.
8497
8498 2003-08-25 Akim Demaille <akim@epita.fr>
8499
8500 * doc/bison.texinfo: Don't promote stdout for error messages.
8501
8502 2003-08-25 Akim Demaille <akim@epita.fr>
8503
8504 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
8505 From Alexandre Duret-Lutz.
8506
8507 2003-08-25 Akim Demaille <akim@epita.fr>
8508
8509 Version 1.875c.
8510
8511 2003-08-25 Akim Demaille <akim@epita.fr>
8512
8513 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
8514 Use them.
8515
8516 2003-08-25 Akim Demaille <akim@epita.fr>
8517
8518 * data/lalr1.cc (Parser::reduce_print_): New.
8519 Use it.
8520
8521 2003-08-25 Akim Demaille <akim@epita.fr>
8522
8523 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
8524 error recovery loops. This patch is based on
8525 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
8526 Also, augment the similarity between lalr1.cc and yacc.c.
8527 Note: the locations of error recovery rules are not correct yet.
8528
8529 * data/lalr1.cc: Comment changes to augment the similarity between
8530 lalr1.cc and yacc.c.
8531 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
8532 (yyerrlab1): Remove, but where it used to be (now the bottom part of
8533 yyerrlab), when hitting EOF, pop the whole stack here instead of
8534 merely falling thru the default error handling mechanism.
8535 (yyerrorlab): New label, with the old contents of YYERROR,
8536 plus the following change: pop the stack of rhs corresponding
8537 to the production that invoked YYERROR. That is how Yacc
8538 behaves (required by POSIX).
8539 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
8540 fail.
8541
8542 2003-08-25 Akim Demaille <akim@epita.fr>
8543
8544 Tune local.at so that people can "autom4te -l autotest calc.at -o
8545 calc" for instance, to extract a sub test suite.
8546
8547 * tests/testsuite.at: Move the initialization, Autotest version
8548 requirement, and AT_TESTED invocation into...
8549 * tests/local.at: here.
8550 * tests/testsuite.at: Include it for compatibility with Autoconf
8551 2.57.
8552 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
8553 be ignore.
8554
8555 2003-08-04 Paul Eggert <eggert@twinsun.com>
8556
8557 Rework code slightly to avoid gcc -Wtraditional warnings.
8558 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
8559 The returned value is now stored in *YY0. All callers changed.
8560 * src/output.c (merge_output): Adjust to the above change.
8561
8562 2003-07-26 Paul Eggert <eggert@twinsun.com>
8563
8564 * data/glr.c (YYASSERT): New macro.
8565 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
8566 yyresolveStates, yyprocessOneStack):
8567 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
8568 Derived from a suggestion by Frank Heckenbach.
8569
8570 2003-07-25 Paul Eggert <eggert@twinsun.com>
8571
8572 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
8573 for portability to K&R C (after ansi2knr, presumably). See
8574 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
8575 by Frank Heckenbach, though I have omitted the structure-initialization
8576 part of his glr-knr.diff patch since I recall that the Portable
8577 C Compiler didn't require that change.
8578
8579 Let the user specify how to allocate and free memory.
8580 Derived from a suggestion by Frank Heckenbach in
8581 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
8582 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
8583 All uses of free, malloc, realloc changed to use these macros,
8584 and unnecessary casts removed.
8585 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
8586
8587 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
8588
8589 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
8590 use s.empty() rather than s == "" to test for empty string; see
8591 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
8592 (trivial change)
8593
8594 2003-06-25 Akim Demaille <akim@epita.fr>
8595
8596 * config/depcomp, config/install-sh: Update from masters.
8597
8598 2003-06-20 Paul Eggert <eggert@twinsun.com>
8599
8600 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
8601 and return properly parenthesized result.
8602 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
8603 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8604 Remove unnecessary parentheses from uses.
8605 * doc/bison.texinfo (Location Default Action): Describe the
8606 conventions for parentheses.
8607
8608 2003-06-19 Paul Eggert <eggert@twinsun.com>
8609
8610 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
8611 yyreportTree): Do not assume that size_t is the same width as int,
8612 when printing sizes. Print sizes using an unsigned format.
8613 Problem reported by Frank Heckenbach in
8614 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
8615
8616 Port to Forte Developer 7 C compiler.
8617 * data/glr.c (struct YYLTYPE): If locations are not being used,
8618 declare a single dummy member, as empty structs do not conform
8619 to the C standard.
8620 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
8621 the Forte Developer 7 C compiler complains that end-of-loop
8622 code is not reached.
8623
8624 2003-06-17 Paul Eggert <eggert@twinsun.com>
8625
8626 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
8627 avoid warnings from picky compilers about redefinition of PARAMS.
8628
8629 2003-06-17 Paul Eggert <eggert@twinsun.com>
8630
8631 Version 1.875b.
8632
8633 * NEWS: Document 1.875b.
8634
8635 * lib/bbitset.h: Do not include config.h; that's the includer's job.
8636 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
8637 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
8638 Don't use 'index' in comments, as it's a builtin fn on some hosts.
8639 * lib/bitset_stats.c: Include gettext.h unconditionally, as
8640 per recent gettext manual's suggestion.
8641 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
8642 Use prototypes, not old-style definitions.
8643 * lib/lbitset.c (lbitset_unused_clear): Likewise.
8644 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
8645 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
8646 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
8647 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
8648 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
8649 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
8650 vbitset_or_and_cmp, vbitset_copy): Likewise.
8651
8652 * lib/libiberty.h: Do not include config.h; that's the includer's job.
8653 Do not include <stdlib.h>.
8654 (PARAMS): Define unconditionally for C89.
8655 (ATTRIBUTE_NORETURN): Remove.
8656 (ATTRIBUTE_UNUSED): Define unconditionally.
8657
8658 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
8659 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8660 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
8661 * lib/vbitset.c, lib/vbitset.h: New files.
8662 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
8663 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
8664 from libbitset.
8665
8666 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
8667 `How Can I Reset @code{yyparse}', since texinfo does not allow
8668 arbitrary @ in node names.
8669
8670 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
8671 shouldn't be needed according to the gettext 0.12.1 documentation
8672 but which seem to be needed anyway: codeset.m4 glibc21.m4
8673 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8674 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
8675 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
8676
8677 * lib/.cvsignore: Add stdbool.h.
8678 * m4/.cvsignore: Add nls.m4, po.m4.
8679
8680 Upgrade to CVS gnulib.
8681 * stdbool_.h: File renamed from stdbool.h.in.
8682 * configure.ac (AM_STDBOOL_H): Invoke this instead of
8683 AC_HEADER_STDBOOL.
8684 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
8685 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
8686 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
8687 (MOSTLYCLEANFILES): New var.
8688 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
8689 (stdbool.h): New rule.
8690 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
8691 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
8692 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
8693 m4/quote.m4: Upgrade to today's gnulib.
8694
8695 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
8696 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
8697 the tests right now.
8698 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
8699 yyerror are declared before use; C99 requires this.
8700
8701 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8702
8703 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
8704 first.
8705 (yyrecoverSyntaxError): Correct the logic for setting and testing
8706 yyerrState.
8707 Correct comment on handling EOF.
8708 Allow states with only a default reduction, rather than failing
8709 (I can't quite reconstruct why these were not allowed before).
8710
8711 Fixes to avoid problem that $-N rules in GLR parsers can cause
8712 buffer overruns, corrupting state.
8713
8714 * src/output.c (prepare_rules): Output max_left_semantic_context
8715 definition.
8716 * src/reader.h (max_left_semantic_context): New variable declaration.
8717 * src/scan-gram.l (max_left_semantic_context): Define.
8718 (handle_action_dollar): Update max_left_semantic_context.
8719 * data/glr.c (YYMAXLEFT): New definition.
8720 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
8721 (yyresolveAction): Ditto.
8722
8723 Fixes to problems with location handling in GLR parsers reported by
8724 Frank Heckenbach (2003/06/05).
8725
8726 * data/glr.c (YYLTYPE): Make trivial if locations not used.
8727 (YYRHSLOC): Add parentheses, and define only if locations used.
8728 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
8729 locations not used.
8730 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
8731 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8732
8733 * tests/cxx-type.at: Exercise location information; update tests
8734 to differentiate output with and without locations.
8735 Remove forward declarations of yylex and yyerror---caused errors
8736 because default YYLTYPE not yet defined.
8737 Change semantic actions to compute strings, rather than printing
8738 them directly (to test proper passing of semantics values). Change
8739 output to prefix notation and update test data and expected results.
8740 (yylex): Track locations.
8741 (stmtMerge): Return value rather than printing, and include arguments
8742 in value.
8743
8744 2003-06-03 Paul Eggert <eggert@twinsun.com>
8745
8746 Avoid warnings generated by GCC 2.95.4 when Bison is
8747 configured with --enable-gcc-warnings.
8748 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
8749 yy::]b4_parser_class_name[::translate_,
8750 yy::Stack::operator[] (unsigned),
8751 yy::Stack::operator[] (unsigned) const,
8752 yy::Slice::operator[] (unsigned),
8753 yy::Slice::operator[] (unsigned) const):
8754 Rename local vars to avoid warnings.
8755 * tests/glr-regression.at (Improper handling of embedded actions
8756 and $-N in GLR parsers): Remove unused local variable from yylex.
8757 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
8758 (void) as arg when not pure, since we now assume C89 when building
8759 Bison. Pacify GCC by using parameter.
8760
8761 2003-06-02 Paul Eggert <eggert@twinsun.com>
8762
8763 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
8764 yy::Location::lines, yy::Location::columns): Rename arguments
8765 to avoid shadowing; this removes a warning generated by GCC 3.3.
8766
8767 2003-06-01 Paul Eggert <eggert@twinsun.com>
8768
8769 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
8770 to g++, as GCC 3.3 complains if you do it.
8771 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
8772 everything that WARNING_CFLAGS has, except omit warnings
8773 not suitable for C++.
8774 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
8775 * tests/atlocal.in (CXXFLAGS): New var.
8776 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
8777
8778 Fix a GLR parser bug I reported in February; see
8779 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
8780 The problem was that GLR parsers did not conform to the C standard,
8781 because actions like { $1 = $2 + $3; } expanded to expressions
8782 that invoked YYFILL in separate subexpressions, and YYFILL assigned
8783 to a local variable. The C standard says that expressions
8784 like (var = f ()) + (var = f ()) have undefined behavior.
8785 Another problem was that GCC sometimes issues warnings that
8786 yyfill and its parameters are unused.
8787
8788 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
8789 as possibly unused.
8790 (yyfill): New function.
8791 (YYFILL): Use it.
8792 (yyuserAction): Change type of yynormal to bool, so that it matches
8793 the new yyfill signature. Mark it as possibly unused.
8794
8795
8796 Follow up on a bug I reported in February, where a Bison-generated
8797 parser can loop. Provide a test case and a fix for yacc.c. I
8798 don't have a fix for lalr1.cc or for glr.c, unfortunately.
8799 The original bug report is in:
8800 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
8801
8802 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
8803 macro's size was becoming unwieldy.
8804 (yyerrlab): Do not discard an empty lookahead symbol, as this
8805 might destroy garbage.
8806 (yyerrorlab): New label, with the old contents of YYERROR,
8807 plus the following change: pop the stack of rhs corresponding
8808 to the production that invoked YYERROR. That is how Yacc
8809 behaves, and POSIX requires this behavior.
8810 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
8811 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
8812 Define 'alarm' to do nothing if unistd.h is not available.
8813 Add a new rule "exp: '-' error;" to test the above change to
8814 data/yacc.c. Use 'alarm' to abort any test taking longer than
8815 10 seconds, as it's probably looping.
8816 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
8817 Also, the new yacc.c generates two fewer diagnostics for an
8818 existing test.
8819
8820 2003-05-24 Paul Eggert <eggert@twinsun.com>
8821
8822 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
8823 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
8824 This fixes a problem reported by John Bowman when the Compaq/HP
8825 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
8826 -ansi -Wall -gall).
8827 * data/yacc.c (union yyalloc): Likewise.
8828 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
8829
8830 Switch from 'int' to 'bool' where that makes sense.
8831
8832 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
8833 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
8834 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
8835 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
8836 Return or accept bool, not int. All callers changed.
8837 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
8838 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
8839 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
8840 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
8841 bitset_or_and_cmp_): Likewise.
8842 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
8843 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
8844 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
8845 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
8846 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
8847 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
8848 bitset_stats_or_and_cmp): Likewise.
8849 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
8850 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
8851 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
8852 ebitset_xor_cmp): Likewise.
8853 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
8854 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
8855 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
8856 lbitset_xor_cmp): Likewise.
8857 * lib/bbitset.h: Include <stdbool.h>.
8858 (struct bitset_vtable): The following members now return bool, not
8859 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
8860 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
8861 or_and_cmp).
8862 * src/conflicts.c (count_rr_conflicts): Likewise.
8863 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
8864 All uses changed.
8865 * lib/ebitset.c (ebitset_obstack_init): Likewise.
8866 * lib/lbitset.c (lbitset_obstack_init): Likewise.
8867 * src/getargs.c (debug_flag, defines_flag, locations_flag,
8868 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
8869 graph_flag): Likewise.
8870 * src/getargs.h (debug_flag, defines_flag, locations_flag,
8871 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
8872 graph_flag): Likewise.
8873 * src/output.c (error_verbose): Likewise.
8874 * src/output.h (error_verbose): Likewise.
8875 * src/reader.c (start_flag, typed): Likewise.
8876 * src/reader.h (typed): Likewise.
8877 * src/getargs.c (LOCATIONS_OPTION): New constant.
8878 (long_options, getargs): Use it.
8879 * src/lalr.c (build_relations): Use bool, not int.
8880 * src/nullable.c (nullable_compute): Likewise.
8881 * src/print.c (print_reductions): Likewise.
8882 * src/tables.c (action_row, pack_vector): Likewise.
8883 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
8884 * src/output.c (prepare): Use it.
8885 * src/output.c (token_definitions_output,
8886 symbol_destructors_output, symbol_destructors_output): Use string,
8887 not boolean integer, to keep track of whether to output separator.
8888 * src/print_graph.c (print_core): Likewise.
8889 * src/state.c (state_rule_lookaheads_print): Likewise.
8890
8891 * config/install-sh: Sync from automake 1.7.5.
8892
8893 2003-05-14 Paul Eggert <eggert@twinsun.com>
8894
8895 * src/parse-gram.y (rules_or_grammar_declaration): Require a
8896 semicolon after a grammar declaration, in the interest of possible
8897 future changes to the Bison input language.
8898 Do not allow a stray semicolon at the start of the grammar.
8899 (rhses.1): Allow one or more semicolons after any rule, including
8900 just before "|" as required by POSIX.
8901 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
8902 grammar.
8903
8904 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
8905
8906 %parse-param support for lalr1.cc.
8907
8908 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
8909 b4_cc_constructor_calls, b4_cc_constructor_call,
8910 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
8911 definitions.
8912 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
8913 parse-param arguments.
8914 (yy::b4_parser_class_name): Declare instance variables to
8915 hold parse-param arguments.
8916 * tests/calc.at: s/value/semantic_value/ because value clashes
8917 with a member of yy::b4_parser_class_name. Adjust C++ code
8918 to handle %parse-param. Enable %parse-param test in C++.
8919
8920 2003-05-12 Paul Eggert <eggert@twinsun.com>
8921
8922 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
8923 English a bit. Fix fclose typo. Change "const char" to "char
8924 const", and use ANSI C rather than K&R for "main". Suggest
8925 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
8926 and suggest yy_switch_to_buffer.
8927
8928 2003-05-05 Paul Eggert <eggert@twinsun.com>
8929
8930 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
8931 C89. This avoids a diagnostic on compilers that define __STDC__
8932 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
8933 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
8934
8935 2003-05-03 Paul Eggert <eggert@twinsun.com>
8936
8937 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
8938 Do not overrun array bounds.
8939 This should fix a bug reported today by Olatunji Oluwabukunmi in
8940 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
8941
8942 2003-04-29 Akim Demaille <akim@epita.fr>
8943
8944 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
8945 * src/getargs.c, src/getargs.h: here, as bool, not int.
8946 (nondeterministic_parser): New.
8947 * src/parse-gram.y, src/scan-gram.l: Support
8948 %nondeterministic-parser.
8949 * src/output.c (prepare): Use nondeterministic_parser instead
8950 of glr_parser where appropriate.
8951 * src/tables.c (conflict_row, action_row, save_row)
8952 (token_actions, token_actions, pack_vector): Ditto.
8953
8954 2003-04-29 Akim Demaille <akim@epita.fr>
8955
8956 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
8957
8958 2003-04-29 Akim Demaille <akim@epita.fr>
8959
8960 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
8961 with %pure-parser and %locations to exercise the patch from Yakov
8962 Markovitch below.
8963
8964 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
8965
8966 * data/yacc.c: (b4_lex_param): Corrected for the case where
8967 %lex-param is provided and %pure-parser isn't.
8968
8969 2003-04-27 Paul Eggert <eggert@twinsun.com>
8970
8971 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
8972 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
8973 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
8974 if it is not defined.
8975 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
8976
8977 2003-04-26 Paul Eggert <eggert@twinsun.com>
8978
8979 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
8980 Declare to be of type suitable for the ninf value itself, not of
8981 type suitable for the corresponding table, since the latter might
8982 be unsigned but the ninf value might be negative. This fixes a
8983 bug reported by Alexandre Duret-Lutz in
8984 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
8985
8986 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
8987 invokes it. We shouldn't invoke it twice because it will attempt
8988 to put error.o in the archive twice. This fixes a glitch reported
8989 by Martin Mokrejs in
8990 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
8991
8992 2003-04-21 Paul Eggert <eggert@twinsun.com>
8993
8994 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
8995 to gnulib.
8996
8997 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
8998
8999 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
9000 Fix obvious typo that results in uncompilable GLR parsers
9001 when both %pure-parser and %locations are used. (trivial change)
9002
9003 2003-04-17 Paul Eggert <eggert@twinsun.com>
9004
9005 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
9006 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
9007 Do not insert the expected token via unput, as this runs afoul
9008 of a POSIX-compatibility bug in flex 2.5.31.
9009 All uses changed to BEGIN the parent state,
9010 since we no longer insert the expected token via unput.
9011 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
9012 that is no longer emitted after the above change.
9013
9014 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
9015 the first one. This change is from Paul Hilfinger, and it fixes
9016 regression reported by Werner Lemberg in
9017 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
9018
9019 (resolve_sr_conflict): Don't invoke state_errs_set
9020 unless one or more tokens have been explicitly made errors.
9021 Otherwise, the above change causes Bison to abort.
9022
9023 * tests/existing.at (GNU pic Grammar): New test case, taken from
9024 Lemberg's email.
9025
9026 2003-03-31 Akim Demaille <akim@epita.fr>
9027
9028 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
9029
9030 2003-03-31 Akim Demaille <akim@epita.fr>
9031
9032 * src/output.c (prepare_symbols): Avoid trailing spaces in the
9033 output.
9034
9035 2003-03-31 Akim Demaille <akim@epita.fr>
9036
9037 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
9038 From Paul Hilfinger.
9039
9040 2003-03-29 Akim Demaille <akim@epita.fr>
9041
9042 * m4/error.m4: Do not put under dynamic conditions some code which
9043 expansion is under static control.
9044
9045 2003-03-29 Akim Demaille <akim@epita.fr>
9046
9047 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
9048
9049 2003-03-29 Akim Demaille <akim@epita.fr>
9050
9051 * doc/bison.texinfo (Strings are Destroyed): New.
9052
9053 2003-03-13 Paul Eggert <eggert@twinsun.com>
9054
9055 * .cvsignore: Add configure.lineno.
9056 * src/.cvsignore: Add yacc.
9057 * tests/.cvsignore: Add testsuite.log.
9058 * doc/fdl.texi: Sync with latest FSF version.
9059
9060 2003-03-12 Paul Eggert <eggert@twinsun.com>
9061
9062 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
9063 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
9064 cursor, instead of leaving it undefined. This fixes a bug
9065 reported by Tim Van Holder in
9066 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
9067 * tests/input.at (Torturing the Scanner): Test the scanner on
9068 an empty input file, which was Tim Van Holder's test case.
9069
9070 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
9071 <sys/resource.h> can be included, include sys/time.h and
9072 sys/times.h first, if available. This works around the SunOS
9073 4.1.4 porting bug reported by Bruce Becker in
9074 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
9075
9076 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
9077 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
9078 AC_HEADER_SYS_WAIT.
9079
9080 Merge changes from gnulib. This was prompted because the CVS
9081 snapshot didn't build on Solaris 7 due to strnlen problems.
9082
9083 These changes need to be merged back into gnulib:
9084 * lib/hash.c: Include <stdbool.h> unconditionally.
9085 * m4/onceonly.m4 (m4_quote): New macro.
9086 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
9087 Quote AC_FOREACH variable-expansions properly.
9088 The 2003-01-03 obstack.h change also needs merging.
9089 {end of changes requiring merging}
9090
9091 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
9092 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
9093 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
9094 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
9095 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
9096 New files, imported from gnulib.
9097 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
9098 above.
9099
9100 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
9101 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
9102 gnulib sources.
9103
9104 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
9105 Add.
9106 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
9107 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
9108 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
9109 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
9110 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
9111 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
9112 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
9113 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
9114 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
9115 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
9116 (jm_PREREQ_ARGMATCH): Remove.
9117 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
9118 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
9119
9120 * src/system.h: Include <stdbool.h> unconditionally.
9121
9122 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
9123 assuming at least C89 in the bitset code for some time now.
9124
9125 2003-03-03 Akim Demaille <akim@epita.fr>
9126
9127 * ro.po: New.
9128
9129 2003-03-02 Akim Demaille <akim@epita.fr>
9130
9131 * doc/bison.texinfo (Table of Symbols): Reactivate the
9132 documentation for %lex-param, and %parse-param.
9133
9134 2003-03-02 Akim Demaille <akim@epita.fr>
9135
9136 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
9137 generate verbose error messages.
9138 Use the number of tokens as an upper bound in yytname, as it
9139 cannot be a non terminal.
9140
9141 2003-03-02 Akim Demaille <akim@epita.fr>
9142
9143 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
9144 message.
9145
9146 2003-03-02 Akim Demaille <akim@epita.fr>
9147
9148 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
9149 Use them to exercise yycheck overrun.
9150 Based on Andrew Suffield's grammar.
9151
9152 2003-03-02 Akim Demaille <akim@epita.fr>
9153
9154 Create tests/local.at for Bison generic testing macros.
9155
9156 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
9157 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
9158 This new file.
9159 * tests/calc.at (AT_CHECK_CALC): Adjust.
9160 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
9161 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
9162 * tests/local.at: here.
9163 (AT_COMPILE_CXX): Tags the tests using it as c++.
9164 Ignore the test if CXX is not functional.
9165
9166 2003-03-01 Paul Eggert <eggert@twinsun.com>
9167
9168 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
9169 not loc->end, since loc->end might contain garbage and this leads
9170 to undefined behavior on some platforms.
9171 (id_loc, token_start): Use (IF_LINTed) initial values that do not
9172 depend on *loc, so that the reader doesn't give the the false
9173 impression that *loc is initialized.
9174 (<INITIAL>"%%"): Do not bother setting code_start, since its value
9175 does not survive the return.
9176
9177 2003-03-01 Akim Demaille <akim@epita.fr>
9178
9179 * src/scan-gram.l (code_start): Always initialize it when entering
9180 into yylex, as SC_EPILOGUE is activated *before* the corresponding
9181 yylex invocation. An alternative would be making it static, but
9182 then it starts with the second %%'s beginning, instead of its end.
9183
9184 2003-02-28 Paul Eggert <eggert@twinsun.com>
9185
9186 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
9187 around a UnixWare 7.1.1 porting bug reported by John Hughes in
9188 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
9189
9190 2003-02-26 Paul Eggert <eggert@twinsun.com>
9191
9192 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
9193 Remove Sequent/Pyramid discussion (nobody uses them any more).
9194 Merge VMS and MS-DOS discussion; these ports may well be dead
9195 but let's keep mentioning them for now. Put <> around email
9196 addresses. Add copyright notice.
9197
9198 2003-02-24 Paul Eggert <eggert@twinsun.com>
9199
9200 * data/glr.c (yy_reduce_print): yylineno -> yylno,
9201 to avoid collision with flex use of yylineno.
9202 Problem reported by Bruce Lilly in
9203 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
9204 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9205 * data/yacc.c (yy_reduce_print): Likewise.
9206
9207 * config/depcomp: Sync with Automake 1.7.3.
9208
9209 2003-02-21 Akim Demaille <akim@epita.fr>
9210
9211 * data/lalr1.cc: Use temporary variables instead of casts to
9212 change integer types.
9213 Suggested by Paul Eggert.
9214
9215 2003-02-21 Akim Demaille <akim@epita.fr>
9216
9217 * doc/bison.texinfo: Use "location" consistently to refer to @n,
9218 to avoid confusions with lalr1.cc's notion of Position.
9219 Suggested by Paul Eggert.
9220
9221 2003-02-20 Akim Demaille <akim@epita.fr>
9222
9223 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
9224 before initial_columns.
9225 (location.hh): Use consistent variable names when defining the
9226 operator<<.
9227 Use "last" so that we subtract from Positions, not from unsigned.
9228
9229 2003-02-20 Akim Demaille <akim@epita.fr>
9230
9231 * data/lalr1.cc (position.hh): New subfile, including the extended
9232 and Doxygen'ed documentation of class Position.
9233 (location.hh): Use it.
9234 Document a` la Doxygen.
9235 With the help of Benoit Perrot.
9236
9237 2003-02-20 Akim Demaille <akim@epita.fr>
9238
9239 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
9240 AT_YACC_IF.
9241 Redefine AT_YYERROR_SEES_LOC_IF using it.
9242 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
9243 not defined.
9244 Don't use the location in yy::Parser::error_ and
9245 yy::Parser::print_ when not %locations.
9246 Activate more lalr1.cc tests.
9247
9248 2003-02-19 Akim Demaille <akim@epita.fr>
9249
9250 * data/lalr1.cc: When displaying a line number, be sure to make it
9251 an int.
9252
9253 2003-02-19 Akim Demaille <akim@epita.fr>
9254
9255 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
9256 Remove, useless.
9257 (YYABORT, YYACCEPT, YYERROR): New.
9258 * tests/calc.at: Renable the lalr1.cc test.
9259
9260 2003-02-19 Akim Demaille <akim@epita.fr>
9261
9262 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
9263 error recovery, mixing with/without pops and discarding of the
9264 lookahead.
9265 Exercise YYERROR.
9266 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
9267
9268 2003-02-17 Paul Eggert <eggert@twinsun.com>
9269
9270 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
9271 * tests/testsuite.at (AT_COMPILE): Use them.
9272 This fixes the testsuite problem reported by Robert Lentz in
9273 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
9274
9275 2003-02-12 Paul Eggert <eggert@twinsun.com>
9276
9277 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
9278 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
9279 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
9280 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
9281 Check for malloc failure, for consistency with yacc.c.
9282 (yytname_size): Remove, for consistency with yacc.c.
9283
9284 The bug still remains in data/lalr1.cc, as I didn't have time
9285 to fix it there.
9286
9287 2003-02-06 Akim Demaille <akim@epita.fr>
9288
9289 * configure.ac (GXX): Rename as...
9290 (CXX): this, to keep the original Autoconf semantics.
9291 Require 2.57.
9292 * data/lalr1.cc: Fix b4_copyright invocations.
9293 If YYDEBUG is not defined, don't depend upon name_ being defined.
9294 (location.hh): Include string and iostream.
9295 (Position::filename): New member.
9296 (Position::Position ()): New.
9297 (operator<< (Position)): New.
9298 (operator- (Position, int)): New.
9299 (Location::first, Location::last): Rename as...
9300 (Location::begin, Location::end): these, to mock the conventional
9301 iterator names.
9302 (operator<< (Location)): New.
9303 * tests/atlocal.in (CXX): New.
9304 * tests/testsuite.at (AT_COMPILE_CXX): New.
9305 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
9306 locations in a more synthetic way.
9307 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
9308 lalr1.cc is used.
9309 Adjust the C locations to match those from Emacs: first column is
9310 column 0.
9311 Change all the expected results.
9312 Conform to the GCS: simplify the locations when applicable.
9313 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
9314 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
9315 these CPP macros with the m4 macros new defined by...
9316 (AT_CHECK_PUSHDEFS): this, i.e.:
9317 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
9318 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
9319 New macros.
9320 (AT_CHECK_POPDEFS): Undefine them.
9321 (AT_CHECK_CALC_LALR1_CC): New.
9322 Use it for the first lalr1.cc test.
9323
9324 2003-02-04 Akim Demaille <akim@epita.fr>
9325
9326 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
9327 Location as is defined.
9328
9329 2003-02-04 Akim Demaille <akim@epita.fr>
9330
9331 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
9332 name_ being defined.
9333
9334 2003-02-03 Paul Eggert <eggert@twinsun.com>
9335
9336 * src/gram.h (start_symbol): Remove unused decl.
9337
9338 Use more-consistent naming conventions for local vars.
9339
9340 * src/derives.c (derives_compute): Change type of local var from
9341 int to rule_number.
9342 * src/gram.c (grammar_rules_partial_print): Likewise.
9343 * src/print.c (print_core): Likewise.
9344 * src/reduce.c (reduce_grammar_tables): Likewise.
9345
9346 * src/gram.c (grammar_dump): Change name of item_number *
9347 local var from r to rp.
9348 * src/nullable.c (nullable_compute): Likewise.
9349
9350 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
9351
9352 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
9353 for symbol or symbol_number var.
9354 * src/reader.c (grammar_start_symbol_set): Likewise.
9355 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
9356 Likewise.
9357 * src/state.c (transitions_to): Likewise.
9358 * src/state.h: Likewise.
9359 * src/tables.c (symbol_number_to_vector_number): Likewise.
9360
9361 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
9362 char * var.
9363
9364 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
9365 var.
9366
9367 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
9368 var.
9369
9370 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
9371 Use str, not s, for char * var. Use ch, not c, for character var.
9372 Use size for size var.
9373
9374 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
9375 char * var.
9376 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
9377 uniqstr var.
9378 * src/uniqstr.h: Likewise.
9379
9380 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9381 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9382 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
9383 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
9384 param to have same name as that of enum, so that we don't use
9385 "s" to stand for a non-state.
9386
9387 2003-02-02 Akim Demaille <akim@epita.fr>
9388
9389 * src/scan-skel.l: Scan more than one inert character per yylex
9390 invocation.
9391
9392 2003-02-01 Paul Eggert <eggert@twinsun.com>
9393
9394 Version 1.875a.
9395
9396 * po/LINGUAS: Add ms.
9397
9398 2003-01-30 Akim Demaille <akim@epita.fr>
9399
9400 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
9401
9402 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9403
9404 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
9405 of $1.
9406
9407 Changes in response to error report by S. Eken: GLR mode does not
9408 handle negative $ indices or $ indices in embedded rules correctly.
9409 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
9410
9411 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
9412 (b4_rhs_location): Ditto.
9413 (yyfill): New function to copy from stack tree into array
9414 incrementally.
9415 (yyuserAction): Modify to allow incremental move of semantic values
9416 to rhs array when in GLR mode.
9417 Define YYFILL to use in user-defined actions to fill semantic array
9418 as needed.
9419 Remove dummy use of yystack, as there is now a guaranteed use.
9420 (yydoAction): Modify to allow incremental move of semantic values
9421 to rhs array when in GLR mode.
9422 (yyresolveAction): Ditto.
9423 (yyglrShiftDefer): Update comment.
9424 (yyresolveStates): Use X == NULL for pointers, not !X.
9425 (yyglrReduce): Ditto.
9426 (yydoAction): Ditto
9427
9428 * tests/glr-regr1.at: Rename to ...
9429 * tests/glr-regression.at: Add new regression test for the problems
9430 described above (adapted from S. Eken).
9431 Update copyright notice.
9432 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
9433 * tests/Makefile.am: Ditto.
9434
9435 2003-01-28 Paul Eggert <eggert@twinsun.com>
9436
9437 * data/lalr1.cc: Do not use @output_header_name@ unless
9438 b4_defines_flag is set. This fixes two bugs reported by
9439 Tim Van Holder in
9440 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
9441 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
9442
9443 2003-01-21 Paul Eggert <eggert@twinsun.com>
9444
9445 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
9446 we don't need to worry about yyerrlab1 being reported as an
9447 "unused label" by non-GCC C compilers. The downside is that if
9448 locations are used then a couple of statements are duplicated each
9449 time YYERROR is invoked, but the upside is that the warnings
9450 should vanish.
9451 (yyerrlab1): Move code to YERROR.
9452 (yyerrlab2): Remove. Change uses back to yyerrlab1.
9453 This reverts some of the 2002-12-27 change.
9454
9455 2003-01-17 Paul Eggert <eggert@twinsun.com>
9456
9457 * src/output.c (symbol_printers_output): Fix typo that led
9458 to core dump. Problem reported by Antonio Rus in
9459 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
9460
9461 2003-01-13 Akim Demaille <akim@epita.fr>,
9462 Quoc Peyrot <chojin@lrde.epita.fr>,
9463 Robert Anisko <anisko_r@lrde.epita.fr>
9464
9465 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
9466 when the stacks contain one element, as the loop would otherwise
9467 free the last state, and then use the top state (the one we just
9468 popped). This means that the initial elements will not be freed
9469 explicitly, as is the case in yacc.c; it is not a problem, as
9470 these elements have fake values.
9471
9472 2003-01-11 Paul Eggert <eggert@twinsun.com>
9473
9474 * NEWS: %expect-violations are now just warnings, reverting
9475 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
9476 bootstrapping problem reported by Matthias Klose; see
9477 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
9478 * src/conflicts.c (conflicts_print): Likewise.
9479 * tests/conflicts.at (%expect not enough, %expect too much,
9480 %expect with reduce conflicts): Likewise.
9481 * doc/bison.texinfo (Expect Decl): Document this. Also mention
9482 that the warning is enabled if the number of conflicts changes
9483 (not necessarily increases).
9484
9485 * src/getargs.c (version): Update copyright year.
9486
9487 2003-01-09 Akim Demaille <akim@epita.fr>
9488
9489 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
9490
9491 2003-01-08 Paul Eggert <eggert@twinsun.com>
9492
9493 * Makefile.maint (WGETFLAGS):
9494 New macro, containing "-C off" to disable proxy caches.
9495 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
9496 (rel-check): Use $(WGET) instead of wget.
9497
9498 2003-01-06 Paul Eggert <eggert@twinsun.com>
9499
9500 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
9501 the GLR paper of Scott, Johnstone and Hussain.
9502
9503 2003-01-04 Paul Eggert <eggert@twinsun.com>
9504
9505 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
9506 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
9507 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
9508 (EXTRA_LIBRARIES): New var, for liby.a.
9509 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
9510 (EXTRA_SCRIPTS): New var, for yacc.
9511
9512 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
9513 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
9514 Problem reported by Nelson H. F. Beebe.
9515
9516 2003-01-03 Paul Eggert <eggert@twinsun.com>
9517
9518 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
9519 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
9520 when compiling Bison 1.875's `bitset bset = obstack_alloc
9521 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
9522
9523 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
9524 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
9525 grow to a huge size with typical invocation.
9526
9527 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
9528 Use the pattern recommended by Autoconf 2.57, except also protect
9529 against double-definition.
9530 * src/system.h: Likewise.
9531 Portability issues reported by Nelson H. F. Beebe.
9532
9533 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
9534 All uses changed. Provide a definition in both C and C++.
9535 (yytrue, yyfalse): Define even if defined (__cplusplus).
9536
9537 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
9538 Reported by Nelson H. F. Beebe.
9539
9540 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
9541
9542 2003-01-02 Paul Eggert <eggert@twinsun.com>
9543
9544 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
9545 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
9546 Bug reported by Nelson H. F. Beebe.
9547
9548 2003-01-01 Paul Eggert <eggert@twinsun.com>
9549
9550 * Version 1.875.
9551
9552 2002-12-30 Paul Eggert <eggert@twinsun.com>
9553
9554 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
9555 Moved here from...
9556 (<INITIAL>","): Here. This causes stray "," to be treated
9557 more uniformly.
9558
9559 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
9560 last brace in braced code when not in Yacc mode, for compatibility
9561 with Bison 1.35. This resurrects the 2001-12-15 patch to
9562 src/reader.c.
9563
9564 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
9565 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
9566
9567 2002-12-28 Paul Eggert <eggert@twinsun.com>
9568
9569 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
9570 that of SYM's type. This fixes Debian bug 168069, reported by
9571 Thomas Olsson.
9572
9573 2002-12-28 Paul Eggert <eggert@twinsun.com>
9574
9575 Version 1.75f.
9576
9577 Switch back to the Yacc style of conflict reports, undoing some
9578 of the 2002-07-30 change.
9579 * doc/bison.texinfo (Understanding): Use Yacc style for
9580 conflict reports. Also, use new way of locating rules.
9581 * src/conflicts.c (conflict_report):
9582 Renamed from conflict_report_yacc, removing the old
9583 'conflict_report'. Translate the entire conflict report at once,
9584 so that we don't assume that "," has the same interpretation in
9585 all languages.
9586 (conflicts_output): Use Yacc-style conflict report for each state,
9587 instead of our more-complicated style.
9588 (conflicts_print): Use Yacc-style conflict report, except print
9589 the input file name when not emulating Yacc.
9590 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
9591 Conflicted Reduction, %expect not enough, %expect too much,
9592 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
9593 * tests/existing.at (GNU Cim Grammar): Likewise.
9594 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
9595
9596 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
9597 fatal): Don't invoke fflush; it's not needed and it might even be
9598 harmful for stdout, as stdout might not be open.
9599 * src/reduce.c (reduce_print): Likewise.
9600
9601 2002-12-27 Paul Eggert <eggert@twinsun.com>
9602
9603 Fix a bug where error locations were not being recorded correctly.
9604 This problem was originally reported by Paul Hilfinger in
9605 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
9606
9607 * data/yacc.c (yyparse): New local var yylerrsp, to record the
9608 top of the location stack's error locations.
9609 (yyerrlab): Set it. When discarding a token, push its location
9610 onto yylerrsp so that we don't lose track of the error's end.
9611 (yyerrlab1): Now is only the target of YYERROR, so that we can
9612 properly record the location of the action that failed. For GCC
9613 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
9614 GCC warning about yyerrlab1 being unused if YYERROR is unused.
9615 (yyerrlab2): New label, which yyerrlab now falls through to.
9616 Compute the error's location by applying YYLLOC_DEFAULT to
9617 the locations of all the symbols that went into the error.
9618 * doc/bison.texinfo (Location Default Action): Mention that
9619 YYLLOC_DEFAULT is also invoked for syntax errors.
9620 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9621 Error locations include the locations of all the tokens that were
9622 discarded, not just the last token.
9623
9624 2002-12-26 Paul Eggert <eggert@twinsun.com>
9625
9626 * src/files.c: Include quote.h.
9627 (compute_output_file_names): Warn if we detect conflicting
9628 outputs to the same file. This should catch the misunderstanding
9629 exemplified by Debian Bug 165349, reported by Bruce Stephens..
9630
9631 * src/conflicts.c (conflicts_print): If the user specifies
9632 "%expect N", report an error if there are any reduce/reduce
9633 conflicts. This is what the manual says should happen.
9634 This fixes Debian bug 130890, reported by Anthony DeRobertis.
9635 * tests/conflicts.at (%expect with reduce conflicts): New test.
9636
9637 Don't use m4_include on relative file names, as it doesn't work as
9638 desired if there happens to be a file with that name under ".".
9639
9640 * m4sugar/version.m4: Remove; it was included but it wasn't used.
9641 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
9642 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
9643 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
9644 * src/output.c (output_skeleton): Use full path names when
9645 specifying a file to include; don't rely on include path, as
9646 it's unreliable when the working file contains a file with
9647 that name.
9648
9649 2002-12-25 Paul Eggert <eggert@twinsun.com>
9650
9651 Remove obsolete references to bison.simple and bison.hairy.
9652 Problem mentioned by Aubin Mahe in
9653 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
9654 * data/glr.c: Comment fix.
9655 * doc/bison.1: Remove references. Also, mention "yacc".
9656
9657 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
9658 with -g option.
9659
9660 * src/parse-gram.y (declaration): Use enum "report_states" rather
9661 than its numeric value 1.
9662
9663 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
9664 opening a new one. This fixes Debian bug 165349, reported by
9665 Bruce Stephens.
9666
9667 2002-12-24 Paul Eggert <eggert@twinsun.com>
9668
9669 Version 1.75e.
9670
9671 * Makefile.maint (cvs-update): Don't assume that the shell
9672 supports $(...), as Solaris sh doesn't.
9673
9674 * src/parse-gram.y (lloc_default): Remove test for empty
9675 nonterminals at the end, since it didn't change the result.
9676
9677 2002-12-24 Paul Eggert <eggert@twinsun.com>
9678
9679 If the user does not define YYSTYPE as a macro, Bison now declares it
9680 using typedef instead of defining it as a macro. POSIX requires this.
9681 For consistency, YYLTYPE is also declared instead of defined.
9682
9683 %union directives can now have a tag before the `{', e.g., the
9684 directive `%union foo {...}' now generates the C code
9685 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
9686 The default union tag is `YYSTYPE', for compatibility with Solaris 9
9687 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
9688 instead of `yyltype'.
9689
9690 `yystype' and `yyltype' are now obsolescent macros instead of being
9691 typedefs or tags; they are no longer documented and will be
9692 withdrawn in a future release.
9693
9694 * data/glr.c (b4_location_type): Remove.
9695 (YYSTYPE): Renamed from yystype.
9696 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
9697 (struct YYLTYPE): Renamed from struct yyltype.
9698 (YYLTYPE): Renamed from yyltype.
9699 (yyltype, yystype): New (and obsolescent) macros,
9700 for backward compatibility.
9701 * data/yacc.c: Likewise.
9702
9703 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
9704 does not specify a union tag. This is for compatibility with
9705 Solaris 9 yacc.
9706
9707 * src/parse-gram.y (add_param): 2nd arg is now char * not char
9708 const *, since it is now modified by stripping surrounding { }.
9709 (current_braced_code): Remove.
9710 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
9711 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
9712 trailing " {...}". Now of type <chars>.
9713 (grammar_declaration): Adjust to bundled tokens.
9714 (code_content): Remove; stripping is now done by add_param.
9715 (print_token_value): Print contents of bundled tokens.
9716 (token_name): New function.
9717
9718 * src/reader.h (braced_code, current_braced_code): Remove.
9719 (token_name): New decl.
9720
9721 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
9722 token_type, not braced_code code_kind. All uses changed.
9723 (SC_PRE_CODE): New state, for scanning after a keyword that
9724 has (or usually has) an immediately-following braced code.
9725 (token_type): New local var, to keep track of which token type
9726 to return when scanning braced code.
9727 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
9728 <INITIAL>"%parse-param", <INITIAL>"%printer",
9729 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
9730 instead of returning a token type immediately.
9731 (<INITIAL>"{"): Set token type.
9732 (<SC_BRACED_CODE>"}"): Use it.
9733 (handle_action_dollar, handle_action_at): Now returns bool
9734 indicating success. Fail if ! current_rule; this prevents a core dump.
9735 (handle_symbol_code_dollar, handle_symbol_code_at):
9736 Remove; merge body into caller.
9737 (handle_dollar, handle_at): Complain in invalid contexts.
9738
9739 * NEWS, doc/bison.texinfo: Document the above.
9740 * NEWS: Fix years and program names in copyright notice.
9741
9742 2002-12-17 Paul Eggert <eggert@twinsun.com>
9743
9744 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
9745 Reporting, Table of Symbols): Omit mentions of %lex-param and
9746 %parse-param from the documentation for now.
9747
9748 2002-12-15 Paul Eggert <eggert@twinsun.com>
9749
9750 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
9751 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
9752 lookahead symbol, and which sets yychar in parser actions) and it
9753 disagreed with the Bison documentation. Bug
9754 reported by Andrew Walrond.
9755
9756 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
9757 as the caller now does that.
9758 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
9759 (YYEMPTY): Parenthesize right hand side, since others use it.
9760 (yyparse): Don't assume that our generated code is the only code
9761 that sets yychar.
9762
9763 2002-12-13 Paul Eggert <eggert@twinsun.com>
9764
9765 Version 1.75d.
9766
9767 POSIX requires a "yacc" command.
9768 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
9769 (MOSTLYCLEANFILES): Add yacc.
9770 (yacc): New rule.
9771 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
9772 as an alias for bison y.
9773
9774 * po/LINGUAS: Add da.
9775
9776 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
9777 problem with latest <getopt.h>.
9778 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
9779
9780 * doc/fdl.texi: Upgrade to 1.2.
9781 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
9782 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
9783 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
9784 gnulib.
9785 * config/install-sh: Sync with autotools.
9786
9787 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
9788 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
9789 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
9790 locations are requested.
9791 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
9792 locations are requested.
9793
9794 2002-12-12 Paul Eggert <eggert@twinsun.com>
9795
9796 Remove unportable casts and storage allocation tricks.
9797 While we're at it, remove almost all casts, since they
9798 usually aren't needed and are a sign of trouble.
9799
9800 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
9801
9802 * src/derives.c (derives_compute): Do not subtract NTOKENS from
9803 the pointer DSET returned by malloc; this isn't portable.
9804 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
9805 Similarly for DERIVES.
9806 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
9807 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
9808 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
9809
9810 * src/derives.c (derives_compute): Do not bother invoking
9811 int_of_rule_number, since rule numbers are integers.
9812
9813 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
9814 rather than XMALLOC (char, N).
9815
9816 * src/files.c (filename_split): Rewrite to avoid cast.
9817
9818 * src/gram.h (symbol_number_as_item_number,
9819 item_number_as_symbol_number, rule_number_as_item_number,
9820 item_number_as_rule_number):
9821 Now inline functions rather than macros, to avoid casts.
9822 * src/state.h (state_number_as_int): Likewise.
9823 * src/tables.c (state_number_to_vector_number,
9824 symbol_number_to_vector_number): Likewise.
9825
9826 * src/gram.h (int_of_rule_number): Remove; no longer used.
9827
9828 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
9829 since the resulting storage is always stored into.
9830
9831 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
9832 where it's needed.
9833
9834 * src/muscle_tab.c (muscle_m4_output):
9835 Now inline. Return bool, not int.
9836 * src/state.c (state_compare): Likewise.
9837 * src/symtab.c (symbol_check_defined,
9838 symbol_check_alias_consistency, symbol_pack, symbol_translation,
9839 hash_compare_symbol, hash_symbol):
9840 Likewise.
9841 * src/uniqstr.c (uniqstr_print): Likewise.
9842 * src/muscle_tab.c (muscle_m4_output_processor):
9843 New function, to avoid casts.
9844 * src/state.c (state_comparator, stage_hasher): Likewise.
9845 * src/symtab.c (symbol_check_defined_processor,
9846 symbol_check_alias_consistency_processor, symbol_pack_processor,
9847 symbol_translation_processor, hash_symbol_comparator,
9848 hash_symbol_hasher): Likewise.
9849 * src/uniqstr.c (uniqstr_print_processor): Likewise.
9850 * src/muscle_tab.c (muscles_m4_output):
9851 Use new functions instead of casting old functions unportably.
9852 * src/state.c (state_hash_new): Likewise.
9853 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
9854 symbols_token_translations_init):
9855 Likewise.
9856 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
9857
9858 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
9859 var instead of casting to long, to avoid casts.
9860 (prepare_states): Use MALLOC rather than alloca, so that we don't
9861 have to worry about alloca.
9862 * src/state.c (state_hash_lookup): Likewise.
9863
9864 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
9865 local var instead of casting to unsigned char, to avoid casts.
9866
9867 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
9868 STATE_ALLOC): Remove.
9869 (transitions_new, errs_new, reductions_new, state_new): Use malloc
9870 rather than calloc, and use offsetof to avoid allocating slightly
9871 too much storage.
9872 (state_new): Initialize all members.
9873
9874 * src/state.c (state_hash): Use unsigned accumulator, not signed.
9875
9876 * src/symtab.c (symbol_free): Remove; unused.
9877 (symbol_get): Remove cast in lhs of assignment.
9878 (symbols_do): Now static. Accept generic arguments, not
9879 hashing-related ones.
9880
9881 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
9882 (symbol_processor): Remove.
9883 (symbols_do): Remove decl; now static.
9884
9885 * src/system.h (alloca): Remove; decl no longer needed.
9886 (<stddef.h>): Include, for offsetof.
9887 (<inttypes.>, <stdint.h>): Include if available.
9888 (uintptr_t): New type, if system lacks it.
9889 (CALLOC, MALLOC, REALLOC): New macros.
9890 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
9891 new macros.
9892
9893 * src/tables.c (table_size): Now int, to pacify GCC.
9894 (table_grow, table_ninf_remap): Use signed table size.
9895 (save_row): Don't bother initializing locals when not needed.
9896 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
9897 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
9898
9899 * src/vcg.h: Correct misspellings.
9900
9901 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
9902
9903
9904 * src/getargs.c (getargs): Don't assume EOF == -1.
9905
9906 2002-12-09 Paul Eggert <eggert@twinsun.com>
9907
9908 Change identifier spellings to avoid collisions with names
9909 that are reserved by POSIX.
9910
9911 Don't use names ending in _t, since POSIX reserves them.
9912 For consistency, remove _e and _s endings -- they're weren't
9913 needed to remove ambiguity. All uses changed.
9914 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
9915 turn was just renamed from struniq_t.
9916 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
9917 which in turn was just renamed from struniq_processor_t.
9918 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
9919 in turn was renamed from hash_compare_struniq_t.
9920 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
9921 (state_list): Renamed from state_list_t.
9922 * src/assoc.h (assoc): Renamed from assoc_t.
9923 * src/conflicts.c (enum conflict_resolution): Renamed from
9924 enum conflict_resolution_e.
9925 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
9926 (rule_list): Renamed from rule_list_t.
9927 * src/getargs.h (enum trace): Renamed from enum trace_e.
9928 (enum report): Renamed from enum report_e.
9929 * src/gram.h (item_number): Renamed from item_number_t.
9930 (rule_number): Renamed from rule_number_t.
9931 (struct rule_s): Remove the "rule_s" part; not used.
9932 (rule): Renamed from rule_t.
9933 (rule_filter): Renamed from rule_filter_t.
9934 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
9935 (goto_list): Renamed from goto_list_t.
9936 * src/lalr.h (goto_number): Renamed from goto_number_t.
9937 * src/location.h (location): Renamed from location_t.
9938 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
9939 and moved here from:
9940 * src/muscle_tab.h (muscle_entry_t): here.
9941 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
9942 (rule_list): Renamed from rule_list_t.
9943 * src/print_graph.c (static_graph): Renamed from graph.
9944 * src/reader.h (braced_code): Renamed from braced_code_t.
9945 Remove brace_code_e tag.
9946 * src/relation.h (relation_node): Renamed from relation_node_t.
9947 (relation_nodes): Renamed from relation_nodes_t.
9948 (relation): Renamed from relation_t.
9949 * src/state.h (state_number): Renamed from state_number_t.
9950 (struct state): Renamed from struct state_s.
9951 (state): Renamed from state_t.
9952 (transitions): Renamed from transitions_t. Unused (and
9953 misspelled) transtion_s tag removed.
9954 (errs): Renamed from errs_t. Unused errs_s tag removed.
9955 (reductions): Renamed from reductions_t. Unused tag
9956 reductions_s removed.
9957 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
9958 (struct symbol_list): Renamed from struct symbol_list_s.
9959 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
9960 (struct symbol): Renamed from struct symbol_s.
9961 (symbol): Renamed from symbol_t.
9962 * src/tables.c (vector_number): Renamed from vector_number_t.
9963 (action_number): Renamed from action_t.
9964 * src/tables.h (base_number): Renamed from base_t.
9965 * src/vcg.h (enum color): Renamed from enum color_e.
9966 (enum textmode): Renamed from enum textmode_e.
9967 (enum shape): Renamed from enum shape_e.
9968 (struct colorentry): Renamed from struct colorentry_s.
9969 (struct classname): Renamed from struct classname_s.
9970 (struct infoname): Renamed from struct infoname_s.
9971 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
9972 (enum decision): Renamed from enum decision_e.
9973 (enum orientation): Renamed from enum orientation_e.
9974 (enum alignment): Renamed from enum alignment_e.
9975 (enum arrow_mode): Renamed from enum arrow_mode_e.
9976 (enum crossing_type): Renamed from enum crossing_type_e.
9977 (enum view): Renamed from enum view_e.
9978 (struct node): Renamed from struct node_s.
9979 (node): Renamed from node_t.
9980 (enum linestyle): Renamed from enum linestyle_e.
9981 (enum arrowstyle): Renamed from enum arrowstyle_e.
9982 (struct edge): Renamed from struct edge.
9983 (edge): Renamed from edge_t.
9984 (struct graph): Renamed from struct graph_s.
9985 (graph): Renamed from graph_t.
9986 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
9987 Rename value_t -> value.
9988 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
9989 value_t_as_yystype -> value_as_yystype.
9990
9991 Don't include <errno.h> in the mainstream code, since it
9992 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
9993 * lib/get-errno.c, lib/get-errno.h: New files.
9994 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
9995 get-errno.c.
9996 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
9997 * src/output.c (output_skeleton): Likewise.
9998 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
9999 instead of errno.
10000 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
10001 Likewise.
10002 (handle_action_dollar, handle_action_at): Likewise.
10003 * src/system.h: Do not include <errno.h>.
10004 (TAB_EXT): Renamed from EXT_TAB.
10005 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
10006
10007 Avoid str[a-z]*, since <string.h> reserves that name space.
10008 Change all instances of "struniq" in names to "uniqstr", and
10009 likewise for "STRUNIQ" and "UNIQSTR".
10010 * src/uniqstr.c: Renamed from src/struniq.c.
10011 * src/uniqstr.h: Renamed from src/struniq.h.
10012 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
10013 * src/files.c (strsuffix): Remove; unused.
10014 (concat2): Renamed from stringappend. Now static.
10015 * src/files.h (strsuffix, stringappend): Remove; unused.
10016 * src/parse-gram.y (<chars>): Renamed from <string>.
10017 (<uniqstr>): Renamed from <struniq>.
10018 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
10019 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
10020 (struct graph_s.expand): Renamed from struct graph_s.stretch.
10021 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
10022 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
10023 (N_EXPAND): Renamed from N_STRETCH.
10024
10025 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
10026 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
10027 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
10028 Remove; unused.
10029 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
10030 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
10031 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
10032 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
10033 (BASE_MAXIMUM): Renamed from BASE_MAX.
10034 (BASE_MINIMUM): Renamed from BASE_MIN.
10035 (ACTION_MAX): Remove; unused.
10036 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
10037 Unnecessary casts removed from above defines.
10038
10039
10040 Fix misspelling in names.
10041 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
10042 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
10043 G_NODE_ALIGNEMENT.
10044
10045
10046 * lib/timevar.c (timevar_report): Renamed from time_report,
10047 for consistency with other names.
10048 * lib/timevar.h (timevar_report): New decl.
10049 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
10050
10051
10052 Sort include-file uses.
10053
10054 Reorder all include files under src to be in the order "system.h".
10055 then the ../lib include files in angle brackets (alphabetized),
10056 then the . include files in double-quotes (alphabetized). Fix
10057 dependency breakages encountered in this process, as follows:
10058 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
10059 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
10060 * src/state.h: Include "symtab.h".
10061
10062 2002-12-08 Paul Eggert <eggert@twinsun.com>
10063
10064 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
10065 since this causes problems when __file__ contains character
10066 sequences like "@" that are treated specially by src/scan-skel.l.
10067 Instead, just use the file's basename. This fixes the bug
10068 reported by Martin Mokrejs in
10069 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
10070
10071 2002-12-06 Paul Eggert <eggert@twinsun.com>
10072
10073 Add support for rules that do not have trailing semicolons, as
10074 POSIX requires. Improve the quality of locations in Bison
10075 diagnostics.
10076
10077 * src/location.c: Include <quotearg.h>.
10078 (empty_location): Now const.
10079 (location_print): New function. Follow the recommendation of the
10080 GNU Coding Standards for locations that span file boundaries.
10081 * src/location.h: Do not include <quotearg.h>; no longer needed.
10082 (boundary): New type.
10083 (location_t): Use it. This allows locations to span file boundaries.
10084 All member uses changed: file -> start.file or end.file (as needed),
10085 first_line -> start.line, first_column -> start.column,
10086 last_line -> end.line, last_column -> end.column.
10087 (equal_boundaries): New function.
10088 (LOCATION_RESET, LOCATION_STEP): Remove.
10089 (LOCATION_PRINT): Remove. All callers changed to use location_print.
10090 (empty_location): Now const.
10091 (location_print): New decl.
10092 * src/parse-gram.y (lloc_default): New function, which handles
10093 empty locations more accurately.
10094 (YYLLOC_DEFAULT): Use it.
10095 (%token COLON): Remove.
10096 (%token ID_COLON): New token.
10097 (rules): Use it.
10098 (declarations, rules): Remove trailing semicolon.
10099 (declaration, rules_or_grammar_declaration):
10100 Allow empty (";") declaration.
10101 (symbol_def): Remove empty actions; no longer needed.
10102 (rules_or_grammar_declaration): Remove trailing semicolon.
10103 (semi_colon.opt): Remove.
10104 * src/reader.h: Include location.h.
10105 (scanner_cursor): New decl.
10106 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
10107 rolling our own.
10108 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
10109 of *loc.
10110 (STEP): Remove. No longer needed, now that adjust_location does
10111 the work. All uses removed.
10112 (scanner_cursor): New var.
10113 (adjust_location): Renamed from extend_location. It now sets
10114 *loc and adjusts the scanner cursor. All uses changed.
10115 Don't bother testing for CR.
10116 (handle_syncline): Remove location arg; now updates scanner cursor.
10117 All callers changed.
10118 (unexpected_end_of_file): Now accepts start boundary of token or
10119 comment, not location. All callers changed. Update scanner cursor,
10120 not the location.
10121 (SC_AFTER_IDENTIFIER): New state.
10122 (context_state): Renamed from c_context. All uses changed.
10123 (id_loc, code_start, token_start): New local vars.
10124 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
10125 processing of Yacc white space and equivalents here.
10126 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
10127 instead of returning ID immediately, since we need to search for
10128 a subsequent colon.
10129 (<INITIAL>"'", "\""): Save token_start.
10130 (<INITIAL>"%{", "{", "%%"): Save code_start.
10131 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
10132 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
10133 BEGIN context_state at end, not INITIAL.
10134 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
10135 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
10136 Return correct token start.
10137 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
10138 the start of a character, string or multiline comment is found.
10139 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
10140 Reduction): Adjust reported locations to match the more-precise
10141 results now expected.
10142 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
10143 * tests/reduce.at (Useless Rules, Reduced Automaton,
10144 Underivable Rules): Likewise.
10145 * tests/regression.at (Invalid inputs): No longer `expecting ";"
10146 or "|"' now that so many other tokens are allowed by the new grammar.
10147
10148 * src/complain.h (current_file): Remove duplicate decl;
10149 current_file is now owned by files.h.
10150 * src/complain.c, src/scan-gram.l: Include files.h.
10151
10152 2002-12-06 Paul Eggert <eggert@twinsun.com>
10153
10154 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
10155 promotes to int; it might be unsigned int.
10156 * data/yacc.c (yy_reduce_print): Likewise.
10157
10158 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
10159 be #defined in the prologue, not in the Bison declarations.
10160 This fixes Debian Bug 102878, reported by Shaul Karl.
10161
10162 2002-12-02 Paul Eggert <eggert@twinsun.com>
10163
10164 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
10165 * lib/strtoul.c: New file, from gnulib.
10166 This fixes a porting bug reported by Peter Klein in
10167 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
10168
10169 2002-11-30 Paul Eggert <eggert@twinsun.com>
10170
10171 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
10172 and put only a forward declaration in the prologue. This is for
10173 consistency with the other scanner helper functions.
10174
10175 Type clashes now generate warnings, not errors, since it
10176 appears that POSIX may allow some grammars with type clashes.
10177 * src/reader.c (grammar_current_rule_check): Warn about
10178 type clashes instead of complaining.
10179 * tests/input.at (Type Clashes): Expect warnings, not complaints.
10180
10181 Add Yacc library, since POSIX requires it.
10182 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
10183 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
10184 * lib/main.c, lib/yyerror.c: New files.
10185
10186 gram_error can be static; it need not be extern.
10187 * src/reader.h (gram_error): Remove decl.
10188 * src/parse-gram.y (gram_error): Now static. Add static decl.
10189 (print_token_value): Omit parameter names from forward decl,
10190 for consistency.
10191
10192 2002-11-29 Paul Eggert <eggert@twinsun.com>
10193
10194 * doc/bison.texinfo: Emphasize that yylex and yyerror must
10195 be declared before being used. E.g., one should typically
10196 declare them in the prologue. Use GNU coding style in examples.
10197 Put "const" consistently after the type it modifies. Mention
10198 that C99 supports "inline". Mention that yyerror traditionally
10199 returns "int".
10200
10201 %parse-param and %lex-param now take just one argument, the
10202 declaration; the argument name is deduced from the declaration.
10203
10204 * doc/bison.texinfo (Parser Function, Pure Calling, Error
10205 Reporting, Table of Symbols): Document this.
10206 * src/parse-gram.y (add_param): New function.
10207 (COMMA): Remove.
10208 (declaration): Implement new rule for %parse-param and %lex-param.
10209 * src/scan-gram.l: "," now elicits a warning, rather than being
10210 a token; this is more compatible with byacc.
10211 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
10212
10213 2002-11-27 Paul Eggert <eggert@twinsun.com>
10214
10215 Rename identifiers to avoid real and potential collisions.
10216
10217 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
10218 to avoid collision with lex macro described by Bruce Lilly in
10219 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
10220 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10221 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
10222 * src/parse-gram.y (print_token_value): Renamed from yyprint.
10223 All uses changed.
10224 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
10225 The name "yycontrol" violates the name space rules, and this stuff
10226 wasn't being used anyway.
10227 (input): Remove action; this stuff wasn't being used.
10228 (gram_error): Rename local variable yylloc -> loc.
10229 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
10230 (YY_DECL): Don't use "yy" at start of local variables.
10231 All uses changed, e.g., yylloc -> loc.
10232 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
10233 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
10234 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
10235 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
10236
10237 * src/parse-gram.y (gram_error): loc is now const *.
10238 * src/reader.h (gram_error): Likewise.
10239
10240 2002-11-24 Paul Eggert <eggert@twinsun.com>
10241
10242 Version 1.75c.
10243
10244 * tests/actions.at (Actions after errors): Use an output format
10245 more similar to that of the Printers and Destructors test.
10246 Test the position of the ';' token too.
10247 (Printers and Destructors): Likewise.
10248 (Printers and Destructors: %glr-parser): Remove for now, to avoid
10249 unnecessarily alarming people when the test fails.
10250
10251 * data/yacc.c (yyerrlab1): Move this label down, so that the
10252 parser does not discard the lookahead token if the user code
10253 invokes YYERROR. This change is required for POSIX conformance.
10254
10255 * lib/error.c: Sync with gnulib.
10256
10257 2002-11-22 Paul Eggert <eggert@twinsun.com>
10258
10259 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
10260 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
10261 * lib/xmalloc.c: Likewise.
10262
10263 2002-11-20 Paul Eggert <eggert@twinsun.com>
10264
10265 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
10266
10267 2002-11-20 Paul Eggert <eggert@twinsun.com>
10268
10269 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
10270 should use `if (! x) abort ();' rather than `assert (x);', and
10271 anyway it's one less thing to worry about configuring.
10272
10273 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
10274 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
10275 and replace all instances of assert with abort.
10276 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10277 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
10278
10279 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
10280 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
10281 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
10282 hash_find_entry, hash_rehash, hash_insert): Likewise.
10283 * src/conflicts.c (resolve_sr_conflict): Likewise.
10284 * src/lalr.c (set_goto_map, map_goto): Likewise.
10285 * src/nullable.c (nullable_compute): Likewise.
10286 * src/output.c (prepare_rules, token_definitions_output): Likewise.
10287 * src/reader.c (packgram, reader): Likewise.
10288 * src/state.c (state_new, state_free, state_transitions_set,
10289 state_reduction_find): Likewise.
10290 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
10291 symbol_pack): Likewise.
10292 * src/tables.c (conflict_row, pack_vector): Likewise.
10293 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10294 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10295 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
10296 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
10297
10298 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
10299 (ARGMATCH_CONSTRAINT): New macro.
10300 (ARGMATCH_ASSERT): Use it.
10301
10302 * src/system.h (verify): New macro.
10303 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
10304 rather than assert.
10305 * src/tables.c (tables_generate): Likewise.
10306
10307 * src/struniq.c (struniq_assert): Now returns void, and aborts
10308 if the assertion is false.
10309 (struniq_assert_p): Remove.
10310 * src/struniq.h: Likewise.
10311
10312 2002-11-18 Paul Eggert <eggert@twinsun.com>
10313
10314 * data/glr.c (yygetLRActions): Replace `yyindex' with
10315 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
10316 This fixes the regression with Sun ONE Studio 7 cc that I reported in
10317 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
10318
10319 2002-11-18 Akim Demaille <akim@epita.fr>
10320
10321 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
10322 space.
10323 From Tim Van Holder.
10324
10325 2002-11-17 Paul Eggert <eggert@twinsun.com>
10326
10327 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
10328 to "SyntaxError" for consistency with my 2002-11-15 change.
10329
10330 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
10331 not define to {}, since this breaks the common use of `YYDPRINTF
10332 ((...));' if a single statement is desired (e.g. before `else').
10333 Work around GCC warnings by surrounding corresponding calls with
10334 {} if needed.
10335 (yyhasResolvedValue): Remove unused function.
10336 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
10337 loop body.
10338 (yyreportSyntaxError): Renamed from yyreportParseError.
10339 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
10340 All uses changed.
10341 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
10342 extern when possible. Remove unused initializations.
10343
10344 2002-11-16 Akim Demaille <akim@epita.fr>
10345
10346 Augment the similarity between GLR and LALR traces.
10347
10348 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
10349 (YY_REDUCE_PRINT): New.
10350 (yyparse): Use them.
10351 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
10352 YYDPRINT here.
10353 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
10354 state reached after the reduction/recovery, since...
10355 (yyparse, yyprocessOneStack): Report the state we are entering in.
10356
10357 2002-11-16 Akim Demaille <akim@epita.fr>
10358
10359 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
10360 Add support for --trace=skeleton.
10361 * src/scan-skel.l: %option debug.
10362 Scan strings of non-@ or \n instead of character by character.
10363 (scan_skel): Handle trace_skeleton.
10364 (QPUTS): New.
10365 (@output_parser_name@, @output_header_name@): ``Restore'' their
10366 support (used to be M4 macros).
10367 * data/yacc.c: Quote larger chunks, a la glr.c.
10368 * data/lalr1.cc: Likewise.
10369 The header guards are no longer available, so use some other
10370 string than `YYLSP_NEEDED'.
10371
10372 2002-11-16 Akim Demaille <akim@epita.fr>
10373
10374 Make the ``Printers and Destructors'' test more verbose, taking
10375 `yacc.c''s behavior as (possibly wrong) reference.
10376
10377 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
10378 instead of fprint on stdout.
10379 Set and report the last_line of the symbols.
10380 Consistently display values and locations.
10381
10382 2002-11-16 Paul Eggert <eggert@twinsun.com>
10383
10384 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
10385
10386 2002-11-15 Paul Eggert <eggert@twinsun.com>
10387
10388 * tests/actions.at (Actions after errors): New test case.
10389
10390 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
10391 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
10392 tests/action.at, tests/calc.at, tests/conflicts.at,
10393 tests/cxx-type.at, tests/regression.at:
10394 "parse error" -> "syntax error" for POSIX compatibility.
10395 "parsing stack overflow..." -> "parser stack overflow" so
10396 that code matches Bison documentation.
10397
10398 2002-11-15 Akim Demaille <akim@epita.fr>
10399
10400 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
10401 take two BRACED_CODE, not two string_content.
10402 Free the scanner's obstack when we are done.
10403 (code_content): New.
10404 * tests/calc.at: Adjust.
10405 * doc/bison.texinfo: Adjust.
10406 Also, make sure to include the `,' for these declarations.
10407
10408 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
10409
10410 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
10411 definition; avoids potential autoreconf problems.
10412
10413 2002-11-15 Akim Demaille <akim@epita.fr>
10414
10415 Always check the value returned by yyparse.
10416
10417 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
10418 returned by yyparse.
10419 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
10420 Adjust calls.
10421 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
10422 returned by yyparse.
10423
10424 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10425
10426 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
10427 on input.at test.
10428
10429 2002-11-14 Paul Eggert <eggert@twinsun.com>
10430
10431 * src/output.c (output_skeleton): Call xfopen instead of
10432 duplicating xfopen's body.
10433
10434 Fix bugs reported by Nelson H. F. Beebe in
10435 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
10436
10437 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
10438 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
10439 Group compiler. Instead, use "$CC -E bar.c". Include the .h
10440 file twice in the grammar, as an extra check.
10441
10442 * tests/input.at (Torturing the Scanner): Surround the
10443 backslash-newline tests with "#if 0", to make it less likely that
10444 we'll run into compiler bugs. Bring back solitary \ inside
10445 comment, but add a closing comment to work around HP C bug. Don't
10446 test backslash-newline in C character constant.
10447
10448 2002-11-14 Akim Demaille <akim@epita.fr>
10449
10450 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
10451 status of the compiler.
10452 Calling `exit 1' is no longer needed.
10453 Reported by Nelson H. F. Beebe.
10454
10455 2002-11-14 Akim Demaille <akim@epita.fr>
10456
10457 * tests/atlocal.in (CPPFLAGS): We have config.h.
10458 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
10459 New.
10460 * tests/actions.at, tests/calc.at, tests/conflicts.at,
10461 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
10462 * tests/regression.at, tests/torture.at: Use them for all the
10463 grammars that are to be compiled.
10464 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
10465 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
10466 * doc/bison.texinfo (GLR Parsers): Document `inline'.
10467
10468 2002-11-14 Akim Demaille <akim@epita.fr>
10469
10470 * doc/bison.texinfo: Various formatting changes (alignments in
10471 samples, additional @group/@end group, GCS in samples.
10472 Use @deffn instead of simple @table to define the directives,
10473 macros, variables etc.
10474
10475 2002-11-13 Paul Eggert <eggert@twinsun.com>
10476
10477 Fix some bugs reported by Albert Chin-A-Young in
10478 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
10479
10480 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
10481 -o c"; the HP C compiler chatters during compilation.
10482 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
10483 * tests/headers.at (export YYLTYPE): Likewise.
10484
10485 * tests/input.at (Torturing the Scanner): Remove lines containing
10486 solitary backslashes, as they tickle a bug in the HP C compiler.
10487
10488 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
10489 comments, since they're not portable. Use GNU coding style.
10490
10491 2002-11-13 Akim Demaille <akim@epita.fr>
10492
10493 * data/yacc.c: Leave bigger chunks of quoted text.
10494 (YYDSYMPRINTF): New.
10495 Use it to report symbol activities.
10496 * data/glr.c (YYDSYMPRINTF): New.
10497 Use it.
10498
10499 2002-11-12 Paul Eggert <eggert@twinsun.com>
10500
10501 Version 1.75b.
10502
10503 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
10504 (yyglrReduce): Return yyok, not 0.
10505 This should avoid the enumerated-type warnings reported
10506 by Nelson H. F. Beebe in
10507 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
10508
10509 * lib/bbitset.h (BITSET_INLINE): Remove.
10510 * lib/bitset.h [! BITSET_INLINE]: Remove.
10511 (bitset_set, bitset_reset, bitset_test): Rename local vars
10512 to avoid shadowing warnings by GCC.
10513
10514 * data/glr.c (inline): Remove #define. It's the user's
10515 responsibility to #define it away, just like 'const'.
10516 This fixes one of the bugs reported by Nelson H. F. Beebe in
10517 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
10518
10519 * Makefile.maint (po-check): Scan .l and .y files instead of the
10520 .c and the .h files that they generate. This fixes the bug
10521 reported by Tim Van Holder in:
10522 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
10523 Look for N_ as well as for _. Try to avoid matching #define for
10524 N_ and _.
10525 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
10526 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
10527 * src/scan-gram.l: Revamp regular expressions so that " and '
10528 do not confuse xgettext.
10529
10530 * src/struniq.h (struniq_new): Do not declare the return type
10531 to be 'const'; this violates the C standard.
10532 * src/struniq.c (struniq_new): Likewise.
10533
10534 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
10535
10536 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
10537 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
10538 linker.
10539
10540 2002-11-12 Akim Demaille <akim@epita.fr>
10541
10542 * Makefile.maint: Sync with Autoconf:
10543 (local_updates): New.
10544
10545 2002-11-12 Akim Demaille <akim@epita.fr>
10546
10547 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
10548
10549 2002-11-12 Akim Demaille <akim@epita.fr>
10550
10551 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
10552 locations.
10553
10554 2002-11-12 Akim Demaille <akim@epita.fr>
10555
10556 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
10557 not yyvalue.
10558
10559 2002-11-12 Akim Demaille <akim@epita.fr>
10560
10561 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
10562 Use it to test the GLR parser.
10563
10564 2002-11-12 Akim Demaille <akim@epita.fr>
10565
10566 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
10567 defines it.
10568 * data/glr.c (yystos): New.
10569 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
10570 (YYDSYMPRINT): New.
10571 (yyval): Don't define it, it is handled via M4.
10572 (yyrecoverParseError): Free verbosely the discarded symbols.
10573 * data/yacc.c (yysymprint): Remove, rather...
10574 (b4_yysymprint_generate): invoke.
10575 * data/c.m4 (b4_yysymprint_generate): New.
10576 Accept pointers as arguments, as opposed to the version from
10577 yacc.c.
10578 (b4_yydestruct_generate): Likewise.
10579 * tests/cations.at (Printers and Destructors): Use Bison directives
10580 instead of CPP macros.
10581 Don't rely on internal details.
10582
10583 2002-11-12 Akim Demaille <akim@epita.fr>
10584
10585 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
10586 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
10587 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
10588 it against YYEMPTY and so forth), work on yytoken (i.e., set
10589 it to YYEMPTY etc.).
10590 (yydestruct): Replace with a b4_yydestruct_generate invocation.
10591 (b4_symbol_actions): Remove.
10592 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
10593 for 0, end-of-input.
10594
10595 2002-11-12 Akim Demaille <akim@epita.fr>
10596
10597 * doc/bison.texinfo (Destructor Decl): New.
10598
10599 2002-11-12 Akim Demaille <akim@epita.fr>
10600
10601 * src/tables.c (tables_generate): Use free for pointers that
10602 cannot be NULL, not XFREE.
10603 (pack_vector): Use assert, not fatal, for bound violations.
10604 * src/state.c (state_new): Likewise.
10605 * src/reader.c (reader): Likewise.
10606 * src/lalr.c (set_goto_map): Likewise.
10607 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
10608 the file name.
10609
10610 2002-11-12 Akim Demaille <akim@epita.fr>
10611
10612 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
10613 Restore.
10614 * src/scan-gram.l (last_string): Is global to the file, not to
10615 yylex.
10616 * src/parse-gram.y (input): Don't append the epilogue here,
10617 (epilogue.opt): do it here, and free the scanner's obstack.
10618 * src/reader.c (epilogue_set): Rename as...
10619 (epilogue_augment): this.
10620 * data/c.m4 (b4_epilogue): Defaults to empty.
10621
10622 2002-11-12 Akim Demaille <akim@epita.fr>
10623
10624 * src/getargs.c (long_options): Remove duplicates.
10625 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
10626 Remove.
10627 * doc/bison.rnh: Remove.
10628 * doc/bison.texinfo (VMS Invocation): Remove.
10629
10630 2002-11-12 Akim Demaille <akim@epita.fr>
10631
10632 * src/struniq.h, src/struniq.c (struniq_t): Is const.
10633 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
10634
10635 Use struniq for symbols.
10636
10637 * src/symtab.h (symbol_t): The tag member is a struniq.
10638 (symbol_type_set): Adjust.
10639 * src/symtab.c (symbol_new): Takes a struniq.
10640 (symbol_free): Don't free the tag member.
10641 (hash_compare_symbol_t, hash_symbol_t): Rename as...
10642 (hash_compare_symbol, hash_symbol): these.
10643 Use the fact that tags as struniqs.
10644 (symbol_get): Use struniq_new.
10645 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
10646 Returns a strniq.
10647 * src/reader.h (merger_list, grammar_currentmerge_set): The name
10648 and type members are struniqs.
10649 * src/reader.c (get_merge_function)
10650 (grammar_current_rule_merge_set): Adjust.
10651 (TYPE, current_type): Are struniq.
10652
10653 Use struniq for file names.
10654
10655 * src/files.h, src/files.c (infile): Split into...
10656 (grammar_file, current_file): these.
10657 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
10658 * src/reduce.c (reduce_print): Likewise.
10659 * src/getargs.c (getargs): Likewise.
10660 * src/complain.h, src/complain.c: Likewise.
10661 * src/main.c (main): Call struniqs_new early enough to use it for
10662 file names.
10663 Don't free the input file name.
10664
10665 2002-11-12 Akim Demaille <akim@epita.fr>
10666
10667 * src/symtab.c (symbol_free): Remove dead deactivated code:
10668 type_name are properly removed.
10669 Don't use XFREE to free items that cannot be NULL.
10670 * src/struniq.h, src/struniq.c: New.
10671 * src/main.c (main): Initialize/free struniqs.
10672 * src/parse-gram.y (%union): Add astruniq member.
10673 (yyprint): Adjust.
10674 * src/scan-gram.l (<{tag}>): Return a struniq.
10675 Free the obstack bit that used to store it.
10676 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
10677
10678 2002-11-11 Paul Eggert <eggert@twinsun.com>
10679
10680 Revamp to fix many (but not all) of the C- and M4-related quoting
10681 problems. Among other things, this fixes the Bison bug reported
10682 by Jan Hubicka when processing the Bash grammar; see:
10683 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
10684
10685 Use new @ escapes consistently. Represent brackets with @{ and @}
10686 rather than @<:@ and @:>@, since this works a bit better with dumb
10687 editors like vi. Represent @ with @@, since @ is now consistently
10688 an escape. Use @oline@ and @ofile@ rather than __oline__ and
10689 __ofile__, to avoid unexpected expansions. Similarly, use @output
10690 rather than #output.
10691
10692 * data/c.m4 (b4_copyright): Omit file name from comment, since
10693 the file name could contain "*/".
10694 (b4_synclines_flag): Don't quote the 2nd argument; it should already
10695 be quoted. All uses changed.
10696
10697 * data/glr.c: Use new @ escapes consistently.
10698 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
10699 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
10700 Remove, since they couldn't handle arbitrary characters in file
10701 names.
10702 * data/lalr1.cc: Likewise.
10703 * data/yacc.c: Likewise.
10704
10705 * src/files.c (output_infix): Remove; all uses removed.
10706 * src/files.h: Likewise.
10707
10708 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
10709 mishandled funny characters in file names, and anyway it isn't
10710 needed any more.
10711 * data/yacc.c: Likewise.
10712 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
10713
10714 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
10715 * data/yacc.c: Likewise.
10716
10717 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
10718 strings now.
10719 (muscle_init): Quote filename as a C string.
10720 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
10721 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
10722 * src/output.c (escaped_file_name_output): New function.
10723 (prepare_symbols): Quote tokens for M4.
10724 (prepare): Don't insert output_infix, output_prefix,
10725 output_parser_name, output_header_name; this is now down by scan-skel.
10726 Insert skeleton as a C string.
10727
10728 * src/output.c (user_actions_output, symbol_destructors_output,
10729 symbol_printers_output): Quote filenames for C and M4.
10730 * src/reader.c (prologue_augment, epilogue_set): Likewise.
10731
10732 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
10733 escapes other than \\ and \'; this simplifies the code.
10734 (<SC_STRING>): Likewise, for \\ and \".
10735 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
10736 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
10737 Use new escapes @{ and @} for [ and ].
10738
10739 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
10740 them with auto vars.
10741 Switch to new escape scheme, where @ is the escape character uniformly.
10742 Abort if a stray escape character is found. Avoid unbounded input
10743 buffer when parsing non-escaped text.
10744
10745 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
10746 __oline__, #output, $@, and @{ do not have unintended meanings.
10747
10748 2002-11-09 Paul Eggert <eggert@twinsun.com>
10749
10750 Fix the test failure due to GCC warnings described in
10751 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
10752 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
10753 evaluate to 0 if it's impossible for NINF to be in the respective
10754 table.
10755 (yygetLRActions, yyrecoverParseError): Use them.
10756
10757 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
10758 counted in the token inserted at end of file. Now takes
10759 location_t *, not location_t, so that the location can be
10760 adjusted. All uses changed.
10761
10762 * tests/regression.at (Invalid inputs): Adjust wording in
10763 diagnostic to match the new behavior.
10764
10765 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
10766 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
10767 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
10768 abort ();'. This reduces the runtime of the "Many lookaheads"
10769 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
10770 GCC 3.2.
10771
10772 2002-11-07 Paul Eggert <eggert@twinsun.com>
10773
10774 * src/parse-gram.y (CHARACTER): Remove unused token.
10775 All uses removed.
10776
10777 * src/scan-gram.l: Remove stack option. We no longer use the
10778 stack, since the stack was never deeper than 1; instead, use the
10779 new auto var c_context to record the stacked value.
10780
10781 Remove nounput option. At an unexpected end of file, we now unput
10782 the minimal input necessary to end cleanly; this simplifies the
10783 code.
10784
10785 Avoid unbounded token sizes where this is easy.
10786
10787 (unexpected_end_of_file): New function.
10788 Use it to systematize the error message on unexpected EOF.
10789 (last-string): Now auto, not static.
10790 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
10791 (scanner_last_string_free): Remove; not used.
10792 (percent_percent_count): Move decl to just before use.
10793 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
10794 not the (never otherwised-used) CHARACTER.
10795
10796 2002-11-07 Akim Demaille <akim@epita.fr>
10797
10798 Let yyerror always receive the msg as last argument, so that
10799 yyerror can be variadic.
10800
10801 * data/yacc.c (b4_yyerror_args): New.
10802 Use it when calling yyerror.
10803 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
10804 Use it when calling yyerror.
10805 * doc/bison.texinfo (Error Reporting): Adjust.
10806 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
10807 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
10808
10809 2002-11-06 Akim Demaille <akim@epita.fr>
10810
10811 #line should have quoted strings.
10812 Ideally, this should be done by m4_quotearg.
10813
10814 * src/scan-skel.l: Include quotearg.h.
10815 Quote __ofile__.
10816 * src/output.c (symbol_printers_output)
10817 (symbol_destructors_output): Quote the file name.
10818
10819 2002-11-06 Akim Demaille <akim@epita.fr>
10820
10821 * tests/regression.at (Invalid inputs): Adjust to the recent
10822 messages.
10823
10824 2002-11-06 Akim Demaille <akim@epita.fr>
10825
10826 Restore --no-lines.
10827 Reported by Jim Kent.
10828
10829 * data/c.m4 (b4_syncline): New.
10830 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
10831 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
10832 * src/output.c (user_actions_output): Likewise.
10833 (prepare): Define 'b4_synclines_flag'.
10834 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
10835
10836 2002-11-06 Akim Demaille <akim@epita.fr>
10837
10838 * src/main.c (main): Free `infile'.
10839 * src/scan-gram.l (handle_syncline): New.
10840 Recognize `#line'.
10841 * src/output.c (user_actions_output, symbol_destructors_output)
10842 (symbol_printers_output): Use the location's file name, not
10843 infile.
10844 * src/reader.c (prologue_augment, epilogue_set): Likewise.
10845
10846 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10847
10848 * src/tables.c (matching_state): Don't allow states to match if
10849 either has GLR conflict entries.
10850
10851 2002-11-05 Paul Eggert <eggert@twinsun.com>
10852
10853 * src/scan-gram.l: Use more accurate diagnostics, e.g.
10854 "integer out of range" rather than "invalid value".
10855 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
10856 accordingly.
10857
10858 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
10859 Also, remove one static variable in the scanner.
10860
10861 * src/scan-gram.l (braces_level): Now auto, not static.
10862 Initialize to zero if the compiler is being picky.
10863 (INITIAL): Clear braces_level instead of incrementing it.
10864 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
10865 as POSIX 1003.1-2001 requires.
10866 * src/system.h (IF_LINT): New macro, taken from coreutils.
10867 * configure.ac: Define "lint" if --enable-gcc-warnings.
10868
10869 2002-11-05 Akim Demaille <akim@epita.fr>
10870
10871 * src/scan-gram.l: When it starts with `%', complain about the
10872 whole directive, not just that `invalid character: %'.
10873
10874 2002-11-04 Akim Demaille <akim@epita.fr>
10875
10876 * Makefile.maint: Update from Autoconf.
10877 (update, cvs-update, po-update, do-po-update): New.
10878
10879 2002-11-04 Akim Demaille <akim@epita.fr>
10880
10881 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
10882 and yyerror.
10883 Have yyerror `use' its arguments.
10884 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
10885 returns true when location & yacc & pure & parse-param.
10886 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
10887
10888 2002-11-04 Akim Demaille <akim@epita.fr>
10889
10890 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
10891 clashes.
10892 * src/scan-gram.l: Use [\'] instead of ['] to pacify
10893 font-lock-mode.
10894 Use complain_at.
10895 Use quote, not quote_n since LOCATION_PRINT no longer uses the
10896 slot 0.
10897
10898 2002-11-03 Paul Eggert <eggert@twinsun.com>
10899
10900 * src/reader.c (get_merge_function, grammar_current_rule_check):
10901 Use consistent diagnostics for reporting type name clashes.
10902 Quote the types with <>, for consistency with Yacc.
10903 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
10904
10905 2002-11-03 Akim Demaille <akim@epita.fr>
10906
10907 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
10908 New.
10909 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
10910 (b4_parse_param): Remove.
10911 Use b4_identification.
10912 Propagate b4_pure_args where needed to pass them to yyerror.
10913 * data/glr.m4 (b4_parse_param): Remove.
10914 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
10915 (b4_lpure_formals): New.
10916 Use b4_identification.
10917 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
10918 b4_user_formals and b4_user_args.
10919 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
10920 (yyreportAmbiguity): When using a pure parser, also need
10921 the location, and the parse-params.
10922 Adjust callers.
10923 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
10924 When using a pure parser, also need the parse-params.
10925 Adjust callers.
10926 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
10927 (%pure-parser + %parse-param) LALR and GLR parsers.
10928 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
10929 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
10930 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
10931 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
10932 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
10933 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
10934 * doc/bison.texinfo: Untabify the whole file.
10935 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
10936 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
10937 (Error Reporting): Adjust to these new directives.
10938 Document %error-verbose, deprecate YYERROR_VERBOSE.
10939
10940 2002-11-03 Akim Demaille <akim@epita.fr>
10941
10942 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
10943 AT_CHECK_CALC_GLR invocations to use % directives, instead of
10944 command line options.
10945 * tests/cxx-type.at: Formatting changes.
10946
10947 2002-11-03 Paul Eggert <eggert@twinsun.com>
10948
10949 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
10950 to count columns correctly, and to check for invalid inputs.
10951
10952 Use mbsnwidth to count columns correctly. Account for tabs, too.
10953 Include mbswidth.h.
10954 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
10955 (extend_location): New function.
10956 (YY_LINES): Remove.
10957
10958 Handle CRLF in C code rather than in Lex code.
10959 (YY_INPUT): New macro.
10960 (no_cr_read): New function.
10961
10962 Scan UCNs, even though we don't fully handle them yet.
10963 (convert_ucn_to_byte): New function.
10964
10965 Handle backslash-newline correctly in C code.
10966 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
10967 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
10968 all uses changed.
10969 (tag, splice): New EREs. Do not allow NUL or newline in tags.
10970 Use {splice} wherever C allows backslash-newline.
10971 YY_STEP after space, newline, vertical-tab.
10972 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
10973
10974 (letter, id): Don't assume ASCII; e.g., spell out a-z.
10975
10976 ({int}, handle_action_dollar, handle_action_at): Check for integer
10977 overflow.
10978
10979 (YY_STEP): Omit trailing semicolon, so that it's more like C.
10980
10981 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
10982 as well as \000. Check for UCHAR_MAX, not 255.
10983 Allow \x with an arbitrary positive number of digits, as in C.
10984 Check for overflow here.
10985 Allow \? and UCNs, for compatibility with C.
10986
10987 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
10988 with quote slot used by complain_at.
10989
10990 * tests/input.at: Add tests for backslash-newline, m4 quotes
10991 in symbols, long literals, and funny escapes in strings.
10992
10993 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
10994 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
10995 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
10996 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
10997 * m4/mbswidth.m4: New file, from GNU coreutils.
10998
10999 * doc/bison.texinfo (Grammar Outline): Document // comments.
11000 (Symbols): Document that trigraphs have no special meaning in Bison,
11001 nor is backslash-newline allowed.
11002 (Actions): Document that trigraphs have no special meaning.
11003
11004 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
11005 no longer used.
11006
11007 2002-11-02 Paul Eggert <eggert@twinsun.com>
11008
11009 * src/reader.c: Don't include quote.h; not needed.
11010 (get_merge_function): Reword warning to be consistent with
11011 type clash diagnostic in grammar_current_rule_check.
11012
11013 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
11014 bug in trigraph handling.
11015
11016 * src/output.c (prepare_symbols): When printing token names,
11017 escape "[" as "@<:@" and likewise for "]".
11018
11019 * src/system.h (errno): Remove declaration, as we are now
11020 assuming C89 or better, and C89 guarantees errno.
11021
11022 2002-10-30 Paul Eggert <eggert@twinsun.com>
11023
11024 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
11025 Check for close failures.
11026 * src/files.h (xfclose): Return void, not int, since it always
11027 returned zero.
11028 * src/files.c (xfclose): Likewise. Report I/O error if ferror
11029 indicates one.
11030 * src/output.c (output_skeleton): Use xfclose rather than fclose
11031 and ferror. xfclose now checks ferror.
11032
11033 * data/glr.c (YYLEFTMOST_STATE): Remove.
11034 (yyreportTree): Use a stack-based leftmost state. This avoids
11035 our continuing battles with bogus warnings about initializers.
11036
11037 2002-10-30 Akim Demaille <akim@epita.fr>
11038
11039 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
11040 #if.
11041
11042 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11043
11044 * tests/glr-regr1.at: New test for reported regressions.
11045 * tests/testsuite.at: Add glr-regr1.at test.
11046 * tests/Makefile.am: Add glr-regr1.at test.
11047
11048 2002-10-24 Paul Eggert <eggert@twinsun.com>
11049
11050 Version 1.75a.
11051
11052 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
11053 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
11054 we use malloc. Don't assume 'A' through 'Z' are contiguous.
11055 Don't assume strdup exists; POSIX says its an XSI extension.
11056 Check for buffer overflow on input.
11057
11058 2002-10-24 Akim Demaille <akim@epita.fr>
11059
11060 * src/output.c (output_skeleton): Don't disable M4sugar comments
11061 too soon: it results in comments being expanded.
11062 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
11063 first output.
11064
11065 2002-10-24 Akim Demaille <akim@epita.fr>
11066
11067 * data/yacc.c (m4_int_type): New.
11068 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
11069 char' as only yacc.c wants K&R portability.
11070 * data/glr.c (yysigned_char): Remove.
11071 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
11072 Reported by Quoc Peyrot.
11073
11074 2002-10-23 Paul Eggert <eggert@twinsun.com>
11075
11076 * src/main.c (main): With --trace=time, report times even if a
11077 non-fatal error occurs. Formerly, the times were reported in some
11078 such cases but not in others.
11079 * src/reader.c (reader): Just return if a complaint has been issued,
11080 instead of exiting, so that 'main' can report times.
11081
11082 2002-10-22 Akim Demaille <akim@epita.fr>
11083
11084 * src/system.h: Include sys/types.
11085 Reported by Bert Deknuydt.
11086
11087 2002-10-23 Paul Eggert <eggert@twinsun.com>
11088
11089 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
11090 Suggested by Art Haas.
11091
11092 2002-10-22 Paul Eggert <eggert@twinsun.com>
11093
11094 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
11095 decl; not needed any more.
11096 * src/main.c (main): Use return to exit, undoing yesterday's change.
11097 The last OS that we could find where this wouldn't work is
11098 SunOS 3.5, and that's too old to worry about now.
11099
11100 * data/glr.c (struct yyltype): Define members even when not
11101 doing locations. This is more consistent with yacc.c, and it
11102 works around the following bug reports:
11103 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
11104 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
11105
11106 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
11107 @acronym consistently. Standardize on "Yacc" instead of "YACC",
11108 "Algol" instead of "ALGOL". Give a bit more history about BNF.
11109
11110 2002-10-22 Akim Demaille <akim@epita.fr>
11111
11112 * data/README: New.
11113
11114 2002-10-21 Paul Eggert <eggert@twinsun.com>
11115
11116 Be consistent about 'bool'; the old code used an enum in one
11117 module and an int in another, and this violates the C standard.
11118 * m4/stdbool.m4: New file, from coreutils 4.5.3.
11119 * configure.ac (AC_HEADER_STDBOOL): Add.
11120 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
11121 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
11122 * src/symtab.c (hash_compare_symbol_t): Likewise.
11123 * src/system.h (bool, false, true): Use a definition consistent
11124 with ../lib/hash.c. All uses changed.
11125
11126 * src/complain.c (warning_issued): Renamed from warn_message_count,
11127 so that we needn't worry about integer overflow (!).
11128 Now of type bool. All uses changed.
11129 (complaint_issued): Renamed from complain_message_count; likewise.
11130
11131 * src/main.c (main): Use exit to exit with failure.
11132
11133 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
11134 rather than 1 and 0.
11135 * src/main.c (main): Likewise.
11136 * src/getargs.c (getargs): Likewise.
11137 * src/reader.c (reader): Likewise.
11138
11139 * src/getarg.c (getargs): Remove duplicate code for
11140 "Try `bison --help'".
11141
11142 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
11143 What was that "2" for?
11144
11145 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
11146 * src/getargs.c (usage): Likewise.
11147
11148 * src/getargs.c (getargs): When there are too few operands, report
11149 the last one. When there are too many, report the first extra
11150 one. This is how diffutils does it.
11151
11152 2002-10-20 Paul Eggert <eggert@twinsun.com>
11153
11154 Remove K&R vestiges.
11155 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
11156 * src/complain.c (VA_START): Remove. Assume prototypes.
11157 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
11158 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
11159 fatal): Assume prototypes.
11160 * src/complain.h: Assume prototypes.
11161 * src/system.h (PARAMS): Remove.
11162 Include <limits.h> unconditionally, since it's guaranteeed even
11163 for a freestanding C89 compiler.
11164 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
11165 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
11166
11167 2002-10-20 Akim Demaille <akim@epita.fr>
11168
11169 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
11170 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
11171 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
11172 (yyresolveStates, yyresolveAction, yyresolveStack)
11173 (yyprocessOneStack): Use them.
11174 (yy_reduce_print): New.
11175 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
11176
11177 2002-10-20 Akim Demaille <akim@epita.fr>
11178
11179 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
11180 arguments and output `void'.
11181 (b4_c_function): Rename as...
11182 (b4_c_function_def): this.
11183 (b4_c_function_decl, b4_c_ansi_function_def)
11184 (b4_c_ansi_function_decl): New.
11185 Change the interpretation of the arguments: before `int, foo', now
11186 `int foo, foo'.
11187 * data/yacc.c (yyparse): Prototype and define thanks to these.
11188 Adjust b4_c_function_def uses.
11189 * data/glr.c (yyparse): Likewise, but ANSI only.
11190
11191 2002-10-20 Akim Demaille <akim@epita.fr>
11192
11193 * src/output.c (prepare): Move the definition of `tokens_number',
11194 `nterms_number', `undef_token_number', `user_token_number_max'
11195 to...
11196 (prepare_tokens): Here.
11197 (prepare_tokens): Rename as...
11198 (prepare_symbols): this.
11199 (prepare): Move the definition of `rules_number' to...
11200 (prepare_rules): here.
11201 (prepare): Move the definition of `last', `final_state_number',
11202 `states_number' to...
11203 (prepare_states): here.
11204 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
11205
11206 2002-10-20 Akim Demaille <akim@epita.fr>
11207
11208 * src/tables.h, src/tables.c, src/output.c: Comment changes.
11209
11210 2002-10-20 Akim Demaille <akim@epita.fr>
11211
11212 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
11213 * data/c.m4: here.
11214
11215 2002-10-20 Akim Demaille <akim@epita.fr>
11216
11217 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
11218 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
11219 `pair'.
11220 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
11221 `name' to...
11222 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
11223 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
11224 These.
11225
11226 2002-10-19 Paul Eggert <eggert@twinsun.com>
11227
11228 Do not create a temporary file, as that involves security and
11229 cleanup headaches. Instead, use a pair of pipes.
11230 Derived from a suggestion by Florian Krohm.
11231 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
11232 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
11233 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
11234 (BISON_PREREQ_SUBPIPE): Add.
11235 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
11236 Add subpipe.h, subpipe.c.
11237 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
11238 * po/POTFILES.in: Add lib/subpipe.c.
11239 * src/output.c: Include "subpipe.h".
11240 (m4_invoke): Remove decl.
11241 (scan_skel): New decl.
11242 (output_skeleton): Use pipe rather than temporary file for m4 input.
11243 Check that m4sugar.m4 is readable, to avoid deadlock.
11244 Check for pipe I/O error.
11245 * src/scan-skel.l (readpipe): Remove decl.
11246 (scan_skel): New function, to be used in place of m4_invoke.
11247 Read from stream rather than file.
11248
11249 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
11250 float, as this generates a warning on Solaris 8 + GCC 3.2 with
11251 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
11252 this generates a more-accurate value anyway.
11253
11254 * lib/timevar.c (timervar_accumulate): Rename locals to
11255 avoid confusion with similarly-named more-global.
11256 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
11257
11258 * src/output.c (prepare): Use xstrdup to convert char const *
11259 to char *, to avoid GCC warning.
11260
11261 2002-10-19 Akim Demaille <akim@epita.fr>
11262
11263 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
11264 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
11265 Use them to have `calc.y' ready for %pure-parser.
11266 * data/yacc.c (YYLEX): Pass a yylex return type to
11267 b4_c_function_call.
11268
11269 2002-10-19 Akim Demaille <akim@epita.fr>
11270
11271 Prototype support of %lex-param and %parse-param.
11272
11273 * src/parse-gram.y: Add the definition of the %lex-param and
11274 %parse-param tokens, plus their rules.
11275 Drop the `_' version of %glr-parser.
11276 Add the "," token.
11277 * src/scan-gram.l (INITIAL): Scan them.
11278 * src/muscle_tab.c: Comment changes.
11279 (muscle_insert, muscle_find): Rename `pair' as `probe'.
11280 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
11281 (muscle_entry_s): The `value' member is no longer const.
11282 Adjust all dependencies.
11283 * src/muscle_tab.c (muscle_init): Adjust: use
11284 MUSCLE_INSERT_STRING.
11285 Initialize the obstack earlier.
11286 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
11287 (muscle_pair_list_grow): New.
11288 * data/c.m4 (b4_c_function_call, b4_c_args): New.
11289 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
11290 * tests/calc.at: Use %locations, not --locations.
11291 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
11292
11293 2002-10-19 Akim Demaille <akim@epita.fr>
11294
11295 * src/getargs.c (usage): Take status as argument and exit
11296 accordingly.
11297 Report the traditional `Try ... --help' message when status != 0.
11298 (usage, version): Don't take a FILE * as arg, it is pointless.
11299 (getargs): When there is an incorrect number of arguments, make it
11300 an error, and report it GNUlically thanks to `usage ()'.
11301
11302 2002-10-18 Paul Eggert <eggert@twinsun.com>
11303
11304 * data/glr.c (yyreportParseError): Don't assume that sprintf
11305 yields the length of the printed string, as this is not true
11306 on SunOS 4.1.4. Reported by Peter Klein.
11307
11308 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
11309 * tests/conflicts.at (%nonassoc and eof): Likewise.
11310 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
11311
11312 2002-10-17 Akim Demaille <akim@epita.fr>
11313
11314 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
11315 * src/getargs.c (trace_types, trace_args): Adjust.
11316 * src/reader.c (grammar_current_rule_prec_set)
11317 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
11318 Standardize error messages.
11319 And s/@prec/%prec/!
11320 (reader): Use trace_flag to enable scanner/parser debugging,
11321 instead of an adhoc scheme.
11322 * src/scan-gram.l: Remove trailing debugging code.
11323
11324 2002-10-16 Paul Eggert <eggert@twinsun.com>
11325
11326 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
11327 MUSCLE_TAB_H.
11328
11329 * NEWS: Officially drop support for building Bison with K&R C,
11330 since it didn't work anyway and it's not worth worrying about.
11331 * Makefile.maint (wget_files): Remove ansi2knr.c.
11332 (ansi2knr.c-url_prefix): Remove.
11333 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
11334 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11335 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11336
11337 2002-10-15 Paul Eggert <eggert@twinsun.com>
11338
11339 Stop using the "enum_" trick for K&R-style function definitions;
11340 it confused me, and I was the author! Instead, assume that people
11341 who want to use K&R C compilers (when using these modules in GCC,
11342 perhaps?) will run ansi2knr.
11343
11344 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
11345 All uses of "enum_" changed to "enum ".
11346 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11347 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11348
11349 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
11350 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
11351 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
11352 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
11353 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
11354 abitset_not, abitset_ones, abitset_or, abitset_or_and,
11355 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
11356 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
11357 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
11358 Use function prototypes; this removes the need for declaring
11359 static functions simply to provide their prototypes.
11360 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
11361 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
11362 bitset_count_, bitset_create, bitset_dump, bitset_first,
11363 bitset_free, bitset_init, bitset_last, bitset_next,
11364 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
11365 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
11366 bitset_print, bitset_release_memory, bitset_toggle_,
11367 bitset_type_choose, bitset_type_get, bitset_type_name_get,
11368 debug_bitset): Likewise.
11369 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
11370 * lib/bitset_stats.c (bitset_log_histogram_print,
11371 bitset_percent_histogram_print, bitset_stats_and,
11372 bitset_stats_and_cmp, bitset_stats_and_or,
11373 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
11374 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
11375 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
11376 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
11377 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
11378 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
11379 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
11380 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
11381 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
11382 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
11383 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
11384 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
11385 bitset_stats_zero): Likewise.
11386 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11387 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11388 bitsetv_dump, debug_bitsetv): Likewise.
11389 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
11390 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
11391 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
11392 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
11393 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
11394 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
11395 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
11396 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
11397 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
11398 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
11399 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
11400 Likewise.
11401 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
11402 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
11403 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
11404 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
11405 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
11406 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
11407 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
11408 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
11409 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
11410 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
11411 lbitset_xor_cmp, lbitset_zero): Likewise.
11412
11413 2002-10-14 Akim Demaille <akim@epita.fr>
11414
11415 Version 1.75.
11416
11417 2002-10-14 Akim Demaille <akim@epita.fr>
11418
11419 * tests/Makefile.am (maintainer-check-posix): New.
11420
11421 2002-10-14 Akim Demaille <akim@epita.fr>
11422
11423 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
11424 member.
11425
11426 2002-10-14 Akim Demaille <akim@epita.fr>
11427
11428 * src/tables.c (table_ninf_remap): base -> tab.
11429 Reported by Matt Rosing.
11430
11431 2002-10-14 Paul Eggert <eggert@twinsun.com>
11432
11433 * tests/action.at, tests/calc.at, tests/conflicts.at,
11434 tests/cxx-type.at, tests/headers.at, tests/input.at,
11435 tests/regression.at, tests/synclines.at, tests/torture.at:
11436 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
11437 so that the tests still work even if POSIXLY_CORRECT is set.
11438 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
11439
11440 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
11441 for portability to K&R hosts. Fix typo: signed char is guaranteed
11442 only to 127, not to 128.
11443 * data/glr.c (yysigned_char): New type.
11444 * data/yacc.c (yysigned_char): Likewise.
11445 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
11446
11447 2002-10-13 Paul Eggert <eggert@twinsun.com>
11448
11449 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
11450 true due to limited range of data type" warning from GCC.
11451
11452 * data/c.m4 (b4_token_defines): Protect against double-inclusion
11453 by wrapping enum yytokentype's definition inside #ifndef
11454 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
11455
11456 2002-10-13 Akim Demaille <akim@epita.fr>
11457
11458 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
11459 Un yy- yyrhs to avoid the name clash with the global YYRHS.
11460
11461 2002-10-13 Akim Demaille <akim@epita.fr>
11462
11463 * Makefile.maint: Update from Autoconf 2.54.
11464 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
11465
11466 2002-10-13 Akim Demaille <akim@epita.fr>
11467
11468 * src/print.c (print_state): Separate the list of solved conflicts
11469 from the other items.
11470 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
11471
11472 2002-10-13 Akim Demaille <akim@epita.fr>
11473
11474 Let nondeterministic skeletons be usable with deterministic
11475 tables.
11476
11477 With the patch, GAWK compiled by GCC without -O2 passes its test
11478 suite using a GLR parser driven by LALR tables. It fails with -O2
11479 because `struct stat' gives two different answers on my machine:
11480 88 (definition of an auto var) and later 96 (memset on this var).
11481 Hence the stack is badly corrumpted. The headers inclusion is to
11482 blame: if I move the awk.h inclusion before GLR's system header
11483 inclusion, the two struct stat have the same size.
11484
11485 * src/tables.c (pack_table): Always create conflict_table.
11486 (token_actions): Always create conflict_list.
11487 * data/glr.c (YYFLAG): Remove, unused.
11488
11489 2002-10-13 Akim Demaille <akim@epita.fr>
11490
11491 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
11492 (O0FLAGS): New.
11493 (VALGRIND, GXX): New.
11494 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
11495 * tests/bison.in: Run $PREBISON a pre-command.
11496 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
11497 (maintainer-check-g++): New.
11498 * Makefile.am (maintainer-check): New.
11499
11500 2002-10-13 Akim Demaille <akim@epita.fr>
11501
11502 * data/glr.c: Formatting changes.
11503 Tweak some trace messages to match yacc.c's.
11504
11505 2002-10-13 Akim Demaille <akim@epita.fr>
11506
11507 GLR parsers sometimes raise parse errors instead of performing the
11508 default reduction.
11509 Reported by Charles-Henry de Boysson.
11510
11511 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
11512 check the length of the traces when %glr.
11513 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
11514 GLR's traces.
11515 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
11516 Test GLR parsers.
11517 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
11518 (yyltype): Remove the yy prefix from the member names.
11519 (yytable): Complete its comment.
11520 (yygetLRActions): Map error action number from YYTABLE from
11521 YYTABLE_NINF to 0.
11522 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
11523 (which was a bug: it should have been YYTABEL_NINF, and yet it was
11524 not satisfying as we could compare an YYACTION computed from
11525 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
11526 only value for error actions.
11527 (yyreportParseError): In verbose parse error messages, don't issue
11528 `error' in the list of expected tokens.
11529 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
11530 next action to perform to match glr.c's decoding.
11531 (yytable): Complete its comment.
11532
11533 2002-10-13 Paul Eggert <eggert@twinsun.com>
11534
11535 Fix problem reported by Henrik Grubbstroem in
11536 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
11537 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
11538 because the Bison parser reads the second action before reducing
11539 the first one.
11540 * src/scan-gram.l (rule_length): New static var.
11541 Use it to keep track of the rule length in the scanner, since
11542 we can't expect the parser to be in lock-step sync with the scanner.
11543 (handle_action_dollar, handle_action_at): Use this var.
11544 * tests/actions.at (Exotic Dollars): Test for the problem.
11545
11546 2002-10-12 Paul Eggert <eggert@twinsun.com>
11547
11548 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
11549 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
11550 Include <sys/time.h> when checking for clock_t and struct tms.
11551 Use same include order as source.
11552 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
11553 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
11554
11555 * lib/timevar.c: Update copyright date and clarify comments.
11556 (get_time) [IN_GCC]: Keep the GCC version for reference.
11557
11558 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
11559 GCC version as of today, then merge Bison's changes.
11560 Change "GCC" to "Bison" in copyright notice. timevar.def's
11561 author is Akim, so change that too.
11562
11563 * src/reader.c (grammar_current_rule_check):
11564 Don't worry about the default action if $$ is untyped.
11565 Prevents bogus warnings reported by Jim Gifford in
11566 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
11567
11568 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
11569 * data/glr.c, data/lalr1.cc, data/yacc.c:
11570 Output token definitions before the first part of user declarations.
11571 Fixes compatibility problem reported by Jim Gifford for kbd in
11572 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
11573
11574 2002-10-11 Paul Eggert <eggert@twinsun.com>
11575
11576 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
11577 (yyparse): here. This undoes some of the 2002-07-25 change.
11578 Compatibility problem reported by Ralf S. Engelschall with
11579 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
11580
11581 2002-10-11 Akim Demaille <akim@epita.fr>
11582
11583 * tests/regression.at Characters Escapes): New.
11584 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
11585 characters.
11586 Reported by Jan Nieuwenhuizen.
11587
11588 2002-10-11 Akim Demaille <akim@epita.fr>
11589
11590 * po/id.po: New.
11591
11592 2002-10-10 Paul Eggert <eggert@twinsun.com>
11593
11594 Portability fixes for bitsets; this also avoids several GCC
11595 warnings.
11596
11597 * lib/abitset.c: Include <stddef.h>, for offsetof.
11598 * lib/lbitset.c: Likewise.
11599
11600 * lib/abitset.c (abitset_bytes): Return a size that is aligned
11601 properly for vectors of objects. Do not assume that adding a
11602 header size to a multiple of a word size yields a value that is
11603 properly aligned for the whole union.
11604 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11605
11606 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
11607 unique names for structures.
11608 * lib/ebitset.c (ebitset_bytes): Likewise.
11609 * lib/lbitset.c (lbitset_bytes): Likewise.
11610
11611 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
11612 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
11613 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
11614 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
11615 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
11616 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
11617 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
11618 to improve the type-checking that GCC can do.
11619 * lib/bitset.c (bitset_op4_cmp): Likewise.
11620 * lib/bitset_stats.c (bitset_stats_count,
11621 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
11622 bitset_stats_copy, bitset_stats_disjoint_p,
11623 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
11624 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
11625 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
11626 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
11627 bitset_stats_and_or_cmp, bitset_stats_andn_or,
11628 bitset_stats_andn_or_cmp, bitset_stats_or_and,
11629 bitset_stats_or_and_cmp): Likewise.
11630 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
11631 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
11632 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
11633 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
11634
11635 * lib/abitset.h: Include bitset.h, not bbitset.h.
11636 * lib/ebitset.h: Likewise.
11637 * lib/lbitset.h: Likewise.
11638
11639 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
11640 All instances of parameters of type enum bitset_opts are now of
11641 type enum_bitset_opts, to conform to the C Standard, and similarly
11642 for enum_bitset_type.
11643 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11644 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11645
11646 Do not use "struct bitset_struct" to mean different things in
11647 different modules. Not only is this confusing, it violates
11648 the C Standard, which requires that structure types in different
11649 modules must be compatible if one is to be passed to the other.
11650 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
11651 All instances of "struct bitset_struct *" replaced with "bitset".
11652 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
11653 (union bitset_union, struct abitset_struct, struct ebitset_struct,
11654 struct lbitset_struct, struct bitset_stats_struct): New types.
11655 All uses of struct bitset_struct changed to union bitset_union,
11656 etc.
11657 * lib/abitset.c (struct abitset_struct, abitset,
11658 struct bitset_struct): Remove.
11659 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
11660 struct bitset_struct): Remove.
11661 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
11662 bitset_struct): Remove.
11663 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
11664 Likewise.
11665
11666 Do not call a function of type T using a call that assumes the
11667 function is of a different type U. Standard C requires that a
11668 function must be called with a type that is compatible with its
11669 definition.
11670 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11671 New decls.
11672 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11673 New functions.
11674 * lib/ebitset.c (PFV): Remove.
11675 * lib/lbitset.c (PFV): Likewise.
11676 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
11677 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
11678 decls.
11679 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
11680 (ebitset_vtable): Use them.
11681 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
11682 lbitset_xor): New functions.
11683 (lbitset_vtable): Use them.
11684
11685 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
11686 Declare.
11687
11688 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
11689 GCC warning.
11690 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
11691 Use offsetof, for simplicity.
11692
11693 2002-10-06 Paul Eggert <eggert@twinsun.com>
11694
11695 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
11696 the same width as int. This reapplies a hunk of the 2002-08-12 patch
11697 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
11698 which was inadvertently undone by the 2002-09-30 patch.
11699 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
11700 the same width as int.
11701
11702 2002-10-04 Paul Eggert <eggert@twinsun.com>
11703
11704 Version 1.50.
11705
11706 * configure.ac (AC_INIT), NEWS: Increment version number.
11707
11708 * doc/bison.texinfo: Minor spelling, grammar, and white space
11709 fixes.
11710 (Symbols): Mention that any negative value returned from yylex
11711 signifies end-of-input. Warn about negative chars. Mention
11712 the portable Standard C character set.
11713
11714 The GNU coding standard says CFLAGS and YFLAGS are reserved
11715 for the installer to set.
11716 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
11717 * src/Makefile.am (AM_CFLAGS): Likewise.
11718 (AM_YFLAGS): Renamed from YFLAGS.
11719
11720 Fix some MAX and MIN problems.
11721 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
11722 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
11723 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
11724 * src/reader.c (reader): Use it.
11725
11726 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
11727 POSIX 1003.1-2001 has removed fgrep.
11728
11729 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
11730
11731 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
11732 interpreted as signed.
11733 * lib/ebitset.c (ebitset_list): Fix bug.
11734
11735 2002-10-01 Paul Eggert <eggert@twinsun.com>
11736
11737 More fixes for 64-bit hosts and large bitsets.
11738
11739 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
11740 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
11741 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
11742 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
11743 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
11744 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
11745 bitset_count_): Likewise.
11746 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
11747 bitset_first, bitset_last): Likewise.
11748 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
11749 bitset_stats_list_reverse, bitset_stats_size,
11750 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
11751 Likewise.
11752 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11753 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11754 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11755 bitsetv_reflexive_transitive_closure): Likewise.
11756 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
11757 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
11758 Likewise.
11759 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
11760 Likewise.
11761
11762 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
11763 Use size_t, not unsigned int, to count bytes.
11764 * lib/abitset.h (abitset_bytes): Likewise.
11765 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
11766 Likewise.
11767 * lib/bitset.h (bitset_bytes): Likewise.
11768 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
11769 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
11770 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11771 * lib/ebitset.c (ebitset_bytes): Likewise.
11772 * lib/ebitset.h (ebitset_bytes): Likewise.
11773 * lib/lbitset.c (lbitset_bytes): Likewise.
11774 * lib/lbitset.h (lbitset_bytes): Likewise.
11775
11776 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
11777 abitset_subset_p, abitset_disjoint_p, abitset_and,
11778 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
11779 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
11780 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
11781 abitset_or_and, abitset_or_and_cmp):
11782 Use bitset_windex instead of unsigned int.
11783 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
11784 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
11785 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
11786 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
11787 Likewise.
11788 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
11789
11790 * lib/bitset.c (bitset_print):
11791 Use proper printf formats for widths of integer types.
11792 * lib/bitset_stats.c (bitset_percent_histogram_print,
11793 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
11794 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
11795 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
11796 * lib/lbitset.c (lbitset_bytes): Likewise.
11797
11798 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
11799 BITSET_SIZE_MAX): New macros.
11800 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
11801 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
11802 to BITSET_WINDEX_MAX.
11803
11804 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
11805 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
11806 since we now return the bitset_bindex type (not int).
11807
11808 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
11809 when computing sizes.
11810 * lib/ebitset.c (ebitset_elts_grow): Likewise.
11811
11812 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
11813 and avoid cast to unsigned.
11814
11815 2002-09-30 Akim Demaille <akim@epita.fr>
11816
11817 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
11818 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
11819 Updates from Michael Hayes.
11820
11821 2002-09-30 Art Haas <ahaas@neosoft.com>
11822
11823 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
11824 invocations.
11825 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
11826 defined.
11827
11828 2002-09-27 Akim Demaille <akim@epita.fr>
11829
11830 Version 1.49c.
11831
11832 2002-09-27 Akim Demaille <akim@epita.fr>
11833
11834 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
11835 (Because of AC_LIBSOURCE).
11836
11837 2002-09-27 Akim Demaille <akim@epita.fr>
11838
11839 Playing with Autoscan.
11840
11841 * configure.ac: Remove the old LIBOBJ tweaks.
11842 (AC_REPLACE_FUNCS): Add strrchr and strtol.
11843 * lib/strrchr.c: New.
11844 * lib/strtol.c: New, from the Coreutils 4.5.1.
11845
11846 2002-09-27 Akim Demaille <akim@epita.fr>
11847
11848 Playing with Autoscan.
11849
11850 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
11851 * lib/Makefile.am (libbison_a_SOURCES): No longer include
11852 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
11853 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
11854 Coreutils 4.5.1.
11855
11856 2002-09-24 Akim Demaille <akim@epita.fr>
11857
11858 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
11859 (Frequently Asked Questions, Parser Stack Overflow): New.
11860
11861 2002-09-13 Akim Demaille <akim@epita.fr>
11862
11863 Playing with autoscan.
11864
11865 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
11866 * src/files.c (skeleton_find): Remove, unused.
11867 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
11868 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
11869
11870 2002-09-13 Akim Demaille <akim@epita.fr>
11871
11872 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
11873 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
11874
11875 2002-09-13 Akim Demaille <akim@epita.fr>
11876
11877 * configure.ac: Require 2.54.
11878 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
11879 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
11880 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
11881 Remove, provided by Autoconf macros.
11882
11883 2002-09-12 Akim Demaille <akim@epita.fr>
11884
11885 * m4/prereq.m4: Update, from Coreutils 4.5.1.
11886
11887 2002-09-12 Akim Demaille <akim@epita.fr>
11888
11889 * m4/prereq.m4: Update, from Fileutils 4.1.5.
11890 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
11891 Reported by Martin Mokrejs.
11892
11893 2002-09-10 Akim Demaille <akim@epita.fr>
11894
11895 * src/parse-gram.y: Associate a human readable string to each
11896 token type.
11897 * tests/regression.at (Invalid inputs): Adjust.
11898
11899 2002-09-10 Gary V. Vaughan <gary@gnu.org>
11900
11901 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
11902 with an Autoconf-2.5x style configure.ac.
11903
11904 2002-09-06 Paul Eggert <eggert@twinsun.com>
11905
11906 * doc/bison.texinfo (Conditions): Make explicit that the GPL
11907 exception applies only to yacc.c. This is a modification of a
11908 patch originally suggested by Akim Demaille.
11909
11910 2002-09-06 Akim Demaille <akim@epita.fr>
11911
11912 * data/c.m4 (b4_copyright): Move the GPL exception comment from
11913 here to...
11914 * data/yacc.c: here.
11915
11916 * data/lalr1.cc (struct yyltype): Don't define it, since we use
11917 LocationType.
11918 (b4_ltype): Default to yy::Location from location.hh.
11919
11920 2002-09-04 Jim Meyering <jim@meyering.net>
11921
11922 * data/yacc.c: Guard the declaration of yytoknum also with
11923 `#ifdef YYPRINT', so it is declared only when used.
11924
11925 2002-09-04 Akim Demaille <akim@epita.fr>
11926
11927 * configure.in: Rename as...
11928 * configure.ac: this.
11929 Bump to 1.49c.
11930
11931 2002-09-04 Akim Demaille <akim@epita.fr>
11932
11933 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
11934 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
11935 translate maintainer only messages.
11936
11937 2002-08-12 Paul Eggert <eggert@twinsun.com>
11938
11939 Version 1.49b.
11940
11941 * Makefile.am (SUBDIRS): Remove intl.
11942 (DISTCLEANFILES): Remove.
11943 * NEWS: Mention that GNU M4 is now required. Clarify what is
11944 meant by "larger grammars". Mention the pt_BR translation.
11945 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
11946 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
11947 Bump version from 0.11.2 to 0.11.5.
11948 (BISON_PREREQ_STAGE): Remove.
11949 (AM_GNU_GETTEXT): Use external gettext.
11950 (AC_OUTPUT): Remove intl/Makefile.
11951
11952 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
11953
11954 * data/glr.c: Include string.h, for strlen.
11955 (yyreportParseError): Use size_t for yysize.
11956 (yy_yypstack): No longer nested inside yypstates, as nested
11957 functions are not portable. Do not assume size_t is the
11958 same width as int.
11959 (yypstates): Do not assume that ptrdiff_t is the same width
11960 as int, and similarly for yyposn and YYINDEX.
11961
11962 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
11963
11964 * lib/Makefile.am (INCLUDES): Do not include from the intl
11965 directory, which has been removed.
11966 * src/Makefile.am (INCLUDES): Likewise.
11967
11968 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
11969 (bitsets_sources, additional_bitsets_sources, timevars_sources):
11970 New vars.
11971
11972 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
11973 * tests/Makefile.am (EXTRA_DIST): Likewise.
11974
11975 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
11976 Do not assume that bitset_windex is the same width as unsigned.
11977
11978 * lib/abitset.c (abitset_unused_clear): Do not assume that
11979 bitset_word is the same width as int.
11980 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
11981 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
11982 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
11983 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
11984 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
11985
11986 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
11987 portability to one's complement hosts!).
11988 * lib/ebitset.c (ebitset_op1): Likewise.
11989 * lib/lbitset.c (lbitset_op1): Likewise.
11990
11991 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
11992 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
11993 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
11994 Sync with fileutils.
11995 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
11996 lib/gettext.h: Sync with diffutils.
11997
11998 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
11999 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
12000
12001 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
12002 PROTOTYPES to check for prototypes, and "defined __STDC__" to
12003 check for void *.
12004
12005 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
12006 size_t; the old version tried to do this but casted improperly.
12007 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
12008 (bitset_test): Now returns int, not unsigned long.
12009
12010 * lib/bitset_stats.c: Include "gettext.h".
12011 (_): New macro.
12012 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
12013 name locals "index", as it generates unnecessary warnings on some
12014 hosts that have an "index" function.
12015
12016 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
12017 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
12018 they need translation.
12019 * src/LR0.c (state_list_append, new_itemsets, get_state,
12020 append_states, generate_states): Likewise.
12021 * src/assoc.c (assoc_to_string): Likewise.
12022 * src/closure.c (print_closure, set_firsts, closure): Likewise.
12023 * src/gram.c (grammar_dump): Likewise.
12024 * src/injections.c (injections_compute): Likewise.
12025 * src/lalr.c (lookaheads_print): Likewise.
12026 * src/relation.c (relation_transpose): Likewise.
12027 * src/scan-gram.l: Likewise.
12028 * src/tables.c (table_grow, pack_vector): Likewise.
12029
12030 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
12031 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
12032 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
12033 * m4/mbstate_t.m4: Sync with fileutils.
12034 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
12035
12036 * po/LINGUAS: Add pt_BR.
12037 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
12038 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
12039 lib/timevar.c.
12040 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
12041 manual recommends.
12042 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
12043
12044 * src/complain.c (strerror_r): Remove decl; not needed.
12045 (strerror): Use same pattern as ../lib/error.c.
12046
12047 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
12048
12049 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
12050
12051 * src/main.c (main): Cast result of bindtextdomain and textdomain
12052 to void, to avoid a GCC warning when --disable-nls is in effect.
12053
12054 * src/scan-gram.l: Use strings rather than escapes when possible,
12055 to minimize the number of warnings from xgettext.
12056 (handle_action_dollar, handle_action_at): Don't use isdigit,
12057 as it mishandles negative chars and it may not work as expected
12058 outside the C locale.
12059
12060 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
12061 this is a GCC extension and is not portable to other compilers.
12062
12063 * src/system.h (alloca): Use same pattern as ../lib/error.c.
12064 Do not include <ctype.h>; no longer needed.
12065 Do not include <malloc.h>; no longer needed (and generates
12066 warnings on OpenBSD 3.0).
12067
12068 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
12069 it's not portable.
12070
12071 * tests/regression.at: Do not use 'cc -c input.c -o input';
12072 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
12073
12074 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
12075 exit status as failure, not just exit status 1. Sun C exits
12076 with status 2 sometimes.
12077
12078 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
12079 Use it for the two large tests.
12080
12081 2002-08-02 Akim Demaille <akim@epita.fr>
12082
12083 * src/conflicts.c (conflicts_output): Don't output rules never
12084 reduced here, since anyway that computation doesn't work.
12085 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
12086 (rule_useless_p, rule_never_reduced_p): New.
12087 (grammar_rules_partial_print): Use a filter instead of a range.
12088 Display the title only if needed.
12089 (grammar_rules_print): Adjust.
12090 (grammar_rules_never_reduced_report): New.
12091 * src/tables.c (action_row): Move the computation of rules never
12092 reduced to...
12093 (token_actions): here.
12094 * src/main.c (main): Make the parser before making the report, so
12095 that rules never reduced are computed.
12096 Call grammar_rules_never_reduced_report.
12097 * src/print.c (print_results): Report rules never reduced.
12098 * tests/conflicts.at, tests/reduce.at: Adjust.
12099
12100 2002-08-01 Akim Demaille <akim@epita.fr>
12101
12102 Instead of attaching lookaheads and duplicating the rules being
12103 reduced by a state, attach the lookaheads to the reductions.
12104
12105 * src/state.h (state_t): Remove the `lookaheads',
12106 `lookaheads_rule' member.
12107 (reductions_t): Add a `lookaheads' member.
12108 Use a regular array for the `rules'.
12109 * src/state.c (reductions_new): Initialize the lookaheads member
12110 to 0.
12111 (state_rule_lookaheads_print): Adjust.
12112 * src/state.h, src/state.c (state_reductions_find): New.
12113 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
12114 (count_rr_conflicts): Adjust.
12115 * src/lalr.c (LArule): Remove.
12116 (add_lookback_edge): Adjust.
12117 (state_lookaheads_count): New.
12118 (states_lookaheads_initialize): Merge into...
12119 (initialize_LA): this.
12120 (lalr_free): Adjust.
12121 * src/main.c (main): Don't free nullable and derives too early: it
12122 is used by --verbose.
12123 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
12124
12125 2002-08-01 Akim Demaille <akim@epita.fr>
12126
12127 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
12128 `rule_number_t**'.
12129 (set_derives, free_derives): Rename as...
12130 (derives_compute, derives_free): this.
12131 Adjust all dependencies.
12132 * src/nullable.c (set_nullable, free_nullable): Rename as...
12133 (nullable_compute, nullable_free): these.
12134 (rule_list_t): Store rule_t *, not rule_number_t.
12135 * src/state.c (state_rule_lookaheads_print): Directly compare rule
12136 pointers, instead of their numbers.
12137 * src/main.c (main): Call nullable_free, and derives_free earlier,
12138 as they were lo longer used.
12139
12140 2002-08-01 Akim Demaille <akim@epita.fr>
12141
12142 * lib/timevar.c (get_time): Include children time.
12143 * src/lalr.h (LA, LArule): Don't export them: used with the
12144 state_t.
12145 * src/lalr.c (LA, LArule): Static.
12146 * src/lalr.h, src/lalr.c (lalr_free): New.
12147 * src/main.c (main): Call it.
12148 * src/tables.c (pack_vector): Check whether loc is >= to the
12149 table_size, not >.
12150 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
12151 (tables_generate): do it, since that's also it which allocates
12152 them.
12153 Don't free LA and LArule, main does.
12154
12155 2002-07-31 Akim Demaille <akim@epita.fr>
12156
12157 Separate parser tables computation and output.
12158
12159 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
12160 (conflict_list, conflict_list_cnt, table, check, table_ninf)
12161 (yydefgoto, yydefact, high): Move to...
12162 * src/tables.h, src/tables.c: here.
12163 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12164 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12165 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
12166 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
12167 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
12168 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
12169 (action_row, save_row, token_actions, save_column, default_goto)
12170 (goto_actions, sort_actions, matching_state, pack_vector)
12171 (table_ninf_remap, pack_table, prepare_actions): Move to...
12172 * src/tables.c: here.
12173 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
12174 * src/output.c (token_actions, output_base, output_conflicts)
12175 (output_check): Merge into...
12176 (prepare_actions): this.
12177 (actions_output): Rename as...
12178 (user_actions_output): this.
12179 * src/main.c (main): Call tables_generate and tables_free.
12180
12181 2002-07-31 Akim Demaille <akim@epita.fr>
12182
12183 Steal GCC's --time-report support.
12184
12185 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
12186 stolen/adjusted from GCC.
12187 * m4/stage.m4: Remove time related checks.
12188 * m4/timevar.m4: New.
12189 * configure.in: Adjust.
12190 * src/system.h: Adjust to using timevar.h.
12191 * src/getargs.h, src/getargs.c: Support trace_time for
12192 --trace=time.
12193 * src/main.c (stage): Remove.
12194 (main): Replace `stage' invocations with timevar calls.
12195 * src/output.c: Insert pertinent timevar calls.
12196
12197 2002-07-31 Akim Demaille <akim@epita.fr>
12198
12199 Let --trace have arguments.
12200
12201 * src/getargs.h (enum trace_e): New.
12202 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
12203 (long_options, short_options): --trace/-T takes an optional
12204 argument.
12205 Change all the uses of trace_flag to reflect the new flags.
12206 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
12207
12208 Strengthen `stage' portability.
12209
12210 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
12211 * configure.in: Use it.
12212 Don't check for malloc.h and sys/times.h.
12213 * src/system.h: Include them when appropriate.
12214 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
12215 times and struct tms are available.
12216
12217 2002-07-30 Akim Demaille <akim@epita.fr>
12218
12219 In verbose parse error message, don't report `error' as an
12220 expected token.
12221 * tests/actions.at (Printers and Destructors): Adjust.
12222 * tests/calc.at (Calculator $1): Adjust.
12223 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
12224 error message, do not report the parser accepts the error token in
12225 that state.
12226
12227 2002-07-30 Akim Demaille <akim@epita.fr>
12228
12229 Normalize conflict related messages.
12230
12231 * src/complain.h, src/complain.c (warn, complain): New.
12232 * src/conflicts.c (conflicts_print): Use them.
12233 (conflict_report_yacc): New, extracted from...
12234 (conflicts_print): here.
12235 * tests/conflicts.at, tests/existing.at: Adjust.
12236
12237 2002-07-30 Akim Demaille <akim@epita.fr>
12238
12239 Report rules which are never reduced by the parser: those hidden
12240 by conflicts.
12241
12242 * src/LR0.c (save_reductions): Don't make the final state too
12243 different: save its reduction (accept) instead of having a state
12244 without any action (no shift or goto, no reduce).
12245 Note: the final state is now a ``regular'' state, i.e., the
12246 parsers now contain `reduce 0' as default reduction.
12247 Nevertheless, since they decide to `accept' when yystate =
12248 final_state, they still will not reduce rule 0.
12249 * src/print.c (print_actions, print_reduction): Adjust.
12250 * src/output.c (action_row): Track reduced rules.
12251 (token_actions): Report rules never reduced.
12252 * tests/conflicts.at, tests/regression.at: Adjust.
12253
12254 2002-07-30 Akim Demaille <akim@epita.fr>
12255
12256 `stage' was accidently included in a previous patch.
12257 Initiate its autoconfiscation.
12258
12259 * configure.in: Look for malloc.h and sys/times.h.
12260 * src/main.c (stage): Adjust.
12261 Report only when trace_flag.
12262
12263 2002-07-29 Akim Demaille <akim@epita.fr>
12264
12265 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
12266 state_number_t.
12267 (errs_t): symbol_t*, not symbol_number_t.
12268 (reductions_t): rule_t*, not rule_number_t.
12269 (FOR_EACH_SHIFT): New.
12270 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
12271 * src/print.c, src/print_graph.c: Adjust.
12272
12273 2002-07-29 Akim Demaille <akim@epita.fr>
12274
12275 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
12276
12277 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
12278 (endtoken, accept): these.
12279 * src/reader.c (reader): Set endtoken's default tag to "$end".
12280 Set undeftoken's tag to "$undefined" instead of "$undefined.".
12281 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
12282 Adjust.
12283
12284 2002-07-29 Akim Demaille <akim@epita.fr>
12285
12286 * src/reduce.c (reduce_grammar): When the language is empty,
12287 complain about the start symbol, not the axiom.
12288 Use its location.
12289 * tests/reduce.at (Empty Language): New.
12290
12291 2002-07-26 Akim Demaille <akim@epita.fr>
12292
12293 * src/reader.h, src/reader.c (gram_error): ... can't get
12294 yycontrol without making too strong assumptions on the parser
12295 itself.
12296 * src/output.c (prepare_tokens): Use the real 0th value of
12297 token_translations instead of `0'.
12298 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
12299 visible here.
12300 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
12301 for the time being: %locations ought to provide it to yyerror.
12302
12303 2002-07-25 Akim Demaille <akim@epita.fr>
12304
12305 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
12306 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
12307 * tests/regression.at (Web2c Actions): Adjust.
12308
12309 2002-07-25 Akim Demaille <akim@epita.fr>
12310
12311 Stop storing rules from 1 to nrules + 1.
12312
12313 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
12314 * src/nullable.c, src/output.c, src/print.c, src/reader.c
12315 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
12316 Iterate from 0 to nrules.
12317 Use rule_number_as_item_number and item_number_as_rule_number.
12318 Adjust to `derive' now containing possibly 0.
12319 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
12320 Handle the `- 1' part in rule numbers from/to item numbers.
12321 * src/conflicts.c (log_resolution): Fix the message which reversed
12322 shift and reduce.
12323 * src/output.c (action_row): Initialize default_rule to -1.
12324 (token_actions): Adjust.
12325 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
12326 expected output.
12327 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
12328
12329 2002-07-25 Akim Demaille <akim@epita.fr>
12330
12331 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
12332 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
12333 (b4_c_knr_arg_decl): New.
12334 * data/yacc.c: Use it to define yysymprint, yydestruct, and
12335 yyreport_parse_error.
12336
12337 2002-07-25 Akim Demaille <akim@epita.fr>
12338
12339 * data/yacc.c (yyreport_parse_error): New, extracted from...
12340 (yyparse): here.
12341 (yydestruct, yysymprint): Move above yyparse.
12342 Be K&R compliant.
12343
12344 2002-07-25 Akim Demaille <akim@epita.fr>
12345
12346 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
12347 replace...
12348 (b4_sint_type, b4_uint_type): these.
12349 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
12350 * tests/regression.at (Web2c Actions): Adjust.
12351
12352 2002-07-25 Akim Demaille <akim@epita.fr>
12353
12354 * src/gram.h (TIEM_NUMBER_MAX): New.
12355 (item_number_of_rule_number, rule_number_of_item_number): Rename
12356 as...
12357 (rule_number_as_item_number, item_number_as_rule_number): these.
12358 Adjust dependencies.
12359 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12360 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12361 (symbol_number_to_vector_number): New.
12362 (order): Of vector_number_t* type.
12363 (base_t, BASE_MAX, BASE_MIN): New.
12364 (froms, tos, width, pos, check): Of base_t type.
12365 (action_number_t, ACTION_MIN, ACTION_MAX): New.
12366 (actrow): Of action_number_t type.
12367 (conflrow): Of unsigned int type.
12368 (table_ninf, base_ninf): New.
12369 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
12370 (muscle_insert_int_table, muscle_insert_base_table)
12371 (muscle_insert_rule_number_table): New.
12372 (prepare_tokens): Output `toknum' as int_table.
12373 (action_row): Returns a rule_number_t.
12374 Use ACTION_MIN, not SHRT_MIN.
12375 (token_actions): yydefact is rule_number_t*.
12376 (table_ninf_remap): New.
12377 (pack_table): Use it for `base' and `table'.
12378 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
12379 replaced with...
12380 (YYPACT_NINF, YYTABLE_NINF): these.
12381 (yypact, yytable): Compute their types instead of hard-coded
12382 `short'.
12383 * tests/regression.at (Web2c Actions): Adjust.
12384
12385 2002-07-19 Akim Demaille <akim@epita.fr>
12386
12387 * src/scan-gram.l (id): Can start with an underscore.
12388
12389 2002-07-16 Akim Demaille <akim@epita.fr>
12390
12391 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
12392 Adjust all former `associativity' dependencies.
12393 * src/symtab.c (symbol_new): Default associativity is `undef', not
12394 `right'.
12395 (symbol_check_alias_consistence): Adjust.
12396
12397 2002-07-09 Akim Demaille <akim@epita.fr>
12398
12399 * doc/bison.texinfo: Properly set the ``header'' part.
12400 Use @dircategory ``GNU programming tools'' as per Texinfo's
12401 documentation.
12402 Use @copying.
12403
12404 2002-07-09 Akim Demaille <akim@epita.fr>
12405
12406 * lib/quotearg.h: Protect against multiple inclusions.
12407 * src/location.h (location_t): Add a `file' member.
12408 (LOCATION_RESET, LOCATION_PRINT): Adjust.
12409 * src/complain.c (warn_at, complain_at, fatal_at): Drop
12410 `error_one_per_line' support.
12411
12412 2002-07-09 Akim Demaille <akim@epita.fr>
12413
12414 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
12415 * src/reader.c (lineno): Remove.
12416 Adjust all dependencies.
12417 (get_merge_function): Take a location and use complain_at.
12418 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
12419 * tests/regression.at (Invalid inputs, Mixing %token styles):
12420 Adjust.
12421
12422 2002-07-09 Akim Demaille <akim@epita.fr>
12423
12424 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
12425 recovery rule, and forbid extensions when --yacc.
12426 (gram_error): Use complain_at.
12427 * src/reader.c (reader): Exit if there were parse errors.
12428
12429 2002-07-09 Akim Demaille <akim@epita.fr>
12430
12431 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
12432 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
12433 Reported by R Blake <blakers@mac.com>.
12434
12435 2002-07-09 Akim Demaille <akim@epita.fr>
12436
12437 * data/yacc.c: Output the copyright notive in the header.
12438
12439 2002-07-03 Akim Demaille <akim@epita.fr>
12440
12441 * src/output.c (froms, tos): Are state_number_t.
12442 (save_column): sp, sp1, and sp2 are state_number_t.
12443 (prepare): Rename `final' as `final_state_number', `nnts' as
12444 `nterms_number', `nrules' as `rules_number', `nstates' as
12445 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
12446 unused.
12447 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
12448 * data/lalr1.cc (nsym_): Remove, unused.
12449
12450 2002-07-03 Akim Demaille <akim@epita.fr>
12451
12452 * src/lalr.h, src/lalr.c (goto_number_t): New.
12453 * src/lalr.c (goto_list_t): New.
12454 Propagate them.
12455 * src/nullable.c (rule_list_t): New.
12456 Propagate.
12457 * src/types.h: Remove.
12458
12459 2002-07-03 Akim Demaille <akim@epita.fr>
12460
12461 * src/closure.c (print_fderives): Use rule_rhs_print.
12462 * src/derives.c (print_derives): Use rule_rhs_print.
12463 (rule_list_t): New, replaces `shorts'.
12464 (set_derives): Add comments.
12465 * tests/sets.at (Nullable, Firsts): Adjust.
12466
12467 2002-07-03 Akim Demaille <akim@epita.fr>
12468
12469 * src/output.c (prepare_actions): Free `tally' and `width'.
12470 (prepare_actions): Allocate and free `order'.
12471 * src/symtab.c (symbols_free): Free `symbols'.
12472 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
12473 * src/output.c (m4_invoke): Move to...
12474 * src/scan-skel.l: here.
12475 (<<EOF>>): Close yyout, and free its name.
12476
12477 2002-07-03 Akim Demaille <akim@epita.fr>
12478
12479 Fix some memory leaks, and fix a bug: state 0 was examined twice.
12480
12481 * src/LR0.c (new_state): Merge into...
12482 (state_list_append): this.
12483 (new_states): Merge into...
12484 (generate_states): here.
12485 (set_states): Don't ensure a proper `errs' state member here, do it...
12486 * src/conflicts.c (conflicts_solve): here.
12487 * src/state.h, src/state.c: Comment changes.
12488 (state_t): Rename member `shifts' as `transitions'.
12489 Adjust all dependencies.
12490 (errs_new): For consistency, also take the values as argument.
12491 (errs_dup): Remove.
12492 (state_errs_set): New.
12493 (state_reductions_set, state_transitions_set): Assert that no
12494 previous value was assigned.
12495 (state_free): New.
12496 (states_free): Use it.
12497 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
12498 temporary storage: use `errs' and `nerrs' as elsewhere.
12499 (set_conflicts): Allocate and free this `errs'.
12500
12501 2002-07-02 Akim Demaille <akim@epita.fr>
12502
12503 * lib/libiberty.h: New.
12504 * lib: Update the bitset implementation from upstream.
12505 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
12506 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
12507 * src/main.c: Adjust bitset stats calls.
12508
12509 2002-07-01 Paul Eggert <eggert@twinsun.com>
12510
12511 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
12512 char, so that negative chars don't collide with $.
12513
12514 2002-06-30 Akim Demaille <akim@epita.fr>
12515
12516 Have the GLR tests be `warning' checked, and fix the warnings.
12517
12518 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
12519 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
12520 (yyremoveDeletes): `yyi' and `yyj' are size_t.
12521 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
12522 (yyaddDeferredAction): static.
12523 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
12524 (yyreportParseError): yyprefix is const.
12525 yytokenp is used only when verbose.
12526 (yy__GNUC__): Replace with __GNUC__.
12527 (yypdumpstack): yyi is size_t.
12528 (yypreference): Un-yy local variables and arguments, to avoid
12529 clashes with `yyr1'. Anyway, we are not in the user name space.
12530 (yytname_size): be an int, as is compared with ints.
12531 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
12532 Use them.
12533 * tests/cxx-gram.at: Use quotation to protect $1.
12534 Use AT_COMPILE to enable warnings hunts.
12535 Prototype yylex and yyerror.
12536 `Use' argc.
12537 Include `string.h', not `strings.h'.
12538 Produce and prototype stmtMerge only when used.
12539 yylex takes a location.
12540
12541 2002-06-30 Akim Demaille <akim@epita.fr>
12542
12543 We spend a lot of time in quotearg, in particular when --verbose.
12544
12545 * src/symtab.c (symbol_get): Store a quoted version of the key.
12546 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
12547 Adjust all callers.
12548
12549 2002-06-30 Akim Demaille <akim@epita.fr>
12550
12551 * src/state.h (reductions_t): Rename member `nreds' as num.
12552 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
12553 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
12554
12555 2002-06-30 Akim Demaille <akim@epita.fr>
12556
12557 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
12558 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
12559 (shifts_to): Rename as...
12560 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
12561 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
12562 (TRANSITION_IS_DISABLED, transitions_to): these.
12563
12564 2002-06-30 Akim Demaille <akim@epita.fr>
12565
12566 * src/print.c (print_shifts, print_gotos): Merge into...
12567 (print_transitions): this.
12568 (print_transitions, print_errs, print_reductions): Align the
12569 lookaheads columns.
12570 (print_core, print_transitions, print_errs, print_state,
12571 print_grammar): Output empty lines separator before, not after.
12572 (state_default_rule_compute): Rename as...
12573 (state_default_rule): this.
12574 * tests/conflicts.at (Defaulted Conflicted Reduction),
12575 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
12576 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
12577
12578 2002-06-30 Akim Demaille <akim@epita.fr>
12579
12580 Display items as we display rules.
12581
12582 * src/gram.h, src/gram.c (rule_lhs_print): New.
12583 * src/gram.c (grammar_rules_partial_print): Use it.
12584 * src/print.c (print_core): Likewise.
12585 * tests/conflicts.at (Defaulted Conflicted Reduction),
12586 (Unresolved SR Conflicts): Adjust.
12587 (Unresolved SR Conflicts): Adjust and rename as...
12588 (Resolved SR Conflicts): this, as was meant.
12589 * tests/regression.at (Web2c Report): Adjust.
12590
12591 2002-06-30 Akim Demaille <akim@epita.fr>
12592
12593 * src/print.c (state_default_rule_compute): New, extracted from...
12594 (print_reductions): here.
12595 Pessimize, but clarify the code.
12596 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
12597
12598 2002-06-30 Akim Demaille <akim@epita.fr>
12599
12600 * src/output.c (action_row): Let default_rule be always a rule
12601 number.
12602
12603 2002-06-30 Akim Demaille <akim@epita.fr>
12604
12605 * src/closure.c (print_firsts, print_fderives, closure):
12606 Use BITSET_EXECUTE.
12607 * src/lalr.c (lookaheads_print): Likewise.
12608 * src/state.c (state_rule_lookaheads_print): Likewise.
12609 * src/print_graph.c (print_core): Likewise.
12610 * src/print.c (print_reductions): Likewise.
12611 * src/output.c (action_row): Likewise.
12612 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
12613
12614 2002-06-30 Akim Demaille <akim@epita.fr>
12615
12616 * src/print_graph.c: Use report_flag.
12617
12618 2002-06-30 Akim Demaille <akim@epita.fr>
12619
12620 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
12621 to...
12622 * src/relation.h, src/relation.c (traverse, relation_digraph)
12623 (relation_print, relation_transpose): New.
12624
12625 2002-06-30 Akim Demaille <akim@epita.fr>
12626
12627 * src/state.h, src/state.c (shifts_to): New.
12628 * src/lalr.c (build_relations): Use it.
12629
12630 2002-06-30 Akim Demaille <akim@epita.fr>
12631
12632 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
12633 (item_number_of_rule_number, rule_number_of_item_number): New.
12634 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
12635 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
12636 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
12637 Propagate their use.
12638 Much remains to be done, in particular wrt `shorts' from types.h.
12639
12640 2002-06-30 Akim Demaille <akim@epita.fr>
12641
12642 * src/symtab.c (symbol_new): Initialize the `printer' member.
12643
12644 2002-06-30 Akim Demaille <akim@epita.fr>
12645
12646 * src/LR0.c (save_reductions): Remove, replaced by...
12647 * src/state.h, src/state.c (state_reductions_set): New.
12648 (reductions, errs): Rename as...
12649 (reductions_t, errs_t): these.
12650 Adjust all dependencies.
12651
12652 2002-06-30 Akim Demaille <akim@epita.fr>
12653
12654 * src/LR0.c (state_list_t, state_list_append): New.
12655 (first_state, last_state): Now symbol_list_t.
12656 (this_state): Remove.
12657 (new_itemsets, append_states, save_reductions): Take a state_t as
12658 argument.
12659 (set_states, generate_states): Adjust.
12660 (save_shifts): Remove, replaced by...
12661 * src/state.h, src/state.c (state_shifts_set): New.
12662 (shifts): Rename as...
12663 (shifts_t): this.
12664 Adjust all dependencies.
12665 * src/state.h (state_t): Remove the `next' member.
12666
12667 2002-06-30 Akim Demaille <akim@epita.fr>
12668
12669 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
12670 escaped in slot 0.
12671
12672 2002-06-30 Akim Demaille <akim@epita.fr>
12673
12674 Use hash.h for the state hash table.
12675
12676 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
12677 (allocate_storage): Use state_hash_new.
12678 (free_storage): Use state_hash_free.
12679 (new_state, get_state): Adjust.
12680 * src/lalr.h, src/lalr.c (states): Move to...
12681 * src/states.h (state_t): Remove the `link' member, no longer
12682 used.
12683 * src/states.h, src/states.c: here.
12684 (state_hash_new, state_hash_free, state_hash_lookup)
12685 (state_hash_insert, states_free): New.
12686 * src/states.c (state_table, state_compare, state_hash): New.
12687 * src/output.c (output_actions): Do not free states now, since we
12688 still need to know the final_state number in `prepare', called
12689 afterwards. Do it...
12690 * src/main.c (main): here: call states_free after `output'.
12691
12692 2002-06-30 Akim Demaille <akim@epita.fr>
12693
12694 * src/state.h, src/state.c (state_new): New, extracted from...
12695 * src/LR0.c (new_state): here.
12696 * src/state.h (STATE_ALLOC): Move to...
12697 * src/state.c: here.
12698 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
12699 * src/state.h, src/state.c: here.
12700
12701 2002-06-30 Akim Demaille <akim@epita.fr>
12702
12703 * src/reader.c (gensym): Rename as...
12704 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
12705 (getsym): Rename as...
12706 (symbol_get): this.
12707
12708 2002-06-30 Akim Demaille <akim@epita.fr>
12709
12710 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
12711 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
12712 * src/output.c, src/print.c, src/print_graph.c: Propagate.
12713 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
12714
12715 2002-06-30 Akim Demaille <akim@epita.fr>
12716
12717 Make the test suite pass with warnings checked.
12718
12719 * tests/actions.at (Printers and Destructors): Improve.
12720 Avoid unsigned vs. signed issues.
12721 * tests/calc.at: Don't exercise the scanner here, do it...
12722 * tests/input.at (Torturing the Scanner): here.
12723
12724 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12725
12726 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
12727 reorganize first lines parallel to yacc.c.
12728
12729 2002-06-28 Akim Demaille <akim@epita.fr>
12730
12731 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
12732 (b4_token_enum, b4_token_defines): New, factored from...
12733 * data/lalr1.cc, data/yacc.c, glr.c: here.
12734
12735 2002-06-28 Akim Demaille <akim@epita.fr>
12736
12737 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
12738 unused variables.
12739 * src/output.c (merger_output): static.
12740
12741 2002-06-28 Akim Demaille <akim@epita.fr>
12742
12743 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
12744 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
12745 pacify GCC.
12746 * src/output.c (save_row): Initialize all the variables to pacify GCC.
12747
12748 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12749
12750 Accumulated changelog for new GLR parsing features.
12751
12752 * src/conflicts.c (count_total_conflicts): Change name to
12753 conflicts_total_count.
12754 * src/conflicts.h: Ditto.
12755 * src/output.c (token_actions): Use the new name.
12756 (output_conflicts): Change conflp => conflict_list_heads, and
12757 confl => conflict_list for better readability.
12758 * data/glr.c: Use the new names.
12759 * NEWS: Add self to GLR announcement.
12760
12761 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
12762
12763 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
12764 Akim Demaille.
12765
12766 * data/bison.glr: Change name to glr.c
12767 * data/glr.c: Renamed from bison.glr.
12768 * data/Makefile.am: Add glr.c
12769
12770 * src/getargs.c:
12771
12772 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
12773 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
12774
12775 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12776
12777 * data/bison.glr: Be sure to restore the
12778 current #line when returning to the skeleton contents after having
12779 exposed the input file's #line.
12780
12781 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12782
12783 * data/bison.glr: Bring up to date with changes to bison.simple.
12784
12785 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12786
12787 * data/bison.glr: Correct definitions that use b4_prefix.
12788 Various reformatting.
12789 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
12790 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
12791 yytokenp argument; now part of stack.
12792 (yychar): Define to behave as documented.
12793 (yyclearin): Ditto.
12794
12795 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
12796
12797 * src/reader.h: Add declaration for free_merger_functions.
12798
12799 * src/reader.c (merge_functions): New variable.
12800 (get_merge_function): New function.
12801 (free_merger_functions): New function.
12802 (readgram): Check for %prec that is not followed by a symbol.
12803 Handle %dprec and %merge declarations.
12804 (packgram): Initialize dprec and merger fields in rules array.
12805
12806 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
12807 conflict_list_cnt, conflict_list_free): New variables.
12808 (table_grow): Also grow conflict_table.
12809 (prepare_rules): Output dprec and merger tables.
12810 (conflict_row): New function.
12811 (action_row): Output conflict lists for GLR parser. Don't use
12812 default reduction in conflicted states for GLR parser so that there
12813 are spaces for the conflict lists.
12814 (save_row): Also save conflict information.
12815 (token_actions): Allocate conflict list.
12816 (merger_output): New function.
12817 (pack_vector): Pack conflict table, too.
12818 (output_conflicts): New function to output yyconflp and yyconfl.
12819 (output_check): Allocate conflict_tos.
12820 (output_actions): Output conflict tables, also.
12821 (output_skeleton): Output b4_mergers definition.
12822 (prepare): Output b4_max_rhs_length definition.
12823 Use 'bison.glr' as default skeleton for GLR parsers.
12824
12825 * src/gram.c (glr_parser): New flag.
12826 (grammar_free): Call free_merger_functions.
12827
12828 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
12829 all pairs of conflicting reductions, rather than just all tokens
12830 causing conflicts. Needed to size conflict tables.
12831 (conflicts_output): Modify call to count_rr_conflicts for new
12832 interface.
12833 (conflicts_print): Ditto.
12834 (count_total_conflicts): New function.
12835
12836 * src/reader.h (merger_list): New type.
12837 (merge_functions): New variable.
12838
12839 * src/lex.h (tok_dprec, tok_merge): New token types.
12840
12841 * src/gram.h (rule_s): Add dprec and merger fields.
12842 (glr_parser): New flag.
12843
12844 * src/conflicts.h (count_total_conflicts): New function.
12845
12846 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
12847
12848 * doc/bison.texinfo (Generalized LR Parsing): New section.
12849 (GLR Parsers): New section.
12850 (Language and Grammar): Mention GLR parsing.
12851 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
12852 Correct typo ("tge" -> "the").
12853
12854 * data/bison.glr: New skeleton for GLR parsing.
12855
12856 * tests/cxx-gram.at: New tests for GLR parsing.
12857
12858 * tests/testsuite.at: Include cxx-gram.at.
12859
12860 * tests/Makefile.am: Add cxx-gram.at.
12861
12862 * src/parse-gram.y:
12863
12864 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
12865
12866 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
12867
12868 2002-06-27 Akim Demaille <akim@epita.fr>
12869
12870 * src/options.h, src/options.c: Remove.
12871 * src/getargs.c (short_options, long_options): New.
12872
12873 2002-06-27 Akim Demaille <akim@epita.fr>
12874
12875 * data/bison.simple, data/bison.c++: Rename as...
12876 * data/yacc.c, data/lalr1.cc: these.
12877 * doc/bison.texinfo (Environment Variables): Remove.
12878
12879 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
12880
12881 * src/getargs.c (report_argmatch): Initialize strtok().
12882
12883 2002-06-20 Akim Demaille <akim@epita.fr>
12884
12885 * data/bison.simple (b4_symbol_actions): New, replaces...
12886 (b4_symbol_destructor, b4_symbol_printer): these.
12887 (yysymprint): Be sure to call YYPRINT only for tokens, and using
12888 user token numbers.
12889
12890 2002-06-20 Akim Demaille <akim@epita.fr>
12891
12892 * data/bison.simple (yydestructor): Rename as...
12893 (yydestruct): this.
12894
12895 2002-06-20 Akim Demaille <akim@epita.fr>
12896
12897 * src/symtab.h, src/symtab.c (symbol_type_set)
12898 (symbol_destructor_set, symbol_precedence_set): The location is
12899 the last argument.
12900 Adjust all callers.
12901
12902 2002-06-20 Akim Demaille <akim@epita.fr>
12903
12904 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
12905 internals.
12906 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
12907 Takes a location.
12908 * src/symtab.h, src/symtab.c (symbol_class_set)
12909 (symbol_user_token_number_set): Likewise.
12910 Adjust all callers.
12911 Promote complain_at.
12912 * tests/input.at (Type Clashes): Adjust.
12913
12914 2002-06-20 Akim Demaille <akim@epita.fr>
12915
12916 * data/bison.simple (YYLEX): Fix the declaration when
12917 %pure-parser.
12918
12919 2002-06-20 Akim Demaille <akim@epita.fr>
12920
12921 * data/bison.simple (yysymprint): Don't print the token number,
12922 just its name.
12923 * tests/actions.at (Destructors): Rename as...
12924 (Printers and Destructors): this.
12925 Also exercise %printer.
12926
12927 2002-06-20 Akim Demaille <akim@epita.fr>
12928
12929 * data/bison.simple (YYDSYMPRINT): New.
12930 Use it to remove many of the #if YYDEBUG/if (yydebug).
12931
12932 2002-06-20 Akim Demaille <akim@epita.fr>
12933
12934 * src/symtab.h, src/symtab.c (symbol_t): printer and
12935 printer_location are new members.
12936 (symbol_printer_set): New.
12937 * src/parse-gram.y (PERCENT_PRINTER): New token.
12938 Handle its associated rule.
12939 * src/scan-gram.l: Adjust.
12940 (handle_destructor_at, handle_destructor_dollar): Rename as...
12941 (handle_symbol_code_at, handle_symbol_code_dollar): these.
12942 * src/output.c (symbol_printers_output): New.
12943 (output_skeleton): Call it.
12944 * data/bison.simple (yysymprint): New. Cannot be named yyprint
12945 since there are already many grammar files with a user `yyprint'.
12946 Replace the calls to YYPRINT to calls to yysymprint.
12947 * tests/calc.at: Adjust.
12948 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
12949 taking advantage of parser very internal details (stack size!).
12950
12951 2002-06-20 Akim Demaille <akim@epita.fr>
12952
12953 * src/scan-gram.l: Complete the scanner with the missing patterns
12954 to pacify Flex.
12955 Use `quote' and `symbol_tag_get' where appropriate.
12956
12957 2002-06-19 Akim Demaille <akim@epita.fr>
12958
12959 * tests/actions.at (Destructors): Augment to test locations.
12960 * data/bison.simple (yydestructor): Pass it the current location
12961 if locations are enabled.
12962 Prototype only when __STDC__ or C++.
12963 Change the argument names to move into the yy name space: there is
12964 user code here.
12965
12966 2002-06-19 Akim Demaille <akim@epita.fr>
12967
12968 * data/bison.simple (b4_pure_if): New.
12969 Use it instead of #ifdef YYPURE.
12970
12971 2002-06-19 Akim Demaille <akim@epita.fr>
12972
12973 * data/bison.simple (b4_location_if): New.
12974 Use it instead of #ifdef YYLSP_NEEDED.
12975
12976 2002-06-19 Akim Demaille <akim@epita.fr>
12977
12978 Prepare @$ in %destructor, but currently don't bind it in the
12979 skeleton, as %location use is not cleaned up yet.
12980
12981 * src/scan-gram.l (handle_dollar, handle_destructor_at)
12982 (handle_action_at): New.
12983 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
12984 a braced_code_t and a location as additional arguments.
12985 (handle_destructor_dollar): Instead of requiring `b4_eval', just
12986 unquote one when outputting `b4_dollar_dollar'.
12987 Adjust callers.
12988 * data/bison.simple (b4_eval): Remove.
12989 (b4_symbol_destructor): Adjust.
12990 * tests/input.at (Invalid @n): Adjust.
12991
12992 2002-06-19 Zack Weinberg <zack@codesourcery.com>
12993
12994 * doc/bison.texinfo: Document ability to have multiple
12995 prologue sections.
12996
12997 2002-06-18 Akim Demaille <akim@epita.fr>
12998
12999 * src/files.c (compute_base_names): When computing the output file
13000 names from the input file name, strip the directory part.
13001
13002 2002-06-18 Akim Demaille <akim@epita.fr>
13003
13004 * data/bison.simple.new: Comment changes.
13005 Reported by Andreas Schwab.
13006
13007 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
13008
13009 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
13010 there are no `label `yyoverflowlab' defined but not used' warnings
13011 when yyoverflow is defined.
13012
13013 2002-06-18 Akim Demaille <akim@epita.fr>
13014
13015 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
13016 new member.
13017 (symbol_destructor_set): Adjust.
13018 * src/output.c (symbol_destructors_output): Output the destructor
13019 locations.
13020 Output the symbol name.
13021 * data/bison.simple (b4_symbol_destructor): Adjust.
13022
13023 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
13024 and Akim Demaille <akim@epita.fr>
13025
13026 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
13027 what's left on the stack when the error recovery hits EOF.
13028 * tests/actions.at (Destructors): Complete to exercise this case.
13029
13030 2002-06-17 Akim Demaille <akim@epita.fr>
13031
13032 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
13033 arguments is really empty, not only equal to `[]'.
13034 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
13035 member.
13036 (symbol_destructor_set): New.
13037 * src/output.c (symbol_destructors_output): New.
13038 * src/reader.h (brace_code_t, current_braced_code): New.
13039 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
13040 (handle_dollar): Rename as...
13041 (handle_action_dollar): this.
13042 (handle_destructor_dollar): New.
13043 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
13044 (grammar_declaration): Use it.
13045 * data/bison.simple (yystos): Is always defined.
13046 (yydestructor): New.
13047 * tests/actions.at (Destructors): New.
13048 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
13049
13050 2002-06-17 Akim Demaille <akim@epita.fr>
13051
13052 * src/symlist.h, src/symlist.c (symbol_list_length): New.
13053 * src/scan-gram.l (handle_dollar, handle_at): Compute the
13054 rule_length only when needed.
13055 * src/output.c (actions_output, token_definitions_output): Output
13056 the full M4 block.
13057 * src/symtab.c: Don't access directly to the symbol tag, use
13058 symbol_tag_get.
13059 * src/parse-gram.y: Use symbol_list_free.
13060
13061 2002-06-17 Akim Demaille <akim@epita.fr>
13062
13063 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
13064 (symbol_list_prepend, get_type_name): Move to...
13065 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
13066 (symbol_list_prepend, symbol_list_n_type_name_get): here.
13067 Adjust all callers.
13068 (symbol_list_free): New.
13069 * src/scan-gram.l (handle_dollar): Takes a location.
13070 * tests/input.at (Invalid $n): Adjust.
13071
13072 2002-06-17 Akim Demaille <akim@epita.fr>
13073
13074 * src/reader.h, src/reader.c (symbol_list_new): Export it.
13075 (symbol_list_prepend): New.
13076 * src/parse-gram.y (%union): `list' is a new member.
13077 (symbols.1): New, replaces...
13078 (terms_to_prec.1, nterms_to_type.1): these.
13079 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
13080 Take a location as additional argument.
13081 Adjust all callers.
13082
13083 2002-06-15 Akim Demaille <akim@epita.fr>
13084
13085 * src/parse-gram.y: Move %token in the declaration section so that
13086 we don't depend upon CVS Bison.
13087
13088 2002-06-15 Akim Demaille <akim@epita.fr>
13089
13090 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
13091 * src/print.c (print_core): Use it.
13092
13093 2002-06-15 Akim Demaille <akim@epita.fr>
13094
13095 * src/conflicts.c (log_resolution): Accept the rule involved in
13096 the sr conflicts instead of the lookahead number that points to
13097 that rule.
13098 (flush_reduce): Accept the current lookahead vector as argument,
13099 instead of the index in LA.
13100 (resolve_sr_conflict): Accept the current number of lookahead
13101 bitset to consider for the STATE, instead of the index in LA.
13102 (set_conflicts): Adjust.
13103 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
13104
13105 2002-06-15 Akim Demaille <akim@epita.fr>
13106
13107 * src/state.h (state_t): Replace the `lookaheadsp' member, a
13108 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
13109 Adjust all dependencies.
13110 * src/lalr.c (initialize_lookaheads): Split into...
13111 (states_lookaheads_count, states_lookaheads_initialize): these.
13112 (lalr): Adjust.
13113
13114 2002-06-15 Akim Demaille <akim@epita.fr>
13115
13116 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
13117 out of...
13118 (grammar_rules_print): here.
13119 * src/reduce.c (reduce_output): Use it.
13120 * tests/reduce.at (Useless Rules, Reduced Automaton)
13121 (Underivable Rules): Adjust.
13122
13123 2002-06-15 Akim Demaille <akim@epita.fr>
13124
13125 Copy BYacc's nice way to report the grammar.
13126
13127 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
13128 New.
13129 Don't print the rules' location, it is confusing and useless.
13130 (rule_print): Use grammar_rhs_print.
13131 * src/print.c (print_grammar): Use grammar_rules_print.
13132
13133 2002-06-15 Akim Demaille <akim@epita.fr>
13134
13135 Complete and rationalize `useless thing' warnings.
13136
13137 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
13138 (symbol_tag_print): New.
13139 Use them everywhere in place of accessing directly the tag member.
13140 * src/gram.h, src/gram.c (rule_print): New.
13141 Use it where a rule used to be printed `by hand'.
13142 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
13143 (reduce_grammar_tables): Report the useless rules.
13144 (reduce_print): Useless things are a warning, not an error.
13145 Report it as such.
13146 * tests/reduce.at (Useless Nonterminals, Useless Rules):
13147 (Reduced Automaton, Underivable Rules): Adjust.
13148 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
13149 * tests/conflicts.at (Unresolved SR Conflicts)
13150 (Solved SR Conflicts): Adjust.
13151
13152 2002-06-15 Akim Demaille <akim@epita.fr>
13153
13154 Let symbols have a location.
13155
13156 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
13157 (getsym): Adjust.
13158 Adjust all callers.
13159 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
13160 Use location_t, not int.
13161 * src/symtab.c (symbol_check_defined): Take advantage of the
13162 location.
13163 * tests/regression.at (Invalid inputs): Adjust.
13164
13165 2002-06-15 Akim Demaille <akim@epita.fr>
13166
13167 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
13168 (input): Don't try to initialize yylloc here, do it in the
13169 scanner.
13170 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
13171 * src/gram.h (rule_t): Change line and action_line into location
13172 and action_location, of location_t type.
13173 Adjust all dependencies.
13174 * src/location.h, src/location.c (empty_location): New.
13175 * src/reader.h, src/reader.c (grammar_start_symbol_set)
13176 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
13177 (grammar_current_rule_symbol_append)
13178 (grammar_current_rule_action_append): Expect a location as argument.
13179 * src/reader.c (grammar_midrule_action): Adjust to attach an
13180 action's location as dummy symbol location.
13181 * src/symtab.h, src/symtab.c (startsymbol_location): New.
13182 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
13183 the line numbers.
13184
13185 2002-06-14 Akim Demaille <akim@epita.fr>
13186
13187 Grammar declarations may be found in the grammar section.
13188
13189 * src/parse-gram.y (rules_or_grammar_declaration): New.
13190 (declarations): Each declaration may end with a semicolon, not
13191 just...
13192 (grammar_declaration): `"%union"'.
13193 (grammar): Branch to rules_or_grammar_declaration.
13194
13195 2002-06-14 Akim Demaille <akim@epita.fr>
13196
13197 * src/main.c (main): Invoke scanner_free.
13198
13199 2002-06-14 Akim Demaille <akim@epita.fr>
13200
13201 * src/output.c (m4_invoke): Extracted from...
13202 (output_skeleton): here.
13203 Free tempfile.
13204
13205 2002-06-14 Akim Demaille <akim@epita.fr>
13206
13207 * src/parse-gram.y (directives, directive, gram)
13208 (grammar_directives, precedence_directives, precedence_directive):
13209 Rename as...
13210 (declarations, declaration, grammar, grammar_declaration)
13211 (precedence_declaration, precedence_declarator): these.
13212 (symbol_declaration): New.
13213
13214 2002-06-14 Akim Demaille <akim@epita.fr>
13215
13216 * src/files.c (action_obstack): Remove, unused.
13217 (output_obstack): Remove it, and all its dependencies, as it is no
13218 longer needed.
13219 * src/reader.c (epilogue_set): Build the epilogue in the
13220 muscle_obstack.
13221 * src/output.h, src/output.c (muscle_obstack): Move to...
13222 * src/muscle_tab.h, src/muscle_tab.h: here.
13223 (muscle_init): Initialize muscle_obstack.
13224 (muscle_free): New.
13225 * src/main.c (main): Call it.
13226
13227 2002-06-14 Akim Demaille <akim@epita.fr>
13228
13229 * src/location.h: New, extracted from...
13230 * src/reader.h: here.
13231 * src/Makefile.am (noinst_HEADERS): Merge into
13232 (bison_SOURCES): this.
13233 Add location.h.
13234 * src/parse-gram.y: Use location_t instead of Bison's.
13235 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
13236 Use location_t instead of ints.
13237
13238 2002-06-14 Akim Demaille <akim@epita.fr>
13239
13240 * data/bison.simple, data/bison.c++: Be sure to restore the
13241 current #line when returning to the skeleton contents after having
13242 exposed the input file's #line.
13243
13244 2002-06-12 Akim Demaille <akim@epita.fr>
13245
13246 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
13247 eager.
13248 * tests/actions.at (Exotic Dollars): New.
13249
13250 2002-06-12 Akim Demaille <akim@epita.fr>
13251
13252 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
13253 ['"/] too eagerly.
13254 * tests/input.at (Torturing the Scanner): New.
13255
13256 2002-06-11 Akim Demaille <akim@epita.fr>
13257
13258 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
13259 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
13260 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
13261 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
13262 * src/reader.c (reader): Use it.
13263
13264 2002-06-11 Akim Demaille <akim@epita.fr>
13265
13266 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
13267 Adjust all callers.
13268 (scanner_last_string_free): New.
13269
13270 2002-06-11 Akim Demaille <akim@epita.fr>
13271
13272 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
13273 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
13274 (last_string, YY_OBS_FREE): New.
13275 Use them when returning an ID.
13276
13277 2002-06-11 Akim Demaille <akim@epita.fr>
13278
13279 Have Bison grammars parsed by a Bison grammar.
13280
13281 * src/reader.c, src/reader.h (prologue_augment): New.
13282 * src/reader.c (copy_definition): Remove.
13283
13284 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
13285 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
13286 (grammar_current_rule_prec_set, grammar_current_rule_check)
13287 (grammar_current_rule_symbol_append)
13288 (grammar_current_rule_action_append): Export.
13289 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
13290 (symbol_list_action_append): Remove.
13291 Hook the routines from reader.
13292 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
13293 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
13294
13295 * src/reader.c (read_declarations): Remove, unused.
13296
13297 * src/parse-gram.y: Handle the epilogue.
13298 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
13299 (grammar_start_symbol_set): this.
13300 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
13301 * src/reader.c (readgram): Remove, unused.
13302 (reader): Adjust to insert eoftoken and axiom where appropriate.
13303
13304 * src/reader.c (copy_dollar): Replace with...
13305 * src/scan-gram.h (handle_dollar): this.
13306 * src/parse-gram.y: Remove `%thong'.
13307
13308 * src/reader.c (copy_at): Replace with...
13309 * src/scan-gram.h (handle_at): this.
13310
13311 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
13312 New.
13313
13314 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
13315 time being.
13316
13317 * src/reader.h, src/reader.c (grammar_rule_end): New.
13318
13319 * src/parse.y (current_type, current_class): New.
13320 Implement `%nterm', `%token' support.
13321 Merge `%term' into `%token'.
13322 (string_as_id): New.
13323 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
13324 type name.
13325
13326 * src/parse-gram.y: Be sure to handle properly the beginning of
13327 rules.
13328
13329 * src/parse-gram.y: Handle %type.
13330 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
13331
13332 * src/parse-gram.y: More directives support.
13333 * src/options.c: No longer handle source directives.
13334
13335 * src/parse-gram.y: Fix %output.
13336
13337 * src/parse-gram.y: Handle %union.
13338 Use the prologue locations.
13339 * src/reader.c (parse_union_decl): Remove.
13340
13341 * src/reader.h, src/reader.c (epilogue_set): New.
13342 * src/parse-gram.y: Use it.
13343
13344 * data/bison.simple, data/bison.c++: b4_stype is now either not
13345 defined, then default to int, or to the contents of %union,
13346 without `union' itself.
13347 Adjust.
13348 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
13349
13350 * src/output.c (actions_output): Don't output braces, as they are
13351 already handled by the scanner.
13352
13353 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
13354 characters to themselves.
13355
13356 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
13357 that the epilogue has a proper #line.
13358
13359 * src/parse-gram.y: Handle precedence/associativity.
13360
13361 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
13362 a terminal.
13363 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
13364 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
13365 at all to define terminals that cannot be emitted.
13366
13367 * src/scan-gram.l: Escape M4 characters.
13368
13369 * src/scan-gram.l: Working properly with escapes in user
13370 strings/characters.
13371
13372 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
13373 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
13374 grammar.
13375 Use more modest sizes, as for the time being the parser does not
13376 release memory, and therefore the process swallows a huge amount
13377 of memory.
13378
13379 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
13380 stricter %token grammar.
13381
13382 * src/symtab.h (associativity): Add `undef_assoc'.
13383 (symbol_precedence_set): Do nothing when passed an undef_assoc.
13384 * src/symtab.c (symbol_check_alias_consistence): Adjust.
13385
13386 * tests/regression.at (Invalid %directive): Remove, as it is now
13387 meaningless.
13388 (Invalid inputs): Adjust to the new error messages.
13389 (Token definitions): The new grammar doesn't allow too many
13390 eccentricities.
13391
13392 * src/lex.h, src/lex.c: Remove.
13393 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
13394 (copy_character, copy_string2, copy_string, copy_identifier)
13395 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
13396 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
13397 (parse_action): Remove.
13398 * po/POTFILES.in: Adjust.
13399
13400 2002-06-11 Akim Demaille <akim@epita.fr>
13401
13402 * src/reader.c (parse_action): Don't store directly into the
13403 rule's action member: return the action as a string.
13404 Don't require `rule_length' as an argument: compute it.
13405 (grammar_current_rule_symbol_append)
13406 (grammar_current_rule_action_append): New, eved out from
13407 (readgram): here.
13408 Remove `action_flag', `rulelength', unused now.
13409
13410 2002-06-11 Akim Demaille <akim@epita.fr>
13411
13412 * src/reader.c (grammar_current_rule_prec_set).
13413 (grammar_current_rule_check): New, eved out from...
13414 (readgram): here.
13415 Remove `xaction', `first_rhs': useless.
13416 * tests/input.at (Type clashes): New.
13417 * tests/existing.at (GNU Cim Grammar): Adjust.
13418
13419 2002-06-11 Akim Demaille <akim@epita.fr>
13420
13421 * src/reader.c (grammar_midrule_action): New, Eved out from
13422 (readgram): here.
13423
13424 2002-06-11 Akim Demaille <akim@epita.fr>
13425
13426 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
13427 New.
13428 (readgram): Use them as replacement of inlined code, crule and
13429 crule1.
13430
13431 2002-06-11 Akim Demaille <akim@epita.fr>
13432
13433 * src/reader.c (grammar_end, grammar_symbol_append): New.
13434 (readgram): Use them.
13435 Make the use of `p' as local as possible.
13436
13437 2002-06-10 Akim Demaille <akim@epita.fr>
13438
13439 GCJ's parser requires the tokens to be defined before the prologue.
13440
13441 * data/bison.simple: Output the token definition before the user's
13442 prologue.
13443 * tests/regression.at (Braces parsing, Duplicate string)
13444 (Mixing %token styles): Check the output from bison.
13445 (Early token definitions): New.
13446
13447 2002-06-10 Akim Demaille <akim@epita.fr>
13448
13449 * src/symtab.c (symbol_user_token_number_set): Don't complain when
13450 assigning twice the same user number to a token, so that we can
13451 use it in...
13452 * src/lex.c (lex): here.
13453 Also use `symbol_class_set' instead of hand written code.
13454 * src/reader.c (parse_assoc_decl): Likewise.
13455
13456 2002-06-10 Akim Demaille <akim@epita.fr>
13457
13458 * src/symtab.c, src/symtab.c (symbol_class_set)
13459 (symbol_user_token_number_set): New.
13460 * src/reader.c (parse_token_decl): Use them.
13461 Use a switch instead of ifs.
13462 Use a single argument.
13463
13464 2002-06-10 Akim Demaille <akim@epita.fr>
13465
13466 Remove `%thong' support as it is undocumented, unused, duplicates
13467 `%token's job, and creates useless e-mail traffic with people who
13468 want to know what it is, why it is undocumented, unused, and
13469 duplicates `%token's job.
13470
13471 * src/reader.c (parse_thong_decl): Remove.
13472 * src/options.c (option_table): Remove "thong".
13473 * src/lex.h (tok_thong): Remove.
13474
13475 2002-06-10 Akim Demaille <akim@epita.fr>
13476
13477 * src/symtab.c, src/symtab.c (symbol_type_set)
13478 (symbol_precedence_set): New.
13479 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
13480 (value_components_used): Remove, unused.
13481
13482 2002-06-09 Akim Demaille <akim@epita.fr>
13483
13484 Move symbols handling code out of the reader.
13485
13486 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
13487 (axiom): Move to...
13488 * src/symtab.h, src/symtab.c: here.
13489
13490 * src/gram.c (start_symbol): Remove: use startsymbol->number.
13491 * src/reader.c (startval): Rename as...
13492 * src/symtab.h, src/symtab.c (startsymbol): this.
13493 * src/reader.c: Adjust.
13494
13495 * src/reader.c (symbol_check_defined, symbol_make_alias)
13496 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13497 (token_translations_init)
13498 Move to...
13499 * src/symtab.c: here.
13500 * src/reader.c (packsymbols): Move to...
13501 * src/symtab.h, src/symtab.c (symbols_pack): here.
13502 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
13503 argument.
13504
13505 2002-06-03 Akim Demaille <akim@epita.fr>
13506
13507 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
13508 then statements.
13509
13510 2002-06-03 Akim Demaille <akim@epita.fr>
13511
13512 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
13513 structs with non literals.
13514 * src/scan-skel.l: never-interactive.
13515 * src/conflicts.c (enum conflict_resolution_e): No trailing
13516 comma.
13517 * src/getargs.c (usage): Split long literal strings.
13518 Reported by Hans Aberg.
13519
13520 2002-05-28 Akim Demaille <akim@epita.fr>
13521
13522 * data/bison.c++: Use C++ ostreams.
13523 (cdebug_): New member.
13524
13525 2002-05-28 Akim Demaille <akim@epita.fr>
13526
13527 * src/output.c (output_skeleton): Be sure to allocate enough room
13528 for `/' _and_ for `\0' in full_skeleton.
13529
13530 2002-05-28 Akim Demaille <akim@epita.fr>
13531
13532 * data/bison.c++: Catch up with bison.simple:
13533 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13534 and Paul Eggert <eggert@twinsun.com>: `error' handing.
13535 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
13536 and popping traces.
13537
13538 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13539
13540 * src/output.c (output_skeleton): Put an explicit path in front of
13541 the skeleton file name, rather than relying on the -I directory,
13542 to partially alleviate effects of having a skeleton file lying around
13543 in the current directory.
13544
13545 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13546
13547 * src/conflicts.c (log_resolution): Correct typo:
13548 obstack_printf should be obstack_fgrow1.
13549
13550 2002-05-26 Akim Demaille <akim@epita.fr>
13551
13552 * src/state.h (state_t): `solved_conflicts' is a new member.
13553 * src/LR0.c (new_state): Set it to 0.
13554 * src/conflicts.h, src/conflicts.c (print_conflicts)
13555 (free_conflicts, solve_conflicts): Rename as...
13556 (conflicts_print, conflicts_free, conflicts_solve): these.
13557 Adjust callers.
13558 * src/conflicts.c (enum conflict_resolution_e)
13559 (solved_conflicts_obstack): New, used by...
13560 (log_resolution): this.
13561 Adjust to attach the conflict resolution to each state.
13562 Complete the description with the precedence/associativity
13563 information.
13564 (resolve_sr_conflict): Adjust.
13565 * src/print.c (print_state): Output its solved_conflicts.
13566 * tests/conflicts.at (Unresolved SR Conflicts)
13567 (Solved SR Conflicts): Exercise --report=all.
13568
13569 2002-05-26 Akim Demaille <akim@epita.fr>
13570
13571 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13572 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13573 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
13574 (token_number_t, item_number_as_token_number)
13575 (token_number_as_item_number, muscle_insert_token_number_table):
13576 Rename as...
13577 (symbol_number_t, item_number_as_symbol_number)
13578 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
13579 these, since it is more appropriate.
13580
13581 2002-05-26 Akim Demaille <akim@epita.fr>
13582
13583 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
13584 `Error:' lines.
13585 * data/bison.simple (yystos) [YYDEBUG]: New.
13586 (yyparse) [YYDEBUG]: Display the symbols which are popped during
13587 error recovery.
13588 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
13589
13590 2002-05-25 Akim Demaille <akim@epita.fr>
13591
13592 * doc/bison.texinfo (Debugging): Split into...
13593 (Tracing): this new section, its former contents, and...
13594 (Understanding): this new section.
13595 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
13596 by...
13597 (report_flag): this.
13598 Adjust all dependencies.
13599 (report_args, report_types, report_argmatch): New.
13600 (usage, getargs): Report/support -r, --report.
13601 * src/options.h
13602 (struct option_table_struct): Rename as..,
13603 (struct option_table_s): this.
13604 Rename the `set_flag' member to `flag' to match with getopt_long's
13605 struct.
13606 * src/options.c (option_table): Split verbose into an entry for
13607 %verbose, and another for --verbose.
13608 Support --report/-r, so remove -r from the obsolete --raw.
13609 * src/print.c: Attach full item sets and lookaheads reports to
13610 report_flag instead of trace_flag.
13611 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
13612
13613 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13614 and Paul Eggert <eggert@twinsun.com>
13615
13616 * data/bison.simple (yyparse): Correct error handling to conform to
13617 POSIX and yacc. Specifically, after syntax error is discovered,
13618 do not reduce further before shifting the error token.
13619 Clean up the code a bit by removing the labels yyerrdefault,
13620 yyerrhandle, yyerrpop.
13621 * NEWS: Document the above.
13622
13623 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13624
13625 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
13626 type; it isn't always big enough, since it doesn't necessarily
13627 include non-terminals.
13628 (yytranslate): Expand definition of yy_token_number_type, so that
13629 the latter can be removed.
13630 (yy_token_number_type): Remove, only one use.
13631 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
13632 don't use TokenNumberType as element type.
13633
13634 * tests/regression.at: Modify expected output to agree with change
13635 to yyr1 and yytranslate.
13636
13637 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
13638
13639 * src/reader.c (parse_action): Use copy_character instead of
13640 obstack_1grow.
13641
13642 2002-05-13 Akim Demaille <akim@epita.fr>
13643
13644 * tests/regression.at (Token definitions): Prototype yylex and
13645 yyerror.
13646
13647 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13648
13649 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
13650 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
13651 32-bit arithmetic.
13652 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
13653
13654 2002-05-07 Akim Demaille <akim@epita.fr>
13655
13656 * tests/synclines.at: Be sure to prototype yylex and yyerror to
13657 avoid GCC warnings.
13658
13659 2002-05-07 Akim Demaille <akim@epita.fr>
13660
13661 Kill GCC warnings.
13662
13663 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
13664 over the RHS of each rule.
13665 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
13666 * src/state.h (state_t): Member `nitems' is unsigned short.
13667 * src/LR0.c (get_state): Adjust.
13668 * src/reader.c (packgram): Likewise.
13669 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
13670 `Type'.
13671 (muscle_insert_int_table): Remove, unused.
13672 (prepare_rules): Remove `max'.
13673
13674 2002-05-06 Akim Demaille <akim@epita.fr>
13675
13676 * src/closure.c (print_firsts): Display of the symbol tags.
13677 (bitmatrix_print): Move to...
13678 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
13679 here.
13680 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
13681
13682 2002-05-06 Akim Demaille <akim@epita.fr>
13683
13684 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
13685 hash_do_for_each.
13686
13687 2002-05-06 Akim Demaille <akim@epita.fr>
13688
13689 * src/LR0.c (new_state, get_state): Instead of using the global
13690 `kernel_size' and `kernel_base', have two new arguments:
13691 `core_size' and `core'.
13692 Adjust callers.
13693
13694 2002-05-06 Akim Demaille <akim@epita.fr>
13695
13696 * src/reader.c (packgram): No longer end `ritem' with a 0
13697 sentinel: it is not used.
13698
13699 2002-05-05 Akim Demaille <akim@epita.fr>
13700
13701 New experimental feature: display the lookaheads in the report and
13702 graph.
13703
13704 * src/print (print_core): When --trace-flag, display the rules
13705 lookaheads.
13706 * src/print_graph.c (print_core): Likewise.
13707 Swap the arguments.
13708 Adjust caller.
13709
13710 2002-05-05 Akim Demaille <akim@epita.fr>
13711
13712 * tests/torture.at (Many lookaheads): New test.
13713
13714 2002-05-05 Akim Demaille <akim@epita.fr>
13715
13716 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
13717 (GENERATE_MUSCLE_INSERT_TABLE): this.
13718 (output_int_table, output_unsigned_int_table, output_short_table)
13719 (output_token_number_table, output_item_number_table): Replace with...
13720 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
13721 (muscle_insert_short_table, muscle_insert_token_number_table)
13722 (muscle_insert_item_number_table): these.
13723 Adjust all callers.
13724 (prepare_tokens): Don't free `translations', since...
13725 * src/reader.h, src/reader.c (grammar_free): do it.
13726 Move to...
13727 * src/gram.h, src/gram.c (grammar_free): here.
13728 * data/bison.simple, data/bison.c++: b4_token_number_max is now
13729 b4_translate_max.
13730
13731 2002-05-05 Akim Demaille <akim@epita.fr>
13732
13733 * src/output.c (output_unsigned_int_table): New.
13734 (prepare_rules): `i' is unsigned.
13735 `prhs', `rline', `r2' are unsigned int.
13736 Rename muscle `rhs_number_max' as `rhs_max'.
13737 Output muscles `prhs_max', `rline_max', and `r2_max'.
13738 Free rline and r1.
13739 * data/bison.simple, data/bison.c++: Adjust to use these muscles
13740 to compute types instead of constant types.
13741 * tests/regression.at (Web2c Actions): Adjust.
13742
13743 2002-05-04 Akim Demaille <akim@epita.fr>
13744
13745 * src/symtab.h (SALIAS, SUNDEF): Rename as...
13746 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
13747 Adjust dependencies.
13748 * src/output.c (token_definitions_output): Be sure not to output a
13749 `#define 'a'' when fed with `%token 'a' "a"'.
13750 * tests/regression.at (Token definitions): New.
13751
13752 2002-05-03 Paul Eggert <eggert@twinsun.com>
13753
13754 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
13755 for K&R C.
13756
13757 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
13758
13759 * Makefile.am (SUBDIRS): Remove intl.
13760 (EXTRA_DIST): Add config/config.rpath.
13761
13762 2002-05-03 Akim Demaille <akim@epita.fr>
13763
13764 * data/bison.simple (m4_if): Don't output empty enums.
13765 And actually, output valid enum definitions :(.
13766
13767 2002-05-03 Akim Demaille <akim@epita.fr>
13768
13769 * configure.bat: Remove, completely obsolete.
13770 * Makefile.am (EXTRA_DIST): Adjust.
13771 Don't distribute config.rpath...
13772 * config/Makefile.am (EXTRA_DIST): Do it.
13773
13774 2002-05-03 Akim Demaille <akim@epita.fr>
13775
13776 * configure.in (GETTEXT_VERSION): New.
13777 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
13778
13779 2002-05-03 Akim Demaille <akim@epita.fr>
13780
13781 * data/bison.simple (b4_token_enum): New.
13782 (b4_token_defines): Use it to output tokens both as #define and
13783 enums.
13784 Suggested by Paul Eggert.
13785 * src/output.c (token_definitions_output): Don't output spurious
13786 white spaces.
13787
13788 2002-05-03 Akim Demaille <akim@epita.fr>
13789
13790 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
13791
13792 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
13793
13794 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
13795 Update the stack class, give a try to deque as the default container.
13796
13797 2002-05-02 Akim Demaille <akim@epita.fr>
13798
13799 * data/bison.simple (yyparse): Do not implement @$ = @1.
13800 (YYLLOC_DEFAULT): Adjust to do it.
13801 * doc/bison.texinfo (Location Default Action): Fix.
13802
13803 2002-05-02 Akim Demaille <akim@epita.fr>
13804
13805 * src/reader.c (parse_braces): Merge into...
13806 (parse_action): this.
13807
13808 2002-05-02 Akim Demaille <akim@epita.fr>
13809
13810 * configure.in (ALL_LINGUAS): Remove.
13811 * po/LINGUAS, hr.po: New.
13812
13813 2002-05-02 Akim Demaille <akim@epita.fr>
13814
13815 Remove the so called hairy (semantic) parsers.
13816
13817 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
13818 * src/gram.h, src/gram.c (semantic_parser): Remove.
13819 (rule_t): Remove the guard and guard_line members.
13820 * src/lex.h (token_t): remove tok_guard.
13821 * src/options.c (option_table): Remove %guard and %semantic_parser
13822 support.
13823 * src/output.c, src/output.h (guards_output): Remove.
13824 (prepare): Adjust.
13825 (token_definitions_output): Don't output the `T'
13826 tokens (???).
13827 (output_skeleton): Don't output the guards.
13828 * src/files.c, src/files.c (attrsfile): Remove.
13829 * src/reader.c (symbol_list): Remove the guard and guard_line
13830 members.
13831 Adjust dependencies.
13832 (parse_guard): Remove.
13833 * data/bison.hairy: Remove.
13834 * doc/bison.texinfo (Environment Variables): Remove occurrences of
13835 BISON_HAIRY.
13836
13837 2002-05-02 Akim Demaille <akim@epita.fr>
13838
13839 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
13840 (parse_guard): Rename the formal argument `stack_offset' as
13841 `rule_length', which is more readable.
13842 Adjust callers.
13843 (copy_at, copy_dollar): Instead of outputting the hard coded
13844 values of $$, $n and so forth, output invocation to b4_lhs_value,
13845 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
13846 Note: this patch partially drops `semantic-parser' support: it
13847 always does `rule_length - n', where semantic parsers ought to
13848 always use `-n'.
13849 * data/bison.simple, data/bison.c++ (b4_lhs_value)
13850 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
13851
13852 2002-05-02 Akim Demaille <akim@epita.fr>
13853
13854 * configure.in (AC_INIT): Bump to 1.49b.
13855 (AM_INIT_AUTOMAKE): Short invocation.
13856
13857 2002-05-02 Akim Demaille <akim@epita.fr>
13858
13859 Version 1.49a.
13860
13861 2002-05-01 Akim Demaille <akim@epita.fr>
13862
13863 * src/skeleton.h: Remove.
13864
13865 2002-05-01 Akim Demaille <akim@epita.fr>
13866
13867 * src/skeleton.h: Fix the #endif.
13868 Reported by Magnus Fromreide.
13869
13870 2002-04-26 Paul Eggert <eggert@twinsun.com>
13871
13872 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
13873 Define if we define YYSTYPE and YYLTYPE, respectively.
13874 (YYCOPY): Fix [] quoting problem in the non-GCC case.
13875
13876 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
13877
13878 * src/scan-skel.l: Postprocess quadrigraphs.
13879
13880 * src/reader.c (copy_character): New function, used to output
13881 single characters while replacing `[' and `]' with quadrigraphs, to
13882 avoid troubles with M4 quotes.
13883 (copy_comment): Output characters with copy_character.
13884 (read_additionnal_code): Likewise.
13885 (copy_string2): Likewise.
13886 (copy_definition): Likewise.
13887
13888 * tests/calc.at: Exercise M4 quoting.
13889
13890 2002-04-25 Akim Demaille <akim@epita.fr>
13891
13892 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
13893 between `!' and the command.
13894 Reported by Paul Eggert.
13895
13896 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
13897
13898 * tests/calc.at: Exercise prologue splitting.
13899
13900 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
13901 `b4_post_prologue' instead of `b4_prologue'.
13902
13903 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
13904 muscles.
13905 (output): Free pre_prologue_obstack and post_prologue_obstack.
13906 * src/files.h, src/files.c (attrs_obstack): Remove.
13907 (pre_prologue_obstack, post_prologue_obstack): New.
13908 * src/reader.c (copy_definition): Add a parameter to specify the
13909 obstack to fill, instead of using attrs_obstack unconditionally.
13910 (read_declarations): Pass pre_prologue_obstack to copy_definition if
13911 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
13912
13913 2002-04-23 Paul Eggert <eggert@twinsun.com>
13914
13915 * data/bison.simple: Remove unnecessary commentary and white
13916 space differences from 1_29-branch.
13917 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
13918
13919 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
13920 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
13921 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
13922 constructors or destructors.
13923
13924 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
13925
13926 2002-04-23 Akim Demaille <akim@epita.fr>
13927
13928 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
13929 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
13930 location with columns.
13931 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
13932 All reported by Paul Eggert.
13933
13934 2002-04-22 Akim Demaille <akim@epita.fr>
13935
13936 * src/reduce.c (dump_grammar): Move to...
13937 * src/gram.h, src/gram.c (grammar_dump): here.
13938 Be sure to separate long item numbers.
13939 Don't read the members of a rule's prec if its nil.
13940
13941 2002-04-22 Akim Demaille <akim@epita.fr>
13942
13943 * src/output.c (table_size, table_grow): New.
13944 (MAXTABLE): Remove, replace uses with table_size.
13945 (pack_vector): Instead of dying when the table is too big, grow it.
13946
13947 2002-04-22 Akim Demaille <akim@epita.fr>
13948
13949 * data/bison.simple (yyr1): Its type is that of a token number.
13950 * data/bison.c++ (r1_): Likewise.
13951 * tests/regression.at (Web2c Actions): Adjust.
13952
13953 2002-04-22 Akim Demaille <akim@epita.fr>
13954
13955 * src/reader.c (token_translations_init): 256 is now the default
13956 value for the error token, i.e., it will be assigned another
13957 number if the user assigned 256 to one of her tokens.
13958 (reader): Don't force 256 to error.
13959 * doc/bison.texinfo (Symbols): Adjust.
13960 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
13961 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
13962 etc. instead of 10, 20, 30 (which was used to `jump' over error
13963 (256) and undefined (2)).
13964
13965 2002-04-22 Akim Demaille <akim@epita.fr>
13966
13967 Propagate more token_number_t.
13968
13969 * src/gram.h (token_number_as_item_number)
13970 (item_number_as_token_number): New.
13971 * src/output.c (GENERATE_OUTPUT_TABLE): New.
13972 Use it to create output_item_number_table and
13973 output_token_number_table.
13974 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13975 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
13976 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
13977 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
13978
13979 2002-04-22 Akim Demaille <akim@epita.fr>
13980
13981 * src/output.h, src/output.c (get_lines_number): Remove.
13982
13983 2002-04-19 Akim Demaille <akim@epita.fr>
13984
13985 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
13986 as Lex/Flex'.
13987 (Debugging): More details about enabling the debugging features.
13988 (Table of Symbols): Describe $$, $n, @$, and @n.
13989 Suggested by Tim Josling.
13990
13991 2002-04-19 Akim Demaille <akim@epita.fr>
13992
13993 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
13994
13995 2002-04-10 Akim Demaille <akim@epita.fr>
13996
13997 * src/system.h: Rely on HAVE_LIMITS_H.
13998 Suggested by Paul Eggert.
13999
14000 2002-04-09 Akim Demaille <akim@epita.fr>
14001
14002 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
14003 full stderr, and strip it according to the bison options, instead
14004 of composing the error message from different bits.
14005 This makes it easier to check for several error messages.
14006 Adjust all the invocations.
14007 Add an invocation exercising the error token.
14008 Add an invocation demonstrating a stupid error message.
14009 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
14010 Adjust the tests.
14011 Error message are for stderr, not stdout.
14012
14013 2002-04-09 Akim Demaille <akim@epita.fr>
14014
14015 * src/gram.h, src/gram.c (error_token_number): Remove, use
14016 errtoken->number.
14017 * src/reader.c (reader): Don't specify the user token number (2)
14018 for $undefined, as it uselessly prevents using it.
14019 * src/gram.h (token_number_t): Move to...
14020 * src/symtab.h: here.
14021 (state_t.number): Is a token_number_t.
14022 * src/print.c, src/reader.c: Use undeftoken->number instead of
14023 hard coded 2.
14024 (Even though this 2 is not the same as above: the number of the
14025 undeftoken remains being 2, it is its user token number which
14026 might not be 2).
14027 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
14028 `user_token_number_max'.
14029 Output `undef_token_number'.
14030 * data/bison.simple, data/bison.c++: Use them.
14031 Be sure to map invalid yylex return values to
14032 `undef_token_number'. This saves us from gratuitous SEGV.
14033
14034 * tests/conflicts.at (Solved SR Conflicts)
14035 (Unresolved SR Conflicts): Adjust.
14036 * tests/regression.at (Web2c Actions): Adjust.
14037
14038 2002-04-08 Akim Demaille <akim@epita.fr>
14039
14040 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
14041 Adding #line.
14042 Remove the duplicate `typedefs'.
14043 (RhsNumberType): Fix the declaration and various other typos.
14044 Use __ofile__.
14045 * data/bison.simple: Use __ofile__.
14046 * src/scan-skel.l: Handle __ofile__.
14047
14048 2002-04-08 Akim Demaille <akim@epita.fr>
14049
14050 * src/gram.h (item_number_t): New, the type of item numbers in
14051 RITEM. Note that it must be able to code symbol numbers as
14052 positive number, and the negation of rule numbers as negative
14053 numbers.
14054 Adjust all dependencies (pretty many).
14055 * src/reduce.c (rule): Remove this `short *' pointer: use
14056 item_number_t.
14057 * src/system.h (MINSHORT, MAXSHORT): Remove.
14058 Include `limits.h'.
14059 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
14060 (shortcpy): Remove.
14061 (MAXTABLE): Move to...
14062 * src/output.c (MAXTABLE): here.
14063 (prepare_rules): Use output_int_table to output rhs.
14064 * data/bison.simple, data/bison.c++: Adjust.
14065 * tests/torture.at (Big triangle): Move the limit from 254 to
14066 500.
14067 * tests/regression.at (Web2c Actions): Ajust.
14068
14069 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
14070 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
14071 passes, but produces negative #line number, once fixed, GCC is
14072 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
14073 C), it passes.
14074 * src/state.h (state_h): Code input lines on ints, not shorts.
14075
14076 2002-04-08 Akim Demaille <akim@epita.fr>
14077
14078 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
14079 and then the grammar.
14080
14081 2002-04-08 Akim Demaille <akim@epita.fr>
14082
14083 * src/system.h: No longer using strndup.
14084
14085 2002-04-07 Akim Demaille <akim@epita.fr>
14086
14087 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
14088 * src/output.c (output_table_data): Return the longest number.
14089 (prepare_tokens): Output `token_number_max').
14090 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
14091 New.
14092 Use them to define yy_token_number_type/TokenNumberType.
14093 Use this type for yytranslate.
14094 * tests/torture.at (Big triangle): Push the limit from 124 to
14095 253.
14096 * tests/regression.at (Web2c Actions): Adjust.
14097
14098 2002-04-07 Akim Demaille <akim@epita.fr>
14099
14100 * tests/torture.at (Big triangle): New.
14101 (GNU AWK Grammar, GNU Cim Grammar): Move to...
14102 * tests/existing.at: here.
14103
14104 2002-04-07 Akim Demaille <akim@epita.fr>
14105
14106 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
14107 nritems.
14108 Adjust dependencies.
14109
14110 2002-04-07 Akim Demaille <akim@epita.fr>
14111
14112 * src/reader.c: Normalize increments to prefix form.
14113
14114 2002-04-07 Akim Demaille <akim@epita.fr>
14115
14116 * src/reader.c, symtab.c: Remove debugging code.
14117
14118 2002-04-07 Akim Demaille <akim@epita.fr>
14119
14120 Rename all the `bucket's as `symbol_t'.
14121
14122 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
14123 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
14124 * src/symtab.c, src/symtab.h (bucket): Rename as...
14125 (symbol_t): this.
14126 (symbol_list_new, bucket_check_defined, bucket_make_alias)
14127 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
14128 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14129 (buckets_new, buckets_free, buckets_do): Rename as...
14130 (symbol_list_new, symbol_check_defined, symbol_make_alias)
14131 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
14132 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
14133 (symbols_new, symbols_free, symbols_do): these.
14134
14135 2002-04-07 Akim Demaille <akim@epita.fr>
14136
14137 Use lib/hash for the symbol table.
14138
14139 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
14140 EOF.
14141 * src/lex.c (lex): Set the `number' member of new terminals.
14142 * src/reader.c (bucket_check_defined, bucket_make_alias)
14143 (bucket_check_alias_consistence, bucket_translation): New.
14144 (reader, grammar_free, readgram, token_translations_init)
14145 (packsymbols): Adjust.
14146 (reader): Number the predefined tokens.
14147 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
14148 for predefined tokens.
14149 * src/symtab.h (bucket): Remove all the hash table related
14150 members.
14151 * src/symtab.c (symtab): Replace by...
14152 (bucket_table): this.
14153 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14154 (buckets_new, buckets_do): New.
14155
14156 2002-04-07 Akim Demaille <akim@epita.fr>
14157
14158 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
14159 (start_symbol, max_user_token_number, semantic_parser)
14160 (error_token_number): Initialize.
14161 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
14162 Initialize.
14163 (reader): Don't.
14164 (errtoken, eoftoken, undeftoken, axiom): Extern.
14165
14166 2002-04-07 Akim Demaille <akim@epita.fr>
14167
14168 * src/gram.h (rule_s): prec and precsym are now pointers
14169 to the bucket giving the priority/associativity.
14170 Member `associativity' removed: useless.
14171 * src/reduce.c, src/conflicts.c: Adjust.
14172
14173 2002-04-07 Akim Demaille <akim@epita.fr>
14174
14175 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
14176 Properly escape the symbols' TAG when outputting them.
14177
14178 2002-04-07 Akim Demaille <akim@epita.fr>
14179
14180 * src/lalr.h (LA): Is a bitsetv, not bitset*.
14181
14182 2002-04-07 Akim Demaille <akim@epita.fr>
14183
14184 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
14185 (LArule): this, which is an array to rule_t*.
14186 * src/print.c, src/conflicts.c: Adjust.
14187
14188 2002-04-07 Akim Demaille <akim@epita.fr>
14189
14190 * src/gram.h (rule_t): Rename `number' as `user_number'.
14191 `number' is a new member.
14192 Adjust dependencies.
14193 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
14194
14195 2002-04-07 Akim Demaille <akim@epita.fr>
14196
14197 As a result of the previous patch, it is no longer needed
14198 to reorder ritem itself.
14199
14200 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
14201
14202 2002-04-07 Akim Demaille <akim@epita.fr>
14203
14204 Be sure never to walk through RITEMS, but use only data related to
14205 the rules themselves. RITEMS should be banished.
14206
14207 * src/output.c (output_token_translations): Rename as...
14208 (prepare_tokens): this.
14209 In addition to `translate', prepare the muscles `tname' and
14210 `toknum', which were handled by...
14211 (output_rule_data): this.
14212 Remove, and move the remainder of its outputs into...
14213 (prepare_rules): this new routines, which also merges content from
14214 (output_gram): this.
14215 (prepare_rules): Be sure never to walk through RITEMS.
14216 (output_stos): Rename as...
14217 (prepare_stos): this.
14218 (output): Always invoke prepare_states, after all, just don't use it
14219 in the output if you don't need it.
14220
14221 2002-04-07 Akim Demaille <akim@epita.fr>
14222
14223 * src/LR0.c (new_state): Display `nstates' as the name of the
14224 newly created state.
14225 Adjust to initialize first_state and last_state if needed.
14226 Be sure to distinguish the initial from the final state.
14227 (new_states): Create the itemset of the initial state, and use
14228 new_state.
14229 * src/closure.c (closure): Now that the initial state has its
14230 items properly set, there is no need for a special case when
14231 creating `ruleset'.
14232
14233 As a result, now the rule 0, reducing to $axiom, is visible in the
14234 outputs. Adjust the test suite.
14235
14236 * tests/conflicts.at (Solved SR Conflicts)
14237 (Unresolved SR Conflicts): Adjust.
14238 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
14239 * tests/conflicts.at (S/R in initial): New.
14240
14241 2002-04-07 Akim Demaille <akim@epita.fr>
14242
14243 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
14244 the RHS of the rules.
14245 * src/output.c (output_gram): Likewise.
14246
14247 2002-04-07 Akim Demaille <akim@epita.fr>
14248
14249 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
14250 bucket.
14251 Adjust all dependencies.
14252 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
14253 `number' of the buckets too.
14254 * src/gram.h: Include `symtab.h'.
14255 (associativity): Move to...
14256 * src/symtab.h: here.
14257 No longer include `gram.h'.
14258
14259 2002-04-07 Akim Demaille <akim@epita.fr>
14260
14261 * src/gram.h, src/gram.c (rules_rhs_length): New.
14262 (ritem_longest_rhs): Use it.
14263 * src/gram.h (rule_t): `number' is a new member.
14264 * src/reader.c (packgram): Set it.
14265 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
14266 the end of `rules', and count them out of `nrules'.
14267 (reduce_output, dump_grammar): Adjust.
14268 * src/print.c (print_grammar): It is no longer needed to check for
14269 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
14270 * tests/reduce.at (Reduced Automaton): New test.
14271
14272 2002-04-07 Akim Demaille <akim@epita.fr>
14273
14274 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
14275 lacking `+ 1' to nrules, Bison reported as useless a token if it
14276 was used solely to set the precedence of the last rule...
14277
14278 2002-04-07 Akim Demaille <akim@epita.fr>
14279
14280 * data/bison.c++, data/bison.simple: Don't output the current file
14281 name in #line, to avoid useless diffs between two identical
14282 outputs under different names.
14283
14284 2002-04-07 Akim Demaille <akim@epita.fr>
14285
14286 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
14287 Normalize loops to using `< nrules + 1', not `<= nrules'.
14288
14289 2002-04-07 Akim Demaille <akim@epita.fr>
14290
14291 * TODO: Update.
14292
14293 2002-04-07 Akim Demaille <akim@epita.fr>
14294
14295 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
14296 bucket.value as bucket.number.
14297
14298 2002-04-07 Akim Demaille <akim@epita.fr>
14299
14300 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
14301 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14302 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
14303 RHS, instead of being an index in RITEMS.
14304
14305 2002-04-04 Paul Eggert <eggert@twinsun.com>
14306
14307 * doc/bison.texinfo: Update copyright date.
14308 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
14309 (Symbols): Warn about running Bison in one character set,
14310 but compiling and/or running in an incompatible one.
14311 Warn about character code 256, too.
14312
14313 2002-04-03 Paul Eggert <eggert@twinsun.com>
14314
14315 * src/bison.data (YYSTACK_ALLOC): Depend on whether
14316 YYERROR_VERBOSE is nonzero, not whether it is defined.
14317
14318 Merge changes from bison-1_29-branch.
14319
14320 2002-03-20 Paul Eggert <eggert@twinsun.com>
14321
14322 Merge fixes from Debian bison_1.34-1.diff.
14323
14324 * configure.in (AC_PREREQ): 2.53.
14325
14326 2002-03-20 Akim Demaille <akim@epita.fr>
14327
14328 * src/conflicts.c (log_resolution): Argument `resolution' is const.
14329
14330 2002-03-19 Paul Eggert <eggert@twinsun.com>
14331
14332 * src/bison.simple (YYCOPY): New macro.
14333 (YYSTACK_RELOCATE): Use it.
14334 Remove Type arg; no longer needed. All callers changed.
14335 (yymemcpy): Remove; no longer needed.
14336
14337 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
14338 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14339
14340 2002-03-19 Akim Demaille <akim@epita.fr>
14341
14342 Test and fix the #line outputs.
14343
14344 * tests/atlocal.at (GCC): New.
14345 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
14346 (Prologue synch line, %union synch line, Postprologue synch line)
14347 (Action synch line, Epilogue synch line): New tests.
14348 * src/reader.c (parse_union_decl): Define the muscle stype_line.
14349 * data/bison.simple, data/bison.c++: Use it.
14350
14351 2002-03-19 Akim Demaille <akim@epita.fr>
14352
14353 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
14354 (Solved SR Conflicts, %expect not enough, %expect right)
14355 (%expect too much): Move to...
14356 * tests/conflicts.at: this new file.
14357
14358 2002-03-19 Akim Demaille <akim@epita.fr>
14359
14360 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14361 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
14362 that we can move to enums for instance.
14363 * src/output.c (token_definitions_output): Output a list of
14364 `token-name, token-number' instead of the #define.
14365 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
14366
14367 2002-03-14 Akim Demaille <akim@epita.fr>
14368
14369 Use Gettext 0.11.1.
14370
14371 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
14372
14373 * data/bison.c++: Make the user able to add members to the generated
14374 parser by subclassing.
14375
14376 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
14377
14378 * src/reader.c (read_additionnal_code): `c' should be an integer, not
14379 a character.
14380 Reported by Nicolas Tisserand and Nicolas Burrus.
14381
14382 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
14383
14384 * src/reader.c: Warn about lacking semi-colons, do not complain.
14385
14386 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
14387
14388 * data/bison.c++: Remove a debug line.
14389
14390 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
14391
14392 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
14393 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
14394 provide a default implementation.
14395
14396 2002-03-04 Akim Demaille <akim@epita.fr>
14397
14398 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
14399 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
14400 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
14401 * tests/semantic.at (Parsing Guards): Similarly.
14402 * src/reader.at (readgram): Complain if the last rule is not ended
14403 with a semi-colon.
14404
14405 2002-03-04 Akim Demaille <akim@epita.fr>
14406
14407 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
14408 * src/closure.c: here.
14409 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
14410 RTC.
14411 * src/warshall.h, src/warshall.c: Remove.
14412 * tests/sets.at (Broken Closure): Adjust.
14413
14414 2002-03-04 Akim Demaille <akim@epita.fr>
14415
14416 * src/output.c (output_skeleton): tempdir is const.
14417 bytes_read is unused.
14418
14419 2002-03-04 Akim Demaille <akim@epita.fr>
14420
14421 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14422 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
14423 Update.
14424 From Michael Hayes.
14425
14426 2002-03-04 Akim Demaille <akim@epita.fr>
14427
14428 * src/closure.c (closure): `r' is unused.
14429
14430 2002-03-04 Akim Demaille <akim@epita.fr>
14431
14432 * tests/sets.at (Broken Closure): Add the ending `;'.
14433 * src/reader.at (readgram): Complain if a rule is not ended with a
14434 semi-colon.
14435
14436 2002-03-04 Akim Demaille <akim@epita.fr>
14437
14438 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
14439 (count_sr_conflicts): Use bitset_count.
14440 * src/reduce.c (inaccessable_symbols): Ditto.
14441 (bits_size): Remove.
14442 * src/warshall.h, src/warshall.c: Convert to bitsetv.
14443
14444 2002-03-04 Akim Demaille <akim@epita.fr>
14445
14446 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
14447 * src/reduce.c: Remove the `bitset_zero's following the
14448 `bitset_create's, as now it is performed by the latter.
14449
14450 2002-03-04 Akim Demaille <akim@epita.fr>
14451
14452 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
14453 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
14454 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
14455 latest sources from Michael.
14456
14457 2002-03-04 Akim Demaille <akim@epita.fr>
14458
14459 * src/output.c (output): Don't free the grammar.
14460 * src/reader.c (grammar_free): New.
14461 * src/main.c (main): Call it and don't free symtab here.
14462
14463 2002-03-04 Akim Demaille <akim@epita.fr>
14464
14465 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
14466 before returning.
14467 Reported by Benoit Perrot.
14468
14469 2002-03-04 Akim Demaille <akim@epita.fr>
14470
14471 Use bitset operations when possible, not loops over bits.
14472
14473 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
14474 bitset_or.
14475 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
14476 * src/reduce.c (useless_nonterminals): Formatting changes.
14477 * src/warshall.c (TC): Use bitset_or.
14478
14479 2002-03-04 Akim Demaille <akim@epita.fr>
14480
14481 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
14482 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
14483 Ditto.
14484
14485 2002-03-04 Akim Demaille <akim@epita.fr>
14486
14487 * src/lalr.c (F): Now a bitset*.
14488 Adjust all dependencies.
14489
14490 2002-03-04 Akim Demaille <akim@epita.fr>
14491
14492 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
14493 Adjust all dependencies.
14494
14495 2002-03-04 Akim Demaille <akim@epita.fr>
14496
14497 * src/L0.c, src/LR0.h (nstates): Be size_t.
14498 Adjust comparisons (signed vs unsigned).
14499 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
14500 bitset*.
14501 Adjust all dependencies.
14502
14503 2002-03-04 Akim Demaille <akim@epita.fr>
14504
14505 * src/closure.c (firsts): Now, also a bitset.
14506 Adjust all dependencies.
14507 (varsetsize): Remove, now unused.
14508 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
14509
14510 2002-03-04 Akim Demaille <akim@epita.fr>
14511
14512 * src/print.c: Convert to use bitset.h, not hand coded iterations
14513 over ints.
14514
14515 2002-03-04 Akim Demaille <akim@epita.fr>
14516
14517 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
14518
14519 2002-03-04 Akim Demaille <akim@epita.fr>
14520
14521 * src/closure.c (ruleset): Be a bitset.
14522 (rulesetsize): Remove.
14523
14524 2002-03-04 Akim Demaille <akim@epita.fr>
14525
14526 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14527 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
14528 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
14529 * src/closure.c (fderives): Be an array of bitsets.
14530
14531 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
14532
14533 * data/bison.c++: Merge the two generated headers. Insert a copyright
14534 notice in each output file.
14535
14536 2002-02-28 Akim Demaille <akim@epita.fr>
14537
14538 * data/bison.c++: Copy the prologue of bison.simple to fetch
14539 useful M4 definitions, such as b4_header_guard.
14540
14541 2002-02-25 Akim Demaille <akim@epita.fr>
14542
14543 * src/getargs.c (version): Give the name of the authors, and use a
14544 translator friendly scheme for the bgr
14545 copyright notice.
14546
14547 2002-02-25 Akim Demaille <akim@epita.fr>
14548
14549 * src/output.c (header_output): Remove, now handled completely via
14550 M4.
14551
14552 2002-02-25 Akim Demaille <akim@epita.fr>
14553
14554 * m4/m4.m4: New, from CVS Autoconf.
14555 * configure.in: Invoke it.
14556 * src/output.c (output_skeleton): Use its result instead of the
14557 hard coded name.
14558
14559 2002-02-25 Akim Demaille <akim@epita.fr>
14560
14561 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
14562 Fileutils 4.1.5.
14563 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
14564 * src/output.c (output_skeleton): Use mkstemp to create a real
14565 temporary file.
14566 Move the filling of `skeleton' and its muscle to...
14567 (prepare): here.
14568 (output): Move the definition of the prologue muscle to...
14569 (prepare): here.
14570 * src/system.h (DEFAULT_TMPDIR): New.
14571
14572 2002-02-14 Paul Eggert <eggert@twinsun.com>
14573
14574 Remove the support for C++ namespace cleanliness; it was
14575 causing more problems than it was curing, since it didn't work
14576 properly on some nonstandard C++ compilers. This can wait
14577 for a proper C++ parser.
14578
14579 * NEWS: Document this.
14580 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
14581 of C++, as it's treated like C now.
14582 * src/bison.simple (YYSTD): Remove.
14583 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
14584 Treat C++ just like Standard C instead of trying to support
14585 namespace cleanliness.
14586
14587 2002-02-14 Akim Demaille <akim@epita.fr>
14588
14589 * tests/regression.at (else): Adjust to Andreas' change.
14590
14591 2002-02-14 Akim Demaille <akim@epita.fr>
14592
14593 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
14594
14595 2002-02-13 Andreas Schwab <schwab@suse.de>
14596
14597 * src/output.c (output_rule_data): Don't output NULL, it might
14598 not be defined yet.
14599
14600 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
14601
14602 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
14603 (Copyright notice): Update.
14604
14605 2002-02-11 Akim Demaille <akim@epita.fr>
14606
14607 * tests/regression.at (%nonassoc and eof): Don't include
14608 nonportable headers.
14609
14610 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
14611
14612 * data/bison.c++: Correct error recovery. Make the user able to
14613 initialize the starting location.
14614
14615 2002-02-07 Akim Demaille <akim@epita.fr>
14616
14617 * tests/input.at: New.
14618
14619 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14620
14621 * data/bison.c++: Replace some direct m4 expansions by constants. Be
14622 more consistent when naming methods and variables. Put preprocessor
14623 directives around tables only needed for debugging.
14624
14625 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14626
14627 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
14628 C++ parsers.
14629 (yy::b4_name::parse): Use print_.
14630
14631 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14632
14633 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
14634
14635 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14636
14637 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
14638 C++ parsers.
14639 (yy::b4_name::parse): Build verbose error messages, and use error_.
14640
14641 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
14642
14643 * data/bison.c++: Fix m4 quoting in comments.
14644
14645 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
14646
14647 * data/bison.c++: Adjust the parser code. Fix some muscles that were
14648 not expanded by m4.
14649
14650 2002-02-05 Akim Demaille <akim@epita.fr>
14651
14652 * data/bison.c++: Adjust to the M4 back end.
14653 More is certainly needed.
14654
14655 2002-02-05 Akim Demaille <akim@epita.fr>
14656
14657 Give a try to M4 as a back end.
14658
14659 * lib/readpipe.c: New, from wdiff.
14660 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
14661 BISON_HAIRY.
14662 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
14663 specific values. Now it is m4 that performs the lookup.
14664 * src/parse-skel.y: Remove.
14665 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
14666 * src/output.c (actions_output, guards_output)
14667 (token_definitions_output): No longer keeps track of the output
14668 line number, hence remove the second argument.
14669 (guards_output): Check against the guard member of a rule, not the
14670 action member.
14671 Adjust callers.
14672 (output_skeleton): Don't look for the skeleton location, let m4 do
14673 that.
14674 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
14675 file will be used.
14676 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
14677 (prepare): Given that for the time being changesyntax is not
14678 usable in M4, rename the muscles using `-' to `_'.
14679 Define `defines_flag', `output_parser_name' and `output_header_name'.
14680 * src/output.h (actions_output, guards_output)
14681 (token_definitions_output): Adjust prototypes.
14682 * src/scan-skel.l: Instead of scanning the skeletons, it now
14683 processes the output of m4: `__oline__' and `#output'.
14684 * data/bison.simple: Adjust to be used by M4(sugar).
14685 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
14686 to date.
14687 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
14688 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
14689 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
14690 shamelessly stolen from CVS Autoconf.
14691
14692 2002-02-05 Akim Demaille <akim@epita.fr>
14693
14694 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
14695 * configure.in: Check for the declarations of free and malloc.
14696 * src/muscle_tab.c: Adjust.
14697
14698 2002-02-05 Akim Demaille <akim@epita.fr>
14699
14700 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
14701 which have no values.
14702
14703 2002-02-05 Akim Demaille <akim@epita.fr>
14704
14705 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
14706 * data/: here.
14707
14708 2002-01-29 Paul Eggert <eggert@twinsun.com>
14709
14710 * src/bison.simple (YYSIZE_T): Do not define merely because
14711 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
14712 On some platforms, <alloca.h> does not declare YYSTD (size_t).
14713
14714 2002-01-27 Akim Demaille <akim@epita.fr>
14715
14716 Fix `%nonassoc and eof'.
14717
14718 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
14719 which were not properly copied! Replace
14720 memcpy (res->errs, src->errs, src->nerrs);
14721 with
14722 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
14723 !!!
14724 * tests/regression.at (%nonassoc and eof): Adjust to newest
14725 Autotest: `.' is not in the PATH.
14726
14727 2002-01-27 Akim Demaille <akim@epita.fr>
14728
14729 * tests/sets.at (AT_EXTRACT_SETS): New.
14730 (Nullable): Use it.
14731 (Firsts): New.
14732
14733 2002-01-26 Akim Demaille <akim@epita.fr>
14734
14735 * tests/actions.at, tests/calc.at, tests/headers.at,
14736 * tests/torture.at: Adjust to the newest Autotest which no longer
14737 forces `.' in the PATH.
14738
14739 2002-01-25 Akim Demaille <akim@epita.fr>
14740
14741 * tests/regression.at (%nonassoc and eof): New.
14742 Suggested by Robert Anisko.
14743
14744 2002-01-24 Akim Demaille <akim@epita.fr>
14745
14746 Bison dumps core when trying to complain about broken input files.
14747 Reported by Cris van Pelt.
14748
14749 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
14750 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
14751 into...
14752 (Invalid inputs): Strengthen: exercise parse_percent_token.
14753
14754 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
14755
14756 * src/Makefile.am: Add bison.c++.
14757 * src/bison.c++: New skeleton.
14758
14759 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
14760
14761 * po/it.po: New.
14762
14763 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
14764
14765 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
14766
14767 2002-01-20 Marc Autret <marc@gnu.org>
14768
14769 * src/files.c (compute_output_file_names): Fix
14770
14771 2002-01-20 Marc Autret <marc@gnu.org>
14772
14773 * tests/output.at: New test.
14774 * src/files.c (compute_base_names): Don't map extensions when
14775 the YACC flag is set, use defaults.
14776 Reported by Evgeny Stambulchik.
14777
14778 2002-01-20 Marc Autret <marc@gnu.org>
14779
14780 * src/system.h: Need to define __attribute__ away for non-GCC
14781 compilers as well (i.e., the vendor C compiler).
14782 Suggested by Albert Chin-A-Young.
14783
14784 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
14785
14786 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
14787 canonical definition.
14788 * src/system.h: Use the canonical definition for PARAMS (avoids
14789 a conflict with the macro from lib/hash.h).
14790
14791 2002-01-11 Akim Demaille <akim@epita.fr>
14792
14793 * configure.in: Use AC_FUNC_STRNLEN.
14794 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
14795
14796 2002-01-09 Akim Demaille <akim@epita.fr>
14797
14798 * src/files.c, src/files.h (output_infix): New.
14799 (tab_extension): Remove.
14800 (compute_base_names): Compute the former, drop the latter.
14801 * src/output.c (prepare): Insert the muscles `output-infix', and
14802 `output-suffix'.
14803 * src/parse-skel.y (string, string.1): New.
14804 (section.header): Use it.
14805 (section.yacc): Remove.
14806 (prefix): Remove too.
14807 * src/scan-skel.l: Adjust.
14808 * src/bison.simple, src/bison.hairy: Adjust.
14809
14810 2002-01-09 Akim Demaille <akim@epita.fr>
14811
14812 * configure.in (WERROR_CFLAGS): Compute it.
14813 * src/Makefile.am (CFLAGS): Pass it.
14814 * tests/atlocal.in (CFLAGS): Idem.
14815 * src/files.c: Fix a few warnings.
14816 (get_extension_index): Remove, unused.
14817
14818 2002-01-08 Akim Demaille <akim@epita.fr>
14819
14820 * src/getargs.c (AS_FILE_NAME): New.
14821 (getargs): Use it to convert DOSish file names.
14822 * src/files.c (base_name): Rename as full_base_name to avoid
14823 clashes with `base_name ()'.
14824 (filename_split): New.
14825 (compute_base_names): N-th rewrite, using filename_split.
14826
14827 2002-01-08 Akim Demaille <akim@epita.fr>
14828
14829 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
14830 New, stolen from the Fileutils 4.1.
14831 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
14832 * configure.in: Check for the presence of memrchr, and of its
14833 prototype.
14834
14835 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
14836
14837 * lib/hash.h (__P): Added definition for this macro.
14838 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
14839 BUILT_SOURCES, to ensure they are generated first.
14840 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
14841 %error-verbose to allow bootstrapping with bison 1.30x.
14842
14843 2002-01-06 Akim Demaille <akim@epita.fr>
14844
14845 * src/reader.c (parse_braces): Don't fetch the next char, the
14846 convention is to fetch on entry.
14847 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
14848 'switch' without a following semicolon.
14849 * tests/regression.at (braces parsing): New.
14850
14851 2002-01-06 Akim Demaille <akim@epita.fr>
14852
14853 Bison is dead wrong in its RR conflict reports.
14854
14855 * tests/torture.at (GNU Cim Grammar): New.
14856 * src/conflicts.c (count_rr_conflicts): Fix.
14857
14858 2002-01-06 Akim Demaille <akim@epita.fr>
14859
14860 Creating package.m4 from configure.ac causes too many problems.
14861
14862 * tests/Makefile.am (package.m4): Create it by hand,
14863 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
14864
14865 2002-01-06 Akim Demaille <akim@epita.fr>
14866
14867 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
14868 skeleton.h.
14869
14870 2002-01-04 Paul Eggert <eggert@twinsun.com>
14871
14872 * doc/bison.texinfo (Debugging):
14873 Remove YYSTDERR; it's no longer defined or used.
14874 Also, s/cstdio.h/cstdio/.
14875
14876 2002-01-03 Akim Demaille <akim@epita.fr>
14877
14878 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
14879
14880 2002-01-03 Akim Demaille <akim@epita.fr>
14881
14882 * src/parse-skel.y (process_skeleton): Don't bind the parser's
14883 tracing code to --trace, wait for a better --trace option, with
14884 args.
14885
14886 2002-01-03 Akim Demaille <akim@epita.fr>
14887
14888 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
14889 The ISO C++ standard is extremely clear about it: stderr is
14890 considered a macro, not a regular symbol (see table 94 `Header
14891 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
14892 Therefore std:: does not apply to it. It still does with fprintf.
14893 Also, s/cstdio.h/cstdio/.
14894
14895 2002-01-03 Akim Demaille <akim@epita.fr>
14896
14897 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
14898 for non system headers.
14899
14900 2002-01-02 Akim Demaille <akim@epita.fr>
14901
14902 Equip the skeleton chain with location tracking, runtime trace,
14903 pure parser and scanner.
14904
14905 * src/parse-skel.y: Request a pure parser, locations, and prefix
14906 renaming.
14907 (%union): Having several members with the same type does not help
14908 type mismatches, simplify.
14909 (YYPRINT, yyprint): New.
14910 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
14911 (skel_error): this.
14912 Handle locations.
14913 * src/scan-skel.l: Adjust to these changes.
14914 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
14915 (LOCATION_PRINT, skel_control_t): New.
14916
14917 2001-12-30 Akim Demaille <akim@epita.fr>
14918
14919 * src/parse-skel.y: Get rid of the shift/reduce conflict:
14920 replace `gb' with BLANKS.
14921 * src/scan-skel.l: Adjust.
14922
14923 2001-12-30 Akim Demaille <akim@epita.fr>
14924
14925 * src/system.h: We don't need nor want bcopy.
14926 Throw away MS-DOS crap: we don't need getpid.
14927 * configure.in: We don't need strndup. It was even causing
14928 problems: because Flex includes the headers *before* us,
14929 _GNU_SOURCE is not defined by config.h, and therefore strndup was
14930 not visible.
14931 * lib/xstrndup.c: New.
14932 * src/scan-skel.l: Use it.
14933 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
14934 * src/parse-skel.y: Use %directives instead of #defines.
14935
14936 2001-12-30 Akim Demaille <akim@epita.fr>
14937
14938 * src/skeleton.h: New.
14939 * src/output.c (output_parser, output_master_parser): Remove, dead
14940 code.
14941 * src/output.h (get_lines_number, actions_output, guards_output)
14942 (token_definitions_output): Prototype them.
14943 * src/parse-skel.y: Add the license notice.
14944 Include output.h and skeleton.h.
14945 (process_skeleton): Returns void, and takes a single parameter.
14946 * src/scan-skel.l: Add the license notice.
14947 Include skeleton.h.
14948 Don't use %option yylineno: it seems that then Flex imagines
14949 REJECT has been used, and therefore it won't reallocate its
14950 buffers (which makes no other sense to me than a bug). It results
14951 in warnings for `unused: yy_flex_realloc'.
14952
14953 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
14954
14955 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
14956 (MUSCLE_INSERT_PREFIX): ...to there.
14957 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
14958 (MUSCLE_INSERT_PREFIX): Move from here...
14959
14960 * src/bison.hairy: Add a section directive. Put braces around muscle
14961 names. This parser skeleton is still broken, but Bison should not
14962 choke on a bad muscle 'syntax'.
14963 * src/bison.simple: Add a section directive. Put braces around muscle
14964 names.
14965
14966 * src/files.h (strsuffix, stringappend): Add declarations.
14967 (tab_extension): Add declaration.
14968 (short_base_name): Add declaration.
14969
14970 * src/files.c (strsuffix, stringappend): No longer static. These
14971 functions are used in the skeleton parser.
14972 (tab_extension): New.
14973 (compute_base_names): Use the computations done in this function
14974 to guess if the generated parsers should have '.tab' in their
14975 names.
14976 (short_base_name): No longer static.
14977
14978 * src/output.c (output_skeleton): New.
14979 (output): Disable call to output_master_parser, and give a try to
14980 a new skeleton handling system.
14981 (guards_output, actions_output): No longer static.
14982 (token_definitions_output, get_lines_number): No longer static.
14983
14984 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
14985
14986 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
14987 parse-skel.y.
14988
14989 * src/parse-skel.y: New file.
14990 * src/scan-skel.l: New file.
14991
14992 2001-12-29 Akim Demaille <akim@epita.fr>
14993
14994 %name-prefix is broken.
14995
14996 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
14997 Adjust all dependencies.
14998 * tests/headers.at (export YYLTYPE): Strengthen this test: use
14999 %name-prefix.
15000
15001 Renaming yylval but not yylloc is not consistent. Now we do.
15002
15003 * src/bison.simple: Prefix yylloc if used.
15004 * doc/bison.texinfo (Decl Summary): Document that.
15005
15006 2001-12-29 Akim Demaille <akim@epita.fr>
15007
15008 * doc/bison.texinfo: Promote `%long-directive' over
15009 `%long_directive'.
15010 Remove all references to fixed-output-files, yacc is enough.
15011
15012 2001-12-29 Akim Demaille <akim@epita.fr>
15013
15014 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
15015 user prologue. These are defaults.
15016 * tests/actions.at (Mid-rule actions): Make sure the user can
15017 define YYDEBUG and YYERROR_VERBOSE.
15018
15019 2001-12-29 Akim Demaille <akim@epita.fr>
15020
15021 * src/output.c (header_output): Don't forget to export YYLTYPE and
15022 yylloc.
15023 * tests/headers.at (export YYLTYPE): New, make sure it does.
15024 * tests/regression.at (%union and --defines, Invalid CPP headers):
15025 Move to...
15026 * tests/headers.at: here.
15027
15028 2001-12-29 Akim Demaille <akim@epita.fr>
15029
15030 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
15031
15032 2001-12-29 Akim Demaille <akim@epita.fr>
15033
15034 * tests/actions.at (Mid-rule actions): Output on a single line
15035 instead of several.
15036
15037 2001-12-29 Akim Demaille <akim@epita.fr>
15038
15039 * doc/bison.texinfo: Formatting changes.
15040
15041 2001-12-29 Akim Demaille <akim@epita.fr>
15042
15043 Don't store the token defs in a muscle, just be ready to output it
15044 on command. Now possible via `symbols'. Fixes a memory leak.
15045
15046 * src/output.c (token_definitions_output): New.
15047 (output_parser, header_output): Use it.
15048 * src/reader.c (symbols_save): Remove.
15049
15050 2001-12-29 Akim Demaille <akim@epita.fr>
15051
15052 * src/bison.simple: Do not provide a default for YYSTYPE and
15053 YYLTYPE before the user's prologue. Otherwise it's hardly... a
15054 default.
15055
15056 2001-12-29 Akim Demaille <akim@epita.fr>
15057
15058 Mid-rule actions are simply... ignored!
15059
15060 * src/reader.c (readgram): Be sure to attach mid-rule actions to
15061 the empty-rule associated to the dummy symbol, not to the host
15062 rule.
15063 * tests/actions.at (Mid-rule actions): New.
15064
15065 2001-12-29 Akim Demaille <akim@epita.fr>
15066
15067 Memory leak.
15068
15069 * src/reader.c (reader): Free grammar.
15070
15071 2001-12-29 Akim Demaille <akim@epita.fr>
15072
15073 Memory leak.
15074
15075 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
15076 since it allocates it for each state, although only one is needed.
15077 (allocate_storage): Do it here.
15078
15079 2001-12-29 Akim Demaille <akim@epita.fr>
15080
15081 * src/options.h, src/options.c (create_long_option_table): Rename
15082 as...
15083 (long_option_table_new): this, with a clearer prototype.
15084 (percent_table): Remove, unused,
15085 * src/getargs.c (getargs): Adjust.
15086
15087 2001-12-29 Akim Demaille <akim@epita.fr>
15088
15089 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
15090 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
15091 as states.
15092
15093 2001-12-29 Akim Demaille <akim@epita.fr>
15094
15095 * src/lalr.c (build_relations): Rename `states' as `states1'.
15096 Sorry, I don't understand exactly what it is, no better name...
15097
15098 2001-12-29 Akim Demaille <akim@epita.fr>
15099
15100 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
15101 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
15102 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
15103 as rules.
15104
15105 2001-12-29 Akim Demaille <akim@epita.fr>
15106
15107 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
15108 ago.
15109
15110 2001-12-29 Akim Demaille <akim@epita.fr>
15111
15112 * src/reader.c, src/reader.h (user_toknums): Remove.
15113 Adjust all users to use symbols[i]->user_token_number.
15114
15115 2001-12-29 Akim Demaille <akim@epita.fr>
15116
15117 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
15118 Adjust all users to use symbols[i]->prec or ->assoc.
15119
15120 2001-12-29 Akim Demaille <akim@epita.fr>
15121
15122 * src/reader.c, src/reader.h (tags): Remove.
15123 Adjust all users to use symbols[i]->tag.
15124
15125 2001-12-29 Akim Demaille <akim@epita.fr>
15126
15127 * src/gram.h, src/gram.c (symbols): New, similar to state_table
15128 and rule_table.
15129 * src/reader.c (packsymbols): Fill this table.
15130 Drop sprec.
15131 * src/conflicts.c (resolve_sr_conflict): Adjust.
15132 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
15133 single table.
15134 Use symbols[i]->tag instead of tags[i].
15135
15136 2001-12-29 Akim Demaille <akim@epita.fr>
15137
15138 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
15139 In addition, put a comment in there, to replace...
15140 * tests/regression.at (%union and C comments): Remove.
15141
15142 2001-12-29 Akim Demaille <akim@epita.fr>
15143
15144 * tests/regression.at (Web2c Actions): Blindly move the actual
15145 output as expected output. The contents *seem* right to me, but I
15146 can't pretend reading perfectly parser tables... Nonetheless, all
15147 the other tests pass correctly, the table look OK, even though the
15148 presence of `$axiom' is to be noted: AFAICS it is useless (but
15149 harmless).
15150
15151 2001-12-29 Akim Demaille <akim@epita.fr>
15152
15153 * src/reader.c (readgram): Don't add the rule 0 if there were no
15154 rules read. In other words, add it _after_ having performed
15155 grammar sanity checks.
15156 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
15157
15158 2001-12-29 Akim Demaille <akim@epita.fr>
15159
15160 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
15161 visible, and some states have now a different number.
15162
15163 2001-12-29 Akim Demaille <akim@epita.fr>
15164
15165 * src/reader.c (readgram): Bind the initial rule's lineno to that
15166 of the first rule.
15167 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
15168 (Solved SR Conflicts): Adjust rule 0's line number.
15169
15170 2001-12-29 Akim Demaille <akim@epita.fr>
15171
15172 Fix the `GAWK Grammar' failure.
15173
15174 * src/LR0.c (final_state): Initialize to -1 so that we do compute
15175 the reductions of the first state which was mistakenly confused
15176 with the final state because precisely final_state was initialized
15177 to 0.
15178 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
15179 now noticed by Bison.
15180 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
15181 have a reduction on $default.
15182
15183 2001-12-29 Akim Demaille <akim@epita.fr>
15184
15185 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
15186 rule line numbers.
15187 * src/closure.c (print_closure): Likewise.
15188 * src/derives.c (print_derives): Likewise.
15189 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
15190 now.
15191
15192 2001-12-29 Akim Demaille <akim@epita.fr>
15193
15194 * src/lalr.c (lookaheads_print): New.
15195 (lalr): Call it when --trace-flag.
15196 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
15197 are dumped.
15198
15199 2001-12-29 Akim Demaille <akim@epita.fr>
15200
15201 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
15202 when walking through ritem, even via rule->rhs.
15203 * src/reduce.c (dump_grammar, useful_production, reduce_output)
15204 (useful_production, useless_nonterminals): Likewise.
15205 (reduce_grammar_tables): Likewise, plus update nritems.
15206 * src/nullable.c (set_nullable): Likewise.
15207 * src/lalr.c (build_relations): Likewise.
15208 * tests/sets.at (Nullable): Adjust.
15209 Fortunately, now, the $axiom is no longer nullable.
15210
15211 2001-12-29 Akim Demaille <akim@epita.fr>
15212
15213 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
15214 the 0-sentinel.
15215 * src/gram.c (ritem_longest_rhs): Likewise.
15216 * src/reduce.c (nonterminals_reduce): Likewise.
15217 * src/print_graph.c (print_graph): Likewise.
15218 * src/output.c (output_rule_data): Likewise.
15219 * src/nullable.c (set_nullable): Likewise.
15220
15221 2001-12-29 Akim Demaille <akim@epita.fr>
15222
15223 * src/output.c: Comment changes.
15224
15225 2001-12-27 Paul Eggert <eggert@twinsun.com>
15226
15227 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
15228 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
15229 Sparc, as they were causing more porting problems than the
15230 (minor) performance improvement was worth.
15231
15232 Also, catch up with 1.31's YYSTD.
15233
15234 2001-12-27 Akim Demaille <akim@epita.fr>
15235
15236 * src/output.c (output_gram): Rely on nritems, not the
15237 0-sentinel. See below.
15238 Use -1 as separator, not 0.
15239 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
15240 Rely on -1 as separator in yyrhs, instead of 0.
15241 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
15242 twice `Now at end of input', therefore there are two lines less to
15243 expect.
15244
15245 2001-12-27 Akim Demaille <akim@epita.fr>
15246
15247 * tests/regression.at (Unresolved SR Conflicts):
15248 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
15249 below.
15250
15251 2001-12-27 Akim Demaille <akim@epita.fr>
15252
15253 * src/LR0.c (new_state): Recognize the final state by the fact it
15254 is reached by eoftoken.
15255 (insert_start_shifting_state, insert_eof_shifting_state)
15256 (insert_accepting_state, augment_automaton): Remove, since now
15257 these states are automatically computed from the initial state.
15258 (generate_states): Adjust.
15259 * src/print.c: When reporting a rule number to the user, substract
15260 1, so that the axiom rule is rule 0, and the first user rule is 1.
15261 * src/reduce.c: Likewise.
15262 * src/print_graph.c (print_core): For the time being, just as for
15263 the report, depend upon --trace-flags to dump the full set of
15264 items.
15265 * src/reader.c (readgram): Once the grammar read, insert the rule
15266 0: `$axiom: START-SYMBOL $'.
15267 * tests/set.at: Adjust: rule 0 is now displayed, and since the
15268 number of the states has changed (the final state is no longer
15269 necessarily the last), catch up.
15270
15271 2001-12-27 Akim Demaille <akim@epita.fr>
15272
15273 Try to make the use of the eoftoken valid. Given that its value
15274 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
15275 is used instead of > 0 where appropriate, (ii), depend upon nritems
15276 instead of the 0-sentinel.
15277
15278 * src/gram.h, src/gram.c (nritems): New.
15279 Expected to be duplication of nitems, but for the time being...
15280 * src/reader.c (packgram): Assert nritems and nitems are equal.
15281 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
15282 * src/closure.c (print_closure, print_fderives): Likewise.
15283 * src/gram.c (ritem_print): Likewise.
15284 * src/print.c (print_core, print_grammar): Likewise.
15285 * src/print_graph.c: Likewise.
15286
15287 2001-12-27 Akim Demaille <akim@epita.fr>
15288
15289 * src/main.c (main): If there are complains after grammar
15290 reductions, then output the report anyway if requested, then die.
15291 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
15292 * src/reader.c (eoftoken): New.
15293 (parse_token_decl): If the token being defined has value `0', it
15294 is the eoftoken.
15295 (packsymbols): No longer hack `tags' to insert `$' by hand.
15296 Be sure to preserve the value of the eoftoken.
15297 (reader): Make sure eoftoken is defined.
15298 Initialize nsyms to 0: now eoftoken is created just like the others.
15299 * src/print.c (print_grammar): Don't special case the eof token.
15300 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
15301 lie anyway, albeit pleasant.
15302 * tests/calc.at: Exercise error messages with eoftoken.
15303 Change the grammar so that empty input is invalid.
15304 Adjust expectations.
15305 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
15306
15307 2001-12-27 Akim Demaille <akim@epita.fr>
15308
15309 * configure.in: Check the protos of strchr ans strspn.
15310 Replace strchr if needed.
15311 * src/system.h: Provide the protos of strchr, strspn and memchr if
15312 missing.
15313 * lib/strchr.c: New.
15314 * src/reader.c (symbols_save): Use strchr.
15315
15316 2001-12-27 Akim Demaille <akim@epita.fr>
15317
15318 * src/print.c, src/print_graph.c (escape): New.
15319 Use it to quote the TAGS outputs.
15320 * src/print_graph.c (print_state): Now errors are in red, and
15321 reductions in green.
15322 Prefer high to wide: output the state number on a line of its own.
15323
15324 2001-12-27 Akim Demaille <akim@epita.fr>
15325
15326 * src/state.h, src/state.c (reductions_new): New.
15327 * src/LR0.c (set_state_table): Let all the states have a
15328 `reductions', even if reduced to 0.
15329 (save_reductions): Adjust.
15330 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
15331 * src/print.c (print_reductions, print_actions): Adjust.
15332 * src/output.c (action_row): Adjust.
15333
15334 2001-12-27 Akim Demaille <akim@epita.fr>
15335
15336 * src/state.h, src/state.c (errs_new, errs_dup): New.
15337 * src/LR0.c (set_state_table): Let all the states have an errs,
15338 even if reduced to 0.
15339 * src/print.c (print_errs, print_reductions): Adjust.
15340 * src/output.c (output_actions, action_row): Adjust.
15341 * src/conflicts.c (resolve_sr_conflict): Adjust.
15342
15343 2001-12-27 Akim Demaille <akim@epita.fr>
15344
15345 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
15346
15347 2001-12-27 Akim Demaille <akim@epita.fr>
15348
15349 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
15350 * src/print.c: here.
15351 (lookaheadset, shiftset): New, used as additional storage by
15352 print_reductions.
15353 (print_results): Adjust.
15354 (print_shifts, print_gotos, print_errs): New, extracted from...
15355 (print_actions): here.
15356 * src/print_graph.c (print_actions): Remove dead code.
15357
15358 2001-12-27 Akim Demaille <akim@epita.fr>
15359
15360 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
15361 `$n' and `@n'.
15362
15363 2001-12-27 Akim Demaille <akim@epita.fr>
15364
15365 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
15366 (build_relations): Adjust.
15367
15368 2001-12-27 Akim Demaille <akim@epita.fr>
15369
15370 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
15371 duplication.
15372
15373 2001-12-27 Akim Demaille <akim@epita.fr>
15374
15375 * src/reader.c (packgram): Catch nitems overflows.
15376
15377 2001-12-27 Akim Demaille <akim@epita.fr>
15378
15379 * src/files.c, src/files.h (guard_obstack): Remove.
15380 * src/output.c (output): Adjust.
15381 * src/reader.c (parse_braces): New, factoring...
15382 (copy_action, copy_guard): these two which are renamed as...
15383 (parse_action, parse_guard): these.
15384 As a voluntary consequence, using braces around guards is now
15385 mandatory.
15386
15387 2001-12-27 Akim Demaille <akim@epita.fr>
15388
15389 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
15390 * src/reader.c (symbol_list): `guard' and `guard_line' are new
15391 members.
15392 (symbol_list_new): Adjust.
15393 (copy_action): action_line is the first line, not the last.
15394 (copy_guard): Just as for actions, store the `action' only, not
15395 the switch/case/break flesh.
15396 Don't parse the user action that might follow the guard, let...
15397 (readgram): do it, i.e., now, there can be an action after a
15398 guard.
15399 In other words the guard is just explicitly optional.
15400 (packgram): Adjust.
15401 * src/output.c (guards_output): New.
15402 (output_parser): Call it when needed.
15403 (output): Also free the guard and attrs obstacks.
15404 * src/files.c, src/files.h (obstack_save): Remove.
15405 (output_files): Remove.
15406 As a result, if one needs the former `.act' file, using an
15407 appropriate skeleton which requires actions and guards is now
15408 required.
15409 * src/main.c (main): Adjust.
15410 * tests/semantic.at: New.
15411 * tests/regression.at: Use `input.y' as input file name.
15412 Avoid 8+3 problems by requiring input.c when the test needs the
15413 parser.
15414
15415 2001-12-27 Akim Demaille <akim@epita.fr>
15416
15417 * src/reader.c (symbol_list_new): Be sure to initialize all the
15418 fields.
15419
15420 2001-12-27 Akim Demaille <akim@epita.fr>
15421
15422 All the hacks using a final pseudo state are now useless.
15423
15424 * src/LR0.c (set_state_table): state_table holds exactly nstates.
15425 * src/lalr.c (nLA): New.
15426 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
15427 instead of lookaheadsp from the pseudo state (nstate + 1).
15428
15429 2001-12-27 Akim Demaille <akim@epita.fr>
15430
15431 * src/output.c (action_row, token_actions): Use a state_t instead
15432 of a integer, and nlookaheads instead of the following state's
15433 lookaheadsp.
15434
15435 2001-12-27 Akim Demaille <akim@epita.fr>
15436
15437 * src/conflicts.c (log_resolution, flush_shift)
15438 (resolve_sr_conflict, set_conflicts, solve_conflicts)
15439 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
15440 (conflicts_print, print_reductions): Use a state_t instead of an
15441 integer when referring to a state.
15442 As much as possible, depend upon nlookaheads, instead of the
15443 `lookaheadsp' member of the following state (since lookaheads of
15444 successive states are successive, the difference between state n + 1
15445 and n served as the number of lookaheads for state n).
15446 * src/lalr.c (add_lookback_edge): Likewise.
15447 * src/print.c (print_core, print_actions, print_state)
15448 (print_results): Likewise.
15449 * src/print_graph.c (print_core, print_actions, print_state)
15450 (print_graph): Likewise.
15451 * src/conflicts.h: Adjust.
15452
15453 2001-12-27 Akim Demaille <akim@epita.fr>
15454
15455 * src/bison.hairy: Formatting/comment changes.
15456 ANSIfy.
15457 Remove `register' indications.
15458 Add plenty of `static'.
15459
15460 2001-12-27 Akim Demaille <akim@epita.fr>
15461
15462 * src/output.c (prepare): Drop the muscle `ntbase' which
15463 duplicates ntokens.
15464 * src/bison.simple: Formatting/comment changes.
15465 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
15466 is an undocumented synonym.
15467
15468 2001-12-22 Akim Demaille <akim@epita.fr>
15469
15470 * src/output.c (output_table_data): Change the prototype to use
15471 `int' for array ranges: some invocations do pass an int, not a
15472 short.
15473 Reported by Wayne Green.
15474
15475 2001-12-22 Akim Demaille <akim@epita.fr>
15476
15477 Some actions of web2c.y are improperly triggered.
15478 Reported by Mike Castle.
15479
15480 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
15481 * tests/regression.at (Web2c): Rename as...
15482 (Web2c Report): this.
15483 (Web2c Actions): New.
15484
15485 2001-12-22 Akim Demaille <akim@epita.fr>
15486
15487 Reductions in web2c.y are improperly reported.
15488 Reported by Mike Castle.
15489
15490 * src/conflicts.c (print_reductions): Fix.
15491 * tests/regression.at (Web2c): New.
15492
15493 2001-12-18 Akim Demaille <akim@epita.fr>
15494
15495 Some host fail on `assert (!"foo")', which expands to
15496 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
15497 Reported by Nelson Beebee.
15498
15499 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
15500 `#define it_succeeded 0' and `assert (it_succeeded)'.
15501
15502 2001-12-17 Marc Autret <autret_m@epita.fr>
15503
15504 * src/bison.simple: Don't hard code the skeleton line and filename.
15505 * src/output.c (output_parser): Rename 'line' as 'output_line'.
15506 New line counter 'skeleton_line' (skeleton-line muscle).
15507
15508 2001-12-17 Paul Eggert <eggert@twinsun.com>
15509
15510 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
15511 YYDEBUG must be defined to a nonzero value.
15512
15513 * src/bison.simple (yytname): Do not assume that the user defines
15514 YYDEBUG to a properly parenthesized expression.
15515
15516 2001-12-17 Akim Demaille <akim@epita.fr>
15517
15518 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
15519 nlookaheads is a new member.
15520 Adjust all users.
15521 * src/lalr.h (nlookaheads): Remove this orphan declaration.
15522 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
15523 state.
15524
15525 2001-12-17 Akim Demaille <akim@epita.fr>
15526
15527 * src/files.h, src/files.c (open_files, close_files): Remove.
15528 * src/main.c (main): Don't open/close files, nor invoke lex_free,
15529 let...
15530 * src/reader.c (reader): Do it.
15531
15532 2001-12-17 Akim Demaille <akim@epita.fr>
15533
15534 * src/conflicts.c (print_reductions): Formatting changes.
15535
15536 2001-12-17 Akim Demaille <akim@epita.fr>
15537
15538 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
15539 (flush_reduce): New.
15540 (resolve_sr_conflict): Adjust.
15541
15542 2001-12-17 Akim Demaille <akim@epita.fr>
15543
15544 * src/output.c (output_obstack): Be static and rename as...
15545 (format_obstack): this, to avoid any confusion with files.c's
15546 output_obstack.
15547 * src/reader.h (muscle_obstack): Move to...
15548 * src/output.h: here, since it's defined in output.c.
15549
15550 2001-12-17 Akim Demaille <akim@epita.fr>
15551
15552 * src/output.c (action_row, save_column, default_goto)
15553 (sort_actions, matching_state, pack_vector): Better variable
15554 locality.
15555
15556 2001-12-17 Akim Demaille <akim@epita.fr>
15557
15558 * src/output.c: Various formatting changes.
15559
15560 2001-12-17 Akim Demaille <akim@epita.fr>
15561
15562 * src/files.c (output_files): Free the output_obstack.
15563 * src/main.c (main): Call print and print_graph conditionally.
15564 * src/print.c (print): Work unconditionally.
15565 * src/print_graph.c (print_graph): Work unconditionally.
15566 * src/conflicts.c (log_resolution): Output only if verbose_flag.
15567
15568 2001-12-16 Marc Autret <autret_m@epita.fr>
15569
15570 * src/output.c (actions_output): Fix. When we use %no-lines,
15571 there is one less line per action.
15572
15573 2001-12-16 Marc Autret <autret_m@epita.fr>
15574
15575 * src/bison.simple: Remove a useless #line directive.
15576 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
15577 * src/output.c (get_lines_number): New.
15578 (output_parser): Adjust, now takes care about the lines of a
15579 output muscles.
15580 Fix line numbering.
15581 (actions_output): Computes the number of lines taken by actions.
15582 (output_master_parser): Insert new skeleton which is the name of
15583 the output parser file name.
15584
15585 2001-12-15 Marc Autret <autret_m@epita.fr>
15586
15587 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
15588
15589 2001-12-15 Marc Autret <autret_m@epita.fr>
15590
15591 * src/output.c (output_gram): Keep track of the hairy one.
15592
15593 2001-12-15 Akim Demaille <akim@epita.fr>
15594
15595 Make `make distcheck' work.
15596
15597 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
15598 system.h which uses libgettext.h.
15599
15600 2001-12-15 Akim Demaille <akim@epita.fr>
15601
15602 * src/nullable.c (set_nullable): Useless rules must be skipped,
15603 otherwise, since we range over their symbols, we might look at a
15604 nonterminal which no longer ``exists'', i.e., it is not counted in
15605 `nvars', hence we overflow our arrays.
15606
15607 2001-12-15 Akim Demaille <akim@epita.fr>
15608
15609 The header can also be produced directly, without any obstack!
15610 Yahoo!
15611
15612 * src/files.c, src/files.h (defines_obstack): Remove.
15613 (compute_header_macro): Global.
15614 (defines_obstack_save): Remove.
15615 * src/reader.c (parse_union_decl): No longer output to
15616 defines_obstack: its content can be found in the `stype' muscle
15617 anyway.
15618 (output_token_translations): Merge into...
15619 (symbols_output): this.
15620 Rename as...
15621 (symbols_save): this.
15622 (reader): Adjust.
15623 * src/output.c (header_output): New.
15624 (output): Call it.
15625
15626 2001-12-15 Akim Demaille <akim@epita.fr>
15627
15628 * src/reader.c (parse_union_decl): Instead of handling two obstack
15629 simultaneously, use one to define the `stype' muscle, and use the
15630 value of the latter to fill defines_obstack.
15631 (copy_comment): Remove.
15632 (copy_comment2): Work for a single obstack.
15633 Rename as...
15634 (copy_comment): this.
15635
15636 2001-12-15 Akim Demaille <akim@epita.fr>
15637
15638 * src/lex.c, src/lex.h (xgetc): No longer static.
15639 * src/reader.c (parse_union_decl): Revamp.
15640
15641 2001-12-15 Akim Demaille <akim@epita.fr>
15642
15643 Still making progress in separating Bison into (i) input, (ii)
15644 process, (iii) output: now we can directly output the parser file
15645 without using table_obstack at all.
15646
15647 * src/files.c, src/files.h (table_obstack): Bye bye.
15648 (parser_file_name): New.
15649 * src/files.c (compute_output_file_names): Compute it.
15650 * src/output.c (actions_output, output_parser)
15651 (output_master_parser): To a file instead of an obstack.
15652
15653 2001-12-15 Akim Demaille <akim@epita.fr>
15654
15655 Attach actions to rules, instead of pre-outputting them to
15656 actions_obstack.
15657
15658 * src/gram.h (rule_t): action and action_line are new members.
15659 * src/reader.c (symbol_list): Likewise.
15660 (copy_action): Save the actions within the rule.
15661 (packgram): Save them in rule_table.
15662 * src/output.c (actions_output): New.
15663 (output_parser): Use it on `%%actions'.
15664 (output_rule_data): Don't free rule_table.
15665 (output): Do it.
15666 (prepare): Don't save the `action' muscle.
15667 * src/bison.simple: s/%%action/%%actions/.
15668
15669 2001-12-15 Akim Demaille <akim@epita.fr>
15670
15671 * src/reader.c (copy_action): When --yacc, don't append a `;'
15672 to the user action: let it fail if lacking.
15673 Suggested by Arnold Robbins and Tom Tromey.
15674
15675 2001-12-14 Akim Demaille <akim@epita.fr>
15676
15677 * src/lex.c (literalchar): Simply return the char you decoded, non
15678 longer mess around with obstacks and int pointers.
15679 Adjust all callers.
15680
15681 2001-12-14 Akim Demaille <akim@epita.fr>
15682
15683 * src/lex.c (literalchar): Don't escape the special characters,
15684 just decode them, and keep them as char (before, eol was output as
15685 the 2 char string `\n' etc.).
15686 * src/output.c (output_rule_data): Use quotearg to output the
15687 token strings.
15688
15689 2001-12-13 Paul Eggert <eggert@twinsun.com>
15690
15691 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
15692 Do not infringe on the global user namespace when using C++.
15693 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
15694 All uses of `fprintf' and `stderr' changed.
15695
15696 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
15697
15698 2001-12-13 Akim Demaille <akim@epita.fr>
15699
15700 The computation of nullable is broken: it doesn't handle empty
15701 RHS's properly.
15702
15703 * tests/torture.at (GNU AWK Grammar): New.
15704 * tests/sets.at (Nullable): New.
15705 * src/nullable.c (set_nullable): Instead of blindly looping over
15706 `ritems', loop over the rules, and then over their rhs's.
15707
15708 Work around Autotest bugs.
15709
15710 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
15711 frame, because Autotest understand lines starting with a `+' as
15712 traces from the shell. Then, they are not processed properly.
15713 Admittedly an Autotest bug, but we don't have time to wait for
15714 Autotest to catch up.
15715 * tests/regression.at (Broken Closure): Adjust to the new table
15716 frames.
15717 Move to...
15718 * tests/sets.at: here.
15719
15720 2001-12-13 Akim Demaille <akim@epita.fr>
15721
15722 * src/closure.c (closure): Use nrules instead of playing tricks
15723 with BITS_PER_WORD.
15724
15725 2001-12-13 Akim Demaille <akim@epita.fr>
15726
15727 * src/print.c (print_actions): Output the handling of `$' as the
15728 traces do: shifting the token EOF. Before EOF was treated as a
15729 nonterminal.
15730 * tests/regression.at: Adjust some tests.
15731 * src/print_graph.c (print_core): Complete the set of items via
15732 closure. The next-to-final and final states are still unsatisfying,
15733 but that's to be addressed elsewhere.
15734 No longer output the rule numbers, but do output the state number.
15735 A single loop for the shifts + gotos is enough, but picked a
15736 distinct color for each.
15737 (print_graph): Initialize and finalize closure.
15738
15739 2001-12-13 Akim Demaille <akim@epita.fr>
15740
15741 * src/reader.c (readgram): Remove dead code, an strip useless
15742 braces.
15743 (get_type): Remove, unused.
15744
15745 2001-12-12 Akim Demaille <akim@epita.fr>
15746
15747 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
15748 on that of lib/error.c.
15749
15750 2001-12-12 Akim Demaille <akim@epita.fr>
15751
15752 Some hosts don't like `/' in includes.
15753
15754 * src/system.h: Include libgettext.h without qualifying the path.
15755 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
15756 $(top_srcdir).
15757
15758 2001-12-11 Marc Autret <autret_m@epita.fr>
15759
15760 * src/output.c (output_parser): Remove useless muscle.
15761
15762 2001-12-11 Marc Autret <autret_m@epita.fr>
15763
15764 * src/bison.simple: Remove #line just before %%epilogue. It
15765 is now handled in ...
15766 * src/reader.c (read_additionnal_code): Add the output of a
15767 #line for the epilogue.
15768
15769 2001-12-10 Marc Autret <autret_m@epita.fr>
15770
15771 * src/reader.c (copy_definition): Re-use CPP-outed code which
15772 replace precedent remove.
15773 * src/bison.simple: Remove #line before %%prologue because
15774 %%input-line is wrong at this time.
15775
15776 2001-12-10 Marc Autret <autret_m@epita.fr>
15777
15778 * src/reader.c (symbols_output): Clean up.
15779 * src/output.c (output_gram, output): Clean up.
15780
15781 2001-12-10 Akim Demaille <akim@epita.fr>
15782
15783 * src/lalr.c (initialize_lookaheads): New. Extracted from...
15784 * src/LR0.c (set_state_table): here.
15785 * src/lalr.c (lalr): Call it.
15786
15787 2001-12-10 Akim Demaille <akim@epita.fr>
15788
15789 * src/state.h (shifts): Remove the `number' member: shifts are
15790 attached to state, hence no longer need to be labelled with a
15791 state number.
15792
15793 2001-12-10 Akim Demaille <akim@epita.fr>
15794
15795 Now that states have a complete set of members, the linked list of
15796 shifts is useless: just fill directly the state's shifts member.
15797
15798 * src/state.h (shifts): Remove the `next' member.
15799 * src/LR0.c (first_state, last_state): Remove.
15800 Adjust the callers.
15801 (augment_automaton): Don't look for the shifts that must be added
15802 a shift on EOF: it is those of the state we looked for! But now,
15803 since shifts are attached, it is no longer needed to looking
15804 merely by its id: its number.
15805
15806 2001-12-10 Akim Demaille <akim@epita.fr>
15807
15808 * src/LR0.c (augment_automaton): Better variable locality.
15809 Remove an impossible branch: if there is a state corresponding to
15810 the start symbol being shifted, then there is shift for the start
15811 symbol from the initial state.
15812
15813 2001-12-10 Akim Demaille <akim@epita.fr>
15814
15815 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
15816 only when appropriate: when insert_start_shifting_state' is not
15817 invoked.
15818 * tests/regression.at (Rule Line Numbers): Adjust.
15819
15820 2001-12-10 Akim Demaille <akim@epita.fr>
15821
15822 * src/LR0.c (augment_automaton): Now that all states have shifts,
15823 merge the two cases addition shifts to the initial state.
15824
15825 2001-12-10 Akim Demaille <akim@epita.fr>
15826
15827 * src/lalr.c (set_state_table): Move to...
15828 * src/LR0.c: here.
15829 * src/lalr.c (lalr): Don't call it...
15830 * src/LR0.c (generate_states): do it.
15831 * src/LR0.h (first_state): Remove, only the table is used.
15832
15833 2001-12-10 Akim Demaille <akim@epita.fr>
15834
15835 * src/LR0.h (first_shift, first_reduction): Remove.
15836 * src/lalr.c: Don't use first_shift: find shifts through the
15837 states.
15838
15839 2001-12-10 Akim Demaille <akim@epita.fr>
15840
15841 * src/LR0.c: Attach shifts to states as soon as they are
15842 computed.
15843 * src/lalr.c (set_state_table): Instead of assigning shifts to
15844 state, just assert that the mapping was properly done.
15845
15846 2001-12-10 Akim Demaille <akim@epita.fr>
15847
15848 * src/LR0.c (insert_start_shift): Rename as...
15849 (insert_start_shifting_state): this.
15850 (insert_eof_shifting_state, insert_accepting_state): New.
15851 (augment_automaton): Adjust.
15852 Better locality of the variables.
15853 When looking if the start_symbol is shifted from the initial
15854 state, using `while (... symbol != start_symbol ...)' sounds
15855 better than `while (... symbol < start_symbol ...)': If fail
15856 to see how the order between symbols could be relevant!
15857
15858 2001-12-10 Akim Demaille <akim@epita.fr>
15859
15860 * src/getargs.h: Don't declare `spec_name_prefix' and
15861 `spec_file_prefix', declared by src/files.h.
15862 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
15863 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
15864 * src/output.c (prepare): Adjust.
15865 * src/reader.c (symbols_output): Likewise.
15866 * src/vmsgetargs.c: Vaguely adjust, but who cares?
15867
15868 2001-12-10 Akim Demaille <akim@epita.fr>
15869
15870 * src/muscle_tab.c (muscle_init): NULL is a better default than
15871 `"0"'.
15872
15873 2001-12-10 Akim Demaille <akim@epita.fr>
15874
15875 * src/reader.c (reader): Calling symbols_output once is enough.
15876
15877 2001-12-10 Akim Demaille <akim@epita.fr>
15878
15879 Now that states have a complete set of members, the linked list of
15880 reductions is useless: just fill directly the state's reductions
15881 member.
15882
15883 * src/state.h (struct reductions): Remove member `number' and
15884 `next'.
15885 * src/LR0.c (first_reduction, last_reduction): Remove.
15886 (save_reductions): Don't link the new reductions, store them in
15887 this_state.
15888 * src/lalr.c (set_state_table): No need to attach reductions to
15889 states, it's already done.
15890 * src/output.c (output_actions): No longer free the shifts, then
15891 the reductions, then the states: free all the states and their
15892 members.
15893
15894 2001-12-10 Akim Demaille <akim@epita.fr>
15895
15896 * src/options.c (OPTN, DRTV, BOTH): New.
15897 (option_table): Use them.
15898
15899 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
15900 the job of system.h.
15901 * src/options.c: Don't include stdio.h and xalloc.h for the same
15902 reasons.
15903
15904 2001-12-10 Akim Demaille <akim@epita.fr>
15905
15906 * src/output.c (output, prepare): Make sure the values of the
15907 muscles `action' and `prologue' are 0-terminated.
15908
15909 2001-12-10 Akim Demaille <akim@epita.fr>
15910
15911 Clean up GCC warnings.
15912
15913 * src/reader.c (copy_action): `buf' is not used.
15914 (parse_skel_decl): Be static.
15915 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
15916 * src/options.h (create_long_option_table): Have a real prototype.
15917 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
15918 (hash_delete_at): Return const void *.
15919 Adjust casts to preserve the const.
15920
15921 2001-12-10 Akim Demaille <akim@epita.fr>
15922
15923 * configure.in: Require 2.52g.
15924 M4 is not needed, but AUTOM4TE is.
15925 * m4/m4.m4: Remove.
15926 * tests/Makefile.am: Adjust.
15927
15928 2001-12-10 Akim Demaille <akim@epita.fr>
15929
15930 One structure for states is enough, even though theoretically
15931 there are LR(0) states and LALR(1) states.
15932
15933 * src/lalr.h (state_t): Remove.
15934 (state_table): Be state_t **, not state_t *.
15935 * src/state.h (core, CORE_ALLOC): Rename as...
15936 (state_t, STATE_ALLOC): this.
15937 Add the LALR(1) members: shifts, reductions, errs.
15938 * src/LR0.c (state_table): Rename as...
15939 (state_hash): this, to avoid name clashes with the global
15940 `state_table'.
15941 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
15942 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
15943
15944 2001-12-10 Akim Demaille <akim@epita.fr>
15945
15946 Bison dumps core on bash.y.
15947 Reported by Pascal Bart.
15948
15949 * src/warshall.c (bitmatrix_print): New.
15950 (TC): Use it.
15951 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
15952 j must be the outer loop.
15953 * tests/regression.at (Broken Closure): New.
15954
15955 2001-12-05 Akim Demaille <akim@epita.fr>
15956
15957 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
15958 its argument.
15959 Reported by Peter Hamorsky.
15960
15961 2001-12-05 Akim Demaille <akim@epita.fr>
15962
15963 * src/conflicts.c (err_table): Remove.
15964 (resolve_sr_conflict): Adjust.
15965 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
15966 Rename as...
15967 (state_t.reductions, state_t.shifts): this.
15968
15969 2001-12-05 Akim Demaille <akim@epita.fr>
15970
15971 * src/reduce.c (reduce_grammar_tables): No longer disable the
15972 removal of useless rules via CPP but via `if (0)', so that the
15973 compiler still check the code is valid.
15974 For instance, it should have noticed `rline' no longer exists: use
15975 the `line' member of rule_t.
15976 * src/gram.c (dummy, rline): Remove, unused.
15977
15978 2001-12-05 Akim Demaille <akim@epita.fr>
15979
15980 * src/output.c (pack_vector): Use assert, not berror.
15981 * src/main.c (berror): Remove, unused.
15982
15983 2001-12-05 Akim Demaille <akim@epita.fr>
15984
15985 New experimental feature: if --verbose --trace output all the
15986 items of a state, not only its kernel.
15987
15988 * src/print.c (print_core): If `trace_flag', then invoke closure
15989 before outputting the items of the state (print_core is no longer
15990 a correct name them).
15991 (print_results): Invoke new_closure/free_closure if needed.
15992
15993 2001-12-05 Akim Demaille <akim@epita.fr>
15994
15995 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
15996 * src/closure.c, src/closure.h (itemsetsize): Rename as...
15997 (nitemset): for consistency with the rest of the project.
15998
15999 2001-12-05 Akim Demaille <akim@epita.fr>
16000
16001 * src/closure.c (print_closure): Improve.
16002 (closure): Use it for printing input and output.
16003
16004 2001-12-05 Akim Demaille <akim@epita.fr>
16005
16006 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
16007 indexed by nonterminals.
16008
16009 2001-12-05 Akim Demaille <akim@epita.fr>
16010
16011 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
16012 what it was!).
16013 * src/warshall.h: Remove accidental duplication of the content.
16014
16015 2001-12-05 Akim Demaille <akim@epita.fr>
16016
16017 * src/closure.c (set_fderives): De-obfuscate.
16018
16019 2001-12-05 Akim Demaille <akim@epita.fr>
16020
16021 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
16022
16023 2001-12-05 Akim Demaille <akim@epita.fr>
16024
16025 * src/closure.c (set_firsts): De-obfuscate.
16026
16027 2001-12-05 Akim Demaille <akim@epita.fr>
16028
16029 * src/output.c (action_row): De-obfuscate
16030 using the good o' techniques: arrays not pointers, variable
16031 locality, BITISSET, RESETBIT etc.
16032
16033 2001-12-05 Akim Demaille <akim@epita.fr>
16034
16035 Pessimize the code to simplify it: from now on, all the states
16036 have a valid SHIFTS, which NSHIFTS is possibly 0.
16037
16038 * src/LR0.c (shifts_new): Be global and move to..
16039 * src/state.c, src/state.h: here.
16040 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
16041 * src/print_graph: Adjust.
16042
16043 2001-12-05 Akim Demaille <akim@epita.fr>
16044
16045 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
16046 * src/conflicts.c: Use it.
16047 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
16048 incorrectly ``simplified''.
16049
16050 2001-12-05 Akim Demaille <akim@epita.fr>
16051
16052 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
16053 using the good o' techniques: arrays not pointers, variable
16054 locality, BITISSET, RESETBIT etc.
16055
16056 2001-12-05 Akim Demaille <akim@epita.fr>
16057
16058 * src/state.h (SHIFT_SYMBOL): New.
16059 * src/conflicts.c: Use it to deobfuscate.
16060
16061 2001-12-05 Akim Demaille <akim@epita.fr>
16062
16063 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
16064 (print_reductions): De-obfuscate using the good o' techniques:
16065 arrays not pointers, variable locality, BITISSET.
16066
16067 2001-12-05 Akim Demaille <akim@epita.fr>
16068
16069 * src/conflicts.c (print_reductions): Arrays, not pointers.
16070 Use BITISSET.
16071
16072 2001-12-05 Akim Demaille <akim@epita.fr>
16073
16074 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16075
16076 2001-12-05 Akim Demaille <akim@epita.fr>
16077
16078 * src/conflicts.c (print_reductions): Improve variable locality.
16079
16080 2001-12-05 Akim Demaille <akim@epita.fr>
16081
16082 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16083
16084 2001-12-05 Akim Demaille <akim@epita.fr>
16085
16086 * src/conflicts.c (print_reductions): Improve variable locality.
16087
16088 2001-12-05 Akim Demaille <akim@epita.fr>
16089
16090 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
16091 * src/lalr.c: Use them.
16092
16093 2001-12-05 Akim Demaille <akim@epita.fr>
16094
16095 * src/LR0.c (augment_automaton): Formatting changes.
16096 Better variable locality.
16097
16098 2001-12-05 Akim Demaille <akim@epita.fr>
16099
16100 * src/lalr.c (matrix_print): New.
16101 (transpose): Use it.
16102 Use arrays instead of pointers.
16103
16104 2001-12-05 Akim Demaille <akim@epita.fr>
16105
16106 * src/lalr.c (maxrhs): Move to...
16107 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
16108 * src/lalr.c (build_relations): Adjust.
16109
16110 2001-12-05 Akim Demaille <akim@epita.fr>
16111
16112 * src/lalr.c (transpose): Free the memory allocated to the
16113 argument, as it is replaced by the results by the unique caller.
16114 (build_relations): Merely invoke transpose: it handles the memory
16115 deallocation.
16116 Improve variable locality.
16117 Avoid variables used as mere abbreviations.
16118 (compute_lookaheads): Use arrays instead of pointers.
16119
16120 2001-12-05 Akim Demaille <akim@epita.fr>
16121
16122 * src/lalr.c (initialize_F): Improve variable locality.
16123 Avoid variables used as mere abbreviations.
16124
16125 2001-12-05 Akim Demaille <akim@epita.fr>
16126
16127 * src/derives.c (print_derives): Display the ruleno.
16128 * src/lalr.c (initialize_F, transpose): Better variable locality
16129 to improve readability.
16130 Avoid variables used as mere abbreviations.
16131
16132 2001-12-05 Akim Demaille <akim@epita.fr>
16133
16134 * src/lalr.c (traverse): Use arrays instead of pointers.
16135
16136 2001-12-05 Akim Demaille <akim@epita.fr>
16137
16138 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
16139 the handling of squeue.
16140 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16141
16142 2001-12-05 Akim Demaille <akim@epita.fr>
16143
16144 Because useless nonterminals are now kept alive (instead of being
16145 `destroyed'), we now sometimes examine them, and store information
16146 related to them. Hence we need to know their number, and adjust
16147 memory allocations.
16148
16149 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
16150 static.
16151 * src/LR0.c (allocate_itemsets): The memory allocated to
16152 `symbol_count' was used for two different purpose: once to count
16153 the number of occurrences of each symbol, and later reassigned to
16154 `shift_symbol', containing the symbol that can be shifted from a
16155 given state.
16156 Deobfuscate, i.e., allocate, use and free `symbol_count' here
16157 only, and...
16158 (new_itemsets): Allocate `shift_symbol' here.
16159 (allocate_itemsets): symbol_count includes useless nonterminals.
16160 Make room for them.
16161 (free_storage): Use `free', not `XFREE', for pointers that cannot
16162 be null.
16163
16164 2001-12-05 Akim Demaille <akim@epita.fr>
16165
16166 * src/nullable.c (set_nullable): Deobfuscate the handling of
16167 ritem.
16168 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16169
16170 2001-12-05 Akim Demaille <akim@epita.fr>
16171
16172 * src/gram.c, src/gram.h (ritem_print): New.
16173 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
16174 (This useless function was defined only to work around VMS linkers
16175 that can't handle compilation units with variables only).
16176 * src/reduce.c (dump_grammar): Use it to trace the construction of
16177 ritem.
16178
16179 2001-12-04 Paul Eggert <eggert@twinsun.com>
16180
16181 * src/bison.simple (union yyalloc): Change member names
16182 to be the same as the stack names.
16183 (yyparse): yyptr is now union yyalloc *, not char *.
16184 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
16185 and may generate better code on some machines.
16186 (yystpcpy): Use prototype if __STDC__ is defined, not just
16187 if __cplusplus is defined.
16188
16189 2001-11-30 Akim Demaille <akim@epita.fr>
16190
16191 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
16192 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
16193 Gettext doesn't compile cleanly, and dies with -Werror.
16194 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
16195 Include WARNING_CFLAGS here.
16196 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
16197 before being defined.
16198
16199 2001-11-27 Paul Eggert <eggert@twinsun.com>
16200
16201 * lib/quotearg.h (quotearg_n, quotearg_n_style):
16202 First arg is int, not unsigned.
16203 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
16204 (SIZE_MAX, UINT_MAX): New macros.
16205 (quotearg_n_options): Abort if N is negative.
16206 Avoid overflow check on hosts where size_t is 64 bits and int
16207 is 32 bits, as overflow is impossible there.
16208 Fix off-by-one typo that caused unnecessary reallocation.
16209
16210 2001-11-29 Paul Eggert <eggert@twinsun.com>
16211
16212 Name space cleanup in generated parser.
16213
16214 * doc/bison.texinfo (Bison Parser): Discuss system headers
16215 and their effect on the user name space.
16216
16217 * src/bison.simple:
16218 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
16219 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
16220 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
16221
16222 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
16223 on user names when possible.
16224
16225 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
16226 Simplify test for whather <alloca.h> exists.
16227
16228 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
16229
16230 (<stdio.h>): Include if YYDEBUG.
16231
16232 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
16233 ! defined (yyoverflow) && ! defined (yymemcpy).
16234
16235 (yymemcpy, yyparse): Rename local variables as needed so that
16236 they all begin with 'yy'.
16237
16238 (yystrlen, yystpcpy): New functions.
16239
16240 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
16241 All uses changed.
16242
16243 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
16244 instead of relying on string.h functions. Use YYSTACK_ALLOC
16245 and YYSTACK_FREE instead of malloc and free.
16246
16247 2001-11-30 Akim Demaille <akim@epita.fr>
16248
16249 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
16250 before their first uses.
16251 (YYBISON, YYPURE): Move to the top of the output.
16252
16253 2001-11-30 Akim Demaille <akim@epita.fr>
16254
16255 * tests/reduce.at (Useless Nonterminals): Fix.
16256
16257 2001-11-30 Akim Demaille <akim@epita.fr>
16258
16259 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
16260 if body instead of `;' to pacify GCC's warnings.
16261
16262 2001-11-30 Akim Demaille <akim@epita.fr>
16263
16264 Instead of mapping the LHS of unused rules to -1, keep the LHS
16265 valid, but flag the rules as invalid.
16266
16267 * src/gram.h (rule_t): `useful' is a new member.
16268 * src/print.c (print_grammar): Adjust.
16269 * src/derives.c (set_derives): Likewise.
16270 * src/reader.c (packgram, reduce_output): Likewise.
16271 * src/reduce.c (reduce_grammar_tables): Likewise.
16272 * tests/reduce.at (Underivable Rules, Useless Rules): New.
16273
16274 2001-11-30 Akim Demaille <akim@epita.fr>
16275
16276 * src/reduce.c (reduce_output): Formatting changes.
16277 * src/print.c (print_results, print_grammar): Likewise.
16278 * tests/regression.at (Rule Line Numbers)
16279 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
16280
16281 2001-11-30 Akim Demaille <akim@epita.fr>
16282
16283 * src/reduce.c (nonterminals_reduce): Instead of throwing away
16284 useless nonterminals, move them at the end of the symbol arrays.
16285 (reduce_output): Adjust.
16286 * tests/reduce.at (Useless Nonterminals): Adjust.
16287
16288 2001-11-30 Akim Demaille <akim@epita.fr>
16289
16290 * src/reduce.c: Various comment/formatting changes.
16291 (nonterminals_reduce): New, extracted from...
16292 (reduce_grammar_tables): here.
16293 (reduce_grammar): Call nonterminals_reduce.
16294
16295 2001-11-29 Paul Eggert <eggert@twinsun.com>
16296
16297 * src/bison.simple (YYSTACK_REALLOC): Remove.
16298 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
16299 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
16300 New macros.
16301 (union yyalloc): New type.
16302 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
16303 an arbitrary restriction on hosts where size_t is wider than int.
16304
16305 (yyparse): Don't dump core if alloca or malloc fails; instead, report
16306 a parser stack overflow. Allocate just one block of memory for all
16307 three stacks, instead of allocating three blocks; this typically is
16308 faster and reduces fragmentation.
16309
16310 Do not limit the number of items in the stack to a value that fits
16311 in 'int', as this is an arbitrary limit on hosts with 64-bit
16312 size_t and 32-bit int.
16313
16314 2001-11-29 Marc Autret <autret_m@epita.fr>
16315
16316 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
16317 of defining YYERROR_VERBOSE.
16318 [AT_DATA]: $4 is now out of C declarations in the prologue.
16319
16320 2001-11-28 Marc Autret <autret_m@epita.fr>
16321
16322 * src/reader.c (parse_dquoted_param): New.
16323 (parse_skel_decl): Use it.
16324 * src/lex.h: Add its prototype.
16325 * src/lex.c (literalchar): Become not static.
16326
16327 2001-11-28 Marc Autret <autret_m@epita.fr>
16328
16329 * src/output.h: And put its extern declaration here.
16330 * src/output.c (error_verbose): Define here.
16331 (prepare): Echo name modification.
16332 * src/getargs.h: Clean its extern declaration.
16333 * src/getargs.c (error_verbose_flag): Remove.
16334 (getargs): Remove case 'e'.
16335 * src/options.c (option_table): 'error-verbose' is now seen as simple
16336 percent option.
16337 Include output.h.
16338
16339 * src/reader.c (read_declarations): Remove case tok_include.
16340 (parse_include_decl): Remove.
16341 * src/lex.h (token_t): Remove tok_include.
16342 * src/options.c (option_table): 'include' is now a simple command line
16343 option.
16344
16345 2001-11-28 Marc Autret <autret_m@epita.fr>
16346
16347 * src/bison.simple: Adjust muscle names.
16348 * src/muscle_tab.c (muscle_init): Also rename the muscles.
16349 * src/output.c (prepare): s/_/-/ for the muscles names.
16350 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
16351
16352 2001-11-28 Marc Autret <autret_m@epita.fr>
16353
16354 * src/bison.simple: Fix debug.
16355 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
16356
16357 2001-11-28 Akim Demaille <akim@epita.fr>
16358
16359 * src/LR0.c (shifts_new): New.
16360 (save_shifts, insert_start_shift, augment_automaton): Use it.
16361
16362 2001-11-28 Akim Demaille <akim@epita.fr>
16363
16364 * src/closure.c (closure): `b' and `ruleno' denote the same value:
16365 keep ruleno only.
16366
16367 2001-11-28 Akim Demaille <akim@epita.fr>
16368
16369 * src/closure.c (closure): Instead of looping over word in array
16370 then bits in words, loop over bits in array.
16371
16372 2001-11-28 Akim Demaille <akim@epita.fr>
16373
16374 * src/closure.c (closure): No longer optimize the special case
16375 where all the bits of `ruleset[r]' are set to 0, to make the code
16376 clearer.
16377
16378 2001-11-28 Akim Demaille <akim@epita.fr>
16379
16380 * src/closure.c (closure): `r' and `c' are new variables, used to
16381 de-obfuscate accesses to RULESET and CORE.
16382
16383 2001-11-28 Akim Demaille <akim@epita.fr>
16384
16385 * src/reduce.c (reduce_print): Use ngettext.
16386 (dump_grammar): Improve the trace accuracy.
16387
16388 2001-11-28 Akim Demaille <akim@epita.fr>
16389
16390 * src/reduce.c (dump_grammar): Don't translate trace messages.
16391
16392 2001-11-28 Akim Demaille <akim@epita.fr>
16393
16394 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
16395 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
16396 as all tags are free'ed afterwards.
16397 From Enrico Scholz.
16398
16399 2001-11-27 Paul Eggert <eggert@twinsun.com>
16400
16401 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
16402 use alloca when we didn't want to, and vice versa.
16403
16404 2001-11-27 Marc Autret <autret_m@epita.fr>
16405
16406 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
16407 initialization.
16408 * src/output.c (prepare): Remove its update.
16409
16410 2001-11-27 Marc Autret <autret_m@epita.fr>
16411
16412 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
16413 Use %error-verbose.
16414
16415 2001-11-27 Marc Autret <autret_m@epita.fr>
16416
16417 * src/bison.simple: Remove YYERROR_VERBOSE using.
16418 Use %%error_verbose.
16419 (yyparse): Likewise.
16420 * src/output.c (prepare): Give its final value.
16421 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
16422 * src/getargs.h: Add its extern declaration.
16423 * src/getargs.c (error_verbose_flag): New int.
16424 (getargs): Update to catch new case.
16425 * src/options.c (option_table): 'error-verbose' is a new option.
16426 (shortopts): Update.
16427
16428 2001-11-27 Akim Demaille <akim@epita.fr>
16429
16430 * src/system.h: Use intl/libgettext.h.
16431 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
16432
16433 2001-11-27 Akim Demaille <akim@epita.fr>
16434
16435 * tests/torture.at (Exploding the Stack Size with Malloc):
16436 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
16437
16438 2001-11-27 Akim Demaille <akim@epita.fr>
16439
16440 * src/files.c: Include error.h.
16441 Reported by Hans Aberg.
16442
16443 2001-11-26 Marc Autret <autret_m@epita.fr>
16444
16445 * src/reader.c (parse_include_decl): New, not yet implemented.
16446 (read_declarations): Add case tok_include.
16447 * src/getargs.h (include): Add its extern definition.
16448 * src/getargs.c (include): New const char *.
16449 (getargs): Add case '-I'.
16450 * src/options.c (option_table): Add include as command line and
16451 percent option.
16452 * src/lex.h (token_t): Add tok_include.
16453
16454 2001-11-26 Akim Demaille <akim@epita.fr>
16455
16456 * src/reader.c (readgram): Make sure rules for mid-rule actions
16457 have a lineno equal to that of their host rule.
16458 Reported by Hans Aberg.
16459 * tests/regression.at (Rule Line Numbers): New.
16460
16461 2001-11-26 Akim Demaille <akim@epita.fr>
16462
16463 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
16464 size_ts.
16465
16466 2001-11-26 Akim Demaille <akim@epita.fr>
16467
16468 * src/complain.c, src/complain.h (error): Remove, provided by
16469 lib/error.[ch].
16470
16471 2001-11-26 Akim Demaille <akim@epita.fr>
16472
16473 * src/reader.c (read_declarations): Don't abort on tok_illegal,
16474 issue an error message.
16475 * tests/regression.at (Invalid %directive): New.
16476 Reported by Hans Aberg.
16477
16478 2001-11-26 Akim Demaille <akim@epita.fr>
16479
16480 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
16481 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16482
16483 2001-11-26 Akim Demaille <akim@epita.fr>
16484
16485 * src/conflicts.c (conflicts_print): Don't complain at all when
16486 there are no reduce/reduce conflicts, and as many shift/reduce
16487 conflicts as expected.
16488 * tests/regression.at (%expect right): Adjust.
16489
16490 2001-11-23 Akim Demaille <akim@epita.fr>
16491
16492 * lib/alloca.c: Update, from fileutils.
16493
16494 2001-11-23 Akim Demaille <akim@epita.fr>
16495
16496 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
16497
16498 2001-11-23 Akim Demaille <akim@epita.fr>
16499
16500 * src/system.h: Include alloca.h.
16501 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
16502
16503 2001-11-23 Akim Demaille <akim@epita.fr>
16504
16505 * src/print_graph.c (print_actions): Remove `rule', unused.
16506 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
16507 pacify GCC's signed < unsigned warnings.
16508 * src/closure.c (itemsetsize): Likewise.
16509 * src/reader.c (symbol_list_new): Static.
16510
16511 2001-11-23 Akim Demaille <akim@epita.fr>
16512
16513 Attaching lineno to buckets is stupid, since only one copy of each
16514 symbol is kept, only the line of the first occurrence is kept too.
16515
16516 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
16517 * src/reader.c (rline_allocated): Remove, unused.
16518 (symbol_list): Have a `line' member.
16519 (symbol_list_new): New.
16520 (readgram): Use it.
16521 * src/print.c (print_grammar): Output the rule line numbers.
16522 * tests/regression.at (Solved SR Conflicts)
16523 (Unresolved SR Conflicts): Adjust.
16524 Reported by Hans Aberg.
16525
16526 2001-11-22 Marc Autret <autret_m@epita.fr>
16527
16528 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
16529
16530 2001-11-22 Marc Autret <autret_m@epita.fr>
16531
16532 * src/muscle_tab.c (muscle_init): Remove initialization of
16533 skeleton muscle.
16534 * src/output.c (output_master_parser): Do it here.
16535
16536 2001-11-20 Akim Demaille <akim@epita.fr>
16537
16538 * po/sv.po: New.
16539 * configure.in (ALL_LINGUAS): Adjust.
16540 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
16541 longer contains strings to translate.
16542
16543 2001-11-19 Akim Demaille <akim@epita.fr>
16544
16545 * src/conflicts.c (conflicts_print): Add a missing \n.
16546
16547 2001-11-19 Akim Demaille <akim@epita.fr>
16548
16549 * src/nullable.c (nullable_print): New.
16550 (set_nullable): Call it when tracing.
16551 Better locality of variables.
16552
16553 2001-11-19 Akim Demaille <akim@epita.fr>
16554
16555 * src/print.c (print_actions): Better locality of variables.
16556
16557 2001-11-19 Akim Demaille <akim@epita.fr>
16558
16559 * src/derives.c (print_derives): Fix and enrich.
16560 * src/closure.c (print_fderives): Likewise.
16561
16562 2001-11-19 Akim Demaille <akim@epita.fr>
16563
16564 * src/closure.c (itemsetend): Remove, replaced with...
16565 (itemsetsize): new.
16566
16567 2001-11-19 Akim Demaille <akim@epita.fr>
16568
16569 * src/LR0.c (kernel_end): Remove, replaced with...
16570 (kernel_size): new.
16571
16572 2001-11-19 Akim Demaille <akim@epita.fr>
16573
16574 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
16575 to clarify.
16576
16577 2001-11-19 Akim Demaille <akim@epita.fr>
16578
16579 * src/closure.c (closure): Use arrays instead of pointers to clarify.
16580
16581 2001-11-19 Akim Demaille <akim@epita.fr>
16582
16583 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
16584 trace messages.
16585 * src/LR0.c: Likewise.
16586 (allocate_itemsets): Use arrays instead of pointers to clarify.
16587
16588 2001-11-19 Akim Demaille <akim@epita.fr>
16589
16590 * src/getargs.c (statistics_flag): Replace with...
16591 (trace_flag): New.
16592 (longopts): Accept --trace instead of --statistics.
16593 * src/getargs.h, src/options.c: Adjust.
16594 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
16595 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
16596
16597 2001-11-19 Akim Demaille <akim@epita.fr>
16598
16599 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
16600 pointers to clarify the code.
16601 (save_reductions, save_shifts): Factor common parts of alternatives.
16602
16603 2001-11-19 Akim Demaille <akim@epita.fr>
16604
16605 * src/LR0.c (new_state, get_state): Complete TRACE code.
16606 * src/closure.c: Include `reader.h' to get `tags', needed by the
16607 trace code.
16608 Rename the conditional DEBUG as TRACE.
16609 Output consistently TRACEs to stderr, not stdout.
16610 * src/derives.c: Likewise.
16611 * src/reduce.c: (inaccessable_symbols): Using if is better style
16612 than goto.
16613 Use `#if TRACE' instead of `#if 0' for tracing code.
16614
16615 2001-11-19 Akim Demaille <akim@epita.fr>
16616
16617 * src/system.h (LIST_FREE, shortcpy): New.
16618 * src/LR0.c: Use them.
16619 * src/output.c (free_itemsets, free_reductions, free_shifts):
16620 Remove, replaced by LIST_FREE.
16621
16622 2001-11-19 Akim Demaille <akim@epita.fr>
16623
16624 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
16625 (REDUCTIONS_ALLOC): New.
16626 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
16627 allocation.
16628
16629 2001-11-19 Akim Demaille <akim@epita.fr>
16630
16631 * src/LR0.c (new_state): Complete trace code.
16632 * src/nullable.c (set_nullable): Don't translate traces.
16633
16634 2001-11-19 Akim Demaille <akim@epita.fr>
16635
16636 * src/print_graph.c (print_core): Better locality of variables.
16637 * src/print.c (print_core): Likewise.
16638
16639 2001-11-19 Akim Demaille <akim@epita.fr>
16640
16641 * src/vcg.c: You do the output, so you are responsible of the
16642 handling of VCG syntax, in particular: use quotearg.
16643 * src/print_graph.c: Don't.
16644 (print_actions): Don't output the actions as part of the nodes,
16645 since that's the job of the edges.
16646 (print_state): Don't output by hand: fill the node description,
16647 and ask for its output.
16648
16649 2001-11-19 Akim Demaille <akim@epita.fr>
16650
16651 * src/bison.simple (yyparse): When verbosely reporting an error,
16652 no longer put additional quotes around token names.
16653 * tests/calc.at: Adjust.
16654
16655 2001-11-19 Akim Demaille <akim@epita.fr>
16656
16657 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
16658 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
16659 * src/output.c: Adjust.
16660
16661 2001-11-19 Akim Demaille <akim@epita.fr>
16662
16663 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
16664 (rule_t): this.
16665 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
16666
16667 2001-11-19 Akim Demaille <akim@epita.fr>
16668
16669 * src/gram.h (rule_t): New.
16670 (rule_table): New.
16671 (rrhs, rlhs): Remove, part of state_t.
16672 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
16673 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
16674 * src/reader.c, src/reduce.c: Adjust.
16675
16676 2001-11-19 Akim Demaille <akim@epita.fr>
16677
16678 * src/reader.c (symbols_output): New, extracted from...
16679 (packsymbols): Here.
16680 (reader): Call it.
16681
16682 2001-11-19 Akim Demaille <akim@epita.fr>
16683
16684 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
16685 (maxrhs): this new function.
16686
16687 2001-11-19 Akim Demaille <akim@epita.fr>
16688
16689 * src/lalr.c (F): New macro to access the variable F.
16690 Adjust.
16691
16692 2001-11-19 Akim Demaille <akim@epita.fr>
16693
16694 * src/lalr.h (LA): New macro to access the variable LA.
16695 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16696 * src/lalr.c: Adjust.
16697
16698 2001-11-19 Akim Demaille <akim@epita.fr>
16699
16700 * src/lalr.c (initialize_LA): Only initialize LA. Let...
16701 (set_state_table): handle the `lookaheads' members.
16702
16703 2001-11-19 Akim Demaille <akim@epita.fr>
16704
16705 * src/lalr.h (lookaheads): Removed array, whose contents is now
16706 a member of...
16707 (state_t): this structure.
16708 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16709 Adjust.
16710
16711 2001-11-19 Akim Demaille <akim@epita.fr>
16712
16713 * src/lalr.h (consistent): Removed array, whose contents is now
16714 a member of...
16715 (state_t): this structure.
16716 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16717 Adjust.
16718
16719 2001-11-19 Akim Demaille <akim@epita.fr>
16720
16721 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
16722 contents are now members of...
16723 (state_t): this structure.
16724 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
16725 Adjust.
16726
16727 2001-11-19 Akim Demaille <akim@epita.fr>
16728
16729 * src/lalr.h (state_t): New.
16730 (state_table): Be a state_t * instead of a core **.
16731 (accessing_symbol): Remove, part of state_t.
16732 * src/lalr.c: Adjust.
16733 (set_accessing_symbol): Merge into...
16734 (set_state_table): this.
16735 * src/print_graph.c, src/conflicts.c: Adjust.
16736
16737 2001-11-14 Akim Demaille <akim@epita.fr>
16738
16739 * tests/calc.at, tests/output.at, tests/regression.at,
16740 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
16741 now the tests are run in private dirs, therefore AC_CLEANUP and
16742 family can be simplified to 0-ary.
16743 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
16744 use abs. path to find config.h.
16745 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
16746 stderr, there can be way too much random noise.
16747 Instead pass -Werror to GCC and rely on the exit status.
16748 Reported by Wolfram Wagner.
16749
16750 2001-11-14 Akim Demaille <akim@epita.fr>
16751
16752 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
16753 defined only if yyoverflow is defined, to avoid `warning: unused
16754 variable `yyvs1''.
16755 Reported by The Test Suite.
16756
16757 2001-11-14 Akim Demaille <akim@epita.fr>
16758
16759 * src/print.c: Include reduce.h.
16760 Reported by Hans Aberg.
16761
16762 2001-11-14 Akim Demaille <akim@epita.fr>
16763
16764 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
16765 Revert a previous patch: these are really const.
16766 * src/conflicts.c (conflict_report): Additional useless pair of
16767 braces to pacify GCC's warnings for `if () if () {} else {}'.
16768 * src/lex.c (parse_percent_token): Replace equal_offset with
16769 arg_offset.
16770 arg is const.
16771 Be sure to strdup `arg' when used, since there is no reason for
16772 token_buffer not to change.
16773
16774 2001-11-14 Akim Demaille <akim@epita.fr>
16775
16776 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
16777 definition.
16778 * src/main.c (main): Use them.
16779 Suggested by Hans Aberg.
16780
16781 2001-11-12 Akim Demaille <akim@epita.fr>
16782
16783 * src/system.h (ngettext): Now that we use ngettext, be sure to
16784 provide a default definition when NLS are not used.
16785
16786 2001-11-12 Akim Demaille <akim@epita.fr>
16787
16788 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
16789 Use @kbd to denote user input.
16790 (Language and Grammar): ANSIfy the example.
16791 Adjust its layout for info/notinfo.
16792 (Location Tracking Calc): Output error messages to stderr.
16793 Output locations in a more GNUtically correct way.
16794 Fix a couple of Englishos.
16795 Adjust @group/@end group pairs.
16796
16797 2001-11-12 Akim Demaille <akim@epita.fr>
16798
16799 %expect was not functioning at all.
16800
16801 * src/conflicts.c (expected_conflicts): Set to -1.
16802 (conflict_report): Use ngettext.
16803 (conflicts_print): Check %expect and make its violation an error.
16804 * doc/bison.texinfo (Expect Decl): Adjust.
16805 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
16806 * tests/regression.at (%expect not enough, %expect right)
16807 (%expect too much): New.
16808
16809 2001-11-12 Akim Demaille <akim@epita.fr>
16810
16811 * tests/regression.at (Conflicts): Rename as...
16812 (Unresolved SR Conflicts): this.
16813 (Solved SR Conflicts): New.
16814
16815 2001-11-12 Akim Demaille <akim@epita.fr>
16816
16817 * src/reduce.c (print_results): Rename as...
16818 (reduce_output): This.
16819 Output to OUT, passed as argument, instead of output_obstack.
16820 (dump_grammar): Likewise.
16821 (reduce_free): New.
16822 Also free V1.
16823 (reduce_grammar): No longer call reduce_output, since...
16824 * src/print.c (print_results): do it.
16825 * src/main.c (main): Call reduce_free;
16826
16827 2001-11-12 Akim Demaille <akim@epita.fr>
16828
16829 * src/conflicts.c (print_reductions): Accept OUT as argument.
16830 Output to it, not to output_obstack.
16831 * src/print.c (print_actions): Adjust.
16832
16833 2001-11-12 Akim Demaille <akim@epita.fr>
16834
16835 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
16836 the result instead of using...
16837 (src_total, rrc_total, src_count, rrc_count): Remove.
16838 (any_conflicts): Remove.
16839 (print_conflicts): Split into...
16840 (conflicts_print, conflicts_output): New.
16841 * src/conflicts.h: Adjust.
16842 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
16843 * src/print.c (print_grammar): Issue `\n' between two rules.
16844 * tests/regression.at (Conflicts): New.
16845 Reported by Tom Lane.
16846
16847 2001-11-12 Akim Demaille <akim@epita.fr>
16848
16849 * tests/regression.at (Invalid input): Remove, duplicate with
16850 ``Invalid input: 1''.
16851
16852 2001-11-12 Akim Demaille <akim@epita.fr>
16853
16854 * tests/torture.at (AT_DATA_STACK_TORTURE)
16855 (Exploding the Stack Size with Alloca)
16856 (Exploding the Stack Size with Malloc): New.
16857
16858 2001-11-12 Akim Demaille <akim@epita.fr>
16859
16860 * src/bison.simple (YYSTACK_REALLOC): New.
16861 (yyparse) [!yyoverflow]: Use it and free the old stack.
16862 Reported by Per Allansson.
16863
16864 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
16865
16866 * src/bison.simple: Define type yystype instead of YYSTYPE, and
16867 define CPP macro, which substitute YYSTYPE by yystype.
16868 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
16869 with yyltype/YYLTYPE. This allows inclusion of the generated
16870 header within the parser if the compiler, such as GGC, accepts
16871 multiple equivalent #defines.
16872 From Akim.
16873
16874 2001-11-05 Akim Demaille <akim@epita.fr>
16875
16876 * src/reader.c (symbols_output): New, extracted from...
16877 (packsymbols): here.
16878 (reader): Adjust.
16879
16880 2001-11-05 Akim Demaille <akim@epita.fr>
16881
16882 * src/lex.c (parse_percent_token): s/quotearg/quote/.
16883
16884 2001-11-05 Akim Demaille <akim@epita.fr>
16885
16886 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
16887 pattern.
16888
16889 2001-11-05 Akim Demaille <akim@epita.fr>
16890
16891 * src/options.h (struct option_table_struct): set_flags is void*.
16892 * src/options.c (longopts): Support `--output' and `%output'.
16893 (usage): Adjust.
16894 * src/lex.h (tok_setopt): Remove, replaced with...
16895 (tok_intopt, tok_stropt): these new guys.
16896 * src/lex.c (getopt.h): Not needed.
16897 (token_buffer, unlexed_token_buffer): Not const.
16898 (percent_table): Promote `-' over `_' in directive names.
16899 Active `%name-prefix', `file-prefix', and `output'.
16900 (parse_percent_token): Accept possible arguments to directives.
16901 Promote `-' over `_' in directive names.
16902
16903 2001-11-04 Akim Demaille <akim@epita.fr>
16904
16905 * doc/bison.texinfo (Decl Summary): Split the list into
16906 `directives for grammars' and `directives for bison'.
16907 Sort'em.
16908 Add description of `%name-prefix', `file-prefix', and `output'.
16909 Promote `-' over `_' in directive names.
16910 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
16911 Simplify the description of `--name-prefix'.
16912 Promote `-' over `_' in directive names.
16913 Promote `--output' over `--output-file'.
16914 Fix the description of `--defines'.
16915 * tests/output.at: Exercise %file-prefix and %output.
16916
16917 2001-11-02 Akim Demaille <akim@epita.fr>
16918
16919 * doc/refcard.tex: Update.
16920
16921 2001-11-02 Akim Demaille <akim@epita.fr>
16922
16923 * src/symtab.h (SUNDEF): New.
16924 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
16925 stand for `uninitialized', instead of 0.
16926 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
16927 * src/lex.c (lex): Adjust.
16928
16929 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
16930 Number it 0.
16931 Let yylex return it instead of a plain 0.
16932 Reported by Dick Streefland.
16933
16934 2001-11-02 Akim Demaille <akim@epita.fr>
16935
16936 * tests/regression.at (Mixing %token styles): New test.
16937
16938 2001-11-02 Akim Demaille <akim@epita.fr>
16939
16940 * src/reader.c (parse_thong_decl): Formatting changes.
16941 (token_translations_init): New, extracted from...
16942 (packsymbols): Here.
16943 Adjust.
16944
16945 2001-11-01 Akim Demaille <akim@epita.fr>
16946
16947 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
16948 Check that `9foo.y' produces correct cpp guards.
16949 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
16950 guards.
16951 Reported by Wwp.
16952
16953 2001-11-01 Akim Demaille <akim@epita.fr>
16954
16955 * tests/regression.at (Invalid input: 2): New.
16956 * src/lex.c (unlexed_token_buffer): New.
16957 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
16958 too.
16959 Reported by Wwp.
16960
16961 2001-11-01 Akim Demaille <akim@epita.fr>
16962
16963 * tests/calc.at: Catch up with 1.30.
16964 * configure.in: Bump to 1.49a.
16965 Adjust to newer Autotest.
16966
16967 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
16968
16969 * src/conflicts.c: Move global variables rrc_total and src_total ...
16970 (print_conflicts): here.
16971 * src/output.c (output): Free global variable user_toknums.
16972 * src/lex.c (token_obstack): Become static.
16973
16974 2001-10-18 Akim Demaille <akim@epita.fr>
16975
16976 * tests/atlocal.in (GCC): Add.
16977 * tests/calc.at: s/m4_match/m4_bmatch/.
16978 s/m4_patsubst/m4_bpatsubst/.
16979 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
16980 * configure.in: AC_SUBST(GCC).
16981
16982 2001-10-14 Marc Autret <autret_m@epita.fr>
16983
16984 * src/options.c (create_long_option_table): Fix.
16985
16986 2001-10-10 Akim Demaille <akim@epita.fr>
16987
16988 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
16989
16990 2001-10-04 Akim Demaille <akim@epita.fr>
16991
16992 * src/reader.c (parse_union_decl): Push the caracters in
16993 union_obstack, not attrs_obstack.
16994
16995 2001-10-04 Akim Demaille <akim@epita.fr>
16996
16997 Merge in the branch 1.29.
16998
16999 * src/reader.c (packsymbols): Use a temporary obstack for
17000 `%%tokendef', since output_stack is already used elsewhere.
17001
17002 2001-10-02 Akim Demaille <akim@epita.fr>
17003
17004 Bump 1.29d.
17005
17006 2001-10-02 Akim Demaille <akim@epita.fr>
17007
17008 Version 1.29c.
17009
17010 2001-10-02 Akim Demaille <akim@epita.fr>
17011
17012 * tests/regression.at (Invalid CPP headers): New.
17013 From Alexander Belopolsky.
17014 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
17015
17016 2001-10-02 Akim Demaille <akim@epita.fr>
17017
17018 * tests/regression.at (Invalid input): New.
17019 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
17020 Reported by Shura.
17021
17022 2001-10-02 Akim Demaille <akim@epita.fr>
17023
17024 * tests/calc.at: Now that --debug works, the tests must be adjusted.
17025
17026 2001-10-02 Akim Demaille <akim@epita.fr>
17027
17028 * src/output.c (output_parser): Assert `skeleton'.
17029 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
17030 systems.
17031 From Shura.
17032
17033 2001-10-01 Marc Autret <autret_m@epita.fr>
17034
17035 * src/lex.h: Echo modifications.
17036 * src/lex.c (unlex): Parameter is now token_t.
17037 From Hans Aberg.
17038
17039 2001-10-01 Marc Autret <autret_m@epita.fr>
17040
17041 * src/main.c: Include lex.h.
17042 From Hans Aberg.
17043
17044 2001-09-29 Akim Demaille <akim@epita.fr>
17045
17046 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
17047
17048 2001-09-28 Akim Demaille <akim@epita.fr>
17049
17050 * tests/testsuite.at: Update to newer Autotest.
17051 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
17052
17053 2001-09-27 Akim Demaille <akim@epita.fr>
17054
17055 Position independent wrapper.
17056
17057 * tests/bison: Remove.
17058 * tests/bison.in: New.
17059 * configure.in: Adjust.
17060
17061 2001-09-27 Paul Eggert <eggert@twinsun.com>
17062
17063 Port quotearg fixes from tar 1.13.24.
17064
17065 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
17066 tm to be declared.
17067 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
17068 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
17069
17070 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
17071 * m4/mbrtowc.m4: New file.
17072 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
17073 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
17074
17075 2001-09-27 Akim Demaille <akim@epita.fr>
17076
17077 Bump to 1.29c.
17078
17079 2001-09-27 Akim Demaille <akim@epita.fr>
17080
17081 Version 1.29b.
17082
17083 2001-09-25 Akim Demaille <akim@epita.fr>
17084
17085 * src/system.h: Include `xalloc.h'.
17086 Remove it from the C files.
17087 * src/files.c (output_files): Free the obstacks.
17088 * src/lex.c (init_lex): Rename as...
17089 (lex_init): this.
17090 (lex_free): New.
17091 * src/main.c (main): Use it.
17092
17093 2001-09-24 Marc Autret <autret_m@epita.fr>
17094
17095 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
17096 to output informations in fout (FILE*).
17097 (open_graph, close_graph): Likewise.
17098 (output_graph, output_edge, output_node): Likewise.
17099 * src/vcg.h: Update function prototypes.
17100 * src/print_graph.c (print_graph): Open output graph file.
17101 (print_actions): Adjust.
17102 * src/files.h: Remove extern declaration.
17103 * src/files.c: Remove graph_obstack declaration.
17104 (open_files): Remove graph_obstack initialization.
17105 (output_files): Remove graph_obstack saving.
17106
17107 2001-09-24 Marc Autret <autret_m@epita.fr>
17108
17109 * src/files.c (compute_output_file_names): Fix.
17110
17111 2001-09-24 Marc Autret <autret_m@epita.fr>,
17112 Akim Demaille <akim@epita.fr>
17113
17114 * src/reader.c (reader): Remove call to free_symtab ().
17115 * src/main.c (main): Call it here.
17116 Include symtab.h.
17117 * src/conflicts.c (initialize_conflicts): Rename as...
17118 (solve_conflicts): this.
17119 * src/print.c (print_core, print_actions, print_state)
17120 (print_grammar): Dump to a file instead a `output_obstack'.
17121 (print_results): Dump `output_obstack', and then proceed with the
17122 FILE *.
17123 * src/files.c (compute_output_file_names, close_files): New.
17124 (output_files): Adjust.
17125 * src/main.c (main): Adjust.
17126
17127 2001-09-23 Marc Autret <autret_m@epita.fr>
17128
17129 * src/files.c (compute_header_macro): Computes header macro name
17130 from spec_defines_file when given.
17131
17132 2001-09-23 Marc Autret <autret_m@epita.fr>
17133
17134 * src/files.c (output_files): Add default extensions.
17135
17136 2001-09-22 Akim Demaille <akim@epita.fr>
17137
17138 * src/conflicts.c (finalize_conflicts): Rename as...
17139 (free_conflicts): this.
17140
17141 2001-09-22 Akim Demaille <akim@epita.fr>
17142
17143 * src/gram.c (gram_free): Rename back as...
17144 (dummy): this.
17145 (output_token_translations): Free `token_translations'.
17146 * src/symtab.c (free_symtab): Free the tag field.
17147
17148 2001-09-22 Akim Demaille <akim@epita.fr>
17149
17150 Remove `translations' as it is always set to true.
17151
17152 * src/gram.h: Adjust.
17153 * src/reader.c (packsymbols, parse_token_decl): Adjust
17154 * src/print.c (print_grammar): Adjust.
17155 * src/output.c (output_token_translations): Adjust.
17156 * src/lex.c (lex): Adjust.
17157 * src/gram.c: Be sure the set pointers to NULL.
17158 (dummy): Rename as...
17159 (gram_free): this.
17160
17161 2001-09-22 Akim Demaille <akim@epita.fr>
17162
17163 * configure.in: Invoke AM_LIB_DMALLOC.
17164 * src/system.h: Use dmalloc.
17165 * src/LR0.c: Be sure to have pointers initialized to NULL.
17166 (allocate_itemsets): Allocate kernel_items only if needed.
17167
17168 2001-09-22 Akim Demaille <akim@epita.fr>
17169
17170 * configure.in: Bump to 1.29b.
17171 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
17172 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
17173 need xmalloc.c in calc.y.
17174 From Pascal Bart.
17175
17176 2001-09-21 Akim Demaille <akim@epita.fr>
17177
17178 Version 1.29a.
17179 * Makefile.maint, config/config.guess, config/config.sub,
17180 * config/missing: Update from masters.
17181 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
17182 upon package.m4.
17183 * configure.in (ALL_LINGUAS): Add `tr'.
17184
17185 2001-09-21 Akim Demaille <akim@epita.fr>
17186
17187 * tests/Makefile.am (package.m4): Move to...
17188 ($(srcdir)/$(TESTSUITE)): here.
17189
17190 2001-09-20 Akim Demaille <akim@epita.fr>
17191
17192 * src/complain.c: No longer try to be standalone: use system.h.
17193 Don't assume __STDC__ is defined to 1. Just test if it is defined.
17194 * src/complain.h: Likewise.
17195 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
17196 Remove the unused variable `n'.
17197 From Albert Chin-A-Young.
17198
17199 2001-09-18 Marc Autret <autret_m@epita.fr>
17200
17201 * doc/bison.1: Update.
17202 * doc/bison.texinfo (Bison Options): Update --defines and --graph
17203 descriptions.
17204 (Option Cross Key): Update.
17205 Add --graph.
17206
17207 2001-09-18 Marc Autret <autret_m@epita.fr>
17208
17209 * tests/regression.at: New test (comment in %union).
17210
17211 2001-09-18 Marc Autret <autret_m@epita.fr>
17212
17213 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
17214 do that.
17215 Reported by Keith Browne.
17216
17217 2001-09-18 Marc Autret <autret_m@epita.fr>
17218
17219 * tests/output.at: Add tests for --defines and --graph.
17220
17221 2001-09-18 Marc Autret <autret_m@epita.fr>
17222
17223 * tests/output.at: Removes tests of %{header,src}_extension features.
17224
17225 2001-09-18 Akim Demaille <akim@epita.fr>
17226
17227 * tests/Makefile.am (package.m4): New.
17228 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
17229 (_AT_CHECK_CALC_ERROR): Likewise.
17230 Factor the `, ' part of verbose error messages.
17231
17232 2001-09-18 Marc Autret <autret_m@epita.fr>
17233
17234 * src/getargs.c (longopts): Declare --defines and --graph as options
17235 with optional arguments.
17236 * src/files.h: Add extern declarations.
17237 * src/files.c (spec_graph_file, spec_defines_file): New.
17238 (output_files): Update.
17239 Remove CPP-outed code.
17240
17241 2001-09-18 Marc Autret <autret_m@epita.fr>
17242
17243 Turn off %{source,header}_extension feature.
17244
17245 * src/files.c (compute_exts_from_gf): Update.
17246 (compute_exts_from_src): Update.
17247 (output_files): CPP-out useless code.
17248 * src/files.h: Remove {header,source}_extension extern declarations.
17249 * src/reader.c (parse_dquoted_param): CPP-out.
17250 (parse_header_extension_decl): Remove.
17251 (parse_source_extension_decl): Remove.
17252 (read_declarations): Remove cases tok_{hdrext,srcext}.
17253 * src/lex.c (percent_table): Remove {header,source}_extension entries.
17254 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
17255
17256 2001-09-10 Akim Demaille <akim@epita.fr>
17257
17258 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
17259 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
17260 (AT_CHECK_OUTPUT): this.
17261 Merely check ls' exit status, its output is useless.
17262
17263 2001-09-10 Akim Demaille <akim@epita.fr>
17264
17265 * tests/calc.at: Use m4_match.
17266 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
17267
17268 2001-09-10 Marc Autret <autret_m@epita.fr>,
17269 Akim Demaille <akim@epita.fr>
17270
17271 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
17272 enum color_e.
17273 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
17274 to `normal'.
17275 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
17276 * src/lex.h: Adjust prototype.
17277 (token_t): Add `tok_undef'.
17278 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
17279 (parse_percent_token): Now returns token_t.
17280 Add default statement in switch.
17281 (lex): Separate `c' as an input variable, from the token_t result
17282 part.
17283 (unlexed): Is a token_t.
17284
17285 2001-09-10 Akim Demaille <akim@epita.fr>
17286
17287 * configure.in: Bump to 1.29a.
17288
17289 2001-09-07 Akim Demaille <akim@epita.fr>
17290
17291 Version 1.29.
17292
17293 2001-08-30 Akim Demaille <akim@epita.fr>
17294
17295 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
17296 * m4/atconfig.m4: Remove.
17297 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
17298 * tests/bison: New.
17299 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
17300 m4_if, m4_patsubst, and m4_regexp.
17301 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
17302 `input' file instead of echo.
17303
17304 2001-08-29 Akim Demaille <akim@epita.fr>
17305
17306 Bump to 1.28e.
17307
17308 2001-08-29 Akim Demaille <akim@epita.fr>
17309
17310 Version 1.28d.
17311
17312 2001-08-29 Paul Eggert <eggert@twinsun.com>
17313
17314 * src/bison.simple (yyparse): Don't take the address of an
17315 item before the start of an array, as that doesn't conform to
17316 the C Standard.
17317
17318 2001-08-29 Robert Anisko <anisko_r@epita.fr>
17319
17320 * doc/bison.texinfo (Location Tracking Calc): New node.
17321
17322 2001-08-29 Paul Eggert <eggert@twinsun.com>
17323
17324 * src/output.c (output): Do not define const, as this now
17325 causes more problems than it cures.
17326
17327 2001-08-29 Akim Demaille <akim@epita.fr>
17328
17329 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
17330 the nodes.
17331 Be sure to tag the `detailmenu'.
17332
17333 2001-08-29 Akim Demaille <akim@epita.fr>
17334
17335 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
17336 download in a tmp dir.
17337
17338 2001-08-28 Marc Autret <autret_m@epita.fr>
17339
17340 * config/depcomp: New file.
17341
17342 2001-08-28 Marc Autret <autret_m@epita.fr>
17343
17344 * doc/bison.1 (mandoc): Adjust.
17345 From Juan Manuel Guerrero.
17346
17347 2001-08-28 Marc Autret <autret_m@epita.fr>
17348
17349 * src/print_graph.c (print_state): Fix.
17350
17351 2001-08-27 Marc Autret <autret_m@epita.fr>
17352
17353 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
17354 char * members.
17355 Echo modifications to the functions prototypes.
17356 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
17357
17358 2001-08-27 Marc Autret <autret_m@epita.fr>
17359
17360 * src/vcg.c: Include `xalloc.h'.
17361 (add_colorentry): New.
17362 (add_classname): New.
17363 (add_infoname): New.
17364 * src/vcg.h: Add new prototypes.
17365
17366 2001-08-27 Akim Demaille <akim@epita.fr>
17367
17368 * Makefile.maint: Sync. again with CVS Autoconf.
17369
17370 2001-08-27 Akim Demaille <akim@epita.fr>
17371
17372 * Makefile.maint: Formatting changes.
17373 (po-update, cvs-update, update): New targets.
17374 (AMTAR): Remove.
17375
17376 2001-08-27 Akim Demaille <akim@epita.fr>
17377
17378 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17379 * Makefile.maint: Sync. with CVS Autoconf.
17380
17381 2001-08-27 Marc Autret <autret_m@epita.fr>
17382
17383 * src/vcg.h (struct infoname_s): New.
17384 (struct colorentry_s): New.
17385 (graph_s): New fields {vertical,horizontal}_order in structure.
17386 Add `infoname' field.
17387 Add `colorentry' field;
17388 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
17389 (G_HORIZONTAL_ORDER): New.
17390 (G_INFONAME): New.
17391 (G_COLORENTRY): New.
17392 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
17393 Add output of `infoname'.
17394 Add output of `colorentry'.
17395
17396 2001-08-27 Marc Autret <autret_m@epita.fr>
17397
17398 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
17399 This one shadowed a global parameter.
17400
17401 2001-08-24 Marc Autret <autret_m@epita.fr>
17402
17403 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
17404 instead of `unsigned'.
17405 (print_state): Do not call obstack_object_size () in obstack_grow ()
17406 to avoid macro variables shadowing.
17407
17408 2001-08-23 Marc Autret <autret_m@epita.fr>
17409
17410 * src/lex.c (percent_table): Typo: s/naem/name/.
17411 Add graph option.
17412 Normalize new options declarations.
17413
17414 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
17415
17416 * tests/suite.at: Exercise %header_extension and %source_extension.
17417
17418 2001-08-16 Marc Autret <autret_m@epita.fr>
17419
17420 * src/reader.c (parse_dquoted_param): New.
17421 (parse_header_extension_decl): Use it.
17422 (parse_source_extension_decl): Likewise.
17423
17424 2001-08-16 Marc Autret <autret_m@epita.fr>
17425
17426 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
17427 (get_xxxx_str): Use assert () instead of complain ().
17428 Remove return invokations in default cases.
17429 (get_decision_str): Modify default behaviour. Remove second argument.
17430 Echo modifications on calls.
17431 (output_graph): Fix.
17432
17433 2001-08-16 Marc Autret <autret_m@epita.fr>
17434
17435 * src/getargs.c (usage): Update with ``-g, --graph''.
17436
17437 2001-08-16 Marc Autret <autret_m@epita.fr>
17438
17439 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
17440 (Option Cross Key): Likewise.
17441 * doc/bison.1: Update.
17442
17443 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
17444
17445 * src/output.c (output_master_parser): Don't finish action_obstack.
17446 (output_parser): Don't care about the muscle action, here.
17447 (prepare): Copy the action_obstack in the action muscle.
17448 (output): Free action_obstack.
17449
17450 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
17451
17452 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
17453 will contain `%union' declaration.
17454 (parse_union_decl): Delete #line directive output.
17455 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
17456 informations about %union.
17457 (parse_union_decl): Copy the union_obstack in the muscle stype.
17458 * src/bison.simple: Add new #line directive.
17459 Add typdef %%stype YYSTYPE.
17460
17461 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
17462
17463 * src/bison.simple: Add new `#line' directive.
17464
17465 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
17466
17467 * src/bison.simple: New `#line' directive.
17468 * src/output.c (output_parser): Support new dynamic muscle input_line.
17469
17470 2001-09-22 Marc Autret <autret_m@epita.fr>
17471
17472 * src/output.c (output_master_parser): New.
17473 (output_parser): Be more re-entrant.
17474
17475 2001-09-21 Marc Autret <autret_m@epita.fr>
17476
17477 * src/reader.c (copy_definition, parse_union_decl): Update and use
17478 `linef' muscle.
17479 (copy_action): Likewise.
17480 Use obstack_1grow ().
17481 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
17482
17483 2001-09-21 Marc Autret <autret_m@epita.fr>
17484
17485 * src/options.c (option_table): Adjust.
17486 * src/lex.c (parse_percent_token): Fix.
17487
17488 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
17489
17490 * src/options.c (symtab.h): Include it, need by lex.h.
17491
17492 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
17493
17494 * src/lex.c (parse_percent_token): Change type of variable `tx', which
17495 is now an option_table_struct*.
17496 (option_strcmp): New function option_strcmp.
17497 (parse_percent_token): Call option_strcmp.
17498 * src/getargs.c (xalloc.h, options.h): Include it.
17499 (getargs): Call create_long_option_table.
17500 (getargs): Free longopts at the end of the function.
17501 (shortopts): Move in options.c.
17502 * src/options.c (create_long_option_table): New function. Convert
17503 information from option_table to option structure.
17504 * src/reader.c (options.h): Include it.
17505
17506 * src/Makefile.am: Adjust.
17507 * src/options.c (option_table): Create from longopts and percent_table.
17508 * src/getargs.c (longopts): Delete.
17509 * src/lex.c (struct percent_table_struct): Delete.
17510 (percent_table): Delete.
17511 (options.h): Include it.
17512 * src/options.c: Create.
17513 * src/options.h: Create.
17514 Declare enum opt_access_e.
17515 Define struct option_table_struct.
17516
17517 2001-09-20 Marc Autret <autret_m@epita.fr>
17518
17519 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
17520 sections of Bison.
17521
17522 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
17523
17524 * src/bison.simple: s/%%filename/%%skeleton.
17525 * src/muscle_tab.c (getargs.h): Include it.
17526 (muscle_init): Insert new muscle skeleton.
17527
17528 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
17529
17530 * src/output.c (output_parser): Delete unused variable actions_dumped.
17531
17532 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
17533
17534 * src/output.c (output): Delete call to reader_output_yylsp.
17535 * src/reader.c (reader): Likewise.
17536 * src/reader.h: Delete declaration of reader_output_yylsp.
17537
17538 2001-09-02 Marc Autret <autret_m@epita.fr>
17539
17540 * src/reader.c: Include muscle_tab.h.
17541 (parse_union_decl): Update.
17542 (parse_macro_decl): Rename parse_muscle_decl.
17543 Update to use renamed functions and variable.
17544 (read_declarations, copy_action, read_additionnal_code, : Updated
17545 with correct variables and functions names.
17546 (packsymbols, reader): Likewise.
17547
17548 * src/reader.h (muscle_obstack): Extern declaration update.
17549
17550 * src/output.c: Include muscle_tab.h
17551 In all functions using macro_insert, change by using muscle_insert ().
17552 (macro_obstack): Rename muscle_obstack.
17553 Echo modifications in the whole file.
17554 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
17555 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
17556 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
17557
17558 * src/muscle_tab.h: Update double inclusion macros.
17559 (macro_entry_s): Rename muscle_entry_s.
17560 Update prototypes.
17561
17562 * src/muscle_tab.c: Include muscle_tab.h.
17563 Rename macro_tabble to muscle_table.
17564 (mhash1, mhash2, mcmp): Use muscle_entry.
17565 (macro_init): Rename muscle_init. Update.
17566 (macro_insert): Rename muscle_insert. Update.
17567 (macro_find): Rename muscle_find. Update.
17568
17569 * src/main.c: Include muscle_tab.h.
17570 (main): Call muscle_init ().
17571 * src/Makefile.am (bison_SOURCES): Echo modifications.
17572
17573 2001-09-02 Marc Autret <autret_m@epita.fr>
17574
17575 Now the files macro_tab.[ch] are named muscle_tab.[ch].
17576
17577 * src/muscle_tab.c, src/muscle_tab.h: Add files.
17578
17579 2001-09-02 Marc Autret <autret_m@epita.fr>
17580
17581 * src/macrotab.c, src/macrotab.h: Remove.
17582
17583 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
17584
17585 * src/reader.c (copy_guard): Use muscle to specify the `#line'
17586 filename.
17587
17588 2001-09-01 Marc Autret <autret_m@epita.fr>
17589
17590 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
17591 to an explicit value to activate the feature. We do it here.
17592
17593 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17594
17595 * src/output.c (prepare): Delete the `filename' muscule insertion.
17596 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
17597 (parse_union_decl): Likewise.
17598 * src/macrotab.c (macro_init): Initialize filename by infile.
17599
17600 2001-08-31 Marc Autret <autret_m@epita.fr>
17601
17602 * src/bison.simple (YYLSP_NEEDED): New definition.
17603 * src/output.c (prepare): Add macro insertion of `locations_flag'
17604
17605 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17606
17607 * src/output.c (prepare): Delete insertion of previous muscles,
17608 and insert the `prefix' muscles.
17609 * src/macrotab.c (macro_init): Likewise.
17610 (macro_init): Initialization prefix directive by `yy'.
17611 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17612 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
17613 yylval, yydebug, yyerror, yynerrs and yyparse.
17614 New directive `#define' to substitute yydebug, ... with option
17615 name_prefix.
17616
17617 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17618
17619 * src/main.c (main): Standardize.
17620 * src/output.c (output_table_data, output_parser): Likewise.
17621 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
17622
17623 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
17624
17625 * src/reader.c (read_additionnal_code): Rename %%user_code to
17626 %%epilogue.
17627 * src/output.c (output): Rename %%declarations to %%prologue.
17628 * src/bison.simple: Echo modifications.
17629
17630 2001-08-31 Marc Autret <autret_m@epita.fr>
17631
17632 * src/reader.c (readgram): CleanUp.
17633 (output_token_defines): Likewise.
17634 (packsymbols): Likewise.
17635 (reader): Likewise.
17636 * src/output.c (output): CPP-out useless code.
17637
17638 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17639
17640 * src/reader.c (reader): Delete obsolete call to function
17641 output_trailers and output_headers.
17642 * src/output.h: Remove obsolete functions prototypes of output_headers
17643 and output_trailers.
17644
17645 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
17646
17647 * src/main.c: Include macrotab.h.
17648 * src/macrotab.h (macro_entry_s): Constify fields.
17649 Adjust functions prototypes.
17650 * src/macrotab.c (macro_insert): Constify key and value.
17651 (macro_find): Constify key.
17652 (macro_insert): Include 'xalloc.h'
17653 (macro_insert): Use XMALLOC.
17654 (macro_find): Constify return value.
17655 * src/output.c (output_table_data): Rename table to table_data.
17656 (output_parser): Constify macro_key, macro_value.
17657
17658 2001-08-30 Marc Autret <autret_m@epita.fr>
17659
17660 * src/reader.c (parse_skel_decl): New.
17661 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
17662 * src/lex.h (token_t): New token `tok_skel'.
17663 * src/lex.c (percent_table): Add skeleton option entry.
17664 Standardize.
17665
17666 2001-08-29 Marc Autret <autret_m@epita.fr>
17667
17668 * src/bison.simple: Add %%user_code directive at the end.
17669 * src/reader.c (read_additionnal_code): New.
17670 (reader): Use it.
17671 * src/output.c (output_program): Remove.
17672 (output): Update.
17673
17674 2001-08-28 Marc Autret <autret_m@epita.fr>
17675
17676 * src/output.c (output_actions): Clean up.
17677 (output_gram): CPP-out useless code.
17678 * src/reader.c (reader): Clean up, CPP-out useless code.
17679
17680 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
17681
17682 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
17683 directive.
17684 * src/bison.simple: Add `%%definitions'.
17685
17686 2001-08-28 Marc Autret <autret_m@epita.fr>
17687
17688 * config/depcomp: New file.
17689
17690 2001-08-27 Paul Eggert <eggert@twinsun.com>
17691
17692 * src/bison.simple (yyparse): Don't take the address of an
17693 item before the start of an array, as that doesn't conform to
17694 the C Standard.
17695
17696 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
17697
17698 * src/output.c (output): Remove the initialization of the macro
17699 obstack. It was done too late here.
17700
17701 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
17702 completely wrong.
17703 (reader): Initialize the macro obstack here, since we need it to grow
17704 '%define' directives.
17705
17706 * src/reader.h: Declare the macro obstack as extern.
17707
17708 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
17709
17710 * src/output.c (output_parser): Fix. Store single '%' characters in
17711 the output obstack instead of throwing them away.
17712
17713 2001-08-27 Akim Demaille <akim@epita.fr>
17714
17715 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17716
17717 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17718
17719 * lib/Makefile.am: Adjust.
17720
17721 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17722
17723 * src/bison.simple: Update and add '%%' directives.
17724
17725 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17726
17727 * src/reader.c (reader): Remove calls to 'output_headers' and
17728 'output_trailers'. Remove some C output.
17729 (readgram): Disable a piece of code that was writing a default
17730 definition for 'YYSTYPE'.
17731 (reader_output_yylsp): Remove.
17732 (packsymbols): Output token defintions to a macro.
17733 (copy_definition): Disable C output.
17734
17735 * src/reader.c (parse_macro_decl): New function used to parse macro
17736 declarations.
17737 (copy_string2): Put the body of copy_string into this new function.
17738 Add a parameter to let the caller choose whether he wants to copy the
17739 string delimiters or not.
17740 (copy_string): Be a simple call to copy_string2 with the last argument
17741 bound to true.
17742 (read_declarations): Add case for macro definition.
17743 (copy_identifier): New.
17744 (parse_macro_decl): Read macro identifiers using copy_identifier
17745 rather than lex.
17746
17747 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17748
17749 * src/output.c (prepare): Add prefixed names.
17750 (output_parser): Output semantic actions.
17751 (output_parser): Fix bug on '%%line' directives.
17752
17753 * src/output.c (output_headers): Remove. The C code printed by this
17754 function should now be in the skeletons.
17755 (output_trailers): Remove.
17756 (output): Disable call to 'reader_output_yylsp'.
17757 (output_rule_data): Do not output tables to the table obstack.
17758
17759 * src/output.c: Remove some C dedicated output.
17760 Improve the use of macro and output obstacks.
17761 (output_defines): Remove.
17762
17763 * src/output.c (output_token_translations): Associate 'translate'
17764 table with a macro. No output to the table obstack.
17765 (output_gram): Same for 'rhs' and 'prhs'.
17766 (output_stos): Same for 'stos'.
17767 (output_rule_data): Same for 'r1' and 'r2'.
17768 (token_actions): Same for 'defact'.
17769 (goto_actions): Same for 'defgoto'.
17770 (output_base): Same for 'pact' and 'pgoto'.
17771 (output_table): Same for 'table'.
17772 (output_check): Same for 'check'.
17773
17774 * src/output.c (output_table_data): New function.
17775 (output_short_table): Remove.
17776 (output_short_or_char_table): Remove.
17777
17778 * src/output.c (output_parser): Replace most of the skeleton copy code
17779 with something new. Skeletons are now processed character by character
17780 rather than line by line, and Bison looks for '%%' macros. This is the
17781 first step in making Bison's output process (a lot) more flexible.
17782 (output_parser): Use the macro table.
17783
17784 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17785
17786 * src/main.c (main): Initialize the macro table.
17787
17788 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17789
17790 * src/lex.c (percent_table): Add tok_define.
17791 * src/lex.h: Add tok_define.
17792
17793 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17794
17795 * src/macrotab.c: New file.
17796 * src/macrotab.h: New file.
17797 * src/Makefile.am: Update.
17798
17799 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
17800
17801 * lib/hash.c: New file.
17802 * lib/hash.h: New file.
17803 * lib/Makefile.am: Update.
17804
17805 2001-08-15 Akim Demaille <akim@epita.fr>
17806
17807 Version 1.28c.
17808
17809 2001-08-15 Marc Autret <autret_m@epita.fr>
17810
17811 * src/reader.c (readgram): Indent output macro YYSTYPE.
17812 (packsymbols): Likewise.
17813 (output_token_defines): Likewise.
17814 * src/files.c: Standardize.
17815 (compute_header_macro): New.
17816 (defines_obstack_save): New. Use compute_header_macro.
17817 (output_files): Update. Use defines_obstack_save.
17818
17819 2001-08-15 Akim Demaille <akim@epita.fr>
17820
17821 * doc/bison.texinfo (Table of Symbols): Document
17822 YYSTACK_USE_ALLOCA.
17823
17824 2001-08-15 Akim Demaille <akim@epita.fr>
17825
17826 * missing: Update from CVS Automake.
17827 * config/config.guess, config/config.sub, config/texinfo.tex:
17828 Update from gnu.org.
17829
17830 2001-08-15 Akim Demaille <akim@epita.fr>
17831
17832 * Makefile.maint: Sync with CVS Autoconf.
17833
17834 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
17835
17836 * doc/bison.texinfo: Include GNU Free Documentation License from
17837 `fdl.texi'.
17838 * doc/fdl.texi: Add to package.
17839
17840 2001-08-14 Marc Autret <autret_m@epita.fr>
17841
17842 Turn on %{source,header}_extension features.
17843
17844 * src/lex.c (percent_table): Un-CPP out header_extension and
17845 source_extension.
17846 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
17847 (compute_exts_from_src): Remove conditions. It restores priorities
17848 between options.
17849
17850 2001-08-14 Marc Autret <autret_m@epita.fr>
17851
17852 * src/files.c (compute_base_names): Add extensions computing when
17853 `--file-prefix' used.
17854 Standardize function calls.
17855
17856 2001-08-13 Marc Autret <autret_m@epita.fr>
17857
17858 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
17859 defining it (defined but null disables alloca).
17860
17861 2001-08-13 Marc Autret <autret_m@epita.fr>
17862
17863 * src/bison.simple (_yy_memcpy): CPP reformat.
17864
17865 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
17866
17867 * tests/atconfig.in (CPPFLAGS): Fix.
17868
17869 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
17870
17871 * doc/bison.texinfo: Include GNU General Public License from
17872 `gpl.texi'.
17873 * doc/gpl.texi: Add to package.
17874
17875 2001-08-10 Marc Autret <autret_m@epita.fr>
17876
17877 * src/print_graph.h: Fix.
17878 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
17879
17880 2001-08-10 Akim Demaille <akim@epita.fr>
17881
17882 * src/system.h: Provide default declarations for stpcpy, strndup,
17883 and strnlen.
17884
17885 2001-08-10 Robert Anisko <anisko_r@epita.fr>
17886
17887 * doc/bison.texinfo (Locations): Update @$ stuff.
17888
17889 2001-08-09 Robert Anisko <anisko_r@epita.fr>
17890
17891 * src/bison.simple (YYLLOC_DEFAULT): Update.
17892 (yyparse): Adjust.
17893
17894 2001-08-08 Marc Autret <autret_m@epita.fr>
17895
17896 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
17897 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
17898 Reported by Fabrice Bauzac.
17899
17900 2001-08-08 Marc Autret <autret_m@epita.fr>
17901
17902 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
17903 * src/vcg.c (output_node): Fix.
17904 * src/vcg.h: Cleanup.
17905 * src/print_graph.c: Add comments.
17906 (node_output_size): New global variable. Simplify the formatting of
17907 the VCG graph output.
17908 (print_actions): Unused code is now used. It notifies the final state
17909 and no action states in the VCG graph. It also give the reduce actions.
17910 The `shift and goto' edges are red and the `go to state' edges are
17911 blue.
17912 Get the current node name and node_obstack by argument.
17913 (node_obstack): New variable.
17914 (print_state): Manage node_obstack.
17915 (print_core): Use node_obstack given by argument.
17916 A node is not only computed here but in print_actions also.
17917 (print_graph): CPP out useless code instead of commenting it.
17918
17919 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
17920
17921 * tests/atconfig.in (CPPFLAGS): Fix.
17922
17923 2001-08-07 Akim Demaille <akim@epita.fr>
17924
17925 * src/print_graph.c (quote): New.
17926 (print_core): Use it.
17927
17928 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
17929
17930 * src/vcg.c (complain.h): Include it.
17931 Unepitaize `return' invocations.
17932 [NDEBUG] (main): Remove.
17933 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
17934 * src/files.c (open_files): Initialize graph_obstack.
17935 * src/print_graph.c (print_actions): CPP out useless code.
17936 (print_core): Don't output the last `\n' in labels.
17937 Use `quote'.
17938 * src/files.c (output_files): Output the VCG file.
17939 * src/main.c (main): Invoke print_graph ();
17940
17941 2001-08-06 Marc Autret <autret_m@epita.fr>
17942
17943 Automaton VCG graph output.
17944 Using option ``-g'' or long option ``--graph'', you can generate
17945 a gram_filename.vcg file containing a VCG description of the LALR (1)
17946 automaton of your grammar.
17947
17948 * src/main.c: Call to print_graph() function.
17949 * src/getargs.h: Update.
17950 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
17951 (graph_flag): New flag.
17952 (longopts): Update.
17953 (getargs): Add case `g'.
17954 * src/files.c (graph_obstack): New obstack struct.
17955 (open_files): Initialize new obstack.
17956 (output_files): Saves graph_obstack if required.
17957 * src/files.h (graph_obstack): New extern declaration.
17958 * src/Makefile.am: Add new source files.
17959
17960 2001-08-06 Marc Autret <autret_m@epita.fr>
17961
17962 * src/print_graph.c, src/print_graph.h (graph): New.
17963 * src/vcg.h: New file.
17964 * src/vcg.c: New file, VCG graph handling.
17965
17966 2001-08-06 Marc Autret <autret_m@epita.fr>
17967
17968 Add of %source_extension and %header_extension which specify
17969 the source or/and the header output file extension.
17970
17971 * src/files.c (compute_base_names): Remove initialisation of
17972 src_extension and header_extension.
17973 (compute_exts_from_gf): Update.
17974 (compute_exts_from_src): Update.
17975 (output_files): Update.
17976 * src/reader.c (parse_header_extension_decl): New.
17977 (parse_source_extension_decl): New.
17978 (read_declarations): New case statements for the new tokens.
17979 * src/lex.c (percent_table): Add entries for %source_extension
17980 and %header_extension.
17981 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
17982
17983 2001-08-06 Marc Autret <autret_m@epita.fr>
17984
17985 * configure.in: Bump to 1.28c.
17986 * doc/bison.texinfo: Texinfo thingies.
17987
17988 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
17989
17990 * tests/atconfig.in (CPPFLAGS): Add.
17991 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
17992
17993 2001-08-03 Akim Demaille <akim@epita.fr>
17994
17995 Version 1.28b.
17996
17997 2001-08-03 Akim Demaille <akim@epita.fr>
17998
17999 * tests/Makefile.am (check-local): Ship testsuite.
18000 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
18001 Include `string.h'.
18002
18003 2001-08-03 Akim Demaille <akim@epita.fr>
18004
18005 * configure.in: Try using -Wformat when compiling.
18006
18007 2001-08-03 Akim Demaille <akim@epita.fr>
18008
18009 * configure.in: Bump to 1.28b.
18010
18011 2001-08-03 Akim Demaille <akim@epita.fr>
18012
18013 * src/complain.c: Adjust strerror_r portability issues.
18014
18015 2001-08-03 Akim Demaille <akim@epita.fr>
18016
18017 Version 1.28a.
18018
18019 2001-08-03 Akim Demaille <akim@epita.fr>
18020
18021 * src/getargs.c, src/getarg.h (skeleton)): Constify.
18022 * src/lex.c (literalchar): Avoid name clashes on `buf'.
18023 * src/getargs.c: Include complain.h.
18024 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
18025 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
18026
18027 2001-08-03 Akim Demaille <akim@epita.fr>
18028
18029 * src/reader.c (readgram): Display hidden chars in error messages.
18030
18031 2001-08-03 Akim Demaille <akim@epita.fr>
18032
18033 Update to gettext 0.10.39.
18034
18035 2001-08-03 Akim Demaille <akim@epita.fr>
18036
18037 * lib/strspn.c: New.
18038
18039 2001-08-01 Marc Autret <autret_m@epita.fr>
18040
18041 * doc/bison.texinfo: Update.
18042 * doc/bison.1 (mandoc): Update.
18043 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
18044 * src/files.c: Support output files extensions computing.
18045 (src_extension): New static variable.
18046 (header_extension): New static variable.
18047 (tr): New function.
18048 (get_extension_index): New function, gets the index of an extension
18049 filename in a string.
18050 (compute_exts_from_gf): New function, computes extensions from the
18051 grammar file extension.
18052 (compute_exts_from_src): New functions, computes extensions from the
18053 C source file extension, file given by ``-o'' option.
18054 (compute_base_names): Update.
18055 (output_files): Update.
18056
18057 2001-08-01 Robert Anisko <anisko_r@epita.fr>
18058
18059 * doc/bison.texi: Document @$.
18060 (Locations): New section.
18061
18062 2001-07-18 Akim Demaille <akim@epita.fr>
18063
18064 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
18065 * config/prev-version.txt, config/move-if-change: New.
18066 * Makefile.am: Adjust.
18067
18068 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
18069
18070 * src/bison.simple (yyparse): Suppress warning `comparaison
18071 between signed and unsigned'.
18072
18073 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
18074
18075 * src/getargs.h (raw_flag): Remove.
18076 * src/getargs.c: Die on `-r'/`--raw'.
18077 * src/lex.c (parse_percent_token): Die on `%raw'.
18078 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
18079 * tests/calc.at: Suppress test with option `--raw'.
18080
18081 2001-07-14 Akim Demaille <akim@epita.fr>
18082
18083 * config/: New.
18084 * configure.in: Require Autoconf 2.50.
18085 Update to gettext 0.10.38.
18086
18087 2001-03-16 Akim Demaille <akim@epita.fr>
18088
18089 * doc/bison.texinfo: ANSIfy the examples.
18090
18091 2001-03-16 Akim Demaille <akim@epita.fr>
18092
18093 * getargs.c (skeleton): New variable.
18094 (longopts): --skeleton is a new option.
18095 (shortopts, getargs): -S is a new option.
18096 * getargs.h: Declare skeleton.
18097 * output.c (output_parser): Use it.
18098
18099 2001-03-16 Akim Demaille <akim@epita.fr>
18100
18101 * m4/strerror_r.m4: New.
18102 * m4/error.m4: Run AC_FUNC_STRERROR_R.
18103 * lib/error.h, lib/error.c: Update.
18104
18105 2001-03-16 Akim Demaille <akim@epita.fr>
18106
18107 * src/getargs.c (longopts): Clean up.
18108
18109 2001-02-21 Akim Demaille <akim@epita.fr>
18110
18111 * src/reader.c (gensym): `gensym_count' is your own.
18112 Use a static buf to create the symbol name, as token_buffer is no
18113 longer a buffer.
18114
18115 2001-02-08 Akim Demaille <akim@epita.fr>
18116
18117 * src/conflicts.c (conflict_report): Be sure not to append to res
18118 between two calls, which could happen if both first sprintf were
18119 skipped, but not the first cp += strlen.
18120
18121 2001-02-08 Akim Demaille <akim@epita.fr>
18122
18123 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
18124 New, from fileutils 4.0.37.
18125 * configure.in: Require Autoconf 2.49c. I took some time before
18126 making this decision. This is the only way out for portability
18127 issues in Bison, it would mean way too much duplicate effort to
18128 import in Bison features implemented in 2.49c since 2.13.
18129 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
18130
18131 2001-02-02 Akim Demaille <akim@epita.fr>
18132
18133 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
18134 * lib/xalloc.h, lib/xmalloc.c: Update.
18135
18136 2001-01-19 Akim Demaille <akim@epita.fr>
18137
18138 Get rid of the ad hoc handling of token_buffer in the scanner: use
18139 the obstacks.
18140
18141 * src/lex.c (token_obstack): New.
18142 (init_lex): Initialize it. No longer call...
18143 (grow_token_buffer): this. Remove it.
18144 Adjust all the places which used it to use the obstack.
18145
18146 2001-01-19 Akim Demaille <akim@epita.fr>
18147
18148 * src/lex.h: Rename all the tokens:
18149 s/\bENDFILE\b/tok_eof/g;
18150 s/\bIDENTIFIER\b/tok_identifier/g;
18151 etc.
18152 Let them be enums, not #define, to ease debugging.
18153 Adjust all the code.
18154
18155 2001-01-18 Akim Demaille <akim@epita.fr>
18156
18157 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
18158 * src/lex.c (maxtoken, grow_token_buffer): Static.
18159
18160 2001-01-18 Akim Demaille <akim@epita.fr>
18161
18162 Since we now use obstacks, more % directives can be enabled.
18163
18164 * src/lex.c (percent_table): Also accept `%yacc',
18165 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
18166 `%debug'.
18167 Handle the actions for `%semantic_parser' and `%pure_parser' here,
18168 instead of returning a token.
18169 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
18170 * src/reader.c (read_declarations): Adjust.
18171 * src/files.c (open_files): Don't call `compute_base_names', don't
18172 compute `attrsfile' since they depend upon data which might be
18173 *in* the input file now.
18174 (output_files): Do it here.
18175 * src/output.c (output_headers): Document the fact that this patch
18176 introduces a guaranteed SEGV for semantic parsers.
18177 * doc/bison.texinfo: Document them.
18178 * tests/suite.at: Exercise these %options.
18179
18180 2000-12-20 Akim Demaille <akim@epita.fr>
18181
18182 Also handle the output file (--verbose) with obstacks.
18183
18184 * files.c (foutput): Remove.
18185 (output_obstack): New.
18186 Adjust all dependencies.
18187 * src/conflicts.c: Return a string.
18188 * src/system.h (obstack_grow_string): Rename as...
18189 (obstack_sgrow): this. Be ready to work with non literals.
18190 (obstack_fgrow4): New.
18191
18192 2000-12-20 Akim Demaille <akim@epita.fr>
18193
18194 * src/files.c (open_files): Fix the computation of short_base_name
18195 in the case of `-o foo.tab.c'.
18196
18197 2000-12-20 Akim Demaille <akim@epita.fr>
18198
18199 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
18200 (copy_dollar): Now that everything uses obstacks, get rid of the
18201 FILE * parameters.
18202
18203 2000-12-20 Akim Demaille <akim@epita.fr>
18204
18205 * src/files.c (open_files): Actually the `.output' file is based
18206 on the short_base_name, not base_name.
18207 * tests/suite.at (Checking output file names): Adjust.
18208
18209 2000-12-20 Akim Demaille <akim@epita.fr>
18210
18211 * src/bison.s1: Remove, we now use directly...
18212 * src/bison.simple: this.
18213 * src/Makefile.am: Use pkgdata instead of data.
18214
18215 2000-12-20 Akim Demaille <akim@epita.fr>
18216
18217 * src/files.c (guard_obstack): New.
18218 (open_files): Initialize it.
18219 (output_files): Dump it...
18220 * src/files.h: Export it.
18221 * src/reader.c (copy_guard): Use it.
18222
18223 2000-12-19 Akim Demaille <akim@epita.fr>
18224
18225 * src/files.c (outfile, defsfile, actfile): Removed as global
18226 vars.
18227 (open_files): Don't compute them.
18228 (output_files): Adjust.
18229 (base_name, short_base_name): Be global.
18230 Adjust dependencies.
18231
18232 2000-12-19 Akim Demaille <akim@epita.fr>
18233
18234 * src/files.c (strsuffix): New.
18235 (stringappend): Be just like strcat but allocate.
18236 (base_names): Eve out from open_files.
18237 Try to simplify the rather hairy computation of base_name and
18238 short_base_name.
18239 (open_files): Use it.
18240 * tests/suite.at (Checking output file names): New test.
18241
18242 2000-12-19 Akim Demaille <akim@epita.fr>
18243
18244 * src/system.h (obstack_grow_literal_string): Rename as...
18245 (obstack_grow_string): this.
18246 * src/output.c (output_parser): Recognize `%% actions' instead of
18247 `$'.
18248 * src/bison.s1: s/$/%% actions/.
18249 * src/bison.hairy: Likewise.
18250
18251 2000-12-19 Akim Demaille <akim@epita.fr>
18252
18253 * src/output.c (output_parser): Compute the `#line' lines when
18254 there are.
18255 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
18256 Suggested by Hans Aberg.
18257
18258 2000-12-19 Akim Demaille <akim@epita.fr>
18259
18260 Let the handling of the skeleton files be local to the procedures
18261 that use it.
18262
18263 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
18264 longer static.
18265 (fparser, open_extra_files): Remove.
18266 (open_files, output_files): Don't take care of fparser.
18267 * src/files.h: Adjust.
18268 * src/output.c (output_parser): Open and close the file to the
18269 skeleton.
18270 * src/reader.c (read_declarations): When %semantic_parser, open
18271 fguard.
18272
18273 2000-12-19 Akim Demaille <akim@epita.fr>
18274
18275 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
18276 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
18277
18278 2000-12-19 Akim Demaille <akim@epita.fr>
18279
18280 * src/files.c (open_files): Yipee! We no longer need all the code
18281 looking for `/tmp' since we have no tmp file.
18282
18283 2000-12-19 Akim Demaille <akim@epita.fr>
18284
18285 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
18286 New macros.
18287 * src/files.c (open_files): Less dependency on MSDOS etc.
18288
18289 2000-12-14 Akim Demaille <akim@epita.fr>
18290
18291 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
18292 Provide a default definition.
18293 Use it when executing the default @ action.
18294 * src/reader.c (reader_output_yylsp): No longer include
18295 `timestamp' and `text' in the default YYLTYPE.
18296
18297 2000-12-12 Akim Demaille <akim@epita.fr>
18298
18299 * src/reader.c (copy_definition, parse_union_decl, copy_action)
18300 (copy_guard): Quote the file names.
18301 Reported by Laurent Mascherpa.
18302
18303 2000-12-12 Akim Demaille <akim@epita.fr>
18304
18305 * src/output.c (output_headers, output_program, output): Be sure
18306 to escape special characters when outputting filenames.
18307 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
18308 (output_headers): Don't depend on them, Use ACTSTR.
18309
18310 2000-11-17 Akim Demaille <akim@epita.fr>
18311
18312 * lib/obstack.h: Formatting changes.
18313 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
18314 prevents type checking.
18315 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
18316 cast the value to (void *): assigning a `foo *' to a `void *'
18317 variable is valid.
18318 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
18319 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
18320 append characters.
18321
18322 2000-11-17 Akim Demaille <akim@epita.fr>
18323
18324 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
18325 as...
18326 (suite.m4, regression.m4, calc.m4): these.
18327 * tests/atgeneral.m4: Update from CVS Autoconf.
18328
18329 2000-11-17 Akim Demaille <akim@epita.fr>
18330
18331 * tests/regression.m4 (%union and --defines): New test,
18332 demonstrating a current bug in the obstack implementation.
18333
18334 2000-11-17 Akim Demaille <akim@epita.fr>
18335
18336 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
18337 macros.
18338 Use them to declare the variables which are global or local to
18339 `yyparse'.
18340
18341 2000-11-17 Akim Demaille <akim@epita.fr>
18342
18343 * acconfig.h: Remove, no longer used.
18344
18345 2000-11-07 Akim Demaille <akim@epita.fr>
18346
18347 * src: s/Copyright (C)/Copyright/g.
18348
18349 2000-11-07 Akim Demaille <akim@epita.fr>
18350
18351 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
18352 defining.
18353 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
18354
18355 2000-11-07 Akim Demaille <akim@epita.fr>
18356
18357 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
18358 Merge in a single CPP if/else.
18359
18360 2000-11-07 Akim Demaille <akim@epita.fr>
18361
18362 * src/output.c (output): Remove useless variables.
18363 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
18364 argument `data' for consistency with the prototypes.
18365 Qualify it `const'.
18366 (obstack_copy, obstack_copy0): Rename the second argument as
18367 `address' for consistency. Qualify it `const'.
18368 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
18369 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
18370 `const' their input argument (`data' or `address').
18371 Adjust the corresponding macros to include `const' in casts.
18372
18373 2000-11-03 Akim Demaille <akim@epita.fr>
18374
18375 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
18376 s/PFILE1/BISON_HAIRY/.
18377 Adjust dependencies.
18378
18379 2000-11-03 Akim Demaille <akim@epita.fr>
18380
18381 For some reason, this was not applied.
18382
18383 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18384 `unlink': it's no longer used.
18385
18386 2000-11-03 Akim Demaille <akim@epita.fr>
18387
18388 * src/files.c (skeleton_find): New function, eved out of...
18389 (open_files, open_extra_files): here.
18390
18391 2000-11-03 Akim Demaille <akim@epita.fr>
18392
18393 Don't use `atexit'.
18394
18395 * src/files.c (obstack_save): New function.
18396 (done): Rename as...
18397 (output_files): this.
18398 Use `obstack_save'.
18399 * src/main.c (main): Don't use `atexit' to register `done', since
18400 it no longer has to remove tmp files, just call `output_files'
18401 when there are no errors.
18402
18403 2000-11-02 Akim Demaille <akim@epita.fr>
18404
18405 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18406 `unlink': it's no longer used.
18407 * src/files.h: Formatting changes.
18408
18409 2000-11-02 Akim Demaille <akim@epita.fr>
18410
18411 Remove the last uses of mktemp and unlink/delete.
18412
18413 * src/files.c (fdefines, ftable): Removed.
18414 (defines_ostack, table_obstack): New.
18415 Adjust dependencies of the former into uses of the latter.
18416 * src/output.c (output_short_or_char_table, output_short_table):
18417 Convert to using obstacks.
18418 * src/reader.c (copy_comment2): Accept one FILE * and two
18419 obstacks.
18420 (output_token_defines, reader_output_yylsp): Use obstacks.
18421 * src/system.h (obstack_fgrow3): New.
18422 * po/POTFILES.in: Adjust.
18423
18424 2000-11-01 Akim Demaille <akim@epita.fr>
18425
18426 Change each use of `fattrs' into a use of `attrs_obstack'.
18427
18428 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
18429 * src/files.c (fattrs): Remove.
18430 (attrs_obstack): New.
18431 Adjust all dependencies.
18432 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
18433
18434 2000-11-01 Akim Demaille <akim@epita.fr>
18435
18436 Introduce obstacks.
18437 Change each use of `faction' into a use of `action_obstack'.
18438
18439 * lib/obstack.h, lib/obstack.c: New files.
18440 * src/files.c (faction): Remove.
18441 (action_obstack): New.
18442 Adjust all dependencies.
18443
18444 2000-10-20 Akim Demaille <akim@epita.fr>
18445
18446 * lib/quote.h (PARAMS): New macro. Use it.
18447
18448 2000-10-16 Akim Demaille <akim@epita.fr>
18449
18450 * src/output.c (output_short_or_char_table): New function.
18451 (output_short_table, output_token_translations): Use it.
18452 (goto_actions): Use output_short_table.
18453
18454 2000-10-16 Akim Demaille <akim@epita.fr>
18455
18456 * src/symtab.c (bucket_new): New function.
18457 (getsym): Use it.
18458
18459 * src/output.c (output_short_table): New argument to display the
18460 comment associated with the table.
18461 Adjust dependencies.
18462 (output_gram): Use it.
18463 (output_rule_data): Nicer output layout for YYTNAME.
18464
18465 2000-10-16 Akim Demaille <akim@epita.fr>
18466
18467 * src/lex.c (read_typename): New function.
18468 (lex): Use it.
18469 * src/reader.c (copy_dollar): Likewise.
18470
18471 2000-10-16 Akim Demaille <akim@epita.fr>
18472
18473 * src/reader.c (copy_comment2): Expect the input stream to be on
18474 the `/' which is suspected to open a comment, instead of being
18475 called after `//' or `/*' was read.
18476 (copy_comment, copy_definition, parse_union_decl, copy_action)
18477 (copy_guard): Adjust.
18478
18479 2000-10-16 Akim Demaille <akim@epita.fr>
18480
18481 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
18482 `read_signed_integer'.
18483
18484 2000-10-16 Akim Demaille <akim@epita.fr>
18485
18486 * src/reader.c (copy_dollar): New function.
18487 (copy_guard, copy_action): Use it.
18488
18489 2000-10-16 Akim Demaille <akim@epita.fr>
18490
18491 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
18492 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
18493 New files, from Fileutils 4.0.27.
18494 * src/main.c (printable_version): Remove.
18495 * src/lex.c, src/reader.c: Use `quote'.
18496
18497 2000-10-04 Akim Demaille <akim@epita.fr>
18498
18499 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
18500
18501 2000-10-04 Akim Demaille <akim@epita.fr>
18502
18503 * doc/bison.texinfo: Various typos spotted by Neil Booth.
18504
18505 2000-10-04 Akim Demaille <akim@epita.fr>
18506
18507 When a literal string is used to define two different tokens,
18508 `bison -v' segfaults.
18509 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
18510
18511 * tests/regression.m4: New file.
18512 Include the core of the sample provided by Piotr Gackiewicz.
18513 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
18514 properly.
18515
18516 2000-10-04 Akim Demaille <akim@epita.fr>
18517
18518 * src/reader.c (parse_expect_decl): Keep `count' within the size
18519 of `buffer'.
18520 From Neil Booth.
18521
18522 2000-10-02 Paul Eggert <eggert@twinsun.com>
18523
18524 * bison.s1 (yyparse): Assign the default value
18525 unconditionally, to avoid a GCC warning and make the parser a
18526 tad smaller.
18527
18528 2000-10-02 Akim Demaille <akim@epita.fr>
18529
18530 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
18531 options.
18532
18533 2000-10-02 Akim Demaille <akim@epita.fr>
18534
18535 * src/derives.c, src/print.c, src/reduce.c: To ease the
18536 translation, move some `\n' out of the translated strings.
18537
18538 2000-10-02 Akim Demaille <akim@epita.fr>
18539
18540 The location tracking mechanism is precious for parse error
18541 messages. Nevertheless, it is enabled only when `@n' is used in
18542 the grammar, which is a different issue (you can use it in error
18543 message, but not in the grammar per se). Therefore, there should
18544 be another means to enable it.
18545
18546 * src/getargs.c (getargs): Support `--locations'.
18547 (usage): Report it.
18548 * src/getargs.h (locationsflag): Export it.
18549 * src/lex.c (percent_table): Support `%locations'.
18550 * src/reader.c (yylsp_needed): Remove this variable, now replaced
18551 with `locationsflag'.
18552 * doc/bison.texinfo: Document `--locations' and `%locations'.
18553 Sort the options.
18554 * tests/calc.m4: Test it.
18555
18556 For regularity of the names, replace each
18557 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
18558 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
18559 In addition replace each `flag' with `_flag'.
18560
18561 2000-10-02 Akim Demaille <akim@epita.fr>
18562
18563 Also test parse error messages, including with YYERROR_VERBOSE.
18564
18565 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
18566 associative).
18567 Use it to check the computations.
18568 Use it to check `nonassoc' is honored.
18569 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
18570 `--yyerror-verbose'.
18571 (_AT_CHECK_CALC): Adjust to this option.
18572 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
18573
18574 2000-10-02 Akim Demaille <akim@epita.fr>
18575
18576 Test also `--verbose', `--defines' and `--name-prefix'. Testing
18577 the latter demonstrates a flaw in the handling of non debugging
18578 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
18579 was used in order to simplify:
18580
18581 #if YYDEBUG
18582 if (yydebug)
18583 {
18584 ...
18585 }
18586 #endif
18587
18588 into
18589
18590 if (yydebug)
18591 {
18592 ...
18593 }
18594
18595 unfortunately this leads to a CPP conflict when
18596 `--name-prefix=foo' is used since it produces `#define yydebug
18597 foodebug'.
18598
18599 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
18600 (YYDPRINTF): New macro.
18601 Spread its use.
18602 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
18603 the bison options.
18604 Also test `--verbose', `--defines' and `--name-prefix'.
18605
18606 2000-10-02 Akim Demaille <akim@epita.fr>
18607
18608 Improve the readability of the produced parsers.
18609
18610 * src/bison.s1: Formatting changes.
18611 Improve the comment related to the `$' mark.
18612 (yydefault): Don't fall through to `yyresume': `goto' there.
18613 * src/output.c (output_parser): When the `$' is met, skip the end
18614 of its line.
18615 New variable, `number_of_dollar_signs', to check there's exactly
18616 one `$' in the parser skeleton.
18617
18618 2000-10-02 Akim Demaille <akim@epita.fr>
18619
18620 * lib/xstrdup.c: New file, from the fileutils.
18621 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
18622 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
18623 instead of strlen + xmalloc + strcpy.
18624 * src/symtab.c (copys): Remove, use xstrdup instead.
18625
18626 2000-10-02 Akim Demaille <akim@epita.fr>
18627
18628 * src/gram.h (associativity): New enum type which replaces the
18629 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
18630 `right_assoc', `left_assoc' and `non_assoc'.
18631 Adjust all dependencies.
18632 * src/reader.c: Formatting changes.
18633 (LTYPESTR): Don't define it, use it as a literal in
18634 `reader_output_yylsp'.
18635 * src/symtab.h (symbol_class): New enum type which replaces the
18636 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
18637 `sunknown', `stoken and `snterm'.
18638
18639 2000-10-02 Akim Demaille <akim@epita.fr>
18640
18641 * src/getargs.c (fixed_outfiles): Rename as...
18642 (yaccflag): for consistency and accuracy.
18643 Adjust dependencies.
18644
18645 2000-10-02 Akim Demaille <akim@epita.fr>
18646
18647 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
18648 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
18649 difficult and introduced a lot of core dump. It turns out that
18650 Bison used an implementation of `xmalloc' based on `calloc', and
18651 at various places it does depend upon the initialization to 0. I
18652 have not tried to isolate the pertinent places, and all the former
18653 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
18654 someone should address this issue.
18655
18656 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
18657 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
18658 files.
18659 Adjust dependencies.
18660 * src/warshall.h: New file.
18661 Propagate.
18662
18663 2000-10-02 Akim Demaille <akim@epita.fr>
18664
18665 Various anti-`extern in *.c' changes.
18666
18667 * src/system.h: Include `assert.h'.
18668
18669 2000-10-02 Akim Demaille <akim@epita.fr>
18670
18671 * src/state.h (nstates, final_state, first_state, first_shift)
18672 (first_reduction): Move their exportation from here...
18673 * src/LR0.h: to here.
18674 Adjust dependencies.
18675 * src/getargs.c (statisticsflag): New variable.
18676 Add support for `--statistics'.
18677 Adjust dependencies.
18678
18679 Remove a lot of now useless `extern' statements in most files.
18680
18681 2000-10-02 Akim Demaille <akim@epita.fr>
18682
18683 * src/LR0.h: New file.
18684 Propagate its use.
18685
18686 2000-10-02 Akim Demaille <akim@epita.fr>
18687
18688 * src/print.h: New file.
18689 Propagate its use.
18690 * src/print.c: Formatting and ordering changes.
18691 (verbose, terse): Replace with...
18692 (print_results): this new function.
18693 Adjust dependencies.
18694
18695 2000-10-02 Akim Demaille <akim@epita.fr>
18696
18697 * src/conflicts.c (conflict_report): New function.
18698 (conflict_log, verbose_conflict_log): Replace with...
18699 (print_conflicts): this function.
18700 Adjust dependencies.
18701 * src/conflicts.h: New file.
18702 Propagate its inclusion.
18703
18704 2000-10-02 Akim Demaille <akim@epita.fr>
18705
18706 * src/nullable.h: New file.
18707 Propagate its inclusion.
18708 * src/nullable.c: Formatting changes.
18709
18710 2000-10-02 Akim Demaille <akim@epita.fr>
18711
18712 * src/reduce.h: New file.
18713 Propagate its inclusion.
18714 * src/reduce.c: Topological sort and other formatting changes.
18715 (bool, TRUE, FALSE): Move their definition to...
18716 * src/system.h: here.
18717
18718 2000-10-02 Akim Demaille <akim@epita.fr>
18719
18720 * src/files.c: Formatting changes.
18721 (tryopen, tryclose, openfiles): Rename as...
18722 (xfopen, xfclose, open_files): this.
18723 (stringappend): static.
18724 * src/files.h: Complete the list of exported symbols.
18725 Propagate its use.
18726
18727 2000-10-02 Akim Demaille <akim@epita.fr>
18728
18729 * src/reader.h: New file.
18730 Propagate its use instead of tedious list of `extern' and
18731 prototypes.
18732 * src/reader.c: Formatting changes, topological sort,
18733 s/register//.
18734
18735 2000-10-02 Akim Demaille <akim@epita.fr>
18736
18737 * src/lex.h: Prototype `lex.c' exported functions.
18738 * src/reader.c: Adjust.
18739 * src/lex.c: Formatting changes.
18740 (safegetc): Rename as...
18741 (xgetc): this.
18742
18743 2000-10-02 Akim Demaille <akim@epita.fr>
18744
18745 * src/lalr.h: New file.
18746 Propagate its inclusion instead of prototypes and `extern'.
18747 * src/lalr.c: Formatting changes, topological sorting etc.
18748
18749 2000-10-02 Akim Demaille <akim@epita.fr>
18750
18751 * src/output.c (token_actions): Introduce a temporary array,
18752 YYDEFACT, that makes it possible for this function to use
18753 output_short_table.
18754
18755 2000-10-02 Akim Demaille <akim@epita.fr>
18756
18757 `user_toknums' is output as a `short[]' in `output.c', while it is
18758 defined as a `int[]' in `reader.c'. For consistency with the
18759 other output tables, `user_toknums' is now defined as a table of
18760 shorts.
18761
18762 * src/reader.c (user_toknums): Be a short table instead of an int
18763 table.
18764 Adjust dependencies.
18765
18766 Factor the short table outputs.
18767
18768 * src/output.c (output_short_table): New function.
18769 * src/output.c (output_gram, output_stos, output_rule_data)
18770 (output_base, output_table, output_check): Use it.
18771
18772 2000-10-02 Akim Demaille <akim@epita.fr>
18773
18774 * src/output.c (output): Topological sort of the functions, in
18775 order to get rid of the `static' prototypes.
18776 No longer use `register'.
18777 * src/output.h: New file.
18778 Propagate its inclusion in files explicitly prototyping functions
18779 from output.c.
18780
18781 2000-09-21 Akim Demaille <akim@epita.fr>
18782
18783 * src/atgeneral.m4: Update from Autoconf.
18784
18785 2000-09-21 Akim Demaille <akim@epita.fr>
18786
18787 * src/closure.h: New file.
18788 * src/closure.c: Formatting changes, topological sort over the
18789 functions, use of closure.h.
18790 (initialize_closure, finalize_closure): Rename as...
18791 (new_closure, free_closure): these. Adjust dependencies.
18792 * src/LR0.c: Formatting changes, topological sort, use of
18793 cloture.h.
18794 (initialize_states): Rename as...
18795 (new_states): this.
18796 * src/Makefile.am (noinst_HEADERS): Adjust.
18797
18798 2000-09-20 Akim Demaille <akim@epita.fr>
18799
18800 * src/acconfig.h: Don't protect config.h against multiple
18801 inclusion.
18802 Don't define PARAMS.
18803 * src/system.h: Define PARAMS.
18804 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
18805 purpose of config.h. system.h must not try to fix wrong
18806 definitions in config.h.
18807
18808 2000-09-20 Akim Demaille <akim@epita.fr>
18809
18810 * src/derives.h: New file.
18811 * src/main.c, src/derives.h: Use it.
18812 Formatting changes.
18813 * src/Makefile.am (noinst_HEADERS): Adjust.
18814
18815 2000-09-20 Akim Demaille <akim@epita.fr>
18816
18817 * tests/atgeneral.m4: Update from Autoconf.
18818 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
18819 (AT_CHECK_CALC): New macros.
18820 Use these macros to test bison with options `', `--raw',
18821 `--debug', `--yacc', `--yacc --debug'.
18822
18823 2000-09-19 Akim Demaille <akim@epita.fr>
18824
18825 * src/output.c: Formatting changes.
18826 * src/machine.h: Remove, leaving its contents in...
18827 * src/system.h: here.
18828 Include stdio.h.
18829 Adjust all dependencies on stdio.h and machine.h.
18830 * src/getargs.h: New file.
18831 Let all `extern' declarations about getargs.c be replaced with
18832 inclusion of `getargs.h'.
18833 * src/Makefile.am (noinst_HEADERS): Adjust.
18834
18835 * tests/calc.m4 (yyin): Be initialized in main, not on the global
18836 scope.
18837 (yyerror): Returns void, not int.
18838 * doc/bison.texinfo: Formatting changes.
18839
18840 2000-09-19 Akim Demaille <akim@epita.fr>
18841
18842 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
18843 portable.
18844
18845 2000-09-18 Akim Demaille <akim@epita.fr>
18846
18847 * configure.in: Append WARNING_CFLAGS to CFLAGS.
18848 * src/Makefile.am (INCLUDES): Don't.
18849 Be ready to fetch headers in lib/.
18850
18851 2000-09-18 Akim Demaille <akim@epita.fr>
18852
18853 * doc/bison.texinfo: Update the copyright.
18854 ANSIfy and GNUify the examples.
18855 Remove the old menu.
18856
18857 2000-09-18 Akim Demaille <akim@epita.fr>
18858
18859 First set of tests: use the `calc' example from the documentation.
18860
18861 * src/bison.s1 (yyparse): Condition the code using `yytname' which
18862 is defined only when YYDEBUG is.
18863 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
18864 * src/files.c (tryopen, tryclose): Formatting changes.
18865 Move to the top and be static.
18866 * src/reader.c (read_signed_integer): Likewise.
18867 * tests/calc.m4: New file.
18868 * Makefile.am, suite.m4: Adjust.
18869 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
18870
18871 2000-09-18 Akim Demaille <akim@epita.fr>
18872
18873 Add support for an Autotest test suite for Bison.
18874
18875 * m4/m4.m4, m4/atconfig.m4: New files.
18876 * m4/Makefile.am (EXTRA_DIST): Adjust.
18877 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
18878 files.
18879 * src/getargs.c: Display a more standard --version message.
18880 * src/reader.c (reader): Formatting changes.
18881 No longer depend upon VERSION_STRING.
18882 * configure.in: No longer use `dnl'.
18883 Set up the test suite and the new directory `tests/.
18884 (VERSION_STRING): Remove.
18885
18886 2000-04-14 Akim Demaille <akim@epita.fr>
18887
18888 * src/reader.c (copy_comment2): New function, same as former
18889 `copy_comment', but outputs into two FILE *.
18890 (copy_comment): Use it.
18891 (parse_union_decl): Use it.
18892 (get_type, parse_start_decl): Use the same `invalid' message.
18893 (parse_start_decl, parse_union_decl): Use the same `multiple'
18894 message.
18895 (parse_union_decl, copy_guard, copy_action): Use the same
18896 `unmatched' message.
18897 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
18898
18899 2000-03-31 Akim Demaille <akim@epita.fr>
18900
18901 * src/files.c (tryopen, tryclose): Move to the top.
18902 Be static.
18903
18904 2000-03-31 Akim Demaille <akim@epita.fr>
18905
18906 * src/main.c (main): Don't call `done', exit does it.
18907
18908 2000-03-31 Akim Demaille <akim@epita.fr>
18909
18910 * allocate.c: s/return (foo)/return foo/.
18911 * lalr.c: Likewise.
18912 * LR0.c: Likewise.
18913 * output.c: Likewise.
18914 * reader.c: Likewise.
18915 * symtab.c: Likewise.
18916 * vmsgetargs.c: Likewise.
18917
18918 2000-03-31 Akim Demaille <akim@epita.fr>
18919
18920 Clean up the error reporting functions.
18921
18922 * src/report.c: New file.
18923 * src/report.h: Likewise.
18924 * src/Makefile.am: Adjust.
18925 * m4/error.m4: New file.
18926 * m4/Makefile.am: Adjust.
18927 * configure.in (jm_PREREQ_ERROR): Call it.
18928 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
18929 Remove.
18930 (fatal, fatals): Remove. All callers use complain.c::fatal.
18931 (warn, warni, warns, warnss, warnss): Remove. All callers use
18932 complain.c::complain.
18933 (toomany): Remove, use fatal instead.
18934 * src/files.c (done): No argument, use complain_message_count.
18935 * src/main.c (main): Register `done' to `atexit'.
18936
18937 * src/getargs.c (usage): More `fputs', less `fprintf'.
18938
18939 2000-03-28 Akim Demaille <akim@epita.fr>
18940
18941 * lib/: New directory.
18942 * Makefile.am (SUBDIRS): Adjust.
18943 * configure.in: Adjust.
18944 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
18945 useless.
18946 * src/alloca.c: Moved to lib/.
18947 * src/getopt.c: Likewise.
18948 * src/getopt1.c: Likewise.
18949 * src/getopt.h: Likewise.
18950 * src/ansi2knr.c: Likewise.
18951 * src/ansi2knr.1: Likewise.
18952 * src/Makefile.am: Adjust.
18953 * lib/Makefile.am: New file.
18954
18955 2000-03-28 Akim Demaille <akim@epita.fr>
18956
18957 * src/getargs.c (usage): Refresh the help message.
18958
18959 2000-03-17 Akim Demaille <akim@epita.fr>
18960
18961 * src/getopt1.c: Updated from textutils 2.0e
18962 * src/getopt.c: Likewise.
18963 * src/getopt.h: Likewise.
18964
18965 2000-03-17 Akim Demaille <akim@epita.fr>
18966
18967 * src/Makefile.am (bison.simple): Fix the awk program: quote only
18968 the file name, not the whole `#line LINE FILE'.
18969
18970 2000-03-17 Akim Demaille <akim@epita.fr>
18971
18972 On syntax errors, report the token on which we choked.
18973
18974 * src/bison.s1 (yyparse): In the label yyerrlab, when
18975 YYERROR_VERBOSE, add yychar in msg.
18976
18977 2000-03-17 Akim Demaille <akim@epita.fr>
18978
18979 * src/reader.c (copy_at): New function.
18980 (copy_guard): Use it.
18981 (copy_action): Use it.
18982
18983 2000-03-17 Akim Demaille <akim@epita.fr>
18984
18985 Be kind to translators, save some useless translations.
18986
18987 * src/main.c (banner): New function.
18988 (fatal_banner): Use it.
18989 (warn_banner): Use it.
18990
18991 2000-03-17 Akim Demaille <akim@epita.fr>
18992
18993 * src/reader.c (copy_definition): Use copy_string and
18994 copy_comment. Removed now unused `match', `ended',
18995 `cplus_comment'.
18996 (copy_comment, copy_string): Moved, to be visible from
18997 copy_definition.
18998
18999 2000-03-17 Akim Demaille <akim@epita.fr>
19000
19001 * src/reader.c (copy_string): Declare `static inline'. No
19002 problems with inline, since it is checked by configure.
19003 (copy_comment): Likewise.
19004
19005 2000-03-17 Akim Demaille <akim@epita.fr>
19006
19007 * src/reader.c (packsymbols): Formatting changes.
19008
19009 2000-03-17 Akim Demaille <akim@epita.fr>
19010
19011 * src/reader.c (copy_comment): New function, factored out from:
19012 (copy_action): Use it. Removed now unused `match', `ended',
19013 `cplus_comment'.
19014 (copy_guard): Likewise.
19015
19016 2000-03-17 Akim Demaille <akim@epita.fr>
19017
19018 * src/reader.c (copy_string): New function, factored out from:
19019 (copy_action): Use it.
19020 (copy_guard): Likewise.
19021
19022 2000-03-17 Akim Demaille <akim@epita.fr>
19023
19024 Change the handling of @s so that they behave exactly like $s.
19025 There is now a pseudo variable @$ (readble and writable), location
19026 of the lhs of the rule (by default ranging from the location of
19027 the first symbol of the rhs, to the location of the last symbol,
19028 or, if the rhs is empty, YYLLOC).
19029
19030 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
19031 yyval.
19032 (yyparse): When providing a default semantic action, provide a
19033 default location action.
19034 (after the $): No longer change `*YYLSP', just stack YYLOC the
19035 same way you stack YYVAL.
19036 * src/reader.c (read_declarations): Use warns.
19037 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
19038 (copy_action, case '@'): Likewise.
19039 Use a standard error message, to save useless work from
19040 translators.
19041
19042 2000-03-17 Akim Demaille <akim@epita.fr>
19043
19044 * src/bison.s1: Formatting and cosmetics changes.
19045 * src/reader.c: Likewise.
19046 Update the Copyright notice.
19047
19048 2000-03-17 Akim Demaille <akim@epita.fr>
19049
19050 * src/bison.s1 (#line): All set to `#line' only, since the
19051 Makefile now handles them.
19052
19053 2000-03-16 Akim Demaille <akim@epita.fr>
19054
19055 * src/output.c (output_rule_data): Output the documentation of
19056 some of the tables.
19057 (Copyright notice): Update.
19058 Formatting changes.
19059
19060 2000-03-16 Akim Demaille <akim@epita.fr>
19061
19062 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
19063 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
19064 One `#if YYDEBUG' remains, since it uses variables which are
19065 defined only if `YYDEBUG != 0'.
19066
19067 2000-03-16 Akim Demaille <akim@epita.fr>
19068
19069 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
19070 and related variables so that the similarities are highlighted.
19071
19072 2000-03-16 Akim Demaille <akim@epita.fr>
19073
19074 * src/bison.s1: Properly indent CPP directives.
19075
19076 2000-03-16 Akim Demaille <akim@epita.fr>
19077
19078 * src/bison.s1: Properly indent the `alloca' CPP section.
19079
19080 2000-03-16 Akim Demaille <akim@epita.fr>
19081
19082 Do not hard code values of directories in `configure.in'.
19083 Update the `configure' tool chain.
19084
19085 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
19086 src/makefile.am.
19087 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
19088 (AC_OUTPUT): Add m4/Makefile.
19089 Bump to bison 1.28a, 1.29 has never been released.
19090 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
19091 handled via src/Makefile.am.
19092 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
19093 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
19094 autoheader.
19095 * Makefile.am (SUBDIRS): Add m4.
19096 (ACLOCAL_AM_FLAGS): New variable.
19097 (AUTOMAKE_OPTIONS): Add check-news.
19098 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
19099 the proper line number and file name.
19100 (DEFS): Propagate the location of bison library files and of the
19101 locale files.
19102 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
19103 builddir.
19104 * acinclude.m4: Remove, replaced by the directory m4.
19105 * m4/Makefile.am (EXTRA_DIST): New variable.
19106 * m4/gettext.m4: New file, from the fileutils.
19107 * m4/lcmessage.m4: Likewise
19108 * m4/progtest.m4: Likewise.
19109 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
19110
19111 2000-03-10 Akim Demaille <akim@epita.fr>
19112
19113 * src/closure.c:
19114 Formatting changes of various comments.
19115 Respect the GNU coding standards at various places.
19116 Don't use `_()' when no translation is needed.
19117
19118 1999-12-13 Jesse Thilo <jthilo@gnu.org>
19119
19120 * src/files.c:
19121 OS/2 honors TMPDIR environment variable.
19122
19123 1999-12-13 Jesse Thilo <jthilo@gnu.org>
19124
19125 * doc/bison.texinfo: Tweaked spelling and grammar.
19126 Updated ISBN.
19127 Removed reference to price of printed copy.
19128 Mention BISON_SIMPLE and BISON_HAIRY.
19129
19130 1999-12-13 Jesse Thilo <jthilo@gnu.org>
19131
19132 * configure.in, NEWS:
19133 Bison 1.29 released.
19134
19135 1999-10-27 Jesse Thilo <jthilo@gnu.org>
19136
19137 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
19138 Added reference card.
19139
19140 1999-07-26 Jesse Thilo <jthilo@gnu.org>
19141
19142 * po/ru.po: Added Russian translation.
19143
19144 1999-07-26 Jesse Thilo <jthilo@gnu.org>
19145
19146 * configure.in: Added Russian translation.
19147
19148 1999-07-06 Jesse Thilo <jthilo@gnu.org>
19149
19150 * configure.in, NEWS, README:
19151 Released version 1.28.
19152
19153 1999-06-14 Jesse Thilo <jthilo@gnu.org>
19154
19155 * src/system.h:
19156 Squashed redefinition warning on some systems.
19157
19158 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
19159 Have configure build version string instead of relying on ANSI string
19160 concatentation.
19161
19162 1999-06-14 Jesse Thilo <jthilo@gnu.org>
19163
19164 * po/POTFILES.in: Got rid of version.c.
19165
19166 1999-06-14 Jesse Thilo <jthilo@gnu.org>
19167
19168 * acconfig.h, configure.in:
19169 Have configure build version string instead of relying on ANSI string
19170 concatentation.
19171
19172 1999-06-08 Jesse Thilo <jthilo@gnu.org>
19173
19174 * doc/bison.1:
19175 Dropped mention of `+' for long-named options.
19176
19177 1999-05-30 Jesse Thilo <jthilo@gnu.org>
19178
19179 * src/files.c: Added <unistd.h> for unlink().
19180
19181 * src/Makefile.am, src/system.h:
19182 I18n fixes.
19183
19184 1999-05-30 Jesse Thilo <jthilo@gnu.org>
19185
19186 * README: Added a FAQ list.
19187
19188 * configure.in, acconfig.h:
19189 I18n fixes.
19190
19191 1999-05-30 Jesse Thilo <jthilo@gnu.org>
19192
19193 * doc/FAQ, doc/Makefile.am:
19194 Added a FAQ list.
19195
19196 1999-05-19 Jesse Thilo <jthilo@gnu.org>
19197
19198 * src/alloc.h, src/symtab.h, src/version.c:
19199 Protected inclusion of "config.h" with HAVE_CONFIG_H.
19200
19201 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19202
19203 * src/.cvsignore, src/Makefile.am:
19204 Reorganized: sources in `src', documentation in `doc'.
19205
19206 * src/lex.c (literalchar):
19207 fixed the code for escaping double quotes (thanks
19208 Jonathan Czisny.)
19209
19210 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19211
19212 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
19213 Adjusted paths to reflect directory reorganization.
19214
19215 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19216
19217 * doc/.cvsignore, doc/Makefile.am:
19218 Reorganized: sources in `src', documentation in `doc'.
19219
19220 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19221
19222 * configure.in:
19223 Updated AC_INIT file to reflect directory reorganization.
19224
19225 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
19226 Reorganized: sources in `src', documentation in `doc'.
19227
19228 1999-04-13 Jesse Thilo <jthilo@gnu.org>
19229
19230 * src/allocate.c:
19231 Don't declare calloc() and realloc() if not necessary.
19232
19233 1999-04-13 Jesse Thilo <jthilo@gnu.org>
19234
19235 * configure.in, acconfig.h, acinclude.m4:
19236 Don't declare calloc() and realloc() if not necessary.
19237
19238 1999-03-23 Jesse Thilo <jthilo@gnu.org>
19239
19240 * po/.cvsignore: Added i18n support.
19241
19242 1999-03-23 Jesse Thilo <jthilo@gnu.org>
19243
19244 * acconfig.h, configure.in, Makefile.am:
19245 Added i18n support.
19246
19247 1999-03-22 Jesse Thilo <jthilo@gnu.org>
19248
19249 * src/bison.s1: Fixed #line numbers.
19250
19251 1999-03-15 Jesse Thilo <jthilo@gnu.org>
19252
19253 * po/es.po, po/fr.po, po/nl.po, po/de.po:
19254 Added PO files from Translation Project.
19255
19256 1999-03-03 Jesse Thilo <jthilo@gnu.org>
19257
19258 * Makefile.am:
19259 Added support for non-ANSI compilers (ansi2knr).
19260
19261 1999-02-16 Jesse Thilo <jthilo@gnu.org>
19262
19263 * configure.in: Bumped version number to 1.27.
19264
19265 * Makefile.am:
19266 Added `bison.simple' to list of files removed by `make distclean'.
19267
19268 1999-02-12 Jesse Thilo <jthilo@gnu.org>
19269
19270 * src/files.c, src/files.h:
19271 Defined locations of parser files in config.h instead of Makefile.
19272
19273 1999-02-12 Jesse Thilo <jthilo@gnu.org>
19274
19275 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
19276 Defined locations of parser files in config.h instead of Makefile.
19277
19278 1999-02-09 Jesse Thilo <jthilo@gnu.org>
19279
19280 * Makefile.am:
19281 Removed inappropriate use of $< macro.
19282
19283 1999-02-05 Jesse Thilo <jthilo@gnu.org>
19284
19285 * po/Makefile.in.in, po/POTFILES.in:
19286 Add `po' directory skeleton.
19287
19288 1999-01-27 Jesse Thilo <jthilo@gnu.org>
19289
19290 * README: Document help-bison list.
19291
19292 * configure.in: Add check for mkstemp().
19293
19294 1999-01-20 Jesse Thilo <jthilo@gnu.org>
19295
19296 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
19297 Hush a few compiler warnings.
19298
19299 * src/files.c:
19300 Add tryclose(), which verifies that fclose was successful.
19301 Hush a couple of compiler warnings.
19302
19303 1999-01-20 Jesse Thilo <jthilo@gnu.org>
19304
19305 * Makefile.am, OChangeLog:
19306 ChangeLog is now automatically generated. Include the old version as
19307 OChangeLog.
19308
19309 1999-01-14 Jesse Thilo <jthilo@gnu.org>
19310
19311 * 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:
19312 Update FSF address.
19313
19314 1999-01-14 Jesse Thilo <jthilo@gnu.org>
19315
19316 * doc/bison.texinfo: Fix formatting glitch.
19317
19318 * doc/bison.texinfo: Update FSF address.
19319
19320 1999-01-14 Jesse Thilo <jthilo@gnu.org>
19321
19322 * acconfig.h: Update FSF address.
19323
19324 1999-01-08 Jesse Thilo <jthilo@gnu.org>
19325
19326 * src/system.h:
19327 Don't define PACKAGE here, since config.h defines it.
19328
19329 1998-12-30 Jesse Thilo <jthilo@gnu.org>
19330
19331 * src/reader.c: Update copyright date.
19332
19333 * src/main.c:
19334 Ditch sprintf to statically-sized buffers in fatal/warn functions in
19335 favor of output directly to stderr (avoids buffer overruns).
19336
19337 * src/reader.c: Some checks for premature EOF.
19338
19339 * 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:
19340 Use prototypes if the compiler understands them.
19341
19342 * src/files.c: Honor TMPDIR on Unix hosts.
19343 Use prototypes if the compiler understands them.
19344
19345 * src/reader.c:
19346 Fix a couple of buffer overrun bugs.
19347 Use prototypes if the compiler understands them.
19348
19349 * src/system.h: Include unistd.h and ctype.h.
19350 Use #ifdef instead of #if for NLS symbols.
19351
19352 1998-12-30 Jesse Thilo <jthilo@gnu.org>
19353
19354 * doc/bison.texinfo:
19355 Delete comment "consider using @set for edition number, etc..." since
19356 we now are doing so.
19357
19358 1998-12-30 Jesse Thilo <jthilo@gnu.org>
19359
19360 * configure.in:
19361 Use prototypes if the compiler understands them.
19362
19363 * NEWS: Document 1.26 highlights.
19364
19365 * Makefile.am: Require Automake 1.3 or later.
19366
19367 * acconfig.h:
19368 Use prototypes if the compiler understands them.
19369
19370 1998-12-29 Jesse Thilo <jthilo@gnu.org>
19371
19372 * src/version.c:
19373 Use VERSION symbol from automake for version number.
19374
19375 1998-12-29 Jesse Thilo <jthilo@gnu.org>
19376
19377 * acconfig.h, configure.in, version.cin:
19378 Use VERSION symbol from automake for version number.
19379
19380 1998-11-28 Jesse Thilo <jthilo@gnu.org>
19381
19382 * Makefile.am:
19383 Distribute original version of simple parser (bison.s1), not built
19384 version (bison.simple).
19385
19386 1998-11-28 Jesse Thilo <jthilo@gnu.org>
19387
19388 * doc/bison.texinfo: Add info dir entry.
19389
19390 * doc/bison.texinfo:
19391 Let automake put version number into documentation.
19392
19393 1998-11-26 Jesse Thilo <jthilo@gnu.org>
19394
19395 * src/bison.cld, src/build.com, src/vmshlp.mar:
19396 Add non-RCS files from /gd/gnu/bison.
19397
19398 1998-11-26 Jesse Thilo <jthilo@gnu.org>
19399
19400 * doc/bison.1:
19401 Document the BISON_HAIRY and BISON_SIMPLE variables.
19402
19403 1998-11-25 Jesse Thilo <jthilo@gnu.org>
19404
19405 * src/version.c: Build version.c automatically.
19406
19407 * src/reader.c:
19408 Fix token numbering (used to start at 258, not 257).
19409
19410 * src/system.h: Include config.h.
19411
19412 * src/getargs.c: Update bug report address.
19413
19414 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
19415 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
19416
19417 1998-11-25 Jesse Thilo <jthilo@gnu.org>
19418
19419 * Makefile.am:
19420 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19421
19422 * configure.in, version.cin:
19423 Build version.c automatically.
19424
19425 * AUTHORS: Add AUTHORS file.
19426
19427 * README: Update bug report address.
19428
19429 * bison.simple:
19430 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19431
19432 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
19433 Add automake stuff.
19434
19435 1998-11-25 Jesse Thilo <jthilo@gnu.org>
19436
19437 * doc/bison.texinfo: Clean up some formatting.
19438
19439 1998-05-05 Richard Stallman <rms@gnu.org>
19440
19441 * doc/bison.texinfo:
19442 Explain better why to make a pure parser.
19443
19444 1998-01-05 Richard Stallman <rms@gnu.org>
19445
19446 * src/files.c (openfiles):
19447 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
19448 find a temporary directory, if possible. Do not unlink files while
19449 they are open.
19450
19451 1997-08-25 Richard Stallman <rms@gnu.org>
19452
19453 * src/reader.c (stack_offset;):
19454 Change some warni to warns.
19455
19456 * src/lex.c (literalchar): Use warns, not warni.
19457
19458 1997-06-28 Richard Stallman <rms@gnu.org>
19459
19460 * src/bison.s1: Add a Bison version comment.
19461
19462 * src/main.c (fatal, warn, berror):
19463 Use program_name.
19464
19465 1997-06-28 Richard Stallman <rms@gnu.org>
19466
19467 * Makefile.in (bison_version): New variable.
19468 (dist): Use that variable.
19469 (bison.s1): Substitute the Bison version into bison.simple.
19470
19471 * bison.simple: Add a Bison version comment.
19472
19473 1997-06-18 Richard Stallman <rms@gnu.org>
19474
19475 * src/main.c (fatal, warn, berror):
19476 Make error messages standard.
19477 (toomany): Improve error message text.
19478
19479 * 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:
19480 new.h renamed to alloc.h.
19481
19482 1997-06-18 Richard Stallman <rms@gnu.org>
19483
19484 * Makefile.in: new.h renamed to alloc.h.
19485
19486 1997-05-24 Richard Stallman <rms@gnu.org>
19487
19488 * src/lex.c (literalchar):
19489 Fix the code for escaping \, " and '.
19490
19491 (lex): Avoid trouble when there are many chars
19492 to discard in a char literal with just several chars in it.
19493
19494 1997-05-17 Richard Stallman <rms@gnu.org>
19495
19496 * src/bison.s1:
19497 Use malloc, if using alloca is troublesome.
19498 (YYSTACK_USE_ALLOCA): New flag macro.
19499 Define it for some systems and compilers.
19500 (YYSTACK_ALLOC): New macro.
19501 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19502 If it was malloc'd, free it.
19503
19504 1997-05-17 Richard Stallman <rms@gnu.org>
19505
19506 * bison.simple:
19507 Use malloc, if using alloca is troublesome.
19508 (YYSTACK_USE_ALLOCA): New flag macro.
19509 Define it for some systems and compilers.
19510 (YYSTACK_ALLOC): New macro.
19511 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19512 If it was malloc'd, free it.
19513
19514 1997-04-23 Richard Stallman <rms@gnu.org>
19515
19516 * src/bison.s1:
19517 (alloca) [__hpux]: Always define as __builtin_alloca.
19518
19519 1997-04-23 Richard Stallman <rms@gnu.org>
19520
19521 * bison.simple:
19522 (alloca) [__hpux]: Always define as __builtin_alloca.
19523
19524 1997-04-22 Richard Stallman <rms@gnu.org>
19525
19526 * src/bison.s1:
19527 [__hpux]: Include alloca.h (right for HPUX 10)
19528 instead of declaring alloca (right for HPUX 9).
19529
19530 * src/bison.s1 (__yy_memcpy):
19531 Declare arg `count' as unsigned int.
19532 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19533
19534 1997-04-22 Richard Stallman <rms@gnu.org>
19535
19536 * bison.simple:
19537 [__hpux]: Include alloca.h (right for HPUX 10)
19538 instead of declaring alloca (right for HPUX 9).
19539
19540 * bison.simple (__yy_memcpy):
19541 Declare arg `count' as unsigned int.
19542 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19543
19544 1997-01-03 Richard Stallman <rms@gnu.org>
19545
19546 * src/allocate.c: [__STDC__ or _MSC_VER]:
19547 Declare calloc and realloc to return void *.
19548
19549 1997-01-02 Richard Stallman <rms@gnu.org>
19550
19551 * src/system.h:
19552 [_MSC_VER]: Include stdlib.h and process.h.
19553 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
19554
19555 * src/main.c (main): Return FAILURE as a value.
19556 (printable_version): Declare arg as int, not char.
19557
19558 1997-01-02 Richard Stallman <rms@gnu.org>
19559
19560 * Makefile.in (dist):
19561 Explicitly check for symlinks, and copy them.
19562
19563 1996-12-19 Richard Stallman <rms@gnu.org>
19564
19565 * src/files.c:
19566 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
19567
19568 1996-12-18 Paul Eggert <eggert@gnu.org>
19569
19570 * src/bison.s1 (yyparse):
19571 If __GNUC__ and YYPARSE_PARAM are both defined,
19572 declare yyparse to have a void * argument.
19573
19574 1996-12-18 Paul Eggert <eggert@gnu.org>
19575
19576 * bison.simple (yyparse):
19577 If __GNUC__ and YYPARSE_PARAM are both defined,
19578 declare yyparse to have a void * argument.
19579
19580 1996-12-17 Richard Stallman <rms@gnu.org>
19581
19582 * src/reduce.c (nbits): Add some casts.
19583
19584 1996-08-12 Richard Stallman <rms@gnu.org>
19585
19586 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
19587
19588 1996-08-12 Richard Stallman <rms@gnu.org>
19589
19590 * bison.simple: Test _MSDOS as well as _MSDOS_.
19591
19592 1996-07-31 Richard Stallman <rms@gnu.org>
19593
19594 * src/bison.s1:
19595 [__sun && __i386]: Include alloca.h.
19596
19597 1996-07-31 Richard Stallman <rms@gnu.org>
19598
19599 * bison.simple:
19600 [__sun && __i386]: Include alloca.h.
19601
19602 1996-07-30 Richard Stallman <rms@gnu.org>
19603
19604 * src/bison.s1: Comment change.
19605
19606 * src/bison.s1: Test _MSDOS_, not MSDOS.
19607
19608 1996-07-30 Richard Stallman <rms@gnu.org>
19609
19610 * bison.simple: Comment change.
19611
19612 * bison.simple: Test _MSDOS_, not MSDOS.
19613
19614 1996-06-01 Richard Stallman <rms@gnu.org>
19615
19616 * 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:
19617 Insert `_' macro around many string constants.
19618
19619 * src/main.c:
19620 Insert `_' macro around many string constants.
19621
19622 (main): Call setlocale, bindtextdomain and textdomain.
19623
19624 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
19625 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
19626 [ENABLE_NLS]: Include libintl.h.
19627 [ENABLE_NLS] (gettext): Define.
19628 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
19629 (N_, PACKAGE, LOCALEDIR): New macros.
19630
19631 1996-06-01 Richard Stallman <rms@gnu.org>
19632
19633 * POTFILES.in: New file.
19634
19635 * Makefile.in (allocate.o):
19636 Define target explicitly.
19637
19638 * Makefile.in (CFLAGS): Set to @CFLAGS@.
19639 (LDFLAGS): Set to @LDFLAGS@.
19640 (configure): Run autoconf only if preceding `cd' succeeds.
19641 (bison.s1): Redirect output to temporary file then move the
19642 temporary to the target, rather than redirecting directly to bison.s1.
19643 (clean): Remove config.status and config.log.
19644 (distclean): Don't remove config.status here.
19645
19646 1996-05-12 Richard Stallman <rms@gnu.org>
19647
19648 * src/bison.s1:
19649 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19650
19651 1996-05-12 Richard Stallman <rms@gnu.org>
19652
19653 * bison.simple:
19654 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19655
19656 1996-05-11 Richard Stallman <rms@gnu.org>
19657
19658 * src/bison.s1 (__yy_memcpy):
19659 Really reorder the args, as was supposedly done on Feb 14 1995.
19660 (yyparse): Calls changed accordingly.
19661
19662 1996-05-11 Richard Stallman <rms@gnu.org>
19663
19664 * Makefile.in (dist): Don't use $(srcdir).
19665
19666 * bison.simple (__yy_memcpy):
19667 Really reorder the args, as was supposedly done on Feb 14 1995.
19668 (yyparse): Calls changed accordingly.
19669
19670 1996-01-27 Richard Stallman <rms@gnu.org>
19671
19672 * src/output.c (output_rule_data):
19673 Test YYERROR_VERBOSE in the conditional
19674 around the definition of ttyname.
19675
19676 1995-12-29 Richard Stallman <rms@gnu.org>
19677
19678 * src/bison.s1:
19679 Fix line numbers in #line commands.
19680
19681 1995-12-29 Richard Stallman <rms@gnu.org>
19682
19683 * bison.simple:
19684 Fix line numbers in #line commands.
19685
19686 1995-12-27 Richard Stallman <rms@gnu.org>
19687
19688 * src/bison.s1 (YYPARSE_PARAM_DECL):
19689 In C++, make it always null.
19690 (YYPARSE_PARAM_ARG): New macro.
19691 (yyparse): Use YYPARSE_PARAM_ARG.
19692
19693 1995-12-27 Richard Stallman <rms@gnu.org>
19694
19695 * bison.simple (YYPARSE_PARAM_DECL):
19696 In C++, make it always null.
19697 (YYPARSE_PARAM_ARG): New macro.
19698 (yyparse): Use YYPARSE_PARAM_ARG.
19699
19700 1995-11-29 Richard Stallman <rms@gnu.org>
19701
19702 * doc/bison.texinfo:
19703 Describe literal string tokens, %raw, %no_lines, %token_table.
19704
19705 1995-11-29 Daniel Hagerty <hag@gnu.org>
19706
19707 * doc/bison.texinfo: Fixed update date
19708
19709 1995-10-16 Richard Stallman <rms@gnu.org>
19710
19711 * src/version.c: Version 1.25.
19712
19713 1995-10-16 Richard Stallman <rms@gnu.org>
19714
19715 * NEWS: *** empty log message ***
19716
19717 1995-10-16 Richard Stallman <rms@gnu.org>
19718
19719 * doc/bison.1, doc/bison.rnh:
19720 Add new options.
19721
19722 1995-10-15 Richard Stallman <rms@gnu.org>
19723
19724 * src/vmsgetargs.c, src/getargs.c:
19725 Added -n, -k, and -raw switches.
19726 (noparserflag, toknumflag, rawtoknumflag): New variables.
19727
19728 * src/symtab.h (SALIAS):
19729 New #define for adding aliases to %token.
19730 (struct bucket): Added `alias' field.
19731
19732 * src/reduce.c (reduce_grammar):
19733 Revise error message.
19734 (print_notices): Remove final `.' from error message.
19735
19736 * src/reader.c (reader_output_yylsp):
19737 New function.
19738 (readgram): Use `#if 0' around code that accepted %command
19739 inside grammar rules: The documentation doesn't allow it,
19740 and it will fail since the %command processors scan for the next %.
19741 (parse_token_decl): Extended the %token
19742 declaration to allow a multi-character symbol as an alias.
19743 (parse_thong_decl): New function.
19744 (read_declarations): Added %thong declarations.
19745 (read_declarations): Handle NOOP to deal with allowing
19746 % declarations as another means to specify the flags.
19747 (readgram): Allow %prec prior to semantics embedded in a rule.
19748 (skip_to_char, read_declarations, copy_definition)
19749 (parse_token_decl, parse_start_decl, parse_type_decl)
19750 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
19751 (get_type_name, copy_guard, copy_action, readgram)
19752 (get_type, packsymbols): Revised most error messages.
19753 Changed `fatal' to `warnxxx' to avoid aborting for error.
19754 Revised and use multiple warnxxx functions to avoid using VARARGS1.
19755 (read_declarations): Improve the error message for
19756 an invalid character. Do not abort.
19757 (read_declarations, copy_guard, copy_action): Use
19758 printable_version to avoid unprintable characters in printed output.
19759 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
19760 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
19761 Allow the type of a non-terminal can be given
19762 more than once, as long as all specifications give the same type.
19763
19764 * src/output.c:
19765 (output_headers, output_trailers, output, output_gram)
19766 (output_rule_data): Implement noparserflag variable.
19767 Implement toknumflag variable.
19768 (output): Call reader_output_yylsp to output LTYPESTR.
19769
19770 * src/main.c (main):
19771 If reader sees an error, don't process the grammar.
19772 (fatals): Updated to not use VARARGS1.
19773 (printable_version, int_to_string, warn, warni, warns, warnss)
19774 (warnsss): New error reporting functions. Avoid abort for error.
19775
19776 * src/lex.h:
19777 Added THONG and NOOP for alias processing.
19778 Added SETOPT for the new code that allows setting options with %flags.
19779
19780 * src/lex.c:
19781 Include getopt.h. Add some extern decls.
19782 (safegetc): New function to deal with EOF gracefully.
19783 (literalchar); new function to deal with reading \ escapes.
19784 (lex): Use literalchar.
19785 (lex): Implemented "..." tokens.
19786 (literalchar, lex, parse_percent_token): Made tokenbuffer
19787 always contain the token. This includes growing the token
19788 buffer while reading an integer.
19789 (parse_percent_token): Replaced if-else statement with percent_table.
19790 (parse_percent_token): Added % declarations as another
19791 way to specify the flags -n, -l, and -r. Also added hooks for
19792 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
19793 major changes to files.c.
19794 (lex) Retain in the incoming stream a character following
19795 an incorrect '/'.
19796 (skip_white_space, lex): Revised most error messages
19797 and changed fatal to warn to avoid aborting.
19798 (percent_table): Added %thong declarations.
19799
19800 * src/gram.h: Comment changes.
19801
19802 * src/files.c (openfiles, open_extra_files, done):
19803 Add faction flag
19804 and actfile file. Handle noparserflag. Both for -n switch.
19805
19806 * src/conflicts.c (resolve_sr_conflict):
19807 Remove use of alloca.
19808
19809 1995-06-01 Jim Meyering <meyering@gnu.org>
19810
19811 * doc/bison.texinfo: *** empty log message ***
19812
19813 1995-05-06 Richard Stallman <rms@gnu.org>
19814
19815 * src/bison.s1: Comment change.
19816
19817 1995-05-06 Richard Stallman <rms@gnu.org>
19818
19819 * bison.simple: Comment change.
19820
19821 1995-05-03 Richard Stallman <rms@gnu.org>
19822
19823 * src/version.c: Version now 1.24.
19824
19825 * src/bison.s1: Change distribution terms.
19826
19827 * src/version.c: Version now 1.23.
19828
19829 1995-05-03 Richard Stallman <rms@gnu.org>
19830
19831 * doc/bison.texinfo:
19832 Rewrite "Conditions for Using Bison".
19833 Update version to 1.24.
19834
19835 1995-05-03 Richard Stallman <rms@gnu.org>
19836
19837 * bison.simple: Change distribution terms.
19838
19839 1995-02-23 Richard Stallman <rms@gnu.org>
19840
19841 * src/files.c: Test __VMS_POSIX as well as VMS.
19842
19843 1995-02-14 Jim Meyering <meyering@gnu.org>
19844
19845 * src/bison.s1 (__yy_memcpy):
19846 Renamed from __yy_bcopy to avoid
19847 confusion. Reverse FROM and TO arguments to be consistent with
19848 those of memcpy.
19849
19850 1995-02-14 Jim Meyering <meyering@gnu.org>
19851
19852 * bison.simple (__yy_memcpy):
19853 Renamed from __yy_bcopy to avoid
19854 confusion. Reverse FROM and TO arguments to be consistent with
19855 those of memcpy.
19856
19857 1994-11-10 David J. MacKenzie <djm@gnu.org>
19858
19859 * NEWS: reformat
19860
19861 * NEWS: New file.
19862
19863 * Makefile.in (DISTFILES): Include NEWS.
19864
19865 * Makefile.in (DISTFILES):
19866 Include install-sh, not install.sh.
19867
19868 * configure.in: Update to Autoconf v2 macro names.
19869
19870 1994-10-05 David J. MacKenzie <djm@gnu.org>
19871
19872 * Makefile.in: fix typo
19873
19874 * Makefile.in (prefix, exec_prefix):
19875 Let configure set them.
19876
19877 1994-09-28 David J. MacKenzie <djm@gnu.org>
19878
19879 * Makefile.in: Set datadir to $(prefix)/share.
19880
19881 1994-09-15 Richard Stallman <rms@gnu.org>
19882
19883 * src/bison.s1:
19884 Update copyright notice and GPL version.
19885
19886 1994-09-15 Richard Stallman <rms@gnu.org>
19887
19888 * bison.simple:
19889 Update copyright notice and GPL version.
19890
19891 1994-07-12 Richard Stallman <rms@gnu.org>
19892
19893 * src/reduce.c, src/reader.c:
19894 entered into RCS
19895
19896 1994-05-05 David J. MacKenzie <djm@gnu.org>
19897
19898 * Makefile.in: entered into RCS
19899
19900 1994-03-26 Richard Stallman <rms@gnu.org>
19901
19902 * src/bison.s1: entered into RCS
19903
19904 1994-03-26 Richard Stallman <rms@gnu.org>
19905
19906 * bison.simple: entered into RCS
19907
19908 1994-03-25 Richard Stallman <rms@gnu.org>
19909
19910 * src/main.c: entered into RCS
19911
19912 1994-03-24 Richard Stallman <rms@gnu.org>
19913
19914 * src/conflicts.c: entered into RCS
19915
19916 1994-01-02 Richard Stallman <rms@gnu.org>
19917
19918 * Makefile.in: *** empty log message ***
19919
19920 1993-11-21 Richard Stallman <rms@gnu.org>
19921
19922 * src/bison.s1: *** empty log message ***
19923
19924 1993-11-21 Richard Stallman <rms@gnu.org>
19925
19926 * doc/bison.texinfo: entered into RCS
19927
19928 * doc/bison.texinfo: *** empty log message ***
19929
19930 1993-11-21 Richard Stallman <rms@gnu.org>
19931
19932 * bison.simple: *** empty log message ***
19933
19934 1993-10-25 David J. MacKenzie <djm@gnu.org>
19935
19936 * doc/bison.texinfo: *** empty log message ***
19937
19938 1993-10-19 Richard Stallman <rms@gnu.org>
19939
19940 * src/bison.s1: *** empty log message ***
19941
19942 1993-10-19 Richard Stallman <rms@gnu.org>
19943
19944 * bison.simple: *** empty log message ***
19945
19946 1993-10-14 Richard Stallman <rms@gnu.org>
19947
19948 * src/bison.s1: *** empty log message ***
19949
19950 1993-10-14 Richard Stallman <rms@gnu.org>
19951
19952 * bison.simple: *** empty log message ***
19953
19954 1993-09-14 David J. MacKenzie <djm@gnu.org>
19955
19956 * doc/bison.texinfo: *** empty log message ***
19957
19958 1993-09-13 Noah Friedman <friedman@gnu.org>
19959
19960 * Makefile.in: *** empty log message ***
19961
19962 1993-09-10 Richard Stallman <rms@gnu.org>
19963
19964 * src/conflicts.c: *** empty log message ***
19965
19966 * src/system.h: entered into RCS
19967
19968 1993-09-10 Richard Stallman <rms@gnu.org>
19969
19970 * doc/bison.1: entered into RCS
19971
19972 1993-09-06 Noah Friedman <friedman@gnu.org>
19973
19974 * src/version.c: entered into RCS
19975
19976 1993-09-06 Noah Friedman <friedman@gnu.org>
19977
19978 * Makefile.in: *** empty log message ***
19979
19980 1993-07-30 David J. MacKenzie <djm@gnu.org>
19981
19982 * Makefile.in: *** empty log message ***
19983
19984 1993-07-24 Richard Stallman <rms@gnu.org>
19985
19986 * src/bison.s1: *** empty log message ***
19987
19988 1993-07-24 Richard Stallman <rms@gnu.org>
19989
19990 * bison.simple: *** empty log message ***
19991
19992 1993-07-08 David J. MacKenzie <djm@gnu.org>
19993
19994 * Makefile.in: *** empty log message ***
19995
19996 1993-07-04 Richard Stallman <rms@gnu.org>
19997
19998 * src/bison.s1: *** empty log message ***
19999
20000 1993-07-04 Richard Stallman <rms@gnu.org>
20001
20002 * bison.simple: *** empty log message ***
20003
20004 1993-06-26 David J. MacKenzie <djm@gnu.org>
20005
20006 * src/getargs.c: entered into RCS
20007
20008 1993-06-26 David J. MacKenzie <djm@gnu.org>
20009
20010 * doc/bison.texinfo: *** empty log message ***
20011
20012 * doc/bison.1: New file.
20013
20014 1993-06-25 Richard Stallman <rms@gnu.org>
20015
20016 * src/getargs.c: New file.
20017
20018 1993-06-16 Richard Stallman <rms@gnu.org>
20019
20020 * src/bison.s1: *** empty log message ***
20021
20022 1993-06-16 Richard Stallman <rms@gnu.org>
20023
20024 * bison.simple: *** empty log message ***
20025
20026 1993-06-03 Richard Stallman <rms@gnu.org>
20027
20028 * src/bison.s1: New file.
20029
20030 1993-06-03 Richard Stallman <rms@gnu.org>
20031
20032 * doc/bison.texinfo: *** empty log message ***
20033
20034 1993-06-03 Richard Stallman <rms@gnu.org>
20035
20036 * bison.simple: New file.
20037
20038 1993-05-19 Richard Stallman <rms@gnu.org>
20039
20040 * doc/bison.texinfo: New file.
20041
20042 1993-05-07 Noah Friedman <friedman@gnu.org>
20043
20044 * Makefile.in: *** empty log message ***
20045
20046 1993-04-28 Noah Friedman <friedman@gnu.org>
20047
20048 * src/reader.c: *** empty log message ***
20049
20050 1993-04-23 Noah Friedman <friedman@gnu.org>
20051
20052 * src/alloc.h: entered into RCS
20053
20054 1993-04-20 David J. MacKenzie <djm@gnu.org>
20055
20056 * src/version.c: *** empty log message ***
20057
20058 * src/files.c, src/allocate.c:
20059 entered into RCS
20060
20061 * src/reader.c: *** empty log message ***
20062
20063 * src/lex.c: entered into RCS
20064
20065 * src/conflicts.c: New file.
20066
20067 * src/symtab.c: entered into RCS
20068
20069 * src/alloc.h: New file.
20070
20071 * src/LR0.c: entered into RCS
20072
20073 1993-04-18 Noah Friedman <friedman@gnu.org>
20074
20075 * src/reader.c: New file.
20076
20077 * src/version.c: *** empty log message ***
20078
20079 1993-04-18 Noah Friedman <friedman@gnu.org>
20080
20081 * Makefile.in: *** empty log message ***
20082
20083 1993-04-17 Noah Friedman <friedman@gnu.org>
20084
20085 * Makefile.in: *** empty log message ***
20086
20087 1993-04-15 Richard Stallman <rms@gnu.org>
20088
20089 * src/main.c, src/files.c:
20090 New file.
20091
20092 1993-04-15 Noah Friedman <friedman@gnu.org>
20093
20094 * configure.in: entered into RCS
20095
20096 * configure.in: *** empty log message ***
20097
20098 * configure.in: New file.
20099
20100 1993-04-14 Richard Stallman <rms@gnu.org>
20101
20102 * Makefile.in: New file.
20103
20104 1993-04-13 Richard Stallman <rms@gnu.org>
20105
20106 * src/version.c: New file.
20107
20108 1993-03-25 Richard Stallman <rms@gnu.org>
20109
20110 * src/output.c: entered into RCS
20111
20112 1992-09-25 Richard Stallman <rms@gnu.org>
20113
20114 * configure.bat: entered into RCS
20115
20116 1992-06-22 Richard Stallman <rms@gnu.org>
20117
20118 * src/vmsgetargs.c: entered into RCS
20119
20120 1992-06-22 Richard Stallman <rms@gnu.org>
20121
20122 * doc/bison.rnh: entered into RCS
20123
20124 1992-04-20 David J. MacKenzie <djm@gnu.org>
20125
20126 * README: entered into RCS
20127
20128 1992-01-22 Richard Stallman <rms@gnu.org>
20129
20130 * src/machine.h: entered into RCS
20131
20132 1991-12-21 Richard Stallman <rms@gnu.org>
20133
20134 * src/lalr.c, src/closure.c:
20135 entered into RCS
20136
20137 1991-12-20 Richard Stallman <rms@gnu.org>
20138
20139 * src/state.h: entered into RCS
20140
20141 1991-12-18 Richard Stallman <rms@gnu.org>
20142
20143 * src/print.c, src/nullable.c, src/derives.c:
20144 entered into RCS
20145
20146 1991-11-03 David J. MacKenzie <djm@gnu.org>
20147
20148 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
20149 entered into RCS
20150
20151 1988-09-09 Richard Stallman <rms@gnu.org>
20152
20153 * src/bison.hairy: entered into RCS
20154
20155 1987-12-16 Richard Stallman <rms@gnu.org>
20156
20157 * REFERENCES: entered into RCS
20158
20159
20160 -----
20161
20162 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
20163 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
20164 Free Software Foundation, Inc.
20165
20166 Copying and distribution of this file, with or without
20167 modification, are permitted provided the copyright notice and this
20168 notice are preserved.
20169
20170 $Id$