]> git.saurik.com Git - bison.git/blame_incremental - ChangeLog
* HACKING: Update copyright year.
[bison.git] / ChangeLog
... / ...
CommitLineData
12008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
4 coordinator@translationproject.org.
5
62008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
7
8 * THANKS: Add Eric Blake.
9
102008-04-23 Eric Blake <ebb9@byu.net>
11
12 Revert prior patch, by working around autoconf regression.
13 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
14 ("Output file name: ("): Uncomment test.
15 ("Output file name: )"): Likewise.
16 Based on an idea from Noah Misch.
17
182008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
19
20 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
21 2.61. Reported by Juan Manuel Guerrero at
22 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
23 * tests/output.at ("Output file name: ("): Comment out test case for
24 now.
25 ("Output file name: )"): Likewise.
26
272008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
28
29 * GNUmakefile: Update git-version-gen invocation so make dist
30 succeeds.
31
322008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
33
34 Update to the current gnulib CVS repository, and fix trigraph handling
35 in Bison.
36 * bootstrap: Update gnulib CVS repository URL.
37 (symlink_to_dir): Encapsulate the code that guarantees the destination
38 directory exists into...
39 (check_dst_dir): ... this new function, and...
40 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
41 fail when copying files into lib/uniwidth/.
42 * src/output.c (prepare_symbols): When writing yytname muscles, where
43 symbol names will be encoded in C-string literals, tell quotearg to
44 escape trigraphs. This used to be the default in gnulib.
45 * tests/regression.at (Token definitions): Because of the change in
46 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
47 escapes trigraphs in symbol names. Thus, yytname no longer has
48 trigraphs unnecessarily doubly escaped. Update test case output.
49 Extend test case to be sure Bison's own error messages will no longer
50 have trigraphs in symbol names unnecessarily escaped once.
51
522008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
53
54 Fix make dist infinite loop reported by Juan Manuel Guerrero at
55 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
56 * .cvsignore: Add .version.
57 * .version.in: New.
58 * bootstrap.conf (gnulib_modules): Add git-version-gen.
59 * configure.ac (AC_CONFIG_FILES): Add .version.
60 * build-aux/.cvsignore: Add git-version-gen.
61
622008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
63
64 * NEWS (2.3a+): Mention that -g now takes an argument.
65 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
66 consistency. Update the -g and -x entries now that they take
67 arguments. Use brackets to indicate optional arguments.
68 * src/getargs.c (usage): Explain the relationship between arguments of
69 long and short options more completely. Document --defines and -d
70 separately since the former takes an argument but, for POSIX Yacc, the
71 latter does not.
72 (short_options): Let -W take an optional argument like --warnings.
73 (getargs): Sort cases.
74
752008-02-28 Akim Demaille <demaille@gostai.com>
76
77 * doc/bison.texinfo: Fix a few typos.
78
792008-02-28 Akim Demaille <akim@epita.fr>
80
81 * doc/bison.texinfo (Bison Options): Document -W.
82 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
83
842008-02-28 Akim Demaille <akim@epita.fr>
85
86 * src/getargs.c (short_options): Split and sort for readability.
87 -g and -x take optional arguments, just like their long options.
88 * build-aux/cross-options.pl: Use /x to make the regexp easier to
89 understand.
90 Fix the handling of $opt which resulted in all the argument to be
91 considered as optional.
92
932008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
94
95 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
96 say its interface is experimental.
97 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
98 Java.
99 (Bison Options): In the -L and --language entry, mention Java.
100 (Java Bison Interface): Say the interface is experimental.
101 * src/getargs.c (usage): Mention -L and --language.
102
103 * NEWS (2.3a+): Say the push parsing interface is experimental.
104 * doc/bison.texinfo (Push Decl): Likewise.
105 (Decl Summary): Likewise in the "%define api.push_pull" entry.
106 (Push Parser Function): Likewise.
107 (Pull Parser Function): Likewise.
108 (Parser Create Function): Likewise.
109 (Parser Delete Function): Likewise.
110 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
111 yypull_parse, and yypush_parse entries.
112
113 * NEWS (2.3a+): Mention XML support, and say the schema is
114 experimental.
115 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
116 * src/getargs.c (usage): Say the XML schema is experimental.
117
118 * NEWS (2.3a+): Say option instead of flag.
119
1202008-02-21 Wojciech Polak <polak@gnu.org>
121
122 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
123 text.
124
1252008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
126
127 Fix impure push parser compile error reported by Bob Rossi at
128 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
129 * data/yacc.c: Clean up whitespace in the output a little.
130 (yypstate_allocated): Define for impure push parsers regardless of
131 whether the pull interface is also requested.
132 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
133 check impure push parsers without the pull interface.
134
135 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
136 yyerror takes arguments specified by %parse-param while yypstate_new
137 does not.
138 * doc/bison.texinfo (Parser Create Function): Document that
139 yypstate_new returns 0 for multiple impure parser instances.
140 * tests/push.at (Push Parsing: Multiple impure instances): Update
141 expected stderr output.
142
1432008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
144
145 * runtime-po/POTFILES.in (push.c): Remove.
146
1472008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
148
149 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
150 * data/push.c: Rename to...
151 * data/yacc.c: ... this, overwriting it.
152 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
153 `%push-pull-parser' -> `%define api.push_pull "both"'.
154 Remove old yacc.c tests, and update push.c tests to yacc.c.
155
1562008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
157
158 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
159 `"%code top" blocks' instead of `%code "top" blocks'.
160 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
161 Clean up whitespace in the output a little.
162
1632008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
164
165 Fix documentation problems reported by Tim Josling at
166 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
167 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
168 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
169 integers. Explain the effect of literal string aliases on error
170 messages. Copy token 0 documentation from the C++ skeleton
171 documentation.
172
1732008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
174
175 Accept a token number in a %left, %right, or %nonassoc for POSIX
176 conformance. Reported by Tim Josling at
177 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
178 * NEWS (2.3a+): Mention.
179 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
180 and code numbers are treated by precedence declarations.
181 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
182 of symbols.1.
183 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
184 of symbol.
185 (symbol.prec): New, just like symbol but allows INT.
186 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
187 longer holds.
188 * tests/regression.at (Token number in precedence declaration): New
189 test case.
190
1912008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
192
193 DJGPP specific issues.
194 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
195 be changed. Copyright timestamp adjusted.
196 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
197 be changed. Copyright timestamp adjusted.
198 * djgpp/config.site: Copyright timestamp adjusted.
199 * djgpp/config_h.sed: Copyright timestamp adjusted.
200 * djgpp/djunpack.bat: Copyright timestamp adjusted.
201 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
202 filename translation list.
203 * djgpp/subpipe.c (init_subpipe): Check the environment variables
204 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
205 files shall be created. Before trying to use the temp dir where the
206 environment variable points to check that the dir really exists. If
207 not default to the cwd as temp dir. Copyright timestamp adjusted.
208 * djgpp/subpipe.h: Copyright timestamp adjusted.
209 * djgpp/testsuite.sed: Copyright timestamp adjusted.
210
2112008-01-30 Paul Eggert <eggert@cs.ucla.edu>
212
213 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
214
2152008-01-09 Paul Eggert <eggert@cs.ucla.edu>
216
217 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
218 Problem reported by Claudio Saavedra in
219 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
220
2212008-01-05 Wojciech Polak <polak@gnu.org>
222
223 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
224 document's title with the input grammar file name.
225
2262007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
227
228 Automate regression testing of the XML/XSLT implementation. Discussed
229 starting at
230 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
231 * configure.ac (XSLTPROC): New substitution.
232 * Makefile.am (maintainer-xml-check): New phony target invoking...
233 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
234 invoking make maintainer-check with BISON_TEST_XML=1.
235 * tests/atlocal.in (XSLTPROC): New.
236 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
237 not to report reachable memory when Bison is expected to have a
238 non-zero exit status and (2) to compare XML/XSLT output with --graph
239 and --report=all output for every working grammar when
240 BISON_TEST_XML=1.
241 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
242 (AT_BISON_CHECK_XML): New.
243 (AT_QUELL_VALGRIND): New.
244 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
245 (AT_CHECK): ... don't redefine this since this was the old way to
246 quell Valgrind.
247 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
248 AT_BISON_CHECK invocations.
249 * tests/c++.at: Likewise.
250 * tests/calc.at: Likewise.
251 * tests/conflicts.at: Likewise.
252 * tests/cxx-type.at: Likewise.
253 * tests/existing.at: Likewise.
254 * tests/glr-regression.at: Likewise.
255 * tests/headers.at: Likewise.
256 * tests/input.at: Likewise.
257 * tests/java.at: Likewise.
258 * tests/output.at: Likewise.
259 * tests/push.at: Likewise.
260 * tests/reduce.at: Likewise.
261 * tests/regression.at: Likewise.
262 * tests/sets.at: Likewise.
263 * tests/skeletons.at: Likewise.
264 * tests/synclines.at: Likewise.
265 * tests/torture.at: Likewise.
266 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
267 tends to hang xsltproc.
268 (Big horizontal): Likewise.
269
2702007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
271
272 In XML output, remove redundant class attribute on symbol element.
273 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
274 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
275 look up a symbol to determine whether it's a nonterminal or terminal.
276 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
277 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
278
279 Add prec/assoc information to XML output.
280 * src/gram.c (grammar_rules_print_xml): For each rule that has a
281 %prec, add a percent_prec attribute.
282 * src/print-xml.c (print_grammar): For each terminal that has a
283 precedence or associativity, add a prec or assoc attribute.
284 (xml_indent): New.
285 (xml_puts): Use xml_indent.
286 (xml_printf): Use xml_indent.
287 * src/print-xml.h (xml_indent): Prototype.
288
289 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
290 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
291
2922007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
293
294 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
295 (bison:ruleByNumber): ... this for clarity.
296 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
297 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
298 (xsl:template match="reduction"): Update.
299 (xsl:template match="item"): Update.
300 (xsl:template match="reduction"): Update.
301
302 In the XML output, don't print the list of rules where symbols appear.
303 Compute it in XSLT instead. Discussed at
304 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
305 * data/xslt/bison.xsl (bison:ruleByLhs): New.
306 (bison:ruleByRhs): New.
307 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
308 bison:ruleByRhs.
309 (xsl:template match="terminal/rule"): Remove.
310 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
311 bison:ruleByRhs.
312 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
313 Remove.
314 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
315 bison:ruleByRhs and mode="number-link" for rule template.
316 (xsl:template match="terminal/rule"): Remove.
317 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
318 bison:ruleByRhs and mode="number-link" for rule template.
319 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
320 Rewrite as...
321 (xsl:template match="rule" mode="number-link"): ... this.
322 * src/print-xml.c (print_grammar): Don't print the list of rules.
323
3242007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
325
326 Don't let --report affect XML output; always print all information.
327 Discussed at
328 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
329 * src/conflicts.c (log_resolution): Implement.
330 * src/print-xml.c (print_core): Implement.
331 (print_state): Implement.
332 (print_xml): Implement.
333
334 * NEWS (2.3a+): Fix quotes.
335 * src/parse-gram.y (prologue_declaration): For consistency with -v,
336 don't let %verbose clear the list specified by --report.
337
3382007-11-26 Akim Demaille <akim@epita.fr>
339
340 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
341
3422007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
343
344 In the XML output, list useless and unused symbols and rules with the
345 useful ones and add a "usefulness" attribute. Discussed starting at
346 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
347 * src/gram.c (grammar_rules_partial_print_xml): Remove.
348 (grammar_rules_print_xml): Print all rules instead of just those
349 useful in the grammar, and add a "usefulness" attribute.
350 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
351 * src/print-xml.c (print_rules_useless_in_parser): Remove.
352 (print_grammar): Print all nonterminals instead of just useful ones,
353 and add a "usefulness" attribute to nonterminals and terminals.
354 (print_xml): Don't print a separate "reductions" or
355 "rules-useless-in-parser" element.
356 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
357 (reduce_xml): Remove.
358 (reduce_token_unused_in_grammar): New.
359 (reduce_nonterminal_useless_in_grammar): New.
360 * src/reduce.h (reduce_xml): Remove prototype.
361 (reduce_token_unused_in_grammar): Add prototype.
362 (reduce_nonterminal_useless_in_grammar): Add prototype.
363 * data/xslt/xml2text.xsl: Update for XML changes.
364 * data/xslt/xml2xhtml.xsl: Update for XML changes.
365 * tests/reduce.at (Useless Terminals): Update output.
366 (Useless Rules): Update output.
367 (Reduced Automaton): Update output.
368
369 Say "Terminals unused in grammar" instead of "Unused terminals".
370 * NEWS (2.3a+): Update.
371 * doc/bison.texinfo (Understanding): Update example output.
372 * src/reduce.c (reduce_output): Implement.
373 * data/xslt/xml2text.xsl: Implement.
374 * data/xslt/xml2xhtml.xsl: Implement.
375
3762007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
377
378 Accept --report-file=FILE to override the default `.output' filename.
379 * NEWS (2.3a+): Mention.
380 * doc/bison.texinfo (Bison Options): Add an entry.
381 * src/files.c (compute_output_file_names): Don't override
382 spec_verbose_file if already set.
383 * src/getargs.c (usage): Document --report-file.
384 (REPORT_FILE_OPTION): New anonymous enum member.
385 (long_options): Add entry for it.
386 (getargs): Add case for it setting spec_verbose_file.
387
388 * build-aux/cross-options.pl: Don't record a short option just because
389 there's an arg.
390 * doc/.cvsignore: Add yacc.1.
391
3922007-11-14 Akim Demaille <akim@epita.fr>
393
394 * doc/yacc.1.in: New.
395 * configure.ac, doc/Makefile.am: Adjust.
396 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
397 config.h symbol.
398 Use AC_SUBST for assignments too.
399 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
400
4012007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
402
403 * src/gram.c: Remove comments that duplicate comments in gram.h.
404
405 When reporting useless rules and nonterminals, say "useless in grammar"
406 instead of "useless", and say "useless in parser" instead of "never
407 reduced". Discussed starting at
408 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
409 * NEWS (2.3a+): Mention this change.
410 * data/xslt/xml2text.xsl: Update output text and expected input XML
411 element names to match changes below.
412 * data/xslt/xml2xhtml.xsl: Likewise.
413 (xsl:template match="bison-xml-report"): Add missing entry in Table of
414 Contents: "Rules useless in parser due to conflicts".
415 * doc/bison.texinfo (Decl Summary): Reword a little.
416 (Understanding): Update example output for changes below.
417 * src/gram.c: (rule_useful_p): Rename to...
418 (rule_useful_in_grammar_p): ... this.
419 (rule_useless_p): Rename to...
420 (rule_useless_in_grammar_p): ... this.
421 (rule_never_reduced_p): Rename to...
422 (rule_useless_in_parser_p): ... this.
423 (grammar_rules_print): Update for renames.
424 (grammar_rules_print_xml): Update for renames.
425 (grammar_rules_never_reduced_report): Rename to...
426 (grammar_rules_useless_report): ... this since it is used for either
427 kind of useless rule.
428 * src/gram.h: Reword comments and update function names in prototypes.
429 * src/main.c (main): Say "rule useless in parser due to conflicts".
430 * src/print-xml.c (print_rules_never_reduced): Rename to...
431 (print_rules_useless_in_parser): ... this, and rename output XML
432 element "rules-never-reduced" to "rules-useless-in-parser".
433 (print_xml): Update for rename.
434 * src/print.c (print_results): Say "Rules useless in parser due to
435 conflicts".
436 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
437 (nonterminals_reduce): Say "nonterminal useless in grammar".
438 (reduce_output): Say "Nonterminals useless in grammar".
439 Say "Rules useless in grammar".
440 (reduce_xml): Rename output XML element "useless" to
441 "useless-in-grammar".
442 (reduce_print): Don't report the count of grammatically useless rules
443 as "rules never reduced" just because %yacc is specified.
444 In the correct report of this count, say nonterminal(s) and rule(s)
445 "useless in grammar".
446 * tests/conflicts.at (S/R in initial): Update expected output.
447 (Defaulted Conflicted Reduction): Likewise.
448 (Unreachable States After Conflict Resolution): Likewise.
449 * tests/existing.at (GNU pic Grammar): Likewise.
450 * tests/reduce.at (Useless Nonterminals): Likewise.
451 (Useless Rules): Likewise.
452 (Reduced Automaton): Likewise.
453 (Underivable Rules): Likewise.
454 (Empty Language): Likewise.
455
4562007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
457
458 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
459 here document and before the EOF so that BSD's implementation of Bourne
460 shell doesn't parse the delimiter as part of the here document.
461 * doc/.cvsignore: Add cross-options.texi.
462 * src/getargs.c (usage): Add a blank line after the warning categories.
463
4642007-11-08 Paolo Bonzini <bonzini@gnu.org>
465
466 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
467
4682007-11-05 Akim Demaille <akim@epita.fr>
469
470 Remove Id: from bison.1.
471 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
472 (perl -0777 -pi -e 's/\.PP\nId): New.
473 (.x.1): Use it to ignore the version control revision.
474
4752007-11-05 Akim Demaille <demaille@gostai.com>
476
477 * build-aux/Makefile.am: Ship cross-options.pl.
478 * doc/Makefile.am: Always refer to cross-options.texi with
479 $(srcdir).
480 (MAINTAINERCLEANFILES): Add it.
481
4822007-11-04 Akim Demaille <demaille@gostai.com>
483
484 Generate the long/short option cross-table.
485 * build-aux/cross-options.pl: New.
486 * doc/Makefile.am (cross-options.texi): New.
487 * doc/bison.texinfo: Use it.
488
4892007-11-04 Akim Demaille <demaille@gostai.com>
490
491 Generate bison.1 using help2man.
492 * doc/common.x, doc/bison.x: New.
493 * doc/Makefile.am (bison.1, .x.1): New.
494 The code is taken from autoconf-2.61/man/Makefile.am.
495 * configure.ac: Look for help2man.
496
4972007-11-04 Akim Demaille <demaille@gostai.com>
498
499 Complete --help.
500 * src/getargs.c (usage): Document -W, make it clear that -d,
501 -g and -x have optional arguments.
502
5032007-11-04 Akim Demaille <demaille@gostai.com>
504
505 Find sha1sum when named gsha1sum.
506 * bootstrap (find_tool): New.
507 ($SHA1SUM): New.
508
5092007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
510
511 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
512 at
513 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
514 * NEWS (2.3a+): Mention.
515 * data/bison.m4 (b4_pure_if): Don't define it here.
516 * data/c.m4 (b4_identification): Depend on individual skeletons to
517 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
518 values of the %define variables api.pure or api.push_pull. Define
519 YYPURE, YYPUSH, and YYPULL accordingly.
520 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
521 glr.cc has already defined b4_pure_flag.
522 * data/push.c: Define b4_pure_if based on `%define api.pure'.
523 Remove YYPUSH and YYPULL since they're back in b4_identification again.
524 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
525 * doc/bison.texinfo (Pure Decl): Update.
526 (Push Decl): Update.
527 (Decl Summary): Add api.pure to %define entry.
528 In %pure-parser entry, say it's deprecated and reference %define.
529 (Pure Calling): Update.
530 (Error Reporting): Update.
531 (C++ Scanner Interface): Update.
532 (How Can I Reset the Parser): Update.
533 (Table of Symbols): In %pure-parser entry, say it's deprecated and
534 reference %define.
535 * src/getargs.c (pure_parser): Remove global variable.
536 * src/getargs.h (pure_parser): Remove extern.
537 * src/output.c (prepare): Don't define pure_flag muscle.
538 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
539 wrapper around `%define api.pure'.
540 * tests/calc.at (Simple LALR Calculator): Update.
541 (Simple GLR Calculator): Update.
542 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
543 Update.
544 (GLR: Resolve ambiguity, pure, locations): Update.
545 (GLR: Merge conflicting parses, pure, no locations): Update.
546 (GLR: Merge conflicting parses, pure, locations): Update.
547 * tests/glr-regression.at (Uninitialized location when reporting
548 ambiguity): Update
549 * tests/input.at (Unused %define api.pure): New test case.
550 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
551 AT_PURE_IF and AT_PURE_AND_LOC_IF.
552 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
553
5542007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
555
556 %define push_pull -> %define api.push_pull. Discussed starting at
557 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
558 * data/push.c: Expect the new name.
559 * data/yacc.c: Likewise.
560 * doc/bison.texinfo (Push Decl): Update.
561 (Decl Summary): Update %define entry.
562 (Push Parser Function): Update.
563 (Pull Parser Function): Update.
564 (Parser Create Function): Update.
565 (Parser Delete Function): Update.
566 * tests/calc.at (Simple LALR Calculator): Update.
567 * tests/input.at (%define enum variables): Update.
568 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
569 (Push Parsing: Multiple impure instances): Update.
570 (Push Parsing: Unsupported Skeletons): Update.
571 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
572 (Exploding the Stack Size with Malloc): Update.
573
574 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
575 other entries some.
576
5772007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
578
579 For the XML output's terminal element, rename @number to @token-number,
580 and add @symbol-number. In the nonterminal element, rename @number to
581 @symbol-number. Discussed starting at
582 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
583 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
584 renames.
585 (xsl:template match="nonterminal"): Likewise.
586 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
587 (xsl:template match="nonterminal"): Likewise.
588 * src/print-xml.c (print_grammar): Implement.
589
5902007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
591
592 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
593 2007-10-11 change, the child elements here are items not rules.
594 (xsl:template match="item"): New.
595 (xsl:template match="rule"): Update for new reduced itemset.
596 (xsl:template match="point"): Remove.
597 (xsl:template match="empty"): For consistency with --graph, don't
598 output "/* empty */".
599 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
600 line-wrap, don't pass a negative value as first-line-length since this
601 won't work with the following changes.
602 (xsl:template name="line-wrap"): Simplify slightly.
603 (xsl:template name="ws-search"): Eliminate recursion.
604 * src/print_graph.c (print_core): Don't print a reduction's lookahead
605 set next to an item whose dot is not at the end of the RHS even if it
606 happens to be associated with the same rule.
607
6082007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
609
610 Add %define lr.keep_unreachable_states.
611 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
612 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
613 * src/main.c (main): Implement it.
614 * tests/conflicts.at (Unreachable States After Conflict Resolution):
615 Extend to test it, and fix a typo.
616
6172007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
618
619 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
620 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
621 the example .output text.
622 * tests/regression.at (Extra lookahead sets in report): Improve wording
623 of comments.
624
6252007-10-17 Wojciech Polak <polak@gnu.org>
626
627 * src/print-xml.c (print_grammar): Renamed
628 <terminal> and <nonterminal> attributes:
629 "type" to "number" and "symbol" to "name".
630 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
631 Use new attribute names.
632 (xsl:template match="nonterminal"): Likewise.
633 * data/xslt/xml2xhtml.xsl: Likewise.
634
6352007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
636
637 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
638 (Option Cross Key): Likewise.
639
640 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
641 next to an item whose dot is not at the end of the RHS even if it
642 happens to be associated with the same rule.
643 * src/print.c (print_core): Likewise.
644 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
645 (Resolved SR Conflicts): Update output.
646 * tests/regression.at (Extra lookahead sets in report): New test case.
647
6482007-10-11 Wojciech Polak <polak@gnu.org>
649
650 * src/print-xml.c (print_core): Remove item set
651 redundancy.
652 * data/xslt/bison.xsl (bison:ruleNumber): New key.
653 Improve processing time. Suggested by Joel E. Denny.
654 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
655 Write xsl:param "required" attribute as comment.
656 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
657 (xsl:template match="rule"): Support new reduced itemset.
658 (xsl:template match="point"): Remove.
659 * data/xslt/xml2xhtml.xsl: Likewise.
660
6612007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
662
663 * src/getargs.c (version): Update copyright year.
664
6652007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
666
667 Make xml2dot.xsl and --graph produce the same output.
668 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
669 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
670 escaped later.
671 (xsl:template name="output-node"): Use the new escape template instead
672 of the string-replace template directly.
673 (xsl:template name="output-edge"): Likewise.
674 (xsl:template name="escape"): New, escapes backslashes and newlines in
675 addition to quotation marks.
676 * src/graphviz.c (start_graph, output_node, output_edge): Add
677 whitespace to output for legibility.
678
679 Make xml2text.xsl and --report produce the same output, and remove the
680 XML "conflicts" element since a conflict summary is easily extracted
681 from the automaton.
682 * data/xslt/bison.xsl: New.
683 (xsl:template match="state" mode="bison:count-conflicts): New.
684 * data/xslt/xml2text.xsl: Import bison.xsl.
685 (xsl:template match="bison-xml-report"): Instead of styling the
686 "conflicts" element, style the "automaton" element with mode
687 "conflicts". Unlike the former, the latter lists S/R and R/R
688 conflicts for a state on the same line.
689 (xsl:template match="conflicts"): Remove.
690 (xsl:template match="conflict"): Remove.
691 (xsl:template match="terminal"): Line-wrap the list of rules in which
692 the terminal is used.
693 (xsl:template match="nonterminal"): Likewise for nonterminals.
694 (xsl:template match="automaton" mode="conflicts"): New.
695 (xsl:template match="state" mode="conflicts"): New.
696 (xsl:template name="line-wrap"): New.
697 (xsl:template name="ws-search"): New.
698 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
699 (xsl:template match="bison-xml-report"): Instead of styling the
700 "conflicts" element, style the "automaton" element with mode
701 "conflicts."
702 (xsl:template match="conflicts"): Remove.
703 (xsl:template match="conflict"): Remove.
704 (xsl:template match="automaton" mode="conflicts"): New.
705 (xsl:template match="state" mode="conflicts): New.
706 * src/conflicts.c (conflicts_output_xml): Remove.
707 * src/conflicts.h (conflicts_output_xml): Remove prototype.
708 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
709 * src/print.c (print_grammar): Consistently wrap at the 66th column so
710 the corresponding XSLT is easier. Also, never wrap between a word and
711 the comma that follows it.
712
7132007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
714
715 Improve C++ namespace support. Discussed starting at
716 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
717 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
718 b4_namespace_close): New macros that interpret the %define variable
719 "namespace" so its value can contain "::" to indicate nested
720 namespaces.
721 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
722 the above macros.
723 * data/lalr1.cc (b4_namespace): Likewise.
724 * data/location.cc (b4_namespace): Likewise.
725 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
726 inside a new table in the general %define entry. Document `%define
727 namespace' there as well. Point the %name-prefix entry to it since it
728 explains it more completely in the case of C++.
729 (C++ Bison Interface): Mention `%define namespace' instead of
730 %name-prefix.
731 (Table of Symbols): Remove the `%define push_pull' entry. The %define
732 entry suffices.
733 * tests/c++.at (Relative namespace references): New test case.
734 (Absolute namespace references): New test case.
735 (Syntactically invalid namespace references): New test case.
736 * tests/input.at (C++ namespace reference errors): New test case.
737
7382007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
739
740 Add syncline support and location accessor to internal %define
741 interfaces.
742 * data/bison.m4 (b4_percent_define_get_loc): New.
743 (b4_percent_define_get_syncline): New.
744 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
745 (b4_percent_define_default): Record defining location as line 1 rather
746 than 0 for the sake of synchronizing #line's, and define
747 b4_percent_define_syncline(VARIABLE).
748 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
749 * src/muscle_tab.c (muscle_syncline_grow): New.
750 (muscle_code_grow): Use muscle_syncline_grow.
751 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
752 define b4_percent_define_syncline(VARIABLE).
753 (muscle_percent_define_get_loc): New.
754 (muscle_percent_define_get_syncline): New.
755 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
756 remove some unused variables.
757 (muscle_percent_define_default): Record defining location as line 1
758 rather than 0 for the sake of synchronizing #line's, and define
759 b4_percent_define_syncline(VARIABLE).
760 (muscle_percent_define_check_values): Use
761 muscle_percent_define_get_loc.
762 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
763 (muscle_percent_define_get_syncline): Prototype.
764 * tests/skeletons.at (%define Boolean variables: invalid skeleton
765 defaults): Update output for location change.
766 (Complaining during macro argument expansion): Extend to test
767 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
768
7692007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
770
771 Fix some error-reporting macro bugs.
772 * data/bison.m4 (b4_cat): New.
773 (b4_error, b4_error_at): Use b4_cat to send error directives directly
774 to stdout so they don't become arguments to other macros. Update
775 comments and add examples.
776 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
777 add examples.
778 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
779 after printing the error directive so that M4 doesn't report subsequent
780 problems that are induced by this problem.
781 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
782 instead of just in them. Recognize @\n in both places. Both expand to
783 the empty string. Needed by b4_cat.
784 * tests/skeletons.at (Complaining during macro argument expansion):
785 New test case.
786 (Fatal errors make M4 exit immediately): New test case.
787
7882007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
789
790 Implement --print-datadir.
791 * src/getargs.c (usage): Mention.
792 (PRINT_DATADIR_OPTION): New anonymous enum member.
793 (long_options): Add entry for it.
794 (getargs): Add case for it calling compute_pkgdatadir.
795 * src/output.c (output_skeleton): Encapsulate data directory
796 computation from here...
797 (prepare): ... and from here...
798 (compute_pkgdatadir): ... into this new function.
799 * src/output.h (compute_pkgdatadir): Prototype.
800
8012007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
802
803 * src/print-xml.c (escape_bufs): New static global variable
804 replacing...
805 (xml_escape_n): ... the static local variable buf here.
806 (print_xml): Free memory for escape_bufs.
807 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
808
8092007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
810
811 Replace `%push-parser' and `%push-pull-parser' with
812 `%define push_pull "push"' and `%define push_pull "both"'.
813 `%define push_pull "pull"' is the default.
814 * doc/bison.texinfo (Push Decl, Push Parser Function,
815 Pull Parser Function, Parser Create Function, Parser Delete Function):
816 Update declarations.
817 (Decl Summary, Table of Symbols): Replace %push-parser and
818 %push-pull-parser entries with a %define push_pull entry.
819 * data/bison.m4 (b4_percent_define_check_values): New macro.
820 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
821 definitions...
822 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
823 definitions...
824 * data/push.c: ... to here and compute them from the value of the
825 %define variable push_pull.
826 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
827 parsing requests here...
828 * data/yacc.c: ... hack this to switch to push.c any time
829 b4_use_push_pull_flag or the %define variable push_pull is set. This
830 will go away when we mv push.c yacc.c.
831 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
832 push parsing is not supported since unused %define variables are
833 reported anyway.
834 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
835 * src/muscle_tab.h (muscle_percent_define_check_values): Update
836 comments for consistency with b4_percent_define_check_values.
837 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
838 muscles.
839 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
840 Remove.
841 (prologue_declaration): Remove %push-parser and %push-pull-parser
842 rules.
843 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
844 * tests/calc.at: Update declarations.
845 * tests/input.at (%define enum variables): New test case.
846 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
847 declaration.
848 (Push Parsing: Multiple impure instances): Update declaration.
849 (Push Parsing: Unsupported Skeletons): New test case.
850 * tests/torture.at (Exploding the Stack Size with Alloca): Update
851 declaration.
852 (Exploding the Stack Size with Malloc): Update declaration.
853
8542007-09-24 Wojciech Polak <polak@gnu.org>
855
856 Add XSLT transformations.
857
858 * data/xslt/xml2dot.xsl: Transform XML into DOT.
859 * data/xslt/xml2text.xsl: Transform XML into plain text.
860 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
861 * data/Makefile.am (xsltdir): New variable.
862 (dist_xslt_DATA): Add xslt/*.xsl files.
863
8642007-09-23 Paul Eggert <eggert@cs.ucla.edu>
865
866 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
867 Problem reported by Wojciech Polak.
868 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
869 (xml_printf): Undo change I made on 21 September; that is,
870 indent 2 spaces, not 1.
871
8722007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
873
874 Pacify ./configure --enable-gcc-warnings.
875 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
876 `char const *' instead of `char *'.
877 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
878 local variable `sep'.
879
8802007-09-21 Paul Eggert <eggert@cs.ucla.edu>
881
882 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
883 elsewhere.
884 * src/print-xml.c: Prefer "const" after types; that's more consistent.
885 (xml_printf): Indent just 1 space for level.
886 (e_char, xlate_char): Remove.
887 (xml_escape_string): Rewrite to avoid undefined behavior (used
888 storage that was freed from the stack).
889 (xml_escape_n): Don't bother checking for subscript error.
890
8912007-09-21 Wojciech Polak <polak@gnu.org>
892
893 Add Bison XML Automaton Report.
894
895 Add support for an -x option to generate an XML report.
896 It is not documented yet.
897 * src/print-xml.c: New file.
898 * src/print-xml.h: Likewise.
899 * lib/timevar.def (TV_XML): New var.
900 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
901 * src/conflicts.c: Include print-xml.h.
902 (solved_conflicts_xml_obstack): New var.
903 (log_resolution, conflicts_solve, conflicts_free):
904 Add support for XML report.
905 (conflicts_output_val): New function.
906 * src/conflicts.h (conflicts_output_val): New decl.
907 * src/files.c (spec_xml_file): New var.
908 (compute_output_file_names, output_file_names_free): Add XML support.
909 * src/files.h (spec_xml_file): New decl.
910 * src/getargs.c (xml_flag): New var.
911 (usage, short_options, long_options, getargs): Add XML support.
912 * src/getargs.h (xml_flag): New decl.
913 * src/gram.c: Include print-xml.h.
914 (rule_lhs_print_xml, rule_rhs_print_xml):
915 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
916 New functions.
917 * src/gram.h: Declare external ones.
918 * src/main.c: Include print-xml.h.
919 (main): Add XML support.
920 * src/reduce.c: Include print-xml.h.
921 (reduce_xml): New function.
922 * src/reduce.h: Declare it.
923 * src/state.c: Include print-xml.h.
924 (state_new): Add XML support.
925 (state_rule_lookahead_tokens_print_xml): New function.
926 * src/state.h: Declare it.
927 (struct state): New member solved_conflicts_xml.
928 * src/symtab.c (symbol_class_get_string): New function.
929 * src/symtab.h: Declare it.
930
9312007-09-21 Paul Eggert <eggert@cs.ucla.edu>
932
933 * GNUmakefile: Switch to coreutils's version.
934 * bootstrap: Likewise.
935 * Makefile.cfg: Adjust to new GNUmakefile.
936 * README-hacking: Likewise.
937
938 Import from gnulib:
939
940 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
941 Bruno Haible <bruno@clisp.org>
942
943 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
944 and is a script that invokes bison. Tighten the code. Add comments.
945
9462007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
947
948 Spell "boolean" as "Boolean". Reported by Akim Demaille.
949 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
950 * doc/bison.texinfo (Decl Summary): Fix.
951 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
952 * tests/input.at (Boolean %define variables): Update output.
953 * tests/skeletons.at (%define boolean variables: invalid skeleton
954 defaults): Rename to...
955 (%define Boolean variables: invalid skeleton defaults): ... this and
956 update output.
957
9582007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
959
960 In impure push mode, don't allow more than one yypstate to be allocated
961 since multiple impure parsers would corrupt yynerrs.
962 * data/push.c (yypstate_allocated): New static global variable
963 initialized to 0.
964 (yypull_parse): If yypstate_new returns 0, don't report it as memory
965 exhaustion if yypstate_allocated is 1, but still return 2.
966 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
967 already 1. Otherwise, set it to 1.
968 (yypstate_delete): Set it to 0.
969 * tests/push.at (Push Parsing: Multiple impure instances): New test
970 case.
971
9722007-08-17 Bob Rossi <bob@brasko.net>
973
974 * doc/bison.texinfo (Push Decl): Document the push parser.
975 (Table of Symbols): Ditto.
976 (Pure Decl): Ditto.
977 (Decl Summary): Ditto.
978 (Multiple Parsers, Push Parser Function, Pull Parser Function,
979 Parser Create Function, Parser Delete Function):
980 Add new push parser symbols.
981 (Table of Symbols): Document push-parser, push-pull-parser,
982 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
983
9842007-08-15 Paul Eggert <eggert@cs.ucla.edu>
985
986 Update to GPLv3.
987 * doc/gpl-3.0.texi: New file.
988 * doc/gpl.texi: Remove.
989 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
990 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
991 * README-hacking, TODO, bootstrap, bootstrap.conf:
992 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
993 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
994 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
995 * data/lalr1.cc, data/lalr1.java, data/location.cc:
996 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
997 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
998 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
999 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
1000 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
1001 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
1002 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
1003 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
1004 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
1005 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
1006 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
1007 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
1008 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
1009 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
1010 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
1011 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
1012 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
1013 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
1014 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
1015 * src/complain.c, src/complain.h, src/conflicts.c:
1016 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
1017 * src/files.h, src/flex-scanner.h, src/getargs.c:
1018 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
1019 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
1020 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
1021 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
1022 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
1023 * src/print.c, src/print.h, src/print_graph.c:
1024 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
1025 * src/reduce.h, src/relation.c, src/relation.h:
1026 * src/revision.h, src/scan-code.h, src/scan-code.l:
1027 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
1028 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
1029 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
1030 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
1031 * tests/Makefile.am, tests/actions.at, tests/c++.at:
1032 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
1033 * tests/existing.at, tests/glr-regression.at:
1034 * tests/headers.at, tests/input.at, tests/java.at:
1035 * tests/local.at, tests/output.at, tests/push.at:
1036 * tests/reduce.at, tests/regression.at, tests/sets.at:
1037 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
1038 * tests/torture.at:
1039 Update to GPLv3.
1040
10412007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1042
1043 Get rid of broken %no-parser, -n, and --no-parser implementation and
1044 documentation.
1045 * TODO: Don't mention them.
1046 * doc/bison.1: Likewise.
1047 * doc/bison.texinfo (Decl Summary): Likewise.
1048 (Bison Options): Likewise.
1049 (Option Cross Key): Likewise.
1050 * src/getargs.c (no_parser_flag): Remove global variable.
1051 (usage): Don't print description of -n and --no-parser.
1052 (long_options): Remove --no-parser entry here.
1053 (getargs): Remove -n case in the switch here.
1054 * src/getargs.h (no_parser_flag): Remove extern.
1055 * tests/regression.at (Web2c Actions): Remove comment that mentions
1056 --no-parser.
1057
10582007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1059
1060 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
1061 name user variables starting with `yy'. Just pass NULL instead of a
1062 dummy local &yylval to yypush_parse.
1063 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
1064 starting with `yy'.
1065
10662007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
1067
1068 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
1069 true since it's then always used regardless of whether yyoverflow is
1070 defined. Reported by Christian Burger at
1071 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
1072 * THANKS: Add Christian Burger.
1073
1074 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1075 node names: say "Decl Summary" not "Bison Declaration Summary".
1076
10772007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
1078
1079 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
1080 determine whether this function has already complained about an invalid
1081 value for a %define boolean variable, don't check whether Bison has
1082 ever examined the value. As written, the check was a tautology.
1083 Instead, record and check for this complaint using a separate muscle.
1084
10852007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1086
1087 Fix push parsing memory leak reported by Brandon Lucia at
1088 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
1089 * THANKS: Add Brandon Lucia.
1090 * data/push.c (yypstate_delete): Free the stack if it was reallocated
1091 but the parse never completed and thus freed it.
1092 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
1093 * tests/testsuite.at: Include push.at.
1094 * test/push.at: New.
1095 (Push Parsing: Memory Leak for Early Deletion): New test case.
1096
10972007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
1098
1099 Improve handling of multiple S/R conflicts in the same state and of S/R
1100 conflicts involving multiple reductions.
1101 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
1102 set for a state here or Bison will abort if it is reassigned on a
1103 later conflicted reduction in the same state.
1104 Similarly, don't finalize and assign the solved conflicts report here
1105 or it will be lost if it is reassigned on a later conflicted reduction
1106 in the same state.
1107 (set_conflicts): Instead, assign them both here after all S/R conflicts
1108 in the state have been fully examined.
1109 * src/print.c (shift_set): Rename to...
1110 (no_reduce_set): ... this.
1111 (print_reductions): Update for rename, and add %nonassoc error action
1112 tokens to no_reduce_set so that, when printing the first remaining
1113 reduction on an error action token, the reduction is enclosed in
1114 brackets.
1115 (print_results): Update for rename.
1116 * tests/conflicts.at (Solved conflicts report for multiple reductions
1117 in a state): New test case.
1118 (%nonassoc error actions for multiple reductions in a state): New test
1119 case.
1120
1121 * src/main.c (main): Don't depend on C99 features.
1122
11232007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1124
1125 * build-aux/.cvsignore: Add compile.
1126 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
1127 uniwidth.
1128
11292007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
1130
1131 * bootstrap (slurp): Create target directories that don't exist.
1132 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
1133
11342007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1135
1136 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
1137 than item number.
1138 * closure.c (closure): Likewise.
1139 * state.h (reductions): Comment sorting of rules.
1140 (state): Comment sorting of items.
1141
11422007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
1143
1144 Fix C++ test cases after recent Gnulib changes. Discussed starting at
1145 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
1146 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
1147 definition in order to avoid Gnulib headers since we don't use config.h
1148 here.
1149 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
1150 rather than AT_DATA so that config.h is included.
1151
11522007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
1153
1154 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
1155 instead of fprintf. Guard these functions with #if YYDEBUG instead of
1156 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
1157 and so that YYFPRINTF is guaranteed to be defined here.
1158
11592007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1160
1161 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
1162 with...
1163 (muscle_percent_define_check_values): ... this more helpful function.
1164 Again, it's not used yet, but it will be.
1165 * src/muscle_tab.h: Likewise.
1166
1167 Improve some comments in parser table construction.
1168 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
1169 (generate_states): Don't mention ruleset, which is internal to closure.
1170 * src/closure.c (closure): Explain sorting of core and itemset, which
1171 is required for this function to behave correctly.
1172 * src/closure.h (closure): Mention sorting.
1173
11742007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
1175
1176 * src/lalr.c (state_lookahead_tokens_count): For code readability,
1177 move the check for disabled transitions to an aver since conflict
1178 resolution hasn't happened yet.
1179
1180 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
1181 labels a state as inconsistent just because it has error transitions.
1182 The original form of this check appeared in revision 1.1 of lalr.c,
1183 which was committed on 1991-12-21. Now (at least), changing the
1184 consistency label on such a state appears to have no useful effect in
1185 any of the places it is examined, which I enumerate below. The key
1186 point to understanding each item in this enumeration is that a state
1187 with an error transition is labelled consistent in the first place only
1188 if it has no rules, so the check cannot matter for states that have
1189 rules. (1) Labelling a state as inconsistent will cause set_conflicts
1190 to try to identify its conflicts, and a state must have *rules* to have
1191 conflicts. (2) Labelling a state as inconsistent will affect how
1192 action_row sets the default *rule* for the state. (3) Labelling a
1193 state as inconsistent will cause build_relations to add lookback edges
1194 to *rules* in that state.
1195 * src/state.h (struct state): Word the comment for member consistent
1196 more carefully.
1197
11982007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1199
1200 Don't depend on C99 features.
1201 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
1202 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
1203 * src/reader.c (check_and_convert_grammar): Fix for-loop.
1204 * src/state.c (state_mark_reachable_states): Fix for-loop.
1205 (state_remove_unreachable_states): Fix for-loop.
1206
1207 Don't widen struct state with member reachable just to temporarily
1208 record reachability. Instead, use a local bitset.
1209 * src/state.h (struct state): Remove member.
1210 * src/state.c (state_new): Don't initialize it.
1211 (state_mark_reachable_states): Rename to...
1212 (state_record_reachable_states): ... this, and use bitset.
1213 (state_remove_unreachable_states): Use bitset.
1214
12152007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
1216
1217 * src/Makefile.am (yacc): Quote target action commands properly so
1218 that the yacc script isn't corrupt. Reported by Hans Aberg at
1219 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
1220
1221 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
1222 the case of pure parsers. Reported by Frans Englich at
1223 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
1224 * THANKS: Add Frans Englich.
1225
1226 * NEWS (2.3a+): In the %code entry, reference section `Bison
1227 Declaration Summary' from the manual now since the %code summary has
1228 moved there.
1229 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
1230 in the rules section must be terminated by semicolons.
1231
12322007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1233
1234 Extend the front-end API for %define variables to more completely
1235 mirror the back-end. This will be useful in the future.
1236 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
1237 Update comments to mention the new front-end counterparts of these
1238 macros.
1239 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
1240 for muscle_string_decode and muscle_location_decode.
1241 (muscle_string_decode): New static function.
1242 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
1243 (muscle_percent_define_get, muscle_percent_define_ifdef): New
1244 functions.
1245 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
1246 muscle_percent_define_get to mimic the b4_percent_define_flag_if
1247 implementation more closely.
1248 (muscle_percent_define_invalid_value): New function.
1249 * src/muscle_tab.h (muscle_percent_define_get,
1250 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
1251 Prototype.
1252
12532007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1254
1255 * NEWS (2.3a+): Mention yesterday's state-removal change.
1256 (2.3a): Remove the %language entry, which was added after 2.3a.
1257 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
1258 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
1259 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
1260 tests/existing.at: Update copyright date.
1261
12622007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1263
1264 If conflict resolution makes states unreachable, remove those states,
1265 report rules that are then unused, and don't report conflicts in those
1266 states.
1267 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
1268 New global function.
1269 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
1270 function.
1271 * src/main.c (main): After conflict resolution, remove the unreachable
1272 states and update all data structures that reference states by number.
1273 * src/state.c (state_new): Initialize each state's reachable member to
1274 false.
1275 (state_mark_reachable_states): New static function.
1276 (state_remove_unreachable_states): New global function.
1277 * src/state.h (struct state): Add member bool reachable.
1278 (state_remove_unreachable_states): Prototype.
1279 * tests/conflicts.at (Unreachable States After Conflict Resolution):
1280 New test case.
1281 * tests/existing.at (GNU pic Grammar): Update test case output now that
1282 an unused rule is discovered.
1283
12842007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1285
1286 Minor code cleanup in parser table construction.
1287 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
1288 (new_itemsets, save_reductions): Update for rename to nitemset.
1289 * src/closure.c (nritemset): Rename to...
1290 (nitemset): ... this since the "r" appears to meaningless and isn't
1291 used in the comments.
1292 (closure): Update for rename.
1293 * src/closure.h (nritemset): Update extern to...
1294 (nitemset): ... this.
1295 * src/lalr.c (LA): Fix a typo in comments.
1296 * src/print.c (print_core): Update for rename to nitemset.
1297 * src/print_graph.c (print_graph): Likewise.
1298 * src/state.h: Fix some typos in header comments.
1299
13002007-04-04 Paul Eggert <eggert@cs.ucla.edu>
1301
1302 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
1303 still sticks to ASCII. Sorry!
1304
1305 * README-hacking: New file, taken mostly from coreutils, with changes
1306 for Bison. Contains much of the contents of:
1307 * README-cvs: Remove.
1308 * bootstrap: Sync from gnulib.
1309 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
1310 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
1311
13122007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
1313
1314 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
1315 Setzer.
1316 (Java Differences): Fix some typos.
1317 * THANKS: Add Sebastian Setzer.
1318
13192007-03-07 Paolo Bonzini <bonzini@gnu.org>
1320
1321 * data/java.m4 (b4_single_class_if): Remove.
1322 (b4_abstract_if): Look at "%define abstract".
1323 (b4_lexer_if): New.
1324 (b4_union_name): Rename...
1325 (b4_yystype): ... to this. Map to "%define stype".
1326 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
1327 b4_maybe_throws): Fix quoting.
1328 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
1329 * data/lalr1.java (Lexer interface): Always define.
1330 (Lexer interface within parser class): Remove.
1331 (YYLexer class): New, used when "%code lexer" is present.
1332 (constructor): When "%code lexer" is used, pass %lex-param
1333 to the lexer constructor.
1334 (yylex, yyparse): Remove %lex-param from method invocations
1335 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
1336
1337 * doc/bison.texinfo (Java Bison Interface): Mention "%define
1338 abstract". Rename "%define union_name" to "%define stype".
1339 Rename method names according to previous patch.
1340 (Java Scanner Interface): Describe "%code lexer" instead of
1341 "%pure-parser" and "%define single_class".
1342 (Java Differences): Mention "%code lexer".
1343
1344 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
1345 Include scanner here, using macros from tests/local.at.
1346 (AT_DATA_CALC_Y): Remove final argument.
1347 (_AT_CHECK_JAVA_CALC): Likewise.
1348 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
1349 of %locations and %error-verbose.
1350 (main): Test with and without %lex-param.
1351 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
1352 (AT_BISON_OPTION_POPDEFS): Pop it.
1353
13542007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1355
1356 DJGPP spefic issue. Inhibit the use of disallowed characters for
1357 file name genertion on Win98, WinXP, etc. These are |<>":?*\
1358 and concern testsuite case 46.
1359 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
1360 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
1361 * djgpp/config.bat: Inhibit the use of disallowed characters.
1362
13632007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
1364
1365 Miscellaneous %define and %code cleanup.
1366 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
1367 values are interpreted.
1368 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
1369 documentation a little more.
1370 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
1371 muscle_percent_define_insert, muscle_percent_code_grow): New
1372 functions/macros.
1373 * src/muscle_tab.h (muscle_percent_define_insert,
1374 muscle_percent_code_grow): Prototype.
1375 * src/parse-gram.y (prologue_declaration): Use
1376 muscle_percent_define_insert and muscle_percent_code_grow when parsing
1377 %define and %code directives.
1378
1379 Make it easy to share %define boolean variables between the front-end
1380 and back-end. Though not used yet, this will be useful in the future.
1381 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
1382 Bison uses of names rather than just skeleton uses of names.
1383 (b4_percent_define_get, b4_percent_define_ifdef): Rename
1384 b4_percent_define_skeleton_variables(VARIABLE) to
1385 b4_percent_define_bison_variables(VARIABLE).
1386 (b4_percent_code_get, b4_percent_code_ifdef): Rename
1387 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
1388 b4_percent_code_bison_qualifiers(QUALIFIER).
1389 (b4_check_user_names_wrap): Update for renames.
1390 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
1391 muscle_percent_define_default): New functions mimicking
1392 b4_percent_define_flag_if and b4_percent_define_default.
1393
1394 For %define variables, report locations for invalid values and
1395 redefinitions.
1396 * data/bison.m4 (b4_percent_define_flag_if): Read
1397 b4_percent_define_loc(VARIABLE) to report the location of an invalid
1398 value for VARIABLE.
1399 (b4_percent_define_default): Save a special location in
1400 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
1401 must later be reported as invalid.
1402 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
1403 functions.
1404 (muscle_percent_define_insert): Record the location of VARIABLE in
1405 muscle percent_define_loc(VARIABLE), and use it to report the previous
1406 location for a redefinition.
1407 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
1408 (muscle_percent_define_default): Update like b4_percent_define_default.
1409 (muscle_grow_user_name_list): Rename to...
1410 (muscle_user_name_list_grow): ... this for consistency and use
1411 muscle_location_grow.
1412 * src/muscle_tab.h (muscle_location_grow): Prototype.
1413 * tests/input.at (%define errors): Update expected output.
1414 * tests/skeletons.at (%define boolean variables: invalid skeleton
1415 defaults): New test case.
1416
14172007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
1418
1419 * src/print.c (lookahead_set, state_default_rule): Remove.
1420 (print_reductions): Replace state_default_rule invocation with
1421 equivalent use of yydefact, which was computed in token_actions in
1422 tables.c.
1423 (print_results): Don't allocate lookahead_set.
1424
14252007-02-27 Paolo Bonzini <bonzini@gnu.org>
1426
1427 * data/lalr1.java: Prefix all private members with yy.
1428
14292007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
1430
1431 Use YYFPRINTF instead of fprintf where appropriate. Reported by
1432 Sebastien Fricker at
1433 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
1434 * THANKS: Add Sebastien Fricker.
1435 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
1436 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
1437 accept a variable number of arguments.
1438
14392007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1440
1441 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
1442
14432007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1444
1445 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
1446 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
1447 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
1448
14492007-02-11 Paul Eggert <eggert@cs.ucla.edu>
1450
1451 Undo my 2007-02-07 change, switching back to the c-strcase module
1452 introduced in the 2007-02-03 change. Bruno Haible reported that
1453 the 2007-02-07 change would be dangerous in Turkish if we add a
1454 language whose name contains "i", since "i" is not lowercase "I"
1455 in Turkish.
1456 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
1457 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
1458 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
1459 * m4/.cvsignore: Remove strcase.m4.
1460 * src/getargs.c: Revert 2007-02-07 change, as follows.
1461 Include c-strcase.h.
1462 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
1463
14642007-02-11 Bruno Haible <bruno@clisp.org>
1465
1466 Enable the Java related testsuite tests when the only Java compiler
1467 found is a gcj < 4.3. Discussed at
1468 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
1469 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
1470
14712007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
1472
1473 * data/Makefile.am: Update copyright date.
1474 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
1475 yypstate_new returns NULL.
1476 (yypstate_new): Return NULL if malloc does.
1477 * src/reader.c (packgram): Move translation of rule actions from the
1478 beginning of packgram to...
1479 (check_and_convert_grammar): ... here right before packgram is invoked
1480 so it's easier to write more complete comments, and remove redundant
1481 code.
1482
14832007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
1484
1485 As in semantic actions, make @$ in %initial-action, %destructor, and
1486 %printer imply %locations.
1487 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
1488 scanning @$.
1489 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
1490 (@$ in %initial-action implies %locations,
1491 @$ in %destructor implies %locations,
1492 @$ in %printer implies %locations): ... these new test cases.
1493
14942007-02-07 Paul Eggert <eggert@cs.ucla.edu>
1495
1496 Undo most of the 2007-02-03 change, switching to the strcase module
1497 now that gnulib strcase has been fixed.
1498 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
1499 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
1500 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
1501 * m4/.cvsignore: Add strcase.m4.
1502 * src/getargs.c: Revert 2007-02-03 change, as follows.
1503 Don't include c-strcase.h.
1504 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
1505 strcasecmp has "unspecified behavior" outside the POSIX locale,
1506 but it works fine in practice if at least one argument is ASCII,
1507 as is the case in Bison.
1508
15092007-02-07 Paolo Bonzini <bonzini@gnu.org>
1510
1511 * tests/java.at: Skip tests if only one of javac/java is present.
1512 Reported by Joel E. Denny.
1513 * tests/atlocal.in: Adjust copyright years.
1514
15152007-02-05 Paolo Bonzini <bonzini@gnu.org>
1516
1517 * data/lalr1.java (Stack): Work around old verifiers that disallow
1518 access to the private fields of an inner class, from the outer class.
1519 We can make Stack's fields public because user code doesn't have access
1520 to the instance of Stack used by parse(). Reported by Paul Eggert.
1521
15222007-02-03 Paul Eggert <eggert@cs.ucla.edu>
1523
1524 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
1525 the right spot for these files?
1526 * bootstrap.conf (gnulib_modules): Add c-strcase.
1527 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
1528 c-strncasecmp.c.
1529 * src/getargs.c: Include c-strcase.h.
1530 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
1531 to avoid unspecified behavior.
1532
15332007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
1534
1535 * doc/bison.texinfo (Decl Summary): Correct typo.
1536
15372007-01-30 Paolo Bonzini <bonzini@gnu.org>
1538
1539 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
1540 Complain if the value does not match empty, "true" or "false".
1541 * data/c++.m4: Adjust default definitions of %define variables.
1542 * data/java.m4: Adjust default definitions of %define variables.
1543 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
1544 to above behavior.
1545 * tests/input.at (Boolean %define variables): Test new behavior.
1546
15472007-01-29 Paolo Bonzini <bonzini@gnu.org>
1548
1549 * NEWS: Mention java.
1550 * TODO: Remove things that are done.
1551 * bootstrap.conf: Add javacomp-script and javaexec-script.
1552 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
1553
1554 * data/Makefile.am: Add new files.
1555 * data/java-skel.m4: New.
1556 * data/java.m4: New.
1557 * data/lalr1.java: New.
1558
1559 * doc/bison.texinfo: Put "A Complete C++ Example" under
1560 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
1561 under Other Languages.
1562
1563 * src/getargs.c (valid_languages): Add Java.
1564 * src/getargs.h (struct bison_language): Update size of string fields.
1565
1566 * tests/Makefile.am: Add java.at.
1567 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
1568 * tests/java.at: New.
1569 * tests/testsuite.at: Include it.
1570
15712007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
1572
1573 Clean up.
1574 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
1575 at_directive_argv arguments so these no longer have to be global
1576 variables. Also, update the implementation for the following changes.
1577 (fail_for_at_directive_too_many_args,
1578 fail_for_at_directive_too_few_args): Add at_directive_name argument.
1579 (at_directive_name): Remove as at_directive_argv[0] will be used for
1580 this now.
1581 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
1582 for the directive name.
1583 (at_directive_argc, at_directive_argv): Make these local within
1584 skel_lex instead of global.
1585 (INITIAL): Update directive start action for above changes.
1586 (SC_AT_DIRECTIVE_ARG): Rename to...
1587 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
1588 (SC_AT_DIRECTIVE_SKIP_WS): Update.
1589 (scan_skel): Move yylex_destroy to...
1590 (skel_scanner_free): ... here.
1591 * tests/skeletons.at (installed skeleton file name): Rename to...
1592 (installed skeleton file names): ... this.
1593
15942007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
1595
1596 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1597 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
1598 Summary" not "Directives".
1599 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
1600 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
1601 since the former is now the more complete one.
1602 (Prologue Alternatives): Likewise and do the same for %defines.
1603 (Table of Symbols): Add summary of %code, add summary of %define, and
1604 move full %code documentation to...
1605 (Decl Summary): ... here for consistency with other entries in these
1606 sections.
1607 Move %define entry in order to keep this list alphabetized.
1608 Reword %define entry a little to put less emphasis on the skeleton
1609 concept, which most users shouldn't have to think about.
1610
16112007-01-26 Paul Eggert <eggert@cs.ucla.edu>
1612
1613 Adjust to recent gnulib changes.
1614 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
1615 Add string.h, string_.h, unistd_.h, wchar_.h.
1616 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
1617 * src/system.h: Don't include <stpcpy.h>; this is now done by
1618 <string.h>.
1619
16202007-01-23 Paolo Bonzini <bonzini@gnu.org>
1621
1622 Simplify implementation of unqualified %code, implement macros for
1623 uniform treatment of boolean %define flags. Document %define.
1624 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
1625 b4_percent_code_ifdef): New.
1626 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
1627 * data/c++.m4: Define default value for global_tokens_and_yystype.
1628 * data/glr.cc: Likewise.
1629 * data/location.cc: Use b4_percent_define_flag_if.
1630
1631 * doc/bison.texinfo (Decl Summary): Document %define.
1632
1633 * src/parse-gram.y (Unqualified %code): Change muscle name to
1634 b4_percent_code().
1635 (content.opt): Default to empty.
1636
16372007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1638
1639 Implement support for relative and absolute skeleton file names.
1640 Discussed starting at
1641 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
1642 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
1643 (Bison Options): Document in --skeleton entry.
1644 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
1645 full_skeleton can't necessarily hold all of pkgdatadir.
1646 If the specified skeleton file name contains a `/', don't prepend
1647 pkgdatadir.
1648 * src/parse-gram.y (prologue_declaration): If the specified skeleton
1649 file name contains a `/', prepend the grammar file directory.
1650 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
1651 * skeletons.at: New file.
1652 (relative skeleton file names): New test case.
1653 (installed skeleton file names): New test case.
1654 * tests/testsuite.at: Include skeletons.at.
1655
1656 * bootstrap: Update copyright to 2007.
1657
16582007-01-17 Paolo Bonzini <bonzini@gnu.org>
1659
1660 * bootstrap: Remove occurrences of .#bootmp from the files.
1661
16622007-01-17 Akim Demaille <akim@epita.fr>
1663
1664 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
1665 nonterminals.
1666 Use per-type %printer.
1667
16682007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1669
1670 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
1671 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1672 djgpp/config.site, src/files.c, src/files.h, src/main.c,
1673 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
1674 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
1675 tests/glr-regression.at, tests/input.at, tests/local.at,
1676 tests/output.at, tests/torture.at: Update copyright to 2007.
1677
16782007-01-16 Akim Demaille <akim@epita.fr>
1679
1680 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
1681 error code.
1682 (Calc++ Scanner): Exit with failure if we can't open the input
1683 file.
1684 Accept "-" standing for stdin.
1685 (Calc++ Top Level): Print the result only if the parsing was
1686 successful.
1687
16882007-01-16 Akim Demaille <akim@epita.fr>
1689
1690 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
1691
16922007-01-15 Paolo Bonzini <bonzini@gnu.org>
1693 and Joel E. Denny <jdenny@ces.clemson.edu>
1694
1695 Clean up %define and %code implementation in M4 some. Most
1696 importantly, rename all related macros to be in the b4_percent_define
1697 and b4_percent_code namespaces. Also, complete support for `.' in
1698 %define variable names and %code qualifiers.
1699 * data/bison.m4 (b4_check_user_names): Check for special
1700 "SKELETON-NAMESPACE(name)" macros instead of using two nested
1701 m4_foreach loops.
1702 (b4_get_percent_define, b4_get_percent_code): Rename to...
1703 (b4_percent_define_get, b4_percent_code_get): ... these.
1704 Extend documentation with examples.
1705 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
1706 b4_percent_define_skeleton_variables and
1707 b4_percent_code_skeleton_qualifiers.
1708 Expect any value for the %define variable `foo' to be stored in the
1709 macro named `b4_percent_define(foo)'; expect any %code blocks for the
1710 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
1711 expect any unqualified %code blocks to be stored in a macro named
1712 `b4_percent_code_unqualified'.
1713 Use m4_indir so that %define variable names and %code qualifiers can
1714 contain `.', which is allowed by the grammar parser.
1715 (b4_percent_define_default): New macro to set a default value for a
1716 %define variable.
1717 (m4_wrap): Update wrapped code, and fix some underquoting.
1718 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
1719 Expect grammar uses of %define variables and %code qualifiers to be
1720 defined in b4_percent_define_user_variables and
1721 b4_percent_code_user_qualifiers.
1722 * data/c++.m4: Use b4_percent_define_default rather than
1723 m4_define_default. Fix some underquoting. Skeleton usage of %define
1724 variable define_location_comparison now implies skeleton usage of
1725 %define variable filename_type.
1726 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1727 data/push.c, data/yacc.c: Update macro names.
1728 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
1729 muscle names.
1730
17312007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1732
1733 DJGPP specific issues.
1734
1735 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
1736 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
1737
17382007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1739
1740 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
1741 run parsers in all tests so that Valgrind is invoked during
1742 maintainer-check-valgrind.
1743 (Duplicate representation of merged trees): Free all semantic values.
1744 (Duplicated user destructor for lookahead): Likewise.
1745
17462007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1747
1748 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
1749 command-line prefix.
1750 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
1751 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
1752 miss Valgrind messages.
1753 (Exploding the Stack Size with Malloc): Likewise.
1754
17552007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1756
1757 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
1758 locals. Reported by Juan Manuel Guerrero at
1759 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
1760 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
1761 Fix some indentation also.
1762 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
1763 explaining this issue.
1764
17652007-01-09 Paolo Bonzini <bonzini@gnu.org>
1766 and Joel E. Denny <jdenny@ces.clemson.edu>
1767
1768 Simplify union and prologue handling, and escape union and lex/parse
1769 params with digraphs.
1770 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
1771 values to the empty string since these are no longer guaranteed
1772 initialized by the front-end.
1773 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
1774 braces around b4_user_stype since this is no longer done by the
1775 front-end.
1776 * src/files.c, src/files.h (pre_prologue_obstack,
1777 post_prologue_obstack): Remove.
1778 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
1779 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
1780 with digraphs. This fixes lex params and parse params.
1781 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
1782 * src/output.c (prepare): Remove muscle insertion of the prologues.
1783 (output): Remove freeing of pre_prologue_obstack and
1784 post_prologue_obstack.
1785 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
1786 than prologue_augment for prologue parsing so you don't need prologue
1787 obstacks.
1788 (grammar_declaration): For %union RHS, use `braceless' instead of
1789 "{...}" so that braces are already stripped and code is escaped with
1790 digraphs.
1791 * src/reader.c (prologue_augment): Remove.
1792 (reader): Remove initialization of pre_prologue_obstack and
1793 post_prologue_obstack.
1794 * src/reader.h (prologue_augment): Remove.
1795
1796 * data/c.m4: Remove stray parenthesis.
1797
17982007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1799
1800 Remove quotes from variables names in %define directives and from
1801 qualifiers in %code directives, and restrict the characters that are
1802 allowed in them to M4-friendly ones. For %define, continue to support
1803 the quoted form as a deprecated feature. Discussed starting at
1804 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
1805 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
1806 %code.
1807 * doc/bison.texinfo (Prologue Alternatives): Update.
1808 (Decl Summary): In %defines entry, update mention of `%code requires'
1809 and `%code provides'.
1810 (C++ Location Values): Update %define uses.
1811 (Calc++ Parser Interface): Likewise.
1812 (Calc++ Parser): Likewise, and update `%code requires' uses.
1813 (Table of Symbols): Update %code documentation.
1814 * src/parse-gram.y (prologue_declaration): For %define variables, use
1815 `variable' instead of `STRING'.
1816 (grammar_declaration): For %code qualifiers, use `ID' instead of
1817 `STRING'.
1818 (variable): New nonterminal that takes an `ID' or a `STRING'.
1819 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
1820 and %define uses.
1821 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
1822 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
1823 (%define errors): Update %define uses.
1824
18252007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1826
1827 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
1828 instead of muscle_insert for %define values so that M4-special
1829 characters are replaced with digraphs.
1830 * tests/input.at (%define errors): Extend to check weird values.
1831
18322007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1833
1834 Instead of having skeletons declare all valid %define variables and
1835 %code qualifiers, provide macros that retrieve the associated values
1836 and build these lists automatically. Thus Bison will now warn when a
1837 variable or qualifier is not used by the skeleton in the current
1838 invocation regardless of whether it might sometimes be used by that
1839 skeleton in other invocations. Also, move all %define value macros to
1840 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
1841 form, which is replaced by %code.
1842 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
1843 (b4_check_user_names): ... this, and change the series of valid name
1844 arguments to a single list argument for names used in the skeleton
1845 similar to the existing list argument for names used in the grammar.
1846 Warn instead of complaining.
1847 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
1848 values and %code code, to format %code code properly, and to build
1849 lists of all %define variables and %code qualifiers used in the
1850 skeleton: b4_skeleton_percent_define_variables and
1851 b4_skeleton_percent_code_qualifiers.
1852 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
1853 Remove, and...
1854 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
1855 the skeleton names lists can finish building first. In place of
1856 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
1857 expect the lists b4_user_percent_define_variables and
1858 b4_user_percent_code_qualifiers.
1859 * data/c++.m4: Where setting default values for b4_parser_class_name,
1860 b4_location_type, b4_filename_type, b4_namespace, and
1861 b4_define_location_comparison, update their names to the
1862 b4_percent_define_ namespace.
1863 * data/glr.c: Don't use b4_check_percent_define_variables and
1864 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1865 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
1866 (b4_parser_class_name, b4_namespace): Define these using
1867 b4_get_percent_define for parser_class_name and namespace.
1868 * data/location.cc: Use b4_get_percent_define.
1869 * data/push.c: Don't use b4_check_percent_define_variables and
1870 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1871 * data/yacc.c: Likewise, and don't call m4_exit in
1872 b4_use_push_for_pull_if or m4_wrap code will never execute.
1873 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
1874 Rename to...
1875 (muscle_grow_user_name_list): ... this for consistency with the
1876 terminology used in bison.m4.
1877 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
1878 %define variable names, and rename muscle used_percent_define_variables
1879 to user_percent_define_variables.
1880 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
1881 user_percent_code_qualifiers.
1882 (content): Remove.
1883 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
1884 {CODE} form is no longer accepted.
1885 * tests/input.at (Reject bad %code qualifiers): Rename to...
1886 (Reject unused %code qualifiers): ... this, and update test output.
1887 (%define error): Update test output.
1888
18892007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
1890
1891 Check for unrecognized %define variables similar to checking for
1892 unrecognized %code qualifiers. Check for redefined %define variables.
1893 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
1894 generalizes...
1895 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
1896 (b4_check_percent_define_variables): New, also wraps it.
1897 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
1898 variables using b4_check_percent_define_variables.
1899 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
1900 all those exercised in the test suite and all those listed in the
1901 `Default values' section of c++.m4. Are there others?
1902 * data/push.c, data/yacc.c: Declare no valid %define variables.
1903 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
1904 similar to muscle_find, but it works even when the muscle stores a
1905 const value.
1906 (muscle_grow_used_name_list): New function for constructing the used
1907 name list muscles that b4_check_for_unrecognized_names requires.
1908 * src/parse-gram.y (prologue_declaration): Warn if a variable is
1909 %define'd more than once. Define the b4_used_percent_define_variables
1910 muscle with muscle_grow_used_name_list.
1911 (grammar_declaration): Abbreviate %code code with
1912 muscle_grow_used_name_list.
1913 * tests/input.at (%define errors): New.
1914
19152007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1916
1917 Provide warn_at, complain_at, and fatal_at function callbacks to the
1918 skeletons, and use this for %code qualifier complaints.
1919 * data/bison.m4 (b4_error_at): New, invoked by...
1920 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
1921 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
1922 @fatal_at(...@) directives.
1923 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
1924 qualifiers in b4_used_percent_code_qualifiers and to use
1925 b4_complain_at.
1926 * src/location.c, src/location.h (boundary_set_from_string): New global
1927 function.
1928 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
1929 function.
1930 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
1931 to b4_used_percent_code_qualifiers.
1932 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
1933 function.
1934 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
1935 (lineno): Rename to...
1936 (out_lineno): ... this so I don't misunderstand it again.
1937 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
1938 here; these newlines are in the input but not the output file.
1939 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
1940 (at_directive_perform): ... this new static function, and add handling
1941 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
1942 directives.
1943 * tests/input.at (Reject bad %code qualifiers): Update test output with
1944 locations and extend.
1945
1946 * tests/output.at (Output file name: [, Output file name: ]): Remove
1947 bogus comment about these tests failing.
1948
19492007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1950
1951 Clean up b4_check_percent_code_qualifiers a little.
1952 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
1953 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
1954 documentation and add examples.
1955 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
1956 qualifiers here.
1957
19582007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
1959
1960 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
1961 unreliable -- especially when they're hidden inside another macro.
1962 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
1963 data/c.m4: Remove m4_divert(-1).
1964 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1965 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
1966 m4_divert_push(0) and m4_divert_pop(0).
1967 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
1968 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
1969 pushed and popped by m4sugar, should be first on the stack.
1970
1971 Provide warn, complain, and fatal function callbacks to the skeletons.
1972 This provides more flexibility than m4_fatal, improves the error
1973 message format, and captures messages for translation. Discussed
1974 starting at
1975 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
1976 * data/bison.m4 (b4_error): New, invoked by...
1977 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
1978 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
1979 directives. Because these M4 macros might be called when the current
1980 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
1981 the previous removal of uses of m4_divert, which caused trouble.
1982 (b4_check_percent_code_qualifiers): Use b4_complain instead of
1983 m4_fatal to report unrecognized %code qualifiers.
1984 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
1985 push parser requests.
1986 * data/glr.c: Use b4_complain instead of m4_fatal to report
1987 non-deterministic push parser requests.
1988 Update @output usage to @output(...@) form.
1989 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
1990 report missing %defines. Update @output usage to @output(...@) form.
1991 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
1992 @output(...@) form.
1993 * src/main.c (main): Invoke skel_scanner_free.
1994 * src/scan-skel.h (skel_scanner_free): Prototype new function.
1995 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
1996 obstack_for_string from flex-scanner.h.
1997 (YY_DECL): Use to declare skel_lex static.
1998 (decode_at_digraphs): Remove; now handled in the new
1999 SC_AT_DIRECTIVE_ARG start condition.
2000 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
2001 functions.
2002 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
2003 at_directive_argv): New static globals.
2004 (INITIAL): Use fail_for_invalid_at.
2005 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
2006 recognize the start of a generalized `@directive(...@)' form and
2007 start...
2008 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
2009 directive args (using the new obstack_for_string), to decode the
2010 contained @ diagraphs, and to perform the directive. It recognizes
2011 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
2012 @output(...@).
2013 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
2014 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
2015 `@,'.
2016 (scan_skel): Initialize obstack_for_string on the first call.
2017 (skel_scanner_free): New function to free obstack_for_string.
2018 * tests/input.at (Reject bad %code qualifiers): Update test output.
2019
20202007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
2021
2022 Consolidate the 4 prologue alternative directives (%code, %requires,
2023 %provides, and %code-top) into a single %code directive with an
2024 optional qualifier field. Discussed at
2025 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
2026 * NEWS (2.3a+): Rewrite the existing entry for the prologue
2027 alternatives.
2028 * doc/bison.texinfo (Prologue Alternatives): Update.
2029 (Decl Summary): Update to %code "requires" and %code "provides".
2030 (Calc++ Parser): Update to %code "requires".
2031 (Table of Symbols): Remove entries for %requires, %provides, and
2032 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
2033 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
2034 are replaced by b4_percent_code_provides and b4_percent_code_requires,
2035 which are skeleton-specific.
2036 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
2037 declare what %code qualifiers it supports and to complain if any other
2038 qualifiers were used in the grammar.
2039 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
2040 and b4_user_code([b4_percent_code_provides]) in place of
2041 b4_user_requires and b4_user_provides.
2042 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
2043 Add b4_user_code([b4_percent_code_top]) and
2044 b4_user_code([b4_percent_code]).
2045 Invoke b4_check_percent_code_qualifiers.
2046 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2047 PERCENT_REQUIRES): Remove.
2048 (grammar_declaration): Remove RHS's for %code-top, %provides, and
2049 %requires. Rewrite the %code RHS as the unqualified form defining the
2050 muscle b4_percent_code. Add another RHS for the qualified %code form,
2051 which defines muscles of the form b4_percent_code_QUALIFIER and the
2052 b4_used_percent_code_qualifiers muscle.
2053 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2054 PERCENT_REQUIRES): Remove.
2055 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
2056 %code "requires" and %code "provides".
2057 * tests/input.at (Reject bad %code qualifiers): New.
2058
20592007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2060
2061 Use the new code_props interface for destructors and printers.
2062 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
2063 printer_location members, and change the type of the destructor and
2064 printer members to code_props.
2065 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
2066 symbol_printer_get, semantic_type_destructor_set,
2067 semantic_type_printer_set, default_tagged_destructor_set,
2068 default_tagless_destructor_set, default_tagged_printer_set,
2069 default_tagless_printer_set): Use code_props in arguments and return
2070 types in place of char const * and location.
2071 (symbol_destructor_location_get, symbol_printer_location_get): Remove
2072 since the locations are now contained in the return of
2073 symbol_destructor_get and symbol_printer_get.
2074 * src/output.c (symbol_destructors_output, symbol_printers_output):
2075 Replace with...
2076 (symbol_code_props_output): ... this to eliminate duplicate code.
2077 (output_skeleton): Update to use symbol_code_props_output.
2078 * src/reader.c (symbol_should_be_used): Update use of
2079 symbol_destructor_get.
2080 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2081 Update uses of the various _destructor_set and _printer_set functions.
2082 * src/symtab.c: (default_tagged_destructor_location,
2083 default_tagless_destructor_location, default_tagged_printer_location,
2084 default_tagless_printer_location): Remove since we...
2085 (default_tagged_destructor, default_tagless_destructor,
2086 default_tagged_printer, default_tagless_printer): ... change the type
2087 of these to code_props.
2088 (symbol_new, semantic_type_new, symbol_destructor_set,
2089 semantic_type_destructor_set, symbol_destructor_get,
2090 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
2091 symbol_check_alias_consistency, default_tagged_destructor_set,
2092 default_tagless_destructor_set, default_tagged_printer_set,
2093 default_tagless_printer_set): Update.
2094 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
2095 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
2096 code_props members.
2097 (symbol_print): Use SYMBOL_CODE_PRINT.
2098
20992007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2100
2101 Use the new code_props interface for rule actions.
2102 * src/symlist.h (symbol_list): Replace action, action_location, and
2103 used members with a code_props action_props member.
2104 * src/reader.c (symbol_should_be_used, grammar_rule_check,
2105 grammar_midrule_action, grammar_current_rule_merge_set,
2106 grammar_current_rule_symbol_append, packgram): Update.
2107 * src/scan-code.h (translate_rule_action): Remove, no longer used.
2108 * src/scan-code.l (handle_action_dollar): Update.
2109 (translate_rule_action): Remove, no longer used.
2110 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
2111
21122007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2113
2114 Use the new code_props interface in parse-gram.y.
2115 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
2116 Update all uses of translate_* functions to use the new code_props
2117 interface and to use gram_scanner_last_string_free and
2118 code_scanner_last_string_free where possible.
2119 (grammar_declaration): symbol_list_destructor_set and
2120 symbol_list_printer_set now perform the translation, so don't do it
2121 here. Use gram_scanner_last_string_free where possible.
2122 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
2123 translate_code): Remove, no longer used.
2124 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
2125 symbol_list_printer_set): Perform code translation here rather than
2126 depending on the caller to do so.
2127
2128 * src/symlist.h (struct symbol_list): Correct some documentation typos.
2129 * src/scan-gram.h (gram_last_string): Remove declaration.
2130 * src/scan-gram.l (last_string): Declare it static.
2131
21322007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2133
2134 Encapsulate code properties and related functionality for the various
2135 destructors, printers, and actions into a code_props structure and
2136 interface. This patch merely implements code_props in scan-code.h and
2137 scan-code.l. Future patches will rewrite other modules to use it.
2138 Discussed starting at
2139 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
2140 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
2141 consistently initialize const structs that have an empty location
2142 field.
2143 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
2144 to ensure consistency.
2145 * src/scan-code.h (code_props): New structure.
2146 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
2147 function, macro, and const global variable for initializing a
2148 code_props with no code.
2149 (code_props_plain_init, code_props_symbol_action_init,
2150 code_props_rule_action_init, code_props_translate_code): The rest of
2151 the new code_props functional interface. Among other things, the init
2152 functions set the code_props kind field so that
2153 code_props_translate_code will know whether to behave like
2154 translate_symbol_action, translate_rule_action, or translate_code.
2155 These old translate functions must remain until all other modules are
2156 updated to use the new code_props interface.
2157 (code_scanner_last_string_free): New function similar to
2158 gram_scanner_last_string_free.
2159 (code_scanner_free): Add documentation.
2160 * src/scan-code.l: Implement the new interface.
2161 (code_lex): Make it static, add a code_props* argument, and remove the
2162 rule argument.
2163 (last_string): New static global similar to the one in scan-gram.l.
2164 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
2165 instead of rule.
2166 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
2167 code_props since Bison may one day use this information for destructors
2168 and printers.
2169 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
2170 (handle_action_dollar): Use symbol_list_n_get and set used flag
2171 directly since symbol_list_n_used_set is removed.
2172 (translate_action): Add a code_props* argument and remove the rule,
2173 action, and location arguments. Pass the code_props* on to code_lex.
2174 (translate_rule_action, translate_symbol_action, translate_code):
2175 Rewrite as wrappers around the new code_props interface.
2176 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
2177 it would eventually need to break the encapsulation of code_props.
2178
21792007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2180
2181 * etc/.cvsignore: New.
2182
21832007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2184
2185 Add maintainer-push-check to run maintainer-check using push parsing in
2186 place of pull parsing where available.
2187 * Makefile.am (maintainer-push-check): New.
2188 * data/bison.m4 (b4_use_push_for_pull_if): New.
2189 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
2190 appropriately based on their existing values.
2191 (yypush_parse): Don't print push-parser-specific diagnostics if push
2192 parsing is being used in place of pull parsing.
2193 * data/yacc.c: If push parsing should replace pull parsing, redirect to
2194 push.c.
2195 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
2196 variable, and insert b4_use_push_for_pull_flag into muscles.
2197 * tests/Makefile.am (maintainer-push-check): New.
2198
21992006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2200
2201 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
2202 (whether successful or failed) so that yypush_parse can be invoked
2203 again to start a new parse using the same yypstate.
2204 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
2205 check multiple yypull_parse invocations on the same yypstate. For pull
2206 mode, extend to check multiple yyparse invocations.
2207 (Exploding the Stack Size with Alloca): Extend to try with
2208 %push-pull-parser.
2209 (Exploding the Stack Size with Malloc): Likewise.
2210
2211 * tests/calc.at (Simple LALR Calculator): Don't specify
2212 %skeleton "push.c" since %push-pull-parser implies that now.
2213 * tests/headers.at (export YYLTYPE): Don't check for the push
2214 declarations. Otherwise, this test case can't be used to see if push
2215 mode can truly emulate pull mode.
2216 * tests/input.at (Torturing the Scanner): Likewise.
2217 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
2218 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
2219 AT_YACC_IF, which now includes the case of push mode since %skeleton
2220 need not be used for push mode. This will be more intuitive once
2221 push.c is renamed to yacc.c.
2222
22232006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2224
2225 For push mode, convert yyparse from a macro to a function, invoke yylex
2226 instead of passing a yylexp argument to yypull_parse, and don't
2227 generate yypull_parse or yyparse unless %push-pull-parser is declared.
2228 Discussed starting at
2229 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
2230 * data/bison.m4 (b4_pull_if): New.
2231 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
2232 * data/push.c: Improve M4 quoting a little.
2233 (b4_generate_macro_args, b4_parenthesize): Remove.
2234 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
2235 any time a pull parser is requested.
2236 Don't #define this as a wrapper around yypull_parse. Instead, when
2237 both push and pull are requested, make it a function that does that
2238 same thing.
2239 (yypull_parse): If there's a b4_prefix, #define this to
2240 b4_prefix[pull_parse] when both push and pull are requested.
2241 Don't define this as a function unless both push and pull are
2242 requested.
2243 Remove the yylexp argument and hard-code yylex invocation instead.
2244 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
2245 %push-parser.
2246 * src/getargs.c (pull_parser): New global initialized to true.
2247 * getargs.h (pull_parser): extern it.
2248 * src/output.c (prepare): Insert pull_flag muscle.
2249 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
2250 (prologue_declaration): Set both push_parser and pull_parser = true for
2251 %push-pull-parser. Set push_parser = true and pull_parser = false for
2252 %push-parser.
2253 * src/scan-gram.l: Don't accept %push_parser as an alternative to
2254 %push-parser since there's no backward-compatibility concern here.
2255 Scan %push-pull-parser.
2256 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
2257 instead of %push-parser.
2258 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
2259 prototype it in the module that calls yyparse.
2260 * tests/input.at (Torturing the Scanner): Likewise.
2261 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
2262
22632006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
2264
2265 Update etc/bench.pl. Optimize push mode a little (the yyn change
2266 deserves most of the credit).
2267 * Makefile.am (SUBDIRS): Add etc subdirectory.
2268 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
2269 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
2270 yytoken, yyval, and yyloc declarations to...
2271 (yyparse or yypush_parse): ... here to improve performance. For
2272 yypush_parse invocations after the first, be sure to assign yyn its old
2273 value again.
2274 (yypstate_new): Don't bother initializing the yyresult field since the
2275 initial value isn't used.
2276 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
2277 remove the #define that, in push mode, set it to yyps->NAME.
2278 * etc/Makefile.am: New.
2279 * etc/bench.pl: Remove and build it instead from...
2280 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
2281 "tests/bison" from the build directory by default rather than just
2282 invoking "bison" from $PATH.
2283 (calc_grammar): Update push parser code: don't declare yylval globally,
2284 don't define yyparse_wrapper, and don't #define yyparse.
2285 (bench_grammar): Update to check all working combinations of yacc.c,
2286 push.c, impure, pure, pull, and push.
2287
22882006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2289
2290 For push mode, add pull wrappers around yypush_parse.
2291 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
2292 (yypull_parse): New function wrapping yypush_parse.
2293 (yyparse): New #define wrapping yypull_parse.
2294 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
2295 is declared.
2296 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
2297 prototype yylex in the module that calls yyparse, and don't prototype
2298 yyparse there. Otherwise, the yyparse expansion won't compile.
2299 * tests/input.at (Torturing the Scanner): Likewise.
2300
23012006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2302
2303 Enable push parsers to operate in impure mode. Thus, %push-parser no
2304 longer implies %pure-parser. The point of this change is to move
2305 towards being able to test the push parser code by running the entire
2306 test suite as if %push-parser had been declared.
2307 * data/push.c (yypush_parse): For impure mode, remove the
2308 yypushed_char, yypushed_val, and yypushed_loc arguments.
2309 Instead, declare these as local variables initialized to the global
2310 yychar, yylval, and yylloc.
2311 For the first yypush_parse invocation only, restore the initial values
2312 of these global variables when it's time to read a token since they
2313 have been overwritten.
2314 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
2315 %push-parser.
2316 * tests/calc.at (Simple LALR(1) Calculator): Always declare
2317 %pure-parser along with %push-parser since this test case was designed
2318 for pure push parsers.
2319 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
2320 (AT_YACC_OR_PUSH_IF): New.
2321 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
2322 add a note that it's still wrong for some cases (as it has been for a
2323 while).
2324 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
2325 %push-parser no longer implies %pure-parser.
2326
23272006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2328
2329 Remove some unnecessary differences between the pull parser code and
2330 the push parser code. This patch enables yynerrs in push mode.
2331 * data/push.c: Reformat M4 a little.
2332 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
2333 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
2334 because push mode is on. Instead, if pure mode is on, move yynerrs
2335 to...
2336 (b4_declare_parser_state_variables): ... here.
2337 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
2338 to yyps->NAME so it can be used in yypush_parse.
2339 (yypush_parse): Don't omit uses of yynerrs in push mode.
2340
23412006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2342
2343 Fix bug such that the first pushed token's value and location are
2344 sometimes overwritten (sometimes by %initial-action) before being used.
2345 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
2346 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
2347 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
2348 more closely mimic the pull parser logic.
2349 Don't copy the pushed token to yychar, yylval, and yylloc until it's
2350 time to read a token, which is after any initialization of yylval and
2351 yylloc.
2352 (gottoken): Rename label to...
2353 (yyread_pushed_token): ... for clarity and to avoid infringing on the
2354 user namespace.
2355
23562006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2357
2358 Rearrange initialization of the parser state variables so that the
2359 skeleton doesn't have to have a copy for pull mode and another for push
2360 mode. This patch also fixes at least a bug such that yylloc was not
2361 initialized (with b4_location_initial_line and
2362 b4_location_initial_column) upon calling yypush_parse. However, that
2363 initialization now overwrites the first token's location;
2364 %initial-action assigning @$ already did the same thing, and both bugs
2365 will be fixed in a later patch.
2366 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
2367 (b4_declare_parser_state_variables): Remove initialization of yytoken,
2368 yyss, yyvs, yyls, and yystacksize.
2369 (yypstate_new): Remove initialization of some yypstate fields: yystate,
2370 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
2371 yylsp.
2372 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
2373 yyps->NAME so it can be used in yypush_parse.
2374 (yyparse or yypush_parse): For yypush_parse, don't print the
2375 "Starting parse" diagnostic for invocations after the first.
2376 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
2377 yypush_parse, only do it for the first invocation.
2378 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
2379 initialization to occur in yypush_parse but only on the first
2380 invocation.
2381
23822006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2383
2384 * data/push.c: Add CPP guards around push parser declarations in both
2385 the header and the code file.
2386 In the code file, move the push parser declarations to the same place
2387 they appear in the header file.
2388 Clean up the M4 some, especially the inconsistent underquoting in
2389 some b4_c_function_def and b4_c_function_decl uses.
2390
23912006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2392
2393 Encapsulate the push parser state variables into an M4 macro so the
2394 push skeleton doesn't have to list them again for pull mode's yyparse.
2395 For push mode, remove yypush_parse's local equivalents of these
2396 variables to eliminate unnecessary copying between the two sets at
2397 run-time. This patch also fixes at least a bug related to multiple
2398 %initial-action invocations in push mode.
2399 * data/push.c (b4_declare_parser_variables): Rename to...
2400 (b4_declare_scanner_communication_variables): ... this for clarity and
2401 update both uses.
2402 (b4_declare_yyparse_variables): Remove and move its contents to the one
2403 spot where it was invoked.
2404 (b4_declare_parser_state_variables): New macro containing the parser
2405 state variables required by push mode.
2406 (struct yypstate): Replace all fields but yynew with
2407 b4_declare_parser_state_variables.
2408 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
2409 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
2410 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
2411 (yyparse or yypush_parse): For yyparse in pull mode, replace local
2412 parser state variable declarations with
2413 b4_declare_parser_state_variables.
2414 Don't initialize parser state variables when calling yypush_parse since
2415 yypstate_new already does that.
2416 Invoke the user's initial action only upon the first yypush_parse
2417 invocation.
2418 Remove all code that copies between the local parser state variables
2419 and the yypstate.
2420
24212006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2422
2423 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
2424 prevent a name collision in a future patch where these names will
2425 sometimes be #define'd.
2426 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
2427 since it no longer has the same name as the existing argument.
2428 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
2429
24302006-12-19 Paolo Bonzini <bonzini@gnu.org>
2431 and Joel E. Denny <jdenny@ces.clemson.edu>
2432
2433 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2434 that the argument is case-insensitive, and there's no `=' here.
2435 For the %skeleton entry, mention that %language is better.
2436 (Bison Options): Likewise for --language and --skeleton. Move the
2437 --skeleton entry so that the `Tuning the parser' section is sorted
2438 alphabetically on long options.
2439 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
2440 %language directive in detail here; cross-reference the %language
2441 documentation instead.
2442 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
2443 `%require "2.3b"' so that the example is always up-to-date.
2444 (Table of Symbols): Add entries for %language and %skeleton.
2445 * examples/extexi (normalize): Instead of replacing every %require
2446 argument with the current Bison version, just substitute for
2447 `@value{VERSION}'. This guarantees that we're testing what actually
2448 appears in the documentation.
2449 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
2450 rather than `@VERSION@'.
2451
24522006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2453
2454 * NEWS: Reword the %language news a bit, and put it earlier.
2455
2456 * src/getargs.c (skeleton_arg): Last arg is now location const *.
2457 Rewrite to simplify the logic.
2458 (language_argmatch): Likewise.
2459 (program_name): We now own this var.
2460 * src/getargs.h (struct bison_language): Use char[] rather than
2461 const char *.
2462
2463 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
2464 Java is supported.
2465 * src/complain.c (program_name): Remove decl; no longer needed.
2466 * src/main.c (program_name): Remove; now belongs to getargs.
2467
24682006-12-18 Paolo Bonzini <bonzini@gnu.org>
2469
2470 * NEWS: Document %language.
2471
2472 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
2473
2474 * data/c-skel.m4, data/c++-skel.m4: New files.
2475 * data/glr.c: Complain on push parsers.
2476
2477 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
2478 over %skeleton.
2479 (Decl Summary): Document %language and %skeleton.
2480 (Command line): Document -L.
2481
2482 * examples/extexi: Rewrite %require directive.
2483 * examples/calc++/Makefile.am: Pass VERSION to extexi.
2484
2485 * src/files.c (compute_exts_from_gc): Look in language structure
2486 for .y extension.
2487 (compute_file_name_parts): Check whether .tab should be added.
2488 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
2489 (language, skeleton_arg, language_argmatch): New.
2490 (long_options): Add --language.
2491 (getargs): Use skeleton_arg, add -L/--language.
2492 * src/getargs.h: Include location.h.
2493 (struct bison_language, language, skeleton_arg, language_argmatch): New.
2494 * src/output.c (prepare): Pick default skeleton from struct language.
2495 Don't dispatch C skeletons here.
2496 * src/parse-gram.y (PERCENT_LANGUAGE): New.
2497 (prologue_declaration): Add "%language" rule, use skeleton_arg.
2498 * src/scan-gram.l ("%language"): New rule.
2499
2500 * tests/calc.at: Test %skeleton and %language.
2501 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
2502 (AT_GLR_IF): Look for %skeleton "glr.cc".
2503 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
2504 (AT_YACC_IF): Reject %language.
2505
25062006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2507
2508 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
2509 since it wasn't used; only the typedef name 'semantic_type' is needed.
2510 Also, omit trailing white space.
2511
2512 * bootstrap: Sync from coreutils.
2513 (gnulib_extra_files): Add build-aux/announce.gen.
2514 (slurp): Adjust .gitignore files like .cvsignore files.
2515 * build-aux/announce-gen: Remove from CVS, since bootstrap
2516 now creates this.
2517
25182006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
2519
2520 Make %push-parser imply %pure-parser. This fixes several bugs; see
2521 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
2522 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
2523 pure_parser = true.
2524 * data/push.c: Don't bother testing b4_push_if when deciding whether
2525 to expand b4_declare_parser_variables globally.
2526 (yypush_parse): Likewise in here.
2527
2528 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
2529 (yy_reduce_print): Reformat M4 for readability.
2530
25312006-12-15 Bob Rossi <bob@brasko.net>
2532 and Joel Denny <jdenny@ces.clemson.edu>
2533
2534 * data/push.c (yypstate): Add typedef, and update all uses of
2535 struct yypstate to just yypstate.
2536 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
2537
25382006-12-14 Bob Rossi <bob@brasko.net>
2539
2540 * data/push.c (yypush_parse): Declare prototype regardless of
2541 %locations option.
2542
25432006-12-14 Bob Rossi <bob@brasko.net>
2544
2545 * data/push.c (yyparse): Remove the prototype and the #define when in
2546 push-parser mode.
2547
25482006-12-13 Bob Rossi <bob@brasko.net>
2549
2550 * data/push.c (yypstate_init): Rename to...
2551 (yypstate_new): ... this and use b4_c_function_def.
2552 (yypstate_delete): New.
2553 (yypush_parse): Change parameters yynval and yynlloc to be const.
2554 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
2555 yypstate_delete functions.
2556
25572006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
2558
2559 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
2560 strange test case titles. Reported by Bob Rossi.
2561
25622006-12-13 Paul Eggert <eggert@cs.ucla.edu>
2563
2564 * TODO: Add pointer to Sylvain Schmitz's work on static detection
2565 of potential ambiguities in GLR grammers.
2566
25672006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
2568
2569 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
2570 `bison ', use m4_index instead of m4_substr since chopping up a string
2571 containing M4-special characters causes problems here.
2572
2573 Fix a couple of bugs related to special characters in user-specified
2574 file names, and make it easier for skeletons to compute output file
2575 names with the same file name prefix as Bison-computed output file
2576 names.
2577 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
2578 b4_parser_file_name and b4_spec_defines_file instead of
2579 @output_parser_name@ and @output_header_name@, which are now redundant.
2580 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
2581 b4_parser_file_name, b4_spec_defines_file, and the new
2582 @basename(FILENAME@) instead of @output_parser_name@ and
2583 @output_header_name@, which inappropriately escaped the file names as
2584 C string literals.
2585 * src/files.c (all_but_ext): Remove static qualifier.
2586 (compute_output_file_names): Move `free (all_but_ext)' to...
2587 (output_file_names_free): ... here since all_but_ext is needed later.
2588 * src/files.h (all_but_ext): Extern.
2589 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
2590 exactly what MUSCLE_INSERT_STRING used to do.
2591 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
2592 characters are escaped properly.
2593 * src/output.c (prepare): Define muscle file_name_all_but_ext as
2594 all_but_ext.
2595 For pkgdatadir muscle, maintain previous functionality by using
2596 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
2597 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
2598 digraphs would never be expanded. Hopefully no one has M4-special
2599 characters in his Bison installation path.
2600 * src/scan-skel.l: Don't parse @output_header_name@ and
2601 @output_parser_name@ anymore since they're now redundant.
2602 In @output, use decode_at_digraphs.
2603 Parse a new @basename command that invokes last_component.
2604 (decode_at_digraphs): New.
2605 (BASE_QPUTS): Remove unused.
2606 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
2607 (Output file name): New tests.
2608
26092006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
2610
2611 Warn about output files that are generated by the skeletons and that
2612 conflict with other output files.
2613 * data/glr.c: Don't generate the header file here when glr.cc does.
2614 * src/files.c (file_names, file_names_count): New static globals.
2615 (compute_output_file_names): Invoke output_file_name_check for files
2616 not generated by the skeletons and remove existing checks.
2617 (output_file_name_check): New function that warns about conflicting
2618 output file names.
2619 (output_file_names_free): Free file_names.
2620 * src/files.h (output_file_name_check): Declare.
2621 * src/scan-skel.l: Invoke output_file_name_check for files generated by
2622 the skeletons.
2623 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
2624 (Conflicting output files): New tests.
2625
26262006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2627
2628 * doc/bison.texinfo: Fix a couple of typos.
2629
26302006-12-08 Bob Rossi <bob@brasko.net>
2631
2632 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
2633 Rename to...
2634 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
2635 update all uses.
2636 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
2637 (yypush_parse): Rename yypvars argument to yyps and remove redundant
2638 local pv.
2639 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
2640 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
2641
26422006-12-07 Bob Rossi <bob@brasko.net>
2643 and Joel Denny <jdenny@ces.clemson.edu>
2644
2645 * data/push.c (yypvarsinit): Change return type from void* to struct
2646 yypvars*. No longer cast to void* on return.
2647 (struct yypvars): Remove yylen since it need not be remembered between
2648 yypushparse invocations.
2649 (yypushparse): Don't copy between yylen and pv->yylen.
2650
26512006-12-05 Bob Rossi <bob@brasko.net>
2652
2653 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
2654 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
2655 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
2656 (struct yypvars): Remove b4_declare_parser_variables.
2657 (yypvarsinit): Remove init code for removed variables.
2658 (global scope): Do not declare b4_declare_parser_variables if
2659 push or pure mode.
2660 (yypushparse): Add b4_declare_parser_variables.
2661 Init new local variables, and remove init code for removed
2662 yypvars variables.
2663 (yyparse): Delete.
2664 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
2665 and yyparse for other modes.
2666 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
2667 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
2668 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
2669 (AT_PURE_LEX_IF): True if pure or push parser.
2670
26712006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
2672
2673 Document Yacc prologue alternatives and default %destructor's and
2674 %printer's as experimental. Don't mention Java yet. Discussed at
2675 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
2676 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
2677 (2.3a): Annotate this entry to say the old forms of these features were
2678 also experimental.
2679 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
2680 Table of Symbols): Say they're experimental. Comment out any mention
2681 of Java (we'll want this back eventually).
2682
26832006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2684
2685 Support a file name argument to %defines. Deprecate `=' in
2686 %file-prefix, %name-prefix, and %output. Discussed at
2687 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
2688 * NEWS (2.3a+): Mention.
2689 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
2690 form of %defines, and remove `=' from entries for %file-prefix,
2691 %name-prefix, and %output.
2692 * src/parse-gram.y (prologue_declaration): Implement.
2693 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
2694 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
2695 all but one occurrence of %name-prefix.
2696 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
2697 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
2698 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
2699 occurrence of each of %file-prefix and %output. Add check for %defines
2700 with argument.
2701 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
2702 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
2703 Remove the `=' from %output.
2704
27052006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
2706
2707 Don't escape $ in test case titles since Autoconf 2.61 now does that
2708 correctly.
2709 * tests/actions.at (Default %printer and %destructor are not for error
2710 or $undefined): Here.
2711 (Default %printer and %destructor are not for $accept): Here.
2712 * tests/input.at (Invalid $n and @n): Here.
2713
27142006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
2715
2716 Rename <!> to <>. Discussed starting at
2717 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
2718 * NEWS (2.3a+): Update.
2719 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
2720 Update.
2721 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
2722 * src/scan-gram.l (INITIAL): Implement.
2723 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
2724 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
2725 comment.
2726 * tests/actions.at (Default tagless %printer and %destructor,
2727 Default tagged and per-type %printer and %destructor,
2728 Default %printer and %destructor are not for error or $undefined,
2729 Default %printer and %destructor are not for $accept,
2730 Default %printer and %destructor for mid-rule values): Update.
2731 * tests/input.at (Default %printer and %destructor redeclared,
2732 Unused values with default %destructor): Update.
2733
27342006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2735
2736 Don't let %prec take a nonterminal.
2737 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
2738 token.
2739 * tests/input.at (%prec takes a token): New test checking that %prec
2740 won't take a nonterminal.
2741
27422006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2743
2744 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
2745 it was double-quoted.
2746 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
2747 grammar is maintained with Bison's highest standards.
2748 * src/getargs.c: Fix some typos in Doxygen comments.
2749
27502006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2751
2752 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
2753 later. Reported by Paul Eggert in
2754 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
2755 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
2756 * src/scan-code.l (translate_action): Don't bother invoking
2757 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
2758 (code_scanner_free): Instead of invoking
2759 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
2760 which frees more.
2761 * src/scan-gram.l (gram_scanner_free): Likewise.
2762 * src/scan-skel.l (scan_skel): Likewise.
2763
27642006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2765
2766 * src/files.c (tr): Change return type to void.
2767 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
2768 has been called previously for the same key.
2769 (muscle_find): Return storage instead of value so that
2770 --enable-gcc-warnings doesn't produce warnings that the return discards
2771 const. aver that the value and storage are the same since storage
2772 could potentially be NULL when value is not.
2773 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
2774 same as 0.
2775
27762006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2777
2778 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
2779 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
2780 us a slightly cleaner distribution, and also works.
2781 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
2782 gnulib changes.
2783
27842006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
2785 and Paul Eggert <eggert@cs.ucla.edu>
2786
2787 Don't let Bison leak memory except when it complains.
2788 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
2789 (spec_defines_file, dir_prefix): Now char *, not const char *,
2790 since they are freed.
2791 * src/files.c: Likewise.
2792 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
2793 Likewise.
2794 (tr): Now operates in-place. All uses changed.
2795 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
2796 values.
2797 (compute_file_name_parts, compute_output_file_names): Don't store
2798 read-only data in variables that will be freed.
2799 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
2800 src_extension, and header_extension.
2801 (output_file_names_free): New public function to free
2802 spec_verbose_file, spec_graph_file, spec_defines_file,
2803 parser_file_name, and dir_prefix.
2804 * src/getargs.c (getargs): Don't store read-only data in variables that
2805 will be freed.
2806 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
2807 (which previously existed but was unused), and quotearg_free.
2808 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
2809 * src/muscle_tab.c: Likewise.
2810 (muscle_entry): Make the value char const *,
2811 and add a new storage member that is char * and can be freed.
2812 (muscle_entry_free): New private function.
2813 (muscle_init): Use it instead of free.
2814 (muscle_insert, muscle_grow): Update and use new storage member.
2815 (muscle_code_grow): Free the string passed to muscle_grow
2816 since it's not needed anymore.
2817 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
2818 add a new `char *code' member.
2819 ("{...}"): Declare semantic type as code.
2820 * src/scan-code.h (translate_rule_action):
2821 (translate_symbol_action, translate_code, translate_action): Return
2822 `char const *' rather than `char *' since external code should not free
2823 these strings.
2824 * src/scan-code.l: Likewise.
2825 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
2826 which is "{...}" in the parser.
2827 * tests/Makefile.am (maintainer-check-valgrind): Set
2828 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
2829 Valgrind.
2830 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
2831 complain.
2832 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
2833 expecting a non-zero exit status sets --leak-check=summary and
2834 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
2835 this case, and we don't want to hear about it.
2836
28372006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2838
2839 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
2840 instead of from the template, to simplify configuration a bit.
2841 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
2842 and m4/wint_t.m4, as they are needed with the latest gnulib.
2843
28442006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2845
2846 Disable unset/unused mid-rule value warnings by default, and recognize
2847 --warnings=midrule-values to enable them. Discussed starting at
2848 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
2849 * NEWS (2.3a+): Mention.
2850 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
2851 warnings): Add entry for midrule-values subargument.
2852 * src/reader.c (symbol_should_be_used): Don't return true just because
2853 the value is a set/used mid-rule value unless
2854 --warnings=midrule-values was specified.
2855 * tests/input.at (Unused values, Unused values before symbol
2856 declarations): Run tests with and without --warnings=midrule-values.
2857
2858 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
2859 than LIST_FREE directly.
2860
28612006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2862
2863 Finish implementing --warnings=error, which should not be implied by
2864 --warnings=all (or by its synonyms -W and --warnings without
2865 subarguments).
2866 * src/complain.c (set_warning_issued): New function to report that
2867 warnings are being treated as errors and to record an error if so.
2868 Invoke...
2869 (warn_at, warn): ... here.
2870 * src/getargs.c (warnings_args, warnings_types): Reorder so that
2871 "error - warnings are errors" does not appear above "all - all of the
2872 above".
2873 (getargs): For -W and --warnings without subarguments, don't let
2874 FLAGS_ARGMATCH set warnings_error in warnings_flag.
2875 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
2876
28772006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2878
2879 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
2880 empty subargument list. For example: `bison --warnings= parser.y'.
2881
28822006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2883
2884 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
2885 the parser header file so that gcc doesn't warn.
2886
28872006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2888
2889 Split the default %destructor/%printer into two kinds: <*> and <!>.
2890 Discussed starting at
2891 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
2892 * NEWS (2.3a+): Mention.
2893 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
2894 previous change today related to mid-rules.
2895 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
2896 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
2897 (TYPE_TAG_ANY): Add as <*>.
2898 (TYPE_TAG_NONE): Add as <!>.
2899 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
2900 for <*> and <!>.
2901 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
2902 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
2903 * src/symlist.c (symbol_list_default_new): Split into tagged and
2904 tagless versions.
2905 (symbol_list_destructor_set, symbol_list_printer_set): Split
2906 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
2907 SYMLIST_DEFAULT_TAGLESS.
2908 * src/symlist.h: Update symbol_list_default*_new prototypes.
2909 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
2910 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
2911 * src/symtab.c (default_destructor, default_destructor_location,
2912 default_printer, default_printer_location): Split each into tagged and
2913 tagless versions.
2914 (symbol_destructor_get, symbol_destructor_location_get,
2915 symbol_printer_get, symbol_printer_location_get): Implement tagged
2916 default and tagless default cases.
2917 (default_destructor_set, default_printer_set): Split each into tagged
2918 and tagless versions.
2919 * src/symtab.h: Update prototypes.
2920 * tests/actions.at (Default %printer and %destructor): Rename to...
2921 (Default tagless %printer and %destructor): ... this, and extend.
2922 (Per-type %printer and %destructor): Rename to...
2923 (Default tagged and per-type %printer and %destructor): ... this, and
2924 extend.
2925 (Default %printer and %destructor for user-defined end token): Extend.
2926 (Default %printer and %destructor are not for error or $undefined):
2927 Update.
2928 (Default %printer and %destructor are not for $accept): Update.
2929 (Default %printer and %destructor for mid-rule values): Extend.
2930 * tests/input.at (Default %printer and %destructor redeclared): Extend.
2931 (Unused values with default %destructor): Extend.
2932
29332006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2934
2935 Don't apply the default %destructor/%printer to an unreferenced midrule
2936 value. Mentioned at
2937 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
2938 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
2939 like $@n instead of just @n so that the default %destructor/%printer
2940 logic doesn't see them as user-defined symbols.
2941 (symbol_is_dummy): Check for both forms of the name.
2942 * src/reader.c (packgram): Remove the `$' from each midrule symbol
2943 name for which the midrule value is referenced in any action.
2944 * tests/actions.at (Default %printer and %destructor for mid-rule
2945 values): New test.
2946 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
2947 for change to dummy symbol names.
2948
29492006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2950
2951 Warn about unset midrule $$ if the corresponding $n is used.
2952 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
2953 $n usage.
2954 (packgram): Before invoking grammar_rule_check on any rule, make sure
2955 all actions have already been scanned in order to set `used' flags.
2956 Otherwise, checking that a midrule's $$ is set will not always work
2957 properly because the midrule check must forward-reference the midrule's
2958 parent rule.
2959 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
2960 warning.
2961
29622006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2963
2964 More improvements to the documentation of the prologue alternatives:
2965 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
2966 Bison manual.
2967 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
2968 some text to clarify the relative importance of the new directives and
2969 to show how these directives may be viewed as code labels.
2970
29712006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
2972
2973 Similar to the recently removed %before-header, add %code-top as the
2974 alternative to the pre-prologue. Mentioned at
2975 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
2976 Also, let the prologue alternatives appear in the grammar section.
2977 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
2978 (prologue_declaration): Move the existing prologue alternatives to...
2979 (grammar_declaration): ... here and add %code-top.
2980 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
2981
2982 Clean up and extend documentation for the prologue alternatives.
2983 * NEWS (2.3a+): Describe prologue alternatives.
2984 * doc/bison.texinfo (Prologue): Move discussion of prologue
2985 alternatives to...
2986 (Prologue Alternatives): ... this new section, and extend it to discuss
2987 all 4 directives in detail.
2988 (Table of Symbols): Clean up discussion of prologue alternatives and
2989 add %code-top.
2990
29912006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2992
2993 DJGPP specific issues.
2994
2995 * djgpp/config.bat: config.hin has been moved to lib. Adjust
2996 config.bat accordingly.
2997 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
2998 * djgpp/config.site: Likewise.
2999
30002006-10-16 Paolo Bonzini <bonzini@gnu.org>
3001
3002 Replace %*-header with %provides, %requires, %code. See discussion at
3003 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
3004
3005 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
3006 (b4_user_start_header): Remove.
3007 * data/glr.c: Use new macros instead of b4_*start_header
3008 and b4_*end_header.
3009 * data/glr.cc: Likewise.
3010 * data/lalr1.cc: Likewise.
3011 * data/push.c: Likewise.
3012 * data/yacc.c: Likewise.
3013
3014 * doc/bison.texinfo: Remove %before-header, rename
3015 %{start,end,after}-header to %requires, %provides, %code.
3016
3017 * src/parse-gram.y: Likewise (also rename token names accordingly).
3018 * src/scan-gram.l: Likewise.
3019 * tests/actions.at: Likewise.
3020
30212006-10-14 Paul Eggert <eggert@cs.ucla.edu>
3022
3023 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
3024 Problem reported by Joel E. Denny.
3025
30262006-10-14 Jim Meyering <jim@meyering.net>
3027
3028 (Sync from coreutils.)
3029 Work also when the working directory (with e.g. coreutils sources)
3030 is version controlled with git, rather than CVS.
3031 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
3032 rather than CVS.
3033 In messages and comments, say e.g., "checked-out sources",
3034 rather than "CVS sources".
3035 (version_controlled_file): New function. Work for git as well as
3036 for CVS. Don't use grep's -q option.
3037 (slurp): Call it here, in place of CVS-specific code.
3038
30392006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
3040
3041 Fix testsuite for ./configure --enable-gcc-warnings:
3042 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
3043 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
3044 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
3045 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
3046 * test/regression.at (Diagnostic that expects two alternatives):
3047 Likewise.
3048
30492006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3050
3051 * bootstrap.conf (gnulib_modules): Add config-h.
3052 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
3053 worry about HAVE_CONFIG_H.
3054 * lib/abitset.c: Likewise.
3055 * lib/bitset.c: Likewise.
3056 * lib/bitset_stats.c: Likewise.
3057 * lib/bitsetv-print.c: Likewise.
3058 * lib/bitsetv.c: Likewise.
3059 * lib/ebitset.c: Likewise.
3060 * lib/get-errno.c: Likewise.
3061 * lib/lbitset.c: Likewise.
3062 * lib/subpipe.c: Likewise.
3063 * lib/timevar.c: Likewise.
3064 * lib/vbitset.c: Likewise.
3065 * lib/bitset.c: Include "bitset.h" first, to test interface.
3066 * lib/bitset_stats.c: Include "bitset_stats.h" first.
3067 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
3068 * lib/bitsetv.c: Include "bitsetv.h" first.
3069 * lib/get-errno.c: Include "get-errno.h" first.
3070 * m4/.cvsignore: Add config-h.m4.
3071 * tests/actions.at (Default %printer and %destructor for ...):
3072 Adjust expected line numbers in output to reflect removal of #if
3073 HAVE_CONFIG_H lines.
3074 * tests/glr-regression.at (Missed %merge type warnings when ...):
3075 Likewise.
3076 * tests/regression.at (Braced code in declaration in rules section):
3077 Likewise.
3078 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
3079 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
3080 Include <config.h> unconditionally.
3081
3082 * bootstrap: Sync from coreutils, as follows:
3083
3084 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3085
3086 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
3087 variable was sometimes used without being initialized. This
3088 messed up the installation of the INSTALL file in some cases.
3089
3090 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3091
3092 * bootstrap (usage, main program, symlink_to_gnulib): Add option
3093 --copy. Inspired by a suggestion from Bruno Haible.
3094
3095 2006-10-03 Jim Meyering <jim@meyering.net>
3096
3097 * bootstrap: Undo last change to this file, since now gnulib-tool
3098 sticks with the automake default in generating dependencies.
3099
31002006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3101
3102 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
3103 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
3104
3105 * doc/bison.1: Add copyright notice.
3106
3107 * data/glr.c: Don't include <stdarg.h>; not used.
3108
3109 * NEWS: The -g and --graph options now output graphs in Graphviz
3110 DOT format, not VCG format.
3111 * doc/bison.1: Likewise.
3112 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
3113 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
3114 of this change in
3115 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
3116 * TODO: Remove Graphviz entry.
3117 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
3118 remove vcg.c, vcg.h, vcg_defaults.h.
3119 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
3120 * src/graphviz.c, src/graphviz.h: New files.
3121 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
3122 * src/files.h: Make comment more generic.
3123 * src/main.c (main): Likewise.
3124 * src/print_graph.h: Likewise.
3125 * src/getargs.c (usage): Make usage description more generic.
3126 * src/print_graph.c: Include graphviz.h rather than vcg.h.
3127 (static_graph, fgraph): Remove. All uses changed to pass
3128 arguments instead of sharing a static var.
3129 (print_core, print_actions, print_state, print_graph):
3130 Output graphviz format rather than VCG format.
3131 * tests/.cvsignore: Remove *.vcg; add *.dot.
3132 * tests/output.at: Expect *.dot files, not *.vcg files.
3133
3134 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
3135 accommodates the 2006-10-08 change.
3136
31372006-10-11 Bob Rossi <bob@brasko.net>
3138
3139 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
3140 (b4_yyssa, b4_yyerror_range): New macros.
3141 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
3142 (yypvarsinit): Remove init of removed fields.
3143 (yypushparse): Remove use of removed fields; use new macros instead.
3144
31452006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3146
3147 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
3148 in a push parser. Reindent slightly to match yacc.c better.
3149
31502006-10-11 Bob Rossi <bob@brasko.net>
3151
3152 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
3153 yymsg_alloc fields.
3154 (yypvarsinit, yypushparse): Remove init of removed fields.
3155 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
3156
31572006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3158
3159 * THANKS: Add Paolo Bonzini and Bob Rossi.
3160
31612006-10-08 Paolo Bonzini <bonzini@gnu.org>
3162
3163 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
3164 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
3165 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
3166 b4_define_user_cde and uses): Remove.
3167 (b4_comment, b4_prefix, b4_sync_start): New.
3168 * data/bison.m4: New file, with most of the content removed from c.m4.
3169 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
3170 * src/output.c (output_skeleton): Pass bison.m4.
3171 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
3172 only if specified.
3173
31742006-10-05 Paul Eggert <eggert@cs.ucla.edu>
3175
3176 Fix test failure reported by Tom Lane in
3177 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
3178 and try to make such failures easier to catch in the future.
3179 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
3180 that's now the caller's responsibility.
3181 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
3182 Set yychar = YYEOF if it's negative.
3183 * tests/actions.at (yylex): Abort if asked to read past EOF.
3184 * tests/conflicts.at (yylex): Likewise.
3185 * tests/cxx-type.at (yylex): Likewise.
3186 * tests/glr-regression.at (yylex): Likewise.
3187 * tests/input.at (yylex): Likewise.
3188 * tests/regression.at (yylex): Likewise.
3189 * tests/torture.at (yylex): Likewise.
3190
31912006-10-01 Paul Eggert <eggert@cs.ucla.edu>
3192
3193 Fix problems with translating English-language diagnostics.
3194 * bootstrap: Fix bug introduced in recent bootstrap changes, with
3195 respect to bison-runtime pot generation. The YY_ stuff
3196 wasn't being captured.
3197 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
3198 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
3199 * runtime-po/POTFILES.in: Add data/push.c.
3200
32012006-09-29 Paul Eggert <eggert@cs.ucla.edu>
3202
3203 Merge bootstrap changes from coreutils.
3204
3205 2006-09-28 Jim Meyering <jim@meyering.net>
3206
3207 Automatically generated dependencies are important even
3208 when all of the sources in a directory come from gnulib.
3209 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
3210 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
3211
3212 2006-09-23 Jim Meyering <jim@meyering.net>
3213
3214 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
3215
3216 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3217
3218 * bootstrap: Add support for --force.
3219 (usage): New function. Describe usage less tersely.
3220 (CVS_only_file): New var.
3221
32222006-09-21 Paul Eggert <eggert@cs.ucla.edu>
3223
3224 * data/push.c (YYPUSH_MORE): Make it an enum instead.
3225 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
3226 Adjust white space and comments to match GNU style better.
3227
32282006-09-20 Bob Rossi <bob@brasko.net>
3229
3230 * data/push.c (yyresult_get): Remove function.
3231 (YYPUSH_MORE): Add #define.
3232 (yypushparse): Modify return value.
3233
32342006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3235
3236 * stamp-h.in: Remove; no longer needed.
3237 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
3238 Remove config.h, config.hin, intl (no longer created).
3239 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
3240 stamp-h1.
3241
3242 Sync bootstrap from coreutils, as follows:
3243
3244 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
3245
3246 * bootstrap (symlink_to_gnulib): New function.
3247 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
3248 to copies-of-gnulib.
3249 (cp_mark_as_generated, slurp, gnulib_files):
3250 Avoid making a copy if it's the same as the old version.
3251 (gnulib_files): Add support for this variable (used by Bison).
3252
32532006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3254
3255 * src/getargs.c (usage): Rework to use conventions similar to
3256 coreutils, to make translation a bit easier and the code a bit
3257 smaller. Problem reported by Tim Van Holder.
3258
32592006-09-15 Paul Eggert <eggert@cs.ucla.edu>
3260
3261 Use some of gnulib's new modules, taken from coreutils.
3262
3263 * bootstrap: Sync from coreutils, except add support for gnulib_files.
3264 * bootstrap.conf: New file.
3265 (gnulib_modules): Add configmake, inttypes, unistd.
3266 (XGETTEXT_OPTIONS): Add complain, complain_at,
3267 fatal, fatal_at, warn, warn_at, unexpected_end.
3268 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
3269 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
3270 (gl_EARLY): Add.
3271 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
3272 (gl_INIT): Add
3273 (GNULIB_AUTOCONF_SNIPPET): Remove.
3274 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
3275 the pickiest.
3276 * lib/.cvsignore: Add inttypes_.h.
3277 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
3278 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
3279 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
3280 no-longer-necessary initializations.
3281 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
3282 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
3283 use the unistd module.
3284 * src/system.h: Likewise.
3285 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
3286 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
3287 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
3288 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
3289 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
3290 * src/system.h: Include inttypes.h unconditionally, now that we
3291 use the inttypes module. Don't bother to include stdint.h, since
3292 inttypes.h now does that for us.
3293 (LOCALEDIR): Remove, now that we use the configmake module.
3294 * src/getargs.c: Include configmake.h.
3295 * src/main.c: Likewise.
3296 * src/output.c: Likewise.
3297 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
3298 not from $abs_top_builddir, since config.h moved.
3299
3300
3301 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
3302 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
3303
3304 * src/parse-gram.y (symbol_declaration): Don't put statements
3305 before declarations; it's not portable to C89.
3306 * src/scan-code.l (handle_action_at): Likewise.
3307
3308 * src/scan-code.l: Always initialize braces_level; the old code
3309 left it uninitialized and therefore had undefined behavior.
3310
3311 Don't attempt to redefine 'assert', since it runs afoul of
3312 systems where standard headers (mistakenly) include <assert.h>.
3313 Instead, define and use our own alternative, called 'aver'.
3314 * src/reader.c: Don't include assert.h, since we no longer
3315 use assert.
3316 * src/scan-code.l: Likewise.
3317 * src/system.h (assert): Remove, replacing with....
3318 (aver): New function, taking a bool arg. All uses changed.
3319 * src/tables.c (pack_vector): Ensure that aver arg is bool,
3320 not merely an integer.
3321
33222006-09-15 Bob Rossi <bob@brasko.net>
3323
3324 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
3325 * data/c.m4 (YYPUSH): New.
3326 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
3327 * src/getargs.c (push_parser): New var.
3328 * src/getargs.h (push_parser): New declaration.
3329 * src/output.c (prepare): Add macro insertion of `push_flag'.
3330 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
3331 (prologue_declaration): Parse %push-parser.
3332 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
3333 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
3334 list of removed lines from the traces observed.
3335 (AT_CHECK_CALC_LALR): Added push parser tests.
3336
33372006-09-13 Paul Eggert <eggert@cs.ucla.edu>
3338
3339 * NEWS: Version 2.3a.
3340 * configure.ac (AC_INIT): Likewise.
3341
3342 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
3343 "#define YYSTYPE int" that caused "make maintainer-check" to fail
3344 due to header ordering dependencies. I don't know why the #define
3345 was there.
3346
3347 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
3348 runtime cost when YYDEBUG is not defined, and so that some tests
3349 that used to fail now work. Problem and initial suggestion by
3350 Paolo Bonzini.
3351 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
3352 * data/glr.cc (b4_parser_class_name):
3353 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
3354 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
3355 (yydebug_) [YYDEBUG]: New member.
3356 (yycdebug_): Now defined only if YYDEBUG.
3357 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
3358 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
3359 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
3360 if YYYDEBUG.
3361 (debug_stream, set_debug_stream, debug_level, set_debug_level):
3362 Define only if YYDEBUG.
3363 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
3364 set_debug_level.
3365 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
3366 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
3367 AT_CHECK_CALC_GLR_CC that are working now.
3368
33692006-09-12 Paul Eggert <eggert@cs.ucla.edu>
3370
3371 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
3372 We don't need them in glr.cc, and glr.c defines them.
3373 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
3374 assumes that defining it to anything is the same as defining
3375 it to 1. Problem reported by Paolo Bonzini.
3376
33772006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
3378
3379 * data/c.m4 (b4_null, b4_case): Define.
3380 * src/output.c (prepare_symbols): Use b4_null.
3381 (user_actions_output): Use b4_case.
3382
33832006-09-11 Paul Eggert <eggert@cs.ucla.edu>
3384
3385 * data/glr.c (b4_shared_declarations): Put start-header first,
3386 before any #includes that we generate, so that feature-test
3387 macros work. Problem reported by Michael Deutschmann in
3388 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
3389 * data/lalr1.cc: Likewise.
3390 * doc/bison.texinfo (Prologue): Document that feature-test macros
3391 should be defined before any Bison declarations.
3392 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
3393 that depend on location.hh after, not before, Bison decls, since
3394 we now include location.hh after the first user prologue.
3395
3396 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
3397 Sander Brandenburg in
3398 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
3399 Also, fix minor white space and comment issues.
3400 (Prologue): Mention that it's better to define feature-test macros
3401 before Bison declarations. Problem reported by Michael Deutschmann.
3402
3403 * README-cvs: Fix typo: "&" should be "&&". Problem reported
3404 by Jim Meyering.
3405 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
3406 This adjusts to recent gnulib changes.
3407
34082006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3409
3410 Finish implementation of per-type %destructor/%printer. Discussed
3411 starting at
3412 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
3413 and
3414 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
3415 * NEWS (2.3+): Add a description of this feature to the default
3416 %destructor/%printer description.
3417 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
3418 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3419 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
3420 list node contains a semantic type.
3421 * src/symtab.c, src/symtab.h: Extend with a table that associates
3422 semantic types with their %destructor's and %printer's.
3423 (semantic_type_from_uniqstr, semantic_type_get,
3424 semantic_type_destructor_set, semantic_type_printer_set): New functions
3425 composing the public interface of that table.
3426 (symbol_destructor_get, symbol_destructor_location_get,
3427 symbol_printer_get, symbol_printer_location_get): If there's no
3428 per-symbol %destructor/%printer, look up the per-type before trying
3429 the default.
3430 * tests/actions.at (Per-type %printer and %destructor): New test case.
3431 * tests/input.at (Default %printer and %destructor redeclared):
3432 Extend to check that multiple occurrences of %symbol-default in a
3433 single %destructor/%printer declaration is an error.
3434 (Per-type %printer and %destructor redeclared, Unused values with
3435 per-type %destructor): New test cases.
3436
34372006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3438
3439 Require default %destructor/%printer to be declared using
3440 %symbol-default instead of an empty symbol list, and start working on
3441 new per-type %destructor/%printer. Discussed at
3442 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
3443 * NEWS (2.3+): Add %symbol-default to example.
3444 * bison.texinfo (Freeing Discarded Symbols): Likewise.
3445 (Table of Symbols): Add entry for %symbol-default.
3446 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
3447 (generic_symlist, generic_symlist_item): New nonterminals for creating
3448 a list in which each item is a symbol, semantic type, or
3449 %symbol-default.
3450 (grammar_declaration): Use generic_symlist in %destructor and %printer
3451 declarations instead of symbols.1 or an empty list.
3452 (symbol_declaration, precedence_declaration, symbols.1): Update actions
3453 for changes to symbol_list.
3454 * src/reader.c: Update for changes to symbol_list.
3455 * src/scan-code.l: Likewise.
3456 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
3457 * src/symlist.c, src/symlist.h: Extend such that a list node may
3458 represent a semantic type or a %symbol-default in addition to just an
3459 ordinary symbol. Add switched functions for setting %destructor's and
3460 %printer's.
3461 * tests/actions.at, tests/input.at: Add %symbol-default to all default
3462 %destructor/%printer declarations.
3463
34642006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
3465
3466 Whether the default %destructor/%printer applies to a particular symbol
3467 isn't a question of whether the user *declares* that symbol (in %token,
3468 for example). It's a question of whether the user by any means
3469 *defines* the symbol at all (by simply using a char token, for
3470 example). $end is defined by Bison whereas any other token with token
3471 number 0 is defined by the user. The error token is always defined by
3472 Bison regardless of whether the user declares it with %token, but we
3473 may one day let the user define error as a nonterminal instead.
3474 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
3475 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
3476 the meaning of "user-defined".
3477 * tests/actions.at (Default %printer and %destructor for user-declared
3478 end token): Rename to...
3479 (Default %printer and %destructor for user-defined end token): ...
3480 this.
3481
3482 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
3483 computation of whether to apply the default, don't maintain a list of
3484 every Bison-defined symbol. Instead, just check for a first character
3485 of '$', which a user symbol cannot have, and check for the error token.
3486
34872006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
3488
3489 Don't apply the default %destructor or %printer to the error token,
3490 $undefined, or $accept. This change fits the general rule that the
3491 default %destructor and %printer are only for user-declared symbols,
3492 and it solves several difficulties that are described in the new test
3493 cases listed below.
3494 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
3495 * tests/actions.at (Default %printer and %destructor are not for error
3496 or $undefined, Default %printer and %destructor are not for $accept):
3497 New test cases.
3498
34992006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
3500
3501 Allow %start after the first rule.
3502 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
3503 when parsing the first rule.
3504 (check_and_convert_grammar): Search for it here after all grammar
3505 declarations have been parsed. Skip midrules, which have dummy LHS
3506 nonterminals.
3507 * src/symtab.c (symbol_is_dummy): New function.
3508 * src/symtab.h (symbol_is_dummy): Declare it.
3509 * tests/input.at (%start after first rule): New test.
3510
35112006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3512
3513 Redo some of the previous commit: add back the ability to use
3514 non-aliased/undeclared string literals since it might be useful to
3515 those declaring %token-table.
3516 * src/reader.c (check_and_convert_grammar): Undo changes in previous
3517 commit: don't worry about complaints from symbols_pack.
3518 * src/symtab.c (symbol_new, symbol_class_set,
3519 symbol_check_alias_consistency): Undo changes in previous commit: count
3520 each string literal as a new symbol and token, assign it a symbol
3521 number, and don't complain about non-aliased string literals.
3522 (symbols_pack): Since symbol_make_alias still does not decrement symbol
3523 and token counts but does still set aliased tokens to the same number,
3524 symbol_pack_processor now leaves empty slots in the symbols array.
3525 Remove those slots.
3526 * tests/regression.at (Undeclared string literal): Remove test case
3527 added in previous commit since non-aliased string literals are allowed
3528 again.
3529 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
3530 remove unnecessary string literal declarations.
3531 * tests/sets.at (Firsts): Likewise.
3532
35332006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3534
3535 Don't allow an undeclared string literal, but allow a string literal to
3536 be used before its declaration.
3537 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
3538 symbols_pack complained.
3539 * src/symtab.c (symbol_new): Don't count a string literal as a new
3540 symbol.
3541 (symbol_class_set): Don't count a string literal as a new token, and
3542 don't assign it a symbol number since symbol_make_alias does that.
3543 (symbol_make_alias): It's not necessary to decrement the symbol and
3544 token counts anymore. Don't assume that an alias declaration occurs
3545 before any uses of the identifier or string, and thus don't assert that
3546 one of them has the highest symbol number so far.
3547 (symbol_check_alias_consistency): Complain if there's a string literal
3548 that wasn't declared as an alias.
3549 (symbols_pack): Bail if symbol_check_alias_consistency failed since
3550 symbol_pack asserts that every token has been assigned a symbol number
3551 although undeclared string literals have not.
3552 * tests/regression.at (String alias declared after use, Undeclared
3553 string literal): New test cases.
3554 (Characters Escapes, Web2c Actions): Declare string literals as
3555 aliases.
3556 * tests/sets.at (Firsts): Likewise.
3557
35582006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
3559
3560 In the grammar scanner, STRING_FINISH unclosed constructs and return
3561 them to the parser in order to improve error messages.
3562 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
3563 SC_BRACED_CODE, SC_PROLOGUE): Implement.
3564 * tests/input.at (Unclosed constructs): New test case.
3565 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
3566 seen.
3567
3568 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
3569 unused global.
3570
35712006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
3572
3573 Handle string aliases for character tokens correctly.
3574 * src/symtab.c (symbol_user_token_number_set): If the token has an
3575 alias, check and set its alias's user token number instead of its own,
3576 which is set to indicate the alias. Previously, every occurrence of
3577 the character token in the grammar overwrote that alias indicator with
3578 the character code.
3579 * tests/input.at (String aliases for character tokens): New test.
3580
35812006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
3582
3583 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
3584
35852006-08-11 Paul Eggert <eggert@cs.ucla.edu>
3586
3587 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
3588 to prevent failures when building on older platforms.
3589 Check for autopoint failure.
3590 Set XGETTEXT_OPTIONS to values that check for C format strings,
3591 so that translators are warned about them (this also helps
3592 prevent core dumps).
3593
3594 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
3595 function, since it simplifies our code a bit.
3596
3597 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
3598 rather than -W, so we don't get bogus warnings about sign comparisons.
3599 Add -Wpointer-arith, since that warning is useful (it reports code
3600 that does not conform to C89 and that some compilers reject).
3601 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
3602 since it's no longer needed.
3603
36042006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
3605
3606 Clean up scanners a bit.
3607 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
3608 definitions so gcc won't warn when obstack_for_string is unused.
3609 * src/scan-code.l: config.h and system.h are already #include'd by
3610 scan-code-c.c, so get rid of them here.
3611 * src/scan-gram.l: Likewise.
3612 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
3613 definitions rather than duplicating the rest of it.
3614 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
3615
36162006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
3617
3618 Suppress signed/unsigned comparison warnings for yycheck.
3619 * data/c.m4 (b4_safest_int_type): New macro.
3620 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
3621 a signed int type, cast it to b4_safest_int_type first.
3622 * data/yacc.c: Likewise.
3623 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
3624 also overwritten.
3625
36262006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3627
3628 * doc/bison.texinfo: Fix some typos.
3629
36302006-08-02 Paul Eggert <eggert@cs.ucla.edu>
3631
3632 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
3633 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
3634
3635 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
3636 the latest gnulib does this a different way.
3637 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
3638 translation was patched, so stop omitting it.
3639
36402006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3641
3642 Enable declaration of default %printer/%destructor. Make the parser
3643 use these for all user-declared grammar symbols for which the user does
3644 not declare a specific %printer/%destructor. Thus, the parser uses it
3645 for token 0 if the user declares it but not if Bison generates it as
3646 $end. Discussed starting at
3647 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
3648 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
3649 and
3650 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
3651 * NEWS (2.3+): Mention.
3652 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
3653 declare a %destructor for a mid-rule's semantic value. It's just
3654 impossible to declare one specific to it.
3655 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
3656 code. Describe default %destructor form.
3657 * src/parse-gram.y (grammar_declaration): Parse default
3658 %printer/%destructor declarations.
3659 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
3660 and symbol_destructor_location_get rather than accessing the destructor
3661 and destructor_location members of struct symbol.
3662 (symbol_printers_output): Likewise but for %printer's.
3663 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
3664 again.
3665 * src/symtab.c (default_destructor, default_destructor_location,
3666 default_printer, default_printer_location): New static global
3667 variables to record the default %destructor and %printer.
3668 (symbol_destructor_get, symbol_destructor_location_get,
3669 symbol_printer_get, symbol_printer_location_get): New functions to
3670 compute the appropriate %destructor and %printer for a symbol.
3671 (default_destructor_set, default_printer_set): New functions to set the
3672 default %destructor and %printer.
3673 * src/symtab.h: Prototype all those new functions.
3674 * tests/actions.at (Default %printer and %destructor): New test to
3675 check that the right %printer and %destructor are called, that they're
3676 not called for $end, and that $$ and @$ work correctly.
3677 (Default %printer and %destructor for user-declared end token): New
3678 test to check that the default %printer and %destructor are called for
3679 a user-declared end token.
3680 * tests/input.at (Default %printer and %destructor redeclared, Unused
3681 values with default %destructor): New tests to check related grammar
3682 warnings and errors.
3683
36842006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3685
3686 Clean up handling of %destructor for the end token (token 0).
3687 Discussed starting at
3688 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
3689 and
3690 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
3691
3692 Make the skeletons consistent in how they pop the end token and invoke
3693 its %destructor.
3694 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
3695 state, which has token number 0, since this would invoke the
3696 %destructor for the end token.
3697 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
3698 until after shifting the end token, or else it won't be popped.
3699 * data/yacc.c (yyparse): Likewise.
3700
3701 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
3702 it's the end token. Upon termination, destroy an unshifted lookahead
3703 even when it's the end token.
3704 * data/lalr1.cc (yy::parser::parse): Likewise.
3705 * data/yacc.c (yyparse): Likewise.
3706
3707 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
3708 value warnings for the end token when the user gives the end token a
3709 %destructor.
3710
3711 * tests/actions.at (Printers and Destructors): Test all the above.
3712
37132006-07-24 Paul Eggert <eggert@cs.ucla.edu>
3714
3715 Update to latest gnulib and gettext versions.
3716 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
3717 Add fopen-safer.
3718 (gnulib_files): Add m4/warning.m4. Don't worry about files
3719 overwritten by autopoint.
3720 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
3721 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
3722 rejects them.
3723 Don't use autoreconf; instead, invoke autopoint etc. by hand,
3724 so that we can remove the intl files at a better time.
3725 (intl_files_to_remove): Remove aclocal.m4, since it gets
3726 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
3727 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
3728 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
3729 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
3730 Remove datarootdir hack; no longer needed.
3731 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
3732 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
3733 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
3734 strdup.h.
3735 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
3736 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
3737
37382006-07-20 Paul Eggert <eggert@cs.ucla.edu>
3739
3740 * bootstrap: Adjust to today's change to gnulib-tool by invoking
3741 it with --assume-autoconf='latest-stable'.
3742
37432006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
3744
3745 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
3746 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
3747 YYSTYPE' and `{'.
3748 * src/muscle_tab.h (muscle_grow): Replace the header comments with
3749 those from muscle_tab.c since the old ones are misleading.
3750
37512006-07-13 Akim Demaille <akim@epita.fr>
3752
3753 Support %define "KEY" {VALUE}.
3754 * src/scan-code.h, src/scan-code.l (translate_action)
3755 (translate_rule_action, translate_symbol_action, translate_code):
3756 Return char *, not const char *.
3757 * src/parse-gram.y (declaration): Rename as...
3758 (prologue_declaration): this.
3759 (string_content): Remove this nonterminal, use STRING.
3760 (braceless, content, content.opt): New nonterminal.
3761 Use them.
3762 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
3763 as value.
3764 * src/scan-gram.l (getargs.h): Don't include it.
3765
37662006-07-12 Paul Eggert <eggert@cs.ucla.edu>
3767
3768 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
3769 rather than a for-loop that declares a local bool variable. This
3770 should work around a compatibility problem with a Cray x1e C++
3771 compiler reported by Hung Nguyen in
3772 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
3773 The for-loop was introduced in the 2004-11-17 change but I don't
3774 know why it was needed.
3775
37762006-07-12 Akim Demaille <akim@epita.fr>
3777
3778 * data/c.m4: Comment changes.
3779
37802006-07-10 Akim Demaille <akim@lrde.epita.fr>
3781
3782 * src/complain.c (error_message, ERROR_MESSAGE): New.
3783 To factor...
3784 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
3785 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
3786
37872006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3788
3789 * NEWS: Instead of %union, you can define and use your own union type
3790 YYSTYPE if your grammar contains at least one <type> tag.
3791 Your YYSTYPE need not be a macro; it can be a typedef.
3792 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
3793 (Union Decl, Decl Summary): Document this.
3794 * data/glr.c (YYSTYPE): Implement this.
3795 * data/glr.cc (YYSTYPE): Likewise.
3796 * data/lalr1.cc (YYSTYPE): Likewise.
3797 * data/yacc.c (YYSTYPE): Likewise.
3798 * src/output.c (prepare): Output tag_seen_flag.
3799 * src/parse-gram.y (declaration, grammar_declaration):
3800 Use 'union_seen' rather than 'typed' to determine whether
3801 %union has been seen, since grammars can now be typed without
3802 %union.
3803 (symbol_declaration, type.opt, symbol_def):
3804 Keep track of whether a tag has been seen.
3805 * src/reader.c (union_seen, tag_seen): New vars.
3806 (typed): remove.
3807 * src/reader.h (union_seen, tag_seen, typed): Likewise.
3808 * src/scan-code.l (untyped_var_seen): New variable.
3809 (handle_action_dollar): Adjust to above changes.
3810 (handle_action_dollar, handle_action_at):
3811 Improve overflow checking for outlandish numbers.
3812 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
3813 avoid new diagnostics generated by above changes.
3814 * tests/regression.at (YYSTYPE typedef): Add test to check
3815 for type tags without %union.
3816
3817 * src/symlist.c (symbol_list_length): Return int, not unsigned
3818 int, since callers expect int. This may need to get revisited
3819 once we have proper integer overflow checking.
3820
3821 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
3822 object is now static.
3823
3824 * src/getargs.c (flags_argmatch): Return void, not int,
3825 to pacify ./configure --enable-gcc-warnings.
3826
3827 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
3828 since last_string is already defined to FLEX_PREFIX (last_string).
3829
38302006-07-09 Akim Demaille <akim@lrde.epita.fr>
3831
3832 Implement --warnings/-W.
3833 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
3834 replaced by...
3835 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
3836 Adjust callers.
3837 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
3838 (warnings_args, warnings_types): New.
3839 (getargs, short_options, long_options): Accept -W/--warnings.
3840 Sort the options by alphabetical order, upper case letter right
3841 before its lower case.
3842
38432006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3844
3845 Change %merge result type clash warnings to errors. Discussed at
3846 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
3847 * src/reader.c (record_merge_function_type): Use complain_at.
3848 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3849 declared later): Update test case results.
3850
38512006-07-09 Akim Demaille <akim@lrde.epita.fr>
3852
3853 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
3854 to be in alphabetical order.
3855 (trace_args): Spelling fixes.
3856
38572006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3858
3859 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
3860 so they don't collide with user-defined macros.
3861 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
3862 this was never guaranteed, and now that we're using gnulib stdint,
3863 which defines int_fast16_t to long int, the problem is exposed.
3864
38652006-07-08 Paul Eggert <eggert@cs.ucla.edu>
3866
3867 * data/c.m4 (b4_basename): Simplify a bit, since we don't
3868 need the full POSIX semantics (and weren't implementing them
3869 anyway).
3870
3871 Adjust to Autoconf 2.60 and today's gnulib.
3872 * bootstrap (gnulib_modules): Add stdint.
3873 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
3874 no longer copies it.
3875 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
3876 since stdint needs the former and wcwidth (which is now required
3877 by mbswidth) needs the latter.
3878 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
3879 work around a compatibility glitch between gettext 0.14.6 and
3880 Autoconf 2.60.
3881 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
3882 Do not check for uintptr_t, since new stdint module does the right
3883 thing.
3884 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
3885 Add stdint.h, stdint_.h, wcwidth.h.
3886 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
3887 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
3888 stdint.m4, wchar_t.m4, wcwidth.m4.
3889 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
3890 usual order for ../lib/*.h files.
3891 (file_name_split): Use last_component, not base_name, to adjust
3892 to gnulib changes.
3893 * src/parse-gram.h: Include <strverscmp.h> in the usual order
3894 for ../lib/*.h files.
3895 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
3896 Define unconditionally, since we now assume the stdint module.
3897 * src/scan-skel.l: Include <dirname.h>.
3898 (BASE_QPUTS): Use last_component, not base_name.
3899 * src/system.h: Include <unlocked-io.h> in the usual order
3900 for ../lib/*.h files. Include <stdint.h> unconditionally,
3901 since we now use the stdint module.
3902 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
3903 HAVE_UINTPTR_T, since we now use the stdint module.
3904 (base_name): Remove decl, since files now include <dirname.h>
3905 to get the decl.
3906
39072006-07-08 Akim Demaille <akim@lrde.epita.fr>
3908
3909 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
3910 New, default to 1.
3911 * data/yacc.c, data/glr.c, data/location.cc: Use them.
3912 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
3913 default.
3914 * tests/calc.at: Adjust.
3915
39162006-07-08 Akim Demaille <akim@lrde.epita.fr>
3917
3918 * data/c.m4 (b4_basename): New.
3919 (b4_syncline): Also output the location of its invocation (from
3920 the skeleton).
3921 (b4_user_action, b4_define_user_action, b4_user_actions)
3922 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
3923 (b4_user_stype): New.
3924 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
3925
39262006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3927
3928 In the grammar file, the first column is 1 not 0 on the first line as
3929 on every other line.
3930 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
3931 * tests/input.at (Torturing the Scanner): Update output.
3932
3933 * src/scan-gram.l (scanner_cursor): Declare it static.
3934
39352006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3936
3937 In warnings, say "previous declaration" rather than "first
3938 declaration".
3939 * src/symtab.c (redeclaration): Do that here.
3940 * src/reader.c (record_merge_function_type): In the case of a result
3941 type clash, report the previous declaration rather than the very first
3942 one in the grammar file.
3943 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3944 declared later): Add a third declaration to check this behavior.
3945 * tests/input.at (Incompatible Aliases): Update output.
3946
39472006-06-27 Akim Demaille <akim@epita.fr>
3948
3949 * doc/Doxyfile.in: New.
3950 * doc/Makefile.am: Use it.
3951 * src/lalr.h, src/symtab.h: Initial doxygenation.
3952
39532006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3954
3955 Don't miss %merge result type warnings just because the LHS types are
3956 declared after the %merge. This continues the effort of the previous
3957 patch.
3958 * src/reader.c (get_merge_function): Don't set the merger type yet.
3959 (record_merge_function_type): New function for setting the merger type
3960 and checking for clashes.
3961 (grammar_current_rule_merge_set): Set the location of the %merge for
3962 the current rule.
3963 (packgram): Invoke record_merge_function_type for each rule now that
3964 all symbol type declarations have been parsed.
3965 * src/reader.h (merger_list.type_declaration_location): New member
3966 storing the location of the first %merge from which the type for this
3967 merging function was derived.
3968 * src/symlist.h (symbol_list.merger_declaration_location): New member
3969 storing the location of a rule's %merge, if any.
3970 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3971 declared later): New test to catch the error fixed by the above patch.
3972
39732006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3974
3975 Get action warnings (grammar_rule_check) right even when symbol
3976 declarations appear after the rules. Discussed at
3977 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
3978 and
3979 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
3980 Don't mistake the type of $$ in a midrule to be that of its parent
3981 rule's $$.
3982 * src/reader.c (grammar_current_rule_end): Don't invoke
3983 grammar_rule_check yet since not all symbol declarations may have been
3984 parsed yet.
3985 (grammar_midrule_action): Likewise.
3986 Don't record whether the midrule's $$ has been used yet since actions
3987 haven't been translated yet.
3988 Record the midrule's parent rule and its RHS index within the parent
3989 rule.
3990 (grammar_current_rule_action_append): Don't translate the action yet
3991 since not all symbol declarations may have been parsed yet and, thus,
3992 warnings about types for $$, $n, @$, and @n can't be reported yet.
3993 (packgram): Translate the action and invoke grammar_rule_check now that
3994 all symbol declarations have been parsed.
3995 * src/scan-code.l (handle_action_dollar): Now that this is invoked
3996 after parsing the entire grammar file, the symbol list here in the case
3997 of a midrule is actually the midrule's empty RHS, so reference its
3998 parent rule's RHS where necessary.
3999 On the other hand, now that you can already know it's a midrule, you
4000 aren't forced to think $$ has the same type as its parent rule's $$.
4001 (handle_action_at): In the case of a midrule, reference the parent rule
4002 where necessary.
4003 * src/symlist.c (symbol_list_new): Initialize new midrule-related
4004 members.
4005 (symbol_list_length): Now that this is invoked after all rules have
4006 been parsed, a NULL symbol (rather than a NULL symbol list node)
4007 terminates a rule. symbol_list_print already does this correctly.
4008 * src/symlist.h (symbol_list.midrule_parent_rule,
4009 symbol_list.midrule_parent_rhs_index): New members so that midrules can
4010 remember their relationships with their parents.
4011 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
4012 fixed by the above patch.
4013 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
4014 implementing...
4015 (Unused values): ... this old test case and...
4016 (Unused values before symbol declarations): ... this new test case.
4017 This one is the same as `Unused values' except that all symbol
4018 declarations appear after the rules in order to catch the rest of the
4019 errors fixed by the above patch.
4020
40212006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4022
4023 More cleanup.
4024 * src/reader.c (current_rule): Declare it static since it's no longer
4025 used outside this file.
4026 (grammar_current_rule_action_append): Remove redundant arguments from
4027 translate_rule_action invocation.
4028 * src/reader.h (current_rule): Remove this unused extern.
4029 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
4030 * src/scan-code.l (translate_rule_action): Likewise.
4031
40322006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
4033
4034 Clean up yesterday's patch.
4035 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
4036 to...
4037 * src/reader.c (grammar_current_rule_action_append): ... here for
4038 consistency with grammar_current_rule_symbol_append.
4039 * tests/regression.at (Braced code in declaration in rules section):
4040 Make yyerror and yylex static as usual.
4041
40422006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
4043
4044 Fix bug that mistakes braced code in a declaration in the rules section
4045 to be a rule action. Mentioned at
4046 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
4047 * src/scan-gram.l: Move midrule action detection from the start of the
4048 scanning of any braced code to...
4049 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
4050 action. For readability, use $2 and @2 rather than the equivalent
4051 global variables.
4052 * tests/regression.at (Braced code in declaration in rules section):
4053 New test to catch the error fixed by the above patch.
4054
4055 Work on code readability some.
4056 * src/scan-code.l (current_rule): Get rid of this misleading and
4057 redundant declaration: it's actually extern'ed in reader.h.
4058 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
4059 translate_action): Add a rule argument and use it instead of the global
4060 current_rule.
4061 (translate_rule_action): This already receives current_rule through an
4062 argument, so pass it on to translate_action instead of assigning
4063 current_rule to current_rule.
4064 (translate_symbol_action, translate_code): Pass rule = NULL to
4065 translate_action.
4066
40672006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
4068
4069 Rename %before-definitions to %start-header and %after-definitions to
4070 %end-header. Don't use these declarations to separate pre-prologue
4071 blocks from post-prologue blocks. Add new order-independent
4072 declarations %before-header and %after-header as alternatives to the
4073 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
4074 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
4075 * NEWS (2.3+): Update for these changes.
4076 * data/glr.c (b4_before_definitions): Update to...
4077 (b4_start_header): ... this.
4078 (b4_after_definitions): Update to...
4079 (b4_end_header): ... this.
4080 * data/glr.cc: Likewise.
4081 * data/lalr1.cc: Likewise.
4082 * data/yacc.c: Likewise.
4083 * doc/bison.texinfo (The prologue): Update names, and replace remaining
4084 prologue blocks with %*-header declarations.
4085 (Calc++ Parser): Likewise.
4086 (Decl Summary): Update names.
4087 (Table of Symbols): Update description.
4088 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
4089 (PERCENT_END_HEADER): ... this.
4090 (PERCENT_BEFORE_DEFINITIONS): Update to...
4091 (PERCENT_START_HEADER): ... this.
4092 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4093 (declaration): Update token names and m4 macro names.
4094 When parsing %end-header and %start-header, invoke translate_code
4095 before muscle_code_grow, and no longer set global booleans to remember
4096 whether these declarations have been seen.
4097 Parse new %after-header and %before-header.
4098 * src/reader.c (before_definitions, after_definitions): Remove.
4099 (prologue_augment): Accept a new bool argument to specify whether to
4100 augment the pre-prologue or post-prologue.
4101 * src/reader.h (before_definitions, after_definitions): Remove these
4102 extern's.
4103 (prologue_augment): Add new bool argument.
4104 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
4105 (PERCENT_END_HEADER): ... this.
4106 (PERCENT_BEFORE_DEFINITIONS): Update to...
4107 (PERCENT_START_HEADER): ... this.
4108 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4109 * tests/actions.at (Printers and Destructors): Update names.
4110
41112006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
4112
4113 Add comparison operators for C++ location classes. Discussed at
4114 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
4115 * data/c++.m4 (b4_define_location_comparison): New boolean %define
4116 declaration indicating whether filename_type has an operator==. If
4117 filename_type is `std::string', it defaults to `1', `0' otherwise.
4118 * data/location.cc: Iff b4_define_location_comparison is `1', add
4119 operator== and operator!= for class position and for class location.
4120
4121 Some minor fixes.
4122 * src/scan-action.l: Remove unused file.
4123 * src/symtab.c (symbol_printer_set): Use printer_location not
4124 destructor_location.
4125 * src/symtab.h (struct symbol): Replace incorrect source comment for
4126 printer members.
4127 * tests/input.at (Incompatible Aliases): Update output with correct
4128 printer location.
4129
41302006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
4131
4132 Don't put the pre-prologue in the header file. For the yacc.c code
4133 file and the glr.c header and code files, move the pre-prologue before
4134 the token definitions. Add new %before-definitions and
4135 %after-definitions to declare code that will go in both the header file
4136 and code file. Discussed at
4137 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
4138 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
4139 and
4140 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
4141 * NEWS (2.3+): Describe these changes.
4142 * data/glr.c (b4_pre_prologue): Move from within to before...
4143 (b4_shared_declarations): ... this.
4144 Add new b4_before_definitions before b4_token_enums.
4145 Add new b4_after_definitions at the end.
4146 * data/glr.cc (b4_pre_prologue): Replace with...
4147 (b4_before_definitions): ... this in the header file.
4148 (b4_after_definitions): New near the end of the header file.
4149 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
4150 code file right before including the header file.
4151 (b4_before_definitions): New in the previous position of
4152 b4_pre_prologue in the header file.
4153 (b4_after_definitions): New near the end of the header file.
4154 * data/yacc.c: Clean up some m4 quoting especially in the header file.
4155 (b4_token_enums_defines): In the code file, move to right before
4156 YYSTYPE for consistency with the header file.
4157 (b4_before_definitions): New right before b4_token_enums_defines in
4158 both the header and code file.
4159 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
4160 header and code file.
4161 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
4162 of prologues for %union dependencies.
4163 (Decl Summary): In %defines description, mention the effect of
4164 %before-definitions and %after-definitions on the header file.
4165 (Calc++ Parser): Forward declare driver in a %before-definitions rather
4166 than in the pre-prologue so that make check succeeds.
4167 (Table of Symbols): Add entries for %before-definitions and
4168 %after-definitions.
4169 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
4170 %before-definitions.
4171 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
4172 (declaration): Parse those declarations and append to
4173 b4_before_definitions and b4_after_definitions, respectively.
4174 * src/reader.c (before_definitions, after_definitions): New bools to
4175 track whether those declarations have been seen.
4176 (prologue_augment): Add to the post-prologue if %union,
4177 %before-definitions, or %after-definitions has been seen.
4178 * src/reader.h (before_definitions, after_definitions): New extern's.
4179 * src/scan-gram.l: Scan the new declarations.
4180 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
4181 prologue block in a %before-definitions or a %after-definitions based
4182 on whether the %union is declared.
4183 * tests/regression.at (Early token definitions with --yacc, Early token
4184 definitions without --yacc): Move tests for token definitions into the
4185 post-prologue since token names are no longer defined in the
4186 pre-prologue.
4187
41882006-06-20 Akim Demaille <akim@epita.fr>
4189
4190 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
4191 (symbol_get): Use it.
4192 * src/parse-gram.y: Use it.
4193
41942006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
4195
4196 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
4197 build succeeds when configured with --enable-gcc-warnings.
4198
41992006-06-19 Paul Eggert <eggert@cs.ucla.edu>
4200
4201 * src/parse-gram.y (char_name): New function.
4202 (CHAR, STRING, string_content): For %printer, properly escape.
4203 (ID): Prefer fputs to fprintf.
4204 (id): Reindent to be consistent with other rules.
4205 Properly quote char.
4206
4207 The Translation Project changed its way of publishing translations
4208 to maintainers. I haven't received any responses to my request
4209 for supporting the old way, or for documenting the new way. I
4210 have modified 'bootstrap' to use screen scraping
4211 (in this case, HTML scraping). This is unreliable and inelegant,
4212 but I don't see any better way. Yuck.
4213 * bootstrap (TP_URL, WGET_COMMAND): New vars.
4214 (get_translations): New function, which uses HTML scraping to
4215 deduce locations of latest translations.
4216 Use this function to grab both bison and bison-runtime .po files.
4217 Don't bother priming the pump for the runtime-po domain any more,
4218 as it's now translated better than bison is.
4219
42202006-06-19 Akim Demaille <akim@epita.fr>
4221
4222 * src/scan-gram.l: No longer "parse" things after `%union' until
4223 `{'. Rather, return a single "%union" token.
4224 No longer make symbols: return strings, and leave the conversion
4225 to symbols to the parser.
4226 (SC_PRE_CODE, token_type): Remove.
4227 * src/parse-gram.y (%union): New field `character'.
4228 Sort tokens.
4229 (CHAR): New token.
4230 (ID, ID_COLON): Now that the scanner no longer makes them
4231 identifiers, adjust all uses to invoke symbol_get.
4232 (id_colon): New, wraps the conversion from string to symbol.
4233 (%union): Accept a possible union_name.
4234 (symbol): Now can be a char.
4235 * data/c.m4 (b4_union_name): Leave a default value.
4236 * data/glr.c, data/yacc.c: Use it.
4237
42382006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
4239
4240 For associating token numbers with token names for "yacc.c", don't use
4241 #define statements unless `--yacc' is specified; always use enum
4242 yytokentype. Most important discussions start at:
4243 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
4244 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
4245 and
4246 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
4247 * NEWS (2.3+): Mention.
4248 * data/c.m4 (b4_yacc_if): New.
4249 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
4250 token #define's.
4251 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
4252 on token name definitions.
4253 * src/getargs.c (usage): Capitalize `Yacc' in English.
4254 * src/output.c (prepare): Define b4_yacc_flag.
4255 * tests/regression.at (Early token definitions): Test that tokens names
4256 are defined before the pre-prologue not just before the post-prologue.
4257 Remove this test case and copy to...
4258 (Early token definitions with --yacc): ... this to test #define's.
4259 (Early token definitions without --yacc): ... and this to test enums.
4260
42612006-06-11 Paul Eggert <eggert@cs.ucla.edu>
4262
4263 * NEWS: Reword the post-2.3 change to not be so optimistic about
4264 removing the old "look-ahead" spelling.
4265 Update previous look-ahead/lookahead change reports.
4266 * REFERENCES: look-ahead -> lookahead (since that's
4267 what he actually wrote).
4268 * doc/refcard.tex: look ahead -> lookahead,
4269 look-ahead -> lookahead
4270
42712006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
4272
4273 For consistency, use `lookahead' instead of `look-ahead' or
4274 `look_ahead'. Discussed starting at
4275 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
4276 and then at
4277 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
4278 * NEWS: For the next release, note the change to `--report'.
4279 * TODO, doc/bison.1: Update English.
4280 * doc/bison.texinfo: Update English.
4281 (Understanding Your Parser, Bison Options): Document as
4282 `--report=lookahead' rather than `--report=look-ahead'.
4283 * src/conflicts.c: Update English in comments.
4284 (lookahead_set): Rename from look_ahead_set.
4285 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
4286 (resolve_sr_conflict): Rename local look_ahead_tokens to
4287 lookahead_tokens, and update other uses.
4288 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
4289 count_rr_conflicts, conflicts_free): Update uses.
4290 * src/getargs.c (report_args): Move "lookahead" before alternate
4291 spellings.
4292 (report_types): Update uses.
4293 (usage): For `--report' usage description, state `lookahead' spelling
4294 rather than `look-ahead'.
4295 * src/getargs.h (report.report_lookahead_tokens): Rename from
4296 report_look_ahead_tokens.
4297 * src/lalr.c: Update English in comments.
4298 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
4299 (state_lookahead_tokens_count): Rename from
4300 state_look_ahead_tokens_count.
4301 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4302 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
4303 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4304 Update other uses.
4305 Update English in output.
4306 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
4307 * src/print.c: Update English in comments.
4308 (lookahead_set): Rename from look_ahead_set.
4309 (print_reduction): Rename argument lookahead_token from
4310 look_ahead_token.
4311 (print_core, state_default_rule, print_reductions, print_results):
4312 Update uses.
4313 * src/print_graph.c: Update English in comments.
4314 (print_core): Update uses.
4315 * src/state.c: Update English in comments.
4316 (reductions_new): Update uses.
4317 (state_rule_lookahead_tokens_print): Rename from
4318 state_rule_look_ahead_tokens_print, and update other uses.
4319 * src/state.h: Update English in comments.
4320 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
4321 (state_rule_lookahead_tokens_print): Rename from
4322 state_rule_look_ahead_tokens_print.
4323 * src/tables.c: Update English in comments.
4324 (conflict_row, action_row): Update uses.
4325 * tests/glr-regression.at
4326 (Incorrect lookahead during deterministic GLR,
4327 Incorrect lookahead during nondeterministic GLR): Rename
4328 print_look_ahead to print_lookahead.
4329 * tests/torture.at: Update English in comments.
4330 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
4331 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
4332 (Many lookahead tokens): Update uses.
4333 * data/glr.c: Update English in comments.
4334 * lalr1.cc: Likewise.
4335 * yacc.c: Likewise.
4336 * src/conflicts.h: Likewise.
4337 * src/lalr.h: Likewise.
4338 * src/main.c: Likewise.
4339 * src/output.c: Likewise.
4340 * src/parse-gram.c: Likewise.
4341 * src/tables.h: Likewise.
4342 * tests/calc.at: Likewise.
4343
43442006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
4345
4346 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
4347
43482006-06-07 Paul Eggert <eggert@cs.ucla.edu>
4349
4350 * TODO: Add request from Nelson H. F. Beebe to be able to install
4351 Bison without installing the yacc script.
4352
43532006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4354
4355 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
4356 and yytext if they're already #define'd.
4357 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
4358 * src/scan-code-c.c: ... here.
4359 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
4360 <config.h>.
4361
43622006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4363
4364 Get Bison to build again when configured with --enable-gcc-warnings.
4365 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
4366 missing #include's.
4367 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
4368 loc argument as it shadows a global.
4369 * src/scan-gram.l: Remove stray comma that prevents boundary_set
4370 invocation.
4371
4372 * src/.cvsignore: Add scan-code.c.
4373
43742006-06-07 Akim Demaille <akim@epita.fr>
4375
4376 * src/scan-gram.l: Move the "add a trailing ; to actions" code
4377 to...
4378 * src/scan-code.l: here.
4379 * tests/input.at (Torturing the Scanner): Fix another location
4380 error.
4381
43822006-06-07 Akim Demaille <akim@epita.fr>
4383
4384 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
4385
43862006-06-06 Akim Demaille <akim@epita.fr>
4387
4388 Extract the parsing of user actions from the grammar scanner.
4389 As a consequence, the relation between the grammar scanner and
4390 parser is much simpler. We can also split "composite tokens" back
4391 into simple tokens.
4392 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
4393 * src/scan-gram.l (add_column_width, adjust_location): Move to and
4394 rename as...
4395 * src/location.h, src/location.c (add_column_width)
4396 (location_compute): these.
4397 Fix the column count: the initial column is 0.
4398 (location_print): Be robust to ending column being 0.
4399 * src/location.h (boundary_set): New.
4400 * src/main.c: Adjust to scanner_free being renamed as
4401 gram_scanner_free.
4402 * src/output.c: Include scan-code.h.
4403 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
4404 Use boundary_set.
4405 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
4406 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
4407 which is now, again, a separate token.
4408 Adjust all dependencies.
4409 Whereever actions with $ and @ are used, use translate_code.
4410 (action): Remove this nonterminal which is now useless.
4411 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
4412 (grammar_current_rule_action_append): Use translate_code.
4413 (packgram): Bound check ruleno, itemno, and rule_length.
4414 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
4415 (last_string, last_braced_code_loc, max_left_semantic_context)
4416 (scanner_initialize, scanner_free, scanner_last_string_free)
4417 (gram_out, gram_lineno, YY_DECL_): Move to...
4418 * src/scan-gram.h: this new file.
4419 (YY_DECL): Rename as...
4420 (GRAM_DECL): this.
4421 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
4422 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4423 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4424 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4425 Move these declarations, and...
4426 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
4427 these to...
4428 * src/flex-scanner.h: this new file.
4429 * src/scan-gram.l (rule_length, rule_length_overflow)
4430 (increment_rule_length): Remove.
4431 (last_braced_code_loc): Rename as...
4432 (gram_last_braced_code_loc): this.
4433 Adjust to the changes of the parser.
4434 Move all the handling of $ and @ into...
4435 * src/scan-code.l: here.
4436 * src/scan-gram.l (handle_dollar, handle_at): Remove.
4437 (handle_action_dollar, handle_action_at): Move to...
4438 * src/scan-code.l: here.
4439 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
4440 scan-code.h, scan-code-c.c, scan-gram.h.
4441 (EXTRA_bison_SOURCES): Add scan-code.l.
4442 (BUILT_SOURCES): Add scan-code.c.
4443 (yacc): Be robust to white spaces.
4444
4445 * tests/conflicts.at, tests/input.at, tests/reduce.at,
4446 * tests/regression.at: Adjust the column numbers.
4447 * tests/regression.at: Adjust the error message.
4448
44492006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4450
4451 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4452 Use Akim's wording from
4453 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
4454
44552006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4456
4457 Between Bison releases, manually append `+' to the previous Bison
4458 release number, and use that as a signal to automatically print the
4459 ChangeLog's CVS Id keyword from --version. Discussed starting at
4460 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
4461 * ChangeLog: Add Id header.
4462 * configure.ac (AC_INIT): Append `+' to `2.3'.
4463 * src/.cvsignore: Add revision.c.
4464 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
4465 (BUILT_SOURCES): Add revision.c.
4466 (revision.c): New target rule. This file defines a new global variable
4467 named revision. It initializes it with either the Id from ChangeLog
4468 or, if VERSION doesn't contain `+', with the empty string.
4469 * src/getargs.c (version): Print the value of revision.
4470 * src/revision.h: Extern revision.
4471
44722006-06-05 Paul Eggert <eggert@cs.ucla.edu>
4473
4474 * NEWS: Version 2.3.
4475 * configure.ac (AC_INIT): Likewise.
4476
44772006-05-30 Paul Eggert <eggert@cs.ucla.edu>
4478
4479 * data/glr.c (YYRECOVERING): Define to be a function-like macro
4480 with no arguments, not as an object-like macro. This is for
4481 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
4482 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
4483 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
4484 Document this.
4485
44862006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
4487
4488 * src/getargs.c (usage): Back out yesterday's modification of the
4489 --help output so that we don't have to wait for translation before
4490 releasing 2.3.
4491
44922006-05-29 Paul Eggert <eggert@cs.ucla.edu>
4493
4494 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
4495 Problem reported by Akim Demaille.
4496
44972006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4498
4499 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4500
45012006-05-26 Paul Eggert <eggert@cs.ucla.edu>
4502
4503 * data/yacc.c (yy_reduce_print): Omit trailing white space in
4504 generated source code. Problem reported by Frans Englich in
4505 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
4506
45072006-05-22 Paul Eggert <eggert@cs.ucla.edu>
4508
4509 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
4510 shell, not within 'make', so that 'make' by an ordinary builder
4511 (using GNU make) does not worry about configuring gzip. This also
4512 works around a bug reported independently by Keith Thompson and by
4513 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
4514 stderr rather than stdout, messing up the build logs.
4515
45162006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4517
4518 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
4519 to make sure that YYID will never be unused. This fixes a 'make
4520 maintainer-check' failure caused by the recent changes to the 'Trivial
4521 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
4522 not used.
4523 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
4524
45252006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4526
4527 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
4528 state before an empty RHS is always resolved here. Only the location
4529 of that state is guaranteed to be resolved, and that's enough. This
4530 fixes the remaining bug reported by Derek M. Jones in
4531 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4532 * tests/glr-regression.at (Uninitialized location when reporting
4533 ambiguity): Test the above case.
4534 Also, the embedded comments in this test case claim it checks the case
4535 of an empty RHS that has inherited the initial location. However, the
4536 corresponding LHS was already resolved, so yyresolveLocations didn't
4537 actually have reason to modify it. Fix this by forcing
4538 nondeterministic operation at the beginning of the parse.
4539
45402006-05-20 Paul Eggert <eggert@cs.ucla.edu>
4541
4542 * data/c.m4 (b4_yy_symbol_print_generate):
4543 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
4544 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
4545 of the bugs reported today by Derek M Jones in
4546 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4547 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
4548 defined to be a type name without parens or brackets.
4549 (Location Type): Similarly for YYLTYPE.
4550 * tests/regression.at (Trivial grammars): Put in a test for this
4551 bug that will be caught by 'make maintainer-check' (though not,
4552 alas, by 'make check' unless your compiler is picky).
4553
45542006-05-19 Paul Eggert <eggert@cs.ucla.edu>
4555
4556 * NEWS: Version 2.2.
4557 * configure.ac (AC_INIT): Likewise.
4558
45592006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
4560
4561 * data/glr.c (yyreportTree): Make room in yystates for the state
4562 preceding the RHS. This fixes the segmentation fault reported by Derek
4563 M. Jones in
4564 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
4565 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
4566 to the user. Reported for yyreportTree by Derek M. Jones later in the
4567 same thread.
4568 * THANKS: Add Derek M. Jones.
4569 Update my email address.
4570 Fix typo in Steve Murphy's name.
4571
45722006-05-14 Paul Eggert <eggert@cs.ucla.edu>
4573
4574 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
4575 checking against YYLAST that caused the parser to miss a potential
4576 alternative in its diagnostic.
4577 Problem reported by Maria Jose Moron Fernandez in
4578 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
4579 * data/lalr1.cc (yysyntax_error_): Likewise.
4580 * data/yacc.c (yysyntax_error): Likewise.
4581 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
4582 tokens, in case we run into an older C compiler.
4583 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
4584 Use them to check for the off-by-one error fixed above.
4585
4586 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
4587 YYSIZE_T, not size_t.
4588 * tests/regression.at (Trivial grammars): New test, to catch
4589 the error fixed by the above patch.
4590
45912006-05-14 Akim Demaille <akim@lrde.epita.fr>
4592
4593 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
4594 scheme.
4595 Reported by Steve Murphy.
4596
45972006-05-14 Akim Demaille <akim@lrde.epita.fr>
4598
4599 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
4600 * data/glr.cc: b4_location_flag is now b4_locations_flag.
4601
46022006-05-14 Akim Demaille <akim@lrde.epita.fr>
4603
4604 Implement --trace=m4.
4605 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
4606 * src/output.c (output_skeleton): When set, pass -dV to m4.
4607
4608 Factor the handling of flags in m4.
4609 * src/output.c (prepare): Rename the muscle names debug, defines,
4610 error_verbose to debug_flag, defines_flag, error_verbose_flag.
4611 * data/c.m4: Adjust.
4612 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
4613 Use b4_define_flag_if to define other b4_FLAG_if macros.
4614 (b4_location_if): As a consequence, rename as...
4615 (b4_locations_if): this, for consistency.
4616 Adjust all the skeletons.
4617
46182006-05-14 Akim Demaille <akim@lrde.epita.fr>
4619
4620 * etc/bench.pm: Shorten bench names.
4621
46222006-05-14 Akim Demaille <akim@lrde.epita.fr>
4623
4624 * src/output.h, src/output.c (error_verbose): Move to...
4625 * src/getargs.h, src/getargs.c: here.
4626 Sort the flags.
4627 Adjust dependencies.
4628
46292006-05-13 Paul Eggert <eggert@cs.ucla.edu>
4630
4631 * data/c.m4 (b4_copyright): Put the special exception for Bison
4632 skeletons here, so we don't have to put it in each skeleton. All
4633 uses changed. Suggested by Akim Demaille. Also, wrap the
4634 copyright notice, in case it is longer than 80 columns. Replace
4635 comma by newline after title.
4636
46372006-05-11 Paul Eggert <eggert@cs.ucla.edu>
4638
4639 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
4640 incompatibility, not a bug. Mention that it wasn't fixed as of
4641 flex 2.5.33.
4642
46432006-05-11 Akim Demaille <akim@lrde.epita.fr>
4644
4645 * examples/extexi: Enforce the precedence of concatenation over
4646 >>.
4647 Reported by Tommy Nordgren.
4648
46492006-05-11 Akim Demaille <akim@lrde.epita.fr>
4650
4651 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
4652 with the member "token".
4653 Reported by Martin Nylin.
4654
46552006-05-08 Paul Eggert <eggert@cs.ucla.edu>
4656
4657 * data/glr.c: Switch to Bison 2.2 special-exception language in
4658 the copyright notice. Use more-regular format for titles and
4659 copyright notices.
4660 * data/glr.cc: Likewise.
4661 * data/location.cc: Likewise.
4662 * data/yacc.cc: Likewise.
4663 * doc/bison.texinfo (Conditions): Document this.
4664 * NEWS: likewise. Upgrade version to 2.2.
4665
46662006-04-27 Akim Demaille <akim@lrde.epita.fr>
4667
4668 * data/glr.cc: Remove dead code.
4669
46702006-04-25 Paul Eggert <eggert@cs.ucla.edu>
4671
4672 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
4673 that variable and the line breaks the bootstrap. Problem reported
4674 by Juan M. Guerrero.
4675
46762006-04-24 Akim Demaille <akim@lrde.epita.fr>
4677
4678 * doc/bison.texinfo (Multiple start-symbols): New.
4679
46802006-04-24 Akim Demaille <akim@lrde.epita.fr>
4681
4682 * etc/README, etc/bench.pl: New.
4683
46842006-04-03 Akim Demaille <akim@lrde.epita.fr>
4685
4686 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
4687 rule.
4688 Reported by Mickael Labau.
4689 * tests/input.at (Torturing the Scanner): Test it.
4690
46912006-03-16 Paul Eggert <eggert@cs.ucla.edu>
4692
4693 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
4694 Problem reported by Bob Rossi.
4695
46962006-03-13 Paul Eggert <eggert@cs.ucla.edu>
4697
4698 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
4699 and didn't really work.
4700 For the index, use @ifnotinfo, not @iftex.
4701 Minor cleanups of spacing and terminology.
4702
47032006-03-12 Akim Demaille <akim@lrde.epita.fr>
4704
4705 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
4706 of AT_NAME_PREFIX when %name-prefix is not used.
4707
47082006-03-12 Akim Demaille <akim@lrde.epita.fr>
4709
4710 Apply --prefix to C++ skeletons too: they change the namespace.
4711 The test suite already exercize these cases.
4712 * data/c++.m4 (b4_namespace): New.
4713 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
4714 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
4715 * data/yacc.c, data/glr.c: Remove a useless `[]'.
4716 * doc/bison.texinfo: Document it.
4717 (Option Cross Key): Use @multitable in all formats. It looks
4718 nicer, even in TeX outputs.
4719 (Rules): Use the same code whatever the output type is.
4720 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
4721 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
4722 * tests/calc.at: Use it, instead of hard coding `yy'.
4723
47242006-03-10 Akim Demaille <akim@lrde.epita.fr>
4725
4726 * TODO: Remove dead items.
4727
47282006-03-10 Akim Demaille <akim@lrde.epita.fr>
4729
4730 * doc/FAQ: Remove, merged into...
4731 * doc/bison.texinfo (FAQ): this.
4732 * doc/Makefile.am (EXTRA_DIST): Adjust.
4733
47342006-03-10 Akim Demaille <akim@lrde.epita.fr>
4735
4736 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
4737 even if empty.
4738 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
4739 * doc/bison.texinfo (Calc++ Scanner): Use it.
4740
47412006-03-09 Paul Eggert <eggert@cs.ucla.edu>
4742
4743 Fix two nits reported by twlevo, plus one more that I discovered.
4744
4745 * src/assoc.h (assoc_to_string): Give a name to the arg, as
4746 this is the usual Bison style.
4747 * src/location.h (location_print): Likewise.
4748
4749 * src/reader.h (token_name): Likewise.
4750
47512006-03-08 Paul Eggert <eggert@cs.ucla.edu>
4752
4753 Fix some nits reported by twlevo.
4754 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
4755 and "POSIX". Use more-modern syntax for URLs. Mention C++
4756 and ask for Java. Don't hardwire OS version numbers. Add
4757 copyright notice.
4758 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
4759 * src/conflicts.c (solved_conflicts_obstack): Now static.
4760
47612006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4762
4763 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
4764 page. Say "you can use it" not "you may use it" as on the web page;
4765 we're describing capabilities not granting permission.
4766
47672006-03-06 Paul Eggert <eggert@cs.ucla.edu>
4768
4769 * data/glr.c (yyresolveLocations): Rename local variables to avoid
4770 shadowing warnings. Use usual patter for iterating through RHS.
4771 * tests/glr-regression.at
4772 (Uninitialized location when reporting ambiguity):
4773 Modify yylex so that it uses its argument, rather than trying
4774 to rely on ARGSUSED (which doesn't work for gcc with warnings).
4775 const char -> char const.
4776
4777 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
4778 Don't use tabs inside commands; it messes up 'ps'.
4779 Problem reported by twlevo.
4780
47812006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
4782
4783 * tests/glr-regression.at (Uninitialized location when reporting
4784 ambiguity): New test case.
4785 * data/glr.c (yyresolveLocations): New function, which uses
4786 YYLLOC_DEFAULT.
4787 (yyresolveValue): Invoke yyresolveLocations before reporting an
4788 ambiguity.
4789 * doc/bison.texinfo (Default Action for Locations): Note
4790 YYLLOC_DEFAULT's usage for ambiguity locations.
4791 (GLR Semantic Actions): Cross-reference those notes.
4792
47932006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
4794
4795 * tests/glr-regression.at (Leaked semantic values when reporting
4796 ambiguity): Remove unnecessary union and type declarations.
4797 (Leaked lookahead after nondeterministic parse syntax error): New test
4798 case.
4799 * data/glr.c (yyparse): Check for zero stacks remaining before
4800 attempting to shift the lookahead so that you don't lose it.
4801
48022006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4803
4804 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
4805 * tests/glr-regression.at (Leaked semantic values when reporting
4806 ambiguity): New test case.
4807 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
4808 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
4809 now unnecessary yystackp parameter.
4810 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
4811 destructors can be called.
4812
4813 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
4814 in existing testcases.
4815
48162006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4817
4818 Don't leak semantic values for parent RHS when a user action cuts the
4819 parser, and clean up related code a bit.
4820 * tests/glr-regression.at (Leaked merged semantic value if user action
4821 cuts parse): Rename to...
4822 (Leaked semantic values if user action cuts parse): ... this. Add check
4823 for leaked parent RHS values.
4824 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
4825 between an unresolved state (non-empty chain of semantic options) and
4826 an incomplete one (signaled by an empty chain).
4827 (yyresolveStates): Document the interface. Move all manipulation of a
4828 successfully or unsuccessfully resolved yyGLRState to...
4829 (yyresolveValue): ... here so that yyresolveValue always leaves a
4830 yyGLRState with consistent data and thus is easier to understand.
4831 Remove the yyvalp and yylocp parameters since they are always just
4832 taken from the yys parameter. When reporting a discarded merged value
4833 in debugging output, note that it is incompletely merged. Document the
4834 interface.
4835 (yyresolveAction): If resolving any of the RHS states fails, destroy
4836 them all rather than leaking them. Thus, as long as user actions are
4837 written to clean up the RHS correctly, yyresolveAction always cleans up
4838 the RHS of a semantic option. Document the interface.
4839
48402006-02-27 Paul Eggert <eggert@cs.ucla.edu>
4841
4842 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
4843 led to a segmentation fault in GNU Pascal. Problem reported
4844 by Waldek Hebisch.
4845
48462006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
4847
4848 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
4849 mid-rule action inside a nonterminal symbol in order to declare a
4850 destructor for its semantic value.
4851
48522006-02-16 Paul Eggert <eggert@cs.ucla.edu>
4853
4854 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
4855 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
4856 __cplusplus && ! defined _STDLIB_H && !
4857 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
4858 defined free))]: Include <stdlib.h> rather than rolling our own
4859 declarations of malloc and free, to avoid problems with
4860 incompatible declarations (using 'throw') C++'s stdlib.h. This
4861 should fix Debian bug 340012
4862 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
4863 reported by Guillaume Melquiond.
4864
48652006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4866
4867 * NEWS: Clarify symbols versus types in unused-value warnings.
4868
4869 * configure.ac (AC_INIT): Bump version number.
4870
48712006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4872
4873 * NEWS: Version 2.1a.
4874 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
4875 since C99 requires this.
4876
48772006-02-11 Paul Eggert <eggert@cs.ucla.edu>
4878
4879 * m4/c-working.m4: New file.
4880 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
4881
48822006-02-10 Paul Eggert <eggert@cs.ucla.edu>
4883
4884 * Makefile.maint: Merge from coreutils.
4885
48862006-02-09 Paul Eggert <eggert@cs.ucla.edu>
4887
4888 More portability fixes for problems summarized by Nelson H. F. Beebe.
4889
4890 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
4891 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
4892 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
4893 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
4894 messes up because C++ code is compiled in 32-bit mode but linked
4895 in 64-bit mode.
4896
48972006-02-08 Paul Eggert <eggert@cs.ucla.edu>
4898
4899 More portability fixes for problems summarized by Nelson H. F. Beebe.
4900
4901 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
4902 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
4903
4904 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
4905 nodist_PROGRAMS, since we don't need to actually compile the
4906 example if we're just doing a plain 'make'. This avoids bothering
4907 the installer unnecessarily about problems due to weird C++
4908 compilers.
4909
49102006-02-06 Paul Eggert <eggert@cs.ucla.edu>
4911
4912 More portability fixes for problems summarized by Nelson H. F. Beebe.
4913
4914 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
4915 than #include "...", and compile with -I'.'. The old method was
4916 not portable, according to Posix and the C standard, and it does
4917 not work with Sun C 5.7, where previous #line directives affect
4918 the working directory used in later #include "..." directives.
4919
49202006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4921
4922 Various DJGGP specific issues in /djgpp
4923
49242006-02-02 Paul Eggert <eggert@cs.ucla.edu>
4925
4926 More portability fixes for problems summarized by Nelson H. F. Beebe.
4927
4928 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
4929 '#include <map>' works and that you can apply ++ to iterators.
4930
49312006-02-01 Paul Eggert <eggert@cs.ucla.edu>
4932
4933 Work around portability problems summarized by Nelson H. F. Beebe in
4934 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
4935
4936 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4937 that '#include <string>' works.
4938
4939 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
4940 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
4941 "warning: sorry: semantics of inline function static data `const
4942 unsigned char translate_table[262]' are wrong (you'll wind up with
4943 multiple copies)".
4944
4945 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
4946 or, xor to not_, and_, or_, and xor_, respectively. This works
4947 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
4948 random system header somewhere that includes the equivalent of
4949 <iso646.h>.
4950
4951 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
4952 -E" works; it apparently doesn't work with PathScale EKO Compiler
4953 Suite Version 2.0.
4954
49552006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
4956
4957 During deterministic GLR operation, user actions should be able to
4958 influence the parse by changing yychar. To make this easier to fix and
4959 to make glr.c easier to evolve in general, don't maintain yytoken in
4960 parallel with yychar; just compute yytoken when needed.
4961 * tests/glr-regression.at (Incorrect lookahead during deterministic
4962 GLR): Check that setting yychar in a user action has the intended
4963 effect.
4964 * data/glr.c (yyGLRStack): Remove yytokenp member.
4965 (yyclearin): Don't set *yytokenp.
4966 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
4967 yychar rather than *yytokenp to determine the current lookahead.
4968 Compute yytoken locally when needed.
4969 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
4970 point to.
4971
4972 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
4973 after `--report' documentation.
4974
49752006-01-30 Paul Eggert <eggert@cs.ucla.edu>
4976
4977 * src/parse-gram.y (grammar_declaration): Location of printer
4978 symbol is @1, not list->location. Bug reported by twlevo.
4979 * tests/input.at (Incompatible Aliases): Adjust to above change.
4980
49812006-01-29 Paul Eggert <eggert@cs.ucla.edu>
4982
4983 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
4984 all the test at once. This makes the output easier to read in the
4985 normal case.
4986
4987 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
4988 got from <http://bro-ids.org/download.html>. The bug is that
4989 when two actions appeared in succession, the second one was
4990 scanned before the first one was added to the grammar rule
4991 as a midrule action. Bison then output the incorrect warning
4992 "parse.y:905.17-906.36: warning: unused value: $3".
4993 * src/parse-gram.y (BRACED_CODE, action): These are no longer
4994 associated with a value.
4995 (rhs): Don't invoke grammar_current_rule_action_append.
4996 (action): Invoke it here instead.
4997 * src/reader.c (grammar_midrule_action): Now extern.
4998 (grammar_current_rule_action_append): Don't invoke
4999 grammar_midrule_action; that is now the scanner's job.
5000 * src/reader.h (last_string, last_braced_code_loc):
5001 (grammar_midrule_action): New decls.
5002 * src/scan-gram.l (last_string): Now extern, sigh.
5003 (last_braced_code_loc): New extern variable.
5004 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
5005 rule already has an action.
5006 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
5007 * tests/input.at (AT_CHECK_UNUSED_VALUES):
5008 Add some tests to check that the above changes fixed the bug.
5009
50102006-01-27 Paul Eggert <eggert@cs.ucla.edu>
5011
5012 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
5013 All used changed. Check whether the symbol has a destructor,
5014 not whether it is typed.
5015 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
5016 that the values are still reported as unused. All line numbers
5017 adjusted.
5018
50192006-01-23 Paul Eggert <eggert@cs.ucla.edu>
5020
5021 Work around a bug in bro 0.8, which underparenthesizes its
5022 definition of YYLLOC_DEFAULT.
5023 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
5024 their arguments.
5025 * data/lalr1.cc: Likewise.
5026 * data/yacc.cc: Likewise.
5027
50282006-01-22 Paul Eggert <eggert@cs.ucla.edu>
5029
5030 Work around a bug in Pike 7.0, and give the Pike folks a
5031 better way to override the usual int widths.
5032 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
5033 user can override the types.
5034 (short): #undef, to work around a bug in Pike 7.0.
5035 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
5036 (union yyalloc.yyss): Use yytype_int16 rather than short.
5037 All uses changed.
5038 (yysigned_char): Remove.
5039 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
5040 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
5041 * tests/regression.at (Web2c Actions): Adjust to above changes.
5042
5043 * src/reader.c (check_and_convert_grammar): New function.
5044 (reader): Close the input file even if something went wrong during
5045 parsing. Minor file descriptor leak reported by twlevo.
5046
5047 * src/assoc.c (assoc_to_string): Use a default: abort (); case
5048 to pacify gcc -Wswitch-default.
5049 * src/scan-gram.l (adjust_location): Use a default: break; case
5050 to pacify gcc -Wswitch-default.
5051 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
5052 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5053 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5054 Move these decls to scan-skel.l, since they don't need to be
5055 visible elsewhere.
5056 * src/scan-skel.l: Accept the above decls.
5057 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
5058 is used.
5059
50602006-01-21 Paul Eggert <eggert@cs.ucla.edu>
5061
5062 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
5063 since we don't want to insist on a version number at the start
5064 of the changelog every time.
5065 * Makefile.maint: Sync from coreutils a bit better.
5066 (sc_trailing_blank): Renamed from sc_trailing_space.
5067 All uses changed.
5068 (sc_no_if_have_config_h, sc_require_config_h):
5069 (sc_prohibit_assert_without_use): New rules.
5070 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
5071 (sc_dd_max_sym_length): Fix leading spaces in rule.
5072 (sc_system_h_headers): Prefix with @.
5073 (sc_useless_cpp_parens, m4-check): Output line numbers.
5074 (changelog-check): Allow version only in head.
5075 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
5076 satisfy new Makefile.maint rule.
5077 * data/glr.c: Likewise.
5078 * data/glr.cc: Likewise.
5079 * data/lalr1.cc: Likewise.
5080 * data/yacc.c: Likewise.
5081 * lib/ebitsetv.c: Likewise.
5082 * lib/lbitset.c: Likewise.
5083 * lib/subpipe.c: Likewise.
5084 * lib/timevar.c: Likewise.
5085 * src/system.h: Likewise.
5086 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
5087 * djgpp/Makefile.maint: Add copyright notice.
5088 * djgpp/README.in: Likewise.
5089 * djgpp/config.bat: Likewise.
5090 * djgpp/config.site: Likewise.
5091 * djgpp/config_h.sed: Likewise.
5092 * djgpp/djunpack.bat: Likewise.
5093 * djgpp/config.sed: Fix copyright notice to match standard format.
5094 * djgpp/subpipe.h: Likewise.
5095 * lib/bitsetv-print.c: Likewise.
5096 * lib/bitsetv.c: Likewise.
5097 * lib/subpipe.h: Likewise.
5098 * lib/timevar.c: Likewise.
5099 * lib/timevar.h: Likewise.
5100 * djgpp/subpipe.c: Use standard recipe for config.h.
5101 * lib/abitset.c: Likewise.
5102 * lib/bitset.c: Likewise.
5103 * lib/bitset_stats.c: Likewise.
5104 * lib/bitsetv-print.c: Likewise.
5105 * lib/bitsetv.c: Likewise.
5106 * lib/ebitsetv.c: Likewise.
5107 * lib/get-errno.c: Likewise.
5108 * lib/lbitset.c: Likewise.
5109 * lib/subpipe.c: Likewise.
5110 * lib/timevar.c: Likewise.
5111 * lib/vbitset.c: Likewise.
5112 * tests/local.at: Likewise.
5113 * src/scan-gram.l: Don't include verify.h, since system.h does
5114 that for us.
5115 * .x-sc_require_config_h: New file.
5116 * .x-sc_unmarked_diagnostics: New file.
5117
51182006-01-20 Paul Eggert <eggert@cs.ucla.edu>
5119
5120 Be a bit more systematic about using 'abort'.
5121 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
5122 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
5123 Put 'default: abort ();' before some other case, to satisfy older
5124 pedantic compilers.
5125 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5126 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
5127 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
5128 * src/conflicts.c (resolve_sr_conflict): Likewise.
5129 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
5130 (get_decision_str, get_orientation_str, get_node_alignment_str):
5131 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
5132 (get_linestyle_str, get_arrowstyle_str): Likewise.
5133 * src/conflicts.c (resolve_sr_conflict):
5134 Use a default case rather than one for the one remaining enum
5135 value, to catch invalid enum values as well.
5136 * src/lalr.c (set_goto_map, map_goto):
5137 Prefer "assert (FOO);" to "if (!FOO) abort ();".
5138 * src/nullable.c (nullable_compute, token_definitions_output):
5139 Likewise.
5140 * src/reader.c (packgram, reader): Likewise.
5141 * src/state.c (transitions_to, state_new, state_reduction_find):
5142 Likewise.
5143 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
5144 (symbol_pack): Likewise.
5145 * src/tables.c (conflict_row, pack_vector): Likewise.
5146 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
5147 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
5148 * src/system.h: Don't include <assert.h>.
5149 (assert): New macro.
5150
5151 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
5152 (Destructor Decl, Parser Function, Pure Calling):
5153 Describe rules for braces inside C code more carefully.
5154
51552006-01-19 Paul Eggert <eggert@cs.ucla.edu>
5156
5157 Fix some porting glitches found by Nelson H. F. Beebe.
5158 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
5159 compilers that don't understand that abort () does not return.
5160 * src/state.c (transitions_to): Likewise.
5161 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
5162 that '#include <cstdlib>' works.
5163 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
5164 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
5165 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
5166 for the benefit of some pre-C99 compilers.
5167
5168 * bootstrap: Undo changes to gnulib files that autoreconf made.
5169
5170 Minor fixups to get 'make maintainer-check' to work.
5171 * configure.ac: Don't use -Wnested-externs, as it's incompatible
5172 with the new verify.h implementation.
5173 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
5174 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
5175 * data/yacc.c (YYUSE): Likewise.
5176 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
5177 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
5178 * src/parse-gram.y (declaration): Don't pass a string constant
5179 to a function that expects char *, since GCC might complain
5180 about the constant value.
5181 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
5182 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
5183 before #defining them.
5184 * tests/glr-regression.at
5185 (Incorrectly initialized location for empty right-hand side in GLR):
5186 In yyerror, use the msg arg.
5187 (Corrupted semantic options if user action cuts parse):
5188 (Incorrect lookahead during deterministic GLR):
5189 (Incorrect lookahead during nondeterministic GLR):
5190 Don't name a local var 'index'; it shadows string.h's 'index'.
5191
51922006-01-19 Akim Demaille <akim@epita.fr>
5193
5194 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
5195 location, not just parts of it.
5196
51972006-01-18 Paul Eggert <eggert@cs.ucla.edu>
5198
5199 * NEWS: Document the fact that multiple %unions are now allowed.
5200 * doc/bison.texinfo (Union Decl): Likewise.
5201 * TODO: This feature is now implemented, so remove it from
5202 the wishlist.
5203
5204 * Makefile.maint: Merge with coreutils Makefile.maint.
5205 (CVS_LIST): Use build-aux version if available.
5206 (VERSION_REGEXP): New macro.
5207 (syntax-check-rules): Add sc_no_if_have_config_h,
5208 sc_prohibit_assert_without_use, sc_require_config_h,
5209 sc_useless_cpp_parens.
5210 (sc_obsolete_symbols): Check for O_NDELAY.
5211 (sc_dd_max_sym_length): Track coreutils.
5212 (sc_unmarked_diagnostics): Look in all files, not just *.c.
5213 (sc_useless_cpp_parens): New rule.
5214 (news-date-check): Look for version or today's date.
5215 (changelog-check): Don't require version number near head.
5216 (copyright-check): Use current year instead of hardwiring 2005.
5217 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
5218 (announcement): Add --gpg-key-ID.
5219
5220 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
5221 with "file system".
5222
5223 Avoid undefined behavior that addressed just before the start of an
5224 array. Problem reported by twlevo.
5225 * src/reader.c (packgram): Prepend a new sentinel before ritem.
5226 * src/lalr.c (build_relations): Rely on new sentinel.
5227 * src/gram.c (gram_free): Adjust to new sentinel.
5228
52292006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
5230
5231 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
5232 yylookaheadNeeds. All uses updated.
5233 (yysplitStack): Rename local yynewLookaheadStatuses to
5234 yynewLookaheadNeeds.
5235 * data/glr-regression.at (Incorrect lookahead during nondeterministic
5236 GLR): In comments, change `lookahead status' to `lookahead need'.
5237
52382006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5239
5240 * data/glr.c (yysplitStack): A little stylistic rewrite.
5241
52422006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5243
5244 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
5245
52462006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
5247
5248 * doc/bison.texinfo: Fix some typos.
5249 (GLR Semantic Actions): New subsection discussing special
5250 considerations because GLR semantic actions might be deferred.
5251 (Actions): Mention look-ahead usage of yylval.
5252 (Actions and Locations): Mention look-ahead usage of yylloc.
5253 (Special Features for Use in Actions): Add YYEOF entry and mention it
5254 in the yychar entry.
5255 In the yychar entry, remove mention of the local yychar case (pure
5256 parser) since this is irrelevant information when writing semantic
5257 actions and since it's already discussed in `Table of Symbols' where
5258 yychar is otherwise described as an external variable.
5259 In the yychar entry, don't call it the `current' look-ahead since it
5260 isn't when semantic actions are deferred.
5261 In the yychar and yyclearin entries, add note about deferred semantic
5262 actions.
5263 Add yylloc and yylval entries discussing look-ahead usage.
5264 (Look-Ahead Tokens): When discussing yychar, don't call it the
5265 `current' look-ahead, and do mention yylval and yylloc.
5266 (Error Recovery): Cross-reference `Action Features' when mentioning
5267 yyclearin.
5268 (Table of Symbols): In the yychar entry, don't call it the `current'
5269 look-ahead.
5270 In the yylloc and yylval entries, mention look-ahead usage.
5271
52722006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5273
5274 * tests/glr-regression.at: Update copyright year to 2006.
5275
52762006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5277
5278 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
5279 use during nondeterministic operation to track which stacks have
5280 actually needed the current lookahead.
5281 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
5282 Allocate, deallocate, resize, and otherwise shuffle space for
5283 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
5284 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
5285 appropriately during nondeterministic operation.
5286 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
5287 members to store the current lookahead to be used by the deferred
5288 user action.
5289 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
5290 from which the RHS is taken. Set the lookahead members of the new
5291 yySemanticOption according to the lookahead status for stack yyk.
5292 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
5293 yyaddDeferredAction.
5294 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
5295 members of yySemanticOption before invoking yyuserAction, and then set
5296 them back to their current values afterward.
5297 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
5298 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
5299 * tests/glr-regression.at: Remove `.' from the ends of recent test case
5300 titles for consistency.
5301 (Leaked merged semantic value if user action cuts parse): In order to
5302 suppress lint warnings, use arguments in merge function, and assign
5303 char value < 128 in main.
5304 (Incorrect lookahead during deterministic GLR): New test case.
5305 (Incorrect lookahead during nondeterministic GLR): New test case.
5306
53072006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5308
5309 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
5310 !yyvaluep as signal that no semantic value is available to print.
5311 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
5312 to print a semantic value.
5313
53142006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5315
5316 * tests/glr-regression.at: For consistency with my newer test cases,
5317 don't thank myself.
5318
53192006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5320
5321 * data/glr.c (yyresolveValue): When merging semantic options, if at
5322 least one user action succeeds but a later one cuts the parse, then
5323 destroy the semantic value before returning rather than leaking it.
5324 (yyresolveStates): If a user action cuts the parse and thus
5325 yyresolveValue fails, ignore the (unset) semantic value rather than
5326 corrupting the yyGLRState, and empty the semantic options list since
5327 the user actions should have called all necessary destructors.
5328 Simplify code with YYCHK.
5329 * tests/glr-regression.at (Corrupted semantic options if user action
5330 cuts parse): New test case.
5331 (Undesirable destructors if user action cuts parse): New test case.
5332 Before applying any of this patch, this test case never actually failed
5333 for me... but only because the corrupted semantic options usually
5334 masked this bug.
5335 (Leaked merged semantic value if user action cuts parse): New test
5336 case.
5337
53382006-01-05 Akim Demaille <akim@epita.fr>
5339
5340 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
5341
53422006-01-04 Paul Eggert <eggert@cs.ucla.edu>
5343
5344 * data/c.m4 (b4_c_modern): New macro, with a new provision for
5345 _MSC_VER. Problem reported by Cenzato Marco.
5346 (b4_c_function_def): Use it.
5347 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
5348 b4_c_modern.
5349 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
5350 than rolling our own.
5351
53522006-01-04 Akim Demaille <akim@epita.fr>
5353
5354 Also warn about non-used mid-rule values.
5355 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
5356 member.
5357 (symbol_list_new): Adjust.
5358 * src/reader.c (symbol_typed_p): New.
5359 (grammar_rule_check): Use it.
5360 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
5361 Check its rule.
5362 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
5363 Use it.
5364 * tests/actions.at (Exotic Dollars): Adjust.
5365
53662006-01-04 Akim Demaille <akim@epita.fr>
5367
5368 * src/reader.c (grammar_midrule_action): If $$ is set in a
5369 mid-rule, move the `used' bit to its lhs.
5370 * tests/input.at (Unused values): New.
5371 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
5372
53732006-01-03 Paul Eggert <eggert@cs.ucla.edu>
5374
5375 * doc/bison.texinfo (Bison Options): Say more accurately what
5376 --yacc does.
5377 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
5378 about declarations in the grammar when in Yacc mode, as POSIX does
5379 not require a diagnostic when the grammar uses extensions.
5380
5381 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
5382
5383 Warn about dubious constructions like "%token T T".
5384 Reported by twlevo.
5385 * src/symtab.h (struct symbol.declared): New member.
5386 * src/symtab.c (symbol_new): Initialize it to false.
5387 (symbol_class_set): New arg DECLARING, specifying whether
5388 this is a declaration that we want to warn about, if there
5389 is more than one of them. All uses changed.
5390
5391 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
5392 Allow multiple %union directives, whose contents concatenate.
5393 * src/parse-gram.y (grammar_declaration): Likewise.
5394 Use muscle_code_grow, so that we don't need stype_line any more.
5395 All uses changed.
5396
5397 * src/muscle_tab.c (muscle_grow): Fix comment.
5398
5399 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
5400 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
5401 Update copyright year to 2006.
5402
54032006-01-03 Akim Demaille <akim@epita.fr>
5404
5405 Have glr.cc pass (some of) the calc.at tests.
5406 * data/glr.cc (b4_parse_param_orig): New.
5407 (b4_parse_param): Improve its definition, and bound it more
5408 clearly in the skeleton.
5409 (b4_epilogue): Append, instead of prepending, in order to keep
5410 #line consistency.
5411 Simplify the generation of auxiliary functions: locations and
5412 purity are mandated.
5413 (b4_global_tokens_and_yystype): Honor it.
5414 * data/location.cc (c++.m4): Don't include it.
5415 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
5416 and AT_SKEL_CC_IF.
5417 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
5418 AT_LALR1_CC_IF.
5419 Be sure to initialize the first position's filename.
5420 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
5421 mandated anyway.
5422 (AT_CHECK_CALC_GLR_CC): New.
5423 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
5424
54252006-01-02 Akim Demaille <akim@epita.fr>
5426
5427 * src/output.c (output_skeleton): Don't hard wire the inclusion of
5428 c.m4.
5429 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
5430 * data/glr.cc: Do not include stack.hh.
5431
54322006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5433
5434 * data/glr.c: Reformat whitespace with tabs.
5435 (b4_lpure_formals): Remove this unused m4 macro.
5436 * tests/cxx-type.at: Reformat whitespace with tabs.
5437 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
5438 since it's a member. Rename type to isNterm for clarity.
5439
54402005-12-29 Akim <akim@sulaco.local>
5441
5442 Let glr.cc catch up with symbol_value_print.
5443 * data/glr.cc (b4_yysymprint_generate): Replace by...
5444 (b4_yy_symbol_print_generate): this.
5445 (yy_symbol_print, yy_symbol_value_print): Declare them.
5446
54472005-12-28 Paul Eggert <eggert@cs.ucla.edu>
5448
5449 * src/location.h (boundary): Note that a line or column equal
5450 to INT_MAX indicates an overflow.
5451 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
5452 (rule_length_overflow, increment_rule_length, add_column_width):
5453 New functions.
5454 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
5455 (<SC_BRACED_CODE>"}"):
5456 Use increment_rule_length rather than incrementing it by hand.
5457 (adjust_location, handle_syncline): Diagnose overflow.
5458 (handle_action_dollar, handle_action_at):
5459 Fix bug with monstrosities like $-2147483648.
5460 Remove now-unnecessary checks.
5461 (scan_integer): Verify assumptions and remove now-unnecessary checks.
5462 (convert_ucn_to_byte): Verify assumptions.
5463 (handle_syncline): New arg LOC. All callers changed.
5464 Don't store through a value derived from char const * pointer.
5465
5466 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
5467 GCC warnings.
5468
54692005-12-27 Paul Eggert <eggert@cs.ucla.edu>
5470
5471 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
5472 Remove unnecessary forward static decls.
5473
54742005-12-27 Akim Demaille <akim@epita.fr>
5475
5476 * src/reader.c (grammar_current_rule_check): Also check that $$
5477 is used.
5478 Take the rule to check as argument, hence rename as...
5479 (grammar_rule_check): this.
5480 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
5481 Rename as...
5482 (grammar_rule_begin, grammar_rule_end): these, for consistency.
5483 (grammar_midrule_action, grammar_symbol_append): Now static.
5484 * tests/torture.at (input): Don't rely on the default action
5485 being always performed.
5486 * tests/calc.at: "Set" $$ even when the action is "cut" with
5487 YYERROR or other.
5488 * tests/actions.at (Exotic Dollars): Instead of using unused
5489 values, check that the warning is issued.
5490
54912005-12-22 Paul Eggert <eggert@cs.ucla.edu>
5492
5493 * NEWS: Improve wording for unused-value warnings.
5494
54952005-12-22 Akim Demaille <akim@epita.fr>
5496
5497 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
5498 (b4_yysymprint_generate): Rename as...
5499 (b4_yy_symbol_print_generate): this.
5500 Generate yy_symbol_print instead of yysymprint.
5501 Generate also yy_symbol_value_print, and use it.
5502
55032005-12-22 Akim Demaille <akim@epita.fr>
5504
5505 * NEWS: Warn about unused values.
5506 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
5507 a `used' member.
5508 (symbol_list_n_get, symbol_list_n_used_set): New.
5509 (symbol_list_n_type_name_get): Use symbol_list_n_get.
5510 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
5511 * src/reader.c (grammar_current_rule_check): Check that values are
5512 used.
5513 * src/symtab.c (symbol_print): Accept 0.
5514 * tests/existing.at: Remove the type information.
5515 Empty the actions.
5516 Remove useless actions (beware of mid-rule actions: perl -000
5517 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
5518 * tests/actions.at (Exotic Dollars): Use unused values.
5519 * tests/calc.at: Likewise.
5520 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5521 Likewise.
5522
5523 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
5524 rule_useful_p.
5525
55262005-12-21 Paul Eggert <eggert@cs.ucla.edu>
5527
5528 Undo 2005-12-01 tentative license wording change. The wording is
5529 still being reviewed by the lawyers, and we don't want to wait for
5530 them before publishing a test release. For now, revert to the
5531 previous wording.
5532 * NEWS: Undo 2005-12-01 change.
5533 * data/glr.c: Revert to previous license wording.
5534 * data/glr.cc: Likewise.
5535 * data/lalr1.cc: Likewise.
5536 * data/location.cc: Likewise.
5537 * data/yacc.c: Likewise.
5538
5539 * NEWS: Reword %destructor vs YYABORT etc.
5540 * data/glr.c: Use American spacing, for consistency.
5541 * data/glr.cc: Likewise.
5542 * data/lalr1.cc: Likewise.
5543 * data/yacc.c: Likewise.
5544 * data/yacc.c: Reformat comments slightly.
5545 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
5546 for consistency. Fix some spelling errors and reword recently-included
5547 text slightly.
5548 * tests/cxx-type.at: Cast results of malloc, for C++.
5549
55502005-12-21 Joel E. Denny <address@hidden>
5551
5552 * tests/cxx-type.at: Construct a tree, count the parents of shared
5553 nodes, and free each node once and only once. Previously, the memory
5554 for semantic values was leaked instead.
5555
55562005-12-21 Joel E. Denny <address@hidden>
5557
5558 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
5559 (yylval, yylloc): If pure, #define to yystackp->yyval and
5560 yystackp->yyloc similar to yychar and yynerrs.
5561 (yyparse): If pure, remove local yylval and yylloc. Add local
5562 yystackp to accommodate pure definitions of yylval and yylloc.
5563 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
5564 yylvalp and yyllocp to &yylval and &yylloc.
5565 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
5566 namespace. Previously, nerrs and char were missing, but lval and lloc
5567 weren't necessary.
5568 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
5569 yylvalp and yyllocp parameters since, if pure, these are now always
5570 accessible through yystackp. If not pure, they are still accessible
5571 globally.
5572 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
5573 `if (YYID (N))' to pacify lint.
5574
55752005-12-21 Akim Demaille <akim@epita.fr>
5576
5577 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
5578 destroy the RHS symbols of a rule.
5579 * data/yacc.c (yylen): Initialize to 0.
5580 Keep its value to the number of items to possibly shift.
5581 In particular, a regular successful parse that ends on YYFINAL by
5582 a (internal) YYACCEPT must not have yylen != 0.
5583 (yyerrorlab, yyreturn): Pop the RHS.
5584 Reorder a bit to emphasize the `shifting' bits of code.
5585 (YYPOPSTACK): Now accept a number of items to pop.
5586 * data/lalr1.cc: Likewise.
5587 * data/glr.c: Formatting changes.
5588 Use goto instead of fall through.
5589 * doc/bison.texinfo (Destructor Decl): Complete.
5590
55912005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5592
5593 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5594 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
5595 * djgpp/config.bat: Replace every occurence of the file name
5596 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5597 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5598 * djgpp/config.sed: Replace every occurence of the file name
5599 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5600 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5601 * djgpp/djunpack.bat: DJGPP specific file.
5602 * djgpp/fnchange.lst: DJGPP specific file.
5603 * djgpp/README.in: Add new information about how to unpack the bison
5604 source on MSDOS and other systems which have 8.3 file name restrictions
5605 using djunpack.bat and fnchange.lst.
5606
56072005-12-12 Paul Eggert <eggert@cs.ucla.edu>
5608
5609 * bootstrap (build_cvs_prefix): Remove; unused.
5610 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
5611 when getting gnulib.
5612
56132005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
5614
5615 * data/glr.c: Reorder typedef declarations for structs to match order
5616 of struct declarations.
5617 Rename yystack everywhere to yystackp except in yyparse where it's not
5618 a pointer.
5619 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
5620 consistency.
5621 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
5622 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
5623 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
5624 lint.
5625
56262005-12-09 Paul Eggert <eggert@cs.ucla.edu>
5627
5628 * tests/sets.at (Accept): Fix typos in regular expression used to
5629 sed out the final state number.
5630
5631 Work around portability problem on Solaris 10: flex-generated
5632 files include <stdio.h> before <config.h>, which messes up
5633 because the latter defines __EXTENSIONS__. Address the problem
5634 by creating two new little files that include <config.h> first,
5635 then include the flex-generated files. Rewrite everyone else
5636 to include <config.h> first, as well.
5637 * lib/timevar.c: Always include "config.h".
5638 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
5639 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
5640 (EXTRA_bison_SOURCES): New macro.
5641 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
5642 * src/system.h: Don't include config.h.
5643 * src/LR0.c: Include <config.h> first.
5644 * src/assoc.c: Likewise.
5645 * src/closure.c: Likewise.
5646 * src/complain.c: Likewise.
5647 * src/conflicts.c: Likewise.
5648 * src/derives.c: Likewise.
5649 * src/files.c: Likewise.
5650 * src/getargs.c: Likewise.
5651 * src/gram.c: Likewise.
5652 * src/lalr.c: Likewise.
5653 * src/location.c: Likewise.
5654 * src/main.c: Likewise.
5655 * src/muscle_tab.c: Likewise.
5656 * src/nullable.c: Likewise.
5657 * src/output.c: Likewise.
5658 * src/parse-gram.y: Likewise.
5659 * src/print.c: Likewise.
5660 * src/print_graph.c: Likewise.
5661 * src/reader.c: Likewise.
5662 * src/reduce.c: Likewise.
5663 * src/relation.c: Likewise.
5664 * src/state.c: Likewise.
5665 * src/symlist.c: Likewise.
5666 * src/symtab.c: Likewise.
5667 * src/tables.c: Likewise.
5668 * src/uniqstr.c: Likewise.
5669 * src/vcg.c: Likewise.
5670
5671 * src/parse-gram.y: Fix minor problems uncovered by lint.
5672 (current_lhs, current_lhs_location): Now static.
5673 (current_assoc): Remove unused variable.
5674
5675 Cleanups so that Bison-generated parsers have less lint.
5676 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
5677 Prepend /*ARGSUSED*/, for lint's sake.
5678 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
5679 definition if 'lint' is defined.
5680 (YYID): New macro (or function, if lint).
5681 All uses of /*CONSTCOND*/0 replaced by YYID(0).
5682 * data/yacc.c: Likewise.
5683 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
5684 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
5685 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
5686 is C++ only.
5687 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
5688 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
5689 Use YYID(0) rather than 0, for lint.
5690 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
5691 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
5692
56932005-12-07 Paul Eggert <eggert@cs.ucla.edu>
5694
5695 * tests/glr-regression.at
5696 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5697 Close memory leak reported by twlevo.
5698
56992005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
5700
5701 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
5702 all stacks.
5703 (yyparse): Iterate another stack in order to call user destructors.
5704 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5705 New test case.
5706 (Duplicated user destructor for lookahead): This test now is expected
5707 to succeed.
5708
57092005-12-01 Paul Eggert <eggert@cs.ucla.edu>
5710
5711 * NEWS: Document the following change.
5712 * data/yacc.c: Say "parser skeleton" rather than "file", since
5713 it's no longer just a file.
5714 * data/glr.c: Grant a special exception for C GLR parsers, that
5715 reads like the already-existing exception for C LALR(1) parsers.
5716 * data/glr.cc: Likewise.
5717 * data/lalr1.cc: Likewise.
5718 * data/location.cc: Likewise.
5719 * data/yacc.c: Reword the "written by" statement to clarify that
5720 it was the parser skeleton, not the entire output file.
5721 * data/glr.c: Written by Paul Hilfinger.
5722 * data/glr.cc: Written by Akim Demaille.
5723 * data/lalr1.cc: Likewise.
5724
57252005-11-18 Paul Eggert <eggert@cs.ucla.edu>
5726
5727 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
5728 Fix typos in previous change that broke 'make check'.
5729 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
5730 supported in C.
5731 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
5732 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
5733 We can revert this once things settle down.
5734
5735 * src/conflicts.c (conflicts_print): Don't print file name twice
5736 when %expect fails because there were no conflicts.
5737 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
5738 change.
5739 * tests/conflicts.at (%expect not enough, %expect too much):
5740 (%expect with reduce conflicts): Adjust to new behavior.
5741
57422005-11-18 Akim Demaille <akim@epita.fr>
5743
5744 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
5745 errors.
5746 * NEWS: Document this.
5747 * doc/bison.texinfo (Expect Decl): Likewise.
5748
57492005-11-16 Akim Demaille <akim@epita.fr>
5750
5751 Generalize the display of semantic values and locations in traces.
5752 * data/glr.c (yy_reduce_print): Fix indices (again).
5753 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
5754 literal integers.
5755 * data/lalr1.cc (yyreduce_print): Rename as...
5756 (yy_reduce_print): this.
5757 Display values and locations.
5758 * data/yacc.c (yy_reduce_print): Likewise.
5759 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
5760 (yysymprint): Move higher to be visible from yy_reduce_print).
5761 (yyparse): Adjust.
5762 * tests/calc.at: Adjust the expected length of the traces.
5763
57642005-11-14 Akim Demaille <akim@epita.fr>
5765
5766 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
5767 from 1 to N, while values and location start at 0.
5768 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
5769
57702005-11-14 Akim Demaille <akim@epita.fr>
5771
5772 * data/glr.c (yy_reduce_print): Fix the $ number.
5773
57742005-11-14 Akim Demaille <akim@epita.fr>
5775
5776 "Use" parse parameters.
5777 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
5778 * data/glr.c, data/glr.cc: Use them.
5779 * data/glr.c (YYUSE): Have a C++ definition that supports
5780 non-pointer types.
5781
57822005-11-14 Akim Demaille <akim@epita.fr>
5783
5784 * data/glr.c (yyexpandGLRStack): Declare only if defined.
5785
57862005-11-14 Akim Demaille <akim@epita.fr>
5787
5788 * data/glr.cc: New.
5789 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5790
57912005-11-12 Akim Demaille <akim@epita.fr>
5792
5793 Let position and location be PODs.
5794 * data/location.cc (position::initialize, location::initialize): New.
5795 (position::position, location::location): Define only if
5796 b4_location_constructors is defined.
5797 * data/lalr1.cc (b4_location_constructors): Define it for backward
5798 compatibility.
5799 * doc/bison.texinfo (Initial Action Decl): Use initialize.
5800
58012005-11-12 Akim Demaille <akim@epita.fr>
5802
5803 * data/lalr1.cc: Move the body of the ctor and dtor into the
5804 parser file (instead of the header).
5805 Wrap the implementations in a "namespace yy".
5806
58072005-11-12 Akim Demaille <akim@epita.fr>
5808
5809 Have glr.c include its header file when created.
5810 * data/glr.c (b4_shared_declarations): New.
5811 Output them verbatim in the parser if !%defines, otherwise
5812 output then in the header file, and include it instead.
5813
58142005-11-11 Akim Demaille <akim@epita.fr>
5815
5816 * data/glr.c: Comment changes.
5817
58182005-11-11 Akim Demaille <akim@epita.fr>
5819
5820 When yydebug, report semantic and location values for reductions.
5821 * data/glr.c (yy_reduce_print): Report the semantic values and the
5822 locations.
5823 (YY_REDUCE_PRINT): Adjust.
5824 (yyglrReduce): Use them.
5825 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
5826 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
5827 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
5828 traces.
5829
58302005-11-10 Akim Demaille <akim@epita.fr>
5831
5832 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
5833 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
5834 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
5835
58362005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
5837
5838 * m4/cxx.m4, examples/Makefile.am: Don't build
5839 examples/calc++ if no C++ compiler is available. (trivial change)
5840
58412005-11-09 Akim Demaille <akim@epita.fr>
5842
5843 * src/scan-skel.l: Use a couple of asserts.
5844
58452005-11-03 Akim Demaille <akim@epita.fr>
5846
5847 In some (weird) cases, the final state number is incorrect.
5848 Reported by Alexandre Duret-Lutz.
5849 * src/LR0.c (state_list_append): Remove the computation of
5850 final_state.
5851 (save_reductions): Do it here.
5852 (get_state): Alpha conversion.
5853 (generate_states): Use a for loop.
5854 * src/gram.h (item_number_is_rule_number)
5855 (item_number_is_symbol_number): New.
5856 * src/state.c: Use assert.
5857 * src/system.h: Include assert.h.
5858 * tests/sets.at (Accept): New.
5859
58602005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5861
5862 * data/glr.c (yyfill): Adjust comment.
5863 (yyresolveAction): Initialize default location properly
5864 for empty right-hand sides.
5865 (yydoAction): Ditto.
5866 Add comment explaining apparently dead code.
5867 * tests/glr-regression.at
5868 (Incorrectly initialized location for empty right-hand side in GLR):
5869 New test.
5870
58712005-10-30 Paul Eggert <eggert@cs.ucla.edu>
5872
5873 * bootstrap (cleanup_gnulib): New function. Use it to clean up
5874 gnulib when interrupted. This fixes some race conditions and
5875 works around some portability problems (one noted by Paul
5876 Hilfinger).
5877
58782005-10-22 Akim <akim@epita.fr>
5879
5880 * Makefile.cfg: Adjust to config -> build-aux.
5881 Reported by twledo.
5882
58832005-10-21 Akim Demaille <akim@epita.fr>
5884
5885 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
5886 the %parse-params.
5887 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
5888 * data/yacc.c (b4_Pure_if): Rename as...
5889 (b4_yacc_pure_if): this.
5890 (YY_SYMBOL_PRINT, yyparse): Adjust.
5891 * doc/bison.texinfo: Formatting changes.
5892
58932005-10-21 Akim Demaille <akim@epita.fr>
5894
5895 Finish the transition config -> build-aux.
5896 * configure.ac, Makefile.am: Use build-aux.
5897 * config/prev-version, config/announce-gen, config/Makefile.am:
5898 Move to...
5899 * build-aux/prev-version, build-aux/announce-gen,
5900 * build-aux/Makefile.am: here.
5901
59022005-10-14 Akim Demaille <akim@epita.fr>
5903
5904 * examples/calc++/test: Use set -x only when VERBOSE.
5905
59062005-10-13 Paul Eggert <eggert@cs.ucla.edu>
5907
5908 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
5909 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
5910
59112005-10-13 Akim Demaille <akim@epita.fr>
5912
5913 * src/scan-skel.l: Output the base name parts of the parser and
5914 header file names.
5915 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
5916 additional checks.
5917 Use this to exercise C++ outputs in subdirs.
5918 Reported by Oleg Smolsky.
5919
59202005-10-12 Paul Eggert <eggert@cs.ucla.edu>
5921
5922 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
5923 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
5924 Problem reported by John P. Hartmann.
5925 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
5926 already defined it.
5927
59282005-10-12 Akim Demaille <akim@epita.fr>
5929
5930 * src/parse-gram.y (version_check): Exit 63 to please missing
5931 (stands for "version mismatch).
5932 * tests/input.at, doc/bison.texinfo: Adjust.
5933
59342005-10-10 Paul Eggert <eggert@cs.ucla.edu>
5935
5936 Work around portability problems with Visual Age C compiler
5937 (xlc and xlC_r) reported by John P. Hartmann.
5938 * data/location.cc (initial_column, initial_line): Remove.
5939 All uses replaced by 0 and 1.
5940 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
5941 that xlc complains about.
5942 * src/scan-skel.l (skel_wrap): Likewise.
5943 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
5944 as __STDC__.
5945 * data/yacc.c (YYMODERN_C): New macro, which also looks at
5946 __STDC_VERSION__. Use it everywhere instead of looking at
5947 __STDC__ and __cplusplus.
5948
59492005-10-10 Akim Demaille <akim@epita.fr>
5950
5951 * examples/calc++/test: Be quiet unless VERBOSE.
5952
59532005-10-05 Paul Eggert <eggert@cs.ucla.edu>
5954
5955 * data/c.m4 (yydestruct, yysymprint):
5956 Use YYUSE instead of casting to void.
5957 * data/glr.c (YYUSE): New macro.
5958 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5959 Use it instead of rolling our own.
5960 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5961 (YYCHK1):
5962 Use /*CONSTCOND*/ to suppress lint warnings.
5963 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5964 (YY_STACK_PRINT): Use 'false' not '0'.
5965 (YYUSE): New macro.
5966 (yysymprint_, yydestruct_): Use it instead of rolling our own.
5967 * data/yacc.c (YYUSE): New macro.
5968 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
5969 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
5970 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
5971
5972
5973 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
5974 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
5975
59762005-10-04 Paul Eggert <eggert@cs.ucla.edu>
5977
5978 Undo the parts of the unlocked-I/O change that substituted
5979 putc or puts for printf. This might hurt performance a bit,
5980 but some people prefer the printf style.
5981 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
5982 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
5983 All uses replaced by YYFPRINTF and YYDPRINTF.
5984 * data/yacc.c: Likewise.
5985 * lib/bitset.c (bitset_print): Likewise.
5986 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
5987 putc and puts.
5988 * lib/lbitset.c (debug_lbitset): Likewise.
5989 * src/closure.c (print_firsts, print_fderives): Likewise.
5990 * src/gram.c (grammar_dump): Likewise.
5991 * src/lalr.c (look_ahead_tokens_print): Likewise.
5992 * src/output.c (escaped_output): Likewise.
5993 (user_actions_output): Break apart two printfs.
5994 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
5995 * src/reduce.c (reduce_print): Likewise.
5996 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
5997 * src/system.h: Include unlocked-io.h rathe than stdio.h.
5998
5999 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
6000 Use assignments rather than casts-to-void to suppress
6001 unused-variable warnings. This pacifies 'lint'.
6002 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
6003 unused-variable warnings.
6004
60052005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6006
6007 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
6008
60092005-10-02 Paul Eggert <eggert@cs.ucla.edu>
6010
6011 Use unlocked I/O for a minor performance improvement on hosts like
6012 GNU/Linux and Solaris that support unlocked I/O. The basic idea
6013 is to use the gnlib unlocked-io module, and to prefer putc and
6014 puts to printf when either will work (since the latter doesn't
6015 come in an unlocked flavor).
6016 * bootstrap (gnulib_modules): Add unlocked-io.
6017 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
6018 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
6019 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
6020 and similarly for puts and putc and printf.
6021 * data/yacc.c: Likewise.
6022 * lib/bitset.c (bitset_print): Likewise.
6023 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
6024 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
6025 to printf.
6026 * lib/lbitset.c (debug_lbitset): Likewise.
6027 * src/closure.c (print_firsts, print_fderives): Likewise.
6028 * src/gram.c (grammar_dump): Likewise.
6029 * src/lalr.c (look_ahead_tokens_print): Likewise.
6030 * src/output.c (escaped_output): Likewise.
6031 (user_actions_output): Coalesce two printfs.
6032 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
6033 * src/reduce.c (reduce_print): Likewise.
6034 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
6035 * src/system.h: Include unlocked-io.h rather than stdio.h.
6036
6037 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
6038 this confuses xgettext.
6039
60402005-10-02 Akim Demaille <akim@epita.fr>
6041
6042 * bootstrap (gnulib_modules): Add strverscmp.
6043 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
6044 * m4/.cvsignore: Add strverscmp.m4.
6045 * src/parse-gram.y (%require): New token, new rule.
6046 (version_check): New.
6047 * src/scan-gram.l (%require): Adjust.
6048 * tests/input.at (AT_REQUIRE): New.
6049 Use it.
6050 * doc/bison.texinfo (Require Decl): New.
6051 (Calc++ Parser): Use %require.
6052
60532005-10-02 Akim Demaille <akim@epita.fr>
6054
6055 * data/location.cc: New.
6056
60572005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
6058 Akim Demaille <akim@epita.fr>
6059
6060 Make sure -odir/foo.cc creates dir/location.hh etc.
6061 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
6062 (spec_file_prefix, spec_verbose_file, spec_graph_file)
6063 (spec_defines_file): Now const.
6064 (dir_prefix): New.
6065 (short_base_name): Remove.
6066 * src/files.c: Adjust.
6067 (dirname.h): Include.
6068 (base_name): Don't prototype it.
6069 (finput): Remove, duplicates gram_in.
6070 (full_base_name, short_base_name): Replace by...
6071 (all_but_ext, all_but_tab_ext): these.
6072 (compute_base_names): Rename as...
6073 (compute_file_name_parts): this.
6074 Update to compute the new variables, including dir_prefix.
6075 Adjust dependencies.
6076 * src/output.c (prepare): Output them.
6077 * src/reader.c: Adjust to use gram_in, not finput.
6078 * src/scan-skel.l (@dir_prefix@): New.
6079
60802005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6081
6082 * lib/subpipe.c: New function end_of_output_subpipe() added
6083 to allow support for non-posix systems. This is a no-op function
6084 for posix systems.
6085
6086 * lib/subpipe.h: New function end_of_output_subpipe() added
6087 to allow support for non-posix systems. This is a no-op function
6088 for posix systems.
6089
6090 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
6091 handle the lack of pipe/fork functionality on non-posix systems.
6092
6093 * djgpp/Makefile.maint: DJGPP specific file.
6094
6095 * djgpp/README.in: DJGPP specific file.
6096
6097 * djgpp/config.bat: DJGPP specific configuration file.
6098
6099 * djgpp/config.sed: DJGPP specific configuration file.
6100
6101 * djgpp/config.site: DJGPP specific configuration file.
6102
6103 * djgpp/config_h.sed: DJGPP specific configuration file.
6104
6105 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
6106
6107 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
6108
61092005-10-02 Akim Demaille <akim@epita.fr>
6110
6111 * data/location.cc: New, extract from...
6112 * data/lalr1.cc: here.
6113 (location.hh): Include it after the user prologue, in case the
6114 filename type is defined by the user.
6115 Forward declation location and position before the pre-prologue.
6116 (yyresult_): Rename as...
6117 (yyresult): this, it's a local variable, not an attribute.
6118 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
6119
61202005-10-01 Akim Demaille <akim@epita.fr>
6121
6122 * examples/extexi: Restore the #line generation.
6123
61242005-09-30 Akim Demaille <akim@epita.fr>,
6125 Alexandre Duret-Lutz <adl@gnu.org>
6126
6127 Move the token type and YYSTYPE in the parser class.
6128 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
6129 (parser::token): New, from the moved free definition of tokens.
6130 (parser::semantic_value): Now a full definition instead of an
6131 indirection to YYSTYPE.
6132 (b4_post_prologue): No longer included in the header file, but
6133 in the implementation file.
6134 * doc/bison.texi (C+ Language Interface): Update.
6135 * src/parse-gram.y: Support unary %define.
6136 * tests/actions.at: Define global_tokens_and_yystype for backward
6137 compatibility until we update the tests.
6138 * tests/calc.at: Idem.
6139 (first_line, first_column, last_line, last_column): Define for lalr1.cc
6140 to simplify the code.
6141
61422005-09-29 Paul Eggert <eggert@cs.ucla.edu>
6143
6144 Port to SunOS 4.1.4, which lacks strtoul and strerror.
6145 Ah, the good old days! Problem reported by Peter Klein.
6146 * bootstrap (gnulib_modules): Add strerror, strtoul.
6147 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
6148 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
6149
61502005-09-29 Akim Demaille <akim@epita.fr>
6151
6152 * data/c.m4 (b4_error_verbose_if): New.
6153 * data/lalr1.cc: Use it.
6154 (YYERROR_VERBOSE_IF): Remove.
6155 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
6156 parser members, replaced by...
6157 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
6158 local variables.
6159 (yysyntax_error_): Takes the state number as argument.
6160 (yyreduce_print_): Use the argument yyrule, not the former
6161 attribute yyn_.
6162
61632005-09-26 Paul Eggert <eggert@cs.ucla.edu>
6164
6165 * bootstrap (gnulib_modules): Add verify.
6166 * lib/.cvsignore: Add verify.h.
6167 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
6168 * src/system.h (verify): Remove.
6169 Include verify.h instead.
6170 * src/tables.c (tables_generate): Use new API for 'verify'.
6171
61722005-09-21 Paul Eggert <eggert@cs.ucla.edu>
6173
6174 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
6175 local variables whose names begin with 'yy'.
6176 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
6177 Trivial changes from Joel E. Denny.
6178
6179 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
6180 it itself.
6181 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
6182 don't use alloca any more.
6183
6184 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
6185 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
6186 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
6187 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
6188 to match yacc.c, to test more hosts.
6189
61902005-09-20 Paul Eggert <eggert@cs.ucla.edu>
6191
6192 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
6193 doesn't affect behavior.
6194 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
6195 Solaris, AIX, MSC.
6196 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
6197 This works a bit better with glibc, if user code has already included
6198 stdlib.h.
6199 * doc/bison.texinfo (Bison Parser): Document that users can't
6200 arbitrarily use malloc and free for other purposes. Document
6201 that <alloca.h> and <malloc.h> might be included.
6202 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
6203 user must declare alloca.
6204
6205 * HACKING (release): Forwarn the Translation Project about
6206 stable releses.
6207
62082005-09-20 Akim Demaille <akim@epita.fr>
6209
6210 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
6211
62122005-09-19 Paul Eggert <eggert@cs.ucla.edu>
6213
6214 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
6215 (YYSTACK_ALLOC_MAXIMUM): Use it.
6216 (yysyntax_error): New function.
6217 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
6218 multiple syntax errors are reported, and alloca is being used.
6219 Instead, reallocate buffers twice as big each time, so that
6220 we waste at most half the allocated memory. Start with a small
6221 (128-byte) buffer that will suffice in most cases anyway.
6222 Use yysyntax_error to do most of the work.
6223
6224 * doc/bison.texinfo (Error Reporting, Table of Symbols):
6225 yynerrs is the number of errors reported, not the number of
6226 errors encountered.
6227
6228 * tests/glr-regression.at (Duplicated user destructor for lookahead):
6229 Mark it as expected to fail.
6230 Cast result of malloc; problem reported by twlevo@xs4all.nl.
6231 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
6232 Don't start user-code symbols with "yy", to avoid name space problems.
6233
62342005-09-19 Akim Demaille <akim@epita.fr>
6235
6236 Remove the traits, failed experiment.
6237 It never proved useful, and anyway because of the current
6238 definition, it was not possible to have several specialization of
6239 this traits, making it useless.
6240 * data/lalr1.cc (yy:traits): Remove.
6241 Inline its definitions in the parser class.
6242
62432005-09-19 Akim Demaille <akim@epita.fr>
6244
6245 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
6246 least Mac OSX with a /usr/local install of gettext.
6247
62482005-09-19 Akim Demaille <akim@epita.fr>
6249
6250 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
6251 and yytoken for similarity with the other skeletons.
6252
62532005-09-19 Akim Demaille <akim@epita.fr>
6254
6255 * NEWS, configure.ac: update version number to 2.1a.
6256
62572005-09-16 Paul Eggert <eggert@cs.ucla.edu>
6258
6259 * NEWS: Version 2.1.
6260
6261 * NEWS: Remove notice of yytname change, since it was never in an
6262 official release.
6263 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
6264 diagnostic.
6265 * src/output.c (prepare): Likewise.
6266 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
6267 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
6268 is not defined. This is an awful hack, but it's enough for now.
6269 All callers changed.
6270 * tests/glr-regression-at (make_value): Args are const pointers now,
6271 to avoid GCC warning.
6272 (Duplicated user destructor for lookahead): New test. Currently
6273 skipped. It fails on my host but I'm not sure it'll always fail.
6274
62752005-09-16 Akim Demaille <akim@epita.fr>
6276
6277 * src/symtab.h (struct symbol): Declare the printer and destructor
6278 as const, to avoid accidental calls to free.
6279 (symbol_destructor_set, symbol_printer_set): Adjust.
6280 * src/symtab.c: Adjust.
6281
62822005-09-16 Akim Demaille <akim@epita.fr>
6283
6284 * data/c.m4 (b4_token_enums): New.
6285 (b4_token_defines): Rename as...
6286 (b4_token_enums_defines): this.
6287 (b4_token_defines): New, output only the #defines.
6288 * data/yacc.c, data/glr.c: Adjust.
6289 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
6290 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
6291 as default values.
6292
62932005-09-16 Akim Demaille <akim@epita.fr>
6294
6295 * data/lalr1.cc (yylex_): Remove, inline its code.
6296 (yyreport_syntax_error_): Remove, replaced by...
6297 (yysyntax_error_): this which returns a string and leaves to the
6298 caller the call to the users' error function.
6299 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
6300 Move from members of the parser object...
6301 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
6302 to local variables of the parse function.
6303
63042005-09-16 Akim Demaille <akim@epita.fr>
6305
6306 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
6307 since it's in Bison's name space.
6308
63092005-09-15 Paul Eggert <eggert@cs.ucla.edu>
6310
6311 * data/glr.c (yyresolveValue): Add default case to pacify
6312 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
6313
6314 * NEWS: Document when yyparse started to return 2.
6315 * doc/bison.texinfo (Parser Function): Document when yyparse
6316 returns 2.
6317
6318 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
6319 (b4_filename_type): Renamed back from b4_file_name_type. All uses
6320 changed.
6321 (class position): file_name -> filename (reverting). All uses changed.
6322
63232005-09-14 Paul Eggert <eggert@cs.ucla.edu>
6324
6325 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
6326 do anything if $@ exists. This reverts part of the 2005-07-07
6327 patch.
6328
63292005-09-11 Paul Eggert <eggert@cs.ucla.edu>
6330
6331 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
6332 contains obsolete information and isn't worth distributing as a
6333 separate file anyway.
6334 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
6335 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
6336 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
6337 (yyparse): Abort if user code uses longjmp to throw an unexpected
6338 value.
6339
63402005-09-09 Paul Eggert <eggert@cs.ucla.edu>
6341
6342 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
6343 Suggested by twlevo@xs4all.nl.
6344
6345 * data/glr.c (YYCHK1): Do not assume YYE is in range.
6346 This avoids a diagnostic from gcc -Wswitch-enum.
6347 Problem reported by twlevo@xs4all.nl.
6348
6349 * doc/bison.texinfo: Don't use "filename", as per GNU coding
6350 standards. Use "file name" or "file" or "name", depending on
6351 the context.
6352 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
6353 not to hack/foo.tab.c.
6354 (Calc++ Top Level): 2nd arg of main is not const.
6355 * data/glr.c: b4_filename -> b4_file_name.
6356 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
6357 All uses changed.
6358 (class position): filename -> file_name. All uses changed.
6359 * data/yacc.c: b4_filename -> b4_file_name.
6360 * lib/bitset.h: filename -> file_name in local vars.
6361 * lib/bitset_stats.c: Likewise.
6362 * src/files.c: Likewise.
6363 * src/scan-skel.l ("@output ".*\n): Likewise.
6364 * src/files.c (file_name_split): Renamed from filename_split.
6365 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
6366
63672005-09-08 Paul Eggert <eggert@cs.ucla.edu>
6368
6369 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
6370 to accommodate latest gnulib.
6371
6372 * tests/glr-regression.at (Duplicate representation of merged trees):
6373 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
6374
6375 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
6376 needed.
6377
63782005-08-26 Paul Eggert <eggert@cs.ucla.edu>
6379
6380 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
6381 All uses changed. Invoke user destructor after an error during a
6382 split parse (trivial change from Joel E. Denny).
6383
6384 * tests/glr-regression.at
6385 (User destructor after an error during a split parse): New test case.
6386 Problem reported by Joel E. Denny in:
6387 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
6388
63892005-08-25 Paul Eggert <eggert@cs.ucla.edu>
6390
6391 * README-cvs: Give URLs for recommended tools.
6392 Mention Gzip version problem, and bootstrapping issues.
6393 Remove troubleshooting section, as it's somewhat obsolete.
6394
6395 * bootstrap (no_cache): New var, to accommodate different wget
6396 variants. Use it instead of '-C off'. Problem reported by
6397 twlevo@xs4all.nl.
6398
6399 * data/glr.c (yydestroyStackItem): New function.
6400 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
6401 debugging information. Problem reported by Joel E. Denny.
6402
64032005-08-25 Akim Demaille <akim@epita.fr>
6404
6405 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
6406
64072005-08-24 Paul Eggert <eggert@cs.ucla.edu>
6408
6409 * data/glr.c (yyrecoverSyntaxError, yyreturn):
6410 Don't invoke destructor on unresolved entries.
6411 * tests/glr-regression.at
6412 (User destructor for unresolved GLR semantic value): New test case.
6413 Problem reported by Joel E. Denny in:
6414 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
6415
64162005-08-21 Paul Eggert <eggert@cs.ucla.edu>
6417
6418 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
6419 Add strnlen.c.
6420 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
6421 lib-prefix.m4, po.m4.
6422
6423 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
6424 in yydestruct diagnostic, since it might not be an error.
6425 Problem reported by Joel Denny near end of
6426 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6427 * data/lalr1.cc (yyerturn): Likewise.
6428 * data/yacc.c (yyreturn): Likewise.
6429 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
6430
6431 * src/files.c: Remove obsolete FIXME comment.
6432
6433 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
6434 with the other templates, and to fix bogus run-on messages such
6435 as the one reported at the end of
6436 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6437 All callers changed to avoid the newline.
6438 (yyprocessOneStack): Output two lines rather than one, to accommodate
6439 the above change. This changes the debug output format slightly.
6440
6441 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
6442 reported by Joel E. Denny in
6443 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
6444 (trivial change).
6445 * tests/glr-regression.at (Duplicate representation of merged trees):
6446 New test, from Joel E. Denny in:
6447 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
6448 * THANKS: Add Joel E. Denny.
6449
6450 * configure.ac (AC_INIT): Bump to 2.0c.
6451
64522005-07-24 Paul Eggert <eggert@cs.ucla.edu>
6453
6454 * NEWS: Version 2.0b.
6455
6456 * Makefile.am (SUBDIRS): Put examples before tests, so that
6457 "make check" doesn't finish with "All 1 tests passed".
6458
6459 * tests/regression.at (Token definitions): Don't rely on
6460 AT_PARSER_CHECK for data that contains backslashes. It currently
6461 uses 'echo', and 'echo' isn't portable if its argument contains
6462 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
6463 that the byte '\0xff' is not printable in the C locale; it is,
6464 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
6465 not printable, so use '\0x81' to test.
6466
6467 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
6468 version of GCC, since the macro is used with non-GCC compilers.
6469
6470 Fix core dump reported by Pablo De Napoli in
6471 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
6472 * tests/regression.at (Invalid inputs with {}): New test.
6473 * src/parse-gram.y (token_name): Translate type before using
6474 it as an index.
6475
6476 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
6477 the user's name space. All uses changed to __attribute__
6478 ((__unused__)).
6479 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
6480 Add __attribute__ ((__noreturn__)).
6481
6482 * etc/clcommit: Remove. We weren't using it, and it failed
6483 "make maintainer-distcheck".
6484 * Makefile.maint: Merge from coreutils.
6485 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
6486 (syntax-check-rules): Change list of rules as described below.
6487 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
6488 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
6489 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
6490 (sc_trailing_space): New rules.
6491 (sc_xalloc_h_in_src): Remove.
6492 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
6493 (sc_space_tab, sc_error_exit_success, sc_changelog):
6494 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
6495 (makefile-check, po-check, author_mark_check):
6496 (makefile_path_separator_check, copyright-check):
6497 Use grep -n, to make it easier to find violations.
6498 Use CVS_LIST and CVS_LIST_EXCEPT.
6499 (header_regexp, h_re): Remove.
6500 (dd_c): New macro.
6501 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
6502 (my-distcheck): Use more-modern GCC flags.
6503 (signatures, %.asc): Remove.
6504 (rel-files, announcement): Remove signatures.
6505 Restore old updating code, even though we don't use it, so
6506 that we're the same as coreutils.
6507 (alpha, beta, major): Depend on news-date-check.
6508 Make the upload commands.
6509
6510 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
6511 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
6512 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
6513 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
6514 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
6515 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
6516 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
6517 * tests/sets.at: Likewise.
6518
6519 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
6520 we comment out the Autoconf version number.
6521 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
6522 it's error-prone and "make maintainer-distcheck" rejects it.
6523
6524 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
6525 Indent calls to "error" to pacify "make maintainer-distcheck",
6526 when the calls are not intended to be translated.
6527 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
6528
6529 * src/Makefile.am (DEFS): Use +=, to pacify
6530 "make maintainer-distcheck".
6531 (bison_SOURCES): Add scan-skel.h.
6532 (sc_tight_scope): New rule, from coreutils.
6533
6534 * src/files.c (src_extension, header_extension):
6535 Now static, not extern.
6536 * src/getargs.c (short_options): Likewise.
6537 * src/muscle_tab.c (muscle_table): Likewise.
6538 * src/parse-gram.y (current_class, current_type, current_prec):
6539 Likewise.
6540 * src/reader.c (grammar_end, previous_rule_end): Likewise.
6541 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
6542 * src/main.c (main): Cast bindtextdomain and textdomain calls to
6543 void, to avoid warning when NLS is disabled.
6544 * src/output.c: Include scan-skel.h.
6545 (scan_skel): Remove decl, since scan-skel.h does this.
6546 (output_skeleton):
6547 Indent calls to "error" to pacify "make maintainer-distcheck".
6548 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
6549 * src/reader.h (gram_end, gram_lineno): New decls to pacify
6550 "make maintainer-distcheck".
6551 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
6552 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
6553 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
6554 (skel_lex_destroy, scan_skel): Move these decls to...
6555 * src/scan-skel.h: New file.
6556 * src/uniqstr.c (uniqstr_assert):
6557 Indent calls to "error" to pacify "make maintainer-distcheck".
6558
6559 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
6560 not @VAR@.
6561
6562 * tests/torture.at: Revamp to avoid misuse of atoi that
6563 "make maintainer-distcheck" complained about.
6564
6565 * examples/extexi (message): Don't print a message more than once,
6566 and omit line-number decoration that makes Emacs compile think
6567 that informative messages are worth worrying about.
6568
65692005-07-22 Paul Eggert <eggert@cs.ucla.edu>
6570
6571 * configure.ac: Update version number.
6572
6573 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
6574 accidentally.
6575 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
6576 autogenerated by the maintainer.
6577 * examples/calc++/.cvsignore: Add *.yy.
6578
6579 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
6580 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6581 * lib/bitsetv.c (bitsetv_alloc): Likewise.
6582
6583 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
6584
6585 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
6586 from maintainer-distcheck about casting the argument of 'free'.
6587
6588 * NEWS: Mention recent yytname changes.
6589 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
6590
6591 * bootstrap: For translations that have not yet been upgraded to
6592 the new runtime-po domain, prime the pump by extracting the
6593 relevant strings from the obsolete translations. This code can be
6594 removed once the bison-runtime domain has been translated by each
6595 team.
6596
6597 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
6598 now that token names are already quoted.
6599
6600 Fix problem reported by Anthony Heading.
6601 * data/glr.c (YYTOKEN_TABLE): New macro.
6602 (yytname): Define if YYTOKEN_TABLE.
6603 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
6604 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
6605 (YYERROR_VERBOSE): Define the same way the other skeletons do.
6606 * src/output.c (prepare_symbols): Output token_table_flag.
6607
66082005-07-21 Paul Eggert <eggert@cs.ucla.edu>
6609
6610 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
6611 again if the first call fails.
6612
6613 * data/glr.c (yytnamerr): New function.
6614 (yyreportSyntaxError): Use it to dequote most string literals.
6615 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
6616 with other skeletons. All uses changed.
6617 (yytnameerr_): New function.
6618 (yyreport_syntax_error): Use it to dequote most string literals.
6619 * data/yacc.c (yytnamerr): New function.
6620 (yyerrlab): Use it to decode most string literals.
6621 * doc/bison.texinfo (Decl Summary, Calling Convention):
6622 Clarify quoting convention of yytname.
6623 * src/output.c (prepare_symbols): Quote all names. This undoes
6624 the 2005-04-17 change, which is now accomplished (mostly) via
6625 changes in the parsers as described above.
6626 * tests/regression.at (Token definitions, Web2c Actions):
6627 Undo most 2005-04-17 change here, too.
6628
66292005-07-20 Paul Eggert <eggert@cs.ucla.edu>
6630
6631 Fix more problems reported by twlevo@xs4all.nl.
6632 * tests/cxx-type.at: Don't pipe output of ./types through sed to
6633 remove trailing spaces. This loses the exit status of ./types,
6634 and isn't needed since ./types shouldn't be emitting trailing
6635 spaces.
6636 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
6637 as the stack isn't valid in that case.
6638
6639 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6640 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6641 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6642 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
6643 is used.
6644 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
6645 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6646 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6647 Likewise.
6648
6649 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
6650 overly-picky compilers that reject 'char *foo = "bar";'.
6651
6652 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
6653 to FILE * parameter, not to stderr. This fixes a typo introduced
6654 in the 2005-07-12 change.
6655
6656 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
6657 warnings from GCC 4.
6658
6659 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
6660 (yyglrShiftDefer, yysplitStack):
6661 Remove unused parameters b4_pure_formals. All uses changed.
6662 (yyglrShift): Remove unused parameters b4_user_formals.
6663 All uses changed.
6664 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
6665
66662005-07-18 Paul Eggert <eggert@cs.ucla.edu>
6667
6668 Destructor cleanups and regularization among the three skeletons.
6669 * NEWS: Document the behavior changes.
6670 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
6671 stack before failing, as the cleanup code will do it for us now.
6672 * data/lalr1.cc (yyerrlab): Likewise.
6673 * data/glr.c (yyparse): Pop everything off the stack before
6674 freeing it, so that destructors get called properly.
6675 * data/lalr1.cc (yyreturn): Likewise.
6676 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
6677 This is more consistent.
6678 * doc/bison.texinfo (Destructor Decl): Mention more reasons
6679 why destructors might be called. 1.875 -> 2.1.
6680 (Destructor Decl, Decl Summary, Table of Symbols):
6681 Some English-language cleanups for %destructor.
6682 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6683 Add output line for destructor of start symbol.
6684 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
6685 because of that same extra output line.
6686
6687 * NEWS: Document minor wording changes in diagnostics of
6688 Bison-generated parsers.
6689 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
6690 Remove unused formals. All uses changed.
6691 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
6692 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
6693 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
6694 Rename yyoverflowab to yyexhaustedlab.
6695 When memory exhaustion occurs during syntax-error reporting,
6696 report it separately rather than in a single diagnostic; this
6697 eases translation.
6698 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
6699 (Memory Exhausted): Renamed from Parser Stack Overflow.
6700 Revamp wording slightly to prefer "memory exhaustion".
6701 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
6702
6703 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
6704
6705 Add i18n support to the GLR skeleton. Partially fix the C++
6706 skeleton; a C++ expert needs to finish this. Remove debugging
6707 msgids; there's little point to having them translated, since they
6708 can be understood only by someone who can read the
6709 (English-language) source code.
6710
6711 Generate runtime-po/bison-runtime.pot automatically, so that we
6712 don't have to worry about garbage getting in that file. We'll
6713 make sure after the next official release that old msgids don't
6714 get lost. See
6715 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
6716
6717 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
6718 Now auto-generated.
6719 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
6720 Fix typos in explanations of the runtime file.
6721 * bootstrap: Change gettext keyword from YYI18N to YY_.
6722 Use standard Makefile.in.in in runtime-po, since we'll arrange
6723 for backward-compatible bison-runtime.po files in a different way.
6724 * data/glr.c (YY_): New macro, from yacc.c.
6725 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
6726 Translate messages intended for users.
6727 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
6728 the wording in the other skeletons. We don't know that the memory
6729 is virtual.
6730 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
6731 Use same method that yacc.c uses.
6732 Don't translate debugging messages.
6733 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
6734 it doesn't work (yet), and requires C++ expertise to fix.
6735 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
6736 Move defn to a more logical place, to be consistent with other
6737 skeletons.
6738 Don't translate debugging messages.
6739 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
6740 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
6741 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
6742 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
6743
6744 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
6745 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
6746 void, not int.
6747 * tests/glr-regression.at (Badly Collapsed GLR States):
6748 Likewise.
6749 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6750 yylex should return 0 at EOF rather than aborting.
6751
6752 Improve tests for stack overflow in GLR parser.
6753 Problem reported by twlevo@xs4all.nl.
6754 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
6755 All uses removed.
6756 (yyStackOverflow): Just longjmp, but with value 2 so that caller
6757 can handle the problem.
6758 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
6759 (yyparse): New local variable yyresult to record the result.
6760 Use result of setjmp to set it, rather than storing itinto
6761 struct.
6762 (yyDone): Remove label.
6763 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
6764 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
6765 if YYABORT is used).
6766 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
6767 yyparse status; put status > 1 into diagnostic.
6768 Check that status==2 works.
6769 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
6770 Use exit status 3 for failure to open (which shouldn't happen).
6771
67722005-07-17 Paul Eggert <eggert@cs.ucla.edu>
6773
6774 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
6775 1 on syntax error; just let yyparse do its thing.
6776 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
6777 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
6778 (Exploding the Stack Size with Alloca):
6779 (Exploding the Stack Size with Malloc):
6780 Expect exit status 2, not 1, since the parser is supposed to blow
6781 its stack. Problem reported by twlevo@xs4all.nl.
6782
6783 * data/glr.c (yyparse): Don't assume that the initial calls
6784 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
6785 Print a stack-overflow message and fail instead.
6786 Initialize the line-number information before creating the stack,
6787 so that the stack-overflow message can report line zero safely.
6788
67892005-07-14 Paul Eggert <eggert@cs.ucla.edu>
6790
6791 Fix problems reported by twlevo@xs4all.nl.
6792 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
6793 (yyuserMerge): Provide a default case if b4_mergers is empty.
6794 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
6795 * tests/glr-regression.at
6796 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6797 Add casts to pacify C++ compilers.
6798 * tests/glr-regression.at (Improper merging of GLR delayed action
6799 sets): Declare yylex before using it.
6800 * tests/Makefile.am (maintainer-check-g++): Fix a stray
6801 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
6802 test for valgrind; valgrind is independent of g++.
6803 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
6804 for compatibility with POSIX 1003.1-2001 (if running coreutils).
6805 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
6806 Use a destructor, so that we can expand the stack. Change
6807 YYSTYPE to char * so that we can free it. Cast result of malloc.
6808
68092005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6810
6811 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
6812 a valgrind failure. Problem reported by twlevo@xs4all.nl.
6813
68142005-07-13 Paul Eggert <eggert@cs.ucla.edu>
6815
6816 * PACKAGING: New file, suggested by Bruno Haible and taken from
6817 similar wording in gettext's PACKAGING file.
6818 * NEWS: Mention PACKAGING.
6819 * Makefile.am (EXTRA_DIST): Add PACKAGING.
6820
68212005-07-12 Paul Eggert <eggert@cs.ucla.edu>
6822
6823 * NEWS: Document recent i18n improvements.
6824 * bootstrap: Get runtime translations into runtime-po.
6825 Create runtime-po files automatically, if possible.
6826 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
6827 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
6828 does not infringe on the user's name space.
6829 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
6830 * doc/bison.texinfo (Internationalization): Revamp the English
6831 and Texinfo syntax a bit, to try to make it clearer.
6832 (Bison Options, Option Cross Key): Mention --print-localedir.
6833 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
6834 YYENABLE_NLS. Quote a bit more.
6835 * runtime-po/.cvsignore: New file.
6836 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
6837 * runtime-po/Rules-quot: Remove; now created by bootstrap.
6838 * runtime-po/quot.sed: Likewise.
6839 * runtime-po/boldquot.sed: Likewise.
6840 * runtime-po/en@quot.header: Likewise.
6841 * runtime-po/en@boldquot.header: Likewise.
6842 * runtime-po/insert-header.sin: Likewise.
6843 * runtime-po/remove-potcdate.sin: Likewise.
6844 * runtime-po/Makevars: Likewise.
6845 * runtime-po/LINGUAS: Likewise.
6846 * runtime-po/de.po: Likewise; we will rely on the translation project
6847 to maintain this, so "bootstrap" should get it.
6848 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
6849 its value.
6850 * src/main.c (main): Bind the bison-runtime domain, too.
6851
68522005-07-12 Bruno Haible <bruno@clisp.org>
6853
6854 * data/yacc.c: Include <libintl.h> when NLS is enabled.
6855 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
6856 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
6857 * runtime-po: New directory.
6858 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
6859 $(DOMAIN).pot-update rule, so that old messages are never dropped.
6860 * runtime-po/Rules-quot: New file, copied from po/.
6861 * runtime-po/quot.sed: Likewise.
6862 * runtime-po/boldquot.sed: Likewise.
6863 * runtime-po/en@quot.header: Likewise.
6864 * runtime-po/en@boldquot.header: Likewise.
6865 * runtime-po/insert-header.sin: Likewise.
6866 * runtime-po/remove-potcdate.sin: Likewise.
6867 * runtime-po/Makevars: New file.
6868 * runtime-po/POTFILES.in: New file.
6869 * runtime-po/LINGUAS: New file.
6870 * runtime-po/bison-runtime.pot: New file.
6871 * runtime-po/de.po: New file.
6872 * m4/bison.m4: New file.
6873 * Makefile.am (SUBDIRS): Add runtime-po.
6874 (aclocaldir, aclocal_DATA): New variables.
6875 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
6876 Define aclocaldir.
6877 * src/getargs.c (usage): Document --print-localedir option.
6878 (PRINT_LOCALEDIR_OPTION): New enum item.
6879 (long_options): Add --print-localedir option.
6880 (getargs): Handle --print-localedir option.
6881 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
6882 (Internationalization): New section.
6883
68842005-07-12 Akim Demaille <akim@epita.fr>
6885
6886 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
6887 for consistency with the rest of the code.
6888 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
6889 Add separators.
6890
68912005-07-12 Akim Demaille <akim@epita.fr>
6892
6893 * src/parse-gram.y: Use %printer instead of YYPRINT.
6894
68952005-07-12 Akim Demaille <akim@epita.fr>
6896
6897 * src/symtab.h, src/symtab.c (symbol_print): New.
6898 * src/symlist.h, src/symlist.c (symbol_list_print): New.
6899 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
6900
69012005-07-12 Akim Demaille <akim@epita.fr>
6902
6903 * data/glr.c (b4_syncline): Fix (swap) the definitions of
6904 b4_at_dollar and b4_dollar_dollar.
6905
69062005-07-11 Paul Eggert <eggert@cs.ucla.edu>
6907
6908 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
6909 and Pennello's paper.
6910
69112005-07-09 Paul Eggert <eggert@cs.ucla.edu>
6912
6913 * data/yacc.c (yyparse): Undo previous patch. Instead,
6914 set yylsp[0] and yyvsp[0] only if the initial action
6915 sets yylloc and yylval, respectively.
6916
6917 * data/yacc.c (yyparse): In the initial action, set
6918 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
6919 This avoids the use of undefined variables if the initial
6920 action does not set yylloc and/or yylval.
6921
69222005-07-07 Paul Eggert <eggert@cs.ucla.edu>
6923
6924 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
6925 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
6926 Remove from CVS. These files are automatically generated.
6927 * examples/extexi: Clarify that this file is now part of Bison,
6928 not GNU M4, and that it works with any POSIX-compatible Awk.
6929 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
6930 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
6931 so that we also get calc++-parser.yy. Geneate it.
6932 Use $(AWK), not gawk, since any conforming Awk will do.
6933 Put comment before action, since older 'make' can't handle comment
6934 in action.
6935 $(BUILT_SOURCES): List all built sources, not just some of them.
6936 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
6937 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
6938 $($(calc_sources_generated)): Remove unnecessary test for existence
6939 of target. (This had a shell syntax error anyway; a stray "x".)
6940 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
6941 calc++-parser.yy.
6942 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
6943
6944 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
6945 implied by the other modules.
6946
69472005-07-06 Akim Demaille <akim@epita.fr>
6948
6949 Bind examples/calc++ to the package.
6950 * examples/calc++/Makefile: Remove, replaced by...
6951 * examples/calc++/Makefile.am: ... this new file.
6952 * examples/calc++/test: Remove input.
6953 * examples/calc++/compile: Remove.
6954 * examples/Makefile.am: New.
6955 * configure.ac, Makefile.am: Adjust.
6956 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
6957
69582005-07-05 Paul Eggert <eggert@cs.ucla.edu>
6959
6960 * data/glr.c (yyFail): Drastically simplify; since the format argument
6961 never had any % directives, we can simply pass it to yyerror.
6962 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
6963 be modified later, as that is the usual style in glr.c.
6964 Problems reported by Paul Hilfinger.
6965
6966 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
6967 and size overflow errors.
6968 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
6969 in case the user prolog sets feature-test macros like _GNU_SOURCE.
6970 (YYSIZEMAX): New macro.
6971 (yystpcpy): New function, taken from yacc.c.
6972 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
6973 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
6974 so that we don't have to maintain their signatures.
6975 (yyFail): Check for buffer overflow, by using vsnprintf rather
6976 than vsprintf. Allocate a bigger buffer if possible.
6977 Report an error if buffer allocation fails.
6978 (yyStackOverflow): New function.
6979 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
6980 the initialization was successful. It might fail if storage was
6981 exhausted.
6982 (yyexpandGLRStack): Add more checks for storage allocation failure.
6983 Use yyStackOverflow to report failures.
6984 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
6985 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
6986 Don't assume stack number fits in int.
6987 (yysplitStack): Check for storage allocation failure.
6988 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
6989 can print diagnostics on storage allocation failure. All callers
6990 changed.
6991 (yyresolveValue): Use yybool for boolean.
6992 (yyreportSyntaxError): Check for size-calculation overflow.
6993 This code is taken from yacc.c.
6994 (yyparse): Check for storage allocation errors when allocating
6995 the initial stack.
6996
69972005-07-05 Akim Demaille <akim@epita.fr>
6998
6999 Extract calc++ from the documentation.
7000 * doc/bison.texinfo (Calc++): Add the extraction marks.
7001 * examples/extexi: New, from the aborted GNU Programming 2E.
7002 Separate the different paragraph of a file with empty lines.
7003 * examples/Makefile: Use it to extract the whole calc++ example.
7004
70052005-06-24 Akim Demaille <akim@epita.fr>
7006
7007 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
7008 class typedefs.
7009
70102005-06-22 Akim Demaille <akim@epita.fr>
7011
7012 * doc/bison.texinfo (C++ Language Interface): First stab.
7013 (C++ Parsers): Remove.
7014
70152005-06-22 Akim Demaille <akim@epita.fr>
7016
7017 * data/lalr1.cc (yylex_): Honor %lex-param.
7018
70192005-06-22 Akim Demaille <akim@epita.fr>
7020
7021 Start a set of simple examples.
7022 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
7023 * examples/calc++/calc++-driver.hh,
7024 * examples/calc++/calc++-parser.yy,
7025 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
7026 * examples/calc++/compile, examples/calc++/test: New.
7027
70282005-06-09 Paul Eggert <eggert@cs.ucla.edu>
7029
7030 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
7031 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
7032 which stems from the 2005-05-27 patch.
7033
70342005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7035
7036 * data/glr.c: Modify treatment of unused parameters to permit use
7037 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
7038
70392005-05-30 Paul Eggert <eggert@cs.ucla.edu>
7040
7041 Fix infringement on user name space reported by Janos Zoltan Szabo.
7042 * data/yacc.c (yyparse): strlen -> yystrlen.
7043
70442005-05-30 Akim Demaille <akim@epita.fr>
7045
7046 * data/lalr1.cc (_): New.
7047 Translate the various messages.
7048
70492005-05-27 Paul Eggert <eggert@cs.ucla.edu>
7050
7051 Fix infringement on user name space reported by Bruno Haible.
7052 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
7053 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
7054 the user's name space.
7055 (alloca): Include <stdlib.h> to get it, if it's not built in.
7056 (YYMALLOC, YYFREE): Define only if needed.
7057 (malloc, free): Declare, but only if needed, as this infringes on
7058 the user name space.
7059
70602005-05-25 Paul Eggert <eggert@cs.ucla.edu>
7061
7062 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
7063 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
7064 with %d format.
7065 * lib/ebitset.c (min, max): Undef before defining.
7066 * lib/vbitset.c (min, max): Likewise.
7067 * lib/subpipe.c (create_subpipe): Save local variables in case
7068 vfork clobbers them.
7069
70702005-05-24 Bruno Haible <bruno@clisp.org>
7071
7072 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
7073 error message syntax used by gcc-4.0.
7074
70752005-05-23 Paul Eggert <eggert@cs.ucla.edu>
7076
7077 * README: Mention m4 1.4.3. Remove obsolete advice about
7078 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
7079
7080 * bootstrap: Remove workaround for problem I encountered with
7081 gettext 0.14.1; it seems to be fixed now.
7082
70832005-05-22 Paul Eggert <eggert@cs.ucla.edu>
7084
7085 * NEWS: Version 2.0a.
7086
7087 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
7088 the previous change.
7089
7090 Various maintainer cleanups.
7091 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
7092 conftest*, for benefit of CVS commands run at the same time as
7093 "configure". Add build-aux, since "bootstrap" now creates it and
7094 its subfiles.
7095 * Makefile.cfg (move_if_change): Remove.
7096 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
7097 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
7098 (po_repo, do-po-update, po-update, wget_files, get-targets):
7099 (config.guess-url_prefix, config.sub-url_prefix):
7100 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
7101 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
7102 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
7103 Remove.
7104 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
7105 this is now the recommended name.
7106 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
7107 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
7108 ylwrap. These files now go into build-aux.
7109 * config/move-if-change: Remove.
7110 * config/prev-version.txt: Bump from 1.75 to 2.0.
7111
7112 * bootstrap: Add stdio-safer, unistd-safer modules.
7113 Remove m4/glibc2.m4 (introduced by latest gnulib, but
7114 we don't need it).
7115 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
7116 fopen-safer.c, stdio-safer.h, unistd-safer.h.
7117 * lib/subpipe.c: Include "unistd-safer.h".
7118 (create_subpipe): Make sure all the newly-created
7119 file descriptors are > 2, so that diagnostics don't
7120 get sent down them (which might cause Bison to hang, in theory).
7121 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
7122 * src/files.c (xfopen): Use fopen_safer, not fopen.
7123
7124 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
7125 yesterday's yacc.c fix.
7126
71272005-05-21 Paul Eggert <eggert@cs.ucla.edu>
7128
7129 * data/glr.c, data/lalr1.cc: Update copyright date.
7130
7131 Fix a destructor bug reported by Wolfgang Spraul in
7132 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
7133 * data/yacc.c (yyabortlab): Don't call destructor, and
7134 don't set yychar to EMPTY.
7135 (yyoverflowlab): Don't call destructor.
7136 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
7137 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
7138 since we no longer output the message "discarding lookahead token
7139 end of input ()".
7140
71412005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7142
7143 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
7144 fix a small glitch in debugging output.
7145 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
7146 after YY_SYMBOL_PRINT where needed.
7147
7148 (struct yyGLRState): Add some comments.
7149 (struct yySemanticOption): Add some comments.
7150 (union yyGLRStackItem): Add comment.
7151
7152 (yymergeOptionSets): Correct this to properly perform the union,
7153 avoiding infinite reported by Michael Rosien.
7154 Update comment.
7155
7156 * tests/glr-regression.at: Add test for GLR merging error reported
7157 by M. Rosien.
7158
71592005-05-13 Paul Eggert <eggert@cs.ucla.edu>
7160
7161 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
7162 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
7163 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
7164 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
7165 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
7166 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
7167 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
7168 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
7169 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
7170 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
7171 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
7172 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
7173 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
7174 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
7175 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
7176 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
7177 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
7178 src/derives.h, src/files.c, src/files.h, src/getargs.c,
7179 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
7180 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
7181 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
7182 src/output.h, src/parse-gram.c, src/parse-gram.h,
7183 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
7184 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
7185 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
7186 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
7187 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
7188 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
7189 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
7190 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
7191 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
7192 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
7193 tests/reduce.at, tests/regression.at, tests/sets.at,
7194 tests/synclines.at, tests/testsuite.at, tests/torture.at:
7195 Update FSF postal mail address.
7196
71972005-05-11 Paul Eggert <eggert@cs.ucla.edu>
7198
7199 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
7200 Problem reported by Ralf Menzel.
7201
72022005-05-01 Paul Eggert <eggert@cs.ucla.edu>
7203
7204 * tests/actions.at: Test that stack overflow invokes destructors.
7205 From Marcus Holland-Moritz.
7206 * data/yacc.c (yyerrlab): Move the code that destroys the stack
7207 from here....
7208 (yyreturn): to here. That way, destructors are called properly
7209 even if the stack overflows, or the user calls YYACCEPT or
7210 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
7211 (yyoverflowlab): Destroy the lookahead.
7212
72132005-04-24 Paul Eggert <eggert@cs.ucla.edu>
7214
7215 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
7216
72172005-04-17 Paul Eggert <eggert@cs.ucla.edu>
7218
7219 * NEWS: Bison-generated C parsers no longer quote literal strings
7220 associated with tokens.
7221 * src/output.c (prepare_symbols): Don't escape strings,
7222 since users don't want to see C escapes.
7223 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
7224 in diagnostics.
7225 * tests/input.at (Torturing the Scanner): Likewise.
7226 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
7227
72282005-04-16 Paul Eggert <eggert@cs.ucla.edu>
7229
7230 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
7231 the data size is known to be too small and we can't increase it.
7232 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
7233
72342005-04-15 Paul Eggert <eggert@cs.ucla.edu>
7235
7236 * src/parse-gram.y: Include quotearg.h.
7237 (string_as_id): Quote $1 before using it as a key, since the
7238 lexer no longer quotes it for us.
7239 (string_content): Don't strip quotes, since lexer no longer
7240 quotes it for us.
7241 * src/scan-gram.l: Include quotearg.h.
7242 ("\""): Omit quote.
7243 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
7244 a key, since the rest of the lexer doesn't quote it.
7245 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
7246 * tests/regression.at (Token definitions): Check for backslashes
7247 in token strings.
7248
7249 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
7250 (YYSIZE_T): Define to unsigned long int when using an older compiler.
7251 (yyparse): Revamp code to generate long syntax error message, to
7252 make it easier to translate, and to avoid problems with arithmetic
7253 overflow. Change "virtual memory" to "memory" in diagnostic, since
7254 we don't know whether the memory is virtual.
7255
72562005-04-13 Paul Eggert <eggert@cs.ucla.edu>
7257
7258 * NEWS: Bison-generated C parsers now use the _ macro to
7259 translate strings.
7260 * data/yacc.c (_) [!defined _]: New macro.
7261 All English strings wrapped inside this macro.
7262 * doc/bison.texinfo (Bison Parser): Document _.
7263 * po/POTFILES.in: Include src/parse-gram.c, since it now
7264 includes translateable strings that parse-gram.y doesn't.
7265
72662005-04-12 Paul Eggert <eggert@cs.ucla.edu>
7267
7268 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
7269 reverting the 2004-10-11 change to this function.
7270 (symbol_check_alias_consistency): Don't call symbol_type_set
7271 if the type name is already correct.
7272 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
7273
72742005-03-25 Paul Eggert <eggert@cs.ucla.edu>
7275
7276 * tests/regression.at (Token definitions): Don't use a token named
7277 c, as that generates a "#define c ..." that runs afoul of buggy
7278 stdlib.h that uses the identifier c as a member of struct
7279 drand48_data. Problem reported by Horst Wente.
7280
72812005-03-21 Paul Eggert <eggert@cs.ucla.edu>
7282
7283 * bootstrap: Change translation URL from
7284 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
7285 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
7286 redirection glitches. Problem reported by twlevo@xs4all.nl.
7287
72882005-03-20 Paul Eggert <eggert@cs.ucla.edu>
7289
7290 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
7291 after operands; POSIX says this isn't portable for the c99 command.
7292
72932005-03-18 Paul Eggert <eggert@cs.ucla.edu>
7294
7295 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
7296 immediately if a data overrun has occurred; this may help us track
7297 down what may be a spurious failure on MacOS.
7298
72992005-03-17 Paul Eggert <eggert@cs.ucla.edu>
7300
7301 Respond to problems reported by twlevo@xs4all.nl.
7302
7303 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
7304
7305 * src/vcg.h: Comment fix.
7306 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
7307 (G_CMAX): Change to -1 instead of INT_MAX.
7308
7309 * data/yacc.c (yyparse): Omit spaces before #line.
7310
73112005-03-15 Paul Eggert <eggert@cs.ucla.edu>
7312
7313 * src/tables.c (state_number_to_vector_number): Put it inside an
7314 "#if 0", since it's not currently used. Problem reported by
7315 Roland McGrath.
7316
73172005-03-06 Paul Eggert <eggert@cs.ucla.edu>
7318
7319 * src/output.c (escaped_output): Renamed from
7320 escaped_file_name_output, since we now use it for symbol tags as
7321 well. All uses changed.
7322 (symbol_destructors_output, symbol_printers_output):
7323 Escape symbol tags too.
7324 Problem reported by Matyas Forstner in
7325 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
7326
7327 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
7328 not needed.
7329 * src/output.c (user_actions_output, token_definitions_output,
7330 symbol_destructors_output, symbol_printers_output): Likewise.
7331 * src/reader.c (prologue_augment): Likewise.
7332 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
7333
7334 * src/vcg.c (output_edge): Don't quote linestyle arg.
7335 Problem reported by twlevo@xs4all.nl.
7336
73372005-02-28 Paul Eggert <eggert@cs.ucla.edu>
7338
7339 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
7340 example, reported by Derek M Jones. Also, make the example even
7341 more outrageous, to better illustrate how bad the problem is.
7342
73432005-02-24 Paul Eggert <eggert@cs.ucla.edu>
7344
7345 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
7346 putsym. Typo reported by Sebastian Piping.
7347
73482005-02-23 Paul Eggert <eggert@cs.ucla.edu>
7349
7350 * doc/bison.texinfo (Language and Grammar): some -> same
7351 (Epilogue): int he -> in the
7352 Typos reported by Sebastian Piping via Justin Pence.
7353
73542005-02-07 Paul Eggert <eggert@cs.ucla.edu>
7355
7356 * tests/glr-regression.at (Improper handling of embedded actions
7357 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
7358 embedded actions and $-N in GLR parsers", work around an Autoconf bug
7359 with dollar signs in test names.
7360 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
7361 for a similar reason.
7362
73632005-01-28 Paul Eggert <eggert@cs.ucla.edu>
7364
7365 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
7366 wants to redefine G_VIEW.
7367
73682005-01-27 Paul Eggert <eggert@cs.ucla.edu>
7369
7370 * src/vcg.c (get_view_str): Remove case for normal_view.
7371 Problem reported by twlevo@xs4all.nl.
7372
73732005-01-24 Paul Eggert <eggert@cs.ucla.edu>
7374
7375 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
7376 Problem reported by twlevo@xs4all.nl.
7377
7378 * doc/bison.texinfo: Change @dircategory from "GNU programming
7379 tools" to "Software development". Requested by Richard Stallman
7380 via Karl Berry.
7381
73822005-01-23 Paul Eggert <eggert@cs.ucla.edu>
7383
7384 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
7385 Problem reported by twlevo@xs4all.nl.
7386
73872005-01-21 Paul Eggert <eggert@cs.ucla.edu>
7388
7389 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
7390 keyword; it's not needed with modern compilers, and it doesn't
7391 affect correctness with older compilers. Suggested by
7392 twlevo@xs4all.nl.
7393
73942005-01-17 Paul Eggert <eggert@cs.ucla.edu>
7395
7396 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
7397 gcc -Wswitch-default.
7398 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7399 * data/yacc.c (yyparse): Likewise.
7400
74012005-01-12 Paul Eggert <eggert@cs.ucla.edu>
7402
7403 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
7404 already. Let config.h define any nonstandard values.
7405
74062005-01-10 Paul Eggert <eggert@cs.ucla.edu>
7407
7408 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
7409 for the benefit of slower hosts. Problem reported by
7410 Nelson H. F. Beebe.
7411
74122005-01-07 Paul Eggert <eggert@cs.ucla.edu>
7413
7414 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
7415 being defined and not used.
7416 * data/lalr1.cc (yyparse): Likewise.
7417 Use "if (false)" rather than "if (0)".
7418
74192005-01-05 Paul Eggert <eggert@cs.ucla.edu>
7420
7421 * TODO: Mention that we should allow NUL bytes in tokens.
7422
74232005-01-02 Paul Eggert <eggert@cs.ucla.edu>
7424
7425 * src/scan-skel.l (<<EOF>>): Don't close standard output.
7426 Problem reported by Hans Aberg.
7427
74282005-01-01 Paul Eggert <eggert@cs.ucla.edu>
7429
7430 * src/getargs.c (version): Happy new year; update overall
7431 program copyright date from 2004 to 2005.
7432
7433 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
7434 Problem reported by Hans Aberg.
7435 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
7436 (Output file names.): Add a test for the case when standard output
7437 is closed.
7438
74392004-12-26 Paul Eggert <eggert@cs.ucla.edu>
7440
7441 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
7442 to fix an oversight in the Bison 2.0 manual.
7443
74442004-12-25 Paul Eggert <eggert@cs.ucla.edu>
7445
7446 * NEWS: Version 2.0. Reformat the existing news items since
7447 1.875, so that related items are grouped together.
7448 * configure.ac (AC_INIT): Bump version to 2.0.
7449 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
7450
7451 * tests/torture.at (Exploding the Stack Size with Alloca): Set
7452 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
7453 otherwise, we're not testing alloca. Unfortunately there's no
7454 simple way to consult HAVE_ALLOCA here.
7455
7456 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
7457 for yymsg, too.
7458
7459 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
7460 hand. This avoids a warning about comparing int to size_t when
7461 GCC warnings are enabled.
7462
74632004-12-22 Paul Eggert <eggert@cs.ucla.edu>
7464
7465 * NEWS: Bison-generated parsers no longer default to using the
7466 alloca function (when available) to extend the parser stack, due
7467 to widespread problems in unchecked stack-overflow detection.
7468 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
7469 responsibility to set it to a positive value. This lets the user
7470 specify a value that is not a preprocessor constant.
7471 * data/yacc.c (YYMAXDEPTH): Likewise.
7472 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
7473 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
7474 to be a compile-time constant. However, explain the constraints on it.
7475 Also, explain the constraints on YYINITDEPTH.
7476 (Table of Symbols): Explain that alloca is no longer the default.
7477 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
7478 to 1.
7479
7480 * doc/bison.texinfo (Location Default Action): Mention that n must
7481 be zero when k is zero. Suggested by Frank Heckenbach.
7482
74832004-12-22 Akim Demaille <akim@epita.fr>
7484
7485 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
7486 (parser::state_type, parser::semantic_type, parser::location_type):
7487 Private, not public.
7488 (parser::parse): Return ints, not bool.
7489 Returning a bool introduces a problem: 0 corresponds to false, and
7490 it seems weird to return false on success. Returning true changes
7491 the conventions for yyparse.
7492 Alternatively we could return void and send an exception.
7493 There is no clear consensus (yet?).
7494 (state_stack, semantic_stack, location_stack): Rename as...
7495 (state_stack_type, semantic_stack_type, location_stack_type): these.
7496 Private, not public.
7497 * tests/c++.at: New.
7498 * tests/testsuite.at, tests/Makefile.am: Adjust.
7499
75002004-12-21 Akim Demaille <akim@epita.fr>
7501
7502 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
7503
75042004-12-21 Akim Demaille <akim@epita.fr>
7505
7506 Don't impose std::string for filenames.
7507
7508 * data/lalr1.cc (b4_filename_type): New.
7509 (position::filename): Use it.
7510 (parser.hh): Move the inclusion of stack.hh and location.hh below
7511 the user code, so that needed headers for the filename type can be
7512 included first.
7513 Forward declare them before the user code.
7514 * tests/Makefile.am (check-local, installcheck-local): Pass
7515 TESTSUITEFLAGS to the TESTSUITE.
7516
75172004-12-20 Akim Demaille <akim@epita.fr>
7518
7519 Use more STL like names: my_class instead of MyClass.
7520
7521 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
7522 (SemanticStack, SemanticType, StateStack, StateType)
7523 (TokenNumberType, Stack, Slice, Traits, Parser::location)
7524 (Parser::value): Rename as...
7525 (location_stack, location_type, rhs_number_type, semantic_stack)
7526 (semantic_type, state_stack, state_type, token_number_type, stack)
7527 (slice, traits, parser::yylloc, parser::yylval): these.
7528
7529 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
7530
75312004-12-19 Paul Eggert <eggert@cs.ucla.edu>
7532
7533 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
7534 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7535
75362004-12-17 Paul Eggert <eggert@cs.ucla.edu>
7537
7538 Remove uses of 'short int' and 'unsigned short int'. This raises
7539 some arbitrary limits. It uses more memory but nowadays that's
7540 not much of an issue.
7541
7542 This change does not affect the generated parsers; that's a different
7543 task, as some users will want to conserve memory there.
7544
7545 Ideally we should use size_t to represent all object counts, and
7546 something like ptrdiff_t to represent signed differences of object
7547 counts; but that will require more code-cleanup than I have the
7548 time to do right now.
7549
7550 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
7551 Use size_t, not int or short int, to count objects.
7552 * src/closure.c (nritemset, closure): Likewise.
7553 * src/closure.h (nritemset, closure): Likewise.
7554 * src/nullable.c (nullable_compute): Likewise.
7555 * src/print.c (print_core): Likewise.
7556 * src/print_graph.c (print_core): Likewise.
7557 * src/state.c (state_compare, state_hash): Likewise.
7558 * src/state.h (struct state): Likewise.
7559 * src/tables.c (default_goto, goto_actions): Likewise.
7560
7561 * src/gram.h (rule_number, rule): Use int, not short int.
7562 * src/output.c (prepare_rules): Likewise.
7563 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
7564 errs, reductions): Likewise.
7565 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
7566 Likewise.
7567 * src/tables.c (vector_number, tally, action_number,
7568 ACTION_NUMBER_MINIMUM): Likewise.
7569 * src/output.c (muscle_insert_short_int_table): Remove.
7570
75712004-12-17 Akim Demaille <akim@epita.fr>
7572
7573 * data/lalr1.cc: Extensive Doxygenation.
7574 (error_): Rename as...
7575 (error): this, since it is visible to the user.
7576 Adjust callers.
7577 (Parser::message): Now an automatic variable from...
7578 (Parser::yyreport_syntax_error_): here.
7579 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
7580 Parser::error.
7581 * tests/input.at: Escape $.
7582
75832004-12-16 Paul Eggert <eggert@cs.ucla.edu>
7584
7585 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
7586 Parenthesize rhs to avoid obscure problems with mistakes like
7587 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
7588 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7589 b4_rhs_location): Likewise.
7590 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7591 b4_rhs_location): Likewise.
7592
75932004-12-16 Akim Demaille <akim@epita.fr>
7594
7595 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
7596 yacc.c: be sure to stay within yycheck_.
7597 * tests/actions.at: Re-enable C++ tests.
7598
75992004-12-16 Akim Demaille <akim@epita.fr>
7600
7601 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
7602 real.
7603
76042004-12-16 Akim Demaille <akim@epita.fr>
7605
7606 Use #define to handle the %name-prefix.
7607
7608 * data/glr.c, data/yacc.c: Comment changes.
7609 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
7610 so that one can refer to yylex in the parser file, and have it
7611 renamed, as is the case with other skeletons.
7612
76132004-12-16 Akim Demaille <akim@epita.fr>
7614
7615 Move lalr1.cc internals into yy*.
7616
7617 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
7618 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
7619 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
7620 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
7621 (empty_, final_, terror_, errcode_, ntokens_)
7622 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
7623 (looka_, ilooka_, error_range_, nerrs_):
7624 Rename as...
7625 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
7626 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
7627 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
7628 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
7629 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
7630 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
7631 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
7632 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
7633 these.
7634
76352004-12-15 Paul Eggert <eggert@cs.ucla.edu>
7636
7637 Fix some problems reported by twlevo at xs4all.
7638 * src/symtab.c (symbol_new): Report an error if the input grammar
7639 contains too many symbols. This is better than calling abort() later.
7640 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
7641 (struct node, struct graph):
7642 Rename member expand to stretch. All uses changed.
7643 (struct graph): Remove member layoutalgorithm. All uses removed.
7644 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
7645 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
7646 All uses changed.
7647 (N_STRETCH): Rename from N_EXPAND. All uses changed.
7648
76492004-12-15 Akim Demaille <akim@epita.fr>
7650
7651 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
7652 Add more Doxygen comments.
7653 (symprint_, stack_print_, reduce_print_, destruct_, pop)
7654 (report_syntax_error_, translate_): Rename as...
7655 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
7656 (yypop_, yyreport_syntax_error_, yytranslate_): this.
7657
76582004-12-15 Akim Demaille <akim@epita.fr>
7659
7660 * data/lalr1.cc (lex_): Rename as...
7661 (yylex_): this.
7662 Move the trace here.
7663 Take the %name-prefix into account.
7664 Reported by Alexandre Duret-Lutz.
7665
76662004-12-15 Akim Demaille <akim@epita.fr>
7667
7668 Simplify the C++ parser constructor.
7669
7670 * data/lalr1.cc (debug_): Rename as...
7671 (yydebug_): so that the parser's internals are always in the yy*
7672 pseudo namespace.
7673 Adjust uses.
7674 (b4_parse_param_decl): Remove the leading comma as it is now only
7675 called as unique argument list.
7676 (Parser::Parser): Remove the constructor accepting a location and
7677 an initial debugging level.
7678 Remove from the other ctor the argument for the debugging level.
7679 (debug_level_type, debug_level, set_debug_level): New.
7680
7681 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
7682 constructor calls.
7683
76842004-12-15 Akim Demaille <akim@epita.fr>
7685
7686 Remove b4_root related material: failure experiment
7687 (which goal was to allow to derive from a class).
7688
7689 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
7690 definitions and uses.
7691
76922004-12-14 Paul Eggert <eggert@cs.ucla.edu>
7693
7694 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
7695 not 2, since it's not portable to subtract 1 from the start of an
7696 array. The new item 0 is never set or used. All uses changed.
7697
7698 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
7699 the default definition of YYLLOC_DEFAULT. Problem reported
7700 by Frank Heckenbach.
7701
77022004-12-12 Paul Eggert <eggert@cs.ucla.edu>
7703
7704 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
7705 the normal case and one for the error case. Just use the
7706 first one uniformly. Problem reported by Frank Heckenbach.
7707 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
7708 use exactly the same macro in both places.
7709 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
7710 so that the normal-case YYRHSLOC works for the error case too.
7711 All uses changed.
7712 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
7713 (YYLLOC_DEFAULT): Use the same macro as glr.c.
7714 * doc/bison.texinfo (Location Default Action): Don't claim that
7715 we have an array of locations. Use the same macro for both glr
7716 and lalr parsers. Mention YYRHSLOC. Mention what happens when
7717 the index is 0.
7718
77192004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7720
7721 * HACKING: Update email addresses to send announcements to.
7722
7723 * configure.ac (AC_INIT): Bump version to 1.875f.
7724
77252004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7726
7727 * NEWS: Version 1.875e.
7728 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
7729
7730 * src/scan-skel.l: Include "complain.h", for "fatal".
7731
7732 * src/relation.h (relation_print, relation_digraph):
7733 Relation sizes are of type relation_node, not size_t (this is
7734 merely a doc fix, since the two types are equivalent).
7735 (relation_transpose): Relation sizes are of type relation_node,
7736 not int.
7737 * src/relation.c: Likewise.
7738 (top, infinity): Now of type relation_node, not int.
7739 (traverse, relation_transpose): Use relation_node, not int.
7740
7741 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
7742 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
7743 (yyparse): Remove unused local introduced in 2004-10-25 patch.
7744
7745 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
7746 specifying whether the test should be skipped. Use it tp
7747 specify that the [%defines %skeleton "lalr1.cc"] tests currently
7748 fail on some hosts, and should be skipped.
7749
77502004-12-08 Paul Eggert <eggert@cs.ucla.edu>
7751
7752 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
7753 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
7754 unless otherwise specified below.
7755
7756 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
7757 to allocate kernel_base, kernel_items, kernel_size, since
7758 they needn't be initialized to 0.
7759 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
7760 * src/closure.c (new_closure): Likewise, for itemset.
7761 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
7762 * src/lalr.c (set_goto_map): Likewise, for temp_map.
7763 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
7764 (build_relations): Likewise for edge, states1, includes.
7765 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
7766 * src/reader.c (packgram): Likewise, for ritem, rules.
7767 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
7768 * src/relation.c (relation_digraph): Likewise for VERTICES.
7769 (relation_transpose): Likewise for new_R, end_R.
7770 * src/symtab.c (symbols_token_translations_init): Likewise for
7771 token_translations.
7772 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
7773 (token_actions): Likewise for yydefact, actrow, conflrow,
7774 conflict_list.
7775 (save_column): Likewise for froms[symno], tos[symno].
7776 (goto_actions): Likewise for state_count.
7777 (pack_table): Likewise for base, pos, check.
7778 (tables_generate): Likewise for width.
7779
7780 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
7781 for initial core. Just have a separate core, so we needn't worry
7782 about whether kernel_size and kernel_base are initialized.
7783
7784 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
7785 kernel_size, kernel_items): Remove unnecessary initialization.
7786 * src/conflicts.c (conflicts): Likewise.
7787 * src/derives.c (derives): Likewise.
7788 * src/muscle_tablc (muscle_insert): Likewise.
7789 * src/relation.c (relation_digraph): Likewise.
7790 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
7791 conflrow, conflict_table, conflict_list, table, check):
7792 Likewise.
7793
7794 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
7795 This is because all callers pass unsigned int.
7796 * src/closure.h (new_closure): Likewise.
7797
7798 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
7799 (build_relations): Initialize includes[i] in all cases.
7800 * src/reader.c (packgram): Always initialize rules[ruleno].prec
7801 and rules[ruleno].precsym. Initialize members in order.
7802 * src/relation.c (relation_transpose): Always initialize new_R[i]
7803 and end_R[i].
7804 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
7805
7806 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
7807 conflict_list[0] was always 0, but now it isn't initialized.
7808
7809 * src/table.c (table_grow): When conflict_table grew, the grown
7810 area wasn't cleared. Fix this.
7811
7812 * lib/.cvsignore: Add strdup.c, strdup.h.
7813 * m4/.cvsignore: Add strdup.m4.
7814
78152004-12-07 Paul Eggert <eggert@cs.ucla.edu>
7816
7817 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
7818 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
7819 GOTO_NUMBER_MAXIMUM, since we occasionally compute
7820 ngotos + 1 without checking for overflow.
7821 (build_relations): Use END_NODE, not -1, to denote end of edges.
7822 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
7823 build_relations): Use goto_number, not int, for goto numbers.
7824 * src/tables.c (save_column, default_goto): Likewise.
7825
78262004-11-23 Akim Demaille <akim@epita.fr>
7827
7828 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
7829 of #defining from yystype.
7830 Don't typedef yystype, C++ does not need it.
7831 This lets it possible to forward declare it as union.
7832
78332004-11-23 Paul Eggert <eggert@cs.ucla.edu>
7834
7835 * bootstrap (gnulib_modules): Add extensions.
7836 Problem reported by Jim Meyering.
7837
78382004-11-22 Paul Eggert <eggert@cs.ucla.edu>
7839
7840 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
7841 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
7842 src/system.h, src/tables.c: XFREE -> free, to accommodate
7843 recent change to gnulib xalloc.h.
7844 Problem reported by Jim Meyering.
7845
78462004-11-17 Akim Demaille <akim@epita.fr>
7847
7848 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
7849
78502004-11-17 Akim Demaille <akim@epita.fr>,
7851 Alexandre Duret-Lutz <adl@gnu.org>
7852
7853 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
7854 changes.
7855 (YYCDEBUG): Adjust.
7856 Use it instead of cdebug_.
7857 (Parser::debug_stream, Parser::set_debug_stream): New.
7858 (Parser::symprint_): Define cdebug_ for temporary backward
7859 compatibility.
7860 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
7861 debug_stream ().
7862
78632004-11-17 Akim Demaille <akim@epita.fr>
7864
7865 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
7866 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
7867 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
7868 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
7869
78702004-10-27 Paul Eggert <eggert@cs.ucla.edu>
7871
7872 * data/glr.c (yyloc_default): Remove; not used.
7873 Problem reported by Frank Heckenbach.
7874
78752004-10-25 Akim Demaille <akim@epita.fr>
7876
7877 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
7878 Introduce another definition to address simple location arrays.
7879 (yyGLRStack): New member: yyerror_range.
7880 (yyrecoverSyntaxError, yyparse): Update it.
7881 (yyrecoverSyntaxError): Use it when shifting the error token to
7882 have an accurate range, equivalent to the one computed by both
7883 yacc.c and lalr1.cc.
7884 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
7885 that column numbers start at column 0, as per GNU Coding
7886 Standards, the others tests, and the doc.
7887 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
7888 Adjust to the above change (first column is 0).
7889 And adjust the location of the "<error>", now covering the whole
7890 line.
7891
78922004-10-22 Akim Demaille <akim@epita.fr>
7893 and Paul Eggert <eggert@cs.ucla.edu>
7894
7895 Remove some arbitrary limits on goto numbers and relations.
7896 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
7897 initial values, since they're never used.
7898 (set_goto_map): ngotos is now unsigned, so test for overflow
7899 by seeing whether it wraps around to zero.
7900 * src/lalr.h (goto_number): Now size_t, not short int.
7901 (GOTO_NUMBER_MAXIMUM): Remove.
7902 * src/relation.c (relation_print, traverse, relation_transpose):
7903 Check for END_NODE rather than looking at sign.
7904 * src/relation.h (END_NODE): New macro.
7905 (relation_node): Now size_t, not short int.
7906
79072004-10-22 Paul Eggert <eggert@cs.ucla.edu>
7908
7909 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
7910 keyword, not an identifier. Problem reported by Baron Schwartz in
7911 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
7912
79132004-10-11 Akim Demaille <akim@epita.fr>
7914
7915 * src/symtab.c (symbol_check_alias_consistency): Also check
7916 type names, destructors, and printers.
7917 Reported by Alexandre Duret-Lutz.
7918 Recode the handling of associativity and precedence in terms
7919 of symbol_precedence_set.
7920 Accept no redeclaration at all, not even equal to the previous
7921 value.
7922 (redeclaration): New.
7923 Use it to factor redeclaration complaints.
7924 (symbol_make_alias): Don't set the type of the alias, let
7925 symbol_check_alias_consistency do it as for other features.
7926 * src/symtab.h (symbol): Add new member prec_location, and
7927 type_location.
7928 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
7929 * tests/input.at (Incompatible Aliases): New.
7930
79312004-10-09 Paul Eggert <eggert@cs.ucla.edu>
7932
7933 .cvsignore fixes to accommodate gnulib changes,
7934 and the practice of naming build directories "_build".
7935 * .cvsignore: Add "_*". Sort.
7936 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
7937 * m4/.cvsignore: Add "*_gl.m4".
7938
79392004-10-06 Akim Demaille <akim@epita.fr>
7940
7941 * src/parse-gram.y (add_param): Fix the truncation of trailing
7942 spaces.
7943
79442004-10-05 Akim Demaille <akim@epita.fr>
7945
7946 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
7947 whether the reducion was empty or not. This leaves room to
7948 improve the use of YYLLOC_DEFAULT in such a case.
7949 lalr1.cc is still experimental, so changing this is acceptable.
7950 And finally, there are probably not many users who changed the
7951 handling of locations in GLR, so changing is admissible too.
7952
7953 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
7954 empty reduction, set @$ to an empty location ending the previously
7955 stacked symbol.
7956 Adjust uses to make sure the code is triggered on empty
7957 reductions.
7958 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
7959 expected output: empty reductions have empty locations.
7960
79612004-09-29 Akim Demaille <akim@epita.fr>
7962
7963 * data/lalr1.cc: Move towards a more standard C++ coding style
7964 for templates: Class < T > -> Class<T>.
7965
79662004-09-29 Akim Demaille <akim@epita.fr>
7967
7968 * data/lalr1.cc: Reinstall the former ctor, for sake of
7969 compatibility, but warn it will be removed.
7970 Move towards a more standard C++ coding style (i.e., type *var ->
7971 type* var).
7972
79732004-09-27 Paul Eggert <eggert@cs.ucla.edu>
7974
7975 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
7976 since it's less likely to work if NULs are involved in the future.
7977
79782004-09-27 Akim Demaille <akim@epita.fr>
7979
7980 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
7981
79822004-09-27 Akim Demaille <akim@epita.fr>
7983
7984 * data/lalr1.cc (b4_parse_param_decl_1): New.
7985 (b4_parse_param_decl): Use it to have different names between attribute
7986 and argument names.
7987 (b4_cc_constructor_call): Likewise.
7988
79892004-09-24 Akim Demaille <akim@epita.fr>
7990
7991 * src/parse-gram.y (add_param): Strip the leading and trailing
7992 blanks from a formal argument declaration.
7993 (YY_LOCATION_PRINT): New.
7994
79952004-09-24 Akim Demaille <akim@epita.fr>
7996
7997 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
7998 after the location.
7999
80002004-09-24 Akim Demaille <akim@epita.fr>
8001
8002 * doc/bison.texinfo (Table of Symbols): Sort.
8003
80042004-09-21 Akim Demaille <akim@epita.fr>
8005
8006 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
8007 the useless parentheses.
8008 Suggested by Paul Eggert.
8009
80102004-09-20 Akim Demaille <akim@epita.fr>
8011
8012 Let the initial-action act on the look-ahead, and use it for the
8013 "initial push" (corresponding to an hypothetical beginning-of-file).
8014 And let lalr1.cc honor %initial-action.
8015
8016 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
8017 example.
8018 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
8019 (Parser::Parser): Remove the ctor that used to initialize it.
8020 (Parser::parse): Like in the other skeletons, issue the "starting
8021 parse" message before any action.
8022 Honor %initial-action.
8023 Initialize the stacks with the lookahead.
8024 * data/yacc.c: Let $$ and @$ in %initial-action designate the
8025 look-ahead.
8026 Push them in the stacks.
8027 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
8028
80292004-09-20 Akim Demaille <akim@epita.fr>
8030
8031 * doc/bison.texinfo (Initial Action Decl): New.
8032
80332004-09-20 Akim Demaille <akim@epita.fr>
8034
8035 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
8036 clearer criterion to define it.
8037 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
8038 When reducing on an empty RHS, use the latest stacked location as
8039 location.
8040 yylloc is not always available.
8041 * data/glr.c: Likewise.
8042 Also, honor initial-actions.
8043
80442004-09-20 Akim Demaille <akim@epita.fr>
8045
8046 * data/yacc.c (YY_LOCATION_PRINT): New.
8047 Define when we know YYLTYPE's structure, i.e., when the default
8048 YYLLOC_DEFAULT is used.
8049 * data/c.m4 (b4_yysymprint_generate): Use it.
8050 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
8051 value of the result.
8052 (error_start_): Replace with...
8053 (error_range_): this location array.
8054 This allows to replace code relying on the implementation of
8055 locations by portable code.
8056 * data/yacc.c (yylerrsp): Replace with...
8057 (yyerror_range): this.
8058 Every time a token is popped, update yyerror_range[0], to have an
8059 accurate location for the error token.
8060 * data/glr.c (YY_LOCATION_PRINT): New.
8061 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
8062 deference a pointer.
8063 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
8064 report the location in %printers.
8065
8066 * src/scan-skel.l: Instead of abort, report error messages to ease
8067 understanding skeleton scanning failures.
8068
80692004-09-16 Akim Demaille <akim@epita.fr>
8070
8071 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
8072 (iterator, const_iterator): these, to be more in the C++ spirit.
8073 Also, return reverse iterators so that when displaying the stack
8074 we display its bottom first.
8075 (Parser::stack_print_, Parser::reduce_print_): Match the messages
8076 from yacc.c.
8077 We should probably use vector here though.
8078
80792004-09-16 Akim Demaille <akim@epita.fr>
8080
8081 Have more complete shift traces.
8082
8083 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
8084 to report Shifts instead of ad hoc YYDPRINTF invocations,
8085 including for the error token.
8086 * data/lalr1.cc (symprint_): Output the location.
8087 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
8088 output the location within the %printer.
8089 Activate GLR tests, at least to make sure they compile properly.
8090 They still don't pass though.
8091 * tests/calc.at: Adjust expect verbose output, since now "Entering
8092 state..." is on a different line than the "Shifting" message.
8093
80942004-09-08 Akim Demaille <akim@epita.fr>
8095
8096 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
8097 Bison directive from the Bison file to the invocation of this
8098 macro, so that these directives are passed to
8099 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
8100 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
8101 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
8102 the extra Bison directives instead of the whole series.
8103 Change the grammar so that there are recoverable errors, and
8104 unrecoverable errors. Now we can have the parser give up before
8105 consuming the whole input. As a result we now can observe that
8106 the lookahead is freed when needed.
8107 Change the parser source to parse argv[1] instead of a hard coded
8108 string.
8109 Simplify yylex, and give a value and location to EOF.
8110 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
8111 passed directives already coded in the file.
8112 Add some tests to check the location of "error".
8113 For some tests, the C++ parser is correct, and not yacc.c.
8114 For other tests, they provide different, but unsatisfying, values,
8115 so keep the C++ value so that at least one parser is "correct"
8116 according to the test suite.
8117 (Actions after errors): Remove, this is subsumed by the
8118 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
8119
81202004-09-06 Akim Demaille <akim@epita.fr>
8121
8122 * data/lalr1.cc: Adjust the indentation of the labels.
8123 (Parser::pop): New.
8124 Use it.
8125
81262004-09-06 Akim Demaille <akim@epita.fr>
8127
8128 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
8129 argument, an informative message.
8130 Call YY_SYMBOL_PRINT.
8131 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
8132 * data/lalr1.cc (destruct_): Likewise.
8133 In addition, no longer depend on b4_yysymprint_generate and
8134 b4_yydestruct_generate to generate these functions, do it "by
8135 hand".
8136
81372004-09-03 Akim Demaille <akim@epita.fr>
8138
8139 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
8140 invoked, yydestruct the lookahead.
8141 * tests/calc.at (Calculator $1): Update the expected lengths of
8142 traces: there is an added line for the discarded lookahead.
8143 * doc/bison.texinfo (Destructor Decl): Some rewording.
8144 Define "discarded" symbols.
8145
81462004-09-02 Akim Demaille <akim@epita.fr>
8147
8148 * data/lalr1.cc (translate_, destruct_): No reason to be static.
8149
81502004-09-02 Akim Demaille <akim@epita.fr>
8151
8152 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
8153 (YYDSYMPRINTF): Rename as...
8154 (YY_SYMBOL_PRINT): this.
8155 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
8156 two.
8157 Use it instead of direct symprint_ calls.
8158 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
8159 one.
8160
81612004-09-02 Akim Demaille <akim@epita.fr>
8162
8163 * data/lalr1.cc (b4_yysymprint_generate): New.
8164 (symprint_): New member function, defined when YYDEBUG.
8165 Use it consistently instead of token/nterm debugging output by
8166 hand.
8167 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
8168 %printer calls to use cdebug_ when using lalr1.cc.
8169
81702004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
8171
8172 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
8173 with #ifdef YYDEBUG.
8174
81752004-08-26 Akim Demaille <akim@epita.fr>
8176
8177 * doc/bison.texinfo (Implementing Loops): Rename as...
8178 (Implementing Gotos/Loops): this.
8179
81802004-08-13 Paul Eggert <eggert@cs.ucla.edu>
8181
8182 Adjust to latest gnulib.
8183 * bootstrap (gnulib_modules): Add xalloc-die.
8184 Set LC_ALL=C so that file names sort consistently.
8185 Prefer the gnulib copies of gettext.m4, glibc21.m4,
8186 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
8187 uintmax_t.m4, ulonglong.m4.
8188 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
8189 po.m4 since we are now using _gl.m4 instead.
8190
81912004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
8192
8193 * src/scan-action.l: Remove. Scanning of semantic actions is
8194 handled in scan-gram.l.
8195
81962004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
8197
8198 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
8199
8200 * src/location.h (struct): The file member is a uniqstr.
8201 (equal_boundaries): Use UNIQSTR_EQ for comparison.
8202
82032004-07-22 Paul Eggert <eggert@cs.ucla.edu>
8204
8205 Fix bug with non-%union parsers that have printers or destructors,
8206 which led to a Bison core dump. Reported by Peter Fales in
8207 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
8208
8209 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
8210 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
8211 not to our own type.
8212 * src/output.c (symbol_destructors_output, symbol_printers_output):
8213 Don't assume %union.
8214 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
8215 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
8216 UNION-FLAG. All callers changed.
8217 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
8218 Use type char, not unsigned int, when declaring an array of char;
8219 this lets us remove a cast.
8220 (Printers and Destructors): Add non-%union test cases.
8221
82222004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8223
8224 * doc/bison.texinfo: Minor editorial changes, mostly to the new
8225 GLR writeups. E.g., avoid frenchspacing and the future tense,
8226 change "lookahead" to "look-ahead", and change "wrt" to "with
8227 respect to".
8228
82292004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8230
8231 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
8232 New sections, split off from the GLR Parsers section. Put the new
8233 Simple GLR Parser near the start of the GLR section, for clarity.
8234 Rewrite connective text.
8235
82362004-06-21 Frank Heckenbach <frank@g-n-u.de>
8237
8238 * doc/bison.texinfo (Simple GLR Parsers): New section.
8239
82402004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8241
8242 * NEWS, TODO, doc/bison.texinfo:
8243 Use "look-ahead" instead of "lookahead", to be consistent.
8244 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
8245 while we're fixing "look-ahead".
8246 * src/conflicts.c (shift_set): Renamed from shiftset.
8247 (look_ahead_set): Renamed from lookaheadset.
8248 * src/print.c: Likewise.
8249 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
8250 name for "lookahead".
8251 (report_types, usage): Likewise.
8252 * src/getargs.h (report_look_ahead_tokens): Renamed from
8253 report_lookaheads.
8254 * src/lalr.c (compute_look_ahead_tokens): Renamed from
8255 compute_lookaheads.
8256 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
8257 (look_ahead_tokens_print): Renamed from lookaheads_print.
8258 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
8259 state_rule_lookaheads_print.
8260 * src/state.h: Likewise.
8261 (reductions.look_ahead_tokens): Renamed from lookaheads.
8262 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
8263 AT_DATA_LOOKAHEADS_GRAMMAR.
8264
82652004-06-03 Paul Eggert <eggert@cs.ucla.edu>
8266
8267 * README: Update location of patched M4 distribution.
8268
82692004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
8270
8271 Don't assume the C++ compiler takes the same arguments as the C compiler
8272 (trivial change).
8273 * configure.ac (O0CXXFLAGS): New var.
8274 * tests/atlocal.in (CXXFLAGS): Use it.
8275
82762004-05-29 Paul Eggert <eggert@cs.ucla.edu>
8277
8278 Fix some "make check" problems with C++ reported by
8279 Albert Chin-A-Young for Tru64 C++ in this thread:
8280 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
8281
8282 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
8283 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8284 Output to a .cc file for C++, not to a .c file.
8285 * tests/calc.at (AT_CHECK_CALC): Likewise.
8286 * tests/regression.at (AT_CHECK_DANCER): Likewise.
8287 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
8288
82892004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
8290
8291 * tests/calc.at, tests/actions.at: Workaround for SGI
8292 C++ compiler. (trivial change)
8293
82942004-05-27 Paul Eggert <eggert@cs.ucla.edu>
8295
8296 Spent a few hours checking out which prerequisite versions the
8297 current sources actually require. I went all the way back to
8298 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
8299 a seemingly endless set of combinations of versions more recent
8300 than that. The bottom line is that the current sources require
8301 fairly recent versions of the build tools, and it'll be some work
8302 to change this.
8303 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
8304 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
8305 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
8306 Add comments explaining why those particular versions are
8307 currently needed.
8308
8309 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
8310 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
8311 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
8312
8313 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
8314 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
8315
83162004-05-26 Paul Eggert <eggert@cs.ucla.edu>
8317
8318 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
8319 0.11.5. Suggested by Bruno Haible.
8320 * bootstrap: Remove gettext version checking.
8321
8322 * doc/bison.texinfo (Decl Summary): Also mention that %union
8323 can depend on prerequisite types. Problem reported by Tim
8324 Van Holder.
8325
83262004-05-25 Paul Eggert <eggert@cs.ucla.edu>
8327
8328 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
8329 * README-alpha: Don't tell people not to package this.
8330
8331 * bootstrap: Don't assume $(...) works; use `...` instead.
8332 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
8333 gettext better.
8334
8335 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
8336 put into the -d output file, and mention what to do if YYSTYPE is
8337 defined as a macro.
8338
83392004-05-24 Paul Eggert <eggert@cs.ucla.edu>
8340
8341 Undo change made earlier today: it caused autopoint to not bring
8342 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
8343 autopoint's.
8344
8345 * bootstrap: Check that gettext version matches what's in
8346 configure.ac. Warn users to ignore robots.txt ERROR 404.
8347 * bootstrap: Undo today's earlier change (logged below).
8348 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
8349
8350 The gettext version checking is causing more trouble than it's
8351 curing; remove it. Problem reported by Paul Hilfinger.
8352
8353 * bootstrap: Issue a warning that one can expect a message
8354 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
8355 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
8356
83572004-05-23 Paul Eggert <eggert@cs.ucla.edu>
8358
8359 Ensure that the C++ compiler used for testing actually works on a
8360 simple test program; if not, skip the C++-related tests. Problem
8361 reported by Vin Shelton in:
8362 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
8363
8364 * m4/cxx.m4: New file.
8365 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
8366 * tests/atlocal.in (BISON_CXX_WORKS): Add.
8367 * tests/local.at (AT_COMPILE_CXX): Use it.
8368
83692004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8370
8371 * data/glr.c (yylloc): Output this macro even if locations are not
8372 being generated, as the GLR parser needs it even in that case.
8373 Problem reported by Troy A. Johnson
8374 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
8375
8376 * configure.ac (AC_INIT): Update to 1.875e.
8377
83782004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8379
8380 * NEWS: Version 1.875d.
8381 * configure.ac (AC_INIT): Likewise.
8382 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
8383
8384 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
8385 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
8386 lalr1.cc runs afoul of the first, and the last two are no longer
8387 supported by GCC 3.4.0.
8388 * README: Mention GNU m4 1.4 or later; mention m4 patches.
8389 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
8390
83912004-05-06 Paul Eggert <eggert@cs.ucla.edu>
8392
8393 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
8394 unsigned int, for compatibility with latest gnulib hash module.
8395 * src/state.c (state_hash, state_hasher): Likewise.
8396 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
8397 * src/uniqstr.c (hash_uniqstr): Likewise.
8398
83992004-05-03 Paul Eggert <eggert@cs.ucla.edu>
8400
8401 * NEWS: Unescaped newlines are no longer allowed in char & strings.
8402
8403 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
8404 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
8405 character and string literals.
8406 (unexpected_end): New function.
8407 (unexpected_eof): Use it.
8408 (unexpected_newline): New function.
8409 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
8410 actions.
8411
8412 * NEWS: Document %expect-rr.
8413
8414 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
8415 Fix typo by replacing $1 with $option.
8416 Remove more 'intl'-related files.
8417 Don't DEFUN AM_INTL_SUBDIR twice.
8418
8419 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
8420 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
8421 strtoul.c.
8422 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
8423 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
8424 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
8425 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
8426 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
8427 * src/.cvsignore: Add *.output.
8428
8429 * src/parse-gram.y: Put copyright notice inside %{ %} so it
8430 gets copied to the output file.
8431
84322004-04-28 Paul Eggert <eggert@twinsun.com>
8433
8434 Get files from the gnulib and po repositories, instead of relying
8435 on them being in our CVS. Upgrade to latest versions of gnulib
8436 and Automake.
8437
8438 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
8439 * bootstrap: Bootstrap from gnulib and po repositories.
8440 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
8441 * README-cvs: Document these changes. Remove version numbers from
8442 mentions of build tools, since they change so often. Mention Flex.
8443
8444 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
8445 (gl_USE_SYSTEM_EXTENSIONS): Add.
8446 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
8447 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
8448 does this for us.
8449 (AC_ISC_POSIX): Remove; we no longer support this
8450 ancient OS, as it gets in the way of latest Autoconf & gnulib.
8451 (AC_HEADER_STDC): Remove: we now assume C89 or better.
8452 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
8453 Do not check for C89 headers, except for locale.h which is used
8454 by the Yacc library and must port to K&R hosts.
8455 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
8456 Do not check for C89 functions, except for setlocale which is
8457 used by the Yacc library.
8458 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
8459 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
8460 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
8461 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
8462 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
8463 AM_GNU_GETTEXT): Remove; now done by:
8464 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
8465 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
8466 for us.
8467
8468 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
8469 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
8470 Define to empty, as gnulib.mk will do the rest for us.
8471 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
8472 for us.
8473 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
8474 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
8475
8476 * src/files.c: Include gnulib's xstrndup.h.
8477
8478 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
8479 (REALLOC): Use xnrealloc, for likewise.
8480 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
8481 (strnlen, memrchr): Remove decls; functions no longer used.
8482 Include <stpcpy.h>.
8483
8484 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
8485 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
8486 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
8487 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
8488 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
8489 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
8490 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
8491 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
8492 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
8493 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
8494 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
8495 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8496 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
8497 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
8498 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
8499 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
8500 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
8501 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
8502 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
8503 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
8504 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
8505 Remove, as these files are now generated automatically
8506 by bootstrap or automake.
8507
8508 * po/ChangeLog: Remove: all but one entry was a duplicate
8509 of this file, and I moved that 2000-11-02 entry here.
8510
8511 * config/.cvsignore: Add Makefile, depcomp, install-sh.
8512 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
8513 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
8514 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
8515 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
8516 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
8517 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
8518 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
8519 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
8520 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
8521 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
8522 xstrndup.h.
8523 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
8524 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
8525 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
8526 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
8527 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
8528 * src/.cvsignore: Remove *_.c.
8529
8530
8531 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
8532 support it. (The latest stable gzip doesn't.)
8533
85342004-04-27 Paul Eggert <eggert@twinsun.com>
8535
8536 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
8537 case, as stos_ is now used by destructors due to the 2004-02-09
8538 change.
8539
8540 Remove more K&R C support.
8541 * lib/libiberty.y (PARAMS): Remove. All uses removed.
8542 * lib/subpipe.c (errno): Remove decl.
8543 Include <stdlib.h> unconditionally.
8544 (EXIT_FAILURE): Remove macro.
8545 * src/complain.c (vfprintf, strerror): Remove.
8546 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
8547 unconditionally.
8548 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
8549 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
8550 (strchr, strspn, memchr): Remove decls.
8551 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
8552 unconditionally. Do not declare perror.
8553 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
8554 unconditionally.
8555
8556 * src/complain.c (_): Remove useless defn, as system.h defines this.
8557
8558 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
8559 with latest obstack.h.
8560 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
8561 to procedure types, as obstack.h now does that for us.
8562 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
8563
8564 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
8565 so that this include file can stand alone.
8566 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
8567 does this now. Include subpipe.h first after config.h, to
8568 test whether it can stand alone.
8569
8570 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
8571 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
8572 unused declaration.
8573
8574 * tests/synclines.at (%union synch line): Put a dummy member in
8575 the union, because empty unions aren't allowed in C. Caught
8576 by GCC 3.4.0.
8577
85782004-04-13 Jim Meyering <jim@meyering.net>
8579
8580 * src/conflicts.c (conflicts_print): Correct format string typo:
8581 use `%%' to produce literal `%'. (trivial change)
8582
85832004-03-30 Paul Eggert <eggert@twinsun.com>
8584
8585 * src/getargs.c (version): Update copyright year to 2004.
8586
8587 * data/c.m4 (b4_int_type): Use 'short int' rather than
8588 'short', and similarly for 'long', 'unsigned', etc.
8589 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
8590 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
8591 yy_yypstack, yydumpstack): Likewise.
8592 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
8593 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
8594 Likewise.
8595 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
8596 yy_stack_print, yyparse): Likewise.
8597 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
8598 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
8599 * lib/bitset.c (bitset_print): Likewise.
8600 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
8601 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8602 * lib/bitsetv.c (bitsetv_dump): Likewise.
8603 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
8604 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
8605 Likewise.
8606 * src/LR0.c (allocate_itemsets): Likewise.
8607 * src/gram.h (rule_number, rule): Likewise.
8608 * src/lalr.h (goto_number): Likewise.
8609 * src/nullable.c (nullable_compute): Likewise.
8610 * src/output.c (prepare_rules): Likewise.
8611 * src/relation.c (relation_print, relation_digraph): Likewise.
8612 * src/relation.h (relation_node): Likewise.
8613 * src/state.h (state_number, transitions, errs, reductions,
8614 struct state): Likewise.
8615 * src/symtab.h (symbol_number, struct symbol): Likewise.
8616 * src/tables.c (vector_number, tally, action_number,
8617 default_goto, goto_actions): Likewise.
8618 * tests/existing.at (GNU Cim Grammar): Likewise.
8619 * tests/regression.at (Web2c Actions): Likewise.
8620
8621 * src/output.c (muscle_insert_short_int_table): Renamed from
8622 muscle_insert_short_table. All uses changed.
8623
86242004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8625
8626 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
8627 (declaration): Replace expected_conflicts with expected_sr_conflicts.
8628 Add %expect-rr rule.
8629
8630 * src/scan-gram.l: Recognize %expect-rr.
8631
8632 * src/conflicts.h (expected_sr_conflicts): Rename from
8633 expected_conflicts.
8634 (expected_rr_conflicts): Declare.
8635
8636 * src/conflicts.c (expected_sr_conflicts): Rename from
8637 expected_conflicts.
8638 (expected_rr_conflicts): Define.
8639 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
8640 for GLR parsers.
8641 Use expected_sr_conflicts in place of expected_conflicts.
8642 Warn if expected_rr_conflicts used in non-GLR parser.
8643
8644 * doc/bison.texinfo: Add documentation for %expect-rr.
8645
86462004-03-08 Paul Eggert <eggert@gnu.org>
8647
8648 Add support for hex token numbers. Suggested by Odd Arild Olsen in
8649 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
8650
8651 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
8652 in lalr1.cc.
8653 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
8654 * src/scan-gram.l (scan_integer): New function.
8655 ({int}): Use it.
8656 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
8657 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
8658 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
8659 Say "long int", not "long", for uniformity with GNU style.
8660
86612004-02-25 Paul Eggert <eggert@twinsun.com>
8662
8663 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
8664 compilers. This fixes a problem with Intel's C++ compiler being
8665 chatty, reported by Guido Trentalancia in
8666 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
8667
86682004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
8669
8670 Support %destructor and merge error locations in lalr1.cc.
8671
8672 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
8673 (Parser::stos_): Define unconditionally.
8674 (Parser::destruct_): New method. Generate its body with
8675 b4_yydestruct_generate.
8676 (Parser::error_start_): New attribute.
8677 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
8678 token which are discarded.
8679 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
8680 error_start_ when erroneous token are discarded.
8681 (Parser::parse) <yyerrlab1>: Compute the location of the error
8682 token so that it covers all the discarded tokens.
8683 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
8684 it can be called with `%skeleton "lalr1.cc"', and do that.
8685
86862004-02-02 Paul Eggert <eggert@twinsun.com>
8687
8688 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
8689 $(top_srcdir)/lib and ../lib. This fixes a bug reported
8690 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
8691 There's no need to mention top_builddir since Automake does that
8692 for us.
8693 (INCLUDES): Remove, as Automake says it's obsolescent.
8694 Contents migrated into AM_CPPFLAGS as described above.
8695 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
8696
86972004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8698
8699 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
8700 (yyreportSyntaxError): Handle case where lookahead token is
8701 YYEMPTY.
8702
87032004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8704
8705 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
8706 resulting parsers are compilable with C++.
8707
87082003-12-23 Paul Eggert <eggert@twinsun.com>
8709
8710 * config/depcomp, config/install-sh: Sync with Automake 1.8.
8711 * src/output.c (output_skeleton): Rename local var.
8712 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
8713 Bison tokens, as this runs afoul of the 2003-10-07 change that
8714 disallowed NUL bytes in character constants or string literals.
8715
8716 * tests/local.at: Require Autoconf 2.59's Autotest.
8717 * tests/testsuite.at: Don't include local.at, since we now assume
8718 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
8719 including it.
8720 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
8721 multiple inclusion warnings.
8722
87232003-12-02 Akim Demaille <akim@epita.fr>
8724
8725 * doc/bison.texinfo (How Can I Reset the Parser): More about start
8726 conditions.
8727 From Bruno Haible.
8728
87292003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
8730
8731 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
8732
87332003-10-07 Paul Eggert <eggert@twinsun.com>
8734
8735 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
8736 if testsuite doesn't exist.
8737
8738 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
8739 literals, unfortunately.
8740 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
8741 Complain about NUL bytes in character constants or string literals.
8742
87432003-10-05 Paul Eggert <eggert@twinsun.com>
8744
8745 * NEWS: Don't document %no-default-prec, as it's still
8746 too experimental.
8747 * doc/bison.texinfo: Document %no-default-prec only if
8748 the defaultprec flag is set. Normally it's not.
8749
87502003-10-04 Paul Eggert <eggert@twinsun.com>
8751
8752 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
8753 non-modifiable lvalue, instead of a modifiable one.
8754 * doc/bison.texinfo (Actions): Document that $$ can
8755 be assigned to. Do not claim that $$ and $N are
8756 array element references: user code should not rely on this.
8757
87582003-10-01 Paul Eggert <eggert@twinsun.com>
8759
8760 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
8761 (grammar_declaration): Use it.
8762 * src/scan-gram.l: New token %no-default-prec.
8763 * tests/conflicts.at: Revamp tests to use %no-default-prec.
8764 * NEWS, doc/bison.texinfo: Document the above.
8765
87662003-10-01 Akim Demaille <akim@epita.fr>
8767
8768 VCG no longer supports long_straight_phase.
8769
8770 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
8771 * src/print_graph.c (print_graph): Adjust.
8772
87732003-09-30 Frank Heckenbach <frank@g-n-u.de>
8774 and Paul Eggert <eggert@twinsun.com>
8775
8776 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
8777 Table of Symbols): Document %default-prec.
8778 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
8779 (grammar_declaration): Set default_prec on %default-prec.
8780 * src/scan-gram.l (%default-prec): New token.
8781 * src/reader.h (default_prec): New flag.
8782 * src/reader.c: Likewise.
8783 (packgram): Handle it.
8784 * tests/conflicts.at (%default-prec without %prec,
8785 %default-prec with %prec, %default-prec 1): New tests.
8786
87872003-09-30 Paul Eggert <eggert@twinsun.com>
8788
8789 * tests/testsuite.at: Include local.at, not input.at, fixing
8790 a typo in the 2003-08-25 patch.
8791
87922003-08-27 Akim Demaille <akim@epita.fr>
8793
8794 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
8795 GCC warnings.
8796
87972003-08-26 Akim Demaille <akim@epita.fr>
8798
8799 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
8800 "<\#" to avoid magic from Gnus when posting parts of this script.
8801
88022003-08-26 Akim Demaille <akim@epita.fr>
8803
8804 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
8805 (Parser::parse): here.
8806 Adjust: nerrs and errstatus is now replaced by...
8807 (Parser::nerrs_, Parser::errstatus_): New.
8808
88092003-08-25 Akim Demaille <akim@epita.fr>
8810
8811 * config/announce-gen, Makefile.cfg: New.
8812 * Makefile.am: Adjust.
8813 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
8814 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
8815
88162003-08-25 Akim Demaille <akim@epita.fr>
8817
8818 When reducing initial empty rules, Bison parser read an initial
8819 location that is not defined. This results in garbage, and that
8820 affects Bison's own parser. Therefore we need (i) to extend Bison
8821 to support a means to initialize this location, and (ii) to use
8822 this CVS Bison to fix CVS Bison's parser.
8823
8824 * src/reader.h, reader.c (epilogue_augment): Remove, replace
8825 with...
8826 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
8827 * src/parse-gram.y: Adjust.
8828 (%initial-action): New.
8829 (%error-verbose): Since we require CVS Bison, there is no reason
8830 not to use it.
8831 * src/scan-gram.l: Adjust.
8832 * src/Makefile.am (YACC): New, to make sure we use our own parser.
8833 * data/yacc.c (yyparse): Use b4_initial_action.
8834
88352003-08-25 Akim Demaille <akim@epita.fr>
8836
8837 * doc/bison.texinfo: Don't promote stdout for error messages.
8838
88392003-08-25 Akim Demaille <akim@epita.fr>
8840
8841 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
8842 From Alexandre Duret-Lutz.
8843
88442003-08-25 Akim Demaille <akim@epita.fr>
8845
8846 Version 1.875c.
8847
88482003-08-25 Akim Demaille <akim@epita.fr>
8849
8850 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
8851 Use them.
8852
88532003-08-25 Akim Demaille <akim@epita.fr>
8854
8855 * data/lalr1.cc (Parser::reduce_print_): New.
8856 Use it.
8857
88582003-08-25 Akim Demaille <akim@epita.fr>
8859
8860 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
8861 error recovery loops. This patch is based on
8862 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
8863 Also, augment the similarity between lalr1.cc and yacc.c.
8864 Note: the locations of error recovery rules are not correct yet.
8865
8866 * data/lalr1.cc: Comment changes to augment the similarity between
8867 lalr1.cc and yacc.c.
8868 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
8869 (yyerrlab1): Remove, but where it used to be (now the bottom part of
8870 yyerrlab), when hitting EOF, pop the whole stack here instead of
8871 merely falling thru the default error handling mechanism.
8872 (yyerrorlab): New label, with the old contents of YYERROR,
8873 plus the following change: pop the stack of rhs corresponding
8874 to the production that invoked YYERROR. That is how Yacc
8875 behaves (required by POSIX).
8876 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
8877 fail.
8878
88792003-08-25 Akim Demaille <akim@epita.fr>
8880
8881 Tune local.at so that people can "autom4te -l autotest calc.at -o
8882 calc" for instance, to extract a sub test suite.
8883
8884 * tests/testsuite.at: Move the initialization, Autotest version
8885 requirement, and AT_TESTED invocation into...
8886 * tests/local.at: here.
8887 * tests/testsuite.at: Include it for compatibility with Autoconf
8888 2.57.
8889 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
8890 be ignore.
8891
88922003-08-04 Paul Eggert <eggert@twinsun.com>
8893
8894 Rework code slightly to avoid gcc -Wtraditional warnings.
8895 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
8896 The returned value is now stored in *YY0. All callers changed.
8897 * src/output.c (merge_output): Adjust to the above change.
8898
88992003-07-26 Paul Eggert <eggert@twinsun.com>
8900
8901 * data/glr.c (YYASSERT): New macro.
8902 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
8903 yyresolveStates, yyprocessOneStack):
8904 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
8905 Derived from a suggestion by Frank Heckenbach.
8906
89072003-07-25 Paul Eggert <eggert@twinsun.com>
8908
8909 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
8910 for portability to K&R C (after ansi2knr, presumably). See
8911 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
8912 by Frank Heckenbach, though I have omitted the structure-initialization
8913 part of his glr-knr.diff patch since I recall that the Portable
8914 C Compiler didn't require that change.
8915
8916 Let the user specify how to allocate and free memory.
8917 Derived from a suggestion by Frank Heckenbach in
8918 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
8919 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
8920 All uses of free, malloc, realloc changed to use these macros,
8921 and unnecessary casts removed.
8922 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
8923
89242003-07-06 Matthias Mann <MatthiasMann@gmx.de>
8925
8926 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
8927 use s.empty() rather than s == "" to test for empty string; see
8928 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
8929 (trivial change)
8930
89312003-06-25 Akim Demaille <akim@epita.fr>
8932
8933 * config/depcomp, config/install-sh: Update from masters.
8934
89352003-06-20 Paul Eggert <eggert@twinsun.com>
8936
8937 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
8938 and return properly parenthesized result.
8939 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
8940 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8941 Remove unnecessary parentheses from uses.
8942 * doc/bison.texinfo (Location Default Action): Describe the
8943 conventions for parentheses.
8944
89452003-06-19 Paul Eggert <eggert@twinsun.com>
8946
8947 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
8948 yyreportTree): Do not assume that size_t is the same width as int,
8949 when printing sizes. Print sizes using an unsigned format.
8950 Problem reported by Frank Heckenbach in
8951 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
8952
8953 Port to Forte Developer 7 C compiler.
8954 * data/glr.c (struct YYLTYPE): If locations are not being used,
8955 declare a single dummy member, as empty structs do not conform
8956 to the C standard.
8957 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
8958 the Forte Developer 7 C compiler complains that end-of-loop
8959 code is not reached.
8960
89612003-06-17 Paul Eggert <eggert@twinsun.com>
8962
8963 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
8964 avoid warnings from picky compilers about redefinition of PARAMS.
8965
89662003-06-17 Paul Eggert <eggert@twinsun.com>
8967
8968 Version 1.875b.
8969
8970 * NEWS: Document 1.875b.
8971
8972 * lib/bbitset.h: Do not include config.h; that's the includer's job.
8973 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
8974 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
8975 Don't use 'index' in comments, as it's a builtin fn on some hosts.
8976 * lib/bitset_stats.c: Include gettext.h unconditionally, as
8977 per recent gettext manual's suggestion.
8978 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
8979 Use prototypes, not old-style definitions.
8980 * lib/lbitset.c (lbitset_unused_clear): Likewise.
8981 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
8982 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
8983 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
8984 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
8985 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
8986 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
8987 vbitset_or_and_cmp, vbitset_copy): Likewise.
8988
8989 * lib/libiberty.h: Do not include config.h; that's the includer's job.
8990 Do not include <stdlib.h>.
8991 (PARAMS): Define unconditionally for C89.
8992 (ATTRIBUTE_NORETURN): Remove.
8993 (ATTRIBUTE_UNUSED): Define unconditionally.
8994
8995 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
8996 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8997 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
8998 * lib/vbitset.c, lib/vbitset.h: New files.
8999 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9000 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
9001 from libbitset.
9002
9003 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
9004 `How Can I Reset @code{yyparse}', since texinfo does not allow
9005 arbitrary @ in node names.
9006
9007 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
9008 shouldn't be needed according to the gettext 0.12.1 documentation
9009 but which seem to be needed anyway: codeset.m4 glibc21.m4
9010 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
9011 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
9012 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
9013
9014 * lib/.cvsignore: Add stdbool.h.
9015 * m4/.cvsignore: Add nls.m4, po.m4.
9016
9017 Upgrade to CVS gnulib.
9018 * stdbool_.h: File renamed from stdbool.h.in.
9019 * configure.ac (AM_STDBOOL_H): Invoke this instead of
9020 AC_HEADER_STDBOOL.
9021 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
9022 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
9023 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
9024 (MOSTLYCLEANFILES): New var.
9025 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
9026 (stdbool.h): New rule.
9027 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
9028 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
9029 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
9030 m4/quote.m4: Upgrade to today's gnulib.
9031
9032 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
9033 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
9034 the tests right now.
9035 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
9036 yyerror are declared before use; C99 requires this.
9037
90382003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9039
9040 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
9041 first.
9042 (yyrecoverSyntaxError): Correct the logic for setting and testing
9043 yyerrState.
9044 Correct comment on handling EOF.
9045 Allow states with only a default reduction, rather than failing
9046 (I can't quite reconstruct why these were not allowed before).
9047
9048 Fixes to avoid problem that $-N rules in GLR parsers can cause
9049 buffer overruns, corrupting state.
9050
9051 * src/output.c (prepare_rules): Output max_left_semantic_context
9052 definition.
9053 * src/reader.h (max_left_semantic_context): New variable declaration.
9054 * src/scan-gram.l (max_left_semantic_context): Define.
9055 (handle_action_dollar): Update max_left_semantic_context.
9056 * data/glr.c (YYMAXLEFT): New definition.
9057 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
9058 (yyresolveAction): Ditto.
9059
9060 Fixes to problems with location handling in GLR parsers reported by
9061 Frank Heckenbach (2003/06/05).
9062
9063 * data/glr.c (YYLTYPE): Make trivial if locations not used.
9064 (YYRHSLOC): Add parentheses, and define only if locations used.
9065 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
9066 locations not used.
9067 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
9068 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
9069
9070 * tests/cxx-type.at: Exercise location information; update tests
9071 to differentiate output with and without locations.
9072 Remove forward declarations of yylex and yyerror---caused errors
9073 because default YYLTYPE not yet defined.
9074 Change semantic actions to compute strings, rather than printing
9075 them directly (to test proper passing of semantics values). Change
9076 output to prefix notation and update test data and expected results.
9077 (yylex): Track locations.
9078 (stmtMerge): Return value rather than printing, and include arguments
9079 in value.
9080
90812003-06-03 Paul Eggert <eggert@twinsun.com>
9082
9083 Avoid warnings generated by GCC 2.95.4 when Bison is
9084 configured with --enable-gcc-warnings.
9085 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
9086 yy::]b4_parser_class_name[::translate_,
9087 yy::Stack::operator[] (unsigned),
9088 yy::Stack::operator[] (unsigned) const,
9089 yy::Slice::operator[] (unsigned),
9090 yy::Slice::operator[] (unsigned) const):
9091 Rename local vars to avoid warnings.
9092 * tests/glr-regression.at (Improper handling of embedded actions
9093 and $-N in GLR parsers): Remove unused local variable from yylex.
9094 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
9095 (void) as arg when not pure, since we now assume C89 when building
9096 Bison. Pacify GCC by using parameter.
9097
90982003-06-02 Paul Eggert <eggert@twinsun.com>
9099
9100 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
9101 yy::Location::lines, yy::Location::columns): Rename arguments
9102 to avoid shadowing; this removes a warning generated by GCC 3.3.
9103
91042003-06-01 Paul Eggert <eggert@twinsun.com>
9105
9106 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
9107 to g++, as GCC 3.3 complains if you do it.
9108 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
9109 everything that WARNING_CFLAGS has, except omit warnings
9110 not suitable for C++.
9111 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
9112 * tests/atlocal.in (CXXFLAGS): New var.
9113 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
9114
9115 Fix a GLR parser bug I reported in February; see
9116 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
9117 The problem was that GLR parsers did not conform to the C standard,
9118 because actions like { $1 = $2 + $3; } expanded to expressions
9119 that invoked YYFILL in separate subexpressions, and YYFILL assigned
9120 to a local variable. The C standard says that expressions
9121 like (var = f ()) + (var = f ()) have undefined behavior.
9122 Another problem was that GCC sometimes issues warnings that
9123 yyfill and its parameters are unused.
9124
9125 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
9126 as possibly unused.
9127 (yyfill): New function.
9128 (YYFILL): Use it.
9129 (yyuserAction): Change type of yynormal to bool, so that it matches
9130 the new yyfill signature. Mark it as possibly unused.
9131
9132
9133 Follow up on a bug I reported in February, where a Bison-generated
9134 parser can loop. Provide a test case and a fix for yacc.c. I
9135 don't have a fix for lalr1.cc or for glr.c, unfortunately.
9136 The original bug report is in:
9137 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
9138
9139 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
9140 macro's size was becoming unwieldy.
9141 (yyerrlab): Do not discard an empty lookahead symbol, as this
9142 might destroy garbage.
9143 (yyerrorlab): New label, with the old contents of YYERROR,
9144 plus the following change: pop the stack of rhs corresponding
9145 to the production that invoked YYERROR. That is how Yacc
9146 behaves, and POSIX requires this behavior.
9147 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
9148 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
9149 Define 'alarm' to do nothing if unistd.h is not available.
9150 Add a new rule "exp: '-' error;" to test the above change to
9151 data/yacc.c. Use 'alarm' to abort any test taking longer than
9152 10 seconds, as it's probably looping.
9153 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
9154 Also, the new yacc.c generates two fewer diagnostics for an
9155 existing test.
9156
91572003-05-24 Paul Eggert <eggert@twinsun.com>
9158
9159 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
9160 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
9161 This fixes a problem reported by John Bowman when the Compaq/HP
9162 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
9163 -ansi -Wall -gall).
9164 * data/yacc.c (union yyalloc): Likewise.
9165 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
9166
9167 Switch from 'int' to 'bool' where that makes sense.
9168
9169 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
9170 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
9171 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
9172 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
9173 Return or accept bool, not int. All callers changed.
9174 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
9175 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
9176 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
9177 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
9178 bitset_or_and_cmp_): Likewise.
9179 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
9180 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
9181 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
9182 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
9183 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
9184 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
9185 bitset_stats_or_and_cmp): Likewise.
9186 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
9187 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
9188 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
9189 ebitset_xor_cmp): Likewise.
9190 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
9191 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
9192 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
9193 lbitset_xor_cmp): Likewise.
9194 * lib/bbitset.h: Include <stdbool.h>.
9195 (struct bitset_vtable): The following members now return bool, not
9196 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
9197 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
9198 or_and_cmp).
9199 * src/conflicts.c (count_rr_conflicts): Likewise.
9200 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
9201 All uses changed.
9202 * lib/ebitset.c (ebitset_obstack_init): Likewise.
9203 * lib/lbitset.c (lbitset_obstack_init): Likewise.
9204 * src/getargs.c (debug_flag, defines_flag, locations_flag,
9205 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9206 graph_flag): Likewise.
9207 * src/getargs.h (debug_flag, defines_flag, locations_flag,
9208 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9209 graph_flag): Likewise.
9210 * src/output.c (error_verbose): Likewise.
9211 * src/output.h (error_verbose): Likewise.
9212 * src/reader.c (start_flag, typed): Likewise.
9213 * src/reader.h (typed): Likewise.
9214 * src/getargs.c (LOCATIONS_OPTION): New constant.
9215 (long_options, getargs): Use it.
9216 * src/lalr.c (build_relations): Use bool, not int.
9217 * src/nullable.c (nullable_compute): Likewise.
9218 * src/print.c (print_reductions): Likewise.
9219 * src/tables.c (action_row, pack_vector): Likewise.
9220 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
9221 * src/output.c (prepare): Use it.
9222 * src/output.c (token_definitions_output,
9223 symbol_destructors_output, symbol_destructors_output): Use string,
9224 not boolean integer, to keep track of whether to output separator.
9225 * src/print_graph.c (print_core): Likewise.
9226 * src/state.c (state_rule_lookaheads_print): Likewise.
9227
9228 * config/install-sh: Sync from automake 1.7.5.
9229
92302003-05-14 Paul Eggert <eggert@twinsun.com>
9231
9232 * src/parse-gram.y (rules_or_grammar_declaration): Require a
9233 semicolon after a grammar declaration, in the interest of possible
9234 future changes to the Bison input language.
9235 Do not allow a stray semicolon at the start of the grammar.
9236 (rhses.1): Allow one or more semicolons after any rule, including
9237 just before "|" as required by POSIX.
9238 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
9239 grammar.
9240
92412003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
9242
9243 %parse-param support for lalr1.cc.
9244
9245 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
9246 b4_cc_constructor_calls, b4_cc_constructor_call,
9247 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
9248 definitions.
9249 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
9250 parse-param arguments.
9251 (yy::b4_parser_class_name): Declare instance variables to
9252 hold parse-param arguments.
9253 * tests/calc.at: s/value/semantic_value/ because value clashes
9254 with a member of yy::b4_parser_class_name. Adjust C++ code
9255 to handle %parse-param. Enable %parse-param test in C++.
9256
92572003-05-12 Paul Eggert <eggert@twinsun.com>
9258
9259 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
9260 English a bit. Fix fclose typo. Change "const char" to "char
9261 const", and use ANSI C rather than K&R for "main". Suggest
9262 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
9263 and suggest yy_switch_to_buffer.
9264
92652003-05-05 Paul Eggert <eggert@twinsun.com>
9266
9267 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
9268 C89. This avoids a diagnostic on compilers that define __STDC__
9269 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
9270 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
9271
92722003-05-03 Paul Eggert <eggert@twinsun.com>
9273
9274 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
9275 Do not overrun array bounds.
9276 This should fix a bug reported today by Olatunji Oluwabukunmi in
9277 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
9278
92792003-04-29 Akim Demaille <akim@epita.fr>
9280
9281 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
9282 * src/getargs.c, src/getargs.h: here, as bool, not int.
9283 (nondeterministic_parser): New.
9284 * src/parse-gram.y, src/scan-gram.l: Support
9285 %nondeterministic-parser.
9286 * src/output.c (prepare): Use nondeterministic_parser instead
9287 of glr_parser where appropriate.
9288 * src/tables.c (conflict_row, action_row, save_row)
9289 (token_actions, token_actions, pack_vector): Ditto.
9290
92912003-04-29 Akim Demaille <akim@epita.fr>
9292
9293 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
9294
92952003-04-29 Akim Demaille <akim@epita.fr>
9296
9297 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
9298 with %pure-parser and %locations to exercise the patch from Yakov
9299 Markovitch below.
9300
93012003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
9302
9303 * data/yacc.c: (b4_lex_param): Corrected for the case where
9304 %lex-param is provided and %pure-parser isn't.
9305
93062003-04-27 Paul Eggert <eggert@twinsun.com>
9307
9308 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
9309 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
9310 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
9311 if it is not defined.
9312 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
9313
93142003-04-26 Paul Eggert <eggert@twinsun.com>
9315
9316 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
9317 Declare to be of type suitable for the ninf value itself, not of
9318 type suitable for the corresponding table, since the latter might
9319 be unsigned but the ninf value might be negative. This fixes a
9320 bug reported by Alexandre Duret-Lutz in
9321 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
9322
9323 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
9324 invokes it. We shouldn't invoke it twice because it will attempt
9325 to put error.o in the archive twice. This fixes a glitch reported
9326 by Martin Mokrejs in
9327 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
9328
93292003-04-21 Paul Eggert <eggert@twinsun.com>
9330
9331 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
9332 to gnulib.
9333
93342003-04-21 Yakov Markovitch <Markovitch@iso.ru>
9335
9336 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
9337 Fix obvious typo that results in uncompilable GLR parsers
9338 when both %pure-parser and %locations are used. (trivial change)
9339
93402003-04-17 Paul Eggert <eggert@twinsun.com>
9341
9342 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
9343 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
9344 Do not insert the expected token via unput, as this runs afoul
9345 of a POSIX-compatibility bug in flex 2.5.31.
9346 All uses changed to BEGIN the parent state,
9347 since we no longer insert the expected token via unput.
9348 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
9349 that is no longer emitted after the above change.
9350
9351 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
9352 the first one. This change is from Paul Hilfinger, and it fixes
9353 regression reported by Werner Lemberg in
9354 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
9355
9356 (resolve_sr_conflict): Don't invoke state_errs_set
9357 unless one or more tokens have been explicitly made errors.
9358 Otherwise, the above change causes Bison to abort.
9359
9360 * tests/existing.at (GNU pic Grammar): New test case, taken from
9361 Lemberg's email.
9362
93632003-03-31 Akim Demaille <akim@epita.fr>
9364
9365 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
9366
93672003-03-31 Akim Demaille <akim@epita.fr>
9368
9369 * src/output.c (prepare_symbols): Avoid trailing spaces in the
9370 output.
9371
93722003-03-31 Akim Demaille <akim@epita.fr>
9373
9374 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
9375 From Paul Hilfinger.
9376
93772003-03-29 Akim Demaille <akim@epita.fr>
9378
9379 * m4/error.m4: Do not put under dynamic conditions some code which
9380 expansion is under static control.
9381
93822003-03-29 Akim Demaille <akim@epita.fr>
9383
9384 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
9385
93862003-03-29 Akim Demaille <akim@epita.fr>
9387
9388 * doc/bison.texinfo (Strings are Destroyed): New.
9389
93902003-03-13 Paul Eggert <eggert@twinsun.com>
9391
9392 * .cvsignore: Add configure.lineno.
9393 * src/.cvsignore: Add yacc.
9394 * tests/.cvsignore: Add testsuite.log.
9395 * doc/fdl.texi: Sync with latest FSF version.
9396
93972003-03-12 Paul Eggert <eggert@twinsun.com>
9398
9399 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
9400 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
9401 cursor, instead of leaving it undefined. This fixes a bug
9402 reported by Tim Van Holder in
9403 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
9404 * tests/input.at (Torturing the Scanner): Test the scanner on
9405 an empty input file, which was Tim Van Holder's test case.
9406
9407 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
9408 <sys/resource.h> can be included, include sys/time.h and
9409 sys/times.h first, if available. This works around the SunOS
9410 4.1.4 porting bug reported by Bruce Becker in
9411 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
9412
9413 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
9414 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
9415 AC_HEADER_SYS_WAIT.
9416
9417 Merge changes from gnulib. This was prompted because the CVS
9418 snapshot didn't build on Solaris 7 due to strnlen problems.
9419
9420 These changes need to be merged back into gnulib:
9421 * lib/hash.c: Include <stdbool.h> unconditionally.
9422 * m4/onceonly.m4 (m4_quote): New macro.
9423 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
9424 Quote AC_FOREACH variable-expansions properly.
9425 The 2003-01-03 obstack.h change also needs merging.
9426 {end of changes requiring merging}
9427
9428 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
9429 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
9430 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
9431 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
9432 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
9433 New files, imported from gnulib.
9434 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
9435 above.
9436
9437 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
9438 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
9439 gnulib sources.
9440
9441 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
9442 Add.
9443 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
9444 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
9445 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
9446 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
9447 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
9448 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
9449 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
9450 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
9451 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
9452 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
9453 (jm_PREREQ_ARGMATCH): Remove.
9454 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
9455 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
9456
9457 * src/system.h: Include <stdbool.h> unconditionally.
9458
9459 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
9460 assuming at least C89 in the bitset code for some time now.
9461
94622003-03-03 Akim Demaille <akim@epita.fr>
9463
9464 * ro.po: New.
9465
94662003-03-02 Akim Demaille <akim@epita.fr>
9467
9468 * doc/bison.texinfo (Table of Symbols): Reactivate the
9469 documentation for %lex-param, and %parse-param.
9470
94712003-03-02 Akim Demaille <akim@epita.fr>
9472
9473 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
9474 generate verbose error messages.
9475 Use the number of tokens as an upper bound in yytname, as it
9476 cannot be a non terminal.
9477
94782003-03-02 Akim Demaille <akim@epita.fr>
9479
9480 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
9481 message.
9482
94832003-03-02 Akim Demaille <akim@epita.fr>
9484
9485 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
9486 Use them to exercise yycheck overrun.
9487 Based on Andrew Suffield's grammar.
9488
94892003-03-02 Akim Demaille <akim@epita.fr>
9490
9491 Create tests/local.at for Bison generic testing macros.
9492
9493 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
9494 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
9495 This new file.
9496 * tests/calc.at (AT_CHECK_CALC): Adjust.
9497 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
9498 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
9499 * tests/local.at: here.
9500 (AT_COMPILE_CXX): Tags the tests using it as c++.
9501 Ignore the test if CXX is not functional.
9502
95032003-03-01 Paul Eggert <eggert@twinsun.com>
9504
9505 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
9506 not loc->end, since loc->end might contain garbage and this leads
9507 to undefined behavior on some platforms.
9508 (id_loc, token_start): Use (IF_LINTed) initial values that do not
9509 depend on *loc, so that the reader doesn't give the the false
9510 impression that *loc is initialized.
9511 (<INITIAL>"%%"): Do not bother setting code_start, since its value
9512 does not survive the return.
9513
95142003-03-01 Akim Demaille <akim@epita.fr>
9515
9516 * src/scan-gram.l (code_start): Always initialize it when entering
9517 into yylex, as SC_EPILOGUE is activated *before* the corresponding
9518 yylex invocation. An alternative would be making it static, but
9519 then it starts with the second %%'s beginning, instead of its end.
9520
95212003-02-28 Paul Eggert <eggert@twinsun.com>
9522
9523 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
9524 around a UnixWare 7.1.1 porting bug reported by John Hughes in
9525 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
9526
95272003-02-26 Paul Eggert <eggert@twinsun.com>
9528
9529 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
9530 Remove Sequent/Pyramid discussion (nobody uses them any more).
9531 Merge VMS and MS-DOS discussion; these ports may well be dead
9532 but let's keep mentioning them for now. Put <> around email
9533 addresses. Add copyright notice.
9534
95352003-02-24 Paul Eggert <eggert@twinsun.com>
9536
9537 * data/glr.c (yy_reduce_print): yylineno -> yylno,
9538 to avoid collision with flex use of yylineno.
9539 Problem reported by Bruce Lilly in
9540 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
9541 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9542 * data/yacc.c (yy_reduce_print): Likewise.
9543
9544 * config/depcomp: Sync with Automake 1.7.3.
9545
95462003-02-21 Akim Demaille <akim@epita.fr>
9547
9548 * data/lalr1.cc: Use temporary variables instead of casts to
9549 change integer types.
9550 Suggested by Paul Eggert.
9551
95522003-02-21 Akim Demaille <akim@epita.fr>
9553
9554 * doc/bison.texinfo: Use "location" consistently to refer to @n,
9555 to avoid confusions with lalr1.cc's notion of Position.
9556 Suggested by Paul Eggert.
9557
95582003-02-20 Akim Demaille <akim@epita.fr>
9559
9560 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
9561 before initial_columns.
9562 (location.hh): Use consistent variable names when defining the
9563 operator<<.
9564 Use "last" so that we subtract from Positions, not from unsigned.
9565
95662003-02-20 Akim Demaille <akim@epita.fr>
9567
9568 * data/lalr1.cc (position.hh): New subfile, including the extended
9569 and Doxygen'ed documentation of class Position.
9570 (location.hh): Use it.
9571 Document a` la Doxygen.
9572 With the help of Benoit Perrot.
9573
95742003-02-20 Akim Demaille <akim@epita.fr>
9575
9576 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
9577 AT_YACC_IF.
9578 Redefine AT_YYERROR_SEES_LOC_IF using it.
9579 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
9580 not defined.
9581 Don't use the location in yy::Parser::error_ and
9582 yy::Parser::print_ when not %locations.
9583 Activate more lalr1.cc tests.
9584
95852003-02-19 Akim Demaille <akim@epita.fr>
9586
9587 * data/lalr1.cc: When displaying a line number, be sure to make it
9588 an int.
9589
95902003-02-19 Akim Demaille <akim@epita.fr>
9591
9592 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
9593 Remove, useless.
9594 (YYABORT, YYACCEPT, YYERROR): New.
9595 * tests/calc.at: Renable the lalr1.cc test.
9596
95972003-02-19 Akim Demaille <akim@epita.fr>
9598
9599 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
9600 error recovery, mixing with/without pops and discarding of the
9601 lookahead.
9602 Exercise YYERROR.
9603 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
9604
96052003-02-17 Paul Eggert <eggert@twinsun.com>
9606
9607 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
9608 * tests/testsuite.at (AT_COMPILE): Use them.
9609 This fixes the testsuite problem reported by Robert Lentz in
9610 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
9611
96122003-02-12 Paul Eggert <eggert@twinsun.com>
9613
9614 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
9615 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
9616 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
9617 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
9618 Check for malloc failure, for consistency with yacc.c.
9619 (yytname_size): Remove, for consistency with yacc.c.
9620
9621 The bug still remains in data/lalr1.cc, as I didn't have time
9622 to fix it there.
9623
96242003-02-06 Akim Demaille <akim@epita.fr>
9625
9626 * configure.ac (GXX): Rename as...
9627 (CXX): this, to keep the original Autoconf semantics.
9628 Require 2.57.
9629 * data/lalr1.cc: Fix b4_copyright invocations.
9630 If YYDEBUG is not defined, don't depend upon name_ being defined.
9631 (location.hh): Include string and iostream.
9632 (Position::filename): New member.
9633 (Position::Position ()): New.
9634 (operator<< (Position)): New.
9635 (operator- (Position, int)): New.
9636 (Location::first, Location::last): Rename as...
9637 (Location::begin, Location::end): these, to mock the conventional
9638 iterator names.
9639 (operator<< (Location)): New.
9640 * tests/atlocal.in (CXX): New.
9641 * tests/testsuite.at (AT_COMPILE_CXX): New.
9642 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
9643 locations in a more synthetic way.
9644 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
9645 lalr1.cc is used.
9646 Adjust the C locations to match those from Emacs: first column is
9647 column 0.
9648 Change all the expected results.
9649 Conform to the GCS: simplify the locations when applicable.
9650 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
9651 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
9652 these CPP macros with the m4 macros new defined by...
9653 (AT_CHECK_PUSHDEFS): this, i.e.:
9654 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
9655 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
9656 New macros.
9657 (AT_CHECK_POPDEFS): Undefine them.
9658 (AT_CHECK_CALC_LALR1_CC): New.
9659 Use it for the first lalr1.cc test.
9660
96612003-02-04 Akim Demaille <akim@epita.fr>
9662
9663 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
9664 Location as is defined.
9665
96662003-02-04 Akim Demaille <akim@epita.fr>
9667
9668 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
9669 name_ being defined.
9670
96712003-02-03 Paul Eggert <eggert@twinsun.com>
9672
9673 * src/gram.h (start_symbol): Remove unused decl.
9674
9675 Use more-consistent naming conventions for local vars.
9676
9677 * src/derives.c (derives_compute): Change type of local var from
9678 int to rule_number.
9679 * src/gram.c (grammar_rules_partial_print): Likewise.
9680 * src/print.c (print_core): Likewise.
9681 * src/reduce.c (reduce_grammar_tables): Likewise.
9682
9683 * src/gram.c (grammar_dump): Change name of item_number *
9684 local var from r to rp.
9685 * src/nullable.c (nullable_compute): Likewise.
9686
9687 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
9688
9689 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
9690 for symbol or symbol_number var.
9691 * src/reader.c (grammar_start_symbol_set): Likewise.
9692 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
9693 Likewise.
9694 * src/state.c (transitions_to): Likewise.
9695 * src/state.h: Likewise.
9696 * src/tables.c (symbol_number_to_vector_number): Likewise.
9697
9698 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
9699 char * var.
9700
9701 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
9702 var.
9703
9704 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
9705 var.
9706
9707 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
9708 Use str, not s, for char * var. Use ch, not c, for character var.
9709 Use size for size var.
9710
9711 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
9712 char * var.
9713 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
9714 uniqstr var.
9715 * src/uniqstr.h: Likewise.
9716
9717 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9718 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9719 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
9720 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
9721 param to have same name as that of enum, so that we don't use
9722 "s" to stand for a non-state.
9723
97242003-02-02 Akim Demaille <akim@epita.fr>
9725
9726 * src/scan-skel.l: Scan more than one inert character per yylex
9727 invocation.
9728
97292003-02-01 Paul Eggert <eggert@twinsun.com>
9730
9731 Version 1.875a.
9732
9733 * po/LINGUAS: Add ms.
9734
97352003-01-30 Akim Demaille <akim@epita.fr>
9736
9737 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
9738
97392003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9740
9741 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
9742 of $1.
9743
9744 Changes in response to error report by S. Eken: GLR mode does not
9745 handle negative $ indices or $ indices in embedded rules correctly.
9746 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
9747
9748 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
9749 (b4_rhs_location): Ditto.
9750 (yyfill): New function to copy from stack tree into array
9751 incrementally.
9752 (yyuserAction): Modify to allow incremental move of semantic values
9753 to rhs array when in GLR mode.
9754 Define YYFILL to use in user-defined actions to fill semantic array
9755 as needed.
9756 Remove dummy use of yystack, as there is now a guaranteed use.
9757 (yydoAction): Modify to allow incremental move of semantic values
9758 to rhs array when in GLR mode.
9759 (yyresolveAction): Ditto.
9760 (yyglrShiftDefer): Update comment.
9761 (yyresolveStates): Use X == NULL for pointers, not !X.
9762 (yyglrReduce): Ditto.
9763 (yydoAction): Ditto
9764
9765 * tests/glr-regr1.at: Rename to ...
9766 * tests/glr-regression.at: Add new regression test for the problems
9767 described above (adapted from S. Eken).
9768 Update copyright notice.
9769 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
9770 * tests/Makefile.am: Ditto.
9771
97722003-01-28 Paul Eggert <eggert@twinsun.com>
9773
9774 * data/lalr1.cc: Do not use @output_header_name@ unless
9775 b4_defines_flag is set. This fixes two bugs reported by
9776 Tim Van Holder in
9777 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
9778 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
9779
97802003-01-21 Paul Eggert <eggert@twinsun.com>
9781
9782 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
9783 we don't need to worry about yyerrlab1 being reported as an
9784 "unused label" by non-GCC C compilers. The downside is that if
9785 locations are used then a couple of statements are duplicated each
9786 time YYERROR is invoked, but the upside is that the warnings
9787 should vanish.
9788 (yyerrlab1): Move code to YERROR.
9789 (yyerrlab2): Remove. Change uses back to yyerrlab1.
9790 This reverts some of the 2002-12-27 change.
9791
97922003-01-17 Paul Eggert <eggert@twinsun.com>
9793
9794 * src/output.c (symbol_printers_output): Fix typo that led
9795 to core dump. Problem reported by Antonio Rus in
9796 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
9797
97982003-01-13 Akim Demaille <akim@epita.fr>,
9799 Quoc Peyrot <chojin@lrde.epita.fr>,
9800 Robert Anisko <anisko_r@lrde.epita.fr>
9801
9802 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
9803 when the stacks contain one element, as the loop would otherwise
9804 free the last state, and then use the top state (the one we just
9805 popped). This means that the initial elements will not be freed
9806 explicitly, as is the case in yacc.c; it is not a problem, as
9807 these elements have fake values.
9808
98092003-01-11 Paul Eggert <eggert@twinsun.com>
9810
9811 * NEWS: %expect-violations are now just warnings, reverting
9812 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
9813 bootstrapping problem reported by Matthias Klose; see
9814 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
9815 * src/conflicts.c (conflicts_print): Likewise.
9816 * tests/conflicts.at (%expect not enough, %expect too much,
9817 %expect with reduce conflicts): Likewise.
9818 * doc/bison.texinfo (Expect Decl): Document this. Also mention
9819 that the warning is enabled if the number of conflicts changes
9820 (not necessarily increases).
9821
9822 * src/getargs.c (version): Update copyright year.
9823
98242003-01-09 Akim Demaille <akim@epita.fr>
9825
9826 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
9827
98282003-01-08 Paul Eggert <eggert@twinsun.com>
9829
9830 * Makefile.maint (WGETFLAGS):
9831 New macro, containing "-C off" to disable proxy caches.
9832 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
9833 (rel-check): Use $(WGET) instead of wget.
9834
98352003-01-06 Paul Eggert <eggert@twinsun.com>
9836
9837 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
9838 the GLR paper of Scott, Johnstone and Hussain.
9839
98402003-01-04 Paul Eggert <eggert@twinsun.com>
9841
9842 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
9843 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
9844 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
9845 (EXTRA_LIBRARIES): New var, for liby.a.
9846 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
9847 (EXTRA_SCRIPTS): New var, for yacc.
9848
9849 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
9850 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
9851 Problem reported by Nelson H. F. Beebe.
9852
98532003-01-03 Paul Eggert <eggert@twinsun.com>
9854
9855 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
9856 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
9857 when compiling Bison 1.875's `bitset bset = obstack_alloc
9858 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
9859
9860 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
9861 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
9862 grow to a huge size with typical invocation.
9863
9864 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
9865 Use the pattern recommended by Autoconf 2.57, except also protect
9866 against double-definition.
9867 * src/system.h: Likewise.
9868 Portability issues reported by Nelson H. F. Beebe.
9869
9870 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
9871 All uses changed. Provide a definition in both C and C++.
9872 (yytrue, yyfalse): Define even if defined (__cplusplus).
9873
9874 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
9875 Reported by Nelson H. F. Beebe.
9876
9877 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
9878
98792003-01-02 Paul Eggert <eggert@twinsun.com>
9880
9881 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
9882 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
9883 Bug reported by Nelson H. F. Beebe.
9884
98852003-01-01 Paul Eggert <eggert@twinsun.com>
9886
9887 * Version 1.875.
9888
98892002-12-30 Paul Eggert <eggert@twinsun.com>
9890
9891 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
9892 Moved here from...
9893 (<INITIAL>","): Here. This causes stray "," to be treated
9894 more uniformly.
9895
9896 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
9897 last brace in braced code when not in Yacc mode, for compatibility
9898 with Bison 1.35. This resurrects the 2001-12-15 patch to
9899 src/reader.c.
9900
9901 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
9902 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
9903
99042002-12-28 Paul Eggert <eggert@twinsun.com>
9905
9906 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
9907 that of SYM's type. This fixes Debian bug 168069, reported by
9908 Thomas Olsson.
9909
99102002-12-28 Paul Eggert <eggert@twinsun.com>
9911
9912 Version 1.75f.
9913
9914 Switch back to the Yacc style of conflict reports, undoing some
9915 of the 2002-07-30 change.
9916 * doc/bison.texinfo (Understanding): Use Yacc style for
9917 conflict reports. Also, use new way of locating rules.
9918 * src/conflicts.c (conflict_report):
9919 Renamed from conflict_report_yacc, removing the old
9920 'conflict_report'. Translate the entire conflict report at once,
9921 so that we don't assume that "," has the same interpretation in
9922 all languages.
9923 (conflicts_output): Use Yacc-style conflict report for each state,
9924 instead of our more-complicated style.
9925 (conflicts_print): Use Yacc-style conflict report, except print
9926 the input file name when not emulating Yacc.
9927 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
9928 Conflicted Reduction, %expect not enough, %expect too much,
9929 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
9930 * tests/existing.at (GNU Cim Grammar): Likewise.
9931 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
9932
9933 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
9934 fatal): Don't invoke fflush; it's not needed and it might even be
9935 harmful for stdout, as stdout might not be open.
9936 * src/reduce.c (reduce_print): Likewise.
9937
99382002-12-27 Paul Eggert <eggert@twinsun.com>
9939
9940 Fix a bug where error locations were not being recorded correctly.
9941 This problem was originally reported by Paul Hilfinger in
9942 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
9943
9944 * data/yacc.c (yyparse): New local var yylerrsp, to record the
9945 top of the location stack's error locations.
9946 (yyerrlab): Set it. When discarding a token, push its location
9947 onto yylerrsp so that we don't lose track of the error's end.
9948 (yyerrlab1): Now is only the target of YYERROR, so that we can
9949 properly record the location of the action that failed. For GCC
9950 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
9951 GCC warning about yyerrlab1 being unused if YYERROR is unused.
9952 (yyerrlab2): New label, which yyerrlab now falls through to.
9953 Compute the error's location by applying YYLLOC_DEFAULT to
9954 the locations of all the symbols that went into the error.
9955 * doc/bison.texinfo (Location Default Action): Mention that
9956 YYLLOC_DEFAULT is also invoked for syntax errors.
9957 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9958 Error locations include the locations of all the tokens that were
9959 discarded, not just the last token.
9960
99612002-12-26 Paul Eggert <eggert@twinsun.com>
9962
9963 * src/files.c: Include quote.h.
9964 (compute_output_file_names): Warn if we detect conflicting
9965 outputs to the same file. This should catch the misunderstanding
9966 exemplified by Debian Bug 165349, reported by Bruce Stephens..
9967
9968 * src/conflicts.c (conflicts_print): If the user specifies
9969 "%expect N", report an error if there are any reduce/reduce
9970 conflicts. This is what the manual says should happen.
9971 This fixes Debian bug 130890, reported by Anthony DeRobertis.
9972 * tests/conflicts.at (%expect with reduce conflicts): New test.
9973
9974 Don't use m4_include on relative file names, as it doesn't work as
9975 desired if there happens to be a file with that name under ".".
9976
9977 * m4sugar/version.m4: Remove; it was included but it wasn't used.
9978 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
9979 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
9980 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
9981 * src/output.c (output_skeleton): Use full path names when
9982 specifying a file to include; don't rely on include path, as
9983 it's unreliable when the working file contains a file with
9984 that name.
9985
99862002-12-25 Paul Eggert <eggert@twinsun.com>
9987
9988 Remove obsolete references to bison.simple and bison.hairy.
9989 Problem mentioned by Aubin Mahe in
9990 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
9991 * data/glr.c: Comment fix.
9992 * doc/bison.1: Remove references. Also, mention "yacc".
9993
9994 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
9995 with -g option.
9996
9997 * src/parse-gram.y (declaration): Use enum "report_states" rather
9998 than its numeric value 1.
9999
10000 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
10001 opening a new one. This fixes Debian bug 165349, reported by
10002 Bruce Stephens.
10003
100042002-12-24 Paul Eggert <eggert@twinsun.com>
10005
10006 Version 1.75e.
10007
10008 * Makefile.maint (cvs-update): Don't assume that the shell
10009 supports $(...), as Solaris sh doesn't.
10010
10011 * src/parse-gram.y (lloc_default): Remove test for empty
10012 nonterminals at the end, since it didn't change the result.
10013
100142002-12-24 Paul Eggert <eggert@twinsun.com>
10015
10016 If the user does not define YYSTYPE as a macro, Bison now declares it
10017 using typedef instead of defining it as a macro. POSIX requires this.
10018 For consistency, YYLTYPE is also declared instead of defined.
10019
10020 %union directives can now have a tag before the `{', e.g., the
10021 directive `%union foo {...}' now generates the C code
10022 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
10023 The default union tag is `YYSTYPE', for compatibility with Solaris 9
10024 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
10025 instead of `yyltype'.
10026
10027 `yystype' and `yyltype' are now obsolescent macros instead of being
10028 typedefs or tags; they are no longer documented and will be
10029 withdrawn in a future release.
10030
10031 * data/glr.c (b4_location_type): Remove.
10032 (YYSTYPE): Renamed from yystype.
10033 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
10034 (struct YYLTYPE): Renamed from struct yyltype.
10035 (YYLTYPE): Renamed from yyltype.
10036 (yyltype, yystype): New (and obsolescent) macros,
10037 for backward compatibility.
10038 * data/yacc.c: Likewise.
10039
10040 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
10041 does not specify a union tag. This is for compatibility with
10042 Solaris 9 yacc.
10043
10044 * src/parse-gram.y (add_param): 2nd arg is now char * not char
10045 const *, since it is now modified by stripping surrounding { }.
10046 (current_braced_code): Remove.
10047 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
10048 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
10049 trailing " {...}". Now of type <chars>.
10050 (grammar_declaration): Adjust to bundled tokens.
10051 (code_content): Remove; stripping is now done by add_param.
10052 (print_token_value): Print contents of bundled tokens.
10053 (token_name): New function.
10054
10055 * src/reader.h (braced_code, current_braced_code): Remove.
10056 (token_name): New decl.
10057
10058 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
10059 token_type, not braced_code code_kind. All uses changed.
10060 (SC_PRE_CODE): New state, for scanning after a keyword that
10061 has (or usually has) an immediately-following braced code.
10062 (token_type): New local var, to keep track of which token type
10063 to return when scanning braced code.
10064 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
10065 <INITIAL>"%parse-param", <INITIAL>"%printer",
10066 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
10067 instead of returning a token type immediately.
10068 (<INITIAL>"{"): Set token type.
10069 (<SC_BRACED_CODE>"}"): Use it.
10070 (handle_action_dollar, handle_action_at): Now returns bool
10071 indicating success. Fail if ! current_rule; this prevents a core dump.
10072 (handle_symbol_code_dollar, handle_symbol_code_at):
10073 Remove; merge body into caller.
10074 (handle_dollar, handle_at): Complain in invalid contexts.
10075
10076 * NEWS, doc/bison.texinfo: Document the above.
10077 * NEWS: Fix years and program names in copyright notice.
10078
100792002-12-17 Paul Eggert <eggert@twinsun.com>
10080
10081 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
10082 Reporting, Table of Symbols): Omit mentions of %lex-param and
10083 %parse-param from the documentation for now.
10084
100852002-12-15 Paul Eggert <eggert@twinsun.com>
10086
10087 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
10088 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
10089 lookahead symbol, and which sets yychar in parser actions) and it
10090 disagreed with the Bison documentation. Bug
10091 reported by Andrew Walrond.
10092
10093 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
10094 as the caller now does that.
10095 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
10096 (YYEMPTY): Parenthesize right hand side, since others use it.
10097 (yyparse): Don't assume that our generated code is the only code
10098 that sets yychar.
10099
101002002-12-13 Paul Eggert <eggert@twinsun.com>
10101
10102 Version 1.75d.
10103
10104 POSIX requires a "yacc" command.
10105 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
10106 (MOSTLYCLEANFILES): Add yacc.
10107 (yacc): New rule.
10108 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
10109 as an alias for bison y.
10110
10111 * po/LINGUAS: Add da.
10112
10113 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
10114 problem with latest <getopt.h>.
10115 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
10116
10117 * doc/fdl.texi: Upgrade to 1.2.
10118 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
10119 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
10120 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
10121 gnulib.
10122 * config/install-sh: Sync with autotools.
10123
10124 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
10125 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
10126 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
10127 locations are requested.
10128 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
10129 locations are requested.
10130
101312002-12-12 Paul Eggert <eggert@twinsun.com>
10132
10133 Remove unportable casts and storage allocation tricks.
10134 While we're at it, remove almost all casts, since they
10135 usually aren't needed and are a sign of trouble.
10136
10137 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
10138
10139 * src/derives.c (derives_compute): Do not subtract NTOKENS from
10140 the pointer DSET returned by malloc; this isn't portable.
10141 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
10142 Similarly for DERIVES.
10143 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
10144 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
10145 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
10146
10147 * src/derives.c (derives_compute): Do not bother invoking
10148 int_of_rule_number, since rule numbers are integers.
10149
10150 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
10151 rather than XMALLOC (char, N).
10152
10153 * src/files.c (filename_split): Rewrite to avoid cast.
10154
10155 * src/gram.h (symbol_number_as_item_number,
10156 item_number_as_symbol_number, rule_number_as_item_number,
10157 item_number_as_rule_number):
10158 Now inline functions rather than macros, to avoid casts.
10159 * src/state.h (state_number_as_int): Likewise.
10160 * src/tables.c (state_number_to_vector_number,
10161 symbol_number_to_vector_number): Likewise.
10162
10163 * src/gram.h (int_of_rule_number): Remove; no longer used.
10164
10165 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
10166 since the resulting storage is always stored into.
10167
10168 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
10169 where it's needed.
10170
10171 * src/muscle_tab.c (muscle_m4_output):
10172 Now inline. Return bool, not int.
10173 * src/state.c (state_compare): Likewise.
10174 * src/symtab.c (symbol_check_defined,
10175 symbol_check_alias_consistency, symbol_pack, symbol_translation,
10176 hash_compare_symbol, hash_symbol):
10177 Likewise.
10178 * src/uniqstr.c (uniqstr_print): Likewise.
10179 * src/muscle_tab.c (muscle_m4_output_processor):
10180 New function, to avoid casts.
10181 * src/state.c (state_comparator, stage_hasher): Likewise.
10182 * src/symtab.c (symbol_check_defined_processor,
10183 symbol_check_alias_consistency_processor, symbol_pack_processor,
10184 symbol_translation_processor, hash_symbol_comparator,
10185 hash_symbol_hasher): Likewise.
10186 * src/uniqstr.c (uniqstr_print_processor): Likewise.
10187 * src/muscle_tab.c (muscles_m4_output):
10188 Use new functions instead of casting old functions unportably.
10189 * src/state.c (state_hash_new): Likewise.
10190 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
10191 symbols_token_translations_init):
10192 Likewise.
10193 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
10194
10195 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
10196 var instead of casting to long, to avoid casts.
10197 (prepare_states): Use MALLOC rather than alloca, so that we don't
10198 have to worry about alloca.
10199 * src/state.c (state_hash_lookup): Likewise.
10200
10201 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
10202 local var instead of casting to unsigned char, to avoid casts.
10203
10204 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
10205 STATE_ALLOC): Remove.
10206 (transitions_new, errs_new, reductions_new, state_new): Use malloc
10207 rather than calloc, and use offsetof to avoid allocating slightly
10208 too much storage.
10209 (state_new): Initialize all members.
10210
10211 * src/state.c (state_hash): Use unsigned accumulator, not signed.
10212
10213 * src/symtab.c (symbol_free): Remove; unused.
10214 (symbol_get): Remove cast in lhs of assignment.
10215 (symbols_do): Now static. Accept generic arguments, not
10216 hashing-related ones.
10217
10218 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
10219 (symbol_processor): Remove.
10220 (symbols_do): Remove decl; now static.
10221
10222 * src/system.h (alloca): Remove; decl no longer needed.
10223 (<stddef.h>): Include, for offsetof.
10224 (<inttypes.>, <stdint.h>): Include if available.
10225 (uintptr_t): New type, if system lacks it.
10226 (CALLOC, MALLOC, REALLOC): New macros.
10227 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
10228 new macros.
10229
10230 * src/tables.c (table_size): Now int, to pacify GCC.
10231 (table_grow, table_ninf_remap): Use signed table size.
10232 (save_row): Don't bother initializing locals when not needed.
10233 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
10234 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
10235
10236 * src/vcg.h: Correct misspellings.
10237
10238 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
10239
10240
10241 * src/getargs.c (getargs): Don't assume EOF == -1.
10242
102432002-12-09 Paul Eggert <eggert@twinsun.com>
10244
10245 Change identifier spellings to avoid collisions with names
10246 that are reserved by POSIX.
10247
10248 Don't use names ending in _t, since POSIX reserves them.
10249 For consistency, remove _e and _s endings -- they're weren't
10250 needed to remove ambiguity. All uses changed.
10251 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
10252 turn was just renamed from struniq_t.
10253 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
10254 which in turn was just renamed from struniq_processor_t.
10255 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
10256 in turn was renamed from hash_compare_struniq_t.
10257 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
10258 (state_list): Renamed from state_list_t.
10259 * src/assoc.h (assoc): Renamed from assoc_t.
10260 * src/conflicts.c (enum conflict_resolution): Renamed from
10261 enum conflict_resolution_e.
10262 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
10263 (rule_list): Renamed from rule_list_t.
10264 * src/getargs.h (enum trace): Renamed from enum trace_e.
10265 (enum report): Renamed from enum report_e.
10266 * src/gram.h (item_number): Renamed from item_number_t.
10267 (rule_number): Renamed from rule_number_t.
10268 (struct rule_s): Remove the "rule_s" part; not used.
10269 (rule): Renamed from rule_t.
10270 (rule_filter): Renamed from rule_filter_t.
10271 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
10272 (goto_list): Renamed from goto_list_t.
10273 * src/lalr.h (goto_number): Renamed from goto_number_t.
10274 * src/location.h (location): Renamed from location_t.
10275 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
10276 and moved here from:
10277 * src/muscle_tab.h (muscle_entry_t): here.
10278 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
10279 (rule_list): Renamed from rule_list_t.
10280 * src/print_graph.c (static_graph): Renamed from graph.
10281 * src/reader.h (braced_code): Renamed from braced_code_t.
10282 Remove brace_code_e tag.
10283 * src/relation.h (relation_node): Renamed from relation_node_t.
10284 (relation_nodes): Renamed from relation_nodes_t.
10285 (relation): Renamed from relation_t.
10286 * src/state.h (state_number): Renamed from state_number_t.
10287 (struct state): Renamed from struct state_s.
10288 (state): Renamed from state_t.
10289 (transitions): Renamed from transitions_t. Unused (and
10290 misspelled) transtion_s tag removed.
10291 (errs): Renamed from errs_t. Unused errs_s tag removed.
10292 (reductions): Renamed from reductions_t. Unused tag
10293 reductions_s removed.
10294 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
10295 (struct symbol_list): Renamed from struct symbol_list_s.
10296 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
10297 (struct symbol): Renamed from struct symbol_s.
10298 (symbol): Renamed from symbol_t.
10299 * src/tables.c (vector_number): Renamed from vector_number_t.
10300 (action_number): Renamed from action_t.
10301 * src/tables.h (base_number): Renamed from base_t.
10302 * src/vcg.h (enum color): Renamed from enum color_e.
10303 (enum textmode): Renamed from enum textmode_e.
10304 (enum shape): Renamed from enum shape_e.
10305 (struct colorentry): Renamed from struct colorentry_s.
10306 (struct classname): Renamed from struct classname_s.
10307 (struct infoname): Renamed from struct infoname_s.
10308 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
10309 (enum decision): Renamed from enum decision_e.
10310 (enum orientation): Renamed from enum orientation_e.
10311 (enum alignment): Renamed from enum alignment_e.
10312 (enum arrow_mode): Renamed from enum arrow_mode_e.
10313 (enum crossing_type): Renamed from enum crossing_type_e.
10314 (enum view): Renamed from enum view_e.
10315 (struct node): Renamed from struct node_s.
10316 (node): Renamed from node_t.
10317 (enum linestyle): Renamed from enum linestyle_e.
10318 (enum arrowstyle): Renamed from enum arrowstyle_e.
10319 (struct edge): Renamed from struct edge.
10320 (edge): Renamed from edge_t.
10321 (struct graph): Renamed from struct graph_s.
10322 (graph): Renamed from graph_t.
10323 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
10324 Rename value_t -> value.
10325 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
10326 value_t_as_yystype -> value_as_yystype.
10327
10328 Don't include <errno.h> in the mainstream code, since it
10329 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
10330 * lib/get-errno.c, lib/get-errno.h: New files.
10331 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
10332 get-errno.c.
10333 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
10334 * src/output.c (output_skeleton): Likewise.
10335 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
10336 instead of errno.
10337 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
10338 Likewise.
10339 (handle_action_dollar, handle_action_at): Likewise.
10340 * src/system.h: Do not include <errno.h>.
10341 (TAB_EXT): Renamed from EXT_TAB.
10342 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
10343
10344 Avoid str[a-z]*, since <string.h> reserves that name space.
10345 Change all instances of "struniq" in names to "uniqstr", and
10346 likewise for "STRUNIQ" and "UNIQSTR".
10347 * src/uniqstr.c: Renamed from src/struniq.c.
10348 * src/uniqstr.h: Renamed from src/struniq.h.
10349 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
10350 * src/files.c (strsuffix): Remove; unused.
10351 (concat2): Renamed from stringappend. Now static.
10352 * src/files.h (strsuffix, stringappend): Remove; unused.
10353 * src/parse-gram.y (<chars>): Renamed from <string>.
10354 (<uniqstr>): Renamed from <struniq>.
10355 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
10356 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
10357 (struct graph_s.expand): Renamed from struct graph_s.stretch.
10358 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
10359 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
10360 (N_EXPAND): Renamed from N_STRETCH.
10361
10362 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
10363 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
10364 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
10365 Remove; unused.
10366 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
10367 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
10368 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
10369 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
10370 (BASE_MAXIMUM): Renamed from BASE_MAX.
10371 (BASE_MINIMUM): Renamed from BASE_MIN.
10372 (ACTION_MAX): Remove; unused.
10373 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
10374 Unnecessary casts removed from above defines.
10375
10376
10377 Fix misspelling in names.
10378 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
10379 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
10380 G_NODE_ALIGNEMENT.
10381
10382
10383 * lib/timevar.c (timevar_report): Renamed from time_report,
10384 for consistency with other names.
10385 * lib/timevar.h (timevar_report): New decl.
10386 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
10387
10388
10389 Sort include-file uses.
10390
10391 Reorder all include files under src to be in the order "system.h".
10392 then the ../lib include files in angle brackets (alphabetized),
10393 then the . include files in double-quotes (alphabetized). Fix
10394 dependency breakages encountered in this process, as follows:
10395 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
10396 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
10397 * src/state.h: Include "symtab.h".
10398
103992002-12-08 Paul Eggert <eggert@twinsun.com>
10400
10401 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
10402 since this causes problems when __file__ contains character
10403 sequences like "@" that are treated specially by src/scan-skel.l.
10404 Instead, just use the file's basename. This fixes the bug
10405 reported by Martin Mokrejs in
10406 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
10407
104082002-12-06 Paul Eggert <eggert@twinsun.com>
10409
10410 Add support for rules that do not have trailing semicolons, as
10411 POSIX requires. Improve the quality of locations in Bison
10412 diagnostics.
10413
10414 * src/location.c: Include <quotearg.h>.
10415 (empty_location): Now const.
10416 (location_print): New function. Follow the recommendation of the
10417 GNU Coding Standards for locations that span file boundaries.
10418 * src/location.h: Do not include <quotearg.h>; no longer needed.
10419 (boundary): New type.
10420 (location_t): Use it. This allows locations to span file boundaries.
10421 All member uses changed: file -> start.file or end.file (as needed),
10422 first_line -> start.line, first_column -> start.column,
10423 last_line -> end.line, last_column -> end.column.
10424 (equal_boundaries): New function.
10425 (LOCATION_RESET, LOCATION_STEP): Remove.
10426 (LOCATION_PRINT): Remove. All callers changed to use location_print.
10427 (empty_location): Now const.
10428 (location_print): New decl.
10429 * src/parse-gram.y (lloc_default): New function, which handles
10430 empty locations more accurately.
10431 (YYLLOC_DEFAULT): Use it.
10432 (%token COLON): Remove.
10433 (%token ID_COLON): New token.
10434 (rules): Use it.
10435 (declarations, rules): Remove trailing semicolon.
10436 (declaration, rules_or_grammar_declaration):
10437 Allow empty (";") declaration.
10438 (symbol_def): Remove empty actions; no longer needed.
10439 (rules_or_grammar_declaration): Remove trailing semicolon.
10440 (semi_colon.opt): Remove.
10441 * src/reader.h: Include location.h.
10442 (scanner_cursor): New decl.
10443 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
10444 rolling our own.
10445 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
10446 of *loc.
10447 (STEP): Remove. No longer needed, now that adjust_location does
10448 the work. All uses removed.
10449 (scanner_cursor): New var.
10450 (adjust_location): Renamed from extend_location. It now sets
10451 *loc and adjusts the scanner cursor. All uses changed.
10452 Don't bother testing for CR.
10453 (handle_syncline): Remove location arg; now updates scanner cursor.
10454 All callers changed.
10455 (unexpected_end_of_file): Now accepts start boundary of token or
10456 comment, not location. All callers changed. Update scanner cursor,
10457 not the location.
10458 (SC_AFTER_IDENTIFIER): New state.
10459 (context_state): Renamed from c_context. All uses changed.
10460 (id_loc, code_start, token_start): New local vars.
10461 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
10462 processing of Yacc white space and equivalents here.
10463 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
10464 instead of returning ID immediately, since we need to search for
10465 a subsequent colon.
10466 (<INITIAL>"'", "\""): Save token_start.
10467 (<INITIAL>"%{", "{", "%%"): Save code_start.
10468 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
10469 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
10470 BEGIN context_state at end, not INITIAL.
10471 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
10472 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
10473 Return correct token start.
10474 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
10475 the start of a character, string or multiline comment is found.
10476 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
10477 Reduction): Adjust reported locations to match the more-precise
10478 results now expected.
10479 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
10480 * tests/reduce.at (Useless Rules, Reduced Automaton,
10481 Underivable Rules): Likewise.
10482 * tests/regression.at (Invalid inputs): No longer `expecting ";"
10483 or "|"' now that so many other tokens are allowed by the new grammar.
10484
10485 * src/complain.h (current_file): Remove duplicate decl;
10486 current_file is now owned by files.h.
10487 * src/complain.c, src/scan-gram.l: Include files.h.
10488
104892002-12-06 Paul Eggert <eggert@twinsun.com>
10490
10491 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
10492 promotes to int; it might be unsigned int.
10493 * data/yacc.c (yy_reduce_print): Likewise.
10494
10495 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
10496 be #defined in the prologue, not in the Bison declarations.
10497 This fixes Debian Bug 102878, reported by Shaul Karl.
10498
104992002-12-02 Paul Eggert <eggert@twinsun.com>
10500
10501 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
10502 * lib/strtoul.c: New file, from gnulib.
10503 This fixes a porting bug reported by Peter Klein in
10504 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
10505
105062002-11-30 Paul Eggert <eggert@twinsun.com>
10507
10508 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
10509 and put only a forward declaration in the prologue. This is for
10510 consistency with the other scanner helper functions.
10511
10512 Type clashes now generate warnings, not errors, since it
10513 appears that POSIX may allow some grammars with type clashes.
10514 * src/reader.c (grammar_current_rule_check): Warn about
10515 type clashes instead of complaining.
10516 * tests/input.at (Type Clashes): Expect warnings, not complaints.
10517
10518 Add Yacc library, since POSIX requires it.
10519 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
10520 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
10521 * lib/main.c, lib/yyerror.c: New files.
10522
10523 gram_error can be static; it need not be extern.
10524 * src/reader.h (gram_error): Remove decl.
10525 * src/parse-gram.y (gram_error): Now static. Add static decl.
10526 (print_token_value): Omit parameter names from forward decl,
10527 for consistency.
10528
105292002-11-29 Paul Eggert <eggert@twinsun.com>
10530
10531 * doc/bison.texinfo: Emphasize that yylex and yyerror must
10532 be declared before being used. E.g., one should typically
10533 declare them in the prologue. Use GNU coding style in examples.
10534 Put "const" consistently after the type it modifies. Mention
10535 that C99 supports "inline". Mention that yyerror traditionally
10536 returns "int".
10537
10538 %parse-param and %lex-param now take just one argument, the
10539 declaration; the argument name is deduced from the declaration.
10540
10541 * doc/bison.texinfo (Parser Function, Pure Calling, Error
10542 Reporting, Table of Symbols): Document this.
10543 * src/parse-gram.y (add_param): New function.
10544 (COMMA): Remove.
10545 (declaration): Implement new rule for %parse-param and %lex-param.
10546 * src/scan-gram.l: "," now elicits a warning, rather than being
10547 a token; this is more compatible with byacc.
10548 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
10549
105502002-11-27 Paul Eggert <eggert@twinsun.com>
10551
10552 Rename identifiers to avoid real and potential collisions.
10553
10554 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
10555 to avoid collision with lex macro described by Bruce Lilly in
10556 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
10557 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10558 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
10559 * src/parse-gram.y (print_token_value): Renamed from yyprint.
10560 All uses changed.
10561 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
10562 The name "yycontrol" violates the name space rules, and this stuff
10563 wasn't being used anyway.
10564 (input): Remove action; this stuff wasn't being used.
10565 (gram_error): Rename local variable yylloc -> loc.
10566 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
10567 (YY_DECL): Don't use "yy" at start of local variables.
10568 All uses changed, e.g., yylloc -> loc.
10569 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
10570 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
10571 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
10572 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
10573
10574 * src/parse-gram.y (gram_error): loc is now const *.
10575 * src/reader.h (gram_error): Likewise.
10576
105772002-11-24 Paul Eggert <eggert@twinsun.com>
10578
10579 Version 1.75c.
10580
10581 * tests/actions.at (Actions after errors): Use an output format
10582 more similar to that of the Printers and Destructors test.
10583 Test the position of the ';' token too.
10584 (Printers and Destructors): Likewise.
10585 (Printers and Destructors: %glr-parser): Remove for now, to avoid
10586 unnecessarily alarming people when the test fails.
10587
10588 * data/yacc.c (yyerrlab1): Move this label down, so that the
10589 parser does not discard the lookahead token if the user code
10590 invokes YYERROR. This change is required for POSIX conformance.
10591
10592 * lib/error.c: Sync with gnulib.
10593
105942002-11-22 Paul Eggert <eggert@twinsun.com>
10595
10596 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
10597 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
10598 * lib/xmalloc.c: Likewise.
10599
106002002-11-20 Paul Eggert <eggert@twinsun.com>
10601
10602 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
10603
106042002-11-20 Paul Eggert <eggert@twinsun.com>
10605
10606 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
10607 should use `if (! x) abort ();' rather than `assert (x);', and
10608 anyway it's one less thing to worry about configuring.
10609
10610 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
10611 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
10612 and replace all instances of assert with abort.
10613 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10614 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
10615
10616 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
10617 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
10618 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
10619 hash_find_entry, hash_rehash, hash_insert): Likewise.
10620 * src/conflicts.c (resolve_sr_conflict): Likewise.
10621 * src/lalr.c (set_goto_map, map_goto): Likewise.
10622 * src/nullable.c (nullable_compute): Likewise.
10623 * src/output.c (prepare_rules, token_definitions_output): Likewise.
10624 * src/reader.c (packgram, reader): Likewise.
10625 * src/state.c (state_new, state_free, state_transitions_set,
10626 state_reduction_find): Likewise.
10627 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
10628 symbol_pack): Likewise.
10629 * src/tables.c (conflict_row, pack_vector): Likewise.
10630 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10631 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10632 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
10633 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
10634
10635 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
10636 (ARGMATCH_CONSTRAINT): New macro.
10637 (ARGMATCH_ASSERT): Use it.
10638
10639 * src/system.h (verify): New macro.
10640 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
10641 rather than assert.
10642 * src/tables.c (tables_generate): Likewise.
10643
10644 * src/struniq.c (struniq_assert): Now returns void, and aborts
10645 if the assertion is false.
10646 (struniq_assert_p): Remove.
10647 * src/struniq.h: Likewise.
10648
106492002-11-18 Paul Eggert <eggert@twinsun.com>
10650
10651 * data/glr.c (yygetLRActions): Replace `yyindex' with
10652 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
10653 This fixes the regression with Sun ONE Studio 7 cc that I reported in
10654 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
10655
106562002-11-18 Akim Demaille <akim@epita.fr>
10657
10658 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
10659 space.
10660 From Tim Van Holder.
10661
106622002-11-17 Paul Eggert <eggert@twinsun.com>
10663
10664 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
10665 to "SyntaxError" for consistency with my 2002-11-15 change.
10666
10667 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
10668 not define to {}, since this breaks the common use of `YYDPRINTF
10669 ((...));' if a single statement is desired (e.g. before `else').
10670 Work around GCC warnings by surrounding corresponding calls with
10671 {} if needed.
10672 (yyhasResolvedValue): Remove unused function.
10673 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
10674 loop body.
10675 (yyreportSyntaxError): Renamed from yyreportParseError.
10676 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
10677 All uses changed.
10678 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
10679 extern when possible. Remove unused initializations.
10680
106812002-11-16 Akim Demaille <akim@epita.fr>
10682
10683 Augment the similarity between GLR and LALR traces.
10684
10685 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
10686 (YY_REDUCE_PRINT): New.
10687 (yyparse): Use them.
10688 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
10689 YYDPRINT here.
10690 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
10691 state reached after the reduction/recovery, since...
10692 (yyparse, yyprocessOneStack): Report the state we are entering in.
10693
106942002-11-16 Akim Demaille <akim@epita.fr>
10695
10696 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
10697 Add support for --trace=skeleton.
10698 * src/scan-skel.l: %option debug.
10699 Scan strings of non-@ or \n instead of character by character.
10700 (scan_skel): Handle trace_skeleton.
10701 (QPUTS): New.
10702 (@output_parser_name@, @output_header_name@): ``Restore'' their
10703 support (used to be M4 macros).
10704 * data/yacc.c: Quote larger chunks, a la glr.c.
10705 * data/lalr1.cc: Likewise.
10706 The header guards are no longer available, so use some other
10707 string than `YYLSP_NEEDED'.
10708
107092002-11-16 Akim Demaille <akim@epita.fr>
10710
10711 Make the ``Printers and Destructors'' test more verbose, taking
10712 `yacc.c''s behavior as (possibly wrong) reference.
10713
10714 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
10715 instead of fprint on stdout.
10716 Set and report the last_line of the symbols.
10717 Consistently display values and locations.
10718
107192002-11-16 Paul Eggert <eggert@twinsun.com>
10720
10721 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
10722
107232002-11-15 Paul Eggert <eggert@twinsun.com>
10724
10725 * tests/actions.at (Actions after errors): New test case.
10726
10727 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
10728 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
10729 tests/action.at, tests/calc.at, tests/conflicts.at,
10730 tests/cxx-type.at, tests/regression.at:
10731 "parse error" -> "syntax error" for POSIX compatibility.
10732 "parsing stack overflow..." -> "parser stack overflow" so
10733 that code matches Bison documentation.
10734
107352002-11-15 Akim Demaille <akim@epita.fr>
10736
10737 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
10738 take two BRACED_CODE, not two string_content.
10739 Free the scanner's obstack when we are done.
10740 (code_content): New.
10741 * tests/calc.at: Adjust.
10742 * doc/bison.texinfo: Adjust.
10743 Also, make sure to include the `,' for these declarations.
10744
107452002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
10746
10747 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
10748 definition; avoids potential autoreconf problems.
10749
107502002-11-15 Akim Demaille <akim@epita.fr>
10751
10752 Always check the value returned by yyparse.
10753
10754 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
10755 returned by yyparse.
10756 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
10757 Adjust calls.
10758 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
10759 returned by yyparse.
10760
107612002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10762
10763 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
10764 on input.at test.
10765
107662002-11-14 Paul Eggert <eggert@twinsun.com>
10767
10768 * src/output.c (output_skeleton): Call xfopen instead of
10769 duplicating xfopen's body.
10770
10771 Fix bugs reported by Nelson H. F. Beebe in
10772 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
10773
10774 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
10775 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
10776 Group compiler. Instead, use "$CC -E bar.c". Include the .h
10777 file twice in the grammar, as an extra check.
10778
10779 * tests/input.at (Torturing the Scanner): Surround the
10780 backslash-newline tests with "#if 0", to make it less likely that
10781 we'll run into compiler bugs. Bring back solitary \ inside
10782 comment, but add a closing comment to work around HP C bug. Don't
10783 test backslash-newline in C character constant.
10784
107852002-11-14 Akim Demaille <akim@epita.fr>
10786
10787 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
10788 status of the compiler.
10789 Calling `exit 1' is no longer needed.
10790 Reported by Nelson H. F. Beebe.
10791
107922002-11-14 Akim Demaille <akim@epita.fr>
10793
10794 * tests/atlocal.in (CPPFLAGS): We have config.h.
10795 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
10796 New.
10797 * tests/actions.at, tests/calc.at, tests/conflicts.at,
10798 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
10799 * tests/regression.at, tests/torture.at: Use them for all the
10800 grammars that are to be compiled.
10801 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
10802 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
10803 * doc/bison.texinfo (GLR Parsers): Document `inline'.
10804
108052002-11-14 Akim Demaille <akim@epita.fr>
10806
10807 * doc/bison.texinfo: Various formatting changes (alignments in
10808 samples, additional @group/@end group, GCS in samples.
10809 Use @deffn instead of simple @table to define the directives,
10810 macros, variables etc.
10811
108122002-11-13 Paul Eggert <eggert@twinsun.com>
10813
10814 Fix some bugs reported by Albert Chin-A-Young in
10815 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
10816
10817 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
10818 -o c"; the HP C compiler chatters during compilation.
10819 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
10820 * tests/headers.at (export YYLTYPE): Likewise.
10821
10822 * tests/input.at (Torturing the Scanner): Remove lines containing
10823 solitary backslashes, as they tickle a bug in the HP C compiler.
10824
10825 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
10826 comments, since they're not portable. Use GNU coding style.
10827
108282002-11-13 Akim Demaille <akim@epita.fr>
10829
10830 * data/yacc.c: Leave bigger chunks of quoted text.
10831 (YYDSYMPRINTF): New.
10832 Use it to report symbol activities.
10833 * data/glr.c (YYDSYMPRINTF): New.
10834 Use it.
10835
108362002-11-12 Paul Eggert <eggert@twinsun.com>
10837
10838 Version 1.75b.
10839
10840 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
10841 (yyglrReduce): Return yyok, not 0.
10842 This should avoid the enumerated-type warnings reported
10843 by Nelson H. F. Beebe in
10844 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
10845
10846 * lib/bbitset.h (BITSET_INLINE): Remove.
10847 * lib/bitset.h [! BITSET_INLINE]: Remove.
10848 (bitset_set, bitset_reset, bitset_test): Rename local vars
10849 to avoid shadowing warnings by GCC.
10850
10851 * data/glr.c (inline): Remove #define. It's the user's
10852 responsibility to #define it away, just like 'const'.
10853 This fixes one of the bugs reported by Nelson H. F. Beebe in
10854 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
10855
10856 * Makefile.maint (po-check): Scan .l and .y files instead of the
10857 .c and the .h files that they generate. This fixes the bug
10858 reported by Tim Van Holder in:
10859 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
10860 Look for N_ as well as for _. Try to avoid matching #define for
10861 N_ and _.
10862 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
10863 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
10864 * src/scan-gram.l: Revamp regular expressions so that " and '
10865 do not confuse xgettext.
10866
10867 * src/struniq.h (struniq_new): Do not declare the return type
10868 to be 'const'; this violates the C standard.
10869 * src/struniq.c (struniq_new): Likewise.
10870
108712002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
10872
10873 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
10874 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
10875 linker.
10876
108772002-11-12 Akim Demaille <akim@epita.fr>
10878
10879 * Makefile.maint: Sync with Autoconf:
10880 (local_updates): New.
10881
108822002-11-12 Akim Demaille <akim@epita.fr>
10883
10884 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
10885
108862002-11-12 Akim Demaille <akim@epita.fr>
10887
10888 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
10889 locations.
10890
108912002-11-12 Akim Demaille <akim@epita.fr>
10892
10893 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
10894 not yyvalue.
10895
108962002-11-12 Akim Demaille <akim@epita.fr>
10897
10898 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
10899 Use it to test the GLR parser.
10900
109012002-11-12 Akim Demaille <akim@epita.fr>
10902
10903 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
10904 defines it.
10905 * data/glr.c (yystos): New.
10906 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
10907 (YYDSYMPRINT): New.
10908 (yyval): Don't define it, it is handled via M4.
10909 (yyrecoverParseError): Free verbosely the discarded symbols.
10910 * data/yacc.c (yysymprint): Remove, rather...
10911 (b4_yysymprint_generate): invoke.
10912 * data/c.m4 (b4_yysymprint_generate): New.
10913 Accept pointers as arguments, as opposed to the version from
10914 yacc.c.
10915 (b4_yydestruct_generate): Likewise.
10916 * tests/cations.at (Printers and Destructors): Use Bison directives
10917 instead of CPP macros.
10918 Don't rely on internal details.
10919
109202002-11-12 Akim Demaille <akim@epita.fr>
10921
10922 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
10923 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
10924 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
10925 it against YYEMPTY and so forth), work on yytoken (i.e., set
10926 it to YYEMPTY etc.).
10927 (yydestruct): Replace with a b4_yydestruct_generate invocation.
10928 (b4_symbol_actions): Remove.
10929 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
10930 for 0, end-of-input.
10931
109322002-11-12 Akim Demaille <akim@epita.fr>
10933
10934 * doc/bison.texinfo (Destructor Decl): New.
10935
109362002-11-12 Akim Demaille <akim@epita.fr>
10937
10938 * src/tables.c (tables_generate): Use free for pointers that
10939 cannot be NULL, not XFREE.
10940 (pack_vector): Use assert, not fatal, for bound violations.
10941 * src/state.c (state_new): Likewise.
10942 * src/reader.c (reader): Likewise.
10943 * src/lalr.c (set_goto_map): Likewise.
10944 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
10945 the file name.
10946
109472002-11-12 Akim Demaille <akim@epita.fr>
10948
10949 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
10950 Restore.
10951 * src/scan-gram.l (last_string): Is global to the file, not to
10952 yylex.
10953 * src/parse-gram.y (input): Don't append the epilogue here,
10954 (epilogue.opt): do it here, and free the scanner's obstack.
10955 * src/reader.c (epilogue_set): Rename as...
10956 (epilogue_augment): this.
10957 * data/c.m4 (b4_epilogue): Defaults to empty.
10958
109592002-11-12 Akim Demaille <akim@epita.fr>
10960
10961 * src/getargs.c (long_options): Remove duplicates.
10962 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
10963 Remove.
10964 * doc/bison.rnh: Remove.
10965 * doc/bison.texinfo (VMS Invocation): Remove.
10966
109672002-11-12 Akim Demaille <akim@epita.fr>
10968
10969 * src/struniq.h, src/struniq.c (struniq_t): Is const.
10970 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
10971
10972 Use struniq for symbols.
10973
10974 * src/symtab.h (symbol_t): The tag member is a struniq.
10975 (symbol_type_set): Adjust.
10976 * src/symtab.c (symbol_new): Takes a struniq.
10977 (symbol_free): Don't free the tag member.
10978 (hash_compare_symbol_t, hash_symbol_t): Rename as...
10979 (hash_compare_symbol, hash_symbol): these.
10980 Use the fact that tags as struniqs.
10981 (symbol_get): Use struniq_new.
10982 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
10983 Returns a strniq.
10984 * src/reader.h (merger_list, grammar_currentmerge_set): The name
10985 and type members are struniqs.
10986 * src/reader.c (get_merge_function)
10987 (grammar_current_rule_merge_set): Adjust.
10988 (TYPE, current_type): Are struniq.
10989
10990 Use struniq for file names.
10991
10992 * src/files.h, src/files.c (infile): Split into...
10993 (grammar_file, current_file): these.
10994 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
10995 * src/reduce.c (reduce_print): Likewise.
10996 * src/getargs.c (getargs): Likewise.
10997 * src/complain.h, src/complain.c: Likewise.
10998 * src/main.c (main): Call struniqs_new early enough to use it for
10999 file names.
11000 Don't free the input file name.
11001
110022002-11-12 Akim Demaille <akim@epita.fr>
11003
11004 * src/symtab.c (symbol_free): Remove dead deactivated code:
11005 type_name are properly removed.
11006 Don't use XFREE to free items that cannot be NULL.
11007 * src/struniq.h, src/struniq.c: New.
11008 * src/main.c (main): Initialize/free struniqs.
11009 * src/parse-gram.y (%union): Add astruniq member.
11010 (yyprint): Adjust.
11011 * src/scan-gram.l (<{tag}>): Return a struniq.
11012 Free the obstack bit that used to store it.
11013 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
11014
110152002-11-11 Paul Eggert <eggert@twinsun.com>
11016
11017 Revamp to fix many (but not all) of the C- and M4-related quoting
11018 problems. Among other things, this fixes the Bison bug reported
11019 by Jan Hubicka when processing the Bash grammar; see:
11020 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
11021
11022 Use new @ escapes consistently. Represent brackets with @{ and @}
11023 rather than @<:@ and @:>@, since this works a bit better with dumb
11024 editors like vi. Represent @ with @@, since @ is now consistently
11025 an escape. Use @oline@ and @ofile@ rather than __oline__ and
11026 __ofile__, to avoid unexpected expansions. Similarly, use @output
11027 rather than #output.
11028
11029 * data/c.m4 (b4_copyright): Omit file name from comment, since
11030 the file name could contain "*/".
11031 (b4_synclines_flag): Don't quote the 2nd argument; it should already
11032 be quoted. All uses changed.
11033
11034 * data/glr.c: Use new @ escapes consistently.
11035 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
11036 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
11037 Remove, since they couldn't handle arbitrary characters in file
11038 names.
11039 * data/lalr1.cc: Likewise.
11040 * data/yacc.c: Likewise.
11041
11042 * src/files.c (output_infix): Remove; all uses removed.
11043 * src/files.h: Likewise.
11044
11045 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
11046 mishandled funny characters in file names, and anyway it isn't
11047 needed any more.
11048 * data/yacc.c: Likewise.
11049 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
11050
11051 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
11052 * data/yacc.c: Likewise.
11053
11054 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
11055 strings now.
11056 (muscle_init): Quote filename as a C string.
11057 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
11058 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
11059 * src/output.c (escaped_file_name_output): New function.
11060 (prepare_symbols): Quote tokens for M4.
11061 (prepare): Don't insert output_infix, output_prefix,
11062 output_parser_name, output_header_name; this is now down by scan-skel.
11063 Insert skeleton as a C string.
11064
11065 * src/output.c (user_actions_output, symbol_destructors_output,
11066 symbol_printers_output): Quote filenames for C and M4.
11067 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11068
11069 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
11070 escapes other than \\ and \'; this simplifies the code.
11071 (<SC_STRING>): Likewise, for \\ and \".
11072 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
11073 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
11074 Use new escapes @{ and @} for [ and ].
11075
11076 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
11077 them with auto vars.
11078 Switch to new escape scheme, where @ is the escape character uniformly.
11079 Abort if a stray escape character is found. Avoid unbounded input
11080 buffer when parsing non-escaped text.
11081
11082 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
11083 __oline__, #output, $@, and @{ do not have unintended meanings.
11084
110852002-11-09 Paul Eggert <eggert@twinsun.com>
11086
11087 Fix the test failure due to GCC warnings described in
11088 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
11089 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
11090 evaluate to 0 if it's impossible for NINF to be in the respective
11091 table.
11092 (yygetLRActions, yyrecoverParseError): Use them.
11093
11094 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
11095 counted in the token inserted at end of file. Now takes
11096 location_t *, not location_t, so that the location can be
11097 adjusted. All uses changed.
11098
11099 * tests/regression.at (Invalid inputs): Adjust wording in
11100 diagnostic to match the new behavior.
11101
11102 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
11103 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
11104 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
11105 abort ();'. This reduces the runtime of the "Many lookaheads"
11106 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
11107 GCC 3.2.
11108
111092002-11-07 Paul Eggert <eggert@twinsun.com>
11110
11111 * src/parse-gram.y (CHARACTER): Remove unused token.
11112 All uses removed.
11113
11114 * src/scan-gram.l: Remove stack option. We no longer use the
11115 stack, since the stack was never deeper than 1; instead, use the
11116 new auto var c_context to record the stacked value.
11117
11118 Remove nounput option. At an unexpected end of file, we now unput
11119 the minimal input necessary to end cleanly; this simplifies the
11120 code.
11121
11122 Avoid unbounded token sizes where this is easy.
11123
11124 (unexpected_end_of_file): New function.
11125 Use it to systematize the error message on unexpected EOF.
11126 (last-string): Now auto, not static.
11127 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
11128 (scanner_last_string_free): Remove; not used.
11129 (percent_percent_count): Move decl to just before use.
11130 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
11131 not the (never otherwised-used) CHARACTER.
11132
111332002-11-07 Akim Demaille <akim@epita.fr>
11134
11135 Let yyerror always receive the msg as last argument, so that
11136 yyerror can be variadic.
11137
11138 * data/yacc.c (b4_yyerror_args): New.
11139 Use it when calling yyerror.
11140 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
11141 Use it when calling yyerror.
11142 * doc/bison.texinfo (Error Reporting): Adjust.
11143 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
11144 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
11145
111462002-11-06 Akim Demaille <akim@epita.fr>
11147
11148 #line should have quoted strings.
11149 Ideally, this should be done by m4_quotearg.
11150
11151 * src/scan-skel.l: Include quotearg.h.
11152 Quote __ofile__.
11153 * src/output.c (symbol_printers_output)
11154 (symbol_destructors_output): Quote the file name.
11155
111562002-11-06 Akim Demaille <akim@epita.fr>
11157
11158 * tests/regression.at (Invalid inputs): Adjust to the recent
11159 messages.
11160
111612002-11-06 Akim Demaille <akim@epita.fr>
11162
11163 Restore --no-lines.
11164 Reported by Jim Kent.
11165
11166 * data/c.m4 (b4_syncline): New.
11167 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
11168 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
11169 * src/output.c (user_actions_output): Likewise.
11170 (prepare): Define 'b4_synclines_flag'.
11171 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
11172
111732002-11-06 Akim Demaille <akim@epita.fr>
11174
11175 * src/main.c (main): Free `infile'.
11176 * src/scan-gram.l (handle_syncline): New.
11177 Recognize `#line'.
11178 * src/output.c (user_actions_output, symbol_destructors_output)
11179 (symbol_printers_output): Use the location's file name, not
11180 infile.
11181 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11182
111832002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11184
11185 * src/tables.c (matching_state): Don't allow states to match if
11186 either has GLR conflict entries.
11187
111882002-11-05 Paul Eggert <eggert@twinsun.com>
11189
11190 * src/scan-gram.l: Use more accurate diagnostics, e.g.
11191 "integer out of range" rather than "invalid value".
11192 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
11193 accordingly.
11194
11195 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
11196 Also, remove one static variable in the scanner.
11197
11198 * src/scan-gram.l (braces_level): Now auto, not static.
11199 Initialize to zero if the compiler is being picky.
11200 (INITIAL): Clear braces_level instead of incrementing it.
11201 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
11202 as POSIX 1003.1-2001 requires.
11203 * src/system.h (IF_LINT): New macro, taken from coreutils.
11204 * configure.ac: Define "lint" if --enable-gcc-warnings.
11205
112062002-11-05 Akim Demaille <akim@epita.fr>
11207
11208 * src/scan-gram.l: When it starts with `%', complain about the
11209 whole directive, not just that `invalid character: %'.
11210
112112002-11-04 Akim Demaille <akim@epita.fr>
11212
11213 * Makefile.maint: Update from Autoconf.
11214 (update, cvs-update, po-update, do-po-update): New.
11215
112162002-11-04 Akim Demaille <akim@epita.fr>
11217
11218 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
11219 and yyerror.
11220 Have yyerror `use' its arguments.
11221 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
11222 returns true when location & yacc & pure & parse-param.
11223 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
11224
112252002-11-04 Akim Demaille <akim@epita.fr>
11226
11227 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
11228 clashes.
11229 * src/scan-gram.l: Use [\'] instead of ['] to pacify
11230 font-lock-mode.
11231 Use complain_at.
11232 Use quote, not quote_n since LOCATION_PRINT no longer uses the
11233 slot 0.
11234
112352002-11-03 Paul Eggert <eggert@twinsun.com>
11236
11237 * src/reader.c (get_merge_function, grammar_current_rule_check):
11238 Use consistent diagnostics for reporting type name clashes.
11239 Quote the types with <>, for consistency with Yacc.
11240 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
11241
112422002-11-03 Akim Demaille <akim@epita.fr>
11243
11244 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
11245 New.
11246 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
11247 (b4_parse_param): Remove.
11248 Use b4_identification.
11249 Propagate b4_pure_args where needed to pass them to yyerror.
11250 * data/glr.m4 (b4_parse_param): Remove.
11251 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
11252 (b4_lpure_formals): New.
11253 Use b4_identification.
11254 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
11255 b4_user_formals and b4_user_args.
11256 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
11257 (yyreportAmbiguity): When using a pure parser, also need
11258 the location, and the parse-params.
11259 Adjust callers.
11260 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
11261 When using a pure parser, also need the parse-params.
11262 Adjust callers.
11263 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
11264 (%pure-parser + %parse-param) LALR and GLR parsers.
11265 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
11266 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
11267 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
11268 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
11269 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
11270 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
11271 * doc/bison.texinfo: Untabify the whole file.
11272 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
11273 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
11274 (Error Reporting): Adjust to these new directives.
11275 Document %error-verbose, deprecate YYERROR_VERBOSE.
11276
112772002-11-03 Akim Demaille <akim@epita.fr>
11278
11279 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
11280 AT_CHECK_CALC_GLR invocations to use % directives, instead of
11281 command line options.
11282 * tests/cxx-type.at: Formatting changes.
11283
112842002-11-03 Paul Eggert <eggert@twinsun.com>
11285
11286 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
11287 to count columns correctly, and to check for invalid inputs.
11288
11289 Use mbsnwidth to count columns correctly. Account for tabs, too.
11290 Include mbswidth.h.
11291 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
11292 (extend_location): New function.
11293 (YY_LINES): Remove.
11294
11295 Handle CRLF in C code rather than in Lex code.
11296 (YY_INPUT): New macro.
11297 (no_cr_read): New function.
11298
11299 Scan UCNs, even though we don't fully handle them yet.
11300 (convert_ucn_to_byte): New function.
11301
11302 Handle backslash-newline correctly in C code.
11303 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
11304 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
11305 all uses changed.
11306 (tag, splice): New EREs. Do not allow NUL or newline in tags.
11307 Use {splice} wherever C allows backslash-newline.
11308 YY_STEP after space, newline, vertical-tab.
11309 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
11310
11311 (letter, id): Don't assume ASCII; e.g., spell out a-z.
11312
11313 ({int}, handle_action_dollar, handle_action_at): Check for integer
11314 overflow.
11315
11316 (YY_STEP): Omit trailing semicolon, so that it's more like C.
11317
11318 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
11319 as well as \000. Check for UCHAR_MAX, not 255.
11320 Allow \x with an arbitrary positive number of digits, as in C.
11321 Check for overflow here.
11322 Allow \? and UCNs, for compatibility with C.
11323
11324 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
11325 with quote slot used by complain_at.
11326
11327 * tests/input.at: Add tests for backslash-newline, m4 quotes
11328 in symbols, long literals, and funny escapes in strings.
11329
11330 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
11331 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
11332 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
11333 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
11334 * m4/mbswidth.m4: New file, from GNU coreutils.
11335
11336 * doc/bison.texinfo (Grammar Outline): Document // comments.
11337 (Symbols): Document that trigraphs have no special meaning in Bison,
11338 nor is backslash-newline allowed.
11339 (Actions): Document that trigraphs have no special meaning.
11340
11341 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
11342 no longer used.
11343
113442002-11-02 Paul Eggert <eggert@twinsun.com>
11345
11346 * src/reader.c: Don't include quote.h; not needed.
11347 (get_merge_function): Reword warning to be consistent with
11348 type clash diagnostic in grammar_current_rule_check.
11349
11350 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
11351 bug in trigraph handling.
11352
11353 * src/output.c (prepare_symbols): When printing token names,
11354 escape "[" as "@<:@" and likewise for "]".
11355
11356 * src/system.h (errno): Remove declaration, as we are now
11357 assuming C89 or better, and C89 guarantees errno.
11358
113592002-10-30 Paul Eggert <eggert@twinsun.com>
11360
11361 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
11362 Check for close failures.
11363 * src/files.h (xfclose): Return void, not int, since it always
11364 returned zero.
11365 * src/files.c (xfclose): Likewise. Report I/O error if ferror
11366 indicates one.
11367 * src/output.c (output_skeleton): Use xfclose rather than fclose
11368 and ferror. xfclose now checks ferror.
11369
11370 * data/glr.c (YYLEFTMOST_STATE): Remove.
11371 (yyreportTree): Use a stack-based leftmost state. This avoids
11372 our continuing battles with bogus warnings about initializers.
11373
113742002-10-30 Akim Demaille <akim@epita.fr>
11375
11376 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
11377 #if.
11378
113792002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11380
11381 * tests/glr-regr1.at: New test for reported regressions.
11382 * tests/testsuite.at: Add glr-regr1.at test.
11383 * tests/Makefile.am: Add glr-regr1.at test.
11384
113852002-10-24 Paul Eggert <eggert@twinsun.com>
11386
11387 Version 1.75a.
11388
11389 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
11390 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
11391 we use malloc. Don't assume 'A' through 'Z' are contiguous.
11392 Don't assume strdup exists; POSIX says its an XSI extension.
11393 Check for buffer overflow on input.
11394
113952002-10-24 Akim Demaille <akim@epita.fr>
11396
11397 * src/output.c (output_skeleton): Don't disable M4sugar comments
11398 too soon: it results in comments being expanded.
11399 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
11400 first output.
11401
114022002-10-24 Akim Demaille <akim@epita.fr>
11403
11404 * data/yacc.c (m4_int_type): New.
11405 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
11406 char' as only yacc.c wants K&R portability.
11407 * data/glr.c (yysigned_char): Remove.
11408 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
11409 Reported by Quoc Peyrot.
11410
114112002-10-23 Paul Eggert <eggert@twinsun.com>
11412
11413 * src/main.c (main): With --trace=time, report times even if a
11414 non-fatal error occurs. Formerly, the times were reported in some
11415 such cases but not in others.
11416 * src/reader.c (reader): Just return if a complaint has been issued,
11417 instead of exiting, so that 'main' can report times.
11418
114192002-10-22 Akim Demaille <akim@epita.fr>
11420
11421 * src/system.h: Include sys/types.
11422 Reported by Bert Deknuydt.
11423
114242002-10-23 Paul Eggert <eggert@twinsun.com>
11425
11426 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
11427 Suggested by Art Haas.
11428
114292002-10-22 Paul Eggert <eggert@twinsun.com>
11430
11431 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
11432 decl; not needed any more.
11433 * src/main.c (main): Use return to exit, undoing yesterday's change.
11434 The last OS that we could find where this wouldn't work is
11435 SunOS 3.5, and that's too old to worry about now.
11436
11437 * data/glr.c (struct yyltype): Define members even when not
11438 doing locations. This is more consistent with yacc.c, and it
11439 works around the following bug reports:
11440 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
11441 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
11442
11443 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
11444 @acronym consistently. Standardize on "Yacc" instead of "YACC",
11445 "Algol" instead of "ALGOL". Give a bit more history about BNF.
11446
114472002-10-22 Akim Demaille <akim@epita.fr>
11448
11449 * data/README: New.
11450
114512002-10-21 Paul Eggert <eggert@twinsun.com>
11452
11453 Be consistent about 'bool'; the old code used an enum in one
11454 module and an int in another, and this violates the C standard.
11455 * m4/stdbool.m4: New file, from coreutils 4.5.3.
11456 * configure.ac (AC_HEADER_STDBOOL): Add.
11457 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
11458 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
11459 * src/symtab.c (hash_compare_symbol_t): Likewise.
11460 * src/system.h (bool, false, true): Use a definition consistent
11461 with ../lib/hash.c. All uses changed.
11462
11463 * src/complain.c (warning_issued): Renamed from warn_message_count,
11464 so that we needn't worry about integer overflow (!).
11465 Now of type bool. All uses changed.
11466 (complaint_issued): Renamed from complain_message_count; likewise.
11467
11468 * src/main.c (main): Use exit to exit with failure.
11469
11470 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
11471 rather than 1 and 0.
11472 * src/main.c (main): Likewise.
11473 * src/getargs.c (getargs): Likewise.
11474 * src/reader.c (reader): Likewise.
11475
11476 * src/getarg.c (getargs): Remove duplicate code for
11477 "Try `bison --help'".
11478
11479 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
11480 What was that "2" for?
11481
11482 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
11483 * src/getargs.c (usage): Likewise.
11484
11485 * src/getargs.c (getargs): When there are too few operands, report
11486 the last one. When there are too many, report the first extra
11487 one. This is how diffutils does it.
11488
114892002-10-20 Paul Eggert <eggert@twinsun.com>
11490
11491 Remove K&R vestiges.
11492 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
11493 * src/complain.c (VA_START): Remove. Assume prototypes.
11494 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
11495 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
11496 fatal): Assume prototypes.
11497 * src/complain.h: Assume prototypes.
11498 * src/system.h (PARAMS): Remove.
11499 Include <limits.h> unconditionally, since it's guaranteeed even
11500 for a freestanding C89 compiler.
11501 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
11502 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
11503
115042002-10-20 Akim Demaille <akim@epita.fr>
11505
11506 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
11507 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
11508 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
11509 (yyresolveStates, yyresolveAction, yyresolveStack)
11510 (yyprocessOneStack): Use them.
11511 (yy_reduce_print): New.
11512 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
11513
115142002-10-20 Akim Demaille <akim@epita.fr>
11515
11516 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
11517 arguments and output `void'.
11518 (b4_c_function): Rename as...
11519 (b4_c_function_def): this.
11520 (b4_c_function_decl, b4_c_ansi_function_def)
11521 (b4_c_ansi_function_decl): New.
11522 Change the interpretation of the arguments: before `int, foo', now
11523 `int foo, foo'.
11524 * data/yacc.c (yyparse): Prototype and define thanks to these.
11525 Adjust b4_c_function_def uses.
11526 * data/glr.c (yyparse): Likewise, but ANSI only.
11527
115282002-10-20 Akim Demaille <akim@epita.fr>
11529
11530 * src/output.c (prepare): Move the definition of `tokens_number',
11531 `nterms_number', `undef_token_number', `user_token_number_max'
11532 to...
11533 (prepare_tokens): Here.
11534 (prepare_tokens): Rename as...
11535 (prepare_symbols): this.
11536 (prepare): Move the definition of `rules_number' to...
11537 (prepare_rules): here.
11538 (prepare): Move the definition of `last', `final_state_number',
11539 `states_number' to...
11540 (prepare_states): here.
11541 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
11542
115432002-10-20 Akim Demaille <akim@epita.fr>
11544
11545 * src/tables.h, src/tables.c, src/output.c: Comment changes.
11546
115472002-10-20 Akim Demaille <akim@epita.fr>
11548
11549 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
11550 * data/c.m4: here.
11551
115522002-10-20 Akim Demaille <akim@epita.fr>
11553
11554 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
11555 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
11556 `pair'.
11557 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
11558 `name' to...
11559 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
11560 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
11561 These.
11562
115632002-10-19 Paul Eggert <eggert@twinsun.com>
11564
11565 Do not create a temporary file, as that involves security and
11566 cleanup headaches. Instead, use a pair of pipes.
11567 Derived from a suggestion by Florian Krohm.
11568 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
11569 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
11570 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
11571 (BISON_PREREQ_SUBPIPE): Add.
11572 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
11573 Add subpipe.h, subpipe.c.
11574 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
11575 * po/POTFILES.in: Add lib/subpipe.c.
11576 * src/output.c: Include "subpipe.h".
11577 (m4_invoke): Remove decl.
11578 (scan_skel): New decl.
11579 (output_skeleton): Use pipe rather than temporary file for m4 input.
11580 Check that m4sugar.m4 is readable, to avoid deadlock.
11581 Check for pipe I/O error.
11582 * src/scan-skel.l (readpipe): Remove decl.
11583 (scan_skel): New function, to be used in place of m4_invoke.
11584 Read from stream rather than file.
11585
11586 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
11587 float, as this generates a warning on Solaris 8 + GCC 3.2 with
11588 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
11589 this generates a more-accurate value anyway.
11590
11591 * lib/timevar.c (timervar_accumulate): Rename locals to
11592 avoid confusion with similarly-named more-global.
11593 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
11594
11595 * src/output.c (prepare): Use xstrdup to convert char const *
11596 to char *, to avoid GCC warning.
11597
115982002-10-19 Akim Demaille <akim@epita.fr>
11599
11600 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
11601 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
11602 Use them to have `calc.y' ready for %pure-parser.
11603 * data/yacc.c (YYLEX): Pass a yylex return type to
11604 b4_c_function_call.
11605
116062002-10-19 Akim Demaille <akim@epita.fr>
11607
11608 Prototype support of %lex-param and %parse-param.
11609
11610 * src/parse-gram.y: Add the definition of the %lex-param and
11611 %parse-param tokens, plus their rules.
11612 Drop the `_' version of %glr-parser.
11613 Add the "," token.
11614 * src/scan-gram.l (INITIAL): Scan them.
11615 * src/muscle_tab.c: Comment changes.
11616 (muscle_insert, muscle_find): Rename `pair' as `probe'.
11617 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
11618 (muscle_entry_s): The `value' member is no longer const.
11619 Adjust all dependencies.
11620 * src/muscle_tab.c (muscle_init): Adjust: use
11621 MUSCLE_INSERT_STRING.
11622 Initialize the obstack earlier.
11623 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
11624 (muscle_pair_list_grow): New.
11625 * data/c.m4 (b4_c_function_call, b4_c_args): New.
11626 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
11627 * tests/calc.at: Use %locations, not --locations.
11628 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
11629
116302002-10-19 Akim Demaille <akim@epita.fr>
11631
11632 * src/getargs.c (usage): Take status as argument and exit
11633 accordingly.
11634 Report the traditional `Try ... --help' message when status != 0.
11635 (usage, version): Don't take a FILE * as arg, it is pointless.
11636 (getargs): When there is an incorrect number of arguments, make it
11637 an error, and report it GNUlically thanks to `usage ()'.
11638
116392002-10-18 Paul Eggert <eggert@twinsun.com>
11640
11641 * data/glr.c (yyreportParseError): Don't assume that sprintf
11642 yields the length of the printed string, as this is not true
11643 on SunOS 4.1.4. Reported by Peter Klein.
11644
11645 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
11646 * tests/conflicts.at (%nonassoc and eof): Likewise.
11647 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
11648
116492002-10-17 Akim Demaille <akim@epita.fr>
11650
11651 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
11652 * src/getargs.c (trace_types, trace_args): Adjust.
11653 * src/reader.c (grammar_current_rule_prec_set)
11654 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
11655 Standardize error messages.
11656 And s/@prec/%prec/!
11657 (reader): Use trace_flag to enable scanner/parser debugging,
11658 instead of an adhoc scheme.
11659 * src/scan-gram.l: Remove trailing debugging code.
11660
116612002-10-16 Paul Eggert <eggert@twinsun.com>
11662
11663 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
11664 MUSCLE_TAB_H.
11665
11666 * NEWS: Officially drop support for building Bison with K&R C,
11667 since it didn't work anyway and it's not worth worrying about.
11668 * Makefile.maint (wget_files): Remove ansi2knr.c.
11669 (ansi2knr.c-url_prefix): Remove.
11670 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
11671 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11672 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11673
116742002-10-15 Paul Eggert <eggert@twinsun.com>
11675
11676 Stop using the "enum_" trick for K&R-style function definitions;
11677 it confused me, and I was the author! Instead, assume that people
11678 who want to use K&R C compilers (when using these modules in GCC,
11679 perhaps?) will run ansi2knr.
11680
11681 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
11682 All uses of "enum_" changed to "enum ".
11683 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11684 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11685
11686 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
11687 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
11688 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
11689 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
11690 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
11691 abitset_not, abitset_ones, abitset_or, abitset_or_and,
11692 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
11693 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
11694 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
11695 Use function prototypes; this removes the need for declaring
11696 static functions simply to provide their prototypes.
11697 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
11698 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
11699 bitset_count_, bitset_create, bitset_dump, bitset_first,
11700 bitset_free, bitset_init, bitset_last, bitset_next,
11701 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
11702 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
11703 bitset_print, bitset_release_memory, bitset_toggle_,
11704 bitset_type_choose, bitset_type_get, bitset_type_name_get,
11705 debug_bitset): Likewise.
11706 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
11707 * lib/bitset_stats.c (bitset_log_histogram_print,
11708 bitset_percent_histogram_print, bitset_stats_and,
11709 bitset_stats_and_cmp, bitset_stats_and_or,
11710 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
11711 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
11712 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
11713 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
11714 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
11715 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
11716 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
11717 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
11718 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
11719 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
11720 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
11721 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
11722 bitset_stats_zero): Likewise.
11723 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11724 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11725 bitsetv_dump, debug_bitsetv): Likewise.
11726 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
11727 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
11728 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
11729 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
11730 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
11731 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
11732 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
11733 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
11734 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
11735 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
11736 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
11737 Likewise.
11738 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
11739 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
11740 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
11741 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
11742 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
11743 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
11744 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
11745 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
11746 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
11747 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
11748 lbitset_xor_cmp, lbitset_zero): Likewise.
11749
117502002-10-14 Akim Demaille <akim@epita.fr>
11751
11752 Version 1.75.
11753
117542002-10-14 Akim Demaille <akim@epita.fr>
11755
11756 * tests/Makefile.am (maintainer-check-posix): New.
11757
117582002-10-14 Akim Demaille <akim@epita.fr>
11759
11760 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
11761 member.
11762
117632002-10-14 Akim Demaille <akim@epita.fr>
11764
11765 * src/tables.c (table_ninf_remap): base -> tab.
11766 Reported by Matt Rosing.
11767
117682002-10-14 Paul Eggert <eggert@twinsun.com>
11769
11770 * tests/action.at, tests/calc.at, tests/conflicts.at,
11771 tests/cxx-type.at, tests/headers.at, tests/input.at,
11772 tests/regression.at, tests/synclines.at, tests/torture.at:
11773 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
11774 so that the tests still work even if POSIXLY_CORRECT is set.
11775 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
11776
11777 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
11778 for portability to K&R hosts. Fix typo: signed char is guaranteed
11779 only to 127, not to 128.
11780 * data/glr.c (yysigned_char): New type.
11781 * data/yacc.c (yysigned_char): Likewise.
11782 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
11783
117842002-10-13 Paul Eggert <eggert@twinsun.com>
11785
11786 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
11787 true due to limited range of data type" warning from GCC.
11788
11789 * data/c.m4 (b4_token_defines): Protect against double-inclusion
11790 by wrapping enum yytokentype's definition inside #ifndef
11791 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
11792
117932002-10-13 Akim Demaille <akim@epita.fr>
11794
11795 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
11796 Un yy- yyrhs to avoid the name clash with the global YYRHS.
11797
117982002-10-13 Akim Demaille <akim@epita.fr>
11799
11800 * Makefile.maint: Update from Autoconf 2.54.
11801 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
11802
118032002-10-13 Akim Demaille <akim@epita.fr>
11804
11805 * src/print.c (print_state): Separate the list of solved conflicts
11806 from the other items.
11807 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
11808
118092002-10-13 Akim Demaille <akim@epita.fr>
11810
11811 Let nondeterministic skeletons be usable with deterministic
11812 tables.
11813
11814 With the patch, GAWK compiled by GCC without -O2 passes its test
11815 suite using a GLR parser driven by LALR tables. It fails with -O2
11816 because `struct stat' gives two different answers on my machine:
11817 88 (definition of an auto var) and later 96 (memset on this var).
11818 Hence the stack is badly corrumpted. The headers inclusion is to
11819 blame: if I move the awk.h inclusion before GLR's system header
11820 inclusion, the two struct stat have the same size.
11821
11822 * src/tables.c (pack_table): Always create conflict_table.
11823 (token_actions): Always create conflict_list.
11824 * data/glr.c (YYFLAG): Remove, unused.
11825
118262002-10-13 Akim Demaille <akim@epita.fr>
11827
11828 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
11829 (O0FLAGS): New.
11830 (VALGRIND, GXX): New.
11831 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
11832 * tests/bison.in: Run $PREBISON a pre-command.
11833 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
11834 (maintainer-check-g++): New.
11835 * Makefile.am (maintainer-check): New.
11836
118372002-10-13 Akim Demaille <akim@epita.fr>
11838
11839 * data/glr.c: Formatting changes.
11840 Tweak some trace messages to match yacc.c's.
11841
118422002-10-13 Akim Demaille <akim@epita.fr>
11843
11844 GLR parsers sometimes raise parse errors instead of performing the
11845 default reduction.
11846 Reported by Charles-Henry de Boysson.
11847
11848 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
11849 check the length of the traces when %glr.
11850 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
11851 GLR's traces.
11852 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
11853 Test GLR parsers.
11854 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
11855 (yyltype): Remove the yy prefix from the member names.
11856 (yytable): Complete its comment.
11857 (yygetLRActions): Map error action number from YYTABLE from
11858 YYTABLE_NINF to 0.
11859 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
11860 (which was a bug: it should have been YYTABEL_NINF, and yet it was
11861 not satisfying as we could compare an YYACTION computed from
11862 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
11863 only value for error actions.
11864 (yyreportParseError): In verbose parse error messages, don't issue
11865 `error' in the list of expected tokens.
11866 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
11867 next action to perform to match glr.c's decoding.
11868 (yytable): Complete its comment.
11869
118702002-10-13 Paul Eggert <eggert@twinsun.com>
11871
11872 Fix problem reported by Henrik Grubbstroem in
11873 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
11874 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
11875 because the Bison parser reads the second action before reducing
11876 the first one.
11877 * src/scan-gram.l (rule_length): New static var.
11878 Use it to keep track of the rule length in the scanner, since
11879 we can't expect the parser to be in lock-step sync with the scanner.
11880 (handle_action_dollar, handle_action_at): Use this var.
11881 * tests/actions.at (Exotic Dollars): Test for the problem.
11882
118832002-10-12 Paul Eggert <eggert@twinsun.com>
11884
11885 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
11886 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
11887 Include <sys/time.h> when checking for clock_t and struct tms.
11888 Use same include order as source.
11889 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
11890 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
11891
11892 * lib/timevar.c: Update copyright date and clarify comments.
11893 (get_time) [IN_GCC]: Keep the GCC version for reference.
11894
11895 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
11896 GCC version as of today, then merge Bison's changes.
11897 Change "GCC" to "Bison" in copyright notice. timevar.def's
11898 author is Akim, so change that too.
11899
11900 * src/reader.c (grammar_current_rule_check):
11901 Don't worry about the default action if $$ is untyped.
11902 Prevents bogus warnings reported by Jim Gifford in
11903 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
11904
11905 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
11906 * data/glr.c, data/lalr1.cc, data/yacc.c:
11907 Output token definitions before the first part of user declarations.
11908 Fixes compatibility problem reported by Jim Gifford for kbd in
11909 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
11910
119112002-10-11 Paul Eggert <eggert@twinsun.com>
11912
11913 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
11914 (yyparse): here. This undoes some of the 2002-07-25 change.
11915 Compatibility problem reported by Ralf S. Engelschall with
11916 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
11917
119182002-10-11 Akim Demaille <akim@epita.fr>
11919
11920 * tests/regression.at Characters Escapes): New.
11921 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
11922 characters.
11923 Reported by Jan Nieuwenhuizen.
11924
119252002-10-11 Akim Demaille <akim@epita.fr>
11926
11927 * po/id.po: New.
11928
119292002-10-10 Paul Eggert <eggert@twinsun.com>
11930
11931 Portability fixes for bitsets; this also avoids several GCC
11932 warnings.
11933
11934 * lib/abitset.c: Include <stddef.h>, for offsetof.
11935 * lib/lbitset.c: Likewise.
11936
11937 * lib/abitset.c (abitset_bytes): Return a size that is aligned
11938 properly for vectors of objects. Do not assume that adding a
11939 header size to a multiple of a word size yields a value that is
11940 properly aligned for the whole union.
11941 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11942
11943 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
11944 unique names for structures.
11945 * lib/ebitset.c (ebitset_bytes): Likewise.
11946 * lib/lbitset.c (lbitset_bytes): Likewise.
11947
11948 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
11949 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
11950 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
11951 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
11952 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
11953 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
11954 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
11955 to improve the type-checking that GCC can do.
11956 * lib/bitset.c (bitset_op4_cmp): Likewise.
11957 * lib/bitset_stats.c (bitset_stats_count,
11958 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
11959 bitset_stats_copy, bitset_stats_disjoint_p,
11960 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
11961 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
11962 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
11963 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
11964 bitset_stats_and_or_cmp, bitset_stats_andn_or,
11965 bitset_stats_andn_or_cmp, bitset_stats_or_and,
11966 bitset_stats_or_and_cmp): Likewise.
11967 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
11968 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
11969 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
11970 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
11971
11972 * lib/abitset.h: Include bitset.h, not bbitset.h.
11973 * lib/ebitset.h: Likewise.
11974 * lib/lbitset.h: Likewise.
11975
11976 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
11977 All instances of parameters of type enum bitset_opts are now of
11978 type enum_bitset_opts, to conform to the C Standard, and similarly
11979 for enum_bitset_type.
11980 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11981 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11982
11983 Do not use "struct bitset_struct" to mean different things in
11984 different modules. Not only is this confusing, it violates
11985 the C Standard, which requires that structure types in different
11986 modules must be compatible if one is to be passed to the other.
11987 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
11988 All instances of "struct bitset_struct *" replaced with "bitset".
11989 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
11990 (union bitset_union, struct abitset_struct, struct ebitset_struct,
11991 struct lbitset_struct, struct bitset_stats_struct): New types.
11992 All uses of struct bitset_struct changed to union bitset_union,
11993 etc.
11994 * lib/abitset.c (struct abitset_struct, abitset,
11995 struct bitset_struct): Remove.
11996 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
11997 struct bitset_struct): Remove.
11998 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
11999 bitset_struct): Remove.
12000 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
12001 Likewise.
12002
12003 Do not call a function of type T using a call that assumes the
12004 function is of a different type U. Standard C requires that a
12005 function must be called with a type that is compatible with its
12006 definition.
12007 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12008 New decls.
12009 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12010 New functions.
12011 * lib/ebitset.c (PFV): Remove.
12012 * lib/lbitset.c (PFV): Likewise.
12013 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
12014 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
12015 decls.
12016 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
12017 (ebitset_vtable): Use them.
12018 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
12019 lbitset_xor): New functions.
12020 (lbitset_vtable): Use them.
12021
12022 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
12023 Declare.
12024
12025 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
12026 GCC warning.
12027 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
12028 Use offsetof, for simplicity.
12029
120302002-10-06 Paul Eggert <eggert@twinsun.com>
12031
12032 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
12033 the same width as int. This reapplies a hunk of the 2002-08-12 patch
12034 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
12035 which was inadvertently undone by the 2002-09-30 patch.
12036 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
12037 the same width as int.
12038
120392002-10-04 Paul Eggert <eggert@twinsun.com>
12040
12041 Version 1.50.
12042
12043 * configure.ac (AC_INIT), NEWS: Increment version number.
12044
12045 * doc/bison.texinfo: Minor spelling, grammar, and white space
12046 fixes.
12047 (Symbols): Mention that any negative value returned from yylex
12048 signifies end-of-input. Warn about negative chars. Mention
12049 the portable Standard C character set.
12050
12051 The GNU coding standard says CFLAGS and YFLAGS are reserved
12052 for the installer to set.
12053 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
12054 * src/Makefile.am (AM_CFLAGS): Likewise.
12055 (AM_YFLAGS): Renamed from YFLAGS.
12056
12057 Fix some MAX and MIN problems.
12058 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
12059 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
12060 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
12061 * src/reader.c (reader): Use it.
12062
12063 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
12064 POSIX 1003.1-2001 has removed fgrep.
12065
120662002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
12067
12068 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
12069 interpreted as signed.
12070 * lib/ebitset.c (ebitset_list): Fix bug.
12071
120722002-10-01 Paul Eggert <eggert@twinsun.com>
12073
12074 More fixes for 64-bit hosts and large bitsets.
12075
12076 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
12077 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
12078 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
12079 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
12080 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
12081 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
12082 bitset_count_): Likewise.
12083 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
12084 bitset_first, bitset_last): Likewise.
12085 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
12086 bitset_stats_list_reverse, bitset_stats_size,
12087 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
12088 Likewise.
12089 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12090 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
12091 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
12092 bitsetv_reflexive_transitive_closure): Likewise.
12093 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
12094 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
12095 Likewise.
12096 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
12097 Likewise.
12098
12099 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
12100 Use size_t, not unsigned int, to count bytes.
12101 * lib/abitset.h (abitset_bytes): Likewise.
12102 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
12103 Likewise.
12104 * lib/bitset.h (bitset_bytes): Likewise.
12105 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
12106 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
12107 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12108 * lib/ebitset.c (ebitset_bytes): Likewise.
12109 * lib/ebitset.h (ebitset_bytes): Likewise.
12110 * lib/lbitset.c (lbitset_bytes): Likewise.
12111 * lib/lbitset.h (lbitset_bytes): Likewise.
12112
12113 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
12114 abitset_subset_p, abitset_disjoint_p, abitset_and,
12115 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
12116 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
12117 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
12118 abitset_or_and, abitset_or_and_cmp):
12119 Use bitset_windex instead of unsigned int.
12120 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12121 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
12122 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
12123 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
12124 Likewise.
12125 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
12126
12127 * lib/bitset.c (bitset_print):
12128 Use proper printf formats for widths of integer types.
12129 * lib/bitset_stats.c (bitset_percent_histogram_print,
12130 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
12131 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12132 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12133 * lib/lbitset.c (lbitset_bytes): Likewise.
12134
12135 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
12136 BITSET_SIZE_MAX): New macros.
12137 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
12138 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
12139 to BITSET_WINDEX_MAX.
12140
12141 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
12142 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
12143 since we now return the bitset_bindex type (not int).
12144
12145 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
12146 when computing sizes.
12147 * lib/ebitset.c (ebitset_elts_grow): Likewise.
12148
12149 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
12150 and avoid cast to unsigned.
12151
121522002-09-30 Akim Demaille <akim@epita.fr>
12153
12154 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12155 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
12156 Updates from Michael Hayes.
12157
121582002-09-30 Art Haas <ahaas@neosoft.com>
12159
12160 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
12161 invocations.
12162 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
12163 defined.
12164
121652002-09-27 Akim Demaille <akim@epita.fr>
12166
12167 Version 1.49c.
12168
121692002-09-27 Akim Demaille <akim@epita.fr>
12170
12171 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
12172 (Because of AC_LIBSOURCE).
12173
121742002-09-27 Akim Demaille <akim@epita.fr>
12175
12176 Playing with Autoscan.
12177
12178 * configure.ac: Remove the old LIBOBJ tweaks.
12179 (AC_REPLACE_FUNCS): Add strrchr and strtol.
12180 * lib/strrchr.c: New.
12181 * lib/strtol.c: New, from the Coreutils 4.5.1.
12182
121832002-09-27 Akim Demaille <akim@epita.fr>
12184
12185 Playing with Autoscan.
12186
12187 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
12188 * lib/Makefile.am (libbison_a_SOURCES): No longer include
12189 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
12190 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
12191 Coreutils 4.5.1.
12192
121932002-09-24 Akim Demaille <akim@epita.fr>
12194
12195 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
12196 (Frequently Asked Questions, Parser Stack Overflow): New.
12197
121982002-09-13 Akim Demaille <akim@epita.fr>
12199
12200 Playing with autoscan.
12201
12202 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
12203 * src/files.c (skeleton_find): Remove, unused.
12204 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
12205 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
12206
122072002-09-13 Akim Demaille <akim@epita.fr>
12208
12209 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
12210 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
12211
122122002-09-13 Akim Demaille <akim@epita.fr>
12213
12214 * configure.ac: Require 2.54.
12215 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
12216 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
12217 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
12218 Remove, provided by Autoconf macros.
12219
122202002-09-12 Akim Demaille <akim@epita.fr>
12221
12222 * m4/prereq.m4: Update, from Coreutils 4.5.1.
12223
122242002-09-12 Akim Demaille <akim@epita.fr>
12225
12226 * m4/prereq.m4: Update, from Fileutils 4.1.5.
12227 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
12228 Reported by Martin Mokrejs.
12229
122302002-09-10 Akim Demaille <akim@epita.fr>
12231
12232 * src/parse-gram.y: Associate a human readable string to each
12233 token type.
12234 * tests/regression.at (Invalid inputs): Adjust.
12235
122362002-09-10 Gary V. Vaughan <gary@gnu.org>
12237
12238 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
12239 with an Autoconf-2.5x style configure.ac.
12240
122412002-09-06 Paul Eggert <eggert@twinsun.com>
12242
12243 * doc/bison.texinfo (Conditions): Make explicit that the GPL
12244 exception applies only to yacc.c. This is a modification of a
12245 patch originally suggested by Akim Demaille.
12246
122472002-09-06 Akim Demaille <akim@epita.fr>
12248
12249 * data/c.m4 (b4_copyright): Move the GPL exception comment from
12250 here to...
12251 * data/yacc.c: here.
12252
12253 * data/lalr1.cc (struct yyltype): Don't define it, since we use
12254 LocationType.
12255 (b4_ltype): Default to yy::Location from location.hh.
12256
122572002-09-04 Jim Meyering <jim@meyering.net>
12258
12259 * data/yacc.c: Guard the declaration of yytoknum also with
12260 `#ifdef YYPRINT', so it is declared only when used.
12261
122622002-09-04 Akim Demaille <akim@epita.fr>
12263
12264 * configure.in: Rename as...
12265 * configure.ac: this.
12266 Bump to 1.49c.
12267
122682002-09-04 Akim Demaille <akim@epita.fr>
12269
12270 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
12271 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
12272 translate maintainer only messages.
12273
122742002-08-12 Paul Eggert <eggert@twinsun.com>
12275
12276 Version 1.49b.
12277
12278 * Makefile.am (SUBDIRS): Remove intl.
12279 (DISTCLEANFILES): Remove.
12280 * NEWS: Mention that GNU M4 is now required. Clarify what is
12281 meant by "larger grammars". Mention the pt_BR translation.
12282 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
12283 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
12284 Bump version from 0.11.2 to 0.11.5.
12285 (BISON_PREREQ_STAGE): Remove.
12286 (AM_GNU_GETTEXT): Use external gettext.
12287 (AC_OUTPUT): Remove intl/Makefile.
12288
12289 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
12290
12291 * data/glr.c: Include string.h, for strlen.
12292 (yyreportParseError): Use size_t for yysize.
12293 (yy_yypstack): No longer nested inside yypstates, as nested
12294 functions are not portable. Do not assume size_t is the
12295 same width as int.
12296 (yypstates): Do not assume that ptrdiff_t is the same width
12297 as int, and similarly for yyposn and YYINDEX.
12298
12299 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
12300
12301 * lib/Makefile.am (INCLUDES): Do not include from the intl
12302 directory, which has been removed.
12303 * src/Makefile.am (INCLUDES): Likewise.
12304
12305 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
12306 (bitsets_sources, additional_bitsets_sources, timevars_sources):
12307 New vars.
12308
12309 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
12310 * tests/Makefile.am (EXTRA_DIST): Likewise.
12311
12312 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
12313 Do not assume that bitset_windex is the same width as unsigned.
12314
12315 * lib/abitset.c (abitset_unused_clear): Do not assume that
12316 bitset_word is the same width as int.
12317 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
12318 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
12319 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
12320 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
12321 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
12322
12323 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
12324 portability to one's complement hosts!).
12325 * lib/ebitset.c (ebitset_op1): Likewise.
12326 * lib/lbitset.c (lbitset_op1): Likewise.
12327
12328 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
12329 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12330 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
12331 Sync with fileutils.
12332 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
12333 lib/gettext.h: Sync with diffutils.
12334
12335 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
12336 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
12337
12338 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
12339 PROTOTYPES to check for prototypes, and "defined __STDC__" to
12340 check for void *.
12341
12342 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
12343 size_t; the old version tried to do this but casted improperly.
12344 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
12345 (bitset_test): Now returns int, not unsigned long.
12346
12347 * lib/bitset_stats.c: Include "gettext.h".
12348 (_): New macro.
12349 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
12350 name locals "index", as it generates unnecessary warnings on some
12351 hosts that have an "index" function.
12352
12353 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
12354 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
12355 they need translation.
12356 * src/LR0.c (state_list_append, new_itemsets, get_state,
12357 append_states, generate_states): Likewise.
12358 * src/assoc.c (assoc_to_string): Likewise.
12359 * src/closure.c (print_closure, set_firsts, closure): Likewise.
12360 * src/gram.c (grammar_dump): Likewise.
12361 * src/injections.c (injections_compute): Likewise.
12362 * src/lalr.c (lookaheads_print): Likewise.
12363 * src/relation.c (relation_transpose): Likewise.
12364 * src/scan-gram.l: Likewise.
12365 * src/tables.c (table_grow, pack_vector): Likewise.
12366
12367 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
12368 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
12369 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
12370 * m4/mbstate_t.m4: Sync with fileutils.
12371 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
12372
12373 * po/LINGUAS: Add pt_BR.
12374 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
12375 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
12376 lib/timevar.c.
12377 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
12378 manual recommends.
12379 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
12380
12381 * src/complain.c (strerror_r): Remove decl; not needed.
12382 (strerror): Use same pattern as ../lib/error.c.
12383
12384 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
12385
12386 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
12387
12388 * src/main.c (main): Cast result of bindtextdomain and textdomain
12389 to void, to avoid a GCC warning when --disable-nls is in effect.
12390
12391 * src/scan-gram.l: Use strings rather than escapes when possible,
12392 to minimize the number of warnings from xgettext.
12393 (handle_action_dollar, handle_action_at): Don't use isdigit,
12394 as it mishandles negative chars and it may not work as expected
12395 outside the C locale.
12396
12397 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
12398 this is a GCC extension and is not portable to other compilers.
12399
12400 * src/system.h (alloca): Use same pattern as ../lib/error.c.
12401 Do not include <ctype.h>; no longer needed.
12402 Do not include <malloc.h>; no longer needed (and generates
12403 warnings on OpenBSD 3.0).
12404
12405 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
12406 it's not portable.
12407
12408 * tests/regression.at: Do not use 'cc -c input.c -o input';
12409 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
12410
12411 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
12412 exit status as failure, not just exit status 1. Sun C exits
12413 with status 2 sometimes.
12414
12415 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
12416 Use it for the two large tests.
12417
124182002-08-02 Akim Demaille <akim@epita.fr>
12419
12420 * src/conflicts.c (conflicts_output): Don't output rules never
12421 reduced here, since anyway that computation doesn't work.
12422 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
12423 (rule_useless_p, rule_never_reduced_p): New.
12424 (grammar_rules_partial_print): Use a filter instead of a range.
12425 Display the title only if needed.
12426 (grammar_rules_print): Adjust.
12427 (grammar_rules_never_reduced_report): New.
12428 * src/tables.c (action_row): Move the computation of rules never
12429 reduced to...
12430 (token_actions): here.
12431 * src/main.c (main): Make the parser before making the report, so
12432 that rules never reduced are computed.
12433 Call grammar_rules_never_reduced_report.
12434 * src/print.c (print_results): Report rules never reduced.
12435 * tests/conflicts.at, tests/reduce.at: Adjust.
12436
124372002-08-01 Akim Demaille <akim@epita.fr>
12438
12439 Instead of attaching lookaheads and duplicating the rules being
12440 reduced by a state, attach the lookaheads to the reductions.
12441
12442 * src/state.h (state_t): Remove the `lookaheads',
12443 `lookaheads_rule' member.
12444 (reductions_t): Add a `lookaheads' member.
12445 Use a regular array for the `rules'.
12446 * src/state.c (reductions_new): Initialize the lookaheads member
12447 to 0.
12448 (state_rule_lookaheads_print): Adjust.
12449 * src/state.h, src/state.c (state_reductions_find): New.
12450 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
12451 (count_rr_conflicts): Adjust.
12452 * src/lalr.c (LArule): Remove.
12453 (add_lookback_edge): Adjust.
12454 (state_lookaheads_count): New.
12455 (states_lookaheads_initialize): Merge into...
12456 (initialize_LA): this.
12457 (lalr_free): Adjust.
12458 * src/main.c (main): Don't free nullable and derives too early: it
12459 is used by --verbose.
12460 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
12461
124622002-08-01 Akim Demaille <akim@epita.fr>
12463
12464 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
12465 `rule_number_t**'.
12466 (set_derives, free_derives): Rename as...
12467 (derives_compute, derives_free): this.
12468 Adjust all dependencies.
12469 * src/nullable.c (set_nullable, free_nullable): Rename as...
12470 (nullable_compute, nullable_free): these.
12471 (rule_list_t): Store rule_t *, not rule_number_t.
12472 * src/state.c (state_rule_lookaheads_print): Directly compare rule
12473 pointers, instead of their numbers.
12474 * src/main.c (main): Call nullable_free, and derives_free earlier,
12475 as they were lo longer used.
12476
124772002-08-01 Akim Demaille <akim@epita.fr>
12478
12479 * lib/timevar.c (get_time): Include children time.
12480 * src/lalr.h (LA, LArule): Don't export them: used with the
12481 state_t.
12482 * src/lalr.c (LA, LArule): Static.
12483 * src/lalr.h, src/lalr.c (lalr_free): New.
12484 * src/main.c (main): Call it.
12485 * src/tables.c (pack_vector): Check whether loc is >= to the
12486 table_size, not >.
12487 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
12488 (tables_generate): do it, since that's also it which allocates
12489 them.
12490 Don't free LA and LArule, main does.
12491
124922002-07-31 Akim Demaille <akim@epita.fr>
12493
12494 Separate parser tables computation and output.
12495
12496 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
12497 (conflict_list, conflict_list_cnt, table, check, table_ninf)
12498 (yydefgoto, yydefact, high): Move to...
12499 * src/tables.h, src/tables.c: here.
12500 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12501 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12502 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
12503 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
12504 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
12505 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
12506 (action_row, save_row, token_actions, save_column, default_goto)
12507 (goto_actions, sort_actions, matching_state, pack_vector)
12508 (table_ninf_remap, pack_table, prepare_actions): Move to...
12509 * src/tables.c: here.
12510 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
12511 * src/output.c (token_actions, output_base, output_conflicts)
12512 (output_check): Merge into...
12513 (prepare_actions): this.
12514 (actions_output): Rename as...
12515 (user_actions_output): this.
12516 * src/main.c (main): Call tables_generate and tables_free.
12517
125182002-07-31 Akim Demaille <akim@epita.fr>
12519
12520 Steal GCC's --time-report support.
12521
12522 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
12523 stolen/adjusted from GCC.
12524 * m4/stage.m4: Remove time related checks.
12525 * m4/timevar.m4: New.
12526 * configure.in: Adjust.
12527 * src/system.h: Adjust to using timevar.h.
12528 * src/getargs.h, src/getargs.c: Support trace_time for
12529 --trace=time.
12530 * src/main.c (stage): Remove.
12531 (main): Replace `stage' invocations with timevar calls.
12532 * src/output.c: Insert pertinent timevar calls.
12533
125342002-07-31 Akim Demaille <akim@epita.fr>
12535
12536 Let --trace have arguments.
12537
12538 * src/getargs.h (enum trace_e): New.
12539 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
12540 (long_options, short_options): --trace/-T takes an optional
12541 argument.
12542 Change all the uses of trace_flag to reflect the new flags.
12543 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
12544
12545 Strengthen `stage' portability.
12546
12547 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
12548 * configure.in: Use it.
12549 Don't check for malloc.h and sys/times.h.
12550 * src/system.h: Include them when appropriate.
12551 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
12552 times and struct tms are available.
12553
125542002-07-30 Akim Demaille <akim@epita.fr>
12555
12556 In verbose parse error message, don't report `error' as an
12557 expected token.
12558 * tests/actions.at (Printers and Destructors): Adjust.
12559 * tests/calc.at (Calculator $1): Adjust.
12560 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
12561 error message, do not report the parser accepts the error token in
12562 that state.
12563
125642002-07-30 Akim Demaille <akim@epita.fr>
12565
12566 Normalize conflict related messages.
12567
12568 * src/complain.h, src/complain.c (warn, complain): New.
12569 * src/conflicts.c (conflicts_print): Use them.
12570 (conflict_report_yacc): New, extracted from...
12571 (conflicts_print): here.
12572 * tests/conflicts.at, tests/existing.at: Adjust.
12573
125742002-07-30 Akim Demaille <akim@epita.fr>
12575
12576 Report rules which are never reduced by the parser: those hidden
12577 by conflicts.
12578
12579 * src/LR0.c (save_reductions): Don't make the final state too
12580 different: save its reduction (accept) instead of having a state
12581 without any action (no shift or goto, no reduce).
12582 Note: the final state is now a ``regular'' state, i.e., the
12583 parsers now contain `reduce 0' as default reduction.
12584 Nevertheless, since they decide to `accept' when yystate =
12585 final_state, they still will not reduce rule 0.
12586 * src/print.c (print_actions, print_reduction): Adjust.
12587 * src/output.c (action_row): Track reduced rules.
12588 (token_actions): Report rules never reduced.
12589 * tests/conflicts.at, tests/regression.at: Adjust.
12590
125912002-07-30 Akim Demaille <akim@epita.fr>
12592
12593 `stage' was accidently included in a previous patch.
12594 Initiate its autoconfiscation.
12595
12596 * configure.in: Look for malloc.h and sys/times.h.
12597 * src/main.c (stage): Adjust.
12598 Report only when trace_flag.
12599
126002002-07-29 Akim Demaille <akim@epita.fr>
12601
12602 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
12603 state_number_t.
12604 (errs_t): symbol_t*, not symbol_number_t.
12605 (reductions_t): rule_t*, not rule_number_t.
12606 (FOR_EACH_SHIFT): New.
12607 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
12608 * src/print.c, src/print_graph.c: Adjust.
12609
126102002-07-29 Akim Demaille <akim@epita.fr>
12611
12612 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
12613
12614 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
12615 (endtoken, accept): these.
12616 * src/reader.c (reader): Set endtoken's default tag to "$end".
12617 Set undeftoken's tag to "$undefined" instead of "$undefined.".
12618 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
12619 Adjust.
12620
126212002-07-29 Akim Demaille <akim@epita.fr>
12622
12623 * src/reduce.c (reduce_grammar): When the language is empty,
12624 complain about the start symbol, not the axiom.
12625 Use its location.
12626 * tests/reduce.at (Empty Language): New.
12627
126282002-07-26 Akim Demaille <akim@epita.fr>
12629
12630 * src/reader.h, src/reader.c (gram_error): ... can't get
12631 yycontrol without making too strong assumptions on the parser
12632 itself.
12633 * src/output.c (prepare_tokens): Use the real 0th value of
12634 token_translations instead of `0'.
12635 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
12636 visible here.
12637 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
12638 for the time being: %locations ought to provide it to yyerror.
12639
126402002-07-25 Akim Demaille <akim@epita.fr>
12641
12642 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
12643 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
12644 * tests/regression.at (Web2c Actions): Adjust.
12645
126462002-07-25 Akim Demaille <akim@epita.fr>
12647
12648 Stop storing rules from 1 to nrules + 1.
12649
12650 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
12651 * src/nullable.c, src/output.c, src/print.c, src/reader.c
12652 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
12653 Iterate from 0 to nrules.
12654 Use rule_number_as_item_number and item_number_as_rule_number.
12655 Adjust to `derive' now containing possibly 0.
12656 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
12657 Handle the `- 1' part in rule numbers from/to item numbers.
12658 * src/conflicts.c (log_resolution): Fix the message which reversed
12659 shift and reduce.
12660 * src/output.c (action_row): Initialize default_rule to -1.
12661 (token_actions): Adjust.
12662 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
12663 expected output.
12664 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
12665
126662002-07-25 Akim Demaille <akim@epita.fr>
12667
12668 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
12669 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
12670 (b4_c_knr_arg_decl): New.
12671 * data/yacc.c: Use it to define yysymprint, yydestruct, and
12672 yyreport_parse_error.
12673
126742002-07-25 Akim Demaille <akim@epita.fr>
12675
12676 * data/yacc.c (yyreport_parse_error): New, extracted from...
12677 (yyparse): here.
12678 (yydestruct, yysymprint): Move above yyparse.
12679 Be K&R compliant.
12680
126812002-07-25 Akim Demaille <akim@epita.fr>
12682
12683 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
12684 replace...
12685 (b4_sint_type, b4_uint_type): these.
12686 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
12687 * tests/regression.at (Web2c Actions): Adjust.
12688
126892002-07-25 Akim Demaille <akim@epita.fr>
12690
12691 * src/gram.h (TIEM_NUMBER_MAX): New.
12692 (item_number_of_rule_number, rule_number_of_item_number): Rename
12693 as...
12694 (rule_number_as_item_number, item_number_as_rule_number): these.
12695 Adjust dependencies.
12696 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12697 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12698 (symbol_number_to_vector_number): New.
12699 (order): Of vector_number_t* type.
12700 (base_t, BASE_MAX, BASE_MIN): New.
12701 (froms, tos, width, pos, check): Of base_t type.
12702 (action_number_t, ACTION_MIN, ACTION_MAX): New.
12703 (actrow): Of action_number_t type.
12704 (conflrow): Of unsigned int type.
12705 (table_ninf, base_ninf): New.
12706 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
12707 (muscle_insert_int_table, muscle_insert_base_table)
12708 (muscle_insert_rule_number_table): New.
12709 (prepare_tokens): Output `toknum' as int_table.
12710 (action_row): Returns a rule_number_t.
12711 Use ACTION_MIN, not SHRT_MIN.
12712 (token_actions): yydefact is rule_number_t*.
12713 (table_ninf_remap): New.
12714 (pack_table): Use it for `base' and `table'.
12715 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
12716 replaced with...
12717 (YYPACT_NINF, YYTABLE_NINF): these.
12718 (yypact, yytable): Compute their types instead of hard-coded
12719 `short'.
12720 * tests/regression.at (Web2c Actions): Adjust.
12721
127222002-07-19 Akim Demaille <akim@epita.fr>
12723
12724 * src/scan-gram.l (id): Can start with an underscore.
12725
127262002-07-16 Akim Demaille <akim@epita.fr>
12727
12728 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
12729 Adjust all former `associativity' dependencies.
12730 * src/symtab.c (symbol_new): Default associativity is `undef', not
12731 `right'.
12732 (symbol_check_alias_consistence): Adjust.
12733
127342002-07-09 Akim Demaille <akim@epita.fr>
12735
12736 * doc/bison.texinfo: Properly set the ``header'' part.
12737 Use @dircategory ``GNU programming tools'' as per Texinfo's
12738 documentation.
12739 Use @copying.
12740
127412002-07-09 Akim Demaille <akim@epita.fr>
12742
12743 * lib/quotearg.h: Protect against multiple inclusions.
12744 * src/location.h (location_t): Add a `file' member.
12745 (LOCATION_RESET, LOCATION_PRINT): Adjust.
12746 * src/complain.c (warn_at, complain_at, fatal_at): Drop
12747 `error_one_per_line' support.
12748
127492002-07-09 Akim Demaille <akim@epita.fr>
12750
12751 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
12752 * src/reader.c (lineno): Remove.
12753 Adjust all dependencies.
12754 (get_merge_function): Take a location and use complain_at.
12755 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
12756 * tests/regression.at (Invalid inputs, Mixing %token styles):
12757 Adjust.
12758
127592002-07-09 Akim Demaille <akim@epita.fr>
12760
12761 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
12762 recovery rule, and forbid extensions when --yacc.
12763 (gram_error): Use complain_at.
12764 * src/reader.c (reader): Exit if there were parse errors.
12765
127662002-07-09 Akim Demaille <akim@epita.fr>
12767
12768 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
12769 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
12770 Reported by R Blake <blakers@mac.com>.
12771
127722002-07-09 Akim Demaille <akim@epita.fr>
12773
12774 * data/yacc.c: Output the copyright notive in the header.
12775
127762002-07-03 Akim Demaille <akim@epita.fr>
12777
12778 * src/output.c (froms, tos): Are state_number_t.
12779 (save_column): sp, sp1, and sp2 are state_number_t.
12780 (prepare): Rename `final' as `final_state_number', `nnts' as
12781 `nterms_number', `nrules' as `rules_number', `nstates' as
12782 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
12783 unused.
12784 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
12785 * data/lalr1.cc (nsym_): Remove, unused.
12786
127872002-07-03 Akim Demaille <akim@epita.fr>
12788
12789 * src/lalr.h, src/lalr.c (goto_number_t): New.
12790 * src/lalr.c (goto_list_t): New.
12791 Propagate them.
12792 * src/nullable.c (rule_list_t): New.
12793 Propagate.
12794 * src/types.h: Remove.
12795
127962002-07-03 Akim Demaille <akim@epita.fr>
12797
12798 * src/closure.c (print_fderives): Use rule_rhs_print.
12799 * src/derives.c (print_derives): Use rule_rhs_print.
12800 (rule_list_t): New, replaces `shorts'.
12801 (set_derives): Add comments.
12802 * tests/sets.at (Nullable, Firsts): Adjust.
12803
128042002-07-03 Akim Demaille <akim@epita.fr>
12805
12806 * src/output.c (prepare_actions): Free `tally' and `width'.
12807 (prepare_actions): Allocate and free `order'.
12808 * src/symtab.c (symbols_free): Free `symbols'.
12809 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
12810 * src/output.c (m4_invoke): Move to...
12811 * src/scan-skel.l: here.
12812 (<<EOF>>): Close yyout, and free its name.
12813
128142002-07-03 Akim Demaille <akim@epita.fr>
12815
12816 Fix some memory leaks, and fix a bug: state 0 was examined twice.
12817
12818 * src/LR0.c (new_state): Merge into...
12819 (state_list_append): this.
12820 (new_states): Merge into...
12821 (generate_states): here.
12822 (set_states): Don't ensure a proper `errs' state member here, do it...
12823 * src/conflicts.c (conflicts_solve): here.
12824 * src/state.h, src/state.c: Comment changes.
12825 (state_t): Rename member `shifts' as `transitions'.
12826 Adjust all dependencies.
12827 (errs_new): For consistency, also take the values as argument.
12828 (errs_dup): Remove.
12829 (state_errs_set): New.
12830 (state_reductions_set, state_transitions_set): Assert that no
12831 previous value was assigned.
12832 (state_free): New.
12833 (states_free): Use it.
12834 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
12835 temporary storage: use `errs' and `nerrs' as elsewhere.
12836 (set_conflicts): Allocate and free this `errs'.
12837
128382002-07-02 Akim Demaille <akim@epita.fr>
12839
12840 * lib/libiberty.h: New.
12841 * lib: Update the bitset implementation from upstream.
12842 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
12843 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
12844 * src/main.c: Adjust bitset stats calls.
12845
128462002-07-01 Paul Eggert <eggert@twinsun.com>
12847
12848 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
12849 char, so that negative chars don't collide with $.
12850
128512002-06-30 Akim Demaille <akim@epita.fr>
12852
12853 Have the GLR tests be `warning' checked, and fix the warnings.
12854
12855 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
12856 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
12857 (yyremoveDeletes): `yyi' and `yyj' are size_t.
12858 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
12859 (yyaddDeferredAction): static.
12860 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
12861 (yyreportParseError): yyprefix is const.
12862 yytokenp is used only when verbose.
12863 (yy__GNUC__): Replace with __GNUC__.
12864 (yypdumpstack): yyi is size_t.
12865 (yypreference): Un-yy local variables and arguments, to avoid
12866 clashes with `yyr1'. Anyway, we are not in the user name space.
12867 (yytname_size): be an int, as is compared with ints.
12868 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
12869 Use them.
12870 * tests/cxx-gram.at: Use quotation to protect $1.
12871 Use AT_COMPILE to enable warnings hunts.
12872 Prototype yylex and yyerror.
12873 `Use' argc.
12874 Include `string.h', not `strings.h'.
12875 Produce and prototype stmtMerge only when used.
12876 yylex takes a location.
12877
128782002-06-30 Akim Demaille <akim@epita.fr>
12879
12880 We spend a lot of time in quotearg, in particular when --verbose.
12881
12882 * src/symtab.c (symbol_get): Store a quoted version of the key.
12883 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
12884 Adjust all callers.
12885
128862002-06-30 Akim Demaille <akim@epita.fr>
12887
12888 * src/state.h (reductions_t): Rename member `nreds' as num.
12889 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
12890 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
12891
128922002-06-30 Akim Demaille <akim@epita.fr>
12893
12894 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
12895 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
12896 (shifts_to): Rename as...
12897 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
12898 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
12899 (TRANSITION_IS_DISABLED, transitions_to): these.
12900
129012002-06-30 Akim Demaille <akim@epita.fr>
12902
12903 * src/print.c (print_shifts, print_gotos): Merge into...
12904 (print_transitions): this.
12905 (print_transitions, print_errs, print_reductions): Align the
12906 lookaheads columns.
12907 (print_core, print_transitions, print_errs, print_state,
12908 print_grammar): Output empty lines separator before, not after.
12909 (state_default_rule_compute): Rename as...
12910 (state_default_rule): this.
12911 * tests/conflicts.at (Defaulted Conflicted Reduction),
12912 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
12913 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
12914
129152002-06-30 Akim Demaille <akim@epita.fr>
12916
12917 Display items as we display rules.
12918
12919 * src/gram.h, src/gram.c (rule_lhs_print): New.
12920 * src/gram.c (grammar_rules_partial_print): Use it.
12921 * src/print.c (print_core): Likewise.
12922 * tests/conflicts.at (Defaulted Conflicted Reduction),
12923 (Unresolved SR Conflicts): Adjust.
12924 (Unresolved SR Conflicts): Adjust and rename as...
12925 (Resolved SR Conflicts): this, as was meant.
12926 * tests/regression.at (Web2c Report): Adjust.
12927
129282002-06-30 Akim Demaille <akim@epita.fr>
12929
12930 * src/print.c (state_default_rule_compute): New, extracted from...
12931 (print_reductions): here.
12932 Pessimize, but clarify the code.
12933 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
12934
129352002-06-30 Akim Demaille <akim@epita.fr>
12936
12937 * src/output.c (action_row): Let default_rule be always a rule
12938 number.
12939
129402002-06-30 Akim Demaille <akim@epita.fr>
12941
12942 * src/closure.c (print_firsts, print_fderives, closure):
12943 Use BITSET_EXECUTE.
12944 * src/lalr.c (lookaheads_print): Likewise.
12945 * src/state.c (state_rule_lookaheads_print): Likewise.
12946 * src/print_graph.c (print_core): Likewise.
12947 * src/print.c (print_reductions): Likewise.
12948 * src/output.c (action_row): Likewise.
12949 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
12950
129512002-06-30 Akim Demaille <akim@epita.fr>
12952
12953 * src/print_graph.c: Use report_flag.
12954
129552002-06-30 Akim Demaille <akim@epita.fr>
12956
12957 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
12958 to...
12959 * src/relation.h, src/relation.c (traverse, relation_digraph)
12960 (relation_print, relation_transpose): New.
12961
129622002-06-30 Akim Demaille <akim@epita.fr>
12963
12964 * src/state.h, src/state.c (shifts_to): New.
12965 * src/lalr.c (build_relations): Use it.
12966
129672002-06-30 Akim Demaille <akim@epita.fr>
12968
12969 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
12970 (item_number_of_rule_number, rule_number_of_item_number): New.
12971 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
12972 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
12973 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
12974 Propagate their use.
12975 Much remains to be done, in particular wrt `shorts' from types.h.
12976
129772002-06-30 Akim Demaille <akim@epita.fr>
12978
12979 * src/symtab.c (symbol_new): Initialize the `printer' member.
12980
129812002-06-30 Akim Demaille <akim@epita.fr>
12982
12983 * src/LR0.c (save_reductions): Remove, replaced by...
12984 * src/state.h, src/state.c (state_reductions_set): New.
12985 (reductions, errs): Rename as...
12986 (reductions_t, errs_t): these.
12987 Adjust all dependencies.
12988
129892002-06-30 Akim Demaille <akim@epita.fr>
12990
12991 * src/LR0.c (state_list_t, state_list_append): New.
12992 (first_state, last_state): Now symbol_list_t.
12993 (this_state): Remove.
12994 (new_itemsets, append_states, save_reductions): Take a state_t as
12995 argument.
12996 (set_states, generate_states): Adjust.
12997 (save_shifts): Remove, replaced by...
12998 * src/state.h, src/state.c (state_shifts_set): New.
12999 (shifts): Rename as...
13000 (shifts_t): this.
13001 Adjust all dependencies.
13002 * src/state.h (state_t): Remove the `next' member.
13003
130042002-06-30 Akim Demaille <akim@epita.fr>
13005
13006 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
13007 escaped in slot 0.
13008
130092002-06-30 Akim Demaille <akim@epita.fr>
13010
13011 Use hash.h for the state hash table.
13012
13013 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
13014 (allocate_storage): Use state_hash_new.
13015 (free_storage): Use state_hash_free.
13016 (new_state, get_state): Adjust.
13017 * src/lalr.h, src/lalr.c (states): Move to...
13018 * src/states.h (state_t): Remove the `link' member, no longer
13019 used.
13020 * src/states.h, src/states.c: here.
13021 (state_hash_new, state_hash_free, state_hash_lookup)
13022 (state_hash_insert, states_free): New.
13023 * src/states.c (state_table, state_compare, state_hash): New.
13024 * src/output.c (output_actions): Do not free states now, since we
13025 still need to know the final_state number in `prepare', called
13026 afterwards. Do it...
13027 * src/main.c (main): here: call states_free after `output'.
13028
130292002-06-30 Akim Demaille <akim@epita.fr>
13030
13031 * src/state.h, src/state.c (state_new): New, extracted from...
13032 * src/LR0.c (new_state): here.
13033 * src/state.h (STATE_ALLOC): Move to...
13034 * src/state.c: here.
13035 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
13036 * src/state.h, src/state.c: here.
13037
130382002-06-30 Akim Demaille <akim@epita.fr>
13039
13040 * src/reader.c (gensym): Rename as...
13041 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
13042 (getsym): Rename as...
13043 (symbol_get): this.
13044
130452002-06-30 Akim Demaille <akim@epita.fr>
13046
13047 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
13048 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
13049 * src/output.c, src/print.c, src/print_graph.c: Propagate.
13050 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
13051
130522002-06-30 Akim Demaille <akim@epita.fr>
13053
13054 Make the test suite pass with warnings checked.
13055
13056 * tests/actions.at (Printers and Destructors): Improve.
13057 Avoid unsigned vs. signed issues.
13058 * tests/calc.at: Don't exercise the scanner here, do it...
13059 * tests/input.at (Torturing the Scanner): here.
13060
130612002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13062
13063 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
13064 reorganize first lines parallel to yacc.c.
13065
130662002-06-28 Akim Demaille <akim@epita.fr>
13067
13068 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
13069 (b4_token_enum, b4_token_defines): New, factored from...
13070 * data/lalr1.cc, data/yacc.c, glr.c: here.
13071
130722002-06-28 Akim Demaille <akim@epita.fr>
13073
13074 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
13075 unused variables.
13076 * src/output.c (merger_output): static.
13077
130782002-06-28 Akim Demaille <akim@epita.fr>
13079
13080 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
13081 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
13082 pacify GCC.
13083 * src/output.c (save_row): Initialize all the variables to pacify GCC.
13084
130852002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13086
13087 Accumulated changelog for new GLR parsing features.
13088
13089 * src/conflicts.c (count_total_conflicts): Change name to
13090 conflicts_total_count.
13091 * src/conflicts.h: Ditto.
13092 * src/output.c (token_actions): Use the new name.
13093 (output_conflicts): Change conflp => conflict_list_heads, and
13094 confl => conflict_list for better readability.
13095 * data/glr.c: Use the new names.
13096 * NEWS: Add self to GLR announcement.
13097
13098 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
13099
13100 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
13101 Akim Demaille.
13102
13103 * data/bison.glr: Change name to glr.c
13104 * data/glr.c: Renamed from bison.glr.
13105 * data/Makefile.am: Add glr.c
13106
13107 * src/getargs.c:
13108
13109 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
13110 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
13111
13112 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13113
13114 * data/bison.glr: Be sure to restore the
13115 current #line when returning to the skeleton contents after having
13116 exposed the input file's #line.
13117
13118 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13119
13120 * data/bison.glr: Bring up to date with changes to bison.simple.
13121
13122 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13123
13124 * data/bison.glr: Correct definitions that use b4_prefix.
13125 Various reformatting.
13126 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
13127 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
13128 yytokenp argument; now part of stack.
13129 (yychar): Define to behave as documented.
13130 (yyclearin): Ditto.
13131
13132 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13133
13134 * src/reader.h: Add declaration for free_merger_functions.
13135
13136 * src/reader.c (merge_functions): New variable.
13137 (get_merge_function): New function.
13138 (free_merger_functions): New function.
13139 (readgram): Check for %prec that is not followed by a symbol.
13140 Handle %dprec and %merge declarations.
13141 (packgram): Initialize dprec and merger fields in rules array.
13142
13143 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
13144 conflict_list_cnt, conflict_list_free): New variables.
13145 (table_grow): Also grow conflict_table.
13146 (prepare_rules): Output dprec and merger tables.
13147 (conflict_row): New function.
13148 (action_row): Output conflict lists for GLR parser. Don't use
13149 default reduction in conflicted states for GLR parser so that there
13150 are spaces for the conflict lists.
13151 (save_row): Also save conflict information.
13152 (token_actions): Allocate conflict list.
13153 (merger_output): New function.
13154 (pack_vector): Pack conflict table, too.
13155 (output_conflicts): New function to output yyconflp and yyconfl.
13156 (output_check): Allocate conflict_tos.
13157 (output_actions): Output conflict tables, also.
13158 (output_skeleton): Output b4_mergers definition.
13159 (prepare): Output b4_max_rhs_length definition.
13160 Use 'bison.glr' as default skeleton for GLR parsers.
13161
13162 * src/gram.c (glr_parser): New flag.
13163 (grammar_free): Call free_merger_functions.
13164
13165 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
13166 all pairs of conflicting reductions, rather than just all tokens
13167 causing conflicts. Needed to size conflict tables.
13168 (conflicts_output): Modify call to count_rr_conflicts for new
13169 interface.
13170 (conflicts_print): Ditto.
13171 (count_total_conflicts): New function.
13172
13173 * src/reader.h (merger_list): New type.
13174 (merge_functions): New variable.
13175
13176 * src/lex.h (tok_dprec, tok_merge): New token types.
13177
13178 * src/gram.h (rule_s): Add dprec and merger fields.
13179 (glr_parser): New flag.
13180
13181 * src/conflicts.h (count_total_conflicts): New function.
13182
13183 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
13184
13185 * doc/bison.texinfo (Generalized LR Parsing): New section.
13186 (GLR Parsers): New section.
13187 (Language and Grammar): Mention GLR parsing.
13188 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
13189 Correct typo ("tge" -> "the").
13190
13191 * data/bison.glr: New skeleton for GLR parsing.
13192
13193 * tests/cxx-gram.at: New tests for GLR parsing.
13194
13195 * tests/testsuite.at: Include cxx-gram.at.
13196
13197 * tests/Makefile.am: Add cxx-gram.at.
13198
13199 * src/parse-gram.y:
13200
13201 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
13202
13203 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
13204
132052002-06-27 Akim Demaille <akim@epita.fr>
13206
13207 * src/options.h, src/options.c: Remove.
13208 * src/getargs.c (short_options, long_options): New.
13209
132102002-06-27 Akim Demaille <akim@epita.fr>
13211
13212 * data/bison.simple, data/bison.c++: Rename as...
13213 * data/yacc.c, data/lalr1.cc: these.
13214 * doc/bison.texinfo (Environment Variables): Remove.
13215
132162002-06-25 Raja R Harinath <harinath@cs.umn.edu>
13217
13218 * src/getargs.c (report_argmatch): Initialize strtok().
13219
132202002-06-20 Akim Demaille <akim@epita.fr>
13221
13222 * data/bison.simple (b4_symbol_actions): New, replaces...
13223 (b4_symbol_destructor, b4_symbol_printer): these.
13224 (yysymprint): Be sure to call YYPRINT only for tokens, and using
13225 user token numbers.
13226
132272002-06-20 Akim Demaille <akim@epita.fr>
13228
13229 * data/bison.simple (yydestructor): Rename as...
13230 (yydestruct): this.
13231
132322002-06-20 Akim Demaille <akim@epita.fr>
13233
13234 * src/symtab.h, src/symtab.c (symbol_type_set)
13235 (symbol_destructor_set, symbol_precedence_set): The location is
13236 the last argument.
13237 Adjust all callers.
13238
132392002-06-20 Akim Demaille <akim@epita.fr>
13240
13241 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
13242 internals.
13243 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
13244 Takes a location.
13245 * src/symtab.h, src/symtab.c (symbol_class_set)
13246 (symbol_user_token_number_set): Likewise.
13247 Adjust all callers.
13248 Promote complain_at.
13249 * tests/input.at (Type Clashes): Adjust.
13250
132512002-06-20 Akim Demaille <akim@epita.fr>
13252
13253 * data/bison.simple (YYLEX): Fix the declaration when
13254 %pure-parser.
13255
132562002-06-20 Akim Demaille <akim@epita.fr>
13257
13258 * data/bison.simple (yysymprint): Don't print the token number,
13259 just its name.
13260 * tests/actions.at (Destructors): Rename as...
13261 (Printers and Destructors): this.
13262 Also exercise %printer.
13263
132642002-06-20 Akim Demaille <akim@epita.fr>
13265
13266 * data/bison.simple (YYDSYMPRINT): New.
13267 Use it to remove many of the #if YYDEBUG/if (yydebug).
13268
132692002-06-20 Akim Demaille <akim@epita.fr>
13270
13271 * src/symtab.h, src/symtab.c (symbol_t): printer and
13272 printer_location are new members.
13273 (symbol_printer_set): New.
13274 * src/parse-gram.y (PERCENT_PRINTER): New token.
13275 Handle its associated rule.
13276 * src/scan-gram.l: Adjust.
13277 (handle_destructor_at, handle_destructor_dollar): Rename as...
13278 (handle_symbol_code_at, handle_symbol_code_dollar): these.
13279 * src/output.c (symbol_printers_output): New.
13280 (output_skeleton): Call it.
13281 * data/bison.simple (yysymprint): New. Cannot be named yyprint
13282 since there are already many grammar files with a user `yyprint'.
13283 Replace the calls to YYPRINT to calls to yysymprint.
13284 * tests/calc.at: Adjust.
13285 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
13286 taking advantage of parser very internal details (stack size!).
13287
132882002-06-20 Akim Demaille <akim@epita.fr>
13289
13290 * src/scan-gram.l: Complete the scanner with the missing patterns
13291 to pacify Flex.
13292 Use `quote' and `symbol_tag_get' where appropriate.
13293
132942002-06-19 Akim Demaille <akim@epita.fr>
13295
13296 * tests/actions.at (Destructors): Augment to test locations.
13297 * data/bison.simple (yydestructor): Pass it the current location
13298 if locations are enabled.
13299 Prototype only when __STDC__ or C++.
13300 Change the argument names to move into the yy name space: there is
13301 user code here.
13302
133032002-06-19 Akim Demaille <akim@epita.fr>
13304
13305 * data/bison.simple (b4_pure_if): New.
13306 Use it instead of #ifdef YYPURE.
13307
133082002-06-19 Akim Demaille <akim@epita.fr>
13309
13310 * data/bison.simple (b4_location_if): New.
13311 Use it instead of #ifdef YYLSP_NEEDED.
13312
133132002-06-19 Akim Demaille <akim@epita.fr>
13314
13315 Prepare @$ in %destructor, but currently don't bind it in the
13316 skeleton, as %location use is not cleaned up yet.
13317
13318 * src/scan-gram.l (handle_dollar, handle_destructor_at)
13319 (handle_action_at): New.
13320 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
13321 a braced_code_t and a location as additional arguments.
13322 (handle_destructor_dollar): Instead of requiring `b4_eval', just
13323 unquote one when outputting `b4_dollar_dollar'.
13324 Adjust callers.
13325 * data/bison.simple (b4_eval): Remove.
13326 (b4_symbol_destructor): Adjust.
13327 * tests/input.at (Invalid @n): Adjust.
13328
133292002-06-19 Zack Weinberg <zack@codesourcery.com>
13330
13331 * doc/bison.texinfo: Document ability to have multiple
13332 prologue sections.
13333
133342002-06-18 Akim Demaille <akim@epita.fr>
13335
13336 * src/files.c (compute_base_names): When computing the output file
13337 names from the input file name, strip the directory part.
13338
133392002-06-18 Akim Demaille <akim@epita.fr>
13340
13341 * data/bison.simple.new: Comment changes.
13342 Reported by Andreas Schwab.
13343
133442002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
13345
13346 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
13347 there are no `label `yyoverflowlab' defined but not used' warnings
13348 when yyoverflow is defined.
13349
133502002-06-18 Akim Demaille <akim@epita.fr>
13351
13352 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
13353 new member.
13354 (symbol_destructor_set): Adjust.
13355 * src/output.c (symbol_destructors_output): Output the destructor
13356 locations.
13357 Output the symbol name.
13358 * data/bison.simple (b4_symbol_destructor): Adjust.
13359
133602002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
13361 and Akim Demaille <akim@epita.fr>
13362
13363 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
13364 what's left on the stack when the error recovery hits EOF.
13365 * tests/actions.at (Destructors): Complete to exercise this case.
13366
133672002-06-17 Akim Demaille <akim@epita.fr>
13368
13369 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
13370 arguments is really empty, not only equal to `[]'.
13371 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
13372 member.
13373 (symbol_destructor_set): New.
13374 * src/output.c (symbol_destructors_output): New.
13375 * src/reader.h (brace_code_t, current_braced_code): New.
13376 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
13377 (handle_dollar): Rename as...
13378 (handle_action_dollar): this.
13379 (handle_destructor_dollar): New.
13380 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
13381 (grammar_declaration): Use it.
13382 * data/bison.simple (yystos): Is always defined.
13383 (yydestructor): New.
13384 * tests/actions.at (Destructors): New.
13385 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
13386
133872002-06-17 Akim Demaille <akim@epita.fr>
13388
13389 * src/symlist.h, src/symlist.c (symbol_list_length): New.
13390 * src/scan-gram.l (handle_dollar, handle_at): Compute the
13391 rule_length only when needed.
13392 * src/output.c (actions_output, token_definitions_output): Output
13393 the full M4 block.
13394 * src/symtab.c: Don't access directly to the symbol tag, use
13395 symbol_tag_get.
13396 * src/parse-gram.y: Use symbol_list_free.
13397
133982002-06-17 Akim Demaille <akim@epita.fr>
13399
13400 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
13401 (symbol_list_prepend, get_type_name): Move to...
13402 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
13403 (symbol_list_prepend, symbol_list_n_type_name_get): here.
13404 Adjust all callers.
13405 (symbol_list_free): New.
13406 * src/scan-gram.l (handle_dollar): Takes a location.
13407 * tests/input.at (Invalid $n): Adjust.
13408
134092002-06-17 Akim Demaille <akim@epita.fr>
13410
13411 * src/reader.h, src/reader.c (symbol_list_new): Export it.
13412 (symbol_list_prepend): New.
13413 * src/parse-gram.y (%union): `list' is a new member.
13414 (symbols.1): New, replaces...
13415 (terms_to_prec.1, nterms_to_type.1): these.
13416 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
13417 Take a location as additional argument.
13418 Adjust all callers.
13419
134202002-06-15 Akim Demaille <akim@epita.fr>
13421
13422 * src/parse-gram.y: Move %token in the declaration section so that
13423 we don't depend upon CVS Bison.
13424
134252002-06-15 Akim Demaille <akim@epita.fr>
13426
13427 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
13428 * src/print.c (print_core): Use it.
13429
134302002-06-15 Akim Demaille <akim@epita.fr>
13431
13432 * src/conflicts.c (log_resolution): Accept the rule involved in
13433 the sr conflicts instead of the lookahead number that points to
13434 that rule.
13435 (flush_reduce): Accept the current lookahead vector as argument,
13436 instead of the index in LA.
13437 (resolve_sr_conflict): Accept the current number of lookahead
13438 bitset to consider for the STATE, instead of the index in LA.
13439 (set_conflicts): Adjust.
13440 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
13441
134422002-06-15 Akim Demaille <akim@epita.fr>
13443
13444 * src/state.h (state_t): Replace the `lookaheadsp' member, a
13445 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
13446 Adjust all dependencies.
13447 * src/lalr.c (initialize_lookaheads): Split into...
13448 (states_lookaheads_count, states_lookaheads_initialize): these.
13449 (lalr): Adjust.
13450
134512002-06-15 Akim Demaille <akim@epita.fr>
13452
13453 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
13454 out of...
13455 (grammar_rules_print): here.
13456 * src/reduce.c (reduce_output): Use it.
13457 * tests/reduce.at (Useless Rules, Reduced Automaton)
13458 (Underivable Rules): Adjust.
13459
134602002-06-15 Akim Demaille <akim@epita.fr>
13461
13462 Copy BYacc's nice way to report the grammar.
13463
13464 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
13465 New.
13466 Don't print the rules' location, it is confusing and useless.
13467 (rule_print): Use grammar_rhs_print.
13468 * src/print.c (print_grammar): Use grammar_rules_print.
13469
134702002-06-15 Akim Demaille <akim@epita.fr>
13471
13472 Complete and rationalize `useless thing' warnings.
13473
13474 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
13475 (symbol_tag_print): New.
13476 Use them everywhere in place of accessing directly the tag member.
13477 * src/gram.h, src/gram.c (rule_print): New.
13478 Use it where a rule used to be printed `by hand'.
13479 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
13480 (reduce_grammar_tables): Report the useless rules.
13481 (reduce_print): Useless things are a warning, not an error.
13482 Report it as such.
13483 * tests/reduce.at (Useless Nonterminals, Useless Rules):
13484 (Reduced Automaton, Underivable Rules): Adjust.
13485 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
13486 * tests/conflicts.at (Unresolved SR Conflicts)
13487 (Solved SR Conflicts): Adjust.
13488
134892002-06-15 Akim Demaille <akim@epita.fr>
13490
13491 Let symbols have a location.
13492
13493 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
13494 (getsym): Adjust.
13495 Adjust all callers.
13496 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
13497 Use location_t, not int.
13498 * src/symtab.c (symbol_check_defined): Take advantage of the
13499 location.
13500 * tests/regression.at (Invalid inputs): Adjust.
13501
135022002-06-15 Akim Demaille <akim@epita.fr>
13503
13504 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
13505 (input): Don't try to initialize yylloc here, do it in the
13506 scanner.
13507 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
13508 * src/gram.h (rule_t): Change line and action_line into location
13509 and action_location, of location_t type.
13510 Adjust all dependencies.
13511 * src/location.h, src/location.c (empty_location): New.
13512 * src/reader.h, src/reader.c (grammar_start_symbol_set)
13513 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
13514 (grammar_current_rule_symbol_append)
13515 (grammar_current_rule_action_append): Expect a location as argument.
13516 * src/reader.c (grammar_midrule_action): Adjust to attach an
13517 action's location as dummy symbol location.
13518 * src/symtab.h, src/symtab.c (startsymbol_location): New.
13519 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
13520 the line numbers.
13521
135222002-06-14 Akim Demaille <akim@epita.fr>
13523
13524 Grammar declarations may be found in the grammar section.
13525
13526 * src/parse-gram.y (rules_or_grammar_declaration): New.
13527 (declarations): Each declaration may end with a semicolon, not
13528 just...
13529 (grammar_declaration): `"%union"'.
13530 (grammar): Branch to rules_or_grammar_declaration.
13531
135322002-06-14 Akim Demaille <akim@epita.fr>
13533
13534 * src/main.c (main): Invoke scanner_free.
13535
135362002-06-14 Akim Demaille <akim@epita.fr>
13537
13538 * src/output.c (m4_invoke): Extracted from...
13539 (output_skeleton): here.
13540 Free tempfile.
13541
135422002-06-14 Akim Demaille <akim@epita.fr>
13543
13544 * src/parse-gram.y (directives, directive, gram)
13545 (grammar_directives, precedence_directives, precedence_directive):
13546 Rename as...
13547 (declarations, declaration, grammar, grammar_declaration)
13548 (precedence_declaration, precedence_declarator): these.
13549 (symbol_declaration): New.
13550
135512002-06-14 Akim Demaille <akim@epita.fr>
13552
13553 * src/files.c (action_obstack): Remove, unused.
13554 (output_obstack): Remove it, and all its dependencies, as it is no
13555 longer needed.
13556 * src/reader.c (epilogue_set): Build the epilogue in the
13557 muscle_obstack.
13558 * src/output.h, src/output.c (muscle_obstack): Move to...
13559 * src/muscle_tab.h, src/muscle_tab.h: here.
13560 (muscle_init): Initialize muscle_obstack.
13561 (muscle_free): New.
13562 * src/main.c (main): Call it.
13563
135642002-06-14 Akim Demaille <akim@epita.fr>
13565
13566 * src/location.h: New, extracted from...
13567 * src/reader.h: here.
13568 * src/Makefile.am (noinst_HEADERS): Merge into
13569 (bison_SOURCES): this.
13570 Add location.h.
13571 * src/parse-gram.y: Use location_t instead of Bison's.
13572 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
13573 Use location_t instead of ints.
13574
135752002-06-14 Akim Demaille <akim@epita.fr>
13576
13577 * data/bison.simple, data/bison.c++: Be sure to restore the
13578 current #line when returning to the skeleton contents after having
13579 exposed the input file's #line.
13580
135812002-06-12 Akim Demaille <akim@epita.fr>
13582
13583 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
13584 eager.
13585 * tests/actions.at (Exotic Dollars): New.
13586
135872002-06-12 Akim Demaille <akim@epita.fr>
13588
13589 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
13590 ['"/] too eagerly.
13591 * tests/input.at (Torturing the Scanner): New.
13592
135932002-06-11 Akim Demaille <akim@epita.fr>
13594
13595 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
13596 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
13597 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
13598 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
13599 * src/reader.c (reader): Use it.
13600
136012002-06-11 Akim Demaille <akim@epita.fr>
13602
13603 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
13604 Adjust all callers.
13605 (scanner_last_string_free): New.
13606
136072002-06-11 Akim Demaille <akim@epita.fr>
13608
13609 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
13610 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
13611 (last_string, YY_OBS_FREE): New.
13612 Use them when returning an ID.
13613
136142002-06-11 Akim Demaille <akim@epita.fr>
13615
13616 Have Bison grammars parsed by a Bison grammar.
13617
13618 * src/reader.c, src/reader.h (prologue_augment): New.
13619 * src/reader.c (copy_definition): Remove.
13620
13621 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
13622 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
13623 (grammar_current_rule_prec_set, grammar_current_rule_check)
13624 (grammar_current_rule_symbol_append)
13625 (grammar_current_rule_action_append): Export.
13626 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
13627 (symbol_list_action_append): Remove.
13628 Hook the routines from reader.
13629 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
13630 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
13631
13632 * src/reader.c (read_declarations): Remove, unused.
13633
13634 * src/parse-gram.y: Handle the epilogue.
13635 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
13636 (grammar_start_symbol_set): this.
13637 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
13638 * src/reader.c (readgram): Remove, unused.
13639 (reader): Adjust to insert eoftoken and axiom where appropriate.
13640
13641 * src/reader.c (copy_dollar): Replace with...
13642 * src/scan-gram.h (handle_dollar): this.
13643 * src/parse-gram.y: Remove `%thong'.
13644
13645 * src/reader.c (copy_at): Replace with...
13646 * src/scan-gram.h (handle_at): this.
13647
13648 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
13649 New.
13650
13651 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
13652 time being.
13653
13654 * src/reader.h, src/reader.c (grammar_rule_end): New.
13655
13656 * src/parse.y (current_type, current_class): New.
13657 Implement `%nterm', `%token' support.
13658 Merge `%term' into `%token'.
13659 (string_as_id): New.
13660 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
13661 type name.
13662
13663 * src/parse-gram.y: Be sure to handle properly the beginning of
13664 rules.
13665
13666 * src/parse-gram.y: Handle %type.
13667 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
13668
13669 * src/parse-gram.y: More directives support.
13670 * src/options.c: No longer handle source directives.
13671
13672 * src/parse-gram.y: Fix %output.
13673
13674 * src/parse-gram.y: Handle %union.
13675 Use the prologue locations.
13676 * src/reader.c (parse_union_decl): Remove.
13677
13678 * src/reader.h, src/reader.c (epilogue_set): New.
13679 * src/parse-gram.y: Use it.
13680
13681 * data/bison.simple, data/bison.c++: b4_stype is now either not
13682 defined, then default to int, or to the contents of %union,
13683 without `union' itself.
13684 Adjust.
13685 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
13686
13687 * src/output.c (actions_output): Don't output braces, as they are
13688 already handled by the scanner.
13689
13690 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
13691 characters to themselves.
13692
13693 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
13694 that the epilogue has a proper #line.
13695
13696 * src/parse-gram.y: Handle precedence/associativity.
13697
13698 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
13699 a terminal.
13700 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
13701 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
13702 at all to define terminals that cannot be emitted.
13703
13704 * src/scan-gram.l: Escape M4 characters.
13705
13706 * src/scan-gram.l: Working properly with escapes in user
13707 strings/characters.
13708
13709 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
13710 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
13711 grammar.
13712 Use more modest sizes, as for the time being the parser does not
13713 release memory, and therefore the process swallows a huge amount
13714 of memory.
13715
13716 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
13717 stricter %token grammar.
13718
13719 * src/symtab.h (associativity): Add `undef_assoc'.
13720 (symbol_precedence_set): Do nothing when passed an undef_assoc.
13721 * src/symtab.c (symbol_check_alias_consistence): Adjust.
13722
13723 * tests/regression.at (Invalid %directive): Remove, as it is now
13724 meaningless.
13725 (Invalid inputs): Adjust to the new error messages.
13726 (Token definitions): The new grammar doesn't allow too many
13727 eccentricities.
13728
13729 * src/lex.h, src/lex.c: Remove.
13730 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
13731 (copy_character, copy_string2, copy_string, copy_identifier)
13732 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
13733 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
13734 (parse_action): Remove.
13735 * po/POTFILES.in: Adjust.
13736
137372002-06-11 Akim Demaille <akim@epita.fr>
13738
13739 * src/reader.c (parse_action): Don't store directly into the
13740 rule's action member: return the action as a string.
13741 Don't require `rule_length' as an argument: compute it.
13742 (grammar_current_rule_symbol_append)
13743 (grammar_current_rule_action_append): New, eved out from
13744 (readgram): here.
13745 Remove `action_flag', `rulelength', unused now.
13746
137472002-06-11 Akim Demaille <akim@epita.fr>
13748
13749 * src/reader.c (grammar_current_rule_prec_set).
13750 (grammar_current_rule_check): New, eved out from...
13751 (readgram): here.
13752 Remove `xaction', `first_rhs': useless.
13753 * tests/input.at (Type clashes): New.
13754 * tests/existing.at (GNU Cim Grammar): Adjust.
13755
137562002-06-11 Akim Demaille <akim@epita.fr>
13757
13758 * src/reader.c (grammar_midrule_action): New, Eved out from
13759 (readgram): here.
13760
137612002-06-11 Akim Demaille <akim@epita.fr>
13762
13763 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
13764 New.
13765 (readgram): Use them as replacement of inlined code, crule and
13766 crule1.
13767
137682002-06-11 Akim Demaille <akim@epita.fr>
13769
13770 * src/reader.c (grammar_end, grammar_symbol_append): New.
13771 (readgram): Use them.
13772 Make the use of `p' as local as possible.
13773
137742002-06-10 Akim Demaille <akim@epita.fr>
13775
13776 GCJ's parser requires the tokens to be defined before the prologue.
13777
13778 * data/bison.simple: Output the token definition before the user's
13779 prologue.
13780 * tests/regression.at (Braces parsing, Duplicate string)
13781 (Mixing %token styles): Check the output from bison.
13782 (Early token definitions): New.
13783
137842002-06-10 Akim Demaille <akim@epita.fr>
13785
13786 * src/symtab.c (symbol_user_token_number_set): Don't complain when
13787 assigning twice the same user number to a token, so that we can
13788 use it in...
13789 * src/lex.c (lex): here.
13790 Also use `symbol_class_set' instead of hand written code.
13791 * src/reader.c (parse_assoc_decl): Likewise.
13792
137932002-06-10 Akim Demaille <akim@epita.fr>
13794
13795 * src/symtab.c, src/symtab.c (symbol_class_set)
13796 (symbol_user_token_number_set): New.
13797 * src/reader.c (parse_token_decl): Use them.
13798 Use a switch instead of ifs.
13799 Use a single argument.
13800
138012002-06-10 Akim Demaille <akim@epita.fr>
13802
13803 Remove `%thong' support as it is undocumented, unused, duplicates
13804 `%token's job, and creates useless e-mail traffic with people who
13805 want to know what it is, why it is undocumented, unused, and
13806 duplicates `%token's job.
13807
13808 * src/reader.c (parse_thong_decl): Remove.
13809 * src/options.c (option_table): Remove "thong".
13810 * src/lex.h (tok_thong): Remove.
13811
138122002-06-10 Akim Demaille <akim@epita.fr>
13813
13814 * src/symtab.c, src/symtab.c (symbol_type_set)
13815 (symbol_precedence_set): New.
13816 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
13817 (value_components_used): Remove, unused.
13818
138192002-06-09 Akim Demaille <akim@epita.fr>
13820
13821 Move symbols handling code out of the reader.
13822
13823 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
13824 (axiom): Move to...
13825 * src/symtab.h, src/symtab.c: here.
13826
13827 * src/gram.c (start_symbol): Remove: use startsymbol->number.
13828 * src/reader.c (startval): Rename as...
13829 * src/symtab.h, src/symtab.c (startsymbol): this.
13830 * src/reader.c: Adjust.
13831
13832 * src/reader.c (symbol_check_defined, symbol_make_alias)
13833 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13834 (token_translations_init)
13835 Move to...
13836 * src/symtab.c: here.
13837 * src/reader.c (packsymbols): Move to...
13838 * src/symtab.h, src/symtab.c (symbols_pack): here.
13839 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
13840 argument.
13841
138422002-06-03 Akim Demaille <akim@epita.fr>
13843
13844 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
13845 then statements.
13846
138472002-06-03 Akim Demaille <akim@epita.fr>
13848
13849 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
13850 structs with non literals.
13851 * src/scan-skel.l: never-interactive.
13852 * src/conflicts.c (enum conflict_resolution_e): No trailing
13853 comma.
13854 * src/getargs.c (usage): Split long literal strings.
13855 Reported by Hans Aberg.
13856
138572002-05-28 Akim Demaille <akim@epita.fr>
13858
13859 * data/bison.c++: Use C++ ostreams.
13860 (cdebug_): New member.
13861
138622002-05-28 Akim Demaille <akim@epita.fr>
13863
13864 * src/output.c (output_skeleton): Be sure to allocate enough room
13865 for `/' _and_ for `\0' in full_skeleton.
13866
138672002-05-28 Akim Demaille <akim@epita.fr>
13868
13869 * data/bison.c++: Catch up with bison.simple:
13870 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13871 and Paul Eggert <eggert@twinsun.com>: `error' handing.
13872 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
13873 and popping traces.
13874
138752002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13876
13877 * src/output.c (output_skeleton): Put an explicit path in front of
13878 the skeleton file name, rather than relying on the -I directory,
13879 to partially alleviate effects of having a skeleton file lying around
13880 in the current directory.
13881
138822002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13883
13884 * src/conflicts.c (log_resolution): Correct typo:
13885 obstack_printf should be obstack_fgrow1.
13886
138872002-05-26 Akim Demaille <akim@epita.fr>
13888
13889 * src/state.h (state_t): `solved_conflicts' is a new member.
13890 * src/LR0.c (new_state): Set it to 0.
13891 * src/conflicts.h, src/conflicts.c (print_conflicts)
13892 (free_conflicts, solve_conflicts): Rename as...
13893 (conflicts_print, conflicts_free, conflicts_solve): these.
13894 Adjust callers.
13895 * src/conflicts.c (enum conflict_resolution_e)
13896 (solved_conflicts_obstack): New, used by...
13897 (log_resolution): this.
13898 Adjust to attach the conflict resolution to each state.
13899 Complete the description with the precedence/associativity
13900 information.
13901 (resolve_sr_conflict): Adjust.
13902 * src/print.c (print_state): Output its solved_conflicts.
13903 * tests/conflicts.at (Unresolved SR Conflicts)
13904 (Solved SR Conflicts): Exercise --report=all.
13905
139062002-05-26 Akim Demaille <akim@epita.fr>
13907
13908 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13909 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13910 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
13911 (token_number_t, item_number_as_token_number)
13912 (token_number_as_item_number, muscle_insert_token_number_table):
13913 Rename as...
13914 (symbol_number_t, item_number_as_symbol_number)
13915 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
13916 these, since it is more appropriate.
13917
139182002-05-26 Akim Demaille <akim@epita.fr>
13919
13920 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
13921 `Error:' lines.
13922 * data/bison.simple (yystos) [YYDEBUG]: New.
13923 (yyparse) [YYDEBUG]: Display the symbols which are popped during
13924 error recovery.
13925 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
13926
139272002-05-25 Akim Demaille <akim@epita.fr>
13928
13929 * doc/bison.texinfo (Debugging): Split into...
13930 (Tracing): this new section, its former contents, and...
13931 (Understanding): this new section.
13932 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
13933 by...
13934 (report_flag): this.
13935 Adjust all dependencies.
13936 (report_args, report_types, report_argmatch): New.
13937 (usage, getargs): Report/support -r, --report.
13938 * src/options.h
13939 (struct option_table_struct): Rename as..,
13940 (struct option_table_s): this.
13941 Rename the `set_flag' member to `flag' to match with getopt_long's
13942 struct.
13943 * src/options.c (option_table): Split verbose into an entry for
13944 %verbose, and another for --verbose.
13945 Support --report/-r, so remove -r from the obsolete --raw.
13946 * src/print.c: Attach full item sets and lookaheads reports to
13947 report_flag instead of trace_flag.
13948 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
13949
139502002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13951 and Paul Eggert <eggert@twinsun.com>
13952
13953 * data/bison.simple (yyparse): Correct error handling to conform to
13954 POSIX and yacc. Specifically, after syntax error is discovered,
13955 do not reduce further before shifting the error token.
13956 Clean up the code a bit by removing the labels yyerrdefault,
13957 yyerrhandle, yyerrpop.
13958 * NEWS: Document the above.
13959
139602002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13961
13962 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
13963 type; it isn't always big enough, since it doesn't necessarily
13964 include non-terminals.
13965 (yytranslate): Expand definition of yy_token_number_type, so that
13966 the latter can be removed.
13967 (yy_token_number_type): Remove, only one use.
13968 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
13969 don't use TokenNumberType as element type.
13970
13971 * tests/regression.at: Modify expected output to agree with change
13972 to yyr1 and yytranslate.
13973
139742002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
13975
13976 * src/reader.c (parse_action): Use copy_character instead of
13977 obstack_1grow.
13978
139792002-05-13 Akim Demaille <akim@epita.fr>
13980
13981 * tests/regression.at (Token definitions): Prototype yylex and
13982 yyerror.
13983
139842002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13985
13986 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
13987 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
13988 32-bit arithmetic.
13989 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
13990
139912002-05-07 Akim Demaille <akim@epita.fr>
13992
13993 * tests/synclines.at: Be sure to prototype yylex and yyerror to
13994 avoid GCC warnings.
13995
139962002-05-07 Akim Demaille <akim@epita.fr>
13997
13998 Kill GCC warnings.
13999
14000 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
14001 over the RHS of each rule.
14002 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
14003 * src/state.h (state_t): Member `nitems' is unsigned short.
14004 * src/LR0.c (get_state): Adjust.
14005 * src/reader.c (packgram): Likewise.
14006 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
14007 `Type'.
14008 (muscle_insert_int_table): Remove, unused.
14009 (prepare_rules): Remove `max'.
14010
140112002-05-06 Akim Demaille <akim@epita.fr>
14012
14013 * src/closure.c (print_firsts): Display of the symbol tags.
14014 (bitmatrix_print): Move to...
14015 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
14016 here.
14017 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
14018
140192002-05-06 Akim Demaille <akim@epita.fr>
14020
14021 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
14022 hash_do_for_each.
14023
140242002-05-06 Akim Demaille <akim@epita.fr>
14025
14026 * src/LR0.c (new_state, get_state): Instead of using the global
14027 `kernel_size' and `kernel_base', have two new arguments:
14028 `core_size' and `core'.
14029 Adjust callers.
14030
140312002-05-06 Akim Demaille <akim@epita.fr>
14032
14033 * src/reader.c (packgram): No longer end `ritem' with a 0
14034 sentinel: it is not used.
14035
140362002-05-05 Akim Demaille <akim@epita.fr>
14037
14038 New experimental feature: display the lookaheads in the report and
14039 graph.
14040
14041 * src/print (print_core): When --trace-flag, display the rules
14042 lookaheads.
14043 * src/print_graph.c (print_core): Likewise.
14044 Swap the arguments.
14045 Adjust caller.
14046
140472002-05-05 Akim Demaille <akim@epita.fr>
14048
14049 * tests/torture.at (Many lookaheads): New test.
14050
140512002-05-05 Akim Demaille <akim@epita.fr>
14052
14053 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
14054 (GENERATE_MUSCLE_INSERT_TABLE): this.
14055 (output_int_table, output_unsigned_int_table, output_short_table)
14056 (output_token_number_table, output_item_number_table): Replace with...
14057 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
14058 (muscle_insert_short_table, muscle_insert_token_number_table)
14059 (muscle_insert_item_number_table): these.
14060 Adjust all callers.
14061 (prepare_tokens): Don't free `translations', since...
14062 * src/reader.h, src/reader.c (grammar_free): do it.
14063 Move to...
14064 * src/gram.h, src/gram.c (grammar_free): here.
14065 * data/bison.simple, data/bison.c++: b4_token_number_max is now
14066 b4_translate_max.
14067
140682002-05-05 Akim Demaille <akim@epita.fr>
14069
14070 * src/output.c (output_unsigned_int_table): New.
14071 (prepare_rules): `i' is unsigned.
14072 `prhs', `rline', `r2' are unsigned int.
14073 Rename muscle `rhs_number_max' as `rhs_max'.
14074 Output muscles `prhs_max', `rline_max', and `r2_max'.
14075 Free rline and r1.
14076 * data/bison.simple, data/bison.c++: Adjust to use these muscles
14077 to compute types instead of constant types.
14078 * tests/regression.at (Web2c Actions): Adjust.
14079
140802002-05-04 Akim Demaille <akim@epita.fr>
14081
14082 * src/symtab.h (SALIAS, SUNDEF): Rename as...
14083 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
14084 Adjust dependencies.
14085 * src/output.c (token_definitions_output): Be sure not to output a
14086 `#define 'a'' when fed with `%token 'a' "a"'.
14087 * tests/regression.at (Token definitions): New.
14088
140892002-05-03 Paul Eggert <eggert@twinsun.com>
14090
14091 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
14092 for K&R C.
14093
140942002-05-03 gettextize <bug-gnu-gettext@gnu.org>
14095
14096 * Makefile.am (SUBDIRS): Remove intl.
14097 (EXTRA_DIST): Add config/config.rpath.
14098
140992002-05-03 Akim Demaille <akim@epita.fr>
14100
14101 * data/bison.simple (m4_if): Don't output empty enums.
14102 And actually, output valid enum definitions :(.
14103
141042002-05-03 Akim Demaille <akim@epita.fr>
14105
14106 * configure.bat: Remove, completely obsolete.
14107 * Makefile.am (EXTRA_DIST): Adjust.
14108 Don't distribute config.rpath...
14109 * config/Makefile.am (EXTRA_DIST): Do it.
14110
141112002-05-03 Akim Demaille <akim@epita.fr>
14112
14113 * configure.in (GETTEXT_VERSION): New.
14114 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
14115
141162002-05-03 Akim Demaille <akim@epita.fr>
14117
14118 * data/bison.simple (b4_token_enum): New.
14119 (b4_token_defines): Use it to output tokens both as #define and
14120 enums.
14121 Suggested by Paul Eggert.
14122 * src/output.c (token_definitions_output): Don't output spurious
14123 white spaces.
14124
141252002-05-03 Akim Demaille <akim@epita.fr>
14126
14127 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14128
141292002-05-02 Robert Anisko <robert@lrde.epita.fr>
14130
14131 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
14132 Update the stack class, give a try to deque as the default container.
14133
141342002-05-02 Akim Demaille <akim@epita.fr>
14135
14136 * data/bison.simple (yyparse): Do not implement @$ = @1.
14137 (YYLLOC_DEFAULT): Adjust to do it.
14138 * doc/bison.texinfo (Location Default Action): Fix.
14139
141402002-05-02 Akim Demaille <akim@epita.fr>
14141
14142 * src/reader.c (parse_braces): Merge into...
14143 (parse_action): this.
14144
141452002-05-02 Akim Demaille <akim@epita.fr>
14146
14147 * configure.in (ALL_LINGUAS): Remove.
14148 * po/LINGUAS, hr.po: New.
14149
141502002-05-02 Akim Demaille <akim@epita.fr>
14151
14152 Remove the so called hairy (semantic) parsers.
14153
14154 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
14155 * src/gram.h, src/gram.c (semantic_parser): Remove.
14156 (rule_t): Remove the guard and guard_line members.
14157 * src/lex.h (token_t): remove tok_guard.
14158 * src/options.c (option_table): Remove %guard and %semantic_parser
14159 support.
14160 * src/output.c, src/output.h (guards_output): Remove.
14161 (prepare): Adjust.
14162 (token_definitions_output): Don't output the `T'
14163 tokens (???).
14164 (output_skeleton): Don't output the guards.
14165 * src/files.c, src/files.c (attrsfile): Remove.
14166 * src/reader.c (symbol_list): Remove the guard and guard_line
14167 members.
14168 Adjust dependencies.
14169 (parse_guard): Remove.
14170 * data/bison.hairy: Remove.
14171 * doc/bison.texinfo (Environment Variables): Remove occurrences of
14172 BISON_HAIRY.
14173
141742002-05-02 Akim Demaille <akim@epita.fr>
14175
14176 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
14177 (parse_guard): Rename the formal argument `stack_offset' as
14178 `rule_length', which is more readable.
14179 Adjust callers.
14180 (copy_at, copy_dollar): Instead of outputting the hard coded
14181 values of $$, $n and so forth, output invocation to b4_lhs_value,
14182 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
14183 Note: this patch partially drops `semantic-parser' support: it
14184 always does `rule_length - n', where semantic parsers ought to
14185 always use `-n'.
14186 * data/bison.simple, data/bison.c++ (b4_lhs_value)
14187 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
14188
141892002-05-02 Akim Demaille <akim@epita.fr>
14190
14191 * configure.in (AC_INIT): Bump to 1.49b.
14192 (AM_INIT_AUTOMAKE): Short invocation.
14193
141942002-05-02 Akim Demaille <akim@epita.fr>
14195
14196 Version 1.49a.
14197
141982002-05-01 Akim Demaille <akim@epita.fr>
14199
14200 * src/skeleton.h: Remove.
14201
142022002-05-01 Akim Demaille <akim@epita.fr>
14203
14204 * src/skeleton.h: Fix the #endif.
14205 Reported by Magnus Fromreide.
14206
142072002-04-26 Paul Eggert <eggert@twinsun.com>
14208
14209 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
14210 Define if we define YYSTYPE and YYLTYPE, respectively.
14211 (YYCOPY): Fix [] quoting problem in the non-GCC case.
14212
142132002-04-25 Robert Anisko <robert@lrde.epita.fr>
14214
14215 * src/scan-skel.l: Postprocess quadrigraphs.
14216
14217 * src/reader.c (copy_character): New function, used to output
14218 single characters while replacing `[' and `]' with quadrigraphs, to
14219 avoid troubles with M4 quotes.
14220 (copy_comment): Output characters with copy_character.
14221 (read_additionnal_code): Likewise.
14222 (copy_string2): Likewise.
14223 (copy_definition): Likewise.
14224
14225 * tests/calc.at: Exercise M4 quoting.
14226
142272002-04-25 Akim Demaille <akim@epita.fr>
14228
14229 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
14230 between `!' and the command.
14231 Reported by Paul Eggert.
14232
142332002-04-24 Robert Anisko <robert@lrde.epita.fr>
14234
14235 * tests/calc.at: Exercise prologue splitting.
14236
14237 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
14238 `b4_post_prologue' instead of `b4_prologue'.
14239
14240 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
14241 muscles.
14242 (output): Free pre_prologue_obstack and post_prologue_obstack.
14243 * src/files.h, src/files.c (attrs_obstack): Remove.
14244 (pre_prologue_obstack, post_prologue_obstack): New.
14245 * src/reader.c (copy_definition): Add a parameter to specify the
14246 obstack to fill, instead of using attrs_obstack unconditionally.
14247 (read_declarations): Pass pre_prologue_obstack to copy_definition if
14248 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
14249
142502002-04-23 Paul Eggert <eggert@twinsun.com>
14251
14252 * data/bison.simple: Remove unnecessary commentary and white
14253 space differences from 1_29-branch.
14254 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
14255
14256 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
14257 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
14258 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
14259 constructors or destructors.
14260
14261 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
14262
142632002-04-23 Akim Demaille <akim@epita.fr>
14264
14265 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
14266 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
14267 location with columns.
14268 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
14269 All reported by Paul Eggert.
14270
142712002-04-22 Akim Demaille <akim@epita.fr>
14272
14273 * src/reduce.c (dump_grammar): Move to...
14274 * src/gram.h, src/gram.c (grammar_dump): here.
14275 Be sure to separate long item numbers.
14276 Don't read the members of a rule's prec if its nil.
14277
142782002-04-22 Akim Demaille <akim@epita.fr>
14279
14280 * src/output.c (table_size, table_grow): New.
14281 (MAXTABLE): Remove, replace uses with table_size.
14282 (pack_vector): Instead of dying when the table is too big, grow it.
14283
142842002-04-22 Akim Demaille <akim@epita.fr>
14285
14286 * data/bison.simple (yyr1): Its type is that of a token number.
14287 * data/bison.c++ (r1_): Likewise.
14288 * tests/regression.at (Web2c Actions): Adjust.
14289
142902002-04-22 Akim Demaille <akim@epita.fr>
14291
14292 * src/reader.c (token_translations_init): 256 is now the default
14293 value for the error token, i.e., it will be assigned another
14294 number if the user assigned 256 to one of her tokens.
14295 (reader): Don't force 256 to error.
14296 * doc/bison.texinfo (Symbols): Adjust.
14297 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
14298 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
14299 etc. instead of 10, 20, 30 (which was used to `jump' over error
14300 (256) and undefined (2)).
14301
143022002-04-22 Akim Demaille <akim@epita.fr>
14303
14304 Propagate more token_number_t.
14305
14306 * src/gram.h (token_number_as_item_number)
14307 (item_number_as_token_number): New.
14308 * src/output.c (GENERATE_OUTPUT_TABLE): New.
14309 Use it to create output_item_number_table and
14310 output_token_number_table.
14311 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14312 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
14313 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
14314 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
14315
143162002-04-22 Akim Demaille <akim@epita.fr>
14317
14318 * src/output.h, src/output.c (get_lines_number): Remove.
14319
143202002-04-19 Akim Demaille <akim@epita.fr>
14321
14322 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
14323 as Lex/Flex'.
14324 (Debugging): More details about enabling the debugging features.
14325 (Table of Symbols): Describe $$, $n, @$, and @n.
14326 Suggested by Tim Josling.
14327
143282002-04-19 Akim Demaille <akim@epita.fr>
14329
14330 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
14331
143322002-04-10 Akim Demaille <akim@epita.fr>
14333
14334 * src/system.h: Rely on HAVE_LIMITS_H.
14335 Suggested by Paul Eggert.
14336
143372002-04-09 Akim Demaille <akim@epita.fr>
14338
14339 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
14340 full stderr, and strip it according to the bison options, instead
14341 of composing the error message from different bits.
14342 This makes it easier to check for several error messages.
14343 Adjust all the invocations.
14344 Add an invocation exercising the error token.
14345 Add an invocation demonstrating a stupid error message.
14346 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
14347 Adjust the tests.
14348 Error message are for stderr, not stdout.
14349
143502002-04-09 Akim Demaille <akim@epita.fr>
14351
14352 * src/gram.h, src/gram.c (error_token_number): Remove, use
14353 errtoken->number.
14354 * src/reader.c (reader): Don't specify the user token number (2)
14355 for $undefined, as it uselessly prevents using it.
14356 * src/gram.h (token_number_t): Move to...
14357 * src/symtab.h: here.
14358 (state_t.number): Is a token_number_t.
14359 * src/print.c, src/reader.c: Use undeftoken->number instead of
14360 hard coded 2.
14361 (Even though this 2 is not the same as above: the number of the
14362 undeftoken remains being 2, it is its user token number which
14363 might not be 2).
14364 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
14365 `user_token_number_max'.
14366 Output `undef_token_number'.
14367 * data/bison.simple, data/bison.c++: Use them.
14368 Be sure to map invalid yylex return values to
14369 `undef_token_number'. This saves us from gratuitous SEGV.
14370
14371 * tests/conflicts.at (Solved SR Conflicts)
14372 (Unresolved SR Conflicts): Adjust.
14373 * tests/regression.at (Web2c Actions): Adjust.
14374
143752002-04-08 Akim Demaille <akim@epita.fr>
14376
14377 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
14378 Adding #line.
14379 Remove the duplicate `typedefs'.
14380 (RhsNumberType): Fix the declaration and various other typos.
14381 Use __ofile__.
14382 * data/bison.simple: Use __ofile__.
14383 * src/scan-skel.l: Handle __ofile__.
14384
143852002-04-08 Akim Demaille <akim@epita.fr>
14386
14387 * src/gram.h (item_number_t): New, the type of item numbers in
14388 RITEM. Note that it must be able to code symbol numbers as
14389 positive number, and the negation of rule numbers as negative
14390 numbers.
14391 Adjust all dependencies (pretty many).
14392 * src/reduce.c (rule): Remove this `short *' pointer: use
14393 item_number_t.
14394 * src/system.h (MINSHORT, MAXSHORT): Remove.
14395 Include `limits.h'.
14396 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
14397 (shortcpy): Remove.
14398 (MAXTABLE): Move to...
14399 * src/output.c (MAXTABLE): here.
14400 (prepare_rules): Use output_int_table to output rhs.
14401 * data/bison.simple, data/bison.c++: Adjust.
14402 * tests/torture.at (Big triangle): Move the limit from 254 to
14403 500.
14404 * tests/regression.at (Web2c Actions): Ajust.
14405
14406 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
14407 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
14408 passes, but produces negative #line number, once fixed, GCC is
14409 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
14410 C), it passes.
14411 * src/state.h (state_h): Code input lines on ints, not shorts.
14412
144132002-04-08 Akim Demaille <akim@epita.fr>
14414
14415 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
14416 and then the grammar.
14417
144182002-04-08 Akim Demaille <akim@epita.fr>
14419
14420 * src/system.h: No longer using strndup.
14421
144222002-04-07 Akim Demaille <akim@epita.fr>
14423
14424 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
14425 * src/output.c (output_table_data): Return the longest number.
14426 (prepare_tokens): Output `token_number_max').
14427 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
14428 New.
14429 Use them to define yy_token_number_type/TokenNumberType.
14430 Use this type for yytranslate.
14431 * tests/torture.at (Big triangle): Push the limit from 124 to
14432 253.
14433 * tests/regression.at (Web2c Actions): Adjust.
14434
144352002-04-07 Akim Demaille <akim@epita.fr>
14436
14437 * tests/torture.at (Big triangle): New.
14438 (GNU AWK Grammar, GNU Cim Grammar): Move to...
14439 * tests/existing.at: here.
14440
144412002-04-07 Akim Demaille <akim@epita.fr>
14442
14443 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
14444 nritems.
14445 Adjust dependencies.
14446
144472002-04-07 Akim Demaille <akim@epita.fr>
14448
14449 * src/reader.c: Normalize increments to prefix form.
14450
144512002-04-07 Akim Demaille <akim@epita.fr>
14452
14453 * src/reader.c, symtab.c: Remove debugging code.
14454
144552002-04-07 Akim Demaille <akim@epita.fr>
14456
14457 Rename all the `bucket's as `symbol_t'.
14458
14459 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
14460 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
14461 * src/symtab.c, src/symtab.h (bucket): Rename as...
14462 (symbol_t): this.
14463 (symbol_list_new, bucket_check_defined, bucket_make_alias)
14464 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
14465 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14466 (buckets_new, buckets_free, buckets_do): Rename as...
14467 (symbol_list_new, symbol_check_defined, symbol_make_alias)
14468 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
14469 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
14470 (symbols_new, symbols_free, symbols_do): these.
14471
144722002-04-07 Akim Demaille <akim@epita.fr>
14473
14474 Use lib/hash for the symbol table.
14475
14476 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
14477 EOF.
14478 * src/lex.c (lex): Set the `number' member of new terminals.
14479 * src/reader.c (bucket_check_defined, bucket_make_alias)
14480 (bucket_check_alias_consistence, bucket_translation): New.
14481 (reader, grammar_free, readgram, token_translations_init)
14482 (packsymbols): Adjust.
14483 (reader): Number the predefined tokens.
14484 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
14485 for predefined tokens.
14486 * src/symtab.h (bucket): Remove all the hash table related
14487 members.
14488 * src/symtab.c (symtab): Replace by...
14489 (bucket_table): this.
14490 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14491 (buckets_new, buckets_do): New.
14492
144932002-04-07 Akim Demaille <akim@epita.fr>
14494
14495 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
14496 (start_symbol, max_user_token_number, semantic_parser)
14497 (error_token_number): Initialize.
14498 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
14499 Initialize.
14500 (reader): Don't.
14501 (errtoken, eoftoken, undeftoken, axiom): Extern.
14502
145032002-04-07 Akim Demaille <akim@epita.fr>
14504
14505 * src/gram.h (rule_s): prec and precsym are now pointers
14506 to the bucket giving the priority/associativity.
14507 Member `associativity' removed: useless.
14508 * src/reduce.c, src/conflicts.c: Adjust.
14509
145102002-04-07 Akim Demaille <akim@epita.fr>
14511
14512 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
14513 Properly escape the symbols' TAG when outputting them.
14514
145152002-04-07 Akim Demaille <akim@epita.fr>
14516
14517 * src/lalr.h (LA): Is a bitsetv, not bitset*.
14518
145192002-04-07 Akim Demaille <akim@epita.fr>
14520
14521 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
14522 (LArule): this, which is an array to rule_t*.
14523 * src/print.c, src/conflicts.c: Adjust.
14524
145252002-04-07 Akim Demaille <akim@epita.fr>
14526
14527 * src/gram.h (rule_t): Rename `number' as `user_number'.
14528 `number' is a new member.
14529 Adjust dependencies.
14530 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
14531
145322002-04-07 Akim Demaille <akim@epita.fr>
14533
14534 As a result of the previous patch, it is no longer needed
14535 to reorder ritem itself.
14536
14537 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
14538
145392002-04-07 Akim Demaille <akim@epita.fr>
14540
14541 Be sure never to walk through RITEMS, but use only data related to
14542 the rules themselves. RITEMS should be banished.
14543
14544 * src/output.c (output_token_translations): Rename as...
14545 (prepare_tokens): this.
14546 In addition to `translate', prepare the muscles `tname' and
14547 `toknum', which were handled by...
14548 (output_rule_data): this.
14549 Remove, and move the remainder of its outputs into...
14550 (prepare_rules): this new routines, which also merges content from
14551 (output_gram): this.
14552 (prepare_rules): Be sure never to walk through RITEMS.
14553 (output_stos): Rename as...
14554 (prepare_stos): this.
14555 (output): Always invoke prepare_states, after all, just don't use it
14556 in the output if you don't need it.
14557
145582002-04-07 Akim Demaille <akim@epita.fr>
14559
14560 * src/LR0.c (new_state): Display `nstates' as the name of the
14561 newly created state.
14562 Adjust to initialize first_state and last_state if needed.
14563 Be sure to distinguish the initial from the final state.
14564 (new_states): Create the itemset of the initial state, and use
14565 new_state.
14566 * src/closure.c (closure): Now that the initial state has its
14567 items properly set, there is no need for a special case when
14568 creating `ruleset'.
14569
14570 As a result, now the rule 0, reducing to $axiom, is visible in the
14571 outputs. Adjust the test suite.
14572
14573 * tests/conflicts.at (Solved SR Conflicts)
14574 (Unresolved SR Conflicts): Adjust.
14575 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
14576 * tests/conflicts.at (S/R in initial): New.
14577
145782002-04-07 Akim Demaille <akim@epita.fr>
14579
14580 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
14581 the RHS of the rules.
14582 * src/output.c (output_gram): Likewise.
14583
145842002-04-07 Akim Demaille <akim@epita.fr>
14585
14586 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
14587 bucket.
14588 Adjust all dependencies.
14589 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
14590 `number' of the buckets too.
14591 * src/gram.h: Include `symtab.h'.
14592 (associativity): Move to...
14593 * src/symtab.h: here.
14594 No longer include `gram.h'.
14595
145962002-04-07 Akim Demaille <akim@epita.fr>
14597
14598 * src/gram.h, src/gram.c (rules_rhs_length): New.
14599 (ritem_longest_rhs): Use it.
14600 * src/gram.h (rule_t): `number' is a new member.
14601 * src/reader.c (packgram): Set it.
14602 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
14603 the end of `rules', and count them out of `nrules'.
14604 (reduce_output, dump_grammar): Adjust.
14605 * src/print.c (print_grammar): It is no longer needed to check for
14606 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
14607 * tests/reduce.at (Reduced Automaton): New test.
14608
146092002-04-07 Akim Demaille <akim@epita.fr>
14610
14611 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
14612 lacking `+ 1' to nrules, Bison reported as useless a token if it
14613 was used solely to set the precedence of the last rule...
14614
146152002-04-07 Akim Demaille <akim@epita.fr>
14616
14617 * data/bison.c++, data/bison.simple: Don't output the current file
14618 name in #line, to avoid useless diffs between two identical
14619 outputs under different names.
14620
146212002-04-07 Akim Demaille <akim@epita.fr>
14622
14623 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
14624 Normalize loops to using `< nrules + 1', not `<= nrules'.
14625
146262002-04-07 Akim Demaille <akim@epita.fr>
14627
14628 * TODO: Update.
14629
146302002-04-07 Akim Demaille <akim@epita.fr>
14631
14632 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
14633 bucket.value as bucket.number.
14634
146352002-04-07 Akim Demaille <akim@epita.fr>
14636
14637 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
14638 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14639 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
14640 RHS, instead of being an index in RITEMS.
14641
146422002-04-04 Paul Eggert <eggert@twinsun.com>
14643
14644 * doc/bison.texinfo: Update copyright date.
14645 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
14646 (Symbols): Warn about running Bison in one character set,
14647 but compiling and/or running in an incompatible one.
14648 Warn about character code 256, too.
14649
146502002-04-03 Paul Eggert <eggert@twinsun.com>
14651
14652 * src/bison.data (YYSTACK_ALLOC): Depend on whether
14653 YYERROR_VERBOSE is nonzero, not whether it is defined.
14654
14655 Merge changes from bison-1_29-branch.
14656
146572002-03-20 Paul Eggert <eggert@twinsun.com>
14658
14659 Merge fixes from Debian bison_1.34-1.diff.
14660
14661 * configure.in (AC_PREREQ): 2.53.
14662
146632002-03-20 Akim Demaille <akim@epita.fr>
14664
14665 * src/conflicts.c (log_resolution): Argument `resolution' is const.
14666
146672002-03-19 Paul Eggert <eggert@twinsun.com>
14668
14669 * src/bison.simple (YYCOPY): New macro.
14670 (YYSTACK_RELOCATE): Use it.
14671 Remove Type arg; no longer needed. All callers changed.
14672 (yymemcpy): Remove; no longer needed.
14673
14674 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
14675 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14676
146772002-03-19 Akim Demaille <akim@epita.fr>
14678
14679 Test and fix the #line outputs.
14680
14681 * tests/atlocal.at (GCC): New.
14682 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
14683 (Prologue synch line, %union synch line, Postprologue synch line)
14684 (Action synch line, Epilogue synch line): New tests.
14685 * src/reader.c (parse_union_decl): Define the muscle stype_line.
14686 * data/bison.simple, data/bison.c++: Use it.
14687
146882002-03-19 Akim Demaille <akim@epita.fr>
14689
14690 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
14691 (Solved SR Conflicts, %expect not enough, %expect right)
14692 (%expect too much): Move to...
14693 * tests/conflicts.at: this new file.
14694
146952002-03-19 Akim Demaille <akim@epita.fr>
14696
14697 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14698 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
14699 that we can move to enums for instance.
14700 * src/output.c (token_definitions_output): Output a list of
14701 `token-name, token-number' instead of the #define.
14702 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
14703
147042002-03-14 Akim Demaille <akim@epita.fr>
14705
14706 Use Gettext 0.11.1.
14707
147082002-03-09 Robert Anisko <robert@lrde.epita.fr>
14709
14710 * data/bison.c++: Make the user able to add members to the generated
14711 parser by subclassing.
14712
147132002-03-05 Robert Anisko <robert@lrde.epita.fr>
14714
14715 * src/reader.c (read_additionnal_code): `c' should be an integer, not
14716 a character.
14717 Reported by Nicolas Tisserand and Nicolas Burrus.
14718
147192002-03-04 Robert Anisko <robert@lrde.epita.fr>
14720
14721 * src/reader.c: Warn about lacking semi-colons, do not complain.
14722
147232002-03-04 Robert Anisko <robert@lrde.epita.fr>
14724
14725 * data/bison.c++: Remove a debug line.
14726
147272002-03-04 Robert Anisko <robert@lrde.epita.fr>
14728
14729 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
14730 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
14731 provide a default implementation.
14732
147332002-03-04 Akim Demaille <akim@epita.fr>
14734
14735 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
14736 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
14737 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
14738 * tests/semantic.at (Parsing Guards): Similarly.
14739 * src/reader.at (readgram): Complain if the last rule is not ended
14740 with a semi-colon.
14741
147422002-03-04 Akim Demaille <akim@epita.fr>
14743
14744 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
14745 * src/closure.c: here.
14746 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
14747 RTC.
14748 * src/warshall.h, src/warshall.c: Remove.
14749 * tests/sets.at (Broken Closure): Adjust.
14750
147512002-03-04 Akim Demaille <akim@epita.fr>
14752
14753 * src/output.c (output_skeleton): tempdir is const.
14754 bytes_read is unused.
14755
147562002-03-04 Akim Demaille <akim@epita.fr>
14757
14758 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14759 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
14760 Update.
14761 From Michael Hayes.
14762
147632002-03-04 Akim Demaille <akim@epita.fr>
14764
14765 * src/closure.c (closure): `r' is unused.
14766
147672002-03-04 Akim Demaille <akim@epita.fr>
14768
14769 * tests/sets.at (Broken Closure): Add the ending `;'.
14770 * src/reader.at (readgram): Complain if a rule is not ended with a
14771 semi-colon.
14772
147732002-03-04 Akim Demaille <akim@epita.fr>
14774
14775 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
14776 (count_sr_conflicts): Use bitset_count.
14777 * src/reduce.c (inaccessable_symbols): Ditto.
14778 (bits_size): Remove.
14779 * src/warshall.h, src/warshall.c: Convert to bitsetv.
14780
147812002-03-04 Akim Demaille <akim@epita.fr>
14782
14783 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
14784 * src/reduce.c: Remove the `bitset_zero's following the
14785 `bitset_create's, as now it is performed by the latter.
14786
147872002-03-04 Akim Demaille <akim@epita.fr>
14788
14789 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
14790 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
14791 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
14792 latest sources from Michael.
14793
147942002-03-04 Akim Demaille <akim@epita.fr>
14795
14796 * src/output.c (output): Don't free the grammar.
14797 * src/reader.c (grammar_free): New.
14798 * src/main.c (main): Call it and don't free symtab here.
14799
148002002-03-04 Akim Demaille <akim@epita.fr>
14801
14802 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
14803 before returning.
14804 Reported by Benoit Perrot.
14805
148062002-03-04 Akim Demaille <akim@epita.fr>
14807
14808 Use bitset operations when possible, not loops over bits.
14809
14810 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
14811 bitset_or.
14812 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
14813 * src/reduce.c (useless_nonterminals): Formatting changes.
14814 * src/warshall.c (TC): Use bitset_or.
14815
148162002-03-04 Akim Demaille <akim@epita.fr>
14817
14818 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
14819 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
14820 Ditto.
14821
148222002-03-04 Akim Demaille <akim@epita.fr>
14823
14824 * src/lalr.c (F): Now a bitset*.
14825 Adjust all dependencies.
14826
148272002-03-04 Akim Demaille <akim@epita.fr>
14828
14829 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
14830 Adjust all dependencies.
14831
148322002-03-04 Akim Demaille <akim@epita.fr>
14833
14834 * src/L0.c, src/LR0.h (nstates): Be size_t.
14835 Adjust comparisons (signed vs unsigned).
14836 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
14837 bitset*.
14838 Adjust all dependencies.
14839
148402002-03-04 Akim Demaille <akim@epita.fr>
14841
14842 * src/closure.c (firsts): Now, also a bitset.
14843 Adjust all dependencies.
14844 (varsetsize): Remove, now unused.
14845 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
14846
148472002-03-04 Akim Demaille <akim@epita.fr>
14848
14849 * src/print.c: Convert to use bitset.h, not hand coded iterations
14850 over ints.
14851
148522002-03-04 Akim Demaille <akim@epita.fr>
14853
14854 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
14855
148562002-03-04 Akim Demaille <akim@epita.fr>
14857
14858 * src/closure.c (ruleset): Be a bitset.
14859 (rulesetsize): Remove.
14860
148612002-03-04 Akim Demaille <akim@epita.fr>
14862
14863 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14864 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
14865 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
14866 * src/closure.c (fderives): Be an array of bitsets.
14867
148682002-02-28 Robert Anisko <robert@lrde.epita.fr>
14869
14870 * data/bison.c++: Merge the two generated headers. Insert a copyright
14871 notice in each output file.
14872
148732002-02-28 Akim Demaille <akim@epita.fr>
14874
14875 * data/bison.c++: Copy the prologue of bison.simple to fetch
14876 useful M4 definitions, such as b4_header_guard.
14877
148782002-02-25 Akim Demaille <akim@epita.fr>
14879
14880 * src/getargs.c (version): Give the name of the authors, and use a
14881 translator friendly scheme for the bgr
14882 copyright notice.
14883
148842002-02-25 Akim Demaille <akim@epita.fr>
14885
14886 * src/output.c (header_output): Remove, now handled completely via
14887 M4.
14888
148892002-02-25 Akim Demaille <akim@epita.fr>
14890
14891 * m4/m4.m4: New, from CVS Autoconf.
14892 * configure.in: Invoke it.
14893 * src/output.c (output_skeleton): Use its result instead of the
14894 hard coded name.
14895
148962002-02-25 Akim Demaille <akim@epita.fr>
14897
14898 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
14899 Fileutils 4.1.5.
14900 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
14901 * src/output.c (output_skeleton): Use mkstemp to create a real
14902 temporary file.
14903 Move the filling of `skeleton' and its muscle to...
14904 (prepare): here.
14905 (output): Move the definition of the prologue muscle to...
14906 (prepare): here.
14907 * src/system.h (DEFAULT_TMPDIR): New.
14908
149092002-02-14 Paul Eggert <eggert@twinsun.com>
14910
14911 Remove the support for C++ namespace cleanliness; it was
14912 causing more problems than it was curing, since it didn't work
14913 properly on some nonstandard C++ compilers. This can wait
14914 for a proper C++ parser.
14915
14916 * NEWS: Document this.
14917 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
14918 of C++, as it's treated like C now.
14919 * src/bison.simple (YYSTD): Remove.
14920 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
14921 Treat C++ just like Standard C instead of trying to support
14922 namespace cleanliness.
14923
149242002-02-14 Akim Demaille <akim@epita.fr>
14925
14926 * tests/regression.at (else): Adjust to Andreas' change.
14927
149282002-02-14 Akim Demaille <akim@epita.fr>
14929
14930 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
14931
149322002-02-13 Andreas Schwab <schwab@suse.de>
14933
14934 * src/output.c (output_rule_data): Don't output NULL, it might
14935 not be defined yet.
14936
149372002-02-11 Robert Anisko <robert@lrde.epita.fr>
14938
14939 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
14940 (Copyright notice): Update.
14941
149422002-02-11 Akim Demaille <akim@epita.fr>
14943
14944 * tests/regression.at (%nonassoc and eof): Don't include
14945 nonportable headers.
14946
149472002-02-08 Robert Anisko <robert@lrde.epita.fr>
14948
14949 * data/bison.c++: Correct error recovery. Make the user able to
14950 initialize the starting location.
14951
149522002-02-07 Akim Demaille <akim@epita.fr>
14953
14954 * tests/input.at: New.
14955
149562002-02-07 Robert Anisko <robert@lrde.epita.fr>
14957
14958 * data/bison.c++: Replace some direct m4 expansions by constants. Be
14959 more consistent when naming methods and variables. Put preprocessor
14960 directives around tables only needed for debugging.
14961
149622002-02-07 Robert Anisko <robert@lrde.epita.fr>
14963
14964 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
14965 C++ parsers.
14966 (yy::b4_name::parse): Use print_.
14967
149682002-02-07 Robert Anisko <robert@lrde.epita.fr>
14969
14970 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
14971
149722002-02-07 Robert Anisko <robert@lrde.epita.fr>
14973
14974 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
14975 C++ parsers.
14976 (yy::b4_name::parse): Build verbose error messages, and use error_.
14977
149782002-02-06 Robert Anisko <robert@lrde.epita.fr>
14979
14980 * data/bison.c++: Fix m4 quoting in comments.
14981
149822002-02-06 Robert Anisko <robert@lrde.epita.fr>
14983
14984 * data/bison.c++: Adjust the parser code. Fix some muscles that were
14985 not expanded by m4.
14986
149872002-02-05 Akim Demaille <akim@epita.fr>
14988
14989 * data/bison.c++: Adjust to the M4 back end.
14990 More is certainly needed.
14991
149922002-02-05 Akim Demaille <akim@epita.fr>
14993
14994 Give a try to M4 as a back end.
14995
14996 * lib/readpipe.c: New, from wdiff.
14997 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
14998 BISON_HAIRY.
14999 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
15000 specific values. Now it is m4 that performs the lookup.
15001 * src/parse-skel.y: Remove.
15002 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
15003 * src/output.c (actions_output, guards_output)
15004 (token_definitions_output): No longer keeps track of the output
15005 line number, hence remove the second argument.
15006 (guards_output): Check against the guard member of a rule, not the
15007 action member.
15008 Adjust callers.
15009 (output_skeleton): Don't look for the skeleton location, let m4 do
15010 that.
15011 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
15012 file will be used.
15013 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
15014 (prepare): Given that for the time being changesyntax is not
15015 usable in M4, rename the muscles using `-' to `_'.
15016 Define `defines_flag', `output_parser_name' and `output_header_name'.
15017 * src/output.h (actions_output, guards_output)
15018 (token_definitions_output): Adjust prototypes.
15019 * src/scan-skel.l: Instead of scanning the skeletons, it now
15020 processes the output of m4: `__oline__' and `#output'.
15021 * data/bison.simple: Adjust to be used by M4(sugar).
15022 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
15023 to date.
15024 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
15025 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
15026 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
15027 shamelessly stolen from CVS Autoconf.
15028
150292002-02-05 Akim Demaille <akim@epita.fr>
15030
15031 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
15032 * configure.in: Check for the declarations of free and malloc.
15033 * src/muscle_tab.c: Adjust.
15034
150352002-02-05 Akim Demaille <akim@epita.fr>
15036
15037 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
15038 which have no values.
15039
150402002-02-05 Akim Demaille <akim@epita.fr>
15041
15042 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
15043 * data/: here.
15044
150452002-01-29 Paul Eggert <eggert@twinsun.com>
15046
15047 * src/bison.simple (YYSIZE_T): Do not define merely because
15048 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
15049 On some platforms, <alloca.h> does not declare YYSTD (size_t).
15050
150512002-01-27 Akim Demaille <akim@epita.fr>
15052
15053 Fix `%nonassoc and eof'.
15054
15055 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
15056 which were not properly copied! Replace
15057 memcpy (res->errs, src->errs, src->nerrs);
15058 with
15059 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
15060 !!!
15061 * tests/regression.at (%nonassoc and eof): Adjust to newest
15062 Autotest: `.' is not in the PATH.
15063
150642002-01-27 Akim Demaille <akim@epita.fr>
15065
15066 * tests/sets.at (AT_EXTRACT_SETS): New.
15067 (Nullable): Use it.
15068 (Firsts): New.
15069
150702002-01-26 Akim Demaille <akim@epita.fr>
15071
15072 * tests/actions.at, tests/calc.at, tests/headers.at,
15073 * tests/torture.at: Adjust to the newest Autotest which no longer
15074 forces `.' in the PATH.
15075
150762002-01-25 Akim Demaille <akim@epita.fr>
15077
15078 * tests/regression.at (%nonassoc and eof): New.
15079 Suggested by Robert Anisko.
15080
150812002-01-24 Akim Demaille <akim@epita.fr>
15082
15083 Bison dumps core when trying to complain about broken input files.
15084 Reported by Cris van Pelt.
15085
15086 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
15087 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
15088 into...
15089 (Invalid inputs): Strengthen: exercise parse_percent_token.
15090
150912002-01-24 Robert Anisko <robert.anisko@epita.fr>
15092
15093 * src/Makefile.am: Add bison.c++.
15094 * src/bison.c++: New skeleton.
15095
150962002-01-21 Paolo Bonzini <bonzini@gnu.org>
15097
15098 * po/it.po: New.
15099
151002002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
15101
15102 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
15103
151042002-01-20 Marc Autret <marc@gnu.org>
15105
15106 * src/files.c (compute_output_file_names): Fix
15107
151082002-01-20 Marc Autret <marc@gnu.org>
15109
15110 * tests/output.at: New test.
15111 * src/files.c (compute_base_names): Don't map extensions when
15112 the YACC flag is set, use defaults.
15113 Reported by Evgeny Stambulchik.
15114
151152002-01-20 Marc Autret <marc@gnu.org>
15116
15117 * src/system.h: Need to define __attribute__ away for non-GCC
15118 compilers as well (i.e., the vendor C compiler).
15119 Suggested by Albert Chin-A-Young.
15120
151212002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
15122
15123 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
15124 canonical definition.
15125 * src/system.h: Use the canonical definition for PARAMS (avoids
15126 a conflict with the macro from lib/hash.h).
15127
151282002-01-11 Akim Demaille <akim@epita.fr>
15129
15130 * configure.in: Use AC_FUNC_STRNLEN.
15131 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
15132
151332002-01-09 Akim Demaille <akim@epita.fr>
15134
15135 * src/files.c, src/files.h (output_infix): New.
15136 (tab_extension): Remove.
15137 (compute_base_names): Compute the former, drop the latter.
15138 * src/output.c (prepare): Insert the muscles `output-infix', and
15139 `output-suffix'.
15140 * src/parse-skel.y (string, string.1): New.
15141 (section.header): Use it.
15142 (section.yacc): Remove.
15143 (prefix): Remove too.
15144 * src/scan-skel.l: Adjust.
15145 * src/bison.simple, src/bison.hairy: Adjust.
15146
151472002-01-09 Akim Demaille <akim@epita.fr>
15148
15149 * configure.in (WERROR_CFLAGS): Compute it.
15150 * src/Makefile.am (CFLAGS): Pass it.
15151 * tests/atlocal.in (CFLAGS): Idem.
15152 * src/files.c: Fix a few warnings.
15153 (get_extension_index): Remove, unused.
15154
151552002-01-08 Akim Demaille <akim@epita.fr>
15156
15157 * src/getargs.c (AS_FILE_NAME): New.
15158 (getargs): Use it to convert DOSish file names.
15159 * src/files.c (base_name): Rename as full_base_name to avoid
15160 clashes with `base_name ()'.
15161 (filename_split): New.
15162 (compute_base_names): N-th rewrite, using filename_split.
15163
151642002-01-08 Akim Demaille <akim@epita.fr>
15165
15166 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
15167 New, stolen from the Fileutils 4.1.
15168 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
15169 * configure.in: Check for the presence of memrchr, and of its
15170 prototype.
15171
151722002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
15173
15174 * lib/hash.h (__P): Added definition for this macro.
15175 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
15176 BUILT_SOURCES, to ensure they are generated first.
15177 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
15178 %error-verbose to allow bootstrapping with bison 1.30x.
15179
151802002-01-06 Akim Demaille <akim@epita.fr>
15181
15182 * src/reader.c (parse_braces): Don't fetch the next char, the
15183 convention is to fetch on entry.
15184 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
15185 'switch' without a following semicolon.
15186 * tests/regression.at (braces parsing): New.
15187
151882002-01-06 Akim Demaille <akim@epita.fr>
15189
15190 Bison is dead wrong in its RR conflict reports.
15191
15192 * tests/torture.at (GNU Cim Grammar): New.
15193 * src/conflicts.c (count_rr_conflicts): Fix.
15194
151952002-01-06 Akim Demaille <akim@epita.fr>
15196
15197 Creating package.m4 from configure.ac causes too many problems.
15198
15199 * tests/Makefile.am (package.m4): Create it by hand,
15200 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
15201
152022002-01-06 Akim Demaille <akim@epita.fr>
15203
15204 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
15205 skeleton.h.
15206
152072002-01-04 Paul Eggert <eggert@twinsun.com>
15208
15209 * doc/bison.texinfo (Debugging):
15210 Remove YYSTDERR; it's no longer defined or used.
15211 Also, s/cstdio.h/cstdio/.
15212
152132002-01-03 Akim Demaille <akim@epita.fr>
15214
15215 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
15216
152172002-01-03 Akim Demaille <akim@epita.fr>
15218
15219 * src/parse-skel.y (process_skeleton): Don't bind the parser's
15220 tracing code to --trace, wait for a better --trace option, with
15221 args.
15222
152232002-01-03 Akim Demaille <akim@epita.fr>
15224
15225 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
15226 The ISO C++ standard is extremely clear about it: stderr is
15227 considered a macro, not a regular symbol (see table 94 `Header
15228 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
15229 Therefore std:: does not apply to it. It still does with fprintf.
15230 Also, s/cstdio.h/cstdio/.
15231
152322002-01-03 Akim Demaille <akim@epita.fr>
15233
15234 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
15235 for non system headers.
15236
152372002-01-02 Akim Demaille <akim@epita.fr>
15238
15239 Equip the skeleton chain with location tracking, runtime trace,
15240 pure parser and scanner.
15241
15242 * src/parse-skel.y: Request a pure parser, locations, and prefix
15243 renaming.
15244 (%union): Having several members with the same type does not help
15245 type mismatches, simplify.
15246 (YYPRINT, yyprint): New.
15247 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
15248 (skel_error): this.
15249 Handle locations.
15250 * src/scan-skel.l: Adjust to these changes.
15251 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
15252 (LOCATION_PRINT, skel_control_t): New.
15253
152542001-12-30 Akim Demaille <akim@epita.fr>
15255
15256 * src/parse-skel.y: Get rid of the shift/reduce conflict:
15257 replace `gb' with BLANKS.
15258 * src/scan-skel.l: Adjust.
15259
152602001-12-30 Akim Demaille <akim@epita.fr>
15261
15262 * src/system.h: We don't need nor want bcopy.
15263 Throw away MS-DOS crap: we don't need getpid.
15264 * configure.in: We don't need strndup. It was even causing
15265 problems: because Flex includes the headers *before* us,
15266 _GNU_SOURCE is not defined by config.h, and therefore strndup was
15267 not visible.
15268 * lib/xstrndup.c: New.
15269 * src/scan-skel.l: Use it.
15270 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
15271 * src/parse-skel.y: Use %directives instead of #defines.
15272
152732001-12-30 Akim Demaille <akim@epita.fr>
15274
15275 * src/skeleton.h: New.
15276 * src/output.c (output_parser, output_master_parser): Remove, dead
15277 code.
15278 * src/output.h (get_lines_number, actions_output, guards_output)
15279 (token_definitions_output): Prototype them.
15280 * src/parse-skel.y: Add the license notice.
15281 Include output.h and skeleton.h.
15282 (process_skeleton): Returns void, and takes a single parameter.
15283 * src/scan-skel.l: Add the license notice.
15284 Include skeleton.h.
15285 Don't use %option yylineno: it seems that then Flex imagines
15286 REJECT has been used, and therefore it won't reallocate its
15287 buffers (which makes no other sense to me than a bug). It results
15288 in warnings for `unused: yy_flex_realloc'.
15289
152902001-12-30 Robert Anisko <robert.anisko@epita.fr>
15291
15292 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15293 (MUSCLE_INSERT_PREFIX): ...to there.
15294 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15295 (MUSCLE_INSERT_PREFIX): Move from here...
15296
15297 * src/bison.hairy: Add a section directive. Put braces around muscle
15298 names. This parser skeleton is still broken, but Bison should not
15299 choke on a bad muscle 'syntax'.
15300 * src/bison.simple: Add a section directive. Put braces around muscle
15301 names.
15302
15303 * src/files.h (strsuffix, stringappend): Add declarations.
15304 (tab_extension): Add declaration.
15305 (short_base_name): Add declaration.
15306
15307 * src/files.c (strsuffix, stringappend): No longer static. These
15308 functions are used in the skeleton parser.
15309 (tab_extension): New.
15310 (compute_base_names): Use the computations done in this function
15311 to guess if the generated parsers should have '.tab' in their
15312 names.
15313 (short_base_name): No longer static.
15314
15315 * src/output.c (output_skeleton): New.
15316 (output): Disable call to output_master_parser, and give a try to
15317 a new skeleton handling system.
15318 (guards_output, actions_output): No longer static.
15319 (token_definitions_output, get_lines_number): No longer static.
15320
15321 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
15322
15323 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
15324 parse-skel.y.
15325
15326 * src/parse-skel.y: New file.
15327 * src/scan-skel.l: New file.
15328
153292001-12-29 Akim Demaille <akim@epita.fr>
15330
15331 %name-prefix is broken.
15332
15333 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
15334 Adjust all dependencies.
15335 * tests/headers.at (export YYLTYPE): Strengthen this test: use
15336 %name-prefix.
15337
15338 Renaming yylval but not yylloc is not consistent. Now we do.
15339
15340 * src/bison.simple: Prefix yylloc if used.
15341 * doc/bison.texinfo (Decl Summary): Document that.
15342
153432001-12-29 Akim Demaille <akim@epita.fr>
15344
15345 * doc/bison.texinfo: Promote `%long-directive' over
15346 `%long_directive'.
15347 Remove all references to fixed-output-files, yacc is enough.
15348
153492001-12-29 Akim Demaille <akim@epita.fr>
15350
15351 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
15352 user prologue. These are defaults.
15353 * tests/actions.at (Mid-rule actions): Make sure the user can
15354 define YYDEBUG and YYERROR_VERBOSE.
15355
153562001-12-29 Akim Demaille <akim@epita.fr>
15357
15358 * src/output.c (header_output): Don't forget to export YYLTYPE and
15359 yylloc.
15360 * tests/headers.at (export YYLTYPE): New, make sure it does.
15361 * tests/regression.at (%union and --defines, Invalid CPP headers):
15362 Move to...
15363 * tests/headers.at: here.
15364
153652001-12-29 Akim Demaille <akim@epita.fr>
15366
15367 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
15368
153692001-12-29 Akim Demaille <akim@epita.fr>
15370
15371 * tests/actions.at (Mid-rule actions): Output on a single line
15372 instead of several.
15373
153742001-12-29 Akim Demaille <akim@epita.fr>
15375
15376 * doc/bison.texinfo: Formatting changes.
15377
153782001-12-29 Akim Demaille <akim@epita.fr>
15379
15380 Don't store the token defs in a muscle, just be ready to output it
15381 on command. Now possible via `symbols'. Fixes a memory leak.
15382
15383 * src/output.c (token_definitions_output): New.
15384 (output_parser, header_output): Use it.
15385 * src/reader.c (symbols_save): Remove.
15386
153872001-12-29 Akim Demaille <akim@epita.fr>
15388
15389 * src/bison.simple: Do not provide a default for YYSTYPE and
15390 YYLTYPE before the user's prologue. Otherwise it's hardly... a
15391 default.
15392
153932001-12-29 Akim Demaille <akim@epita.fr>
15394
15395 Mid-rule actions are simply... ignored!
15396
15397 * src/reader.c (readgram): Be sure to attach mid-rule actions to
15398 the empty-rule associated to the dummy symbol, not to the host
15399 rule.
15400 * tests/actions.at (Mid-rule actions): New.
15401
154022001-12-29 Akim Demaille <akim@epita.fr>
15403
15404 Memory leak.
15405
15406 * src/reader.c (reader): Free grammar.
15407
154082001-12-29 Akim Demaille <akim@epita.fr>
15409
15410 Memory leak.
15411
15412 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
15413 since it allocates it for each state, although only one is needed.
15414 (allocate_storage): Do it here.
15415
154162001-12-29 Akim Demaille <akim@epita.fr>
15417
15418 * src/options.h, src/options.c (create_long_option_table): Rename
15419 as...
15420 (long_option_table_new): this, with a clearer prototype.
15421 (percent_table): Remove, unused,
15422 * src/getargs.c (getargs): Adjust.
15423
154242001-12-29 Akim Demaille <akim@epita.fr>
15425
15426 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
15427 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
15428 as states.
15429
154302001-12-29 Akim Demaille <akim@epita.fr>
15431
15432 * src/lalr.c (build_relations): Rename `states' as `states1'.
15433 Sorry, I don't understand exactly what it is, no better name...
15434
154352001-12-29 Akim Demaille <akim@epita.fr>
15436
15437 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
15438 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
15439 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
15440 as rules.
15441
154422001-12-29 Akim Demaille <akim@epita.fr>
15443
15444 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
15445 ago.
15446
154472001-12-29 Akim Demaille <akim@epita.fr>
15448
15449 * src/reader.c, src/reader.h (user_toknums): Remove.
15450 Adjust all users to use symbols[i]->user_token_number.
15451
154522001-12-29 Akim Demaille <akim@epita.fr>
15453
15454 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
15455 Adjust all users to use symbols[i]->prec or ->assoc.
15456
154572001-12-29 Akim Demaille <akim@epita.fr>
15458
15459 * src/reader.c, src/reader.h (tags): Remove.
15460 Adjust all users to use symbols[i]->tag.
15461
154622001-12-29 Akim Demaille <akim@epita.fr>
15463
15464 * src/gram.h, src/gram.c (symbols): New, similar to state_table
15465 and rule_table.
15466 * src/reader.c (packsymbols): Fill this table.
15467 Drop sprec.
15468 * src/conflicts.c (resolve_sr_conflict): Adjust.
15469 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
15470 single table.
15471 Use symbols[i]->tag instead of tags[i].
15472
154732001-12-29 Akim Demaille <akim@epita.fr>
15474
15475 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
15476 In addition, put a comment in there, to replace...
15477 * tests/regression.at (%union and C comments): Remove.
15478
154792001-12-29 Akim Demaille <akim@epita.fr>
15480
15481 * tests/regression.at (Web2c Actions): Blindly move the actual
15482 output as expected output. The contents *seem* right to me, but I
15483 can't pretend reading perfectly parser tables... Nonetheless, all
15484 the other tests pass correctly, the table look OK, even though the
15485 presence of `$axiom' is to be noted: AFAICS it is useless (but
15486 harmless).
15487
154882001-12-29 Akim Demaille <akim@epita.fr>
15489
15490 * src/reader.c (readgram): Don't add the rule 0 if there were no
15491 rules read. In other words, add it _after_ having performed
15492 grammar sanity checks.
15493 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
15494
154952001-12-29 Akim Demaille <akim@epita.fr>
15496
15497 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
15498 visible, and some states have now a different number.
15499
155002001-12-29 Akim Demaille <akim@epita.fr>
15501
15502 * src/reader.c (readgram): Bind the initial rule's lineno to that
15503 of the first rule.
15504 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
15505 (Solved SR Conflicts): Adjust rule 0's line number.
15506
155072001-12-29 Akim Demaille <akim@epita.fr>
15508
15509 Fix the `GAWK Grammar' failure.
15510
15511 * src/LR0.c (final_state): Initialize to -1 so that we do compute
15512 the reductions of the first state which was mistakenly confused
15513 with the final state because precisely final_state was initialized
15514 to 0.
15515 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
15516 now noticed by Bison.
15517 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
15518 have a reduction on $default.
15519
155202001-12-29 Akim Demaille <akim@epita.fr>
15521
15522 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
15523 rule line numbers.
15524 * src/closure.c (print_closure): Likewise.
15525 * src/derives.c (print_derives): Likewise.
15526 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
15527 now.
15528
155292001-12-29 Akim Demaille <akim@epita.fr>
15530
15531 * src/lalr.c (lookaheads_print): New.
15532 (lalr): Call it when --trace-flag.
15533 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
15534 are dumped.
15535
155362001-12-29 Akim Demaille <akim@epita.fr>
15537
15538 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
15539 when walking through ritem, even via rule->rhs.
15540 * src/reduce.c (dump_grammar, useful_production, reduce_output)
15541 (useful_production, useless_nonterminals): Likewise.
15542 (reduce_grammar_tables): Likewise, plus update nritems.
15543 * src/nullable.c (set_nullable): Likewise.
15544 * src/lalr.c (build_relations): Likewise.
15545 * tests/sets.at (Nullable): Adjust.
15546 Fortunately, now, the $axiom is no longer nullable.
15547
155482001-12-29 Akim Demaille <akim@epita.fr>
15549
15550 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
15551 the 0-sentinel.
15552 * src/gram.c (ritem_longest_rhs): Likewise.
15553 * src/reduce.c (nonterminals_reduce): Likewise.
15554 * src/print_graph.c (print_graph): Likewise.
15555 * src/output.c (output_rule_data): Likewise.
15556 * src/nullable.c (set_nullable): Likewise.
15557
155582001-12-29 Akim Demaille <akim@epita.fr>
15559
15560 * src/output.c: Comment changes.
15561
155622001-12-27 Paul Eggert <eggert@twinsun.com>
15563
15564 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
15565 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
15566 Sparc, as they were causing more porting problems than the
15567 (minor) performance improvement was worth.
15568
15569 Also, catch up with 1.31's YYSTD.
15570
155712001-12-27 Akim Demaille <akim@epita.fr>
15572
15573 * src/output.c (output_gram): Rely on nritems, not the
15574 0-sentinel. See below.
15575 Use -1 as separator, not 0.
15576 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
15577 Rely on -1 as separator in yyrhs, instead of 0.
15578 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
15579 twice `Now at end of input', therefore there are two lines less to
15580 expect.
15581
155822001-12-27 Akim Demaille <akim@epita.fr>
15583
15584 * tests/regression.at (Unresolved SR Conflicts):
15585 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
15586 below.
15587
155882001-12-27 Akim Demaille <akim@epita.fr>
15589
15590 * src/LR0.c (new_state): Recognize the final state by the fact it
15591 is reached by eoftoken.
15592 (insert_start_shifting_state, insert_eof_shifting_state)
15593 (insert_accepting_state, augment_automaton): Remove, since now
15594 these states are automatically computed from the initial state.
15595 (generate_states): Adjust.
15596 * src/print.c: When reporting a rule number to the user, substract
15597 1, so that the axiom rule is rule 0, and the first user rule is 1.
15598 * src/reduce.c: Likewise.
15599 * src/print_graph.c (print_core): For the time being, just as for
15600 the report, depend upon --trace-flags to dump the full set of
15601 items.
15602 * src/reader.c (readgram): Once the grammar read, insert the rule
15603 0: `$axiom: START-SYMBOL $'.
15604 * tests/set.at: Adjust: rule 0 is now displayed, and since the
15605 number of the states has changed (the final state is no longer
15606 necessarily the last), catch up.
15607
156082001-12-27 Akim Demaille <akim@epita.fr>
15609
15610 Try to make the use of the eoftoken valid. Given that its value
15611 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
15612 is used instead of > 0 where appropriate, (ii), depend upon nritems
15613 instead of the 0-sentinel.
15614
15615 * src/gram.h, src/gram.c (nritems): New.
15616 Expected to be duplication of nitems, but for the time being...
15617 * src/reader.c (packgram): Assert nritems and nitems are equal.
15618 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
15619 * src/closure.c (print_closure, print_fderives): Likewise.
15620 * src/gram.c (ritem_print): Likewise.
15621 * src/print.c (print_core, print_grammar): Likewise.
15622 * src/print_graph.c: Likewise.
15623
156242001-12-27 Akim Demaille <akim@epita.fr>
15625
15626 * src/main.c (main): If there are complains after grammar
15627 reductions, then output the report anyway if requested, then die.
15628 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
15629 * src/reader.c (eoftoken): New.
15630 (parse_token_decl): If the token being defined has value `0', it
15631 is the eoftoken.
15632 (packsymbols): No longer hack `tags' to insert `$' by hand.
15633 Be sure to preserve the value of the eoftoken.
15634 (reader): Make sure eoftoken is defined.
15635 Initialize nsyms to 0: now eoftoken is created just like the others.
15636 * src/print.c (print_grammar): Don't special case the eof token.
15637 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
15638 lie anyway, albeit pleasant.
15639 * tests/calc.at: Exercise error messages with eoftoken.
15640 Change the grammar so that empty input is invalid.
15641 Adjust expectations.
15642 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
15643
156442001-12-27 Akim Demaille <akim@epita.fr>
15645
15646 * configure.in: Check the protos of strchr ans strspn.
15647 Replace strchr if needed.
15648 * src/system.h: Provide the protos of strchr, strspn and memchr if
15649 missing.
15650 * lib/strchr.c: New.
15651 * src/reader.c (symbols_save): Use strchr.
15652
156532001-12-27 Akim Demaille <akim@epita.fr>
15654
15655 * src/print.c, src/print_graph.c (escape): New.
15656 Use it to quote the TAGS outputs.
15657 * src/print_graph.c (print_state): Now errors are in red, and
15658 reductions in green.
15659 Prefer high to wide: output the state number on a line of its own.
15660
156612001-12-27 Akim Demaille <akim@epita.fr>
15662
15663 * src/state.h, src/state.c (reductions_new): New.
15664 * src/LR0.c (set_state_table): Let all the states have a
15665 `reductions', even if reduced to 0.
15666 (save_reductions): Adjust.
15667 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
15668 * src/print.c (print_reductions, print_actions): Adjust.
15669 * src/output.c (action_row): Adjust.
15670
156712001-12-27 Akim Demaille <akim@epita.fr>
15672
15673 * src/state.h, src/state.c (errs_new, errs_dup): New.
15674 * src/LR0.c (set_state_table): Let all the states have an errs,
15675 even if reduced to 0.
15676 * src/print.c (print_errs, print_reductions): Adjust.
15677 * src/output.c (output_actions, action_row): Adjust.
15678 * src/conflicts.c (resolve_sr_conflict): Adjust.
15679
156802001-12-27 Akim Demaille <akim@epita.fr>
15681
15682 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
15683
156842001-12-27 Akim Demaille <akim@epita.fr>
15685
15686 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
15687 * src/print.c: here.
15688 (lookaheadset, shiftset): New, used as additional storage by
15689 print_reductions.
15690 (print_results): Adjust.
15691 (print_shifts, print_gotos, print_errs): New, extracted from...
15692 (print_actions): here.
15693 * src/print_graph.c (print_actions): Remove dead code.
15694
156952001-12-27 Akim Demaille <akim@epita.fr>
15696
15697 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
15698 `$n' and `@n'.
15699
157002001-12-27 Akim Demaille <akim@epita.fr>
15701
15702 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
15703 (build_relations): Adjust.
15704
157052001-12-27 Akim Demaille <akim@epita.fr>
15706
15707 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
15708 duplication.
15709
157102001-12-27 Akim Demaille <akim@epita.fr>
15711
15712 * src/reader.c (packgram): Catch nitems overflows.
15713
157142001-12-27 Akim Demaille <akim@epita.fr>
15715
15716 * src/files.c, src/files.h (guard_obstack): Remove.
15717 * src/output.c (output): Adjust.
15718 * src/reader.c (parse_braces): New, factoring...
15719 (copy_action, copy_guard): these two which are renamed as...
15720 (parse_action, parse_guard): these.
15721 As a voluntary consequence, using braces around guards is now
15722 mandatory.
15723
157242001-12-27 Akim Demaille <akim@epita.fr>
15725
15726 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
15727 * src/reader.c (symbol_list): `guard' and `guard_line' are new
15728 members.
15729 (symbol_list_new): Adjust.
15730 (copy_action): action_line is the first line, not the last.
15731 (copy_guard): Just as for actions, store the `action' only, not
15732 the switch/case/break flesh.
15733 Don't parse the user action that might follow the guard, let...
15734 (readgram): do it, i.e., now, there can be an action after a
15735 guard.
15736 In other words the guard is just explicitly optional.
15737 (packgram): Adjust.
15738 * src/output.c (guards_output): New.
15739 (output_parser): Call it when needed.
15740 (output): Also free the guard and attrs obstacks.
15741 * src/files.c, src/files.h (obstack_save): Remove.
15742 (output_files): Remove.
15743 As a result, if one needs the former `.act' file, using an
15744 appropriate skeleton which requires actions and guards is now
15745 required.
15746 * src/main.c (main): Adjust.
15747 * tests/semantic.at: New.
15748 * tests/regression.at: Use `input.y' as input file name.
15749 Avoid 8+3 problems by requiring input.c when the test needs the
15750 parser.
15751
157522001-12-27 Akim Demaille <akim@epita.fr>
15753
15754 * src/reader.c (symbol_list_new): Be sure to initialize all the
15755 fields.
15756
157572001-12-27 Akim Demaille <akim@epita.fr>
15758
15759 All the hacks using a final pseudo state are now useless.
15760
15761 * src/LR0.c (set_state_table): state_table holds exactly nstates.
15762 * src/lalr.c (nLA): New.
15763 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
15764 instead of lookaheadsp from the pseudo state (nstate + 1).
15765
157662001-12-27 Akim Demaille <akim@epita.fr>
15767
15768 * src/output.c (action_row, token_actions): Use a state_t instead
15769 of a integer, and nlookaheads instead of the following state's
15770 lookaheadsp.
15771
157722001-12-27 Akim Demaille <akim@epita.fr>
15773
15774 * src/conflicts.c (log_resolution, flush_shift)
15775 (resolve_sr_conflict, set_conflicts, solve_conflicts)
15776 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
15777 (conflicts_print, print_reductions): Use a state_t instead of an
15778 integer when referring to a state.
15779 As much as possible, depend upon nlookaheads, instead of the
15780 `lookaheadsp' member of the following state (since lookaheads of
15781 successive states are successive, the difference between state n + 1
15782 and n served as the number of lookaheads for state n).
15783 * src/lalr.c (add_lookback_edge): Likewise.
15784 * src/print.c (print_core, print_actions, print_state)
15785 (print_results): Likewise.
15786 * src/print_graph.c (print_core, print_actions, print_state)
15787 (print_graph): Likewise.
15788 * src/conflicts.h: Adjust.
15789
157902001-12-27 Akim Demaille <akim@epita.fr>
15791
15792 * src/bison.hairy: Formatting/comment changes.
15793 ANSIfy.
15794 Remove `register' indications.
15795 Add plenty of `static'.
15796
157972001-12-27 Akim Demaille <akim@epita.fr>
15798
15799 * src/output.c (prepare): Drop the muscle `ntbase' which
15800 duplicates ntokens.
15801 * src/bison.simple: Formatting/comment changes.
15802 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
15803 is an undocumented synonym.
15804
158052001-12-22 Akim Demaille <akim@epita.fr>
15806
15807 * src/output.c (output_table_data): Change the prototype to use
15808 `int' for array ranges: some invocations do pass an int, not a
15809 short.
15810 Reported by Wayne Green.
15811
158122001-12-22 Akim Demaille <akim@epita.fr>
15813
15814 Some actions of web2c.y are improperly triggered.
15815 Reported by Mike Castle.
15816
15817 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
15818 * tests/regression.at (Web2c): Rename as...
15819 (Web2c Report): this.
15820 (Web2c Actions): New.
15821
158222001-12-22 Akim Demaille <akim@epita.fr>
15823
15824 Reductions in web2c.y are improperly reported.
15825 Reported by Mike Castle.
15826
15827 * src/conflicts.c (print_reductions): Fix.
15828 * tests/regression.at (Web2c): New.
15829
158302001-12-18 Akim Demaille <akim@epita.fr>
15831
15832 Some host fail on `assert (!"foo")', which expands to
15833 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
15834 Reported by Nelson Beebee.
15835
15836 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
15837 `#define it_succeeded 0' and `assert (it_succeeded)'.
15838
158392001-12-17 Marc Autret <autret_m@epita.fr>
15840
15841 * src/bison.simple: Don't hard code the skeleton line and filename.
15842 * src/output.c (output_parser): Rename 'line' as 'output_line'.
15843 New line counter 'skeleton_line' (skeleton-line muscle).
15844
158452001-12-17 Paul Eggert <eggert@twinsun.com>
15846
15847 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
15848 YYDEBUG must be defined to a nonzero value.
15849
15850 * src/bison.simple (yytname): Do not assume that the user defines
15851 YYDEBUG to a properly parenthesized expression.
15852
158532001-12-17 Akim Demaille <akim@epita.fr>
15854
15855 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
15856 nlookaheads is a new member.
15857 Adjust all users.
15858 * src/lalr.h (nlookaheads): Remove this orphan declaration.
15859 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
15860 state.
15861
158622001-12-17 Akim Demaille <akim@epita.fr>
15863
15864 * src/files.h, src/files.c (open_files, close_files): Remove.
15865 * src/main.c (main): Don't open/close files, nor invoke lex_free,
15866 let...
15867 * src/reader.c (reader): Do it.
15868
158692001-12-17 Akim Demaille <akim@epita.fr>
15870
15871 * src/conflicts.c (print_reductions): Formatting changes.
15872
158732001-12-17 Akim Demaille <akim@epita.fr>
15874
15875 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
15876 (flush_reduce): New.
15877 (resolve_sr_conflict): Adjust.
15878
158792001-12-17 Akim Demaille <akim@epita.fr>
15880
15881 * src/output.c (output_obstack): Be static and rename as...
15882 (format_obstack): this, to avoid any confusion with files.c's
15883 output_obstack.
15884 * src/reader.h (muscle_obstack): Move to...
15885 * src/output.h: here, since it's defined in output.c.
15886
158872001-12-17 Akim Demaille <akim@epita.fr>
15888
15889 * src/output.c (action_row, save_column, default_goto)
15890 (sort_actions, matching_state, pack_vector): Better variable
15891 locality.
15892
158932001-12-17 Akim Demaille <akim@epita.fr>
15894
15895 * src/output.c: Various formatting changes.
15896
158972001-12-17 Akim Demaille <akim@epita.fr>
15898
15899 * src/files.c (output_files): Free the output_obstack.
15900 * src/main.c (main): Call print and print_graph conditionally.
15901 * src/print.c (print): Work unconditionally.
15902 * src/print_graph.c (print_graph): Work unconditionally.
15903 * src/conflicts.c (log_resolution): Output only if verbose_flag.
15904
159052001-12-16 Marc Autret <autret_m@epita.fr>
15906
15907 * src/output.c (actions_output): Fix. When we use %no-lines,
15908 there is one less line per action.
15909
159102001-12-16 Marc Autret <autret_m@epita.fr>
15911
15912 * src/bison.simple: Remove a useless #line directive.
15913 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
15914 * src/output.c (get_lines_number): New.
15915 (output_parser): Adjust, now takes care about the lines of a
15916 output muscles.
15917 Fix line numbering.
15918 (actions_output): Computes the number of lines taken by actions.
15919 (output_master_parser): Insert new skeleton which is the name of
15920 the output parser file name.
15921
159222001-12-15 Marc Autret <autret_m@epita.fr>
15923
15924 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
15925
159262001-12-15 Marc Autret <autret_m@epita.fr>
15927
15928 * src/output.c (output_gram): Keep track of the hairy one.
15929
159302001-12-15 Akim Demaille <akim@epita.fr>
15931
15932 Make `make distcheck' work.
15933
15934 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
15935 system.h which uses libgettext.h.
15936
159372001-12-15 Akim Demaille <akim@epita.fr>
15938
15939 * src/nullable.c (set_nullable): Useless rules must be skipped,
15940 otherwise, since we range over their symbols, we might look at a
15941 nonterminal which no longer ``exists'', i.e., it is not counted in
15942 `nvars', hence we overflow our arrays.
15943
159442001-12-15 Akim Demaille <akim@epita.fr>
15945
15946 The header can also be produced directly, without any obstack!
15947 Yahoo!
15948
15949 * src/files.c, src/files.h (defines_obstack): Remove.
15950 (compute_header_macro): Global.
15951 (defines_obstack_save): Remove.
15952 * src/reader.c (parse_union_decl): No longer output to
15953 defines_obstack: its content can be found in the `stype' muscle
15954 anyway.
15955 (output_token_translations): Merge into...
15956 (symbols_output): this.
15957 Rename as...
15958 (symbols_save): this.
15959 (reader): Adjust.
15960 * src/output.c (header_output): New.
15961 (output): Call it.
15962
159632001-12-15 Akim Demaille <akim@epita.fr>
15964
15965 * src/reader.c (parse_union_decl): Instead of handling two obstack
15966 simultaneously, use one to define the `stype' muscle, and use the
15967 value of the latter to fill defines_obstack.
15968 (copy_comment): Remove.
15969 (copy_comment2): Work for a single obstack.
15970 Rename as...
15971 (copy_comment): this.
15972
159732001-12-15 Akim Demaille <akim@epita.fr>
15974
15975 * src/lex.c, src/lex.h (xgetc): No longer static.
15976 * src/reader.c (parse_union_decl): Revamp.
15977
159782001-12-15 Akim Demaille <akim@epita.fr>
15979
15980 Still making progress in separating Bison into (i) input, (ii)
15981 process, (iii) output: now we can directly output the parser file
15982 without using table_obstack at all.
15983
15984 * src/files.c, src/files.h (table_obstack): Bye bye.
15985 (parser_file_name): New.
15986 * src/files.c (compute_output_file_names): Compute it.
15987 * src/output.c (actions_output, output_parser)
15988 (output_master_parser): To a file instead of an obstack.
15989
159902001-12-15 Akim Demaille <akim@epita.fr>
15991
15992 Attach actions to rules, instead of pre-outputting them to
15993 actions_obstack.
15994
15995 * src/gram.h (rule_t): action and action_line are new members.
15996 * src/reader.c (symbol_list): Likewise.
15997 (copy_action): Save the actions within the rule.
15998 (packgram): Save them in rule_table.
15999 * src/output.c (actions_output): New.
16000 (output_parser): Use it on `%%actions'.
16001 (output_rule_data): Don't free rule_table.
16002 (output): Do it.
16003 (prepare): Don't save the `action' muscle.
16004 * src/bison.simple: s/%%action/%%actions/.
16005
160062001-12-15 Akim Demaille <akim@epita.fr>
16007
16008 * src/reader.c (copy_action): When --yacc, don't append a `;'
16009 to the user action: let it fail if lacking.
16010 Suggested by Arnold Robbins and Tom Tromey.
16011
160122001-12-14 Akim Demaille <akim@epita.fr>
16013
16014 * src/lex.c (literalchar): Simply return the char you decoded, non
16015 longer mess around with obstacks and int pointers.
16016 Adjust all callers.
16017
160182001-12-14 Akim Demaille <akim@epita.fr>
16019
16020 * src/lex.c (literalchar): Don't escape the special characters,
16021 just decode them, and keep them as char (before, eol was output as
16022 the 2 char string `\n' etc.).
16023 * src/output.c (output_rule_data): Use quotearg to output the
16024 token strings.
16025
160262001-12-13 Paul Eggert <eggert@twinsun.com>
16027
16028 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
16029 Do not infringe on the global user namespace when using C++.
16030 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
16031 All uses of `fprintf' and `stderr' changed.
16032
16033 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
16034
160352001-12-13 Akim Demaille <akim@epita.fr>
16036
16037 The computation of nullable is broken: it doesn't handle empty
16038 RHS's properly.
16039
16040 * tests/torture.at (GNU AWK Grammar): New.
16041 * tests/sets.at (Nullable): New.
16042 * src/nullable.c (set_nullable): Instead of blindly looping over
16043 `ritems', loop over the rules, and then over their rhs's.
16044
16045 Work around Autotest bugs.
16046
16047 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
16048 frame, because Autotest understand lines starting with a `+' as
16049 traces from the shell. Then, they are not processed properly.
16050 Admittedly an Autotest bug, but we don't have time to wait for
16051 Autotest to catch up.
16052 * tests/regression.at (Broken Closure): Adjust to the new table
16053 frames.
16054 Move to...
16055 * tests/sets.at: here.
16056
160572001-12-13 Akim Demaille <akim@epita.fr>
16058
16059 * src/closure.c (closure): Use nrules instead of playing tricks
16060 with BITS_PER_WORD.
16061
160622001-12-13 Akim Demaille <akim@epita.fr>
16063
16064 * src/print.c (print_actions): Output the handling of `$' as the
16065 traces do: shifting the token EOF. Before EOF was treated as a
16066 nonterminal.
16067 * tests/regression.at: Adjust some tests.
16068 * src/print_graph.c (print_core): Complete the set of items via
16069 closure. The next-to-final and final states are still unsatisfying,
16070 but that's to be addressed elsewhere.
16071 No longer output the rule numbers, but do output the state number.
16072 A single loop for the shifts + gotos is enough, but picked a
16073 distinct color for each.
16074 (print_graph): Initialize and finalize closure.
16075
160762001-12-13 Akim Demaille <akim@epita.fr>
16077
16078 * src/reader.c (readgram): Remove dead code, an strip useless
16079 braces.
16080 (get_type): Remove, unused.
16081
160822001-12-12 Akim Demaille <akim@epita.fr>
16083
16084 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
16085 on that of lib/error.c.
16086
160872001-12-12 Akim Demaille <akim@epita.fr>
16088
16089 Some hosts don't like `/' in includes.
16090
16091 * src/system.h: Include libgettext.h without qualifying the path.
16092 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
16093 $(top_srcdir).
16094
160952001-12-11 Marc Autret <autret_m@epita.fr>
16096
16097 * src/output.c (output_parser): Remove useless muscle.
16098
160992001-12-11 Marc Autret <autret_m@epita.fr>
16100
16101 * src/bison.simple: Remove #line just before %%epilogue. It
16102 is now handled in ...
16103 * src/reader.c (read_additionnal_code): Add the output of a
16104 #line for the epilogue.
16105
161062001-12-10 Marc Autret <autret_m@epita.fr>
16107
16108 * src/reader.c (copy_definition): Re-use CPP-outed code which
16109 replace precedent remove.
16110 * src/bison.simple: Remove #line before %%prologue because
16111 %%input-line is wrong at this time.
16112
161132001-12-10 Marc Autret <autret_m@epita.fr>
16114
16115 * src/reader.c (symbols_output): Clean up.
16116 * src/output.c (output_gram, output): Clean up.
16117
161182001-12-10 Akim Demaille <akim@epita.fr>
16119
16120 * src/lalr.c (initialize_lookaheads): New. Extracted from...
16121 * src/LR0.c (set_state_table): here.
16122 * src/lalr.c (lalr): Call it.
16123
161242001-12-10 Akim Demaille <akim@epita.fr>
16125
16126 * src/state.h (shifts): Remove the `number' member: shifts are
16127 attached to state, hence no longer need to be labelled with a
16128 state number.
16129
161302001-12-10 Akim Demaille <akim@epita.fr>
16131
16132 Now that states have a complete set of members, the linked list of
16133 shifts is useless: just fill directly the state's shifts member.
16134
16135 * src/state.h (shifts): Remove the `next' member.
16136 * src/LR0.c (first_state, last_state): Remove.
16137 Adjust the callers.
16138 (augment_automaton): Don't look for the shifts that must be added
16139 a shift on EOF: it is those of the state we looked for! But now,
16140 since shifts are attached, it is no longer needed to looking
16141 merely by its id: its number.
16142
161432001-12-10 Akim Demaille <akim@epita.fr>
16144
16145 * src/LR0.c (augment_automaton): Better variable locality.
16146 Remove an impossible branch: if there is a state corresponding to
16147 the start symbol being shifted, then there is shift for the start
16148 symbol from the initial state.
16149
161502001-12-10 Akim Demaille <akim@epita.fr>
16151
16152 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
16153 only when appropriate: when insert_start_shifting_state' is not
16154 invoked.
16155 * tests/regression.at (Rule Line Numbers): Adjust.
16156
161572001-12-10 Akim Demaille <akim@epita.fr>
16158
16159 * src/LR0.c (augment_automaton): Now that all states have shifts,
16160 merge the two cases addition shifts to the initial state.
16161
161622001-12-10 Akim Demaille <akim@epita.fr>
16163
16164 * src/lalr.c (set_state_table): Move to...
16165 * src/LR0.c: here.
16166 * src/lalr.c (lalr): Don't call it...
16167 * src/LR0.c (generate_states): do it.
16168 * src/LR0.h (first_state): Remove, only the table is used.
16169
161702001-12-10 Akim Demaille <akim@epita.fr>
16171
16172 * src/LR0.h (first_shift, first_reduction): Remove.
16173 * src/lalr.c: Don't use first_shift: find shifts through the
16174 states.
16175
161762001-12-10 Akim Demaille <akim@epita.fr>
16177
16178 * src/LR0.c: Attach shifts to states as soon as they are
16179 computed.
16180 * src/lalr.c (set_state_table): Instead of assigning shifts to
16181 state, just assert that the mapping was properly done.
16182
161832001-12-10 Akim Demaille <akim@epita.fr>
16184
16185 * src/LR0.c (insert_start_shift): Rename as...
16186 (insert_start_shifting_state): this.
16187 (insert_eof_shifting_state, insert_accepting_state): New.
16188 (augment_automaton): Adjust.
16189 Better locality of the variables.
16190 When looking if the start_symbol is shifted from the initial
16191 state, using `while (... symbol != start_symbol ...)' sounds
16192 better than `while (... symbol < start_symbol ...)': If fail
16193 to see how the order between symbols could be relevant!
16194
161952001-12-10 Akim Demaille <akim@epita.fr>
16196
16197 * src/getargs.h: Don't declare `spec_name_prefix' and
16198 `spec_file_prefix', declared by src/files.h.
16199 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
16200 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
16201 * src/output.c (prepare): Adjust.
16202 * src/reader.c (symbols_output): Likewise.
16203 * src/vmsgetargs.c: Vaguely adjust, but who cares?
16204
162052001-12-10 Akim Demaille <akim@epita.fr>
16206
16207 * src/muscle_tab.c (muscle_init): NULL is a better default than
16208 `"0"'.
16209
162102001-12-10 Akim Demaille <akim@epita.fr>
16211
16212 * src/reader.c (reader): Calling symbols_output once is enough.
16213
162142001-12-10 Akim Demaille <akim@epita.fr>
16215
16216 Now that states have a complete set of members, the linked list of
16217 reductions is useless: just fill directly the state's reductions
16218 member.
16219
16220 * src/state.h (struct reductions): Remove member `number' and
16221 `next'.
16222 * src/LR0.c (first_reduction, last_reduction): Remove.
16223 (save_reductions): Don't link the new reductions, store them in
16224 this_state.
16225 * src/lalr.c (set_state_table): No need to attach reductions to
16226 states, it's already done.
16227 * src/output.c (output_actions): No longer free the shifts, then
16228 the reductions, then the states: free all the states and their
16229 members.
16230
162312001-12-10 Akim Demaille <akim@epita.fr>
16232
16233 * src/options.c (OPTN, DRTV, BOTH): New.
16234 (option_table): Use them.
16235
16236 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
16237 the job of system.h.
16238 * src/options.c: Don't include stdio.h and xalloc.h for the same
16239 reasons.
16240
162412001-12-10 Akim Demaille <akim@epita.fr>
16242
16243 * src/output.c (output, prepare): Make sure the values of the
16244 muscles `action' and `prologue' are 0-terminated.
16245
162462001-12-10 Akim Demaille <akim@epita.fr>
16247
16248 Clean up GCC warnings.
16249
16250 * src/reader.c (copy_action): `buf' is not used.
16251 (parse_skel_decl): Be static.
16252 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
16253 * src/options.h (create_long_option_table): Have a real prototype.
16254 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
16255 (hash_delete_at): Return const void *.
16256 Adjust casts to preserve the const.
16257
162582001-12-10 Akim Demaille <akim@epita.fr>
16259
16260 * configure.in: Require 2.52g.
16261 M4 is not needed, but AUTOM4TE is.
16262 * m4/m4.m4: Remove.
16263 * tests/Makefile.am: Adjust.
16264
162652001-12-10 Akim Demaille <akim@epita.fr>
16266
16267 One structure for states is enough, even though theoretically
16268 there are LR(0) states and LALR(1) states.
16269
16270 * src/lalr.h (state_t): Remove.
16271 (state_table): Be state_t **, not state_t *.
16272 * src/state.h (core, CORE_ALLOC): Rename as...
16273 (state_t, STATE_ALLOC): this.
16274 Add the LALR(1) members: shifts, reductions, errs.
16275 * src/LR0.c (state_table): Rename as...
16276 (state_hash): this, to avoid name clashes with the global
16277 `state_table'.
16278 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
16279 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
16280
162812001-12-10 Akim Demaille <akim@epita.fr>
16282
16283 Bison dumps core on bash.y.
16284 Reported by Pascal Bart.
16285
16286 * src/warshall.c (bitmatrix_print): New.
16287 (TC): Use it.
16288 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
16289 j must be the outer loop.
16290 * tests/regression.at (Broken Closure): New.
16291
162922001-12-05 Akim Demaille <akim@epita.fr>
16293
16294 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
16295 its argument.
16296 Reported by Peter Hamorsky.
16297
162982001-12-05 Akim Demaille <akim@epita.fr>
16299
16300 * src/conflicts.c (err_table): Remove.
16301 (resolve_sr_conflict): Adjust.
16302 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
16303 Rename as...
16304 (state_t.reductions, state_t.shifts): this.
16305
163062001-12-05 Akim Demaille <akim@epita.fr>
16307
16308 * src/reduce.c (reduce_grammar_tables): No longer disable the
16309 removal of useless rules via CPP but via `if (0)', so that the
16310 compiler still check the code is valid.
16311 For instance, it should have noticed `rline' no longer exists: use
16312 the `line' member of rule_t.
16313 * src/gram.c (dummy, rline): Remove, unused.
16314
163152001-12-05 Akim Demaille <akim@epita.fr>
16316
16317 * src/output.c (pack_vector): Use assert, not berror.
16318 * src/main.c (berror): Remove, unused.
16319
163202001-12-05 Akim Demaille <akim@epita.fr>
16321
16322 New experimental feature: if --verbose --trace output all the
16323 items of a state, not only its kernel.
16324
16325 * src/print.c (print_core): If `trace_flag', then invoke closure
16326 before outputting the items of the state (print_core is no longer
16327 a correct name them).
16328 (print_results): Invoke new_closure/free_closure if needed.
16329
163302001-12-05 Akim Demaille <akim@epita.fr>
16331
16332 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
16333 * src/closure.c, src/closure.h (itemsetsize): Rename as...
16334 (nitemset): for consistency with the rest of the project.
16335
163362001-12-05 Akim Demaille <akim@epita.fr>
16337
16338 * src/closure.c (print_closure): Improve.
16339 (closure): Use it for printing input and output.
16340
163412001-12-05 Akim Demaille <akim@epita.fr>
16342
16343 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
16344 indexed by nonterminals.
16345
163462001-12-05 Akim Demaille <akim@epita.fr>
16347
16348 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
16349 what it was!).
16350 * src/warshall.h: Remove accidental duplication of the content.
16351
163522001-12-05 Akim Demaille <akim@epita.fr>
16353
16354 * src/closure.c (set_fderives): De-obfuscate.
16355
163562001-12-05 Akim Demaille <akim@epita.fr>
16357
16358 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
16359
163602001-12-05 Akim Demaille <akim@epita.fr>
16361
16362 * src/closure.c (set_firsts): De-obfuscate.
16363
163642001-12-05 Akim Demaille <akim@epita.fr>
16365
16366 * src/output.c (action_row): De-obfuscate
16367 using the good o' techniques: arrays not pointers, variable
16368 locality, BITISSET, RESETBIT etc.
16369
163702001-12-05 Akim Demaille <akim@epita.fr>
16371
16372 Pessimize the code to simplify it: from now on, all the states
16373 have a valid SHIFTS, which NSHIFTS is possibly 0.
16374
16375 * src/LR0.c (shifts_new): Be global and move to..
16376 * src/state.c, src/state.h: here.
16377 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
16378 * src/print_graph: Adjust.
16379
163802001-12-05 Akim Demaille <akim@epita.fr>
16381
16382 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
16383 * src/conflicts.c: Use it.
16384 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
16385 incorrectly ``simplified''.
16386
163872001-12-05 Akim Demaille <akim@epita.fr>
16388
16389 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
16390 using the good o' techniques: arrays not pointers, variable
16391 locality, BITISSET, RESETBIT etc.
16392
163932001-12-05 Akim Demaille <akim@epita.fr>
16394
16395 * src/state.h (SHIFT_SYMBOL): New.
16396 * src/conflicts.c: Use it to deobfuscate.
16397
163982001-12-05 Akim Demaille <akim@epita.fr>
16399
16400 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
16401 (print_reductions): De-obfuscate using the good o' techniques:
16402 arrays not pointers, variable locality, BITISSET.
16403
164042001-12-05 Akim Demaille <akim@epita.fr>
16405
16406 * src/conflicts.c (print_reductions): Arrays, not pointers.
16407 Use BITISSET.
16408
164092001-12-05 Akim Demaille <akim@epita.fr>
16410
16411 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16412
164132001-12-05 Akim Demaille <akim@epita.fr>
16414
16415 * src/conflicts.c (print_reductions): Improve variable locality.
16416
164172001-12-05 Akim Demaille <akim@epita.fr>
16418
16419 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16420
164212001-12-05 Akim Demaille <akim@epita.fr>
16422
16423 * src/conflicts.c (print_reductions): Improve variable locality.
16424
164252001-12-05 Akim Demaille <akim@epita.fr>
16426
16427 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
16428 * src/lalr.c: Use them.
16429
164302001-12-05 Akim Demaille <akim@epita.fr>
16431
16432 * src/LR0.c (augment_automaton): Formatting changes.
16433 Better variable locality.
16434
164352001-12-05 Akim Demaille <akim@epita.fr>
16436
16437 * src/lalr.c (matrix_print): New.
16438 (transpose): Use it.
16439 Use arrays instead of pointers.
16440
164412001-12-05 Akim Demaille <akim@epita.fr>
16442
16443 * src/lalr.c (maxrhs): Move to...
16444 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
16445 * src/lalr.c (build_relations): Adjust.
16446
164472001-12-05 Akim Demaille <akim@epita.fr>
16448
16449 * src/lalr.c (transpose): Free the memory allocated to the
16450 argument, as it is replaced by the results by the unique caller.
16451 (build_relations): Merely invoke transpose: it handles the memory
16452 deallocation.
16453 Improve variable locality.
16454 Avoid variables used as mere abbreviations.
16455 (compute_lookaheads): Use arrays instead of pointers.
16456
164572001-12-05 Akim Demaille <akim@epita.fr>
16458
16459 * src/lalr.c (initialize_F): Improve variable locality.
16460 Avoid variables used as mere abbreviations.
16461
164622001-12-05 Akim Demaille <akim@epita.fr>
16463
16464 * src/derives.c (print_derives): Display the ruleno.
16465 * src/lalr.c (initialize_F, transpose): Better variable locality
16466 to improve readability.
16467 Avoid variables used as mere abbreviations.
16468
164692001-12-05 Akim Demaille <akim@epita.fr>
16470
16471 * src/lalr.c (traverse): Use arrays instead of pointers.
16472
164732001-12-05 Akim Demaille <akim@epita.fr>
16474
16475 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
16476 the handling of squeue.
16477 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16478
164792001-12-05 Akim Demaille <akim@epita.fr>
16480
16481 Because useless nonterminals are now kept alive (instead of being
16482 `destroyed'), we now sometimes examine them, and store information
16483 related to them. Hence we need to know their number, and adjust
16484 memory allocations.
16485
16486 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
16487 static.
16488 * src/LR0.c (allocate_itemsets): The memory allocated to
16489 `symbol_count' was used for two different purpose: once to count
16490 the number of occurrences of each symbol, and later reassigned to
16491 `shift_symbol', containing the symbol that can be shifted from a
16492 given state.
16493 Deobfuscate, i.e., allocate, use and free `symbol_count' here
16494 only, and...
16495 (new_itemsets): Allocate `shift_symbol' here.
16496 (allocate_itemsets): symbol_count includes useless nonterminals.
16497 Make room for them.
16498 (free_storage): Use `free', not `XFREE', for pointers that cannot
16499 be null.
16500
165012001-12-05 Akim Demaille <akim@epita.fr>
16502
16503 * src/nullable.c (set_nullable): Deobfuscate the handling of
16504 ritem.
16505 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16506
165072001-12-05 Akim Demaille <akim@epita.fr>
16508
16509 * src/gram.c, src/gram.h (ritem_print): New.
16510 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
16511 (This useless function was defined only to work around VMS linkers
16512 that can't handle compilation units with variables only).
16513 * src/reduce.c (dump_grammar): Use it to trace the construction of
16514 ritem.
16515
165162001-12-04 Paul Eggert <eggert@twinsun.com>
16517
16518 * src/bison.simple (union yyalloc): Change member names
16519 to be the same as the stack names.
16520 (yyparse): yyptr is now union yyalloc *, not char *.
16521 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
16522 and may generate better code on some machines.
16523 (yystpcpy): Use prototype if __STDC__ is defined, not just
16524 if __cplusplus is defined.
16525
165262001-11-30 Akim Demaille <akim@epita.fr>
16527
16528 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
16529 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
16530 Gettext doesn't compile cleanly, and dies with -Werror.
16531 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
16532 Include WARNING_CFLAGS here.
16533 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
16534 before being defined.
16535
165362001-11-27 Paul Eggert <eggert@twinsun.com>
16537
16538 * lib/quotearg.h (quotearg_n, quotearg_n_style):
16539 First arg is int, not unsigned.
16540 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
16541 (SIZE_MAX, UINT_MAX): New macros.
16542 (quotearg_n_options): Abort if N is negative.
16543 Avoid overflow check on hosts where size_t is 64 bits and int
16544 is 32 bits, as overflow is impossible there.
16545 Fix off-by-one typo that caused unnecessary reallocation.
16546
165472001-11-29 Paul Eggert <eggert@twinsun.com>
16548
16549 Name space cleanup in generated parser.
16550
16551 * doc/bison.texinfo (Bison Parser): Discuss system headers
16552 and their effect on the user name space.
16553
16554 * src/bison.simple:
16555 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
16556 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
16557 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
16558
16559 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
16560 on user names when possible.
16561
16562 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
16563 Simplify test for whather <alloca.h> exists.
16564
16565 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
16566
16567 (<stdio.h>): Include if YYDEBUG.
16568
16569 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
16570 ! defined (yyoverflow) && ! defined (yymemcpy).
16571
16572 (yymemcpy, yyparse): Rename local variables as needed so that
16573 they all begin with 'yy'.
16574
16575 (yystrlen, yystpcpy): New functions.
16576
16577 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
16578 All uses changed.
16579
16580 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
16581 instead of relying on string.h functions. Use YYSTACK_ALLOC
16582 and YYSTACK_FREE instead of malloc and free.
16583
165842001-11-30 Akim Demaille <akim@epita.fr>
16585
16586 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
16587 before their first uses.
16588 (YYBISON, YYPURE): Move to the top of the output.
16589
165902001-11-30 Akim Demaille <akim@epita.fr>
16591
16592 * tests/reduce.at (Useless Nonterminals): Fix.
16593
165942001-11-30 Akim Demaille <akim@epita.fr>
16595
16596 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
16597 if body instead of `;' to pacify GCC's warnings.
16598
165992001-11-30 Akim Demaille <akim@epita.fr>
16600
16601 Instead of mapping the LHS of unused rules to -1, keep the LHS
16602 valid, but flag the rules as invalid.
16603
16604 * src/gram.h (rule_t): `useful' is a new member.
16605 * src/print.c (print_grammar): Adjust.
16606 * src/derives.c (set_derives): Likewise.
16607 * src/reader.c (packgram, reduce_output): Likewise.
16608 * src/reduce.c (reduce_grammar_tables): Likewise.
16609 * tests/reduce.at (Underivable Rules, Useless Rules): New.
16610
166112001-11-30 Akim Demaille <akim@epita.fr>
16612
16613 * src/reduce.c (reduce_output): Formatting changes.
16614 * src/print.c (print_results, print_grammar): Likewise.
16615 * tests/regression.at (Rule Line Numbers)
16616 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
16617
166182001-11-30 Akim Demaille <akim@epita.fr>
16619
16620 * src/reduce.c (nonterminals_reduce): Instead of throwing away
16621 useless nonterminals, move them at the end of the symbol arrays.
16622 (reduce_output): Adjust.
16623 * tests/reduce.at (Useless Nonterminals): Adjust.
16624
166252001-11-30 Akim Demaille <akim@epita.fr>
16626
16627 * src/reduce.c: Various comment/formatting changes.
16628 (nonterminals_reduce): New, extracted from...
16629 (reduce_grammar_tables): here.
16630 (reduce_grammar): Call nonterminals_reduce.
16631
166322001-11-29 Paul Eggert <eggert@twinsun.com>
16633
16634 * src/bison.simple (YYSTACK_REALLOC): Remove.
16635 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
16636 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
16637 New macros.
16638 (union yyalloc): New type.
16639 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
16640 an arbitrary restriction on hosts where size_t is wider than int.
16641
16642 (yyparse): Don't dump core if alloca or malloc fails; instead, report
16643 a parser stack overflow. Allocate just one block of memory for all
16644 three stacks, instead of allocating three blocks; this typically is
16645 faster and reduces fragmentation.
16646
16647 Do not limit the number of items in the stack to a value that fits
16648 in 'int', as this is an arbitrary limit on hosts with 64-bit
16649 size_t and 32-bit int.
16650
166512001-11-29 Marc Autret <autret_m@epita.fr>
16652
16653 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
16654 of defining YYERROR_VERBOSE.
16655 [AT_DATA]: $4 is now out of C declarations in the prologue.
16656
166572001-11-28 Marc Autret <autret_m@epita.fr>
16658
16659 * src/reader.c (parse_dquoted_param): New.
16660 (parse_skel_decl): Use it.
16661 * src/lex.h: Add its prototype.
16662 * src/lex.c (literalchar): Become not static.
16663
166642001-11-28 Marc Autret <autret_m@epita.fr>
16665
16666 * src/output.h: And put its extern declaration here.
16667 * src/output.c (error_verbose): Define here.
16668 (prepare): Echo name modification.
16669 * src/getargs.h: Clean its extern declaration.
16670 * src/getargs.c (error_verbose_flag): Remove.
16671 (getargs): Remove case 'e'.
16672 * src/options.c (option_table): 'error-verbose' is now seen as simple
16673 percent option.
16674 Include output.h.
16675
16676 * src/reader.c (read_declarations): Remove case tok_include.
16677 (parse_include_decl): Remove.
16678 * src/lex.h (token_t): Remove tok_include.
16679 * src/options.c (option_table): 'include' is now a simple command line
16680 option.
16681
166822001-11-28 Marc Autret <autret_m@epita.fr>
16683
16684 * src/bison.simple: Adjust muscle names.
16685 * src/muscle_tab.c (muscle_init): Also rename the muscles.
16686 * src/output.c (prepare): s/_/-/ for the muscles names.
16687 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
16688
166892001-11-28 Marc Autret <autret_m@epita.fr>
16690
16691 * src/bison.simple: Fix debug.
16692 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
16693
166942001-11-28 Akim Demaille <akim@epita.fr>
16695
16696 * src/LR0.c (shifts_new): New.
16697 (save_shifts, insert_start_shift, augment_automaton): Use it.
16698
166992001-11-28 Akim Demaille <akim@epita.fr>
16700
16701 * src/closure.c (closure): `b' and `ruleno' denote the same value:
16702 keep ruleno only.
16703
167042001-11-28 Akim Demaille <akim@epita.fr>
16705
16706 * src/closure.c (closure): Instead of looping over word in array
16707 then bits in words, loop over bits in array.
16708
167092001-11-28 Akim Demaille <akim@epita.fr>
16710
16711 * src/closure.c (closure): No longer optimize the special case
16712 where all the bits of `ruleset[r]' are set to 0, to make the code
16713 clearer.
16714
167152001-11-28 Akim Demaille <akim@epita.fr>
16716
16717 * src/closure.c (closure): `r' and `c' are new variables, used to
16718 de-obfuscate accesses to RULESET and CORE.
16719
167202001-11-28 Akim Demaille <akim@epita.fr>
16721
16722 * src/reduce.c (reduce_print): Use ngettext.
16723 (dump_grammar): Improve the trace accuracy.
16724
167252001-11-28 Akim Demaille <akim@epita.fr>
16726
16727 * src/reduce.c (dump_grammar): Don't translate trace messages.
16728
167292001-11-28 Akim Demaille <akim@epita.fr>
16730
16731 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
16732 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
16733 as all tags are free'ed afterwards.
16734 From Enrico Scholz.
16735
167362001-11-27 Paul Eggert <eggert@twinsun.com>
16737
16738 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
16739 use alloca when we didn't want to, and vice versa.
16740
167412001-11-27 Marc Autret <autret_m@epita.fr>
16742
16743 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
16744 initialization.
16745 * src/output.c (prepare): Remove its update.
16746
167472001-11-27 Marc Autret <autret_m@epita.fr>
16748
16749 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
16750 Use %error-verbose.
16751
167522001-11-27 Marc Autret <autret_m@epita.fr>
16753
16754 * src/bison.simple: Remove YYERROR_VERBOSE using.
16755 Use %%error_verbose.
16756 (yyparse): Likewise.
16757 * src/output.c (prepare): Give its final value.
16758 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
16759 * src/getargs.h: Add its extern declaration.
16760 * src/getargs.c (error_verbose_flag): New int.
16761 (getargs): Update to catch new case.
16762 * src/options.c (option_table): 'error-verbose' is a new option.
16763 (shortopts): Update.
16764
167652001-11-27 Akim Demaille <akim@epita.fr>
16766
16767 * src/system.h: Use intl/libgettext.h.
16768 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
16769
167702001-11-27 Akim Demaille <akim@epita.fr>
16771
16772 * tests/torture.at (Exploding the Stack Size with Malloc):
16773 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
16774
167752001-11-27 Akim Demaille <akim@epita.fr>
16776
16777 * src/files.c: Include error.h.
16778 Reported by Hans Aberg.
16779
167802001-11-26 Marc Autret <autret_m@epita.fr>
16781
16782 * src/reader.c (parse_include_decl): New, not yet implemented.
16783 (read_declarations): Add case tok_include.
16784 * src/getargs.h (include): Add its extern definition.
16785 * src/getargs.c (include): New const char *.
16786 (getargs): Add case '-I'.
16787 * src/options.c (option_table): Add include as command line and
16788 percent option.
16789 * src/lex.h (token_t): Add tok_include.
16790
167912001-11-26 Akim Demaille <akim@epita.fr>
16792
16793 * src/reader.c (readgram): Make sure rules for mid-rule actions
16794 have a lineno equal to that of their host rule.
16795 Reported by Hans Aberg.
16796 * tests/regression.at (Rule Line Numbers): New.
16797
167982001-11-26 Akim Demaille <akim@epita.fr>
16799
16800 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
16801 size_ts.
16802
168032001-11-26 Akim Demaille <akim@epita.fr>
16804
16805 * src/complain.c, src/complain.h (error): Remove, provided by
16806 lib/error.[ch].
16807
168082001-11-26 Akim Demaille <akim@epita.fr>
16809
16810 * src/reader.c (read_declarations): Don't abort on tok_illegal,
16811 issue an error message.
16812 * tests/regression.at (Invalid %directive): New.
16813 Reported by Hans Aberg.
16814
168152001-11-26 Akim Demaille <akim@epita.fr>
16816
16817 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
16818 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16819
168202001-11-26 Akim Demaille <akim@epita.fr>
16821
16822 * src/conflicts.c (conflicts_print): Don't complain at all when
16823 there are no reduce/reduce conflicts, and as many shift/reduce
16824 conflicts as expected.
16825 * tests/regression.at (%expect right): Adjust.
16826
168272001-11-23 Akim Demaille <akim@epita.fr>
16828
16829 * lib/alloca.c: Update, from fileutils.
16830
168312001-11-23 Akim Demaille <akim@epita.fr>
16832
16833 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
16834
168352001-11-23 Akim Demaille <akim@epita.fr>
16836
16837 * src/system.h: Include alloca.h.
16838 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
16839
168402001-11-23 Akim Demaille <akim@epita.fr>
16841
16842 * src/print_graph.c (print_actions): Remove `rule', unused.
16843 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
16844 pacify GCC's signed < unsigned warnings.
16845 * src/closure.c (itemsetsize): Likewise.
16846 * src/reader.c (symbol_list_new): Static.
16847
168482001-11-23 Akim Demaille <akim@epita.fr>
16849
16850 Attaching lineno to buckets is stupid, since only one copy of each
16851 symbol is kept, only the line of the first occurrence is kept too.
16852
16853 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
16854 * src/reader.c (rline_allocated): Remove, unused.
16855 (symbol_list): Have a `line' member.
16856 (symbol_list_new): New.
16857 (readgram): Use it.
16858 * src/print.c (print_grammar): Output the rule line numbers.
16859 * tests/regression.at (Solved SR Conflicts)
16860 (Unresolved SR Conflicts): Adjust.
16861 Reported by Hans Aberg.
16862
168632001-11-22 Marc Autret <autret_m@epita.fr>
16864
16865 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
16866
168672001-11-22 Marc Autret <autret_m@epita.fr>
16868
16869 * src/muscle_tab.c (muscle_init): Remove initialization of
16870 skeleton muscle.
16871 * src/output.c (output_master_parser): Do it here.
16872
168732001-11-20 Akim Demaille <akim@epita.fr>
16874
16875 * po/sv.po: New.
16876 * configure.in (ALL_LINGUAS): Adjust.
16877 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
16878 longer contains strings to translate.
16879
168802001-11-19 Akim Demaille <akim@epita.fr>
16881
16882 * src/conflicts.c (conflicts_print): Add a missing \n.
16883
168842001-11-19 Akim Demaille <akim@epita.fr>
16885
16886 * src/nullable.c (nullable_print): New.
16887 (set_nullable): Call it when tracing.
16888 Better locality of variables.
16889
168902001-11-19 Akim Demaille <akim@epita.fr>
16891
16892 * src/print.c (print_actions): Better locality of variables.
16893
168942001-11-19 Akim Demaille <akim@epita.fr>
16895
16896 * src/derives.c (print_derives): Fix and enrich.
16897 * src/closure.c (print_fderives): Likewise.
16898
168992001-11-19 Akim Demaille <akim@epita.fr>
16900
16901 * src/closure.c (itemsetend): Remove, replaced with...
16902 (itemsetsize): new.
16903
169042001-11-19 Akim Demaille <akim@epita.fr>
16905
16906 * src/LR0.c (kernel_end): Remove, replaced with...
16907 (kernel_size): new.
16908
169092001-11-19 Akim Demaille <akim@epita.fr>
16910
16911 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
16912 to clarify.
16913
169142001-11-19 Akim Demaille <akim@epita.fr>
16915
16916 * src/closure.c (closure): Use arrays instead of pointers to clarify.
16917
169182001-11-19 Akim Demaille <akim@epita.fr>
16919
16920 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
16921 trace messages.
16922 * src/LR0.c: Likewise.
16923 (allocate_itemsets): Use arrays instead of pointers to clarify.
16924
169252001-11-19 Akim Demaille <akim@epita.fr>
16926
16927 * src/getargs.c (statistics_flag): Replace with...
16928 (trace_flag): New.
16929 (longopts): Accept --trace instead of --statistics.
16930 * src/getargs.h, src/options.c: Adjust.
16931 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
16932 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
16933
169342001-11-19 Akim Demaille <akim@epita.fr>
16935
16936 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
16937 pointers to clarify the code.
16938 (save_reductions, save_shifts): Factor common parts of alternatives.
16939
169402001-11-19 Akim Demaille <akim@epita.fr>
16941
16942 * src/LR0.c (new_state, get_state): Complete TRACE code.
16943 * src/closure.c: Include `reader.h' to get `tags', needed by the
16944 trace code.
16945 Rename the conditional DEBUG as TRACE.
16946 Output consistently TRACEs to stderr, not stdout.
16947 * src/derives.c: Likewise.
16948 * src/reduce.c: (inaccessable_symbols): Using if is better style
16949 than goto.
16950 Use `#if TRACE' instead of `#if 0' for tracing code.
16951
169522001-11-19 Akim Demaille <akim@epita.fr>
16953
16954 * src/system.h (LIST_FREE, shortcpy): New.
16955 * src/LR0.c: Use them.
16956 * src/output.c (free_itemsets, free_reductions, free_shifts):
16957 Remove, replaced by LIST_FREE.
16958
169592001-11-19 Akim Demaille <akim@epita.fr>
16960
16961 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
16962 (REDUCTIONS_ALLOC): New.
16963 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
16964 allocation.
16965
169662001-11-19 Akim Demaille <akim@epita.fr>
16967
16968 * src/LR0.c (new_state): Complete trace code.
16969 * src/nullable.c (set_nullable): Don't translate traces.
16970
169712001-11-19 Akim Demaille <akim@epita.fr>
16972
16973 * src/print_graph.c (print_core): Better locality of variables.
16974 * src/print.c (print_core): Likewise.
16975
169762001-11-19 Akim Demaille <akim@epita.fr>
16977
16978 * src/vcg.c: You do the output, so you are responsible of the
16979 handling of VCG syntax, in particular: use quotearg.
16980 * src/print_graph.c: Don't.
16981 (print_actions): Don't output the actions as part of the nodes,
16982 since that's the job of the edges.
16983 (print_state): Don't output by hand: fill the node description,
16984 and ask for its output.
16985
169862001-11-19 Akim Demaille <akim@epita.fr>
16987
16988 * src/bison.simple (yyparse): When verbosely reporting an error,
16989 no longer put additional quotes around token names.
16990 * tests/calc.at: Adjust.
16991
169922001-11-19 Akim Demaille <akim@epita.fr>
16993
16994 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
16995 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
16996 * src/output.c: Adjust.
16997
169982001-11-19 Akim Demaille <akim@epita.fr>
16999
17000 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
17001 (rule_t): this.
17002 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
17003
170042001-11-19 Akim Demaille <akim@epita.fr>
17005
17006 * src/gram.h (rule_t): New.
17007 (rule_table): New.
17008 (rrhs, rlhs): Remove, part of state_t.
17009 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
17010 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17011 * src/reader.c, src/reduce.c: Adjust.
17012
170132001-11-19 Akim Demaille <akim@epita.fr>
17014
17015 * src/reader.c (symbols_output): New, extracted from...
17016 (packsymbols): Here.
17017 (reader): Call it.
17018
170192001-11-19 Akim Demaille <akim@epita.fr>
17020
17021 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
17022 (maxrhs): this new function.
17023
170242001-11-19 Akim Demaille <akim@epita.fr>
17025
17026 * src/lalr.c (F): New macro to access the variable F.
17027 Adjust.
17028
170292001-11-19 Akim Demaille <akim@epita.fr>
17030
17031 * src/lalr.h (LA): New macro to access the variable LA.
17032 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17033 * src/lalr.c: Adjust.
17034
170352001-11-19 Akim Demaille <akim@epita.fr>
17036
17037 * src/lalr.c (initialize_LA): Only initialize LA. Let...
17038 (set_state_table): handle the `lookaheads' members.
17039
170402001-11-19 Akim Demaille <akim@epita.fr>
17041
17042 * src/lalr.h (lookaheads): Removed array, whose contents is now
17043 a member of...
17044 (state_t): this structure.
17045 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17046 Adjust.
17047
170482001-11-19 Akim Demaille <akim@epita.fr>
17049
17050 * src/lalr.h (consistent): Removed array, whose contents is now
17051 a member of...
17052 (state_t): this structure.
17053 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17054 Adjust.
17055
170562001-11-19 Akim Demaille <akim@epita.fr>
17057
17058 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
17059 contents are now members of...
17060 (state_t): this structure.
17061 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17062 Adjust.
17063
170642001-11-19 Akim Demaille <akim@epita.fr>
17065
17066 * src/lalr.h (state_t): New.
17067 (state_table): Be a state_t * instead of a core **.
17068 (accessing_symbol): Remove, part of state_t.
17069 * src/lalr.c: Adjust.
17070 (set_accessing_symbol): Merge into...
17071 (set_state_table): this.
17072 * src/print_graph.c, src/conflicts.c: Adjust.
17073
170742001-11-14 Akim Demaille <akim@epita.fr>
17075
17076 * tests/calc.at, tests/output.at, tests/regression.at,
17077 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
17078 now the tests are run in private dirs, therefore AC_CLEANUP and
17079 family can be simplified to 0-ary.
17080 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
17081 use abs. path to find config.h.
17082 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
17083 stderr, there can be way too much random noise.
17084 Instead pass -Werror to GCC and rely on the exit status.
17085 Reported by Wolfram Wagner.
17086
170872001-11-14 Akim Demaille <akim@epita.fr>
17088
17089 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
17090 defined only if yyoverflow is defined, to avoid `warning: unused
17091 variable `yyvs1''.
17092 Reported by The Test Suite.
17093
170942001-11-14 Akim Demaille <akim@epita.fr>
17095
17096 * src/print.c: Include reduce.h.
17097 Reported by Hans Aberg.
17098
170992001-11-14 Akim Demaille <akim@epita.fr>
17100
17101 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
17102 Revert a previous patch: these are really const.
17103 * src/conflicts.c (conflict_report): Additional useless pair of
17104 braces to pacify GCC's warnings for `if () if () {} else {}'.
17105 * src/lex.c (parse_percent_token): Replace equal_offset with
17106 arg_offset.
17107 arg is const.
17108 Be sure to strdup `arg' when used, since there is no reason for
17109 token_buffer not to change.
17110
171112001-11-14 Akim Demaille <akim@epita.fr>
17112
17113 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
17114 definition.
17115 * src/main.c (main): Use them.
17116 Suggested by Hans Aberg.
17117
171182001-11-12 Akim Demaille <akim@epita.fr>
17119
17120 * src/system.h (ngettext): Now that we use ngettext, be sure to
17121 provide a default definition when NLS are not used.
17122
171232001-11-12 Akim Demaille <akim@epita.fr>
17124
17125 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
17126 Use @kbd to denote user input.
17127 (Language and Grammar): ANSIfy the example.
17128 Adjust its layout for info/notinfo.
17129 (Location Tracking Calc): Output error messages to stderr.
17130 Output locations in a more GNUtically correct way.
17131 Fix a couple of Englishos.
17132 Adjust @group/@end group pairs.
17133
171342001-11-12 Akim Demaille <akim@epita.fr>
17135
17136 %expect was not functioning at all.
17137
17138 * src/conflicts.c (expected_conflicts): Set to -1.
17139 (conflict_report): Use ngettext.
17140 (conflicts_print): Check %expect and make its violation an error.
17141 * doc/bison.texinfo (Expect Decl): Adjust.
17142 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
17143 * tests/regression.at (%expect not enough, %expect right)
17144 (%expect too much): New.
17145
171462001-11-12 Akim Demaille <akim@epita.fr>
17147
17148 * tests/regression.at (Conflicts): Rename as...
17149 (Unresolved SR Conflicts): this.
17150 (Solved SR Conflicts): New.
17151
171522001-11-12 Akim Demaille <akim@epita.fr>
17153
17154 * src/reduce.c (print_results): Rename as...
17155 (reduce_output): This.
17156 Output to OUT, passed as argument, instead of output_obstack.
17157 (dump_grammar): Likewise.
17158 (reduce_free): New.
17159 Also free V1.
17160 (reduce_grammar): No longer call reduce_output, since...
17161 * src/print.c (print_results): do it.
17162 * src/main.c (main): Call reduce_free;
17163
171642001-11-12 Akim Demaille <akim@epita.fr>
17165
17166 * src/conflicts.c (print_reductions): Accept OUT as argument.
17167 Output to it, not to output_obstack.
17168 * src/print.c (print_actions): Adjust.
17169
171702001-11-12 Akim Demaille <akim@epita.fr>
17171
17172 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
17173 the result instead of using...
17174 (src_total, rrc_total, src_count, rrc_count): Remove.
17175 (any_conflicts): Remove.
17176 (print_conflicts): Split into...
17177 (conflicts_print, conflicts_output): New.
17178 * src/conflicts.h: Adjust.
17179 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
17180 * src/print.c (print_grammar): Issue `\n' between two rules.
17181 * tests/regression.at (Conflicts): New.
17182 Reported by Tom Lane.
17183
171842001-11-12 Akim Demaille <akim@epita.fr>
17185
17186 * tests/regression.at (Invalid input): Remove, duplicate with
17187 ``Invalid input: 1''.
17188
171892001-11-12 Akim Demaille <akim@epita.fr>
17190
17191 * tests/torture.at (AT_DATA_STACK_TORTURE)
17192 (Exploding the Stack Size with Alloca)
17193 (Exploding the Stack Size with Malloc): New.
17194
171952001-11-12 Akim Demaille <akim@epita.fr>
17196
17197 * src/bison.simple (YYSTACK_REALLOC): New.
17198 (yyparse) [!yyoverflow]: Use it and free the old stack.
17199 Reported by Per Allansson.
17200
172012001-11-12 Pascal Bart <pascal.bart@epita.fr>
17202
17203 * src/bison.simple: Define type yystype instead of YYSTYPE, and
17204 define CPP macro, which substitute YYSTYPE by yystype.
17205 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
17206 with yyltype/YYLTYPE. This allows inclusion of the generated
17207 header within the parser if the compiler, such as GGC, accepts
17208 multiple equivalent #defines.
17209 From Akim.
17210
172112001-11-05 Akim Demaille <akim@epita.fr>
17212
17213 * src/reader.c (symbols_output): New, extracted from...
17214 (packsymbols): here.
17215 (reader): Adjust.
17216
172172001-11-05 Akim Demaille <akim@epita.fr>
17218
17219 * src/lex.c (parse_percent_token): s/quotearg/quote/.
17220
172212001-11-05 Akim Demaille <akim@epita.fr>
17222
17223 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
17224 pattern.
17225
172262001-11-05 Akim Demaille <akim@epita.fr>
17227
17228 * src/options.h (struct option_table_struct): set_flags is void*.
17229 * src/options.c (longopts): Support `--output' and `%output'.
17230 (usage): Adjust.
17231 * src/lex.h (tok_setopt): Remove, replaced with...
17232 (tok_intopt, tok_stropt): these new guys.
17233 * src/lex.c (getopt.h): Not needed.
17234 (token_buffer, unlexed_token_buffer): Not const.
17235 (percent_table): Promote `-' over `_' in directive names.
17236 Active `%name-prefix', `file-prefix', and `output'.
17237 (parse_percent_token): Accept possible arguments to directives.
17238 Promote `-' over `_' in directive names.
17239
172402001-11-04 Akim Demaille <akim@epita.fr>
17241
17242 * doc/bison.texinfo (Decl Summary): Split the list into
17243 `directives for grammars' and `directives for bison'.
17244 Sort'em.
17245 Add description of `%name-prefix', `file-prefix', and `output'.
17246 Promote `-' over `_' in directive names.
17247 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
17248 Simplify the description of `--name-prefix'.
17249 Promote `-' over `_' in directive names.
17250 Promote `--output' over `--output-file'.
17251 Fix the description of `--defines'.
17252 * tests/output.at: Exercise %file-prefix and %output.
17253
172542001-11-02 Akim Demaille <akim@epita.fr>
17255
17256 * doc/refcard.tex: Update.
17257
172582001-11-02 Akim Demaille <akim@epita.fr>
17259
17260 * src/symtab.h (SUNDEF): New.
17261 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
17262 stand for `uninitialized', instead of 0.
17263 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
17264 * src/lex.c (lex): Adjust.
17265
17266 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
17267 Number it 0.
17268 Let yylex return it instead of a plain 0.
17269 Reported by Dick Streefland.
17270
172712001-11-02 Akim Demaille <akim@epita.fr>
17272
17273 * tests/regression.at (Mixing %token styles): New test.
17274
172752001-11-02 Akim Demaille <akim@epita.fr>
17276
17277 * src/reader.c (parse_thong_decl): Formatting changes.
17278 (token_translations_init): New, extracted from...
17279 (packsymbols): Here.
17280 Adjust.
17281
172822001-11-01 Akim Demaille <akim@epita.fr>
17283
17284 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
17285 Check that `9foo.y' produces correct cpp guards.
17286 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
17287 guards.
17288 Reported by Wwp.
17289
172902001-11-01 Akim Demaille <akim@epita.fr>
17291
17292 * tests/regression.at (Invalid input: 2): New.
17293 * src/lex.c (unlexed_token_buffer): New.
17294 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
17295 too.
17296 Reported by Wwp.
17297
172982001-11-01 Akim Demaille <akim@epita.fr>
17299
17300 * tests/calc.at: Catch up with 1.30.
17301 * configure.in: Bump to 1.49a.
17302 Adjust to newer Autotest.
17303
173042001-10-19 Pascal Bart <pascal.bart@epita.fr>
17305
17306 * src/conflicts.c: Move global variables rrc_total and src_total ...
17307 (print_conflicts): here.
17308 * src/output.c (output): Free global variable user_toknums.
17309 * src/lex.c (token_obstack): Become static.
17310
173112001-10-18 Akim Demaille <akim@epita.fr>
17312
17313 * tests/atlocal.in (GCC): Add.
17314 * tests/calc.at: s/m4_match/m4_bmatch/.
17315 s/m4_patsubst/m4_bpatsubst/.
17316 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
17317 * configure.in: AC_SUBST(GCC).
17318
173192001-10-14 Marc Autret <autret_m@epita.fr>
17320
17321 * src/options.c (create_long_option_table): Fix.
17322
173232001-10-10 Akim Demaille <akim@epita.fr>
17324
17325 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
17326
173272001-10-04 Akim Demaille <akim@epita.fr>
17328
17329 * src/reader.c (parse_union_decl): Push the caracters in
17330 union_obstack, not attrs_obstack.
17331
173322001-10-04 Akim Demaille <akim@epita.fr>
17333
17334 Merge in the branch 1.29.
17335
17336 * src/reader.c (packsymbols): Use a temporary obstack for
17337 `%%tokendef', since output_stack is already used elsewhere.
17338
17339 2001-10-02 Akim Demaille <akim@epita.fr>
17340
17341 Bump 1.29d.
17342
17343 2001-10-02 Akim Demaille <akim@epita.fr>
17344
17345 Version 1.29c.
17346
17347 2001-10-02 Akim Demaille <akim@epita.fr>
17348
17349 * tests/regression.at (Invalid CPP headers): New.
17350 From Alexander Belopolsky.
17351 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
17352
17353 2001-10-02 Akim Demaille <akim@epita.fr>
17354
17355 * tests/regression.at (Invalid input): New.
17356 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
17357 Reported by Shura.
17358
17359 2001-10-02 Akim Demaille <akim@epita.fr>
17360
17361 * tests/calc.at: Now that --debug works, the tests must be adjusted.
17362
17363 2001-10-02 Akim Demaille <akim@epita.fr>
17364
17365 * src/output.c (output_parser): Assert `skeleton'.
17366 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
17367 systems.
17368 From Shura.
17369
17370 2001-10-01 Marc Autret <autret_m@epita.fr>
17371
17372 * src/lex.h: Echo modifications.
17373 * src/lex.c (unlex): Parameter is now token_t.
17374 From Hans Aberg.
17375
17376 2001-10-01 Marc Autret <autret_m@epita.fr>
17377
17378 * src/main.c: Include lex.h.
17379 From Hans Aberg.
17380
17381 2001-09-29 Akim Demaille <akim@epita.fr>
17382
17383 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
17384
17385 2001-09-28 Akim Demaille <akim@epita.fr>
17386
17387 * tests/testsuite.at: Update to newer Autotest.
17388 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
17389
17390 2001-09-27 Akim Demaille <akim@epita.fr>
17391
17392 Position independent wrapper.
17393
17394 * tests/bison: Remove.
17395 * tests/bison.in: New.
17396 * configure.in: Adjust.
17397
17398 2001-09-27 Paul Eggert <eggert@twinsun.com>
17399
17400 Port quotearg fixes from tar 1.13.24.
17401
17402 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
17403 tm to be declared.
17404 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
17405 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
17406
17407 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
17408 * m4/mbrtowc.m4: New file.
17409 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
17410 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
17411
17412 2001-09-27 Akim Demaille <akim@epita.fr>
17413
17414 Bump to 1.29c.
17415
17416 2001-09-27 Akim Demaille <akim@epita.fr>
17417
17418 Version 1.29b.
17419
17420 2001-09-25 Akim Demaille <akim@epita.fr>
17421
17422 * src/system.h: Include `xalloc.h'.
17423 Remove it from the C files.
17424 * src/files.c (output_files): Free the obstacks.
17425 * src/lex.c (init_lex): Rename as...
17426 (lex_init): this.
17427 (lex_free): New.
17428 * src/main.c (main): Use it.
17429
17430 2001-09-24 Marc Autret <autret_m@epita.fr>
17431
17432 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
17433 to output informations in fout (FILE*).
17434 (open_graph, close_graph): Likewise.
17435 (output_graph, output_edge, output_node): Likewise.
17436 * src/vcg.h: Update function prototypes.
17437 * src/print_graph.c (print_graph): Open output graph file.
17438 (print_actions): Adjust.
17439 * src/files.h: Remove extern declaration.
17440 * src/files.c: Remove graph_obstack declaration.
17441 (open_files): Remove graph_obstack initialization.
17442 (output_files): Remove graph_obstack saving.
17443
17444 2001-09-24 Marc Autret <autret_m@epita.fr>
17445
17446 * src/files.c (compute_output_file_names): Fix.
17447
17448 2001-09-24 Marc Autret <autret_m@epita.fr>,
17449 Akim Demaille <akim@epita.fr>
17450
17451 * src/reader.c (reader): Remove call to free_symtab ().
17452 * src/main.c (main): Call it here.
17453 Include symtab.h.
17454 * src/conflicts.c (initialize_conflicts): Rename as...
17455 (solve_conflicts): this.
17456 * src/print.c (print_core, print_actions, print_state)
17457 (print_grammar): Dump to a file instead a `output_obstack'.
17458 (print_results): Dump `output_obstack', and then proceed with the
17459 FILE *.
17460 * src/files.c (compute_output_file_names, close_files): New.
17461 (output_files): Adjust.
17462 * src/main.c (main): Adjust.
17463
17464 2001-09-23 Marc Autret <autret_m@epita.fr>
17465
17466 * src/files.c (compute_header_macro): Computes header macro name
17467 from spec_defines_file when given.
17468
17469 2001-09-23 Marc Autret <autret_m@epita.fr>
17470
17471 * src/files.c (output_files): Add default extensions.
17472
17473 2001-09-22 Akim Demaille <akim@epita.fr>
17474
17475 * src/conflicts.c (finalize_conflicts): Rename as...
17476 (free_conflicts): this.
17477
17478 2001-09-22 Akim Demaille <akim@epita.fr>
17479
17480 * src/gram.c (gram_free): Rename back as...
17481 (dummy): this.
17482 (output_token_translations): Free `token_translations'.
17483 * src/symtab.c (free_symtab): Free the tag field.
17484
17485 2001-09-22 Akim Demaille <akim@epita.fr>
17486
17487 Remove `translations' as it is always set to true.
17488
17489 * src/gram.h: Adjust.
17490 * src/reader.c (packsymbols, parse_token_decl): Adjust
17491 * src/print.c (print_grammar): Adjust.
17492 * src/output.c (output_token_translations): Adjust.
17493 * src/lex.c (lex): Adjust.
17494 * src/gram.c: Be sure the set pointers to NULL.
17495 (dummy): Rename as...
17496 (gram_free): this.
17497
17498 2001-09-22 Akim Demaille <akim@epita.fr>
17499
17500 * configure.in: Invoke AM_LIB_DMALLOC.
17501 * src/system.h: Use dmalloc.
17502 * src/LR0.c: Be sure to have pointers initialized to NULL.
17503 (allocate_itemsets): Allocate kernel_items only if needed.
17504
17505 2001-09-22 Akim Demaille <akim@epita.fr>
17506
17507 * configure.in: Bump to 1.29b.
17508 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
17509 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
17510 need xmalloc.c in calc.y.
17511 From Pascal Bart.
17512
17513 2001-09-21 Akim Demaille <akim@epita.fr>
17514
17515 Version 1.29a.
17516 * Makefile.maint, config/config.guess, config/config.sub,
17517 * config/missing: Update from masters.
17518 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
17519 upon package.m4.
17520 * configure.in (ALL_LINGUAS): Add `tr'.
17521
17522 2001-09-21 Akim Demaille <akim@epita.fr>
17523
17524 * tests/Makefile.am (package.m4): Move to...
17525 ($(srcdir)/$(TESTSUITE)): here.
17526
17527 2001-09-20 Akim Demaille <akim@epita.fr>
17528
17529 * src/complain.c: No longer try to be standalone: use system.h.
17530 Don't assume __STDC__ is defined to 1. Just test if it is defined.
17531 * src/complain.h: Likewise.
17532 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
17533 Remove the unused variable `n'.
17534 From Albert Chin-A-Young.
17535
17536 2001-09-18 Marc Autret <autret_m@epita.fr>
17537
17538 * doc/bison.1: Update.
17539 * doc/bison.texinfo (Bison Options): Update --defines and --graph
17540 descriptions.
17541 (Option Cross Key): Update.
17542 Add --graph.
17543
17544 2001-09-18 Marc Autret <autret_m@epita.fr>
17545
17546 * tests/regression.at: New test (comment in %union).
17547
17548 2001-09-18 Marc Autret <autret_m@epita.fr>
17549
17550 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
17551 do that.
17552 Reported by Keith Browne.
17553
17554 2001-09-18 Marc Autret <autret_m@epita.fr>
17555
17556 * tests/output.at: Add tests for --defines and --graph.
17557
17558 2001-09-18 Marc Autret <autret_m@epita.fr>
17559
17560 * tests/output.at: Removes tests of %{header,src}_extension features.
17561
17562 2001-09-18 Akim Demaille <akim@epita.fr>
17563
17564 * tests/Makefile.am (package.m4): New.
17565 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
17566 (_AT_CHECK_CALC_ERROR): Likewise.
17567 Factor the `, ' part of verbose error messages.
17568
17569 2001-09-18 Marc Autret <autret_m@epita.fr>
17570
17571 * src/getargs.c (longopts): Declare --defines and --graph as options
17572 with optional arguments.
17573 * src/files.h: Add extern declarations.
17574 * src/files.c (spec_graph_file, spec_defines_file): New.
17575 (output_files): Update.
17576 Remove CPP-outed code.
17577
17578 2001-09-18 Marc Autret <autret_m@epita.fr>
17579
17580 Turn off %{source,header}_extension feature.
17581
17582 * src/files.c (compute_exts_from_gf): Update.
17583 (compute_exts_from_src): Update.
17584 (output_files): CPP-out useless code.
17585 * src/files.h: Remove {header,source}_extension extern declarations.
17586 * src/reader.c (parse_dquoted_param): CPP-out.
17587 (parse_header_extension_decl): Remove.
17588 (parse_source_extension_decl): Remove.
17589 (read_declarations): Remove cases tok_{hdrext,srcext}.
17590 * src/lex.c (percent_table): Remove {header,source}_extension entries.
17591 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
17592
17593 2001-09-10 Akim Demaille <akim@epita.fr>
17594
17595 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
17596 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
17597 (AT_CHECK_OUTPUT): this.
17598 Merely check ls' exit status, its output is useless.
17599
17600 2001-09-10 Akim Demaille <akim@epita.fr>
17601
17602 * tests/calc.at: Use m4_match.
17603 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
17604
17605 2001-09-10 Marc Autret <autret_m@epita.fr>,
17606 Akim Demaille <akim@epita.fr>
17607
17608 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
17609 enum color_e.
17610 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
17611 to `normal'.
17612 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
17613 * src/lex.h: Adjust prototype.
17614 (token_t): Add `tok_undef'.
17615 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
17616 (parse_percent_token): Now returns token_t.
17617 Add default statement in switch.
17618 (lex): Separate `c' as an input variable, from the token_t result
17619 part.
17620 (unlexed): Is a token_t.
17621
17622 2001-09-10 Akim Demaille <akim@epita.fr>
17623
17624 * configure.in: Bump to 1.29a.
17625
17626 2001-09-07 Akim Demaille <akim@epita.fr>
17627
17628 Version 1.29.
17629
17630 2001-08-30 Akim Demaille <akim@epita.fr>
17631
17632 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
17633 * m4/atconfig.m4: Remove.
17634 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
17635 * tests/bison: New.
17636 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
17637 m4_if, m4_patsubst, and m4_regexp.
17638 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
17639 `input' file instead of echo.
17640
17641 2001-08-29 Akim Demaille <akim@epita.fr>
17642
17643 Bump to 1.28e.
17644
17645 2001-08-29 Akim Demaille <akim@epita.fr>
17646
17647 Version 1.28d.
17648
17649 2001-08-29 Paul Eggert <eggert@twinsun.com>
17650
17651 * src/bison.simple (yyparse): Don't take the address of an
17652 item before the start of an array, as that doesn't conform to
17653 the C Standard.
17654
17655 2001-08-29 Robert Anisko <anisko_r@epita.fr>
17656
17657 * doc/bison.texinfo (Location Tracking Calc): New node.
17658
17659 2001-08-29 Paul Eggert <eggert@twinsun.com>
17660
17661 * src/output.c (output): Do not define const, as this now
17662 causes more problems than it cures.
17663
17664 2001-08-29 Akim Demaille <akim@epita.fr>
17665
17666 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
17667 the nodes.
17668 Be sure to tag the `detailmenu'.
17669
17670 2001-08-29 Akim Demaille <akim@epita.fr>
17671
17672 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
17673 download in a tmp dir.
17674
17675 2001-08-28 Marc Autret <autret_m@epita.fr>
17676
17677 * config/depcomp: New file.
17678
17679 2001-08-28 Marc Autret <autret_m@epita.fr>
17680
17681 * doc/bison.1 (mandoc): Adjust.
17682 From Juan Manuel Guerrero.
17683
17684 2001-08-28 Marc Autret <autret_m@epita.fr>
17685
17686 * src/print_graph.c (print_state): Fix.
17687
17688 2001-08-27 Marc Autret <autret_m@epita.fr>
17689
17690 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
17691 char * members.
17692 Echo modifications to the functions prototypes.
17693 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
17694
17695 2001-08-27 Marc Autret <autret_m@epita.fr>
17696
17697 * src/vcg.c: Include `xalloc.h'.
17698 (add_colorentry): New.
17699 (add_classname): New.
17700 (add_infoname): New.
17701 * src/vcg.h: Add new prototypes.
17702
17703 2001-08-27 Akim Demaille <akim@epita.fr>
17704
17705 * Makefile.maint: Sync. again with CVS Autoconf.
17706
17707 2001-08-27 Akim Demaille <akim@epita.fr>
17708
17709 * Makefile.maint: Formatting changes.
17710 (po-update, cvs-update, update): New targets.
17711 (AMTAR): Remove.
17712
17713 2001-08-27 Akim Demaille <akim@epita.fr>
17714
17715 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17716 * Makefile.maint: Sync. with CVS Autoconf.
17717
17718 2001-08-27 Marc Autret <autret_m@epita.fr>
17719
17720 * src/vcg.h (struct infoname_s): New.
17721 (struct colorentry_s): New.
17722 (graph_s): New fields {vertical,horizontal}_order in structure.
17723 Add `infoname' field.
17724 Add `colorentry' field;
17725 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
17726 (G_HORIZONTAL_ORDER): New.
17727 (G_INFONAME): New.
17728 (G_COLORENTRY): New.
17729 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
17730 Add output of `infoname'.
17731 Add output of `colorentry'.
17732
17733 2001-08-27 Marc Autret <autret_m@epita.fr>
17734
17735 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
17736 This one shadowed a global parameter.
17737
17738 2001-08-24 Marc Autret <autret_m@epita.fr>
17739
17740 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
17741 instead of `unsigned'.
17742 (print_state): Do not call obstack_object_size () in obstack_grow ()
17743 to avoid macro variables shadowing.
17744
17745 2001-08-23 Marc Autret <autret_m@epita.fr>
17746
17747 * src/lex.c (percent_table): Typo: s/naem/name/.
17748 Add graph option.
17749 Normalize new options declarations.
17750
17751 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
17752
17753 * tests/suite.at: Exercise %header_extension and %source_extension.
17754
17755 2001-08-16 Marc Autret <autret_m@epita.fr>
17756
17757 * src/reader.c (parse_dquoted_param): New.
17758 (parse_header_extension_decl): Use it.
17759 (parse_source_extension_decl): Likewise.
17760
17761 2001-08-16 Marc Autret <autret_m@epita.fr>
17762
17763 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
17764 (get_xxxx_str): Use assert () instead of complain ().
17765 Remove return invokations in default cases.
17766 (get_decision_str): Modify default behaviour. Remove second argument.
17767 Echo modifications on calls.
17768 (output_graph): Fix.
17769
17770 2001-08-16 Marc Autret <autret_m@epita.fr>
17771
17772 * src/getargs.c (usage): Update with ``-g, --graph''.
17773
17774 2001-08-16 Marc Autret <autret_m@epita.fr>
17775
17776 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
17777 (Option Cross Key): Likewise.
17778 * doc/bison.1: Update.
17779
177802001-09-25 Pascal Bart <pascal.bart@epita.fr>
17781
17782 * src/output.c (output_master_parser): Don't finish action_obstack.
17783 (output_parser): Don't care about the muscle action, here.
17784 (prepare): Copy the action_obstack in the action muscle.
17785 (output): Free action_obstack.
17786
177872001-09-23 Pascal Bart <pascal.bart@epita.fr>
17788
17789 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
17790 will contain `%union' declaration.
17791 (parse_union_decl): Delete #line directive output.
17792 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
17793 informations about %union.
17794 (parse_union_decl): Copy the union_obstack in the muscle stype.
17795 * src/bison.simple: Add new #line directive.
17796 Add typdef %%stype YYSTYPE.
17797
177982001-09-23 Pascal Bart <pascal.bart@epita.fr>
17799
17800 * src/bison.simple: Add new `#line' directive.
17801
178022001-09-22 Pascal Bart <pascal.bart@epita.fr>
17803
17804 * src/bison.simple: New `#line' directive.
17805 * src/output.c (output_parser): Support new dynamic muscle input_line.
17806
178072001-09-22 Marc Autret <autret_m@epita.fr>
17808
17809 * src/output.c (output_master_parser): New.
17810 (output_parser): Be more re-entrant.
17811
178122001-09-21 Marc Autret <autret_m@epita.fr>
17813
17814 * src/reader.c (copy_definition, parse_union_decl): Update and use
17815 `linef' muscle.
17816 (copy_action): Likewise.
17817 Use obstack_1grow ().
17818 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
17819
178202001-09-21 Marc Autret <autret_m@epita.fr>
17821
17822 * src/options.c (option_table): Adjust.
17823 * src/lex.c (parse_percent_token): Fix.
17824
178252001-09-20 Pascal Bart <pascal.bart@epita.fr>
17826
17827 * src/options.c (symtab.h): Include it, need by lex.h.
17828
178292001-09-20 Pascal Bart <pascal.bart@epita.fr>
17830
17831 * src/lex.c (parse_percent_token): Change type of variable `tx', which
17832 is now an option_table_struct*.
17833 (option_strcmp): New function option_strcmp.
17834 (parse_percent_token): Call option_strcmp.
17835 * src/getargs.c (xalloc.h, options.h): Include it.
17836 (getargs): Call create_long_option_table.
17837 (getargs): Free longopts at the end of the function.
17838 (shortopts): Move in options.c.
17839 * src/options.c (create_long_option_table): New function. Convert
17840 information from option_table to option structure.
17841 * src/reader.c (options.h): Include it.
17842
17843 * src/Makefile.am: Adjust.
17844 * src/options.c (option_table): Create from longopts and percent_table.
17845 * src/getargs.c (longopts): Delete.
17846 * src/lex.c (struct percent_table_struct): Delete.
17847 (percent_table): Delete.
17848 (options.h): Include it.
17849 * src/options.c: Create.
17850 * src/options.h: Create.
17851 Declare enum opt_access_e.
17852 Define struct option_table_struct.
17853
178542001-09-20 Marc Autret <autret_m@epita.fr>
17855
17856 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
17857 sections of Bison.
17858
178592001-09-19 Pascal Bart <pascal.bart@epita.fr>
17860
17861 * src/bison.simple: s/%%filename/%%skeleton.
17862 * src/muscle_tab.c (getargs.h): Include it.
17863 (muscle_init): Insert new muscle skeleton.
17864
178652001-09-18 Pascal Bart <pascal.bart@epita.fr>
17866
17867 * src/output.c (output_parser): Delete unused variable actions_dumped.
17868
178692001-09-07 Pascal Bart <pascal.bart@epita.fr>
17870
17871 * src/output.c (output): Delete call to reader_output_yylsp.
17872 * src/reader.c (reader): Likewise.
17873 * src/reader.h: Delete declaration of reader_output_yylsp.
17874
178752001-09-02 Marc Autret <autret_m@epita.fr>
17876
17877 * src/reader.c: Include muscle_tab.h.
17878 (parse_union_decl): Update.
17879 (parse_macro_decl): Rename parse_muscle_decl.
17880 Update to use renamed functions and variable.
17881 (read_declarations, copy_action, read_additionnal_code, : Updated
17882 with correct variables and functions names.
17883 (packsymbols, reader): Likewise.
17884
17885 * src/reader.h (muscle_obstack): Extern declaration update.
17886
17887 * src/output.c: Include muscle_tab.h
17888 In all functions using macro_insert, change by using muscle_insert ().
17889 (macro_obstack): Rename muscle_obstack.
17890 Echo modifications in the whole file.
17891 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
17892 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
17893 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
17894
17895 * src/muscle_tab.h: Update double inclusion macros.
17896 (macro_entry_s): Rename muscle_entry_s.
17897 Update prototypes.
17898
17899 * src/muscle_tab.c: Include muscle_tab.h.
17900 Rename macro_tabble to muscle_table.
17901 (mhash1, mhash2, mcmp): Use muscle_entry.
17902 (macro_init): Rename muscle_init. Update.
17903 (macro_insert): Rename muscle_insert. Update.
17904 (macro_find): Rename muscle_find. Update.
17905
17906 * src/main.c: Include muscle_tab.h.
17907 (main): Call muscle_init ().
17908 * src/Makefile.am (bison_SOURCES): Echo modifications.
17909
179102001-09-02 Marc Autret <autret_m@epita.fr>
17911
17912 Now the files macro_tab.[ch] are named muscle_tab.[ch].
17913
17914 * src/muscle_tab.c, src/muscle_tab.h: Add files.
17915
179162001-09-02 Marc Autret <autret_m@epita.fr>
17917
17918 * src/macrotab.c, src/macrotab.h: Remove.
17919
179202001-09-01 Pascal Bart <pascal.bart@epita.fr>
17921
17922 * src/reader.c (copy_guard): Use muscle to specify the `#line'
17923 filename.
17924
179252001-09-01 Marc Autret <autret_m@epita.fr>
17926
17927 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
17928 to an explicit value to activate the feature. We do it here.
17929
179302001-08-31 Pascal Bart <pascal.bart@epita.fr>
17931
17932 * src/output.c (prepare): Delete the `filename' muscule insertion.
17933 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
17934 (parse_union_decl): Likewise.
17935 * src/macrotab.c (macro_init): Initialize filename by infile.
17936
179372001-08-31 Marc Autret <autret_m@epita.fr>
17938
17939 * src/bison.simple (YYLSP_NEEDED): New definition.
17940 * src/output.c (prepare): Add macro insertion of `locations_flag'
17941
179422001-08-31 Pascal Bart <pascal.bart@epita.fr>
17943
17944 * src/output.c (prepare): Delete insertion of previous muscles,
17945 and insert the `prefix' muscles.
17946 * src/macrotab.c (macro_init): Likewise.
17947 (macro_init): Initialization prefix directive by `yy'.
17948 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17949 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
17950 yylval, yydebug, yyerror, yynerrs and yyparse.
17951 New directive `#define' to substitute yydebug, ... with option
17952 name_prefix.
17953
179542001-08-31 Pascal Bart <pascal.bart@epita.fr>
17955
17956 * src/main.c (main): Standardize.
17957 * src/output.c (output_table_data, output_parser): Likewise.
17958 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
17959
179602001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
17961
17962 * src/reader.c (read_additionnal_code): Rename %%user_code to
17963 %%epilogue.
17964 * src/output.c (output): Rename %%declarations to %%prologue.
17965 * src/bison.simple: Echo modifications.
17966
179672001-08-31 Marc Autret <autret_m@epita.fr>
17968
17969 * src/reader.c (readgram): CleanUp.
17970 (output_token_defines): Likewise.
17971 (packsymbols): Likewise.
17972 (reader): Likewise.
17973 * src/output.c (output): CPP-out useless code.
17974
179752001-08-31 Pascal Bart <pascal.bart@epita.fr>
17976
17977 * src/reader.c (reader): Delete obsolete call to function
17978 output_trailers and output_headers.
17979 * src/output.h: Remove obsolete functions prototypes of output_headers
17980 and output_trailers.
17981
179822001-08-30 Pascal Bart <pascal.bart@epita.fr>
17983
17984 * src/main.c: Include macrotab.h.
17985 * src/macrotab.h (macro_entry_s): Constify fields.
17986 Adjust functions prototypes.
17987 * src/macrotab.c (macro_insert): Constify key and value.
17988 (macro_find): Constify key.
17989 (macro_insert): Include 'xalloc.h'
17990 (macro_insert): Use XMALLOC.
17991 (macro_find): Constify return value.
17992 * src/output.c (output_table_data): Rename table to table_data.
17993 (output_parser): Constify macro_key, macro_value.
17994
179952001-08-30 Marc Autret <autret_m@epita.fr>
17996
17997 * src/reader.c (parse_skel_decl): New.
17998 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
17999 * src/lex.h (token_t): New token `tok_skel'.
18000 * src/lex.c (percent_table): Add skeleton option entry.
18001 Standardize.
18002
180032001-08-29 Marc Autret <autret_m@epita.fr>
18004
18005 * src/bison.simple: Add %%user_code directive at the end.
18006 * src/reader.c (read_additionnal_code): New.
18007 (reader): Use it.
18008 * src/output.c (output_program): Remove.
18009 (output): Update.
18010
180112001-08-28 Marc Autret <autret_m@epita.fr>
18012
18013 * src/output.c (output_actions): Clean up.
18014 (output_gram): CPP-out useless code.
18015 * src/reader.c (reader): Clean up, CPP-out useless code.
18016
180172001-08-28 Pascal Bart <pascal.bart@epita.fr>
18018
18019 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
18020 directive.
18021 * src/bison.simple: Add `%%definitions'.
18022
180232001-08-28 Marc Autret <autret_m@epita.fr>
18024
18025 * config/depcomp: New file.
18026
180272001-08-27 Paul Eggert <eggert@twinsun.com>
18028
18029 * src/bison.simple (yyparse): Don't take the address of an
18030 item before the start of an array, as that doesn't conform to
18031 the C Standard.
18032
180332001-08-27 Robert Anisko <robert.anisko@epita.fr>
18034
18035 * src/output.c (output): Remove the initialization of the macro
18036 obstack. It was done too late here.
18037
18038 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
18039 completely wrong.
18040 (reader): Initialize the macro obstack here, since we need it to grow
18041 '%define' directives.
18042
18043 * src/reader.h: Declare the macro obstack as extern.
18044
180452001-08-27 Robert Anisko <robert.anisko@epita.fr>
18046
18047 * src/output.c (output_parser): Fix. Store single '%' characters in
18048 the output obstack instead of throwing them away.
18049
180502001-08-27 Akim Demaille <akim@epita.fr>
18051
18052 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
18053
180542001-08-25 Robert Anisko <robert.anisko@epita.fr>
18055
18056 * lib/Makefile.am: Adjust.
18057
180582001-08-25 Robert Anisko <robert.anisko@epita.fr>
18059
18060 * src/bison.simple: Update and add '%%' directives.
18061
180622001-08-25 Robert Anisko <robert.anisko@epita.fr>
18063
18064 * src/reader.c (reader): Remove calls to 'output_headers' and
18065 'output_trailers'. Remove some C output.
18066 (readgram): Disable a piece of code that was writing a default
18067 definition for 'YYSTYPE'.
18068 (reader_output_yylsp): Remove.
18069 (packsymbols): Output token defintions to a macro.
18070 (copy_definition): Disable C output.
18071
18072 * src/reader.c (parse_macro_decl): New function used to parse macro
18073 declarations.
18074 (copy_string2): Put the body of copy_string into this new function.
18075 Add a parameter to let the caller choose whether he wants to copy the
18076 string delimiters or not.
18077 (copy_string): Be a simple call to copy_string2 with the last argument
18078 bound to true.
18079 (read_declarations): Add case for macro definition.
18080 (copy_identifier): New.
18081 (parse_macro_decl): Read macro identifiers using copy_identifier
18082 rather than lex.
18083
180842001-08-25 Robert Anisko <robert.anisko@epita.fr>
18085
18086 * src/output.c (prepare): Add prefixed names.
18087 (output_parser): Output semantic actions.
18088 (output_parser): Fix bug on '%%line' directives.
18089
18090 * src/output.c (output_headers): Remove. The C code printed by this
18091 function should now be in the skeletons.
18092 (output_trailers): Remove.
18093 (output): Disable call to 'reader_output_yylsp'.
18094 (output_rule_data): Do not output tables to the table obstack.
18095
18096 * src/output.c: Remove some C dedicated output.
18097 Improve the use of macro and output obstacks.
18098 (output_defines): Remove.
18099
18100 * src/output.c (output_token_translations): Associate 'translate'
18101 table with a macro. No output to the table obstack.
18102 (output_gram): Same for 'rhs' and 'prhs'.
18103 (output_stos): Same for 'stos'.
18104 (output_rule_data): Same for 'r1' and 'r2'.
18105 (token_actions): Same for 'defact'.
18106 (goto_actions): Same for 'defgoto'.
18107 (output_base): Same for 'pact' and 'pgoto'.
18108 (output_table): Same for 'table'.
18109 (output_check): Same for 'check'.
18110
18111 * src/output.c (output_table_data): New function.
18112 (output_short_table): Remove.
18113 (output_short_or_char_table): Remove.
18114
18115 * src/output.c (output_parser): Replace most of the skeleton copy code
18116 with something new. Skeletons are now processed character by character
18117 rather than line by line, and Bison looks for '%%' macros. This is the
18118 first step in making Bison's output process (a lot) more flexible.
18119 (output_parser): Use the macro table.
18120
181212001-08-25 Robert Anisko <robert.anisko@epita.fr>
18122
18123 * src/main.c (main): Initialize the macro table.
18124
181252001-08-25 Robert Anisko <robert.anisko@epita.fr>
18126
18127 * src/lex.c (percent_table): Add tok_define.
18128 * src/lex.h: Add tok_define.
18129
181302001-08-25 Robert Anisko <robert.anisko@epita.fr>
18131
18132 * src/macrotab.c: New file.
18133 * src/macrotab.h: New file.
18134 * src/Makefile.am: Update.
18135
181362001-08-25 Robert Anisko <robert.anisko@epita.fr>
18137
18138 * lib/hash.c: New file.
18139 * lib/hash.h: New file.
18140 * lib/Makefile.am: Update.
18141
181422001-08-15 Akim Demaille <akim@epita.fr>
18143
18144 Version 1.28c.
18145
181462001-08-15 Marc Autret <autret_m@epita.fr>
18147
18148 * src/reader.c (readgram): Indent output macro YYSTYPE.
18149 (packsymbols): Likewise.
18150 (output_token_defines): Likewise.
18151 * src/files.c: Standardize.
18152 (compute_header_macro): New.
18153 (defines_obstack_save): New. Use compute_header_macro.
18154 (output_files): Update. Use defines_obstack_save.
18155
181562001-08-15 Akim Demaille <akim@epita.fr>
18157
18158 * doc/bison.texinfo (Table of Symbols): Document
18159 YYSTACK_USE_ALLOCA.
18160
181612001-08-15 Akim Demaille <akim@epita.fr>
18162
18163 * missing: Update from CVS Automake.
18164 * config/config.guess, config/config.sub, config/texinfo.tex:
18165 Update from gnu.org.
18166
181672001-08-15 Akim Demaille <akim@epita.fr>
18168
18169 * Makefile.maint: Sync with CVS Autoconf.
18170
181712001-08-14 Pascal Bart <pascal.bart@epita.fr>
18172
18173 * doc/bison.texinfo: Include GNU Free Documentation License from
18174 `fdl.texi'.
18175 * doc/fdl.texi: Add to package.
18176
181772001-08-14 Marc Autret <autret_m@epita.fr>
18178
18179 Turn on %{source,header}_extension features.
18180
18181 * src/lex.c (percent_table): Un-CPP out header_extension and
18182 source_extension.
18183 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
18184 (compute_exts_from_src): Remove conditions. It restores priorities
18185 between options.
18186
181872001-08-14 Marc Autret <autret_m@epita.fr>
18188
18189 * src/files.c (compute_base_names): Add extensions computing when
18190 `--file-prefix' used.
18191 Standardize function calls.
18192
181932001-08-13 Marc Autret <autret_m@epita.fr>
18194
18195 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
18196 defining it (defined but null disables alloca).
18197
181982001-08-13 Marc Autret <autret_m@epita.fr>
18199
18200 * src/bison.simple (_yy_memcpy): CPP reformat.
18201
182022001-08-13 Pascal Bart <pascal.bart@epita.fr>
18203
18204 * tests/atconfig.in (CPPFLAGS): Fix.
18205
182062001-08-10 Pascal Bart <pascal.bart@epita.fr>
18207
18208 * doc/bison.texinfo: Include GNU General Public License from
18209 `gpl.texi'.
18210 * doc/gpl.texi: Add to package.
18211
182122001-08-10 Marc Autret <autret_m@epita.fr>
18213
18214 * src/print_graph.h: Fix.
18215 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
18216
182172001-08-10 Akim Demaille <akim@epita.fr>
18218
18219 * src/system.h: Provide default declarations for stpcpy, strndup,
18220 and strnlen.
18221
182222001-08-10 Robert Anisko <anisko_r@epita.fr>
18223
18224 * doc/bison.texinfo (Locations): Update @$ stuff.
18225
182262001-08-09 Robert Anisko <anisko_r@epita.fr>
18227
18228 * src/bison.simple (YYLLOC_DEFAULT): Update.
18229 (yyparse): Adjust.
18230
182312001-08-08 Marc Autret <autret_m@epita.fr>
18232
18233 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
18234 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
18235 Reported by Fabrice Bauzac.
18236
182372001-08-08 Marc Autret <autret_m@epita.fr>
18238
18239 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
18240 * src/vcg.c (output_node): Fix.
18241 * src/vcg.h: Cleanup.
18242 * src/print_graph.c: Add comments.
18243 (node_output_size): New global variable. Simplify the formatting of
18244 the VCG graph output.
18245 (print_actions): Unused code is now used. It notifies the final state
18246 and no action states in the VCG graph. It also give the reduce actions.
18247 The `shift and goto' edges are red and the `go to state' edges are
18248 blue.
18249 Get the current node name and node_obstack by argument.
18250 (node_obstack): New variable.
18251 (print_state): Manage node_obstack.
18252 (print_core): Use node_obstack given by argument.
18253 A node is not only computed here but in print_actions also.
18254 (print_graph): CPP out useless code instead of commenting it.
18255
182562001-08-07 Pascal Bart <pascal.bart@epita.fr>
18257
18258 * tests/atconfig.in (CPPFLAGS): Fix.
18259
182602001-08-07 Akim Demaille <akim@epita.fr>
18261
18262 * src/print_graph.c (quote): New.
18263 (print_core): Use it.
18264
182652001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
18266
18267 * src/vcg.c (complain.h): Include it.
18268 Unepitaize `return' invocations.
18269 [NDEBUG] (main): Remove.
18270 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
18271 * src/files.c (open_files): Initialize graph_obstack.
18272 * src/print_graph.c (print_actions): CPP out useless code.
18273 (print_core): Don't output the last `\n' in labels.
18274 Use `quote'.
18275 * src/files.c (output_files): Output the VCG file.
18276 * src/main.c (main): Invoke print_graph ();
18277
182782001-08-06 Marc Autret <autret_m@epita.fr>
18279
18280 Automaton VCG graph output.
18281 Using option ``-g'' or long option ``--graph'', you can generate
18282 a gram_filename.vcg file containing a VCG description of the LALR (1)
18283 automaton of your grammar.
18284
18285 * src/main.c: Call to print_graph() function.
18286 * src/getargs.h: Update.
18287 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
18288 (graph_flag): New flag.
18289 (longopts): Update.
18290 (getargs): Add case `g'.
18291 * src/files.c (graph_obstack): New obstack struct.
18292 (open_files): Initialize new obstack.
18293 (output_files): Saves graph_obstack if required.
18294 * src/files.h (graph_obstack): New extern declaration.
18295 * src/Makefile.am: Add new source files.
18296
182972001-08-06 Marc Autret <autret_m@epita.fr>
18298
18299 * src/print_graph.c, src/print_graph.h (graph): New.
18300 * src/vcg.h: New file.
18301 * src/vcg.c: New file, VCG graph handling.
18302
183032001-08-06 Marc Autret <autret_m@epita.fr>
18304
18305 Add of %source_extension and %header_extension which specify
18306 the source or/and the header output file extension.
18307
18308 * src/files.c (compute_base_names): Remove initialisation of
18309 src_extension and header_extension.
18310 (compute_exts_from_gf): Update.
18311 (compute_exts_from_src): Update.
18312 (output_files): Update.
18313 * src/reader.c (parse_header_extension_decl): New.
18314 (parse_source_extension_decl): New.
18315 (read_declarations): New case statements for the new tokens.
18316 * src/lex.c (percent_table): Add entries for %source_extension
18317 and %header_extension.
18318 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
18319
183202001-08-06 Marc Autret <autret_m@epita.fr>
18321
18322 * configure.in: Bump to 1.28c.
18323 * doc/bison.texinfo: Texinfo thingies.
18324
183252001-08-04 Pascal Bart <pascal.bart@epita.fr>
18326
18327 * tests/atconfig.in (CPPFLAGS): Add.
18328 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
18329
183302001-08-03 Akim Demaille <akim@epita.fr>
18331
18332 Version 1.28b.
18333
183342001-08-03 Akim Demaille <akim@epita.fr>
18335
18336 * tests/Makefile.am (check-local): Ship testsuite.
18337 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
18338 Include `string.h'.
18339
183402001-08-03 Akim Demaille <akim@epita.fr>
18341
18342 * configure.in: Try using -Wformat when compiling.
18343
183442001-08-03 Akim Demaille <akim@epita.fr>
18345
18346 * configure.in: Bump to 1.28b.
18347
183482001-08-03 Akim Demaille <akim@epita.fr>
18349
18350 * src/complain.c: Adjust strerror_r portability issues.
18351
183522001-08-03 Akim Demaille <akim@epita.fr>
18353
18354 Version 1.28a.
18355
183562001-08-03 Akim Demaille <akim@epita.fr>
18357
18358 * src/getargs.c, src/getarg.h (skeleton)): Constify.
18359 * src/lex.c (literalchar): Avoid name clashes on `buf'.
18360 * src/getargs.c: Include complain.h.
18361 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
18362 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
18363
183642001-08-03 Akim Demaille <akim@epita.fr>
18365
18366 * src/reader.c (readgram): Display hidden chars in error messages.
18367
183682001-08-03 Akim Demaille <akim@epita.fr>
18369
18370 Update to gettext 0.10.39.
18371
183722001-08-03 Akim Demaille <akim@epita.fr>
18373
18374 * lib/strspn.c: New.
18375
183762001-08-01 Marc Autret <autret_m@epita.fr>
18377
18378 * doc/bison.texinfo: Update.
18379 * doc/bison.1 (mandoc): Update.
18380 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
18381 * src/files.c: Support output files extensions computing.
18382 (src_extension): New static variable.
18383 (header_extension): New static variable.
18384 (tr): New function.
18385 (get_extension_index): New function, gets the index of an extension
18386 filename in a string.
18387 (compute_exts_from_gf): New function, computes extensions from the
18388 grammar file extension.
18389 (compute_exts_from_src): New functions, computes extensions from the
18390 C source file extension, file given by ``-o'' option.
18391 (compute_base_names): Update.
18392 (output_files): Update.
18393
183942001-08-01 Robert Anisko <anisko_r@epita.fr>
18395
18396 * doc/bison.texi: Document @$.
18397 (Locations): New section.
18398
183992001-07-18 Akim Demaille <akim@epita.fr>
18400
18401 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
18402 * config/prev-version.txt, config/move-if-change: New.
18403 * Makefile.am: Adjust.
18404
184052001-07-08 Pascal Bart <pascal.bart@epita.fr>
18406
18407 * src/bison.simple (yyparse): Suppress warning `comparaison
18408 between signed and unsigned'.
18409
184102001-07-05 Pascal Bart <pascal.bart@epita.fr>
18411
18412 * src/getargs.h (raw_flag): Remove.
18413 * src/getargs.c: Die on `-r'/`--raw'.
18414 * src/lex.c (parse_percent_token): Die on `%raw'.
18415 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
18416 * tests/calc.at: Suppress test with option `--raw'.
18417
184182001-07-14 Akim Demaille <akim@epita.fr>
18419
18420 * config/: New.
18421 * configure.in: Require Autoconf 2.50.
18422 Update to gettext 0.10.38.
18423
184242001-03-16 Akim Demaille <akim@epita.fr>
18425
18426 * doc/bison.texinfo: ANSIfy the examples.
18427
184282001-03-16 Akim Demaille <akim@epita.fr>
18429
18430 * getargs.c (skeleton): New variable.
18431 (longopts): --skeleton is a new option.
18432 (shortopts, getargs): -S is a new option.
18433 * getargs.h: Declare skeleton.
18434 * output.c (output_parser): Use it.
18435
184362001-03-16 Akim Demaille <akim@epita.fr>
18437
18438 * m4/strerror_r.m4: New.
18439 * m4/error.m4: Run AC_FUNC_STRERROR_R.
18440 * lib/error.h, lib/error.c: Update.
18441
184422001-03-16 Akim Demaille <akim@epita.fr>
18443
18444 * src/getargs.c (longopts): Clean up.
18445
184462001-02-21 Akim Demaille <akim@epita.fr>
18447
18448 * src/reader.c (gensym): `gensym_count' is your own.
18449 Use a static buf to create the symbol name, as token_buffer is no
18450 longer a buffer.
18451
184522001-02-08 Akim Demaille <akim@epita.fr>
18453
18454 * src/conflicts.c (conflict_report): Be sure not to append to res
18455 between two calls, which could happen if both first sprintf were
18456 skipped, but not the first cp += strlen.
18457
184582001-02-08 Akim Demaille <akim@epita.fr>
18459
18460 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
18461 New, from fileutils 4.0.37.
18462 * configure.in: Require Autoconf 2.49c. I took some time before
18463 making this decision. This is the only way out for portability
18464 issues in Bison, it would mean way too much duplicate effort to
18465 import in Bison features implemented in 2.49c since 2.13.
18466 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
18467
184682001-02-02 Akim Demaille <akim@epita.fr>
18469
18470 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
18471 * lib/xalloc.h, lib/xmalloc.c: Update.
18472
184732001-01-19 Akim Demaille <akim@epita.fr>
18474
18475 Get rid of the ad hoc handling of token_buffer in the scanner: use
18476 the obstacks.
18477
18478 * src/lex.c (token_obstack): New.
18479 (init_lex): Initialize it. No longer call...
18480 (grow_token_buffer): this. Remove it.
18481 Adjust all the places which used it to use the obstack.
18482
184832001-01-19 Akim Demaille <akim@epita.fr>
18484
18485 * src/lex.h: Rename all the tokens:
18486 s/\bENDFILE\b/tok_eof/g;
18487 s/\bIDENTIFIER\b/tok_identifier/g;
18488 etc.
18489 Let them be enums, not #define, to ease debugging.
18490 Adjust all the code.
18491
184922001-01-18 Akim Demaille <akim@epita.fr>
18493
18494 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
18495 * src/lex.c (maxtoken, grow_token_buffer): Static.
18496
184972001-01-18 Akim Demaille <akim@epita.fr>
18498
18499 Since we now use obstacks, more % directives can be enabled.
18500
18501 * src/lex.c (percent_table): Also accept `%yacc',
18502 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
18503 `%debug'.
18504 Handle the actions for `%semantic_parser' and `%pure_parser' here,
18505 instead of returning a token.
18506 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
18507 * src/reader.c (read_declarations): Adjust.
18508 * src/files.c (open_files): Don't call `compute_base_names', don't
18509 compute `attrsfile' since they depend upon data which might be
18510 *in* the input file now.
18511 (output_files): Do it here.
18512 * src/output.c (output_headers): Document the fact that this patch
18513 introduces a guaranteed SEGV for semantic parsers.
18514 * doc/bison.texinfo: Document them.
18515 * tests/suite.at: Exercise these %options.
18516
185172000-12-20 Akim Demaille <akim@epita.fr>
18518
18519 Also handle the output file (--verbose) with obstacks.
18520
18521 * files.c (foutput): Remove.
18522 (output_obstack): New.
18523 Adjust all dependencies.
18524 * src/conflicts.c: Return a string.
18525 * src/system.h (obstack_grow_string): Rename as...
18526 (obstack_sgrow): this. Be ready to work with non literals.
18527 (obstack_fgrow4): New.
18528
185292000-12-20 Akim Demaille <akim@epita.fr>
18530
18531 * src/files.c (open_files): Fix the computation of short_base_name
18532 in the case of `-o foo.tab.c'.
18533
185342000-12-20 Akim Demaille <akim@epita.fr>
18535
18536 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
18537 (copy_dollar): Now that everything uses obstacks, get rid of the
18538 FILE * parameters.
18539
185402000-12-20 Akim Demaille <akim@epita.fr>
18541
18542 * src/files.c (open_files): Actually the `.output' file is based
18543 on the short_base_name, not base_name.
18544 * tests/suite.at (Checking output file names): Adjust.
18545
185462000-12-20 Akim Demaille <akim@epita.fr>
18547
18548 * src/bison.s1: Remove, we now use directly...
18549 * src/bison.simple: this.
18550 * src/Makefile.am: Use pkgdata instead of data.
18551
185522000-12-20 Akim Demaille <akim@epita.fr>
18553
18554 * src/files.c (guard_obstack): New.
18555 (open_files): Initialize it.
18556 (output_files): Dump it...
18557 * src/files.h: Export it.
18558 * src/reader.c (copy_guard): Use it.
18559
185602000-12-19 Akim Demaille <akim@epita.fr>
18561
18562 * src/files.c (outfile, defsfile, actfile): Removed as global
18563 vars.
18564 (open_files): Don't compute them.
18565 (output_files): Adjust.
18566 (base_name, short_base_name): Be global.
18567 Adjust dependencies.
18568
185692000-12-19 Akim Demaille <akim@epita.fr>
18570
18571 * src/files.c (strsuffix): New.
18572 (stringappend): Be just like strcat but allocate.
18573 (base_names): Eve out from open_files.
18574 Try to simplify the rather hairy computation of base_name and
18575 short_base_name.
18576 (open_files): Use it.
18577 * tests/suite.at (Checking output file names): New test.
18578
185792000-12-19 Akim Demaille <akim@epita.fr>
18580
18581 * src/system.h (obstack_grow_literal_string): Rename as...
18582 (obstack_grow_string): this.
18583 * src/output.c (output_parser): Recognize `%% actions' instead of
18584 `$'.
18585 * src/bison.s1: s/$/%% actions/.
18586 * src/bison.hairy: Likewise.
18587
185882000-12-19 Akim Demaille <akim@epita.fr>
18589
18590 * src/output.c (output_parser): Compute the `#line' lines when
18591 there are.
18592 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
18593 Suggested by Hans Aberg.
18594
185952000-12-19 Akim Demaille <akim@epita.fr>
18596
18597 Let the handling of the skeleton files be local to the procedures
18598 that use it.
18599
18600 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
18601 longer static.
18602 (fparser, open_extra_files): Remove.
18603 (open_files, output_files): Don't take care of fparser.
18604 * src/files.h: Adjust.
18605 * src/output.c (output_parser): Open and close the file to the
18606 skeleton.
18607 * src/reader.c (read_declarations): When %semantic_parser, open
18608 fguard.
18609
186102000-12-19 Akim Demaille <akim@epita.fr>
18611
18612 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
18613 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
18614
186152000-12-19 Akim Demaille <akim@epita.fr>
18616
18617 * src/files.c (open_files): Yipee! We no longer need all the code
18618 looking for `/tmp' since we have no tmp file.
18619
186202000-12-19 Akim Demaille <akim@epita.fr>
18621
18622 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
18623 New macros.
18624 * src/files.c (open_files): Less dependency on MSDOS etc.
18625
186262000-12-14 Akim Demaille <akim@epita.fr>
18627
18628 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
18629 Provide a default definition.
18630 Use it when executing the default @ action.
18631 * src/reader.c (reader_output_yylsp): No longer include
18632 `timestamp' and `text' in the default YYLTYPE.
18633
186342000-12-12 Akim Demaille <akim@epita.fr>
18635
18636 * src/reader.c (copy_definition, parse_union_decl, copy_action)
18637 (copy_guard): Quote the file names.
18638 Reported by Laurent Mascherpa.
18639
186402000-12-12 Akim Demaille <akim@epita.fr>
18641
18642 * src/output.c (output_headers, output_program, output): Be sure
18643 to escape special characters when outputting filenames.
18644 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
18645 (output_headers): Don't depend on them, Use ACTSTR.
18646
186472000-11-17 Akim Demaille <akim@epita.fr>
18648
18649 * lib/obstack.h: Formatting changes.
18650 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
18651 prevents type checking.
18652 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
18653 cast the value to (void *): assigning a `foo *' to a `void *'
18654 variable is valid.
18655 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
18656 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
18657 append characters.
18658
186592000-11-17 Akim Demaille <akim@epita.fr>
18660
18661 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
18662 as...
18663 (suite.m4, regression.m4, calc.m4): these.
18664 * tests/atgeneral.m4: Update from CVS Autoconf.
18665
186662000-11-17 Akim Demaille <akim@epita.fr>
18667
18668 * tests/regression.m4 (%union and --defines): New test,
18669 demonstrating a current bug in the obstack implementation.
18670
186712000-11-17 Akim Demaille <akim@epita.fr>
18672
18673 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
18674 macros.
18675 Use them to declare the variables which are global or local to
18676 `yyparse'.
18677
186782000-11-17 Akim Demaille <akim@epita.fr>
18679
18680 * acconfig.h: Remove, no longer used.
18681
186822000-11-07 Akim Demaille <akim@epita.fr>
18683
18684 * src: s/Copyright (C)/Copyright/g.
18685
186862000-11-07 Akim Demaille <akim@epita.fr>
18687
18688 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
18689 defining.
18690 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
18691
186922000-11-07 Akim Demaille <akim@epita.fr>
18693
18694 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
18695 Merge in a single CPP if/else.
18696
186972000-11-07 Akim Demaille <akim@epita.fr>
18698
18699 * src/output.c (output): Remove useless variables.
18700 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
18701 argument `data' for consistency with the prototypes.
18702 Qualify it `const'.
18703 (obstack_copy, obstack_copy0): Rename the second argument as
18704 `address' for consistency. Qualify it `const'.
18705 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
18706 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
18707 `const' their input argument (`data' or `address').
18708 Adjust the corresponding macros to include `const' in casts.
18709
187102000-11-03 Akim Demaille <akim@epita.fr>
18711
18712 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
18713 s/PFILE1/BISON_HAIRY/.
18714 Adjust dependencies.
18715
187162000-11-03 Akim Demaille <akim@epita.fr>
18717
18718 For some reason, this was not applied.
18719
18720 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18721 `unlink': it's no longer used.
18722
187232000-11-03 Akim Demaille <akim@epita.fr>
18724
18725 * src/files.c (skeleton_find): New function, eved out of...
18726 (open_files, open_extra_files): here.
18727
187282000-11-03 Akim Demaille <akim@epita.fr>
18729
18730 Don't use `atexit'.
18731
18732 * src/files.c (obstack_save): New function.
18733 (done): Rename as...
18734 (output_files): this.
18735 Use `obstack_save'.
18736 * src/main.c (main): Don't use `atexit' to register `done', since
18737 it no longer has to remove tmp files, just call `output_files'
18738 when there are no errors.
18739
187402000-11-02 Akim Demaille <akim@epita.fr>
18741
18742 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18743 `unlink': it's no longer used.
18744 * src/files.h: Formatting changes.
18745
187462000-11-02 Akim Demaille <akim@epita.fr>
18747
18748 Remove the last uses of mktemp and unlink/delete.
18749
18750 * src/files.c (fdefines, ftable): Removed.
18751 (defines_ostack, table_obstack): New.
18752 Adjust dependencies of the former into uses of the latter.
18753 * src/output.c (output_short_or_char_table, output_short_table):
18754 Convert to using obstacks.
18755 * src/reader.c (copy_comment2): Accept one FILE * and two
18756 obstacks.
18757 (output_token_defines, reader_output_yylsp): Use obstacks.
18758 * src/system.h (obstack_fgrow3): New.
18759 * po/POTFILES.in: Adjust.
18760
187612000-11-01 Akim Demaille <akim@epita.fr>
18762
18763 Change each use of `fattrs' into a use of `attrs_obstack'.
18764
18765 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
18766 * src/files.c (fattrs): Remove.
18767 (attrs_obstack): New.
18768 Adjust all dependencies.
18769 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
18770
187712000-11-01 Akim Demaille <akim@epita.fr>
18772
18773 Introduce obstacks.
18774 Change each use of `faction' into a use of `action_obstack'.
18775
18776 * lib/obstack.h, lib/obstack.c: New files.
18777 * src/files.c (faction): Remove.
18778 (action_obstack): New.
18779 Adjust all dependencies.
18780
187812000-10-20 Akim Demaille <akim@epita.fr>
18782
18783 * lib/quote.h (PARAMS): New macro. Use it.
18784
187852000-10-16 Akim Demaille <akim@epita.fr>
18786
18787 * src/output.c (output_short_or_char_table): New function.
18788 (output_short_table, output_token_translations): Use it.
18789 (goto_actions): Use output_short_table.
18790
187912000-10-16 Akim Demaille <akim@epita.fr>
18792
18793 * src/symtab.c (bucket_new): New function.
18794 (getsym): Use it.
18795
18796 * src/output.c (output_short_table): New argument to display the
18797 comment associated with the table.
18798 Adjust dependencies.
18799 (output_gram): Use it.
18800 (output_rule_data): Nicer output layout for YYTNAME.
18801
188022000-10-16 Akim Demaille <akim@epita.fr>
18803
18804 * src/lex.c (read_typename): New function.
18805 (lex): Use it.
18806 * src/reader.c (copy_dollar): Likewise.
18807
188082000-10-16 Akim Demaille <akim@epita.fr>
18809
18810 * src/reader.c (copy_comment2): Expect the input stream to be on
18811 the `/' which is suspected to open a comment, instead of being
18812 called after `//' or `/*' was read.
18813 (copy_comment, copy_definition, parse_union_decl, copy_action)
18814 (copy_guard): Adjust.
18815
188162000-10-16 Akim Demaille <akim@epita.fr>
18817
18818 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
18819 `read_signed_integer'.
18820
188212000-10-16 Akim Demaille <akim@epita.fr>
18822
18823 * src/reader.c (copy_dollar): New function.
18824 (copy_guard, copy_action): Use it.
18825
188262000-10-16 Akim Demaille <akim@epita.fr>
18827
18828 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
18829 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
18830 New files, from Fileutils 4.0.27.
18831 * src/main.c (printable_version): Remove.
18832 * src/lex.c, src/reader.c: Use `quote'.
18833
188342000-10-04 Akim Demaille <akim@epita.fr>
18835
18836 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
18837
188382000-10-04 Akim Demaille <akim@epita.fr>
18839
18840 * doc/bison.texinfo: Various typos spotted by Neil Booth.
18841
188422000-10-04 Akim Demaille <akim@epita.fr>
18843
18844 When a literal string is used to define two different tokens,
18845 `bison -v' segfaults.
18846 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
18847
18848 * tests/regression.m4: New file.
18849 Include the core of the sample provided by Piotr Gackiewicz.
18850 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
18851 properly.
18852
188532000-10-04 Akim Demaille <akim@epita.fr>
18854
18855 * src/reader.c (parse_expect_decl): Keep `count' within the size
18856 of `buffer'.
18857 From Neil Booth.
18858
188592000-10-02 Paul Eggert <eggert@twinsun.com>
18860
18861 * bison.s1 (yyparse): Assign the default value
18862 unconditionally, to avoid a GCC warning and make the parser a
18863 tad smaller.
18864
188652000-10-02 Akim Demaille <akim@epita.fr>
18866
18867 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
18868 options.
18869
188702000-10-02 Akim Demaille <akim@epita.fr>
18871
18872 * src/derives.c, src/print.c, src/reduce.c: To ease the
18873 translation, move some `\n' out of the translated strings.
18874
188752000-10-02 Akim Demaille <akim@epita.fr>
18876
18877 The location tracking mechanism is precious for parse error
18878 messages. Nevertheless, it is enabled only when `@n' is used in
18879 the grammar, which is a different issue (you can use it in error
18880 message, but not in the grammar per se). Therefore, there should
18881 be another means to enable it.
18882
18883 * src/getargs.c (getargs): Support `--locations'.
18884 (usage): Report it.
18885 * src/getargs.h (locationsflag): Export it.
18886 * src/lex.c (percent_table): Support `%locations'.
18887 * src/reader.c (yylsp_needed): Remove this variable, now replaced
18888 with `locationsflag'.
18889 * doc/bison.texinfo: Document `--locations' and `%locations'.
18890 Sort the options.
18891 * tests/calc.m4: Test it.
18892
18893 For regularity of the names, replace each
18894 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
18895 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
18896 In addition replace each `flag' with `_flag'.
18897
188982000-10-02 Akim Demaille <akim@epita.fr>
18899
18900 Also test parse error messages, including with YYERROR_VERBOSE.
18901
18902 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
18903 associative).
18904 Use it to check the computations.
18905 Use it to check `nonassoc' is honored.
18906 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
18907 `--yyerror-verbose'.
18908 (_AT_CHECK_CALC): Adjust to this option.
18909 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
18910
189112000-10-02 Akim Demaille <akim@epita.fr>
18912
18913 Test also `--verbose', `--defines' and `--name-prefix'. Testing
18914 the latter demonstrates a flaw in the handling of non debugging
18915 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
18916 was used in order to simplify:
18917
18918 #if YYDEBUG
18919 if (yydebug)
18920 {
18921 ...
18922 }
18923 #endif
18924
18925 into
18926
18927 if (yydebug)
18928 {
18929 ...
18930 }
18931
18932 unfortunately this leads to a CPP conflict when
18933 `--name-prefix=foo' is used since it produces `#define yydebug
18934 foodebug'.
18935
18936 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
18937 (YYDPRINTF): New macro.
18938 Spread its use.
18939 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
18940 the bison options.
18941 Also test `--verbose', `--defines' and `--name-prefix'.
18942
189432000-10-02 Akim Demaille <akim@epita.fr>
18944
18945 Improve the readability of the produced parsers.
18946
18947 * src/bison.s1: Formatting changes.
18948 Improve the comment related to the `$' mark.
18949 (yydefault): Don't fall through to `yyresume': `goto' there.
18950 * src/output.c (output_parser): When the `$' is met, skip the end
18951 of its line.
18952 New variable, `number_of_dollar_signs', to check there's exactly
18953 one `$' in the parser skeleton.
18954
189552000-10-02 Akim Demaille <akim@epita.fr>
18956
18957 * lib/xstrdup.c: New file, from the fileutils.
18958 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
18959 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
18960 instead of strlen + xmalloc + strcpy.
18961 * src/symtab.c (copys): Remove, use xstrdup instead.
18962
189632000-10-02 Akim Demaille <akim@epita.fr>
18964
18965 * src/gram.h (associativity): New enum type which replaces the
18966 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
18967 `right_assoc', `left_assoc' and `non_assoc'.
18968 Adjust all dependencies.
18969 * src/reader.c: Formatting changes.
18970 (LTYPESTR): Don't define it, use it as a literal in
18971 `reader_output_yylsp'.
18972 * src/symtab.h (symbol_class): New enum type which replaces the
18973 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
18974 `sunknown', `stoken and `snterm'.
18975
189762000-10-02 Akim Demaille <akim@epita.fr>
18977
18978 * src/getargs.c (fixed_outfiles): Rename as...
18979 (yaccflag): for consistency and accuracy.
18980 Adjust dependencies.
18981
189822000-10-02 Akim Demaille <akim@epita.fr>
18983
18984 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
18985 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
18986 difficult and introduced a lot of core dump. It turns out that
18987 Bison used an implementation of `xmalloc' based on `calloc', and
18988 at various places it does depend upon the initialization to 0. I
18989 have not tried to isolate the pertinent places, and all the former
18990 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
18991 someone should address this issue.
18992
18993 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
18994 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
18995 files.
18996 Adjust dependencies.
18997 * src/warshall.h: New file.
18998 Propagate.
18999
190002000-10-02 Akim Demaille <akim@epita.fr>
19001
19002 Various anti-`extern in *.c' changes.
19003
19004 * src/system.h: Include `assert.h'.
19005
190062000-10-02 Akim Demaille <akim@epita.fr>
19007
19008 * src/state.h (nstates, final_state, first_state, first_shift)
19009 (first_reduction): Move their exportation from here...
19010 * src/LR0.h: to here.
19011 Adjust dependencies.
19012 * src/getargs.c (statisticsflag): New variable.
19013 Add support for `--statistics'.
19014 Adjust dependencies.
19015
19016 Remove a lot of now useless `extern' statements in most files.
19017
190182000-10-02 Akim Demaille <akim@epita.fr>
19019
19020 * src/LR0.h: New file.
19021 Propagate its use.
19022
190232000-10-02 Akim Demaille <akim@epita.fr>
19024
19025 * src/print.h: New file.
19026 Propagate its use.
19027 * src/print.c: Formatting and ordering changes.
19028 (verbose, terse): Replace with...
19029 (print_results): this new function.
19030 Adjust dependencies.
19031
190322000-10-02 Akim Demaille <akim@epita.fr>
19033
19034 * src/conflicts.c (conflict_report): New function.
19035 (conflict_log, verbose_conflict_log): Replace with...
19036 (print_conflicts): this function.
19037 Adjust dependencies.
19038 * src/conflicts.h: New file.
19039 Propagate its inclusion.
19040
190412000-10-02 Akim Demaille <akim@epita.fr>
19042
19043 * src/nullable.h: New file.
19044 Propagate its inclusion.
19045 * src/nullable.c: Formatting changes.
19046
190472000-10-02 Akim Demaille <akim@epita.fr>
19048
19049 * src/reduce.h: New file.
19050 Propagate its inclusion.
19051 * src/reduce.c: Topological sort and other formatting changes.
19052 (bool, TRUE, FALSE): Move their definition to...
19053 * src/system.h: here.
19054
190552000-10-02 Akim Demaille <akim@epita.fr>
19056
19057 * src/files.c: Formatting changes.
19058 (tryopen, tryclose, openfiles): Rename as...
19059 (xfopen, xfclose, open_files): this.
19060 (stringappend): static.
19061 * src/files.h: Complete the list of exported symbols.
19062 Propagate its use.
19063
190642000-10-02 Akim Demaille <akim@epita.fr>
19065
19066 * src/reader.h: New file.
19067 Propagate its use instead of tedious list of `extern' and
19068 prototypes.
19069 * src/reader.c: Formatting changes, topological sort,
19070 s/register//.
19071
190722000-10-02 Akim Demaille <akim@epita.fr>
19073
19074 * src/lex.h: Prototype `lex.c' exported functions.
19075 * src/reader.c: Adjust.
19076 * src/lex.c: Formatting changes.
19077 (safegetc): Rename as...
19078 (xgetc): this.
19079
190802000-10-02 Akim Demaille <akim@epita.fr>
19081
19082 * src/lalr.h: New file.
19083 Propagate its inclusion instead of prototypes and `extern'.
19084 * src/lalr.c: Formatting changes, topological sorting etc.
19085
190862000-10-02 Akim Demaille <akim@epita.fr>
19087
19088 * src/output.c (token_actions): Introduce a temporary array,
19089 YYDEFACT, that makes it possible for this function to use
19090 output_short_table.
19091
190922000-10-02 Akim Demaille <akim@epita.fr>
19093
19094 `user_toknums' is output as a `short[]' in `output.c', while it is
19095 defined as a `int[]' in `reader.c'. For consistency with the
19096 other output tables, `user_toknums' is now defined as a table of
19097 shorts.
19098
19099 * src/reader.c (user_toknums): Be a short table instead of an int
19100 table.
19101 Adjust dependencies.
19102
19103 Factor the short table outputs.
19104
19105 * src/output.c (output_short_table): New function.
19106 * src/output.c (output_gram, output_stos, output_rule_data)
19107 (output_base, output_table, output_check): Use it.
19108
191092000-10-02 Akim Demaille <akim@epita.fr>
19110
19111 * src/output.c (output): Topological sort of the functions, in
19112 order to get rid of the `static' prototypes.
19113 No longer use `register'.
19114 * src/output.h: New file.
19115 Propagate its inclusion in files explicitly prototyping functions
19116 from output.c.
19117
191182000-09-21 Akim Demaille <akim@epita.fr>
19119
19120 * src/atgeneral.m4: Update from Autoconf.
19121
191222000-09-21 Akim Demaille <akim@epita.fr>
19123
19124 * src/closure.h: New file.
19125 * src/closure.c: Formatting changes, topological sort over the
19126 functions, use of closure.h.
19127 (initialize_closure, finalize_closure): Rename as...
19128 (new_closure, free_closure): these. Adjust dependencies.
19129 * src/LR0.c: Formatting changes, topological sort, use of
19130 cloture.h.
19131 (initialize_states): Rename as...
19132 (new_states): this.
19133 * src/Makefile.am (noinst_HEADERS): Adjust.
19134
191352000-09-20 Akim Demaille <akim@epita.fr>
19136
19137 * src/acconfig.h: Don't protect config.h against multiple
19138 inclusion.
19139 Don't define PARAMS.
19140 * src/system.h: Define PARAMS.
19141 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
19142 purpose of config.h. system.h must not try to fix wrong
19143 definitions in config.h.
19144
191452000-09-20 Akim Demaille <akim@epita.fr>
19146
19147 * src/derives.h: New file.
19148 * src/main.c, src/derives.h: Use it.
19149 Formatting changes.
19150 * src/Makefile.am (noinst_HEADERS): Adjust.
19151
191522000-09-20 Akim Demaille <akim@epita.fr>
19153
19154 * tests/atgeneral.m4: Update from Autoconf.
19155 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
19156 (AT_CHECK_CALC): New macros.
19157 Use these macros to test bison with options `', `--raw',
19158 `--debug', `--yacc', `--yacc --debug'.
19159
191602000-09-19 Akim Demaille <akim@epita.fr>
19161
19162 * src/output.c: Formatting changes.
19163 * src/machine.h: Remove, leaving its contents in...
19164 * src/system.h: here.
19165 Include stdio.h.
19166 Adjust all dependencies on stdio.h and machine.h.
19167 * src/getargs.h: New file.
19168 Let all `extern' declarations about getargs.c be replaced with
19169 inclusion of `getargs.h'.
19170 * src/Makefile.am (noinst_HEADERS): Adjust.
19171
19172 * tests/calc.m4 (yyin): Be initialized in main, not on the global
19173 scope.
19174 (yyerror): Returns void, not int.
19175 * doc/bison.texinfo: Formatting changes.
19176
191772000-09-19 Akim Demaille <akim@epita.fr>
19178
19179 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
19180 portable.
19181
191822000-09-18 Akim Demaille <akim@epita.fr>
19183
19184 * configure.in: Append WARNING_CFLAGS to CFLAGS.
19185 * src/Makefile.am (INCLUDES): Don't.
19186 Be ready to fetch headers in lib/.
19187
191882000-09-18 Akim Demaille <akim@epita.fr>
19189
19190 * doc/bison.texinfo: Update the copyright.
19191 ANSIfy and GNUify the examples.
19192 Remove the old menu.
19193
191942000-09-18 Akim Demaille <akim@epita.fr>
19195
19196 First set of tests: use the `calc' example from the documentation.
19197
19198 * src/bison.s1 (yyparse): Condition the code using `yytname' which
19199 is defined only when YYDEBUG is.
19200 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
19201 * src/files.c (tryopen, tryclose): Formatting changes.
19202 Move to the top and be static.
19203 * src/reader.c (read_signed_integer): Likewise.
19204 * tests/calc.m4: New file.
19205 * Makefile.am, suite.m4: Adjust.
19206 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
19207
192082000-09-18 Akim Demaille <akim@epita.fr>
19209
19210 Add support for an Autotest test suite for Bison.
19211
19212 * m4/m4.m4, m4/atconfig.m4: New files.
19213 * m4/Makefile.am (EXTRA_DIST): Adjust.
19214 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
19215 files.
19216 * src/getargs.c: Display a more standard --version message.
19217 * src/reader.c (reader): Formatting changes.
19218 No longer depend upon VERSION_STRING.
19219 * configure.in: No longer use `dnl'.
19220 Set up the test suite and the new directory `tests/.
19221 (VERSION_STRING): Remove.
19222
192232000-04-14 Akim Demaille <akim@epita.fr>
19224
19225 * src/reader.c (copy_comment2): New function, same as former
19226 `copy_comment', but outputs into two FILE *.
19227 (copy_comment): Use it.
19228 (parse_union_decl): Use it.
19229 (get_type, parse_start_decl): Use the same `invalid' message.
19230 (parse_start_decl, parse_union_decl): Use the same `multiple'
19231 message.
19232 (parse_union_decl, copy_guard, copy_action): Use the same
19233 `unmatched' message.
19234 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
19235
192362000-03-31 Akim Demaille <akim@epita.fr>
19237
19238 * src/files.c (tryopen, tryclose): Move to the top.
19239 Be static.
19240
192412000-03-31 Akim Demaille <akim@epita.fr>
19242
19243 * src/main.c (main): Don't call `done', exit does it.
19244
192452000-03-31 Akim Demaille <akim@epita.fr>
19246
19247 * allocate.c: s/return (foo)/return foo/.
19248 * lalr.c: Likewise.
19249 * LR0.c: Likewise.
19250 * output.c: Likewise.
19251 * reader.c: Likewise.
19252 * symtab.c: Likewise.
19253 * vmsgetargs.c: Likewise.
19254
192552000-03-31 Akim Demaille <akim@epita.fr>
19256
19257 Clean up the error reporting functions.
19258
19259 * src/report.c: New file.
19260 * src/report.h: Likewise.
19261 * src/Makefile.am: Adjust.
19262 * m4/error.m4: New file.
19263 * m4/Makefile.am: Adjust.
19264 * configure.in (jm_PREREQ_ERROR): Call it.
19265 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
19266 Remove.
19267 (fatal, fatals): Remove. All callers use complain.c::fatal.
19268 (warn, warni, warns, warnss, warnss): Remove. All callers use
19269 complain.c::complain.
19270 (toomany): Remove, use fatal instead.
19271 * src/files.c (done): No argument, use complain_message_count.
19272 * src/main.c (main): Register `done' to `atexit'.
19273
19274 * src/getargs.c (usage): More `fputs', less `fprintf'.
19275
192762000-03-28 Akim Demaille <akim@epita.fr>
19277
19278 * lib/: New directory.
19279 * Makefile.am (SUBDIRS): Adjust.
19280 * configure.in: Adjust.
19281 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
19282 useless.
19283 * src/alloca.c: Moved to lib/.
19284 * src/getopt.c: Likewise.
19285 * src/getopt1.c: Likewise.
19286 * src/getopt.h: Likewise.
19287 * src/ansi2knr.c: Likewise.
19288 * src/ansi2knr.1: Likewise.
19289 * src/Makefile.am: Adjust.
19290 * lib/Makefile.am: New file.
19291
192922000-03-28 Akim Demaille <akim@epita.fr>
19293
19294 * src/getargs.c (usage): Refresh the help message.
19295
192962000-03-17 Akim Demaille <akim@epita.fr>
19297
19298 * src/getopt1.c: Updated from textutils 2.0e
19299 * src/getopt.c: Likewise.
19300 * src/getopt.h: Likewise.
19301
193022000-03-17 Akim Demaille <akim@epita.fr>
19303
19304 * src/Makefile.am (bison.simple): Fix the awk program: quote only
19305 the file name, not the whole `#line LINE FILE'.
19306
193072000-03-17 Akim Demaille <akim@epita.fr>
19308
19309 On syntax errors, report the token on which we choked.
19310
19311 * src/bison.s1 (yyparse): In the label yyerrlab, when
19312 YYERROR_VERBOSE, add yychar in msg.
19313
193142000-03-17 Akim Demaille <akim@epita.fr>
19315
19316 * src/reader.c (copy_at): New function.
19317 (copy_guard): Use it.
19318 (copy_action): Use it.
19319
193202000-03-17 Akim Demaille <akim@epita.fr>
19321
19322 Be kind to translators, save some useless translations.
19323
19324 * src/main.c (banner): New function.
19325 (fatal_banner): Use it.
19326 (warn_banner): Use it.
19327
193282000-03-17 Akim Demaille <akim@epita.fr>
19329
19330 * src/reader.c (copy_definition): Use copy_string and
19331 copy_comment. Removed now unused `match', `ended',
19332 `cplus_comment'.
19333 (copy_comment, copy_string): Moved, to be visible from
19334 copy_definition.
19335
193362000-03-17 Akim Demaille <akim@epita.fr>
19337
19338 * src/reader.c (copy_string): Declare `static inline'. No
19339 problems with inline, since it is checked by configure.
19340 (copy_comment): Likewise.
19341
193422000-03-17 Akim Demaille <akim@epita.fr>
19343
19344 * src/reader.c (packsymbols): Formatting changes.
19345
193462000-03-17 Akim Demaille <akim@epita.fr>
19347
19348 * src/reader.c (copy_comment): New function, factored out from:
19349 (copy_action): Use it. Removed now unused `match', `ended',
19350 `cplus_comment'.
19351 (copy_guard): Likewise.
19352
193532000-03-17 Akim Demaille <akim@epita.fr>
19354
19355 * src/reader.c (copy_string): New function, factored out from:
19356 (copy_action): Use it.
19357 (copy_guard): Likewise.
19358
193592000-03-17 Akim Demaille <akim@epita.fr>
19360
19361 Change the handling of @s so that they behave exactly like $s.
19362 There is now a pseudo variable @$ (readble and writable), location
19363 of the lhs of the rule (by default ranging from the location of
19364 the first symbol of the rhs, to the location of the last symbol,
19365 or, if the rhs is empty, YYLLOC).
19366
19367 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
19368 yyval.
19369 (yyparse): When providing a default semantic action, provide a
19370 default location action.
19371 (after the $): No longer change `*YYLSP', just stack YYLOC the
19372 same way you stack YYVAL.
19373 * src/reader.c (read_declarations): Use warns.
19374 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
19375 (copy_action, case '@'): Likewise.
19376 Use a standard error message, to save useless work from
19377 translators.
19378
193792000-03-17 Akim Demaille <akim@epita.fr>
19380
19381 * src/bison.s1: Formatting and cosmetics changes.
19382 * src/reader.c: Likewise.
19383 Update the Copyright notice.
19384
193852000-03-17 Akim Demaille <akim@epita.fr>
19386
19387 * src/bison.s1 (#line): All set to `#line' only, since the
19388 Makefile now handles them.
19389
193902000-03-16 Akim Demaille <akim@epita.fr>
19391
19392 * src/output.c (output_rule_data): Output the documentation of
19393 some of the tables.
19394 (Copyright notice): Update.
19395 Formatting changes.
19396
193972000-03-16 Akim Demaille <akim@epita.fr>
19398
19399 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
19400 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
19401 One `#if YYDEBUG' remains, since it uses variables which are
19402 defined only if `YYDEBUG != 0'.
19403
194042000-03-16 Akim Demaille <akim@epita.fr>
19405
19406 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
19407 and related variables so that the similarities are highlighted.
19408
194092000-03-16 Akim Demaille <akim@epita.fr>
19410
19411 * src/bison.s1: Properly indent CPP directives.
19412
194132000-03-16 Akim Demaille <akim@epita.fr>
19414
19415 * src/bison.s1: Properly indent the `alloca' CPP section.
19416
194172000-03-16 Akim Demaille <akim@epita.fr>
19418
19419 Do not hard code values of directories in `configure.in'.
19420 Update the `configure' tool chain.
19421
19422 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
19423 src/makefile.am.
19424 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
19425 (AC_OUTPUT): Add m4/Makefile.
19426 Bump to bison 1.28a, 1.29 has never been released.
19427 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
19428 handled via src/Makefile.am.
19429 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
19430 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
19431 autoheader.
19432 * Makefile.am (SUBDIRS): Add m4.
19433 (ACLOCAL_AM_FLAGS): New variable.
19434 (AUTOMAKE_OPTIONS): Add check-news.
19435 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
19436 the proper line number and file name.
19437 (DEFS): Propagate the location of bison library files and of the
19438 locale files.
19439 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
19440 builddir.
19441 * acinclude.m4: Remove, replaced by the directory m4.
19442 * m4/Makefile.am (EXTRA_DIST): New variable.
19443 * m4/gettext.m4: New file, from the fileutils.
19444 * m4/lcmessage.m4: Likewise
19445 * m4/progtest.m4: Likewise.
19446 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
19447
194482000-03-10 Akim Demaille <akim@epita.fr>
19449
19450 * src/closure.c:
19451 Formatting changes of various comments.
19452 Respect the GNU coding standards at various places.
19453 Don't use `_()' when no translation is needed.
19454
194551999-12-13 Jesse Thilo <jthilo@gnu.org>
19456
19457 * src/files.c:
19458 OS/2 honors TMPDIR environment variable.
19459
194601999-12-13 Jesse Thilo <jthilo@gnu.org>
19461
19462 * doc/bison.texinfo: Tweaked spelling and grammar.
19463 Updated ISBN.
19464 Removed reference to price of printed copy.
19465 Mention BISON_SIMPLE and BISON_HAIRY.
19466
194671999-12-13 Jesse Thilo <jthilo@gnu.org>
19468
19469 * configure.in, NEWS:
19470 Bison 1.29 released.
19471
194721999-10-27 Jesse Thilo <jthilo@gnu.org>
19473
19474 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
19475 Added reference card.
19476
194771999-07-26 Jesse Thilo <jthilo@gnu.org>
19478
19479 * po/ru.po: Added Russian translation.
19480
194811999-07-26 Jesse Thilo <jthilo@gnu.org>
19482
19483 * configure.in: Added Russian translation.
19484
194851999-07-06 Jesse Thilo <jthilo@gnu.org>
19486
19487 * configure.in, NEWS, README:
19488 Released version 1.28.
19489
194901999-06-14 Jesse Thilo <jthilo@gnu.org>
19491
19492 * src/system.h:
19493 Squashed redefinition warning on some systems.
19494
19495 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
19496 Have configure build version string instead of relying on ANSI string
19497 concatentation.
19498
194991999-06-14 Jesse Thilo <jthilo@gnu.org>
19500
19501 * po/POTFILES.in: Got rid of version.c.
19502
195031999-06-14 Jesse Thilo <jthilo@gnu.org>
19504
19505 * acconfig.h, configure.in:
19506 Have configure build version string instead of relying on ANSI string
19507 concatentation.
19508
195091999-06-08 Jesse Thilo <jthilo@gnu.org>
19510
19511 * doc/bison.1:
19512 Dropped mention of `+' for long-named options.
19513
195141999-05-30 Jesse Thilo <jthilo@gnu.org>
19515
19516 * src/files.c: Added <unistd.h> for unlink().
19517
19518 * src/Makefile.am, src/system.h:
19519 I18n fixes.
19520
195211999-05-30 Jesse Thilo <jthilo@gnu.org>
19522
19523 * README: Added a FAQ list.
19524
19525 * configure.in, acconfig.h:
19526 I18n fixes.
19527
195281999-05-30 Jesse Thilo <jthilo@gnu.org>
19529
19530 * doc/FAQ, doc/Makefile.am:
19531 Added a FAQ list.
19532
195331999-05-19 Jesse Thilo <jthilo@gnu.org>
19534
19535 * src/alloc.h, src/symtab.h, src/version.c:
19536 Protected inclusion of "config.h" with HAVE_CONFIG_H.
19537
195381999-04-18 Jesse Thilo <jthilo@gnu.org>
19539
19540 * src/.cvsignore, src/Makefile.am:
19541 Reorganized: sources in `src', documentation in `doc'.
19542
19543 * src/lex.c (literalchar):
19544 fixed the code for escaping double quotes (thanks
19545 Jonathan Czisny.)
19546
195471999-04-18 Jesse Thilo <jthilo@gnu.org>
19548
19549 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
19550 Adjusted paths to reflect directory reorganization.
19551
195521999-04-18 Jesse Thilo <jthilo@gnu.org>
19553
19554 * doc/.cvsignore, doc/Makefile.am:
19555 Reorganized: sources in `src', documentation in `doc'.
19556
195571999-04-18 Jesse Thilo <jthilo@gnu.org>
19558
19559 * configure.in:
19560 Updated AC_INIT file to reflect directory reorganization.
19561
19562 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
19563 Reorganized: sources in `src', documentation in `doc'.
19564
195651999-04-13 Jesse Thilo <jthilo@gnu.org>
19566
19567 * src/allocate.c:
19568 Don't declare calloc() and realloc() if not necessary.
19569
195701999-04-13 Jesse Thilo <jthilo@gnu.org>
19571
19572 * configure.in, acconfig.h, acinclude.m4:
19573 Don't declare calloc() and realloc() if not necessary.
19574
195751999-03-23 Jesse Thilo <jthilo@gnu.org>
19576
19577 * po/.cvsignore: Added i18n support.
19578
195791999-03-23 Jesse Thilo <jthilo@gnu.org>
19580
19581 * acconfig.h, configure.in, Makefile.am:
19582 Added i18n support.
19583
195841999-03-22 Jesse Thilo <jthilo@gnu.org>
19585
19586 * src/bison.s1: Fixed #line numbers.
19587
195881999-03-15 Jesse Thilo <jthilo@gnu.org>
19589
19590 * po/es.po, po/fr.po, po/nl.po, po/de.po:
19591 Added PO files from Translation Project.
19592
195931999-03-03 Jesse Thilo <jthilo@gnu.org>
19594
19595 * Makefile.am:
19596 Added support for non-ANSI compilers (ansi2knr).
19597
195981999-02-16 Jesse Thilo <jthilo@gnu.org>
19599
19600 * configure.in: Bumped version number to 1.27.
19601
19602 * Makefile.am:
19603 Added `bison.simple' to list of files removed by `make distclean'.
19604
196051999-02-12 Jesse Thilo <jthilo@gnu.org>
19606
19607 * src/files.c, src/files.h:
19608 Defined locations of parser files in config.h instead of Makefile.
19609
196101999-02-12 Jesse Thilo <jthilo@gnu.org>
19611
19612 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
19613 Defined locations of parser files in config.h instead of Makefile.
19614
196151999-02-09 Jesse Thilo <jthilo@gnu.org>
19616
19617 * Makefile.am:
19618 Removed inappropriate use of $< macro.
19619
196201999-02-05 Jesse Thilo <jthilo@gnu.org>
19621
19622 * po/Makefile.in.in, po/POTFILES.in:
19623 Add `po' directory skeleton.
19624
196251999-01-27 Jesse Thilo <jthilo@gnu.org>
19626
19627 * README: Document help-bison list.
19628
19629 * configure.in: Add check for mkstemp().
19630
196311999-01-20 Jesse Thilo <jthilo@gnu.org>
19632
19633 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
19634 Hush a few compiler warnings.
19635
19636 * src/files.c:
19637 Add tryclose(), which verifies that fclose was successful.
19638 Hush a couple of compiler warnings.
19639
196401999-01-20 Jesse Thilo <jthilo@gnu.org>
19641
19642 * Makefile.am, OChangeLog:
19643 ChangeLog is now automatically generated. Include the old version as
19644 OChangeLog.
19645
196461999-01-14 Jesse Thilo <jthilo@gnu.org>
19647
19648 * 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:
19649 Update FSF address.
19650
196511999-01-14 Jesse Thilo <jthilo@gnu.org>
19652
19653 * doc/bison.texinfo: Fix formatting glitch.
19654
19655 * doc/bison.texinfo: Update FSF address.
19656
196571999-01-14 Jesse Thilo <jthilo@gnu.org>
19658
19659 * acconfig.h: Update FSF address.
19660
196611999-01-08 Jesse Thilo <jthilo@gnu.org>
19662
19663 * src/system.h:
19664 Don't define PACKAGE here, since config.h defines it.
19665
196661998-12-30 Jesse Thilo <jthilo@gnu.org>
19667
19668 * src/reader.c: Update copyright date.
19669
19670 * src/main.c:
19671 Ditch sprintf to statically-sized buffers in fatal/warn functions in
19672 favor of output directly to stderr (avoids buffer overruns).
19673
19674 * src/reader.c: Some checks for premature EOF.
19675
19676 * 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:
19677 Use prototypes if the compiler understands them.
19678
19679 * src/files.c: Honor TMPDIR on Unix hosts.
19680 Use prototypes if the compiler understands them.
19681
19682 * src/reader.c:
19683 Fix a couple of buffer overrun bugs.
19684 Use prototypes if the compiler understands them.
19685
19686 * src/system.h: Include unistd.h and ctype.h.
19687 Use #ifdef instead of #if for NLS symbols.
19688
196891998-12-30 Jesse Thilo <jthilo@gnu.org>
19690
19691 * doc/bison.texinfo:
19692 Delete comment "consider using @set for edition number, etc..." since
19693 we now are doing so.
19694
196951998-12-30 Jesse Thilo <jthilo@gnu.org>
19696
19697 * configure.in:
19698 Use prototypes if the compiler understands them.
19699
19700 * NEWS: Document 1.26 highlights.
19701
19702 * Makefile.am: Require Automake 1.3 or later.
19703
19704 * acconfig.h:
19705 Use prototypes if the compiler understands them.
19706
197071998-12-29 Jesse Thilo <jthilo@gnu.org>
19708
19709 * src/version.c:
19710 Use VERSION symbol from automake for version number.
19711
197121998-12-29 Jesse Thilo <jthilo@gnu.org>
19713
19714 * acconfig.h, configure.in, version.cin:
19715 Use VERSION symbol from automake for version number.
19716
197171998-11-28 Jesse Thilo <jthilo@gnu.org>
19718
19719 * Makefile.am:
19720 Distribute original version of simple parser (bison.s1), not built
19721 version (bison.simple).
19722
197231998-11-28 Jesse Thilo <jthilo@gnu.org>
19724
19725 * doc/bison.texinfo: Add info dir entry.
19726
19727 * doc/bison.texinfo:
19728 Let automake put version number into documentation.
19729
197301998-11-26 Jesse Thilo <jthilo@gnu.org>
19731
19732 * src/bison.cld, src/build.com, src/vmshlp.mar:
19733 Add non-RCS files from /gd/gnu/bison.
19734
197351998-11-26 Jesse Thilo <jthilo@gnu.org>
19736
19737 * doc/bison.1:
19738 Document the BISON_HAIRY and BISON_SIMPLE variables.
19739
197401998-11-25 Jesse Thilo <jthilo@gnu.org>
19741
19742 * src/version.c: Build version.c automatically.
19743
19744 * src/reader.c:
19745 Fix token numbering (used to start at 258, not 257).
19746
19747 * src/system.h: Include config.h.
19748
19749 * src/getargs.c: Update bug report address.
19750
19751 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
19752 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
19753
197541998-11-25 Jesse Thilo <jthilo@gnu.org>
19755
19756 * Makefile.am:
19757 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19758
19759 * configure.in, version.cin:
19760 Build version.c automatically.
19761
19762 * AUTHORS: Add AUTHORS file.
19763
19764 * README: Update bug report address.
19765
19766 * bison.simple:
19767 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19768
19769 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
19770 Add automake stuff.
19771
197721998-11-25 Jesse Thilo <jthilo@gnu.org>
19773
19774 * doc/bison.texinfo: Clean up some formatting.
19775
197761998-05-05 Richard Stallman <rms@gnu.org>
19777
19778 * doc/bison.texinfo:
19779 Explain better why to make a pure parser.
19780
197811998-01-05 Richard Stallman <rms@gnu.org>
19782
19783 * src/files.c (openfiles):
19784 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
19785 find a temporary directory, if possible. Do not unlink files while
19786 they are open.
19787
197881997-08-25 Richard Stallman <rms@gnu.org>
19789
19790 * src/reader.c (stack_offset;):
19791 Change some warni to warns.
19792
19793 * src/lex.c (literalchar): Use warns, not warni.
19794
197951997-06-28 Richard Stallman <rms@gnu.org>
19796
19797 * src/bison.s1: Add a Bison version comment.
19798
19799 * src/main.c (fatal, warn, berror):
19800 Use program_name.
19801
198021997-06-28 Richard Stallman <rms@gnu.org>
19803
19804 * Makefile.in (bison_version): New variable.
19805 (dist): Use that variable.
19806 (bison.s1): Substitute the Bison version into bison.simple.
19807
19808 * bison.simple: Add a Bison version comment.
19809
198101997-06-18 Richard Stallman <rms@gnu.org>
19811
19812 * src/main.c (fatal, warn, berror):
19813 Make error messages standard.
19814 (toomany): Improve error message text.
19815
19816 * 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:
19817 new.h renamed to alloc.h.
19818
198191997-06-18 Richard Stallman <rms@gnu.org>
19820
19821 * Makefile.in: new.h renamed to alloc.h.
19822
198231997-05-24 Richard Stallman <rms@gnu.org>
19824
19825 * src/lex.c (literalchar):
19826 Fix the code for escaping \, " and '.
19827
19828 (lex): Avoid trouble when there are many chars
19829 to discard in a char literal with just several chars in it.
19830
198311997-05-17 Richard Stallman <rms@gnu.org>
19832
19833 * src/bison.s1:
19834 Use malloc, if using alloca is troublesome.
19835 (YYSTACK_USE_ALLOCA): New flag macro.
19836 Define it for some systems and compilers.
19837 (YYSTACK_ALLOC): New macro.
19838 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19839 If it was malloc'd, free it.
19840
198411997-05-17 Richard Stallman <rms@gnu.org>
19842
19843 * bison.simple:
19844 Use malloc, if using alloca is troublesome.
19845 (YYSTACK_USE_ALLOCA): New flag macro.
19846 Define it for some systems and compilers.
19847 (YYSTACK_ALLOC): New macro.
19848 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19849 If it was malloc'd, free it.
19850
198511997-04-23 Richard Stallman <rms@gnu.org>
19852
19853 * src/bison.s1:
19854 (alloca) [__hpux]: Always define as __builtin_alloca.
19855
198561997-04-23 Richard Stallman <rms@gnu.org>
19857
19858 * bison.simple:
19859 (alloca) [__hpux]: Always define as __builtin_alloca.
19860
198611997-04-22 Richard Stallman <rms@gnu.org>
19862
19863 * src/bison.s1:
19864 [__hpux]: Include alloca.h (right for HPUX 10)
19865 instead of declaring alloca (right for HPUX 9).
19866
19867 * src/bison.s1 (__yy_memcpy):
19868 Declare arg `count' as unsigned int.
19869 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19870
198711997-04-22 Richard Stallman <rms@gnu.org>
19872
19873 * bison.simple:
19874 [__hpux]: Include alloca.h (right for HPUX 10)
19875 instead of declaring alloca (right for HPUX 9).
19876
19877 * bison.simple (__yy_memcpy):
19878 Declare arg `count' as unsigned int.
19879 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19880
198811997-01-03 Richard Stallman <rms@gnu.org>
19882
19883 * src/allocate.c: [__STDC__ or _MSC_VER]:
19884 Declare calloc and realloc to return void *.
19885
198861997-01-02 Richard Stallman <rms@gnu.org>
19887
19888 * src/system.h:
19889 [_MSC_VER]: Include stdlib.h and process.h.
19890 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
19891
19892 * src/main.c (main): Return FAILURE as a value.
19893 (printable_version): Declare arg as int, not char.
19894
198951997-01-02 Richard Stallman <rms@gnu.org>
19896
19897 * Makefile.in (dist):
19898 Explicitly check for symlinks, and copy them.
19899
199001996-12-19 Richard Stallman <rms@gnu.org>
19901
19902 * src/files.c:
19903 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
19904
199051996-12-18 Paul Eggert <eggert@gnu.org>
19906
19907 * src/bison.s1 (yyparse):
19908 If __GNUC__ and YYPARSE_PARAM are both defined,
19909 declare yyparse to have a void * argument.
19910
199111996-12-18 Paul Eggert <eggert@gnu.org>
19912
19913 * bison.simple (yyparse):
19914 If __GNUC__ and YYPARSE_PARAM are both defined,
19915 declare yyparse to have a void * argument.
19916
199171996-12-17 Richard Stallman <rms@gnu.org>
19918
19919 * src/reduce.c (nbits): Add some casts.
19920
199211996-08-12 Richard Stallman <rms@gnu.org>
19922
19923 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
19924
199251996-08-12 Richard Stallman <rms@gnu.org>
19926
19927 * bison.simple: Test _MSDOS as well as _MSDOS_.
19928
199291996-07-31 Richard Stallman <rms@gnu.org>
19930
19931 * src/bison.s1:
19932 [__sun && __i386]: Include alloca.h.
19933
199341996-07-31 Richard Stallman <rms@gnu.org>
19935
19936 * bison.simple:
19937 [__sun && __i386]: Include alloca.h.
19938
199391996-07-30 Richard Stallman <rms@gnu.org>
19940
19941 * src/bison.s1: Comment change.
19942
19943 * src/bison.s1: Test _MSDOS_, not MSDOS.
19944
199451996-07-30 Richard Stallman <rms@gnu.org>
19946
19947 * bison.simple: Comment change.
19948
19949 * bison.simple: Test _MSDOS_, not MSDOS.
19950
199511996-06-01 Richard Stallman <rms@gnu.org>
19952
19953 * 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:
19954 Insert `_' macro around many string constants.
19955
19956 * src/main.c:
19957 Insert `_' macro around many string constants.
19958
19959 (main): Call setlocale, bindtextdomain and textdomain.
19960
19961 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
19962 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
19963 [ENABLE_NLS]: Include libintl.h.
19964 [ENABLE_NLS] (gettext): Define.
19965 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
19966 (N_, PACKAGE, LOCALEDIR): New macros.
19967
199681996-06-01 Richard Stallman <rms@gnu.org>
19969
19970 * POTFILES.in: New file.
19971
19972 * Makefile.in (allocate.o):
19973 Define target explicitly.
19974
19975 * Makefile.in (CFLAGS): Set to @CFLAGS@.
19976 (LDFLAGS): Set to @LDFLAGS@.
19977 (configure): Run autoconf only if preceding `cd' succeeds.
19978 (bison.s1): Redirect output to temporary file then move the
19979 temporary to the target, rather than redirecting directly to bison.s1.
19980 (clean): Remove config.status and config.log.
19981 (distclean): Don't remove config.status here.
19982
199831996-05-12 Richard Stallman <rms@gnu.org>
19984
19985 * src/bison.s1:
19986 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19987
199881996-05-12 Richard Stallman <rms@gnu.org>
19989
19990 * bison.simple:
19991 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19992
199931996-05-11 Richard Stallman <rms@gnu.org>
19994
19995 * src/bison.s1 (__yy_memcpy):
19996 Really reorder the args, as was supposedly done on Feb 14 1995.
19997 (yyparse): Calls changed accordingly.
19998
199991996-05-11 Richard Stallman <rms@gnu.org>
20000
20001 * Makefile.in (dist): Don't use $(srcdir).
20002
20003 * bison.simple (__yy_memcpy):
20004 Really reorder the args, as was supposedly done on Feb 14 1995.
20005 (yyparse): Calls changed accordingly.
20006
200071996-01-27 Richard Stallman <rms@gnu.org>
20008
20009 * src/output.c (output_rule_data):
20010 Test YYERROR_VERBOSE in the conditional
20011 around the definition of ttyname.
20012
200131995-12-29 Richard Stallman <rms@gnu.org>
20014
20015 * src/bison.s1:
20016 Fix line numbers in #line commands.
20017
200181995-12-29 Richard Stallman <rms@gnu.org>
20019
20020 * bison.simple:
20021 Fix line numbers in #line commands.
20022
200231995-12-27 Richard Stallman <rms@gnu.org>
20024
20025 * src/bison.s1 (YYPARSE_PARAM_DECL):
20026 In C++, make it always null.
20027 (YYPARSE_PARAM_ARG): New macro.
20028 (yyparse): Use YYPARSE_PARAM_ARG.
20029
200301995-12-27 Richard Stallman <rms@gnu.org>
20031
20032 * bison.simple (YYPARSE_PARAM_DECL):
20033 In C++, make it always null.
20034 (YYPARSE_PARAM_ARG): New macro.
20035 (yyparse): Use YYPARSE_PARAM_ARG.
20036
200371995-11-29 Richard Stallman <rms@gnu.org>
20038
20039 * doc/bison.texinfo:
20040 Describe literal string tokens, %raw, %no_lines, %token_table.
20041
200421995-11-29 Daniel Hagerty <hag@gnu.org>
20043
20044 * doc/bison.texinfo: Fixed update date
20045
200461995-10-16 Richard Stallman <rms@gnu.org>
20047
20048 * src/version.c: Version 1.25.
20049
200501995-10-16 Richard Stallman <rms@gnu.org>
20051
20052 * NEWS: *** empty log message ***
20053
200541995-10-16 Richard Stallman <rms@gnu.org>
20055
20056 * doc/bison.1, doc/bison.rnh:
20057 Add new options.
20058
200591995-10-15 Richard Stallman <rms@gnu.org>
20060
20061 * src/vmsgetargs.c, src/getargs.c:
20062 Added -n, -k, and -raw switches.
20063 (noparserflag, toknumflag, rawtoknumflag): New variables.
20064
20065 * src/symtab.h (SALIAS):
20066 New #define for adding aliases to %token.
20067 (struct bucket): Added `alias' field.
20068
20069 * src/reduce.c (reduce_grammar):
20070 Revise error message.
20071 (print_notices): Remove final `.' from error message.
20072
20073 * src/reader.c (reader_output_yylsp):
20074 New function.
20075 (readgram): Use `#if 0' around code that accepted %command
20076 inside grammar rules: The documentation doesn't allow it,
20077 and it will fail since the %command processors scan for the next %.
20078 (parse_token_decl): Extended the %token
20079 declaration to allow a multi-character symbol as an alias.
20080 (parse_thong_decl): New function.
20081 (read_declarations): Added %thong declarations.
20082 (read_declarations): Handle NOOP to deal with allowing
20083 % declarations as another means to specify the flags.
20084 (readgram): Allow %prec prior to semantics embedded in a rule.
20085 (skip_to_char, read_declarations, copy_definition)
20086 (parse_token_decl, parse_start_decl, parse_type_decl)
20087 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
20088 (get_type_name, copy_guard, copy_action, readgram)
20089 (get_type, packsymbols): Revised most error messages.
20090 Changed `fatal' to `warnxxx' to avoid aborting for error.
20091 Revised and use multiple warnxxx functions to avoid using VARARGS1.
20092 (read_declarations): Improve the error message for
20093 an invalid character. Do not abort.
20094 (read_declarations, copy_guard, copy_action): Use
20095 printable_version to avoid unprintable characters in printed output.
20096 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
20097 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
20098 Allow the type of a non-terminal can be given
20099 more than once, as long as all specifications give the same type.
20100
20101 * src/output.c:
20102 (output_headers, output_trailers, output, output_gram)
20103 (output_rule_data): Implement noparserflag variable.
20104 Implement toknumflag variable.
20105 (output): Call reader_output_yylsp to output LTYPESTR.
20106
20107 * src/main.c (main):
20108 If reader sees an error, don't process the grammar.
20109 (fatals): Updated to not use VARARGS1.
20110 (printable_version, int_to_string, warn, warni, warns, warnss)
20111 (warnsss): New error reporting functions. Avoid abort for error.
20112
20113 * src/lex.h:
20114 Added THONG and NOOP for alias processing.
20115 Added SETOPT for the new code that allows setting options with %flags.
20116
20117 * src/lex.c:
20118 Include getopt.h. Add some extern decls.
20119 (safegetc): New function to deal with EOF gracefully.
20120 (literalchar); new function to deal with reading \ escapes.
20121 (lex): Use literalchar.
20122 (lex): Implemented "..." tokens.
20123 (literalchar, lex, parse_percent_token): Made tokenbuffer
20124 always contain the token. This includes growing the token
20125 buffer while reading an integer.
20126 (parse_percent_token): Replaced if-else statement with percent_table.
20127 (parse_percent_token): Added % declarations as another
20128 way to specify the flags -n, -l, and -r. Also added hooks for
20129 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
20130 major changes to files.c.
20131 (lex) Retain in the incoming stream a character following
20132 an incorrect '/'.
20133 (skip_white_space, lex): Revised most error messages
20134 and changed fatal to warn to avoid aborting.
20135 (percent_table): Added %thong declarations.
20136
20137 * src/gram.h: Comment changes.
20138
20139 * src/files.c (openfiles, open_extra_files, done):
20140 Add faction flag
20141 and actfile file. Handle noparserflag. Both for -n switch.
20142
20143 * src/conflicts.c (resolve_sr_conflict):
20144 Remove use of alloca.
20145
201461995-06-01 Jim Meyering <meyering@gnu.org>
20147
20148 * doc/bison.texinfo: *** empty log message ***
20149
201501995-05-06 Richard Stallman <rms@gnu.org>
20151
20152 * src/bison.s1: Comment change.
20153
201541995-05-06 Richard Stallman <rms@gnu.org>
20155
20156 * bison.simple: Comment change.
20157
201581995-05-03 Richard Stallman <rms@gnu.org>
20159
20160 * src/version.c: Version now 1.24.
20161
20162 * src/bison.s1: Change distribution terms.
20163
20164 * src/version.c: Version now 1.23.
20165
201661995-05-03 Richard Stallman <rms@gnu.org>
20167
20168 * doc/bison.texinfo:
20169 Rewrite "Conditions for Using Bison".
20170 Update version to 1.24.
20171
201721995-05-03 Richard Stallman <rms@gnu.org>
20173
20174 * bison.simple: Change distribution terms.
20175
201761995-02-23 Richard Stallman <rms@gnu.org>
20177
20178 * src/files.c: Test __VMS_POSIX as well as VMS.
20179
201801995-02-14 Jim Meyering <meyering@gnu.org>
20181
20182 * src/bison.s1 (__yy_memcpy):
20183 Renamed from __yy_bcopy to avoid
20184 confusion. Reverse FROM and TO arguments to be consistent with
20185 those of memcpy.
20186
201871995-02-14 Jim Meyering <meyering@gnu.org>
20188
20189 * bison.simple (__yy_memcpy):
20190 Renamed from __yy_bcopy to avoid
20191 confusion. Reverse FROM and TO arguments to be consistent with
20192 those of memcpy.
20193
201941994-11-10 David J. MacKenzie <djm@gnu.org>
20195
20196 * NEWS: reformat
20197
20198 * NEWS: New file.
20199
20200 * Makefile.in (DISTFILES): Include NEWS.
20201
20202 * Makefile.in (DISTFILES):
20203 Include install-sh, not install.sh.
20204
20205 * configure.in: Update to Autoconf v2 macro names.
20206
202071994-10-05 David J. MacKenzie <djm@gnu.org>
20208
20209 * Makefile.in: fix typo
20210
20211 * Makefile.in (prefix, exec_prefix):
20212 Let configure set them.
20213
202141994-09-28 David J. MacKenzie <djm@gnu.org>
20215
20216 * Makefile.in: Set datadir to $(prefix)/share.
20217
202181994-09-15 Richard Stallman <rms@gnu.org>
20219
20220 * src/bison.s1:
20221 Update copyright notice and GPL version.
20222
202231994-09-15 Richard Stallman <rms@gnu.org>
20224
20225 * bison.simple:
20226 Update copyright notice and GPL version.
20227
202281994-07-12 Richard Stallman <rms@gnu.org>
20229
20230 * src/reduce.c, src/reader.c:
20231 entered into RCS
20232
202331994-05-05 David J. MacKenzie <djm@gnu.org>
20234
20235 * Makefile.in: entered into RCS
20236
202371994-03-26 Richard Stallman <rms@gnu.org>
20238
20239 * src/bison.s1: entered into RCS
20240
202411994-03-26 Richard Stallman <rms@gnu.org>
20242
20243 * bison.simple: entered into RCS
20244
202451994-03-25 Richard Stallman <rms@gnu.org>
20246
20247 * src/main.c: entered into RCS
20248
202491994-03-24 Richard Stallman <rms@gnu.org>
20250
20251 * src/conflicts.c: entered into RCS
20252
202531994-01-02 Richard Stallman <rms@gnu.org>
20254
20255 * Makefile.in: *** empty log message ***
20256
202571993-11-21 Richard Stallman <rms@gnu.org>
20258
20259 * src/bison.s1: *** empty log message ***
20260
202611993-11-21 Richard Stallman <rms@gnu.org>
20262
20263 * doc/bison.texinfo: entered into RCS
20264
20265 * doc/bison.texinfo: *** empty log message ***
20266
202671993-11-21 Richard Stallman <rms@gnu.org>
20268
20269 * bison.simple: *** empty log message ***
20270
202711993-10-25 David J. MacKenzie <djm@gnu.org>
20272
20273 * doc/bison.texinfo: *** empty log message ***
20274
202751993-10-19 Richard Stallman <rms@gnu.org>
20276
20277 * src/bison.s1: *** empty log message ***
20278
202791993-10-19 Richard Stallman <rms@gnu.org>
20280
20281 * bison.simple: *** empty log message ***
20282
202831993-10-14 Richard Stallman <rms@gnu.org>
20284
20285 * src/bison.s1: *** empty log message ***
20286
202871993-10-14 Richard Stallman <rms@gnu.org>
20288
20289 * bison.simple: *** empty log message ***
20290
202911993-09-14 David J. MacKenzie <djm@gnu.org>
20292
20293 * doc/bison.texinfo: *** empty log message ***
20294
202951993-09-13 Noah Friedman <friedman@gnu.org>
20296
20297 * Makefile.in: *** empty log message ***
20298
202991993-09-10 Richard Stallman <rms@gnu.org>
20300
20301 * src/conflicts.c: *** empty log message ***
20302
20303 * src/system.h: entered into RCS
20304
203051993-09-10 Richard Stallman <rms@gnu.org>
20306
20307 * doc/bison.1: entered into RCS
20308
203091993-09-06 Noah Friedman <friedman@gnu.org>
20310
20311 * src/version.c: entered into RCS
20312
203131993-09-06 Noah Friedman <friedman@gnu.org>
20314
20315 * Makefile.in: *** empty log message ***
20316
203171993-07-30 David J. MacKenzie <djm@gnu.org>
20318
20319 * Makefile.in: *** empty log message ***
20320
203211993-07-24 Richard Stallman <rms@gnu.org>
20322
20323 * src/bison.s1: *** empty log message ***
20324
203251993-07-24 Richard Stallman <rms@gnu.org>
20326
20327 * bison.simple: *** empty log message ***
20328
203291993-07-08 David J. MacKenzie <djm@gnu.org>
20330
20331 * Makefile.in: *** empty log message ***
20332
203331993-07-04 Richard Stallman <rms@gnu.org>
20334
20335 * src/bison.s1: *** empty log message ***
20336
203371993-07-04 Richard Stallman <rms@gnu.org>
20338
20339 * bison.simple: *** empty log message ***
20340
203411993-06-26 David J. MacKenzie <djm@gnu.org>
20342
20343 * src/getargs.c: entered into RCS
20344
203451993-06-26 David J. MacKenzie <djm@gnu.org>
20346
20347 * doc/bison.texinfo: *** empty log message ***
20348
20349 * doc/bison.1: New file.
20350
203511993-06-25 Richard Stallman <rms@gnu.org>
20352
20353 * src/getargs.c: New file.
20354
203551993-06-16 Richard Stallman <rms@gnu.org>
20356
20357 * src/bison.s1: *** empty log message ***
20358
203591993-06-16 Richard Stallman <rms@gnu.org>
20360
20361 * bison.simple: *** empty log message ***
20362
203631993-06-03 Richard Stallman <rms@gnu.org>
20364
20365 * src/bison.s1: New file.
20366
203671993-06-03 Richard Stallman <rms@gnu.org>
20368
20369 * doc/bison.texinfo: *** empty log message ***
20370
203711993-06-03 Richard Stallman <rms@gnu.org>
20372
20373 * bison.simple: New file.
20374
203751993-05-19 Richard Stallman <rms@gnu.org>
20376
20377 * doc/bison.texinfo: New file.
20378
203791993-05-07 Noah Friedman <friedman@gnu.org>
20380
20381 * Makefile.in: *** empty log message ***
20382
203831993-04-28 Noah Friedman <friedman@gnu.org>
20384
20385 * src/reader.c: *** empty log message ***
20386
203871993-04-23 Noah Friedman <friedman@gnu.org>
20388
20389 * src/alloc.h: entered into RCS
20390
203911993-04-20 David J. MacKenzie <djm@gnu.org>
20392
20393 * src/version.c: *** empty log message ***
20394
20395 * src/files.c, src/allocate.c:
20396 entered into RCS
20397
20398 * src/reader.c: *** empty log message ***
20399
20400 * src/lex.c: entered into RCS
20401
20402 * src/conflicts.c: New file.
20403
20404 * src/symtab.c: entered into RCS
20405
20406 * src/alloc.h: New file.
20407
20408 * src/LR0.c: entered into RCS
20409
204101993-04-18 Noah Friedman <friedman@gnu.org>
20411
20412 * src/reader.c: New file.
20413
20414 * src/version.c: *** empty log message ***
20415
204161993-04-18 Noah Friedman <friedman@gnu.org>
20417
20418 * Makefile.in: *** empty log message ***
20419
204201993-04-17 Noah Friedman <friedman@gnu.org>
20421
20422 * Makefile.in: *** empty log message ***
20423
204241993-04-15 Richard Stallman <rms@gnu.org>
20425
20426 * src/main.c, src/files.c:
20427 New file.
20428
204291993-04-15 Noah Friedman <friedman@gnu.org>
20430
20431 * configure.in: entered into RCS
20432
20433 * configure.in: *** empty log message ***
20434
20435 * configure.in: New file.
20436
204371993-04-14 Richard Stallman <rms@gnu.org>
20438
20439 * Makefile.in: New file.
20440
204411993-04-13 Richard Stallman <rms@gnu.org>
20442
20443 * src/version.c: New file.
20444
204451993-03-25 Richard Stallman <rms@gnu.org>
20446
20447 * src/output.c: entered into RCS
20448
204491992-09-25 Richard Stallman <rms@gnu.org>
20450
20451 * configure.bat: entered into RCS
20452
204531992-06-22 Richard Stallman <rms@gnu.org>
20454
20455 * src/vmsgetargs.c: entered into RCS
20456
204571992-06-22 Richard Stallman <rms@gnu.org>
20458
20459 * doc/bison.rnh: entered into RCS
20460
204611992-04-20 David J. MacKenzie <djm@gnu.org>
20462
20463 * README: entered into RCS
20464
204651992-01-22 Richard Stallman <rms@gnu.org>
20466
20467 * src/machine.h: entered into RCS
20468
204691991-12-21 Richard Stallman <rms@gnu.org>
20470
20471 * src/lalr.c, src/closure.c:
20472 entered into RCS
20473
204741991-12-20 Richard Stallman <rms@gnu.org>
20475
20476 * src/state.h: entered into RCS
20477
204781991-12-18 Richard Stallman <rms@gnu.org>
20479
20480 * src/print.c, src/nullable.c, src/derives.c:
20481 entered into RCS
20482
204831991-11-03 David J. MacKenzie <djm@gnu.org>
20484
20485 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
20486 entered into RCS
20487
204881988-09-09 Richard Stallman <rms@gnu.org>
20489
20490 * src/bison.hairy: entered into RCS
20491
204921987-12-16 Richard Stallman <rms@gnu.org>
20493
20494 * REFERENCES: entered into RCS
20495
20496
20497 -----
20498
20499 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
20500 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
20501 Free Software Foundation, Inc.
20502
20503 Copying and distribution of this file, with or without
20504 modification, are permitted provided the copyright notice and this
20505 notice are preserved.
20506
20507$Id$