1 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
3 * THANKS: Add Eric Blake.
5 2008-04-23 Eric Blake <ebb9@byu.net>
7 Revert prior patch, by working around autoconf regression.
8 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
9 ("Output file name: ("): Uncomment test.
10 ("Output file name: )"): Likewise.
11 Based on an idea from Noah Misch.
13 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
15 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
16 2.61. Reported by Juan Manuel Guerrero at
17 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
18 * tests/output.at ("Output file name: ("): Comment out test case for
20 ("Output file name: )"): Likewise.
22 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
24 * GNUmakefile: Update git-version-gen invocation so make dist
27 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
29 Update to the current gnulib CVS repository, and fix trigraph handling
31 * bootstrap: Update gnulib CVS repository URL.
32 (symlink_to_dir): Encapsulate the code that guarantees the destination
33 directory exists into...
34 (check_dst_dir): ... this new function, and...
35 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
36 fail when copying files into lib/uniwidth/.
37 * src/output.c (prepare_symbols): When writing yytname muscles, where
38 symbol names will be encoded in C-string literals, tell quotearg to
39 escape trigraphs. This used to be the default in gnulib.
40 * tests/regression.at (Token definitions): Because of the change in
41 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
42 escapes trigraphs in symbol names. Thus, yytname no longer has
43 trigraphs unnecessarily doubly escaped. Update test case output.
44 Extend test case to be sure Bison's own error messages will no longer
45 have trigraphs in symbol names unnecessarily escaped once.
47 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
49 Fix make dist infinite loop reported by Juan Manuel Guerrero at
50 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
51 * .cvsignore: Add .version.
53 * bootstrap.conf (gnulib_modules): Add git-version-gen.
54 * configure.ac (AC_CONFIG_FILES): Add .version.
55 * build-aux/.cvsignore: Add git-version-gen.
57 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
59 * NEWS (2.3a+): Mention that -g now takes an argument.
60 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
61 consistency. Update the -g and -x entries now that they take
62 arguments. Use brackets to indicate optional arguments.
63 * src/getargs.c (usage): Explain the relationship between arguments of
64 long and short options more completely. Document --defines and -d
65 separately since the former takes an argument but, for POSIX Yacc, the
67 (short_options): Let -W take an optional argument like --warnings.
68 (getargs): Sort cases.
70 2008-02-28 Akim Demaille <demaille@gostai.com>
72 * doc/bison.texinfo: Fix a few typos.
74 2008-02-28 Akim Demaille <akim@epita.fr>
76 * doc/bison.texinfo (Bison Options): Document -W.
77 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
79 2008-02-28 Akim Demaille <akim@epita.fr>
81 * src/getargs.c (short_options): Split and sort for readability.
82 -g and -x take optional arguments, just like their long options.
83 * build-aux/cross-options.pl: Use /x to make the regexp easier to
85 Fix the handling of $opt which resulted in all the argument to be
86 considered as optional.
88 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
90 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
91 say its interface is experimental.
92 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
94 (Bison Options): In the -L and --language entry, mention Java.
95 (Java Bison Interface): Say the interface is experimental.
96 * src/getargs.c (usage): Mention -L and --language.
98 * NEWS (2.3a+): Say the push parsing interface is experimental.
99 * doc/bison.texinfo (Push Decl): Likewise.
100 (Decl Summary): Likewise in the "%define api.push_pull" entry.
101 (Push Parser Function): Likewise.
102 (Pull Parser Function): Likewise.
103 (Parser Create Function): Likewise.
104 (Parser Delete Function): Likewise.
105 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
106 yypull_parse, and yypush_parse entries.
108 * NEWS (2.3a+): Mention XML support, and say the schema is
110 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
111 * src/getargs.c (usage): Say the XML schema is experimental.
113 * NEWS (2.3a+): Say option instead of flag.
115 2008-02-21 Wojciech Polak <polak@gnu.org>
117 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
120 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
122 Fix impure push parser compile error reported by Bob Rossi at
123 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
124 * data/yacc.c: Clean up whitespace in the output a little.
125 (yypstate_allocated): Define for impure push parsers regardless of
126 whether the pull interface is also requested.
127 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
128 check impure push parsers without the pull interface.
130 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
131 yyerror takes arguments specified by %parse-param while yypstate_new
133 * doc/bison.texinfo (Parser Create Function): Document that
134 yypstate_new returns 0 for multiple impure parser instances.
135 * tests/push.at (Push Parsing: Multiple impure instances): Update
136 expected stderr output.
138 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
140 * runtime-po/POTFILES.in (push.c): Remove.
142 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
144 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
145 * data/push.c: Rename to...
146 * data/yacc.c: ... this, overwriting it.
147 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
148 `%push-pull-parser' -> `%define api.push_pull "both"'.
149 Remove old yacc.c tests, and update push.c tests to yacc.c.
151 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
153 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
154 `"%code top" blocks' instead of `%code "top" blocks'.
155 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
156 Clean up whitespace in the output a little.
158 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
160 Fix documentation problems reported by Tim Josling at
161 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
162 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
163 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
164 integers. Explain the effect of literal string aliases on error
165 messages. Copy token 0 documentation from the C++ skeleton
168 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
170 Accept a token number in a %left, %right, or %nonassoc for POSIX
171 conformance. Reported by Tim Josling at
172 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
173 * NEWS (2.3a+): Mention.
174 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
175 and code numbers are treated by precedence declarations.
176 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
178 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
180 (symbol.prec): New, just like symbol but allows INT.
181 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
183 * tests/regression.at (Token number in precedence declaration): New
186 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
188 DJGPP specific issues.
189 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
190 be changed. Copyright timestamp adjusted.
191 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
192 be changed. Copyright timestamp adjusted.
193 * djgpp/config.site: Copyright timestamp adjusted.
194 * djgpp/config_h.sed: Copyright timestamp adjusted.
195 * djgpp/djunpack.bat: Copyright timestamp adjusted.
196 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
197 filename translation list.
198 * djgpp/subpipe.c (init_subpipe): Check the environment variables
199 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
200 files shall be created. Before trying to use the temp dir where the
201 environment variable points to check that the dir really exists. If
202 not default to the cwd as temp dir. Copyright timestamp adjusted.
203 * djgpp/subpipe.h: Copyright timestamp adjusted.
204 * djgpp/testsuite.sed: Copyright timestamp adjusted.
206 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
208 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
210 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
212 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
213 Problem reported by Claudio Saavedra in
214 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
216 2008-01-05 Wojciech Polak <polak@gnu.org>
218 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
219 document's title with the input grammar file name.
221 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
223 Automate regression testing of the XML/XSLT implementation. Discussed
225 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
226 * configure.ac (XSLTPROC): New substitution.
227 * Makefile.am (maintainer-xml-check): New phony target invoking...
228 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
229 invoking make maintainer-check with BISON_TEST_XML=1.
230 * tests/atlocal.in (XSLTPROC): New.
231 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
232 not to report reachable memory when Bison is expected to have a
233 non-zero exit status and (2) to compare XML/XSLT output with --graph
234 and --report=all output for every working grammar when
236 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
237 (AT_BISON_CHECK_XML): New.
238 (AT_QUELL_VALGRIND): New.
239 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
240 (AT_CHECK): ... don't redefine this since this was the old way to
242 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
243 AT_BISON_CHECK invocations.
244 * tests/c++.at: Likewise.
245 * tests/calc.at: Likewise.
246 * tests/conflicts.at: Likewise.
247 * tests/cxx-type.at: Likewise.
248 * tests/existing.at: Likewise.
249 * tests/glr-regression.at: Likewise.
250 * tests/headers.at: Likewise.
251 * tests/input.at: Likewise.
252 * tests/java.at: Likewise.
253 * tests/output.at: Likewise.
254 * tests/push.at: Likewise.
255 * tests/reduce.at: Likewise.
256 * tests/regression.at: Likewise.
257 * tests/sets.at: Likewise.
258 * tests/skeletons.at: Likewise.
259 * tests/synclines.at: Likewise.
260 * tests/torture.at: Likewise.
261 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
262 tends to hang xsltproc.
263 (Big horizontal): Likewise.
265 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
267 In XML output, remove redundant class attribute on symbol element.
268 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
269 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
270 look up a symbol to determine whether it's a nonterminal or terminal.
271 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
272 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
274 Add prec/assoc information to XML output.
275 * src/gram.c (grammar_rules_print_xml): For each rule that has a
276 %prec, add a percent_prec attribute.
277 * src/print-xml.c (print_grammar): For each terminal that has a
278 precedence or associativity, add a prec or assoc attribute.
280 (xml_puts): Use xml_indent.
281 (xml_printf): Use xml_indent.
282 * src/print-xml.h (xml_indent): Prototype.
284 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
285 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
287 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
289 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
290 (bison:ruleByNumber): ... this for clarity.
291 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
292 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
293 (xsl:template match="reduction"): Update.
294 (xsl:template match="item"): Update.
295 (xsl:template match="reduction"): Update.
297 In the XML output, don't print the list of rules where symbols appear.
298 Compute it in XSLT instead. Discussed at
299 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
300 * data/xslt/bison.xsl (bison:ruleByLhs): New.
301 (bison:ruleByRhs): New.
302 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
304 (xsl:template match="terminal/rule"): Remove.
305 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
307 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
309 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
310 bison:ruleByRhs and mode="number-link" for rule template.
311 (xsl:template match="terminal/rule"): Remove.
312 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
313 bison:ruleByRhs and mode="number-link" for rule template.
314 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
316 (xsl:template match="rule" mode="number-link"): ... this.
317 * src/print-xml.c (print_grammar): Don't print the list of rules.
319 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
321 Don't let --report affect XML output; always print all information.
323 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
324 * src/conflicts.c (log_resolution): Implement.
325 * src/print-xml.c (print_core): Implement.
326 (print_state): Implement.
327 (print_xml): Implement.
329 * NEWS (2.3a+): Fix quotes.
330 * src/parse-gram.y (prologue_declaration): For consistency with -v,
331 don't let %verbose clear the list specified by --report.
333 2007-11-26 Akim Demaille <akim@epita.fr>
335 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
337 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
339 In the XML output, list useless and unused symbols and rules with the
340 useful ones and add a "usefulness" attribute. Discussed starting at
341 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
342 * src/gram.c (grammar_rules_partial_print_xml): Remove.
343 (grammar_rules_print_xml): Print all rules instead of just those
344 useful in the grammar, and add a "usefulness" attribute.
345 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
346 * src/print-xml.c (print_rules_useless_in_parser): Remove.
347 (print_grammar): Print all nonterminals instead of just useful ones,
348 and add a "usefulness" attribute to nonterminals and terminals.
349 (print_xml): Don't print a separate "reductions" or
350 "rules-useless-in-parser" element.
351 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
352 (reduce_xml): Remove.
353 (reduce_token_unused_in_grammar): New.
354 (reduce_nonterminal_useless_in_grammar): New.
355 * src/reduce.h (reduce_xml): Remove prototype.
356 (reduce_token_unused_in_grammar): Add prototype.
357 (reduce_nonterminal_useless_in_grammar): Add prototype.
358 * data/xslt/xml2text.xsl: Update for XML changes.
359 * data/xslt/xml2xhtml.xsl: Update for XML changes.
360 * tests/reduce.at (Useless Terminals): Update output.
361 (Useless Rules): Update output.
362 (Reduced Automaton): Update output.
364 Say "Terminals unused in grammar" instead of "Unused terminals".
365 * NEWS (2.3a+): Update.
366 * doc/bison.texinfo (Understanding): Update example output.
367 * src/reduce.c (reduce_output): Implement.
368 * data/xslt/xml2text.xsl: Implement.
369 * data/xslt/xml2xhtml.xsl: Implement.
371 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
373 Accept --report-file=FILE to override the default `.output' filename.
374 * NEWS (2.3a+): Mention.
375 * doc/bison.texinfo (Bison Options): Add an entry.
376 * src/files.c (compute_output_file_names): Don't override
377 spec_verbose_file if already set.
378 * src/getargs.c (usage): Document --report-file.
379 (REPORT_FILE_OPTION): New anonymous enum member.
380 (long_options): Add entry for it.
381 (getargs): Add case for it setting spec_verbose_file.
383 * build-aux/cross-options.pl: Don't record a short option just because
385 * doc/.cvsignore: Add yacc.1.
387 2007-11-14 Akim Demaille <akim@epita.fr>
389 * doc/yacc.1.in: New.
390 * configure.ac, doc/Makefile.am: Adjust.
391 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
393 Use AC_SUBST for assignments too.
394 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
396 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
398 * src/gram.c: Remove comments that duplicate comments in gram.h.
400 When reporting useless rules and nonterminals, say "useless in grammar"
401 instead of "useless", and say "useless in parser" instead of "never
402 reduced". Discussed starting at
403 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
404 * NEWS (2.3a+): Mention this change.
405 * data/xslt/xml2text.xsl: Update output text and expected input XML
406 element names to match changes below.
407 * data/xslt/xml2xhtml.xsl: Likewise.
408 (xsl:template match="bison-xml-report"): Add missing entry in Table of
409 Contents: "Rules useless in parser due to conflicts".
410 * doc/bison.texinfo (Decl Summary): Reword a little.
411 (Understanding): Update example output for changes below.
412 * src/gram.c: (rule_useful_p): Rename to...
413 (rule_useful_in_grammar_p): ... this.
414 (rule_useless_p): Rename to...
415 (rule_useless_in_grammar_p): ... this.
416 (rule_never_reduced_p): Rename to...
417 (rule_useless_in_parser_p): ... this.
418 (grammar_rules_print): Update for renames.
419 (grammar_rules_print_xml): Update for renames.
420 (grammar_rules_never_reduced_report): Rename to...
421 (grammar_rules_useless_report): ... this since it is used for either
422 kind of useless rule.
423 * src/gram.h: Reword comments and update function names in prototypes.
424 * src/main.c (main): Say "rule useless in parser due to conflicts".
425 * src/print-xml.c (print_rules_never_reduced): Rename to...
426 (print_rules_useless_in_parser): ... this, and rename output XML
427 element "rules-never-reduced" to "rules-useless-in-parser".
428 (print_xml): Update for rename.
429 * src/print.c (print_results): Say "Rules useless in parser due to
431 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
432 (nonterminals_reduce): Say "nonterminal useless in grammar".
433 (reduce_output): Say "Nonterminals useless in grammar".
434 Say "Rules useless in grammar".
435 (reduce_xml): Rename output XML element "useless" to
436 "useless-in-grammar".
437 (reduce_print): Don't report the count of grammatically useless rules
438 as "rules never reduced" just because %yacc is specified.
439 In the correct report of this count, say nonterminal(s) and rule(s)
440 "useless in grammar".
441 * tests/conflicts.at (S/R in initial): Update expected output.
442 (Defaulted Conflicted Reduction): Likewise.
443 (Unreachable States After Conflict Resolution): Likewise.
444 * tests/existing.at (GNU pic Grammar): Likewise.
445 * tests/reduce.at (Useless Nonterminals): Likewise.
446 (Useless Rules): Likewise.
447 (Reduced Automaton): Likewise.
448 (Underivable Rules): Likewise.
449 (Empty Language): Likewise.
451 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
453 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
454 here document and before the EOF so that BSD's implementation of Bourne
455 shell doesn't parse the delimiter as part of the here document.
456 * doc/.cvsignore: Add cross-options.texi.
457 * src/getargs.c (usage): Add a blank line after the warning categories.
459 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
461 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
463 2007-11-05 Akim Demaille <akim@epita.fr>
465 Remove Id: from bison.1.
466 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
467 (perl -0777 -pi -e 's/\.PP\nId): New.
468 (.x.1): Use it to ignore the version control revision.
470 2007-11-05 Akim Demaille <demaille@gostai.com>
472 * build-aux/Makefile.am: Ship cross-options.pl.
473 * doc/Makefile.am: Always refer to cross-options.texi with
475 (MAINTAINERCLEANFILES): Add it.
477 2007-11-04 Akim Demaille <demaille@gostai.com>
479 Generate the long/short option cross-table.
480 * build-aux/cross-options.pl: New.
481 * doc/Makefile.am (cross-options.texi): New.
482 * doc/bison.texinfo: Use it.
484 2007-11-04 Akim Demaille <demaille@gostai.com>
486 Generate bison.1 using help2man.
487 * doc/common.x, doc/bison.x: New.
488 * doc/Makefile.am (bison.1, .x.1): New.
489 The code is taken from autoconf-2.61/man/Makefile.am.
490 * configure.ac: Look for help2man.
492 2007-11-04 Akim Demaille <demaille@gostai.com>
495 * src/getargs.c (usage): Document -W, make it clear that -d,
496 -g and -x have optional arguments.
498 2007-11-04 Akim Demaille <demaille@gostai.com>
500 Find sha1sum when named gsha1sum.
501 * bootstrap (find_tool): New.
504 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
506 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
508 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
509 * NEWS (2.3a+): Mention.
510 * data/bison.m4 (b4_pure_if): Don't define it here.
511 * data/c.m4 (b4_identification): Depend on individual skeletons to
512 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
513 values of the %define variables api.pure or api.push_pull. Define
514 YYPURE, YYPUSH, and YYPULL accordingly.
515 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
516 glr.cc has already defined b4_pure_flag.
517 * data/push.c: Define b4_pure_if based on `%define api.pure'.
518 Remove YYPUSH and YYPULL since they're back in b4_identification again.
519 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
520 * doc/bison.texinfo (Pure Decl): Update.
522 (Decl Summary): Add api.pure to %define entry.
523 In %pure-parser entry, say it's deprecated and reference %define.
524 (Pure Calling): Update.
525 (Error Reporting): Update.
526 (C++ Scanner Interface): Update.
527 (How Can I Reset the Parser): Update.
528 (Table of Symbols): In %pure-parser entry, say it's deprecated and
530 * src/getargs.c (pure_parser): Remove global variable.
531 * src/getargs.h (pure_parser): Remove extern.
532 * src/output.c (prepare): Don't define pure_flag muscle.
533 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
534 wrapper around `%define api.pure'.
535 * tests/calc.at (Simple LALR Calculator): Update.
536 (Simple GLR Calculator): Update.
537 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
539 (GLR: Resolve ambiguity, pure, locations): Update.
540 (GLR: Merge conflicting parses, pure, no locations): Update.
541 (GLR: Merge conflicting parses, pure, locations): Update.
542 * tests/glr-regression.at (Uninitialized location when reporting
544 * tests/input.at (Unused %define api.pure): New test case.
545 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
546 AT_PURE_IF and AT_PURE_AND_LOC_IF.
547 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
549 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
551 %define push_pull -> %define api.push_pull. Discussed starting at
552 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
553 * data/push.c: Expect the new name.
554 * data/yacc.c: Likewise.
555 * doc/bison.texinfo (Push Decl): Update.
556 (Decl Summary): Update %define entry.
557 (Push Parser Function): Update.
558 (Pull Parser Function): Update.
559 (Parser Create Function): Update.
560 (Parser Delete Function): Update.
561 * tests/calc.at (Simple LALR Calculator): Update.
562 * tests/input.at (%define enum variables): Update.
563 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
564 (Push Parsing: Multiple impure instances): Update.
565 (Push Parsing: Unsupported Skeletons): Update.
566 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
567 (Exploding the Stack Size with Malloc): Update.
569 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
572 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
574 For the XML output's terminal element, rename @number to @token-number,
575 and add @symbol-number. In the nonterminal element, rename @number to
576 @symbol-number. Discussed starting at
577 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
578 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
580 (xsl:template match="nonterminal"): Likewise.
581 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
582 (xsl:template match="nonterminal"): Likewise.
583 * src/print-xml.c (print_grammar): Implement.
585 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
587 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
588 2007-10-11 change, the child elements here are items not rules.
589 (xsl:template match="item"): New.
590 (xsl:template match="rule"): Update for new reduced itemset.
591 (xsl:template match="point"): Remove.
592 (xsl:template match="empty"): For consistency with --graph, don't
593 output "/* empty */".
594 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
595 line-wrap, don't pass a negative value as first-line-length since this
596 won't work with the following changes.
597 (xsl:template name="line-wrap"): Simplify slightly.
598 (xsl:template name="ws-search"): Eliminate recursion.
599 * src/print_graph.c (print_core): Don't print a reduction's lookahead
600 set next to an item whose dot is not at the end of the RHS even if it
601 happens to be associated with the same rule.
603 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
605 Add %define lr.keep_unreachable_states.
606 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
607 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
608 * src/main.c (main): Implement it.
609 * tests/conflicts.at (Unreachable States After Conflict Resolution):
610 Extend to test it, and fix a typo.
612 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
614 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
615 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
616 the example .output text.
617 * tests/regression.at (Extra lookahead sets in report): Improve wording
620 2007-10-17 Wojciech Polak <polak@gnu.org>
622 * src/print-xml.c (print_grammar): Renamed
623 <terminal> and <nonterminal> attributes:
624 "type" to "number" and "symbol" to "name".
625 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
626 Use new attribute names.
627 (xsl:template match="nonterminal"): Likewise.
628 * data/xslt/xml2xhtml.xsl: Likewise.
630 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
632 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
633 (Option Cross Key): Likewise.
635 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
636 next to an item whose dot is not at the end of the RHS even if it
637 happens to be associated with the same rule.
638 * src/print.c (print_core): Likewise.
639 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
640 (Resolved SR Conflicts): Update output.
641 * tests/regression.at (Extra lookahead sets in report): New test case.
643 2007-10-11 Wojciech Polak <polak@gnu.org>
645 * src/print-xml.c (print_core): Remove item set
647 * data/xslt/bison.xsl (bison:ruleNumber): New key.
648 Improve processing time. Suggested by Joel E. Denny.
649 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
650 Write xsl:param "required" attribute as comment.
651 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
652 (xsl:template match="rule"): Support new reduced itemset.
653 (xsl:template match="point"): Remove.
654 * data/xslt/xml2xhtml.xsl: Likewise.
656 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
658 * src/getargs.c (version): Update copyright year.
660 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
662 Make xml2dot.xsl and --graph produce the same output.
663 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a ` '
664 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
666 (xsl:template name="output-node"): Use the new escape template instead
667 of the string-replace template directly.
668 (xsl:template name="output-edge"): Likewise.
669 (xsl:template name="escape"): New, escapes backslashes and newlines in
670 addition to quotation marks.
671 * src/graphviz.c (start_graph, output_node, output_edge): Add
672 whitespace to output for legibility.
674 Make xml2text.xsl and --report produce the same output, and remove the
675 XML "conflicts" element since a conflict summary is easily extracted
677 * data/xslt/bison.xsl: New.
678 (xsl:template match="state" mode="bison:count-conflicts): New.
679 * data/xslt/xml2text.xsl: Import bison.xsl.
680 (xsl:template match="bison-xml-report"): Instead of styling the
681 "conflicts" element, style the "automaton" element with mode
682 "conflicts". Unlike the former, the latter lists S/R and R/R
683 conflicts for a state on the same line.
684 (xsl:template match="conflicts"): Remove.
685 (xsl:template match="conflict"): Remove.
686 (xsl:template match="terminal"): Line-wrap the list of rules in which
687 the terminal is used.
688 (xsl:template match="nonterminal"): Likewise for nonterminals.
689 (xsl:template match="automaton" mode="conflicts"): New.
690 (xsl:template match="state" mode="conflicts"): New.
691 (xsl:template name="line-wrap"): New.
692 (xsl:template name="ws-search"): New.
693 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
694 (xsl:template match="bison-xml-report"): Instead of styling the
695 "conflicts" element, style the "automaton" element with mode
697 (xsl:template match="conflicts"): Remove.
698 (xsl:template match="conflict"): Remove.
699 (xsl:template match="automaton" mode="conflicts"): New.
700 (xsl:template match="state" mode="conflicts): New.
701 * src/conflicts.c (conflicts_output_xml): Remove.
702 * src/conflicts.h (conflicts_output_xml): Remove prototype.
703 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
704 * src/print.c (print_grammar): Consistently wrap at the 66th column so
705 the corresponding XSLT is easier. Also, never wrap between a word and
706 the comma that follows it.
708 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
710 Improve C++ namespace support. Discussed starting at
711 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
712 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
713 b4_namespace_close): New macros that interpret the %define variable
714 "namespace" so its value can contain "::" to indicate nested
716 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
718 * data/lalr1.cc (b4_namespace): Likewise.
719 * data/location.cc (b4_namespace): Likewise.
720 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
721 inside a new table in the general %define entry. Document `%define
722 namespace' there as well. Point the %name-prefix entry to it since it
723 explains it more completely in the case of C++.
724 (C++ Bison Interface): Mention `%define namespace' instead of
726 (Table of Symbols): Remove the `%define push_pull' entry. The %define
728 * tests/c++.at (Relative namespace references): New test case.
729 (Absolute namespace references): New test case.
730 (Syntactically invalid namespace references): New test case.
731 * tests/input.at (C++ namespace reference errors): New test case.
733 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
735 Add syncline support and location accessor to internal %define
737 * data/bison.m4 (b4_percent_define_get_loc): New.
738 (b4_percent_define_get_syncline): New.
739 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
740 (b4_percent_define_default): Record defining location as line 1 rather
741 than 0 for the sake of synchronizing #line's, and define
742 b4_percent_define_syncline(VARIABLE).
743 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
744 * src/muscle_tab.c (muscle_syncline_grow): New.
745 (muscle_code_grow): Use muscle_syncline_grow.
746 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
747 define b4_percent_define_syncline(VARIABLE).
748 (muscle_percent_define_get_loc): New.
749 (muscle_percent_define_get_syncline): New.
750 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
751 remove some unused variables.
752 (muscle_percent_define_default): Record defining location as line 1
753 rather than 0 for the sake of synchronizing #line's, and define
754 b4_percent_define_syncline(VARIABLE).
755 (muscle_percent_define_check_values): Use
756 muscle_percent_define_get_loc.
757 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
758 (muscle_percent_define_get_syncline): Prototype.
759 * tests/skeletons.at (%define Boolean variables: invalid skeleton
760 defaults): Update output for location change.
761 (Complaining during macro argument expansion): Extend to test
762 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
764 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
766 Fix some error-reporting macro bugs.
767 * data/bison.m4 (b4_cat): New.
768 (b4_error, b4_error_at): Use b4_cat to send error directives directly
769 to stdout so they don't become arguments to other macros. Update
770 comments and add examples.
771 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
773 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
774 after printing the error directive so that M4 doesn't report subsequent
775 problems that are induced by this problem.
776 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
777 instead of just in them. Recognize @\n in both places. Both expand to
778 the empty string. Needed by b4_cat.
779 * tests/skeletons.at (Complaining during macro argument expansion):
781 (Fatal errors make M4 exit immediately): New test case.
783 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
785 Implement --print-datadir.
786 * src/getargs.c (usage): Mention.
787 (PRINT_DATADIR_OPTION): New anonymous enum member.
788 (long_options): Add entry for it.
789 (getargs): Add case for it calling compute_pkgdatadir.
790 * src/output.c (output_skeleton): Encapsulate data directory
791 computation from here...
792 (prepare): ... and from here...
793 (compute_pkgdatadir): ... into this new function.
794 * src/output.h (compute_pkgdatadir): Prototype.
796 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
798 * src/print-xml.c (escape_bufs): New static global variable
800 (xml_escape_n): ... the static local variable buf here.
801 (print_xml): Free memory for escape_bufs.
802 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
804 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
806 Replace `%push-parser' and `%push-pull-parser' with
807 `%define push_pull "push"' and `%define push_pull "both"'.
808 `%define push_pull "pull"' is the default.
809 * doc/bison.texinfo (Push Decl, Push Parser Function,
810 Pull Parser Function, Parser Create Function, Parser Delete Function):
812 (Decl Summary, Table of Symbols): Replace %push-parser and
813 %push-pull-parser entries with a %define push_pull entry.
814 * data/bison.m4 (b4_percent_define_check_values): New macro.
815 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
817 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
819 * data/push.c: ... to here and compute them from the value of the
820 %define variable push_pull.
821 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
822 parsing requests here...
823 * data/yacc.c: ... hack this to switch to push.c any time
824 b4_use_push_pull_flag or the %define variable push_pull is set. This
825 will go away when we mv push.c yacc.c.
826 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
827 push parsing is not supported since unused %define variables are
829 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
830 * src/muscle_tab.h (muscle_percent_define_check_values): Update
831 comments for consistency with b4_percent_define_check_values.
832 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
834 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
836 (prologue_declaration): Remove %push-parser and %push-pull-parser
838 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
839 * tests/calc.at: Update declarations.
840 * tests/input.at (%define enum variables): New test case.
841 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
843 (Push Parsing: Multiple impure instances): Update declaration.
844 (Push Parsing: Unsupported Skeletons): New test case.
845 * tests/torture.at (Exploding the Stack Size with Alloca): Update
847 (Exploding the Stack Size with Malloc): Update declaration.
849 2007-09-24 Wojciech Polak <polak@gnu.org>
851 Add XSLT transformations.
853 * data/xslt/xml2dot.xsl: Transform XML into DOT.
854 * data/xslt/xml2text.xsl: Transform XML into plain text.
855 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
856 * data/Makefile.am (xsltdir): New variable.
857 (dist_xslt_DATA): Add xslt/*.xsl files.
859 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
861 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
862 Problem reported by Wojciech Polak.
863 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
864 (xml_printf): Undo change I made on 21 September; that is,
865 indent 2 spaces, not 1.
867 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
869 Pacify ./configure --enable-gcc-warnings.
870 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
871 `char const *' instead of `char *'.
872 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
873 local variable `sep'.
875 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
877 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
879 * src/print-xml.c: Prefer "const" after types; that's more consistent.
880 (xml_printf): Indent just 1 space for level.
881 (e_char, xlate_char): Remove.
882 (xml_escape_string): Rewrite to avoid undefined behavior (used
883 storage that was freed from the stack).
884 (xml_escape_n): Don't bother checking for subscript error.
886 2007-09-21 Wojciech Polak <polak@gnu.org>
888 Add Bison XML Automaton Report.
890 Add support for an -x option to generate an XML report.
891 It is not documented yet.
892 * src/print-xml.c: New file.
893 * src/print-xml.h: Likewise.
894 * lib/timevar.def (TV_XML): New var.
895 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
896 * src/conflicts.c: Include print-xml.h.
897 (solved_conflicts_xml_obstack): New var.
898 (log_resolution, conflicts_solve, conflicts_free):
899 Add support for XML report.
900 (conflicts_output_val): New function.
901 * src/conflicts.h (conflicts_output_val): New decl.
902 * src/files.c (spec_xml_file): New var.
903 (compute_output_file_names, output_file_names_free): Add XML support.
904 * src/files.h (spec_xml_file): New decl.
905 * src/getargs.c (xml_flag): New var.
906 (usage, short_options, long_options, getargs): Add XML support.
907 * src/getargs.h (xml_flag): New decl.
908 * src/gram.c: Include print-xml.h.
909 (rule_lhs_print_xml, rule_rhs_print_xml):
910 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
912 * src/gram.h: Declare external ones.
913 * src/main.c: Include print-xml.h.
914 (main): Add XML support.
915 * src/reduce.c: Include print-xml.h.
916 (reduce_xml): New function.
917 * src/reduce.h: Declare it.
918 * src/state.c: Include print-xml.h.
919 (state_new): Add XML support.
920 (state_rule_lookahead_tokens_print_xml): New function.
921 * src/state.h: Declare it.
922 (struct state): New member solved_conflicts_xml.
923 * src/symtab.c (symbol_class_get_string): New function.
924 * src/symtab.h: Declare it.
926 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
928 * GNUmakefile: Switch to coreutils's version.
929 * bootstrap: Likewise.
930 * Makefile.cfg: Adjust to new GNUmakefile.
931 * README-hacking: Likewise.
935 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
936 Bruno Haible <bruno@clisp.org>
938 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
939 and is a script that invokes bison. Tighten the code. Add comments.
941 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
943 Spell "boolean" as "Boolean". Reported by Akim Demaille.
944 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
945 * doc/bison.texinfo (Decl Summary): Fix.
946 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
947 * tests/input.at (Boolean %define variables): Update output.
948 * tests/skeletons.at (%define boolean variables: invalid skeleton
949 defaults): Rename to...
950 (%define Boolean variables: invalid skeleton defaults): ... this and
953 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
955 In impure push mode, don't allow more than one yypstate to be allocated
956 since multiple impure parsers would corrupt yynerrs.
957 * data/push.c (yypstate_allocated): New static global variable
959 (yypull_parse): If yypstate_new returns 0, don't report it as memory
960 exhaustion if yypstate_allocated is 1, but still return 2.
961 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
962 already 1. Otherwise, set it to 1.
963 (yypstate_delete): Set it to 0.
964 * tests/push.at (Push Parsing: Multiple impure instances): New test
967 2007-08-17 Bob Rossi <bob@brasko.net>
969 * doc/bison.texinfo (Push Decl): Document the push parser.
970 (Table of Symbols): Ditto.
972 (Decl Summary): Ditto.
973 (Multiple Parsers, Push Parser Function, Pull Parser Function,
974 Parser Create Function, Parser Delete Function):
975 Add new push parser symbols.
976 (Table of Symbols): Document push-parser, push-pull-parser,
977 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
979 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
982 * doc/gpl-3.0.texi: New file.
983 * doc/gpl.texi: Remove.
984 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
985 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
986 * README-hacking, TODO, bootstrap, bootstrap.conf:
987 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
988 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
989 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
990 * data/lalr1.cc, data/lalr1.java, data/location.cc:
991 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
992 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
993 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
994 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
995 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
996 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
997 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
998 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
999 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
1000 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
1001 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
1002 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
1003 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
1004 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
1005 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
1006 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
1007 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
1008 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
1009 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
1010 * src/complain.c, src/complain.h, src/conflicts.c:
1011 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
1012 * src/files.h, src/flex-scanner.h, src/getargs.c:
1013 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
1014 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
1015 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
1016 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
1017 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
1018 * src/print.c, src/print.h, src/print_graph.c:
1019 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
1020 * src/reduce.h, src/relation.c, src/relation.h:
1021 * src/revision.h, src/scan-code.h, src/scan-code.l:
1022 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
1023 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
1024 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
1025 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
1026 * tests/Makefile.am, tests/actions.at, tests/c++.at:
1027 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
1028 * tests/existing.at, tests/glr-regression.at:
1029 * tests/headers.at, tests/input.at, tests/java.at:
1030 * tests/local.at, tests/output.at, tests/push.at:
1031 * tests/reduce.at, tests/regression.at, tests/sets.at:
1032 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
1036 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1038 Get rid of broken %no-parser, -n, and --no-parser implementation and
1040 * TODO: Don't mention them.
1041 * doc/bison.1: Likewise.
1042 * doc/bison.texinfo (Decl Summary): Likewise.
1043 (Bison Options): Likewise.
1044 (Option Cross Key): Likewise.
1045 * src/getargs.c (no_parser_flag): Remove global variable.
1046 (usage): Don't print description of -n and --no-parser.
1047 (long_options): Remove --no-parser entry here.
1048 (getargs): Remove -n case in the switch here.
1049 * src/getargs.h (no_parser_flag): Remove extern.
1050 * tests/regression.at (Web2c Actions): Remove comment that mentions
1053 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1055 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
1056 name user variables starting with `yy'. Just pass NULL instead of a
1057 dummy local &yylval to yypush_parse.
1058 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
1061 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
1063 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
1064 true since it's then always used regardless of whether yyoverflow is
1065 defined. Reported by Christian Burger at
1066 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
1067 * THANKS: Add Christian Burger.
1069 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1070 node names: say "Decl Summary" not "Bison Declaration Summary".
1072 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
1074 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
1075 determine whether this function has already complained about an invalid
1076 value for a %define boolean variable, don't check whether Bison has
1077 ever examined the value. As written, the check was a tautology.
1078 Instead, record and check for this complaint using a separate muscle.
1080 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1082 Fix push parsing memory leak reported by Brandon Lucia at
1083 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
1084 * THANKS: Add Brandon Lucia.
1085 * data/push.c (yypstate_delete): Free the stack if it was reallocated
1086 but the parse never completed and thus freed it.
1087 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
1088 * tests/testsuite.at: Include push.at.
1089 * test/push.at: New.
1090 (Push Parsing: Memory Leak for Early Deletion): New test case.
1092 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
1094 Improve handling of multiple S/R conflicts in the same state and of S/R
1095 conflicts involving multiple reductions.
1096 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
1097 set for a state here or Bison will abort if it is reassigned on a
1098 later conflicted reduction in the same state.
1099 Similarly, don't finalize and assign the solved conflicts report here
1100 or it will be lost if it is reassigned on a later conflicted reduction
1102 (set_conflicts): Instead, assign them both here after all S/R conflicts
1103 in the state have been fully examined.
1104 * src/print.c (shift_set): Rename to...
1105 (no_reduce_set): ... this.
1106 (print_reductions): Update for rename, and add %nonassoc error action
1107 tokens to no_reduce_set so that, when printing the first remaining
1108 reduction on an error action token, the reduction is enclosed in
1110 (print_results): Update for rename.
1111 * tests/conflicts.at (Solved conflicts report for multiple reductions
1112 in a state): New test case.
1113 (%nonassoc error actions for multiple reductions in a state): New test
1116 * src/main.c (main): Don't depend on C99 features.
1118 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1120 * build-aux/.cvsignore: Add compile.
1121 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
1124 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
1126 * bootstrap (slurp): Create target directories that don't exist.
1127 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
1129 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1131 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
1133 * closure.c (closure): Likewise.
1134 * state.h (reductions): Comment sorting of rules.
1135 (state): Comment sorting of items.
1137 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
1139 Fix C++ test cases after recent Gnulib changes. Discussed starting at
1140 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
1141 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
1142 definition in order to avoid Gnulib headers since we don't use config.h
1144 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
1145 rather than AT_DATA so that config.h is included.
1147 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
1149 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
1150 instead of fprintf. Guard these functions with #if YYDEBUG instead of
1151 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
1152 and so that YYFPRINTF is guaranteed to be defined here.
1154 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1156 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
1158 (muscle_percent_define_check_values): ... this more helpful function.
1159 Again, it's not used yet, but it will be.
1160 * src/muscle_tab.h: Likewise.
1162 Improve some comments in parser table construction.
1163 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
1164 (generate_states): Don't mention ruleset, which is internal to closure.
1165 * src/closure.c (closure): Explain sorting of core and itemset, which
1166 is required for this function to behave correctly.
1167 * src/closure.h (closure): Mention sorting.
1169 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
1171 * src/lalr.c (state_lookahead_tokens_count): For code readability,
1172 move the check for disabled transitions to an aver since conflict
1173 resolution hasn't happened yet.
1175 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
1176 labels a state as inconsistent just because it has error transitions.
1177 The original form of this check appeared in revision 1.1 of lalr.c,
1178 which was committed on 1991-12-21. Now (at least), changing the
1179 consistency label on such a state appears to have no useful effect in
1180 any of the places it is examined, which I enumerate below. The key
1181 point to understanding each item in this enumeration is that a state
1182 with an error transition is labelled consistent in the first place only
1183 if it has no rules, so the check cannot matter for states that have
1184 rules. (1) Labelling a state as inconsistent will cause set_conflicts
1185 to try to identify its conflicts, and a state must have *rules* to have
1186 conflicts. (2) Labelling a state as inconsistent will affect how
1187 action_row sets the default *rule* for the state. (3) Labelling a
1188 state as inconsistent will cause build_relations to add lookback edges
1189 to *rules* in that state.
1190 * src/state.h (struct state): Word the comment for member consistent
1193 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1195 Don't depend on C99 features.
1196 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
1197 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
1198 * src/reader.c (check_and_convert_grammar): Fix for-loop.
1199 * src/state.c (state_mark_reachable_states): Fix for-loop.
1200 (state_remove_unreachable_states): Fix for-loop.
1202 Don't widen struct state with member reachable just to temporarily
1203 record reachability. Instead, use a local bitset.
1204 * src/state.h (struct state): Remove member.
1205 * src/state.c (state_new): Don't initialize it.
1206 (state_mark_reachable_states): Rename to...
1207 (state_record_reachable_states): ... this, and use bitset.
1208 (state_remove_unreachable_states): Use bitset.
1210 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
1212 * src/Makefile.am (yacc): Quote target action commands properly so
1213 that the yacc script isn't corrupt. Reported by Hans Aberg at
1214 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
1216 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
1217 the case of pure parsers. Reported by Frans Englich at
1218 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
1219 * THANKS: Add Frans Englich.
1221 * NEWS (2.3a+): In the %code entry, reference section `Bison
1222 Declaration Summary' from the manual now since the %code summary has
1224 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
1225 in the rules section must be terminated by semicolons.
1227 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1229 Extend the front-end API for %define variables to more completely
1230 mirror the back-end. This will be useful in the future.
1231 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
1232 Update comments to mention the new front-end counterparts of these
1234 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
1235 for muscle_string_decode and muscle_location_decode.
1236 (muscle_string_decode): New static function.
1237 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
1238 (muscle_percent_define_get, muscle_percent_define_ifdef): New
1240 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
1241 muscle_percent_define_get to mimic the b4_percent_define_flag_if
1242 implementation more closely.
1243 (muscle_percent_define_invalid_value): New function.
1244 * src/muscle_tab.h (muscle_percent_define_get,
1245 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
1248 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1250 * NEWS (2.3a+): Mention yesterday's state-removal change.
1251 (2.3a): Remove the %language entry, which was added after 2.3a.
1252 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
1253 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
1254 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
1255 tests/existing.at: Update copyright date.
1257 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1259 If conflict resolution makes states unreachable, remove those states,
1260 report rules that are then unused, and don't report conflicts in those
1262 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
1263 New global function.
1264 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
1266 * src/main.c (main): After conflict resolution, remove the unreachable
1267 states and update all data structures that reference states by number.
1268 * src/state.c (state_new): Initialize each state's reachable member to
1270 (state_mark_reachable_states): New static function.
1271 (state_remove_unreachable_states): New global function.
1272 * src/state.h (struct state): Add member bool reachable.
1273 (state_remove_unreachable_states): Prototype.
1274 * tests/conflicts.at (Unreachable States After Conflict Resolution):
1276 * tests/existing.at (GNU pic Grammar): Update test case output now that
1277 an unused rule is discovered.
1279 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1281 Minor code cleanup in parser table construction.
1282 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
1283 (new_itemsets, save_reductions): Update for rename to nitemset.
1284 * src/closure.c (nritemset): Rename to...
1285 (nitemset): ... this since the "r" appears to meaningless and isn't
1286 used in the comments.
1287 (closure): Update for rename.
1288 * src/closure.h (nritemset): Update extern to...
1289 (nitemset): ... this.
1290 * src/lalr.c (LA): Fix a typo in comments.
1291 * src/print.c (print_core): Update for rename to nitemset.
1292 * src/print_graph.c (print_graph): Likewise.
1293 * src/state.h: Fix some typos in header comments.
1295 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
1297 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
1298 still sticks to ASCII. Sorry!
1300 * README-hacking: New file, taken mostly from coreutils, with changes
1301 for Bison. Contains much of the contents of:
1302 * README-cvs: Remove.
1303 * bootstrap: Sync from gnulib.
1304 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
1305 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
1307 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
1309 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
1311 (Java Differences): Fix some typos.
1312 * THANKS: Add Sebastian Setzer.
1314 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
1316 * data/java.m4 (b4_single_class_if): Remove.
1317 (b4_abstract_if): Look at "%define abstract".
1319 (b4_union_name): Rename...
1320 (b4_yystype): ... to this. Map to "%define stype".
1321 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
1322 b4_maybe_throws): Fix quoting.
1323 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
1324 * data/lalr1.java (Lexer interface): Always define.
1325 (Lexer interface within parser class): Remove.
1326 (YYLexer class): New, used when "%code lexer" is present.
1327 (constructor): When "%code lexer" is used, pass %lex-param
1328 to the lexer constructor.
1329 (yylex, yyparse): Remove %lex-param from method invocations
1330 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
1332 * doc/bison.texinfo (Java Bison Interface): Mention "%define
1333 abstract". Rename "%define union_name" to "%define stype".
1334 Rename method names according to previous patch.
1335 (Java Scanner Interface): Describe "%code lexer" instead of
1336 "%pure-parser" and "%define single_class".
1337 (Java Differences): Mention "%code lexer".
1339 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
1340 Include scanner here, using macros from tests/local.at.
1341 (AT_DATA_CALC_Y): Remove final argument.
1342 (_AT_CHECK_JAVA_CALC): Likewise.
1343 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
1344 of %locations and %error-verbose.
1345 (main): Test with and without %lex-param.
1346 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
1347 (AT_BISON_OPTION_POPDEFS): Pop it.
1349 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1351 DJGPP spefic issue. Inhibit the use of disallowed characters for
1352 file name genertion on Win98, WinXP, etc. These are |<>":?*\
1353 and concern testsuite case 46.
1354 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
1355 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
1356 * djgpp/config.bat: Inhibit the use of disallowed characters.
1358 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
1360 Miscellaneous %define and %code cleanup.
1361 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
1362 values are interpreted.
1363 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
1364 documentation a little more.
1365 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
1366 muscle_percent_define_insert, muscle_percent_code_grow): New
1368 * src/muscle_tab.h (muscle_percent_define_insert,
1369 muscle_percent_code_grow): Prototype.
1370 * src/parse-gram.y (prologue_declaration): Use
1371 muscle_percent_define_insert and muscle_percent_code_grow when parsing
1372 %define and %code directives.
1374 Make it easy to share %define boolean variables between the front-end
1375 and back-end. Though not used yet, this will be useful in the future.
1376 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
1377 Bison uses of names rather than just skeleton uses of names.
1378 (b4_percent_define_get, b4_percent_define_ifdef): Rename
1379 b4_percent_define_skeleton_variables(VARIABLE) to
1380 b4_percent_define_bison_variables(VARIABLE).
1381 (b4_percent_code_get, b4_percent_code_ifdef): Rename
1382 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
1383 b4_percent_code_bison_qualifiers(QUALIFIER).
1384 (b4_check_user_names_wrap): Update for renames.
1385 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
1386 muscle_percent_define_default): New functions mimicking
1387 b4_percent_define_flag_if and b4_percent_define_default.
1389 For %define variables, report locations for invalid values and
1391 * data/bison.m4 (b4_percent_define_flag_if): Read
1392 b4_percent_define_loc(VARIABLE) to report the location of an invalid
1394 (b4_percent_define_default): Save a special location in
1395 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
1396 must later be reported as invalid.
1397 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
1399 (muscle_percent_define_insert): Record the location of VARIABLE in
1400 muscle percent_define_loc(VARIABLE), and use it to report the previous
1401 location for a redefinition.
1402 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
1403 (muscle_percent_define_default): Update like b4_percent_define_default.
1404 (muscle_grow_user_name_list): Rename to...
1405 (muscle_user_name_list_grow): ... this for consistency and use
1406 muscle_location_grow.
1407 * src/muscle_tab.h (muscle_location_grow): Prototype.
1408 * tests/input.at (%define errors): Update expected output.
1409 * tests/skeletons.at (%define boolean variables: invalid skeleton
1410 defaults): New test case.
1412 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
1414 * src/print.c (lookahead_set, state_default_rule): Remove.
1415 (print_reductions): Replace state_default_rule invocation with
1416 equivalent use of yydefact, which was computed in token_actions in
1418 (print_results): Don't allocate lookahead_set.
1420 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
1422 * data/lalr1.java: Prefix all private members with yy.
1424 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
1426 Use YYFPRINTF instead of fprintf where appropriate. Reported by
1427 Sebastien Fricker at
1428 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
1429 * THANKS: Add Sebastien Fricker.
1430 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
1431 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
1432 accept a variable number of arguments.
1434 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1436 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
1438 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1440 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
1441 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
1442 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
1444 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
1446 Undo my 2007-02-07 change, switching back to the c-strcase module
1447 introduced in the 2007-02-03 change. Bruno Haible reported that
1448 the 2007-02-07 change would be dangerous in Turkish if we add a
1449 language whose name contains "i", since "i" is not lowercase "I"
1451 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
1452 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
1453 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
1454 * m4/.cvsignore: Remove strcase.m4.
1455 * src/getargs.c: Revert 2007-02-07 change, as follows.
1456 Include c-strcase.h.
1457 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
1459 2007-02-11 Bruno Haible <bruno@clisp.org>
1461 Enable the Java related testsuite tests when the only Java compiler
1462 found is a gcj < 4.3. Discussed at
1463 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
1464 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
1466 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
1468 * data/Makefile.am: Update copyright date.
1469 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
1470 yypstate_new returns NULL.
1471 (yypstate_new): Return NULL if malloc does.
1472 * src/reader.c (packgram): Move translation of rule actions from the
1473 beginning of packgram to...
1474 (check_and_convert_grammar): ... here right before packgram is invoked
1475 so it's easier to write more complete comments, and remove redundant
1478 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
1480 As in semantic actions, make @$ in %initial-action, %destructor, and
1481 %printer imply %locations.
1482 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
1484 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
1485 (@$ in %initial-action implies %locations,
1486 @$ in %destructor implies %locations,
1487 @$ in %printer implies %locations): ... these new test cases.
1489 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
1491 Undo most of the 2007-02-03 change, switching to the strcase module
1492 now that gnulib strcase has been fixed.
1493 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
1494 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
1495 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
1496 * m4/.cvsignore: Add strcase.m4.
1497 * src/getargs.c: Revert 2007-02-03 change, as follows.
1498 Don't include c-strcase.h.
1499 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
1500 strcasecmp has "unspecified behavior" outside the POSIX locale,
1501 but it works fine in practice if at least one argument is ASCII,
1502 as is the case in Bison.
1504 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
1506 * tests/java.at: Skip tests if only one of javac/java is present.
1507 Reported by Joel E. Denny.
1508 * tests/atlocal.in: Adjust copyright years.
1510 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
1512 * data/lalr1.java (Stack): Work around old verifiers that disallow
1513 access to the private fields of an inner class, from the outer class.
1514 We can make Stack's fields public because user code doesn't have access
1515 to the instance of Stack used by parse(). Reported by Paul Eggert.
1517 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
1519 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
1520 the right spot for these files?
1521 * bootstrap.conf (gnulib_modules): Add c-strcase.
1522 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
1524 * src/getargs.c: Include c-strcase.h.
1525 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
1526 to avoid unspecified behavior.
1528 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
1530 * doc/bison.texinfo (Decl Summary): Correct typo.
1532 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
1534 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
1535 Complain if the value does not match empty, "true" or "false".
1536 * data/c++.m4: Adjust default definitions of %define variables.
1537 * data/java.m4: Adjust default definitions of %define variables.
1538 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
1540 * tests/input.at (Boolean %define variables): Test new behavior.
1542 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
1544 * NEWS: Mention java.
1545 * TODO: Remove things that are done.
1546 * bootstrap.conf: Add javacomp-script and javaexec-script.
1547 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
1549 * data/Makefile.am: Add new files.
1550 * data/java-skel.m4: New.
1551 * data/java.m4: New.
1552 * data/lalr1.java: New.
1554 * doc/bison.texinfo: Put "A Complete C++ Example" under
1555 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
1556 under Other Languages.
1558 * src/getargs.c (valid_languages): Add Java.
1559 * src/getargs.h (struct bison_language): Update size of string fields.
1561 * tests/Makefile.am: Add java.at.
1562 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
1563 * tests/java.at: New.
1564 * tests/testsuite.at: Include it.
1566 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
1569 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
1570 at_directive_argv arguments so these no longer have to be global
1571 variables. Also, update the implementation for the following changes.
1572 (fail_for_at_directive_too_many_args,
1573 fail_for_at_directive_too_few_args): Add at_directive_name argument.
1574 (at_directive_name): Remove as at_directive_argv[0] will be used for
1576 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
1577 for the directive name.
1578 (at_directive_argc, at_directive_argv): Make these local within
1579 skel_lex instead of global.
1580 (INITIAL): Update directive start action for above changes.
1581 (SC_AT_DIRECTIVE_ARG): Rename to...
1582 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
1583 (SC_AT_DIRECTIVE_SKIP_WS): Update.
1584 (scan_skel): Move yylex_destroy to...
1585 (skel_scanner_free): ... here.
1586 * tests/skeletons.at (installed skeleton file name): Rename to...
1587 (installed skeleton file names): ... this.
1589 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
1591 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1592 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
1593 Summary" not "Directives".
1594 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
1595 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
1596 since the former is now the more complete one.
1597 (Prologue Alternatives): Likewise and do the same for %defines.
1598 (Table of Symbols): Add summary of %code, add summary of %define, and
1599 move full %code documentation to...
1600 (Decl Summary): ... here for consistency with other entries in these
1602 Move %define entry in order to keep this list alphabetized.
1603 Reword %define entry a little to put less emphasis on the skeleton
1604 concept, which most users shouldn't have to think about.
1606 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
1608 Adjust to recent gnulib changes.
1609 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
1610 Add string.h, string_.h, unistd_.h, wchar_.h.
1611 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
1612 * src/system.h: Don't include <stpcpy.h>; this is now done by
1615 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
1617 Simplify implementation of unqualified %code, implement macros for
1618 uniform treatment of boolean %define flags. Document %define.
1619 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
1620 b4_percent_code_ifdef): New.
1621 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
1622 * data/c++.m4: Define default value for global_tokens_and_yystype.
1623 * data/glr.cc: Likewise.
1624 * data/location.cc: Use b4_percent_define_flag_if.
1626 * doc/bison.texinfo (Decl Summary): Document %define.
1628 * src/parse-gram.y (Unqualified %code): Change muscle name to
1630 (content.opt): Default to empty.
1632 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1634 Implement support for relative and absolute skeleton file names.
1635 Discussed starting at
1636 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
1637 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
1638 (Bison Options): Document in --skeleton entry.
1639 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
1640 full_skeleton can't necessarily hold all of pkgdatadir.
1641 If the specified skeleton file name contains a `/', don't prepend
1643 * src/parse-gram.y (prologue_declaration): If the specified skeleton
1644 file name contains a `/', prepend the grammar file directory.
1645 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
1646 * skeletons.at: New file.
1647 (relative skeleton file names): New test case.
1648 (installed skeleton file names): New test case.
1649 * tests/testsuite.at: Include skeletons.at.
1651 * bootstrap: Update copyright to 2007.
1653 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
1655 * bootstrap: Remove occurrences of .#bootmp from the files.
1657 2007-01-17 Akim Demaille <akim@epita.fr>
1659 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
1661 Use per-type %printer.
1663 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1665 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
1666 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1667 djgpp/config.site, src/files.c, src/files.h, src/main.c,
1668 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
1669 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
1670 tests/glr-regression.at, tests/input.at, tests/local.at,
1671 tests/output.at, tests/torture.at: Update copyright to 2007.
1673 2007-01-16 Akim Demaille <akim@epita.fr>
1675 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
1677 (Calc++ Scanner): Exit with failure if we can't open the input
1679 Accept "-" standing for stdin.
1680 (Calc++ Top Level): Print the result only if the parsing was
1683 2007-01-16 Akim Demaille <akim@epita.fr>
1685 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
1687 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
1688 and Joel E. Denny <jdenny@ces.clemson.edu>
1690 Clean up %define and %code implementation in M4 some. Most
1691 importantly, rename all related macros to be in the b4_percent_define
1692 and b4_percent_code namespaces. Also, complete support for `.' in
1693 %define variable names and %code qualifiers.
1694 * data/bison.m4 (b4_check_user_names): Check for special
1695 "SKELETON-NAMESPACE(name)" macros instead of using two nested
1697 (b4_get_percent_define, b4_get_percent_code): Rename to...
1698 (b4_percent_define_get, b4_percent_code_get): ... these.
1699 Extend documentation with examples.
1700 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
1701 b4_percent_define_skeleton_variables and
1702 b4_percent_code_skeleton_qualifiers.
1703 Expect any value for the %define variable `foo' to be stored in the
1704 macro named `b4_percent_define(foo)'; expect any %code blocks for the
1705 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
1706 expect any unqualified %code blocks to be stored in a macro named
1707 `b4_percent_code_unqualified'.
1708 Use m4_indir so that %define variable names and %code qualifiers can
1709 contain `.', which is allowed by the grammar parser.
1710 (b4_percent_define_default): New macro to set a default value for a
1712 (m4_wrap): Update wrapped code, and fix some underquoting.
1713 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
1714 Expect grammar uses of %define variables and %code qualifiers to be
1715 defined in b4_percent_define_user_variables and
1716 b4_percent_code_user_qualifiers.
1717 * data/c++.m4: Use b4_percent_define_default rather than
1718 m4_define_default. Fix some underquoting. Skeleton usage of %define
1719 variable define_location_comparison now implies skeleton usage of
1720 %define variable filename_type.
1721 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1722 data/push.c, data/yacc.c: Update macro names.
1723 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
1726 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1728 DJGPP specific issues.
1730 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
1731 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
1733 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1735 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
1736 run parsers in all tests so that Valgrind is invoked during
1737 maintainer-check-valgrind.
1738 (Duplicate representation of merged trees): Free all semantic values.
1739 (Duplicated user destructor for lookahead): Likewise.
1741 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1743 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
1744 command-line prefix.
1745 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
1746 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
1747 miss Valgrind messages.
1748 (Exploding the Stack Size with Malloc): Likewise.
1750 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1752 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
1753 locals. Reported by Juan Manuel Guerrero at
1754 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
1755 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
1756 Fix some indentation also.
1757 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
1758 explaining this issue.
1760 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
1761 and Joel E. Denny <jdenny@ces.clemson.edu>
1763 Simplify union and prologue handling, and escape union and lex/parse
1764 params with digraphs.
1765 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
1766 values to the empty string since these are no longer guaranteed
1767 initialized by the front-end.
1768 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
1769 braces around b4_user_stype since this is no longer done by the
1771 * src/files.c, src/files.h (pre_prologue_obstack,
1772 post_prologue_obstack): Remove.
1773 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
1774 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
1775 with digraphs. This fixes lex params and parse params.
1776 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
1777 * src/output.c (prepare): Remove muscle insertion of the prologues.
1778 (output): Remove freeing of pre_prologue_obstack and
1779 post_prologue_obstack.
1780 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
1781 than prologue_augment for prologue parsing so you don't need prologue
1783 (grammar_declaration): For %union RHS, use `braceless' instead of
1784 "{...}" so that braces are already stripped and code is escaped with
1786 * src/reader.c (prologue_augment): Remove.
1787 (reader): Remove initialization of pre_prologue_obstack and
1788 post_prologue_obstack.
1789 * src/reader.h (prologue_augment): Remove.
1791 * data/c.m4: Remove stray parenthesis.
1793 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1795 Remove quotes from variables names in %define directives and from
1796 qualifiers in %code directives, and restrict the characters that are
1797 allowed in them to M4-friendly ones. For %define, continue to support
1798 the quoted form as a deprecated feature. Discussed starting at
1799 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
1800 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
1802 * doc/bison.texinfo (Prologue Alternatives): Update.
1803 (Decl Summary): In %defines entry, update mention of `%code requires'
1804 and `%code provides'.
1805 (C++ Location Values): Update %define uses.
1806 (Calc++ Parser Interface): Likewise.
1807 (Calc++ Parser): Likewise, and update `%code requires' uses.
1808 (Table of Symbols): Update %code documentation.
1809 * src/parse-gram.y (prologue_declaration): For %define variables, use
1810 `variable' instead of `STRING'.
1811 (grammar_declaration): For %code qualifiers, use `ID' instead of
1813 (variable): New nonterminal that takes an `ID' or a `STRING'.
1814 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
1816 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
1817 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
1818 (%define errors): Update %define uses.
1820 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1822 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
1823 instead of muscle_insert for %define values so that M4-special
1824 characters are replaced with digraphs.
1825 * tests/input.at (%define errors): Extend to check weird values.
1827 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1829 Instead of having skeletons declare all valid %define variables and
1830 %code qualifiers, provide macros that retrieve the associated values
1831 and build these lists automatically. Thus Bison will now warn when a
1832 variable or qualifier is not used by the skeleton in the current
1833 invocation regardless of whether it might sometimes be used by that
1834 skeleton in other invocations. Also, move all %define value macros to
1835 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
1836 form, which is replaced by %code.
1837 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
1838 (b4_check_user_names): ... this, and change the series of valid name
1839 arguments to a single list argument for names used in the skeleton
1840 similar to the existing list argument for names used in the grammar.
1841 Warn instead of complaining.
1842 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
1843 values and %code code, to format %code code properly, and to build
1844 lists of all %define variables and %code qualifiers used in the
1845 skeleton: b4_skeleton_percent_define_variables and
1846 b4_skeleton_percent_code_qualifiers.
1847 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
1849 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
1850 the skeleton names lists can finish building first. In place of
1851 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
1852 expect the lists b4_user_percent_define_variables and
1853 b4_user_percent_code_qualifiers.
1854 * data/c++.m4: Where setting default values for b4_parser_class_name,
1855 b4_location_type, b4_filename_type, b4_namespace, and
1856 b4_define_location_comparison, update their names to the
1857 b4_percent_define_ namespace.
1858 * data/glr.c: Don't use b4_check_percent_define_variables and
1859 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1860 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
1861 (b4_parser_class_name, b4_namespace): Define these using
1862 b4_get_percent_define for parser_class_name and namespace.
1863 * data/location.cc: Use b4_get_percent_define.
1864 * data/push.c: Don't use b4_check_percent_define_variables and
1865 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1866 * data/yacc.c: Likewise, and don't call m4_exit in
1867 b4_use_push_for_pull_if or m4_wrap code will never execute.
1868 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
1870 (muscle_grow_user_name_list): ... this for consistency with the
1871 terminology used in bison.m4.
1872 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
1873 %define variable names, and rename muscle used_percent_define_variables
1874 to user_percent_define_variables.
1875 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
1876 user_percent_code_qualifiers.
1878 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
1879 {CODE} form is no longer accepted.
1880 * tests/input.at (Reject bad %code qualifiers): Rename to...
1881 (Reject unused %code qualifiers): ... this, and update test output.
1882 (%define error): Update test output.
1884 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
1886 Check for unrecognized %define variables similar to checking for
1887 unrecognized %code qualifiers. Check for redefined %define variables.
1888 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
1890 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
1891 (b4_check_percent_define_variables): New, also wraps it.
1892 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
1893 variables using b4_check_percent_define_variables.
1894 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
1895 all those exercised in the test suite and all those listed in the
1896 `Default values' section of c++.m4. Are there others?
1897 * data/push.c, data/yacc.c: Declare no valid %define variables.
1898 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
1899 similar to muscle_find, but it works even when the muscle stores a
1901 (muscle_grow_used_name_list): New function for constructing the used
1902 name list muscles that b4_check_for_unrecognized_names requires.
1903 * src/parse-gram.y (prologue_declaration): Warn if a variable is
1904 %define'd more than once. Define the b4_used_percent_define_variables
1905 muscle with muscle_grow_used_name_list.
1906 (grammar_declaration): Abbreviate %code code with
1907 muscle_grow_used_name_list.
1908 * tests/input.at (%define errors): New.
1910 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1912 Provide warn_at, complain_at, and fatal_at function callbacks to the
1913 skeletons, and use this for %code qualifier complaints.
1914 * data/bison.m4 (b4_error_at): New, invoked by...
1915 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
1916 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
1917 @fatal_at(...@) directives.
1918 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
1919 qualifiers in b4_used_percent_code_qualifiers and to use
1921 * src/location.c, src/location.h (boundary_set_from_string): New global
1923 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
1925 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
1926 to b4_used_percent_code_qualifiers.
1927 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
1929 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
1930 (lineno): Rename to...
1931 (out_lineno): ... this so I don't misunderstand it again.
1932 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
1933 here; these newlines are in the input but not the output file.
1934 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
1935 (at_directive_perform): ... this new static function, and add handling
1936 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
1938 * tests/input.at (Reject bad %code qualifiers): Update test output with
1939 locations and extend.
1941 * tests/output.at (Output file name: [, Output file name: ]): Remove
1942 bogus comment about these tests failing.
1944 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1946 Clean up b4_check_percent_code_qualifiers a little.
1947 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
1948 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
1949 documentation and add examples.
1950 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
1953 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
1955 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
1956 unreliable -- especially when they're hidden inside another macro.
1957 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
1958 data/c.m4: Remove m4_divert(-1).
1959 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1960 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
1961 m4_divert_push(0) and m4_divert_pop(0).
1962 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
1963 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
1964 pushed and popped by m4sugar, should be first on the stack.
1966 Provide warn, complain, and fatal function callbacks to the skeletons.
1967 This provides more flexibility than m4_fatal, improves the error
1968 message format, and captures messages for translation. Discussed
1970 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
1971 * data/bison.m4 (b4_error): New, invoked by...
1972 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
1973 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
1974 directives. Because these M4 macros might be called when the current
1975 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
1976 the previous removal of uses of m4_divert, which caused trouble.
1977 (b4_check_percent_code_qualifiers): Use b4_complain instead of
1978 m4_fatal to report unrecognized %code qualifiers.
1979 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
1980 push parser requests.
1981 * data/glr.c: Use b4_complain instead of m4_fatal to report
1982 non-deterministic push parser requests.
1983 Update @output usage to @output(...@) form.
1984 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
1985 report missing %defines. Update @output usage to @output(...@) form.
1986 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
1988 * src/main.c (main): Invoke skel_scanner_free.
1989 * src/scan-skel.h (skel_scanner_free): Prototype new function.
1990 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
1991 obstack_for_string from flex-scanner.h.
1992 (YY_DECL): Use to declare skel_lex static.
1993 (decode_at_digraphs): Remove; now handled in the new
1994 SC_AT_DIRECTIVE_ARG start condition.
1995 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
1997 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
1998 at_directive_argv): New static globals.
1999 (INITIAL): Use fail_for_invalid_at.
2000 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
2001 recognize the start of a generalized `@directive(...@)' form and
2003 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
2004 directive args (using the new obstack_for_string), to decode the
2005 contained @ diagraphs, and to perform the directive. It recognizes
2006 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
2008 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
2009 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
2011 (scan_skel): Initialize obstack_for_string on the first call.
2012 (skel_scanner_free): New function to free obstack_for_string.
2013 * tests/input.at (Reject bad %code qualifiers): Update test output.
2015 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
2017 Consolidate the 4 prologue alternative directives (%code, %requires,
2018 %provides, and %code-top) into a single %code directive with an
2019 optional qualifier field. Discussed at
2020 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
2021 * NEWS (2.3a+): Rewrite the existing entry for the prologue
2023 * doc/bison.texinfo (Prologue Alternatives): Update.
2024 (Decl Summary): Update to %code "requires" and %code "provides".
2025 (Calc++ Parser): Update to %code "requires".
2026 (Table of Symbols): Remove entries for %requires, %provides, and
2027 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
2028 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
2029 are replaced by b4_percent_code_provides and b4_percent_code_requires,
2030 which are skeleton-specific.
2031 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
2032 declare what %code qualifiers it supports and to complain if any other
2033 qualifiers were used in the grammar.
2034 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
2035 and b4_user_code([b4_percent_code_provides]) in place of
2036 b4_user_requires and b4_user_provides.
2037 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
2038 Add b4_user_code([b4_percent_code_top]) and
2039 b4_user_code([b4_percent_code]).
2040 Invoke b4_check_percent_code_qualifiers.
2041 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2042 PERCENT_REQUIRES): Remove.
2043 (grammar_declaration): Remove RHS's for %code-top, %provides, and
2044 %requires. Rewrite the %code RHS as the unqualified form defining the
2045 muscle b4_percent_code. Add another RHS for the qualified %code form,
2046 which defines muscles of the form b4_percent_code_QUALIFIER and the
2047 b4_used_percent_code_qualifiers muscle.
2048 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2049 PERCENT_REQUIRES): Remove.
2050 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
2051 %code "requires" and %code "provides".
2052 * tests/input.at (Reject bad %code qualifiers): New.
2054 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2056 Use the new code_props interface for destructors and printers.
2057 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
2058 printer_location members, and change the type of the destructor and
2059 printer members to code_props.
2060 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
2061 symbol_printer_get, semantic_type_destructor_set,
2062 semantic_type_printer_set, default_tagged_destructor_set,
2063 default_tagless_destructor_set, default_tagged_printer_set,
2064 default_tagless_printer_set): Use code_props in arguments and return
2065 types in place of char const * and location.
2066 (symbol_destructor_location_get, symbol_printer_location_get): Remove
2067 since the locations are now contained in the return of
2068 symbol_destructor_get and symbol_printer_get.
2069 * src/output.c (symbol_destructors_output, symbol_printers_output):
2071 (symbol_code_props_output): ... this to eliminate duplicate code.
2072 (output_skeleton): Update to use symbol_code_props_output.
2073 * src/reader.c (symbol_should_be_used): Update use of
2074 symbol_destructor_get.
2075 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2076 Update uses of the various _destructor_set and _printer_set functions.
2077 * src/symtab.c: (default_tagged_destructor_location,
2078 default_tagless_destructor_location, default_tagged_printer_location,
2079 default_tagless_printer_location): Remove since we...
2080 (default_tagged_destructor, default_tagless_destructor,
2081 default_tagged_printer, default_tagless_printer): ... change the type
2082 of these to code_props.
2083 (symbol_new, semantic_type_new, symbol_destructor_set,
2084 semantic_type_destructor_set, symbol_destructor_get,
2085 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
2086 symbol_check_alias_consistency, default_tagged_destructor_set,
2087 default_tagless_destructor_set, default_tagged_printer_set,
2088 default_tagless_printer_set): Update.
2089 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
2090 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
2092 (symbol_print): Use SYMBOL_CODE_PRINT.
2094 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2096 Use the new code_props interface for rule actions.
2097 * src/symlist.h (symbol_list): Replace action, action_location, and
2098 used members with a code_props action_props member.
2099 * src/reader.c (symbol_should_be_used, grammar_rule_check,
2100 grammar_midrule_action, grammar_current_rule_merge_set,
2101 grammar_current_rule_symbol_append, packgram): Update.
2102 * src/scan-code.h (translate_rule_action): Remove, no longer used.
2103 * src/scan-code.l (handle_action_dollar): Update.
2104 (translate_rule_action): Remove, no longer used.
2105 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
2107 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2109 Use the new code_props interface in parse-gram.y.
2110 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
2111 Update all uses of translate_* functions to use the new code_props
2112 interface and to use gram_scanner_last_string_free and
2113 code_scanner_last_string_free where possible.
2114 (grammar_declaration): symbol_list_destructor_set and
2115 symbol_list_printer_set now perform the translation, so don't do it
2116 here. Use gram_scanner_last_string_free where possible.
2117 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
2118 translate_code): Remove, no longer used.
2119 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
2120 symbol_list_printer_set): Perform code translation here rather than
2121 depending on the caller to do so.
2123 * src/symlist.h (struct symbol_list): Correct some documentation typos.
2124 * src/scan-gram.h (gram_last_string): Remove declaration.
2125 * src/scan-gram.l (last_string): Declare it static.
2127 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2129 Encapsulate code properties and related functionality for the various
2130 destructors, printers, and actions into a code_props structure and
2131 interface. This patch merely implements code_props in scan-code.h and
2132 scan-code.l. Future patches will rewrite other modules to use it.
2133 Discussed starting at
2134 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
2135 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
2136 consistently initialize const structs that have an empty location
2138 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
2139 to ensure consistency.
2140 * src/scan-code.h (code_props): New structure.
2141 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
2142 function, macro, and const global variable for initializing a
2143 code_props with no code.
2144 (code_props_plain_init, code_props_symbol_action_init,
2145 code_props_rule_action_init, code_props_translate_code): The rest of
2146 the new code_props functional interface. Among other things, the init
2147 functions set the code_props kind field so that
2148 code_props_translate_code will know whether to behave like
2149 translate_symbol_action, translate_rule_action, or translate_code.
2150 These old translate functions must remain until all other modules are
2151 updated to use the new code_props interface.
2152 (code_scanner_last_string_free): New function similar to
2153 gram_scanner_last_string_free.
2154 (code_scanner_free): Add documentation.
2155 * src/scan-code.l: Implement the new interface.
2156 (code_lex): Make it static, add a code_props* argument, and remove the
2158 (last_string): New static global similar to the one in scan-gram.l.
2159 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
2161 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
2162 code_props since Bison may one day use this information for destructors
2164 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
2165 (handle_action_dollar): Use symbol_list_n_get and set used flag
2166 directly since symbol_list_n_used_set is removed.
2167 (translate_action): Add a code_props* argument and remove the rule,
2168 action, and location arguments. Pass the code_props* on to code_lex.
2169 (translate_rule_action, translate_symbol_action, translate_code):
2170 Rewrite as wrappers around the new code_props interface.
2171 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
2172 it would eventually need to break the encapsulation of code_props.
2174 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2176 * etc/.cvsignore: New.
2178 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2180 Add maintainer-push-check to run maintainer-check using push parsing in
2181 place of pull parsing where available.
2182 * Makefile.am (maintainer-push-check): New.
2183 * data/bison.m4 (b4_use_push_for_pull_if): New.
2184 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
2185 appropriately based on their existing values.
2186 (yypush_parse): Don't print push-parser-specific diagnostics if push
2187 parsing is being used in place of pull parsing.
2188 * data/yacc.c: If push parsing should replace pull parsing, redirect to
2190 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
2191 variable, and insert b4_use_push_for_pull_flag into muscles.
2192 * tests/Makefile.am (maintainer-push-check): New.
2194 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2196 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
2197 (whether successful or failed) so that yypush_parse can be invoked
2198 again to start a new parse using the same yypstate.
2199 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
2200 check multiple yypull_parse invocations on the same yypstate. For pull
2201 mode, extend to check multiple yyparse invocations.
2202 (Exploding the Stack Size with Alloca): Extend to try with
2204 (Exploding the Stack Size with Malloc): Likewise.
2206 * tests/calc.at (Simple LALR Calculator): Don't specify
2207 %skeleton "push.c" since %push-pull-parser implies that now.
2208 * tests/headers.at (export YYLTYPE): Don't check for the push
2209 declarations. Otherwise, this test case can't be used to see if push
2210 mode can truly emulate pull mode.
2211 * tests/input.at (Torturing the Scanner): Likewise.
2212 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
2213 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
2214 AT_YACC_IF, which now includes the case of push mode since %skeleton
2215 need not be used for push mode. This will be more intuitive once
2216 push.c is renamed to yacc.c.
2218 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2220 For push mode, convert yyparse from a macro to a function, invoke yylex
2221 instead of passing a yylexp argument to yypull_parse, and don't
2222 generate yypull_parse or yyparse unless %push-pull-parser is declared.
2223 Discussed starting at
2224 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
2225 * data/bison.m4 (b4_pull_if): New.
2226 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
2227 * data/push.c: Improve M4 quoting a little.
2228 (b4_generate_macro_args, b4_parenthesize): Remove.
2229 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
2230 any time a pull parser is requested.
2231 Don't #define this as a wrapper around yypull_parse. Instead, when
2232 both push and pull are requested, make it a function that does that
2234 (yypull_parse): If there's a b4_prefix, #define this to
2235 b4_prefix[pull_parse] when both push and pull are requested.
2236 Don't define this as a function unless both push and pull are
2238 Remove the yylexp argument and hard-code yylex invocation instead.
2239 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
2241 * src/getargs.c (pull_parser): New global initialized to true.
2242 * getargs.h (pull_parser): extern it.
2243 * src/output.c (prepare): Insert pull_flag muscle.
2244 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
2245 (prologue_declaration): Set both push_parser and pull_parser = true for
2246 %push-pull-parser. Set push_parser = true and pull_parser = false for
2248 * src/scan-gram.l: Don't accept %push_parser as an alternative to
2249 %push-parser since there's no backward-compatibility concern here.
2250 Scan %push-pull-parser.
2251 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
2252 instead of %push-parser.
2253 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
2254 prototype it in the module that calls yyparse.
2255 * tests/input.at (Torturing the Scanner): Likewise.
2256 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
2258 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
2260 Update etc/bench.pl. Optimize push mode a little (the yyn change
2261 deserves most of the credit).
2262 * Makefile.am (SUBDIRS): Add etc subdirectory.
2263 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
2264 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
2265 yytoken, yyval, and yyloc declarations to...
2266 (yyparse or yypush_parse): ... here to improve performance. For
2267 yypush_parse invocations after the first, be sure to assign yyn its old
2269 (yypstate_new): Don't bother initializing the yyresult field since the
2270 initial value isn't used.
2271 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
2272 remove the #define that, in push mode, set it to yyps->NAME.
2273 * etc/Makefile.am: New.
2274 * etc/bench.pl: Remove and build it instead from...
2275 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
2276 "tests/bison" from the build directory by default rather than just
2277 invoking "bison" from $PATH.
2278 (calc_grammar): Update push parser code: don't declare yylval globally,
2279 don't define yyparse_wrapper, and don't #define yyparse.
2280 (bench_grammar): Update to check all working combinations of yacc.c,
2281 push.c, impure, pure, pull, and push.
2283 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2285 For push mode, add pull wrappers around yypush_parse.
2286 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
2287 (yypull_parse): New function wrapping yypush_parse.
2288 (yyparse): New #define wrapping yypull_parse.
2289 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
2291 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
2292 prototype yylex in the module that calls yyparse, and don't prototype
2293 yyparse there. Otherwise, the yyparse expansion won't compile.
2294 * tests/input.at (Torturing the Scanner): Likewise.
2296 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2298 Enable push parsers to operate in impure mode. Thus, %push-parser no
2299 longer implies %pure-parser. The point of this change is to move
2300 towards being able to test the push parser code by running the entire
2301 test suite as if %push-parser had been declared.
2302 * data/push.c (yypush_parse): For impure mode, remove the
2303 yypushed_char, yypushed_val, and yypushed_loc arguments.
2304 Instead, declare these as local variables initialized to the global
2305 yychar, yylval, and yylloc.
2306 For the first yypush_parse invocation only, restore the initial values
2307 of these global variables when it's time to read a token since they
2308 have been overwritten.
2309 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
2311 * tests/calc.at (Simple LALR(1) Calculator): Always declare
2312 %pure-parser along with %push-parser since this test case was designed
2313 for pure push parsers.
2314 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
2315 (AT_YACC_OR_PUSH_IF): New.
2316 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
2317 add a note that it's still wrong for some cases (as it has been for a
2319 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
2320 %push-parser no longer implies %pure-parser.
2322 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2324 Remove some unnecessary differences between the pull parser code and
2325 the push parser code. This patch enables yynerrs in push mode.
2326 * data/push.c: Reformat M4 a little.
2327 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
2328 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
2329 because push mode is on. Instead, if pure mode is on, move yynerrs
2331 (b4_declare_parser_state_variables): ... here.
2332 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
2333 to yyps->NAME so it can be used in yypush_parse.
2334 (yypush_parse): Don't omit uses of yynerrs in push mode.
2336 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2338 Fix bug such that the first pushed token's value and location are
2339 sometimes overwritten (sometimes by %initial-action) before being used.
2340 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
2341 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
2342 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
2343 more closely mimic the pull parser logic.
2344 Don't copy the pushed token to yychar, yylval, and yylloc until it's
2345 time to read a token, which is after any initialization of yylval and
2347 (gottoken): Rename label to...
2348 (yyread_pushed_token): ... for clarity and to avoid infringing on the
2351 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2353 Rearrange initialization of the parser state variables so that the
2354 skeleton doesn't have to have a copy for pull mode and another for push
2355 mode. This patch also fixes at least a bug such that yylloc was not
2356 initialized (with b4_location_initial_line and
2357 b4_location_initial_column) upon calling yypush_parse. However, that
2358 initialization now overwrites the first token's location;
2359 %initial-action assigning @$ already did the same thing, and both bugs
2360 will be fixed in a later patch.
2361 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
2362 (b4_declare_parser_state_variables): Remove initialization of yytoken,
2363 yyss, yyvs, yyls, and yystacksize.
2364 (yypstate_new): Remove initialization of some yypstate fields: yystate,
2365 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
2367 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
2368 yyps->NAME so it can be used in yypush_parse.
2369 (yyparse or yypush_parse): For yypush_parse, don't print the
2370 "Starting parse" diagnostic for invocations after the first.
2371 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
2372 yypush_parse, only do it for the first invocation.
2373 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
2374 initialization to occur in yypush_parse but only on the first
2377 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2379 * data/push.c: Add CPP guards around push parser declarations in both
2380 the header and the code file.
2381 In the code file, move the push parser declarations to the same place
2382 they appear in the header file.
2383 Clean up the M4 some, especially the inconsistent underquoting in
2384 some b4_c_function_def and b4_c_function_decl uses.
2386 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2388 Encapsulate the push parser state variables into an M4 macro so the
2389 push skeleton doesn't have to list them again for pull mode's yyparse.
2390 For push mode, remove yypush_parse's local equivalents of these
2391 variables to eliminate unnecessary copying between the two sets at
2392 run-time. This patch also fixes at least a bug related to multiple
2393 %initial-action invocations in push mode.
2394 * data/push.c (b4_declare_parser_variables): Rename to...
2395 (b4_declare_scanner_communication_variables): ... this for clarity and
2397 (b4_declare_yyparse_variables): Remove and move its contents to the one
2398 spot where it was invoked.
2399 (b4_declare_parser_state_variables): New macro containing the parser
2400 state variables required by push mode.
2401 (struct yypstate): Replace all fields but yynew with
2402 b4_declare_parser_state_variables.
2403 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
2404 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
2405 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
2406 (yyparse or yypush_parse): For yyparse in pull mode, replace local
2407 parser state variable declarations with
2408 b4_declare_parser_state_variables.
2409 Don't initialize parser state variables when calling yypush_parse since
2410 yypstate_new already does that.
2411 Invoke the user's initial action only upon the first yypush_parse
2413 Remove all code that copies between the local parser state variables
2416 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2418 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
2419 prevent a name collision in a future patch where these names will
2420 sometimes be #define'd.
2421 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
2422 since it no longer has the same name as the existing argument.
2423 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
2425 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
2426 and Joel E. Denny <jdenny@ces.clemson.edu>
2428 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2429 that the argument is case-insensitive, and there's no `=' here.
2430 For the %skeleton entry, mention that %language is better.
2431 (Bison Options): Likewise for --language and --skeleton. Move the
2432 --skeleton entry so that the `Tuning the parser' section is sorted
2433 alphabetically on long options.
2434 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
2435 %language directive in detail here; cross-reference the %language
2436 documentation instead.
2437 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
2438 `%require "2.3b"' so that the example is always up-to-date.
2439 (Table of Symbols): Add entries for %language and %skeleton.
2440 * examples/extexi (normalize): Instead of replacing every %require
2441 argument with the current Bison version, just substitute for
2442 `@value{VERSION}'. This guarantees that we're testing what actually
2443 appears in the documentation.
2444 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
2445 rather than `@VERSION@'.
2447 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2449 * NEWS: Reword the %language news a bit, and put it earlier.
2451 * src/getargs.c (skeleton_arg): Last arg is now location const *.
2452 Rewrite to simplify the logic.
2453 (language_argmatch): Likewise.
2454 (program_name): We now own this var.
2455 * src/getargs.h (struct bison_language): Use char[] rather than
2458 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
2460 * src/complain.c (program_name): Remove decl; no longer needed.
2461 * src/main.c (program_name): Remove; now belongs to getargs.
2463 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
2465 * NEWS: Document %language.
2467 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
2469 * data/c-skel.m4, data/c++-skel.m4: New files.
2470 * data/glr.c: Complain on push parsers.
2472 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
2474 (Decl Summary): Document %language and %skeleton.
2475 (Command line): Document -L.
2477 * examples/extexi: Rewrite %require directive.
2478 * examples/calc++/Makefile.am: Pass VERSION to extexi.
2480 * src/files.c (compute_exts_from_gc): Look in language structure
2482 (compute_file_name_parts): Check whether .tab should be added.
2483 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
2484 (language, skeleton_arg, language_argmatch): New.
2485 (long_options): Add --language.
2486 (getargs): Use skeleton_arg, add -L/--language.
2487 * src/getargs.h: Include location.h.
2488 (struct bison_language, language, skeleton_arg, language_argmatch): New.
2489 * src/output.c (prepare): Pick default skeleton from struct language.
2490 Don't dispatch C skeletons here.
2491 * src/parse-gram.y (PERCENT_LANGUAGE): New.
2492 (prologue_declaration): Add "%language" rule, use skeleton_arg.
2493 * src/scan-gram.l ("%language"): New rule.
2495 * tests/calc.at: Test %skeleton and %language.
2496 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
2497 (AT_GLR_IF): Look for %skeleton "glr.cc".
2498 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
2499 (AT_YACC_IF): Reject %language.
2501 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2503 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
2504 since it wasn't used; only the typedef name 'semantic_type' is needed.
2505 Also, omit trailing white space.
2507 * bootstrap: Sync from coreutils.
2508 (gnulib_extra_files): Add build-aux/announce.gen.
2509 (slurp): Adjust .gitignore files like .cvsignore files.
2510 * build-aux/announce-gen: Remove from CVS, since bootstrap
2513 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
2515 Make %push-parser imply %pure-parser. This fixes several bugs; see
2516 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
2517 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
2519 * data/push.c: Don't bother testing b4_push_if when deciding whether
2520 to expand b4_declare_parser_variables globally.
2521 (yypush_parse): Likewise in here.
2523 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
2524 (yy_reduce_print): Reformat M4 for readability.
2526 2006-12-15 Bob Rossi <bob@brasko.net>
2527 and Joel Denny <jdenny@ces.clemson.edu>
2529 * data/push.c (yypstate): Add typedef, and update all uses of
2530 struct yypstate to just yypstate.
2531 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
2533 2006-12-14 Bob Rossi <bob@brasko.net>
2535 * data/push.c (yypush_parse): Declare prototype regardless of
2538 2006-12-14 Bob Rossi <bob@brasko.net>
2540 * data/push.c (yyparse): Remove the prototype and the #define when in
2543 2006-12-13 Bob Rossi <bob@brasko.net>
2545 * data/push.c (yypstate_init): Rename to...
2546 (yypstate_new): ... this and use b4_c_function_def.
2547 (yypstate_delete): New.
2548 (yypush_parse): Change parameters yynval and yynlloc to be const.
2549 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
2550 yypstate_delete functions.
2552 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
2554 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
2555 strange test case titles. Reported by Bob Rossi.
2557 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
2559 * TODO: Add pointer to Sylvain Schmitz's work on static detection
2560 of potential ambiguities in GLR grammers.
2562 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
2564 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
2565 `bison ', use m4_index instead of m4_substr since chopping up a string
2566 containing M4-special characters causes problems here.
2568 Fix a couple of bugs related to special characters in user-specified
2569 file names, and make it easier for skeletons to compute output file
2570 names with the same file name prefix as Bison-computed output file
2572 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
2573 b4_parser_file_name and b4_spec_defines_file instead of
2574 @output_parser_name@ and @output_header_name@, which are now redundant.
2575 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
2576 b4_parser_file_name, b4_spec_defines_file, and the new
2577 @basename(FILENAME@) instead of @output_parser_name@ and
2578 @output_header_name@, which inappropriately escaped the file names as
2580 * src/files.c (all_but_ext): Remove static qualifier.
2581 (compute_output_file_names): Move `free (all_but_ext)' to...
2582 (output_file_names_free): ... here since all_but_ext is needed later.
2583 * src/files.h (all_but_ext): Extern.
2584 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
2585 exactly what MUSCLE_INSERT_STRING used to do.
2586 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
2587 characters are escaped properly.
2588 * src/output.c (prepare): Define muscle file_name_all_but_ext as
2590 For pkgdatadir muscle, maintain previous functionality by using
2591 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
2592 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
2593 digraphs would never be expanded. Hopefully no one has M4-special
2594 characters in his Bison installation path.
2595 * src/scan-skel.l: Don't parse @output_header_name@ and
2596 @output_parser_name@ anymore since they're now redundant.
2597 In @output, use decode_at_digraphs.
2598 Parse a new @basename command that invokes last_component.
2599 (decode_at_digraphs): New.
2600 (BASE_QPUTS): Remove unused.
2601 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
2602 (Output file name): New tests.
2604 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
2606 Warn about output files that are generated by the skeletons and that
2607 conflict with other output files.
2608 * data/glr.c: Don't generate the header file here when glr.cc does.
2609 * src/files.c (file_names, file_names_count): New static globals.
2610 (compute_output_file_names): Invoke output_file_name_check for files
2611 not generated by the skeletons and remove existing checks.
2612 (output_file_name_check): New function that warns about conflicting
2614 (output_file_names_free): Free file_names.
2615 * src/files.h (output_file_name_check): Declare.
2616 * src/scan-skel.l: Invoke output_file_name_check for files generated by
2618 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
2619 (Conflicting output files): New tests.
2621 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2623 * doc/bison.texinfo: Fix a couple of typos.
2625 2006-12-08 Bob Rossi <bob@brasko.net>
2627 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
2629 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
2631 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
2632 (yypush_parse): Rename yypvars argument to yyps and remove redundant
2634 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
2635 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
2637 2006-12-07 Bob Rossi <bob@brasko.net>
2638 and Joel Denny <jdenny@ces.clemson.edu>
2640 * data/push.c (yypvarsinit): Change return type from void* to struct
2641 yypvars*. No longer cast to void* on return.
2642 (struct yypvars): Remove yylen since it need not be remembered between
2643 yypushparse invocations.
2644 (yypushparse): Don't copy between yylen and pv->yylen.
2646 2006-12-05 Bob Rossi <bob@brasko.net>
2648 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
2649 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
2650 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
2651 (struct yypvars): Remove b4_declare_parser_variables.
2652 (yypvarsinit): Remove init code for removed variables.
2653 (global scope): Do not declare b4_declare_parser_variables if
2655 (yypushparse): Add b4_declare_parser_variables.
2656 Init new local variables, and remove init code for removed
2659 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
2660 and yyparse for other modes.
2661 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
2662 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
2663 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
2664 (AT_PURE_LEX_IF): True if pure or push parser.
2666 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
2668 Document Yacc prologue alternatives and default %destructor's and
2669 %printer's as experimental. Don't mention Java yet. Discussed at
2670 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
2671 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
2672 (2.3a): Annotate this entry to say the old forms of these features were
2674 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
2675 Table of Symbols): Say they're experimental. Comment out any mention
2676 of Java (we'll want this back eventually).
2678 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2680 Support a file name argument to %defines. Deprecate `=' in
2681 %file-prefix, %name-prefix, and %output. Discussed at
2682 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
2683 * NEWS (2.3a+): Mention.
2684 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
2685 form of %defines, and remove `=' from entries for %file-prefix,
2686 %name-prefix, and %output.
2687 * src/parse-gram.y (prologue_declaration): Implement.
2688 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
2689 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
2690 all but one occurrence of %name-prefix.
2691 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
2692 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
2693 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
2694 occurrence of each of %file-prefix and %output. Add check for %defines
2696 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
2697 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
2698 Remove the `=' from %output.
2700 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
2702 Don't escape $ in test case titles since Autoconf 2.61 now does that
2704 * tests/actions.at (Default %printer and %destructor are not for error
2705 or $undefined): Here.
2706 (Default %printer and %destructor are not for $accept): Here.
2707 * tests/input.at (Invalid $n and @n): Here.
2709 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
2711 Rename <!> to <>. Discussed starting at
2712 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
2713 * NEWS (2.3a+): Update.
2714 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
2716 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
2717 * src/scan-gram.l (INITIAL): Implement.
2718 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
2719 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
2721 * tests/actions.at (Default tagless %printer and %destructor,
2722 Default tagged and per-type %printer and %destructor,
2723 Default %printer and %destructor are not for error or $undefined,
2724 Default %printer and %destructor are not for $accept,
2725 Default %printer and %destructor for mid-rule values): Update.
2726 * tests/input.at (Default %printer and %destructor redeclared,
2727 Unused values with default %destructor): Update.
2729 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2731 Don't let %prec take a nonterminal.
2732 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
2734 * tests/input.at (%prec takes a token): New test checking that %prec
2735 won't take a nonterminal.
2737 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2739 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
2740 it was double-quoted.
2741 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
2742 grammar is maintained with Bison's highest standards.
2743 * src/getargs.c: Fix some typos in Doxygen comments.
2745 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2747 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
2748 later. Reported by Paul Eggert in
2749 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
2750 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
2751 * src/scan-code.l (translate_action): Don't bother invoking
2752 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
2753 (code_scanner_free): Instead of invoking
2754 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
2756 * src/scan-gram.l (gram_scanner_free): Likewise.
2757 * src/scan-skel.l (scan_skel): Likewise.
2759 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2761 * src/files.c (tr): Change return type to void.
2762 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
2763 has been called previously for the same key.
2764 (muscle_find): Return storage instead of value so that
2765 --enable-gcc-warnings doesn't produce warnings that the return discards
2766 const. aver that the value and storage are the same since storage
2767 could potentially be NULL when value is not.
2768 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
2771 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2773 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
2774 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
2775 us a slightly cleaner distribution, and also works.
2776 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
2779 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
2780 and Paul Eggert <eggert@cs.ucla.edu>
2782 Don't let Bison leak memory except when it complains.
2783 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
2784 (spec_defines_file, dir_prefix): Now char *, not const char *,
2785 since they are freed.
2786 * src/files.c: Likewise.
2787 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
2789 (tr): Now operates in-place. All uses changed.
2790 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
2792 (compute_file_name_parts, compute_output_file_names): Don't store
2793 read-only data in variables that will be freed.
2794 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
2795 src_extension, and header_extension.
2796 (output_file_names_free): New public function to free
2797 spec_verbose_file, spec_graph_file, spec_defines_file,
2798 parser_file_name, and dir_prefix.
2799 * src/getargs.c (getargs): Don't store read-only data in variables that
2801 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
2802 (which previously existed but was unused), and quotearg_free.
2803 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
2804 * src/muscle_tab.c: Likewise.
2805 (muscle_entry): Make the value char const *,
2806 and add a new storage member that is char * and can be freed.
2807 (muscle_entry_free): New private function.
2808 (muscle_init): Use it instead of free.
2809 (muscle_insert, muscle_grow): Update and use new storage member.
2810 (muscle_code_grow): Free the string passed to muscle_grow
2811 since it's not needed anymore.
2812 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
2813 add a new `char *code' member.
2814 ("{...}"): Declare semantic type as code.
2815 * src/scan-code.h (translate_rule_action):
2816 (translate_symbol_action, translate_code, translate_action): Return
2817 `char const *' rather than `char *' since external code should not free
2819 * src/scan-code.l: Likewise.
2820 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
2821 which is "{...}" in the parser.
2822 * tests/Makefile.am (maintainer-check-valgrind): Set
2823 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
2825 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
2827 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
2828 expecting a non-zero exit status sets --leak-check=summary and
2829 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
2830 this case, and we don't want to hear about it.
2832 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2834 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
2835 instead of from the template, to simplify configuration a bit.
2836 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
2837 and m4/wint_t.m4, as they are needed with the latest gnulib.
2839 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2841 Disable unset/unused mid-rule value warnings by default, and recognize
2842 --warnings=midrule-values to enable them. Discussed starting at
2843 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
2844 * NEWS (2.3a+): Mention.
2845 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
2846 warnings): Add entry for midrule-values subargument.
2847 * src/reader.c (symbol_should_be_used): Don't return true just because
2848 the value is a set/used mid-rule value unless
2849 --warnings=midrule-values was specified.
2850 * tests/input.at (Unused values, Unused values before symbol
2851 declarations): Run tests with and without --warnings=midrule-values.
2853 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
2854 than LIST_FREE directly.
2856 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2858 Finish implementing --warnings=error, which should not be implied by
2859 --warnings=all (or by its synonyms -W and --warnings without
2861 * src/complain.c (set_warning_issued): New function to report that
2862 warnings are being treated as errors and to record an error if so.
2864 (warn_at, warn): ... here.
2865 * src/getargs.c (warnings_args, warnings_types): Reorder so that
2866 "error - warnings are errors" does not appear above "all - all of the
2868 (getargs): For -W and --warnings without subarguments, don't let
2869 FLAGS_ARGMATCH set warnings_error in warnings_flag.
2870 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
2872 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2874 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
2875 empty subargument list. For example: `bison --warnings= parser.y'.
2877 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2879 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
2880 the parser header file so that gcc doesn't warn.
2882 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2884 Split the default %destructor/%printer into two kinds: <*> and <!>.
2885 Discussed starting at
2886 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
2887 * NEWS (2.3a+): Mention.
2888 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
2889 previous change today related to mid-rules.
2890 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
2891 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
2892 (TYPE_TAG_ANY): Add as <*>.
2893 (TYPE_TAG_NONE): Add as <!>.
2894 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
2896 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
2897 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
2898 * src/symlist.c (symbol_list_default_new): Split into tagged and
2900 (symbol_list_destructor_set, symbol_list_printer_set): Split
2901 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
2902 SYMLIST_DEFAULT_TAGLESS.
2903 * src/symlist.h: Update symbol_list_default*_new prototypes.
2904 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
2905 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
2906 * src/symtab.c (default_destructor, default_destructor_location,
2907 default_printer, default_printer_location): Split each into tagged and
2909 (symbol_destructor_get, symbol_destructor_location_get,
2910 symbol_printer_get, symbol_printer_location_get): Implement tagged
2911 default and tagless default cases.
2912 (default_destructor_set, default_printer_set): Split each into tagged
2913 and tagless versions.
2914 * src/symtab.h: Update prototypes.
2915 * tests/actions.at (Default %printer and %destructor): Rename to...
2916 (Default tagless %printer and %destructor): ... this, and extend.
2917 (Per-type %printer and %destructor): Rename to...
2918 (Default tagged and per-type %printer and %destructor): ... this, and
2920 (Default %printer and %destructor for user-defined end token): Extend.
2921 (Default %printer and %destructor are not for error or $undefined):
2923 (Default %printer and %destructor are not for $accept): Update.
2924 (Default %printer and %destructor for mid-rule values): Extend.
2925 * tests/input.at (Default %printer and %destructor redeclared): Extend.
2926 (Unused values with default %destructor): Extend.
2928 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2930 Don't apply the default %destructor/%printer to an unreferenced midrule
2932 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
2933 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
2934 like $@n instead of just @n so that the default %destructor/%printer
2935 logic doesn't see them as user-defined symbols.
2936 (symbol_is_dummy): Check for both forms of the name.
2937 * src/reader.c (packgram): Remove the `$' from each midrule symbol
2938 name for which the midrule value is referenced in any action.
2939 * tests/actions.at (Default %printer and %destructor for mid-rule
2941 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
2942 for change to dummy symbol names.
2944 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2946 Warn about unset midrule $$ if the corresponding $n is used.
2947 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
2949 (packgram): Before invoking grammar_rule_check on any rule, make sure
2950 all actions have already been scanned in order to set `used' flags.
2951 Otherwise, checking that a midrule's $$ is set will not always work
2952 properly because the midrule check must forward-reference the midrule's
2954 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
2957 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2959 More improvements to the documentation of the prologue alternatives:
2960 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
2962 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
2963 some text to clarify the relative importance of the new directives and
2964 to show how these directives may be viewed as code labels.
2966 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
2968 Similar to the recently removed %before-header, add %code-top as the
2969 alternative to the pre-prologue. Mentioned at
2970 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
2971 Also, let the prologue alternatives appear in the grammar section.
2972 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
2973 (prologue_declaration): Move the existing prologue alternatives to...
2974 (grammar_declaration): ... here and add %code-top.
2975 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
2977 Clean up and extend documentation for the prologue alternatives.
2978 * NEWS (2.3a+): Describe prologue alternatives.
2979 * doc/bison.texinfo (Prologue): Move discussion of prologue
2981 (Prologue Alternatives): ... this new section, and extend it to discuss
2982 all 4 directives in detail.
2983 (Table of Symbols): Clean up discussion of prologue alternatives and
2986 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2988 DJGPP specific issues.
2990 * djgpp/config.bat: config.hin has been moved to lib. Adjust
2991 config.bat accordingly.
2992 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
2993 * djgpp/config.site: Likewise.
2995 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
2997 Replace %*-header with %provides, %requires, %code. See discussion at
2998 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
3000 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
3001 (b4_user_start_header): Remove.
3002 * data/glr.c: Use new macros instead of b4_*start_header
3004 * data/glr.cc: Likewise.
3005 * data/lalr1.cc: Likewise.
3006 * data/push.c: Likewise.
3007 * data/yacc.c: Likewise.
3009 * doc/bison.texinfo: Remove %before-header, rename
3010 %{start,end,after}-header to %requires, %provides, %code.
3012 * src/parse-gram.y: Likewise (also rename token names accordingly).
3013 * src/scan-gram.l: Likewise.
3014 * tests/actions.at: Likewise.
3016 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
3018 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
3019 Problem reported by Joel E. Denny.
3021 2006-10-14 Jim Meyering <jim@meyering.net>
3023 (Sync from coreutils.)
3024 Work also when the working directory (with e.g. coreutils sources)
3025 is version controlled with git, rather than CVS.
3026 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
3028 In messages and comments, say e.g., "checked-out sources",
3029 rather than "CVS sources".
3030 (version_controlled_file): New function. Work for git as well as
3031 for CVS. Don't use grep's -q option.
3032 (slurp): Call it here, in place of CVS-specific code.
3034 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
3036 Fix testsuite for ./configure --enable-gcc-warnings:
3037 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
3038 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
3039 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
3040 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
3041 * test/regression.at (Diagnostic that expects two alternatives):
3044 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3046 * bootstrap.conf (gnulib_modules): Add config-h.
3047 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
3048 worry about HAVE_CONFIG_H.
3049 * lib/abitset.c: Likewise.
3050 * lib/bitset.c: Likewise.
3051 * lib/bitset_stats.c: Likewise.
3052 * lib/bitsetv-print.c: Likewise.
3053 * lib/bitsetv.c: Likewise.
3054 * lib/ebitset.c: Likewise.
3055 * lib/get-errno.c: Likewise.
3056 * lib/lbitset.c: Likewise.
3057 * lib/subpipe.c: Likewise.
3058 * lib/timevar.c: Likewise.
3059 * lib/vbitset.c: Likewise.
3060 * lib/bitset.c: Include "bitset.h" first, to test interface.
3061 * lib/bitset_stats.c: Include "bitset_stats.h" first.
3062 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
3063 * lib/bitsetv.c: Include "bitsetv.h" first.
3064 * lib/get-errno.c: Include "get-errno.h" first.
3065 * m4/.cvsignore: Add config-h.m4.
3066 * tests/actions.at (Default %printer and %destructor for ...):
3067 Adjust expected line numbers in output to reflect removal of #if
3068 HAVE_CONFIG_H lines.
3069 * tests/glr-regression.at (Missed %merge type warnings when ...):
3071 * tests/regression.at (Braced code in declaration in rules section):
3073 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
3074 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
3075 Include <config.h> unconditionally.
3077 * bootstrap: Sync from coreutils, as follows:
3079 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3081 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
3082 variable was sometimes used without being initialized. This
3083 messed up the installation of the INSTALL file in some cases.
3085 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3087 * bootstrap (usage, main program, symlink_to_gnulib): Add option
3088 --copy. Inspired by a suggestion from Bruno Haible.
3090 2006-10-03 Jim Meyering <jim@meyering.net>
3092 * bootstrap: Undo last change to this file, since now gnulib-tool
3093 sticks with the automake default in generating dependencies.
3095 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3097 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
3098 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
3100 * doc/bison.1: Add copyright notice.
3102 * data/glr.c: Don't include <stdarg.h>; not used.
3104 * NEWS: The -g and --graph options now output graphs in Graphviz
3105 DOT format, not VCG format.
3106 * doc/bison.1: Likewise.
3107 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
3108 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
3110 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
3111 * TODO: Remove Graphviz entry.
3112 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
3113 remove vcg.c, vcg.h, vcg_defaults.h.
3114 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
3115 * src/graphviz.c, src/graphviz.h: New files.
3116 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
3117 * src/files.h: Make comment more generic.
3118 * src/main.c (main): Likewise.
3119 * src/print_graph.h: Likewise.
3120 * src/getargs.c (usage): Make usage description more generic.
3121 * src/print_graph.c: Include graphviz.h rather than vcg.h.
3122 (static_graph, fgraph): Remove. All uses changed to pass
3123 arguments instead of sharing a static var.
3124 (print_core, print_actions, print_state, print_graph):
3125 Output graphviz format rather than VCG format.
3126 * tests/.cvsignore: Remove *.vcg; add *.dot.
3127 * tests/output.at: Expect *.dot files, not *.vcg files.
3129 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
3130 accommodates the 2006-10-08 change.
3132 2006-10-11 Bob Rossi <bob@brasko.net>
3134 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
3135 (b4_yyssa, b4_yyerror_range): New macros.
3136 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
3137 (yypvarsinit): Remove init of removed fields.
3138 (yypushparse): Remove use of removed fields; use new macros instead.
3140 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3142 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
3143 in a push parser. Reindent slightly to match yacc.c better.
3145 2006-10-11 Bob Rossi <bob@brasko.net>
3147 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
3149 (yypvarsinit, yypushparse): Remove init of removed fields.
3150 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
3152 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3154 * THANKS: Add Paolo Bonzini and Bob Rossi.
3156 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
3158 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
3159 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
3160 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
3161 b4_define_user_cde and uses): Remove.
3162 (b4_comment, b4_prefix, b4_sync_start): New.
3163 * data/bison.m4: New file, with most of the content removed from c.m4.
3164 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
3165 * src/output.c (output_skeleton): Pass bison.m4.
3166 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
3169 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
3171 Fix test failure reported by Tom Lane in
3172 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
3173 and try to make such failures easier to catch in the future.
3174 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
3175 that's now the caller's responsibility.
3176 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
3177 Set yychar = YYEOF if it's negative.
3178 * tests/actions.at (yylex): Abort if asked to read past EOF.
3179 * tests/conflicts.at (yylex): Likewise.
3180 * tests/cxx-type.at (yylex): Likewise.
3181 * tests/glr-regression.at (yylex): Likewise.
3182 * tests/input.at (yylex): Likewise.
3183 * tests/regression.at (yylex): Likewise.
3184 * tests/torture.at (yylex): Likewise.
3186 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
3188 Fix problems with translating English-language diagnostics.
3189 * bootstrap: Fix bug introduced in recent bootstrap changes, with
3190 respect to bison-runtime pot generation. The YY_ stuff
3191 wasn't being captured.
3192 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
3193 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
3194 * runtime-po/POTFILES.in: Add data/push.c.
3196 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
3198 Merge bootstrap changes from coreutils.
3200 2006-09-28 Jim Meyering <jim@meyering.net>
3202 Automatically generated dependencies are important even
3203 when all of the sources in a directory come from gnulib.
3204 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
3205 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
3207 2006-09-23 Jim Meyering <jim@meyering.net>
3209 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
3211 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3213 * bootstrap: Add support for --force.
3214 (usage): New function. Describe usage less tersely.
3215 (CVS_only_file): New var.
3217 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
3219 * data/push.c (YYPUSH_MORE): Make it an enum instead.
3220 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
3221 Adjust white space and comments to match GNU style better.
3223 2006-09-20 Bob Rossi <bob@brasko.net>
3225 * data/push.c (yyresult_get): Remove function.
3226 (YYPUSH_MORE): Add #define.
3227 (yypushparse): Modify return value.
3229 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3231 * stamp-h.in: Remove; no longer needed.
3232 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
3233 Remove config.h, config.hin, intl (no longer created).
3234 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
3237 Sync bootstrap from coreutils, as follows:
3239 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
3241 * bootstrap (symlink_to_gnulib): New function.
3242 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
3243 to copies-of-gnulib.
3244 (cp_mark_as_generated, slurp, gnulib_files):
3245 Avoid making a copy if it's the same as the old version.
3246 (gnulib_files): Add support for this variable (used by Bison).
3248 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3250 * src/getargs.c (usage): Rework to use conventions similar to
3251 coreutils, to make translation a bit easier and the code a bit
3252 smaller. Problem reported by Tim Van Holder.
3254 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
3256 Use some of gnulib's new modules, taken from coreutils.
3258 * bootstrap: Sync from coreutils, except add support for gnulib_files.
3259 * bootstrap.conf: New file.
3260 (gnulib_modules): Add configmake, inttypes, unistd.
3261 (XGETTEXT_OPTIONS): Add complain, complain_at,
3262 fatal, fatal_at, warn, warn_at, unexpected_end.
3263 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
3264 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
3266 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
3268 (GNULIB_AUTOCONF_SNIPPET): Remove.
3269 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
3271 * lib/.cvsignore: Add inttypes_.h.
3272 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
3273 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
3274 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
3275 no-longer-necessary initializations.
3276 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
3277 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
3278 use the unistd module.
3279 * src/system.h: Likewise.
3280 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
3281 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
3282 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
3283 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
3284 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
3285 * src/system.h: Include inttypes.h unconditionally, now that we
3286 use the inttypes module. Don't bother to include stdint.h, since
3287 inttypes.h now does that for us.
3288 (LOCALEDIR): Remove, now that we use the configmake module.
3289 * src/getargs.c: Include configmake.h.
3290 * src/main.c: Likewise.
3291 * src/output.c: Likewise.
3292 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
3293 not from $abs_top_builddir, since config.h moved.
3296 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
3297 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
3299 * src/parse-gram.y (symbol_declaration): Don't put statements
3300 before declarations; it's not portable to C89.
3301 * src/scan-code.l (handle_action_at): Likewise.
3303 * src/scan-code.l: Always initialize braces_level; the old code
3304 left it uninitialized and therefore had undefined behavior.
3306 Don't attempt to redefine 'assert', since it runs afoul of
3307 systems where standard headers (mistakenly) include <assert.h>.
3308 Instead, define and use our own alternative, called 'aver'.
3309 * src/reader.c: Don't include assert.h, since we no longer
3311 * src/scan-code.l: Likewise.
3312 * src/system.h (assert): Remove, replacing with....
3313 (aver): New function, taking a bool arg. All uses changed.
3314 * src/tables.c (pack_vector): Ensure that aver arg is bool,
3315 not merely an integer.
3317 2006-09-15 Bob Rossi <bob@brasko.net>
3319 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
3320 * data/c.m4 (YYPUSH): New.
3321 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
3322 * src/getargs.c (push_parser): New var.
3323 * src/getargs.h (push_parser): New declaration.
3324 * src/output.c (prepare): Add macro insertion of `push_flag'.
3325 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
3326 (prologue_declaration): Parse %push-parser.
3327 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
3328 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
3329 list of removed lines from the traces observed.
3330 (AT_CHECK_CALC_LALR): Added push parser tests.
3332 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
3334 * NEWS: Version 2.3a.
3335 * configure.ac (AC_INIT): Likewise.
3337 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
3338 "#define YYSTYPE int" that caused "make maintainer-check" to fail
3339 due to header ordering dependencies. I don't know why the #define
3342 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
3343 runtime cost when YYDEBUG is not defined, and so that some tests
3344 that used to fail now work. Problem and initial suggestion by
3346 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
3347 * data/glr.cc (b4_parser_class_name):
3348 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
3349 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
3350 (yydebug_) [YYDEBUG]: New member.
3351 (yycdebug_): Now defined only if YYDEBUG.
3352 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
3353 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
3354 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
3356 (debug_stream, set_debug_stream, debug_level, set_debug_level):
3357 Define only if YYDEBUG.
3358 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
3360 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
3361 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
3362 AT_CHECK_CALC_GLR_CC that are working now.
3364 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
3366 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
3367 We don't need them in glr.cc, and glr.c defines them.
3368 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
3369 assumes that defining it to anything is the same as defining
3370 it to 1. Problem reported by Paolo Bonzini.
3372 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
3374 * data/c.m4 (b4_null, b4_case): Define.
3375 * src/output.c (prepare_symbols): Use b4_null.
3376 (user_actions_output): Use b4_case.
3378 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
3380 * data/glr.c (b4_shared_declarations): Put start-header first,
3381 before any #includes that we generate, so that feature-test
3382 macros work. Problem reported by Michael Deutschmann in
3383 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
3384 * data/lalr1.cc: Likewise.
3385 * doc/bison.texinfo (Prologue): Document that feature-test macros
3386 should be defined before any Bison declarations.
3387 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
3388 that depend on location.hh after, not before, Bison decls, since
3389 we now include location.hh after the first user prologue.
3391 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
3392 Sander Brandenburg in
3393 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
3394 Also, fix minor white space and comment issues.
3395 (Prologue): Mention that it's better to define feature-test macros
3396 before Bison declarations. Problem reported by Michael Deutschmann.
3398 * README-cvs: Fix typo: "&" should be "&&". Problem reported
3400 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
3401 This adjusts to recent gnulib changes.
3403 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3405 Finish implementation of per-type %destructor/%printer. Discussed
3407 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
3409 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
3410 * NEWS (2.3+): Add a description of this feature to the default
3411 %destructor/%printer description.
3412 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
3413 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3414 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
3415 list node contains a semantic type.
3416 * src/symtab.c, src/symtab.h: Extend with a table that associates
3417 semantic types with their %destructor's and %printer's.
3418 (semantic_type_from_uniqstr, semantic_type_get,
3419 semantic_type_destructor_set, semantic_type_printer_set): New functions
3420 composing the public interface of that table.
3421 (symbol_destructor_get, symbol_destructor_location_get,
3422 symbol_printer_get, symbol_printer_location_get): If there's no
3423 per-symbol %destructor/%printer, look up the per-type before trying
3425 * tests/actions.at (Per-type %printer and %destructor): New test case.
3426 * tests/input.at (Default %printer and %destructor redeclared):
3427 Extend to check that multiple occurrences of %symbol-default in a
3428 single %destructor/%printer declaration is an error.
3429 (Per-type %printer and %destructor redeclared, Unused values with
3430 per-type %destructor): New test cases.
3432 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3434 Require default %destructor/%printer to be declared using
3435 %symbol-default instead of an empty symbol list, and start working on
3436 new per-type %destructor/%printer. Discussed at
3437 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
3438 * NEWS (2.3+): Add %symbol-default to example.
3439 * bison.texinfo (Freeing Discarded Symbols): Likewise.
3440 (Table of Symbols): Add entry for %symbol-default.
3441 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
3442 (generic_symlist, generic_symlist_item): New nonterminals for creating
3443 a list in which each item is a symbol, semantic type, or
3445 (grammar_declaration): Use generic_symlist in %destructor and %printer
3446 declarations instead of symbols.1 or an empty list.
3447 (symbol_declaration, precedence_declaration, symbols.1): Update actions
3448 for changes to symbol_list.
3449 * src/reader.c: Update for changes to symbol_list.
3450 * src/scan-code.l: Likewise.
3451 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
3452 * src/symlist.c, src/symlist.h: Extend such that a list node may
3453 represent a semantic type or a %symbol-default in addition to just an
3454 ordinary symbol. Add switched functions for setting %destructor's and
3456 * tests/actions.at, tests/input.at: Add %symbol-default to all default
3457 %destructor/%printer declarations.
3459 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
3461 Whether the default %destructor/%printer applies to a particular symbol
3462 isn't a question of whether the user *declares* that symbol (in %token,
3463 for example). It's a question of whether the user by any means
3464 *defines* the symbol at all (by simply using a char token, for
3465 example). $end is defined by Bison whereas any other token with token
3466 number 0 is defined by the user. The error token is always defined by
3467 Bison regardless of whether the user declares it with %token, but we
3468 may one day let the user define error as a nonterminal instead.
3469 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
3470 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
3471 the meaning of "user-defined".
3472 * tests/actions.at (Default %printer and %destructor for user-declared
3473 end token): Rename to...
3474 (Default %printer and %destructor for user-defined end token): ...
3477 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
3478 computation of whether to apply the default, don't maintain a list of
3479 every Bison-defined symbol. Instead, just check for a first character
3480 of '$', which a user symbol cannot have, and check for the error token.
3482 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
3484 Don't apply the default %destructor or %printer to the error token,
3485 $undefined, or $accept. This change fits the general rule that the
3486 default %destructor and %printer are only for user-declared symbols,
3487 and it solves several difficulties that are described in the new test
3489 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
3490 * tests/actions.at (Default %printer and %destructor are not for error
3491 or $undefined, Default %printer and %destructor are not for $accept):
3494 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
3496 Allow %start after the first rule.
3497 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
3498 when parsing the first rule.
3499 (check_and_convert_grammar): Search for it here after all grammar
3500 declarations have been parsed. Skip midrules, which have dummy LHS
3502 * src/symtab.c (symbol_is_dummy): New function.
3503 * src/symtab.h (symbol_is_dummy): Declare it.
3504 * tests/input.at (%start after first rule): New test.
3506 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3508 Redo some of the previous commit: add back the ability to use
3509 non-aliased/undeclared string literals since it might be useful to
3510 those declaring %token-table.
3511 * src/reader.c (check_and_convert_grammar): Undo changes in previous
3512 commit: don't worry about complaints from symbols_pack.
3513 * src/symtab.c (symbol_new, symbol_class_set,
3514 symbol_check_alias_consistency): Undo changes in previous commit: count
3515 each string literal as a new symbol and token, assign it a symbol
3516 number, and don't complain about non-aliased string literals.
3517 (symbols_pack): Since symbol_make_alias still does not decrement symbol
3518 and token counts but does still set aliased tokens to the same number,
3519 symbol_pack_processor now leaves empty slots in the symbols array.
3521 * tests/regression.at (Undeclared string literal): Remove test case
3522 added in previous commit since non-aliased string literals are allowed
3524 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
3525 remove unnecessary string literal declarations.
3526 * tests/sets.at (Firsts): Likewise.
3528 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3530 Don't allow an undeclared string literal, but allow a string literal to
3531 be used before its declaration.
3532 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
3533 symbols_pack complained.
3534 * src/symtab.c (symbol_new): Don't count a string literal as a new
3536 (symbol_class_set): Don't count a string literal as a new token, and
3537 don't assign it a symbol number since symbol_make_alias does that.
3538 (symbol_make_alias): It's not necessary to decrement the symbol and
3539 token counts anymore. Don't assume that an alias declaration occurs
3540 before any uses of the identifier or string, and thus don't assert that
3541 one of them has the highest symbol number so far.
3542 (symbol_check_alias_consistency): Complain if there's a string literal
3543 that wasn't declared as an alias.
3544 (symbols_pack): Bail if symbol_check_alias_consistency failed since
3545 symbol_pack asserts that every token has been assigned a symbol number
3546 although undeclared string literals have not.
3547 * tests/regression.at (String alias declared after use, Undeclared
3548 string literal): New test cases.
3549 (Characters Escapes, Web2c Actions): Declare string literals as
3551 * tests/sets.at (Firsts): Likewise.
3553 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
3555 In the grammar scanner, STRING_FINISH unclosed constructs and return
3556 them to the parser in order to improve error messages.
3557 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
3558 SC_BRACED_CODE, SC_PROLOGUE): Implement.
3559 * tests/input.at (Unclosed constructs): New test case.
3560 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
3563 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
3566 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
3568 Handle string aliases for character tokens correctly.
3569 * src/symtab.c (symbol_user_token_number_set): If the token has an
3570 alias, check and set its alias's user token number instead of its own,
3571 which is set to indicate the alias. Previously, every occurrence of
3572 the character token in the grammar overwrote that alias indicator with
3574 * tests/input.at (String aliases for character tokens): New test.
3576 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
3578 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
3580 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
3582 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
3583 to prevent failures when building on older platforms.
3584 Check for autopoint failure.
3585 Set XGETTEXT_OPTIONS to values that check for C format strings,
3586 so that translators are warned about them (this also helps
3587 prevent core dumps).
3589 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
3590 function, since it simplifies our code a bit.
3592 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
3593 rather than -W, so we don't get bogus warnings about sign comparisons.
3594 Add -Wpointer-arith, since that warning is useful (it reports code
3595 that does not conform to C89 and that some compilers reject).
3596 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
3597 since it's no longer needed.
3599 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
3601 Clean up scanners a bit.
3602 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
3603 definitions so gcc won't warn when obstack_for_string is unused.
3604 * src/scan-code.l: config.h and system.h are already #include'd by
3605 scan-code-c.c, so get rid of them here.
3606 * src/scan-gram.l: Likewise.
3607 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
3608 definitions rather than duplicating the rest of it.
3609 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
3611 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
3613 Suppress signed/unsigned comparison warnings for yycheck.
3614 * data/c.m4 (b4_safest_int_type): New macro.
3615 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
3616 a signed int type, cast it to b4_safest_int_type first.
3617 * data/yacc.c: Likewise.
3618 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
3621 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3623 * doc/bison.texinfo: Fix some typos.
3625 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
3627 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
3628 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
3630 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
3631 the latest gnulib does this a different way.
3632 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
3633 translation was patched, so stop omitting it.
3635 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3637 Enable declaration of default %printer/%destructor. Make the parser
3638 use these for all user-declared grammar symbols for which the user does
3639 not declare a specific %printer/%destructor. Thus, the parser uses it
3640 for token 0 if the user declares it but not if Bison generates it as
3641 $end. Discussed starting at
3642 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
3643 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
3645 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
3646 * NEWS (2.3+): Mention.
3647 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
3648 declare a %destructor for a mid-rule's semantic value. It's just
3649 impossible to declare one specific to it.
3650 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
3651 code. Describe default %destructor form.
3652 * src/parse-gram.y (grammar_declaration): Parse default
3653 %printer/%destructor declarations.
3654 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
3655 and symbol_destructor_location_get rather than accessing the destructor
3656 and destructor_location members of struct symbol.
3657 (symbol_printers_output): Likewise but for %printer's.
3658 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
3660 * src/symtab.c (default_destructor, default_destructor_location,
3661 default_printer, default_printer_location): New static global
3662 variables to record the default %destructor and %printer.
3663 (symbol_destructor_get, symbol_destructor_location_get,
3664 symbol_printer_get, symbol_printer_location_get): New functions to
3665 compute the appropriate %destructor and %printer for a symbol.
3666 (default_destructor_set, default_printer_set): New functions to set the
3667 default %destructor and %printer.
3668 * src/symtab.h: Prototype all those new functions.
3669 * tests/actions.at (Default %printer and %destructor): New test to
3670 check that the right %printer and %destructor are called, that they're
3671 not called for $end, and that $$ and @$ work correctly.
3672 (Default %printer and %destructor for user-declared end token): New
3673 test to check that the default %printer and %destructor are called for
3674 a user-declared end token.
3675 * tests/input.at (Default %printer and %destructor redeclared, Unused
3676 values with default %destructor): New tests to check related grammar
3677 warnings and errors.
3679 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3681 Clean up handling of %destructor for the end token (token 0).
3682 Discussed starting at
3683 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
3685 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
3687 Make the skeletons consistent in how they pop the end token and invoke
3689 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
3690 state, which has token number 0, since this would invoke the
3691 %destructor for the end token.
3692 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
3693 until after shifting the end token, or else it won't be popped.
3694 * data/yacc.c (yyparse): Likewise.
3696 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
3697 it's the end token. Upon termination, destroy an unshifted lookahead
3698 even when it's the end token.
3699 * data/lalr1.cc (yy::parser::parse): Likewise.
3700 * data/yacc.c (yyparse): Likewise.
3702 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
3703 value warnings for the end token when the user gives the end token a
3706 * tests/actions.at (Printers and Destructors): Test all the above.
3708 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
3710 Update to latest gnulib and gettext versions.
3711 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
3713 (gnulib_files): Add m4/warning.m4. Don't worry about files
3714 overwritten by autopoint.
3715 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
3716 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
3718 Don't use autoreconf; instead, invoke autopoint etc. by hand,
3719 so that we can remove the intl files at a better time.
3720 (intl_files_to_remove): Remove aclocal.m4, since it gets
3721 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
3722 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
3723 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
3724 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
3725 Remove datarootdir hack; no longer needed.
3726 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
3727 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
3728 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
3730 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
3731 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
3733 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
3735 * bootstrap: Adjust to today's change to gnulib-tool by invoking
3736 it with --assume-autoconf='latest-stable'.
3738 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
3740 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
3741 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
3743 * src/muscle_tab.h (muscle_grow): Replace the header comments with
3744 those from muscle_tab.c since the old ones are misleading.
3746 2006-07-13 Akim Demaille <akim@epita.fr>
3748 Support %define "KEY" {VALUE}.
3749 * src/scan-code.h, src/scan-code.l (translate_action)
3750 (translate_rule_action, translate_symbol_action, translate_code):
3751 Return char *, not const char *.
3752 * src/parse-gram.y (declaration): Rename as...
3753 (prologue_declaration): this.
3754 (string_content): Remove this nonterminal, use STRING.
3755 (braceless, content, content.opt): New nonterminal.
3757 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
3759 * src/scan-gram.l (getargs.h): Don't include it.
3761 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
3763 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
3764 rather than a for-loop that declares a local bool variable. This
3765 should work around a compatibility problem with a Cray x1e C++
3766 compiler reported by Hung Nguyen in
3767 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
3768 The for-loop was introduced in the 2004-11-17 change but I don't
3769 know why it was needed.
3771 2006-07-12 Akim Demaille <akim@epita.fr>
3773 * data/c.m4: Comment changes.
3775 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
3777 * src/complain.c (error_message, ERROR_MESSAGE): New.
3779 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
3780 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
3782 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3784 * NEWS: Instead of %union, you can define and use your own union type
3785 YYSTYPE if your grammar contains at least one <type> tag.
3786 Your YYSTYPE need not be a macro; it can be a typedef.
3787 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
3788 (Union Decl, Decl Summary): Document this.
3789 * data/glr.c (YYSTYPE): Implement this.
3790 * data/glr.cc (YYSTYPE): Likewise.
3791 * data/lalr1.cc (YYSTYPE): Likewise.
3792 * data/yacc.c (YYSTYPE): Likewise.
3793 * src/output.c (prepare): Output tag_seen_flag.
3794 * src/parse-gram.y (declaration, grammar_declaration):
3795 Use 'union_seen' rather than 'typed' to determine whether
3796 %union has been seen, since grammars can now be typed without
3798 (symbol_declaration, type.opt, symbol_def):
3799 Keep track of whether a tag has been seen.
3800 * src/reader.c (union_seen, tag_seen): New vars.
3802 * src/reader.h (union_seen, tag_seen, typed): Likewise.
3803 * src/scan-code.l (untyped_var_seen): New variable.
3804 (handle_action_dollar): Adjust to above changes.
3805 (handle_action_dollar, handle_action_at):
3806 Improve overflow checking for outlandish numbers.
3807 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
3808 avoid new diagnostics generated by above changes.
3809 * tests/regression.at (YYSTYPE typedef): Add test to check
3810 for type tags without %union.
3812 * src/symlist.c (symbol_list_length): Return int, not unsigned
3813 int, since callers expect int. This may need to get revisited
3814 once we have proper integer overflow checking.
3816 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
3817 object is now static.
3819 * src/getargs.c (flags_argmatch): Return void, not int,
3820 to pacify ./configure --enable-gcc-warnings.
3822 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
3823 since last_string is already defined to FLEX_PREFIX (last_string).
3825 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
3827 Implement --warnings/-W.
3828 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
3830 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
3832 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
3833 (warnings_args, warnings_types): New.
3834 (getargs, short_options, long_options): Accept -W/--warnings.
3835 Sort the options by alphabetical order, upper case letter right
3836 before its lower case.
3838 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3840 Change %merge result type clash warnings to errors. Discussed at
3841 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
3842 * src/reader.c (record_merge_function_type): Use complain_at.
3843 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3844 declared later): Update test case results.
3846 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
3848 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
3849 to be in alphabetical order.
3850 (trace_args): Spelling fixes.
3852 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3854 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
3855 so they don't collide with user-defined macros.
3856 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
3857 this was never guaranteed, and now that we're using gnulib stdint,
3858 which defines int_fast16_t to long int, the problem is exposed.
3860 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
3862 * data/c.m4 (b4_basename): Simplify a bit, since we don't
3863 need the full POSIX semantics (and weren't implementing them
3866 Adjust to Autoconf 2.60 and today's gnulib.
3867 * bootstrap (gnulib_modules): Add stdint.
3868 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
3869 no longer copies it.
3870 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
3871 since stdint needs the former and wcwidth (which is now required
3872 by mbswidth) needs the latter.
3873 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
3874 work around a compatibility glitch between gettext 0.14.6 and
3876 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
3877 Do not check for uintptr_t, since new stdint module does the right
3879 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
3880 Add stdint.h, stdint_.h, wcwidth.h.
3881 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
3882 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
3883 stdint.m4, wchar_t.m4, wcwidth.m4.
3884 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
3885 usual order for ../lib/*.h files.
3886 (file_name_split): Use last_component, not base_name, to adjust
3888 * src/parse-gram.h: Include <strverscmp.h> in the usual order
3889 for ../lib/*.h files.
3890 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
3891 Define unconditionally, since we now assume the stdint module.
3892 * src/scan-skel.l: Include <dirname.h>.
3893 (BASE_QPUTS): Use last_component, not base_name.
3894 * src/system.h: Include <unlocked-io.h> in the usual order
3895 for ../lib/*.h files. Include <stdint.h> unconditionally,
3896 since we now use the stdint module.
3897 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
3898 HAVE_UINTPTR_T, since we now use the stdint module.
3899 (base_name): Remove decl, since files now include <dirname.h>
3902 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
3904 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
3906 * data/yacc.c, data/glr.c, data/location.cc: Use them.
3907 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
3909 * tests/calc.at: Adjust.
3911 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
3913 * data/c.m4 (b4_basename): New.
3914 (b4_syncline): Also output the location of its invocation (from
3916 (b4_user_action, b4_define_user_action, b4_user_actions)
3917 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
3918 (b4_user_stype): New.
3919 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
3921 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3923 In the grammar file, the first column is 1 not 0 on the first line as
3924 on every other line.
3925 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
3926 * tests/input.at (Torturing the Scanner): Update output.
3928 * src/scan-gram.l (scanner_cursor): Declare it static.
3930 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3932 In warnings, say "previous declaration" rather than "first
3934 * src/symtab.c (redeclaration): Do that here.
3935 * src/reader.c (record_merge_function_type): In the case of a result
3936 type clash, report the previous declaration rather than the very first
3937 one in the grammar file.
3938 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3939 declared later): Add a third declaration to check this behavior.
3940 * tests/input.at (Incompatible Aliases): Update output.
3942 2006-06-27 Akim Demaille <akim@epita.fr>
3944 * doc/Doxyfile.in: New.
3945 * doc/Makefile.am: Use it.
3946 * src/lalr.h, src/symtab.h: Initial doxygenation.
3948 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3950 Don't miss %merge result type warnings just because the LHS types are
3951 declared after the %merge. This continues the effort of the previous
3953 * src/reader.c (get_merge_function): Don't set the merger type yet.
3954 (record_merge_function_type): New function for setting the merger type
3955 and checking for clashes.
3956 (grammar_current_rule_merge_set): Set the location of the %merge for
3958 (packgram): Invoke record_merge_function_type for each rule now that
3959 all symbol type declarations have been parsed.
3960 * src/reader.h (merger_list.type_declaration_location): New member
3961 storing the location of the first %merge from which the type for this
3962 merging function was derived.
3963 * src/symlist.h (symbol_list.merger_declaration_location): New member
3964 storing the location of a rule's %merge, if any.
3965 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3966 declared later): New test to catch the error fixed by the above patch.
3968 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3970 Get action warnings (grammar_rule_check) right even when symbol
3971 declarations appear after the rules. Discussed at
3972 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
3974 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
3975 Don't mistake the type of $$ in a midrule to be that of its parent
3977 * src/reader.c (grammar_current_rule_end): Don't invoke
3978 grammar_rule_check yet since not all symbol declarations may have been
3980 (grammar_midrule_action): Likewise.
3981 Don't record whether the midrule's $$ has been used yet since actions
3982 haven't been translated yet.
3983 Record the midrule's parent rule and its RHS index within the parent
3985 (grammar_current_rule_action_append): Don't translate the action yet
3986 since not all symbol declarations may have been parsed yet and, thus,
3987 warnings about types for $$, $n, @$, and @n can't be reported yet.
3988 (packgram): Translate the action and invoke grammar_rule_check now that
3989 all symbol declarations have been parsed.
3990 * src/scan-code.l (handle_action_dollar): Now that this is invoked
3991 after parsing the entire grammar file, the symbol list here in the case
3992 of a midrule is actually the midrule's empty RHS, so reference its
3993 parent rule's RHS where necessary.
3994 On the other hand, now that you can already know it's a midrule, you
3995 aren't forced to think $$ has the same type as its parent rule's $$.
3996 (handle_action_at): In the case of a midrule, reference the parent rule
3998 * src/symlist.c (symbol_list_new): Initialize new midrule-related
4000 (symbol_list_length): Now that this is invoked after all rules have
4001 been parsed, a NULL symbol (rather than a NULL symbol list node)
4002 terminates a rule. symbol_list_print already does this correctly.
4003 * src/symlist.h (symbol_list.midrule_parent_rule,
4004 symbol_list.midrule_parent_rhs_index): New members so that midrules can
4005 remember their relationships with their parents.
4006 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
4007 fixed by the above patch.
4008 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
4010 (Unused values): ... this old test case and...
4011 (Unused values before symbol declarations): ... this new test case.
4012 This one is the same as `Unused values' except that all symbol
4013 declarations appear after the rules in order to catch the rest of the
4014 errors fixed by the above patch.
4016 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4019 * src/reader.c (current_rule): Declare it static since it's no longer
4020 used outside this file.
4021 (grammar_current_rule_action_append): Remove redundant arguments from
4022 translate_rule_action invocation.
4023 * src/reader.h (current_rule): Remove this unused extern.
4024 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
4025 * src/scan-code.l (translate_rule_action): Likewise.
4027 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
4029 Clean up yesterday's patch.
4030 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
4032 * src/reader.c (grammar_current_rule_action_append): ... here for
4033 consistency with grammar_current_rule_symbol_append.
4034 * tests/regression.at (Braced code in declaration in rules section):
4035 Make yyerror and yylex static as usual.
4037 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
4039 Fix bug that mistakes braced code in a declaration in the rules section
4040 to be a rule action. Mentioned at
4041 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
4042 * src/scan-gram.l: Move midrule action detection from the start of the
4043 scanning of any braced code to...
4044 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
4045 action. For readability, use $2 and @2 rather than the equivalent
4047 * tests/regression.at (Braced code in declaration in rules section):
4048 New test to catch the error fixed by the above patch.
4050 Work on code readability some.
4051 * src/scan-code.l (current_rule): Get rid of this misleading and
4052 redundant declaration: it's actually extern'ed in reader.h.
4053 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
4054 translate_action): Add a rule argument and use it instead of the global
4056 (translate_rule_action): This already receives current_rule through an
4057 argument, so pass it on to translate_action instead of assigning
4058 current_rule to current_rule.
4059 (translate_symbol_action, translate_code): Pass rule = NULL to
4062 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
4064 Rename %before-definitions to %start-header and %after-definitions to
4065 %end-header. Don't use these declarations to separate pre-prologue
4066 blocks from post-prologue blocks. Add new order-independent
4067 declarations %before-header and %after-header as alternatives to the
4068 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
4069 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
4070 * NEWS (2.3+): Update for these changes.
4071 * data/glr.c (b4_before_definitions): Update to...
4072 (b4_start_header): ... this.
4073 (b4_after_definitions): Update to...
4074 (b4_end_header): ... this.
4075 * data/glr.cc: Likewise.
4076 * data/lalr1.cc: Likewise.
4077 * data/yacc.c: Likewise.
4078 * doc/bison.texinfo (The prologue): Update names, and replace remaining
4079 prologue blocks with %*-header declarations.
4080 (Calc++ Parser): Likewise.
4081 (Decl Summary): Update names.
4082 (Table of Symbols): Update description.
4083 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
4084 (PERCENT_END_HEADER): ... this.
4085 (PERCENT_BEFORE_DEFINITIONS): Update to...
4086 (PERCENT_START_HEADER): ... this.
4087 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4088 (declaration): Update token names and m4 macro names.
4089 When parsing %end-header and %start-header, invoke translate_code
4090 before muscle_code_grow, and no longer set global booleans to remember
4091 whether these declarations have been seen.
4092 Parse new %after-header and %before-header.
4093 * src/reader.c (before_definitions, after_definitions): Remove.
4094 (prologue_augment): Accept a new bool argument to specify whether to
4095 augment the pre-prologue or post-prologue.
4096 * src/reader.h (before_definitions, after_definitions): Remove these
4098 (prologue_augment): Add new bool argument.
4099 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
4100 (PERCENT_END_HEADER): ... this.
4101 (PERCENT_BEFORE_DEFINITIONS): Update to...
4102 (PERCENT_START_HEADER): ... this.
4103 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4104 * tests/actions.at (Printers and Destructors): Update names.
4106 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
4108 Add comparison operators for C++ location classes. Discussed at
4109 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
4110 * data/c++.m4 (b4_define_location_comparison): New boolean %define
4111 declaration indicating whether filename_type has an operator==. If
4112 filename_type is `std::string', it defaults to `1', `0' otherwise.
4113 * data/location.cc: Iff b4_define_location_comparison is `1', add
4114 operator== and operator!= for class position and for class location.
4117 * src/scan-action.l: Remove unused file.
4118 * src/symtab.c (symbol_printer_set): Use printer_location not
4119 destructor_location.
4120 * src/symtab.h (struct symbol): Replace incorrect source comment for
4122 * tests/input.at (Incompatible Aliases): Update output with correct
4125 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
4127 Don't put the pre-prologue in the header file. For the yacc.c code
4128 file and the glr.c header and code files, move the pre-prologue before
4129 the token definitions. Add new %before-definitions and
4130 %after-definitions to declare code that will go in both the header file
4131 and code file. Discussed at
4132 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
4133 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
4135 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
4136 * NEWS (2.3+): Describe these changes.
4137 * data/glr.c (b4_pre_prologue): Move from within to before...
4138 (b4_shared_declarations): ... this.
4139 Add new b4_before_definitions before b4_token_enums.
4140 Add new b4_after_definitions at the end.
4141 * data/glr.cc (b4_pre_prologue): Replace with...
4142 (b4_before_definitions): ... this in the header file.
4143 (b4_after_definitions): New near the end of the header file.
4144 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
4145 code file right before including the header file.
4146 (b4_before_definitions): New in the previous position of
4147 b4_pre_prologue in the header file.
4148 (b4_after_definitions): New near the end of the header file.
4149 * data/yacc.c: Clean up some m4 quoting especially in the header file.
4150 (b4_token_enums_defines): In the code file, move to right before
4151 YYSTYPE for consistency with the header file.
4152 (b4_before_definitions): New right before b4_token_enums_defines in
4153 both the header and code file.
4154 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
4155 header and code file.
4156 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
4157 of prologues for %union dependencies.
4158 (Decl Summary): In %defines description, mention the effect of
4159 %before-definitions and %after-definitions on the header file.
4160 (Calc++ Parser): Forward declare driver in a %before-definitions rather
4161 than in the pre-prologue so that make check succeeds.
4162 (Table of Symbols): Add entries for %before-definitions and
4164 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
4165 %before-definitions.
4166 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
4167 (declaration): Parse those declarations and append to
4168 b4_before_definitions and b4_after_definitions, respectively.
4169 * src/reader.c (before_definitions, after_definitions): New bools to
4170 track whether those declarations have been seen.
4171 (prologue_augment): Add to the post-prologue if %union,
4172 %before-definitions, or %after-definitions has been seen.
4173 * src/reader.h (before_definitions, after_definitions): New extern's.
4174 * src/scan-gram.l: Scan the new declarations.
4175 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
4176 prologue block in a %before-definitions or a %after-definitions based
4177 on whether the %union is declared.
4178 * tests/regression.at (Early token definitions with --yacc, Early token
4179 definitions without --yacc): Move tests for token definitions into the
4180 post-prologue since token names are no longer defined in the
4183 2006-06-20 Akim Demaille <akim@epita.fr>
4185 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
4186 (symbol_get): Use it.
4187 * src/parse-gram.y: Use it.
4189 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
4191 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
4192 build succeeds when configured with --enable-gcc-warnings.
4194 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
4196 * src/parse-gram.y (char_name): New function.
4197 (CHAR, STRING, string_content): For %printer, properly escape.
4198 (ID): Prefer fputs to fprintf.
4199 (id): Reindent to be consistent with other rules.
4200 Properly quote char.
4202 The Translation Project changed its way of publishing translations
4203 to maintainers. I haven't received any responses to my request
4204 for supporting the old way, or for documenting the new way. I
4205 have modified 'bootstrap' to use screen scraping
4206 (in this case, HTML scraping). This is unreliable and inelegant,
4207 but I don't see any better way. Yuck.
4208 * bootstrap (TP_URL, WGET_COMMAND): New vars.
4209 (get_translations): New function, which uses HTML scraping to
4210 deduce locations of latest translations.
4211 Use this function to grab both bison and bison-runtime .po files.
4212 Don't bother priming the pump for the runtime-po domain any more,
4213 as it's now translated better than bison is.
4215 2006-06-19 Akim Demaille <akim@epita.fr>
4217 * src/scan-gram.l: No longer "parse" things after `%union' until
4218 `{'. Rather, return a single "%union" token.
4219 No longer make symbols: return strings, and leave the conversion
4220 to symbols to the parser.
4221 (SC_PRE_CODE, token_type): Remove.
4222 * src/parse-gram.y (%union): New field `character'.
4225 (ID, ID_COLON): Now that the scanner no longer makes them
4226 identifiers, adjust all uses to invoke symbol_get.
4227 (id_colon): New, wraps the conversion from string to symbol.
4228 (%union): Accept a possible union_name.
4229 (symbol): Now can be a char.
4230 * data/c.m4 (b4_union_name): Leave a default value.
4231 * data/glr.c, data/yacc.c: Use it.
4233 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
4235 For associating token numbers with token names for "yacc.c", don't use
4236 #define statements unless `--yacc' is specified; always use enum
4237 yytokentype. Most important discussions start at:
4238 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
4239 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
4241 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
4242 * NEWS (2.3+): Mention.
4243 * data/c.m4 (b4_yacc_if): New.
4244 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
4246 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
4247 on token name definitions.
4248 * src/getargs.c (usage): Capitalize `Yacc' in English.
4249 * src/output.c (prepare): Define b4_yacc_flag.
4250 * tests/regression.at (Early token definitions): Test that tokens names
4251 are defined before the pre-prologue not just before the post-prologue.
4252 Remove this test case and copy to...
4253 (Early token definitions with --yacc): ... this to test #define's.
4254 (Early token definitions without --yacc): ... and this to test enums.
4256 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
4258 * NEWS: Reword the post-2.3 change to not be so optimistic about
4259 removing the old "look-ahead" spelling.
4260 Update previous look-ahead/lookahead change reports.
4261 * REFERENCES: look-ahead -> lookahead (since that's
4262 what he actually wrote).
4263 * doc/refcard.tex: look ahead -> lookahead,
4264 look-ahead -> lookahead
4266 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
4268 For consistency, use `lookahead' instead of `look-ahead' or
4269 `look_ahead'. Discussed starting at
4270 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
4272 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
4273 * NEWS: For the next release, note the change to `--report'.
4274 * TODO, doc/bison.1: Update English.
4275 * doc/bison.texinfo: Update English.
4276 (Understanding Your Parser, Bison Options): Document as
4277 `--report=lookahead' rather than `--report=look-ahead'.
4278 * src/conflicts.c: Update English in comments.
4279 (lookahead_set): Rename from look_ahead_set.
4280 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
4281 (resolve_sr_conflict): Rename local look_ahead_tokens to
4282 lookahead_tokens, and update other uses.
4283 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
4284 count_rr_conflicts, conflicts_free): Update uses.
4285 * src/getargs.c (report_args): Move "lookahead" before alternate
4287 (report_types): Update uses.
4288 (usage): For `--report' usage description, state `lookahead' spelling
4289 rather than `look-ahead'.
4290 * src/getargs.h (report.report_lookahead_tokens): Rename from
4291 report_look_ahead_tokens.
4292 * src/lalr.c: Update English in comments.
4293 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
4294 (state_lookahead_tokens_count): Rename from
4295 state_look_ahead_tokens_count.
4296 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4297 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
4298 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4300 Update English in output.
4301 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
4302 * src/print.c: Update English in comments.
4303 (lookahead_set): Rename from look_ahead_set.
4304 (print_reduction): Rename argument lookahead_token from
4306 (print_core, state_default_rule, print_reductions, print_results):
4308 * src/print_graph.c: Update English in comments.
4309 (print_core): Update uses.
4310 * src/state.c: Update English in comments.
4311 (reductions_new): Update uses.
4312 (state_rule_lookahead_tokens_print): Rename from
4313 state_rule_look_ahead_tokens_print, and update other uses.
4314 * src/state.h: Update English in comments.
4315 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
4316 (state_rule_lookahead_tokens_print): Rename from
4317 state_rule_look_ahead_tokens_print.
4318 * src/tables.c: Update English in comments.
4319 (conflict_row, action_row): Update uses.
4320 * tests/glr-regression.at
4321 (Incorrect lookahead during deterministic GLR,
4322 Incorrect lookahead during nondeterministic GLR): Rename
4323 print_look_ahead to print_lookahead.
4324 * tests/torture.at: Update English in comments.
4325 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
4326 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
4327 (Many lookahead tokens): Update uses.
4328 * data/glr.c: Update English in comments.
4329 * lalr1.cc: Likewise.
4331 * src/conflicts.h: Likewise.
4332 * src/lalr.h: Likewise.
4333 * src/main.c: Likewise.
4334 * src/output.c: Likewise.
4335 * src/parse-gram.c: Likewise.
4336 * src/tables.h: Likewise.
4337 * tests/calc.at: Likewise.
4339 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
4341 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
4343 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
4345 * TODO: Add request from Nelson H. F. Beebe to be able to install
4346 Bison without installing the yacc script.
4348 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4350 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
4351 and yytext if they're already #define'd.
4352 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
4353 * src/scan-code-c.c: ... here.
4354 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
4357 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4359 Get Bison to build again when configured with --enable-gcc-warnings.
4360 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
4362 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
4363 loc argument as it shadows a global.
4364 * src/scan-gram.l: Remove stray comma that prevents boundary_set
4367 * src/.cvsignore: Add scan-code.c.
4369 2006-06-07 Akim Demaille <akim@epita.fr>
4371 * src/scan-gram.l: Move the "add a trailing ; to actions" code
4373 * src/scan-code.l: here.
4374 * tests/input.at (Torturing the Scanner): Fix another location
4377 2006-06-07 Akim Demaille <akim@epita.fr>
4379 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
4381 2006-06-06 Akim Demaille <akim@epita.fr>
4383 Extract the parsing of user actions from the grammar scanner.
4384 As a consequence, the relation between the grammar scanner and
4385 parser is much simpler. We can also split "composite tokens" back
4387 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
4388 * src/scan-gram.l (add_column_width, adjust_location): Move to and
4390 * src/location.h, src/location.c (add_column_width)
4391 (location_compute): these.
4392 Fix the column count: the initial column is 0.
4393 (location_print): Be robust to ending column being 0.
4394 * src/location.h (boundary_set): New.
4395 * src/main.c: Adjust to scanner_free being renamed as
4397 * src/output.c: Include scan-code.h.
4398 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
4400 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
4401 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
4402 which is now, again, a separate token.
4403 Adjust all dependencies.
4404 Whereever actions with $ and @ are used, use translate_code.
4405 (action): Remove this nonterminal which is now useless.
4406 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
4407 (grammar_current_rule_action_append): Use translate_code.
4408 (packgram): Bound check ruleno, itemno, and rule_length.
4409 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
4410 (last_string, last_braced_code_loc, max_left_semantic_context)
4411 (scanner_initialize, scanner_free, scanner_last_string_free)
4412 (gram_out, gram_lineno, YY_DECL_): Move to...
4413 * src/scan-gram.h: this new file.
4414 (YY_DECL): Rename as...
4416 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
4417 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4418 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4419 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4420 Move these declarations, and...
4421 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
4423 * src/flex-scanner.h: this new file.
4424 * src/scan-gram.l (rule_length, rule_length_overflow)
4425 (increment_rule_length): Remove.
4426 (last_braced_code_loc): Rename as...
4427 (gram_last_braced_code_loc): this.
4428 Adjust to the changes of the parser.
4429 Move all the handling of $ and @ into...
4430 * src/scan-code.l: here.
4431 * src/scan-gram.l (handle_dollar, handle_at): Remove.
4432 (handle_action_dollar, handle_action_at): Move to...
4433 * src/scan-code.l: here.
4434 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
4435 scan-code.h, scan-code-c.c, scan-gram.h.
4436 (EXTRA_bison_SOURCES): Add scan-code.l.
4437 (BUILT_SOURCES): Add scan-code.c.
4438 (yacc): Be robust to white spaces.
4440 * tests/conflicts.at, tests/input.at, tests/reduce.at,
4441 * tests/regression.at: Adjust the column numbers.
4442 * tests/regression.at: Adjust the error message.
4444 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4446 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4447 Use Akim's wording from
4448 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
4450 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4452 Between Bison releases, manually append `+' to the previous Bison
4453 release number, and use that as a signal to automatically print the
4454 ChangeLog's CVS Id keyword from --version. Discussed starting at
4455 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
4456 * ChangeLog: Add Id header.
4457 * configure.ac (AC_INIT): Append `+' to `2.3'.
4458 * src/.cvsignore: Add revision.c.
4459 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
4460 (BUILT_SOURCES): Add revision.c.
4461 (revision.c): New target rule. This file defines a new global variable
4462 named revision. It initializes it with either the Id from ChangeLog
4463 or, if VERSION doesn't contain `+', with the empty string.
4464 * src/getargs.c (version): Print the value of revision.
4465 * src/revision.h: Extern revision.
4467 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
4469 * NEWS: Version 2.3.
4470 * configure.ac (AC_INIT): Likewise.
4472 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
4474 * data/glr.c (YYRECOVERING): Define to be a function-like macro
4475 with no arguments, not as an object-like macro. This is for
4476 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
4477 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
4478 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
4481 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
4483 * src/getargs.c (usage): Back out yesterday's modification of the
4484 --help output so that we don't have to wait for translation before
4487 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
4489 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
4490 Problem reported by Akim Demaille.
4492 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4494 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4496 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
4498 * data/yacc.c (yy_reduce_print): Omit trailing white space in
4499 generated source code. Problem reported by Frans Englich in
4500 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
4502 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
4504 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
4505 shell, not within 'make', so that 'make' by an ordinary builder
4506 (using GNU make) does not worry about configuring gzip. This also
4507 works around a bug reported independently by Keith Thompson and by
4508 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
4509 stderr rather than stdout, messing up the build logs.
4511 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4513 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
4514 to make sure that YYID will never be unused. This fixes a 'make
4515 maintainer-check' failure caused by the recent changes to the 'Trivial
4516 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
4518 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
4520 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4522 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
4523 state before an empty RHS is always resolved here. Only the location
4524 of that state is guaranteed to be resolved, and that's enough. This
4525 fixes the remaining bug reported by Derek M. Jones in
4526 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4527 * tests/glr-regression.at (Uninitialized location when reporting
4528 ambiguity): Test the above case.
4529 Also, the embedded comments in this test case claim it checks the case
4530 of an empty RHS that has inherited the initial location. However, the
4531 corresponding LHS was already resolved, so yyresolveLocations didn't
4532 actually have reason to modify it. Fix this by forcing
4533 nondeterministic operation at the beginning of the parse.
4535 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
4537 * data/c.m4 (b4_yy_symbol_print_generate):
4538 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
4539 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
4540 of the bugs reported today by Derek M Jones in
4541 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4542 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
4543 defined to be a type name without parens or brackets.
4544 (Location Type): Similarly for YYLTYPE.
4545 * tests/regression.at (Trivial grammars): Put in a test for this
4546 bug that will be caught by 'make maintainer-check' (though not,
4547 alas, by 'make check' unless your compiler is picky).
4549 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
4551 * NEWS: Version 2.2.
4552 * configure.ac (AC_INIT): Likewise.
4554 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
4556 * data/glr.c (yyreportTree): Make room in yystates for the state
4557 preceding the RHS. This fixes the segmentation fault reported by Derek
4559 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
4560 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
4561 to the user. Reported for yyreportTree by Derek M. Jones later in the
4563 * THANKS: Add Derek M. Jones.
4564 Update my email address.
4565 Fix typo in Steve Murphy's name.
4567 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
4569 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
4570 checking against YYLAST that caused the parser to miss a potential
4571 alternative in its diagnostic.
4572 Problem reported by Maria Jose Moron Fernandez in
4573 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
4574 * data/lalr1.cc (yysyntax_error_): Likewise.
4575 * data/yacc.c (yysyntax_error): Likewise.
4576 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
4577 tokens, in case we run into an older C compiler.
4578 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
4579 Use them to check for the off-by-one error fixed above.
4581 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
4582 YYSIZE_T, not size_t.
4583 * tests/regression.at (Trivial grammars): New test, to catch
4584 the error fixed by the above patch.
4586 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4588 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
4590 Reported by Steve Murphy.
4592 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4594 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
4595 * data/glr.cc: b4_location_flag is now b4_locations_flag.
4597 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4599 Implement --trace=m4.
4600 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
4601 * src/output.c (output_skeleton): When set, pass -dV to m4.
4603 Factor the handling of flags in m4.
4604 * src/output.c (prepare): Rename the muscle names debug, defines,
4605 error_verbose to debug_flag, defines_flag, error_verbose_flag.
4606 * data/c.m4: Adjust.
4607 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
4608 Use b4_define_flag_if to define other b4_FLAG_if macros.
4609 (b4_location_if): As a consequence, rename as...
4610 (b4_locations_if): this, for consistency.
4611 Adjust all the skeletons.
4613 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4615 * etc/bench.pm: Shorten bench names.
4617 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4619 * src/output.h, src/output.c (error_verbose): Move to...
4620 * src/getargs.h, src/getargs.c: here.
4622 Adjust dependencies.
4624 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
4626 * data/c.m4 (b4_copyright): Put the special exception for Bison
4627 skeletons here, so we don't have to put it in each skeleton. All
4628 uses changed. Suggested by Akim Demaille. Also, wrap the
4629 copyright notice, in case it is longer than 80 columns. Replace
4630 comma by newline after title.
4632 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
4634 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
4635 incompatibility, not a bug. Mention that it wasn't fixed as of
4638 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
4640 * examples/extexi: Enforce the precedence of concatenation over
4642 Reported by Tommy Nordgren.
4644 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
4646 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
4647 with the member "token".
4648 Reported by Martin Nylin.
4650 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
4652 * data/glr.c: Switch to Bison 2.2 special-exception language in
4653 the copyright notice. Use more-regular format for titles and
4655 * data/glr.cc: Likewise.
4656 * data/location.cc: Likewise.
4657 * data/yacc.cc: Likewise.
4658 * doc/bison.texinfo (Conditions): Document this.
4659 * NEWS: likewise. Upgrade version to 2.2.
4661 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
4663 * data/glr.cc: Remove dead code.
4665 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
4667 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
4668 that variable and the line breaks the bootstrap. Problem reported
4669 by Juan M. Guerrero.
4671 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
4673 * doc/bison.texinfo (Multiple start-symbols): New.
4675 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
4677 * etc/README, etc/bench.pl: New.
4679 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
4681 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
4683 Reported by Mickael Labau.
4684 * tests/input.at (Torturing the Scanner): Test it.
4686 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
4688 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
4689 Problem reported by Bob Rossi.
4691 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
4693 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
4694 and didn't really work.
4695 For the index, use @ifnotinfo, not @iftex.
4696 Minor cleanups of spacing and terminology.
4698 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
4700 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
4701 of AT_NAME_PREFIX when %name-prefix is not used.
4703 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
4705 Apply --prefix to C++ skeletons too: they change the namespace.
4706 The test suite already exercize these cases.
4707 * data/c++.m4 (b4_namespace): New.
4708 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
4709 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
4710 * data/yacc.c, data/glr.c: Remove a useless `[]'.
4711 * doc/bison.texinfo: Document it.
4712 (Option Cross Key): Use @multitable in all formats. It looks
4713 nicer, even in TeX outputs.
4714 (Rules): Use the same code whatever the output type is.
4715 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
4716 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
4717 * tests/calc.at: Use it, instead of hard coding `yy'.
4719 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
4721 * TODO: Remove dead items.
4723 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
4725 * doc/FAQ: Remove, merged into...
4726 * doc/bison.texinfo (FAQ): this.
4727 * doc/Makefile.am (EXTRA_DIST): Adjust.
4729 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
4731 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
4733 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
4734 * doc/bison.texinfo (Calc++ Scanner): Use it.
4736 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
4738 Fix two nits reported by twlevo, plus one more that I discovered.
4740 * src/assoc.h (assoc_to_string): Give a name to the arg, as
4741 this is the usual Bison style.
4742 * src/location.h (location_print): Likewise.
4744 * src/reader.h (token_name): Likewise.
4746 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
4748 Fix some nits reported by twlevo.
4749 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
4750 and "POSIX". Use more-modern syntax for URLs. Mention C++
4751 and ask for Java. Don't hardwire OS version numbers. Add
4753 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
4754 * src/conflicts.c (solved_conflicts_obstack): Now static.
4756 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4758 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
4759 page. Say "you can use it" not "you may use it" as on the web page;
4760 we're describing capabilities not granting permission.
4762 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
4764 * data/glr.c (yyresolveLocations): Rename local variables to avoid
4765 shadowing warnings. Use usual patter for iterating through RHS.
4766 * tests/glr-regression.at
4767 (Uninitialized location when reporting ambiguity):
4768 Modify yylex so that it uses its argument, rather than trying
4769 to rely on ARGSUSED (which doesn't work for gcc with warnings).
4770 const char -> char const.
4772 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
4773 Don't use tabs inside commands; it messes up 'ps'.
4774 Problem reported by twlevo.
4776 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
4778 * tests/glr-regression.at (Uninitialized location when reporting
4779 ambiguity): New test case.
4780 * data/glr.c (yyresolveLocations): New function, which uses
4782 (yyresolveValue): Invoke yyresolveLocations before reporting an
4784 * doc/bison.texinfo (Default Action for Locations): Note
4785 YYLLOC_DEFAULT's usage for ambiguity locations.
4786 (GLR Semantic Actions): Cross-reference those notes.
4788 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
4790 * tests/glr-regression.at (Leaked semantic values when reporting
4791 ambiguity): Remove unnecessary union and type declarations.
4792 (Leaked lookahead after nondeterministic parse syntax error): New test
4794 * data/glr.c (yyparse): Check for zero stacks remaining before
4795 attempting to shift the lookahead so that you don't lose it.
4797 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4799 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
4800 * tests/glr-regression.at (Leaked semantic values when reporting
4801 ambiguity): New test case.
4802 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
4803 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
4804 now unnecessary yystackp parameter.
4805 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
4806 destructors can be called.
4808 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
4809 in existing testcases.
4811 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4813 Don't leak semantic values for parent RHS when a user action cuts the
4814 parser, and clean up related code a bit.
4815 * tests/glr-regression.at (Leaked merged semantic value if user action
4816 cuts parse): Rename to...
4817 (Leaked semantic values if user action cuts parse): ... this. Add check
4818 for leaked parent RHS values.
4819 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
4820 between an unresolved state (non-empty chain of semantic options) and
4821 an incomplete one (signaled by an empty chain).
4822 (yyresolveStates): Document the interface. Move all manipulation of a
4823 successfully or unsuccessfully resolved yyGLRState to...
4824 (yyresolveValue): ... here so that yyresolveValue always leaves a
4825 yyGLRState with consistent data and thus is easier to understand.
4826 Remove the yyvalp and yylocp parameters since they are always just
4827 taken from the yys parameter. When reporting a discarded merged value
4828 in debugging output, note that it is incompletely merged. Document the
4830 (yyresolveAction): If resolving any of the RHS states fails, destroy
4831 them all rather than leaking them. Thus, as long as user actions are
4832 written to clean up the RHS correctly, yyresolveAction always cleans up
4833 the RHS of a semantic option. Document the interface.
4835 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
4837 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
4838 led to a segmentation fault in GNU Pascal. Problem reported
4841 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
4843 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
4844 mid-rule action inside a nonterminal symbol in order to declare a
4845 destructor for its semantic value.
4847 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
4849 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
4850 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
4851 __cplusplus && ! defined _STDLIB_H && !
4852 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
4853 defined free))]: Include <stdlib.h> rather than rolling our own
4854 declarations of malloc and free, to avoid problems with
4855 incompatible declarations (using 'throw') C++'s stdlib.h. This
4856 should fix Debian bug 340012
4857 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
4858 reported by Guillaume Melquiond.
4860 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4862 * NEWS: Clarify symbols versus types in unused-value warnings.
4864 * configure.ac (AC_INIT): Bump version number.
4866 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4868 * NEWS: Version 2.1a.
4869 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
4870 since C99 requires this.
4872 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
4874 * m4/c-working.m4: New file.
4875 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
4877 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
4879 * Makefile.maint: Merge from coreutils.
4881 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
4883 More portability fixes for problems summarized by Nelson H. F. Beebe.
4885 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
4886 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
4887 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
4888 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
4889 messes up because C++ code is compiled in 32-bit mode but linked
4892 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
4894 More portability fixes for problems summarized by Nelson H. F. Beebe.
4896 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
4897 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
4899 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
4900 nodist_PROGRAMS, since we don't need to actually compile the
4901 example if we're just doing a plain 'make'. This avoids bothering
4902 the installer unnecessarily about problems due to weird C++
4905 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
4907 More portability fixes for problems summarized by Nelson H. F. Beebe.
4909 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
4910 than #include "...", and compile with -I'.'. The old method was
4911 not portable, according to Posix and the C standard, and it does
4912 not work with Sun C 5.7, where previous #line directives affect
4913 the working directory used in later #include "..." directives.
4915 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4917 Various DJGGP specific issues in /djgpp
4919 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
4921 More portability fixes for problems summarized by Nelson H. F. Beebe.
4923 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
4924 '#include <map>' works and that you can apply ++ to iterators.
4926 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
4928 Work around portability problems summarized by Nelson H. F. Beebe in
4929 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
4931 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4932 that '#include <string>' works.
4934 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
4935 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
4936 "warning: sorry: semantics of inline function static data `const
4937 unsigned char translate_table[262]' are wrong (you'll wind up with
4940 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
4941 or, xor to not_, and_, or_, and xor_, respectively. This works
4942 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
4943 random system header somewhere that includes the equivalent of
4946 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
4947 -E" works; it apparently doesn't work with PathScale EKO Compiler
4950 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
4952 During deterministic GLR operation, user actions should be able to
4953 influence the parse by changing yychar. To make this easier to fix and
4954 to make glr.c easier to evolve in general, don't maintain yytoken in
4955 parallel with yychar; just compute yytoken when needed.
4956 * tests/glr-regression.at (Incorrect lookahead during deterministic
4957 GLR): Check that setting yychar in a user action has the intended
4959 * data/glr.c (yyGLRStack): Remove yytokenp member.
4960 (yyclearin): Don't set *yytokenp.
4961 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
4962 yychar rather than *yytokenp to determine the current lookahead.
4963 Compute yytoken locally when needed.
4964 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
4967 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
4968 after `--report' documentation.
4970 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
4972 * src/parse-gram.y (grammar_declaration): Location of printer
4973 symbol is @1, not list->location. Bug reported by twlevo.
4974 * tests/input.at (Incompatible Aliases): Adjust to above change.
4976 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
4978 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
4979 all the test at once. This makes the output easier to read in the
4982 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
4983 got from <http://bro-ids.org/download.html>. The bug is that
4984 when two actions appeared in succession, the second one was
4985 scanned before the first one was added to the grammar rule
4986 as a midrule action. Bison then output the incorrect warning
4987 "parse.y:905.17-906.36: warning: unused value: $3".
4988 * src/parse-gram.y (BRACED_CODE, action): These are no longer
4989 associated with a value.
4990 (rhs): Don't invoke grammar_current_rule_action_append.
4991 (action): Invoke it here instead.
4992 * src/reader.c (grammar_midrule_action): Now extern.
4993 (grammar_current_rule_action_append): Don't invoke
4994 grammar_midrule_action; that is now the scanner's job.
4995 * src/reader.h (last_string, last_braced_code_loc):
4996 (grammar_midrule_action): New decls.
4997 * src/scan-gram.l (last_string): Now extern, sigh.
4998 (last_braced_code_loc): New extern variable.
4999 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
5000 rule already has an action.
5001 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
5002 * tests/input.at (AT_CHECK_UNUSED_VALUES):
5003 Add some tests to check that the above changes fixed the bug.
5005 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
5007 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
5008 All used changed. Check whether the symbol has a destructor,
5009 not whether it is typed.
5010 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
5011 that the values are still reported as unused. All line numbers
5014 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
5016 Work around a bug in bro 0.8, which underparenthesizes its
5017 definition of YYLLOC_DEFAULT.
5018 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
5020 * data/lalr1.cc: Likewise.
5021 * data/yacc.cc: Likewise.
5023 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
5025 Work around a bug in Pike 7.0, and give the Pike folks a
5026 better way to override the usual int widths.
5027 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
5028 user can override the types.
5029 (short): #undef, to work around a bug in Pike 7.0.
5030 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
5031 (union yyalloc.yyss): Use yytype_int16 rather than short.
5033 (yysigned_char): Remove.
5034 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
5035 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
5036 * tests/regression.at (Web2c Actions): Adjust to above changes.
5038 * src/reader.c (check_and_convert_grammar): New function.
5039 (reader): Close the input file even if something went wrong during
5040 parsing. Minor file descriptor leak reported by twlevo.
5042 * src/assoc.c (assoc_to_string): Use a default: abort (); case
5043 to pacify gcc -Wswitch-default.
5044 * src/scan-gram.l (adjust_location): Use a default: break; case
5045 to pacify gcc -Wswitch-default.
5046 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
5047 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5048 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5049 Move these decls to scan-skel.l, since they don't need to be
5051 * src/scan-skel.l: Accept the above decls.
5052 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
5055 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
5057 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
5058 since we don't want to insist on a version number at the start
5059 of the changelog every time.
5060 * Makefile.maint: Sync from coreutils a bit better.
5061 (sc_trailing_blank): Renamed from sc_trailing_space.
5063 (sc_no_if_have_config_h, sc_require_config_h):
5064 (sc_prohibit_assert_without_use): New rules.
5065 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
5066 (sc_dd_max_sym_length): Fix leading spaces in rule.
5067 (sc_system_h_headers): Prefix with @.
5068 (sc_useless_cpp_parens, m4-check): Output line numbers.
5069 (changelog-check): Allow version only in head.
5070 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
5071 satisfy new Makefile.maint rule.
5072 * data/glr.c: Likewise.
5073 * data/glr.cc: Likewise.
5074 * data/lalr1.cc: Likewise.
5075 * data/yacc.c: Likewise.
5076 * lib/ebitsetv.c: Likewise.
5077 * lib/lbitset.c: Likewise.
5078 * lib/subpipe.c: Likewise.
5079 * lib/timevar.c: Likewise.
5080 * src/system.h: Likewise.
5081 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
5082 * djgpp/Makefile.maint: Add copyright notice.
5083 * djgpp/README.in: Likewise.
5084 * djgpp/config.bat: Likewise.
5085 * djgpp/config.site: Likewise.
5086 * djgpp/config_h.sed: Likewise.
5087 * djgpp/djunpack.bat: Likewise.
5088 * djgpp/config.sed: Fix copyright notice to match standard format.
5089 * djgpp/subpipe.h: Likewise.
5090 * lib/bitsetv-print.c: Likewise.
5091 * lib/bitsetv.c: Likewise.
5092 * lib/subpipe.h: Likewise.
5093 * lib/timevar.c: Likewise.
5094 * lib/timevar.h: Likewise.
5095 * djgpp/subpipe.c: Use standard recipe for config.h.
5096 * lib/abitset.c: Likewise.
5097 * lib/bitset.c: Likewise.
5098 * lib/bitset_stats.c: Likewise.
5099 * lib/bitsetv-print.c: Likewise.
5100 * lib/bitsetv.c: Likewise.
5101 * lib/ebitsetv.c: Likewise.
5102 * lib/get-errno.c: Likewise.
5103 * lib/lbitset.c: Likewise.
5104 * lib/subpipe.c: Likewise.
5105 * lib/timevar.c: Likewise.
5106 * lib/vbitset.c: Likewise.
5107 * tests/local.at: Likewise.
5108 * src/scan-gram.l: Don't include verify.h, since system.h does
5110 * .x-sc_require_config_h: New file.
5111 * .x-sc_unmarked_diagnostics: New file.
5113 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
5115 Be a bit more systematic about using 'abort'.
5116 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
5117 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
5118 Put 'default: abort ();' before some other case, to satisfy older
5120 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5121 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
5122 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
5123 * src/conflicts.c (resolve_sr_conflict): Likewise.
5124 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
5125 (get_decision_str, get_orientation_str, get_node_alignment_str):
5126 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
5127 (get_linestyle_str, get_arrowstyle_str): Likewise.
5128 * src/conflicts.c (resolve_sr_conflict):
5129 Use a default case rather than one for the one remaining enum
5130 value, to catch invalid enum values as well.
5131 * src/lalr.c (set_goto_map, map_goto):
5132 Prefer "assert (FOO);" to "if (!FOO) abort ();".
5133 * src/nullable.c (nullable_compute, token_definitions_output):
5135 * src/reader.c (packgram, reader): Likewise.
5136 * src/state.c (transitions_to, state_new, state_reduction_find):
5138 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
5139 (symbol_pack): Likewise.
5140 * src/tables.c (conflict_row, pack_vector): Likewise.
5141 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
5142 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
5143 * src/system.h: Don't include <assert.h>.
5144 (assert): New macro.
5146 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
5147 (Destructor Decl, Parser Function, Pure Calling):
5148 Describe rules for braces inside C code more carefully.
5150 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
5152 Fix some porting glitches found by Nelson H. F. Beebe.
5153 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
5154 compilers that don't understand that abort () does not return.
5155 * src/state.c (transitions_to): Likewise.
5156 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
5157 that '#include <cstdlib>' works.
5158 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
5159 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
5160 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
5161 for the benefit of some pre-C99 compilers.
5163 * bootstrap: Undo changes to gnulib files that autoreconf made.
5165 Minor fixups to get 'make maintainer-check' to work.
5166 * configure.ac: Don't use -Wnested-externs, as it's incompatible
5167 with the new verify.h implementation.
5168 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
5169 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
5170 * data/yacc.c (YYUSE): Likewise.
5171 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
5172 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
5173 * src/parse-gram.y (declaration): Don't pass a string constant
5174 to a function that expects char *, since GCC might complain
5175 about the constant value.
5176 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
5177 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
5178 before #defining them.
5179 * tests/glr-regression.at
5180 (Incorrectly initialized location for empty right-hand side in GLR):
5181 In yyerror, use the msg arg.
5182 (Corrupted semantic options if user action cuts parse):
5183 (Incorrect lookahead during deterministic GLR):
5184 (Incorrect lookahead during nondeterministic GLR):
5185 Don't name a local var 'index'; it shadows string.h's 'index'.
5187 2006-01-19 Akim Demaille <akim@epita.fr>
5189 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
5190 location, not just parts of it.
5192 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
5194 * NEWS: Document the fact that multiple %unions are now allowed.
5195 * doc/bison.texinfo (Union Decl): Likewise.
5196 * TODO: This feature is now implemented, so remove it from
5199 * Makefile.maint: Merge with coreutils Makefile.maint.
5200 (CVS_LIST): Use build-aux version if available.
5201 (VERSION_REGEXP): New macro.
5202 (syntax-check-rules): Add sc_no_if_have_config_h,
5203 sc_prohibit_assert_without_use, sc_require_config_h,
5204 sc_useless_cpp_parens.
5205 (sc_obsolete_symbols): Check for O_NDELAY.
5206 (sc_dd_max_sym_length): Track coreutils.
5207 (sc_unmarked_diagnostics): Look in all files, not just *.c.
5208 (sc_useless_cpp_parens): New rule.
5209 (news-date-check): Look for version or today's date.
5210 (changelog-check): Don't require version number near head.
5211 (copyright-check): Use current year instead of hardwiring 2005.
5212 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
5213 (announcement): Add --gpg-key-ID.
5215 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
5218 Avoid undefined behavior that addressed just before the start of an
5219 array. Problem reported by twlevo.
5220 * src/reader.c (packgram): Prepend a new sentinel before ritem.
5221 * src/lalr.c (build_relations): Rely on new sentinel.
5222 * src/gram.c (gram_free): Adjust to new sentinel.
5224 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
5226 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
5227 yylookaheadNeeds. All uses updated.
5228 (yysplitStack): Rename local yynewLookaheadStatuses to
5229 yynewLookaheadNeeds.
5230 * data/glr-regression.at (Incorrect lookahead during nondeterministic
5231 GLR): In comments, change `lookahead status' to `lookahead need'.
5233 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5235 * data/glr.c (yysplitStack): A little stylistic rewrite.
5237 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5239 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
5241 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
5243 * doc/bison.texinfo: Fix some typos.
5244 (GLR Semantic Actions): New subsection discussing special
5245 considerations because GLR semantic actions might be deferred.
5246 (Actions): Mention look-ahead usage of yylval.
5247 (Actions and Locations): Mention look-ahead usage of yylloc.
5248 (Special Features for Use in Actions): Add YYEOF entry and mention it
5249 in the yychar entry.
5250 In the yychar entry, remove mention of the local yychar case (pure
5251 parser) since this is irrelevant information when writing semantic
5252 actions and since it's already discussed in `Table of Symbols' where
5253 yychar is otherwise described as an external variable.
5254 In the yychar entry, don't call it the `current' look-ahead since it
5255 isn't when semantic actions are deferred.
5256 In the yychar and yyclearin entries, add note about deferred semantic
5258 Add yylloc and yylval entries discussing look-ahead usage.
5259 (Look-Ahead Tokens): When discussing yychar, don't call it the
5260 `current' look-ahead, and do mention yylval and yylloc.
5261 (Error Recovery): Cross-reference `Action Features' when mentioning
5263 (Table of Symbols): In the yychar entry, don't call it the `current'
5265 In the yylloc and yylval entries, mention look-ahead usage.
5267 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5269 * tests/glr-regression.at: Update copyright year to 2006.
5271 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5273 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
5274 use during nondeterministic operation to track which stacks have
5275 actually needed the current lookahead.
5276 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
5277 Allocate, deallocate, resize, and otherwise shuffle space for
5278 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
5279 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
5280 appropriately during nondeterministic operation.
5281 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
5282 members to store the current lookahead to be used by the deferred
5284 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
5285 from which the RHS is taken. Set the lookahead members of the new
5286 yySemanticOption according to the lookahead status for stack yyk.
5287 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
5288 yyaddDeferredAction.
5289 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
5290 members of yySemanticOption before invoking yyuserAction, and then set
5291 them back to their current values afterward.
5292 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
5293 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
5294 * tests/glr-regression.at: Remove `.' from the ends of recent test case
5295 titles for consistency.
5296 (Leaked merged semantic value if user action cuts parse): In order to
5297 suppress lint warnings, use arguments in merge function, and assign
5298 char value < 128 in main.
5299 (Incorrect lookahead during deterministic GLR): New test case.
5300 (Incorrect lookahead during nondeterministic GLR): New test case.
5302 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5304 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
5305 !yyvaluep as signal that no semantic value is available to print.
5306 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
5307 to print a semantic value.
5309 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5311 * tests/glr-regression.at: For consistency with my newer test cases,
5314 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5316 * data/glr.c (yyresolveValue): When merging semantic options, if at
5317 least one user action succeeds but a later one cuts the parse, then
5318 destroy the semantic value before returning rather than leaking it.
5319 (yyresolveStates): If a user action cuts the parse and thus
5320 yyresolveValue fails, ignore the (unset) semantic value rather than
5321 corrupting the yyGLRState, and empty the semantic options list since
5322 the user actions should have called all necessary destructors.
5323 Simplify code with YYCHK.
5324 * tests/glr-regression.at (Corrupted semantic options if user action
5325 cuts parse): New test case.
5326 (Undesirable destructors if user action cuts parse): New test case.
5327 Before applying any of this patch, this test case never actually failed
5328 for me... but only because the corrupted semantic options usually
5330 (Leaked merged semantic value if user action cuts parse): New test
5333 2006-01-05 Akim Demaille <akim@epita.fr>
5335 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
5337 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
5339 * data/c.m4 (b4_c_modern): New macro, with a new provision for
5340 _MSC_VER. Problem reported by Cenzato Marco.
5341 (b4_c_function_def): Use it.
5342 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
5344 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
5345 than rolling our own.
5347 2006-01-04 Akim Demaille <akim@epita.fr>
5349 Also warn about non-used mid-rule values.
5350 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
5352 (symbol_list_new): Adjust.
5353 * src/reader.c (symbol_typed_p): New.
5354 (grammar_rule_check): Use it.
5355 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
5357 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
5359 * tests/actions.at (Exotic Dollars): Adjust.
5361 2006-01-04 Akim Demaille <akim@epita.fr>
5363 * src/reader.c (grammar_midrule_action): If $$ is set in a
5364 mid-rule, move the `used' bit to its lhs.
5365 * tests/input.at (Unused values): New.
5366 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
5368 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
5370 * doc/bison.texinfo (Bison Options): Say more accurately what
5372 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
5373 about declarations in the grammar when in Yacc mode, as POSIX does
5374 not require a diagnostic when the grammar uses extensions.
5376 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
5378 Warn about dubious constructions like "%token T T".
5380 * src/symtab.h (struct symbol.declared): New member.
5381 * src/symtab.c (symbol_new): Initialize it to false.
5382 (symbol_class_set): New arg DECLARING, specifying whether
5383 this is a declaration that we want to warn about, if there
5384 is more than one of them. All uses changed.
5386 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
5387 Allow multiple %union directives, whose contents concatenate.
5388 * src/parse-gram.y (grammar_declaration): Likewise.
5389 Use muscle_code_grow, so that we don't need stype_line any more.
5392 * src/muscle_tab.c (muscle_grow): Fix comment.
5394 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
5395 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
5396 Update copyright year to 2006.
5398 2006-01-03 Akim Demaille <akim@epita.fr>
5400 Have glr.cc pass (some of) the calc.at tests.
5401 * data/glr.cc (b4_parse_param_orig): New.
5402 (b4_parse_param): Improve its definition, and bound it more
5403 clearly in the skeleton.
5404 (b4_epilogue): Append, instead of prepending, in order to keep
5406 Simplify the generation of auxiliary functions: locations and
5407 purity are mandated.
5408 (b4_global_tokens_and_yystype): Honor it.
5409 * data/location.cc (c++.m4): Don't include it.
5410 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
5412 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
5414 Be sure to initialize the first position's filename.
5415 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
5417 (AT_CHECK_CALC_GLR_CC): New.
5418 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
5420 2006-01-02 Akim Demaille <akim@epita.fr>
5422 * src/output.c (output_skeleton): Don't hard wire the inclusion of
5424 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
5425 * data/glr.cc: Do not include stack.hh.
5427 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5429 * data/glr.c: Reformat whitespace with tabs.
5430 (b4_lpure_formals): Remove this unused m4 macro.
5431 * tests/cxx-type.at: Reformat whitespace with tabs.
5432 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
5433 since it's a member. Rename type to isNterm for clarity.
5435 2005-12-29 Akim <akim@sulaco.local>
5437 Let glr.cc catch up with symbol_value_print.
5438 * data/glr.cc (b4_yysymprint_generate): Replace by...
5439 (b4_yy_symbol_print_generate): this.
5440 (yy_symbol_print, yy_symbol_value_print): Declare them.
5442 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
5444 * src/location.h (boundary): Note that a line or column equal
5445 to INT_MAX indicates an overflow.
5446 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
5447 (rule_length_overflow, increment_rule_length, add_column_width):
5449 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
5450 (<SC_BRACED_CODE>"}"):
5451 Use increment_rule_length rather than incrementing it by hand.
5452 (adjust_location, handle_syncline): Diagnose overflow.
5453 (handle_action_dollar, handle_action_at):
5454 Fix bug with monstrosities like $-2147483648.
5455 Remove now-unnecessary checks.
5456 (scan_integer): Verify assumptions and remove now-unnecessary checks.
5457 (convert_ucn_to_byte): Verify assumptions.
5458 (handle_syncline): New arg LOC. All callers changed.
5459 Don't store through a value derived from char const * pointer.
5461 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
5464 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
5466 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
5467 Remove unnecessary forward static decls.
5469 2005-12-27 Akim Demaille <akim@epita.fr>
5471 * src/reader.c (grammar_current_rule_check): Also check that $$
5473 Take the rule to check as argument, hence rename as...
5474 (grammar_rule_check): this.
5475 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
5477 (grammar_rule_begin, grammar_rule_end): these, for consistency.
5478 (grammar_midrule_action, grammar_symbol_append): Now static.
5479 * tests/torture.at (input): Don't rely on the default action
5480 being always performed.
5481 * tests/calc.at: "Set" $$ even when the action is "cut" with
5483 * tests/actions.at (Exotic Dollars): Instead of using unused
5484 values, check that the warning is issued.
5486 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
5488 * NEWS: Improve wording for unused-value warnings.
5490 2005-12-22 Akim Demaille <akim@epita.fr>
5492 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
5493 (b4_yysymprint_generate): Rename as...
5494 (b4_yy_symbol_print_generate): this.
5495 Generate yy_symbol_print instead of yysymprint.
5496 Generate also yy_symbol_value_print, and use it.
5498 2005-12-22 Akim Demaille <akim@epita.fr>
5500 * NEWS: Warn about unused values.
5501 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
5503 (symbol_list_n_get, symbol_list_n_used_set): New.
5504 (symbol_list_n_type_name_get): Use symbol_list_n_get.
5505 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
5506 * src/reader.c (grammar_current_rule_check): Check that values are
5508 * src/symtab.c (symbol_print): Accept 0.
5509 * tests/existing.at: Remove the type information.
5511 Remove useless actions (beware of mid-rule actions: perl -000
5512 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
5513 * tests/actions.at (Exotic Dollars): Use unused values.
5514 * tests/calc.at: Likewise.
5515 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5518 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
5521 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
5523 Undo 2005-12-01 tentative license wording change. The wording is
5524 still being reviewed by the lawyers, and we don't want to wait for
5525 them before publishing a test release. For now, revert to the
5527 * NEWS: Undo 2005-12-01 change.
5528 * data/glr.c: Revert to previous license wording.
5529 * data/glr.cc: Likewise.
5530 * data/lalr1.cc: Likewise.
5531 * data/location.cc: Likewise.
5532 * data/yacc.c: Likewise.
5534 * NEWS: Reword %destructor vs YYABORT etc.
5535 * data/glr.c: Use American spacing, for consistency.
5536 * data/glr.cc: Likewise.
5537 * data/lalr1.cc: Likewise.
5538 * data/yacc.c: Likewise.
5539 * data/yacc.c: Reformat comments slightly.
5540 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
5541 for consistency. Fix some spelling errors and reword recently-included
5543 * tests/cxx-type.at: Cast results of malloc, for C++.
5545 2005-12-21 Joel E. Denny <address@hidden>
5547 * tests/cxx-type.at: Construct a tree, count the parents of shared
5548 nodes, and free each node once and only once. Previously, the memory
5549 for semantic values was leaked instead.
5551 2005-12-21 Joel E. Denny <address@hidden>
5553 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
5554 (yylval, yylloc): If pure, #define to yystackp->yyval and
5555 yystackp->yyloc similar to yychar and yynerrs.
5556 (yyparse): If pure, remove local yylval and yylloc. Add local
5557 yystackp to accommodate pure definitions of yylval and yylloc.
5558 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
5559 yylvalp and yyllocp to &yylval and &yylloc.
5560 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
5561 namespace. Previously, nerrs and char were missing, but lval and lloc
5563 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
5564 yylvalp and yyllocp parameters since, if pure, these are now always
5565 accessible through yystackp. If not pure, they are still accessible
5567 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
5568 `if (YYID (N))' to pacify lint.
5570 2005-12-21 Akim Demaille <akim@epita.fr>
5572 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
5573 destroy the RHS symbols of a rule.
5574 * data/yacc.c (yylen): Initialize to 0.
5575 Keep its value to the number of items to possibly shift.
5576 In particular, a regular successful parse that ends on YYFINAL by
5577 a (internal) YYACCEPT must not have yylen != 0.
5578 (yyerrorlab, yyreturn): Pop the RHS.
5579 Reorder a bit to emphasize the `shifting' bits of code.
5580 (YYPOPSTACK): Now accept a number of items to pop.
5581 * data/lalr1.cc: Likewise.
5582 * data/glr.c: Formatting changes.
5583 Use goto instead of fall through.
5584 * doc/bison.texinfo (Destructor Decl): Complete.
5586 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5588 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5589 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
5590 * djgpp/config.bat: Replace every occurence of the file name
5591 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5592 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5593 * djgpp/config.sed: Replace every occurence of the file name
5594 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5595 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5596 * djgpp/djunpack.bat: DJGPP specific file.
5597 * djgpp/fnchange.lst: DJGPP specific file.
5598 * djgpp/README.in: Add new information about how to unpack the bison
5599 source on MSDOS and other systems which have 8.3 file name restrictions
5600 using djunpack.bat and fnchange.lst.
5602 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
5604 * bootstrap (build_cvs_prefix): Remove; unused.
5605 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
5606 when getting gnulib.
5608 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
5610 * data/glr.c: Reorder typedef declarations for structs to match order
5611 of struct declarations.
5612 Rename yystack everywhere to yystackp except in yyparse where it's not
5614 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
5616 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
5617 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
5618 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
5621 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
5623 * tests/sets.at (Accept): Fix typos in regular expression used to
5624 sed out the final state number.
5626 Work around portability problem on Solaris 10: flex-generated
5627 files include <stdio.h> before <config.h>, which messes up
5628 because the latter defines __EXTENSIONS__. Address the problem
5629 by creating two new little files that include <config.h> first,
5630 then include the flex-generated files. Rewrite everyone else
5631 to include <config.h> first, as well.
5632 * lib/timevar.c: Always include "config.h".
5633 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
5634 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
5635 (EXTRA_bison_SOURCES): New macro.
5636 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
5637 * src/system.h: Don't include config.h.
5638 * src/LR0.c: Include <config.h> first.
5639 * src/assoc.c: Likewise.
5640 * src/closure.c: Likewise.
5641 * src/complain.c: Likewise.
5642 * src/conflicts.c: Likewise.
5643 * src/derives.c: Likewise.
5644 * src/files.c: Likewise.
5645 * src/getargs.c: Likewise.
5646 * src/gram.c: Likewise.
5647 * src/lalr.c: Likewise.
5648 * src/location.c: Likewise.
5649 * src/main.c: Likewise.
5650 * src/muscle_tab.c: Likewise.
5651 * src/nullable.c: Likewise.
5652 * src/output.c: Likewise.
5653 * src/parse-gram.y: Likewise.
5654 * src/print.c: Likewise.
5655 * src/print_graph.c: Likewise.
5656 * src/reader.c: Likewise.
5657 * src/reduce.c: Likewise.
5658 * src/relation.c: Likewise.
5659 * src/state.c: Likewise.
5660 * src/symlist.c: Likewise.
5661 * src/symtab.c: Likewise.
5662 * src/tables.c: Likewise.
5663 * src/uniqstr.c: Likewise.
5664 * src/vcg.c: Likewise.
5666 * src/parse-gram.y: Fix minor problems uncovered by lint.
5667 (current_lhs, current_lhs_location): Now static.
5668 (current_assoc): Remove unused variable.
5670 Cleanups so that Bison-generated parsers have less lint.
5671 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
5672 Prepend /*ARGSUSED*/, for lint's sake.
5673 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
5674 definition if 'lint' is defined.
5675 (YYID): New macro (or function, if lint).
5676 All uses of /*CONSTCOND*/0 replaced by YYID(0).
5677 * data/yacc.c: Likewise.
5678 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
5679 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
5680 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
5682 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
5683 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
5684 Use YYID(0) rather than 0, for lint.
5685 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
5686 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
5688 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
5690 * tests/glr-regression.at
5691 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5692 Close memory leak reported by twlevo.
5694 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
5696 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
5698 (yyparse): Iterate another stack in order to call user destructors.
5699 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5701 (Duplicated user destructor for lookahead): This test now is expected
5704 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
5706 * NEWS: Document the following change.
5707 * data/yacc.c: Say "parser skeleton" rather than "file", since
5708 it's no longer just a file.
5709 * data/glr.c: Grant a special exception for C GLR parsers, that
5710 reads like the already-existing exception for C LALR(1) parsers.
5711 * data/glr.cc: Likewise.
5712 * data/lalr1.cc: Likewise.
5713 * data/location.cc: Likewise.
5714 * data/yacc.c: Reword the "written by" statement to clarify that
5715 it was the parser skeleton, not the entire output file.
5716 * data/glr.c: Written by Paul Hilfinger.
5717 * data/glr.cc: Written by Akim Demaille.
5718 * data/lalr1.cc: Likewise.
5720 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
5722 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
5723 Fix typos in previous change that broke 'make check'.
5724 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
5726 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
5727 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
5728 We can revert this once things settle down.
5730 * src/conflicts.c (conflicts_print): Don't print file name twice
5731 when %expect fails because there were no conflicts.
5732 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
5734 * tests/conflicts.at (%expect not enough, %expect too much):
5735 (%expect with reduce conflicts): Adjust to new behavior.
5737 2005-11-18 Akim Demaille <akim@epita.fr>
5739 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
5741 * NEWS: Document this.
5742 * doc/bison.texinfo (Expect Decl): Likewise.
5744 2005-11-16 Akim Demaille <akim@epita.fr>
5746 Generalize the display of semantic values and locations in traces.
5747 * data/glr.c (yy_reduce_print): Fix indices (again).
5748 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
5750 * data/lalr1.cc (yyreduce_print): Rename as...
5751 (yy_reduce_print): this.
5752 Display values and locations.
5753 * data/yacc.c (yy_reduce_print): Likewise.
5754 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
5755 (yysymprint): Move higher to be visible from yy_reduce_print).
5757 * tests/calc.at: Adjust the expected length of the traces.
5759 2005-11-14 Akim Demaille <akim@epita.fr>
5761 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
5762 from 1 to N, while values and location start at 0.
5763 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
5765 2005-11-14 Akim Demaille <akim@epita.fr>
5767 * data/glr.c (yy_reduce_print): Fix the $ number.
5769 2005-11-14 Akim Demaille <akim@epita.fr>
5771 "Use" parse parameters.
5772 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
5773 * data/glr.c, data/glr.cc: Use them.
5774 * data/glr.c (YYUSE): Have a C++ definition that supports
5777 2005-11-14 Akim Demaille <akim@epita.fr>
5779 * data/glr.c (yyexpandGLRStack): Declare only if defined.
5781 2005-11-14 Akim Demaille <akim@epita.fr>
5784 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5786 2005-11-12 Akim Demaille <akim@epita.fr>
5788 Let position and location be PODs.
5789 * data/location.cc (position::initialize, location::initialize): New.
5790 (position::position, location::location): Define only if
5791 b4_location_constructors is defined.
5792 * data/lalr1.cc (b4_location_constructors): Define it for backward
5794 * doc/bison.texinfo (Initial Action Decl): Use initialize.
5796 2005-11-12 Akim Demaille <akim@epita.fr>
5798 * data/lalr1.cc: Move the body of the ctor and dtor into the
5799 parser file (instead of the header).
5800 Wrap the implementations in a "namespace yy".
5802 2005-11-12 Akim Demaille <akim@epita.fr>
5804 Have glr.c include its header file when created.
5805 * data/glr.c (b4_shared_declarations): New.
5806 Output them verbatim in the parser if !%defines, otherwise
5807 output then in the header file, and include it instead.
5809 2005-11-11 Akim Demaille <akim@epita.fr>
5811 * data/glr.c: Comment changes.
5813 2005-11-11 Akim Demaille <akim@epita.fr>
5815 When yydebug, report semantic and location values for reductions.
5816 * data/glr.c (yy_reduce_print): Report the semantic values and the
5818 (YY_REDUCE_PRINT): Adjust.
5819 (yyglrReduce): Use them.
5820 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
5821 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
5822 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
5825 2005-11-10 Akim Demaille <akim@epita.fr>
5827 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
5828 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
5829 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
5831 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
5833 * m4/cxx.m4, examples/Makefile.am: Don't build
5834 examples/calc++ if no C++ compiler is available. (trivial change)
5836 2005-11-09 Akim Demaille <akim@epita.fr>
5838 * src/scan-skel.l: Use a couple of asserts.
5840 2005-11-03 Akim Demaille <akim@epita.fr>
5842 In some (weird) cases, the final state number is incorrect.
5843 Reported by Alexandre Duret-Lutz.
5844 * src/LR0.c (state_list_append): Remove the computation of
5846 (save_reductions): Do it here.
5847 (get_state): Alpha conversion.
5848 (generate_states): Use a for loop.
5849 * src/gram.h (item_number_is_rule_number)
5850 (item_number_is_symbol_number): New.
5851 * src/state.c: Use assert.
5852 * src/system.h: Include assert.h.
5853 * tests/sets.at (Accept): New.
5855 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5857 * data/glr.c (yyfill): Adjust comment.
5858 (yyresolveAction): Initialize default location properly
5859 for empty right-hand sides.
5860 (yydoAction): Ditto.
5861 Add comment explaining apparently dead code.
5862 * tests/glr-regression.at
5863 (Incorrectly initialized location for empty right-hand side in GLR):
5866 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
5868 * bootstrap (cleanup_gnulib): New function. Use it to clean up
5869 gnulib when interrupted. This fixes some race conditions and
5870 works around some portability problems (one noted by Paul
5873 2005-10-22 Akim <akim@epita.fr>
5875 * Makefile.cfg: Adjust to config -> build-aux.
5878 2005-10-21 Akim Demaille <akim@epita.fr>
5880 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
5882 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
5883 * data/yacc.c (b4_Pure_if): Rename as...
5884 (b4_yacc_pure_if): this.
5885 (YY_SYMBOL_PRINT, yyparse): Adjust.
5886 * doc/bison.texinfo: Formatting changes.
5888 2005-10-21 Akim Demaille <akim@epita.fr>
5890 Finish the transition config -> build-aux.
5891 * configure.ac, Makefile.am: Use build-aux.
5892 * config/prev-version, config/announce-gen, config/Makefile.am:
5894 * build-aux/prev-version, build-aux/announce-gen,
5895 * build-aux/Makefile.am: here.
5897 2005-10-14 Akim Demaille <akim@epita.fr>
5899 * examples/calc++/test: Use set -x only when VERBOSE.
5901 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
5903 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
5904 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
5906 2005-10-13 Akim Demaille <akim@epita.fr>
5908 * src/scan-skel.l: Output the base name parts of the parser and
5910 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
5912 Use this to exercise C++ outputs in subdirs.
5913 Reported by Oleg Smolsky.
5915 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
5917 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
5918 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
5919 Problem reported by John P. Hartmann.
5920 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
5923 2005-10-12 Akim Demaille <akim@epita.fr>
5925 * src/parse-gram.y (version_check): Exit 63 to please missing
5926 (stands for "version mismatch).
5927 * tests/input.at, doc/bison.texinfo: Adjust.
5929 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
5931 Work around portability problems with Visual Age C compiler
5932 (xlc and xlC_r) reported by John P. Hartmann.
5933 * data/location.cc (initial_column, initial_line): Remove.
5934 All uses replaced by 0 and 1.
5935 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
5936 that xlc complains about.
5937 * src/scan-skel.l (skel_wrap): Likewise.
5938 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
5940 * data/yacc.c (YYMODERN_C): New macro, which also looks at
5941 __STDC_VERSION__. Use it everywhere instead of looking at
5942 __STDC__ and __cplusplus.
5944 2005-10-10 Akim Demaille <akim@epita.fr>
5946 * examples/calc++/test: Be quiet unless VERBOSE.
5948 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
5950 * data/c.m4 (yydestruct, yysymprint):
5951 Use YYUSE instead of casting to void.
5952 * data/glr.c (YYUSE): New macro.
5953 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5954 Use it instead of rolling our own.
5955 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5957 Use /*CONSTCOND*/ to suppress lint warnings.
5958 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5959 (YY_STACK_PRINT): Use 'false' not '0'.
5961 (yysymprint_, yydestruct_): Use it instead of rolling our own.
5962 * data/yacc.c (YYUSE): New macro.
5963 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
5964 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
5965 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
5968 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
5969 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
5971 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
5973 Undo the parts of the unlocked-I/O change that substituted
5974 putc or puts for printf. This might hurt performance a bit,
5975 but some people prefer the printf style.
5976 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
5977 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
5978 All uses replaced by YYFPRINTF and YYDPRINTF.
5979 * data/yacc.c: Likewise.
5980 * lib/bitset.c (bitset_print): Likewise.
5981 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
5983 * lib/lbitset.c (debug_lbitset): Likewise.
5984 * src/closure.c (print_firsts, print_fderives): Likewise.
5985 * src/gram.c (grammar_dump): Likewise.
5986 * src/lalr.c (look_ahead_tokens_print): Likewise.
5987 * src/output.c (escaped_output): Likewise.
5988 (user_actions_output): Break apart two printfs.
5989 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
5990 * src/reduce.c (reduce_print): Likewise.
5991 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
5992 * src/system.h: Include unlocked-io.h rathe than stdio.h.
5994 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5995 Use assignments rather than casts-to-void to suppress
5996 unused-variable warnings. This pacifies 'lint'.
5997 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
5998 unused-variable warnings.
6000 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6002 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
6004 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
6006 Use unlocked I/O for a minor performance improvement on hosts like
6007 GNU/Linux and Solaris that support unlocked I/O. The basic idea
6008 is to use the gnlib unlocked-io module, and to prefer putc and
6009 puts to printf when either will work (since the latter doesn't
6010 come in an unlocked flavor).
6011 * bootstrap (gnulib_modules): Add unlocked-io.
6012 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
6013 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
6014 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
6015 and similarly for puts and putc and printf.
6016 * data/yacc.c: Likewise.
6017 * lib/bitset.c (bitset_print): Likewise.
6018 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
6019 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
6021 * lib/lbitset.c (debug_lbitset): Likewise.
6022 * src/closure.c (print_firsts, print_fderives): Likewise.
6023 * src/gram.c (grammar_dump): Likewise.
6024 * src/lalr.c (look_ahead_tokens_print): Likewise.
6025 * src/output.c (escaped_output): Likewise.
6026 (user_actions_output): Coalesce two printfs.
6027 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
6028 * src/reduce.c (reduce_print): Likewise.
6029 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
6030 * src/system.h: Include unlocked-io.h rather than stdio.h.
6032 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
6033 this confuses xgettext.
6035 2005-10-02 Akim Demaille <akim@epita.fr>
6037 * bootstrap (gnulib_modules): Add strverscmp.
6038 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
6039 * m4/.cvsignore: Add strverscmp.m4.
6040 * src/parse-gram.y (%require): New token, new rule.
6041 (version_check): New.
6042 * src/scan-gram.l (%require): Adjust.
6043 * tests/input.at (AT_REQUIRE): New.
6045 * doc/bison.texinfo (Require Decl): New.
6046 (Calc++ Parser): Use %require.
6048 2005-10-02 Akim Demaille <akim@epita.fr>
6050 * data/location.cc: New.
6052 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
6053 Akim Demaille <akim@epita.fr>
6055 Make sure -odir/foo.cc creates dir/location.hh etc.
6056 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
6057 (spec_file_prefix, spec_verbose_file, spec_graph_file)
6058 (spec_defines_file): Now const.
6060 (short_base_name): Remove.
6061 * src/files.c: Adjust.
6062 (dirname.h): Include.
6063 (base_name): Don't prototype it.
6064 (finput): Remove, duplicates gram_in.
6065 (full_base_name, short_base_name): Replace by...
6066 (all_but_ext, all_but_tab_ext): these.
6067 (compute_base_names): Rename as...
6068 (compute_file_name_parts): this.
6069 Update to compute the new variables, including dir_prefix.
6070 Adjust dependencies.
6071 * src/output.c (prepare): Output them.
6072 * src/reader.c: Adjust to use gram_in, not finput.
6073 * src/scan-skel.l (@dir_prefix@): New.
6075 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6077 * lib/subpipe.c: New function end_of_output_subpipe() added
6078 to allow support for non-posix systems. This is a no-op function
6081 * lib/subpipe.h: New function end_of_output_subpipe() added
6082 to allow support for non-posix systems. This is a no-op function
6085 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
6086 handle the lack of pipe/fork functionality on non-posix systems.
6088 * djgpp/Makefile.maint: DJGPP specific file.
6090 * djgpp/README.in: DJGPP specific file.
6092 * djgpp/config.bat: DJGPP specific configuration file.
6094 * djgpp/config.sed: DJGPP specific configuration file.
6096 * djgpp/config.site: DJGPP specific configuration file.
6098 * djgpp/config_h.sed: DJGPP specific configuration file.
6100 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
6102 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
6104 2005-10-02 Akim Demaille <akim@epita.fr>
6106 * data/location.cc: New, extract from...
6107 * data/lalr1.cc: here.
6108 (location.hh): Include it after the user prologue, in case the
6109 filename type is defined by the user.
6110 Forward declation location and position before the pre-prologue.
6111 (yyresult_): Rename as...
6112 (yyresult): this, it's a local variable, not an attribute.
6113 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
6115 2005-10-01 Akim Demaille <akim@epita.fr>
6117 * examples/extexi: Restore the #line generation.
6119 2005-09-30 Akim Demaille <akim@epita.fr>,
6120 Alexandre Duret-Lutz <adl@gnu.org>
6122 Move the token type and YYSTYPE in the parser class.
6123 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
6124 (parser::token): New, from the moved free definition of tokens.
6125 (parser::semantic_value): Now a full definition instead of an
6126 indirection to YYSTYPE.
6127 (b4_post_prologue): No longer included in the header file, but
6128 in the implementation file.
6129 * doc/bison.texi (C+ Language Interface): Update.
6130 * src/parse-gram.y: Support unary %define.
6131 * tests/actions.at: Define global_tokens_and_yystype for backward
6132 compatibility until we update the tests.
6133 * tests/calc.at: Idem.
6134 (first_line, first_column, last_line, last_column): Define for lalr1.cc
6135 to simplify the code.
6137 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
6139 Port to SunOS 4.1.4, which lacks strtoul and strerror.
6140 Ah, the good old days! Problem reported by Peter Klein.
6141 * bootstrap (gnulib_modules): Add strerror, strtoul.
6142 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
6143 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
6145 2005-09-29 Akim Demaille <akim@epita.fr>
6147 * data/c.m4 (b4_error_verbose_if): New.
6148 * data/lalr1.cc: Use it.
6149 (YYERROR_VERBOSE_IF): Remove.
6150 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
6151 parser members, replaced by...
6152 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
6154 (yysyntax_error_): Takes the state number as argument.
6155 (yyreduce_print_): Use the argument yyrule, not the former
6158 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
6160 * bootstrap (gnulib_modules): Add verify.
6161 * lib/.cvsignore: Add verify.h.
6162 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
6163 * src/system.h (verify): Remove.
6164 Include verify.h instead.
6165 * src/tables.c (tables_generate): Use new API for 'verify'.
6167 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
6169 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
6170 local variables whose names begin with 'yy'.
6171 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
6172 Trivial changes from Joel E. Denny.
6174 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
6176 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
6177 don't use alloca any more.
6179 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
6180 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
6181 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
6182 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
6183 to match yacc.c, to test more hosts.
6185 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
6187 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
6188 doesn't affect behavior.
6189 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
6191 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
6192 This works a bit better with glibc, if user code has already included
6194 * doc/bison.texinfo (Bison Parser): Document that users can't
6195 arbitrarily use malloc and free for other purposes. Document
6196 that <alloca.h> and <malloc.h> might be included.
6197 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
6198 user must declare alloca.
6200 * HACKING (release): Forwarn the Translation Project about
6203 2005-09-20 Akim Demaille <akim@epita.fr>
6205 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
6207 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
6209 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
6210 (YYSTACK_ALLOC_MAXIMUM): Use it.
6211 (yysyntax_error): New function.
6212 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
6213 multiple syntax errors are reported, and alloca is being used.
6214 Instead, reallocate buffers twice as big each time, so that
6215 we waste at most half the allocated memory. Start with a small
6216 (128-byte) buffer that will suffice in most cases anyway.
6217 Use yysyntax_error to do most of the work.
6219 * doc/bison.texinfo (Error Reporting, Table of Symbols):
6220 yynerrs is the number of errors reported, not the number of
6223 * tests/glr-regression.at (Duplicated user destructor for lookahead):
6224 Mark it as expected to fail.
6225 Cast result of malloc; problem reported by twlevo@xs4all.nl.
6226 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
6227 Don't start user-code symbols with "yy", to avoid name space problems.
6229 2005-09-19 Akim Demaille <akim@epita.fr>
6231 Remove the traits, failed experiment.
6232 It never proved useful, and anyway because of the current
6233 definition, it was not possible to have several specialization of
6234 this traits, making it useless.
6235 * data/lalr1.cc (yy:traits): Remove.
6236 Inline its definitions in the parser class.
6238 2005-09-19 Akim Demaille <akim@epita.fr>
6240 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
6241 least Mac OSX with a /usr/local install of gettext.
6243 2005-09-19 Akim Demaille <akim@epita.fr>
6245 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
6246 and yytoken for similarity with the other skeletons.
6248 2005-09-19 Akim Demaille <akim@epita.fr>
6250 * NEWS, configure.ac: update version number to 2.1a.
6252 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
6254 * NEWS: Version 2.1.
6256 * NEWS: Remove notice of yytname change, since it was never in an
6258 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
6260 * src/output.c (prepare): Likewise.
6261 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
6262 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
6263 is not defined. This is an awful hack, but it's enough for now.
6264 All callers changed.
6265 * tests/glr-regression-at (make_value): Args are const pointers now,
6266 to avoid GCC warning.
6267 (Duplicated user destructor for lookahead): New test. Currently
6268 skipped. It fails on my host but I'm not sure it'll always fail.
6270 2005-09-16 Akim Demaille <akim@epita.fr>
6272 * src/symtab.h (struct symbol): Declare the printer and destructor
6273 as const, to avoid accidental calls to free.
6274 (symbol_destructor_set, symbol_printer_set): Adjust.
6275 * src/symtab.c: Adjust.
6277 2005-09-16 Akim Demaille <akim@epita.fr>
6279 * data/c.m4 (b4_token_enums): New.
6280 (b4_token_defines): Rename as...
6281 (b4_token_enums_defines): this.
6282 (b4_token_defines): New, output only the #defines.
6283 * data/yacc.c, data/glr.c: Adjust.
6284 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
6285 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
6288 2005-09-16 Akim Demaille <akim@epita.fr>
6290 * data/lalr1.cc (yylex_): Remove, inline its code.
6291 (yyreport_syntax_error_): Remove, replaced by...
6292 (yysyntax_error_): this which returns a string and leaves to the
6293 caller the call to the users' error function.
6294 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
6295 Move from members of the parser object...
6296 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
6297 to local variables of the parse function.
6299 2005-09-16 Akim Demaille <akim@epita.fr>
6301 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
6302 since it's in Bison's name space.
6304 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
6306 * data/glr.c (yyresolveValue): Add default case to pacify
6307 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
6309 * NEWS: Document when yyparse started to return 2.
6310 * doc/bison.texinfo (Parser Function): Document when yyparse
6313 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
6314 (b4_filename_type): Renamed back from b4_file_name_type. All uses
6316 (class position): file_name -> filename (reverting). All uses changed.
6318 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
6320 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
6321 do anything if $@ exists. This reverts part of the 2005-07-07
6324 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
6326 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
6327 contains obsolete information and isn't worth distributing as a
6328 separate file anyway.
6329 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
6330 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
6331 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
6332 (yyparse): Abort if user code uses longjmp to throw an unexpected
6335 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
6337 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
6338 Suggested by twlevo@xs4all.nl.
6340 * data/glr.c (YYCHK1): Do not assume YYE is in range.
6341 This avoids a diagnostic from gcc -Wswitch-enum.
6342 Problem reported by twlevo@xs4all.nl.
6344 * doc/bison.texinfo: Don't use "filename", as per GNU coding
6345 standards. Use "file name" or "file" or "name", depending on
6347 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
6348 not to hack/foo.tab.c.
6349 (Calc++ Top Level): 2nd arg of main is not const.
6350 * data/glr.c: b4_filename -> b4_file_name.
6351 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
6353 (class position): filename -> file_name. All uses changed.
6354 * data/yacc.c: b4_filename -> b4_file_name.
6355 * lib/bitset.h: filename -> file_name in local vars.
6356 * lib/bitset_stats.c: Likewise.
6357 * src/files.c: Likewise.
6358 * src/scan-skel.l ("@output ".*\n): Likewise.
6359 * src/files.c (file_name_split): Renamed from filename_split.
6360 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
6362 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
6364 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
6365 to accommodate latest gnulib.
6367 * tests/glr-regression.at (Duplicate representation of merged trees):
6368 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
6370 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
6373 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
6375 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
6376 All uses changed. Invoke user destructor after an error during a
6377 split parse (trivial change from Joel E. Denny).
6379 * tests/glr-regression.at
6380 (User destructor after an error during a split parse): New test case.
6381 Problem reported by Joel E. Denny in:
6382 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
6384 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
6386 * README-cvs: Give URLs for recommended tools.
6387 Mention Gzip version problem, and bootstrapping issues.
6388 Remove troubleshooting section, as it's somewhat obsolete.
6390 * bootstrap (no_cache): New var, to accommodate different wget
6391 variants. Use it instead of '-C off'. Problem reported by
6394 * data/glr.c (yydestroyStackItem): New function.
6395 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
6396 debugging information. Problem reported by Joel E. Denny.
6398 2005-08-25 Akim Demaille <akim@epita.fr>
6400 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
6402 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
6404 * data/glr.c (yyrecoverSyntaxError, yyreturn):
6405 Don't invoke destructor on unresolved entries.
6406 * tests/glr-regression.at
6407 (User destructor for unresolved GLR semantic value): New test case.
6408 Problem reported by Joel E. Denny in:
6409 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
6411 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
6413 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
6415 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
6416 lib-prefix.m4, po.m4.
6418 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
6419 in yydestruct diagnostic, since it might not be an error.
6420 Problem reported by Joel Denny near end of
6421 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6422 * data/lalr1.cc (yyerturn): Likewise.
6423 * data/yacc.c (yyreturn): Likewise.
6424 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
6426 * src/files.c: Remove obsolete FIXME comment.
6428 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
6429 with the other templates, and to fix bogus run-on messages such
6430 as the one reported at the end of
6431 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6432 All callers changed to avoid the newline.
6433 (yyprocessOneStack): Output two lines rather than one, to accommodate
6434 the above change. This changes the debug output format slightly.
6436 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
6437 reported by Joel E. Denny in
6438 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
6440 * tests/glr-regression.at (Duplicate representation of merged trees):
6441 New test, from Joel E. Denny in:
6442 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
6443 * THANKS: Add Joel E. Denny.
6445 * configure.ac (AC_INIT): Bump to 2.0c.
6447 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
6449 * NEWS: Version 2.0b.
6451 * Makefile.am (SUBDIRS): Put examples before tests, so that
6452 "make check" doesn't finish with "All 1 tests passed".
6454 * tests/regression.at (Token definitions): Don't rely on
6455 AT_PARSER_CHECK for data that contains backslashes. It currently
6456 uses 'echo', and 'echo' isn't portable if its argument contains
6457 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
6458 that the byte '\0xff' is not printable in the C locale; it is,
6459 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
6460 not printable, so use '\0x81' to test.
6462 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
6463 version of GCC, since the macro is used with non-GCC compilers.
6465 Fix core dump reported by Pablo De Napoli in
6466 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
6467 * tests/regression.at (Invalid inputs with {}): New test.
6468 * src/parse-gram.y (token_name): Translate type before using
6471 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
6472 the user's name space. All uses changed to __attribute__
6474 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
6475 Add __attribute__ ((__noreturn__)).
6477 * etc/clcommit: Remove. We weren't using it, and it failed
6478 "make maintainer-distcheck".
6479 * Makefile.maint: Merge from coreutils.
6480 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
6481 (syntax-check-rules): Change list of rules as described below.
6482 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
6483 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
6484 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
6485 (sc_trailing_space): New rules.
6486 (sc_xalloc_h_in_src): Remove.
6487 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
6488 (sc_space_tab, sc_error_exit_success, sc_changelog):
6489 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
6490 (makefile-check, po-check, author_mark_check):
6491 (makefile_path_separator_check, copyright-check):
6492 Use grep -n, to make it easier to find violations.
6493 Use CVS_LIST and CVS_LIST_EXCEPT.
6494 (header_regexp, h_re): Remove.
6496 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
6497 (my-distcheck): Use more-modern GCC flags.
6498 (signatures, %.asc): Remove.
6499 (rel-files, announcement): Remove signatures.
6500 Restore old updating code, even though we don't use it, so
6501 that we're the same as coreutils.
6502 (alpha, beta, major): Depend on news-date-check.
6503 Make the upload commands.
6505 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
6506 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
6507 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
6508 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
6509 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
6510 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
6511 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
6512 * tests/sets.at: Likewise.
6514 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
6515 we comment out the Autoconf version number.
6516 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
6517 it's error-prone and "make maintainer-distcheck" rejects it.
6519 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
6520 Indent calls to "error" to pacify "make maintainer-distcheck",
6521 when the calls are not intended to be translated.
6522 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
6524 * src/Makefile.am (DEFS): Use +=, to pacify
6525 "make maintainer-distcheck".
6526 (bison_SOURCES): Add scan-skel.h.
6527 (sc_tight_scope): New rule, from coreutils.
6529 * src/files.c (src_extension, header_extension):
6530 Now static, not extern.
6531 * src/getargs.c (short_options): Likewise.
6532 * src/muscle_tab.c (muscle_table): Likewise.
6533 * src/parse-gram.y (current_class, current_type, current_prec):
6535 * src/reader.c (grammar_end, previous_rule_end): Likewise.
6536 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
6537 * src/main.c (main): Cast bindtextdomain and textdomain calls to
6538 void, to avoid warning when NLS is disabled.
6539 * src/output.c: Include scan-skel.h.
6540 (scan_skel): Remove decl, since scan-skel.h does this.
6542 Indent calls to "error" to pacify "make maintainer-distcheck".
6543 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
6544 * src/reader.h (gram_end, gram_lineno): New decls to pacify
6545 "make maintainer-distcheck".
6546 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
6547 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
6548 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
6549 (skel_lex_destroy, scan_skel): Move these decls to...
6550 * src/scan-skel.h: New file.
6551 * src/uniqstr.c (uniqstr_assert):
6552 Indent calls to "error" to pacify "make maintainer-distcheck".
6554 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
6557 * tests/torture.at: Revamp to avoid misuse of atoi that
6558 "make maintainer-distcheck" complained about.
6560 * examples/extexi (message): Don't print a message more than once,
6561 and omit line-number decoration that makes Emacs compile think
6562 that informative messages are worth worrying about.
6564 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
6566 * configure.ac: Update version number.
6568 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
6570 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
6571 autogenerated by the maintainer.
6572 * examples/calc++/.cvsignore: Add *.yy.
6574 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
6575 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6576 * lib/bitsetv.c (bitsetv_alloc): Likewise.
6578 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
6580 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
6581 from maintainer-distcheck about casting the argument of 'free'.
6583 * NEWS: Mention recent yytname changes.
6584 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
6586 * bootstrap: For translations that have not yet been upgraded to
6587 the new runtime-po domain, prime the pump by extracting the
6588 relevant strings from the obsolete translations. This code can be
6589 removed once the bison-runtime domain has been translated by each
6592 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
6593 now that token names are already quoted.
6595 Fix problem reported by Anthony Heading.
6596 * data/glr.c (YYTOKEN_TABLE): New macro.
6597 (yytname): Define if YYTOKEN_TABLE.
6598 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
6599 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
6600 (YYERROR_VERBOSE): Define the same way the other skeletons do.
6601 * src/output.c (prepare_symbols): Output token_table_flag.
6603 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
6605 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
6606 again if the first call fails.
6608 * data/glr.c (yytnamerr): New function.
6609 (yyreportSyntaxError): Use it to dequote most string literals.
6610 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
6611 with other skeletons. All uses changed.
6612 (yytnameerr_): New function.
6613 (yyreport_syntax_error): Use it to dequote most string literals.
6614 * data/yacc.c (yytnamerr): New function.
6615 (yyerrlab): Use it to decode most string literals.
6616 * doc/bison.texinfo (Decl Summary, Calling Convention):
6617 Clarify quoting convention of yytname.
6618 * src/output.c (prepare_symbols): Quote all names. This undoes
6619 the 2005-04-17 change, which is now accomplished (mostly) via
6620 changes in the parsers as described above.
6621 * tests/regression.at (Token definitions, Web2c Actions):
6622 Undo most 2005-04-17 change here, too.
6624 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
6626 Fix more problems reported by twlevo@xs4all.nl.
6627 * tests/cxx-type.at: Don't pipe output of ./types through sed to
6628 remove trailing spaces. This loses the exit status of ./types,
6629 and isn't needed since ./types shouldn't be emitting trailing
6631 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
6632 as the stack isn't valid in that case.
6634 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6635 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6636 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6637 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
6639 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
6640 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6641 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6644 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
6645 overly-picky compilers that reject 'char *foo = "bar";'.
6647 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
6648 to FILE * parameter, not to stderr. This fixes a typo introduced
6649 in the 2005-07-12 change.
6651 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
6652 warnings from GCC 4.
6654 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
6655 (yyglrShiftDefer, yysplitStack):
6656 Remove unused parameters b4_pure_formals. All uses changed.
6657 (yyglrShift): Remove unused parameters b4_user_formals.
6659 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
6661 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
6663 Destructor cleanups and regularization among the three skeletons.
6664 * NEWS: Document the behavior changes.
6665 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
6666 stack before failing, as the cleanup code will do it for us now.
6667 * data/lalr1.cc (yyerrlab): Likewise.
6668 * data/glr.c (yyparse): Pop everything off the stack before
6669 freeing it, so that destructors get called properly.
6670 * data/lalr1.cc (yyreturn): Likewise.
6671 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
6672 This is more consistent.
6673 * doc/bison.texinfo (Destructor Decl): Mention more reasons
6674 why destructors might be called. 1.875 -> 2.1.
6675 (Destructor Decl, Decl Summary, Table of Symbols):
6676 Some English-language cleanups for %destructor.
6677 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6678 Add output line for destructor of start symbol.
6679 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
6680 because of that same extra output line.
6682 * NEWS: Document minor wording changes in diagnostics of
6683 Bison-generated parsers.
6684 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
6685 Remove unused formals. All uses changed.
6686 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
6687 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
6688 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
6689 Rename yyoverflowab to yyexhaustedlab.
6690 When memory exhaustion occurs during syntax-error reporting,
6691 report it separately rather than in a single diagnostic; this
6693 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
6694 (Memory Exhausted): Renamed from Parser Stack Overflow.
6695 Revamp wording slightly to prefer "memory exhaustion".
6696 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
6698 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
6700 Add i18n support to the GLR skeleton. Partially fix the C++
6701 skeleton; a C++ expert needs to finish this. Remove debugging
6702 msgids; there's little point to having them translated, since they
6703 can be understood only by someone who can read the
6704 (English-language) source code.
6706 Generate runtime-po/bison-runtime.pot automatically, so that we
6707 don't have to worry about garbage getting in that file. We'll
6708 make sure after the next official release that old msgids don't
6710 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
6712 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
6714 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
6715 Fix typos in explanations of the runtime file.
6716 * bootstrap: Change gettext keyword from YYI18N to YY_.
6717 Use standard Makefile.in.in in runtime-po, since we'll arrange
6718 for backward-compatible bison-runtime.po files in a different way.
6719 * data/glr.c (YY_): New macro, from yacc.c.
6720 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
6721 Translate messages intended for users.
6722 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
6723 the wording in the other skeletons. We don't know that the memory
6725 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
6726 Use same method that yacc.c uses.
6727 Don't translate debugging messages.
6728 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
6729 it doesn't work (yet), and requires C++ expertise to fix.
6730 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
6731 Move defn to a more logical place, to be consistent with other
6733 Don't translate debugging messages.
6734 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
6735 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
6736 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
6737 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
6739 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
6740 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
6742 * tests/glr-regression.at (Badly Collapsed GLR States):
6744 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6745 yylex should return 0 at EOF rather than aborting.
6747 Improve tests for stack overflow in GLR parser.
6748 Problem reported by twlevo@xs4all.nl.
6749 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
6751 (yyStackOverflow): Just longjmp, but with value 2 so that caller
6752 can handle the problem.
6753 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
6754 (yyparse): New local variable yyresult to record the result.
6755 Use result of setjmp to set it, rather than storing itinto
6757 (yyDone): Remove label.
6758 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
6759 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
6760 if YYABORT is used).
6761 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
6762 yyparse status; put status > 1 into diagnostic.
6763 Check that status==2 works.
6764 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
6765 Use exit status 3 for failure to open (which shouldn't happen).
6767 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
6769 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
6770 1 on syntax error; just let yyparse do its thing.
6771 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
6772 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
6773 (Exploding the Stack Size with Alloca):
6774 (Exploding the Stack Size with Malloc):
6775 Expect exit status 2, not 1, since the parser is supposed to blow
6776 its stack. Problem reported by twlevo@xs4all.nl.
6778 * data/glr.c (yyparse): Don't assume that the initial calls
6779 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
6780 Print a stack-overflow message and fail instead.
6781 Initialize the line-number information before creating the stack,
6782 so that the stack-overflow message can report line zero safely.
6784 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
6786 Fix problems reported by twlevo@xs4all.nl.
6787 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
6788 (yyuserMerge): Provide a default case if b4_mergers is empty.
6789 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
6790 * tests/glr-regression.at
6791 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6792 Add casts to pacify C++ compilers.
6793 * tests/glr-regression.at (Improper merging of GLR delayed action
6794 sets): Declare yylex before using it.
6795 * tests/Makefile.am (maintainer-check-g++): Fix a stray
6796 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
6797 test for valgrind; valgrind is independent of g++.
6798 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
6799 for compatibility with POSIX 1003.1-2001 (if running coreutils).
6800 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
6801 Use a destructor, so that we can expand the stack. Change
6802 YYSTYPE to char * so that we can free it. Cast result of malloc.
6804 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6806 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
6807 a valgrind failure. Problem reported by twlevo@xs4all.nl.
6809 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
6811 * PACKAGING: New file, suggested by Bruno Haible and taken from
6812 similar wording in gettext's PACKAGING file.
6813 * NEWS: Mention PACKAGING.
6814 * Makefile.am (EXTRA_DIST): Add PACKAGING.
6816 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
6818 * NEWS: Document recent i18n improvements.
6819 * bootstrap: Get runtime translations into runtime-po.
6820 Create runtime-po files automatically, if possible.
6821 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
6822 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
6823 does not infringe on the user's name space.
6824 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
6825 * doc/bison.texinfo (Internationalization): Revamp the English
6826 and Texinfo syntax a bit, to try to make it clearer.
6827 (Bison Options, Option Cross Key): Mention --print-localedir.
6828 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
6829 YYENABLE_NLS. Quote a bit more.
6830 * runtime-po/.cvsignore: New file.
6831 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
6832 * runtime-po/Rules-quot: Remove; now created by bootstrap.
6833 * runtime-po/quot.sed: Likewise.
6834 * runtime-po/boldquot.sed: Likewise.
6835 * runtime-po/en@quot.header: Likewise.
6836 * runtime-po/en@boldquot.header: Likewise.
6837 * runtime-po/insert-header.sin: Likewise.
6838 * runtime-po/remove-potcdate.sin: Likewise.
6839 * runtime-po/Makevars: Likewise.
6840 * runtime-po/LINGUAS: Likewise.
6841 * runtime-po/de.po: Likewise; we will rely on the translation project
6842 to maintain this, so "bootstrap" should get it.
6843 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
6845 * src/main.c (main): Bind the bison-runtime domain, too.
6847 2005-07-12 Bruno Haible <bruno@clisp.org>
6849 * data/yacc.c: Include <libintl.h> when NLS is enabled.
6850 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
6851 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
6852 * runtime-po: New directory.
6853 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
6854 $(DOMAIN).pot-update rule, so that old messages are never dropped.
6855 * runtime-po/Rules-quot: New file, copied from po/.
6856 * runtime-po/quot.sed: Likewise.
6857 * runtime-po/boldquot.sed: Likewise.
6858 * runtime-po/en@quot.header: Likewise.
6859 * runtime-po/en@boldquot.header: Likewise.
6860 * runtime-po/insert-header.sin: Likewise.
6861 * runtime-po/remove-potcdate.sin: Likewise.
6862 * runtime-po/Makevars: New file.
6863 * runtime-po/POTFILES.in: New file.
6864 * runtime-po/LINGUAS: New file.
6865 * runtime-po/bison-runtime.pot: New file.
6866 * runtime-po/de.po: New file.
6867 * m4/bison.m4: New file.
6868 * Makefile.am (SUBDIRS): Add runtime-po.
6869 (aclocaldir, aclocal_DATA): New variables.
6870 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
6872 * src/getargs.c (usage): Document --print-localedir option.
6873 (PRINT_LOCALEDIR_OPTION): New enum item.
6874 (long_options): Add --print-localedir option.
6875 (getargs): Handle --print-localedir option.
6876 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
6877 (Internationalization): New section.
6879 2005-07-12 Akim Demaille <akim@epita.fr>
6881 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
6882 for consistency with the rest of the code.
6883 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
6886 2005-07-12 Akim Demaille <akim@epita.fr>
6888 * src/parse-gram.y: Use %printer instead of YYPRINT.
6890 2005-07-12 Akim Demaille <akim@epita.fr>
6892 * src/symtab.h, src/symtab.c (symbol_print): New.
6893 * src/symlist.h, src/symlist.c (symbol_list_print): New.
6894 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
6896 2005-07-12 Akim Demaille <akim@epita.fr>
6898 * data/glr.c (b4_syncline): Fix (swap) the definitions of
6899 b4_at_dollar and b4_dollar_dollar.
6901 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
6903 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
6904 and Pennello's paper.
6906 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
6908 * data/yacc.c (yyparse): Undo previous patch. Instead,
6909 set yylsp[0] and yyvsp[0] only if the initial action
6910 sets yylloc and yylval, respectively.
6912 * data/yacc.c (yyparse): In the initial action, set
6913 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
6914 This avoids the use of undefined variables if the initial
6915 action does not set yylloc and/or yylval.
6917 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
6919 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
6920 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
6921 Remove from CVS. These files are automatically generated.
6922 * examples/extexi: Clarify that this file is now part of Bison,
6923 not GNU M4, and that it works with any POSIX-compatible Awk.
6924 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
6925 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
6926 so that we also get calc++-parser.yy. Geneate it.
6927 Use $(AWK), not gawk, since any conforming Awk will do.
6928 Put comment before action, since older 'make' can't handle comment
6930 $(BUILT_SOURCES): List all built sources, not just some of them.
6931 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
6932 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
6933 $($(calc_sources_generated)): Remove unnecessary test for existence
6934 of target. (This had a shell syntax error anyway; a stray "x".)
6935 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
6937 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
6939 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
6940 implied by the other modules.
6942 2005-07-06 Akim Demaille <akim@epita.fr>
6944 Bind examples/calc++ to the package.
6945 * examples/calc++/Makefile: Remove, replaced by...
6946 * examples/calc++/Makefile.am: ... this new file.
6947 * examples/calc++/test: Remove input.
6948 * examples/calc++/compile: Remove.
6949 * examples/Makefile.am: New.
6950 * configure.ac, Makefile.am: Adjust.
6951 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
6953 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
6955 * data/glr.c (yyFail): Drastically simplify; since the format argument
6956 never had any % directives, we can simply pass it to yyerror.
6957 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
6958 be modified later, as that is the usual style in glr.c.
6959 Problems reported by Paul Hilfinger.
6961 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
6962 and size overflow errors.
6963 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
6964 in case the user prolog sets feature-test macros like _GNU_SOURCE.
6965 (YYSIZEMAX): New macro.
6966 (yystpcpy): New function, taken from yacc.c.
6967 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
6968 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
6969 so that we don't have to maintain their signatures.
6970 (yyFail): Check for buffer overflow, by using vsnprintf rather
6971 than vsprintf. Allocate a bigger buffer if possible.
6972 Report an error if buffer allocation fails.
6973 (yyStackOverflow): New function.
6974 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
6975 the initialization was successful. It might fail if storage was
6977 (yyexpandGLRStack): Add more checks for storage allocation failure.
6978 Use yyStackOverflow to report failures.
6979 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
6980 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
6981 Don't assume stack number fits in int.
6982 (yysplitStack): Check for storage allocation failure.
6983 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
6984 can print diagnostics on storage allocation failure. All callers
6986 (yyresolveValue): Use yybool for boolean.
6987 (yyreportSyntaxError): Check for size-calculation overflow.
6988 This code is taken from yacc.c.
6989 (yyparse): Check for storage allocation errors when allocating
6992 2005-07-05 Akim Demaille <akim@epita.fr>
6994 Extract calc++ from the documentation.
6995 * doc/bison.texinfo (Calc++): Add the extraction marks.
6996 * examples/extexi: New, from the aborted GNU Programming 2E.
6997 Separate the different paragraph of a file with empty lines.
6998 * examples/Makefile: Use it to extract the whole calc++ example.
7000 2005-06-24 Akim Demaille <akim@epita.fr>
7002 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
7005 2005-06-22 Akim Demaille <akim@epita.fr>
7007 * doc/bison.texinfo (C++ Language Interface): First stab.
7008 (C++ Parsers): Remove.
7010 2005-06-22 Akim Demaille <akim@epita.fr>
7012 * data/lalr1.cc (yylex_): Honor %lex-param.
7014 2005-06-22 Akim Demaille <akim@epita.fr>
7016 Start a set of simple examples.
7017 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
7018 * examples/calc++/calc++-driver.hh,
7019 * examples/calc++/calc++-parser.yy,
7020 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
7021 * examples/calc++/compile, examples/calc++/test: New.
7023 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
7025 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
7026 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
7027 which stems from the 2005-05-27 patch.
7029 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7031 * data/glr.c: Modify treatment of unused parameters to permit use
7032 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
7034 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
7036 Fix infringement on user name space reported by Janos Zoltan Szabo.
7037 * data/yacc.c (yyparse): strlen -> yystrlen.
7039 2005-05-30 Akim Demaille <akim@epita.fr>
7041 * data/lalr1.cc (_): New.
7042 Translate the various messages.
7044 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
7046 Fix infringement on user name space reported by Bruno Haible.
7047 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
7048 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
7049 the user's name space.
7050 (alloca): Include <stdlib.h> to get it, if it's not built in.
7051 (YYMALLOC, YYFREE): Define only if needed.
7052 (malloc, free): Declare, but only if needed, as this infringes on
7053 the user name space.
7055 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
7057 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
7058 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
7060 * lib/ebitset.c (min, max): Undef before defining.
7061 * lib/vbitset.c (min, max): Likewise.
7062 * lib/subpipe.c (create_subpipe): Save local variables in case
7063 vfork clobbers them.
7065 2005-05-24 Bruno Haible <bruno@clisp.org>
7067 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
7068 error message syntax used by gcc-4.0.
7070 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
7072 * README: Mention m4 1.4.3. Remove obsolete advice about
7073 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
7075 * bootstrap: Remove workaround for problem I encountered with
7076 gettext 0.14.1; it seems to be fixed now.
7078 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
7080 * NEWS: Version 2.0a.
7082 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
7083 the previous change.
7085 Various maintainer cleanups.
7086 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
7087 conftest*, for benefit of CVS commands run at the same time as
7088 "configure". Add build-aux, since "bootstrap" now creates it and
7090 * Makefile.cfg (move_if_change): Remove.
7091 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
7092 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
7093 (po_repo, do-po-update, po-update, wget_files, get-targets):
7094 (config.guess-url_prefix, config.sub-url_prefix):
7095 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
7096 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
7097 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
7099 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
7100 this is now the recommended name.
7101 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
7102 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
7103 ylwrap. These files now go into build-aux.
7104 * config/move-if-change: Remove.
7105 * config/prev-version.txt: Bump from 1.75 to 2.0.
7107 * bootstrap: Add stdio-safer, unistd-safer modules.
7108 Remove m4/glibc2.m4 (introduced by latest gnulib, but
7110 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
7111 fopen-safer.c, stdio-safer.h, unistd-safer.h.
7112 * lib/subpipe.c: Include "unistd-safer.h".
7113 (create_subpipe): Make sure all the newly-created
7114 file descriptors are > 2, so that diagnostics don't
7115 get sent down them (which might cause Bison to hang, in theory).
7116 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
7117 * src/files.c (xfopen): Use fopen_safer, not fopen.
7119 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
7120 yesterday's yacc.c fix.
7122 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
7124 * data/glr.c, data/lalr1.cc: Update copyright date.
7126 Fix a destructor bug reported by Wolfgang Spraul in
7127 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
7128 * data/yacc.c (yyabortlab): Don't call destructor, and
7129 don't set yychar to EMPTY.
7130 (yyoverflowlab): Don't call destructor.
7131 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
7132 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
7133 since we no longer output the message "discarding lookahead token
7136 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7138 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
7139 fix a small glitch in debugging output.
7140 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
7141 after YY_SYMBOL_PRINT where needed.
7143 (struct yyGLRState): Add some comments.
7144 (struct yySemanticOption): Add some comments.
7145 (union yyGLRStackItem): Add comment.
7147 (yymergeOptionSets): Correct this to properly perform the union,
7148 avoiding infinite reported by Michael Rosien.
7151 * tests/glr-regression.at: Add test for GLR merging error reported
7154 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
7156 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
7157 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
7158 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
7159 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
7160 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
7161 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
7162 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
7163 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
7164 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
7165 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
7166 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
7167 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
7168 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
7169 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
7170 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
7171 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
7172 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
7173 src/derives.h, src/files.c, src/files.h, src/getargs.c,
7174 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
7175 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
7176 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
7177 src/output.h, src/parse-gram.c, src/parse-gram.h,
7178 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
7179 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
7180 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
7181 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
7182 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
7183 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
7184 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
7185 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
7186 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
7187 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
7188 tests/reduce.at, tests/regression.at, tests/sets.at,
7189 tests/synclines.at, tests/testsuite.at, tests/torture.at:
7190 Update FSF postal mail address.
7192 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
7194 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
7195 Problem reported by Ralf Menzel.
7197 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
7199 * tests/actions.at: Test that stack overflow invokes destructors.
7200 From Marcus Holland-Moritz.
7201 * data/yacc.c (yyerrlab): Move the code that destroys the stack
7203 (yyreturn): to here. That way, destructors are called properly
7204 even if the stack overflows, or the user calls YYACCEPT or
7205 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
7206 (yyoverflowlab): Destroy the lookahead.
7208 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
7210 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
7212 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
7214 * NEWS: Bison-generated C parsers no longer quote literal strings
7215 associated with tokens.
7216 * src/output.c (prepare_symbols): Don't escape strings,
7217 since users don't want to see C escapes.
7218 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
7220 * tests/input.at (Torturing the Scanner): Likewise.
7221 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
7223 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
7225 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
7226 the data size is known to be too small and we can't increase it.
7227 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
7229 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
7231 * src/parse-gram.y: Include quotearg.h.
7232 (string_as_id): Quote $1 before using it as a key, since the
7233 lexer no longer quotes it for us.
7234 (string_content): Don't strip quotes, since lexer no longer
7236 * src/scan-gram.l: Include quotearg.h.
7238 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
7239 a key, since the rest of the lexer doesn't quote it.
7240 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
7241 * tests/regression.at (Token definitions): Check for backslashes
7244 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
7245 (YYSIZE_T): Define to unsigned long int when using an older compiler.
7246 (yyparse): Revamp code to generate long syntax error message, to
7247 make it easier to translate, and to avoid problems with arithmetic
7248 overflow. Change "virtual memory" to "memory" in diagnostic, since
7249 we don't know whether the memory is virtual.
7251 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
7253 * NEWS: Bison-generated C parsers now use the _ macro to
7255 * data/yacc.c (_) [!defined _]: New macro.
7256 All English strings wrapped inside this macro.
7257 * doc/bison.texinfo (Bison Parser): Document _.
7258 * po/POTFILES.in: Include src/parse-gram.c, since it now
7259 includes translateable strings that parse-gram.y doesn't.
7261 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
7263 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
7264 reverting the 2004-10-11 change to this function.
7265 (symbol_check_alias_consistency): Don't call symbol_type_set
7266 if the type name is already correct.
7267 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
7269 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
7271 * tests/regression.at (Token definitions): Don't use a token named
7272 c, as that generates a "#define c ..." that runs afoul of buggy
7273 stdlib.h that uses the identifier c as a member of struct
7274 drand48_data. Problem reported by Horst Wente.
7276 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
7278 * bootstrap: Change translation URL from
7279 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
7280 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
7281 redirection glitches. Problem reported by twlevo@xs4all.nl.
7283 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
7285 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
7286 after operands; POSIX says this isn't portable for the c99 command.
7288 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
7290 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
7291 immediately if a data overrun has occurred; this may help us track
7292 down what may be a spurious failure on MacOS.
7294 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
7296 Respond to problems reported by twlevo@xs4all.nl.
7298 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
7300 * src/vcg.h: Comment fix.
7301 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
7302 (G_CMAX): Change to -1 instead of INT_MAX.
7304 * data/yacc.c (yyparse): Omit spaces before #line.
7306 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
7308 * src/tables.c (state_number_to_vector_number): Put it inside an
7309 "#if 0", since it's not currently used. Problem reported by
7312 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
7314 * src/output.c (escaped_output): Renamed from
7315 escaped_file_name_output, since we now use it for symbol tags as
7316 well. All uses changed.
7317 (symbol_destructors_output, symbol_printers_output):
7318 Escape symbol tags too.
7319 Problem reported by Matyas Forstner in
7320 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
7322 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
7324 * src/output.c (user_actions_output, token_definitions_output,
7325 symbol_destructors_output, symbol_printers_output): Likewise.
7326 * src/reader.c (prologue_augment): Likewise.
7327 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
7329 * src/vcg.c (output_edge): Don't quote linestyle arg.
7330 Problem reported by twlevo@xs4all.nl.
7332 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
7334 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
7335 example, reported by Derek M Jones. Also, make the example even
7336 more outrageous, to better illustrate how bad the problem is.
7338 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
7340 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
7341 putsym. Typo reported by Sebastian Piping.
7343 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
7345 * doc/bison.texinfo (Language and Grammar): some -> same
7346 (Epilogue): int he -> in the
7347 Typos reported by Sebastian Piping via Justin Pence.
7349 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
7351 * tests/glr-regression.at (Improper handling of embedded actions
7352 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
7353 embedded actions and $-N in GLR parsers", work around an Autoconf bug
7354 with dollar signs in test names.
7355 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
7356 for a similar reason.
7358 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
7360 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
7361 wants to redefine G_VIEW.
7363 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
7365 * src/vcg.c (get_view_str): Remove case for normal_view.
7366 Problem reported by twlevo@xs4all.nl.
7368 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
7370 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
7371 Problem reported by twlevo@xs4all.nl.
7373 * doc/bison.texinfo: Change @dircategory from "GNU programming
7374 tools" to "Software development". Requested by Richard Stallman
7377 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
7379 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
7380 Problem reported by twlevo@xs4all.nl.
7382 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
7384 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
7385 keyword; it's not needed with modern compilers, and it doesn't
7386 affect correctness with older compilers. Suggested by
7389 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
7391 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
7392 gcc -Wswitch-default.
7393 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7394 * data/yacc.c (yyparse): Likewise.
7396 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
7398 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
7399 already. Let config.h define any nonstandard values.
7401 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
7403 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
7404 for the benefit of slower hosts. Problem reported by
7407 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
7409 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
7410 being defined and not used.
7411 * data/lalr1.cc (yyparse): Likewise.
7412 Use "if (false)" rather than "if (0)".
7414 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
7416 * TODO: Mention that we should allow NUL bytes in tokens.
7418 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
7420 * src/scan-skel.l (<<EOF>>): Don't close standard output.
7421 Problem reported by Hans Aberg.
7423 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
7425 * src/getargs.c (version): Happy new year; update overall
7426 program copyright date from 2004 to 2005.
7428 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
7429 Problem reported by Hans Aberg.
7430 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
7431 (Output file names.): Add a test for the case when standard output
7434 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
7436 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
7437 to fix an oversight in the Bison 2.0 manual.
7439 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
7441 * NEWS: Version 2.0. Reformat the existing news items since
7442 1.875, so that related items are grouped together.
7443 * configure.ac (AC_INIT): Bump version to 2.0.
7444 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
7446 * tests/torture.at (Exploding the Stack Size with Alloca): Set
7447 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
7448 otherwise, we're not testing alloca. Unfortunately there's no
7449 simple way to consult HAVE_ALLOCA here.
7451 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
7454 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
7455 hand. This avoids a warning about comparing int to size_t when
7456 GCC warnings are enabled.
7458 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
7460 * NEWS: Bison-generated parsers no longer default to using the
7461 alloca function (when available) to extend the parser stack, due
7462 to widespread problems in unchecked stack-overflow detection.
7463 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
7464 responsibility to set it to a positive value. This lets the user
7465 specify a value that is not a preprocessor constant.
7466 * data/yacc.c (YYMAXDEPTH): Likewise.
7467 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
7468 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
7469 to be a compile-time constant. However, explain the constraints on it.
7470 Also, explain the constraints on YYINITDEPTH.
7471 (Table of Symbols): Explain that alloca is no longer the default.
7472 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
7475 * doc/bison.texinfo (Location Default Action): Mention that n must
7476 be zero when k is zero. Suggested by Frank Heckenbach.
7478 2004-12-22 Akim Demaille <akim@epita.fr>
7480 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
7481 (parser::state_type, parser::semantic_type, parser::location_type):
7482 Private, not public.
7483 (parser::parse): Return ints, not bool.
7484 Returning a bool introduces a problem: 0 corresponds to false, and
7485 it seems weird to return false on success. Returning true changes
7486 the conventions for yyparse.
7487 Alternatively we could return void and send an exception.
7488 There is no clear consensus (yet?).
7489 (state_stack, semantic_stack, location_stack): Rename as...
7490 (state_stack_type, semantic_stack_type, location_stack_type): these.
7491 Private, not public.
7492 * tests/c++.at: New.
7493 * tests/testsuite.at, tests/Makefile.am: Adjust.
7495 2004-12-21 Akim Demaille <akim@epita.fr>
7497 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
7499 2004-12-21 Akim Demaille <akim@epita.fr>
7501 Don't impose std::string for filenames.
7503 * data/lalr1.cc (b4_filename_type): New.
7504 (position::filename): Use it.
7505 (parser.hh): Move the inclusion of stack.hh and location.hh below
7506 the user code, so that needed headers for the filename type can be
7508 Forward declare them before the user code.
7509 * tests/Makefile.am (check-local, installcheck-local): Pass
7510 TESTSUITEFLAGS to the TESTSUITE.
7512 2004-12-20 Akim Demaille <akim@epita.fr>
7514 Use more STL like names: my_class instead of MyClass.
7516 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
7517 (SemanticStack, SemanticType, StateStack, StateType)
7518 (TokenNumberType, Stack, Slice, Traits, Parser::location)
7519 (Parser::value): Rename as...
7520 (location_stack, location_type, rhs_number_type, semantic_stack)
7521 (semantic_type, state_stack, state_type, token_number_type, stack)
7522 (slice, traits, parser::yylloc, parser::yylval): these.
7524 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
7526 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
7528 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
7529 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7531 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
7533 Remove uses of 'short int' and 'unsigned short int'. This raises
7534 some arbitrary limits. It uses more memory but nowadays that's
7535 not much of an issue.
7537 This change does not affect the generated parsers; that's a different
7538 task, as some users will want to conserve memory there.
7540 Ideally we should use size_t to represent all object counts, and
7541 something like ptrdiff_t to represent signed differences of object
7542 counts; but that will require more code-cleanup than I have the
7543 time to do right now.
7545 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
7546 Use size_t, not int or short int, to count objects.
7547 * src/closure.c (nritemset, closure): Likewise.
7548 * src/closure.h (nritemset, closure): Likewise.
7549 * src/nullable.c (nullable_compute): Likewise.
7550 * src/print.c (print_core): Likewise.
7551 * src/print_graph.c (print_core): Likewise.
7552 * src/state.c (state_compare, state_hash): Likewise.
7553 * src/state.h (struct state): Likewise.
7554 * src/tables.c (default_goto, goto_actions): Likewise.
7556 * src/gram.h (rule_number, rule): Use int, not short int.
7557 * src/output.c (prepare_rules): Likewise.
7558 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
7559 errs, reductions): Likewise.
7560 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
7562 * src/tables.c (vector_number, tally, action_number,
7563 ACTION_NUMBER_MINIMUM): Likewise.
7564 * src/output.c (muscle_insert_short_int_table): Remove.
7566 2004-12-17 Akim Demaille <akim@epita.fr>
7568 * data/lalr1.cc: Extensive Doxygenation.
7569 (error_): Rename as...
7570 (error): this, since it is visible to the user.
7572 (Parser::message): Now an automatic variable from...
7573 (Parser::yyreport_syntax_error_): here.
7574 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
7576 * tests/input.at: Escape $.
7578 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
7580 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
7581 Parenthesize rhs to avoid obscure problems with mistakes like
7582 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
7583 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7584 b4_rhs_location): Likewise.
7585 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7586 b4_rhs_location): Likewise.
7588 2004-12-16 Akim Demaille <akim@epita.fr>
7590 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
7591 yacc.c: be sure to stay within yycheck_.
7592 * tests/actions.at: Re-enable C++ tests.
7594 2004-12-16 Akim Demaille <akim@epita.fr>
7596 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
7599 2004-12-16 Akim Demaille <akim@epita.fr>
7601 Use #define to handle the %name-prefix.
7603 * data/glr.c, data/yacc.c: Comment changes.
7604 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
7605 so that one can refer to yylex in the parser file, and have it
7606 renamed, as is the case with other skeletons.
7608 2004-12-16 Akim Demaille <akim@epita.fr>
7610 Move lalr1.cc internals into yy*.
7612 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
7613 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
7614 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
7615 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
7616 (empty_, final_, terror_, errcode_, ntokens_)
7617 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
7618 (looka_, ilooka_, error_range_, nerrs_):
7620 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
7621 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
7622 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
7623 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
7624 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
7625 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
7626 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
7627 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
7630 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
7632 Fix some problems reported by twlevo at xs4all.
7633 * src/symtab.c (symbol_new): Report an error if the input grammar
7634 contains too many symbols. This is better than calling abort() later.
7635 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
7636 (struct node, struct graph):
7637 Rename member expand to stretch. All uses changed.
7638 (struct graph): Remove member layoutalgorithm. All uses removed.
7639 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
7640 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
7642 (N_STRETCH): Rename from N_EXPAND. All uses changed.
7644 2004-12-15 Akim Demaille <akim@epita.fr>
7646 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
7647 Add more Doxygen comments.
7648 (symprint_, stack_print_, reduce_print_, destruct_, pop)
7649 (report_syntax_error_, translate_): Rename as...
7650 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
7651 (yypop_, yyreport_syntax_error_, yytranslate_): this.
7653 2004-12-15 Akim Demaille <akim@epita.fr>
7655 * data/lalr1.cc (lex_): Rename as...
7657 Move the trace here.
7658 Take the %name-prefix into account.
7659 Reported by Alexandre Duret-Lutz.
7661 2004-12-15 Akim Demaille <akim@epita.fr>
7663 Simplify the C++ parser constructor.
7665 * data/lalr1.cc (debug_): Rename as...
7666 (yydebug_): so that the parser's internals are always in the yy*
7669 (b4_parse_param_decl): Remove the leading comma as it is now only
7670 called as unique argument list.
7671 (Parser::Parser): Remove the constructor accepting a location and
7672 an initial debugging level.
7673 Remove from the other ctor the argument for the debugging level.
7674 (debug_level_type, debug_level, set_debug_level): New.
7676 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
7679 2004-12-15 Akim Demaille <akim@epita.fr>
7681 Remove b4_root related material: failure experiment
7682 (which goal was to allow to derive from a class).
7684 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
7685 definitions and uses.
7687 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
7689 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
7690 not 2, since it's not portable to subtract 1 from the start of an
7691 array. The new item 0 is never set or used. All uses changed.
7693 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
7694 the default definition of YYLLOC_DEFAULT. Problem reported
7695 by Frank Heckenbach.
7697 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
7699 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
7700 the normal case and one for the error case. Just use the
7701 first one uniformly. Problem reported by Frank Heckenbach.
7702 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
7703 use exactly the same macro in both places.
7704 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
7705 so that the normal-case YYRHSLOC works for the error case too.
7707 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
7708 (YYLLOC_DEFAULT): Use the same macro as glr.c.
7709 * doc/bison.texinfo (Location Default Action): Don't claim that
7710 we have an array of locations. Use the same macro for both glr
7711 and lalr parsers. Mention YYRHSLOC. Mention what happens when
7714 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7716 * HACKING: Update email addresses to send announcements to.
7718 * configure.ac (AC_INIT): Bump version to 1.875f.
7720 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7722 * NEWS: Version 1.875e.
7723 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
7725 * src/scan-skel.l: Include "complain.h", for "fatal".
7727 * src/relation.h (relation_print, relation_digraph):
7728 Relation sizes are of type relation_node, not size_t (this is
7729 merely a doc fix, since the two types are equivalent).
7730 (relation_transpose): Relation sizes are of type relation_node,
7732 * src/relation.c: Likewise.
7733 (top, infinity): Now of type relation_node, not int.
7734 (traverse, relation_transpose): Use relation_node, not int.
7736 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
7737 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
7738 (yyparse): Remove unused local introduced in 2004-10-25 patch.
7740 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
7741 specifying whether the test should be skipped. Use it tp
7742 specify that the [%defines %skeleton "lalr1.cc"] tests currently
7743 fail on some hosts, and should be skipped.
7745 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
7747 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
7748 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
7749 unless otherwise specified below.
7751 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
7752 to allocate kernel_base, kernel_items, kernel_size, since
7753 they needn't be initialized to 0.
7754 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
7755 * src/closure.c (new_closure): Likewise, for itemset.
7756 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
7757 * src/lalr.c (set_goto_map): Likewise, for temp_map.
7758 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
7759 (build_relations): Likewise for edge, states1, includes.
7760 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
7761 * src/reader.c (packgram): Likewise, for ritem, rules.
7762 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
7763 * src/relation.c (relation_digraph): Likewise for VERTICES.
7764 (relation_transpose): Likewise for new_R, end_R.
7765 * src/symtab.c (symbols_token_translations_init): Likewise for
7767 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
7768 (token_actions): Likewise for yydefact, actrow, conflrow,
7770 (save_column): Likewise for froms[symno], tos[symno].
7771 (goto_actions): Likewise for state_count.
7772 (pack_table): Likewise for base, pos, check.
7773 (tables_generate): Likewise for width.
7775 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
7776 for initial core. Just have a separate core, so we needn't worry
7777 about whether kernel_size and kernel_base are initialized.
7779 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
7780 kernel_size, kernel_items): Remove unnecessary initialization.
7781 * src/conflicts.c (conflicts): Likewise.
7782 * src/derives.c (derives): Likewise.
7783 * src/muscle_tablc (muscle_insert): Likewise.
7784 * src/relation.c (relation_digraph): Likewise.
7785 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
7786 conflrow, conflict_table, conflict_list, table, check):
7789 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
7790 This is because all callers pass unsigned int.
7791 * src/closure.h (new_closure): Likewise.
7793 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
7794 (build_relations): Initialize includes[i] in all cases.
7795 * src/reader.c (packgram): Always initialize rules[ruleno].prec
7796 and rules[ruleno].precsym. Initialize members in order.
7797 * src/relation.c (relation_transpose): Always initialize new_R[i]
7799 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
7801 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
7802 conflict_list[0] was always 0, but now it isn't initialized.
7804 * src/table.c (table_grow): When conflict_table grew, the grown
7805 area wasn't cleared. Fix this.
7807 * lib/.cvsignore: Add strdup.c, strdup.h.
7808 * m4/.cvsignore: Add strdup.m4.
7810 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
7812 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
7813 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
7814 GOTO_NUMBER_MAXIMUM, since we occasionally compute
7815 ngotos + 1 without checking for overflow.
7816 (build_relations): Use END_NODE, not -1, to denote end of edges.
7817 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
7818 build_relations): Use goto_number, not int, for goto numbers.
7819 * src/tables.c (save_column, default_goto): Likewise.
7821 2004-11-23 Akim Demaille <akim@epita.fr>
7823 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
7824 of #defining from yystype.
7825 Don't typedef yystype, C++ does not need it.
7826 This lets it possible to forward declare it as union.
7828 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
7830 * bootstrap (gnulib_modules): Add extensions.
7831 Problem reported by Jim Meyering.
7833 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
7835 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
7836 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
7837 src/system.h, src/tables.c: XFREE -> free, to accommodate
7838 recent change to gnulib xalloc.h.
7839 Problem reported by Jim Meyering.
7841 2004-11-17 Akim Demaille <akim@epita.fr>
7843 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
7845 2004-11-17 Akim Demaille <akim@epita.fr>,
7846 Alexandre Duret-Lutz <adl@gnu.org>
7848 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
7851 Use it instead of cdebug_.
7852 (Parser::debug_stream, Parser::set_debug_stream): New.
7853 (Parser::symprint_): Define cdebug_ for temporary backward
7855 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
7858 2004-11-17 Akim Demaille <akim@epita.fr>
7860 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
7861 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
7862 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
7863 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
7865 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
7867 * data/glr.c (yyloc_default): Remove; not used.
7868 Problem reported by Frank Heckenbach.
7870 2004-10-25 Akim Demaille <akim@epita.fr>
7872 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
7873 Introduce another definition to address simple location arrays.
7874 (yyGLRStack): New member: yyerror_range.
7875 (yyrecoverSyntaxError, yyparse): Update it.
7876 (yyrecoverSyntaxError): Use it when shifting the error token to
7877 have an accurate range, equivalent to the one computed by both
7878 yacc.c and lalr1.cc.
7879 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
7880 that column numbers start at column 0, as per GNU Coding
7881 Standards, the others tests, and the doc.
7882 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
7883 Adjust to the above change (first column is 0).
7884 And adjust the location of the "<error>", now covering the whole
7887 2004-10-22 Akim Demaille <akim@epita.fr>
7888 and Paul Eggert <eggert@cs.ucla.edu>
7890 Remove some arbitrary limits on goto numbers and relations.
7891 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
7892 initial values, since they're never used.
7893 (set_goto_map): ngotos is now unsigned, so test for overflow
7894 by seeing whether it wraps around to zero.
7895 * src/lalr.h (goto_number): Now size_t, not short int.
7896 (GOTO_NUMBER_MAXIMUM): Remove.
7897 * src/relation.c (relation_print, traverse, relation_transpose):
7898 Check for END_NODE rather than looking at sign.
7899 * src/relation.h (END_NODE): New macro.
7900 (relation_node): Now size_t, not short int.
7902 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
7904 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
7905 keyword, not an identifier. Problem reported by Baron Schwartz in
7906 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
7908 2004-10-11 Akim Demaille <akim@epita.fr>
7910 * src/symtab.c (symbol_check_alias_consistency): Also check
7911 type names, destructors, and printers.
7912 Reported by Alexandre Duret-Lutz.
7913 Recode the handling of associativity and precedence in terms
7914 of symbol_precedence_set.
7915 Accept no redeclaration at all, not even equal to the previous
7917 (redeclaration): New.
7918 Use it to factor redeclaration complaints.
7919 (symbol_make_alias): Don't set the type of the alias, let
7920 symbol_check_alias_consistency do it as for other features.
7921 * src/symtab.h (symbol): Add new member prec_location, and
7923 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
7924 * tests/input.at (Incompatible Aliases): New.
7926 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
7928 .cvsignore fixes to accommodate gnulib changes,
7929 and the practice of naming build directories "_build".
7930 * .cvsignore: Add "_*". Sort.
7931 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
7932 * m4/.cvsignore: Add "*_gl.m4".
7934 2004-10-06 Akim Demaille <akim@epita.fr>
7936 * src/parse-gram.y (add_param): Fix the truncation of trailing
7939 2004-10-05 Akim Demaille <akim@epita.fr>
7941 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
7942 whether the reducion was empty or not. This leaves room to
7943 improve the use of YYLLOC_DEFAULT in such a case.
7944 lalr1.cc is still experimental, so changing this is acceptable.
7945 And finally, there are probably not many users who changed the
7946 handling of locations in GLR, so changing is admissible too.
7948 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
7949 empty reduction, set @$ to an empty location ending the previously
7951 Adjust uses to make sure the code is triggered on empty
7953 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
7954 expected output: empty reductions have empty locations.
7956 2004-09-29 Akim Demaille <akim@epita.fr>
7958 * data/lalr1.cc: Move towards a more standard C++ coding style
7959 for templates: Class < T > -> Class<T>.
7961 2004-09-29 Akim Demaille <akim@epita.fr>
7963 * data/lalr1.cc: Reinstall the former ctor, for sake of
7964 compatibility, but warn it will be removed.
7965 Move towards a more standard C++ coding style (i.e., type *var ->
7968 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
7970 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
7971 since it's less likely to work if NULs are involved in the future.
7973 2004-09-27 Akim Demaille <akim@epita.fr>
7975 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
7977 2004-09-27 Akim Demaille <akim@epita.fr>
7979 * data/lalr1.cc (b4_parse_param_decl_1): New.
7980 (b4_parse_param_decl): Use it to have different names between attribute
7982 (b4_cc_constructor_call): Likewise.
7984 2004-09-24 Akim Demaille <akim@epita.fr>
7986 * src/parse-gram.y (add_param): Strip the leading and trailing
7987 blanks from a formal argument declaration.
7988 (YY_LOCATION_PRINT): New.
7990 2004-09-24 Akim Demaille <akim@epita.fr>
7992 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
7995 2004-09-24 Akim Demaille <akim@epita.fr>
7997 * doc/bison.texinfo (Table of Symbols): Sort.
7999 2004-09-21 Akim Demaille <akim@epita.fr>
8001 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
8002 the useless parentheses.
8003 Suggested by Paul Eggert.
8005 2004-09-20 Akim Demaille <akim@epita.fr>
8007 Let the initial-action act on the look-ahead, and use it for the
8008 "initial push" (corresponding to an hypothetical beginning-of-file).
8009 And let lalr1.cc honor %initial-action.
8011 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
8013 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
8014 (Parser::Parser): Remove the ctor that used to initialize it.
8015 (Parser::parse): Like in the other skeletons, issue the "starting
8016 parse" message before any action.
8017 Honor %initial-action.
8018 Initialize the stacks with the lookahead.
8019 * data/yacc.c: Let $$ and @$ in %initial-action designate the
8021 Push them in the stacks.
8022 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
8024 2004-09-20 Akim Demaille <akim@epita.fr>
8026 * doc/bison.texinfo (Initial Action Decl): New.
8028 2004-09-20 Akim Demaille <akim@epita.fr>
8030 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
8031 clearer criterion to define it.
8032 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
8033 When reducing on an empty RHS, use the latest stacked location as
8035 yylloc is not always available.
8036 * data/glr.c: Likewise.
8037 Also, honor initial-actions.
8039 2004-09-20 Akim Demaille <akim@epita.fr>
8041 * data/yacc.c (YY_LOCATION_PRINT): New.
8042 Define when we know YYLTYPE's structure, i.e., when the default
8043 YYLLOC_DEFAULT is used.
8044 * data/c.m4 (b4_yysymprint_generate): Use it.
8045 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
8046 value of the result.
8047 (error_start_): Replace with...
8048 (error_range_): this location array.
8049 This allows to replace code relying on the implementation of
8050 locations by portable code.
8051 * data/yacc.c (yylerrsp): Replace with...
8052 (yyerror_range): this.
8053 Every time a token is popped, update yyerror_range[0], to have an
8054 accurate location for the error token.
8055 * data/glr.c (YY_LOCATION_PRINT): New.
8056 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
8057 deference a pointer.
8058 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
8059 report the location in %printers.
8061 * src/scan-skel.l: Instead of abort, report error messages to ease
8062 understanding skeleton scanning failures.
8064 2004-09-16 Akim Demaille <akim@epita.fr>
8066 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
8067 (iterator, const_iterator): these, to be more in the C++ spirit.
8068 Also, return reverse iterators so that when displaying the stack
8069 we display its bottom first.
8070 (Parser::stack_print_, Parser::reduce_print_): Match the messages
8072 We should probably use vector here though.
8074 2004-09-16 Akim Demaille <akim@epita.fr>
8076 Have more complete shift traces.
8078 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
8079 to report Shifts instead of ad hoc YYDPRINTF invocations,
8080 including for the error token.
8081 * data/lalr1.cc (symprint_): Output the location.
8082 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
8083 output the location within the %printer.
8084 Activate GLR tests, at least to make sure they compile properly.
8085 They still don't pass though.
8086 * tests/calc.at: Adjust expect verbose output, since now "Entering
8087 state..." is on a different line than the "Shifting" message.
8089 2004-09-08 Akim Demaille <akim@epita.fr>
8091 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
8092 Bison directive from the Bison file to the invocation of this
8093 macro, so that these directives are passed to
8094 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
8095 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
8096 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
8097 the extra Bison directives instead of the whole series.
8098 Change the grammar so that there are recoverable errors, and
8099 unrecoverable errors. Now we can have the parser give up before
8100 consuming the whole input. As a result we now can observe that
8101 the lookahead is freed when needed.
8102 Change the parser source to parse argv[1] instead of a hard coded
8104 Simplify yylex, and give a value and location to EOF.
8105 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
8106 passed directives already coded in the file.
8107 Add some tests to check the location of "error".
8108 For some tests, the C++ parser is correct, and not yacc.c.
8109 For other tests, they provide different, but unsatisfying, values,
8110 so keep the C++ value so that at least one parser is "correct"
8111 according to the test suite.
8112 (Actions after errors): Remove, this is subsumed by the
8113 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
8115 2004-09-06 Akim Demaille <akim@epita.fr>
8117 * data/lalr1.cc: Adjust the indentation of the labels.
8121 2004-09-06 Akim Demaille <akim@epita.fr>
8123 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
8124 argument, an informative message.
8125 Call YY_SYMBOL_PRINT.
8126 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
8127 * data/lalr1.cc (destruct_): Likewise.
8128 In addition, no longer depend on b4_yysymprint_generate and
8129 b4_yydestruct_generate to generate these functions, do it "by
8132 2004-09-03 Akim Demaille <akim@epita.fr>
8134 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
8135 invoked, yydestruct the lookahead.
8136 * tests/calc.at (Calculator $1): Update the expected lengths of
8137 traces: there is an added line for the discarded lookahead.
8138 * doc/bison.texinfo (Destructor Decl): Some rewording.
8139 Define "discarded" symbols.
8141 2004-09-02 Akim Demaille <akim@epita.fr>
8143 * data/lalr1.cc (translate_, destruct_): No reason to be static.
8145 2004-09-02 Akim Demaille <akim@epita.fr>
8147 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
8148 (YYDSYMPRINTF): Rename as...
8149 (YY_SYMBOL_PRINT): this.
8150 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
8152 Use it instead of direct symprint_ calls.
8153 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
8156 2004-09-02 Akim Demaille <akim@epita.fr>
8158 * data/lalr1.cc (b4_yysymprint_generate): New.
8159 (symprint_): New member function, defined when YYDEBUG.
8160 Use it consistently instead of token/nterm debugging output by
8162 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
8163 %printer calls to use cdebug_ when using lalr1.cc.
8165 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
8167 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
8168 with #ifdef YYDEBUG.
8170 2004-08-26 Akim Demaille <akim@epita.fr>
8172 * doc/bison.texinfo (Implementing Loops): Rename as...
8173 (Implementing Gotos/Loops): this.
8175 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
8177 Adjust to latest gnulib.
8178 * bootstrap (gnulib_modules): Add xalloc-die.
8179 Set LC_ALL=C so that file names sort consistently.
8180 Prefer the gnulib copies of gettext.m4, glibc21.m4,
8181 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
8182 uintmax_t.m4, ulonglong.m4.
8183 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
8184 po.m4 since we are now using _gl.m4 instead.
8186 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
8188 * src/scan-action.l: Remove. Scanning of semantic actions is
8189 handled in scan-gram.l.
8191 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
8193 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
8195 * src/location.h (struct): The file member is a uniqstr.
8196 (equal_boundaries): Use UNIQSTR_EQ for comparison.
8198 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
8200 Fix bug with non-%union parsers that have printers or destructors,
8201 which led to a Bison core dump. Reported by Peter Fales in
8202 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
8204 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
8205 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
8206 not to our own type.
8207 * src/output.c (symbol_destructors_output, symbol_printers_output):
8208 Don't assume %union.
8209 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
8210 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
8211 UNION-FLAG. All callers changed.
8212 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
8213 Use type char, not unsigned int, when declaring an array of char;
8214 this lets us remove a cast.
8215 (Printers and Destructors): Add non-%union test cases.
8217 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8219 * doc/bison.texinfo: Minor editorial changes, mostly to the new
8220 GLR writeups. E.g., avoid frenchspacing and the future tense,
8221 change "lookahead" to "look-ahead", and change "wrt" to "with
8224 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8226 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
8227 New sections, split off from the GLR Parsers section. Put the new
8228 Simple GLR Parser near the start of the GLR section, for clarity.
8229 Rewrite connective text.
8231 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
8233 * doc/bison.texinfo (Simple GLR Parsers): New section.
8235 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8237 * NEWS, TODO, doc/bison.texinfo:
8238 Use "look-ahead" instead of "lookahead", to be consistent.
8239 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
8240 while we're fixing "look-ahead".
8241 * src/conflicts.c (shift_set): Renamed from shiftset.
8242 (look_ahead_set): Renamed from lookaheadset.
8243 * src/print.c: Likewise.
8244 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
8245 name for "lookahead".
8246 (report_types, usage): Likewise.
8247 * src/getargs.h (report_look_ahead_tokens): Renamed from
8249 * src/lalr.c (compute_look_ahead_tokens): Renamed from
8251 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
8252 (look_ahead_tokens_print): Renamed from lookaheads_print.
8253 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
8254 state_rule_lookaheads_print.
8255 * src/state.h: Likewise.
8256 (reductions.look_ahead_tokens): Renamed from lookaheads.
8257 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
8258 AT_DATA_LOOKAHEADS_GRAMMAR.
8260 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
8262 * README: Update location of patched M4 distribution.
8264 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
8266 Don't assume the C++ compiler takes the same arguments as the C compiler
8268 * configure.ac (O0CXXFLAGS): New var.
8269 * tests/atlocal.in (CXXFLAGS): Use it.
8271 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
8273 Fix some "make check" problems with C++ reported by
8274 Albert Chin-A-Young for Tru64 C++ in this thread:
8275 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
8277 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
8278 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8279 Output to a .cc file for C++, not to a .c file.
8280 * tests/calc.at (AT_CHECK_CALC): Likewise.
8281 * tests/regression.at (AT_CHECK_DANCER): Likewise.
8282 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
8284 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
8286 * tests/calc.at, tests/actions.at: Workaround for SGI
8287 C++ compiler. (trivial change)
8289 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
8291 Spent a few hours checking out which prerequisite versions the
8292 current sources actually require. I went all the way back to
8293 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
8294 a seemingly endless set of combinations of versions more recent
8295 than that. The bottom line is that the current sources require
8296 fairly recent versions of the build tools, and it'll be some work
8298 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
8299 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
8300 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
8301 Add comments explaining why those particular versions are
8304 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
8305 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
8306 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
8308 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
8309 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
8311 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
8313 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
8314 0.11.5. Suggested by Bruno Haible.
8315 * bootstrap: Remove gettext version checking.
8317 * doc/bison.texinfo (Decl Summary): Also mention that %union
8318 can depend on prerequisite types. Problem reported by Tim
8321 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
8323 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
8324 * README-alpha: Don't tell people not to package this.
8326 * bootstrap: Don't assume $(...) works; use `...` instead.
8327 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
8330 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
8331 put into the -d output file, and mention what to do if YYSTYPE is
8334 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
8336 Undo change made earlier today: it caused autopoint to not bring
8337 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
8340 * bootstrap: Check that gettext version matches what's in
8341 configure.ac. Warn users to ignore robots.txt ERROR 404.
8342 * bootstrap: Undo today's earlier change (logged below).
8343 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
8345 The gettext version checking is causing more trouble than it's
8346 curing; remove it. Problem reported by Paul Hilfinger.
8348 * bootstrap: Issue a warning that one can expect a message
8349 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
8350 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
8352 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
8354 Ensure that the C++ compiler used for testing actually works on a
8355 simple test program; if not, skip the C++-related tests. Problem
8356 reported by Vin Shelton in:
8357 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
8359 * m4/cxx.m4: New file.
8360 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
8361 * tests/atlocal.in (BISON_CXX_WORKS): Add.
8362 * tests/local.at (AT_COMPILE_CXX): Use it.
8364 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8366 * data/glr.c (yylloc): Output this macro even if locations are not
8367 being generated, as the GLR parser needs it even in that case.
8368 Problem reported by Troy A. Johnson
8369 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
8371 * configure.ac (AC_INIT): Update to 1.875e.
8373 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8375 * NEWS: Version 1.875d.
8376 * configure.ac (AC_INIT): Likewise.
8377 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
8379 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
8380 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
8381 lalr1.cc runs afoul of the first, and the last two are no longer
8382 supported by GCC 3.4.0.
8383 * README: Mention GNU m4 1.4 or later; mention m4 patches.
8384 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
8386 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
8388 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
8389 unsigned int, for compatibility with latest gnulib hash module.
8390 * src/state.c (state_hash, state_hasher): Likewise.
8391 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
8392 * src/uniqstr.c (hash_uniqstr): Likewise.
8394 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
8396 * NEWS: Unescaped newlines are no longer allowed in char & strings.
8398 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
8399 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
8400 character and string literals.
8401 (unexpected_end): New function.
8402 (unexpected_eof): Use it.
8403 (unexpected_newline): New function.
8404 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
8407 * NEWS: Document %expect-rr.
8409 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
8410 Fix typo by replacing $1 with $option.
8411 Remove more 'intl'-related files.
8412 Don't DEFUN AM_INTL_SUBDIR twice.
8414 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
8415 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
8417 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
8418 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
8419 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
8420 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
8421 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
8422 * src/.cvsignore: Add *.output.
8424 * src/parse-gram.y: Put copyright notice inside %{ %} so it
8425 gets copied to the output file.
8427 2004-04-28 Paul Eggert <eggert@twinsun.com>
8429 Get files from the gnulib and po repositories, instead of relying
8430 on them being in our CVS. Upgrade to latest versions of gnulib
8433 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
8434 * bootstrap: Bootstrap from gnulib and po repositories.
8435 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
8436 * README-cvs: Document these changes. Remove version numbers from
8437 mentions of build tools, since they change so often. Mention Flex.
8439 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
8440 (gl_USE_SYSTEM_EXTENSIONS): Add.
8441 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
8442 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
8444 (AC_ISC_POSIX): Remove; we no longer support this
8445 ancient OS, as it gets in the way of latest Autoconf & gnulib.
8446 (AC_HEADER_STDC): Remove: we now assume C89 or better.
8447 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
8448 Do not check for C89 headers, except for locale.h which is used
8449 by the Yacc library and must port to K&R hosts.
8450 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
8451 Do not check for C89 functions, except for setlocale which is
8452 used by the Yacc library.
8453 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
8454 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
8455 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
8456 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
8457 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
8458 AM_GNU_GETTEXT): Remove; now done by:
8459 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
8460 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
8463 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
8464 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
8465 Define to empty, as gnulib.mk will do the rest for us.
8466 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
8468 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
8469 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
8471 * src/files.c: Include gnulib's xstrndup.h.
8473 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
8474 (REALLOC): Use xnrealloc, for likewise.
8475 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
8476 (strnlen, memrchr): Remove decls; functions no longer used.
8479 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
8480 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
8481 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
8482 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
8483 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
8484 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
8485 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
8486 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
8487 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
8488 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
8489 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
8490 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8491 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
8492 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
8493 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
8494 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
8495 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
8496 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
8497 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
8498 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
8499 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
8500 Remove, as these files are now generated automatically
8501 by bootstrap or automake.
8503 * po/ChangeLog: Remove: all but one entry was a duplicate
8504 of this file, and I moved that 2000-11-02 entry here.
8506 * config/.cvsignore: Add Makefile, depcomp, install-sh.
8507 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
8508 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
8509 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
8510 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
8511 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
8512 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
8513 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
8514 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
8515 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
8516 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
8518 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
8519 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
8520 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
8521 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
8522 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
8523 * src/.cvsignore: Remove *_.c.
8526 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
8527 support it. (The latest stable gzip doesn't.)
8529 2004-04-27 Paul Eggert <eggert@twinsun.com>
8531 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
8532 case, as stos_ is now used by destructors due to the 2004-02-09
8535 Remove more K&R C support.
8536 * lib/libiberty.y (PARAMS): Remove. All uses removed.
8537 * lib/subpipe.c (errno): Remove decl.
8538 Include <stdlib.h> unconditionally.
8539 (EXIT_FAILURE): Remove macro.
8540 * src/complain.c (vfprintf, strerror): Remove.
8541 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
8543 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
8544 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
8545 (strchr, strspn, memchr): Remove decls.
8546 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
8547 unconditionally. Do not declare perror.
8548 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
8551 * src/complain.c (_): Remove useless defn, as system.h defines this.
8553 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
8554 with latest obstack.h.
8555 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
8556 to procedure types, as obstack.h now does that for us.
8557 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
8559 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
8560 so that this include file can stand alone.
8561 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
8562 does this now. Include subpipe.h first after config.h, to
8563 test whether it can stand alone.
8565 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
8566 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
8569 * tests/synclines.at (%union synch line): Put a dummy member in
8570 the union, because empty unions aren't allowed in C. Caught
8573 2004-04-13 Jim Meyering <jim@meyering.net>
8575 * src/conflicts.c (conflicts_print): Correct format string typo:
8576 use `%%' to produce literal `%'. (trivial change)
8578 2004-03-30 Paul Eggert <eggert@twinsun.com>
8580 * src/getargs.c (version): Update copyright year to 2004.
8582 * data/c.m4 (b4_int_type): Use 'short int' rather than
8583 'short', and similarly for 'long', 'unsigned', etc.
8584 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
8585 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
8586 yy_yypstack, yydumpstack): Likewise.
8587 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
8588 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
8590 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
8591 yy_stack_print, yyparse): Likewise.
8592 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
8593 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
8594 * lib/bitset.c (bitset_print): Likewise.
8595 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
8596 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8597 * lib/bitsetv.c (bitsetv_dump): Likewise.
8598 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
8599 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
8601 * src/LR0.c (allocate_itemsets): Likewise.
8602 * src/gram.h (rule_number, rule): Likewise.
8603 * src/lalr.h (goto_number): Likewise.
8604 * src/nullable.c (nullable_compute): Likewise.
8605 * src/output.c (prepare_rules): Likewise.
8606 * src/relation.c (relation_print, relation_digraph): Likewise.
8607 * src/relation.h (relation_node): Likewise.
8608 * src/state.h (state_number, transitions, errs, reductions,
8609 struct state): Likewise.
8610 * src/symtab.h (symbol_number, struct symbol): Likewise.
8611 * src/tables.c (vector_number, tally, action_number,
8612 default_goto, goto_actions): Likewise.
8613 * tests/existing.at (GNU Cim Grammar): Likewise.
8614 * tests/regression.at (Web2c Actions): Likewise.
8616 * src/output.c (muscle_insert_short_int_table): Renamed from
8617 muscle_insert_short_table. All uses changed.
8619 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8621 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
8622 (declaration): Replace expected_conflicts with expected_sr_conflicts.
8623 Add %expect-rr rule.
8625 * src/scan-gram.l: Recognize %expect-rr.
8627 * src/conflicts.h (expected_sr_conflicts): Rename from
8629 (expected_rr_conflicts): Declare.
8631 * src/conflicts.c (expected_sr_conflicts): Rename from
8633 (expected_rr_conflicts): Define.
8634 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
8636 Use expected_sr_conflicts in place of expected_conflicts.
8637 Warn if expected_rr_conflicts used in non-GLR parser.
8639 * doc/bison.texinfo: Add documentation for %expect-rr.
8641 2004-03-08 Paul Eggert <eggert@gnu.org>
8643 Add support for hex token numbers. Suggested by Odd Arild Olsen in
8644 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
8646 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
8648 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
8649 * src/scan-gram.l (scan_integer): New function.
8651 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
8652 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
8653 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
8654 Say "long int", not "long", for uniformity with GNU style.
8656 2004-02-25 Paul Eggert <eggert@twinsun.com>
8658 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
8659 compilers. This fixes a problem with Intel's C++ compiler being
8660 chatty, reported by Guido Trentalancia in
8661 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
8663 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
8665 Support %destructor and merge error locations in lalr1.cc.
8667 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
8668 (Parser::stos_): Define unconditionally.
8669 (Parser::destruct_): New method. Generate its body with
8670 b4_yydestruct_generate.
8671 (Parser::error_start_): New attribute.
8672 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
8673 token which are discarded.
8674 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
8675 error_start_ when erroneous token are discarded.
8676 (Parser::parse) <yyerrlab1>: Compute the location of the error
8677 token so that it covers all the discarded tokens.
8678 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
8679 it can be called with `%skeleton "lalr1.cc"', and do that.
8681 2004-02-02 Paul Eggert <eggert@twinsun.com>
8683 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
8684 $(top_srcdir)/lib and ../lib. This fixes a bug reported
8685 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
8686 There's no need to mention top_builddir since Automake does that
8688 (INCLUDES): Remove, as Automake says it's obsolescent.
8689 Contents migrated into AM_CPPFLAGS as described above.
8690 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
8692 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8694 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
8695 (yyreportSyntaxError): Handle case where lookahead token is
8698 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8700 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
8701 resulting parsers are compilable with C++.
8703 2003-12-23 Paul Eggert <eggert@twinsun.com>
8705 * config/depcomp, config/install-sh: Sync with Automake 1.8.
8706 * src/output.c (output_skeleton): Rename local var.
8707 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
8708 Bison tokens, as this runs afoul of the 2003-10-07 change that
8709 disallowed NUL bytes in character constants or string literals.
8711 * tests/local.at: Require Autoconf 2.59's Autotest.
8712 * tests/testsuite.at: Don't include local.at, since we now assume
8713 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
8715 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
8716 multiple inclusion warnings.
8718 2003-12-02 Akim Demaille <akim@epita.fr>
8720 * doc/bison.texinfo (How Can I Reset the Parser): More about start
8724 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
8726 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
8728 2003-10-07 Paul Eggert <eggert@twinsun.com>
8730 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
8731 if testsuite doesn't exist.
8733 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
8734 literals, unfortunately.
8735 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
8736 Complain about NUL bytes in character constants or string literals.
8738 2003-10-05 Paul Eggert <eggert@twinsun.com>
8740 * NEWS: Don't document %no-default-prec, as it's still
8742 * doc/bison.texinfo: Document %no-default-prec only if
8743 the defaultprec flag is set. Normally it's not.
8745 2003-10-04 Paul Eggert <eggert@twinsun.com>
8747 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
8748 non-modifiable lvalue, instead of a modifiable one.
8749 * doc/bison.texinfo (Actions): Document that $$ can
8750 be assigned to. Do not claim that $$ and $N are
8751 array element references: user code should not rely on this.
8753 2003-10-01 Paul Eggert <eggert@twinsun.com>
8755 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
8756 (grammar_declaration): Use it.
8757 * src/scan-gram.l: New token %no-default-prec.
8758 * tests/conflicts.at: Revamp tests to use %no-default-prec.
8759 * NEWS, doc/bison.texinfo: Document the above.
8761 2003-10-01 Akim Demaille <akim@epita.fr>
8763 VCG no longer supports long_straight_phase.
8765 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
8766 * src/print_graph.c (print_graph): Adjust.
8768 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
8769 and Paul Eggert <eggert@twinsun.com>
8771 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
8772 Table of Symbols): Document %default-prec.
8773 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
8774 (grammar_declaration): Set default_prec on %default-prec.
8775 * src/scan-gram.l (%default-prec): New token.
8776 * src/reader.h (default_prec): New flag.
8777 * src/reader.c: Likewise.
8778 (packgram): Handle it.
8779 * tests/conflicts.at (%default-prec without %prec,
8780 %default-prec with %prec, %default-prec 1): New tests.
8782 2003-09-30 Paul Eggert <eggert@twinsun.com>
8784 * tests/testsuite.at: Include local.at, not input.at, fixing
8785 a typo in the 2003-08-25 patch.
8787 2003-08-27 Akim Demaille <akim@epita.fr>
8789 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
8792 2003-08-26 Akim Demaille <akim@epita.fr>
8794 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
8795 "<\#" to avoid magic from Gnus when posting parts of this script.
8797 2003-08-26 Akim Demaille <akim@epita.fr>
8799 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
8800 (Parser::parse): here.
8801 Adjust: nerrs and errstatus is now replaced by...
8802 (Parser::nerrs_, Parser::errstatus_): New.
8804 2003-08-25 Akim Demaille <akim@epita.fr>
8806 * config/announce-gen, Makefile.cfg: New.
8807 * Makefile.am: Adjust.
8808 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
8809 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
8811 2003-08-25 Akim Demaille <akim@epita.fr>
8813 When reducing initial empty rules, Bison parser read an initial
8814 location that is not defined. This results in garbage, and that
8815 affects Bison's own parser. Therefore we need (i) to extend Bison
8816 to support a means to initialize this location, and (ii) to use
8817 this CVS Bison to fix CVS Bison's parser.
8819 * src/reader.h, reader.c (epilogue_augment): Remove, replace
8821 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
8822 * src/parse-gram.y: Adjust.
8823 (%initial-action): New.
8824 (%error-verbose): Since we require CVS Bison, there is no reason
8826 * src/scan-gram.l: Adjust.
8827 * src/Makefile.am (YACC): New, to make sure we use our own parser.
8828 * data/yacc.c (yyparse): Use b4_initial_action.
8830 2003-08-25 Akim Demaille <akim@epita.fr>
8832 * doc/bison.texinfo: Don't promote stdout for error messages.
8834 2003-08-25 Akim Demaille <akim@epita.fr>
8836 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
8837 From Alexandre Duret-Lutz.
8839 2003-08-25 Akim Demaille <akim@epita.fr>
8843 2003-08-25 Akim Demaille <akim@epita.fr>
8845 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
8848 2003-08-25 Akim Demaille <akim@epita.fr>
8850 * data/lalr1.cc (Parser::reduce_print_): New.
8853 2003-08-25 Akim Demaille <akim@epita.fr>
8855 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
8856 error recovery loops. This patch is based on
8857 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
8858 Also, augment the similarity between lalr1.cc and yacc.c.
8859 Note: the locations of error recovery rules are not correct yet.
8861 * data/lalr1.cc: Comment changes to augment the similarity between
8862 lalr1.cc and yacc.c.
8863 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
8864 (yyerrlab1): Remove, but where it used to be (now the bottom part of
8865 yyerrlab), when hitting EOF, pop the whole stack here instead of
8866 merely falling thru the default error handling mechanism.
8867 (yyerrorlab): New label, with the old contents of YYERROR,
8868 plus the following change: pop the stack of rhs corresponding
8869 to the production that invoked YYERROR. That is how Yacc
8870 behaves (required by POSIX).
8871 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
8874 2003-08-25 Akim Demaille <akim@epita.fr>
8876 Tune local.at so that people can "autom4te -l autotest calc.at -o
8877 calc" for instance, to extract a sub test suite.
8879 * tests/testsuite.at: Move the initialization, Autotest version
8880 requirement, and AT_TESTED invocation into...
8881 * tests/local.at: here.
8882 * tests/testsuite.at: Include it for compatibility with Autoconf
8884 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
8887 2003-08-04 Paul Eggert <eggert@twinsun.com>
8889 Rework code slightly to avoid gcc -Wtraditional warnings.
8890 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
8891 The returned value is now stored in *YY0. All callers changed.
8892 * src/output.c (merge_output): Adjust to the above change.
8894 2003-07-26 Paul Eggert <eggert@twinsun.com>
8896 * data/glr.c (YYASSERT): New macro.
8897 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
8898 yyresolveStates, yyprocessOneStack):
8899 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
8900 Derived from a suggestion by Frank Heckenbach.
8902 2003-07-25 Paul Eggert <eggert@twinsun.com>
8904 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
8905 for portability to K&R C (after ansi2knr, presumably). See
8906 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
8907 by Frank Heckenbach, though I have omitted the structure-initialization
8908 part of his glr-knr.diff patch since I recall that the Portable
8909 C Compiler didn't require that change.
8911 Let the user specify how to allocate and free memory.
8912 Derived from a suggestion by Frank Heckenbach in
8913 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
8914 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
8915 All uses of free, malloc, realloc changed to use these macros,
8916 and unnecessary casts removed.
8917 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
8919 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
8921 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
8922 use s.empty() rather than s == "" to test for empty string; see
8923 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
8926 2003-06-25 Akim Demaille <akim@epita.fr>
8928 * config/depcomp, config/install-sh: Update from masters.
8930 2003-06-20 Paul Eggert <eggert@twinsun.com>
8932 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
8933 and return properly parenthesized result.
8934 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
8935 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8936 Remove unnecessary parentheses from uses.
8937 * doc/bison.texinfo (Location Default Action): Describe the
8938 conventions for parentheses.
8940 2003-06-19 Paul Eggert <eggert@twinsun.com>
8942 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
8943 yyreportTree): Do not assume that size_t is the same width as int,
8944 when printing sizes. Print sizes using an unsigned format.
8945 Problem reported by Frank Heckenbach in
8946 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
8948 Port to Forte Developer 7 C compiler.
8949 * data/glr.c (struct YYLTYPE): If locations are not being used,
8950 declare a single dummy member, as empty structs do not conform
8952 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
8953 the Forte Developer 7 C compiler complains that end-of-loop
8954 code is not reached.
8956 2003-06-17 Paul Eggert <eggert@twinsun.com>
8958 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
8959 avoid warnings from picky compilers about redefinition of PARAMS.
8961 2003-06-17 Paul Eggert <eggert@twinsun.com>
8965 * NEWS: Document 1.875b.
8967 * lib/bbitset.h: Do not include config.h; that's the includer's job.
8968 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
8969 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
8970 Don't use 'index' in comments, as it's a builtin fn on some hosts.
8971 * lib/bitset_stats.c: Include gettext.h unconditionally, as
8972 per recent gettext manual's suggestion.
8973 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
8974 Use prototypes, not old-style definitions.
8975 * lib/lbitset.c (lbitset_unused_clear): Likewise.
8976 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
8977 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
8978 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
8979 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
8980 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
8981 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
8982 vbitset_or_and_cmp, vbitset_copy): Likewise.
8984 * lib/libiberty.h: Do not include config.h; that's the includer's job.
8985 Do not include <stdlib.h>.
8986 (PARAMS): Define unconditionally for C89.
8987 (ATTRIBUTE_NORETURN): Remove.
8988 (ATTRIBUTE_UNUSED): Define unconditionally.
8990 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
8991 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8992 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
8993 * lib/vbitset.c, lib/vbitset.h: New files.
8994 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
8995 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
8998 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
8999 `How Can I Reset @code{yyparse}', since texinfo does not allow
9000 arbitrary @ in node names.
9002 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
9003 shouldn't be needed according to the gettext 0.12.1 documentation
9004 but which seem to be needed anyway: codeset.m4 glibc21.m4
9005 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
9006 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
9007 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
9009 * lib/.cvsignore: Add stdbool.h.
9010 * m4/.cvsignore: Add nls.m4, po.m4.
9012 Upgrade to CVS gnulib.
9013 * stdbool_.h: File renamed from stdbool.h.in.
9014 * configure.ac (AM_STDBOOL_H): Invoke this instead of
9016 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
9017 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
9018 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
9019 (MOSTLYCLEANFILES): New var.
9020 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
9021 (stdbool.h): New rule.
9022 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
9023 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
9024 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
9025 m4/quote.m4: Upgrade to today's gnulib.
9027 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
9028 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
9029 the tests right now.
9030 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
9031 yyerror are declared before use; C99 requires this.
9033 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9035 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
9037 (yyrecoverSyntaxError): Correct the logic for setting and testing
9039 Correct comment on handling EOF.
9040 Allow states with only a default reduction, rather than failing
9041 (I can't quite reconstruct why these were not allowed before).
9043 Fixes to avoid problem that $-N rules in GLR parsers can cause
9044 buffer overruns, corrupting state.
9046 * src/output.c (prepare_rules): Output max_left_semantic_context
9048 * src/reader.h (max_left_semantic_context): New variable declaration.
9049 * src/scan-gram.l (max_left_semantic_context): Define.
9050 (handle_action_dollar): Update max_left_semantic_context.
9051 * data/glr.c (YYMAXLEFT): New definition.
9052 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
9053 (yyresolveAction): Ditto.
9055 Fixes to problems with location handling in GLR parsers reported by
9056 Frank Heckenbach (2003/06/05).
9058 * data/glr.c (YYLTYPE): Make trivial if locations not used.
9059 (YYRHSLOC): Add parentheses, and define only if locations used.
9060 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
9062 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
9063 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
9065 * tests/cxx-type.at: Exercise location information; update tests
9066 to differentiate output with and without locations.
9067 Remove forward declarations of yylex and yyerror---caused errors
9068 because default YYLTYPE not yet defined.
9069 Change semantic actions to compute strings, rather than printing
9070 them directly (to test proper passing of semantics values). Change
9071 output to prefix notation and update test data and expected results.
9072 (yylex): Track locations.
9073 (stmtMerge): Return value rather than printing, and include arguments
9076 2003-06-03 Paul Eggert <eggert@twinsun.com>
9078 Avoid warnings generated by GCC 2.95.4 when Bison is
9079 configured with --enable-gcc-warnings.
9080 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
9081 yy::]b4_parser_class_name[::translate_,
9082 yy::Stack::operator[] (unsigned),
9083 yy::Stack::operator[] (unsigned) const,
9084 yy::Slice::operator[] (unsigned),
9085 yy::Slice::operator[] (unsigned) const):
9086 Rename local vars to avoid warnings.
9087 * tests/glr-regression.at (Improper handling of embedded actions
9088 and $-N in GLR parsers): Remove unused local variable from yylex.
9089 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
9090 (void) as arg when not pure, since we now assume C89 when building
9091 Bison. Pacify GCC by using parameter.
9093 2003-06-02 Paul Eggert <eggert@twinsun.com>
9095 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
9096 yy::Location::lines, yy::Location::columns): Rename arguments
9097 to avoid shadowing; this removes a warning generated by GCC 3.3.
9099 2003-06-01 Paul Eggert <eggert@twinsun.com>
9101 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
9102 to g++, as GCC 3.3 complains if you do it.
9103 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
9104 everything that WARNING_CFLAGS has, except omit warnings
9105 not suitable for C++.
9106 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
9107 * tests/atlocal.in (CXXFLAGS): New var.
9108 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
9110 Fix a GLR parser bug I reported in February; see
9111 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
9112 The problem was that GLR parsers did not conform to the C standard,
9113 because actions like { $1 = $2 + $3; } expanded to expressions
9114 that invoked YYFILL in separate subexpressions, and YYFILL assigned
9115 to a local variable. The C standard says that expressions
9116 like (var = f ()) + (var = f ()) have undefined behavior.
9117 Another problem was that GCC sometimes issues warnings that
9118 yyfill and its parameters are unused.
9120 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
9122 (yyfill): New function.
9124 (yyuserAction): Change type of yynormal to bool, so that it matches
9125 the new yyfill signature. Mark it as possibly unused.
9128 Follow up on a bug I reported in February, where a Bison-generated
9129 parser can loop. Provide a test case and a fix for yacc.c. I
9130 don't have a fix for lalr1.cc or for glr.c, unfortunately.
9131 The original bug report is in:
9132 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
9134 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
9135 macro's size was becoming unwieldy.
9136 (yyerrlab): Do not discard an empty lookahead symbol, as this
9137 might destroy garbage.
9138 (yyerrorlab): New label, with the old contents of YYERROR,
9139 plus the following change: pop the stack of rhs corresponding
9140 to the production that invoked YYERROR. That is how Yacc
9141 behaves, and POSIX requires this behavior.
9142 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
9143 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
9144 Define 'alarm' to do nothing if unistd.h is not available.
9145 Add a new rule "exp: '-' error;" to test the above change to
9146 data/yacc.c. Use 'alarm' to abort any test taking longer than
9147 10 seconds, as it's probably looping.
9148 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
9149 Also, the new yacc.c generates two fewer diagnostics for an
9152 2003-05-24 Paul Eggert <eggert@twinsun.com>
9154 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
9155 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
9156 This fixes a problem reported by John Bowman when the Compaq/HP
9157 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
9159 * data/yacc.c (union yyalloc): Likewise.
9160 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
9162 Switch from 'int' to 'bool' where that makes sense.
9164 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
9165 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
9166 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
9167 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
9168 Return or accept bool, not int. All callers changed.
9169 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
9170 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
9171 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
9172 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
9173 bitset_or_and_cmp_): Likewise.
9174 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
9175 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
9176 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
9177 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
9178 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
9179 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
9180 bitset_stats_or_and_cmp): Likewise.
9181 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
9182 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
9183 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
9184 ebitset_xor_cmp): Likewise.
9185 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
9186 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
9187 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
9188 lbitset_xor_cmp): Likewise.
9189 * lib/bbitset.h: Include <stdbool.h>.
9190 (struct bitset_vtable): The following members now return bool, not
9191 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
9192 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
9194 * src/conflicts.c (count_rr_conflicts): Likewise.
9195 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
9197 * lib/ebitset.c (ebitset_obstack_init): Likewise.
9198 * lib/lbitset.c (lbitset_obstack_init): Likewise.
9199 * src/getargs.c (debug_flag, defines_flag, locations_flag,
9200 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9201 graph_flag): Likewise.
9202 * src/getargs.h (debug_flag, defines_flag, locations_flag,
9203 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9204 graph_flag): Likewise.
9205 * src/output.c (error_verbose): Likewise.
9206 * src/output.h (error_verbose): Likewise.
9207 * src/reader.c (start_flag, typed): Likewise.
9208 * src/reader.h (typed): Likewise.
9209 * src/getargs.c (LOCATIONS_OPTION): New constant.
9210 (long_options, getargs): Use it.
9211 * src/lalr.c (build_relations): Use bool, not int.
9212 * src/nullable.c (nullable_compute): Likewise.
9213 * src/print.c (print_reductions): Likewise.
9214 * src/tables.c (action_row, pack_vector): Likewise.
9215 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
9216 * src/output.c (prepare): Use it.
9217 * src/output.c (token_definitions_output,
9218 symbol_destructors_output, symbol_destructors_output): Use string,
9219 not boolean integer, to keep track of whether to output separator.
9220 * src/print_graph.c (print_core): Likewise.
9221 * src/state.c (state_rule_lookaheads_print): Likewise.
9223 * config/install-sh: Sync from automake 1.7.5.
9225 2003-05-14 Paul Eggert <eggert@twinsun.com>
9227 * src/parse-gram.y (rules_or_grammar_declaration): Require a
9228 semicolon after a grammar declaration, in the interest of possible
9229 future changes to the Bison input language.
9230 Do not allow a stray semicolon at the start of the grammar.
9231 (rhses.1): Allow one or more semicolons after any rule, including
9232 just before "|" as required by POSIX.
9233 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
9236 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
9238 %parse-param support for lalr1.cc.
9240 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
9241 b4_cc_constructor_calls, b4_cc_constructor_call,
9242 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
9244 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
9245 parse-param arguments.
9246 (yy::b4_parser_class_name): Declare instance variables to
9247 hold parse-param arguments.
9248 * tests/calc.at: s/value/semantic_value/ because value clashes
9249 with a member of yy::b4_parser_class_name. Adjust C++ code
9250 to handle %parse-param. Enable %parse-param test in C++.
9252 2003-05-12 Paul Eggert <eggert@twinsun.com>
9254 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
9255 English a bit. Fix fclose typo. Change "const char" to "char
9256 const", and use ANSI C rather than K&R for "main". Suggest
9257 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
9258 and suggest yy_switch_to_buffer.
9260 2003-05-05 Paul Eggert <eggert@twinsun.com>
9262 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
9263 C89. This avoids a diagnostic on compilers that define __STDC__
9264 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
9265 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
9267 2003-05-03 Paul Eggert <eggert@twinsun.com>
9269 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
9270 Do not overrun array bounds.
9271 This should fix a bug reported today by Olatunji Oluwabukunmi in
9272 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
9274 2003-04-29 Akim Demaille <akim@epita.fr>
9276 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
9277 * src/getargs.c, src/getargs.h: here, as bool, not int.
9278 (nondeterministic_parser): New.
9279 * src/parse-gram.y, src/scan-gram.l: Support
9280 %nondeterministic-parser.
9281 * src/output.c (prepare): Use nondeterministic_parser instead
9282 of glr_parser where appropriate.
9283 * src/tables.c (conflict_row, action_row, save_row)
9284 (token_actions, token_actions, pack_vector): Ditto.
9286 2003-04-29 Akim Demaille <akim@epita.fr>
9288 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
9290 2003-04-29 Akim Demaille <akim@epita.fr>
9292 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
9293 with %pure-parser and %locations to exercise the patch from Yakov
9296 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
9298 * data/yacc.c: (b4_lex_param): Corrected for the case where
9299 %lex-param is provided and %pure-parser isn't.
9301 2003-04-27 Paul Eggert <eggert@twinsun.com>
9303 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
9304 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
9305 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
9306 if it is not defined.
9307 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
9309 2003-04-26 Paul Eggert <eggert@twinsun.com>
9311 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
9312 Declare to be of type suitable for the ninf value itself, not of
9313 type suitable for the corresponding table, since the latter might
9314 be unsigned but the ninf value might be negative. This fixes a
9315 bug reported by Alexandre Duret-Lutz in
9316 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
9318 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
9319 invokes it. We shouldn't invoke it twice because it will attempt
9320 to put error.o in the archive twice. This fixes a glitch reported
9321 by Martin Mokrejs in
9322 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
9324 2003-04-21 Paul Eggert <eggert@twinsun.com>
9326 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
9329 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
9331 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
9332 Fix obvious typo that results in uncompilable GLR parsers
9333 when both %pure-parser and %locations are used. (trivial change)
9335 2003-04-17 Paul Eggert <eggert@twinsun.com>
9337 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
9338 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
9339 Do not insert the expected token via unput, as this runs afoul
9340 of a POSIX-compatibility bug in flex 2.5.31.
9341 All uses changed to BEGIN the parent state,
9342 since we no longer insert the expected token via unput.
9343 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
9344 that is no longer emitted after the above change.
9346 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
9347 the first one. This change is from Paul Hilfinger, and it fixes
9348 regression reported by Werner Lemberg in
9349 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
9351 (resolve_sr_conflict): Don't invoke state_errs_set
9352 unless one or more tokens have been explicitly made errors.
9353 Otherwise, the above change causes Bison to abort.
9355 * tests/existing.at (GNU pic Grammar): New test case, taken from
9358 2003-03-31 Akim Demaille <akim@epita.fr>
9360 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
9362 2003-03-31 Akim Demaille <akim@epita.fr>
9364 * src/output.c (prepare_symbols): Avoid trailing spaces in the
9367 2003-03-31 Akim Demaille <akim@epita.fr>
9369 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
9370 From Paul Hilfinger.
9372 2003-03-29 Akim Demaille <akim@epita.fr>
9374 * m4/error.m4: Do not put under dynamic conditions some code which
9375 expansion is under static control.
9377 2003-03-29 Akim Demaille <akim@epita.fr>
9379 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
9381 2003-03-29 Akim Demaille <akim@epita.fr>
9383 * doc/bison.texinfo (Strings are Destroyed): New.
9385 2003-03-13 Paul Eggert <eggert@twinsun.com>
9387 * .cvsignore: Add configure.lineno.
9388 * src/.cvsignore: Add yacc.
9389 * tests/.cvsignore: Add testsuite.log.
9390 * doc/fdl.texi: Sync with latest FSF version.
9392 2003-03-12 Paul Eggert <eggert@twinsun.com>
9394 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
9395 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
9396 cursor, instead of leaving it undefined. This fixes a bug
9397 reported by Tim Van Holder in
9398 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
9399 * tests/input.at (Torturing the Scanner): Test the scanner on
9400 an empty input file, which was Tim Van Holder's test case.
9402 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
9403 <sys/resource.h> can be included, include sys/time.h and
9404 sys/times.h first, if available. This works around the SunOS
9405 4.1.4 porting bug reported by Bruce Becker in
9406 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
9408 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
9409 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
9412 Merge changes from gnulib. This was prompted because the CVS
9413 snapshot didn't build on Solaris 7 due to strnlen problems.
9415 These changes need to be merged back into gnulib:
9416 * lib/hash.c: Include <stdbool.h> unconditionally.
9417 * m4/onceonly.m4 (m4_quote): New macro.
9418 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
9419 Quote AC_FOREACH variable-expansions properly.
9420 The 2003-01-03 obstack.h change also needs merging.
9421 {end of changes requiring merging}
9423 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
9424 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
9425 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
9426 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
9427 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
9428 New files, imported from gnulib.
9429 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
9432 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
9433 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
9436 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
9438 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
9439 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
9440 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
9441 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
9442 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
9443 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
9444 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
9445 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
9446 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
9447 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
9448 (jm_PREREQ_ARGMATCH): Remove.
9449 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
9450 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
9452 * src/system.h: Include <stdbool.h> unconditionally.
9454 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
9455 assuming at least C89 in the bitset code for some time now.
9457 2003-03-03 Akim Demaille <akim@epita.fr>
9461 2003-03-02 Akim Demaille <akim@epita.fr>
9463 * doc/bison.texinfo (Table of Symbols): Reactivate the
9464 documentation for %lex-param, and %parse-param.
9466 2003-03-02 Akim Demaille <akim@epita.fr>
9468 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
9469 generate verbose error messages.
9470 Use the number of tokens as an upper bound in yytname, as it
9471 cannot be a non terminal.
9473 2003-03-02 Akim Demaille <akim@epita.fr>
9475 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
9478 2003-03-02 Akim Demaille <akim@epita.fr>
9480 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
9481 Use them to exercise yycheck overrun.
9482 Based on Andrew Suffield's grammar.
9484 2003-03-02 Akim Demaille <akim@epita.fr>
9486 Create tests/local.at for Bison generic testing macros.
9488 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
9489 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
9491 * tests/calc.at (AT_CHECK_CALC): Adjust.
9492 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
9493 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
9494 * tests/local.at: here.
9495 (AT_COMPILE_CXX): Tags the tests using it as c++.
9496 Ignore the test if CXX is not functional.
9498 2003-03-01 Paul Eggert <eggert@twinsun.com>
9500 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
9501 not loc->end, since loc->end might contain garbage and this leads
9502 to undefined behavior on some platforms.
9503 (id_loc, token_start): Use (IF_LINTed) initial values that do not
9504 depend on *loc, so that the reader doesn't give the the false
9505 impression that *loc is initialized.
9506 (<INITIAL>"%%"): Do not bother setting code_start, since its value
9507 does not survive the return.
9509 2003-03-01 Akim Demaille <akim@epita.fr>
9511 * src/scan-gram.l (code_start): Always initialize it when entering
9512 into yylex, as SC_EPILOGUE is activated *before* the corresponding
9513 yylex invocation. An alternative would be making it static, but
9514 then it starts with the second %%'s beginning, instead of its end.
9516 2003-02-28 Paul Eggert <eggert@twinsun.com>
9518 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
9519 around a UnixWare 7.1.1 porting bug reported by John Hughes in
9520 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
9522 2003-02-26 Paul Eggert <eggert@twinsun.com>
9524 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
9525 Remove Sequent/Pyramid discussion (nobody uses them any more).
9526 Merge VMS and MS-DOS discussion; these ports may well be dead
9527 but let's keep mentioning them for now. Put <> around email
9528 addresses. Add copyright notice.
9530 2003-02-24 Paul Eggert <eggert@twinsun.com>
9532 * data/glr.c (yy_reduce_print): yylineno -> yylno,
9533 to avoid collision with flex use of yylineno.
9534 Problem reported by Bruce Lilly in
9535 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
9536 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9537 * data/yacc.c (yy_reduce_print): Likewise.
9539 * config/depcomp: Sync with Automake 1.7.3.
9541 2003-02-21 Akim Demaille <akim@epita.fr>
9543 * data/lalr1.cc: Use temporary variables instead of casts to
9544 change integer types.
9545 Suggested by Paul Eggert.
9547 2003-02-21 Akim Demaille <akim@epita.fr>
9549 * doc/bison.texinfo: Use "location" consistently to refer to @n,
9550 to avoid confusions with lalr1.cc's notion of Position.
9551 Suggested by Paul Eggert.
9553 2003-02-20 Akim Demaille <akim@epita.fr>
9555 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
9556 before initial_columns.
9557 (location.hh): Use consistent variable names when defining the
9559 Use "last" so that we subtract from Positions, not from unsigned.
9561 2003-02-20 Akim Demaille <akim@epita.fr>
9563 * data/lalr1.cc (position.hh): New subfile, including the extended
9564 and Doxygen'ed documentation of class Position.
9565 (location.hh): Use it.
9566 Document a` la Doxygen.
9567 With the help of Benoit Perrot.
9569 2003-02-20 Akim Demaille <akim@epita.fr>
9571 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
9573 Redefine AT_YYERROR_SEES_LOC_IF using it.
9574 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
9576 Don't use the location in yy::Parser::error_ and
9577 yy::Parser::print_ when not %locations.
9578 Activate more lalr1.cc tests.
9580 2003-02-19 Akim Demaille <akim@epita.fr>
9582 * data/lalr1.cc: When displaying a line number, be sure to make it
9585 2003-02-19 Akim Demaille <akim@epita.fr>
9587 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
9589 (YYABORT, YYACCEPT, YYERROR): New.
9590 * tests/calc.at: Renable the lalr1.cc test.
9592 2003-02-19 Akim Demaille <akim@epita.fr>
9594 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
9595 error recovery, mixing with/without pops and discarding of the
9598 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
9600 2003-02-17 Paul Eggert <eggert@twinsun.com>
9602 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
9603 * tests/testsuite.at (AT_COMPILE): Use them.
9604 This fixes the testsuite problem reported by Robert Lentz in
9605 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
9607 2003-02-12 Paul Eggert <eggert@twinsun.com>
9609 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
9610 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
9611 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
9612 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
9613 Check for malloc failure, for consistency with yacc.c.
9614 (yytname_size): Remove, for consistency with yacc.c.
9616 The bug still remains in data/lalr1.cc, as I didn't have time
9619 2003-02-06 Akim Demaille <akim@epita.fr>
9621 * configure.ac (GXX): Rename as...
9622 (CXX): this, to keep the original Autoconf semantics.
9624 * data/lalr1.cc: Fix b4_copyright invocations.
9625 If YYDEBUG is not defined, don't depend upon name_ being defined.
9626 (location.hh): Include string and iostream.
9627 (Position::filename): New member.
9628 (Position::Position ()): New.
9629 (operator<< (Position)): New.
9630 (operator- (Position, int)): New.
9631 (Location::first, Location::last): Rename as...
9632 (Location::begin, Location::end): these, to mock the conventional
9634 (operator<< (Location)): New.
9635 * tests/atlocal.in (CXX): New.
9636 * tests/testsuite.at (AT_COMPILE_CXX): New.
9637 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
9638 locations in a more synthetic way.
9639 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
9641 Adjust the C locations to match those from Emacs: first column is
9643 Change all the expected results.
9644 Conform to the GCS: simplify the locations when applicable.
9645 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
9646 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
9647 these CPP macros with the m4 macros new defined by...
9648 (AT_CHECK_PUSHDEFS): this, i.e.:
9649 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
9650 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
9652 (AT_CHECK_POPDEFS): Undefine them.
9653 (AT_CHECK_CALC_LALR1_CC): New.
9654 Use it for the first lalr1.cc test.
9656 2003-02-04 Akim Demaille <akim@epita.fr>
9658 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
9659 Location as is defined.
9661 2003-02-04 Akim Demaille <akim@epita.fr>
9663 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
9664 name_ being defined.
9666 2003-02-03 Paul Eggert <eggert@twinsun.com>
9668 * src/gram.h (start_symbol): Remove unused decl.
9670 Use more-consistent naming conventions for local vars.
9672 * src/derives.c (derives_compute): Change type of local var from
9674 * src/gram.c (grammar_rules_partial_print): Likewise.
9675 * src/print.c (print_core): Likewise.
9676 * src/reduce.c (reduce_grammar_tables): Likewise.
9678 * src/gram.c (grammar_dump): Change name of item_number *
9679 local var from r to rp.
9680 * src/nullable.c (nullable_compute): Likewise.
9682 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
9684 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
9685 for symbol or symbol_number var.
9686 * src/reader.c (grammar_start_symbol_set): Likewise.
9687 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
9689 * src/state.c (transitions_to): Likewise.
9690 * src/state.h: Likewise.
9691 * src/tables.c (symbol_number_to_vector_number): Likewise.
9693 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
9696 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
9699 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
9702 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
9703 Use str, not s, for char * var. Use ch, not c, for character var.
9704 Use size for size var.
9706 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
9708 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
9710 * src/uniqstr.h: Likewise.
9712 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9713 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9714 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
9715 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
9716 param to have same name as that of enum, so that we don't use
9717 "s" to stand for a non-state.
9719 2003-02-02 Akim Demaille <akim@epita.fr>
9721 * src/scan-skel.l: Scan more than one inert character per yylex
9724 2003-02-01 Paul Eggert <eggert@twinsun.com>
9728 * po/LINGUAS: Add ms.
9730 2003-01-30 Akim Demaille <akim@epita.fr>
9732 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
9734 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9736 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
9739 Changes in response to error report by S. Eken: GLR mode does not
9740 handle negative $ indices or $ indices in embedded rules correctly.
9741 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
9743 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
9744 (b4_rhs_location): Ditto.
9745 (yyfill): New function to copy from stack tree into array
9747 (yyuserAction): Modify to allow incremental move of semantic values
9748 to rhs array when in GLR mode.
9749 Define YYFILL to use in user-defined actions to fill semantic array
9751 Remove dummy use of yystack, as there is now a guaranteed use.
9752 (yydoAction): Modify to allow incremental move of semantic values
9753 to rhs array when in GLR mode.
9754 (yyresolveAction): Ditto.
9755 (yyglrShiftDefer): Update comment.
9756 (yyresolveStates): Use X == NULL for pointers, not !X.
9757 (yyglrReduce): Ditto.
9760 * tests/glr-regr1.at: Rename to ...
9761 * tests/glr-regression.at: Add new regression test for the problems
9762 described above (adapted from S. Eken).
9763 Update copyright notice.
9764 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
9765 * tests/Makefile.am: Ditto.
9767 2003-01-28 Paul Eggert <eggert@twinsun.com>
9769 * data/lalr1.cc: Do not use @output_header_name@ unless
9770 b4_defines_flag is set. This fixes two bugs reported by
9772 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
9773 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
9775 2003-01-21 Paul Eggert <eggert@twinsun.com>
9777 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
9778 we don't need to worry about yyerrlab1 being reported as an
9779 "unused label" by non-GCC C compilers. The downside is that if
9780 locations are used then a couple of statements are duplicated each
9781 time YYERROR is invoked, but the upside is that the warnings
9783 (yyerrlab1): Move code to YERROR.
9784 (yyerrlab2): Remove. Change uses back to yyerrlab1.
9785 This reverts some of the 2002-12-27 change.
9787 2003-01-17 Paul Eggert <eggert@twinsun.com>
9789 * src/output.c (symbol_printers_output): Fix typo that led
9790 to core dump. Problem reported by Antonio Rus in
9791 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
9793 2003-01-13 Akim Demaille <akim@epita.fr>,
9794 Quoc Peyrot <chojin@lrde.epita.fr>,
9795 Robert Anisko <anisko_r@lrde.epita.fr>
9797 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
9798 when the stacks contain one element, as the loop would otherwise
9799 free the last state, and then use the top state (the one we just
9800 popped). This means that the initial elements will not be freed
9801 explicitly, as is the case in yacc.c; it is not a problem, as
9802 these elements have fake values.
9804 2003-01-11 Paul Eggert <eggert@twinsun.com>
9806 * NEWS: %expect-violations are now just warnings, reverting
9807 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
9808 bootstrapping problem reported by Matthias Klose; see
9809 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
9810 * src/conflicts.c (conflicts_print): Likewise.
9811 * tests/conflicts.at (%expect not enough, %expect too much,
9812 %expect with reduce conflicts): Likewise.
9813 * doc/bison.texinfo (Expect Decl): Document this. Also mention
9814 that the warning is enabled if the number of conflicts changes
9815 (not necessarily increases).
9817 * src/getargs.c (version): Update copyright year.
9819 2003-01-09 Akim Demaille <akim@epita.fr>
9821 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
9823 2003-01-08 Paul Eggert <eggert@twinsun.com>
9825 * Makefile.maint (WGETFLAGS):
9826 New macro, containing "-C off" to disable proxy caches.
9827 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
9828 (rel-check): Use $(WGET) instead of wget.
9830 2003-01-06 Paul Eggert <eggert@twinsun.com>
9832 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
9833 the GLR paper of Scott, Johnstone and Hussain.
9835 2003-01-04 Paul Eggert <eggert@twinsun.com>
9837 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
9838 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
9839 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
9840 (EXTRA_LIBRARIES): New var, for liby.a.
9841 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
9842 (EXTRA_SCRIPTS): New var, for yacc.
9844 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
9845 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
9846 Problem reported by Nelson H. F. Beebe.
9848 2003-01-03 Paul Eggert <eggert@twinsun.com>
9850 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
9851 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
9852 when compiling Bison 1.875's `bitset bset = obstack_alloc
9853 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
9855 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
9856 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
9857 grow to a huge size with typical invocation.
9859 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
9860 Use the pattern recommended by Autoconf 2.57, except also protect
9861 against double-definition.
9862 * src/system.h: Likewise.
9863 Portability issues reported by Nelson H. F. Beebe.
9865 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
9866 All uses changed. Provide a definition in both C and C++.
9867 (yytrue, yyfalse): Define even if defined (__cplusplus).
9869 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
9870 Reported by Nelson H. F. Beebe.
9872 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
9874 2003-01-02 Paul Eggert <eggert@twinsun.com>
9876 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
9877 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
9878 Bug reported by Nelson H. F. Beebe.
9880 2003-01-01 Paul Eggert <eggert@twinsun.com>
9884 2002-12-30 Paul Eggert <eggert@twinsun.com>
9886 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
9888 (<INITIAL>","): Here. This causes stray "," to be treated
9891 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
9892 last brace in braced code when not in Yacc mode, for compatibility
9893 with Bison 1.35. This resurrects the 2001-12-15 patch to
9896 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
9897 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
9899 2002-12-28 Paul Eggert <eggert@twinsun.com>
9901 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
9902 that of SYM's type. This fixes Debian bug 168069, reported by
9905 2002-12-28 Paul Eggert <eggert@twinsun.com>
9909 Switch back to the Yacc style of conflict reports, undoing some
9910 of the 2002-07-30 change.
9911 * doc/bison.texinfo (Understanding): Use Yacc style for
9912 conflict reports. Also, use new way of locating rules.
9913 * src/conflicts.c (conflict_report):
9914 Renamed from conflict_report_yacc, removing the old
9915 'conflict_report'. Translate the entire conflict report at once,
9916 so that we don't assume that "," has the same interpretation in
9918 (conflicts_output): Use Yacc-style conflict report for each state,
9919 instead of our more-complicated style.
9920 (conflicts_print): Use Yacc-style conflict report, except print
9921 the input file name when not emulating Yacc.
9922 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
9923 Conflicted Reduction, %expect not enough, %expect too much,
9924 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
9925 * tests/existing.at (GNU Cim Grammar): Likewise.
9926 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
9928 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
9929 fatal): Don't invoke fflush; it's not needed and it might even be
9930 harmful for stdout, as stdout might not be open.
9931 * src/reduce.c (reduce_print): Likewise.
9933 2002-12-27 Paul Eggert <eggert@twinsun.com>
9935 Fix a bug where error locations were not being recorded correctly.
9936 This problem was originally reported by Paul Hilfinger in
9937 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
9939 * data/yacc.c (yyparse): New local var yylerrsp, to record the
9940 top of the location stack's error locations.
9941 (yyerrlab): Set it. When discarding a token, push its location
9942 onto yylerrsp so that we don't lose track of the error's end.
9943 (yyerrlab1): Now is only the target of YYERROR, so that we can
9944 properly record the location of the action that failed. For GCC
9945 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
9946 GCC warning about yyerrlab1 being unused if YYERROR is unused.
9947 (yyerrlab2): New label, which yyerrlab now falls through to.
9948 Compute the error's location by applying YYLLOC_DEFAULT to
9949 the locations of all the symbols that went into the error.
9950 * doc/bison.texinfo (Location Default Action): Mention that
9951 YYLLOC_DEFAULT is also invoked for syntax errors.
9952 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9953 Error locations include the locations of all the tokens that were
9954 discarded, not just the last token.
9956 2002-12-26 Paul Eggert <eggert@twinsun.com>
9958 * src/files.c: Include quote.h.
9959 (compute_output_file_names): Warn if we detect conflicting
9960 outputs to the same file. This should catch the misunderstanding
9961 exemplified by Debian Bug 165349, reported by Bruce Stephens..
9963 * src/conflicts.c (conflicts_print): If the user specifies
9964 "%expect N", report an error if there are any reduce/reduce
9965 conflicts. This is what the manual says should happen.
9966 This fixes Debian bug 130890, reported by Anthony DeRobertis.
9967 * tests/conflicts.at (%expect with reduce conflicts): New test.
9969 Don't use m4_include on relative file names, as it doesn't work as
9970 desired if there happens to be a file with that name under ".".
9972 * m4sugar/version.m4: Remove; it was included but it wasn't used.
9973 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
9974 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
9975 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
9976 * src/output.c (output_skeleton): Use full path names when
9977 specifying a file to include; don't rely on include path, as
9978 it's unreliable when the working file contains a file with
9981 2002-12-25 Paul Eggert <eggert@twinsun.com>
9983 Remove obsolete references to bison.simple and bison.hairy.
9984 Problem mentioned by Aubin Mahe in
9985 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
9986 * data/glr.c: Comment fix.
9987 * doc/bison.1: Remove references. Also, mention "yacc".
9989 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
9992 * src/parse-gram.y (declaration): Use enum "report_states" rather
9993 than its numeric value 1.
9995 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
9996 opening a new one. This fixes Debian bug 165349, reported by
9999 2002-12-24 Paul Eggert <eggert@twinsun.com>
10003 * Makefile.maint (cvs-update): Don't assume that the shell
10004 supports $(...), as Solaris sh doesn't.
10006 * src/parse-gram.y (lloc_default): Remove test for empty
10007 nonterminals at the end, since it didn't change the result.
10009 2002-12-24 Paul Eggert <eggert@twinsun.com>
10011 If the user does not define YYSTYPE as a macro, Bison now declares it
10012 using typedef instead of defining it as a macro. POSIX requires this.
10013 For consistency, YYLTYPE is also declared instead of defined.
10015 %union directives can now have a tag before the `{', e.g., the
10016 directive `%union foo {...}' now generates the C code
10017 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
10018 The default union tag is `YYSTYPE', for compatibility with Solaris 9
10019 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
10020 instead of `yyltype'.
10022 `yystype' and `yyltype' are now obsolescent macros instead of being
10023 typedefs or tags; they are no longer documented and will be
10024 withdrawn in a future release.
10026 * data/glr.c (b4_location_type): Remove.
10027 (YYSTYPE): Renamed from yystype.
10028 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
10029 (struct YYLTYPE): Renamed from struct yyltype.
10030 (YYLTYPE): Renamed from yyltype.
10031 (yyltype, yystype): New (and obsolescent) macros,
10032 for backward compatibility.
10033 * data/yacc.c: Likewise.
10035 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
10036 does not specify a union tag. This is for compatibility with
10039 * src/parse-gram.y (add_param): 2nd arg is now char * not char
10040 const *, since it is now modified by stripping surrounding { }.
10041 (current_braced_code): Remove.
10042 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
10043 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
10044 trailing " {...}". Now of type <chars>.
10045 (grammar_declaration): Adjust to bundled tokens.
10046 (code_content): Remove; stripping is now done by add_param.
10047 (print_token_value): Print contents of bundled tokens.
10048 (token_name): New function.
10050 * src/reader.h (braced_code, current_braced_code): Remove.
10051 (token_name): New decl.
10053 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
10054 token_type, not braced_code code_kind. All uses changed.
10055 (SC_PRE_CODE): New state, for scanning after a keyword that
10056 has (or usually has) an immediately-following braced code.
10057 (token_type): New local var, to keep track of which token type
10058 to return when scanning braced code.
10059 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
10060 <INITIAL>"%parse-param", <INITIAL>"%printer",
10061 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
10062 instead of returning a token type immediately.
10063 (<INITIAL>"{"): Set token type.
10064 (<SC_BRACED_CODE>"}"): Use it.
10065 (handle_action_dollar, handle_action_at): Now returns bool
10066 indicating success. Fail if ! current_rule; this prevents a core dump.
10067 (handle_symbol_code_dollar, handle_symbol_code_at):
10068 Remove; merge body into caller.
10069 (handle_dollar, handle_at): Complain in invalid contexts.
10071 * NEWS, doc/bison.texinfo: Document the above.
10072 * NEWS: Fix years and program names in copyright notice.
10074 2002-12-17 Paul Eggert <eggert@twinsun.com>
10076 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
10077 Reporting, Table of Symbols): Omit mentions of %lex-param and
10078 %parse-param from the documentation for now.
10080 2002-12-15 Paul Eggert <eggert@twinsun.com>
10082 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
10083 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
10084 lookahead symbol, and which sets yychar in parser actions) and it
10085 disagreed with the Bison documentation. Bug
10086 reported by Andrew Walrond.
10088 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
10089 as the caller now does that.
10090 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
10091 (YYEMPTY): Parenthesize right hand side, since others use it.
10092 (yyparse): Don't assume that our generated code is the only code
10095 2002-12-13 Paul Eggert <eggert@twinsun.com>
10099 POSIX requires a "yacc" command.
10100 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
10101 (MOSTLYCLEANFILES): Add yacc.
10103 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
10104 as an alias for bison y.
10106 * po/LINGUAS: Add da.
10108 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
10109 problem with latest <getopt.h>.
10110 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
10112 * doc/fdl.texi: Upgrade to 1.2.
10113 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
10114 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
10115 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
10117 * config/install-sh: Sync with autotools.
10119 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
10120 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
10121 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
10122 locations are requested.
10123 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
10124 locations are requested.
10126 2002-12-12 Paul Eggert <eggert@twinsun.com>
10128 Remove unportable casts and storage allocation tricks.
10129 While we're at it, remove almost all casts, since they
10130 usually aren't needed and are a sign of trouble.
10132 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
10134 * src/derives.c (derives_compute): Do not subtract NTOKENS from
10135 the pointer DSET returned by malloc; this isn't portable.
10136 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
10137 Similarly for DERIVES.
10138 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
10139 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
10140 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
10142 * src/derives.c (derives_compute): Do not bother invoking
10143 int_of_rule_number, since rule numbers are integers.
10145 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
10146 rather than XMALLOC (char, N).
10148 * src/files.c (filename_split): Rewrite to avoid cast.
10150 * src/gram.h (symbol_number_as_item_number,
10151 item_number_as_symbol_number, rule_number_as_item_number,
10152 item_number_as_rule_number):
10153 Now inline functions rather than macros, to avoid casts.
10154 * src/state.h (state_number_as_int): Likewise.
10155 * src/tables.c (state_number_to_vector_number,
10156 symbol_number_to_vector_number): Likewise.
10158 * src/gram.h (int_of_rule_number): Remove; no longer used.
10160 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
10161 since the resulting storage is always stored into.
10163 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
10166 * src/muscle_tab.c (muscle_m4_output):
10167 Now inline. Return bool, not int.
10168 * src/state.c (state_compare): Likewise.
10169 * src/symtab.c (symbol_check_defined,
10170 symbol_check_alias_consistency, symbol_pack, symbol_translation,
10171 hash_compare_symbol, hash_symbol):
10173 * src/uniqstr.c (uniqstr_print): Likewise.
10174 * src/muscle_tab.c (muscle_m4_output_processor):
10175 New function, to avoid casts.
10176 * src/state.c (state_comparator, stage_hasher): Likewise.
10177 * src/symtab.c (symbol_check_defined_processor,
10178 symbol_check_alias_consistency_processor, symbol_pack_processor,
10179 symbol_translation_processor, hash_symbol_comparator,
10180 hash_symbol_hasher): Likewise.
10181 * src/uniqstr.c (uniqstr_print_processor): Likewise.
10182 * src/muscle_tab.c (muscles_m4_output):
10183 Use new functions instead of casting old functions unportably.
10184 * src/state.c (state_hash_new): Likewise.
10185 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
10186 symbols_token_translations_init):
10188 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
10190 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
10191 var instead of casting to long, to avoid casts.
10192 (prepare_states): Use MALLOC rather than alloca, so that we don't
10193 have to worry about alloca.
10194 * src/state.c (state_hash_lookup): Likewise.
10196 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
10197 local var instead of casting to unsigned char, to avoid casts.
10199 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
10200 STATE_ALLOC): Remove.
10201 (transitions_new, errs_new, reductions_new, state_new): Use malloc
10202 rather than calloc, and use offsetof to avoid allocating slightly
10204 (state_new): Initialize all members.
10206 * src/state.c (state_hash): Use unsigned accumulator, not signed.
10208 * src/symtab.c (symbol_free): Remove; unused.
10209 (symbol_get): Remove cast in lhs of assignment.
10210 (symbols_do): Now static. Accept generic arguments, not
10211 hashing-related ones.
10213 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
10214 (symbol_processor): Remove.
10215 (symbols_do): Remove decl; now static.
10217 * src/system.h (alloca): Remove; decl no longer needed.
10218 (<stddef.h>): Include, for offsetof.
10219 (<inttypes.>, <stdint.h>): Include if available.
10220 (uintptr_t): New type, if system lacks it.
10221 (CALLOC, MALLOC, REALLOC): New macros.
10222 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
10225 * src/tables.c (table_size): Now int, to pacify GCC.
10226 (table_grow, table_ninf_remap): Use signed table size.
10227 (save_row): Don't bother initializing locals when not needed.
10228 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
10229 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
10231 * src/vcg.h: Correct misspellings.
10233 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
10236 * src/getargs.c (getargs): Don't assume EOF == -1.
10238 2002-12-09 Paul Eggert <eggert@twinsun.com>
10240 Change identifier spellings to avoid collisions with names
10241 that are reserved by POSIX.
10243 Don't use names ending in _t, since POSIX reserves them.
10244 For consistency, remove _e and _s endings -- they're weren't
10245 needed to remove ambiguity. All uses changed.
10246 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
10247 turn was just renamed from struniq_t.
10248 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
10249 which in turn was just renamed from struniq_processor_t.
10250 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
10251 in turn was renamed from hash_compare_struniq_t.
10252 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
10253 (state_list): Renamed from state_list_t.
10254 * src/assoc.h (assoc): Renamed from assoc_t.
10255 * src/conflicts.c (enum conflict_resolution): Renamed from
10256 enum conflict_resolution_e.
10257 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
10258 (rule_list): Renamed from rule_list_t.
10259 * src/getargs.h (enum trace): Renamed from enum trace_e.
10260 (enum report): Renamed from enum report_e.
10261 * src/gram.h (item_number): Renamed from item_number_t.
10262 (rule_number): Renamed from rule_number_t.
10263 (struct rule_s): Remove the "rule_s" part; not used.
10264 (rule): Renamed from rule_t.
10265 (rule_filter): Renamed from rule_filter_t.
10266 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
10267 (goto_list): Renamed from goto_list_t.
10268 * src/lalr.h (goto_number): Renamed from goto_number_t.
10269 * src/location.h (location): Renamed from location_t.
10270 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
10271 and moved here from:
10272 * src/muscle_tab.h (muscle_entry_t): here.
10273 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
10274 (rule_list): Renamed from rule_list_t.
10275 * src/print_graph.c (static_graph): Renamed from graph.
10276 * src/reader.h (braced_code): Renamed from braced_code_t.
10277 Remove brace_code_e tag.
10278 * src/relation.h (relation_node): Renamed from relation_node_t.
10279 (relation_nodes): Renamed from relation_nodes_t.
10280 (relation): Renamed from relation_t.
10281 * src/state.h (state_number): Renamed from state_number_t.
10282 (struct state): Renamed from struct state_s.
10283 (state): Renamed from state_t.
10284 (transitions): Renamed from transitions_t. Unused (and
10285 misspelled) transtion_s tag removed.
10286 (errs): Renamed from errs_t. Unused errs_s tag removed.
10287 (reductions): Renamed from reductions_t. Unused tag
10288 reductions_s removed.
10289 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
10290 (struct symbol_list): Renamed from struct symbol_list_s.
10291 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
10292 (struct symbol): Renamed from struct symbol_s.
10293 (symbol): Renamed from symbol_t.
10294 * src/tables.c (vector_number): Renamed from vector_number_t.
10295 (action_number): Renamed from action_t.
10296 * src/tables.h (base_number): Renamed from base_t.
10297 * src/vcg.h (enum color): Renamed from enum color_e.
10298 (enum textmode): Renamed from enum textmode_e.
10299 (enum shape): Renamed from enum shape_e.
10300 (struct colorentry): Renamed from struct colorentry_s.
10301 (struct classname): Renamed from struct classname_s.
10302 (struct infoname): Renamed from struct infoname_s.
10303 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
10304 (enum decision): Renamed from enum decision_e.
10305 (enum orientation): Renamed from enum orientation_e.
10306 (enum alignment): Renamed from enum alignment_e.
10307 (enum arrow_mode): Renamed from enum arrow_mode_e.
10308 (enum crossing_type): Renamed from enum crossing_type_e.
10309 (enum view): Renamed from enum view_e.
10310 (struct node): Renamed from struct node_s.
10311 (node): Renamed from node_t.
10312 (enum linestyle): Renamed from enum linestyle_e.
10313 (enum arrowstyle): Renamed from enum arrowstyle_e.
10314 (struct edge): Renamed from struct edge.
10315 (edge): Renamed from edge_t.
10316 (struct graph): Renamed from struct graph_s.
10317 (graph): Renamed from graph_t.
10318 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
10319 Rename value_t -> value.
10320 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
10321 value_t_as_yystype -> value_as_yystype.
10323 Don't include <errno.h> in the mainstream code, since it
10324 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
10325 * lib/get-errno.c, lib/get-errno.h: New files.
10326 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
10328 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
10329 * src/output.c (output_skeleton): Likewise.
10330 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
10332 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
10334 (handle_action_dollar, handle_action_at): Likewise.
10335 * src/system.h: Do not include <errno.h>.
10336 (TAB_EXT): Renamed from EXT_TAB.
10337 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
10339 Avoid str[a-z]*, since <string.h> reserves that name space.
10340 Change all instances of "struniq" in names to "uniqstr", and
10341 likewise for "STRUNIQ" and "UNIQSTR".
10342 * src/uniqstr.c: Renamed from src/struniq.c.
10343 * src/uniqstr.h: Renamed from src/struniq.h.
10344 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
10345 * src/files.c (strsuffix): Remove; unused.
10346 (concat2): Renamed from stringappend. Now static.
10347 * src/files.h (strsuffix, stringappend): Remove; unused.
10348 * src/parse-gram.y (<chars>): Renamed from <string>.
10349 (<uniqstr>): Renamed from <struniq>.
10350 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
10351 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
10352 (struct graph_s.expand): Renamed from struct graph_s.stretch.
10353 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
10354 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
10355 (N_EXPAND): Renamed from N_STRETCH.
10357 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
10358 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
10359 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
10361 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
10362 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
10363 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
10364 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
10365 (BASE_MAXIMUM): Renamed from BASE_MAX.
10366 (BASE_MINIMUM): Renamed from BASE_MIN.
10367 (ACTION_MAX): Remove; unused.
10368 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
10369 Unnecessary casts removed from above defines.
10372 Fix misspelling in names.
10373 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
10374 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
10378 * lib/timevar.c (timevar_report): Renamed from time_report,
10379 for consistency with other names.
10380 * lib/timevar.h (timevar_report): New decl.
10381 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
10384 Sort include-file uses.
10386 Reorder all include files under src to be in the order "system.h".
10387 then the ../lib include files in angle brackets (alphabetized),
10388 then the . include files in double-quotes (alphabetized). Fix
10389 dependency breakages encountered in this process, as follows:
10390 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
10391 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
10392 * src/state.h: Include "symtab.h".
10394 2002-12-08 Paul Eggert <eggert@twinsun.com>
10396 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
10397 since this causes problems when __file__ contains character
10398 sequences like "@" that are treated specially by src/scan-skel.l.
10399 Instead, just use the file's basename. This fixes the bug
10400 reported by Martin Mokrejs in
10401 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
10403 2002-12-06 Paul Eggert <eggert@twinsun.com>
10405 Add support for rules that do not have trailing semicolons, as
10406 POSIX requires. Improve the quality of locations in Bison
10409 * src/location.c: Include <quotearg.h>.
10410 (empty_location): Now const.
10411 (location_print): New function. Follow the recommendation of the
10412 GNU Coding Standards for locations that span file boundaries.
10413 * src/location.h: Do not include <quotearg.h>; no longer needed.
10414 (boundary): New type.
10415 (location_t): Use it. This allows locations to span file boundaries.
10416 All member uses changed: file -> start.file or end.file (as needed),
10417 first_line -> start.line, first_column -> start.column,
10418 last_line -> end.line, last_column -> end.column.
10419 (equal_boundaries): New function.
10420 (LOCATION_RESET, LOCATION_STEP): Remove.
10421 (LOCATION_PRINT): Remove. All callers changed to use location_print.
10422 (empty_location): Now const.
10423 (location_print): New decl.
10424 * src/parse-gram.y (lloc_default): New function, which handles
10425 empty locations more accurately.
10426 (YYLLOC_DEFAULT): Use it.
10427 (%token COLON): Remove.
10428 (%token ID_COLON): New token.
10430 (declarations, rules): Remove trailing semicolon.
10431 (declaration, rules_or_grammar_declaration):
10432 Allow empty (";") declaration.
10433 (symbol_def): Remove empty actions; no longer needed.
10434 (rules_or_grammar_declaration): Remove trailing semicolon.
10435 (semi_colon.opt): Remove.
10436 * src/reader.h: Include location.h.
10437 (scanner_cursor): New decl.
10438 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
10440 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
10442 (STEP): Remove. No longer needed, now that adjust_location does
10443 the work. All uses removed.
10444 (scanner_cursor): New var.
10445 (adjust_location): Renamed from extend_location. It now sets
10446 *loc and adjusts the scanner cursor. All uses changed.
10447 Don't bother testing for CR.
10448 (handle_syncline): Remove location arg; now updates scanner cursor.
10449 All callers changed.
10450 (unexpected_end_of_file): Now accepts start boundary of token or
10451 comment, not location. All callers changed. Update scanner cursor,
10453 (SC_AFTER_IDENTIFIER): New state.
10454 (context_state): Renamed from c_context. All uses changed.
10455 (id_loc, code_start, token_start): New local vars.
10456 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
10457 processing of Yacc white space and equivalents here.
10458 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
10459 instead of returning ID immediately, since we need to search for
10460 a subsequent colon.
10461 (<INITIAL>"'", "\""): Save token_start.
10462 (<INITIAL>"%{", "{", "%%"): Save code_start.
10463 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
10464 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
10465 BEGIN context_state at end, not INITIAL.
10466 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
10467 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
10468 Return correct token start.
10469 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
10470 the start of a character, string or multiline comment is found.
10471 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
10472 Reduction): Adjust reported locations to match the more-precise
10473 results now expected.
10474 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
10475 * tests/reduce.at (Useless Rules, Reduced Automaton,
10476 Underivable Rules): Likewise.
10477 * tests/regression.at (Invalid inputs): No longer `expecting ";"
10478 or "|"' now that so many other tokens are allowed by the new grammar.
10480 * src/complain.h (current_file): Remove duplicate decl;
10481 current_file is now owned by files.h.
10482 * src/complain.c, src/scan-gram.l: Include files.h.
10484 2002-12-06 Paul Eggert <eggert@twinsun.com>
10486 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
10487 promotes to int; it might be unsigned int.
10488 * data/yacc.c (yy_reduce_print): Likewise.
10490 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
10491 be #defined in the prologue, not in the Bison declarations.
10492 This fixes Debian Bug 102878, reported by Shaul Karl.
10494 2002-12-02 Paul Eggert <eggert@twinsun.com>
10496 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
10497 * lib/strtoul.c: New file, from gnulib.
10498 This fixes a porting bug reported by Peter Klein in
10499 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
10501 2002-11-30 Paul Eggert <eggert@twinsun.com>
10503 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
10504 and put only a forward declaration in the prologue. This is for
10505 consistency with the other scanner helper functions.
10507 Type clashes now generate warnings, not errors, since it
10508 appears that POSIX may allow some grammars with type clashes.
10509 * src/reader.c (grammar_current_rule_check): Warn about
10510 type clashes instead of complaining.
10511 * tests/input.at (Type Clashes): Expect warnings, not complaints.
10513 Add Yacc library, since POSIX requires it.
10514 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
10515 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
10516 * lib/main.c, lib/yyerror.c: New files.
10518 gram_error can be static; it need not be extern.
10519 * src/reader.h (gram_error): Remove decl.
10520 * src/parse-gram.y (gram_error): Now static. Add static decl.
10521 (print_token_value): Omit parameter names from forward decl,
10524 2002-11-29 Paul Eggert <eggert@twinsun.com>
10526 * doc/bison.texinfo: Emphasize that yylex and yyerror must
10527 be declared before being used. E.g., one should typically
10528 declare them in the prologue. Use GNU coding style in examples.
10529 Put "const" consistently after the type it modifies. Mention
10530 that C99 supports "inline". Mention that yyerror traditionally
10533 %parse-param and %lex-param now take just one argument, the
10534 declaration; the argument name is deduced from the declaration.
10536 * doc/bison.texinfo (Parser Function, Pure Calling, Error
10537 Reporting, Table of Symbols): Document this.
10538 * src/parse-gram.y (add_param): New function.
10540 (declaration): Implement new rule for %parse-param and %lex-param.
10541 * src/scan-gram.l: "," now elicits a warning, rather than being
10542 a token; this is more compatible with byacc.
10543 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
10545 2002-11-27 Paul Eggert <eggert@twinsun.com>
10547 Rename identifiers to avoid real and potential collisions.
10549 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
10550 to avoid collision with lex macro described by Bruce Lilly in
10551 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
10552 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10553 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
10554 * src/parse-gram.y (print_token_value): Renamed from yyprint.
10556 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
10557 The name "yycontrol" violates the name space rules, and this stuff
10558 wasn't being used anyway.
10559 (input): Remove action; this stuff wasn't being used.
10560 (gram_error): Rename local variable yylloc -> loc.
10561 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
10562 (YY_DECL): Don't use "yy" at start of local variables.
10563 All uses changed, e.g., yylloc -> loc.
10564 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
10565 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
10566 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
10567 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
10569 * src/parse-gram.y (gram_error): loc is now const *.
10570 * src/reader.h (gram_error): Likewise.
10572 2002-11-24 Paul Eggert <eggert@twinsun.com>
10576 * tests/actions.at (Actions after errors): Use an output format
10577 more similar to that of the Printers and Destructors test.
10578 Test the position of the ';' token too.
10579 (Printers and Destructors): Likewise.
10580 (Printers and Destructors: %glr-parser): Remove for now, to avoid
10581 unnecessarily alarming people when the test fails.
10583 * data/yacc.c (yyerrlab1): Move this label down, so that the
10584 parser does not discard the lookahead token if the user code
10585 invokes YYERROR. This change is required for POSIX conformance.
10587 * lib/error.c: Sync with gnulib.
10589 2002-11-22 Paul Eggert <eggert@twinsun.com>
10591 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
10592 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
10593 * lib/xmalloc.c: Likewise.
10595 2002-11-20 Paul Eggert <eggert@twinsun.com>
10597 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
10599 2002-11-20 Paul Eggert <eggert@twinsun.com>
10601 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
10602 should use `if (! x) abort ();' rather than `assert (x);', and
10603 anyway it's one less thing to worry about configuring.
10605 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
10606 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
10607 and replace all instances of assert with abort.
10608 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10609 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
10611 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
10612 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
10613 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
10614 hash_find_entry, hash_rehash, hash_insert): Likewise.
10615 * src/conflicts.c (resolve_sr_conflict): Likewise.
10616 * src/lalr.c (set_goto_map, map_goto): Likewise.
10617 * src/nullable.c (nullable_compute): Likewise.
10618 * src/output.c (prepare_rules, token_definitions_output): Likewise.
10619 * src/reader.c (packgram, reader): Likewise.
10620 * src/state.c (state_new, state_free, state_transitions_set,
10621 state_reduction_find): Likewise.
10622 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
10623 symbol_pack): Likewise.
10624 * src/tables.c (conflict_row, pack_vector): Likewise.
10625 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10626 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10627 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
10628 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
10630 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
10631 (ARGMATCH_CONSTRAINT): New macro.
10632 (ARGMATCH_ASSERT): Use it.
10634 * src/system.h (verify): New macro.
10635 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
10636 rather than assert.
10637 * src/tables.c (tables_generate): Likewise.
10639 * src/struniq.c (struniq_assert): Now returns void, and aborts
10640 if the assertion is false.
10641 (struniq_assert_p): Remove.
10642 * src/struniq.h: Likewise.
10644 2002-11-18 Paul Eggert <eggert@twinsun.com>
10646 * data/glr.c (yygetLRActions): Replace `yyindex' with
10647 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
10648 This fixes the regression with Sun ONE Studio 7 cc that I reported in
10649 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
10651 2002-11-18 Akim Demaille <akim@epita.fr>
10653 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
10655 From Tim Van Holder.
10657 2002-11-17 Paul Eggert <eggert@twinsun.com>
10659 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
10660 to "SyntaxError" for consistency with my 2002-11-15 change.
10662 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
10663 not define to {}, since this breaks the common use of `YYDPRINTF
10664 ((...));' if a single statement is desired (e.g. before `else').
10665 Work around GCC warnings by surrounding corresponding calls with
10667 (yyhasResolvedValue): Remove unused function.
10668 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
10670 (yyreportSyntaxError): Renamed from yyreportParseError.
10671 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
10673 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
10674 extern when possible. Remove unused initializations.
10676 2002-11-16 Akim Demaille <akim@epita.fr>
10678 Augment the similarity between GLR and LALR traces.
10680 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
10681 (YY_REDUCE_PRINT): New.
10682 (yyparse): Use them.
10683 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
10685 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
10686 state reached after the reduction/recovery, since...
10687 (yyparse, yyprocessOneStack): Report the state we are entering in.
10689 2002-11-16 Akim Demaille <akim@epita.fr>
10691 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
10692 Add support for --trace=skeleton.
10693 * src/scan-skel.l: %option debug.
10694 Scan strings of non-@ or \n instead of character by character.
10695 (scan_skel): Handle trace_skeleton.
10697 (@output_parser_name@, @output_header_name@): ``Restore'' their
10698 support (used to be M4 macros).
10699 * data/yacc.c: Quote larger chunks, a la glr.c.
10700 * data/lalr1.cc: Likewise.
10701 The header guards are no longer available, so use some other
10702 string than `YYLSP_NEEDED'.
10704 2002-11-16 Akim Demaille <akim@epita.fr>
10706 Make the ``Printers and Destructors'' test more verbose, taking
10707 `yacc.c''s behavior as (possibly wrong) reference.
10709 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
10710 instead of fprint on stdout.
10711 Set and report the last_line of the symbols.
10712 Consistently display values and locations.
10714 2002-11-16 Paul Eggert <eggert@twinsun.com>
10716 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
10718 2002-11-15 Paul Eggert <eggert@twinsun.com>
10720 * tests/actions.at (Actions after errors): New test case.
10722 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
10723 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
10724 tests/action.at, tests/calc.at, tests/conflicts.at,
10725 tests/cxx-type.at, tests/regression.at:
10726 "parse error" -> "syntax error" for POSIX compatibility.
10727 "parsing stack overflow..." -> "parser stack overflow" so
10728 that code matches Bison documentation.
10730 2002-11-15 Akim Demaille <akim@epita.fr>
10732 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
10733 take two BRACED_CODE, not two string_content.
10734 Free the scanner's obstack when we are done.
10735 (code_content): New.
10736 * tests/calc.at: Adjust.
10737 * doc/bison.texinfo: Adjust.
10738 Also, make sure to include the `,' for these declarations.
10740 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
10742 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
10743 definition; avoids potential autoreconf problems.
10745 2002-11-15 Akim Demaille <akim@epita.fr>
10747 Always check the value returned by yyparse.
10749 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
10750 returned by yyparse.
10751 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
10753 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
10754 returned by yyparse.
10756 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10758 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
10761 2002-11-14 Paul Eggert <eggert@twinsun.com>
10763 * src/output.c (output_skeleton): Call xfopen instead of
10764 duplicating xfopen's body.
10766 Fix bugs reported by Nelson H. F. Beebe in
10767 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
10769 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
10770 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
10771 Group compiler. Instead, use "$CC -E bar.c". Include the .h
10772 file twice in the grammar, as an extra check.
10774 * tests/input.at (Torturing the Scanner): Surround the
10775 backslash-newline tests with "#if 0", to make it less likely that
10776 we'll run into compiler bugs. Bring back solitary \ inside
10777 comment, but add a closing comment to work around HP C bug. Don't
10778 test backslash-newline in C character constant.
10780 2002-11-14 Akim Demaille <akim@epita.fr>
10782 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
10783 status of the compiler.
10784 Calling `exit 1' is no longer needed.
10785 Reported by Nelson H. F. Beebe.
10787 2002-11-14 Akim Demaille <akim@epita.fr>
10789 * tests/atlocal.in (CPPFLAGS): We have config.h.
10790 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
10792 * tests/actions.at, tests/calc.at, tests/conflicts.at,
10793 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
10794 * tests/regression.at, tests/torture.at: Use them for all the
10795 grammars that are to be compiled.
10796 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
10797 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
10798 * doc/bison.texinfo (GLR Parsers): Document `inline'.
10800 2002-11-14 Akim Demaille <akim@epita.fr>
10802 * doc/bison.texinfo: Various formatting changes (alignments in
10803 samples, additional @group/@end group, GCS in samples.
10804 Use @deffn instead of simple @table to define the directives,
10805 macros, variables etc.
10807 2002-11-13 Paul Eggert <eggert@twinsun.com>
10809 Fix some bugs reported by Albert Chin-A-Young in
10810 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
10812 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
10813 -o c"; the HP C compiler chatters during compilation.
10814 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
10815 * tests/headers.at (export YYLTYPE): Likewise.
10817 * tests/input.at (Torturing the Scanner): Remove lines containing
10818 solitary backslashes, as they tickle a bug in the HP C compiler.
10820 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
10821 comments, since they're not portable. Use GNU coding style.
10823 2002-11-13 Akim Demaille <akim@epita.fr>
10825 * data/yacc.c: Leave bigger chunks of quoted text.
10826 (YYDSYMPRINTF): New.
10827 Use it to report symbol activities.
10828 * data/glr.c (YYDSYMPRINTF): New.
10831 2002-11-12 Paul Eggert <eggert@twinsun.com>
10835 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
10836 (yyglrReduce): Return yyok, not 0.
10837 This should avoid the enumerated-type warnings reported
10838 by Nelson H. F. Beebe in
10839 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
10841 * lib/bbitset.h (BITSET_INLINE): Remove.
10842 * lib/bitset.h [! BITSET_INLINE]: Remove.
10843 (bitset_set, bitset_reset, bitset_test): Rename local vars
10844 to avoid shadowing warnings by GCC.
10846 * data/glr.c (inline): Remove #define. It's the user's
10847 responsibility to #define it away, just like 'const'.
10848 This fixes one of the bugs reported by Nelson H. F. Beebe in
10849 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
10851 * Makefile.maint (po-check): Scan .l and .y files instead of the
10852 .c and the .h files that they generate. This fixes the bug
10853 reported by Tim Van Holder in:
10854 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
10855 Look for N_ as well as for _. Try to avoid matching #define for
10857 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
10858 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
10859 * src/scan-gram.l: Revamp regular expressions so that " and '
10860 do not confuse xgettext.
10862 * src/struniq.h (struniq_new): Do not declare the return type
10863 to be 'const'; this violates the C standard.
10864 * src/struniq.c (struniq_new): Likewise.
10866 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
10868 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
10869 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
10872 2002-11-12 Akim Demaille <akim@epita.fr>
10874 * Makefile.maint: Sync with Autoconf:
10875 (local_updates): New.
10877 2002-11-12 Akim Demaille <akim@epita.fr>
10879 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
10881 2002-11-12 Akim Demaille <akim@epita.fr>
10883 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
10886 2002-11-12 Akim Demaille <akim@epita.fr>
10888 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
10891 2002-11-12 Akim Demaille <akim@epita.fr>
10893 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
10894 Use it to test the GLR parser.
10896 2002-11-12 Akim Demaille <akim@epita.fr>
10898 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
10900 * data/glr.c (yystos): New.
10901 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
10902 (YYDSYMPRINT): New.
10903 (yyval): Don't define it, it is handled via M4.
10904 (yyrecoverParseError): Free verbosely the discarded symbols.
10905 * data/yacc.c (yysymprint): Remove, rather...
10906 (b4_yysymprint_generate): invoke.
10907 * data/c.m4 (b4_yysymprint_generate): New.
10908 Accept pointers as arguments, as opposed to the version from
10910 (b4_yydestruct_generate): Likewise.
10911 * tests/cations.at (Printers and Destructors): Use Bison directives
10912 instead of CPP macros.
10913 Don't rely on internal details.
10915 2002-11-12 Akim Demaille <akim@epita.fr>
10917 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
10918 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
10919 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
10920 it against YYEMPTY and so forth), work on yytoken (i.e., set
10921 it to YYEMPTY etc.).
10922 (yydestruct): Replace with a b4_yydestruct_generate invocation.
10923 (b4_symbol_actions): Remove.
10924 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
10925 for 0, end-of-input.
10927 2002-11-12 Akim Demaille <akim@epita.fr>
10929 * doc/bison.texinfo (Destructor Decl): New.
10931 2002-11-12 Akim Demaille <akim@epita.fr>
10933 * src/tables.c (tables_generate): Use free for pointers that
10934 cannot be NULL, not XFREE.
10935 (pack_vector): Use assert, not fatal, for bound violations.
10936 * src/state.c (state_new): Likewise.
10937 * src/reader.c (reader): Likewise.
10938 * src/lalr.c (set_goto_map): Likewise.
10939 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
10942 2002-11-12 Akim Demaille <akim@epita.fr>
10944 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
10946 * src/scan-gram.l (last_string): Is global to the file, not to
10948 * src/parse-gram.y (input): Don't append the epilogue here,
10949 (epilogue.opt): do it here, and free the scanner's obstack.
10950 * src/reader.c (epilogue_set): Rename as...
10951 (epilogue_augment): this.
10952 * data/c.m4 (b4_epilogue): Defaults to empty.
10954 2002-11-12 Akim Demaille <akim@epita.fr>
10956 * src/getargs.c (long_options): Remove duplicates.
10957 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
10959 * doc/bison.rnh: Remove.
10960 * doc/bison.texinfo (VMS Invocation): Remove.
10962 2002-11-12 Akim Demaille <akim@epita.fr>
10964 * src/struniq.h, src/struniq.c (struniq_t): Is const.
10965 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
10967 Use struniq for symbols.
10969 * src/symtab.h (symbol_t): The tag member is a struniq.
10970 (symbol_type_set): Adjust.
10971 * src/symtab.c (symbol_new): Takes a struniq.
10972 (symbol_free): Don't free the tag member.
10973 (hash_compare_symbol_t, hash_symbol_t): Rename as...
10974 (hash_compare_symbol, hash_symbol): these.
10975 Use the fact that tags as struniqs.
10976 (symbol_get): Use struniq_new.
10977 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
10979 * src/reader.h (merger_list, grammar_currentmerge_set): The name
10980 and type members are struniqs.
10981 * src/reader.c (get_merge_function)
10982 (grammar_current_rule_merge_set): Adjust.
10983 (TYPE, current_type): Are struniq.
10985 Use struniq for file names.
10987 * src/files.h, src/files.c (infile): Split into...
10988 (grammar_file, current_file): these.
10989 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
10990 * src/reduce.c (reduce_print): Likewise.
10991 * src/getargs.c (getargs): Likewise.
10992 * src/complain.h, src/complain.c: Likewise.
10993 * src/main.c (main): Call struniqs_new early enough to use it for
10995 Don't free the input file name.
10997 2002-11-12 Akim Demaille <akim@epita.fr>
10999 * src/symtab.c (symbol_free): Remove dead deactivated code:
11000 type_name are properly removed.
11001 Don't use XFREE to free items that cannot be NULL.
11002 * src/struniq.h, src/struniq.c: New.
11003 * src/main.c (main): Initialize/free struniqs.
11004 * src/parse-gram.y (%union): Add astruniq member.
11006 * src/scan-gram.l (<{tag}>): Return a struniq.
11007 Free the obstack bit that used to store it.
11008 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
11010 2002-11-11 Paul Eggert <eggert@twinsun.com>
11012 Revamp to fix many (but not all) of the C- and M4-related quoting
11013 problems. Among other things, this fixes the Bison bug reported
11014 by Jan Hubicka when processing the Bash grammar; see:
11015 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
11017 Use new @ escapes consistently. Represent brackets with @{ and @}
11018 rather than @<:@ and @:>@, since this works a bit better with dumb
11019 editors like vi. Represent @ with @@, since @ is now consistently
11020 an escape. Use @oline@ and @ofile@ rather than __oline__ and
11021 __ofile__, to avoid unexpected expansions. Similarly, use @output
11022 rather than #output.
11024 * data/c.m4 (b4_copyright): Omit file name from comment, since
11025 the file name could contain "*/".
11026 (b4_synclines_flag): Don't quote the 2nd argument; it should already
11027 be quoted. All uses changed.
11029 * data/glr.c: Use new @ escapes consistently.
11030 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
11031 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
11032 Remove, since they couldn't handle arbitrary characters in file
11034 * data/lalr1.cc: Likewise.
11035 * data/yacc.c: Likewise.
11037 * src/files.c (output_infix): Remove; all uses removed.
11038 * src/files.h: Likewise.
11040 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
11041 mishandled funny characters in file names, and anyway it isn't
11043 * data/yacc.c: Likewise.
11044 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
11046 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
11047 * data/yacc.c: Likewise.
11049 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
11051 (muscle_init): Quote filename as a C string.
11052 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
11053 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
11054 * src/output.c (escaped_file_name_output): New function.
11055 (prepare_symbols): Quote tokens for M4.
11056 (prepare): Don't insert output_infix, output_prefix,
11057 output_parser_name, output_header_name; this is now down by scan-skel.
11058 Insert skeleton as a C string.
11060 * src/output.c (user_actions_output, symbol_destructors_output,
11061 symbol_printers_output): Quote filenames for C and M4.
11062 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11064 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
11065 escapes other than \\ and \'; this simplifies the code.
11066 (<SC_STRING>): Likewise, for \\ and \".
11067 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
11068 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
11069 Use new escapes @{ and @} for [ and ].
11071 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
11072 them with auto vars.
11073 Switch to new escape scheme, where @ is the escape character uniformly.
11074 Abort if a stray escape character is found. Avoid unbounded input
11075 buffer when parsing non-escaped text.
11077 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
11078 __oline__, #output, $@, and @{ do not have unintended meanings.
11080 2002-11-09 Paul Eggert <eggert@twinsun.com>
11082 Fix the test failure due to GCC warnings described in
11083 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
11084 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
11085 evaluate to 0 if it's impossible for NINF to be in the respective
11087 (yygetLRActions, yyrecoverParseError): Use them.
11089 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
11090 counted in the token inserted at end of file. Now takes
11091 location_t *, not location_t, so that the location can be
11092 adjusted. All uses changed.
11094 * tests/regression.at (Invalid inputs): Adjust wording in
11095 diagnostic to match the new behavior.
11097 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
11098 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
11099 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
11100 abort ();'. This reduces the runtime of the "Many lookaheads"
11101 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
11104 2002-11-07 Paul Eggert <eggert@twinsun.com>
11106 * src/parse-gram.y (CHARACTER): Remove unused token.
11109 * src/scan-gram.l: Remove stack option. We no longer use the
11110 stack, since the stack was never deeper than 1; instead, use the
11111 new auto var c_context to record the stacked value.
11113 Remove nounput option. At an unexpected end of file, we now unput
11114 the minimal input necessary to end cleanly; this simplifies the
11117 Avoid unbounded token sizes where this is easy.
11119 (unexpected_end_of_file): New function.
11120 Use it to systematize the error message on unexpected EOF.
11121 (last-string): Now auto, not static.
11122 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
11123 (scanner_last_string_free): Remove; not used.
11124 (percent_percent_count): Move decl to just before use.
11125 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
11126 not the (never otherwised-used) CHARACTER.
11128 2002-11-07 Akim Demaille <akim@epita.fr>
11130 Let yyerror always receive the msg as last argument, so that
11131 yyerror can be variadic.
11133 * data/yacc.c (b4_yyerror_args): New.
11134 Use it when calling yyerror.
11135 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
11136 Use it when calling yyerror.
11137 * doc/bison.texinfo (Error Reporting): Adjust.
11138 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
11139 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
11141 2002-11-06 Akim Demaille <akim@epita.fr>
11143 #line should have quoted strings.
11144 Ideally, this should be done by m4_quotearg.
11146 * src/scan-skel.l: Include quotearg.h.
11148 * src/output.c (symbol_printers_output)
11149 (symbol_destructors_output): Quote the file name.
11151 2002-11-06 Akim Demaille <akim@epita.fr>
11153 * tests/regression.at (Invalid inputs): Adjust to the recent
11156 2002-11-06 Akim Demaille <akim@epita.fr>
11158 Restore --no-lines.
11159 Reported by Jim Kent.
11161 * data/c.m4 (b4_syncline): New.
11162 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
11163 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
11164 * src/output.c (user_actions_output): Likewise.
11165 (prepare): Define 'b4_synclines_flag'.
11166 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
11168 2002-11-06 Akim Demaille <akim@epita.fr>
11170 * src/main.c (main): Free `infile'.
11171 * src/scan-gram.l (handle_syncline): New.
11173 * src/output.c (user_actions_output, symbol_destructors_output)
11174 (symbol_printers_output): Use the location's file name, not
11176 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11178 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11180 * src/tables.c (matching_state): Don't allow states to match if
11181 either has GLR conflict entries.
11183 2002-11-05 Paul Eggert <eggert@twinsun.com>
11185 * src/scan-gram.l: Use more accurate diagnostics, e.g.
11186 "integer out of range" rather than "invalid value".
11187 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
11190 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
11191 Also, remove one static variable in the scanner.
11193 * src/scan-gram.l (braces_level): Now auto, not static.
11194 Initialize to zero if the compiler is being picky.
11195 (INITIAL): Clear braces_level instead of incrementing it.
11196 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
11197 as POSIX 1003.1-2001 requires.
11198 * src/system.h (IF_LINT): New macro, taken from coreutils.
11199 * configure.ac: Define "lint" if --enable-gcc-warnings.
11201 2002-11-05 Akim Demaille <akim@epita.fr>
11203 * src/scan-gram.l: When it starts with `%', complain about the
11204 whole directive, not just that `invalid character: %'.
11206 2002-11-04 Akim Demaille <akim@epita.fr>
11208 * Makefile.maint: Update from Autoconf.
11209 (update, cvs-update, po-update, do-po-update): New.
11211 2002-11-04 Akim Demaille <akim@epita.fr>
11213 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
11215 Have yyerror `use' its arguments.
11216 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
11217 returns true when location & yacc & pure & parse-param.
11218 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
11220 2002-11-04 Akim Demaille <akim@epita.fr>
11222 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
11224 * src/scan-gram.l: Use [\'] instead of ['] to pacify
11227 Use quote, not quote_n since LOCATION_PRINT no longer uses the
11230 2002-11-03 Paul Eggert <eggert@twinsun.com>
11232 * src/reader.c (get_merge_function, grammar_current_rule_check):
11233 Use consistent diagnostics for reporting type name clashes.
11234 Quote the types with <>, for consistency with Yacc.
11235 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
11237 2002-11-03 Akim Demaille <akim@epita.fr>
11239 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
11241 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
11242 (b4_parse_param): Remove.
11243 Use b4_identification.
11244 Propagate b4_pure_args where needed to pass them to yyerror.
11245 * data/glr.m4 (b4_parse_param): Remove.
11246 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
11247 (b4_lpure_formals): New.
11248 Use b4_identification.
11249 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
11250 b4_user_formals and b4_user_args.
11251 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
11252 (yyreportAmbiguity): When using a pure parser, also need
11253 the location, and the parse-params.
11255 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
11256 When using a pure parser, also need the parse-params.
11258 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
11259 (%pure-parser + %parse-param) LALR and GLR parsers.
11260 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
11261 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
11262 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
11263 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
11264 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
11265 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
11266 * doc/bison.texinfo: Untabify the whole file.
11267 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
11268 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
11269 (Error Reporting): Adjust to these new directives.
11270 Document %error-verbose, deprecate YYERROR_VERBOSE.
11272 2002-11-03 Akim Demaille <akim@epita.fr>
11274 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
11275 AT_CHECK_CALC_GLR invocations to use % directives, instead of
11276 command line options.
11277 * tests/cxx-type.at: Formatting changes.
11279 2002-11-03 Paul Eggert <eggert@twinsun.com>
11281 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
11282 to count columns correctly, and to check for invalid inputs.
11284 Use mbsnwidth to count columns correctly. Account for tabs, too.
11285 Include mbswidth.h.
11286 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
11287 (extend_location): New function.
11288 (YY_LINES): Remove.
11290 Handle CRLF in C code rather than in Lex code.
11291 (YY_INPUT): New macro.
11292 (no_cr_read): New function.
11294 Scan UCNs, even though we don't fully handle them yet.
11295 (convert_ucn_to_byte): New function.
11297 Handle backslash-newline correctly in C code.
11298 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
11299 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
11301 (tag, splice): New EREs. Do not allow NUL or newline in tags.
11302 Use {splice} wherever C allows backslash-newline.
11303 YY_STEP after space, newline, vertical-tab.
11304 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
11306 (letter, id): Don't assume ASCII; e.g., spell out a-z.
11308 ({int}, handle_action_dollar, handle_action_at): Check for integer
11311 (YY_STEP): Omit trailing semicolon, so that it's more like C.
11313 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
11314 as well as \000. Check for UCHAR_MAX, not 255.
11315 Allow \x with an arbitrary positive number of digits, as in C.
11316 Check for overflow here.
11317 Allow \? and UCNs, for compatibility with C.
11319 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
11320 with quote slot used by complain_at.
11322 * tests/input.at: Add tests for backslash-newline, m4 quotes
11323 in symbols, long literals, and funny escapes in strings.
11325 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
11326 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
11327 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
11328 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
11329 * m4/mbswidth.m4: New file, from GNU coreutils.
11331 * doc/bison.texinfo (Grammar Outline): Document // comments.
11332 (Symbols): Document that trigraphs have no special meaning in Bison,
11333 nor is backslash-newline allowed.
11334 (Actions): Document that trigraphs have no special meaning.
11336 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
11339 2002-11-02 Paul Eggert <eggert@twinsun.com>
11341 * src/reader.c: Don't include quote.h; not needed.
11342 (get_merge_function): Reword warning to be consistent with
11343 type clash diagnostic in grammar_current_rule_check.
11345 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
11346 bug in trigraph handling.
11348 * src/output.c (prepare_symbols): When printing token names,
11349 escape "[" as "@<:@" and likewise for "]".
11351 * src/system.h (errno): Remove declaration, as we are now
11352 assuming C89 or better, and C89 guarantees errno.
11354 2002-10-30 Paul Eggert <eggert@twinsun.com>
11356 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
11357 Check for close failures.
11358 * src/files.h (xfclose): Return void, not int, since it always
11360 * src/files.c (xfclose): Likewise. Report I/O error if ferror
11362 * src/output.c (output_skeleton): Use xfclose rather than fclose
11363 and ferror. xfclose now checks ferror.
11365 * data/glr.c (YYLEFTMOST_STATE): Remove.
11366 (yyreportTree): Use a stack-based leftmost state. This avoids
11367 our continuing battles with bogus warnings about initializers.
11369 2002-10-30 Akim Demaille <akim@epita.fr>
11371 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
11374 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11376 * tests/glr-regr1.at: New test for reported regressions.
11377 * tests/testsuite.at: Add glr-regr1.at test.
11378 * tests/Makefile.am: Add glr-regr1.at test.
11380 2002-10-24 Paul Eggert <eggert@twinsun.com>
11384 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
11385 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
11386 we use malloc. Don't assume 'A' through 'Z' are contiguous.
11387 Don't assume strdup exists; POSIX says its an XSI extension.
11388 Check for buffer overflow on input.
11390 2002-10-24 Akim Demaille <akim@epita.fr>
11392 * src/output.c (output_skeleton): Don't disable M4sugar comments
11393 too soon: it results in comments being expanded.
11394 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
11397 2002-10-24 Akim Demaille <akim@epita.fr>
11399 * data/yacc.c (m4_int_type): New.
11400 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
11401 char' as only yacc.c wants K&R portability.
11402 * data/glr.c (yysigned_char): Remove.
11403 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
11404 Reported by Quoc Peyrot.
11406 2002-10-23 Paul Eggert <eggert@twinsun.com>
11408 * src/main.c (main): With --trace=time, report times even if a
11409 non-fatal error occurs. Formerly, the times were reported in some
11410 such cases but not in others.
11411 * src/reader.c (reader): Just return if a complaint has been issued,
11412 instead of exiting, so that 'main' can report times.
11414 2002-10-22 Akim Demaille <akim@epita.fr>
11416 * src/system.h: Include sys/types.
11417 Reported by Bert Deknuydt.
11419 2002-10-23 Paul Eggert <eggert@twinsun.com>
11421 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
11422 Suggested by Art Haas.
11424 2002-10-22 Paul Eggert <eggert@twinsun.com>
11426 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
11427 decl; not needed any more.
11428 * src/main.c (main): Use return to exit, undoing yesterday's change.
11429 The last OS that we could find where this wouldn't work is
11430 SunOS 3.5, and that's too old to worry about now.
11432 * data/glr.c (struct yyltype): Define members even when not
11433 doing locations. This is more consistent with yacc.c, and it
11434 works around the following bug reports:
11435 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
11436 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
11438 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
11439 @acronym consistently. Standardize on "Yacc" instead of "YACC",
11440 "Algol" instead of "ALGOL". Give a bit more history about BNF.
11442 2002-10-22 Akim Demaille <akim@epita.fr>
11444 * data/README: New.
11446 2002-10-21 Paul Eggert <eggert@twinsun.com>
11448 Be consistent about 'bool'; the old code used an enum in one
11449 module and an int in another, and this violates the C standard.
11450 * m4/stdbool.m4: New file, from coreutils 4.5.3.
11451 * configure.ac (AC_HEADER_STDBOOL): Add.
11452 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
11453 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
11454 * src/symtab.c (hash_compare_symbol_t): Likewise.
11455 * src/system.h (bool, false, true): Use a definition consistent
11456 with ../lib/hash.c. All uses changed.
11458 * src/complain.c (warning_issued): Renamed from warn_message_count,
11459 so that we needn't worry about integer overflow (!).
11460 Now of type bool. All uses changed.
11461 (complaint_issued): Renamed from complain_message_count; likewise.
11463 * src/main.c (main): Use exit to exit with failure.
11465 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
11466 rather than 1 and 0.
11467 * src/main.c (main): Likewise.
11468 * src/getargs.c (getargs): Likewise.
11469 * src/reader.c (reader): Likewise.
11471 * src/getarg.c (getargs): Remove duplicate code for
11472 "Try `bison --help'".
11474 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
11475 What was that "2" for?
11477 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
11478 * src/getargs.c (usage): Likewise.
11480 * src/getargs.c (getargs): When there are too few operands, report
11481 the last one. When there are too many, report the first extra
11482 one. This is how diffutils does it.
11484 2002-10-20 Paul Eggert <eggert@twinsun.com>
11486 Remove K&R vestiges.
11487 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
11488 * src/complain.c (VA_START): Remove. Assume prototypes.
11489 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
11490 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
11491 fatal): Assume prototypes.
11492 * src/complain.h: Assume prototypes.
11493 * src/system.h (PARAMS): Remove.
11494 Include <limits.h> unconditionally, since it's guaranteeed even
11495 for a freestanding C89 compiler.
11496 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
11497 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
11499 2002-10-20 Akim Demaille <akim@epita.fr>
11501 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
11502 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
11503 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
11504 (yyresolveStates, yyresolveAction, yyresolveStack)
11505 (yyprocessOneStack): Use them.
11506 (yy_reduce_print): New.
11507 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
11509 2002-10-20 Akim Demaille <akim@epita.fr>
11511 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
11512 arguments and output `void'.
11513 (b4_c_function): Rename as...
11514 (b4_c_function_def): this.
11515 (b4_c_function_decl, b4_c_ansi_function_def)
11516 (b4_c_ansi_function_decl): New.
11517 Change the interpretation of the arguments: before `int, foo', now
11519 * data/yacc.c (yyparse): Prototype and define thanks to these.
11520 Adjust b4_c_function_def uses.
11521 * data/glr.c (yyparse): Likewise, but ANSI only.
11523 2002-10-20 Akim Demaille <akim@epita.fr>
11525 * src/output.c (prepare): Move the definition of `tokens_number',
11526 `nterms_number', `undef_token_number', `user_token_number_max'
11528 (prepare_tokens): Here.
11529 (prepare_tokens): Rename as...
11530 (prepare_symbols): this.
11531 (prepare): Move the definition of `rules_number' to...
11532 (prepare_rules): here.
11533 (prepare): Move the definition of `last', `final_state_number',
11534 `states_number' to...
11535 (prepare_states): here.
11536 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
11538 2002-10-20 Akim Demaille <akim@epita.fr>
11540 * src/tables.h, src/tables.c, src/output.c: Comment changes.
11542 2002-10-20 Akim Demaille <akim@epita.fr>
11544 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
11547 2002-10-20 Akim Demaille <akim@epita.fr>
11549 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
11550 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
11552 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
11554 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
11555 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
11558 2002-10-19 Paul Eggert <eggert@twinsun.com>
11560 Do not create a temporary file, as that involves security and
11561 cleanup headaches. Instead, use a pair of pipes.
11562 Derived from a suggestion by Florian Krohm.
11563 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
11564 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
11565 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
11566 (BISON_PREREQ_SUBPIPE): Add.
11567 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
11568 Add subpipe.h, subpipe.c.
11569 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
11570 * po/POTFILES.in: Add lib/subpipe.c.
11571 * src/output.c: Include "subpipe.h".
11572 (m4_invoke): Remove decl.
11573 (scan_skel): New decl.
11574 (output_skeleton): Use pipe rather than temporary file for m4 input.
11575 Check that m4sugar.m4 is readable, to avoid deadlock.
11576 Check for pipe I/O error.
11577 * src/scan-skel.l (readpipe): Remove decl.
11578 (scan_skel): New function, to be used in place of m4_invoke.
11579 Read from stream rather than file.
11581 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
11582 float, as this generates a warning on Solaris 8 + GCC 3.2 with
11583 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
11584 this generates a more-accurate value anyway.
11586 * lib/timevar.c (timervar_accumulate): Rename locals to
11587 avoid confusion with similarly-named more-global.
11588 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
11590 * src/output.c (prepare): Use xstrdup to convert char const *
11591 to char *, to avoid GCC warning.
11593 2002-10-19 Akim Demaille <akim@epita.fr>
11595 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
11596 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
11597 Use them to have `calc.y' ready for %pure-parser.
11598 * data/yacc.c (YYLEX): Pass a yylex return type to
11599 b4_c_function_call.
11601 2002-10-19 Akim Demaille <akim@epita.fr>
11603 Prototype support of %lex-param and %parse-param.
11605 * src/parse-gram.y: Add the definition of the %lex-param and
11606 %parse-param tokens, plus their rules.
11607 Drop the `_' version of %glr-parser.
11609 * src/scan-gram.l (INITIAL): Scan them.
11610 * src/muscle_tab.c: Comment changes.
11611 (muscle_insert, muscle_find): Rename `pair' as `probe'.
11612 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
11613 (muscle_entry_s): The `value' member is no longer const.
11614 Adjust all dependencies.
11615 * src/muscle_tab.c (muscle_init): Adjust: use
11616 MUSCLE_INSERT_STRING.
11617 Initialize the obstack earlier.
11618 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
11619 (muscle_pair_list_grow): New.
11620 * data/c.m4 (b4_c_function_call, b4_c_args): New.
11621 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
11622 * tests/calc.at: Use %locations, not --locations.
11623 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
11625 2002-10-19 Akim Demaille <akim@epita.fr>
11627 * src/getargs.c (usage): Take status as argument and exit
11629 Report the traditional `Try ... --help' message when status != 0.
11630 (usage, version): Don't take a FILE * as arg, it is pointless.
11631 (getargs): When there is an incorrect number of arguments, make it
11632 an error, and report it GNUlically thanks to `usage ()'.
11634 2002-10-18 Paul Eggert <eggert@twinsun.com>
11636 * data/glr.c (yyreportParseError): Don't assume that sprintf
11637 yields the length of the printed string, as this is not true
11638 on SunOS 4.1.4. Reported by Peter Klein.
11640 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
11641 * tests/conflicts.at (%nonassoc and eof): Likewise.
11642 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
11644 2002-10-17 Akim Demaille <akim@epita.fr>
11646 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
11647 * src/getargs.c (trace_types, trace_args): Adjust.
11648 * src/reader.c (grammar_current_rule_prec_set)
11649 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
11650 Standardize error messages.
11651 And s/@prec/%prec/!
11652 (reader): Use trace_flag to enable scanner/parser debugging,
11653 instead of an adhoc scheme.
11654 * src/scan-gram.l: Remove trailing debugging code.
11656 2002-10-16 Paul Eggert <eggert@twinsun.com>
11658 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
11661 * NEWS: Officially drop support for building Bison with K&R C,
11662 since it didn't work anyway and it's not worth worrying about.
11663 * Makefile.maint (wget_files): Remove ansi2knr.c.
11664 (ansi2knr.c-url_prefix): Remove.
11665 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
11666 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11667 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11669 2002-10-15 Paul Eggert <eggert@twinsun.com>
11671 Stop using the "enum_" trick for K&R-style function definitions;
11672 it confused me, and I was the author! Instead, assume that people
11673 who want to use K&R C compilers (when using these modules in GCC,
11674 perhaps?) will run ansi2knr.
11676 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
11677 All uses of "enum_" changed to "enum ".
11678 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11679 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11681 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
11682 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
11683 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
11684 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
11685 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
11686 abitset_not, abitset_ones, abitset_or, abitset_or_and,
11687 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
11688 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
11689 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
11690 Use function prototypes; this removes the need for declaring
11691 static functions simply to provide their prototypes.
11692 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
11693 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
11694 bitset_count_, bitset_create, bitset_dump, bitset_first,
11695 bitset_free, bitset_init, bitset_last, bitset_next,
11696 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
11697 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
11698 bitset_print, bitset_release_memory, bitset_toggle_,
11699 bitset_type_choose, bitset_type_get, bitset_type_name_get,
11700 debug_bitset): Likewise.
11701 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
11702 * lib/bitset_stats.c (bitset_log_histogram_print,
11703 bitset_percent_histogram_print, bitset_stats_and,
11704 bitset_stats_and_cmp, bitset_stats_and_or,
11705 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
11706 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
11707 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
11708 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
11709 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
11710 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
11711 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
11712 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
11713 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
11714 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
11715 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
11716 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
11717 bitset_stats_zero): Likewise.
11718 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11719 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11720 bitsetv_dump, debug_bitsetv): Likewise.
11721 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
11722 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
11723 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
11724 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
11725 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
11726 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
11727 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
11728 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
11729 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
11730 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
11731 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
11733 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
11734 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
11735 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
11736 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
11737 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
11738 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
11739 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
11740 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
11741 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
11742 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
11743 lbitset_xor_cmp, lbitset_zero): Likewise.
11745 2002-10-14 Akim Demaille <akim@epita.fr>
11749 2002-10-14 Akim Demaille <akim@epita.fr>
11751 * tests/Makefile.am (maintainer-check-posix): New.
11753 2002-10-14 Akim Demaille <akim@epita.fr>
11755 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
11758 2002-10-14 Akim Demaille <akim@epita.fr>
11760 * src/tables.c (table_ninf_remap): base -> tab.
11761 Reported by Matt Rosing.
11763 2002-10-14 Paul Eggert <eggert@twinsun.com>
11765 * tests/action.at, tests/calc.at, tests/conflicts.at,
11766 tests/cxx-type.at, tests/headers.at, tests/input.at,
11767 tests/regression.at, tests/synclines.at, tests/torture.at:
11768 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
11769 so that the tests still work even if POSIXLY_CORRECT is set.
11770 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
11772 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
11773 for portability to K&R hosts. Fix typo: signed char is guaranteed
11774 only to 127, not to 128.
11775 * data/glr.c (yysigned_char): New type.
11776 * data/yacc.c (yysigned_char): Likewise.
11777 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
11779 2002-10-13 Paul Eggert <eggert@twinsun.com>
11781 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
11782 true due to limited range of data type" warning from GCC.
11784 * data/c.m4 (b4_token_defines): Protect against double-inclusion
11785 by wrapping enum yytokentype's definition inside #ifndef
11786 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
11788 2002-10-13 Akim Demaille <akim@epita.fr>
11790 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
11791 Un yy- yyrhs to avoid the name clash with the global YYRHS.
11793 2002-10-13 Akim Demaille <akim@epita.fr>
11795 * Makefile.maint: Update from Autoconf 2.54.
11796 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
11798 2002-10-13 Akim Demaille <akim@epita.fr>
11800 * src/print.c (print_state): Separate the list of solved conflicts
11801 from the other items.
11802 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
11804 2002-10-13 Akim Demaille <akim@epita.fr>
11806 Let nondeterministic skeletons be usable with deterministic
11809 With the patch, GAWK compiled by GCC without -O2 passes its test
11810 suite using a GLR parser driven by LALR tables. It fails with -O2
11811 because `struct stat' gives two different answers on my machine:
11812 88 (definition of an auto var) and later 96 (memset on this var).
11813 Hence the stack is badly corrumpted. The headers inclusion is to
11814 blame: if I move the awk.h inclusion before GLR's system header
11815 inclusion, the two struct stat have the same size.
11817 * src/tables.c (pack_table): Always create conflict_table.
11818 (token_actions): Always create conflict_list.
11819 * data/glr.c (YYFLAG): Remove, unused.
11821 2002-10-13 Akim Demaille <akim@epita.fr>
11823 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
11825 (VALGRIND, GXX): New.
11826 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
11827 * tests/bison.in: Run $PREBISON a pre-command.
11828 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
11829 (maintainer-check-g++): New.
11830 * Makefile.am (maintainer-check): New.
11832 2002-10-13 Akim Demaille <akim@epita.fr>
11834 * data/glr.c: Formatting changes.
11835 Tweak some trace messages to match yacc.c's.
11837 2002-10-13 Akim Demaille <akim@epita.fr>
11839 GLR parsers sometimes raise parse errors instead of performing the
11841 Reported by Charles-Henry de Boysson.
11843 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
11844 check the length of the traces when %glr.
11845 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
11847 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
11849 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
11850 (yyltype): Remove the yy prefix from the member names.
11851 (yytable): Complete its comment.
11852 (yygetLRActions): Map error action number from YYTABLE from
11854 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
11855 (which was a bug: it should have been YYTABEL_NINF, and yet it was
11856 not satisfying as we could compare an YYACTION computed from
11857 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
11858 only value for error actions.
11859 (yyreportParseError): In verbose parse error messages, don't issue
11860 `error' in the list of expected tokens.
11861 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
11862 next action to perform to match glr.c's decoding.
11863 (yytable): Complete its comment.
11865 2002-10-13 Paul Eggert <eggert@twinsun.com>
11867 Fix problem reported by Henrik Grubbstroem in
11868 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
11869 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
11870 because the Bison parser reads the second action before reducing
11872 * src/scan-gram.l (rule_length): New static var.
11873 Use it to keep track of the rule length in the scanner, since
11874 we can't expect the parser to be in lock-step sync with the scanner.
11875 (handle_action_dollar, handle_action_at): Use this var.
11876 * tests/actions.at (Exotic Dollars): Test for the problem.
11878 2002-10-12 Paul Eggert <eggert@twinsun.com>
11880 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
11881 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
11882 Include <sys/time.h> when checking for clock_t and struct tms.
11883 Use same include order as source.
11884 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
11885 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
11887 * lib/timevar.c: Update copyright date and clarify comments.
11888 (get_time) [IN_GCC]: Keep the GCC version for reference.
11890 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
11891 GCC version as of today, then merge Bison's changes.
11892 Change "GCC" to "Bison" in copyright notice. timevar.def's
11893 author is Akim, so change that too.
11895 * src/reader.c (grammar_current_rule_check):
11896 Don't worry about the default action if $$ is untyped.
11897 Prevents bogus warnings reported by Jim Gifford in
11898 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
11900 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
11901 * data/glr.c, data/lalr1.cc, data/yacc.c:
11902 Output token definitions before the first part of user declarations.
11903 Fixes compatibility problem reported by Jim Gifford for kbd in
11904 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
11906 2002-10-11 Paul Eggert <eggert@twinsun.com>
11908 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
11909 (yyparse): here. This undoes some of the 2002-07-25 change.
11910 Compatibility problem reported by Ralf S. Engelschall with
11911 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
11913 2002-10-11 Akim Demaille <akim@epita.fr>
11915 * tests/regression.at Characters Escapes): New.
11916 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
11918 Reported by Jan Nieuwenhuizen.
11920 2002-10-11 Akim Demaille <akim@epita.fr>
11924 2002-10-10 Paul Eggert <eggert@twinsun.com>
11926 Portability fixes for bitsets; this also avoids several GCC
11929 * lib/abitset.c: Include <stddef.h>, for offsetof.
11930 * lib/lbitset.c: Likewise.
11932 * lib/abitset.c (abitset_bytes): Return a size that is aligned
11933 properly for vectors of objects. Do not assume that adding a
11934 header size to a multiple of a word size yields a value that is
11935 properly aligned for the whole union.
11936 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11938 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
11939 unique names for structures.
11940 * lib/ebitset.c (ebitset_bytes): Likewise.
11941 * lib/lbitset.c (lbitset_bytes): Likewise.
11943 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
11944 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
11945 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
11946 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
11947 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
11948 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
11949 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
11950 to improve the type-checking that GCC can do.
11951 * lib/bitset.c (bitset_op4_cmp): Likewise.
11952 * lib/bitset_stats.c (bitset_stats_count,
11953 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
11954 bitset_stats_copy, bitset_stats_disjoint_p,
11955 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
11956 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
11957 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
11958 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
11959 bitset_stats_and_or_cmp, bitset_stats_andn_or,
11960 bitset_stats_andn_or_cmp, bitset_stats_or_and,
11961 bitset_stats_or_and_cmp): Likewise.
11962 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
11963 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
11964 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
11965 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
11967 * lib/abitset.h: Include bitset.h, not bbitset.h.
11968 * lib/ebitset.h: Likewise.
11969 * lib/lbitset.h: Likewise.
11971 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
11972 All instances of parameters of type enum bitset_opts are now of
11973 type enum_bitset_opts, to conform to the C Standard, and similarly
11974 for enum_bitset_type.
11975 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11976 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11978 Do not use "struct bitset_struct" to mean different things in
11979 different modules. Not only is this confusing, it violates
11980 the C Standard, which requires that structure types in different
11981 modules must be compatible if one is to be passed to the other.
11982 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
11983 All instances of "struct bitset_struct *" replaced with "bitset".
11984 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
11985 (union bitset_union, struct abitset_struct, struct ebitset_struct,
11986 struct lbitset_struct, struct bitset_stats_struct): New types.
11987 All uses of struct bitset_struct changed to union bitset_union,
11989 * lib/abitset.c (struct abitset_struct, abitset,
11990 struct bitset_struct): Remove.
11991 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
11992 struct bitset_struct): Remove.
11993 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
11994 bitset_struct): Remove.
11995 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
11998 Do not call a function of type T using a call that assumes the
11999 function is of a different type U. Standard C requires that a
12000 function must be called with a type that is compatible with its
12002 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12004 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12006 * lib/ebitset.c (PFV): Remove.
12007 * lib/lbitset.c (PFV): Likewise.
12008 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
12009 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
12011 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
12012 (ebitset_vtable): Use them.
12013 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
12014 lbitset_xor): New functions.
12015 (lbitset_vtable): Use them.
12017 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
12020 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
12022 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
12023 Use offsetof, for simplicity.
12025 2002-10-06 Paul Eggert <eggert@twinsun.com>
12027 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
12028 the same width as int. This reapplies a hunk of the 2002-08-12 patch
12029 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
12030 which was inadvertently undone by the 2002-09-30 patch.
12031 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
12032 the same width as int.
12034 2002-10-04 Paul Eggert <eggert@twinsun.com>
12038 * configure.ac (AC_INIT), NEWS: Increment version number.
12040 * doc/bison.texinfo: Minor spelling, grammar, and white space
12042 (Symbols): Mention that any negative value returned from yylex
12043 signifies end-of-input. Warn about negative chars. Mention
12044 the portable Standard C character set.
12046 The GNU coding standard says CFLAGS and YFLAGS are reserved
12047 for the installer to set.
12048 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
12049 * src/Makefile.am (AM_CFLAGS): Likewise.
12050 (AM_YFLAGS): Renamed from YFLAGS.
12052 Fix some MAX and MIN problems.
12053 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
12054 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
12055 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
12056 * src/reader.c (reader): Use it.
12058 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
12059 POSIX 1003.1-2001 has removed fgrep.
12061 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
12063 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
12064 interpreted as signed.
12065 * lib/ebitset.c (ebitset_list): Fix bug.
12067 2002-10-01 Paul Eggert <eggert@twinsun.com>
12069 More fixes for 64-bit hosts and large bitsets.
12071 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
12072 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
12073 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
12074 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
12075 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
12076 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
12077 bitset_count_): Likewise.
12078 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
12079 bitset_first, bitset_last): Likewise.
12080 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
12081 bitset_stats_list_reverse, bitset_stats_size,
12082 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
12084 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12085 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
12086 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
12087 bitsetv_reflexive_transitive_closure): Likewise.
12088 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
12089 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
12091 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
12094 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
12095 Use size_t, not unsigned int, to count bytes.
12096 * lib/abitset.h (abitset_bytes): Likewise.
12097 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
12099 * lib/bitset.h (bitset_bytes): Likewise.
12100 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
12101 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
12102 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12103 * lib/ebitset.c (ebitset_bytes): Likewise.
12104 * lib/ebitset.h (ebitset_bytes): Likewise.
12105 * lib/lbitset.c (lbitset_bytes): Likewise.
12106 * lib/lbitset.h (lbitset_bytes): Likewise.
12108 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
12109 abitset_subset_p, abitset_disjoint_p, abitset_and,
12110 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
12111 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
12112 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
12113 abitset_or_and, abitset_or_and_cmp):
12114 Use bitset_windex instead of unsigned int.
12115 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12116 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
12117 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
12118 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
12120 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
12122 * lib/bitset.c (bitset_print):
12123 Use proper printf formats for widths of integer types.
12124 * lib/bitset_stats.c (bitset_percent_histogram_print,
12125 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
12126 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12127 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12128 * lib/lbitset.c (lbitset_bytes): Likewise.
12130 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
12131 BITSET_SIZE_MAX): New macros.
12132 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
12133 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
12134 to BITSET_WINDEX_MAX.
12136 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
12137 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
12138 since we now return the bitset_bindex type (not int).
12140 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
12141 when computing sizes.
12142 * lib/ebitset.c (ebitset_elts_grow): Likewise.
12144 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
12145 and avoid cast to unsigned.
12147 2002-09-30 Akim Demaille <akim@epita.fr>
12149 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12150 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
12151 Updates from Michael Hayes.
12153 2002-09-30 Art Haas <ahaas@neosoft.com>
12155 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
12157 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
12160 2002-09-27 Akim Demaille <akim@epita.fr>
12164 2002-09-27 Akim Demaille <akim@epita.fr>
12166 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
12167 (Because of AC_LIBSOURCE).
12169 2002-09-27 Akim Demaille <akim@epita.fr>
12171 Playing with Autoscan.
12173 * configure.ac: Remove the old LIBOBJ tweaks.
12174 (AC_REPLACE_FUNCS): Add strrchr and strtol.
12175 * lib/strrchr.c: New.
12176 * lib/strtol.c: New, from the Coreutils 4.5.1.
12178 2002-09-27 Akim Demaille <akim@epita.fr>
12180 Playing with Autoscan.
12182 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
12183 * lib/Makefile.am (libbison_a_SOURCES): No longer include
12184 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
12185 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
12188 2002-09-24 Akim Demaille <akim@epita.fr>
12190 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
12191 (Frequently Asked Questions, Parser Stack Overflow): New.
12193 2002-09-13 Akim Demaille <akim@epita.fr>
12195 Playing with autoscan.
12197 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
12198 * src/files.c (skeleton_find): Remove, unused.
12199 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
12200 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
12202 2002-09-13 Akim Demaille <akim@epita.fr>
12204 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
12205 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
12207 2002-09-13 Akim Demaille <akim@epita.fr>
12209 * configure.ac: Require 2.54.
12210 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
12211 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
12212 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
12213 Remove, provided by Autoconf macros.
12215 2002-09-12 Akim Demaille <akim@epita.fr>
12217 * m4/prereq.m4: Update, from Coreutils 4.5.1.
12219 2002-09-12 Akim Demaille <akim@epita.fr>
12221 * m4/prereq.m4: Update, from Fileutils 4.1.5.
12222 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
12223 Reported by Martin Mokrejs.
12225 2002-09-10 Akim Demaille <akim@epita.fr>
12227 * src/parse-gram.y: Associate a human readable string to each
12229 * tests/regression.at (Invalid inputs): Adjust.
12231 2002-09-10 Gary V. Vaughan <gary@gnu.org>
12233 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
12234 with an Autoconf-2.5x style configure.ac.
12236 2002-09-06 Paul Eggert <eggert@twinsun.com>
12238 * doc/bison.texinfo (Conditions): Make explicit that the GPL
12239 exception applies only to yacc.c. This is a modification of a
12240 patch originally suggested by Akim Demaille.
12242 2002-09-06 Akim Demaille <akim@epita.fr>
12244 * data/c.m4 (b4_copyright): Move the GPL exception comment from
12246 * data/yacc.c: here.
12248 * data/lalr1.cc (struct yyltype): Don't define it, since we use
12250 (b4_ltype): Default to yy::Location from location.hh.
12252 2002-09-04 Jim Meyering <jim@meyering.net>
12254 * data/yacc.c: Guard the declaration of yytoknum also with
12255 `#ifdef YYPRINT', so it is declared only when used.
12257 2002-09-04 Akim Demaille <akim@epita.fr>
12259 * configure.in: Rename as...
12260 * configure.ac: this.
12263 2002-09-04 Akim Demaille <akim@epita.fr>
12265 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
12266 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
12267 translate maintainer only messages.
12269 2002-08-12 Paul Eggert <eggert@twinsun.com>
12273 * Makefile.am (SUBDIRS): Remove intl.
12274 (DISTCLEANFILES): Remove.
12275 * NEWS: Mention that GNU M4 is now required. Clarify what is
12276 meant by "larger grammars". Mention the pt_BR translation.
12277 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
12278 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
12279 Bump version from 0.11.2 to 0.11.5.
12280 (BISON_PREREQ_STAGE): Remove.
12281 (AM_GNU_GETTEXT): Use external gettext.
12282 (AC_OUTPUT): Remove intl/Makefile.
12284 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
12286 * data/glr.c: Include string.h, for strlen.
12287 (yyreportParseError): Use size_t for yysize.
12288 (yy_yypstack): No longer nested inside yypstates, as nested
12289 functions are not portable. Do not assume size_t is the
12291 (yypstates): Do not assume that ptrdiff_t is the same width
12292 as int, and similarly for yyposn and YYINDEX.
12294 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
12296 * lib/Makefile.am (INCLUDES): Do not include from the intl
12297 directory, which has been removed.
12298 * src/Makefile.am (INCLUDES): Likewise.
12300 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
12301 (bitsets_sources, additional_bitsets_sources, timevars_sources):
12304 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
12305 * tests/Makefile.am (EXTRA_DIST): Likewise.
12307 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
12308 Do not assume that bitset_windex is the same width as unsigned.
12310 * lib/abitset.c (abitset_unused_clear): Do not assume that
12311 bitset_word is the same width as int.
12312 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
12313 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
12314 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
12315 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
12316 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
12318 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
12319 portability to one's complement hosts!).
12320 * lib/ebitset.c (ebitset_op1): Likewise.
12321 * lib/lbitset.c (lbitset_op1): Likewise.
12323 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
12324 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12325 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
12326 Sync with fileutils.
12327 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
12328 lib/gettext.h: Sync with diffutils.
12330 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
12331 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
12333 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
12334 PROTOTYPES to check for prototypes, and "defined __STDC__" to
12337 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
12338 size_t; the old version tried to do this but casted improperly.
12339 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
12340 (bitset_test): Now returns int, not unsigned long.
12342 * lib/bitset_stats.c: Include "gettext.h".
12344 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
12345 name locals "index", as it generates unnecessary warnings on some
12346 hosts that have an "index" function.
12348 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
12349 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
12350 they need translation.
12351 * src/LR0.c (state_list_append, new_itemsets, get_state,
12352 append_states, generate_states): Likewise.
12353 * src/assoc.c (assoc_to_string): Likewise.
12354 * src/closure.c (print_closure, set_firsts, closure): Likewise.
12355 * src/gram.c (grammar_dump): Likewise.
12356 * src/injections.c (injections_compute): Likewise.
12357 * src/lalr.c (lookaheads_print): Likewise.
12358 * src/relation.c (relation_transpose): Likewise.
12359 * src/scan-gram.l: Likewise.
12360 * src/tables.c (table_grow, pack_vector): Likewise.
12362 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
12363 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
12364 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
12365 * m4/mbstate_t.m4: Sync with fileutils.
12366 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
12368 * po/LINGUAS: Add pt_BR.
12369 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
12370 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
12372 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
12374 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
12376 * src/complain.c (strerror_r): Remove decl; not needed.
12377 (strerror): Use same pattern as ../lib/error.c.
12379 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
12381 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
12383 * src/main.c (main): Cast result of bindtextdomain and textdomain
12384 to void, to avoid a GCC warning when --disable-nls is in effect.
12386 * src/scan-gram.l: Use strings rather than escapes when possible,
12387 to minimize the number of warnings from xgettext.
12388 (handle_action_dollar, handle_action_at): Don't use isdigit,
12389 as it mishandles negative chars and it may not work as expected
12390 outside the C locale.
12392 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
12393 this is a GCC extension and is not portable to other compilers.
12395 * src/system.h (alloca): Use same pattern as ../lib/error.c.
12396 Do not include <ctype.h>; no longer needed.
12397 Do not include <malloc.h>; no longer needed (and generates
12398 warnings on OpenBSD 3.0).
12400 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
12403 * tests/regression.at: Do not use 'cc -c input.c -o input';
12404 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
12406 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
12407 exit status as failure, not just exit status 1. Sun C exits
12408 with status 2 sometimes.
12410 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
12411 Use it for the two large tests.
12413 2002-08-02 Akim Demaille <akim@epita.fr>
12415 * src/conflicts.c (conflicts_output): Don't output rules never
12416 reduced here, since anyway that computation doesn't work.
12417 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
12418 (rule_useless_p, rule_never_reduced_p): New.
12419 (grammar_rules_partial_print): Use a filter instead of a range.
12420 Display the title only if needed.
12421 (grammar_rules_print): Adjust.
12422 (grammar_rules_never_reduced_report): New.
12423 * src/tables.c (action_row): Move the computation of rules never
12425 (token_actions): here.
12426 * src/main.c (main): Make the parser before making the report, so
12427 that rules never reduced are computed.
12428 Call grammar_rules_never_reduced_report.
12429 * src/print.c (print_results): Report rules never reduced.
12430 * tests/conflicts.at, tests/reduce.at: Adjust.
12432 2002-08-01 Akim Demaille <akim@epita.fr>
12434 Instead of attaching lookaheads and duplicating the rules being
12435 reduced by a state, attach the lookaheads to the reductions.
12437 * src/state.h (state_t): Remove the `lookaheads',
12438 `lookaheads_rule' member.
12439 (reductions_t): Add a `lookaheads' member.
12440 Use a regular array for the `rules'.
12441 * src/state.c (reductions_new): Initialize the lookaheads member
12443 (state_rule_lookaheads_print): Adjust.
12444 * src/state.h, src/state.c (state_reductions_find): New.
12445 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
12446 (count_rr_conflicts): Adjust.
12447 * src/lalr.c (LArule): Remove.
12448 (add_lookback_edge): Adjust.
12449 (state_lookaheads_count): New.
12450 (states_lookaheads_initialize): Merge into...
12451 (initialize_LA): this.
12452 (lalr_free): Adjust.
12453 * src/main.c (main): Don't free nullable and derives too early: it
12454 is used by --verbose.
12455 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
12457 2002-08-01 Akim Demaille <akim@epita.fr>
12459 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
12461 (set_derives, free_derives): Rename as...
12462 (derives_compute, derives_free): this.
12463 Adjust all dependencies.
12464 * src/nullable.c (set_nullable, free_nullable): Rename as...
12465 (nullable_compute, nullable_free): these.
12466 (rule_list_t): Store rule_t *, not rule_number_t.
12467 * src/state.c (state_rule_lookaheads_print): Directly compare rule
12468 pointers, instead of their numbers.
12469 * src/main.c (main): Call nullable_free, and derives_free earlier,
12470 as they were lo longer used.
12472 2002-08-01 Akim Demaille <akim@epita.fr>
12474 * lib/timevar.c (get_time): Include children time.
12475 * src/lalr.h (LA, LArule): Don't export them: used with the
12477 * src/lalr.c (LA, LArule): Static.
12478 * src/lalr.h, src/lalr.c (lalr_free): New.
12479 * src/main.c (main): Call it.
12480 * src/tables.c (pack_vector): Check whether loc is >= to the
12482 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
12483 (tables_generate): do it, since that's also it which allocates
12485 Don't free LA and LArule, main does.
12487 2002-07-31 Akim Demaille <akim@epita.fr>
12489 Separate parser tables computation and output.
12491 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
12492 (conflict_list, conflict_list_cnt, table, check, table_ninf)
12493 (yydefgoto, yydefact, high): Move to...
12494 * src/tables.h, src/tables.c: here.
12495 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12496 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12497 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
12498 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
12499 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
12500 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
12501 (action_row, save_row, token_actions, save_column, default_goto)
12502 (goto_actions, sort_actions, matching_state, pack_vector)
12503 (table_ninf_remap, pack_table, prepare_actions): Move to...
12504 * src/tables.c: here.
12505 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
12506 * src/output.c (token_actions, output_base, output_conflicts)
12507 (output_check): Merge into...
12508 (prepare_actions): this.
12509 (actions_output): Rename as...
12510 (user_actions_output): this.
12511 * src/main.c (main): Call tables_generate and tables_free.
12513 2002-07-31 Akim Demaille <akim@epita.fr>
12515 Steal GCC's --time-report support.
12517 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
12518 stolen/adjusted from GCC.
12519 * m4/stage.m4: Remove time related checks.
12520 * m4/timevar.m4: New.
12521 * configure.in: Adjust.
12522 * src/system.h: Adjust to using timevar.h.
12523 * src/getargs.h, src/getargs.c: Support trace_time for
12525 * src/main.c (stage): Remove.
12526 (main): Replace `stage' invocations with timevar calls.
12527 * src/output.c: Insert pertinent timevar calls.
12529 2002-07-31 Akim Demaille <akim@epita.fr>
12531 Let --trace have arguments.
12533 * src/getargs.h (enum trace_e): New.
12534 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
12535 (long_options, short_options): --trace/-T takes an optional
12537 Change all the uses of trace_flag to reflect the new flags.
12538 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
12540 Strengthen `stage' portability.
12542 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
12543 * configure.in: Use it.
12544 Don't check for malloc.h and sys/times.h.
12545 * src/system.h: Include them when appropriate.
12546 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
12547 times and struct tms are available.
12549 2002-07-30 Akim Demaille <akim@epita.fr>
12551 In verbose parse error message, don't report `error' as an
12553 * tests/actions.at (Printers and Destructors): Adjust.
12554 * tests/calc.at (Calculator $1): Adjust.
12555 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
12556 error message, do not report the parser accepts the error token in
12559 2002-07-30 Akim Demaille <akim@epita.fr>
12561 Normalize conflict related messages.
12563 * src/complain.h, src/complain.c (warn, complain): New.
12564 * src/conflicts.c (conflicts_print): Use them.
12565 (conflict_report_yacc): New, extracted from...
12566 (conflicts_print): here.
12567 * tests/conflicts.at, tests/existing.at: Adjust.
12569 2002-07-30 Akim Demaille <akim@epita.fr>
12571 Report rules which are never reduced by the parser: those hidden
12574 * src/LR0.c (save_reductions): Don't make the final state too
12575 different: save its reduction (accept) instead of having a state
12576 without any action (no shift or goto, no reduce).
12577 Note: the final state is now a ``regular'' state, i.e., the
12578 parsers now contain `reduce 0' as default reduction.
12579 Nevertheless, since they decide to `accept' when yystate =
12580 final_state, they still will not reduce rule 0.
12581 * src/print.c (print_actions, print_reduction): Adjust.
12582 * src/output.c (action_row): Track reduced rules.
12583 (token_actions): Report rules never reduced.
12584 * tests/conflicts.at, tests/regression.at: Adjust.
12586 2002-07-30 Akim Demaille <akim@epita.fr>
12588 `stage' was accidently included in a previous patch.
12589 Initiate its autoconfiscation.
12591 * configure.in: Look for malloc.h and sys/times.h.
12592 * src/main.c (stage): Adjust.
12593 Report only when trace_flag.
12595 2002-07-29 Akim Demaille <akim@epita.fr>
12597 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
12599 (errs_t): symbol_t*, not symbol_number_t.
12600 (reductions_t): rule_t*, not rule_number_t.
12601 (FOR_EACH_SHIFT): New.
12602 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
12603 * src/print.c, src/print_graph.c: Adjust.
12605 2002-07-29 Akim Demaille <akim@epita.fr>
12607 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
12609 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
12610 (endtoken, accept): these.
12611 * src/reader.c (reader): Set endtoken's default tag to "$end".
12612 Set undeftoken's tag to "$undefined" instead of "$undefined.".
12613 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
12616 2002-07-29 Akim Demaille <akim@epita.fr>
12618 * src/reduce.c (reduce_grammar): When the language is empty,
12619 complain about the start symbol, not the axiom.
12621 * tests/reduce.at (Empty Language): New.
12623 2002-07-26 Akim Demaille <akim@epita.fr>
12625 * src/reader.h, src/reader.c (gram_error): ... can't get
12626 yycontrol without making too strong assumptions on the parser
12628 * src/output.c (prepare_tokens): Use the real 0th value of
12629 token_translations instead of `0'.
12630 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
12632 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
12633 for the time being: %locations ought to provide it to yyerror.
12635 2002-07-25 Akim Demaille <akim@epita.fr>
12637 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
12638 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
12639 * tests/regression.at (Web2c Actions): Adjust.
12641 2002-07-25 Akim Demaille <akim@epita.fr>
12643 Stop storing rules from 1 to nrules + 1.
12645 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
12646 * src/nullable.c, src/output.c, src/print.c, src/reader.c
12647 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
12648 Iterate from 0 to nrules.
12649 Use rule_number_as_item_number and item_number_as_rule_number.
12650 Adjust to `derive' now containing possibly 0.
12651 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
12652 Handle the `- 1' part in rule numbers from/to item numbers.
12653 * src/conflicts.c (log_resolution): Fix the message which reversed
12655 * src/output.c (action_row): Initialize default_rule to -1.
12656 (token_actions): Adjust.
12657 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
12659 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
12661 2002-07-25 Akim Demaille <akim@epita.fr>
12663 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
12664 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
12665 (b4_c_knr_arg_decl): New.
12666 * data/yacc.c: Use it to define yysymprint, yydestruct, and
12667 yyreport_parse_error.
12669 2002-07-25 Akim Demaille <akim@epita.fr>
12671 * data/yacc.c (yyreport_parse_error): New, extracted from...
12673 (yydestruct, yysymprint): Move above yyparse.
12676 2002-07-25 Akim Demaille <akim@epita.fr>
12678 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
12680 (b4_sint_type, b4_uint_type): these.
12681 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
12682 * tests/regression.at (Web2c Actions): Adjust.
12684 2002-07-25 Akim Demaille <akim@epita.fr>
12686 * src/gram.h (TIEM_NUMBER_MAX): New.
12687 (item_number_of_rule_number, rule_number_of_item_number): Rename
12689 (rule_number_as_item_number, item_number_as_rule_number): these.
12690 Adjust dependencies.
12691 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12692 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12693 (symbol_number_to_vector_number): New.
12694 (order): Of vector_number_t* type.
12695 (base_t, BASE_MAX, BASE_MIN): New.
12696 (froms, tos, width, pos, check): Of base_t type.
12697 (action_number_t, ACTION_MIN, ACTION_MAX): New.
12698 (actrow): Of action_number_t type.
12699 (conflrow): Of unsigned int type.
12700 (table_ninf, base_ninf): New.
12701 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
12702 (muscle_insert_int_table, muscle_insert_base_table)
12703 (muscle_insert_rule_number_table): New.
12704 (prepare_tokens): Output `toknum' as int_table.
12705 (action_row): Returns a rule_number_t.
12706 Use ACTION_MIN, not SHRT_MIN.
12707 (token_actions): yydefact is rule_number_t*.
12708 (table_ninf_remap): New.
12709 (pack_table): Use it for `base' and `table'.
12710 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
12712 (YYPACT_NINF, YYTABLE_NINF): these.
12713 (yypact, yytable): Compute their types instead of hard-coded
12715 * tests/regression.at (Web2c Actions): Adjust.
12717 2002-07-19 Akim Demaille <akim@epita.fr>
12719 * src/scan-gram.l (id): Can start with an underscore.
12721 2002-07-16 Akim Demaille <akim@epita.fr>
12723 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
12724 Adjust all former `associativity' dependencies.
12725 * src/symtab.c (symbol_new): Default associativity is `undef', not
12727 (symbol_check_alias_consistence): Adjust.
12729 2002-07-09 Akim Demaille <akim@epita.fr>
12731 * doc/bison.texinfo: Properly set the ``header'' part.
12732 Use @dircategory ``GNU programming tools'' as per Texinfo's
12736 2002-07-09 Akim Demaille <akim@epita.fr>
12738 * lib/quotearg.h: Protect against multiple inclusions.
12739 * src/location.h (location_t): Add a `file' member.
12740 (LOCATION_RESET, LOCATION_PRINT): Adjust.
12741 * src/complain.c (warn_at, complain_at, fatal_at): Drop
12742 `error_one_per_line' support.
12744 2002-07-09 Akim Demaille <akim@epita.fr>
12746 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
12747 * src/reader.c (lineno): Remove.
12748 Adjust all dependencies.
12749 (get_merge_function): Take a location and use complain_at.
12750 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
12751 * tests/regression.at (Invalid inputs, Mixing %token styles):
12754 2002-07-09 Akim Demaille <akim@epita.fr>
12756 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
12757 recovery rule, and forbid extensions when --yacc.
12758 (gram_error): Use complain_at.
12759 * src/reader.c (reader): Exit if there were parse errors.
12761 2002-07-09 Akim Demaille <akim@epita.fr>
12763 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
12764 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
12765 Reported by R Blake <blakers@mac.com>.
12767 2002-07-09 Akim Demaille <akim@epita.fr>
12769 * data/yacc.c: Output the copyright notive in the header.
12771 2002-07-03 Akim Demaille <akim@epita.fr>
12773 * src/output.c (froms, tos): Are state_number_t.
12774 (save_column): sp, sp1, and sp2 are state_number_t.
12775 (prepare): Rename `final' as `final_state_number', `nnts' as
12776 `nterms_number', `nrules' as `rules_number', `nstates' as
12777 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
12779 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
12780 * data/lalr1.cc (nsym_): Remove, unused.
12782 2002-07-03 Akim Demaille <akim@epita.fr>
12784 * src/lalr.h, src/lalr.c (goto_number_t): New.
12785 * src/lalr.c (goto_list_t): New.
12787 * src/nullable.c (rule_list_t): New.
12789 * src/types.h: Remove.
12791 2002-07-03 Akim Demaille <akim@epita.fr>
12793 * src/closure.c (print_fderives): Use rule_rhs_print.
12794 * src/derives.c (print_derives): Use rule_rhs_print.
12795 (rule_list_t): New, replaces `shorts'.
12796 (set_derives): Add comments.
12797 * tests/sets.at (Nullable, Firsts): Adjust.
12799 2002-07-03 Akim Demaille <akim@epita.fr>
12801 * src/output.c (prepare_actions): Free `tally' and `width'.
12802 (prepare_actions): Allocate and free `order'.
12803 * src/symtab.c (symbols_free): Free `symbols'.
12804 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
12805 * src/output.c (m4_invoke): Move to...
12806 * src/scan-skel.l: here.
12807 (<<EOF>>): Close yyout, and free its name.
12809 2002-07-03 Akim Demaille <akim@epita.fr>
12811 Fix some memory leaks, and fix a bug: state 0 was examined twice.
12813 * src/LR0.c (new_state): Merge into...
12814 (state_list_append): this.
12815 (new_states): Merge into...
12816 (generate_states): here.
12817 (set_states): Don't ensure a proper `errs' state member here, do it...
12818 * src/conflicts.c (conflicts_solve): here.
12819 * src/state.h, src/state.c: Comment changes.
12820 (state_t): Rename member `shifts' as `transitions'.
12821 Adjust all dependencies.
12822 (errs_new): For consistency, also take the values as argument.
12823 (errs_dup): Remove.
12824 (state_errs_set): New.
12825 (state_reductions_set, state_transitions_set): Assert that no
12826 previous value was assigned.
12828 (states_free): Use it.
12829 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
12830 temporary storage: use `errs' and `nerrs' as elsewhere.
12831 (set_conflicts): Allocate and free this `errs'.
12833 2002-07-02 Akim Demaille <akim@epita.fr>
12835 * lib/libiberty.h: New.
12836 * lib: Update the bitset implementation from upstream.
12837 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
12838 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
12839 * src/main.c: Adjust bitset stats calls.
12841 2002-07-01 Paul Eggert <eggert@twinsun.com>
12843 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
12844 char, so that negative chars don't collide with $.
12846 2002-06-30 Akim Demaille <akim@epita.fr>
12848 Have the GLR tests be `warning' checked, and fix the warnings.
12850 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
12851 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
12852 (yyremoveDeletes): `yyi' and `yyj' are size_t.
12853 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
12854 (yyaddDeferredAction): static.
12855 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
12856 (yyreportParseError): yyprefix is const.
12857 yytokenp is used only when verbose.
12858 (yy__GNUC__): Replace with __GNUC__.
12859 (yypdumpstack): yyi is size_t.
12860 (yypreference): Un-yy local variables and arguments, to avoid
12861 clashes with `yyr1'. Anyway, we are not in the user name space.
12862 (yytname_size): be an int, as is compared with ints.
12863 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
12865 * tests/cxx-gram.at: Use quotation to protect $1.
12866 Use AT_COMPILE to enable warnings hunts.
12867 Prototype yylex and yyerror.
12869 Include `string.h', not `strings.h'.
12870 Produce and prototype stmtMerge only when used.
12871 yylex takes a location.
12873 2002-06-30 Akim Demaille <akim@epita.fr>
12875 We spend a lot of time in quotearg, in particular when --verbose.
12877 * src/symtab.c (symbol_get): Store a quoted version of the key.
12878 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
12879 Adjust all callers.
12881 2002-06-30 Akim Demaille <akim@epita.fr>
12883 * src/state.h (reductions_t): Rename member `nreds' as num.
12884 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
12885 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
12887 2002-06-30 Akim Demaille <akim@epita.fr>
12889 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
12890 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
12891 (shifts_to): Rename as...
12892 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
12893 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
12894 (TRANSITION_IS_DISABLED, transitions_to): these.
12896 2002-06-30 Akim Demaille <akim@epita.fr>
12898 * src/print.c (print_shifts, print_gotos): Merge into...
12899 (print_transitions): this.
12900 (print_transitions, print_errs, print_reductions): Align the
12901 lookaheads columns.
12902 (print_core, print_transitions, print_errs, print_state,
12903 print_grammar): Output empty lines separator before, not after.
12904 (state_default_rule_compute): Rename as...
12905 (state_default_rule): this.
12906 * tests/conflicts.at (Defaulted Conflicted Reduction),
12907 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
12908 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
12910 2002-06-30 Akim Demaille <akim@epita.fr>
12912 Display items as we display rules.
12914 * src/gram.h, src/gram.c (rule_lhs_print): New.
12915 * src/gram.c (grammar_rules_partial_print): Use it.
12916 * src/print.c (print_core): Likewise.
12917 * tests/conflicts.at (Defaulted Conflicted Reduction),
12918 (Unresolved SR Conflicts): Adjust.
12919 (Unresolved SR Conflicts): Adjust and rename as...
12920 (Resolved SR Conflicts): this, as was meant.
12921 * tests/regression.at (Web2c Report): Adjust.
12923 2002-06-30 Akim Demaille <akim@epita.fr>
12925 * src/print.c (state_default_rule_compute): New, extracted from...
12926 (print_reductions): here.
12927 Pessimize, but clarify the code.
12928 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
12930 2002-06-30 Akim Demaille <akim@epita.fr>
12932 * src/output.c (action_row): Let default_rule be always a rule
12935 2002-06-30 Akim Demaille <akim@epita.fr>
12937 * src/closure.c (print_firsts, print_fderives, closure):
12938 Use BITSET_EXECUTE.
12939 * src/lalr.c (lookaheads_print): Likewise.
12940 * src/state.c (state_rule_lookaheads_print): Likewise.
12941 * src/print_graph.c (print_core): Likewise.
12942 * src/print.c (print_reductions): Likewise.
12943 * src/output.c (action_row): Likewise.
12944 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
12946 2002-06-30 Akim Demaille <akim@epita.fr>
12948 * src/print_graph.c: Use report_flag.
12950 2002-06-30 Akim Demaille <akim@epita.fr>
12952 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
12954 * src/relation.h, src/relation.c (traverse, relation_digraph)
12955 (relation_print, relation_transpose): New.
12957 2002-06-30 Akim Demaille <akim@epita.fr>
12959 * src/state.h, src/state.c (shifts_to): New.
12960 * src/lalr.c (build_relations): Use it.
12962 2002-06-30 Akim Demaille <akim@epita.fr>
12964 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
12965 (item_number_of_rule_number, rule_number_of_item_number): New.
12966 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
12967 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
12968 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
12969 Propagate their use.
12970 Much remains to be done, in particular wrt `shorts' from types.h.
12972 2002-06-30 Akim Demaille <akim@epita.fr>
12974 * src/symtab.c (symbol_new): Initialize the `printer' member.
12976 2002-06-30 Akim Demaille <akim@epita.fr>
12978 * src/LR0.c (save_reductions): Remove, replaced by...
12979 * src/state.h, src/state.c (state_reductions_set): New.
12980 (reductions, errs): Rename as...
12981 (reductions_t, errs_t): these.
12982 Adjust all dependencies.
12984 2002-06-30 Akim Demaille <akim@epita.fr>
12986 * src/LR0.c (state_list_t, state_list_append): New.
12987 (first_state, last_state): Now symbol_list_t.
12988 (this_state): Remove.
12989 (new_itemsets, append_states, save_reductions): Take a state_t as
12991 (set_states, generate_states): Adjust.
12992 (save_shifts): Remove, replaced by...
12993 * src/state.h, src/state.c (state_shifts_set): New.
12994 (shifts): Rename as...
12996 Adjust all dependencies.
12997 * src/state.h (state_t): Remove the `next' member.
12999 2002-06-30 Akim Demaille <akim@epita.fr>
13001 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
13004 2002-06-30 Akim Demaille <akim@epita.fr>
13006 Use hash.h for the state hash table.
13008 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
13009 (allocate_storage): Use state_hash_new.
13010 (free_storage): Use state_hash_free.
13011 (new_state, get_state): Adjust.
13012 * src/lalr.h, src/lalr.c (states): Move to...
13013 * src/states.h (state_t): Remove the `link' member, no longer
13015 * src/states.h, src/states.c: here.
13016 (state_hash_new, state_hash_free, state_hash_lookup)
13017 (state_hash_insert, states_free): New.
13018 * src/states.c (state_table, state_compare, state_hash): New.
13019 * src/output.c (output_actions): Do not free states now, since we
13020 still need to know the final_state number in `prepare', called
13021 afterwards. Do it...
13022 * src/main.c (main): here: call states_free after `output'.
13024 2002-06-30 Akim Demaille <akim@epita.fr>
13026 * src/state.h, src/state.c (state_new): New, extracted from...
13027 * src/LR0.c (new_state): here.
13028 * src/state.h (STATE_ALLOC): Move to...
13029 * src/state.c: here.
13030 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
13031 * src/state.h, src/state.c: here.
13033 2002-06-30 Akim Demaille <akim@epita.fr>
13035 * src/reader.c (gensym): Rename as...
13036 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
13037 (getsym): Rename as...
13038 (symbol_get): this.
13040 2002-06-30 Akim Demaille <akim@epita.fr>
13042 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
13043 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
13044 * src/output.c, src/print.c, src/print_graph.c: Propagate.
13045 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
13047 2002-06-30 Akim Demaille <akim@epita.fr>
13049 Make the test suite pass with warnings checked.
13051 * tests/actions.at (Printers and Destructors): Improve.
13052 Avoid unsigned vs. signed issues.
13053 * tests/calc.at: Don't exercise the scanner here, do it...
13054 * tests/input.at (Torturing the Scanner): here.
13056 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13058 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
13059 reorganize first lines parallel to yacc.c.
13061 2002-06-28 Akim Demaille <akim@epita.fr>
13063 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
13064 (b4_token_enum, b4_token_defines): New, factored from...
13065 * data/lalr1.cc, data/yacc.c, glr.c: here.
13067 2002-06-28 Akim Demaille <akim@epita.fr>
13069 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
13071 * src/output.c (merger_output): static.
13073 2002-06-28 Akim Demaille <akim@epita.fr>
13075 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
13076 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
13078 * src/output.c (save_row): Initialize all the variables to pacify GCC.
13080 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13082 Accumulated changelog for new GLR parsing features.
13084 * src/conflicts.c (count_total_conflicts): Change name to
13085 conflicts_total_count.
13086 * src/conflicts.h: Ditto.
13087 * src/output.c (token_actions): Use the new name.
13088 (output_conflicts): Change conflp => conflict_list_heads, and
13089 confl => conflict_list for better readability.
13090 * data/glr.c: Use the new names.
13091 * NEWS: Add self to GLR announcement.
13093 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
13095 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
13098 * data/bison.glr: Change name to glr.c
13099 * data/glr.c: Renamed from bison.glr.
13100 * data/Makefile.am: Add glr.c
13104 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
13105 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
13107 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13109 * data/bison.glr: Be sure to restore the
13110 current #line when returning to the skeleton contents after having
13111 exposed the input file's #line.
13113 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13115 * data/bison.glr: Bring up to date with changes to bison.simple.
13117 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13119 * data/bison.glr: Correct definitions that use b4_prefix.
13120 Various reformatting.
13121 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
13122 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
13123 yytokenp argument; now part of stack.
13124 (yychar): Define to behave as documented.
13125 (yyclearin): Ditto.
13127 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13129 * src/reader.h: Add declaration for free_merger_functions.
13131 * src/reader.c (merge_functions): New variable.
13132 (get_merge_function): New function.
13133 (free_merger_functions): New function.
13134 (readgram): Check for %prec that is not followed by a symbol.
13135 Handle %dprec and %merge declarations.
13136 (packgram): Initialize dprec and merger fields in rules array.
13138 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
13139 conflict_list_cnt, conflict_list_free): New variables.
13140 (table_grow): Also grow conflict_table.
13141 (prepare_rules): Output dprec and merger tables.
13142 (conflict_row): New function.
13143 (action_row): Output conflict lists for GLR parser. Don't use
13144 default reduction in conflicted states for GLR parser so that there
13145 are spaces for the conflict lists.
13146 (save_row): Also save conflict information.
13147 (token_actions): Allocate conflict list.
13148 (merger_output): New function.
13149 (pack_vector): Pack conflict table, too.
13150 (output_conflicts): New function to output yyconflp and yyconfl.
13151 (output_check): Allocate conflict_tos.
13152 (output_actions): Output conflict tables, also.
13153 (output_skeleton): Output b4_mergers definition.
13154 (prepare): Output b4_max_rhs_length definition.
13155 Use 'bison.glr' as default skeleton for GLR parsers.
13157 * src/gram.c (glr_parser): New flag.
13158 (grammar_free): Call free_merger_functions.
13160 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
13161 all pairs of conflicting reductions, rather than just all tokens
13162 causing conflicts. Needed to size conflict tables.
13163 (conflicts_output): Modify call to count_rr_conflicts for new
13165 (conflicts_print): Ditto.
13166 (count_total_conflicts): New function.
13168 * src/reader.h (merger_list): New type.
13169 (merge_functions): New variable.
13171 * src/lex.h (tok_dprec, tok_merge): New token types.
13173 * src/gram.h (rule_s): Add dprec and merger fields.
13174 (glr_parser): New flag.
13176 * src/conflicts.h (count_total_conflicts): New function.
13178 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
13180 * doc/bison.texinfo (Generalized LR Parsing): New section.
13181 (GLR Parsers): New section.
13182 (Language and Grammar): Mention GLR parsing.
13183 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
13184 Correct typo ("tge" -> "the").
13186 * data/bison.glr: New skeleton for GLR parsing.
13188 * tests/cxx-gram.at: New tests for GLR parsing.
13190 * tests/testsuite.at: Include cxx-gram.at.
13192 * tests/Makefile.am: Add cxx-gram.at.
13194 * src/parse-gram.y:
13196 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
13198 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
13200 2002-06-27 Akim Demaille <akim@epita.fr>
13202 * src/options.h, src/options.c: Remove.
13203 * src/getargs.c (short_options, long_options): New.
13205 2002-06-27 Akim Demaille <akim@epita.fr>
13207 * data/bison.simple, data/bison.c++: Rename as...
13208 * data/yacc.c, data/lalr1.cc: these.
13209 * doc/bison.texinfo (Environment Variables): Remove.
13211 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
13213 * src/getargs.c (report_argmatch): Initialize strtok().
13215 2002-06-20 Akim Demaille <akim@epita.fr>
13217 * data/bison.simple (b4_symbol_actions): New, replaces...
13218 (b4_symbol_destructor, b4_symbol_printer): these.
13219 (yysymprint): Be sure to call YYPRINT only for tokens, and using
13220 user token numbers.
13222 2002-06-20 Akim Demaille <akim@epita.fr>
13224 * data/bison.simple (yydestructor): Rename as...
13225 (yydestruct): this.
13227 2002-06-20 Akim Demaille <akim@epita.fr>
13229 * src/symtab.h, src/symtab.c (symbol_type_set)
13230 (symbol_destructor_set, symbol_precedence_set): The location is
13232 Adjust all callers.
13234 2002-06-20 Akim Demaille <akim@epita.fr>
13236 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
13238 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
13240 * src/symtab.h, src/symtab.c (symbol_class_set)
13241 (symbol_user_token_number_set): Likewise.
13242 Adjust all callers.
13243 Promote complain_at.
13244 * tests/input.at (Type Clashes): Adjust.
13246 2002-06-20 Akim Demaille <akim@epita.fr>
13248 * data/bison.simple (YYLEX): Fix the declaration when
13251 2002-06-20 Akim Demaille <akim@epita.fr>
13253 * data/bison.simple (yysymprint): Don't print the token number,
13255 * tests/actions.at (Destructors): Rename as...
13256 (Printers and Destructors): this.
13257 Also exercise %printer.
13259 2002-06-20 Akim Demaille <akim@epita.fr>
13261 * data/bison.simple (YYDSYMPRINT): New.
13262 Use it to remove many of the #if YYDEBUG/if (yydebug).
13264 2002-06-20 Akim Demaille <akim@epita.fr>
13266 * src/symtab.h, src/symtab.c (symbol_t): printer and
13267 printer_location are new members.
13268 (symbol_printer_set): New.
13269 * src/parse-gram.y (PERCENT_PRINTER): New token.
13270 Handle its associated rule.
13271 * src/scan-gram.l: Adjust.
13272 (handle_destructor_at, handle_destructor_dollar): Rename as...
13273 (handle_symbol_code_at, handle_symbol_code_dollar): these.
13274 * src/output.c (symbol_printers_output): New.
13275 (output_skeleton): Call it.
13276 * data/bison.simple (yysymprint): New. Cannot be named yyprint
13277 since there are already many grammar files with a user `yyprint'.
13278 Replace the calls to YYPRINT to calls to yysymprint.
13279 * tests/calc.at: Adjust.
13280 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
13281 taking advantage of parser very internal details (stack size!).
13283 2002-06-20 Akim Demaille <akim@epita.fr>
13285 * src/scan-gram.l: Complete the scanner with the missing patterns
13287 Use `quote' and `symbol_tag_get' where appropriate.
13289 2002-06-19 Akim Demaille <akim@epita.fr>
13291 * tests/actions.at (Destructors): Augment to test locations.
13292 * data/bison.simple (yydestructor): Pass it the current location
13293 if locations are enabled.
13294 Prototype only when __STDC__ or C++.
13295 Change the argument names to move into the yy name space: there is
13298 2002-06-19 Akim Demaille <akim@epita.fr>
13300 * data/bison.simple (b4_pure_if): New.
13301 Use it instead of #ifdef YYPURE.
13303 2002-06-19 Akim Demaille <akim@epita.fr>
13305 * data/bison.simple (b4_location_if): New.
13306 Use it instead of #ifdef YYLSP_NEEDED.
13308 2002-06-19 Akim Demaille <akim@epita.fr>
13310 Prepare @$ in %destructor, but currently don't bind it in the
13311 skeleton, as %location use is not cleaned up yet.
13313 * src/scan-gram.l (handle_dollar, handle_destructor_at)
13314 (handle_action_at): New.
13315 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
13316 a braced_code_t and a location as additional arguments.
13317 (handle_destructor_dollar): Instead of requiring `b4_eval', just
13318 unquote one when outputting `b4_dollar_dollar'.
13320 * data/bison.simple (b4_eval): Remove.
13321 (b4_symbol_destructor): Adjust.
13322 * tests/input.at (Invalid @n): Adjust.
13324 2002-06-19 Zack Weinberg <zack@codesourcery.com>
13326 * doc/bison.texinfo: Document ability to have multiple
13329 2002-06-18 Akim Demaille <akim@epita.fr>
13331 * src/files.c (compute_base_names): When computing the output file
13332 names from the input file name, strip the directory part.
13334 2002-06-18 Akim Demaille <akim@epita.fr>
13336 * data/bison.simple.new: Comment changes.
13337 Reported by Andreas Schwab.
13339 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
13341 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
13342 there are no `label `yyoverflowlab' defined but not used' warnings
13343 when yyoverflow is defined.
13345 2002-06-18 Akim Demaille <akim@epita.fr>
13347 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
13349 (symbol_destructor_set): Adjust.
13350 * src/output.c (symbol_destructors_output): Output the destructor
13352 Output the symbol name.
13353 * data/bison.simple (b4_symbol_destructor): Adjust.
13355 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
13356 and Akim Demaille <akim@epita.fr>
13358 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
13359 what's left on the stack when the error recovery hits EOF.
13360 * tests/actions.at (Destructors): Complete to exercise this case.
13362 2002-06-17 Akim Demaille <akim@epita.fr>
13364 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
13365 arguments is really empty, not only equal to `[]'.
13366 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
13368 (symbol_destructor_set): New.
13369 * src/output.c (symbol_destructors_output): New.
13370 * src/reader.h (brace_code_t, current_braced_code): New.
13371 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
13372 (handle_dollar): Rename as...
13373 (handle_action_dollar): this.
13374 (handle_destructor_dollar): New.
13375 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
13376 (grammar_declaration): Use it.
13377 * data/bison.simple (yystos): Is always defined.
13378 (yydestructor): New.
13379 * tests/actions.at (Destructors): New.
13380 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
13382 2002-06-17 Akim Demaille <akim@epita.fr>
13384 * src/symlist.h, src/symlist.c (symbol_list_length): New.
13385 * src/scan-gram.l (handle_dollar, handle_at): Compute the
13386 rule_length only when needed.
13387 * src/output.c (actions_output, token_definitions_output): Output
13389 * src/symtab.c: Don't access directly to the symbol tag, use
13391 * src/parse-gram.y: Use symbol_list_free.
13393 2002-06-17 Akim Demaille <akim@epita.fr>
13395 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
13396 (symbol_list_prepend, get_type_name): Move to...
13397 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
13398 (symbol_list_prepend, symbol_list_n_type_name_get): here.
13399 Adjust all callers.
13400 (symbol_list_free): New.
13401 * src/scan-gram.l (handle_dollar): Takes a location.
13402 * tests/input.at (Invalid $n): Adjust.
13404 2002-06-17 Akim Demaille <akim@epita.fr>
13406 * src/reader.h, src/reader.c (symbol_list_new): Export it.
13407 (symbol_list_prepend): New.
13408 * src/parse-gram.y (%union): `list' is a new member.
13409 (symbols.1): New, replaces...
13410 (terms_to_prec.1, nterms_to_type.1): these.
13411 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
13412 Take a location as additional argument.
13413 Adjust all callers.
13415 2002-06-15 Akim Demaille <akim@epita.fr>
13417 * src/parse-gram.y: Move %token in the declaration section so that
13418 we don't depend upon CVS Bison.
13420 2002-06-15 Akim Demaille <akim@epita.fr>
13422 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
13423 * src/print.c (print_core): Use it.
13425 2002-06-15 Akim Demaille <akim@epita.fr>
13427 * src/conflicts.c (log_resolution): Accept the rule involved in
13428 the sr conflicts instead of the lookahead number that points to
13430 (flush_reduce): Accept the current lookahead vector as argument,
13431 instead of the index in LA.
13432 (resolve_sr_conflict): Accept the current number of lookahead
13433 bitset to consider for the STATE, instead of the index in LA.
13434 (set_conflicts): Adjust.
13435 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
13437 2002-06-15 Akim Demaille <akim@epita.fr>
13439 * src/state.h (state_t): Replace the `lookaheadsp' member, a
13440 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
13441 Adjust all dependencies.
13442 * src/lalr.c (initialize_lookaheads): Split into...
13443 (states_lookaheads_count, states_lookaheads_initialize): these.
13446 2002-06-15 Akim Demaille <akim@epita.fr>
13448 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
13450 (grammar_rules_print): here.
13451 * src/reduce.c (reduce_output): Use it.
13452 * tests/reduce.at (Useless Rules, Reduced Automaton)
13453 (Underivable Rules): Adjust.
13455 2002-06-15 Akim Demaille <akim@epita.fr>
13457 Copy BYacc's nice way to report the grammar.
13459 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
13461 Don't print the rules' location, it is confusing and useless.
13462 (rule_print): Use grammar_rhs_print.
13463 * src/print.c (print_grammar): Use grammar_rules_print.
13465 2002-06-15 Akim Demaille <akim@epita.fr>
13467 Complete and rationalize `useless thing' warnings.
13469 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
13470 (symbol_tag_print): New.
13471 Use them everywhere in place of accessing directly the tag member.
13472 * src/gram.h, src/gram.c (rule_print): New.
13473 Use it where a rule used to be printed `by hand'.
13474 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
13475 (reduce_grammar_tables): Report the useless rules.
13476 (reduce_print): Useless things are a warning, not an error.
13478 * tests/reduce.at (Useless Nonterminals, Useless Rules):
13479 (Reduced Automaton, Underivable Rules): Adjust.
13480 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
13481 * tests/conflicts.at (Unresolved SR Conflicts)
13482 (Solved SR Conflicts): Adjust.
13484 2002-06-15 Akim Demaille <akim@epita.fr>
13486 Let symbols have a location.
13488 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
13490 Adjust all callers.
13491 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
13492 Use location_t, not int.
13493 * src/symtab.c (symbol_check_defined): Take advantage of the
13495 * tests/regression.at (Invalid inputs): Adjust.
13497 2002-06-15 Akim Demaille <akim@epita.fr>
13499 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
13500 (input): Don't try to initialize yylloc here, do it in the
13502 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
13503 * src/gram.h (rule_t): Change line and action_line into location
13504 and action_location, of location_t type.
13505 Adjust all dependencies.
13506 * src/location.h, src/location.c (empty_location): New.
13507 * src/reader.h, src/reader.c (grammar_start_symbol_set)
13508 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
13509 (grammar_current_rule_symbol_append)
13510 (grammar_current_rule_action_append): Expect a location as argument.
13511 * src/reader.c (grammar_midrule_action): Adjust to attach an
13512 action's location as dummy symbol location.
13513 * src/symtab.h, src/symtab.c (startsymbol_location): New.
13514 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
13517 2002-06-14 Akim Demaille <akim@epita.fr>
13519 Grammar declarations may be found in the grammar section.
13521 * src/parse-gram.y (rules_or_grammar_declaration): New.
13522 (declarations): Each declaration may end with a semicolon, not
13524 (grammar_declaration): `"%union"'.
13525 (grammar): Branch to rules_or_grammar_declaration.
13527 2002-06-14 Akim Demaille <akim@epita.fr>
13529 * src/main.c (main): Invoke scanner_free.
13531 2002-06-14 Akim Demaille <akim@epita.fr>
13533 * src/output.c (m4_invoke): Extracted from...
13534 (output_skeleton): here.
13537 2002-06-14 Akim Demaille <akim@epita.fr>
13539 * src/parse-gram.y (directives, directive, gram)
13540 (grammar_directives, precedence_directives, precedence_directive):
13542 (declarations, declaration, grammar, grammar_declaration)
13543 (precedence_declaration, precedence_declarator): these.
13544 (symbol_declaration): New.
13546 2002-06-14 Akim Demaille <akim@epita.fr>
13548 * src/files.c (action_obstack): Remove, unused.
13549 (output_obstack): Remove it, and all its dependencies, as it is no
13551 * src/reader.c (epilogue_set): Build the epilogue in the
13553 * src/output.h, src/output.c (muscle_obstack): Move to...
13554 * src/muscle_tab.h, src/muscle_tab.h: here.
13555 (muscle_init): Initialize muscle_obstack.
13556 (muscle_free): New.
13557 * src/main.c (main): Call it.
13559 2002-06-14 Akim Demaille <akim@epita.fr>
13561 * src/location.h: New, extracted from...
13562 * src/reader.h: here.
13563 * src/Makefile.am (noinst_HEADERS): Merge into
13564 (bison_SOURCES): this.
13566 * src/parse-gram.y: Use location_t instead of Bison's.
13567 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
13568 Use location_t instead of ints.
13570 2002-06-14 Akim Demaille <akim@epita.fr>
13572 * data/bison.simple, data/bison.c++: Be sure to restore the
13573 current #line when returning to the skeleton contents after having
13574 exposed the input file's #line.
13576 2002-06-12 Akim Demaille <akim@epita.fr>
13578 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
13580 * tests/actions.at (Exotic Dollars): New.
13582 2002-06-12 Akim Demaille <akim@epita.fr>
13584 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
13586 * tests/input.at (Torturing the Scanner): New.
13588 2002-06-11 Akim Demaille <akim@epita.fr>
13590 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
13591 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
13592 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
13593 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
13594 * src/reader.c (reader): Use it.
13596 2002-06-11 Akim Demaille <akim@epita.fr>
13598 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
13599 Adjust all callers.
13600 (scanner_last_string_free): New.
13602 2002-06-11 Akim Demaille <akim@epita.fr>
13604 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
13605 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
13606 (last_string, YY_OBS_FREE): New.
13607 Use them when returning an ID.
13609 2002-06-11 Akim Demaille <akim@epita.fr>
13611 Have Bison grammars parsed by a Bison grammar.
13613 * src/reader.c, src/reader.h (prologue_augment): New.
13614 * src/reader.c (copy_definition): Remove.
13616 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
13617 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
13618 (grammar_current_rule_prec_set, grammar_current_rule_check)
13619 (grammar_current_rule_symbol_append)
13620 (grammar_current_rule_action_append): Export.
13621 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
13622 (symbol_list_action_append): Remove.
13623 Hook the routines from reader.
13624 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
13625 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
13627 * src/reader.c (read_declarations): Remove, unused.
13629 * src/parse-gram.y: Handle the epilogue.
13630 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
13631 (grammar_start_symbol_set): this.
13632 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
13633 * src/reader.c (readgram): Remove, unused.
13634 (reader): Adjust to insert eoftoken and axiom where appropriate.
13636 * src/reader.c (copy_dollar): Replace with...
13637 * src/scan-gram.h (handle_dollar): this.
13638 * src/parse-gram.y: Remove `%thong'.
13640 * src/reader.c (copy_at): Replace with...
13641 * src/scan-gram.h (handle_at): this.
13643 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
13646 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
13649 * src/reader.h, src/reader.c (grammar_rule_end): New.
13651 * src/parse.y (current_type, current_class): New.
13652 Implement `%nterm', `%token' support.
13653 Merge `%term' into `%token'.
13654 (string_as_id): New.
13655 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
13658 * src/parse-gram.y: Be sure to handle properly the beginning of
13661 * src/parse-gram.y: Handle %type.
13662 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
13664 * src/parse-gram.y: More directives support.
13665 * src/options.c: No longer handle source directives.
13667 * src/parse-gram.y: Fix %output.
13669 * src/parse-gram.y: Handle %union.
13670 Use the prologue locations.
13671 * src/reader.c (parse_union_decl): Remove.
13673 * src/reader.h, src/reader.c (epilogue_set): New.
13674 * src/parse-gram.y: Use it.
13676 * data/bison.simple, data/bison.c++: b4_stype is now either not
13677 defined, then default to int, or to the contents of %union,
13678 without `union' itself.
13680 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
13682 * src/output.c (actions_output): Don't output braces, as they are
13683 already handled by the scanner.
13685 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
13686 characters to themselves.
13688 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
13689 that the epilogue has a proper #line.
13691 * src/parse-gram.y: Handle precedence/associativity.
13693 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
13695 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
13696 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
13697 at all to define terminals that cannot be emitted.
13699 * src/scan-gram.l: Escape M4 characters.
13701 * src/scan-gram.l: Working properly with escapes in user
13702 strings/characters.
13704 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
13705 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
13707 Use more modest sizes, as for the time being the parser does not
13708 release memory, and therefore the process swallows a huge amount
13711 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
13712 stricter %token grammar.
13714 * src/symtab.h (associativity): Add `undef_assoc'.
13715 (symbol_precedence_set): Do nothing when passed an undef_assoc.
13716 * src/symtab.c (symbol_check_alias_consistence): Adjust.
13718 * tests/regression.at (Invalid %directive): Remove, as it is now
13720 (Invalid inputs): Adjust to the new error messages.
13721 (Token definitions): The new grammar doesn't allow too many
13724 * src/lex.h, src/lex.c: Remove.
13725 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
13726 (copy_character, copy_string2, copy_string, copy_identifier)
13727 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
13728 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
13729 (parse_action): Remove.
13730 * po/POTFILES.in: Adjust.
13732 2002-06-11 Akim Demaille <akim@epita.fr>
13734 * src/reader.c (parse_action): Don't store directly into the
13735 rule's action member: return the action as a string.
13736 Don't require `rule_length' as an argument: compute it.
13737 (grammar_current_rule_symbol_append)
13738 (grammar_current_rule_action_append): New, eved out from
13740 Remove `action_flag', `rulelength', unused now.
13742 2002-06-11 Akim Demaille <akim@epita.fr>
13744 * src/reader.c (grammar_current_rule_prec_set).
13745 (grammar_current_rule_check): New, eved out from...
13747 Remove `xaction', `first_rhs': useless.
13748 * tests/input.at (Type clashes): New.
13749 * tests/existing.at (GNU Cim Grammar): Adjust.
13751 2002-06-11 Akim Demaille <akim@epita.fr>
13753 * src/reader.c (grammar_midrule_action): New, Eved out from
13756 2002-06-11 Akim Demaille <akim@epita.fr>
13758 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
13760 (readgram): Use them as replacement of inlined code, crule and
13763 2002-06-11 Akim Demaille <akim@epita.fr>
13765 * src/reader.c (grammar_end, grammar_symbol_append): New.
13766 (readgram): Use them.
13767 Make the use of `p' as local as possible.
13769 2002-06-10 Akim Demaille <akim@epita.fr>
13771 GCJ's parser requires the tokens to be defined before the prologue.
13773 * data/bison.simple: Output the token definition before the user's
13775 * tests/regression.at (Braces parsing, Duplicate string)
13776 (Mixing %token styles): Check the output from bison.
13777 (Early token definitions): New.
13779 2002-06-10 Akim Demaille <akim@epita.fr>
13781 * src/symtab.c (symbol_user_token_number_set): Don't complain when
13782 assigning twice the same user number to a token, so that we can
13784 * src/lex.c (lex): here.
13785 Also use `symbol_class_set' instead of hand written code.
13786 * src/reader.c (parse_assoc_decl): Likewise.
13788 2002-06-10 Akim Demaille <akim@epita.fr>
13790 * src/symtab.c, src/symtab.c (symbol_class_set)
13791 (symbol_user_token_number_set): New.
13792 * src/reader.c (parse_token_decl): Use them.
13793 Use a switch instead of ifs.
13794 Use a single argument.
13796 2002-06-10 Akim Demaille <akim@epita.fr>
13798 Remove `%thong' support as it is undocumented, unused, duplicates
13799 `%token's job, and creates useless e-mail traffic with people who
13800 want to know what it is, why it is undocumented, unused, and
13801 duplicates `%token's job.
13803 * src/reader.c (parse_thong_decl): Remove.
13804 * src/options.c (option_table): Remove "thong".
13805 * src/lex.h (tok_thong): Remove.
13807 2002-06-10 Akim Demaille <akim@epita.fr>
13809 * src/symtab.c, src/symtab.c (symbol_type_set)
13810 (symbol_precedence_set): New.
13811 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
13812 (value_components_used): Remove, unused.
13814 2002-06-09 Akim Demaille <akim@epita.fr>
13816 Move symbols handling code out of the reader.
13818 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
13819 (axiom): Move to...
13820 * src/symtab.h, src/symtab.c: here.
13822 * src/gram.c (start_symbol): Remove: use startsymbol->number.
13823 * src/reader.c (startval): Rename as...
13824 * src/symtab.h, src/symtab.c (startsymbol): this.
13825 * src/reader.c: Adjust.
13827 * src/reader.c (symbol_check_defined, symbol_make_alias)
13828 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13829 (token_translations_init)
13831 * src/symtab.c: here.
13832 * src/reader.c (packsymbols): Move to...
13833 * src/symtab.h, src/symtab.c (symbols_pack): here.
13834 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
13837 2002-06-03 Akim Demaille <akim@epita.fr>
13839 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
13842 2002-06-03 Akim Demaille <akim@epita.fr>
13844 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
13845 structs with non literals.
13846 * src/scan-skel.l: never-interactive.
13847 * src/conflicts.c (enum conflict_resolution_e): No trailing
13849 * src/getargs.c (usage): Split long literal strings.
13850 Reported by Hans Aberg.
13852 2002-05-28 Akim Demaille <akim@epita.fr>
13854 * data/bison.c++: Use C++ ostreams.
13855 (cdebug_): New member.
13857 2002-05-28 Akim Demaille <akim@epita.fr>
13859 * src/output.c (output_skeleton): Be sure to allocate enough room
13860 for `/' _and_ for `\0' in full_skeleton.
13862 2002-05-28 Akim Demaille <akim@epita.fr>
13864 * data/bison.c++: Catch up with bison.simple:
13865 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13866 and Paul Eggert <eggert@twinsun.com>: `error' handing.
13867 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
13868 and popping traces.
13870 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13872 * src/output.c (output_skeleton): Put an explicit path in front of
13873 the skeleton file name, rather than relying on the -I directory,
13874 to partially alleviate effects of having a skeleton file lying around
13875 in the current directory.
13877 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13879 * src/conflicts.c (log_resolution): Correct typo:
13880 obstack_printf should be obstack_fgrow1.
13882 2002-05-26 Akim Demaille <akim@epita.fr>
13884 * src/state.h (state_t): `solved_conflicts' is a new member.
13885 * src/LR0.c (new_state): Set it to 0.
13886 * src/conflicts.h, src/conflicts.c (print_conflicts)
13887 (free_conflicts, solve_conflicts): Rename as...
13888 (conflicts_print, conflicts_free, conflicts_solve): these.
13890 * src/conflicts.c (enum conflict_resolution_e)
13891 (solved_conflicts_obstack): New, used by...
13892 (log_resolution): this.
13893 Adjust to attach the conflict resolution to each state.
13894 Complete the description with the precedence/associativity
13896 (resolve_sr_conflict): Adjust.
13897 * src/print.c (print_state): Output its solved_conflicts.
13898 * tests/conflicts.at (Unresolved SR Conflicts)
13899 (Solved SR Conflicts): Exercise --report=all.
13901 2002-05-26 Akim Demaille <akim@epita.fr>
13903 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13904 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13905 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
13906 (token_number_t, item_number_as_token_number)
13907 (token_number_as_item_number, muscle_insert_token_number_table):
13909 (symbol_number_t, item_number_as_symbol_number)
13910 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
13911 these, since it is more appropriate.
13913 2002-05-26 Akim Demaille <akim@epita.fr>
13915 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
13917 * data/bison.simple (yystos) [YYDEBUG]: New.
13918 (yyparse) [YYDEBUG]: Display the symbols which are popped during
13920 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
13922 2002-05-25 Akim Demaille <akim@epita.fr>
13924 * doc/bison.texinfo (Debugging): Split into...
13925 (Tracing): this new section, its former contents, and...
13926 (Understanding): this new section.
13927 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
13929 (report_flag): this.
13930 Adjust all dependencies.
13931 (report_args, report_types, report_argmatch): New.
13932 (usage, getargs): Report/support -r, --report.
13934 (struct option_table_struct): Rename as..,
13935 (struct option_table_s): this.
13936 Rename the `set_flag' member to `flag' to match with getopt_long's
13938 * src/options.c (option_table): Split verbose into an entry for
13939 %verbose, and another for --verbose.
13940 Support --report/-r, so remove -r from the obsolete --raw.
13941 * src/print.c: Attach full item sets and lookaheads reports to
13942 report_flag instead of trace_flag.
13943 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
13945 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13946 and Paul Eggert <eggert@twinsun.com>
13948 * data/bison.simple (yyparse): Correct error handling to conform to
13949 POSIX and yacc. Specifically, after syntax error is discovered,
13950 do not reduce further before shifting the error token.
13951 Clean up the code a bit by removing the labels yyerrdefault,
13952 yyerrhandle, yyerrpop.
13953 * NEWS: Document the above.
13955 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13957 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
13958 type; it isn't always big enough, since it doesn't necessarily
13959 include non-terminals.
13960 (yytranslate): Expand definition of yy_token_number_type, so that
13961 the latter can be removed.
13962 (yy_token_number_type): Remove, only one use.
13963 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
13964 don't use TokenNumberType as element type.
13966 * tests/regression.at: Modify expected output to agree with change
13967 to yyr1 and yytranslate.
13969 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
13971 * src/reader.c (parse_action): Use copy_character instead of
13974 2002-05-13 Akim Demaille <akim@epita.fr>
13976 * tests/regression.at (Token definitions): Prototype yylex and
13979 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13981 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
13982 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
13984 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
13986 2002-05-07 Akim Demaille <akim@epita.fr>
13988 * tests/synclines.at: Be sure to prototype yylex and yyerror to
13989 avoid GCC warnings.
13991 2002-05-07 Akim Demaille <akim@epita.fr>
13995 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
13996 over the RHS of each rule.
13997 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
13998 * src/state.h (state_t): Member `nitems' is unsigned short.
13999 * src/LR0.c (get_state): Adjust.
14000 * src/reader.c (packgram): Likewise.
14001 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
14003 (muscle_insert_int_table): Remove, unused.
14004 (prepare_rules): Remove `max'.
14006 2002-05-06 Akim Demaille <akim@epita.fr>
14008 * src/closure.c (print_firsts): Display of the symbol tags.
14009 (bitmatrix_print): Move to...
14010 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
14012 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
14014 2002-05-06 Akim Demaille <akim@epita.fr>
14016 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
14019 2002-05-06 Akim Demaille <akim@epita.fr>
14021 * src/LR0.c (new_state, get_state): Instead of using the global
14022 `kernel_size' and `kernel_base', have two new arguments:
14023 `core_size' and `core'.
14026 2002-05-06 Akim Demaille <akim@epita.fr>
14028 * src/reader.c (packgram): No longer end `ritem' with a 0
14029 sentinel: it is not used.
14031 2002-05-05 Akim Demaille <akim@epita.fr>
14033 New experimental feature: display the lookaheads in the report and
14036 * src/print (print_core): When --trace-flag, display the rules
14038 * src/print_graph.c (print_core): Likewise.
14039 Swap the arguments.
14042 2002-05-05 Akim Demaille <akim@epita.fr>
14044 * tests/torture.at (Many lookaheads): New test.
14046 2002-05-05 Akim Demaille <akim@epita.fr>
14048 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
14049 (GENERATE_MUSCLE_INSERT_TABLE): this.
14050 (output_int_table, output_unsigned_int_table, output_short_table)
14051 (output_token_number_table, output_item_number_table): Replace with...
14052 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
14053 (muscle_insert_short_table, muscle_insert_token_number_table)
14054 (muscle_insert_item_number_table): these.
14055 Adjust all callers.
14056 (prepare_tokens): Don't free `translations', since...
14057 * src/reader.h, src/reader.c (grammar_free): do it.
14059 * src/gram.h, src/gram.c (grammar_free): here.
14060 * data/bison.simple, data/bison.c++: b4_token_number_max is now
14063 2002-05-05 Akim Demaille <akim@epita.fr>
14065 * src/output.c (output_unsigned_int_table): New.
14066 (prepare_rules): `i' is unsigned.
14067 `prhs', `rline', `r2' are unsigned int.
14068 Rename muscle `rhs_number_max' as `rhs_max'.
14069 Output muscles `prhs_max', `rline_max', and `r2_max'.
14071 * data/bison.simple, data/bison.c++: Adjust to use these muscles
14072 to compute types instead of constant types.
14073 * tests/regression.at (Web2c Actions): Adjust.
14075 2002-05-04 Akim Demaille <akim@epita.fr>
14077 * src/symtab.h (SALIAS, SUNDEF): Rename as...
14078 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
14079 Adjust dependencies.
14080 * src/output.c (token_definitions_output): Be sure not to output a
14081 `#define 'a'' when fed with `%token 'a' "a"'.
14082 * tests/regression.at (Token definitions): New.
14084 2002-05-03 Paul Eggert <eggert@twinsun.com>
14086 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
14089 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
14091 * Makefile.am (SUBDIRS): Remove intl.
14092 (EXTRA_DIST): Add config/config.rpath.
14094 2002-05-03 Akim Demaille <akim@epita.fr>
14096 * data/bison.simple (m4_if): Don't output empty enums.
14097 And actually, output valid enum definitions :(.
14099 2002-05-03 Akim Demaille <akim@epita.fr>
14101 * configure.bat: Remove, completely obsolete.
14102 * Makefile.am (EXTRA_DIST): Adjust.
14103 Don't distribute config.rpath...
14104 * config/Makefile.am (EXTRA_DIST): Do it.
14106 2002-05-03 Akim Demaille <akim@epita.fr>
14108 * configure.in (GETTEXT_VERSION): New.
14109 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
14111 2002-05-03 Akim Demaille <akim@epita.fr>
14113 * data/bison.simple (b4_token_enum): New.
14114 (b4_token_defines): Use it to output tokens both as #define and
14116 Suggested by Paul Eggert.
14117 * src/output.c (token_definitions_output): Don't output spurious
14120 2002-05-03 Akim Demaille <akim@epita.fr>
14122 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14124 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
14126 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
14127 Update the stack class, give a try to deque as the default container.
14129 2002-05-02 Akim Demaille <akim@epita.fr>
14131 * data/bison.simple (yyparse): Do not implement @$ = @1.
14132 (YYLLOC_DEFAULT): Adjust to do it.
14133 * doc/bison.texinfo (Location Default Action): Fix.
14135 2002-05-02 Akim Demaille <akim@epita.fr>
14137 * src/reader.c (parse_braces): Merge into...
14138 (parse_action): this.
14140 2002-05-02 Akim Demaille <akim@epita.fr>
14142 * configure.in (ALL_LINGUAS): Remove.
14143 * po/LINGUAS, hr.po: New.
14145 2002-05-02 Akim Demaille <akim@epita.fr>
14147 Remove the so called hairy (semantic) parsers.
14149 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
14150 * src/gram.h, src/gram.c (semantic_parser): Remove.
14151 (rule_t): Remove the guard and guard_line members.
14152 * src/lex.h (token_t): remove tok_guard.
14153 * src/options.c (option_table): Remove %guard and %semantic_parser
14155 * src/output.c, src/output.h (guards_output): Remove.
14157 (token_definitions_output): Don't output the `T'
14159 (output_skeleton): Don't output the guards.
14160 * src/files.c, src/files.c (attrsfile): Remove.
14161 * src/reader.c (symbol_list): Remove the guard and guard_line
14163 Adjust dependencies.
14164 (parse_guard): Remove.
14165 * data/bison.hairy: Remove.
14166 * doc/bison.texinfo (Environment Variables): Remove occurrences of
14169 2002-05-02 Akim Demaille <akim@epita.fr>
14171 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
14172 (parse_guard): Rename the formal argument `stack_offset' as
14173 `rule_length', which is more readable.
14175 (copy_at, copy_dollar): Instead of outputting the hard coded
14176 values of $$, $n and so forth, output invocation to b4_lhs_value,
14177 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
14178 Note: this patch partially drops `semantic-parser' support: it
14179 always does `rule_length - n', where semantic parsers ought to
14181 * data/bison.simple, data/bison.c++ (b4_lhs_value)
14182 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
14184 2002-05-02 Akim Demaille <akim@epita.fr>
14186 * configure.in (AC_INIT): Bump to 1.49b.
14187 (AM_INIT_AUTOMAKE): Short invocation.
14189 2002-05-02 Akim Demaille <akim@epita.fr>
14193 2002-05-01 Akim Demaille <akim@epita.fr>
14195 * src/skeleton.h: Remove.
14197 2002-05-01 Akim Demaille <akim@epita.fr>
14199 * src/skeleton.h: Fix the #endif.
14200 Reported by Magnus Fromreide.
14202 2002-04-26 Paul Eggert <eggert@twinsun.com>
14204 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
14205 Define if we define YYSTYPE and YYLTYPE, respectively.
14206 (YYCOPY): Fix [] quoting problem in the non-GCC case.
14208 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
14210 * src/scan-skel.l: Postprocess quadrigraphs.
14212 * src/reader.c (copy_character): New function, used to output
14213 single characters while replacing `[' and `]' with quadrigraphs, to
14214 avoid troubles with M4 quotes.
14215 (copy_comment): Output characters with copy_character.
14216 (read_additionnal_code): Likewise.
14217 (copy_string2): Likewise.
14218 (copy_definition): Likewise.
14220 * tests/calc.at: Exercise M4 quoting.
14222 2002-04-25 Akim Demaille <akim@epita.fr>
14224 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
14225 between `!' and the command.
14226 Reported by Paul Eggert.
14228 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
14230 * tests/calc.at: Exercise prologue splitting.
14232 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
14233 `b4_post_prologue' instead of `b4_prologue'.
14235 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
14237 (output): Free pre_prologue_obstack and post_prologue_obstack.
14238 * src/files.h, src/files.c (attrs_obstack): Remove.
14239 (pre_prologue_obstack, post_prologue_obstack): New.
14240 * src/reader.c (copy_definition): Add a parameter to specify the
14241 obstack to fill, instead of using attrs_obstack unconditionally.
14242 (read_declarations): Pass pre_prologue_obstack to copy_definition if
14243 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
14245 2002-04-23 Paul Eggert <eggert@twinsun.com>
14247 * data/bison.simple: Remove unnecessary commentary and white
14248 space differences from 1_29-branch.
14249 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
14251 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
14252 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
14253 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
14254 constructors or destructors.
14256 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
14258 2002-04-23 Akim Demaille <akim@epita.fr>
14260 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
14261 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
14262 location with columns.
14263 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
14264 All reported by Paul Eggert.
14266 2002-04-22 Akim Demaille <akim@epita.fr>
14268 * src/reduce.c (dump_grammar): Move to...
14269 * src/gram.h, src/gram.c (grammar_dump): here.
14270 Be sure to separate long item numbers.
14271 Don't read the members of a rule's prec if its nil.
14273 2002-04-22 Akim Demaille <akim@epita.fr>
14275 * src/output.c (table_size, table_grow): New.
14276 (MAXTABLE): Remove, replace uses with table_size.
14277 (pack_vector): Instead of dying when the table is too big, grow it.
14279 2002-04-22 Akim Demaille <akim@epita.fr>
14281 * data/bison.simple (yyr1): Its type is that of a token number.
14282 * data/bison.c++ (r1_): Likewise.
14283 * tests/regression.at (Web2c Actions): Adjust.
14285 2002-04-22 Akim Demaille <akim@epita.fr>
14287 * src/reader.c (token_translations_init): 256 is now the default
14288 value for the error token, i.e., it will be assigned another
14289 number if the user assigned 256 to one of her tokens.
14290 (reader): Don't force 256 to error.
14291 * doc/bison.texinfo (Symbols): Adjust.
14292 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
14293 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
14294 etc. instead of 10, 20, 30 (which was used to `jump' over error
14295 (256) and undefined (2)).
14297 2002-04-22 Akim Demaille <akim@epita.fr>
14299 Propagate more token_number_t.
14301 * src/gram.h (token_number_as_item_number)
14302 (item_number_as_token_number): New.
14303 * src/output.c (GENERATE_OUTPUT_TABLE): New.
14304 Use it to create output_item_number_table and
14305 output_token_number_table.
14306 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14307 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
14308 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
14309 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
14311 2002-04-22 Akim Demaille <akim@epita.fr>
14313 * src/output.h, src/output.c (get_lines_number): Remove.
14315 2002-04-19 Akim Demaille <akim@epita.fr>
14317 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
14319 (Debugging): More details about enabling the debugging features.
14320 (Table of Symbols): Describe $$, $n, @$, and @n.
14321 Suggested by Tim Josling.
14323 2002-04-19 Akim Demaille <akim@epita.fr>
14325 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
14327 2002-04-10 Akim Demaille <akim@epita.fr>
14329 * src/system.h: Rely on HAVE_LIMITS_H.
14330 Suggested by Paul Eggert.
14332 2002-04-09 Akim Demaille <akim@epita.fr>
14334 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
14335 full stderr, and strip it according to the bison options, instead
14336 of composing the error message from different bits.
14337 This makes it easier to check for several error messages.
14338 Adjust all the invocations.
14339 Add an invocation exercising the error token.
14340 Add an invocation demonstrating a stupid error message.
14341 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
14343 Error message are for stderr, not stdout.
14345 2002-04-09 Akim Demaille <akim@epita.fr>
14347 * src/gram.h, src/gram.c (error_token_number): Remove, use
14349 * src/reader.c (reader): Don't specify the user token number (2)
14350 for $undefined, as it uselessly prevents using it.
14351 * src/gram.h (token_number_t): Move to...
14352 * src/symtab.h: here.
14353 (state_t.number): Is a token_number_t.
14354 * src/print.c, src/reader.c: Use undeftoken->number instead of
14356 (Even though this 2 is not the same as above: the number of the
14357 undeftoken remains being 2, it is its user token number which
14359 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
14360 `user_token_number_max'.
14361 Output `undef_token_number'.
14362 * data/bison.simple, data/bison.c++: Use them.
14363 Be sure to map invalid yylex return values to
14364 `undef_token_number'. This saves us from gratuitous SEGV.
14366 * tests/conflicts.at (Solved SR Conflicts)
14367 (Unresolved SR Conflicts): Adjust.
14368 * tests/regression.at (Web2c Actions): Adjust.
14370 2002-04-08 Akim Demaille <akim@epita.fr>
14372 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
14374 Remove the duplicate `typedefs'.
14375 (RhsNumberType): Fix the declaration and various other typos.
14377 * data/bison.simple: Use __ofile__.
14378 * src/scan-skel.l: Handle __ofile__.
14380 2002-04-08 Akim Demaille <akim@epita.fr>
14382 * src/gram.h (item_number_t): New, the type of item numbers in
14383 RITEM. Note that it must be able to code symbol numbers as
14384 positive number, and the negation of rule numbers as negative
14386 Adjust all dependencies (pretty many).
14387 * src/reduce.c (rule): Remove this `short *' pointer: use
14389 * src/system.h (MINSHORT, MAXSHORT): Remove.
14390 Include `limits.h'.
14391 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
14392 (shortcpy): Remove.
14393 (MAXTABLE): Move to...
14394 * src/output.c (MAXTABLE): here.
14395 (prepare_rules): Use output_int_table to output rhs.
14396 * data/bison.simple, data/bison.c++: Adjust.
14397 * tests/torture.at (Big triangle): Move the limit from 254 to
14399 * tests/regression.at (Web2c Actions): Ajust.
14401 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
14402 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
14403 passes, but produces negative #line number, once fixed, GCC is
14404 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
14406 * src/state.h (state_h): Code input lines on ints, not shorts.
14408 2002-04-08 Akim Demaille <akim@epita.fr>
14410 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
14411 and then the grammar.
14413 2002-04-08 Akim Demaille <akim@epita.fr>
14415 * src/system.h: No longer using strndup.
14417 2002-04-07 Akim Demaille <akim@epita.fr>
14419 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
14420 * src/output.c (output_table_data): Return the longest number.
14421 (prepare_tokens): Output `token_number_max').
14422 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
14424 Use them to define yy_token_number_type/TokenNumberType.
14425 Use this type for yytranslate.
14426 * tests/torture.at (Big triangle): Push the limit from 124 to
14428 * tests/regression.at (Web2c Actions): Adjust.
14430 2002-04-07 Akim Demaille <akim@epita.fr>
14432 * tests/torture.at (Big triangle): New.
14433 (GNU AWK Grammar, GNU Cim Grammar): Move to...
14434 * tests/existing.at: here.
14436 2002-04-07 Akim Demaille <akim@epita.fr>
14438 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
14440 Adjust dependencies.
14442 2002-04-07 Akim Demaille <akim@epita.fr>
14444 * src/reader.c: Normalize increments to prefix form.
14446 2002-04-07 Akim Demaille <akim@epita.fr>
14448 * src/reader.c, symtab.c: Remove debugging code.
14450 2002-04-07 Akim Demaille <akim@epita.fr>
14452 Rename all the `bucket's as `symbol_t'.
14454 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
14455 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
14456 * src/symtab.c, src/symtab.h (bucket): Rename as...
14458 (symbol_list_new, bucket_check_defined, bucket_make_alias)
14459 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
14460 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14461 (buckets_new, buckets_free, buckets_do): Rename as...
14462 (symbol_list_new, symbol_check_defined, symbol_make_alias)
14463 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
14464 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
14465 (symbols_new, symbols_free, symbols_do): these.
14467 2002-04-07 Akim Demaille <akim@epita.fr>
14469 Use lib/hash for the symbol table.
14471 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
14473 * src/lex.c (lex): Set the `number' member of new terminals.
14474 * src/reader.c (bucket_check_defined, bucket_make_alias)
14475 (bucket_check_alias_consistence, bucket_translation): New.
14476 (reader, grammar_free, readgram, token_translations_init)
14477 (packsymbols): Adjust.
14478 (reader): Number the predefined tokens.
14479 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
14480 for predefined tokens.
14481 * src/symtab.h (bucket): Remove all the hash table related
14483 * src/symtab.c (symtab): Replace by...
14484 (bucket_table): this.
14485 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14486 (buckets_new, buckets_do): New.
14488 2002-04-07 Akim Demaille <akim@epita.fr>
14490 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
14491 (start_symbol, max_user_token_number, semantic_parser)
14492 (error_token_number): Initialize.
14493 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
14496 (errtoken, eoftoken, undeftoken, axiom): Extern.
14498 2002-04-07 Akim Demaille <akim@epita.fr>
14500 * src/gram.h (rule_s): prec and precsym are now pointers
14501 to the bucket giving the priority/associativity.
14502 Member `associativity' removed: useless.
14503 * src/reduce.c, src/conflicts.c: Adjust.
14505 2002-04-07 Akim Demaille <akim@epita.fr>
14507 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
14508 Properly escape the symbols' TAG when outputting them.
14510 2002-04-07 Akim Demaille <akim@epita.fr>
14512 * src/lalr.h (LA): Is a bitsetv, not bitset*.
14514 2002-04-07 Akim Demaille <akim@epita.fr>
14516 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
14517 (LArule): this, which is an array to rule_t*.
14518 * src/print.c, src/conflicts.c: Adjust.
14520 2002-04-07 Akim Demaille <akim@epita.fr>
14522 * src/gram.h (rule_t): Rename `number' as `user_number'.
14523 `number' is a new member.
14524 Adjust dependencies.
14525 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
14527 2002-04-07 Akim Demaille <akim@epita.fr>
14529 As a result of the previous patch, it is no longer needed
14530 to reorder ritem itself.
14532 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
14534 2002-04-07 Akim Demaille <akim@epita.fr>
14536 Be sure never to walk through RITEMS, but use only data related to
14537 the rules themselves. RITEMS should be banished.
14539 * src/output.c (output_token_translations): Rename as...
14540 (prepare_tokens): this.
14541 In addition to `translate', prepare the muscles `tname' and
14542 `toknum', which were handled by...
14543 (output_rule_data): this.
14544 Remove, and move the remainder of its outputs into...
14545 (prepare_rules): this new routines, which also merges content from
14546 (output_gram): this.
14547 (prepare_rules): Be sure never to walk through RITEMS.
14548 (output_stos): Rename as...
14549 (prepare_stos): this.
14550 (output): Always invoke prepare_states, after all, just don't use it
14551 in the output if you don't need it.
14553 2002-04-07 Akim Demaille <akim@epita.fr>
14555 * src/LR0.c (new_state): Display `nstates' as the name of the
14556 newly created state.
14557 Adjust to initialize first_state and last_state if needed.
14558 Be sure to distinguish the initial from the final state.
14559 (new_states): Create the itemset of the initial state, and use
14561 * src/closure.c (closure): Now that the initial state has its
14562 items properly set, there is no need for a special case when
14563 creating `ruleset'.
14565 As a result, now the rule 0, reducing to $axiom, is visible in the
14566 outputs. Adjust the test suite.
14568 * tests/conflicts.at (Solved SR Conflicts)
14569 (Unresolved SR Conflicts): Adjust.
14570 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
14571 * tests/conflicts.at (S/R in initial): New.
14573 2002-04-07 Akim Demaille <akim@epita.fr>
14575 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
14576 the RHS of the rules.
14577 * src/output.c (output_gram): Likewise.
14579 2002-04-07 Akim Demaille <akim@epita.fr>
14581 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
14583 Adjust all dependencies.
14584 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
14585 `number' of the buckets too.
14586 * src/gram.h: Include `symtab.h'.
14587 (associativity): Move to...
14588 * src/symtab.h: here.
14589 No longer include `gram.h'.
14591 2002-04-07 Akim Demaille <akim@epita.fr>
14593 * src/gram.h, src/gram.c (rules_rhs_length): New.
14594 (ritem_longest_rhs): Use it.
14595 * src/gram.h (rule_t): `number' is a new member.
14596 * src/reader.c (packgram): Set it.
14597 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
14598 the end of `rules', and count them out of `nrules'.
14599 (reduce_output, dump_grammar): Adjust.
14600 * src/print.c (print_grammar): It is no longer needed to check for
14601 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
14602 * tests/reduce.at (Reduced Automaton): New test.
14604 2002-04-07 Akim Demaille <akim@epita.fr>
14606 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
14607 lacking `+ 1' to nrules, Bison reported as useless a token if it
14608 was used solely to set the precedence of the last rule...
14610 2002-04-07 Akim Demaille <akim@epita.fr>
14612 * data/bison.c++, data/bison.simple: Don't output the current file
14613 name in #line, to avoid useless diffs between two identical
14614 outputs under different names.
14616 2002-04-07 Akim Demaille <akim@epita.fr>
14618 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
14619 Normalize loops to using `< nrules + 1', not `<= nrules'.
14621 2002-04-07 Akim Demaille <akim@epita.fr>
14625 2002-04-07 Akim Demaille <akim@epita.fr>
14627 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
14628 bucket.value as bucket.number.
14630 2002-04-07 Akim Demaille <akim@epita.fr>
14632 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
14633 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14634 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
14635 RHS, instead of being an index in RITEMS.
14637 2002-04-04 Paul Eggert <eggert@twinsun.com>
14639 * doc/bison.texinfo: Update copyright date.
14640 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
14641 (Symbols): Warn about running Bison in one character set,
14642 but compiling and/or running in an incompatible one.
14643 Warn about character code 256, too.
14645 2002-04-03 Paul Eggert <eggert@twinsun.com>
14647 * src/bison.data (YYSTACK_ALLOC): Depend on whether
14648 YYERROR_VERBOSE is nonzero, not whether it is defined.
14650 Merge changes from bison-1_29-branch.
14652 2002-03-20 Paul Eggert <eggert@twinsun.com>
14654 Merge fixes from Debian bison_1.34-1.diff.
14656 * configure.in (AC_PREREQ): 2.53.
14658 2002-03-20 Akim Demaille <akim@epita.fr>
14660 * src/conflicts.c (log_resolution): Argument `resolution' is const.
14662 2002-03-19 Paul Eggert <eggert@twinsun.com>
14664 * src/bison.simple (YYCOPY): New macro.
14665 (YYSTACK_RELOCATE): Use it.
14666 Remove Type arg; no longer needed. All callers changed.
14667 (yymemcpy): Remove; no longer needed.
14669 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
14670 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14672 2002-03-19 Akim Demaille <akim@epita.fr>
14674 Test and fix the #line outputs.
14676 * tests/atlocal.at (GCC): New.
14677 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
14678 (Prologue synch line, %union synch line, Postprologue synch line)
14679 (Action synch line, Epilogue synch line): New tests.
14680 * src/reader.c (parse_union_decl): Define the muscle stype_line.
14681 * data/bison.simple, data/bison.c++: Use it.
14683 2002-03-19 Akim Demaille <akim@epita.fr>
14685 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
14686 (Solved SR Conflicts, %expect not enough, %expect right)
14687 (%expect too much): Move to...
14688 * tests/conflicts.at: this new file.
14690 2002-03-19 Akim Demaille <akim@epita.fr>
14692 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14693 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
14694 that we can move to enums for instance.
14695 * src/output.c (token_definitions_output): Output a list of
14696 `token-name, token-number' instead of the #define.
14697 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
14699 2002-03-14 Akim Demaille <akim@epita.fr>
14701 Use Gettext 0.11.1.
14703 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
14705 * data/bison.c++: Make the user able to add members to the generated
14706 parser by subclassing.
14708 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
14710 * src/reader.c (read_additionnal_code): `c' should be an integer, not
14712 Reported by Nicolas Tisserand and Nicolas Burrus.
14714 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
14716 * src/reader.c: Warn about lacking semi-colons, do not complain.
14718 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
14720 * data/bison.c++: Remove a debug line.
14722 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
14724 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
14725 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
14726 provide a default implementation.
14728 2002-03-04 Akim Demaille <akim@epita.fr>
14730 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
14731 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
14732 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
14733 * tests/semantic.at (Parsing Guards): Similarly.
14734 * src/reader.at (readgram): Complain if the last rule is not ended
14737 2002-03-04 Akim Demaille <akim@epita.fr>
14739 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
14740 * src/closure.c: here.
14741 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
14743 * src/warshall.h, src/warshall.c: Remove.
14744 * tests/sets.at (Broken Closure): Adjust.
14746 2002-03-04 Akim Demaille <akim@epita.fr>
14748 * src/output.c (output_skeleton): tempdir is const.
14749 bytes_read is unused.
14751 2002-03-04 Akim Demaille <akim@epita.fr>
14753 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14754 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
14756 From Michael Hayes.
14758 2002-03-04 Akim Demaille <akim@epita.fr>
14760 * src/closure.c (closure): `r' is unused.
14762 2002-03-04 Akim Demaille <akim@epita.fr>
14764 * tests/sets.at (Broken Closure): Add the ending `;'.
14765 * src/reader.at (readgram): Complain if a rule is not ended with a
14768 2002-03-04 Akim Demaille <akim@epita.fr>
14770 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
14771 (count_sr_conflicts): Use bitset_count.
14772 * src/reduce.c (inaccessable_symbols): Ditto.
14773 (bits_size): Remove.
14774 * src/warshall.h, src/warshall.c: Convert to bitsetv.
14776 2002-03-04 Akim Demaille <akim@epita.fr>
14778 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
14779 * src/reduce.c: Remove the `bitset_zero's following the
14780 `bitset_create's, as now it is performed by the latter.
14782 2002-03-04 Akim Demaille <akim@epita.fr>
14784 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
14785 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
14786 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
14787 latest sources from Michael.
14789 2002-03-04 Akim Demaille <akim@epita.fr>
14791 * src/output.c (output): Don't free the grammar.
14792 * src/reader.c (grammar_free): New.
14793 * src/main.c (main): Call it and don't free symtab here.
14795 2002-03-04 Akim Demaille <akim@epita.fr>
14797 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
14799 Reported by Benoit Perrot.
14801 2002-03-04 Akim Demaille <akim@epita.fr>
14803 Use bitset operations when possible, not loops over bits.
14805 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
14807 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
14808 * src/reduce.c (useless_nonterminals): Formatting changes.
14809 * src/warshall.c (TC): Use bitset_or.
14811 2002-03-04 Akim Demaille <akim@epita.fr>
14813 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
14814 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
14817 2002-03-04 Akim Demaille <akim@epita.fr>
14819 * src/lalr.c (F): Now a bitset*.
14820 Adjust all dependencies.
14822 2002-03-04 Akim Demaille <akim@epita.fr>
14824 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
14825 Adjust all dependencies.
14827 2002-03-04 Akim Demaille <akim@epita.fr>
14829 * src/L0.c, src/LR0.h (nstates): Be size_t.
14830 Adjust comparisons (signed vs unsigned).
14831 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
14833 Adjust all dependencies.
14835 2002-03-04 Akim Demaille <akim@epita.fr>
14837 * src/closure.c (firsts): Now, also a bitset.
14838 Adjust all dependencies.
14839 (varsetsize): Remove, now unused.
14840 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
14842 2002-03-04 Akim Demaille <akim@epita.fr>
14844 * src/print.c: Convert to use bitset.h, not hand coded iterations
14847 2002-03-04 Akim Demaille <akim@epita.fr>
14849 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
14851 2002-03-04 Akim Demaille <akim@epita.fr>
14853 * src/closure.c (ruleset): Be a bitset.
14854 (rulesetsize): Remove.
14856 2002-03-04 Akim Demaille <akim@epita.fr>
14858 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14859 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
14860 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
14861 * src/closure.c (fderives): Be an array of bitsets.
14863 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
14865 * data/bison.c++: Merge the two generated headers. Insert a copyright
14866 notice in each output file.
14868 2002-02-28 Akim Demaille <akim@epita.fr>
14870 * data/bison.c++: Copy the prologue of bison.simple to fetch
14871 useful M4 definitions, such as b4_header_guard.
14873 2002-02-25 Akim Demaille <akim@epita.fr>
14875 * src/getargs.c (version): Give the name of the authors, and use a
14876 translator friendly scheme for the bgr
14879 2002-02-25 Akim Demaille <akim@epita.fr>
14881 * src/output.c (header_output): Remove, now handled completely via
14884 2002-02-25 Akim Demaille <akim@epita.fr>
14886 * m4/m4.m4: New, from CVS Autoconf.
14887 * configure.in: Invoke it.
14888 * src/output.c (output_skeleton): Use its result instead of the
14891 2002-02-25 Akim Demaille <akim@epita.fr>
14893 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
14895 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
14896 * src/output.c (output_skeleton): Use mkstemp to create a real
14898 Move the filling of `skeleton' and its muscle to...
14900 (output): Move the definition of the prologue muscle to...
14902 * src/system.h (DEFAULT_TMPDIR): New.
14904 2002-02-14 Paul Eggert <eggert@twinsun.com>
14906 Remove the support for C++ namespace cleanliness; it was
14907 causing more problems than it was curing, since it didn't work
14908 properly on some nonstandard C++ compilers. This can wait
14909 for a proper C++ parser.
14911 * NEWS: Document this.
14912 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
14913 of C++, as it's treated like C now.
14914 * src/bison.simple (YYSTD): Remove.
14915 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
14916 Treat C++ just like Standard C instead of trying to support
14917 namespace cleanliness.
14919 2002-02-14 Akim Demaille <akim@epita.fr>
14921 * tests/regression.at (else): Adjust to Andreas' change.
14923 2002-02-14 Akim Demaille <akim@epita.fr>
14925 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
14927 2002-02-13 Andreas Schwab <schwab@suse.de>
14929 * src/output.c (output_rule_data): Don't output NULL, it might
14930 not be defined yet.
14932 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
14934 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
14935 (Copyright notice): Update.
14937 2002-02-11 Akim Demaille <akim@epita.fr>
14939 * tests/regression.at (%nonassoc and eof): Don't include
14940 nonportable headers.
14942 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
14944 * data/bison.c++: Correct error recovery. Make the user able to
14945 initialize the starting location.
14947 2002-02-07 Akim Demaille <akim@epita.fr>
14949 * tests/input.at: New.
14951 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14953 * data/bison.c++: Replace some direct m4 expansions by constants. Be
14954 more consistent when naming methods and variables. Put preprocessor
14955 directives around tables only needed for debugging.
14957 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14959 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
14961 (yy::b4_name::parse): Use print_.
14963 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14965 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
14967 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14969 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
14971 (yy::b4_name::parse): Build verbose error messages, and use error_.
14973 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
14975 * data/bison.c++: Fix m4 quoting in comments.
14977 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
14979 * data/bison.c++: Adjust the parser code. Fix some muscles that were
14980 not expanded by m4.
14982 2002-02-05 Akim Demaille <akim@epita.fr>
14984 * data/bison.c++: Adjust to the M4 back end.
14985 More is certainly needed.
14987 2002-02-05 Akim Demaille <akim@epita.fr>
14989 Give a try to M4 as a back end.
14991 * lib/readpipe.c: New, from wdiff.
14992 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
14994 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
14995 specific values. Now it is m4 that performs the lookup.
14996 * src/parse-skel.y: Remove.
14997 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
14998 * src/output.c (actions_output, guards_output)
14999 (token_definitions_output): No longer keeps track of the output
15000 line number, hence remove the second argument.
15001 (guards_output): Check against the guard member of a rule, not the
15004 (output_skeleton): Don't look for the skeleton location, let m4 do
15006 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
15008 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
15009 (prepare): Given that for the time being changesyntax is not
15010 usable in M4, rename the muscles using `-' to `_'.
15011 Define `defines_flag', `output_parser_name' and `output_header_name'.
15012 * src/output.h (actions_output, guards_output)
15013 (token_definitions_output): Adjust prototypes.
15014 * src/scan-skel.l: Instead of scanning the skeletons, it now
15015 processes the output of m4: `__oline__' and `#output'.
15016 * data/bison.simple: Adjust to be used by M4(sugar).
15017 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
15019 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
15020 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
15021 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
15022 shamelessly stolen from CVS Autoconf.
15024 2002-02-05 Akim Demaille <akim@epita.fr>
15026 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
15027 * configure.in: Check for the declarations of free and malloc.
15028 * src/muscle_tab.c: Adjust.
15030 2002-02-05 Akim Demaille <akim@epita.fr>
15032 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
15033 which have no values.
15035 2002-02-05 Akim Demaille <akim@epita.fr>
15037 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
15040 2002-01-29 Paul Eggert <eggert@twinsun.com>
15042 * src/bison.simple (YYSIZE_T): Do not define merely because
15043 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
15044 On some platforms, <alloca.h> does not declare YYSTD (size_t).
15046 2002-01-27 Akim Demaille <akim@epita.fr>
15048 Fix `%nonassoc and eof'.
15050 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
15051 which were not properly copied! Replace
15052 memcpy (res->errs, src->errs, src->nerrs);
15054 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
15056 * tests/regression.at (%nonassoc and eof): Adjust to newest
15057 Autotest: `.' is not in the PATH.
15059 2002-01-27 Akim Demaille <akim@epita.fr>
15061 * tests/sets.at (AT_EXTRACT_SETS): New.
15062 (Nullable): Use it.
15065 2002-01-26 Akim Demaille <akim@epita.fr>
15067 * tests/actions.at, tests/calc.at, tests/headers.at,
15068 * tests/torture.at: Adjust to the newest Autotest which no longer
15069 forces `.' in the PATH.
15071 2002-01-25 Akim Demaille <akim@epita.fr>
15073 * tests/regression.at (%nonassoc and eof): New.
15074 Suggested by Robert Anisko.
15076 2002-01-24 Akim Demaille <akim@epita.fr>
15078 Bison dumps core when trying to complain about broken input files.
15079 Reported by Cris van Pelt.
15081 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
15082 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
15084 (Invalid inputs): Strengthen: exercise parse_percent_token.
15086 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
15088 * src/Makefile.am: Add bison.c++.
15089 * src/bison.c++: New skeleton.
15091 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
15095 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
15097 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
15099 2002-01-20 Marc Autret <marc@gnu.org>
15101 * src/files.c (compute_output_file_names): Fix
15103 2002-01-20 Marc Autret <marc@gnu.org>
15105 * tests/output.at: New test.
15106 * src/files.c (compute_base_names): Don't map extensions when
15107 the YACC flag is set, use defaults.
15108 Reported by Evgeny Stambulchik.
15110 2002-01-20 Marc Autret <marc@gnu.org>
15112 * src/system.h: Need to define __attribute__ away for non-GCC
15113 compilers as well (i.e., the vendor C compiler).
15114 Suggested by Albert Chin-A-Young.
15116 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
15118 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
15119 canonical definition.
15120 * src/system.h: Use the canonical definition for PARAMS (avoids
15121 a conflict with the macro from lib/hash.h).
15123 2002-01-11 Akim Demaille <akim@epita.fr>
15125 * configure.in: Use AC_FUNC_STRNLEN.
15126 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
15128 2002-01-09 Akim Demaille <akim@epita.fr>
15130 * src/files.c, src/files.h (output_infix): New.
15131 (tab_extension): Remove.
15132 (compute_base_names): Compute the former, drop the latter.
15133 * src/output.c (prepare): Insert the muscles `output-infix', and
15135 * src/parse-skel.y (string, string.1): New.
15136 (section.header): Use it.
15137 (section.yacc): Remove.
15138 (prefix): Remove too.
15139 * src/scan-skel.l: Adjust.
15140 * src/bison.simple, src/bison.hairy: Adjust.
15142 2002-01-09 Akim Demaille <akim@epita.fr>
15144 * configure.in (WERROR_CFLAGS): Compute it.
15145 * src/Makefile.am (CFLAGS): Pass it.
15146 * tests/atlocal.in (CFLAGS): Idem.
15147 * src/files.c: Fix a few warnings.
15148 (get_extension_index): Remove, unused.
15150 2002-01-08 Akim Demaille <akim@epita.fr>
15152 * src/getargs.c (AS_FILE_NAME): New.
15153 (getargs): Use it to convert DOSish file names.
15154 * src/files.c (base_name): Rename as full_base_name to avoid
15155 clashes with `base_name ()'.
15156 (filename_split): New.
15157 (compute_base_names): N-th rewrite, using filename_split.
15159 2002-01-08 Akim Demaille <akim@epita.fr>
15161 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
15162 New, stolen from the Fileutils 4.1.
15163 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
15164 * configure.in: Check for the presence of memrchr, and of its
15167 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
15169 * lib/hash.h (__P): Added definition for this macro.
15170 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
15171 BUILT_SOURCES, to ensure they are generated first.
15172 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
15173 %error-verbose to allow bootstrapping with bison 1.30x.
15175 2002-01-06 Akim Demaille <akim@epita.fr>
15177 * src/reader.c (parse_braces): Don't fetch the next char, the
15178 convention is to fetch on entry.
15179 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
15180 'switch' without a following semicolon.
15181 * tests/regression.at (braces parsing): New.
15183 2002-01-06 Akim Demaille <akim@epita.fr>
15185 Bison is dead wrong in its RR conflict reports.
15187 * tests/torture.at (GNU Cim Grammar): New.
15188 * src/conflicts.c (count_rr_conflicts): Fix.
15190 2002-01-06 Akim Demaille <akim@epita.fr>
15192 Creating package.m4 from configure.ac causes too many problems.
15194 * tests/Makefile.am (package.m4): Create it by hand,
15195 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
15197 2002-01-06 Akim Demaille <akim@epita.fr>
15199 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
15202 2002-01-04 Paul Eggert <eggert@twinsun.com>
15204 * doc/bison.texinfo (Debugging):
15205 Remove YYSTDERR; it's no longer defined or used.
15206 Also, s/cstdio.h/cstdio/.
15208 2002-01-03 Akim Demaille <akim@epita.fr>
15210 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
15212 2002-01-03 Akim Demaille <akim@epita.fr>
15214 * src/parse-skel.y (process_skeleton): Don't bind the parser's
15215 tracing code to --trace, wait for a better --trace option, with
15218 2002-01-03 Akim Demaille <akim@epita.fr>
15220 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
15221 The ISO C++ standard is extremely clear about it: stderr is
15222 considered a macro, not a regular symbol (see table 94 `Header
15223 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
15224 Therefore std:: does not apply to it. It still does with fprintf.
15225 Also, s/cstdio.h/cstdio/.
15227 2002-01-03 Akim Demaille <akim@epita.fr>
15229 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
15230 for non system headers.
15232 2002-01-02 Akim Demaille <akim@epita.fr>
15234 Equip the skeleton chain with location tracking, runtime trace,
15235 pure parser and scanner.
15237 * src/parse-skel.y: Request a pure parser, locations, and prefix
15239 (%union): Having several members with the same type does not help
15240 type mismatches, simplify.
15241 (YYPRINT, yyprint): New.
15242 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
15243 (skel_error): this.
15245 * src/scan-skel.l: Adjust to these changes.
15246 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
15247 (LOCATION_PRINT, skel_control_t): New.
15249 2001-12-30 Akim Demaille <akim@epita.fr>
15251 * src/parse-skel.y: Get rid of the shift/reduce conflict:
15252 replace `gb' with BLANKS.
15253 * src/scan-skel.l: Adjust.
15255 2001-12-30 Akim Demaille <akim@epita.fr>
15257 * src/system.h: We don't need nor want bcopy.
15258 Throw away MS-DOS crap: we don't need getpid.
15259 * configure.in: We don't need strndup. It was even causing
15260 problems: because Flex includes the headers *before* us,
15261 _GNU_SOURCE is not defined by config.h, and therefore strndup was
15263 * lib/xstrndup.c: New.
15264 * src/scan-skel.l: Use it.
15265 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
15266 * src/parse-skel.y: Use %directives instead of #defines.
15268 2001-12-30 Akim Demaille <akim@epita.fr>
15270 * src/skeleton.h: New.
15271 * src/output.c (output_parser, output_master_parser): Remove, dead
15273 * src/output.h (get_lines_number, actions_output, guards_output)
15274 (token_definitions_output): Prototype them.
15275 * src/parse-skel.y: Add the license notice.
15276 Include output.h and skeleton.h.
15277 (process_skeleton): Returns void, and takes a single parameter.
15278 * src/scan-skel.l: Add the license notice.
15279 Include skeleton.h.
15280 Don't use %option yylineno: it seems that then Flex imagines
15281 REJECT has been used, and therefore it won't reallocate its
15282 buffers (which makes no other sense to me than a bug). It results
15283 in warnings for `unused: yy_flex_realloc'.
15285 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
15287 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15288 (MUSCLE_INSERT_PREFIX): ...to there.
15289 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15290 (MUSCLE_INSERT_PREFIX): Move from here...
15292 * src/bison.hairy: Add a section directive. Put braces around muscle
15293 names. This parser skeleton is still broken, but Bison should not
15294 choke on a bad muscle 'syntax'.
15295 * src/bison.simple: Add a section directive. Put braces around muscle
15298 * src/files.h (strsuffix, stringappend): Add declarations.
15299 (tab_extension): Add declaration.
15300 (short_base_name): Add declaration.
15302 * src/files.c (strsuffix, stringappend): No longer static. These
15303 functions are used in the skeleton parser.
15304 (tab_extension): New.
15305 (compute_base_names): Use the computations done in this function
15306 to guess if the generated parsers should have '.tab' in their
15308 (short_base_name): No longer static.
15310 * src/output.c (output_skeleton): New.
15311 (output): Disable call to output_master_parser, and give a try to
15312 a new skeleton handling system.
15313 (guards_output, actions_output): No longer static.
15314 (token_definitions_output, get_lines_number): No longer static.
15316 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
15318 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
15321 * src/parse-skel.y: New file.
15322 * src/scan-skel.l: New file.
15324 2001-12-29 Akim Demaille <akim@epita.fr>
15326 %name-prefix is broken.
15328 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
15329 Adjust all dependencies.
15330 * tests/headers.at (export YYLTYPE): Strengthen this test: use
15333 Renaming yylval but not yylloc is not consistent. Now we do.
15335 * src/bison.simple: Prefix yylloc if used.
15336 * doc/bison.texinfo (Decl Summary): Document that.
15338 2001-12-29 Akim Demaille <akim@epita.fr>
15340 * doc/bison.texinfo: Promote `%long-directive' over
15342 Remove all references to fixed-output-files, yacc is enough.
15344 2001-12-29 Akim Demaille <akim@epita.fr>
15346 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
15347 user prologue. These are defaults.
15348 * tests/actions.at (Mid-rule actions): Make sure the user can
15349 define YYDEBUG and YYERROR_VERBOSE.
15351 2001-12-29 Akim Demaille <akim@epita.fr>
15353 * src/output.c (header_output): Don't forget to export YYLTYPE and
15355 * tests/headers.at (export YYLTYPE): New, make sure it does.
15356 * tests/regression.at (%union and --defines, Invalid CPP headers):
15358 * tests/headers.at: here.
15360 2001-12-29 Akim Demaille <akim@epita.fr>
15362 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
15364 2001-12-29 Akim Demaille <akim@epita.fr>
15366 * tests/actions.at (Mid-rule actions): Output on a single line
15367 instead of several.
15369 2001-12-29 Akim Demaille <akim@epita.fr>
15371 * doc/bison.texinfo: Formatting changes.
15373 2001-12-29 Akim Demaille <akim@epita.fr>
15375 Don't store the token defs in a muscle, just be ready to output it
15376 on command. Now possible via `symbols'. Fixes a memory leak.
15378 * src/output.c (token_definitions_output): New.
15379 (output_parser, header_output): Use it.
15380 * src/reader.c (symbols_save): Remove.
15382 2001-12-29 Akim Demaille <akim@epita.fr>
15384 * src/bison.simple: Do not provide a default for YYSTYPE and
15385 YYLTYPE before the user's prologue. Otherwise it's hardly... a
15388 2001-12-29 Akim Demaille <akim@epita.fr>
15390 Mid-rule actions are simply... ignored!
15392 * src/reader.c (readgram): Be sure to attach mid-rule actions to
15393 the empty-rule associated to the dummy symbol, not to the host
15395 * tests/actions.at (Mid-rule actions): New.
15397 2001-12-29 Akim Demaille <akim@epita.fr>
15401 * src/reader.c (reader): Free grammar.
15403 2001-12-29 Akim Demaille <akim@epita.fr>
15407 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
15408 since it allocates it for each state, although only one is needed.
15409 (allocate_storage): Do it here.
15411 2001-12-29 Akim Demaille <akim@epita.fr>
15413 * src/options.h, src/options.c (create_long_option_table): Rename
15415 (long_option_table_new): this, with a clearer prototype.
15416 (percent_table): Remove, unused,
15417 * src/getargs.c (getargs): Adjust.
15419 2001-12-29 Akim Demaille <akim@epita.fr>
15421 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
15422 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
15425 2001-12-29 Akim Demaille <akim@epita.fr>
15427 * src/lalr.c (build_relations): Rename `states' as `states1'.
15428 Sorry, I don't understand exactly what it is, no better name...
15430 2001-12-29 Akim Demaille <akim@epita.fr>
15432 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
15433 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
15434 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
15437 2001-12-29 Akim Demaille <akim@epita.fr>
15439 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
15442 2001-12-29 Akim Demaille <akim@epita.fr>
15444 * src/reader.c, src/reader.h (user_toknums): Remove.
15445 Adjust all users to use symbols[i]->user_token_number.
15447 2001-12-29 Akim Demaille <akim@epita.fr>
15449 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
15450 Adjust all users to use symbols[i]->prec or ->assoc.
15452 2001-12-29 Akim Demaille <akim@epita.fr>
15454 * src/reader.c, src/reader.h (tags): Remove.
15455 Adjust all users to use symbols[i]->tag.
15457 2001-12-29 Akim Demaille <akim@epita.fr>
15459 * src/gram.h, src/gram.c (symbols): New, similar to state_table
15461 * src/reader.c (packsymbols): Fill this table.
15463 * src/conflicts.c (resolve_sr_conflict): Adjust.
15464 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
15466 Use symbols[i]->tag instead of tags[i].
15468 2001-12-29 Akim Demaille <akim@epita.fr>
15470 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
15471 In addition, put a comment in there, to replace...
15472 * tests/regression.at (%union and C comments): Remove.
15474 2001-12-29 Akim Demaille <akim@epita.fr>
15476 * tests/regression.at (Web2c Actions): Blindly move the actual
15477 output as expected output. The contents *seem* right to me, but I
15478 can't pretend reading perfectly parser tables... Nonetheless, all
15479 the other tests pass correctly, the table look OK, even though the
15480 presence of `$axiom' is to be noted: AFAICS it is useless (but
15483 2001-12-29 Akim Demaille <akim@epita.fr>
15485 * src/reader.c (readgram): Don't add the rule 0 if there were no
15486 rules read. In other words, add it _after_ having performed
15487 grammar sanity checks.
15488 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
15490 2001-12-29 Akim Demaille <akim@epita.fr>
15492 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
15493 visible, and some states have now a different number.
15495 2001-12-29 Akim Demaille <akim@epita.fr>
15497 * src/reader.c (readgram): Bind the initial rule's lineno to that
15499 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
15500 (Solved SR Conflicts): Adjust rule 0's line number.
15502 2001-12-29 Akim Demaille <akim@epita.fr>
15504 Fix the `GAWK Grammar' failure.
15506 * src/LR0.c (final_state): Initialize to -1 so that we do compute
15507 the reductions of the first state which was mistakenly confused
15508 with the final state because precisely final_state was initialized
15510 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
15511 now noticed by Bison.
15512 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
15513 have a reduction on $default.
15515 2001-12-29 Akim Demaille <akim@epita.fr>
15517 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
15519 * src/closure.c (print_closure): Likewise.
15520 * src/derives.c (print_derives): Likewise.
15521 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
15524 2001-12-29 Akim Demaille <akim@epita.fr>
15526 * src/lalr.c (lookaheads_print): New.
15527 (lalr): Call it when --trace-flag.
15528 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
15531 2001-12-29 Akim Demaille <akim@epita.fr>
15533 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
15534 when walking through ritem, even via rule->rhs.
15535 * src/reduce.c (dump_grammar, useful_production, reduce_output)
15536 (useful_production, useless_nonterminals): Likewise.
15537 (reduce_grammar_tables): Likewise, plus update nritems.
15538 * src/nullable.c (set_nullable): Likewise.
15539 * src/lalr.c (build_relations): Likewise.
15540 * tests/sets.at (Nullable): Adjust.
15541 Fortunately, now, the $axiom is no longer nullable.
15543 2001-12-29 Akim Demaille <akim@epita.fr>
15545 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
15547 * src/gram.c (ritem_longest_rhs): Likewise.
15548 * src/reduce.c (nonterminals_reduce): Likewise.
15549 * src/print_graph.c (print_graph): Likewise.
15550 * src/output.c (output_rule_data): Likewise.
15551 * src/nullable.c (set_nullable): Likewise.
15553 2001-12-29 Akim Demaille <akim@epita.fr>
15555 * src/output.c: Comment changes.
15557 2001-12-27 Paul Eggert <eggert@twinsun.com>
15559 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
15560 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
15561 Sparc, as they were causing more porting problems than the
15562 (minor) performance improvement was worth.
15564 Also, catch up with 1.31's YYSTD.
15566 2001-12-27 Akim Demaille <akim@epita.fr>
15568 * src/output.c (output_gram): Rely on nritems, not the
15569 0-sentinel. See below.
15570 Use -1 as separator, not 0.
15571 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
15572 Rely on -1 as separator in yyrhs, instead of 0.
15573 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
15574 twice `Now at end of input', therefore there are two lines less to
15577 2001-12-27 Akim Demaille <akim@epita.fr>
15579 * tests/regression.at (Unresolved SR Conflicts):
15580 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
15583 2001-12-27 Akim Demaille <akim@epita.fr>
15585 * src/LR0.c (new_state): Recognize the final state by the fact it
15586 is reached by eoftoken.
15587 (insert_start_shifting_state, insert_eof_shifting_state)
15588 (insert_accepting_state, augment_automaton): Remove, since now
15589 these states are automatically computed from the initial state.
15590 (generate_states): Adjust.
15591 * src/print.c: When reporting a rule number to the user, substract
15592 1, so that the axiom rule is rule 0, and the first user rule is 1.
15593 * src/reduce.c: Likewise.
15594 * src/print_graph.c (print_core): For the time being, just as for
15595 the report, depend upon --trace-flags to dump the full set of
15597 * src/reader.c (readgram): Once the grammar read, insert the rule
15598 0: `$axiom: START-SYMBOL $'.
15599 * tests/set.at: Adjust: rule 0 is now displayed, and since the
15600 number of the states has changed (the final state is no longer
15601 necessarily the last), catch up.
15603 2001-12-27 Akim Demaille <akim@epita.fr>
15605 Try to make the use of the eoftoken valid. Given that its value
15606 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
15607 is used instead of > 0 where appropriate, (ii), depend upon nritems
15608 instead of the 0-sentinel.
15610 * src/gram.h, src/gram.c (nritems): New.
15611 Expected to be duplication of nitems, but for the time being...
15612 * src/reader.c (packgram): Assert nritems and nitems are equal.
15613 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
15614 * src/closure.c (print_closure, print_fderives): Likewise.
15615 * src/gram.c (ritem_print): Likewise.
15616 * src/print.c (print_core, print_grammar): Likewise.
15617 * src/print_graph.c: Likewise.
15619 2001-12-27 Akim Demaille <akim@epita.fr>
15621 * src/main.c (main): If there are complains after grammar
15622 reductions, then output the report anyway if requested, then die.
15623 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
15624 * src/reader.c (eoftoken): New.
15625 (parse_token_decl): If the token being defined has value `0', it
15627 (packsymbols): No longer hack `tags' to insert `$' by hand.
15628 Be sure to preserve the value of the eoftoken.
15629 (reader): Make sure eoftoken is defined.
15630 Initialize nsyms to 0: now eoftoken is created just like the others.
15631 * src/print.c (print_grammar): Don't special case the eof token.
15632 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
15633 lie anyway, albeit pleasant.
15634 * tests/calc.at: Exercise error messages with eoftoken.
15635 Change the grammar so that empty input is invalid.
15636 Adjust expectations.
15637 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
15639 2001-12-27 Akim Demaille <akim@epita.fr>
15641 * configure.in: Check the protos of strchr ans strspn.
15642 Replace strchr if needed.
15643 * src/system.h: Provide the protos of strchr, strspn and memchr if
15645 * lib/strchr.c: New.
15646 * src/reader.c (symbols_save): Use strchr.
15648 2001-12-27 Akim Demaille <akim@epita.fr>
15650 * src/print.c, src/print_graph.c (escape): New.
15651 Use it to quote the TAGS outputs.
15652 * src/print_graph.c (print_state): Now errors are in red, and
15653 reductions in green.
15654 Prefer high to wide: output the state number on a line of its own.
15656 2001-12-27 Akim Demaille <akim@epita.fr>
15658 * src/state.h, src/state.c (reductions_new): New.
15659 * src/LR0.c (set_state_table): Let all the states have a
15660 `reductions', even if reduced to 0.
15661 (save_reductions): Adjust.
15662 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
15663 * src/print.c (print_reductions, print_actions): Adjust.
15664 * src/output.c (action_row): Adjust.
15666 2001-12-27 Akim Demaille <akim@epita.fr>
15668 * src/state.h, src/state.c (errs_new, errs_dup): New.
15669 * src/LR0.c (set_state_table): Let all the states have an errs,
15670 even if reduced to 0.
15671 * src/print.c (print_errs, print_reductions): Adjust.
15672 * src/output.c (output_actions, action_row): Adjust.
15673 * src/conflicts.c (resolve_sr_conflict): Adjust.
15675 2001-12-27 Akim Demaille <akim@epita.fr>
15677 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
15679 2001-12-27 Akim Demaille <akim@epita.fr>
15681 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
15682 * src/print.c: here.
15683 (lookaheadset, shiftset): New, used as additional storage by
15685 (print_results): Adjust.
15686 (print_shifts, print_gotos, print_errs): New, extracted from...
15687 (print_actions): here.
15688 * src/print_graph.c (print_actions): Remove dead code.
15690 2001-12-27 Akim Demaille <akim@epita.fr>
15692 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
15695 2001-12-27 Akim Demaille <akim@epita.fr>
15697 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
15698 (build_relations): Adjust.
15700 2001-12-27 Akim Demaille <akim@epita.fr>
15702 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
15705 2001-12-27 Akim Demaille <akim@epita.fr>
15707 * src/reader.c (packgram): Catch nitems overflows.
15709 2001-12-27 Akim Demaille <akim@epita.fr>
15711 * src/files.c, src/files.h (guard_obstack): Remove.
15712 * src/output.c (output): Adjust.
15713 * src/reader.c (parse_braces): New, factoring...
15714 (copy_action, copy_guard): these two which are renamed as...
15715 (parse_action, parse_guard): these.
15716 As a voluntary consequence, using braces around guards is now
15719 2001-12-27 Akim Demaille <akim@epita.fr>
15721 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
15722 * src/reader.c (symbol_list): `guard' and `guard_line' are new
15724 (symbol_list_new): Adjust.
15725 (copy_action): action_line is the first line, not the last.
15726 (copy_guard): Just as for actions, store the `action' only, not
15727 the switch/case/break flesh.
15728 Don't parse the user action that might follow the guard, let...
15729 (readgram): do it, i.e., now, there can be an action after a
15731 In other words the guard is just explicitly optional.
15732 (packgram): Adjust.
15733 * src/output.c (guards_output): New.
15734 (output_parser): Call it when needed.
15735 (output): Also free the guard and attrs obstacks.
15736 * src/files.c, src/files.h (obstack_save): Remove.
15737 (output_files): Remove.
15738 As a result, if one needs the former `.act' file, using an
15739 appropriate skeleton which requires actions and guards is now
15741 * src/main.c (main): Adjust.
15742 * tests/semantic.at: New.
15743 * tests/regression.at: Use `input.y' as input file name.
15744 Avoid 8+3 problems by requiring input.c when the test needs the
15747 2001-12-27 Akim Demaille <akim@epita.fr>
15749 * src/reader.c (symbol_list_new): Be sure to initialize all the
15752 2001-12-27 Akim Demaille <akim@epita.fr>
15754 All the hacks using a final pseudo state are now useless.
15756 * src/LR0.c (set_state_table): state_table holds exactly nstates.
15757 * src/lalr.c (nLA): New.
15758 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
15759 instead of lookaheadsp from the pseudo state (nstate + 1).
15761 2001-12-27 Akim Demaille <akim@epita.fr>
15763 * src/output.c (action_row, token_actions): Use a state_t instead
15764 of a integer, and nlookaheads instead of the following state's
15767 2001-12-27 Akim Demaille <akim@epita.fr>
15769 * src/conflicts.c (log_resolution, flush_shift)
15770 (resolve_sr_conflict, set_conflicts, solve_conflicts)
15771 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
15772 (conflicts_print, print_reductions): Use a state_t instead of an
15773 integer when referring to a state.
15774 As much as possible, depend upon nlookaheads, instead of the
15775 `lookaheadsp' member of the following state (since lookaheads of
15776 successive states are successive, the difference between state n + 1
15777 and n served as the number of lookaheads for state n).
15778 * src/lalr.c (add_lookback_edge): Likewise.
15779 * src/print.c (print_core, print_actions, print_state)
15780 (print_results): Likewise.
15781 * src/print_graph.c (print_core, print_actions, print_state)
15782 (print_graph): Likewise.
15783 * src/conflicts.h: Adjust.
15785 2001-12-27 Akim Demaille <akim@epita.fr>
15787 * src/bison.hairy: Formatting/comment changes.
15789 Remove `register' indications.
15790 Add plenty of `static'.
15792 2001-12-27 Akim Demaille <akim@epita.fr>
15794 * src/output.c (prepare): Drop the muscle `ntbase' which
15795 duplicates ntokens.
15796 * src/bison.simple: Formatting/comment changes.
15797 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
15798 is an undocumented synonym.
15800 2001-12-22 Akim Demaille <akim@epita.fr>
15802 * src/output.c (output_table_data): Change the prototype to use
15803 `int' for array ranges: some invocations do pass an int, not a
15805 Reported by Wayne Green.
15807 2001-12-22 Akim Demaille <akim@epita.fr>
15809 Some actions of web2c.y are improperly triggered.
15810 Reported by Mike Castle.
15812 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
15813 * tests/regression.at (Web2c): Rename as...
15814 (Web2c Report): this.
15815 (Web2c Actions): New.
15817 2001-12-22 Akim Demaille <akim@epita.fr>
15819 Reductions in web2c.y are improperly reported.
15820 Reported by Mike Castle.
15822 * src/conflicts.c (print_reductions): Fix.
15823 * tests/regression.at (Web2c): New.
15825 2001-12-18 Akim Demaille <akim@epita.fr>
15827 Some host fail on `assert (!"foo")', which expands to
15828 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
15829 Reported by Nelson Beebee.
15831 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
15832 `#define it_succeeded 0' and `assert (it_succeeded)'.
15834 2001-12-17 Marc Autret <autret_m@epita.fr>
15836 * src/bison.simple: Don't hard code the skeleton line and filename.
15837 * src/output.c (output_parser): Rename 'line' as 'output_line'.
15838 New line counter 'skeleton_line' (skeleton-line muscle).
15840 2001-12-17 Paul Eggert <eggert@twinsun.com>
15842 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
15843 YYDEBUG must be defined to a nonzero value.
15845 * src/bison.simple (yytname): Do not assume that the user defines
15846 YYDEBUG to a properly parenthesized expression.
15848 2001-12-17 Akim Demaille <akim@epita.fr>
15850 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
15851 nlookaheads is a new member.
15853 * src/lalr.h (nlookaheads): Remove this orphan declaration.
15854 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
15857 2001-12-17 Akim Demaille <akim@epita.fr>
15859 * src/files.h, src/files.c (open_files, close_files): Remove.
15860 * src/main.c (main): Don't open/close files, nor invoke lex_free,
15862 * src/reader.c (reader): Do it.
15864 2001-12-17 Akim Demaille <akim@epita.fr>
15866 * src/conflicts.c (print_reductions): Formatting changes.
15868 2001-12-17 Akim Demaille <akim@epita.fr>
15870 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
15871 (flush_reduce): New.
15872 (resolve_sr_conflict): Adjust.
15874 2001-12-17 Akim Demaille <akim@epita.fr>
15876 * src/output.c (output_obstack): Be static and rename as...
15877 (format_obstack): this, to avoid any confusion with files.c's
15879 * src/reader.h (muscle_obstack): Move to...
15880 * src/output.h: here, since it's defined in output.c.
15882 2001-12-17 Akim Demaille <akim@epita.fr>
15884 * src/output.c (action_row, save_column, default_goto)
15885 (sort_actions, matching_state, pack_vector): Better variable
15888 2001-12-17 Akim Demaille <akim@epita.fr>
15890 * src/output.c: Various formatting changes.
15892 2001-12-17 Akim Demaille <akim@epita.fr>
15894 * src/files.c (output_files): Free the output_obstack.
15895 * src/main.c (main): Call print and print_graph conditionally.
15896 * src/print.c (print): Work unconditionally.
15897 * src/print_graph.c (print_graph): Work unconditionally.
15898 * src/conflicts.c (log_resolution): Output only if verbose_flag.
15900 2001-12-16 Marc Autret <autret_m@epita.fr>
15902 * src/output.c (actions_output): Fix. When we use %no-lines,
15903 there is one less line per action.
15905 2001-12-16 Marc Autret <autret_m@epita.fr>
15907 * src/bison.simple: Remove a useless #line directive.
15908 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
15909 * src/output.c (get_lines_number): New.
15910 (output_parser): Adjust, now takes care about the lines of a
15912 Fix line numbering.
15913 (actions_output): Computes the number of lines taken by actions.
15914 (output_master_parser): Insert new skeleton which is the name of
15915 the output parser file name.
15917 2001-12-15 Marc Autret <autret_m@epita.fr>
15919 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
15921 2001-12-15 Marc Autret <autret_m@epita.fr>
15923 * src/output.c (output_gram): Keep track of the hairy one.
15925 2001-12-15 Akim Demaille <akim@epita.fr>
15927 Make `make distcheck' work.
15929 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
15930 system.h which uses libgettext.h.
15932 2001-12-15 Akim Demaille <akim@epita.fr>
15934 * src/nullable.c (set_nullable): Useless rules must be skipped,
15935 otherwise, since we range over their symbols, we might look at a
15936 nonterminal which no longer ``exists'', i.e., it is not counted in
15937 `nvars', hence we overflow our arrays.
15939 2001-12-15 Akim Demaille <akim@epita.fr>
15941 The header can also be produced directly, without any obstack!
15944 * src/files.c, src/files.h (defines_obstack): Remove.
15945 (compute_header_macro): Global.
15946 (defines_obstack_save): Remove.
15947 * src/reader.c (parse_union_decl): No longer output to
15948 defines_obstack: its content can be found in the `stype' muscle
15950 (output_token_translations): Merge into...
15951 (symbols_output): this.
15953 (symbols_save): this.
15955 * src/output.c (header_output): New.
15958 2001-12-15 Akim Demaille <akim@epita.fr>
15960 * src/reader.c (parse_union_decl): Instead of handling two obstack
15961 simultaneously, use one to define the `stype' muscle, and use the
15962 value of the latter to fill defines_obstack.
15963 (copy_comment): Remove.
15964 (copy_comment2): Work for a single obstack.
15966 (copy_comment): this.
15968 2001-12-15 Akim Demaille <akim@epita.fr>
15970 * src/lex.c, src/lex.h (xgetc): No longer static.
15971 * src/reader.c (parse_union_decl): Revamp.
15973 2001-12-15 Akim Demaille <akim@epita.fr>
15975 Still making progress in separating Bison into (i) input, (ii)
15976 process, (iii) output: now we can directly output the parser file
15977 without using table_obstack at all.
15979 * src/files.c, src/files.h (table_obstack): Bye bye.
15980 (parser_file_name): New.
15981 * src/files.c (compute_output_file_names): Compute it.
15982 * src/output.c (actions_output, output_parser)
15983 (output_master_parser): To a file instead of an obstack.
15985 2001-12-15 Akim Demaille <akim@epita.fr>
15987 Attach actions to rules, instead of pre-outputting them to
15990 * src/gram.h (rule_t): action and action_line are new members.
15991 * src/reader.c (symbol_list): Likewise.
15992 (copy_action): Save the actions within the rule.
15993 (packgram): Save them in rule_table.
15994 * src/output.c (actions_output): New.
15995 (output_parser): Use it on `%%actions'.
15996 (output_rule_data): Don't free rule_table.
15998 (prepare): Don't save the `action' muscle.
15999 * src/bison.simple: s/%%action/%%actions/.
16001 2001-12-15 Akim Demaille <akim@epita.fr>
16003 * src/reader.c (copy_action): When --yacc, don't append a `;'
16004 to the user action: let it fail if lacking.
16005 Suggested by Arnold Robbins and Tom Tromey.
16007 2001-12-14 Akim Demaille <akim@epita.fr>
16009 * src/lex.c (literalchar): Simply return the char you decoded, non
16010 longer mess around with obstacks and int pointers.
16011 Adjust all callers.
16013 2001-12-14 Akim Demaille <akim@epita.fr>
16015 * src/lex.c (literalchar): Don't escape the special characters,
16016 just decode them, and keep them as char (before, eol was output as
16017 the 2 char string `\n' etc.).
16018 * src/output.c (output_rule_data): Use quotearg to output the
16021 2001-12-13 Paul Eggert <eggert@twinsun.com>
16023 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
16024 Do not infringe on the global user namespace when using C++.
16025 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
16026 All uses of `fprintf' and `stderr' changed.
16028 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
16030 2001-12-13 Akim Demaille <akim@epita.fr>
16032 The computation of nullable is broken: it doesn't handle empty
16035 * tests/torture.at (GNU AWK Grammar): New.
16036 * tests/sets.at (Nullable): New.
16037 * src/nullable.c (set_nullable): Instead of blindly looping over
16038 `ritems', loop over the rules, and then over their rhs's.
16040 Work around Autotest bugs.
16042 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
16043 frame, because Autotest understand lines starting with a `+' as
16044 traces from the shell. Then, they are not processed properly.
16045 Admittedly an Autotest bug, but we don't have time to wait for
16046 Autotest to catch up.
16047 * tests/regression.at (Broken Closure): Adjust to the new table
16050 * tests/sets.at: here.
16052 2001-12-13 Akim Demaille <akim@epita.fr>
16054 * src/closure.c (closure): Use nrules instead of playing tricks
16055 with BITS_PER_WORD.
16057 2001-12-13 Akim Demaille <akim@epita.fr>
16059 * src/print.c (print_actions): Output the handling of `$' as the
16060 traces do: shifting the token EOF. Before EOF was treated as a
16062 * tests/regression.at: Adjust some tests.
16063 * src/print_graph.c (print_core): Complete the set of items via
16064 closure. The next-to-final and final states are still unsatisfying,
16065 but that's to be addressed elsewhere.
16066 No longer output the rule numbers, but do output the state number.
16067 A single loop for the shifts + gotos is enough, but picked a
16068 distinct color for each.
16069 (print_graph): Initialize and finalize closure.
16071 2001-12-13 Akim Demaille <akim@epita.fr>
16073 * src/reader.c (readgram): Remove dead code, an strip useless
16075 (get_type): Remove, unused.
16077 2001-12-12 Akim Demaille <akim@epita.fr>
16079 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
16080 on that of lib/error.c.
16082 2001-12-12 Akim Demaille <akim@epita.fr>
16084 Some hosts don't like `/' in includes.
16086 * src/system.h: Include libgettext.h without qualifying the path.
16087 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
16090 2001-12-11 Marc Autret <autret_m@epita.fr>
16092 * src/output.c (output_parser): Remove useless muscle.
16094 2001-12-11 Marc Autret <autret_m@epita.fr>
16096 * src/bison.simple: Remove #line just before %%epilogue. It
16097 is now handled in ...
16098 * src/reader.c (read_additionnal_code): Add the output of a
16099 #line for the epilogue.
16101 2001-12-10 Marc Autret <autret_m@epita.fr>
16103 * src/reader.c (copy_definition): Re-use CPP-outed code which
16104 replace precedent remove.
16105 * src/bison.simple: Remove #line before %%prologue because
16106 %%input-line is wrong at this time.
16108 2001-12-10 Marc Autret <autret_m@epita.fr>
16110 * src/reader.c (symbols_output): Clean up.
16111 * src/output.c (output_gram, output): Clean up.
16113 2001-12-10 Akim Demaille <akim@epita.fr>
16115 * src/lalr.c (initialize_lookaheads): New. Extracted from...
16116 * src/LR0.c (set_state_table): here.
16117 * src/lalr.c (lalr): Call it.
16119 2001-12-10 Akim Demaille <akim@epita.fr>
16121 * src/state.h (shifts): Remove the `number' member: shifts are
16122 attached to state, hence no longer need to be labelled with a
16125 2001-12-10 Akim Demaille <akim@epita.fr>
16127 Now that states have a complete set of members, the linked list of
16128 shifts is useless: just fill directly the state's shifts member.
16130 * src/state.h (shifts): Remove the `next' member.
16131 * src/LR0.c (first_state, last_state): Remove.
16132 Adjust the callers.
16133 (augment_automaton): Don't look for the shifts that must be added
16134 a shift on EOF: it is those of the state we looked for! But now,
16135 since shifts are attached, it is no longer needed to looking
16136 merely by its id: its number.
16138 2001-12-10 Akim Demaille <akim@epita.fr>
16140 * src/LR0.c (augment_automaton): Better variable locality.
16141 Remove an impossible branch: if there is a state corresponding to
16142 the start symbol being shifted, then there is shift for the start
16143 symbol from the initial state.
16145 2001-12-10 Akim Demaille <akim@epita.fr>
16147 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
16148 only when appropriate: when insert_start_shifting_state' is not
16150 * tests/regression.at (Rule Line Numbers): Adjust.
16152 2001-12-10 Akim Demaille <akim@epita.fr>
16154 * src/LR0.c (augment_automaton): Now that all states have shifts,
16155 merge the two cases addition shifts to the initial state.
16157 2001-12-10 Akim Demaille <akim@epita.fr>
16159 * src/lalr.c (set_state_table): Move to...
16161 * src/lalr.c (lalr): Don't call it...
16162 * src/LR0.c (generate_states): do it.
16163 * src/LR0.h (first_state): Remove, only the table is used.
16165 2001-12-10 Akim Demaille <akim@epita.fr>
16167 * src/LR0.h (first_shift, first_reduction): Remove.
16168 * src/lalr.c: Don't use first_shift: find shifts through the
16171 2001-12-10 Akim Demaille <akim@epita.fr>
16173 * src/LR0.c: Attach shifts to states as soon as they are
16175 * src/lalr.c (set_state_table): Instead of assigning shifts to
16176 state, just assert that the mapping was properly done.
16178 2001-12-10 Akim Demaille <akim@epita.fr>
16180 * src/LR0.c (insert_start_shift): Rename as...
16181 (insert_start_shifting_state): this.
16182 (insert_eof_shifting_state, insert_accepting_state): New.
16183 (augment_automaton): Adjust.
16184 Better locality of the variables.
16185 When looking if the start_symbol is shifted from the initial
16186 state, using `while (... symbol != start_symbol ...)' sounds
16187 better than `while (... symbol < start_symbol ...)': If fail
16188 to see how the order between symbols could be relevant!
16190 2001-12-10 Akim Demaille <akim@epita.fr>
16192 * src/getargs.h: Don't declare `spec_name_prefix' and
16193 `spec_file_prefix', declared by src/files.h.
16194 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
16195 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
16196 * src/output.c (prepare): Adjust.
16197 * src/reader.c (symbols_output): Likewise.
16198 * src/vmsgetargs.c: Vaguely adjust, but who cares?
16200 2001-12-10 Akim Demaille <akim@epita.fr>
16202 * src/muscle_tab.c (muscle_init): NULL is a better default than
16205 2001-12-10 Akim Demaille <akim@epita.fr>
16207 * src/reader.c (reader): Calling symbols_output once is enough.
16209 2001-12-10 Akim Demaille <akim@epita.fr>
16211 Now that states have a complete set of members, the linked list of
16212 reductions is useless: just fill directly the state's reductions
16215 * src/state.h (struct reductions): Remove member `number' and
16217 * src/LR0.c (first_reduction, last_reduction): Remove.
16218 (save_reductions): Don't link the new reductions, store them in
16220 * src/lalr.c (set_state_table): No need to attach reductions to
16221 states, it's already done.
16222 * src/output.c (output_actions): No longer free the shifts, then
16223 the reductions, then the states: free all the states and their
16226 2001-12-10 Akim Demaille <akim@epita.fr>
16228 * src/options.c (OPTN, DRTV, BOTH): New.
16229 (option_table): Use them.
16231 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
16232 the job of system.h.
16233 * src/options.c: Don't include stdio.h and xalloc.h for the same
16236 2001-12-10 Akim Demaille <akim@epita.fr>
16238 * src/output.c (output, prepare): Make sure the values of the
16239 muscles `action' and `prologue' are 0-terminated.
16241 2001-12-10 Akim Demaille <akim@epita.fr>
16243 Clean up GCC warnings.
16245 * src/reader.c (copy_action): `buf' is not used.
16246 (parse_skel_decl): Be static.
16247 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
16248 * src/options.h (create_long_option_table): Have a real prototype.
16249 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
16250 (hash_delete_at): Return const void *.
16251 Adjust casts to preserve the const.
16253 2001-12-10 Akim Demaille <akim@epita.fr>
16255 * configure.in: Require 2.52g.
16256 M4 is not needed, but AUTOM4TE is.
16257 * m4/m4.m4: Remove.
16258 * tests/Makefile.am: Adjust.
16260 2001-12-10 Akim Demaille <akim@epita.fr>
16262 One structure for states is enough, even though theoretically
16263 there are LR(0) states and LALR(1) states.
16265 * src/lalr.h (state_t): Remove.
16266 (state_table): Be state_t **, not state_t *.
16267 * src/state.h (core, CORE_ALLOC): Rename as...
16268 (state_t, STATE_ALLOC): this.
16269 Add the LALR(1) members: shifts, reductions, errs.
16270 * src/LR0.c (state_table): Rename as...
16271 (state_hash): this, to avoid name clashes with the global
16273 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
16274 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
16276 2001-12-10 Akim Demaille <akim@epita.fr>
16278 Bison dumps core on bash.y.
16279 Reported by Pascal Bart.
16281 * src/warshall.c (bitmatrix_print): New.
16283 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
16284 j must be the outer loop.
16285 * tests/regression.at (Broken Closure): New.
16287 2001-12-05 Akim Demaille <akim@epita.fr>
16289 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
16291 Reported by Peter Hamorsky.
16293 2001-12-05 Akim Demaille <akim@epita.fr>
16295 * src/conflicts.c (err_table): Remove.
16296 (resolve_sr_conflict): Adjust.
16297 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
16299 (state_t.reductions, state_t.shifts): this.
16301 2001-12-05 Akim Demaille <akim@epita.fr>
16303 * src/reduce.c (reduce_grammar_tables): No longer disable the
16304 removal of useless rules via CPP but via `if (0)', so that the
16305 compiler still check the code is valid.
16306 For instance, it should have noticed `rline' no longer exists: use
16307 the `line' member of rule_t.
16308 * src/gram.c (dummy, rline): Remove, unused.
16310 2001-12-05 Akim Demaille <akim@epita.fr>
16312 * src/output.c (pack_vector): Use assert, not berror.
16313 * src/main.c (berror): Remove, unused.
16315 2001-12-05 Akim Demaille <akim@epita.fr>
16317 New experimental feature: if --verbose --trace output all the
16318 items of a state, not only its kernel.
16320 * src/print.c (print_core): If `trace_flag', then invoke closure
16321 before outputting the items of the state (print_core is no longer
16322 a correct name them).
16323 (print_results): Invoke new_closure/free_closure if needed.
16325 2001-12-05 Akim Demaille <akim@epita.fr>
16327 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
16328 * src/closure.c, src/closure.h (itemsetsize): Rename as...
16329 (nitemset): for consistency with the rest of the project.
16331 2001-12-05 Akim Demaille <akim@epita.fr>
16333 * src/closure.c (print_closure): Improve.
16334 (closure): Use it for printing input and output.
16336 2001-12-05 Akim Demaille <akim@epita.fr>
16338 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
16339 indexed by nonterminals.
16341 2001-12-05 Akim Demaille <akim@epita.fr>
16343 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
16345 * src/warshall.h: Remove accidental duplication of the content.
16347 2001-12-05 Akim Demaille <akim@epita.fr>
16349 * src/closure.c (set_fderives): De-obfuscate.
16351 2001-12-05 Akim Demaille <akim@epita.fr>
16353 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
16355 2001-12-05 Akim Demaille <akim@epita.fr>
16357 * src/closure.c (set_firsts): De-obfuscate.
16359 2001-12-05 Akim Demaille <akim@epita.fr>
16361 * src/output.c (action_row): De-obfuscate
16362 using the good o' techniques: arrays not pointers, variable
16363 locality, BITISSET, RESETBIT etc.
16365 2001-12-05 Akim Demaille <akim@epita.fr>
16367 Pessimize the code to simplify it: from now on, all the states
16368 have a valid SHIFTS, which NSHIFTS is possibly 0.
16370 * src/LR0.c (shifts_new): Be global and move to..
16371 * src/state.c, src/state.h: here.
16372 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
16373 * src/print_graph: Adjust.
16375 2001-12-05 Akim Demaille <akim@epita.fr>
16377 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
16378 * src/conflicts.c: Use it.
16379 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
16380 incorrectly ``simplified''.
16382 2001-12-05 Akim Demaille <akim@epita.fr>
16384 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
16385 using the good o' techniques: arrays not pointers, variable
16386 locality, BITISSET, RESETBIT etc.
16388 2001-12-05 Akim Demaille <akim@epita.fr>
16390 * src/state.h (SHIFT_SYMBOL): New.
16391 * src/conflicts.c: Use it to deobfuscate.
16393 2001-12-05 Akim Demaille <akim@epita.fr>
16395 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
16396 (print_reductions): De-obfuscate using the good o' techniques:
16397 arrays not pointers, variable locality, BITISSET.
16399 2001-12-05 Akim Demaille <akim@epita.fr>
16401 * src/conflicts.c (print_reductions): Arrays, not pointers.
16404 2001-12-05 Akim Demaille <akim@epita.fr>
16406 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16408 2001-12-05 Akim Demaille <akim@epita.fr>
16410 * src/conflicts.c (print_reductions): Improve variable locality.
16412 2001-12-05 Akim Demaille <akim@epita.fr>
16414 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16416 2001-12-05 Akim Demaille <akim@epita.fr>
16418 * src/conflicts.c (print_reductions): Improve variable locality.
16420 2001-12-05 Akim Demaille <akim@epita.fr>
16422 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
16423 * src/lalr.c: Use them.
16425 2001-12-05 Akim Demaille <akim@epita.fr>
16427 * src/LR0.c (augment_automaton): Formatting changes.
16428 Better variable locality.
16430 2001-12-05 Akim Demaille <akim@epita.fr>
16432 * src/lalr.c (matrix_print): New.
16433 (transpose): Use it.
16434 Use arrays instead of pointers.
16436 2001-12-05 Akim Demaille <akim@epita.fr>
16438 * src/lalr.c (maxrhs): Move to...
16439 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
16440 * src/lalr.c (build_relations): Adjust.
16442 2001-12-05 Akim Demaille <akim@epita.fr>
16444 * src/lalr.c (transpose): Free the memory allocated to the
16445 argument, as it is replaced by the results by the unique caller.
16446 (build_relations): Merely invoke transpose: it handles the memory
16448 Improve variable locality.
16449 Avoid variables used as mere abbreviations.
16450 (compute_lookaheads): Use arrays instead of pointers.
16452 2001-12-05 Akim Demaille <akim@epita.fr>
16454 * src/lalr.c (initialize_F): Improve variable locality.
16455 Avoid variables used as mere abbreviations.
16457 2001-12-05 Akim Demaille <akim@epita.fr>
16459 * src/derives.c (print_derives): Display the ruleno.
16460 * src/lalr.c (initialize_F, transpose): Better variable locality
16461 to improve readability.
16462 Avoid variables used as mere abbreviations.
16464 2001-12-05 Akim Demaille <akim@epita.fr>
16466 * src/lalr.c (traverse): Use arrays instead of pointers.
16468 2001-12-05 Akim Demaille <akim@epita.fr>
16470 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
16471 the handling of squeue.
16472 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16474 2001-12-05 Akim Demaille <akim@epita.fr>
16476 Because useless nonterminals are now kept alive (instead of being
16477 `destroyed'), we now sometimes examine them, and store information
16478 related to them. Hence we need to know their number, and adjust
16479 memory allocations.
16481 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
16483 * src/LR0.c (allocate_itemsets): The memory allocated to
16484 `symbol_count' was used for two different purpose: once to count
16485 the number of occurrences of each symbol, and later reassigned to
16486 `shift_symbol', containing the symbol that can be shifted from a
16488 Deobfuscate, i.e., allocate, use and free `symbol_count' here
16490 (new_itemsets): Allocate `shift_symbol' here.
16491 (allocate_itemsets): symbol_count includes useless nonterminals.
16492 Make room for them.
16493 (free_storage): Use `free', not `XFREE', for pointers that cannot
16496 2001-12-05 Akim Demaille <akim@epita.fr>
16498 * src/nullable.c (set_nullable): Deobfuscate the handling of
16500 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16502 2001-12-05 Akim Demaille <akim@epita.fr>
16504 * src/gram.c, src/gram.h (ritem_print): New.
16505 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
16506 (This useless function was defined only to work around VMS linkers
16507 that can't handle compilation units with variables only).
16508 * src/reduce.c (dump_grammar): Use it to trace the construction of
16511 2001-12-04 Paul Eggert <eggert@twinsun.com>
16513 * src/bison.simple (union yyalloc): Change member names
16514 to be the same as the stack names.
16515 (yyparse): yyptr is now union yyalloc *, not char *.
16516 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
16517 and may generate better code on some machines.
16518 (yystpcpy): Use prototype if __STDC__ is defined, not just
16519 if __cplusplus is defined.
16521 2001-11-30 Akim Demaille <akim@epita.fr>
16523 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
16524 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
16525 Gettext doesn't compile cleanly, and dies with -Werror.
16526 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
16527 Include WARNING_CFLAGS here.
16528 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
16529 before being defined.
16531 2001-11-27 Paul Eggert <eggert@twinsun.com>
16533 * lib/quotearg.h (quotearg_n, quotearg_n_style):
16534 First arg is int, not unsigned.
16535 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
16536 (SIZE_MAX, UINT_MAX): New macros.
16537 (quotearg_n_options): Abort if N is negative.
16538 Avoid overflow check on hosts where size_t is 64 bits and int
16539 is 32 bits, as overflow is impossible there.
16540 Fix off-by-one typo that caused unnecessary reallocation.
16542 2001-11-29 Paul Eggert <eggert@twinsun.com>
16544 Name space cleanup in generated parser.
16546 * doc/bison.texinfo (Bison Parser): Discuss system headers
16547 and their effect on the user name space.
16549 * src/bison.simple:
16550 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
16551 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
16552 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
16554 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
16555 on user names when possible.
16557 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
16558 Simplify test for whather <alloca.h> exists.
16560 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
16562 (<stdio.h>): Include if YYDEBUG.
16564 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
16565 ! defined (yyoverflow) && ! defined (yymemcpy).
16567 (yymemcpy, yyparse): Rename local variables as needed so that
16568 they all begin with 'yy'.
16570 (yystrlen, yystpcpy): New functions.
16572 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
16575 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
16576 instead of relying on string.h functions. Use YYSTACK_ALLOC
16577 and YYSTACK_FREE instead of malloc and free.
16579 2001-11-30 Akim Demaille <akim@epita.fr>
16581 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
16582 before their first uses.
16583 (YYBISON, YYPURE): Move to the top of the output.
16585 2001-11-30 Akim Demaille <akim@epita.fr>
16587 * tests/reduce.at (Useless Nonterminals): Fix.
16589 2001-11-30 Akim Demaille <akim@epita.fr>
16591 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
16592 if body instead of `;' to pacify GCC's warnings.
16594 2001-11-30 Akim Demaille <akim@epita.fr>
16596 Instead of mapping the LHS of unused rules to -1, keep the LHS
16597 valid, but flag the rules as invalid.
16599 * src/gram.h (rule_t): `useful' is a new member.
16600 * src/print.c (print_grammar): Adjust.
16601 * src/derives.c (set_derives): Likewise.
16602 * src/reader.c (packgram, reduce_output): Likewise.
16603 * src/reduce.c (reduce_grammar_tables): Likewise.
16604 * tests/reduce.at (Underivable Rules, Useless Rules): New.
16606 2001-11-30 Akim Demaille <akim@epita.fr>
16608 * src/reduce.c (reduce_output): Formatting changes.
16609 * src/print.c (print_results, print_grammar): Likewise.
16610 * tests/regression.at (Rule Line Numbers)
16611 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
16613 2001-11-30 Akim Demaille <akim@epita.fr>
16615 * src/reduce.c (nonterminals_reduce): Instead of throwing away
16616 useless nonterminals, move them at the end of the symbol arrays.
16617 (reduce_output): Adjust.
16618 * tests/reduce.at (Useless Nonterminals): Adjust.
16620 2001-11-30 Akim Demaille <akim@epita.fr>
16622 * src/reduce.c: Various comment/formatting changes.
16623 (nonterminals_reduce): New, extracted from...
16624 (reduce_grammar_tables): here.
16625 (reduce_grammar): Call nonterminals_reduce.
16627 2001-11-29 Paul Eggert <eggert@twinsun.com>
16629 * src/bison.simple (YYSTACK_REALLOC): Remove.
16630 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
16631 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
16633 (union yyalloc): New type.
16634 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
16635 an arbitrary restriction on hosts where size_t is wider than int.
16637 (yyparse): Don't dump core if alloca or malloc fails; instead, report
16638 a parser stack overflow. Allocate just one block of memory for all
16639 three stacks, instead of allocating three blocks; this typically is
16640 faster and reduces fragmentation.
16642 Do not limit the number of items in the stack to a value that fits
16643 in 'int', as this is an arbitrary limit on hosts with 64-bit
16644 size_t and 32-bit int.
16646 2001-11-29 Marc Autret <autret_m@epita.fr>
16648 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
16649 of defining YYERROR_VERBOSE.
16650 [AT_DATA]: $4 is now out of C declarations in the prologue.
16652 2001-11-28 Marc Autret <autret_m@epita.fr>
16654 * src/reader.c (parse_dquoted_param): New.
16655 (parse_skel_decl): Use it.
16656 * src/lex.h: Add its prototype.
16657 * src/lex.c (literalchar): Become not static.
16659 2001-11-28 Marc Autret <autret_m@epita.fr>
16661 * src/output.h: And put its extern declaration here.
16662 * src/output.c (error_verbose): Define here.
16663 (prepare): Echo name modification.
16664 * src/getargs.h: Clean its extern declaration.
16665 * src/getargs.c (error_verbose_flag): Remove.
16666 (getargs): Remove case 'e'.
16667 * src/options.c (option_table): 'error-verbose' is now seen as simple
16671 * src/reader.c (read_declarations): Remove case tok_include.
16672 (parse_include_decl): Remove.
16673 * src/lex.h (token_t): Remove tok_include.
16674 * src/options.c (option_table): 'include' is now a simple command line
16677 2001-11-28 Marc Autret <autret_m@epita.fr>
16679 * src/bison.simple: Adjust muscle names.
16680 * src/muscle_tab.c (muscle_init): Also rename the muscles.
16681 * src/output.c (prepare): s/_/-/ for the muscles names.
16682 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
16684 2001-11-28 Marc Autret <autret_m@epita.fr>
16686 * src/bison.simple: Fix debug.
16687 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
16689 2001-11-28 Akim Demaille <akim@epita.fr>
16691 * src/LR0.c (shifts_new): New.
16692 (save_shifts, insert_start_shift, augment_automaton): Use it.
16694 2001-11-28 Akim Demaille <akim@epita.fr>
16696 * src/closure.c (closure): `b' and `ruleno' denote the same value:
16699 2001-11-28 Akim Demaille <akim@epita.fr>
16701 * src/closure.c (closure): Instead of looping over word in array
16702 then bits in words, loop over bits in array.
16704 2001-11-28 Akim Demaille <akim@epita.fr>
16706 * src/closure.c (closure): No longer optimize the special case
16707 where all the bits of `ruleset[r]' are set to 0, to make the code
16710 2001-11-28 Akim Demaille <akim@epita.fr>
16712 * src/closure.c (closure): `r' and `c' are new variables, used to
16713 de-obfuscate accesses to RULESET and CORE.
16715 2001-11-28 Akim Demaille <akim@epita.fr>
16717 * src/reduce.c (reduce_print): Use ngettext.
16718 (dump_grammar): Improve the trace accuracy.
16720 2001-11-28 Akim Demaille <akim@epita.fr>
16722 * src/reduce.c (dump_grammar): Don't translate trace messages.
16724 2001-11-28 Akim Demaille <akim@epita.fr>
16726 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
16727 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
16728 as all tags are free'ed afterwards.
16729 From Enrico Scholz.
16731 2001-11-27 Paul Eggert <eggert@twinsun.com>
16733 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
16734 use alloca when we didn't want to, and vice versa.
16736 2001-11-27 Marc Autret <autret_m@epita.fr>
16738 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
16740 * src/output.c (prepare): Remove its update.
16742 2001-11-27 Marc Autret <autret_m@epita.fr>
16744 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
16745 Use %error-verbose.
16747 2001-11-27 Marc Autret <autret_m@epita.fr>
16749 * src/bison.simple: Remove YYERROR_VERBOSE using.
16750 Use %%error_verbose.
16751 (yyparse): Likewise.
16752 * src/output.c (prepare): Give its final value.
16753 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
16754 * src/getargs.h: Add its extern declaration.
16755 * src/getargs.c (error_verbose_flag): New int.
16756 (getargs): Update to catch new case.
16757 * src/options.c (option_table): 'error-verbose' is a new option.
16758 (shortopts): Update.
16760 2001-11-27 Akim Demaille <akim@epita.fr>
16762 * src/system.h: Use intl/libgettext.h.
16763 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
16765 2001-11-27 Akim Demaille <akim@epita.fr>
16767 * tests/torture.at (Exploding the Stack Size with Malloc):
16768 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
16770 2001-11-27 Akim Demaille <akim@epita.fr>
16772 * src/files.c: Include error.h.
16773 Reported by Hans Aberg.
16775 2001-11-26 Marc Autret <autret_m@epita.fr>
16777 * src/reader.c (parse_include_decl): New, not yet implemented.
16778 (read_declarations): Add case tok_include.
16779 * src/getargs.h (include): Add its extern definition.
16780 * src/getargs.c (include): New const char *.
16781 (getargs): Add case '-I'.
16782 * src/options.c (option_table): Add include as command line and
16784 * src/lex.h (token_t): Add tok_include.
16786 2001-11-26 Akim Demaille <akim@epita.fr>
16788 * src/reader.c (readgram): Make sure rules for mid-rule actions
16789 have a lineno equal to that of their host rule.
16790 Reported by Hans Aberg.
16791 * tests/regression.at (Rule Line Numbers): New.
16793 2001-11-26 Akim Demaille <akim@epita.fr>
16795 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
16798 2001-11-26 Akim Demaille <akim@epita.fr>
16800 * src/complain.c, src/complain.h (error): Remove, provided by
16803 2001-11-26 Akim Demaille <akim@epita.fr>
16805 * src/reader.c (read_declarations): Don't abort on tok_illegal,
16806 issue an error message.
16807 * tests/regression.at (Invalid %directive): New.
16808 Reported by Hans Aberg.
16810 2001-11-26 Akim Demaille <akim@epita.fr>
16812 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
16813 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16815 2001-11-26 Akim Demaille <akim@epita.fr>
16817 * src/conflicts.c (conflicts_print): Don't complain at all when
16818 there are no reduce/reduce conflicts, and as many shift/reduce
16819 conflicts as expected.
16820 * tests/regression.at (%expect right): Adjust.
16822 2001-11-23 Akim Demaille <akim@epita.fr>
16824 * lib/alloca.c: Update, from fileutils.
16826 2001-11-23 Akim Demaille <akim@epita.fr>
16828 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
16830 2001-11-23 Akim Demaille <akim@epita.fr>
16832 * src/system.h: Include alloca.h.
16833 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
16835 2001-11-23 Akim Demaille <akim@epita.fr>
16837 * src/print_graph.c (print_actions): Remove `rule', unused.
16838 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
16839 pacify GCC's signed < unsigned warnings.
16840 * src/closure.c (itemsetsize): Likewise.
16841 * src/reader.c (symbol_list_new): Static.
16843 2001-11-23 Akim Demaille <akim@epita.fr>
16845 Attaching lineno to buckets is stupid, since only one copy of each
16846 symbol is kept, only the line of the first occurrence is kept too.
16848 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
16849 * src/reader.c (rline_allocated): Remove, unused.
16850 (symbol_list): Have a `line' member.
16851 (symbol_list_new): New.
16852 (readgram): Use it.
16853 * src/print.c (print_grammar): Output the rule line numbers.
16854 * tests/regression.at (Solved SR Conflicts)
16855 (Unresolved SR Conflicts): Adjust.
16856 Reported by Hans Aberg.
16858 2001-11-22 Marc Autret <autret_m@epita.fr>
16860 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
16862 2001-11-22 Marc Autret <autret_m@epita.fr>
16864 * src/muscle_tab.c (muscle_init): Remove initialization of
16866 * src/output.c (output_master_parser): Do it here.
16868 2001-11-20 Akim Demaille <akim@epita.fr>
16871 * configure.in (ALL_LINGUAS): Adjust.
16872 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
16873 longer contains strings to translate.
16875 2001-11-19 Akim Demaille <akim@epita.fr>
16877 * src/conflicts.c (conflicts_print): Add a missing \n.
16879 2001-11-19 Akim Demaille <akim@epita.fr>
16881 * src/nullable.c (nullable_print): New.
16882 (set_nullable): Call it when tracing.
16883 Better locality of variables.
16885 2001-11-19 Akim Demaille <akim@epita.fr>
16887 * src/print.c (print_actions): Better locality of variables.
16889 2001-11-19 Akim Demaille <akim@epita.fr>
16891 * src/derives.c (print_derives): Fix and enrich.
16892 * src/closure.c (print_fderives): Likewise.
16894 2001-11-19 Akim Demaille <akim@epita.fr>
16896 * src/closure.c (itemsetend): Remove, replaced with...
16897 (itemsetsize): new.
16899 2001-11-19 Akim Demaille <akim@epita.fr>
16901 * src/LR0.c (kernel_end): Remove, replaced with...
16902 (kernel_size): new.
16904 2001-11-19 Akim Demaille <akim@epita.fr>
16906 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
16909 2001-11-19 Akim Demaille <akim@epita.fr>
16911 * src/closure.c (closure): Use arrays instead of pointers to clarify.
16913 2001-11-19 Akim Demaille <akim@epita.fr>
16915 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
16917 * src/LR0.c: Likewise.
16918 (allocate_itemsets): Use arrays instead of pointers to clarify.
16920 2001-11-19 Akim Demaille <akim@epita.fr>
16922 * src/getargs.c (statistics_flag): Replace with...
16924 (longopts): Accept --trace instead of --statistics.
16925 * src/getargs.h, src/options.c: Adjust.
16926 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
16927 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
16929 2001-11-19 Akim Demaille <akim@epita.fr>
16931 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
16932 pointers to clarify the code.
16933 (save_reductions, save_shifts): Factor common parts of alternatives.
16935 2001-11-19 Akim Demaille <akim@epita.fr>
16937 * src/LR0.c (new_state, get_state): Complete TRACE code.
16938 * src/closure.c: Include `reader.h' to get `tags', needed by the
16940 Rename the conditional DEBUG as TRACE.
16941 Output consistently TRACEs to stderr, not stdout.
16942 * src/derives.c: Likewise.
16943 * src/reduce.c: (inaccessable_symbols): Using if is better style
16945 Use `#if TRACE' instead of `#if 0' for tracing code.
16947 2001-11-19 Akim Demaille <akim@epita.fr>
16949 * src/system.h (LIST_FREE, shortcpy): New.
16950 * src/LR0.c: Use them.
16951 * src/output.c (free_itemsets, free_reductions, free_shifts):
16952 Remove, replaced by LIST_FREE.
16954 2001-11-19 Akim Demaille <akim@epita.fr>
16956 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
16957 (REDUCTIONS_ALLOC): New.
16958 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
16961 2001-11-19 Akim Demaille <akim@epita.fr>
16963 * src/LR0.c (new_state): Complete trace code.
16964 * src/nullable.c (set_nullable): Don't translate traces.
16966 2001-11-19 Akim Demaille <akim@epita.fr>
16968 * src/print_graph.c (print_core): Better locality of variables.
16969 * src/print.c (print_core): Likewise.
16971 2001-11-19 Akim Demaille <akim@epita.fr>
16973 * src/vcg.c: You do the output, so you are responsible of the
16974 handling of VCG syntax, in particular: use quotearg.
16975 * src/print_graph.c: Don't.
16976 (print_actions): Don't output the actions as part of the nodes,
16977 since that's the job of the edges.
16978 (print_state): Don't output by hand: fill the node description,
16979 and ask for its output.
16981 2001-11-19 Akim Demaille <akim@epita.fr>
16983 * src/bison.simple (yyparse): When verbosely reporting an error,
16984 no longer put additional quotes around token names.
16985 * tests/calc.at: Adjust.
16987 2001-11-19 Akim Demaille <akim@epita.fr>
16989 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
16990 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
16991 * src/output.c: Adjust.
16993 2001-11-19 Akim Demaille <akim@epita.fr>
16995 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
16997 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
16999 2001-11-19 Akim Demaille <akim@epita.fr>
17001 * src/gram.h (rule_t): New.
17003 (rrhs, rlhs): Remove, part of state_t.
17004 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
17005 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17006 * src/reader.c, src/reduce.c: Adjust.
17008 2001-11-19 Akim Demaille <akim@epita.fr>
17010 * src/reader.c (symbols_output): New, extracted from...
17011 (packsymbols): Here.
17014 2001-11-19 Akim Demaille <akim@epita.fr>
17016 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
17017 (maxrhs): this new function.
17019 2001-11-19 Akim Demaille <akim@epita.fr>
17021 * src/lalr.c (F): New macro to access the variable F.
17024 2001-11-19 Akim Demaille <akim@epita.fr>
17026 * src/lalr.h (LA): New macro to access the variable LA.
17027 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17028 * src/lalr.c: Adjust.
17030 2001-11-19 Akim Demaille <akim@epita.fr>
17032 * src/lalr.c (initialize_LA): Only initialize LA. Let...
17033 (set_state_table): handle the `lookaheads' members.
17035 2001-11-19 Akim Demaille <akim@epita.fr>
17037 * src/lalr.h (lookaheads): Removed array, whose contents is now
17039 (state_t): this structure.
17040 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17043 2001-11-19 Akim Demaille <akim@epita.fr>
17045 * src/lalr.h (consistent): Removed array, whose contents is now
17047 (state_t): this structure.
17048 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17051 2001-11-19 Akim Demaille <akim@epita.fr>
17053 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
17054 contents are now members of...
17055 (state_t): this structure.
17056 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17059 2001-11-19 Akim Demaille <akim@epita.fr>
17061 * src/lalr.h (state_t): New.
17062 (state_table): Be a state_t * instead of a core **.
17063 (accessing_symbol): Remove, part of state_t.
17064 * src/lalr.c: Adjust.
17065 (set_accessing_symbol): Merge into...
17066 (set_state_table): this.
17067 * src/print_graph.c, src/conflicts.c: Adjust.
17069 2001-11-14 Akim Demaille <akim@epita.fr>
17071 * tests/calc.at, tests/output.at, tests/regression.at,
17072 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
17073 now the tests are run in private dirs, therefore AC_CLEANUP and
17074 family can be simplified to 0-ary.
17075 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
17076 use abs. path to find config.h.
17077 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
17078 stderr, there can be way too much random noise.
17079 Instead pass -Werror to GCC and rely on the exit status.
17080 Reported by Wolfram Wagner.
17082 2001-11-14 Akim Demaille <akim@epita.fr>
17084 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
17085 defined only if yyoverflow is defined, to avoid `warning: unused
17087 Reported by The Test Suite.
17089 2001-11-14 Akim Demaille <akim@epita.fr>
17091 * src/print.c: Include reduce.h.
17092 Reported by Hans Aberg.
17094 2001-11-14 Akim Demaille <akim@epita.fr>
17096 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
17097 Revert a previous patch: these are really const.
17098 * src/conflicts.c (conflict_report): Additional useless pair of
17099 braces to pacify GCC's warnings for `if () if () {} else {}'.
17100 * src/lex.c (parse_percent_token): Replace equal_offset with
17103 Be sure to strdup `arg' when used, since there is no reason for
17104 token_buffer not to change.
17106 2001-11-14 Akim Demaille <akim@epita.fr>
17108 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
17110 * src/main.c (main): Use them.
17111 Suggested by Hans Aberg.
17113 2001-11-12 Akim Demaille <akim@epita.fr>
17115 * src/system.h (ngettext): Now that we use ngettext, be sure to
17116 provide a default definition when NLS are not used.
17118 2001-11-12 Akim Demaille <akim@epita.fr>
17120 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
17121 Use @kbd to denote user input.
17122 (Language and Grammar): ANSIfy the example.
17123 Adjust its layout for info/notinfo.
17124 (Location Tracking Calc): Output error messages to stderr.
17125 Output locations in a more GNUtically correct way.
17126 Fix a couple of Englishos.
17127 Adjust @group/@end group pairs.
17129 2001-11-12 Akim Demaille <akim@epita.fr>
17131 %expect was not functioning at all.
17133 * src/conflicts.c (expected_conflicts): Set to -1.
17134 (conflict_report): Use ngettext.
17135 (conflicts_print): Check %expect and make its violation an error.
17136 * doc/bison.texinfo (Expect Decl): Adjust.
17137 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
17138 * tests/regression.at (%expect not enough, %expect right)
17139 (%expect too much): New.
17141 2001-11-12 Akim Demaille <akim@epita.fr>
17143 * tests/regression.at (Conflicts): Rename as...
17144 (Unresolved SR Conflicts): this.
17145 (Solved SR Conflicts): New.
17147 2001-11-12 Akim Demaille <akim@epita.fr>
17149 * src/reduce.c (print_results): Rename as...
17150 (reduce_output): This.
17151 Output to OUT, passed as argument, instead of output_obstack.
17152 (dump_grammar): Likewise.
17153 (reduce_free): New.
17155 (reduce_grammar): No longer call reduce_output, since...
17156 * src/print.c (print_results): do it.
17157 * src/main.c (main): Call reduce_free;
17159 2001-11-12 Akim Demaille <akim@epita.fr>
17161 * src/conflicts.c (print_reductions): Accept OUT as argument.
17162 Output to it, not to output_obstack.
17163 * src/print.c (print_actions): Adjust.
17165 2001-11-12 Akim Demaille <akim@epita.fr>
17167 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
17168 the result instead of using...
17169 (src_total, rrc_total, src_count, rrc_count): Remove.
17170 (any_conflicts): Remove.
17171 (print_conflicts): Split into...
17172 (conflicts_print, conflicts_output): New.
17173 * src/conflicts.h: Adjust.
17174 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
17175 * src/print.c (print_grammar): Issue `\n' between two rules.
17176 * tests/regression.at (Conflicts): New.
17177 Reported by Tom Lane.
17179 2001-11-12 Akim Demaille <akim@epita.fr>
17181 * tests/regression.at (Invalid input): Remove, duplicate with
17182 ``Invalid input: 1''.
17184 2001-11-12 Akim Demaille <akim@epita.fr>
17186 * tests/torture.at (AT_DATA_STACK_TORTURE)
17187 (Exploding the Stack Size with Alloca)
17188 (Exploding the Stack Size with Malloc): New.
17190 2001-11-12 Akim Demaille <akim@epita.fr>
17192 * src/bison.simple (YYSTACK_REALLOC): New.
17193 (yyparse) [!yyoverflow]: Use it and free the old stack.
17194 Reported by Per Allansson.
17196 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
17198 * src/bison.simple: Define type yystype instead of YYSTYPE, and
17199 define CPP macro, which substitute YYSTYPE by yystype.
17200 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
17201 with yyltype/YYLTYPE. This allows inclusion of the generated
17202 header within the parser if the compiler, such as GGC, accepts
17203 multiple equivalent #defines.
17206 2001-11-05 Akim Demaille <akim@epita.fr>
17208 * src/reader.c (symbols_output): New, extracted from...
17209 (packsymbols): here.
17212 2001-11-05 Akim Demaille <akim@epita.fr>
17214 * src/lex.c (parse_percent_token): s/quotearg/quote/.
17216 2001-11-05 Akim Demaille <akim@epita.fr>
17218 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
17221 2001-11-05 Akim Demaille <akim@epita.fr>
17223 * src/options.h (struct option_table_struct): set_flags is void*.
17224 * src/options.c (longopts): Support `--output' and `%output'.
17226 * src/lex.h (tok_setopt): Remove, replaced with...
17227 (tok_intopt, tok_stropt): these new guys.
17228 * src/lex.c (getopt.h): Not needed.
17229 (token_buffer, unlexed_token_buffer): Not const.
17230 (percent_table): Promote `-' over `_' in directive names.
17231 Active `%name-prefix', `file-prefix', and `output'.
17232 (parse_percent_token): Accept possible arguments to directives.
17233 Promote `-' over `_' in directive names.
17235 2001-11-04 Akim Demaille <akim@epita.fr>
17237 * doc/bison.texinfo (Decl Summary): Split the list into
17238 `directives for grammars' and `directives for bison'.
17240 Add description of `%name-prefix', `file-prefix', and `output'.
17241 Promote `-' over `_' in directive names.
17242 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
17243 Simplify the description of `--name-prefix'.
17244 Promote `-' over `_' in directive names.
17245 Promote `--output' over `--output-file'.
17246 Fix the description of `--defines'.
17247 * tests/output.at: Exercise %file-prefix and %output.
17249 2001-11-02 Akim Demaille <akim@epita.fr>
17251 * doc/refcard.tex: Update.
17253 2001-11-02 Akim Demaille <akim@epita.fr>
17255 * src/symtab.h (SUNDEF): New.
17256 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
17257 stand for `uninitialized', instead of 0.
17258 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
17259 * src/lex.c (lex): Adjust.
17261 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
17263 Let yylex return it instead of a plain 0.
17264 Reported by Dick Streefland.
17266 2001-11-02 Akim Demaille <akim@epita.fr>
17268 * tests/regression.at (Mixing %token styles): New test.
17270 2001-11-02 Akim Demaille <akim@epita.fr>
17272 * src/reader.c (parse_thong_decl): Formatting changes.
17273 (token_translations_init): New, extracted from...
17274 (packsymbols): Here.
17277 2001-11-01 Akim Demaille <akim@epita.fr>
17279 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
17280 Check that `9foo.y' produces correct cpp guards.
17281 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
17285 2001-11-01 Akim Demaille <akim@epita.fr>
17287 * tests/regression.at (Invalid input: 2): New.
17288 * src/lex.c (unlexed_token_buffer): New.
17289 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
17293 2001-11-01 Akim Demaille <akim@epita.fr>
17295 * tests/calc.at: Catch up with 1.30.
17296 * configure.in: Bump to 1.49a.
17297 Adjust to newer Autotest.
17299 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
17301 * src/conflicts.c: Move global variables rrc_total and src_total ...
17302 (print_conflicts): here.
17303 * src/output.c (output): Free global variable user_toknums.
17304 * src/lex.c (token_obstack): Become static.
17306 2001-10-18 Akim Demaille <akim@epita.fr>
17308 * tests/atlocal.in (GCC): Add.
17309 * tests/calc.at: s/m4_match/m4_bmatch/.
17310 s/m4_patsubst/m4_bpatsubst/.
17311 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
17312 * configure.in: AC_SUBST(GCC).
17314 2001-10-14 Marc Autret <autret_m@epita.fr>
17316 * src/options.c (create_long_option_table): Fix.
17318 2001-10-10 Akim Demaille <akim@epita.fr>
17320 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
17322 2001-10-04 Akim Demaille <akim@epita.fr>
17324 * src/reader.c (parse_union_decl): Push the caracters in
17325 union_obstack, not attrs_obstack.
17327 2001-10-04 Akim Demaille <akim@epita.fr>
17329 Merge in the branch 1.29.
17331 * src/reader.c (packsymbols): Use a temporary obstack for
17332 `%%tokendef', since output_stack is already used elsewhere.
17334 2001-10-02 Akim Demaille <akim@epita.fr>
17338 2001-10-02 Akim Demaille <akim@epita.fr>
17342 2001-10-02 Akim Demaille <akim@epita.fr>
17344 * tests/regression.at (Invalid CPP headers): New.
17345 From Alexander Belopolsky.
17346 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
17348 2001-10-02 Akim Demaille <akim@epita.fr>
17350 * tests/regression.at (Invalid input): New.
17351 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
17354 2001-10-02 Akim Demaille <akim@epita.fr>
17356 * tests/calc.at: Now that --debug works, the tests must be adjusted.
17358 2001-10-02 Akim Demaille <akim@epita.fr>
17360 * src/output.c (output_parser): Assert `skeleton'.
17361 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
17365 2001-10-01 Marc Autret <autret_m@epita.fr>
17367 * src/lex.h: Echo modifications.
17368 * src/lex.c (unlex): Parameter is now token_t.
17371 2001-10-01 Marc Autret <autret_m@epita.fr>
17373 * src/main.c: Include lex.h.
17376 2001-09-29 Akim Demaille <akim@epita.fr>
17378 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
17380 2001-09-28 Akim Demaille <akim@epita.fr>
17382 * tests/testsuite.at: Update to newer Autotest.
17383 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
17385 2001-09-27 Akim Demaille <akim@epita.fr>
17387 Position independent wrapper.
17389 * tests/bison: Remove.
17390 * tests/bison.in: New.
17391 * configure.in: Adjust.
17393 2001-09-27 Paul Eggert <eggert@twinsun.com>
17395 Port quotearg fixes from tar 1.13.24.
17397 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
17399 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
17400 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
17402 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
17403 * m4/mbrtowc.m4: New file.
17404 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
17405 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
17407 2001-09-27 Akim Demaille <akim@epita.fr>
17411 2001-09-27 Akim Demaille <akim@epita.fr>
17415 2001-09-25 Akim Demaille <akim@epita.fr>
17417 * src/system.h: Include `xalloc.h'.
17418 Remove it from the C files.
17419 * src/files.c (output_files): Free the obstacks.
17420 * src/lex.c (init_lex): Rename as...
17423 * src/main.c (main): Use it.
17425 2001-09-24 Marc Autret <autret_m@epita.fr>
17427 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
17428 to output informations in fout (FILE*).
17429 (open_graph, close_graph): Likewise.
17430 (output_graph, output_edge, output_node): Likewise.
17431 * src/vcg.h: Update function prototypes.
17432 * src/print_graph.c (print_graph): Open output graph file.
17433 (print_actions): Adjust.
17434 * src/files.h: Remove extern declaration.
17435 * src/files.c: Remove graph_obstack declaration.
17436 (open_files): Remove graph_obstack initialization.
17437 (output_files): Remove graph_obstack saving.
17439 2001-09-24 Marc Autret <autret_m@epita.fr>
17441 * src/files.c (compute_output_file_names): Fix.
17443 2001-09-24 Marc Autret <autret_m@epita.fr>,
17444 Akim Demaille <akim@epita.fr>
17446 * src/reader.c (reader): Remove call to free_symtab ().
17447 * src/main.c (main): Call it here.
17449 * src/conflicts.c (initialize_conflicts): Rename as...
17450 (solve_conflicts): this.
17451 * src/print.c (print_core, print_actions, print_state)
17452 (print_grammar): Dump to a file instead a `output_obstack'.
17453 (print_results): Dump `output_obstack', and then proceed with the
17455 * src/files.c (compute_output_file_names, close_files): New.
17456 (output_files): Adjust.
17457 * src/main.c (main): Adjust.
17459 2001-09-23 Marc Autret <autret_m@epita.fr>
17461 * src/files.c (compute_header_macro): Computes header macro name
17462 from spec_defines_file when given.
17464 2001-09-23 Marc Autret <autret_m@epita.fr>
17466 * src/files.c (output_files): Add default extensions.
17468 2001-09-22 Akim Demaille <akim@epita.fr>
17470 * src/conflicts.c (finalize_conflicts): Rename as...
17471 (free_conflicts): this.
17473 2001-09-22 Akim Demaille <akim@epita.fr>
17475 * src/gram.c (gram_free): Rename back as...
17477 (output_token_translations): Free `token_translations'.
17478 * src/symtab.c (free_symtab): Free the tag field.
17480 2001-09-22 Akim Demaille <akim@epita.fr>
17482 Remove `translations' as it is always set to true.
17484 * src/gram.h: Adjust.
17485 * src/reader.c (packsymbols, parse_token_decl): Adjust
17486 * src/print.c (print_grammar): Adjust.
17487 * src/output.c (output_token_translations): Adjust.
17488 * src/lex.c (lex): Adjust.
17489 * src/gram.c: Be sure the set pointers to NULL.
17490 (dummy): Rename as...
17493 2001-09-22 Akim Demaille <akim@epita.fr>
17495 * configure.in: Invoke AM_LIB_DMALLOC.
17496 * src/system.h: Use dmalloc.
17497 * src/LR0.c: Be sure to have pointers initialized to NULL.
17498 (allocate_itemsets): Allocate kernel_items only if needed.
17500 2001-09-22 Akim Demaille <akim@epita.fr>
17502 * configure.in: Bump to 1.29b.
17503 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
17504 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
17505 need xmalloc.c in calc.y.
17508 2001-09-21 Akim Demaille <akim@epita.fr>
17511 * Makefile.maint, config/config.guess, config/config.sub,
17512 * config/missing: Update from masters.
17513 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
17515 * configure.in (ALL_LINGUAS): Add `tr'.
17517 2001-09-21 Akim Demaille <akim@epita.fr>
17519 * tests/Makefile.am (package.m4): Move to...
17520 ($(srcdir)/$(TESTSUITE)): here.
17522 2001-09-20 Akim Demaille <akim@epita.fr>
17524 * src/complain.c: No longer try to be standalone: use system.h.
17525 Don't assume __STDC__ is defined to 1. Just test if it is defined.
17526 * src/complain.h: Likewise.
17527 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
17528 Remove the unused variable `n'.
17529 From Albert Chin-A-Young.
17531 2001-09-18 Marc Autret <autret_m@epita.fr>
17533 * doc/bison.1: Update.
17534 * doc/bison.texinfo (Bison Options): Update --defines and --graph
17536 (Option Cross Key): Update.
17539 2001-09-18 Marc Autret <autret_m@epita.fr>
17541 * tests/regression.at: New test (comment in %union).
17543 2001-09-18 Marc Autret <autret_m@epita.fr>
17545 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
17547 Reported by Keith Browne.
17549 2001-09-18 Marc Autret <autret_m@epita.fr>
17551 * tests/output.at: Add tests for --defines and --graph.
17553 2001-09-18 Marc Autret <autret_m@epita.fr>
17555 * tests/output.at: Removes tests of %{header,src}_extension features.
17557 2001-09-18 Akim Demaille <akim@epita.fr>
17559 * tests/Makefile.am (package.m4): New.
17560 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
17561 (_AT_CHECK_CALC_ERROR): Likewise.
17562 Factor the `, ' part of verbose error messages.
17564 2001-09-18 Marc Autret <autret_m@epita.fr>
17566 * src/getargs.c (longopts): Declare --defines and --graph as options
17567 with optional arguments.
17568 * src/files.h: Add extern declarations.
17569 * src/files.c (spec_graph_file, spec_defines_file): New.
17570 (output_files): Update.
17571 Remove CPP-outed code.
17573 2001-09-18 Marc Autret <autret_m@epita.fr>
17575 Turn off %{source,header}_extension feature.
17577 * src/files.c (compute_exts_from_gf): Update.
17578 (compute_exts_from_src): Update.
17579 (output_files): CPP-out useless code.
17580 * src/files.h: Remove {header,source}_extension extern declarations.
17581 * src/reader.c (parse_dquoted_param): CPP-out.
17582 (parse_header_extension_decl): Remove.
17583 (parse_source_extension_decl): Remove.
17584 (read_declarations): Remove cases tok_{hdrext,srcext}.
17585 * src/lex.c (percent_table): Remove {header,source}_extension entries.
17586 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
17588 2001-09-10 Akim Demaille <akim@epita.fr>
17590 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
17591 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
17592 (AT_CHECK_OUTPUT): this.
17593 Merely check ls' exit status, its output is useless.
17595 2001-09-10 Akim Demaille <akim@epita.fr>
17597 * tests/calc.at: Use m4_match.
17598 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
17600 2001-09-10 Marc Autret <autret_m@epita.fr>,
17601 Akim Demaille <akim@epita.fr>
17603 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
17605 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
17607 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
17608 * src/lex.h: Adjust prototype.
17609 (token_t): Add `tok_undef'.
17610 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
17611 (parse_percent_token): Now returns token_t.
17612 Add default statement in switch.
17613 (lex): Separate `c' as an input variable, from the token_t result
17615 (unlexed): Is a token_t.
17617 2001-09-10 Akim Demaille <akim@epita.fr>
17619 * configure.in: Bump to 1.29a.
17621 2001-09-07 Akim Demaille <akim@epita.fr>
17625 2001-08-30 Akim Demaille <akim@epita.fr>
17627 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
17628 * m4/atconfig.m4: Remove.
17629 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
17630 * tests/bison: New.
17631 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
17632 m4_if, m4_patsubst, and m4_regexp.
17633 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
17634 `input' file instead of echo.
17636 2001-08-29 Akim Demaille <akim@epita.fr>
17640 2001-08-29 Akim Demaille <akim@epita.fr>
17644 2001-08-29 Paul Eggert <eggert@twinsun.com>
17646 * src/bison.simple (yyparse): Don't take the address of an
17647 item before the start of an array, as that doesn't conform to
17650 2001-08-29 Robert Anisko <anisko_r@epita.fr>
17652 * doc/bison.texinfo (Location Tracking Calc): New node.
17654 2001-08-29 Paul Eggert <eggert@twinsun.com>
17656 * src/output.c (output): Do not define const, as this now
17657 causes more problems than it cures.
17659 2001-08-29 Akim Demaille <akim@epita.fr>
17661 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
17663 Be sure to tag the `detailmenu'.
17665 2001-08-29 Akim Demaille <akim@epita.fr>
17667 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
17668 download in a tmp dir.
17670 2001-08-28 Marc Autret <autret_m@epita.fr>
17672 * config/depcomp: New file.
17674 2001-08-28 Marc Autret <autret_m@epita.fr>
17676 * doc/bison.1 (mandoc): Adjust.
17677 From Juan Manuel Guerrero.
17679 2001-08-28 Marc Autret <autret_m@epita.fr>
17681 * src/print_graph.c (print_state): Fix.
17683 2001-08-27 Marc Autret <autret_m@epita.fr>
17685 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
17687 Echo modifications to the functions prototypes.
17688 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
17690 2001-08-27 Marc Autret <autret_m@epita.fr>
17692 * src/vcg.c: Include `xalloc.h'.
17693 (add_colorentry): New.
17694 (add_classname): New.
17695 (add_infoname): New.
17696 * src/vcg.h: Add new prototypes.
17698 2001-08-27 Akim Demaille <akim@epita.fr>
17700 * Makefile.maint: Sync. again with CVS Autoconf.
17702 2001-08-27 Akim Demaille <akim@epita.fr>
17704 * Makefile.maint: Formatting changes.
17705 (po-update, cvs-update, update): New targets.
17708 2001-08-27 Akim Demaille <akim@epita.fr>
17710 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17711 * Makefile.maint: Sync. with CVS Autoconf.
17713 2001-08-27 Marc Autret <autret_m@epita.fr>
17715 * src/vcg.h (struct infoname_s): New.
17716 (struct colorentry_s): New.
17717 (graph_s): New fields {vertical,horizontal}_order in structure.
17718 Add `infoname' field.
17719 Add `colorentry' field;
17720 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
17721 (G_HORIZONTAL_ORDER): New.
17723 (G_COLORENTRY): New.
17724 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
17725 Add output of `infoname'.
17726 Add output of `colorentry'.
17728 2001-08-27 Marc Autret <autret_m@epita.fr>
17730 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
17731 This one shadowed a global parameter.
17733 2001-08-24 Marc Autret <autret_m@epita.fr>
17735 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
17736 instead of `unsigned'.
17737 (print_state): Do not call obstack_object_size () in obstack_grow ()
17738 to avoid macro variables shadowing.
17740 2001-08-23 Marc Autret <autret_m@epita.fr>
17742 * src/lex.c (percent_table): Typo: s/naem/name/.
17744 Normalize new options declarations.
17746 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
17748 * tests/suite.at: Exercise %header_extension and %source_extension.
17750 2001-08-16 Marc Autret <autret_m@epita.fr>
17752 * src/reader.c (parse_dquoted_param): New.
17753 (parse_header_extension_decl): Use it.
17754 (parse_source_extension_decl): Likewise.
17756 2001-08-16 Marc Autret <autret_m@epita.fr>
17758 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
17759 (get_xxxx_str): Use assert () instead of complain ().
17760 Remove return invokations in default cases.
17761 (get_decision_str): Modify default behaviour. Remove second argument.
17762 Echo modifications on calls.
17763 (output_graph): Fix.
17765 2001-08-16 Marc Autret <autret_m@epita.fr>
17767 * src/getargs.c (usage): Update with ``-g, --graph''.
17769 2001-08-16 Marc Autret <autret_m@epita.fr>
17771 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
17772 (Option Cross Key): Likewise.
17773 * doc/bison.1: Update.
17775 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
17777 * src/output.c (output_master_parser): Don't finish action_obstack.
17778 (output_parser): Don't care about the muscle action, here.
17779 (prepare): Copy the action_obstack in the action muscle.
17780 (output): Free action_obstack.
17782 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
17784 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
17785 will contain `%union' declaration.
17786 (parse_union_decl): Delete #line directive output.
17787 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
17788 informations about %union.
17789 (parse_union_decl): Copy the union_obstack in the muscle stype.
17790 * src/bison.simple: Add new #line directive.
17791 Add typdef %%stype YYSTYPE.
17793 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
17795 * src/bison.simple: Add new `#line' directive.
17797 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
17799 * src/bison.simple: New `#line' directive.
17800 * src/output.c (output_parser): Support new dynamic muscle input_line.
17802 2001-09-22 Marc Autret <autret_m@epita.fr>
17804 * src/output.c (output_master_parser): New.
17805 (output_parser): Be more re-entrant.
17807 2001-09-21 Marc Autret <autret_m@epita.fr>
17809 * src/reader.c (copy_definition, parse_union_decl): Update and use
17811 (copy_action): Likewise.
17812 Use obstack_1grow ().
17813 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
17815 2001-09-21 Marc Autret <autret_m@epita.fr>
17817 * src/options.c (option_table): Adjust.
17818 * src/lex.c (parse_percent_token): Fix.
17820 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
17822 * src/options.c (symtab.h): Include it, need by lex.h.
17824 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
17826 * src/lex.c (parse_percent_token): Change type of variable `tx', which
17827 is now an option_table_struct*.
17828 (option_strcmp): New function option_strcmp.
17829 (parse_percent_token): Call option_strcmp.
17830 * src/getargs.c (xalloc.h, options.h): Include it.
17831 (getargs): Call create_long_option_table.
17832 (getargs): Free longopts at the end of the function.
17833 (shortopts): Move in options.c.
17834 * src/options.c (create_long_option_table): New function. Convert
17835 information from option_table to option structure.
17836 * src/reader.c (options.h): Include it.
17838 * src/Makefile.am: Adjust.
17839 * src/options.c (option_table): Create from longopts and percent_table.
17840 * src/getargs.c (longopts): Delete.
17841 * src/lex.c (struct percent_table_struct): Delete.
17842 (percent_table): Delete.
17843 (options.h): Include it.
17844 * src/options.c: Create.
17845 * src/options.h: Create.
17846 Declare enum opt_access_e.
17847 Define struct option_table_struct.
17849 2001-09-20 Marc Autret <autret_m@epita.fr>
17851 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
17854 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
17856 * src/bison.simple: s/%%filename/%%skeleton.
17857 * src/muscle_tab.c (getargs.h): Include it.
17858 (muscle_init): Insert new muscle skeleton.
17860 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
17862 * src/output.c (output_parser): Delete unused variable actions_dumped.
17864 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
17866 * src/output.c (output): Delete call to reader_output_yylsp.
17867 * src/reader.c (reader): Likewise.
17868 * src/reader.h: Delete declaration of reader_output_yylsp.
17870 2001-09-02 Marc Autret <autret_m@epita.fr>
17872 * src/reader.c: Include muscle_tab.h.
17873 (parse_union_decl): Update.
17874 (parse_macro_decl): Rename parse_muscle_decl.
17875 Update to use renamed functions and variable.
17876 (read_declarations, copy_action, read_additionnal_code, : Updated
17877 with correct variables and functions names.
17878 (packsymbols, reader): Likewise.
17880 * src/reader.h (muscle_obstack): Extern declaration update.
17882 * src/output.c: Include muscle_tab.h
17883 In all functions using macro_insert, change by using muscle_insert ().
17884 (macro_obstack): Rename muscle_obstack.
17885 Echo modifications in the whole file.
17886 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
17887 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
17888 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
17890 * src/muscle_tab.h: Update double inclusion macros.
17891 (macro_entry_s): Rename muscle_entry_s.
17894 * src/muscle_tab.c: Include muscle_tab.h.
17895 Rename macro_tabble to muscle_table.
17896 (mhash1, mhash2, mcmp): Use muscle_entry.
17897 (macro_init): Rename muscle_init. Update.
17898 (macro_insert): Rename muscle_insert. Update.
17899 (macro_find): Rename muscle_find. Update.
17901 * src/main.c: Include muscle_tab.h.
17902 (main): Call muscle_init ().
17903 * src/Makefile.am (bison_SOURCES): Echo modifications.
17905 2001-09-02 Marc Autret <autret_m@epita.fr>
17907 Now the files macro_tab.[ch] are named muscle_tab.[ch].
17909 * src/muscle_tab.c, src/muscle_tab.h: Add files.
17911 2001-09-02 Marc Autret <autret_m@epita.fr>
17913 * src/macrotab.c, src/macrotab.h: Remove.
17915 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
17917 * src/reader.c (copy_guard): Use muscle to specify the `#line'
17920 2001-09-01 Marc Autret <autret_m@epita.fr>
17922 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
17923 to an explicit value to activate the feature. We do it here.
17925 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17927 * src/output.c (prepare): Delete the `filename' muscule insertion.
17928 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
17929 (parse_union_decl): Likewise.
17930 * src/macrotab.c (macro_init): Initialize filename by infile.
17932 2001-08-31 Marc Autret <autret_m@epita.fr>
17934 * src/bison.simple (YYLSP_NEEDED): New definition.
17935 * src/output.c (prepare): Add macro insertion of `locations_flag'
17937 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17939 * src/output.c (prepare): Delete insertion of previous muscles,
17940 and insert the `prefix' muscles.
17941 * src/macrotab.c (macro_init): Likewise.
17942 (macro_init): Initialization prefix directive by `yy'.
17943 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17944 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
17945 yylval, yydebug, yyerror, yynerrs and yyparse.
17946 New directive `#define' to substitute yydebug, ... with option
17949 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17951 * src/main.c (main): Standardize.
17952 * src/output.c (output_table_data, output_parser): Likewise.
17953 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
17955 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
17957 * src/reader.c (read_additionnal_code): Rename %%user_code to
17959 * src/output.c (output): Rename %%declarations to %%prologue.
17960 * src/bison.simple: Echo modifications.
17962 2001-08-31 Marc Autret <autret_m@epita.fr>
17964 * src/reader.c (readgram): CleanUp.
17965 (output_token_defines): Likewise.
17966 (packsymbols): Likewise.
17967 (reader): Likewise.
17968 * src/output.c (output): CPP-out useless code.
17970 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17972 * src/reader.c (reader): Delete obsolete call to function
17973 output_trailers and output_headers.
17974 * src/output.h: Remove obsolete functions prototypes of output_headers
17975 and output_trailers.
17977 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
17979 * src/main.c: Include macrotab.h.
17980 * src/macrotab.h (macro_entry_s): Constify fields.
17981 Adjust functions prototypes.
17982 * src/macrotab.c (macro_insert): Constify key and value.
17983 (macro_find): Constify key.
17984 (macro_insert): Include 'xalloc.h'
17985 (macro_insert): Use XMALLOC.
17986 (macro_find): Constify return value.
17987 * src/output.c (output_table_data): Rename table to table_data.
17988 (output_parser): Constify macro_key, macro_value.
17990 2001-08-30 Marc Autret <autret_m@epita.fr>
17992 * src/reader.c (parse_skel_decl): New.
17993 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
17994 * src/lex.h (token_t): New token `tok_skel'.
17995 * src/lex.c (percent_table): Add skeleton option entry.
17998 2001-08-29 Marc Autret <autret_m@epita.fr>
18000 * src/bison.simple: Add %%user_code directive at the end.
18001 * src/reader.c (read_additionnal_code): New.
18003 * src/output.c (output_program): Remove.
18006 2001-08-28 Marc Autret <autret_m@epita.fr>
18008 * src/output.c (output_actions): Clean up.
18009 (output_gram): CPP-out useless code.
18010 * src/reader.c (reader): Clean up, CPP-out useless code.
18012 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
18014 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
18016 * src/bison.simple: Add `%%definitions'.
18018 2001-08-28 Marc Autret <autret_m@epita.fr>
18020 * config/depcomp: New file.
18022 2001-08-27 Paul Eggert <eggert@twinsun.com>
18024 * src/bison.simple (yyparse): Don't take the address of an
18025 item before the start of an array, as that doesn't conform to
18028 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
18030 * src/output.c (output): Remove the initialization of the macro
18031 obstack. It was done too late here.
18033 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
18035 (reader): Initialize the macro obstack here, since we need it to grow
18036 '%define' directives.
18038 * src/reader.h: Declare the macro obstack as extern.
18040 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
18042 * src/output.c (output_parser): Fix. Store single '%' characters in
18043 the output obstack instead of throwing them away.
18045 2001-08-27 Akim Demaille <akim@epita.fr>
18047 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
18049 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18051 * lib/Makefile.am: Adjust.
18053 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18055 * src/bison.simple: Update and add '%%' directives.
18057 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18059 * src/reader.c (reader): Remove calls to 'output_headers' and
18060 'output_trailers'. Remove some C output.
18061 (readgram): Disable a piece of code that was writing a default
18062 definition for 'YYSTYPE'.
18063 (reader_output_yylsp): Remove.
18064 (packsymbols): Output token defintions to a macro.
18065 (copy_definition): Disable C output.
18067 * src/reader.c (parse_macro_decl): New function used to parse macro
18069 (copy_string2): Put the body of copy_string into this new function.
18070 Add a parameter to let the caller choose whether he wants to copy the
18071 string delimiters or not.
18072 (copy_string): Be a simple call to copy_string2 with the last argument
18074 (read_declarations): Add case for macro definition.
18075 (copy_identifier): New.
18076 (parse_macro_decl): Read macro identifiers using copy_identifier
18079 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18081 * src/output.c (prepare): Add prefixed names.
18082 (output_parser): Output semantic actions.
18083 (output_parser): Fix bug on '%%line' directives.
18085 * src/output.c (output_headers): Remove. The C code printed by this
18086 function should now be in the skeletons.
18087 (output_trailers): Remove.
18088 (output): Disable call to 'reader_output_yylsp'.
18089 (output_rule_data): Do not output tables to the table obstack.
18091 * src/output.c: Remove some C dedicated output.
18092 Improve the use of macro and output obstacks.
18093 (output_defines): Remove.
18095 * src/output.c (output_token_translations): Associate 'translate'
18096 table with a macro. No output to the table obstack.
18097 (output_gram): Same for 'rhs' and 'prhs'.
18098 (output_stos): Same for 'stos'.
18099 (output_rule_data): Same for 'r1' and 'r2'.
18100 (token_actions): Same for 'defact'.
18101 (goto_actions): Same for 'defgoto'.
18102 (output_base): Same for 'pact' and 'pgoto'.
18103 (output_table): Same for 'table'.
18104 (output_check): Same for 'check'.
18106 * src/output.c (output_table_data): New function.
18107 (output_short_table): Remove.
18108 (output_short_or_char_table): Remove.
18110 * src/output.c (output_parser): Replace most of the skeleton copy code
18111 with something new. Skeletons are now processed character by character
18112 rather than line by line, and Bison looks for '%%' macros. This is the
18113 first step in making Bison's output process (a lot) more flexible.
18114 (output_parser): Use the macro table.
18116 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18118 * src/main.c (main): Initialize the macro table.
18120 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18122 * src/lex.c (percent_table): Add tok_define.
18123 * src/lex.h: Add tok_define.
18125 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18127 * src/macrotab.c: New file.
18128 * src/macrotab.h: New file.
18129 * src/Makefile.am: Update.
18131 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18133 * lib/hash.c: New file.
18134 * lib/hash.h: New file.
18135 * lib/Makefile.am: Update.
18137 2001-08-15 Akim Demaille <akim@epita.fr>
18141 2001-08-15 Marc Autret <autret_m@epita.fr>
18143 * src/reader.c (readgram): Indent output macro YYSTYPE.
18144 (packsymbols): Likewise.
18145 (output_token_defines): Likewise.
18146 * src/files.c: Standardize.
18147 (compute_header_macro): New.
18148 (defines_obstack_save): New. Use compute_header_macro.
18149 (output_files): Update. Use defines_obstack_save.
18151 2001-08-15 Akim Demaille <akim@epita.fr>
18153 * doc/bison.texinfo (Table of Symbols): Document
18154 YYSTACK_USE_ALLOCA.
18156 2001-08-15 Akim Demaille <akim@epita.fr>
18158 * missing: Update from CVS Automake.
18159 * config/config.guess, config/config.sub, config/texinfo.tex:
18160 Update from gnu.org.
18162 2001-08-15 Akim Demaille <akim@epita.fr>
18164 * Makefile.maint: Sync with CVS Autoconf.
18166 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
18168 * doc/bison.texinfo: Include GNU Free Documentation License from
18170 * doc/fdl.texi: Add to package.
18172 2001-08-14 Marc Autret <autret_m@epita.fr>
18174 Turn on %{source,header}_extension features.
18176 * src/lex.c (percent_table): Un-CPP out header_extension and
18178 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
18179 (compute_exts_from_src): Remove conditions. It restores priorities
18182 2001-08-14 Marc Autret <autret_m@epita.fr>
18184 * src/files.c (compute_base_names): Add extensions computing when
18185 `--file-prefix' used.
18186 Standardize function calls.
18188 2001-08-13 Marc Autret <autret_m@epita.fr>
18190 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
18191 defining it (defined but null disables alloca).
18193 2001-08-13 Marc Autret <autret_m@epita.fr>
18195 * src/bison.simple (_yy_memcpy): CPP reformat.
18197 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
18199 * tests/atconfig.in (CPPFLAGS): Fix.
18201 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
18203 * doc/bison.texinfo: Include GNU General Public License from
18205 * doc/gpl.texi: Add to package.
18207 2001-08-10 Marc Autret <autret_m@epita.fr>
18209 * src/print_graph.h: Fix.
18210 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
18212 2001-08-10 Akim Demaille <akim@epita.fr>
18214 * src/system.h: Provide default declarations for stpcpy, strndup,
18217 2001-08-10 Robert Anisko <anisko_r@epita.fr>
18219 * doc/bison.texinfo (Locations): Update @$ stuff.
18221 2001-08-09 Robert Anisko <anisko_r@epita.fr>
18223 * src/bison.simple (YYLLOC_DEFAULT): Update.
18226 2001-08-08 Marc Autret <autret_m@epita.fr>
18228 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
18229 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
18230 Reported by Fabrice Bauzac.
18232 2001-08-08 Marc Autret <autret_m@epita.fr>
18234 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
18235 * src/vcg.c (output_node): Fix.
18236 * src/vcg.h: Cleanup.
18237 * src/print_graph.c: Add comments.
18238 (node_output_size): New global variable. Simplify the formatting of
18239 the VCG graph output.
18240 (print_actions): Unused code is now used. It notifies the final state
18241 and no action states in the VCG graph. It also give the reduce actions.
18242 The `shift and goto' edges are red and the `go to state' edges are
18244 Get the current node name and node_obstack by argument.
18245 (node_obstack): New variable.
18246 (print_state): Manage node_obstack.
18247 (print_core): Use node_obstack given by argument.
18248 A node is not only computed here but in print_actions also.
18249 (print_graph): CPP out useless code instead of commenting it.
18251 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
18253 * tests/atconfig.in (CPPFLAGS): Fix.
18255 2001-08-07 Akim Demaille <akim@epita.fr>
18257 * src/print_graph.c (quote): New.
18258 (print_core): Use it.
18260 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
18262 * src/vcg.c (complain.h): Include it.
18263 Unepitaize `return' invocations.
18264 [NDEBUG] (main): Remove.
18265 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
18266 * src/files.c (open_files): Initialize graph_obstack.
18267 * src/print_graph.c (print_actions): CPP out useless code.
18268 (print_core): Don't output the last `\n' in labels.
18270 * src/files.c (output_files): Output the VCG file.
18271 * src/main.c (main): Invoke print_graph ();
18273 2001-08-06 Marc Autret <autret_m@epita.fr>
18275 Automaton VCG graph output.
18276 Using option ``-g'' or long option ``--graph'', you can generate
18277 a gram_filename.vcg file containing a VCG description of the LALR (1)
18278 automaton of your grammar.
18280 * src/main.c: Call to print_graph() function.
18281 * src/getargs.h: Update.
18282 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
18283 (graph_flag): New flag.
18284 (longopts): Update.
18285 (getargs): Add case `g'.
18286 * src/files.c (graph_obstack): New obstack struct.
18287 (open_files): Initialize new obstack.
18288 (output_files): Saves graph_obstack if required.
18289 * src/files.h (graph_obstack): New extern declaration.
18290 * src/Makefile.am: Add new source files.
18292 2001-08-06 Marc Autret <autret_m@epita.fr>
18294 * src/print_graph.c, src/print_graph.h (graph): New.
18295 * src/vcg.h: New file.
18296 * src/vcg.c: New file, VCG graph handling.
18298 2001-08-06 Marc Autret <autret_m@epita.fr>
18300 Add of %source_extension and %header_extension which specify
18301 the source or/and the header output file extension.
18303 * src/files.c (compute_base_names): Remove initialisation of
18304 src_extension and header_extension.
18305 (compute_exts_from_gf): Update.
18306 (compute_exts_from_src): Update.
18307 (output_files): Update.
18308 * src/reader.c (parse_header_extension_decl): New.
18309 (parse_source_extension_decl): New.
18310 (read_declarations): New case statements for the new tokens.
18311 * src/lex.c (percent_table): Add entries for %source_extension
18312 and %header_extension.
18313 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
18315 2001-08-06 Marc Autret <autret_m@epita.fr>
18317 * configure.in: Bump to 1.28c.
18318 * doc/bison.texinfo: Texinfo thingies.
18320 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
18322 * tests/atconfig.in (CPPFLAGS): Add.
18323 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
18325 2001-08-03 Akim Demaille <akim@epita.fr>
18329 2001-08-03 Akim Demaille <akim@epita.fr>
18331 * tests/Makefile.am (check-local): Ship testsuite.
18332 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
18333 Include `string.h'.
18335 2001-08-03 Akim Demaille <akim@epita.fr>
18337 * configure.in: Try using -Wformat when compiling.
18339 2001-08-03 Akim Demaille <akim@epita.fr>
18341 * configure.in: Bump to 1.28b.
18343 2001-08-03 Akim Demaille <akim@epita.fr>
18345 * src/complain.c: Adjust strerror_r portability issues.
18347 2001-08-03 Akim Demaille <akim@epita.fr>
18351 2001-08-03 Akim Demaille <akim@epita.fr>
18353 * src/getargs.c, src/getarg.h (skeleton)): Constify.
18354 * src/lex.c (literalchar): Avoid name clashes on `buf'.
18355 * src/getargs.c: Include complain.h.
18356 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
18357 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
18359 2001-08-03 Akim Demaille <akim@epita.fr>
18361 * src/reader.c (readgram): Display hidden chars in error messages.
18363 2001-08-03 Akim Demaille <akim@epita.fr>
18365 Update to gettext 0.10.39.
18367 2001-08-03 Akim Demaille <akim@epita.fr>
18369 * lib/strspn.c: New.
18371 2001-08-01 Marc Autret <autret_m@epita.fr>
18373 * doc/bison.texinfo: Update.
18374 * doc/bison.1 (mandoc): Update.
18375 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
18376 * src/files.c: Support output files extensions computing.
18377 (src_extension): New static variable.
18378 (header_extension): New static variable.
18379 (tr): New function.
18380 (get_extension_index): New function, gets the index of an extension
18381 filename in a string.
18382 (compute_exts_from_gf): New function, computes extensions from the
18383 grammar file extension.
18384 (compute_exts_from_src): New functions, computes extensions from the
18385 C source file extension, file given by ``-o'' option.
18386 (compute_base_names): Update.
18387 (output_files): Update.
18389 2001-08-01 Robert Anisko <anisko_r@epita.fr>
18391 * doc/bison.texi: Document @$.
18392 (Locations): New section.
18394 2001-07-18 Akim Demaille <akim@epita.fr>
18396 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
18397 * config/prev-version.txt, config/move-if-change: New.
18398 * Makefile.am: Adjust.
18400 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
18402 * src/bison.simple (yyparse): Suppress warning `comparaison
18403 between signed and unsigned'.
18405 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
18407 * src/getargs.h (raw_flag): Remove.
18408 * src/getargs.c: Die on `-r'/`--raw'.
18409 * src/lex.c (parse_percent_token): Die on `%raw'.
18410 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
18411 * tests/calc.at: Suppress test with option `--raw'.
18413 2001-07-14 Akim Demaille <akim@epita.fr>
18416 * configure.in: Require Autoconf 2.50.
18417 Update to gettext 0.10.38.
18419 2001-03-16 Akim Demaille <akim@epita.fr>
18421 * doc/bison.texinfo: ANSIfy the examples.
18423 2001-03-16 Akim Demaille <akim@epita.fr>
18425 * getargs.c (skeleton): New variable.
18426 (longopts): --skeleton is a new option.
18427 (shortopts, getargs): -S is a new option.
18428 * getargs.h: Declare skeleton.
18429 * output.c (output_parser): Use it.
18431 2001-03-16 Akim Demaille <akim@epita.fr>
18433 * m4/strerror_r.m4: New.
18434 * m4/error.m4: Run AC_FUNC_STRERROR_R.
18435 * lib/error.h, lib/error.c: Update.
18437 2001-03-16 Akim Demaille <akim@epita.fr>
18439 * src/getargs.c (longopts): Clean up.
18441 2001-02-21 Akim Demaille <akim@epita.fr>
18443 * src/reader.c (gensym): `gensym_count' is your own.
18444 Use a static buf to create the symbol name, as token_buffer is no
18447 2001-02-08 Akim Demaille <akim@epita.fr>
18449 * src/conflicts.c (conflict_report): Be sure not to append to res
18450 between two calls, which could happen if both first sprintf were
18451 skipped, but not the first cp += strlen.
18453 2001-02-08 Akim Demaille <akim@epita.fr>
18455 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
18456 New, from fileutils 4.0.37.
18457 * configure.in: Require Autoconf 2.49c. I took some time before
18458 making this decision. This is the only way out for portability
18459 issues in Bison, it would mean way too much duplicate effort to
18460 import in Bison features implemented in 2.49c since 2.13.
18461 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
18463 2001-02-02 Akim Demaille <akim@epita.fr>
18465 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
18466 * lib/xalloc.h, lib/xmalloc.c: Update.
18468 2001-01-19 Akim Demaille <akim@epita.fr>
18470 Get rid of the ad hoc handling of token_buffer in the scanner: use
18473 * src/lex.c (token_obstack): New.
18474 (init_lex): Initialize it. No longer call...
18475 (grow_token_buffer): this. Remove it.
18476 Adjust all the places which used it to use the obstack.
18478 2001-01-19 Akim Demaille <akim@epita.fr>
18480 * src/lex.h: Rename all the tokens:
18481 s/\bENDFILE\b/tok_eof/g;
18482 s/\bIDENTIFIER\b/tok_identifier/g;
18484 Let them be enums, not #define, to ease debugging.
18485 Adjust all the code.
18487 2001-01-18 Akim Demaille <akim@epita.fr>
18489 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
18490 * src/lex.c (maxtoken, grow_token_buffer): Static.
18492 2001-01-18 Akim Demaille <akim@epita.fr>
18494 Since we now use obstacks, more % directives can be enabled.
18496 * src/lex.c (percent_table): Also accept `%yacc',
18497 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
18499 Handle the actions for `%semantic_parser' and `%pure_parser' here,
18500 instead of returning a token.
18501 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
18502 * src/reader.c (read_declarations): Adjust.
18503 * src/files.c (open_files): Don't call `compute_base_names', don't
18504 compute `attrsfile' since they depend upon data which might be
18505 *in* the input file now.
18506 (output_files): Do it here.
18507 * src/output.c (output_headers): Document the fact that this patch
18508 introduces a guaranteed SEGV for semantic parsers.
18509 * doc/bison.texinfo: Document them.
18510 * tests/suite.at: Exercise these %options.
18512 2000-12-20 Akim Demaille <akim@epita.fr>
18514 Also handle the output file (--verbose) with obstacks.
18516 * files.c (foutput): Remove.
18517 (output_obstack): New.
18518 Adjust all dependencies.
18519 * src/conflicts.c: Return a string.
18520 * src/system.h (obstack_grow_string): Rename as...
18521 (obstack_sgrow): this. Be ready to work with non literals.
18522 (obstack_fgrow4): New.
18524 2000-12-20 Akim Demaille <akim@epita.fr>
18526 * src/files.c (open_files): Fix the computation of short_base_name
18527 in the case of `-o foo.tab.c'.
18529 2000-12-20 Akim Demaille <akim@epita.fr>
18531 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
18532 (copy_dollar): Now that everything uses obstacks, get rid of the
18535 2000-12-20 Akim Demaille <akim@epita.fr>
18537 * src/files.c (open_files): Actually the `.output' file is based
18538 on the short_base_name, not base_name.
18539 * tests/suite.at (Checking output file names): Adjust.
18541 2000-12-20 Akim Demaille <akim@epita.fr>
18543 * src/bison.s1: Remove, we now use directly...
18544 * src/bison.simple: this.
18545 * src/Makefile.am: Use pkgdata instead of data.
18547 2000-12-20 Akim Demaille <akim@epita.fr>
18549 * src/files.c (guard_obstack): New.
18550 (open_files): Initialize it.
18551 (output_files): Dump it...
18552 * src/files.h: Export it.
18553 * src/reader.c (copy_guard): Use it.
18555 2000-12-19 Akim Demaille <akim@epita.fr>
18557 * src/files.c (outfile, defsfile, actfile): Removed as global
18559 (open_files): Don't compute them.
18560 (output_files): Adjust.
18561 (base_name, short_base_name): Be global.
18562 Adjust dependencies.
18564 2000-12-19 Akim Demaille <akim@epita.fr>
18566 * src/files.c (strsuffix): New.
18567 (stringappend): Be just like strcat but allocate.
18568 (base_names): Eve out from open_files.
18569 Try to simplify the rather hairy computation of base_name and
18571 (open_files): Use it.
18572 * tests/suite.at (Checking output file names): New test.
18574 2000-12-19 Akim Demaille <akim@epita.fr>
18576 * src/system.h (obstack_grow_literal_string): Rename as...
18577 (obstack_grow_string): this.
18578 * src/output.c (output_parser): Recognize `%% actions' instead of
18580 * src/bison.s1: s/$/%% actions/.
18581 * src/bison.hairy: Likewise.
18583 2000-12-19 Akim Demaille <akim@epita.fr>
18585 * src/output.c (output_parser): Compute the `#line' lines when
18587 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
18588 Suggested by Hans Aberg.
18590 2000-12-19 Akim Demaille <akim@epita.fr>
18592 Let the handling of the skeleton files be local to the procedures
18595 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
18597 (fparser, open_extra_files): Remove.
18598 (open_files, output_files): Don't take care of fparser.
18599 * src/files.h: Adjust.
18600 * src/output.c (output_parser): Open and close the file to the
18602 * src/reader.c (read_declarations): When %semantic_parser, open
18605 2000-12-19 Akim Demaille <akim@epita.fr>
18607 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
18608 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
18610 2000-12-19 Akim Demaille <akim@epita.fr>
18612 * src/files.c (open_files): Yipee! We no longer need all the code
18613 looking for `/tmp' since we have no tmp file.
18615 2000-12-19 Akim Demaille <akim@epita.fr>
18617 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
18619 * src/files.c (open_files): Less dependency on MSDOS etc.
18621 2000-12-14 Akim Demaille <akim@epita.fr>
18623 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
18624 Provide a default definition.
18625 Use it when executing the default @ action.
18626 * src/reader.c (reader_output_yylsp): No longer include
18627 `timestamp' and `text' in the default YYLTYPE.
18629 2000-12-12 Akim Demaille <akim@epita.fr>
18631 * src/reader.c (copy_definition, parse_union_decl, copy_action)
18632 (copy_guard): Quote the file names.
18633 Reported by Laurent Mascherpa.
18635 2000-12-12 Akim Demaille <akim@epita.fr>
18637 * src/output.c (output_headers, output_program, output): Be sure
18638 to escape special characters when outputting filenames.
18639 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
18640 (output_headers): Don't depend on them, Use ACTSTR.
18642 2000-11-17 Akim Demaille <akim@epita.fr>
18644 * lib/obstack.h: Formatting changes.
18645 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
18646 prevents type checking.
18647 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
18648 cast the value to (void *): assigning a `foo *' to a `void *'
18650 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
18651 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
18654 2000-11-17 Akim Demaille <akim@epita.fr>
18656 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
18658 (suite.m4, regression.m4, calc.m4): these.
18659 * tests/atgeneral.m4: Update from CVS Autoconf.
18661 2000-11-17 Akim Demaille <akim@epita.fr>
18663 * tests/regression.m4 (%union and --defines): New test,
18664 demonstrating a current bug in the obstack implementation.
18666 2000-11-17 Akim Demaille <akim@epita.fr>
18668 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
18670 Use them to declare the variables which are global or local to
18673 2000-11-17 Akim Demaille <akim@epita.fr>
18675 * acconfig.h: Remove, no longer used.
18677 2000-11-07 Akim Demaille <akim@epita.fr>
18679 * src: s/Copyright (C)/Copyright/g.
18681 2000-11-07 Akim Demaille <akim@epita.fr>
18683 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
18685 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
18687 2000-11-07 Akim Demaille <akim@epita.fr>
18689 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
18690 Merge in a single CPP if/else.
18692 2000-11-07 Akim Demaille <akim@epita.fr>
18694 * src/output.c (output): Remove useless variables.
18695 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
18696 argument `data' for consistency with the prototypes.
18697 Qualify it `const'.
18698 (obstack_copy, obstack_copy0): Rename the second argument as
18699 `address' for consistency. Qualify it `const'.
18700 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
18701 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
18702 `const' their input argument (`data' or `address').
18703 Adjust the corresponding macros to include `const' in casts.
18705 2000-11-03 Akim Demaille <akim@epita.fr>
18707 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
18708 s/PFILE1/BISON_HAIRY/.
18709 Adjust dependencies.
18711 2000-11-03 Akim Demaille <akim@epita.fr>
18713 For some reason, this was not applied.
18715 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18716 `unlink': it's no longer used.
18718 2000-11-03 Akim Demaille <akim@epita.fr>
18720 * src/files.c (skeleton_find): New function, eved out of...
18721 (open_files, open_extra_files): here.
18723 2000-11-03 Akim Demaille <akim@epita.fr>
18725 Don't use `atexit'.
18727 * src/files.c (obstack_save): New function.
18728 (done): Rename as...
18729 (output_files): this.
18730 Use `obstack_save'.
18731 * src/main.c (main): Don't use `atexit' to register `done', since
18732 it no longer has to remove tmp files, just call `output_files'
18733 when there are no errors.
18735 2000-11-02 Akim Demaille <akim@epita.fr>
18737 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18738 `unlink': it's no longer used.
18739 * src/files.h: Formatting changes.
18741 2000-11-02 Akim Demaille <akim@epita.fr>
18743 Remove the last uses of mktemp and unlink/delete.
18745 * src/files.c (fdefines, ftable): Removed.
18746 (defines_ostack, table_obstack): New.
18747 Adjust dependencies of the former into uses of the latter.
18748 * src/output.c (output_short_or_char_table, output_short_table):
18749 Convert to using obstacks.
18750 * src/reader.c (copy_comment2): Accept one FILE * and two
18752 (output_token_defines, reader_output_yylsp): Use obstacks.
18753 * src/system.h (obstack_fgrow3): New.
18754 * po/POTFILES.in: Adjust.
18756 2000-11-01 Akim Demaille <akim@epita.fr>
18758 Change each use of `fattrs' into a use of `attrs_obstack'.
18760 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
18761 * src/files.c (fattrs): Remove.
18762 (attrs_obstack): New.
18763 Adjust all dependencies.
18764 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
18766 2000-11-01 Akim Demaille <akim@epita.fr>
18768 Introduce obstacks.
18769 Change each use of `faction' into a use of `action_obstack'.
18771 * lib/obstack.h, lib/obstack.c: New files.
18772 * src/files.c (faction): Remove.
18773 (action_obstack): New.
18774 Adjust all dependencies.
18776 2000-10-20 Akim Demaille <akim@epita.fr>
18778 * lib/quote.h (PARAMS): New macro. Use it.
18780 2000-10-16 Akim Demaille <akim@epita.fr>
18782 * src/output.c (output_short_or_char_table): New function.
18783 (output_short_table, output_token_translations): Use it.
18784 (goto_actions): Use output_short_table.
18786 2000-10-16 Akim Demaille <akim@epita.fr>
18788 * src/symtab.c (bucket_new): New function.
18791 * src/output.c (output_short_table): New argument to display the
18792 comment associated with the table.
18793 Adjust dependencies.
18794 (output_gram): Use it.
18795 (output_rule_data): Nicer output layout for YYTNAME.
18797 2000-10-16 Akim Demaille <akim@epita.fr>
18799 * src/lex.c (read_typename): New function.
18801 * src/reader.c (copy_dollar): Likewise.
18803 2000-10-16 Akim Demaille <akim@epita.fr>
18805 * src/reader.c (copy_comment2): Expect the input stream to be on
18806 the `/' which is suspected to open a comment, instead of being
18807 called after `//' or `/*' was read.
18808 (copy_comment, copy_definition, parse_union_decl, copy_action)
18809 (copy_guard): Adjust.
18811 2000-10-16 Akim Demaille <akim@epita.fr>
18813 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
18814 `read_signed_integer'.
18816 2000-10-16 Akim Demaille <akim@epita.fr>
18818 * src/reader.c (copy_dollar): New function.
18819 (copy_guard, copy_action): Use it.
18821 2000-10-16 Akim Demaille <akim@epita.fr>
18823 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
18824 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
18825 New files, from Fileutils 4.0.27.
18826 * src/main.c (printable_version): Remove.
18827 * src/lex.c, src/reader.c: Use `quote'.
18829 2000-10-04 Akim Demaille <akim@epita.fr>
18831 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
18833 2000-10-04 Akim Demaille <akim@epita.fr>
18835 * doc/bison.texinfo: Various typos spotted by Neil Booth.
18837 2000-10-04 Akim Demaille <akim@epita.fr>
18839 When a literal string is used to define two different tokens,
18840 `bison -v' segfaults.
18841 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
18843 * tests/regression.m4: New file.
18844 Include the core of the sample provided by Piotr Gackiewicz.
18845 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
18848 2000-10-04 Akim Demaille <akim@epita.fr>
18850 * src/reader.c (parse_expect_decl): Keep `count' within the size
18854 2000-10-02 Paul Eggert <eggert@twinsun.com>
18856 * bison.s1 (yyparse): Assign the default value
18857 unconditionally, to avoid a GCC warning and make the parser a
18860 2000-10-02 Akim Demaille <akim@epita.fr>
18862 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
18865 2000-10-02 Akim Demaille <akim@epita.fr>
18867 * src/derives.c, src/print.c, src/reduce.c: To ease the
18868 translation, move some `\n' out of the translated strings.
18870 2000-10-02 Akim Demaille <akim@epita.fr>
18872 The location tracking mechanism is precious for parse error
18873 messages. Nevertheless, it is enabled only when `@n' is used in
18874 the grammar, which is a different issue (you can use it in error
18875 message, but not in the grammar per se). Therefore, there should
18876 be another means to enable it.
18878 * src/getargs.c (getargs): Support `--locations'.
18879 (usage): Report it.
18880 * src/getargs.h (locationsflag): Export it.
18881 * src/lex.c (percent_table): Support `%locations'.
18882 * src/reader.c (yylsp_needed): Remove this variable, now replaced
18883 with `locationsflag'.
18884 * doc/bison.texinfo: Document `--locations' and `%locations'.
18886 * tests/calc.m4: Test it.
18888 For regularity of the names, replace each
18889 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
18890 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
18891 In addition replace each `flag' with `_flag'.
18893 2000-10-02 Akim Demaille <akim@epita.fr>
18895 Also test parse error messages, including with YYERROR_VERBOSE.
18897 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
18899 Use it to check the computations.
18900 Use it to check `nonassoc' is honored.
18901 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
18902 `--yyerror-verbose'.
18903 (_AT_CHECK_CALC): Adjust to this option.
18904 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
18906 2000-10-02 Akim Demaille <akim@epita.fr>
18908 Test also `--verbose', `--defines' and `--name-prefix'. Testing
18909 the latter demonstrates a flaw in the handling of non debugging
18910 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
18911 was used in order to simplify:
18927 unfortunately this leads to a CPP conflict when
18928 `--name-prefix=foo' is used since it produces `#define yydebug
18931 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
18932 (YYDPRINTF): New macro.
18934 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
18936 Also test `--verbose', `--defines' and `--name-prefix'.
18938 2000-10-02 Akim Demaille <akim@epita.fr>
18940 Improve the readability of the produced parsers.
18942 * src/bison.s1: Formatting changes.
18943 Improve the comment related to the `$' mark.
18944 (yydefault): Don't fall through to `yyresume': `goto' there.
18945 * src/output.c (output_parser): When the `$' is met, skip the end
18947 New variable, `number_of_dollar_signs', to check there's exactly
18948 one `$' in the parser skeleton.
18950 2000-10-02 Akim Demaille <akim@epita.fr>
18952 * lib/xstrdup.c: New file, from the fileutils.
18953 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
18954 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
18955 instead of strlen + xmalloc + strcpy.
18956 * src/symtab.c (copys): Remove, use xstrdup instead.
18958 2000-10-02 Akim Demaille <akim@epita.fr>
18960 * src/gram.h (associativity): New enum type which replaces the
18961 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
18962 `right_assoc', `left_assoc' and `non_assoc'.
18963 Adjust all dependencies.
18964 * src/reader.c: Formatting changes.
18965 (LTYPESTR): Don't define it, use it as a literal in
18966 `reader_output_yylsp'.
18967 * src/symtab.h (symbol_class): New enum type which replaces the
18968 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
18969 `sunknown', `stoken and `snterm'.
18971 2000-10-02 Akim Demaille <akim@epita.fr>
18973 * src/getargs.c (fixed_outfiles): Rename as...
18974 (yaccflag): for consistency and accuracy.
18975 Adjust dependencies.
18977 2000-10-02 Akim Demaille <akim@epita.fr>
18979 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
18980 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
18981 difficult and introduced a lot of core dump. It turns out that
18982 Bison used an implementation of `xmalloc' based on `calloc', and
18983 at various places it does depend upon the initialization to 0. I
18984 have not tried to isolate the pertinent places, and all the former
18985 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
18986 someone should address this issue.
18988 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
18989 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
18991 Adjust dependencies.
18992 * src/warshall.h: New file.
18995 2000-10-02 Akim Demaille <akim@epita.fr>
18997 Various anti-`extern in *.c' changes.
18999 * src/system.h: Include `assert.h'.
19001 2000-10-02 Akim Demaille <akim@epita.fr>
19003 * src/state.h (nstates, final_state, first_state, first_shift)
19004 (first_reduction): Move their exportation from here...
19005 * src/LR0.h: to here.
19006 Adjust dependencies.
19007 * src/getargs.c (statisticsflag): New variable.
19008 Add support for `--statistics'.
19009 Adjust dependencies.
19011 Remove a lot of now useless `extern' statements in most files.
19013 2000-10-02 Akim Demaille <akim@epita.fr>
19015 * src/LR0.h: New file.
19018 2000-10-02 Akim Demaille <akim@epita.fr>
19020 * src/print.h: New file.
19022 * src/print.c: Formatting and ordering changes.
19023 (verbose, terse): Replace with...
19024 (print_results): this new function.
19025 Adjust dependencies.
19027 2000-10-02 Akim Demaille <akim@epita.fr>
19029 * src/conflicts.c (conflict_report): New function.
19030 (conflict_log, verbose_conflict_log): Replace with...
19031 (print_conflicts): this function.
19032 Adjust dependencies.
19033 * src/conflicts.h: New file.
19034 Propagate its inclusion.
19036 2000-10-02 Akim Demaille <akim@epita.fr>
19038 * src/nullable.h: New file.
19039 Propagate its inclusion.
19040 * src/nullable.c: Formatting changes.
19042 2000-10-02 Akim Demaille <akim@epita.fr>
19044 * src/reduce.h: New file.
19045 Propagate its inclusion.
19046 * src/reduce.c: Topological sort and other formatting changes.
19047 (bool, TRUE, FALSE): Move their definition to...
19048 * src/system.h: here.
19050 2000-10-02 Akim Demaille <akim@epita.fr>
19052 * src/files.c: Formatting changes.
19053 (tryopen, tryclose, openfiles): Rename as...
19054 (xfopen, xfclose, open_files): this.
19055 (stringappend): static.
19056 * src/files.h: Complete the list of exported symbols.
19059 2000-10-02 Akim Demaille <akim@epita.fr>
19061 * src/reader.h: New file.
19062 Propagate its use instead of tedious list of `extern' and
19064 * src/reader.c: Formatting changes, topological sort,
19067 2000-10-02 Akim Demaille <akim@epita.fr>
19069 * src/lex.h: Prototype `lex.c' exported functions.
19070 * src/reader.c: Adjust.
19071 * src/lex.c: Formatting changes.
19072 (safegetc): Rename as...
19075 2000-10-02 Akim Demaille <akim@epita.fr>
19077 * src/lalr.h: New file.
19078 Propagate its inclusion instead of prototypes and `extern'.
19079 * src/lalr.c: Formatting changes, topological sorting etc.
19081 2000-10-02 Akim Demaille <akim@epita.fr>
19083 * src/output.c (token_actions): Introduce a temporary array,
19084 YYDEFACT, that makes it possible for this function to use
19085 output_short_table.
19087 2000-10-02 Akim Demaille <akim@epita.fr>
19089 `user_toknums' is output as a `short[]' in `output.c', while it is
19090 defined as a `int[]' in `reader.c'. For consistency with the
19091 other output tables, `user_toknums' is now defined as a table of
19094 * src/reader.c (user_toknums): Be a short table instead of an int
19096 Adjust dependencies.
19098 Factor the short table outputs.
19100 * src/output.c (output_short_table): New function.
19101 * src/output.c (output_gram, output_stos, output_rule_data)
19102 (output_base, output_table, output_check): Use it.
19104 2000-10-02 Akim Demaille <akim@epita.fr>
19106 * src/output.c (output): Topological sort of the functions, in
19107 order to get rid of the `static' prototypes.
19108 No longer use `register'.
19109 * src/output.h: New file.
19110 Propagate its inclusion in files explicitly prototyping functions
19113 2000-09-21 Akim Demaille <akim@epita.fr>
19115 * src/atgeneral.m4: Update from Autoconf.
19117 2000-09-21 Akim Demaille <akim@epita.fr>
19119 * src/closure.h: New file.
19120 * src/closure.c: Formatting changes, topological sort over the
19121 functions, use of closure.h.
19122 (initialize_closure, finalize_closure): Rename as...
19123 (new_closure, free_closure): these. Adjust dependencies.
19124 * src/LR0.c: Formatting changes, topological sort, use of
19126 (initialize_states): Rename as...
19127 (new_states): this.
19128 * src/Makefile.am (noinst_HEADERS): Adjust.
19130 2000-09-20 Akim Demaille <akim@epita.fr>
19132 * src/acconfig.h: Don't protect config.h against multiple
19134 Don't define PARAMS.
19135 * src/system.h: Define PARAMS.
19136 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
19137 purpose of config.h. system.h must not try to fix wrong
19138 definitions in config.h.
19140 2000-09-20 Akim Demaille <akim@epita.fr>
19142 * src/derives.h: New file.
19143 * src/main.c, src/derives.h: Use it.
19144 Formatting changes.
19145 * src/Makefile.am (noinst_HEADERS): Adjust.
19147 2000-09-20 Akim Demaille <akim@epita.fr>
19149 * tests/atgeneral.m4: Update from Autoconf.
19150 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
19151 (AT_CHECK_CALC): New macros.
19152 Use these macros to test bison with options `', `--raw',
19153 `--debug', `--yacc', `--yacc --debug'.
19155 2000-09-19 Akim Demaille <akim@epita.fr>
19157 * src/output.c: Formatting changes.
19158 * src/machine.h: Remove, leaving its contents in...
19159 * src/system.h: here.
19161 Adjust all dependencies on stdio.h and machine.h.
19162 * src/getargs.h: New file.
19163 Let all `extern' declarations about getargs.c be replaced with
19164 inclusion of `getargs.h'.
19165 * src/Makefile.am (noinst_HEADERS): Adjust.
19167 * tests/calc.m4 (yyin): Be initialized in main, not on the global
19169 (yyerror): Returns void, not int.
19170 * doc/bison.texinfo: Formatting changes.
19172 2000-09-19 Akim Demaille <akim@epita.fr>
19174 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
19177 2000-09-18 Akim Demaille <akim@epita.fr>
19179 * configure.in: Append WARNING_CFLAGS to CFLAGS.
19180 * src/Makefile.am (INCLUDES): Don't.
19181 Be ready to fetch headers in lib/.
19183 2000-09-18 Akim Demaille <akim@epita.fr>
19185 * doc/bison.texinfo: Update the copyright.
19186 ANSIfy and GNUify the examples.
19187 Remove the old menu.
19189 2000-09-18 Akim Demaille <akim@epita.fr>
19191 First set of tests: use the `calc' example from the documentation.
19193 * src/bison.s1 (yyparse): Condition the code using `yytname' which
19194 is defined only when YYDEBUG is.
19195 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
19196 * src/files.c (tryopen, tryclose): Formatting changes.
19197 Move to the top and be static.
19198 * src/reader.c (read_signed_integer): Likewise.
19199 * tests/calc.m4: New file.
19200 * Makefile.am, suite.m4: Adjust.
19201 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
19203 2000-09-18 Akim Demaille <akim@epita.fr>
19205 Add support for an Autotest test suite for Bison.
19207 * m4/m4.m4, m4/atconfig.m4: New files.
19208 * m4/Makefile.am (EXTRA_DIST): Adjust.
19209 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
19211 * src/getargs.c: Display a more standard --version message.
19212 * src/reader.c (reader): Formatting changes.
19213 No longer depend upon VERSION_STRING.
19214 * configure.in: No longer use `dnl'.
19215 Set up the test suite and the new directory `tests/.
19216 (VERSION_STRING): Remove.
19218 2000-04-14 Akim Demaille <akim@epita.fr>
19220 * src/reader.c (copy_comment2): New function, same as former
19221 `copy_comment', but outputs into two FILE *.
19222 (copy_comment): Use it.
19223 (parse_union_decl): Use it.
19224 (get_type, parse_start_decl): Use the same `invalid' message.
19225 (parse_start_decl, parse_union_decl): Use the same `multiple'
19227 (parse_union_decl, copy_guard, copy_action): Use the same
19228 `unmatched' message.
19229 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
19231 2000-03-31 Akim Demaille <akim@epita.fr>
19233 * src/files.c (tryopen, tryclose): Move to the top.
19236 2000-03-31 Akim Demaille <akim@epita.fr>
19238 * src/main.c (main): Don't call `done', exit does it.
19240 2000-03-31 Akim Demaille <akim@epita.fr>
19242 * allocate.c: s/return (foo)/return foo/.
19243 * lalr.c: Likewise.
19245 * output.c: Likewise.
19246 * reader.c: Likewise.
19247 * symtab.c: Likewise.
19248 * vmsgetargs.c: Likewise.
19250 2000-03-31 Akim Demaille <akim@epita.fr>
19252 Clean up the error reporting functions.
19254 * src/report.c: New file.
19255 * src/report.h: Likewise.
19256 * src/Makefile.am: Adjust.
19257 * m4/error.m4: New file.
19258 * m4/Makefile.am: Adjust.
19259 * configure.in (jm_PREREQ_ERROR): Call it.
19260 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
19262 (fatal, fatals): Remove. All callers use complain.c::fatal.
19263 (warn, warni, warns, warnss, warnss): Remove. All callers use
19264 complain.c::complain.
19265 (toomany): Remove, use fatal instead.
19266 * src/files.c (done): No argument, use complain_message_count.
19267 * src/main.c (main): Register `done' to `atexit'.
19269 * src/getargs.c (usage): More `fputs', less `fprintf'.
19271 2000-03-28 Akim Demaille <akim@epita.fr>
19273 * lib/: New directory.
19274 * Makefile.am (SUBDIRS): Adjust.
19275 * configure.in: Adjust.
19276 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
19278 * src/alloca.c: Moved to lib/.
19279 * src/getopt.c: Likewise.
19280 * src/getopt1.c: Likewise.
19281 * src/getopt.h: Likewise.
19282 * src/ansi2knr.c: Likewise.
19283 * src/ansi2knr.1: Likewise.
19284 * src/Makefile.am: Adjust.
19285 * lib/Makefile.am: New file.
19287 2000-03-28 Akim Demaille <akim@epita.fr>
19289 * src/getargs.c (usage): Refresh the help message.
19291 2000-03-17 Akim Demaille <akim@epita.fr>
19293 * src/getopt1.c: Updated from textutils 2.0e
19294 * src/getopt.c: Likewise.
19295 * src/getopt.h: Likewise.
19297 2000-03-17 Akim Demaille <akim@epita.fr>
19299 * src/Makefile.am (bison.simple): Fix the awk program: quote only
19300 the file name, not the whole `#line LINE FILE'.
19302 2000-03-17 Akim Demaille <akim@epita.fr>
19304 On syntax errors, report the token on which we choked.
19306 * src/bison.s1 (yyparse): In the label yyerrlab, when
19307 YYERROR_VERBOSE, add yychar in msg.
19309 2000-03-17 Akim Demaille <akim@epita.fr>
19311 * src/reader.c (copy_at): New function.
19312 (copy_guard): Use it.
19313 (copy_action): Use it.
19315 2000-03-17 Akim Demaille <akim@epita.fr>
19317 Be kind to translators, save some useless translations.
19319 * src/main.c (banner): New function.
19320 (fatal_banner): Use it.
19321 (warn_banner): Use it.
19323 2000-03-17 Akim Demaille <akim@epita.fr>
19325 * src/reader.c (copy_definition): Use copy_string and
19326 copy_comment. Removed now unused `match', `ended',
19328 (copy_comment, copy_string): Moved, to be visible from
19331 2000-03-17 Akim Demaille <akim@epita.fr>
19333 * src/reader.c (copy_string): Declare `static inline'. No
19334 problems with inline, since it is checked by configure.
19335 (copy_comment): Likewise.
19337 2000-03-17 Akim Demaille <akim@epita.fr>
19339 * src/reader.c (packsymbols): Formatting changes.
19341 2000-03-17 Akim Demaille <akim@epita.fr>
19343 * src/reader.c (copy_comment): New function, factored out from:
19344 (copy_action): Use it. Removed now unused `match', `ended',
19346 (copy_guard): Likewise.
19348 2000-03-17 Akim Demaille <akim@epita.fr>
19350 * src/reader.c (copy_string): New function, factored out from:
19351 (copy_action): Use it.
19352 (copy_guard): Likewise.
19354 2000-03-17 Akim Demaille <akim@epita.fr>
19356 Change the handling of @s so that they behave exactly like $s.
19357 There is now a pseudo variable @$ (readble and writable), location
19358 of the lhs of the rule (by default ranging from the location of
19359 the first symbol of the rhs, to the location of the last symbol,
19360 or, if the rhs is empty, YYLLOC).
19362 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
19364 (yyparse): When providing a default semantic action, provide a
19365 default location action.
19366 (after the $): No longer change `*YYLSP', just stack YYLOC the
19367 same way you stack YYVAL.
19368 * src/reader.c (read_declarations): Use warns.
19369 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
19370 (copy_action, case '@'): Likewise.
19371 Use a standard error message, to save useless work from
19374 2000-03-17 Akim Demaille <akim@epita.fr>
19376 * src/bison.s1: Formatting and cosmetics changes.
19377 * src/reader.c: Likewise.
19378 Update the Copyright notice.
19380 2000-03-17 Akim Demaille <akim@epita.fr>
19382 * src/bison.s1 (#line): All set to `#line' only, since the
19383 Makefile now handles them.
19385 2000-03-16 Akim Demaille <akim@epita.fr>
19387 * src/output.c (output_rule_data): Output the documentation of
19388 some of the tables.
19389 (Copyright notice): Update.
19390 Formatting changes.
19392 2000-03-16 Akim Demaille <akim@epita.fr>
19394 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
19395 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
19396 One `#if YYDEBUG' remains, since it uses variables which are
19397 defined only if `YYDEBUG != 0'.
19399 2000-03-16 Akim Demaille <akim@epita.fr>
19401 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
19402 and related variables so that the similarities are highlighted.
19404 2000-03-16 Akim Demaille <akim@epita.fr>
19406 * src/bison.s1: Properly indent CPP directives.
19408 2000-03-16 Akim Demaille <akim@epita.fr>
19410 * src/bison.s1: Properly indent the `alloca' CPP section.
19412 2000-03-16 Akim Demaille <akim@epita.fr>
19414 Do not hard code values of directories in `configure.in'.
19415 Update the `configure' tool chain.
19417 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
19419 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
19420 (AC_OUTPUT): Add m4/Makefile.
19421 Bump to bison 1.28a, 1.29 has never been released.
19422 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
19423 handled via src/Makefile.am.
19424 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
19425 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
19427 * Makefile.am (SUBDIRS): Add m4.
19428 (ACLOCAL_AM_FLAGS): New variable.
19429 (AUTOMAKE_OPTIONS): Add check-news.
19430 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
19431 the proper line number and file name.
19432 (DEFS): Propagate the location of bison library files and of the
19434 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
19436 * acinclude.m4: Remove, replaced by the directory m4.
19437 * m4/Makefile.am (EXTRA_DIST): New variable.
19438 * m4/gettext.m4: New file, from the fileutils.
19439 * m4/lcmessage.m4: Likewise
19440 * m4/progtest.m4: Likewise.
19441 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
19443 2000-03-10 Akim Demaille <akim@epita.fr>
19446 Formatting changes of various comments.
19447 Respect the GNU coding standards at various places.
19448 Don't use `_()' when no translation is needed.
19450 1999-12-13 Jesse Thilo <jthilo@gnu.org>
19453 OS/2 honors TMPDIR environment variable.
19455 1999-12-13 Jesse Thilo <jthilo@gnu.org>
19457 * doc/bison.texinfo: Tweaked spelling and grammar.
19459 Removed reference to price of printed copy.
19460 Mention BISON_SIMPLE and BISON_HAIRY.
19462 1999-12-13 Jesse Thilo <jthilo@gnu.org>
19464 * configure.in, NEWS:
19465 Bison 1.29 released.
19467 1999-10-27 Jesse Thilo <jthilo@gnu.org>
19469 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
19470 Added reference card.
19472 1999-07-26 Jesse Thilo <jthilo@gnu.org>
19474 * po/ru.po: Added Russian translation.
19476 1999-07-26 Jesse Thilo <jthilo@gnu.org>
19478 * configure.in: Added Russian translation.
19480 1999-07-06 Jesse Thilo <jthilo@gnu.org>
19482 * configure.in, NEWS, README:
19483 Released version 1.28.
19485 1999-06-14 Jesse Thilo <jthilo@gnu.org>
19488 Squashed redefinition warning on some systems.
19490 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
19491 Have configure build version string instead of relying on ANSI string
19494 1999-06-14 Jesse Thilo <jthilo@gnu.org>
19496 * po/POTFILES.in: Got rid of version.c.
19498 1999-06-14 Jesse Thilo <jthilo@gnu.org>
19500 * acconfig.h, configure.in:
19501 Have configure build version string instead of relying on ANSI string
19504 1999-06-08 Jesse Thilo <jthilo@gnu.org>
19507 Dropped mention of `+' for long-named options.
19509 1999-05-30 Jesse Thilo <jthilo@gnu.org>
19511 * src/files.c: Added <unistd.h> for unlink().
19513 * src/Makefile.am, src/system.h:
19516 1999-05-30 Jesse Thilo <jthilo@gnu.org>
19518 * README: Added a FAQ list.
19520 * configure.in, acconfig.h:
19523 1999-05-30 Jesse Thilo <jthilo@gnu.org>
19525 * doc/FAQ, doc/Makefile.am:
19528 1999-05-19 Jesse Thilo <jthilo@gnu.org>
19530 * src/alloc.h, src/symtab.h, src/version.c:
19531 Protected inclusion of "config.h" with HAVE_CONFIG_H.
19533 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19535 * src/.cvsignore, src/Makefile.am:
19536 Reorganized: sources in `src', documentation in `doc'.
19538 * src/lex.c (literalchar):
19539 fixed the code for escaping double quotes (thanks
19542 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19544 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
19545 Adjusted paths to reflect directory reorganization.
19547 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19549 * doc/.cvsignore, doc/Makefile.am:
19550 Reorganized: sources in `src', documentation in `doc'.
19552 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19555 Updated AC_INIT file to reflect directory reorganization.
19557 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
19558 Reorganized: sources in `src', documentation in `doc'.
19560 1999-04-13 Jesse Thilo <jthilo@gnu.org>
19563 Don't declare calloc() and realloc() if not necessary.
19565 1999-04-13 Jesse Thilo <jthilo@gnu.org>
19567 * configure.in, acconfig.h, acinclude.m4:
19568 Don't declare calloc() and realloc() if not necessary.
19570 1999-03-23 Jesse Thilo <jthilo@gnu.org>
19572 * po/.cvsignore: Added i18n support.
19574 1999-03-23 Jesse Thilo <jthilo@gnu.org>
19576 * acconfig.h, configure.in, Makefile.am:
19577 Added i18n support.
19579 1999-03-22 Jesse Thilo <jthilo@gnu.org>
19581 * src/bison.s1: Fixed #line numbers.
19583 1999-03-15 Jesse Thilo <jthilo@gnu.org>
19585 * po/es.po, po/fr.po, po/nl.po, po/de.po:
19586 Added PO files from Translation Project.
19588 1999-03-03 Jesse Thilo <jthilo@gnu.org>
19591 Added support for non-ANSI compilers (ansi2knr).
19593 1999-02-16 Jesse Thilo <jthilo@gnu.org>
19595 * configure.in: Bumped version number to 1.27.
19598 Added `bison.simple' to list of files removed by `make distclean'.
19600 1999-02-12 Jesse Thilo <jthilo@gnu.org>
19602 * src/files.c, src/files.h:
19603 Defined locations of parser files in config.h instead of Makefile.
19605 1999-02-12 Jesse Thilo <jthilo@gnu.org>
19607 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
19608 Defined locations of parser files in config.h instead of Makefile.
19610 1999-02-09 Jesse Thilo <jthilo@gnu.org>
19613 Removed inappropriate use of $< macro.
19615 1999-02-05 Jesse Thilo <jthilo@gnu.org>
19617 * po/Makefile.in.in, po/POTFILES.in:
19618 Add `po' directory skeleton.
19620 1999-01-27 Jesse Thilo <jthilo@gnu.org>
19622 * README: Document help-bison list.
19624 * configure.in: Add check for mkstemp().
19626 1999-01-20 Jesse Thilo <jthilo@gnu.org>
19628 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
19629 Hush a few compiler warnings.
19632 Add tryclose(), which verifies that fclose was successful.
19633 Hush a couple of compiler warnings.
19635 1999-01-20 Jesse Thilo <jthilo@gnu.org>
19637 * Makefile.am, OChangeLog:
19638 ChangeLog is now automatically generated. Include the old version as
19641 1999-01-14 Jesse Thilo <jthilo@gnu.org>
19643 * 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:
19644 Update FSF address.
19646 1999-01-14 Jesse Thilo <jthilo@gnu.org>
19648 * doc/bison.texinfo: Fix formatting glitch.
19650 * doc/bison.texinfo: Update FSF address.
19652 1999-01-14 Jesse Thilo <jthilo@gnu.org>
19654 * acconfig.h: Update FSF address.
19656 1999-01-08 Jesse Thilo <jthilo@gnu.org>
19659 Don't define PACKAGE here, since config.h defines it.
19661 1998-12-30 Jesse Thilo <jthilo@gnu.org>
19663 * src/reader.c: Update copyright date.
19666 Ditch sprintf to statically-sized buffers in fatal/warn functions in
19667 favor of output directly to stderr (avoids buffer overruns).
19669 * src/reader.c: Some checks for premature EOF.
19671 * 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:
19672 Use prototypes if the compiler understands them.
19674 * src/files.c: Honor TMPDIR on Unix hosts.
19675 Use prototypes if the compiler understands them.
19678 Fix a couple of buffer overrun bugs.
19679 Use prototypes if the compiler understands them.
19681 * src/system.h: Include unistd.h and ctype.h.
19682 Use #ifdef instead of #if for NLS symbols.
19684 1998-12-30 Jesse Thilo <jthilo@gnu.org>
19686 * doc/bison.texinfo:
19687 Delete comment "consider using @set for edition number, etc..." since
19688 we now are doing so.
19690 1998-12-30 Jesse Thilo <jthilo@gnu.org>
19693 Use prototypes if the compiler understands them.
19695 * NEWS: Document 1.26 highlights.
19697 * Makefile.am: Require Automake 1.3 or later.
19700 Use prototypes if the compiler understands them.
19702 1998-12-29 Jesse Thilo <jthilo@gnu.org>
19705 Use VERSION symbol from automake for version number.
19707 1998-12-29 Jesse Thilo <jthilo@gnu.org>
19709 * acconfig.h, configure.in, version.cin:
19710 Use VERSION symbol from automake for version number.
19712 1998-11-28 Jesse Thilo <jthilo@gnu.org>
19715 Distribute original version of simple parser (bison.s1), not built
19716 version (bison.simple).
19718 1998-11-28 Jesse Thilo <jthilo@gnu.org>
19720 * doc/bison.texinfo: Add info dir entry.
19722 * doc/bison.texinfo:
19723 Let automake put version number into documentation.
19725 1998-11-26 Jesse Thilo <jthilo@gnu.org>
19727 * src/bison.cld, src/build.com, src/vmshlp.mar:
19728 Add non-RCS files from /gd/gnu/bison.
19730 1998-11-26 Jesse Thilo <jthilo@gnu.org>
19733 Document the BISON_HAIRY and BISON_SIMPLE variables.
19735 1998-11-25 Jesse Thilo <jthilo@gnu.org>
19737 * src/version.c: Build version.c automatically.
19740 Fix token numbering (used to start at 258, not 257).
19742 * src/system.h: Include config.h.
19744 * src/getargs.c: Update bug report address.
19746 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
19747 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
19749 1998-11-25 Jesse Thilo <jthilo@gnu.org>
19752 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19754 * configure.in, version.cin:
19755 Build version.c automatically.
19757 * AUTHORS: Add AUTHORS file.
19759 * README: Update bug report address.
19762 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19764 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
19765 Add automake stuff.
19767 1998-11-25 Jesse Thilo <jthilo@gnu.org>
19769 * doc/bison.texinfo: Clean up some formatting.
19771 1998-05-05 Richard Stallman <rms@gnu.org>
19773 * doc/bison.texinfo:
19774 Explain better why to make a pure parser.
19776 1998-01-05 Richard Stallman <rms@gnu.org>
19778 * src/files.c (openfiles):
19779 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
19780 find a temporary directory, if possible. Do not unlink files while
19783 1997-08-25 Richard Stallman <rms@gnu.org>
19785 * src/reader.c (stack_offset;):
19786 Change some warni to warns.
19788 * src/lex.c (literalchar): Use warns, not warni.
19790 1997-06-28 Richard Stallman <rms@gnu.org>
19792 * src/bison.s1: Add a Bison version comment.
19794 * src/main.c (fatal, warn, berror):
19797 1997-06-28 Richard Stallman <rms@gnu.org>
19799 * Makefile.in (bison_version): New variable.
19800 (dist): Use that variable.
19801 (bison.s1): Substitute the Bison version into bison.simple.
19803 * bison.simple: Add a Bison version comment.
19805 1997-06-18 Richard Stallman <rms@gnu.org>
19807 * src/main.c (fatal, warn, berror):
19808 Make error messages standard.
19809 (toomany): Improve error message text.
19811 * 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:
19812 new.h renamed to alloc.h.
19814 1997-06-18 Richard Stallman <rms@gnu.org>
19816 * Makefile.in: new.h renamed to alloc.h.
19818 1997-05-24 Richard Stallman <rms@gnu.org>
19820 * src/lex.c (literalchar):
19821 Fix the code for escaping \, " and '.
19823 (lex): Avoid trouble when there are many chars
19824 to discard in a char literal with just several chars in it.
19826 1997-05-17 Richard Stallman <rms@gnu.org>
19829 Use malloc, if using alloca is troublesome.
19830 (YYSTACK_USE_ALLOCA): New flag macro.
19831 Define it for some systems and compilers.
19832 (YYSTACK_ALLOC): New macro.
19833 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19834 If it was malloc'd, free it.
19836 1997-05-17 Richard Stallman <rms@gnu.org>
19839 Use malloc, if using alloca is troublesome.
19840 (YYSTACK_USE_ALLOCA): New flag macro.
19841 Define it for some systems and compilers.
19842 (YYSTACK_ALLOC): New macro.
19843 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19844 If it was malloc'd, free it.
19846 1997-04-23 Richard Stallman <rms@gnu.org>
19849 (alloca) [__hpux]: Always define as __builtin_alloca.
19851 1997-04-23 Richard Stallman <rms@gnu.org>
19854 (alloca) [__hpux]: Always define as __builtin_alloca.
19856 1997-04-22 Richard Stallman <rms@gnu.org>
19859 [__hpux]: Include alloca.h (right for HPUX 10)
19860 instead of declaring alloca (right for HPUX 9).
19862 * src/bison.s1 (__yy_memcpy):
19863 Declare arg `count' as unsigned int.
19864 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19866 1997-04-22 Richard Stallman <rms@gnu.org>
19869 [__hpux]: Include alloca.h (right for HPUX 10)
19870 instead of declaring alloca (right for HPUX 9).
19872 * bison.simple (__yy_memcpy):
19873 Declare arg `count' as unsigned int.
19874 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19876 1997-01-03 Richard Stallman <rms@gnu.org>
19878 * src/allocate.c: [__STDC__ or _MSC_VER]:
19879 Declare calloc and realloc to return void *.
19881 1997-01-02 Richard Stallman <rms@gnu.org>
19884 [_MSC_VER]: Include stdlib.h and process.h.
19885 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
19887 * src/main.c (main): Return FAILURE as a value.
19888 (printable_version): Declare arg as int, not char.
19890 1997-01-02 Richard Stallman <rms@gnu.org>
19892 * Makefile.in (dist):
19893 Explicitly check for symlinks, and copy them.
19895 1996-12-19 Richard Stallman <rms@gnu.org>
19898 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
19900 1996-12-18 Paul Eggert <eggert@gnu.org>
19902 * src/bison.s1 (yyparse):
19903 If __GNUC__ and YYPARSE_PARAM are both defined,
19904 declare yyparse to have a void * argument.
19906 1996-12-18 Paul Eggert <eggert@gnu.org>
19908 * bison.simple (yyparse):
19909 If __GNUC__ and YYPARSE_PARAM are both defined,
19910 declare yyparse to have a void * argument.
19912 1996-12-17 Richard Stallman <rms@gnu.org>
19914 * src/reduce.c (nbits): Add some casts.
19916 1996-08-12 Richard Stallman <rms@gnu.org>
19918 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
19920 1996-08-12 Richard Stallman <rms@gnu.org>
19922 * bison.simple: Test _MSDOS as well as _MSDOS_.
19924 1996-07-31 Richard Stallman <rms@gnu.org>
19927 [__sun && __i386]: Include alloca.h.
19929 1996-07-31 Richard Stallman <rms@gnu.org>
19932 [__sun && __i386]: Include alloca.h.
19934 1996-07-30 Richard Stallman <rms@gnu.org>
19936 * src/bison.s1: Comment change.
19938 * src/bison.s1: Test _MSDOS_, not MSDOS.
19940 1996-07-30 Richard Stallman <rms@gnu.org>
19942 * bison.simple: Comment change.
19944 * bison.simple: Test _MSDOS_, not MSDOS.
19946 1996-06-01 Richard Stallman <rms@gnu.org>
19948 * 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:
19949 Insert `_' macro around many string constants.
19952 Insert `_' macro around many string constants.
19954 (main): Call setlocale, bindtextdomain and textdomain.
19956 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
19957 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
19958 [ENABLE_NLS]: Include libintl.h.
19959 [ENABLE_NLS] (gettext): Define.
19960 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
19961 (N_, PACKAGE, LOCALEDIR): New macros.
19963 1996-06-01 Richard Stallman <rms@gnu.org>
19965 * POTFILES.in: New file.
19967 * Makefile.in (allocate.o):
19968 Define target explicitly.
19970 * Makefile.in (CFLAGS): Set to @CFLAGS@.
19971 (LDFLAGS): Set to @LDFLAGS@.
19972 (configure): Run autoconf only if preceding `cd' succeeds.
19973 (bison.s1): Redirect output to temporary file then move the
19974 temporary to the target, rather than redirecting directly to bison.s1.
19975 (clean): Remove config.status and config.log.
19976 (distclean): Don't remove config.status here.
19978 1996-05-12 Richard Stallman <rms@gnu.org>
19981 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19983 1996-05-12 Richard Stallman <rms@gnu.org>
19986 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19988 1996-05-11 Richard Stallman <rms@gnu.org>
19990 * src/bison.s1 (__yy_memcpy):
19991 Really reorder the args, as was supposedly done on Feb 14 1995.
19992 (yyparse): Calls changed accordingly.
19994 1996-05-11 Richard Stallman <rms@gnu.org>
19996 * Makefile.in (dist): Don't use $(srcdir).
19998 * bison.simple (__yy_memcpy):
19999 Really reorder the args, as was supposedly done on Feb 14 1995.
20000 (yyparse): Calls changed accordingly.
20002 1996-01-27 Richard Stallman <rms@gnu.org>
20004 * src/output.c (output_rule_data):
20005 Test YYERROR_VERBOSE in the conditional
20006 around the definition of ttyname.
20008 1995-12-29 Richard Stallman <rms@gnu.org>
20011 Fix line numbers in #line commands.
20013 1995-12-29 Richard Stallman <rms@gnu.org>
20016 Fix line numbers in #line commands.
20018 1995-12-27 Richard Stallman <rms@gnu.org>
20020 * src/bison.s1 (YYPARSE_PARAM_DECL):
20021 In C++, make it always null.
20022 (YYPARSE_PARAM_ARG): New macro.
20023 (yyparse): Use YYPARSE_PARAM_ARG.
20025 1995-12-27 Richard Stallman <rms@gnu.org>
20027 * bison.simple (YYPARSE_PARAM_DECL):
20028 In C++, make it always null.
20029 (YYPARSE_PARAM_ARG): New macro.
20030 (yyparse): Use YYPARSE_PARAM_ARG.
20032 1995-11-29 Richard Stallman <rms@gnu.org>
20034 * doc/bison.texinfo:
20035 Describe literal string tokens, %raw, %no_lines, %token_table.
20037 1995-11-29 Daniel Hagerty <hag@gnu.org>
20039 * doc/bison.texinfo: Fixed update date
20041 1995-10-16 Richard Stallman <rms@gnu.org>
20043 * src/version.c: Version 1.25.
20045 1995-10-16 Richard Stallman <rms@gnu.org>
20047 * NEWS: *** empty log message ***
20049 1995-10-16 Richard Stallman <rms@gnu.org>
20051 * doc/bison.1, doc/bison.rnh:
20054 1995-10-15 Richard Stallman <rms@gnu.org>
20056 * src/vmsgetargs.c, src/getargs.c:
20057 Added -n, -k, and -raw switches.
20058 (noparserflag, toknumflag, rawtoknumflag): New variables.
20060 * src/symtab.h (SALIAS):
20061 New #define for adding aliases to %token.
20062 (struct bucket): Added `alias' field.
20064 * src/reduce.c (reduce_grammar):
20065 Revise error message.
20066 (print_notices): Remove final `.' from error message.
20068 * src/reader.c (reader_output_yylsp):
20070 (readgram): Use `#if 0' around code that accepted %command
20071 inside grammar rules: The documentation doesn't allow it,
20072 and it will fail since the %command processors scan for the next %.
20073 (parse_token_decl): Extended the %token
20074 declaration to allow a multi-character symbol as an alias.
20075 (parse_thong_decl): New function.
20076 (read_declarations): Added %thong declarations.
20077 (read_declarations): Handle NOOP to deal with allowing
20078 % declarations as another means to specify the flags.
20079 (readgram): Allow %prec prior to semantics embedded in a rule.
20080 (skip_to_char, read_declarations, copy_definition)
20081 (parse_token_decl, parse_start_decl, parse_type_decl)
20082 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
20083 (get_type_name, copy_guard, copy_action, readgram)
20084 (get_type, packsymbols): Revised most error messages.
20085 Changed `fatal' to `warnxxx' to avoid aborting for error.
20086 Revised and use multiple warnxxx functions to avoid using VARARGS1.
20087 (read_declarations): Improve the error message for
20088 an invalid character. Do not abort.
20089 (read_declarations, copy_guard, copy_action): Use
20090 printable_version to avoid unprintable characters in printed output.
20091 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
20092 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
20093 Allow the type of a non-terminal can be given
20094 more than once, as long as all specifications give the same type.
20097 (output_headers, output_trailers, output, output_gram)
20098 (output_rule_data): Implement noparserflag variable.
20099 Implement toknumflag variable.
20100 (output): Call reader_output_yylsp to output LTYPESTR.
20102 * src/main.c (main):
20103 If reader sees an error, don't process the grammar.
20104 (fatals): Updated to not use VARARGS1.
20105 (printable_version, int_to_string, warn, warni, warns, warnss)
20106 (warnsss): New error reporting functions. Avoid abort for error.
20109 Added THONG and NOOP for alias processing.
20110 Added SETOPT for the new code that allows setting options with %flags.
20113 Include getopt.h. Add some extern decls.
20114 (safegetc): New function to deal with EOF gracefully.
20115 (literalchar); new function to deal with reading \ escapes.
20116 (lex): Use literalchar.
20117 (lex): Implemented "..." tokens.
20118 (literalchar, lex, parse_percent_token): Made tokenbuffer
20119 always contain the token. This includes growing the token
20120 buffer while reading an integer.
20121 (parse_percent_token): Replaced if-else statement with percent_table.
20122 (parse_percent_token): Added % declarations as another
20123 way to specify the flags -n, -l, and -r. Also added hooks for
20124 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
20125 major changes to files.c.
20126 (lex) Retain in the incoming stream a character following
20128 (skip_white_space, lex): Revised most error messages
20129 and changed fatal to warn to avoid aborting.
20130 (percent_table): Added %thong declarations.
20132 * src/gram.h: Comment changes.
20134 * src/files.c (openfiles, open_extra_files, done):
20136 and actfile file. Handle noparserflag. Both for -n switch.
20138 * src/conflicts.c (resolve_sr_conflict):
20139 Remove use of alloca.
20141 1995-06-01 Jim Meyering <meyering@gnu.org>
20143 * doc/bison.texinfo: *** empty log message ***
20145 1995-05-06 Richard Stallman <rms@gnu.org>
20147 * src/bison.s1: Comment change.
20149 1995-05-06 Richard Stallman <rms@gnu.org>
20151 * bison.simple: Comment change.
20153 1995-05-03 Richard Stallman <rms@gnu.org>
20155 * src/version.c: Version now 1.24.
20157 * src/bison.s1: Change distribution terms.
20159 * src/version.c: Version now 1.23.
20161 1995-05-03 Richard Stallman <rms@gnu.org>
20163 * doc/bison.texinfo:
20164 Rewrite "Conditions for Using Bison".
20165 Update version to 1.24.
20167 1995-05-03 Richard Stallman <rms@gnu.org>
20169 * bison.simple: Change distribution terms.
20171 1995-02-23 Richard Stallman <rms@gnu.org>
20173 * src/files.c: Test __VMS_POSIX as well as VMS.
20175 1995-02-14 Jim Meyering <meyering@gnu.org>
20177 * src/bison.s1 (__yy_memcpy):
20178 Renamed from __yy_bcopy to avoid
20179 confusion. Reverse FROM and TO arguments to be consistent with
20182 1995-02-14 Jim Meyering <meyering@gnu.org>
20184 * bison.simple (__yy_memcpy):
20185 Renamed from __yy_bcopy to avoid
20186 confusion. Reverse FROM and TO arguments to be consistent with
20189 1994-11-10 David J. MacKenzie <djm@gnu.org>
20195 * Makefile.in (DISTFILES): Include NEWS.
20197 * Makefile.in (DISTFILES):
20198 Include install-sh, not install.sh.
20200 * configure.in: Update to Autoconf v2 macro names.
20202 1994-10-05 David J. MacKenzie <djm@gnu.org>
20204 * Makefile.in: fix typo
20206 * Makefile.in (prefix, exec_prefix):
20207 Let configure set them.
20209 1994-09-28 David J. MacKenzie <djm@gnu.org>
20211 * Makefile.in: Set datadir to $(prefix)/share.
20213 1994-09-15 Richard Stallman <rms@gnu.org>
20216 Update copyright notice and GPL version.
20218 1994-09-15 Richard Stallman <rms@gnu.org>
20221 Update copyright notice and GPL version.
20223 1994-07-12 Richard Stallman <rms@gnu.org>
20225 * src/reduce.c, src/reader.c:
20228 1994-05-05 David J. MacKenzie <djm@gnu.org>
20230 * Makefile.in: entered into RCS
20232 1994-03-26 Richard Stallman <rms@gnu.org>
20234 * src/bison.s1: entered into RCS
20236 1994-03-26 Richard Stallman <rms@gnu.org>
20238 * bison.simple: entered into RCS
20240 1994-03-25 Richard Stallman <rms@gnu.org>
20242 * src/main.c: entered into RCS
20244 1994-03-24 Richard Stallman <rms@gnu.org>
20246 * src/conflicts.c: entered into RCS
20248 1994-01-02 Richard Stallman <rms@gnu.org>
20250 * Makefile.in: *** empty log message ***
20252 1993-11-21 Richard Stallman <rms@gnu.org>
20254 * src/bison.s1: *** empty log message ***
20256 1993-11-21 Richard Stallman <rms@gnu.org>
20258 * doc/bison.texinfo: entered into RCS
20260 * doc/bison.texinfo: *** empty log message ***
20262 1993-11-21 Richard Stallman <rms@gnu.org>
20264 * bison.simple: *** empty log message ***
20266 1993-10-25 David J. MacKenzie <djm@gnu.org>
20268 * doc/bison.texinfo: *** empty log message ***
20270 1993-10-19 Richard Stallman <rms@gnu.org>
20272 * src/bison.s1: *** empty log message ***
20274 1993-10-19 Richard Stallman <rms@gnu.org>
20276 * bison.simple: *** empty log message ***
20278 1993-10-14 Richard Stallman <rms@gnu.org>
20280 * src/bison.s1: *** empty log message ***
20282 1993-10-14 Richard Stallman <rms@gnu.org>
20284 * bison.simple: *** empty log message ***
20286 1993-09-14 David J. MacKenzie <djm@gnu.org>
20288 * doc/bison.texinfo: *** empty log message ***
20290 1993-09-13 Noah Friedman <friedman@gnu.org>
20292 * Makefile.in: *** empty log message ***
20294 1993-09-10 Richard Stallman <rms@gnu.org>
20296 * src/conflicts.c: *** empty log message ***
20298 * src/system.h: entered into RCS
20300 1993-09-10 Richard Stallman <rms@gnu.org>
20302 * doc/bison.1: entered into RCS
20304 1993-09-06 Noah Friedman <friedman@gnu.org>
20306 * src/version.c: entered into RCS
20308 1993-09-06 Noah Friedman <friedman@gnu.org>
20310 * Makefile.in: *** empty log message ***
20312 1993-07-30 David J. MacKenzie <djm@gnu.org>
20314 * Makefile.in: *** empty log message ***
20316 1993-07-24 Richard Stallman <rms@gnu.org>
20318 * src/bison.s1: *** empty log message ***
20320 1993-07-24 Richard Stallman <rms@gnu.org>
20322 * bison.simple: *** empty log message ***
20324 1993-07-08 David J. MacKenzie <djm@gnu.org>
20326 * Makefile.in: *** empty log message ***
20328 1993-07-04 Richard Stallman <rms@gnu.org>
20330 * src/bison.s1: *** empty log message ***
20332 1993-07-04 Richard Stallman <rms@gnu.org>
20334 * bison.simple: *** empty log message ***
20336 1993-06-26 David J. MacKenzie <djm@gnu.org>
20338 * src/getargs.c: entered into RCS
20340 1993-06-26 David J. MacKenzie <djm@gnu.org>
20342 * doc/bison.texinfo: *** empty log message ***
20344 * doc/bison.1: New file.
20346 1993-06-25 Richard Stallman <rms@gnu.org>
20348 * src/getargs.c: New file.
20350 1993-06-16 Richard Stallman <rms@gnu.org>
20352 * src/bison.s1: *** empty log message ***
20354 1993-06-16 Richard Stallman <rms@gnu.org>
20356 * bison.simple: *** empty log message ***
20358 1993-06-03 Richard Stallman <rms@gnu.org>
20360 * src/bison.s1: New file.
20362 1993-06-03 Richard Stallman <rms@gnu.org>
20364 * doc/bison.texinfo: *** empty log message ***
20366 1993-06-03 Richard Stallman <rms@gnu.org>
20368 * bison.simple: New file.
20370 1993-05-19 Richard Stallman <rms@gnu.org>
20372 * doc/bison.texinfo: New file.
20374 1993-05-07 Noah Friedman <friedman@gnu.org>
20376 * Makefile.in: *** empty log message ***
20378 1993-04-28 Noah Friedman <friedman@gnu.org>
20380 * src/reader.c: *** empty log message ***
20382 1993-04-23 Noah Friedman <friedman@gnu.org>
20384 * src/alloc.h: entered into RCS
20386 1993-04-20 David J. MacKenzie <djm@gnu.org>
20388 * src/version.c: *** empty log message ***
20390 * src/files.c, src/allocate.c:
20393 * src/reader.c: *** empty log message ***
20395 * src/lex.c: entered into RCS
20397 * src/conflicts.c: New file.
20399 * src/symtab.c: entered into RCS
20401 * src/alloc.h: New file.
20403 * src/LR0.c: entered into RCS
20405 1993-04-18 Noah Friedman <friedman@gnu.org>
20407 * src/reader.c: New file.
20409 * src/version.c: *** empty log message ***
20411 1993-04-18 Noah Friedman <friedman@gnu.org>
20413 * Makefile.in: *** empty log message ***
20415 1993-04-17 Noah Friedman <friedman@gnu.org>
20417 * Makefile.in: *** empty log message ***
20419 1993-04-15 Richard Stallman <rms@gnu.org>
20421 * src/main.c, src/files.c:
20424 1993-04-15 Noah Friedman <friedman@gnu.org>
20426 * configure.in: entered into RCS
20428 * configure.in: *** empty log message ***
20430 * configure.in: New file.
20432 1993-04-14 Richard Stallman <rms@gnu.org>
20434 * Makefile.in: New file.
20436 1993-04-13 Richard Stallman <rms@gnu.org>
20438 * src/version.c: New file.
20440 1993-03-25 Richard Stallman <rms@gnu.org>
20442 * src/output.c: entered into RCS
20444 1992-09-25 Richard Stallman <rms@gnu.org>
20446 * configure.bat: entered into RCS
20448 1992-06-22 Richard Stallman <rms@gnu.org>
20450 * src/vmsgetargs.c: entered into RCS
20452 1992-06-22 Richard Stallman <rms@gnu.org>
20454 * doc/bison.rnh: entered into RCS
20456 1992-04-20 David J. MacKenzie <djm@gnu.org>
20458 * README: entered into RCS
20460 1992-01-22 Richard Stallman <rms@gnu.org>
20462 * src/machine.h: entered into RCS
20464 1991-12-21 Richard Stallman <rms@gnu.org>
20466 * src/lalr.c, src/closure.c:
20469 1991-12-20 Richard Stallman <rms@gnu.org>
20471 * src/state.h: entered into RCS
20473 1991-12-18 Richard Stallman <rms@gnu.org>
20475 * src/print.c, src/nullable.c, src/derives.c:
20478 1991-11-03 David J. MacKenzie <djm@gnu.org>
20480 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
20483 1988-09-09 Richard Stallman <rms@gnu.org>
20485 * src/bison.hairy: entered into RCS
20487 1987-12-16 Richard Stallman <rms@gnu.org>
20489 * REFERENCES: entered into RCS
20494 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
20495 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
20496 Free Software Foundation, Inc.
20498 Copying and distribution of this file, with or without
20499 modification, are permitted provided the copyright notice and this
20500 notice are preserved.