]> git.saurik.com Git - bison.git/blob - ChangeLog
331e35a20165de080cb8c5597e89b64e6f18183a
[bison.git] / ChangeLog
1 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
2
3 * NEWS: Version 2.3b.
4 * configure.ac (AC_INIT): Likewise.
5 (PACKAGE_COPYRIGHT_YEAR): Update to 2008.
6
7 2008-05-23 Joel E. Denny <jdenny@ces.clemson.edu>
8
9 * HACKING: Don't say don't mention HACKING in the ChangeLog. We've
10 been doing it for years.
11 (Test suite): Mention maintainer-push-check and maintainer-xml-check.
12 (Release Procedure): Add FIXME about make alpha being unmaintained.
13
14 2008-05-13 Joel E. Denny <jdenny@ces.clemson.edu>
15
16 * data/yacc.c: Reformat m4 a little for readability.
17 * src/lalr.c (build_relations): Correct comment.
18
19 2008-05-12 Juan Manuel Guerrero <juan.guerrero@gmx.de>
20
21 DJGPP specific issue.
22 * djgpp/config.sed: Fixes required to run configure scripts generated
23 by autoconf 2.62.
24
25 2008-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
26
27 * HACKING (Release Procedure): translation@iro.umontreal.ca is now
28 coordinator@translationproject.org.
29
30 2008-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
31
32 * THANKS: Add Eric Blake.
33
34 2008-04-23 Eric Blake <ebb9@byu.net>
35
36 Revert prior patch, by working around autoconf regression.
37 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
38 ("Output file name: ("): Uncomment test.
39 ("Output file name: )"): Likewise.
40 Based on an idea from Noah Misch.
41
42 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
43
44 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
45 2.61. Reported by Juan Manuel Guerrero at
46 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
47 * tests/output.at ("Output file name: ("): Comment out test case for
48 now.
49 ("Output file name: )"): Likewise.
50
51 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
52
53 * GNUmakefile: Update git-version-gen invocation so make dist
54 succeeds.
55
56 2008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
57
58 Update to the current gnulib CVS repository, and fix trigraph handling
59 in Bison.
60 * bootstrap: Update gnulib CVS repository URL.
61 (symlink_to_dir): Encapsulate the code that guarantees the destination
62 directory exists into...
63 (check_dst_dir): ... this new function, and...
64 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
65 fail when copying files into lib/uniwidth/.
66 * src/output.c (prepare_symbols): When writing yytname muscles, where
67 symbol names will be encoded in C-string literals, tell quotearg to
68 escape trigraphs. This used to be the default in gnulib.
69 * tests/regression.at (Token definitions): Because of the change in
70 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
71 escapes trigraphs in symbol names. Thus, yytname no longer has
72 trigraphs unnecessarily doubly escaped. Update test case output.
73 Extend test case to be sure Bison's own error messages will no longer
74 have trigraphs in symbol names unnecessarily escaped once.
75
76 2008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
77
78 Fix make dist infinite loop reported by Juan Manuel Guerrero at
79 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
80 * .cvsignore: Add .version.
81 * .version.in: New.
82 * bootstrap.conf (gnulib_modules): Add git-version-gen.
83 * configure.ac (AC_CONFIG_FILES): Add .version.
84 * build-aux/.cvsignore: Add git-version-gen.
85
86 2008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
87
88 * NEWS (2.3a+): Mention that -g now takes an argument.
89 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
90 consistency. Update the -g and -x entries now that they take
91 arguments. Use brackets to indicate optional arguments.
92 * src/getargs.c (usage): Explain the relationship between arguments of
93 long and short options more completely. Document --defines and -d
94 separately since the former takes an argument but, for POSIX Yacc, the
95 latter does not.
96 (short_options): Let -W take an optional argument like --warnings.
97 (getargs): Sort cases.
98
99 2008-02-28 Akim Demaille <demaille@gostai.com>
100
101 * doc/bison.texinfo: Fix a few typos.
102
103 2008-02-28 Akim Demaille <akim@epita.fr>
104
105 * doc/bison.texinfo (Bison Options): Document -W.
106 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
107
108 2008-02-28 Akim Demaille <akim@epita.fr>
109
110 * src/getargs.c (short_options): Split and sort for readability.
111 -g and -x take optional arguments, just like their long options.
112 * build-aux/cross-options.pl: Use /x to make the regexp easier to
113 understand.
114 Fix the handling of $opt which resulted in all the argument to be
115 considered as optional.
116
117 2008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
118
119 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
120 say its interface is experimental.
121 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
122 Java.
123 (Bison Options): In the -L and --language entry, mention Java.
124 (Java Bison Interface): Say the interface is experimental.
125 * src/getargs.c (usage): Mention -L and --language.
126
127 * NEWS (2.3a+): Say the push parsing interface is experimental.
128 * doc/bison.texinfo (Push Decl): Likewise.
129 (Decl Summary): Likewise in the "%define api.push_pull" entry.
130 (Push Parser Function): Likewise.
131 (Pull Parser Function): Likewise.
132 (Parser Create Function): Likewise.
133 (Parser Delete Function): Likewise.
134 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
135 yypull_parse, and yypush_parse entries.
136
137 * NEWS (2.3a+): Mention XML support, and say the schema is
138 experimental.
139 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
140 * src/getargs.c (usage): Say the XML schema is experimental.
141
142 * NEWS (2.3a+): Say option instead of flag.
143
144 2008-02-21 Wojciech Polak <polak@gnu.org>
145
146 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
147 text.
148
149 2008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
150
151 Fix impure push parser compile error reported by Bob Rossi at
152 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
153 * data/yacc.c: Clean up whitespace in the output a little.
154 (yypstate_allocated): Define for impure push parsers regardless of
155 whether the pull interface is also requested.
156 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
157 check impure push parsers without the pull interface.
158
159 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
160 yyerror takes arguments specified by %parse-param while yypstate_new
161 does not.
162 * doc/bison.texinfo (Parser Create Function): Document that
163 yypstate_new returns 0 for multiple impure parser instances.
164 * tests/push.at (Push Parsing: Multiple impure instances): Update
165 expected stderr output.
166
167 2008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
168
169 * runtime-po/POTFILES.in (push.c): Remove.
170
171 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
172
173 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
174 * data/push.c: Rename to...
175 * data/yacc.c: ... this, overwriting it.
176 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
177 `%push-pull-parser' -> `%define api.push_pull "both"'.
178 Remove old yacc.c tests, and update push.c tests to yacc.c.
179
180 2008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
181
182 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
183 `"%code top" blocks' instead of `%code "top" blocks'.
184 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
185 Clean up whitespace in the output a little.
186
187 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
188
189 Fix documentation problems reported by Tim Josling at
190 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
191 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
192 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
193 integers. Explain the effect of literal string aliases on error
194 messages. Copy token 0 documentation from the C++ skeleton
195 documentation.
196
197 2008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
198
199 Accept a token number in a %left, %right, or %nonassoc for POSIX
200 conformance. Reported by Tim Josling at
201 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
202 * NEWS (2.3a+): Mention.
203 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
204 and code numbers are treated by precedence declarations.
205 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
206 of symbols.1.
207 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
208 of symbol.
209 (symbol.prec): New, just like symbol but allows INT.
210 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
211 longer holds.
212 * tests/regression.at (Token number in precedence declaration): New
213 test case.
214
215 2008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
216
217 DJGPP specific issues.
218 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
219 be changed. Copyright timestamp adjusted.
220 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
221 be changed. Copyright timestamp adjusted.
222 * djgpp/config.site: Copyright timestamp adjusted.
223 * djgpp/config_h.sed: Copyright timestamp adjusted.
224 * djgpp/djunpack.bat: Copyright timestamp adjusted.
225 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
226 filename translation list.
227 * djgpp/subpipe.c (init_subpipe): Check the environment variables
228 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
229 files shall be created. Before trying to use the temp dir where the
230 environment variable points to check that the dir really exists. If
231 not default to the cwd as temp dir. Copyright timestamp adjusted.
232 * djgpp/subpipe.h: Copyright timestamp adjusted.
233 * djgpp/testsuite.sed: Copyright timestamp adjusted.
234
235 2008-01-30 Paul Eggert <eggert@cs.ucla.edu>
236
237 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
238
239 2008-01-09 Paul Eggert <eggert@cs.ucla.edu>
240
241 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
242 Problem reported by Claudio Saavedra in
243 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
244
245 2008-01-05 Wojciech Polak <polak@gnu.org>
246
247 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
248 document's title with the input grammar file name.
249
250 2007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
251
252 Automate regression testing of the XML/XSLT implementation. Discussed
253 starting at
254 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
255 * configure.ac (XSLTPROC): New substitution.
256 * Makefile.am (maintainer-xml-check): New phony target invoking...
257 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
258 invoking make maintainer-check with BISON_TEST_XML=1.
259 * tests/atlocal.in (XSLTPROC): New.
260 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
261 not to report reachable memory when Bison is expected to have a
262 non-zero exit status and (2) to compare XML/XSLT output with --graph
263 and --report=all output for every working grammar when
264 BISON_TEST_XML=1.
265 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
266 (AT_BISON_CHECK_XML): New.
267 (AT_QUELL_VALGRIND): New.
268 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
269 (AT_CHECK): ... don't redefine this since this was the old way to
270 quell Valgrind.
271 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
272 AT_BISON_CHECK invocations.
273 * tests/c++.at: Likewise.
274 * tests/calc.at: Likewise.
275 * tests/conflicts.at: Likewise.
276 * tests/cxx-type.at: Likewise.
277 * tests/existing.at: Likewise.
278 * tests/glr-regression.at: Likewise.
279 * tests/headers.at: Likewise.
280 * tests/input.at: Likewise.
281 * tests/java.at: Likewise.
282 * tests/output.at: Likewise.
283 * tests/push.at: Likewise.
284 * tests/reduce.at: Likewise.
285 * tests/regression.at: Likewise.
286 * tests/sets.at: Likewise.
287 * tests/skeletons.at: Likewise.
288 * tests/synclines.at: Likewise.
289 * tests/torture.at: Likewise.
290 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
291 tends to hang xsltproc.
292 (Big horizontal): Likewise.
293
294 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
295
296 In XML output, remove redundant class attribute on symbol element.
297 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
298 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
299 look up a symbol to determine whether it's a nonterminal or terminal.
300 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
301 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
302
303 Add prec/assoc information to XML output.
304 * src/gram.c (grammar_rules_print_xml): For each rule that has a
305 %prec, add a percent_prec attribute.
306 * src/print-xml.c (print_grammar): For each terminal that has a
307 precedence or associativity, add a prec or assoc attribute.
308 (xml_indent): New.
309 (xml_puts): Use xml_indent.
310 (xml_printf): Use xml_indent.
311 * src/print-xml.h (xml_indent): Prototype.
312
313 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
314 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
315
316 2007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
317
318 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
319 (bison:ruleByNumber): ... this for clarity.
320 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
321 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
322 (xsl:template match="reduction"): Update.
323 (xsl:template match="item"): Update.
324 (xsl:template match="reduction"): Update.
325
326 In the XML output, don't print the list of rules where symbols appear.
327 Compute it in XSLT instead. Discussed at
328 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
329 * data/xslt/bison.xsl (bison:ruleByLhs): New.
330 (bison:ruleByRhs): New.
331 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
332 bison:ruleByRhs.
333 (xsl:template match="terminal/rule"): Remove.
334 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
335 bison:ruleByRhs.
336 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
337 Remove.
338 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
339 bison:ruleByRhs and mode="number-link" for rule template.
340 (xsl:template match="terminal/rule"): Remove.
341 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
342 bison:ruleByRhs and mode="number-link" for rule template.
343 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
344 Rewrite as...
345 (xsl:template match="rule" mode="number-link"): ... this.
346 * src/print-xml.c (print_grammar): Don't print the list of rules.
347
348 2007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
349
350 Don't let --report affect XML output; always print all information.
351 Discussed at
352 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
353 * src/conflicts.c (log_resolution): Implement.
354 * src/print-xml.c (print_core): Implement.
355 (print_state): Implement.
356 (print_xml): Implement.
357
358 * NEWS (2.3a+): Fix quotes.
359 * src/parse-gram.y (prologue_declaration): For consistency with -v,
360 don't let %verbose clear the list specified by --report.
361
362 2007-11-26 Akim Demaille <akim@epita.fr>
363
364 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
365
366 2007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
367
368 In the XML output, list useless and unused symbols and rules with the
369 useful ones and add a "usefulness" attribute. Discussed starting at
370 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
371 * src/gram.c (grammar_rules_partial_print_xml): Remove.
372 (grammar_rules_print_xml): Print all rules instead of just those
373 useful in the grammar, and add a "usefulness" attribute.
374 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
375 * src/print-xml.c (print_rules_useless_in_parser): Remove.
376 (print_grammar): Print all nonterminals instead of just useful ones,
377 and add a "usefulness" attribute to nonterminals and terminals.
378 (print_xml): Don't print a separate "reductions" or
379 "rules-useless-in-parser" element.
380 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
381 (reduce_xml): Remove.
382 (reduce_token_unused_in_grammar): New.
383 (reduce_nonterminal_useless_in_grammar): New.
384 * src/reduce.h (reduce_xml): Remove prototype.
385 (reduce_token_unused_in_grammar): Add prototype.
386 (reduce_nonterminal_useless_in_grammar): Add prototype.
387 * data/xslt/xml2text.xsl: Update for XML changes.
388 * data/xslt/xml2xhtml.xsl: Update for XML changes.
389 * tests/reduce.at (Useless Terminals): Update output.
390 (Useless Rules): Update output.
391 (Reduced Automaton): Update output.
392
393 Say "Terminals unused in grammar" instead of "Unused terminals".
394 * NEWS (2.3a+): Update.
395 * doc/bison.texinfo (Understanding): Update example output.
396 * src/reduce.c (reduce_output): Implement.
397 * data/xslt/xml2text.xsl: Implement.
398 * data/xslt/xml2xhtml.xsl: Implement.
399
400 2007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
401
402 Accept --report-file=FILE to override the default `.output' filename.
403 * NEWS (2.3a+): Mention.
404 * doc/bison.texinfo (Bison Options): Add an entry.
405 * src/files.c (compute_output_file_names): Don't override
406 spec_verbose_file if already set.
407 * src/getargs.c (usage): Document --report-file.
408 (REPORT_FILE_OPTION): New anonymous enum member.
409 (long_options): Add entry for it.
410 (getargs): Add case for it setting spec_verbose_file.
411
412 * build-aux/cross-options.pl: Don't record a short option just because
413 there's an arg.
414 * doc/.cvsignore: Add yacc.1.
415
416 2007-11-14 Akim Demaille <akim@epita.fr>
417
418 * doc/yacc.1.in: New.
419 * configure.ac, doc/Makefile.am: Adjust.
420 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
421 config.h symbol.
422 Use AC_SUBST for assignments too.
423 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
424
425 2007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
426
427 * src/gram.c: Remove comments that duplicate comments in gram.h.
428
429 When reporting useless rules and nonterminals, say "useless in grammar"
430 instead of "useless", and say "useless in parser" instead of "never
431 reduced". Discussed starting at
432 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
433 * NEWS (2.3a+): Mention this change.
434 * data/xslt/xml2text.xsl: Update output text and expected input XML
435 element names to match changes below.
436 * data/xslt/xml2xhtml.xsl: Likewise.
437 (xsl:template match="bison-xml-report"): Add missing entry in Table of
438 Contents: "Rules useless in parser due to conflicts".
439 * doc/bison.texinfo (Decl Summary): Reword a little.
440 (Understanding): Update example output for changes below.
441 * src/gram.c: (rule_useful_p): Rename to...
442 (rule_useful_in_grammar_p): ... this.
443 (rule_useless_p): Rename to...
444 (rule_useless_in_grammar_p): ... this.
445 (rule_never_reduced_p): Rename to...
446 (rule_useless_in_parser_p): ... this.
447 (grammar_rules_print): Update for renames.
448 (grammar_rules_print_xml): Update for renames.
449 (grammar_rules_never_reduced_report): Rename to...
450 (grammar_rules_useless_report): ... this since it is used for either
451 kind of useless rule.
452 * src/gram.h: Reword comments and update function names in prototypes.
453 * src/main.c (main): Say "rule useless in parser due to conflicts".
454 * src/print-xml.c (print_rules_never_reduced): Rename to...
455 (print_rules_useless_in_parser): ... this, and rename output XML
456 element "rules-never-reduced" to "rules-useless-in-parser".
457 (print_xml): Update for rename.
458 * src/print.c (print_results): Say "Rules useless in parser due to
459 conflicts".
460 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
461 (nonterminals_reduce): Say "nonterminal useless in grammar".
462 (reduce_output): Say "Nonterminals useless in grammar".
463 Say "Rules useless in grammar".
464 (reduce_xml): Rename output XML element "useless" to
465 "useless-in-grammar".
466 (reduce_print): Don't report the count of grammatically useless rules
467 as "rules never reduced" just because %yacc is specified.
468 In the correct report of this count, say nonterminal(s) and rule(s)
469 "useless in grammar".
470 * tests/conflicts.at (S/R in initial): Update expected output.
471 (Defaulted Conflicted Reduction): Likewise.
472 (Unreachable States After Conflict Resolution): Likewise.
473 * tests/existing.at (GNU pic Grammar): Likewise.
474 * tests/reduce.at (Useless Nonterminals): Likewise.
475 (Useless Rules): Likewise.
476 (Reduced Automaton): Likewise.
477 (Underivable Rules): Likewise.
478 (Empty Language): Likewise.
479
480 2007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
481
482 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
483 here document and before the EOF so that BSD's implementation of Bourne
484 shell doesn't parse the delimiter as part of the here document.
485 * doc/.cvsignore: Add cross-options.texi.
486 * src/getargs.c (usage): Add a blank line after the warning categories.
487
488 2007-11-08 Paolo Bonzini <bonzini@gnu.org>
489
490 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
491
492 2007-11-05 Akim Demaille <akim@epita.fr>
493
494 Remove Id: from bison.1.
495 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
496 (perl -0777 -pi -e 's/\.PP\nId): New.
497 (.x.1): Use it to ignore the version control revision.
498
499 2007-11-05 Akim Demaille <demaille@gostai.com>
500
501 * build-aux/Makefile.am: Ship cross-options.pl.
502 * doc/Makefile.am: Always refer to cross-options.texi with
503 $(srcdir).
504 (MAINTAINERCLEANFILES): Add it.
505
506 2007-11-04 Akim Demaille <demaille@gostai.com>
507
508 Generate the long/short option cross-table.
509 * build-aux/cross-options.pl: New.
510 * doc/Makefile.am (cross-options.texi): New.
511 * doc/bison.texinfo: Use it.
512
513 2007-11-04 Akim Demaille <demaille@gostai.com>
514
515 Generate bison.1 using help2man.
516 * doc/common.x, doc/bison.x: New.
517 * doc/Makefile.am (bison.1, .x.1): New.
518 The code is taken from autoconf-2.61/man/Makefile.am.
519 * configure.ac: Look for help2man.
520
521 2007-11-04 Akim Demaille <demaille@gostai.com>
522
523 Complete --help.
524 * src/getargs.c (usage): Document -W, make it clear that -d,
525 -g and -x have optional arguments.
526
527 2007-11-04 Akim Demaille <demaille@gostai.com>
528
529 Find sha1sum when named gsha1sum.
530 * bootstrap (find_tool): New.
531 ($SHA1SUM): New.
532
533 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
534
535 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
536 at
537 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
538 * NEWS (2.3a+): Mention.
539 * data/bison.m4 (b4_pure_if): Don't define it here.
540 * data/c.m4 (b4_identification): Depend on individual skeletons to
541 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
542 values of the %define variables api.pure or api.push_pull. Define
543 YYPURE, YYPUSH, and YYPULL accordingly.
544 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
545 glr.cc has already defined b4_pure_flag.
546 * data/push.c: Define b4_pure_if based on `%define api.pure'.
547 Remove YYPUSH and YYPULL since they're back in b4_identification again.
548 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
549 * doc/bison.texinfo (Pure Decl): Update.
550 (Push Decl): Update.
551 (Decl Summary): Add api.pure to %define entry.
552 In %pure-parser entry, say it's deprecated and reference %define.
553 (Pure Calling): Update.
554 (Error Reporting): Update.
555 (C++ Scanner Interface): Update.
556 (How Can I Reset the Parser): Update.
557 (Table of Symbols): In %pure-parser entry, say it's deprecated and
558 reference %define.
559 * src/getargs.c (pure_parser): Remove global variable.
560 * src/getargs.h (pure_parser): Remove extern.
561 * src/output.c (prepare): Don't define pure_flag muscle.
562 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
563 wrapper around `%define api.pure'.
564 * tests/calc.at (Simple LALR Calculator): Update.
565 (Simple GLR Calculator): Update.
566 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
567 Update.
568 (GLR: Resolve ambiguity, pure, locations): Update.
569 (GLR: Merge conflicting parses, pure, no locations): Update.
570 (GLR: Merge conflicting parses, pure, locations): Update.
571 * tests/glr-regression.at (Uninitialized location when reporting
572 ambiguity): Update
573 * tests/input.at (Unused %define api.pure): New test case.
574 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
575 AT_PURE_IF and AT_PURE_AND_LOC_IF.
576 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
577
578 2007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
579
580 %define push_pull -> %define api.push_pull. Discussed starting at
581 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
582 * data/push.c: Expect the new name.
583 * data/yacc.c: Likewise.
584 * doc/bison.texinfo (Push Decl): Update.
585 (Decl Summary): Update %define entry.
586 (Push Parser Function): Update.
587 (Pull Parser Function): Update.
588 (Parser Create Function): Update.
589 (Parser Delete Function): Update.
590 * tests/calc.at (Simple LALR Calculator): Update.
591 * tests/input.at (%define enum variables): Update.
592 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
593 (Push Parsing: Multiple impure instances): Update.
594 (Push Parsing: Unsupported Skeletons): Update.
595 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
596 (Exploding the Stack Size with Malloc): Update.
597
598 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
599 other entries some.
600
601 2007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
602
603 For the XML output's terminal element, rename @number to @token-number,
604 and add @symbol-number. In the nonterminal element, rename @number to
605 @symbol-number. Discussed starting at
606 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
607 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
608 renames.
609 (xsl:template match="nonterminal"): Likewise.
610 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
611 (xsl:template match="nonterminal"): Likewise.
612 * src/print-xml.c (print_grammar): Implement.
613
614 2007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
615
616 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
617 2007-10-11 change, the child elements here are items not rules.
618 (xsl:template match="item"): New.
619 (xsl:template match="rule"): Update for new reduced itemset.
620 (xsl:template match="point"): Remove.
621 (xsl:template match="empty"): For consistency with --graph, don't
622 output "/* empty */".
623 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
624 line-wrap, don't pass a negative value as first-line-length since this
625 won't work with the following changes.
626 (xsl:template name="line-wrap"): Simplify slightly.
627 (xsl:template name="ws-search"): Eliminate recursion.
628 * src/print_graph.c (print_core): Don't print a reduction's lookahead
629 set next to an item whose dot is not at the end of the RHS even if it
630 happens to be associated with the same rule.
631
632 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
633
634 Add %define lr.keep_unreachable_states.
635 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
636 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
637 * src/main.c (main): Implement it.
638 * tests/conflicts.at (Unreachable States After Conflict Resolution):
639 Extend to test it, and fix a typo.
640
641 2007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
642
643 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
644 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
645 the example .output text.
646 * tests/regression.at (Extra lookahead sets in report): Improve wording
647 of comments.
648
649 2007-10-17 Wojciech Polak <polak@gnu.org>
650
651 * src/print-xml.c (print_grammar): Renamed
652 <terminal> and <nonterminal> attributes:
653 "type" to "number" and "symbol" to "name".
654 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
655 Use new attribute names.
656 (xsl:template match="nonterminal"): Likewise.
657 * data/xslt/xml2xhtml.xsl: Likewise.
658
659 2007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
660
661 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
662 (Option Cross Key): Likewise.
663
664 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
665 next to an item whose dot is not at the end of the RHS even if it
666 happens to be associated with the same rule.
667 * src/print.c (print_core): Likewise.
668 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
669 (Resolved SR Conflicts): Update output.
670 * tests/regression.at (Extra lookahead sets in report): New test case.
671
672 2007-10-11 Wojciech Polak <polak@gnu.org>
673
674 * src/print-xml.c (print_core): Remove item set
675 redundancy.
676 * data/xslt/bison.xsl (bison:ruleNumber): New key.
677 Improve processing time. Suggested by Joel E. Denny.
678 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
679 Write xsl:param "required" attribute as comment.
680 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
681 (xsl:template match="rule"): Support new reduced itemset.
682 (xsl:template match="point"): Remove.
683 * data/xslt/xml2xhtml.xsl: Likewise.
684
685 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
686
687 * src/getargs.c (version): Update copyright year.
688
689 2007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
690
691 Make xml2dot.xsl and --graph produce the same output.
692 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
693 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
694 escaped later.
695 (xsl:template name="output-node"): Use the new escape template instead
696 of the string-replace template directly.
697 (xsl:template name="output-edge"): Likewise.
698 (xsl:template name="escape"): New, escapes backslashes and newlines in
699 addition to quotation marks.
700 * src/graphviz.c (start_graph, output_node, output_edge): Add
701 whitespace to output for legibility.
702
703 Make xml2text.xsl and --report produce the same output, and remove the
704 XML "conflicts" element since a conflict summary is easily extracted
705 from the automaton.
706 * data/xslt/bison.xsl: New.
707 (xsl:template match="state" mode="bison:count-conflicts): New.
708 * data/xslt/xml2text.xsl: Import bison.xsl.
709 (xsl:template match="bison-xml-report"): Instead of styling the
710 "conflicts" element, style the "automaton" element with mode
711 "conflicts". Unlike the former, the latter lists S/R and R/R
712 conflicts for a state on the same line.
713 (xsl:template match="conflicts"): Remove.
714 (xsl:template match="conflict"): Remove.
715 (xsl:template match="terminal"): Line-wrap the list of rules in which
716 the terminal is used.
717 (xsl:template match="nonterminal"): Likewise for nonterminals.
718 (xsl:template match="automaton" mode="conflicts"): New.
719 (xsl:template match="state" mode="conflicts"): New.
720 (xsl:template name="line-wrap"): New.
721 (xsl:template name="ws-search"): New.
722 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
723 (xsl:template match="bison-xml-report"): Instead of styling the
724 "conflicts" element, style the "automaton" element with mode
725 "conflicts."
726 (xsl:template match="conflicts"): Remove.
727 (xsl:template match="conflict"): Remove.
728 (xsl:template match="automaton" mode="conflicts"): New.
729 (xsl:template match="state" mode="conflicts): New.
730 * src/conflicts.c (conflicts_output_xml): Remove.
731 * src/conflicts.h (conflicts_output_xml): Remove prototype.
732 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
733 * src/print.c (print_grammar): Consistently wrap at the 66th column so
734 the corresponding XSLT is easier. Also, never wrap between a word and
735 the comma that follows it.
736
737 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
738
739 Improve C++ namespace support. Discussed starting at
740 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
741 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
742 b4_namespace_close): New macros that interpret the %define variable
743 "namespace" so its value can contain "::" to indicate nested
744 namespaces.
745 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
746 the above macros.
747 * data/lalr1.cc (b4_namespace): Likewise.
748 * data/location.cc (b4_namespace): Likewise.
749 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
750 inside a new table in the general %define entry. Document `%define
751 namespace' there as well. Point the %name-prefix entry to it since it
752 explains it more completely in the case of C++.
753 (C++ Bison Interface): Mention `%define namespace' instead of
754 %name-prefix.
755 (Table of Symbols): Remove the `%define push_pull' entry. The %define
756 entry suffices.
757 * tests/c++.at (Relative namespace references): New test case.
758 (Absolute namespace references): New test case.
759 (Syntactically invalid namespace references): New test case.
760 * tests/input.at (C++ namespace reference errors): New test case.
761
762 2007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
763
764 Add syncline support and location accessor to internal %define
765 interfaces.
766 * data/bison.m4 (b4_percent_define_get_loc): New.
767 (b4_percent_define_get_syncline): New.
768 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
769 (b4_percent_define_default): Record defining location as line 1 rather
770 than 0 for the sake of synchronizing #line's, and define
771 b4_percent_define_syncline(VARIABLE).
772 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
773 * src/muscle_tab.c (muscle_syncline_grow): New.
774 (muscle_code_grow): Use muscle_syncline_grow.
775 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
776 define b4_percent_define_syncline(VARIABLE).
777 (muscle_percent_define_get_loc): New.
778 (muscle_percent_define_get_syncline): New.
779 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
780 remove some unused variables.
781 (muscle_percent_define_default): Record defining location as line 1
782 rather than 0 for the sake of synchronizing #line's, and define
783 b4_percent_define_syncline(VARIABLE).
784 (muscle_percent_define_check_values): Use
785 muscle_percent_define_get_loc.
786 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
787 (muscle_percent_define_get_syncline): Prototype.
788 * tests/skeletons.at (%define Boolean variables: invalid skeleton
789 defaults): Update output for location change.
790 (Complaining during macro argument expansion): Extend to test
791 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
792
793 2007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
794
795 Fix some error-reporting macro bugs.
796 * data/bison.m4 (b4_cat): New.
797 (b4_error, b4_error_at): Use b4_cat to send error directives directly
798 to stdout so they don't become arguments to other macros. Update
799 comments and add examples.
800 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
801 add examples.
802 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
803 after printing the error directive so that M4 doesn't report subsequent
804 problems that are induced by this problem.
805 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
806 instead of just in them. Recognize @\n in both places. Both expand to
807 the empty string. Needed by b4_cat.
808 * tests/skeletons.at (Complaining during macro argument expansion):
809 New test case.
810 (Fatal errors make M4 exit immediately): New test case.
811
812 2007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
813
814 Implement --print-datadir.
815 * src/getargs.c (usage): Mention.
816 (PRINT_DATADIR_OPTION): New anonymous enum member.
817 (long_options): Add entry for it.
818 (getargs): Add case for it calling compute_pkgdatadir.
819 * src/output.c (output_skeleton): Encapsulate data directory
820 computation from here...
821 (prepare): ... and from here...
822 (compute_pkgdatadir): ... into this new function.
823 * src/output.h (compute_pkgdatadir): Prototype.
824
825 2007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
826
827 * src/print-xml.c (escape_bufs): New static global variable
828 replacing...
829 (xml_escape_n): ... the static local variable buf here.
830 (print_xml): Free memory for escape_bufs.
831 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
832
833 2007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
834
835 Replace `%push-parser' and `%push-pull-parser' with
836 `%define push_pull "push"' and `%define push_pull "both"'.
837 `%define push_pull "pull"' is the default.
838 * doc/bison.texinfo (Push Decl, Push Parser Function,
839 Pull Parser Function, Parser Create Function, Parser Delete Function):
840 Update declarations.
841 (Decl Summary, Table of Symbols): Replace %push-parser and
842 %push-pull-parser entries with a %define push_pull entry.
843 * data/bison.m4 (b4_percent_define_check_values): New macro.
844 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
845 definitions...
846 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
847 definitions...
848 * data/push.c: ... to here and compute them from the value of the
849 %define variable push_pull.
850 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
851 parsing requests here...
852 * data/yacc.c: ... hack this to switch to push.c any time
853 b4_use_push_pull_flag or the %define variable push_pull is set. This
854 will go away when we mv push.c yacc.c.
855 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
856 push parsing is not supported since unused %define variables are
857 reported anyway.
858 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
859 * src/muscle_tab.h (muscle_percent_define_check_values): Update
860 comments for consistency with b4_percent_define_check_values.
861 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
862 muscles.
863 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
864 Remove.
865 (prologue_declaration): Remove %push-parser and %push-pull-parser
866 rules.
867 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
868 * tests/calc.at: Update declarations.
869 * tests/input.at (%define enum variables): New test case.
870 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
871 declaration.
872 (Push Parsing: Multiple impure instances): Update declaration.
873 (Push Parsing: Unsupported Skeletons): New test case.
874 * tests/torture.at (Exploding the Stack Size with Alloca): Update
875 declaration.
876 (Exploding the Stack Size with Malloc): Update declaration.
877
878 2007-09-24 Wojciech Polak <polak@gnu.org>
879
880 Add XSLT transformations.
881
882 * data/xslt/xml2dot.xsl: Transform XML into DOT.
883 * data/xslt/xml2text.xsl: Transform XML into plain text.
884 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
885 * data/Makefile.am (xsltdir): New variable.
886 (dist_xslt_DATA): Add xslt/*.xsl files.
887
888 2007-09-23 Paul Eggert <eggert@cs.ucla.edu>
889
890 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
891 Problem reported by Wojciech Polak.
892 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
893 (xml_printf): Undo change I made on 21 September; that is,
894 indent 2 spaces, not 1.
895
896 2007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
897
898 Pacify ./configure --enable-gcc-warnings.
899 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
900 `char const *' instead of `char *'.
901 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
902 local variable `sep'.
903
904 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
905
906 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
907 elsewhere.
908 * src/print-xml.c: Prefer "const" after types; that's more consistent.
909 (xml_printf): Indent just 1 space for level.
910 (e_char, xlate_char): Remove.
911 (xml_escape_string): Rewrite to avoid undefined behavior (used
912 storage that was freed from the stack).
913 (xml_escape_n): Don't bother checking for subscript error.
914
915 2007-09-21 Wojciech Polak <polak@gnu.org>
916
917 Add Bison XML Automaton Report.
918
919 Add support for an -x option to generate an XML report.
920 It is not documented yet.
921 * src/print-xml.c: New file.
922 * src/print-xml.h: Likewise.
923 * lib/timevar.def (TV_XML): New var.
924 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
925 * src/conflicts.c: Include print-xml.h.
926 (solved_conflicts_xml_obstack): New var.
927 (log_resolution, conflicts_solve, conflicts_free):
928 Add support for XML report.
929 (conflicts_output_val): New function.
930 * src/conflicts.h (conflicts_output_val): New decl.
931 * src/files.c (spec_xml_file): New var.
932 (compute_output_file_names, output_file_names_free): Add XML support.
933 * src/files.h (spec_xml_file): New decl.
934 * src/getargs.c (xml_flag): New var.
935 (usage, short_options, long_options, getargs): Add XML support.
936 * src/getargs.h (xml_flag): New decl.
937 * src/gram.c: Include print-xml.h.
938 (rule_lhs_print_xml, rule_rhs_print_xml):
939 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
940 New functions.
941 * src/gram.h: Declare external ones.
942 * src/main.c: Include print-xml.h.
943 (main): Add XML support.
944 * src/reduce.c: Include print-xml.h.
945 (reduce_xml): New function.
946 * src/reduce.h: Declare it.
947 * src/state.c: Include print-xml.h.
948 (state_new): Add XML support.
949 (state_rule_lookahead_tokens_print_xml): New function.
950 * src/state.h: Declare it.
951 (struct state): New member solved_conflicts_xml.
952 * src/symtab.c (symbol_class_get_string): New function.
953 * src/symtab.h: Declare it.
954
955 2007-09-21 Paul Eggert <eggert@cs.ucla.edu>
956
957 * GNUmakefile: Switch to coreutils's version.
958 * bootstrap: Likewise.
959 * Makefile.cfg: Adjust to new GNUmakefile.
960 * README-hacking: Likewise.
961
962 Import from gnulib:
963
964 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
965 Bruno Haible <bruno@clisp.org>
966
967 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
968 and is a script that invokes bison. Tighten the code. Add comments.
969
970 2007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
971
972 Spell "boolean" as "Boolean". Reported by Akim Demaille.
973 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
974 * doc/bison.texinfo (Decl Summary): Fix.
975 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
976 * tests/input.at (Boolean %define variables): Update output.
977 * tests/skeletons.at (%define boolean variables: invalid skeleton
978 defaults): Rename to...
979 (%define Boolean variables: invalid skeleton defaults): ... this and
980 update output.
981
982 2007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
983
984 In impure push mode, don't allow more than one yypstate to be allocated
985 since multiple impure parsers would corrupt yynerrs.
986 * data/push.c (yypstate_allocated): New static global variable
987 initialized to 0.
988 (yypull_parse): If yypstate_new returns 0, don't report it as memory
989 exhaustion if yypstate_allocated is 1, but still return 2.
990 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
991 already 1. Otherwise, set it to 1.
992 (yypstate_delete): Set it to 0.
993 * tests/push.at (Push Parsing: Multiple impure instances): New test
994 case.
995
996 2007-08-17 Bob Rossi <bob@brasko.net>
997
998 * doc/bison.texinfo (Push Decl): Document the push parser.
999 (Table of Symbols): Ditto.
1000 (Pure Decl): Ditto.
1001 (Decl Summary): Ditto.
1002 (Multiple Parsers, Push Parser Function, Pull Parser Function,
1003 Parser Create Function, Parser Delete Function):
1004 Add new push parser symbols.
1005 (Table of Symbols): Document push-parser, push-pull-parser,
1006 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
1007
1008 2007-08-15 Paul Eggert <eggert@cs.ucla.edu>
1009
1010 Update to GPLv3.
1011 * doc/gpl-3.0.texi: New file.
1012 * doc/gpl.texi: Remove.
1013 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
1014 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
1015 * README-hacking, TODO, bootstrap, bootstrap.conf:
1016 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
1017 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
1018 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
1019 * data/lalr1.cc, data/lalr1.java, data/location.cc:
1020 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
1021 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
1022 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
1023 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
1024 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
1025 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
1026 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
1027 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
1028 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
1029 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
1030 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
1031 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
1032 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
1033 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
1034 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
1035 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
1036 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
1037 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
1038 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
1039 * src/complain.c, src/complain.h, src/conflicts.c:
1040 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
1041 * src/files.h, src/flex-scanner.h, src/getargs.c:
1042 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
1043 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
1044 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
1045 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
1046 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
1047 * src/print.c, src/print.h, src/print_graph.c:
1048 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
1049 * src/reduce.h, src/relation.c, src/relation.h:
1050 * src/revision.h, src/scan-code.h, src/scan-code.l:
1051 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
1052 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
1053 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
1054 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
1055 * tests/Makefile.am, tests/actions.at, tests/c++.at:
1056 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
1057 * tests/existing.at, tests/glr-regression.at:
1058 * tests/headers.at, tests/input.at, tests/java.at:
1059 * tests/local.at, tests/output.at, tests/push.at:
1060 * tests/reduce.at, tests/regression.at, tests/sets.at:
1061 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
1062 * tests/torture.at:
1063 Update to GPLv3.
1064
1065 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1066
1067 Get rid of broken %no-parser, -n, and --no-parser implementation and
1068 documentation.
1069 * TODO: Don't mention them.
1070 * doc/bison.1: Likewise.
1071 * doc/bison.texinfo (Decl Summary): Likewise.
1072 (Bison Options): Likewise.
1073 (Option Cross Key): Likewise.
1074 * src/getargs.c (no_parser_flag): Remove global variable.
1075 (usage): Don't print description of -n and --no-parser.
1076 (long_options): Remove --no-parser entry here.
1077 (getargs): Remove -n case in the switch here.
1078 * src/getargs.h (no_parser_flag): Remove extern.
1079 * tests/regression.at (Web2c Actions): Remove comment that mentions
1080 --no-parser.
1081
1082 2007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1083
1084 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
1085 name user variables starting with `yy'. Just pass NULL instead of a
1086 dummy local &yylval to yypush_parse.
1087 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
1088 starting with `yy'.
1089
1090 2007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
1091
1092 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
1093 true since it's then always used regardless of whether yyoverflow is
1094 defined. Reported by Christian Burger at
1095 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
1096 * THANKS: Add Christian Burger.
1097
1098 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1099 node names: say "Decl Summary" not "Bison Declaration Summary".
1100
1101 2007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
1102
1103 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
1104 determine whether this function has already complained about an invalid
1105 value for a %define boolean variable, don't check whether Bison has
1106 ever examined the value. As written, the check was a tautology.
1107 Instead, record and check for this complaint using a separate muscle.
1108
1109 2007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1110
1111 Fix push parsing memory leak reported by Brandon Lucia at
1112 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
1113 * THANKS: Add Brandon Lucia.
1114 * data/push.c (yypstate_delete): Free the stack if it was reallocated
1115 but the parse never completed and thus freed it.
1116 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
1117 * tests/testsuite.at: Include push.at.
1118 * test/push.at: New.
1119 (Push Parsing: Memory Leak for Early Deletion): New test case.
1120
1121 2007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
1122
1123 Improve handling of multiple S/R conflicts in the same state and of S/R
1124 conflicts involving multiple reductions.
1125 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
1126 set for a state here or Bison will abort if it is reassigned on a
1127 later conflicted reduction in the same state.
1128 Similarly, don't finalize and assign the solved conflicts report here
1129 or it will be lost if it is reassigned on a later conflicted reduction
1130 in the same state.
1131 (set_conflicts): Instead, assign them both here after all S/R conflicts
1132 in the state have been fully examined.
1133 * src/print.c (shift_set): Rename to...
1134 (no_reduce_set): ... this.
1135 (print_reductions): Update for rename, and add %nonassoc error action
1136 tokens to no_reduce_set so that, when printing the first remaining
1137 reduction on an error action token, the reduction is enclosed in
1138 brackets.
1139 (print_results): Update for rename.
1140 * tests/conflicts.at (Solved conflicts report for multiple reductions
1141 in a state): New test case.
1142 (%nonassoc error actions for multiple reductions in a state): New test
1143 case.
1144
1145 * src/main.c (main): Don't depend on C99 features.
1146
1147 2007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1148
1149 * build-aux/.cvsignore: Add compile.
1150 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
1151 uniwidth.
1152
1153 2007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
1154
1155 * bootstrap (slurp): Create target directories that don't exist.
1156 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
1157
1158 2007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1159
1160 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
1161 than item number.
1162 * closure.c (closure): Likewise.
1163 * state.h (reductions): Comment sorting of rules.
1164 (state): Comment sorting of items.
1165
1166 2007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
1167
1168 Fix C++ test cases after recent Gnulib changes. Discussed starting at
1169 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
1170 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
1171 definition in order to avoid Gnulib headers since we don't use config.h
1172 here.
1173 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
1174 rather than AT_DATA so that config.h is included.
1175
1176 2007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
1177
1178 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
1179 instead of fprintf. Guard these functions with #if YYDEBUG instead of
1180 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
1181 and so that YYFPRINTF is guaranteed to be defined here.
1182
1183 2007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1184
1185 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
1186 with...
1187 (muscle_percent_define_check_values): ... this more helpful function.
1188 Again, it's not used yet, but it will be.
1189 * src/muscle_tab.h: Likewise.
1190
1191 Improve some comments in parser table construction.
1192 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
1193 (generate_states): Don't mention ruleset, which is internal to closure.
1194 * src/closure.c (closure): Explain sorting of core and itemset, which
1195 is required for this function to behave correctly.
1196 * src/closure.h (closure): Mention sorting.
1197
1198 2007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
1199
1200 * src/lalr.c (state_lookahead_tokens_count): For code readability,
1201 move the check for disabled transitions to an aver since conflict
1202 resolution hasn't happened yet.
1203
1204 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
1205 labels a state as inconsistent just because it has error transitions.
1206 The original form of this check appeared in revision 1.1 of lalr.c,
1207 which was committed on 1991-12-21. Now (at least), changing the
1208 consistency label on such a state appears to have no useful effect in
1209 any of the places it is examined, which I enumerate below. The key
1210 point to understanding each item in this enumeration is that a state
1211 with an error transition is labelled consistent in the first place only
1212 if it has no rules, so the check cannot matter for states that have
1213 rules. (1) Labelling a state as inconsistent will cause set_conflicts
1214 to try to identify its conflicts, and a state must have *rules* to have
1215 conflicts. (2) Labelling a state as inconsistent will affect how
1216 action_row sets the default *rule* for the state. (3) Labelling a
1217 state as inconsistent will cause build_relations to add lookback edges
1218 to *rules* in that state.
1219 * src/state.h (struct state): Word the comment for member consistent
1220 more carefully.
1221
1222 2007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1223
1224 Don't depend on C99 features.
1225 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
1226 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
1227 * src/reader.c (check_and_convert_grammar): Fix for-loop.
1228 * src/state.c (state_mark_reachable_states): Fix for-loop.
1229 (state_remove_unreachable_states): Fix for-loop.
1230
1231 Don't widen struct state with member reachable just to temporarily
1232 record reachability. Instead, use a local bitset.
1233 * src/state.h (struct state): Remove member.
1234 * src/state.c (state_new): Don't initialize it.
1235 (state_mark_reachable_states): Rename to...
1236 (state_record_reachable_states): ... this, and use bitset.
1237 (state_remove_unreachable_states): Use bitset.
1238
1239 2007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
1240
1241 * src/Makefile.am (yacc): Quote target action commands properly so
1242 that the yacc script isn't corrupt. Reported by Hans Aberg at
1243 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
1244
1245 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
1246 the case of pure parsers. Reported by Frans Englich at
1247 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
1248 * THANKS: Add Frans Englich.
1249
1250 * NEWS (2.3a+): In the %code entry, reference section `Bison
1251 Declaration Summary' from the manual now since the %code summary has
1252 moved there.
1253 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
1254 in the rules section must be terminated by semicolons.
1255
1256 2007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1257
1258 Extend the front-end API for %define variables to more completely
1259 mirror the back-end. This will be useful in the future.
1260 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
1261 Update comments to mention the new front-end counterparts of these
1262 macros.
1263 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
1264 for muscle_string_decode and muscle_location_decode.
1265 (muscle_string_decode): New static function.
1266 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
1267 (muscle_percent_define_get, muscle_percent_define_ifdef): New
1268 functions.
1269 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
1270 muscle_percent_define_get to mimic the b4_percent_define_flag_if
1271 implementation more closely.
1272 (muscle_percent_define_invalid_value): New function.
1273 * src/muscle_tab.h (muscle_percent_define_get,
1274 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
1275 Prototype.
1276
1277 2007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1278
1279 * NEWS (2.3a+): Mention yesterday's state-removal change.
1280 (2.3a): Remove the %language entry, which was added after 2.3a.
1281 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
1282 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
1283 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
1284 tests/existing.at: Update copyright date.
1285
1286 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1287
1288 If conflict resolution makes states unreachable, remove those states,
1289 report rules that are then unused, and don't report conflicts in those
1290 states.
1291 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
1292 New global function.
1293 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
1294 function.
1295 * src/main.c (main): After conflict resolution, remove the unreachable
1296 states and update all data structures that reference states by number.
1297 * src/state.c (state_new): Initialize each state's reachable member to
1298 false.
1299 (state_mark_reachable_states): New static function.
1300 (state_remove_unreachable_states): New global function.
1301 * src/state.h (struct state): Add member bool reachable.
1302 (state_remove_unreachable_states): Prototype.
1303 * tests/conflicts.at (Unreachable States After Conflict Resolution):
1304 New test case.
1305 * tests/existing.at (GNU pic Grammar): Update test case output now that
1306 an unused rule is discovered.
1307
1308 2007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1309
1310 Minor code cleanup in parser table construction.
1311 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
1312 (new_itemsets, save_reductions): Update for rename to nitemset.
1313 * src/closure.c (nritemset): Rename to...
1314 (nitemset): ... this since the "r" appears to meaningless and isn't
1315 used in the comments.
1316 (closure): Update for rename.
1317 * src/closure.h (nritemset): Update extern to...
1318 (nitemset): ... this.
1319 * src/lalr.c (LA): Fix a typo in comments.
1320 * src/print.c (print_core): Update for rename to nitemset.
1321 * src/print_graph.c (print_graph): Likewise.
1322 * src/state.h: Fix some typos in header comments.
1323
1324 2007-04-04 Paul Eggert <eggert@cs.ucla.edu>
1325
1326 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
1327 still sticks to ASCII. Sorry!
1328
1329 * README-hacking: New file, taken mostly from coreutils, with changes
1330 for Bison. Contains much of the contents of:
1331 * README-cvs: Remove.
1332 * bootstrap: Sync from gnulib.
1333 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
1334 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
1335
1336 2007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
1337
1338 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
1339 Setzer.
1340 (Java Differences): Fix some typos.
1341 * THANKS: Add Sebastian Setzer.
1342
1343 2007-03-07 Paolo Bonzini <bonzini@gnu.org>
1344
1345 * data/java.m4 (b4_single_class_if): Remove.
1346 (b4_abstract_if): Look at "%define abstract".
1347 (b4_lexer_if): New.
1348 (b4_union_name): Rename...
1349 (b4_yystype): ... to this. Map to "%define stype".
1350 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
1351 b4_maybe_throws): Fix quoting.
1352 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
1353 * data/lalr1.java (Lexer interface): Always define.
1354 (Lexer interface within parser class): Remove.
1355 (YYLexer class): New, used when "%code lexer" is present.
1356 (constructor): When "%code lexer" is used, pass %lex-param
1357 to the lexer constructor.
1358 (yylex, yyparse): Remove %lex-param from method invocations
1359 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
1360
1361 * doc/bison.texinfo (Java Bison Interface): Mention "%define
1362 abstract". Rename "%define union_name" to "%define stype".
1363 Rename method names according to previous patch.
1364 (Java Scanner Interface): Describe "%code lexer" instead of
1365 "%pure-parser" and "%define single_class".
1366 (Java Differences): Mention "%code lexer".
1367
1368 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
1369 Include scanner here, using macros from tests/local.at.
1370 (AT_DATA_CALC_Y): Remove final argument.
1371 (_AT_CHECK_JAVA_CALC): Likewise.
1372 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
1373 of %locations and %error-verbose.
1374 (main): Test with and without %lex-param.
1375 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
1376 (AT_BISON_OPTION_POPDEFS): Pop it.
1377
1378 2007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1379
1380 DJGPP spefic issue. Inhibit the use of disallowed characters for
1381 file name genertion on Win98, WinXP, etc. These are |<>":?*\
1382 and concern testsuite case 46.
1383 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
1384 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
1385 * djgpp/config.bat: Inhibit the use of disallowed characters.
1386
1387 2007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
1388
1389 Miscellaneous %define and %code cleanup.
1390 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
1391 values are interpreted.
1392 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
1393 documentation a little more.
1394 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
1395 muscle_percent_define_insert, muscle_percent_code_grow): New
1396 functions/macros.
1397 * src/muscle_tab.h (muscle_percent_define_insert,
1398 muscle_percent_code_grow): Prototype.
1399 * src/parse-gram.y (prologue_declaration): Use
1400 muscle_percent_define_insert and muscle_percent_code_grow when parsing
1401 %define and %code directives.
1402
1403 Make it easy to share %define boolean variables between the front-end
1404 and back-end. Though not used yet, this will be useful in the future.
1405 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
1406 Bison uses of names rather than just skeleton uses of names.
1407 (b4_percent_define_get, b4_percent_define_ifdef): Rename
1408 b4_percent_define_skeleton_variables(VARIABLE) to
1409 b4_percent_define_bison_variables(VARIABLE).
1410 (b4_percent_code_get, b4_percent_code_ifdef): Rename
1411 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
1412 b4_percent_code_bison_qualifiers(QUALIFIER).
1413 (b4_check_user_names_wrap): Update for renames.
1414 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
1415 muscle_percent_define_default): New functions mimicking
1416 b4_percent_define_flag_if and b4_percent_define_default.
1417
1418 For %define variables, report locations for invalid values and
1419 redefinitions.
1420 * data/bison.m4 (b4_percent_define_flag_if): Read
1421 b4_percent_define_loc(VARIABLE) to report the location of an invalid
1422 value for VARIABLE.
1423 (b4_percent_define_default): Save a special location in
1424 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
1425 must later be reported as invalid.
1426 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
1427 functions.
1428 (muscle_percent_define_insert): Record the location of VARIABLE in
1429 muscle percent_define_loc(VARIABLE), and use it to report the previous
1430 location for a redefinition.
1431 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
1432 (muscle_percent_define_default): Update like b4_percent_define_default.
1433 (muscle_grow_user_name_list): Rename to...
1434 (muscle_user_name_list_grow): ... this for consistency and use
1435 muscle_location_grow.
1436 * src/muscle_tab.h (muscle_location_grow): Prototype.
1437 * tests/input.at (%define errors): Update expected output.
1438 * tests/skeletons.at (%define boolean variables: invalid skeleton
1439 defaults): New test case.
1440
1441 2007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
1442
1443 * src/print.c (lookahead_set, state_default_rule): Remove.
1444 (print_reductions): Replace state_default_rule invocation with
1445 equivalent use of yydefact, which was computed in token_actions in
1446 tables.c.
1447 (print_results): Don't allocate lookahead_set.
1448
1449 2007-02-27 Paolo Bonzini <bonzini@gnu.org>
1450
1451 * data/lalr1.java: Prefix all private members with yy.
1452
1453 2007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
1454
1455 Use YYFPRINTF instead of fprintf where appropriate. Reported by
1456 Sebastien Fricker at
1457 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
1458 * THANKS: Add Sebastien Fricker.
1459 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
1460 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
1461 accept a variable number of arguments.
1462
1463 2007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1464
1465 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
1466
1467 2007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1468
1469 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
1470 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
1471 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
1472
1473 2007-02-11 Paul Eggert <eggert@cs.ucla.edu>
1474
1475 Undo my 2007-02-07 change, switching back to the c-strcase module
1476 introduced in the 2007-02-03 change. Bruno Haible reported that
1477 the 2007-02-07 change would be dangerous in Turkish if we add a
1478 language whose name contains "i", since "i" is not lowercase "I"
1479 in Turkish.
1480 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
1481 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
1482 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
1483 * m4/.cvsignore: Remove strcase.m4.
1484 * src/getargs.c: Revert 2007-02-07 change, as follows.
1485 Include c-strcase.h.
1486 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
1487
1488 2007-02-11 Bruno Haible <bruno@clisp.org>
1489
1490 Enable the Java related testsuite tests when the only Java compiler
1491 found is a gcj < 4.3. Discussed at
1492 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
1493 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
1494
1495 2007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
1496
1497 * data/Makefile.am: Update copyright date.
1498 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
1499 yypstate_new returns NULL.
1500 (yypstate_new): Return NULL if malloc does.
1501 * src/reader.c (packgram): Move translation of rule actions from the
1502 beginning of packgram to...
1503 (check_and_convert_grammar): ... here right before packgram is invoked
1504 so it's easier to write more complete comments, and remove redundant
1505 code.
1506
1507 2007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
1508
1509 As in semantic actions, make @$ in %initial-action, %destructor, and
1510 %printer imply %locations.
1511 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
1512 scanning @$.
1513 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
1514 (@$ in %initial-action implies %locations,
1515 @$ in %destructor implies %locations,
1516 @$ in %printer implies %locations): ... these new test cases.
1517
1518 2007-02-07 Paul Eggert <eggert@cs.ucla.edu>
1519
1520 Undo most of the 2007-02-03 change, switching to the strcase module
1521 now that gnulib strcase has been fixed.
1522 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
1523 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
1524 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
1525 * m4/.cvsignore: Add strcase.m4.
1526 * src/getargs.c: Revert 2007-02-03 change, as follows.
1527 Don't include c-strcase.h.
1528 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
1529 strcasecmp has "unspecified behavior" outside the POSIX locale,
1530 but it works fine in practice if at least one argument is ASCII,
1531 as is the case in Bison.
1532
1533 2007-02-07 Paolo Bonzini <bonzini@gnu.org>
1534
1535 * tests/java.at: Skip tests if only one of javac/java is present.
1536 Reported by Joel E. Denny.
1537 * tests/atlocal.in: Adjust copyright years.
1538
1539 2007-02-05 Paolo Bonzini <bonzini@gnu.org>
1540
1541 * data/lalr1.java (Stack): Work around old verifiers that disallow
1542 access to the private fields of an inner class, from the outer class.
1543 We can make Stack's fields public because user code doesn't have access
1544 to the instance of Stack used by parse(). Reported by Paul Eggert.
1545
1546 2007-02-03 Paul Eggert <eggert@cs.ucla.edu>
1547
1548 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
1549 the right spot for these files?
1550 * bootstrap.conf (gnulib_modules): Add c-strcase.
1551 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
1552 c-strncasecmp.c.
1553 * src/getargs.c: Include c-strcase.h.
1554 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
1555 to avoid unspecified behavior.
1556
1557 2007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
1558
1559 * doc/bison.texinfo (Decl Summary): Correct typo.
1560
1561 2007-01-30 Paolo Bonzini <bonzini@gnu.org>
1562
1563 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
1564 Complain if the value does not match empty, "true" or "false".
1565 * data/c++.m4: Adjust default definitions of %define variables.
1566 * data/java.m4: Adjust default definitions of %define variables.
1567 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
1568 to above behavior.
1569 * tests/input.at (Boolean %define variables): Test new behavior.
1570
1571 2007-01-29 Paolo Bonzini <bonzini@gnu.org>
1572
1573 * NEWS: Mention java.
1574 * TODO: Remove things that are done.
1575 * bootstrap.conf: Add javacomp-script and javaexec-script.
1576 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
1577
1578 * data/Makefile.am: Add new files.
1579 * data/java-skel.m4: New.
1580 * data/java.m4: New.
1581 * data/lalr1.java: New.
1582
1583 * doc/bison.texinfo: Put "A Complete C++ Example" under
1584 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
1585 under Other Languages.
1586
1587 * src/getargs.c (valid_languages): Add Java.
1588 * src/getargs.h (struct bison_language): Update size of string fields.
1589
1590 * tests/Makefile.am: Add java.at.
1591 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
1592 * tests/java.at: New.
1593 * tests/testsuite.at: Include it.
1594
1595 2007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
1596
1597 Clean up.
1598 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
1599 at_directive_argv arguments so these no longer have to be global
1600 variables. Also, update the implementation for the following changes.
1601 (fail_for_at_directive_too_many_args,
1602 fail_for_at_directive_too_few_args): Add at_directive_name argument.
1603 (at_directive_name): Remove as at_directive_argv[0] will be used for
1604 this now.
1605 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
1606 for the directive name.
1607 (at_directive_argc, at_directive_argv): Make these local within
1608 skel_lex instead of global.
1609 (INITIAL): Update directive start action for above changes.
1610 (SC_AT_DIRECTIVE_ARG): Rename to...
1611 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
1612 (SC_AT_DIRECTIVE_SKIP_WS): Update.
1613 (scan_skel): Move yylex_destroy to...
1614 (skel_scanner_free): ... here.
1615 * tests/skeletons.at (installed skeleton file name): Rename to...
1616 (installed skeleton file names): ... this.
1617
1618 2007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
1619
1620 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1621 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
1622 Summary" not "Directives".
1623 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
1624 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
1625 since the former is now the more complete one.
1626 (Prologue Alternatives): Likewise and do the same for %defines.
1627 (Table of Symbols): Add summary of %code, add summary of %define, and
1628 move full %code documentation to...
1629 (Decl Summary): ... here for consistency with other entries in these
1630 sections.
1631 Move %define entry in order to keep this list alphabetized.
1632 Reword %define entry a little to put less emphasis on the skeleton
1633 concept, which most users shouldn't have to think about.
1634
1635 2007-01-26 Paul Eggert <eggert@cs.ucla.edu>
1636
1637 Adjust to recent gnulib changes.
1638 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
1639 Add string.h, string_.h, unistd_.h, wchar_.h.
1640 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
1641 * src/system.h: Don't include <stpcpy.h>; this is now done by
1642 <string.h>.
1643
1644 2007-01-23 Paolo Bonzini <bonzini@gnu.org>
1645
1646 Simplify implementation of unqualified %code, implement macros for
1647 uniform treatment of boolean %define flags. Document %define.
1648 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
1649 b4_percent_code_ifdef): New.
1650 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
1651 * data/c++.m4: Define default value for global_tokens_and_yystype.
1652 * data/glr.cc: Likewise.
1653 * data/location.cc: Use b4_percent_define_flag_if.
1654
1655 * doc/bison.texinfo (Decl Summary): Document %define.
1656
1657 * src/parse-gram.y (Unqualified %code): Change muscle name to
1658 b4_percent_code().
1659 (content.opt): Default to empty.
1660
1661 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1662
1663 Implement support for relative and absolute skeleton file names.
1664 Discussed starting at
1665 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
1666 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
1667 (Bison Options): Document in --skeleton entry.
1668 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
1669 full_skeleton can't necessarily hold all of pkgdatadir.
1670 If the specified skeleton file name contains a `/', don't prepend
1671 pkgdatadir.
1672 * src/parse-gram.y (prologue_declaration): If the specified skeleton
1673 file name contains a `/', prepend the grammar file directory.
1674 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
1675 * skeletons.at: New file.
1676 (relative skeleton file names): New test case.
1677 (installed skeleton file names): New test case.
1678 * tests/testsuite.at: Include skeletons.at.
1679
1680 * bootstrap: Update copyright to 2007.
1681
1682 2007-01-17 Paolo Bonzini <bonzini@gnu.org>
1683
1684 * bootstrap: Remove occurrences of .#bootmp from the files.
1685
1686 2007-01-17 Akim Demaille <akim@epita.fr>
1687
1688 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
1689 nonterminals.
1690 Use per-type %printer.
1691
1692 2007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1693
1694 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
1695 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1696 djgpp/config.site, src/files.c, src/files.h, src/main.c,
1697 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
1698 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
1699 tests/glr-regression.at, tests/input.at, tests/local.at,
1700 tests/output.at, tests/torture.at: Update copyright to 2007.
1701
1702 2007-01-16 Akim Demaille <akim@epita.fr>
1703
1704 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
1705 error code.
1706 (Calc++ Scanner): Exit with failure if we can't open the input
1707 file.
1708 Accept "-" standing for stdin.
1709 (Calc++ Top Level): Print the result only if the parsing was
1710 successful.
1711
1712 2007-01-16 Akim Demaille <akim@epita.fr>
1713
1714 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
1715
1716 2007-01-15 Paolo Bonzini <bonzini@gnu.org>
1717 and Joel E. Denny <jdenny@ces.clemson.edu>
1718
1719 Clean up %define and %code implementation in M4 some. Most
1720 importantly, rename all related macros to be in the b4_percent_define
1721 and b4_percent_code namespaces. Also, complete support for `.' in
1722 %define variable names and %code qualifiers.
1723 * data/bison.m4 (b4_check_user_names): Check for special
1724 "SKELETON-NAMESPACE(name)" macros instead of using two nested
1725 m4_foreach loops.
1726 (b4_get_percent_define, b4_get_percent_code): Rename to...
1727 (b4_percent_define_get, b4_percent_code_get): ... these.
1728 Extend documentation with examples.
1729 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
1730 b4_percent_define_skeleton_variables and
1731 b4_percent_code_skeleton_qualifiers.
1732 Expect any value for the %define variable `foo' to be stored in the
1733 macro named `b4_percent_define(foo)'; expect any %code blocks for the
1734 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
1735 expect any unqualified %code blocks to be stored in a macro named
1736 `b4_percent_code_unqualified'.
1737 Use m4_indir so that %define variable names and %code qualifiers can
1738 contain `.', which is allowed by the grammar parser.
1739 (b4_percent_define_default): New macro to set a default value for a
1740 %define variable.
1741 (m4_wrap): Update wrapped code, and fix some underquoting.
1742 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
1743 Expect grammar uses of %define variables and %code qualifiers to be
1744 defined in b4_percent_define_user_variables and
1745 b4_percent_code_user_qualifiers.
1746 * data/c++.m4: Use b4_percent_define_default rather than
1747 m4_define_default. Fix some underquoting. Skeleton usage of %define
1748 variable define_location_comparison now implies skeleton usage of
1749 %define variable filename_type.
1750 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1751 data/push.c, data/yacc.c: Update macro names.
1752 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
1753 muscle names.
1754
1755 2007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1756
1757 DJGPP specific issues.
1758
1759 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
1760 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
1761
1762 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1763
1764 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
1765 run parsers in all tests so that Valgrind is invoked during
1766 maintainer-check-valgrind.
1767 (Duplicate representation of merged trees): Free all semantic values.
1768 (Duplicated user destructor for lookahead): Likewise.
1769
1770 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1771
1772 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
1773 command-line prefix.
1774 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
1775 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
1776 miss Valgrind messages.
1777 (Exploding the Stack Size with Malloc): Likewise.
1778
1779 2007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1780
1781 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
1782 locals. Reported by Juan Manuel Guerrero at
1783 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
1784 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
1785 Fix some indentation also.
1786 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
1787 explaining this issue.
1788
1789 2007-01-09 Paolo Bonzini <bonzini@gnu.org>
1790 and Joel E. Denny <jdenny@ces.clemson.edu>
1791
1792 Simplify union and prologue handling, and escape union and lex/parse
1793 params with digraphs.
1794 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
1795 values to the empty string since these are no longer guaranteed
1796 initialized by the front-end.
1797 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
1798 braces around b4_user_stype since this is no longer done by the
1799 front-end.
1800 * src/files.c, src/files.h (pre_prologue_obstack,
1801 post_prologue_obstack): Remove.
1802 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
1803 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
1804 with digraphs. This fixes lex params and parse params.
1805 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
1806 * src/output.c (prepare): Remove muscle insertion of the prologues.
1807 (output): Remove freeing of pre_prologue_obstack and
1808 post_prologue_obstack.
1809 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
1810 than prologue_augment for prologue parsing so you don't need prologue
1811 obstacks.
1812 (grammar_declaration): For %union RHS, use `braceless' instead of
1813 "{...}" so that braces are already stripped and code is escaped with
1814 digraphs.
1815 * src/reader.c (prologue_augment): Remove.
1816 (reader): Remove initialization of pre_prologue_obstack and
1817 post_prologue_obstack.
1818 * src/reader.h (prologue_augment): Remove.
1819
1820 * data/c.m4: Remove stray parenthesis.
1821
1822 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1823
1824 Remove quotes from variables names in %define directives and from
1825 qualifiers in %code directives, and restrict the characters that are
1826 allowed in them to M4-friendly ones. For %define, continue to support
1827 the quoted form as a deprecated feature. Discussed starting at
1828 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
1829 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
1830 %code.
1831 * doc/bison.texinfo (Prologue Alternatives): Update.
1832 (Decl Summary): In %defines entry, update mention of `%code requires'
1833 and `%code provides'.
1834 (C++ Location Values): Update %define uses.
1835 (Calc++ Parser Interface): Likewise.
1836 (Calc++ Parser): Likewise, and update `%code requires' uses.
1837 (Table of Symbols): Update %code documentation.
1838 * src/parse-gram.y (prologue_declaration): For %define variables, use
1839 `variable' instead of `STRING'.
1840 (grammar_declaration): For %code qualifiers, use `ID' instead of
1841 `STRING'.
1842 (variable): New nonterminal that takes an `ID' or a `STRING'.
1843 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
1844 and %define uses.
1845 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
1846 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
1847 (%define errors): Update %define uses.
1848
1849 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1850
1851 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
1852 instead of muscle_insert for %define values so that M4-special
1853 characters are replaced with digraphs.
1854 * tests/input.at (%define errors): Extend to check weird values.
1855
1856 2007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1857
1858 Instead of having skeletons declare all valid %define variables and
1859 %code qualifiers, provide macros that retrieve the associated values
1860 and build these lists automatically. Thus Bison will now warn when a
1861 variable or qualifier is not used by the skeleton in the current
1862 invocation regardless of whether it might sometimes be used by that
1863 skeleton in other invocations. Also, move all %define value macros to
1864 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
1865 form, which is replaced by %code.
1866 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
1867 (b4_check_user_names): ... this, and change the series of valid name
1868 arguments to a single list argument for names used in the skeleton
1869 similar to the existing list argument for names used in the grammar.
1870 Warn instead of complaining.
1871 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
1872 values and %code code, to format %code code properly, and to build
1873 lists of all %define variables and %code qualifiers used in the
1874 skeleton: b4_skeleton_percent_define_variables and
1875 b4_skeleton_percent_code_qualifiers.
1876 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
1877 Remove, and...
1878 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
1879 the skeleton names lists can finish building first. In place of
1880 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
1881 expect the lists b4_user_percent_define_variables and
1882 b4_user_percent_code_qualifiers.
1883 * data/c++.m4: Where setting default values for b4_parser_class_name,
1884 b4_location_type, b4_filename_type, b4_namespace, and
1885 b4_define_location_comparison, update their names to the
1886 b4_percent_define_ namespace.
1887 * data/glr.c: Don't use b4_check_percent_define_variables and
1888 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1889 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
1890 (b4_parser_class_name, b4_namespace): Define these using
1891 b4_get_percent_define for parser_class_name and namespace.
1892 * data/location.cc: Use b4_get_percent_define.
1893 * data/push.c: Don't use b4_check_percent_define_variables and
1894 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1895 * data/yacc.c: Likewise, and don't call m4_exit in
1896 b4_use_push_for_pull_if or m4_wrap code will never execute.
1897 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
1898 Rename to...
1899 (muscle_grow_user_name_list): ... this for consistency with the
1900 terminology used in bison.m4.
1901 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
1902 %define variable names, and rename muscle used_percent_define_variables
1903 to user_percent_define_variables.
1904 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
1905 user_percent_code_qualifiers.
1906 (content): Remove.
1907 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
1908 {CODE} form is no longer accepted.
1909 * tests/input.at (Reject bad %code qualifiers): Rename to...
1910 (Reject unused %code qualifiers): ... this, and update test output.
1911 (%define error): Update test output.
1912
1913 2007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
1914
1915 Check for unrecognized %define variables similar to checking for
1916 unrecognized %code qualifiers. Check for redefined %define variables.
1917 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
1918 generalizes...
1919 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
1920 (b4_check_percent_define_variables): New, also wraps it.
1921 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
1922 variables using b4_check_percent_define_variables.
1923 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
1924 all those exercised in the test suite and all those listed in the
1925 `Default values' section of c++.m4. Are there others?
1926 * data/push.c, data/yacc.c: Declare no valid %define variables.
1927 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
1928 similar to muscle_find, but it works even when the muscle stores a
1929 const value.
1930 (muscle_grow_used_name_list): New function for constructing the used
1931 name list muscles that b4_check_for_unrecognized_names requires.
1932 * src/parse-gram.y (prologue_declaration): Warn if a variable is
1933 %define'd more than once. Define the b4_used_percent_define_variables
1934 muscle with muscle_grow_used_name_list.
1935 (grammar_declaration): Abbreviate %code code with
1936 muscle_grow_used_name_list.
1937 * tests/input.at (%define errors): New.
1938
1939 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1940
1941 Provide warn_at, complain_at, and fatal_at function callbacks to the
1942 skeletons, and use this for %code qualifier complaints.
1943 * data/bison.m4 (b4_error_at): New, invoked by...
1944 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
1945 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
1946 @fatal_at(...@) directives.
1947 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
1948 qualifiers in b4_used_percent_code_qualifiers and to use
1949 b4_complain_at.
1950 * src/location.c, src/location.h (boundary_set_from_string): New global
1951 function.
1952 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
1953 function.
1954 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
1955 to b4_used_percent_code_qualifiers.
1956 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
1957 function.
1958 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
1959 (lineno): Rename to...
1960 (out_lineno): ... this so I don't misunderstand it again.
1961 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
1962 here; these newlines are in the input but not the output file.
1963 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
1964 (at_directive_perform): ... this new static function, and add handling
1965 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
1966 directives.
1967 * tests/input.at (Reject bad %code qualifiers): Update test output with
1968 locations and extend.
1969
1970 * tests/output.at (Output file name: [, Output file name: ]): Remove
1971 bogus comment about these tests failing.
1972
1973 2007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1974
1975 Clean up b4_check_percent_code_qualifiers a little.
1976 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
1977 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
1978 documentation and add examples.
1979 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
1980 qualifiers here.
1981
1982 2007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
1983
1984 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
1985 unreliable -- especially when they're hidden inside another macro.
1986 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
1987 data/c.m4: Remove m4_divert(-1).
1988 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1989 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
1990 m4_divert_push(0) and m4_divert_pop(0).
1991 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
1992 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
1993 pushed and popped by m4sugar, should be first on the stack.
1994
1995 Provide warn, complain, and fatal function callbacks to the skeletons.
1996 This provides more flexibility than m4_fatal, improves the error
1997 message format, and captures messages for translation. Discussed
1998 starting at
1999 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
2000 * data/bison.m4 (b4_error): New, invoked by...
2001 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
2002 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
2003 directives. Because these M4 macros might be called when the current
2004 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
2005 the previous removal of uses of m4_divert, which caused trouble.
2006 (b4_check_percent_code_qualifiers): Use b4_complain instead of
2007 m4_fatal to report unrecognized %code qualifiers.
2008 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
2009 push parser requests.
2010 * data/glr.c: Use b4_complain instead of m4_fatal to report
2011 non-deterministic push parser requests.
2012 Update @output usage to @output(...@) form.
2013 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
2014 report missing %defines. Update @output usage to @output(...@) form.
2015 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
2016 @output(...@) form.
2017 * src/main.c (main): Invoke skel_scanner_free.
2018 * src/scan-skel.h (skel_scanner_free): Prototype new function.
2019 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
2020 obstack_for_string from flex-scanner.h.
2021 (YY_DECL): Use to declare skel_lex static.
2022 (decode_at_digraphs): Remove; now handled in the new
2023 SC_AT_DIRECTIVE_ARG start condition.
2024 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
2025 functions.
2026 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
2027 at_directive_argv): New static globals.
2028 (INITIAL): Use fail_for_invalid_at.
2029 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
2030 recognize the start of a generalized `@directive(...@)' form and
2031 start...
2032 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
2033 directive args (using the new obstack_for_string), to decode the
2034 contained @ diagraphs, and to perform the directive. It recognizes
2035 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
2036 @output(...@).
2037 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
2038 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
2039 `@,'.
2040 (scan_skel): Initialize obstack_for_string on the first call.
2041 (skel_scanner_free): New function to free obstack_for_string.
2042 * tests/input.at (Reject bad %code qualifiers): Update test output.
2043
2044 2007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
2045
2046 Consolidate the 4 prologue alternative directives (%code, %requires,
2047 %provides, and %code-top) into a single %code directive with an
2048 optional qualifier field. Discussed at
2049 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
2050 * NEWS (2.3a+): Rewrite the existing entry for the prologue
2051 alternatives.
2052 * doc/bison.texinfo (Prologue Alternatives): Update.
2053 (Decl Summary): Update to %code "requires" and %code "provides".
2054 (Calc++ Parser): Update to %code "requires".
2055 (Table of Symbols): Remove entries for %requires, %provides, and
2056 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
2057 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
2058 are replaced by b4_percent_code_provides and b4_percent_code_requires,
2059 which are skeleton-specific.
2060 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
2061 declare what %code qualifiers it supports and to complain if any other
2062 qualifiers were used in the grammar.
2063 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
2064 and b4_user_code([b4_percent_code_provides]) in place of
2065 b4_user_requires and b4_user_provides.
2066 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
2067 Add b4_user_code([b4_percent_code_top]) and
2068 b4_user_code([b4_percent_code]).
2069 Invoke b4_check_percent_code_qualifiers.
2070 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2071 PERCENT_REQUIRES): Remove.
2072 (grammar_declaration): Remove RHS's for %code-top, %provides, and
2073 %requires. Rewrite the %code RHS as the unqualified form defining the
2074 muscle b4_percent_code. Add another RHS for the qualified %code form,
2075 which defines muscles of the form b4_percent_code_QUALIFIER and the
2076 b4_used_percent_code_qualifiers muscle.
2077 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2078 PERCENT_REQUIRES): Remove.
2079 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
2080 %code "requires" and %code "provides".
2081 * tests/input.at (Reject bad %code qualifiers): New.
2082
2083 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2084
2085 Use the new code_props interface for destructors and printers.
2086 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
2087 printer_location members, and change the type of the destructor and
2088 printer members to code_props.
2089 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
2090 symbol_printer_get, semantic_type_destructor_set,
2091 semantic_type_printer_set, default_tagged_destructor_set,
2092 default_tagless_destructor_set, default_tagged_printer_set,
2093 default_tagless_printer_set): Use code_props in arguments and return
2094 types in place of char const * and location.
2095 (symbol_destructor_location_get, symbol_printer_location_get): Remove
2096 since the locations are now contained in the return of
2097 symbol_destructor_get and symbol_printer_get.
2098 * src/output.c (symbol_destructors_output, symbol_printers_output):
2099 Replace with...
2100 (symbol_code_props_output): ... this to eliminate duplicate code.
2101 (output_skeleton): Update to use symbol_code_props_output.
2102 * src/reader.c (symbol_should_be_used): Update use of
2103 symbol_destructor_get.
2104 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2105 Update uses of the various _destructor_set and _printer_set functions.
2106 * src/symtab.c: (default_tagged_destructor_location,
2107 default_tagless_destructor_location, default_tagged_printer_location,
2108 default_tagless_printer_location): Remove since we...
2109 (default_tagged_destructor, default_tagless_destructor,
2110 default_tagged_printer, default_tagless_printer): ... change the type
2111 of these to code_props.
2112 (symbol_new, semantic_type_new, symbol_destructor_set,
2113 semantic_type_destructor_set, symbol_destructor_get,
2114 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
2115 symbol_check_alias_consistency, default_tagged_destructor_set,
2116 default_tagless_destructor_set, default_tagged_printer_set,
2117 default_tagless_printer_set): Update.
2118 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
2119 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
2120 code_props members.
2121 (symbol_print): Use SYMBOL_CODE_PRINT.
2122
2123 2007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2124
2125 Use the new code_props interface for rule actions.
2126 * src/symlist.h (symbol_list): Replace action, action_location, and
2127 used members with a code_props action_props member.
2128 * src/reader.c (symbol_should_be_used, grammar_rule_check,
2129 grammar_midrule_action, grammar_current_rule_merge_set,
2130 grammar_current_rule_symbol_append, packgram): Update.
2131 * src/scan-code.h (translate_rule_action): Remove, no longer used.
2132 * src/scan-code.l (handle_action_dollar): Update.
2133 (translate_rule_action): Remove, no longer used.
2134 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
2135
2136 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2137
2138 Use the new code_props interface in parse-gram.y.
2139 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
2140 Update all uses of translate_* functions to use the new code_props
2141 interface and to use gram_scanner_last_string_free and
2142 code_scanner_last_string_free where possible.
2143 (grammar_declaration): symbol_list_destructor_set and
2144 symbol_list_printer_set now perform the translation, so don't do it
2145 here. Use gram_scanner_last_string_free where possible.
2146 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
2147 translate_code): Remove, no longer used.
2148 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
2149 symbol_list_printer_set): Perform code translation here rather than
2150 depending on the caller to do so.
2151
2152 * src/symlist.h (struct symbol_list): Correct some documentation typos.
2153 * src/scan-gram.h (gram_last_string): Remove declaration.
2154 * src/scan-gram.l (last_string): Declare it static.
2155
2156 2007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2157
2158 Encapsulate code properties and related functionality for the various
2159 destructors, printers, and actions into a code_props structure and
2160 interface. This patch merely implements code_props in scan-code.h and
2161 scan-code.l. Future patches will rewrite other modules to use it.
2162 Discussed starting at
2163 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
2164 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
2165 consistently initialize const structs that have an empty location
2166 field.
2167 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
2168 to ensure consistency.
2169 * src/scan-code.h (code_props): New structure.
2170 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
2171 function, macro, and const global variable for initializing a
2172 code_props with no code.
2173 (code_props_plain_init, code_props_symbol_action_init,
2174 code_props_rule_action_init, code_props_translate_code): The rest of
2175 the new code_props functional interface. Among other things, the init
2176 functions set the code_props kind field so that
2177 code_props_translate_code will know whether to behave like
2178 translate_symbol_action, translate_rule_action, or translate_code.
2179 These old translate functions must remain until all other modules are
2180 updated to use the new code_props interface.
2181 (code_scanner_last_string_free): New function similar to
2182 gram_scanner_last_string_free.
2183 (code_scanner_free): Add documentation.
2184 * src/scan-code.l: Implement the new interface.
2185 (code_lex): Make it static, add a code_props* argument, and remove the
2186 rule argument.
2187 (last_string): New static global similar to the one in scan-gram.l.
2188 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
2189 instead of rule.
2190 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
2191 code_props since Bison may one day use this information for destructors
2192 and printers.
2193 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
2194 (handle_action_dollar): Use symbol_list_n_get and set used flag
2195 directly since symbol_list_n_used_set is removed.
2196 (translate_action): Add a code_props* argument and remove the rule,
2197 action, and location arguments. Pass the code_props* on to code_lex.
2198 (translate_rule_action, translate_symbol_action, translate_code):
2199 Rewrite as wrappers around the new code_props interface.
2200 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
2201 it would eventually need to break the encapsulation of code_props.
2202
2203 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2204
2205 * etc/.cvsignore: New.
2206
2207 2007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2208
2209 Add maintainer-push-check to run maintainer-check using push parsing in
2210 place of pull parsing where available.
2211 * Makefile.am (maintainer-push-check): New.
2212 * data/bison.m4 (b4_use_push_for_pull_if): New.
2213 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
2214 appropriately based on their existing values.
2215 (yypush_parse): Don't print push-parser-specific diagnostics if push
2216 parsing is being used in place of pull parsing.
2217 * data/yacc.c: If push parsing should replace pull parsing, redirect to
2218 push.c.
2219 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
2220 variable, and insert b4_use_push_for_pull_flag into muscles.
2221 * tests/Makefile.am (maintainer-push-check): New.
2222
2223 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2224
2225 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
2226 (whether successful or failed) so that yypush_parse can be invoked
2227 again to start a new parse using the same yypstate.
2228 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
2229 check multiple yypull_parse invocations on the same yypstate. For pull
2230 mode, extend to check multiple yyparse invocations.
2231 (Exploding the Stack Size with Alloca): Extend to try with
2232 %push-pull-parser.
2233 (Exploding the Stack Size with Malloc): Likewise.
2234
2235 * tests/calc.at (Simple LALR Calculator): Don't specify
2236 %skeleton "push.c" since %push-pull-parser implies that now.
2237 * tests/headers.at (export YYLTYPE): Don't check for the push
2238 declarations. Otherwise, this test case can't be used to see if push
2239 mode can truly emulate pull mode.
2240 * tests/input.at (Torturing the Scanner): Likewise.
2241 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
2242 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
2243 AT_YACC_IF, which now includes the case of push mode since %skeleton
2244 need not be used for push mode. This will be more intuitive once
2245 push.c is renamed to yacc.c.
2246
2247 2006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2248
2249 For push mode, convert yyparse from a macro to a function, invoke yylex
2250 instead of passing a yylexp argument to yypull_parse, and don't
2251 generate yypull_parse or yyparse unless %push-pull-parser is declared.
2252 Discussed starting at
2253 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
2254 * data/bison.m4 (b4_pull_if): New.
2255 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
2256 * data/push.c: Improve M4 quoting a little.
2257 (b4_generate_macro_args, b4_parenthesize): Remove.
2258 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
2259 any time a pull parser is requested.
2260 Don't #define this as a wrapper around yypull_parse. Instead, when
2261 both push and pull are requested, make it a function that does that
2262 same thing.
2263 (yypull_parse): If there's a b4_prefix, #define this to
2264 b4_prefix[pull_parse] when both push and pull are requested.
2265 Don't define this as a function unless both push and pull are
2266 requested.
2267 Remove the yylexp argument and hard-code yylex invocation instead.
2268 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
2269 %push-parser.
2270 * src/getargs.c (pull_parser): New global initialized to true.
2271 * getargs.h (pull_parser): extern it.
2272 * src/output.c (prepare): Insert pull_flag muscle.
2273 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
2274 (prologue_declaration): Set both push_parser and pull_parser = true for
2275 %push-pull-parser. Set push_parser = true and pull_parser = false for
2276 %push-parser.
2277 * src/scan-gram.l: Don't accept %push_parser as an alternative to
2278 %push-parser since there's no backward-compatibility concern here.
2279 Scan %push-pull-parser.
2280 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
2281 instead of %push-parser.
2282 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
2283 prototype it in the module that calls yyparse.
2284 * tests/input.at (Torturing the Scanner): Likewise.
2285 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
2286
2287 2006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
2288
2289 Update etc/bench.pl. Optimize push mode a little (the yyn change
2290 deserves most of the credit).
2291 * Makefile.am (SUBDIRS): Add etc subdirectory.
2292 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
2293 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
2294 yytoken, yyval, and yyloc declarations to...
2295 (yyparse or yypush_parse): ... here to improve performance. For
2296 yypush_parse invocations after the first, be sure to assign yyn its old
2297 value again.
2298 (yypstate_new): Don't bother initializing the yyresult field since the
2299 initial value isn't used.
2300 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
2301 remove the #define that, in push mode, set it to yyps->NAME.
2302 * etc/Makefile.am: New.
2303 * etc/bench.pl: Remove and build it instead from...
2304 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
2305 "tests/bison" from the build directory by default rather than just
2306 invoking "bison" from $PATH.
2307 (calc_grammar): Update push parser code: don't declare yylval globally,
2308 don't define yyparse_wrapper, and don't #define yyparse.
2309 (bench_grammar): Update to check all working combinations of yacc.c,
2310 push.c, impure, pure, pull, and push.
2311
2312 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2313
2314 For push mode, add pull wrappers around yypush_parse.
2315 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
2316 (yypull_parse): New function wrapping yypush_parse.
2317 (yyparse): New #define wrapping yypull_parse.
2318 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
2319 is declared.
2320 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
2321 prototype yylex in the module that calls yyparse, and don't prototype
2322 yyparse there. Otherwise, the yyparse expansion won't compile.
2323 * tests/input.at (Torturing the Scanner): Likewise.
2324
2325 2006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2326
2327 Enable push parsers to operate in impure mode. Thus, %push-parser no
2328 longer implies %pure-parser. The point of this change is to move
2329 towards being able to test the push parser code by running the entire
2330 test suite as if %push-parser had been declared.
2331 * data/push.c (yypush_parse): For impure mode, remove the
2332 yypushed_char, yypushed_val, and yypushed_loc arguments.
2333 Instead, declare these as local variables initialized to the global
2334 yychar, yylval, and yylloc.
2335 For the first yypush_parse invocation only, restore the initial values
2336 of these global variables when it's time to read a token since they
2337 have been overwritten.
2338 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
2339 %push-parser.
2340 * tests/calc.at (Simple LALR(1) Calculator): Always declare
2341 %pure-parser along with %push-parser since this test case was designed
2342 for pure push parsers.
2343 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
2344 (AT_YACC_OR_PUSH_IF): New.
2345 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
2346 add a note that it's still wrong for some cases (as it has been for a
2347 while).
2348 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
2349 %push-parser no longer implies %pure-parser.
2350
2351 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2352
2353 Remove some unnecessary differences between the pull parser code and
2354 the push parser code. This patch enables yynerrs in push mode.
2355 * data/push.c: Reformat M4 a little.
2356 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
2357 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
2358 because push mode is on. Instead, if pure mode is on, move yynerrs
2359 to...
2360 (b4_declare_parser_state_variables): ... here.
2361 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
2362 to yyps->NAME so it can be used in yypush_parse.
2363 (yypush_parse): Don't omit uses of yynerrs in push mode.
2364
2365 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2366
2367 Fix bug such that the first pushed token's value and location are
2368 sometimes overwritten (sometimes by %initial-action) before being used.
2369 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
2370 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
2371 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
2372 more closely mimic the pull parser logic.
2373 Don't copy the pushed token to yychar, yylval, and yylloc until it's
2374 time to read a token, which is after any initialization of yylval and
2375 yylloc.
2376 (gottoken): Rename label to...
2377 (yyread_pushed_token): ... for clarity and to avoid infringing on the
2378 user namespace.
2379
2380 2006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2381
2382 Rearrange initialization of the parser state variables so that the
2383 skeleton doesn't have to have a copy for pull mode and another for push
2384 mode. This patch also fixes at least a bug such that yylloc was not
2385 initialized (with b4_location_initial_line and
2386 b4_location_initial_column) upon calling yypush_parse. However, that
2387 initialization now overwrites the first token's location;
2388 %initial-action assigning @$ already did the same thing, and both bugs
2389 will be fixed in a later patch.
2390 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
2391 (b4_declare_parser_state_variables): Remove initialization of yytoken,
2392 yyss, yyvs, yyls, and yystacksize.
2393 (yypstate_new): Remove initialization of some yypstate fields: yystate,
2394 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
2395 yylsp.
2396 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
2397 yyps->NAME so it can be used in yypush_parse.
2398 (yyparse or yypush_parse): For yypush_parse, don't print the
2399 "Starting parse" diagnostic for invocations after the first.
2400 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
2401 yypush_parse, only do it for the first invocation.
2402 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
2403 initialization to occur in yypush_parse but only on the first
2404 invocation.
2405
2406 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2407
2408 * data/push.c: Add CPP guards around push parser declarations in both
2409 the header and the code file.
2410 In the code file, move the push parser declarations to the same place
2411 they appear in the header file.
2412 Clean up the M4 some, especially the inconsistent underquoting in
2413 some b4_c_function_def and b4_c_function_decl uses.
2414
2415 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2416
2417 Encapsulate the push parser state variables into an M4 macro so the
2418 push skeleton doesn't have to list them again for pull mode's yyparse.
2419 For push mode, remove yypush_parse's local equivalents of these
2420 variables to eliminate unnecessary copying between the two sets at
2421 run-time. This patch also fixes at least a bug related to multiple
2422 %initial-action invocations in push mode.
2423 * data/push.c (b4_declare_parser_variables): Rename to...
2424 (b4_declare_scanner_communication_variables): ... this for clarity and
2425 update both uses.
2426 (b4_declare_yyparse_variables): Remove and move its contents to the one
2427 spot where it was invoked.
2428 (b4_declare_parser_state_variables): New macro containing the parser
2429 state variables required by push mode.
2430 (struct yypstate): Replace all fields but yynew with
2431 b4_declare_parser_state_variables.
2432 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
2433 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
2434 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
2435 (yyparse or yypush_parse): For yyparse in pull mode, replace local
2436 parser state variable declarations with
2437 b4_declare_parser_state_variables.
2438 Don't initialize parser state variables when calling yypush_parse since
2439 yypstate_new already does that.
2440 Invoke the user's initial action only upon the first yypush_parse
2441 invocation.
2442 Remove all code that copies between the local parser state variables
2443 and the yypstate.
2444
2445 2006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2446
2447 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
2448 prevent a name collision in a future patch where these names will
2449 sometimes be #define'd.
2450 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
2451 since it no longer has the same name as the existing argument.
2452 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
2453
2454 2006-12-19 Paolo Bonzini <bonzini@gnu.org>
2455 and Joel E. Denny <jdenny@ces.clemson.edu>
2456
2457 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2458 that the argument is case-insensitive, and there's no `=' here.
2459 For the %skeleton entry, mention that %language is better.
2460 (Bison Options): Likewise for --language and --skeleton. Move the
2461 --skeleton entry so that the `Tuning the parser' section is sorted
2462 alphabetically on long options.
2463 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
2464 %language directive in detail here; cross-reference the %language
2465 documentation instead.
2466 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
2467 `%require "2.3b"' so that the example is always up-to-date.
2468 (Table of Symbols): Add entries for %language and %skeleton.
2469 * examples/extexi (normalize): Instead of replacing every %require
2470 argument with the current Bison version, just substitute for
2471 `@value{VERSION}'. This guarantees that we're testing what actually
2472 appears in the documentation.
2473 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
2474 rather than `@VERSION@'.
2475
2476 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2477
2478 * NEWS: Reword the %language news a bit, and put it earlier.
2479
2480 * src/getargs.c (skeleton_arg): Last arg is now location const *.
2481 Rewrite to simplify the logic.
2482 (language_argmatch): Likewise.
2483 (program_name): We now own this var.
2484 * src/getargs.h (struct bison_language): Use char[] rather than
2485 const char *.
2486
2487 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
2488 Java is supported.
2489 * src/complain.c (program_name): Remove decl; no longer needed.
2490 * src/main.c (program_name): Remove; now belongs to getargs.
2491
2492 2006-12-18 Paolo Bonzini <bonzini@gnu.org>
2493
2494 * NEWS: Document %language.
2495
2496 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
2497
2498 * data/c-skel.m4, data/c++-skel.m4: New files.
2499 * data/glr.c: Complain on push parsers.
2500
2501 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
2502 over %skeleton.
2503 (Decl Summary): Document %language and %skeleton.
2504 (Command line): Document -L.
2505
2506 * examples/extexi: Rewrite %require directive.
2507 * examples/calc++/Makefile.am: Pass VERSION to extexi.
2508
2509 * src/files.c (compute_exts_from_gc): Look in language structure
2510 for .y extension.
2511 (compute_file_name_parts): Check whether .tab should be added.
2512 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
2513 (language, skeleton_arg, language_argmatch): New.
2514 (long_options): Add --language.
2515 (getargs): Use skeleton_arg, add -L/--language.
2516 * src/getargs.h: Include location.h.
2517 (struct bison_language, language, skeleton_arg, language_argmatch): New.
2518 * src/output.c (prepare): Pick default skeleton from struct language.
2519 Don't dispatch C skeletons here.
2520 * src/parse-gram.y (PERCENT_LANGUAGE): New.
2521 (prologue_declaration): Add "%language" rule, use skeleton_arg.
2522 * src/scan-gram.l ("%language"): New rule.
2523
2524 * tests/calc.at: Test %skeleton and %language.
2525 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
2526 (AT_GLR_IF): Look for %skeleton "glr.cc".
2527 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
2528 (AT_YACC_IF): Reject %language.
2529
2530 2006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2531
2532 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
2533 since it wasn't used; only the typedef name 'semantic_type' is needed.
2534 Also, omit trailing white space.
2535
2536 * bootstrap: Sync from coreutils.
2537 (gnulib_extra_files): Add build-aux/announce.gen.
2538 (slurp): Adjust .gitignore files like .cvsignore files.
2539 * build-aux/announce-gen: Remove from CVS, since bootstrap
2540 now creates this.
2541
2542 2006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
2543
2544 Make %push-parser imply %pure-parser. This fixes several bugs; see
2545 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
2546 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
2547 pure_parser = true.
2548 * data/push.c: Don't bother testing b4_push_if when deciding whether
2549 to expand b4_declare_parser_variables globally.
2550 (yypush_parse): Likewise in here.
2551
2552 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
2553 (yy_reduce_print): Reformat M4 for readability.
2554
2555 2006-12-15 Bob Rossi <bob@brasko.net>
2556 and Joel Denny <jdenny@ces.clemson.edu>
2557
2558 * data/push.c (yypstate): Add typedef, and update all uses of
2559 struct yypstate to just yypstate.
2560 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
2561
2562 2006-12-14 Bob Rossi <bob@brasko.net>
2563
2564 * data/push.c (yypush_parse): Declare prototype regardless of
2565 %locations option.
2566
2567 2006-12-14 Bob Rossi <bob@brasko.net>
2568
2569 * data/push.c (yyparse): Remove the prototype and the #define when in
2570 push-parser mode.
2571
2572 2006-12-13 Bob Rossi <bob@brasko.net>
2573
2574 * data/push.c (yypstate_init): Rename to...
2575 (yypstate_new): ... this and use b4_c_function_def.
2576 (yypstate_delete): New.
2577 (yypush_parse): Change parameters yynval and yynlloc to be const.
2578 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
2579 yypstate_delete functions.
2580
2581 2006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
2582
2583 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
2584 strange test case titles. Reported by Bob Rossi.
2585
2586 2006-12-13 Paul Eggert <eggert@cs.ucla.edu>
2587
2588 * TODO: Add pointer to Sylvain Schmitz's work on static detection
2589 of potential ambiguities in GLR grammers.
2590
2591 2006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
2592
2593 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
2594 `bison ', use m4_index instead of m4_substr since chopping up a string
2595 containing M4-special characters causes problems here.
2596
2597 Fix a couple of bugs related to special characters in user-specified
2598 file names, and make it easier for skeletons to compute output file
2599 names with the same file name prefix as Bison-computed output file
2600 names.
2601 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
2602 b4_parser_file_name and b4_spec_defines_file instead of
2603 @output_parser_name@ and @output_header_name@, which are now redundant.
2604 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
2605 b4_parser_file_name, b4_spec_defines_file, and the new
2606 @basename(FILENAME@) instead of @output_parser_name@ and
2607 @output_header_name@, which inappropriately escaped the file names as
2608 C string literals.
2609 * src/files.c (all_but_ext): Remove static qualifier.
2610 (compute_output_file_names): Move `free (all_but_ext)' to...
2611 (output_file_names_free): ... here since all_but_ext is needed later.
2612 * src/files.h (all_but_ext): Extern.
2613 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
2614 exactly what MUSCLE_INSERT_STRING used to do.
2615 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
2616 characters are escaped properly.
2617 * src/output.c (prepare): Define muscle file_name_all_but_ext as
2618 all_but_ext.
2619 For pkgdatadir muscle, maintain previous functionality by using
2620 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
2621 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
2622 digraphs would never be expanded. Hopefully no one has M4-special
2623 characters in his Bison installation path.
2624 * src/scan-skel.l: Don't parse @output_header_name@ and
2625 @output_parser_name@ anymore since they're now redundant.
2626 In @output, use decode_at_digraphs.
2627 Parse a new @basename command that invokes last_component.
2628 (decode_at_digraphs): New.
2629 (BASE_QPUTS): Remove unused.
2630 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
2631 (Output file name): New tests.
2632
2633 2006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
2634
2635 Warn about output files that are generated by the skeletons and that
2636 conflict with other output files.
2637 * data/glr.c: Don't generate the header file here when glr.cc does.
2638 * src/files.c (file_names, file_names_count): New static globals.
2639 (compute_output_file_names): Invoke output_file_name_check for files
2640 not generated by the skeletons and remove existing checks.
2641 (output_file_name_check): New function that warns about conflicting
2642 output file names.
2643 (output_file_names_free): Free file_names.
2644 * src/files.h (output_file_name_check): Declare.
2645 * src/scan-skel.l: Invoke output_file_name_check for files generated by
2646 the skeletons.
2647 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
2648 (Conflicting output files): New tests.
2649
2650 2006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2651
2652 * doc/bison.texinfo: Fix a couple of typos.
2653
2654 2006-12-08 Bob Rossi <bob@brasko.net>
2655
2656 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
2657 Rename to...
2658 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
2659 update all uses.
2660 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
2661 (yypush_parse): Rename yypvars argument to yyps and remove redundant
2662 local pv.
2663 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
2664 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
2665
2666 2006-12-07 Bob Rossi <bob@brasko.net>
2667 and Joel Denny <jdenny@ces.clemson.edu>
2668
2669 * data/push.c (yypvarsinit): Change return type from void* to struct
2670 yypvars*. No longer cast to void* on return.
2671 (struct yypvars): Remove yylen since it need not be remembered between
2672 yypushparse invocations.
2673 (yypushparse): Don't copy between yylen and pv->yylen.
2674
2675 2006-12-05 Bob Rossi <bob@brasko.net>
2676
2677 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
2678 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
2679 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
2680 (struct yypvars): Remove b4_declare_parser_variables.
2681 (yypvarsinit): Remove init code for removed variables.
2682 (global scope): Do not declare b4_declare_parser_variables if
2683 push or pure mode.
2684 (yypushparse): Add b4_declare_parser_variables.
2685 Init new local variables, and remove init code for removed
2686 yypvars variables.
2687 (yyparse): Delete.
2688 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
2689 and yyparse for other modes.
2690 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
2691 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
2692 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
2693 (AT_PURE_LEX_IF): True if pure or push parser.
2694
2695 2006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
2696
2697 Document Yacc prologue alternatives and default %destructor's and
2698 %printer's as experimental. Don't mention Java yet. Discussed at
2699 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
2700 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
2701 (2.3a): Annotate this entry to say the old forms of these features were
2702 also experimental.
2703 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
2704 Table of Symbols): Say they're experimental. Comment out any mention
2705 of Java (we'll want this back eventually).
2706
2707 2006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2708
2709 Support a file name argument to %defines. Deprecate `=' in
2710 %file-prefix, %name-prefix, and %output. Discussed at
2711 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
2712 * NEWS (2.3a+): Mention.
2713 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
2714 form of %defines, and remove `=' from entries for %file-prefix,
2715 %name-prefix, and %output.
2716 * src/parse-gram.y (prologue_declaration): Implement.
2717 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
2718 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
2719 all but one occurrence of %name-prefix.
2720 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
2721 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
2722 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
2723 occurrence of each of %file-prefix and %output. Add check for %defines
2724 with argument.
2725 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
2726 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
2727 Remove the `=' from %output.
2728
2729 2006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
2730
2731 Don't escape $ in test case titles since Autoconf 2.61 now does that
2732 correctly.
2733 * tests/actions.at (Default %printer and %destructor are not for error
2734 or $undefined): Here.
2735 (Default %printer and %destructor are not for $accept): Here.
2736 * tests/input.at (Invalid $n and @n): Here.
2737
2738 2006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
2739
2740 Rename <!> to <>. Discussed starting at
2741 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
2742 * NEWS (2.3a+): Update.
2743 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
2744 Update.
2745 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
2746 * src/scan-gram.l (INITIAL): Implement.
2747 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
2748 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
2749 comment.
2750 * tests/actions.at (Default tagless %printer and %destructor,
2751 Default tagged and per-type %printer and %destructor,
2752 Default %printer and %destructor are not for error or $undefined,
2753 Default %printer and %destructor are not for $accept,
2754 Default %printer and %destructor for mid-rule values): Update.
2755 * tests/input.at (Default %printer and %destructor redeclared,
2756 Unused values with default %destructor): Update.
2757
2758 2006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2759
2760 Don't let %prec take a nonterminal.
2761 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
2762 token.
2763 * tests/input.at (%prec takes a token): New test checking that %prec
2764 won't take a nonterminal.
2765
2766 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2767
2768 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
2769 it was double-quoted.
2770 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
2771 grammar is maintained with Bison's highest standards.
2772 * src/getargs.c: Fix some typos in Doxygen comments.
2773
2774 2006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2775
2776 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
2777 later. Reported by Paul Eggert in
2778 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
2779 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
2780 * src/scan-code.l (translate_action): Don't bother invoking
2781 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
2782 (code_scanner_free): Instead of invoking
2783 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
2784 which frees more.
2785 * src/scan-gram.l (gram_scanner_free): Likewise.
2786 * src/scan-skel.l (scan_skel): Likewise.
2787
2788 2006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2789
2790 * src/files.c (tr): Change return type to void.
2791 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
2792 has been called previously for the same key.
2793 (muscle_find): Return storage instead of value so that
2794 --enable-gcc-warnings doesn't produce warnings that the return discards
2795 const. aver that the value and storage are the same since storage
2796 could potentially be NULL when value is not.
2797 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
2798 same as 0.
2799
2800 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2801
2802 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
2803 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
2804 us a slightly cleaner distribution, and also works.
2805 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
2806 gnulib changes.
2807
2808 2006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
2809 and Paul Eggert <eggert@cs.ucla.edu>
2810
2811 Don't let Bison leak memory except when it complains.
2812 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
2813 (spec_defines_file, dir_prefix): Now char *, not const char *,
2814 since they are freed.
2815 * src/files.c: Likewise.
2816 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
2817 Likewise.
2818 (tr): Now operates in-place. All uses changed.
2819 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
2820 values.
2821 (compute_file_name_parts, compute_output_file_names): Don't store
2822 read-only data in variables that will be freed.
2823 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
2824 src_extension, and header_extension.
2825 (output_file_names_free): New public function to free
2826 spec_verbose_file, spec_graph_file, spec_defines_file,
2827 parser_file_name, and dir_prefix.
2828 * src/getargs.c (getargs): Don't store read-only data in variables that
2829 will be freed.
2830 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
2831 (which previously existed but was unused), and quotearg_free.
2832 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
2833 * src/muscle_tab.c: Likewise.
2834 (muscle_entry): Make the value char const *,
2835 and add a new storage member that is char * and can be freed.
2836 (muscle_entry_free): New private function.
2837 (muscle_init): Use it instead of free.
2838 (muscle_insert, muscle_grow): Update and use new storage member.
2839 (muscle_code_grow): Free the string passed to muscle_grow
2840 since it's not needed anymore.
2841 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
2842 add a new `char *code' member.
2843 ("{...}"): Declare semantic type as code.
2844 * src/scan-code.h (translate_rule_action):
2845 (translate_symbol_action, translate_code, translate_action): Return
2846 `char const *' rather than `char *' since external code should not free
2847 these strings.
2848 * src/scan-code.l: Likewise.
2849 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
2850 which is "{...}" in the parser.
2851 * tests/Makefile.am (maintainer-check-valgrind): Set
2852 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
2853 Valgrind.
2854 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
2855 complain.
2856 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
2857 expecting a non-zero exit status sets --leak-check=summary and
2858 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
2859 this case, and we don't want to hear about it.
2860
2861 2006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2862
2863 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
2864 instead of from the template, to simplify configuration a bit.
2865 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
2866 and m4/wint_t.m4, as they are needed with the latest gnulib.
2867
2868 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2869
2870 Disable unset/unused mid-rule value warnings by default, and recognize
2871 --warnings=midrule-values to enable them. Discussed starting at
2872 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
2873 * NEWS (2.3a+): Mention.
2874 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
2875 warnings): Add entry for midrule-values subargument.
2876 * src/reader.c (symbol_should_be_used): Don't return true just because
2877 the value is a set/used mid-rule value unless
2878 --warnings=midrule-values was specified.
2879 * tests/input.at (Unused values, Unused values before symbol
2880 declarations): Run tests with and without --warnings=midrule-values.
2881
2882 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
2883 than LIST_FREE directly.
2884
2885 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2886
2887 Finish implementing --warnings=error, which should not be implied by
2888 --warnings=all (or by its synonyms -W and --warnings without
2889 subarguments).
2890 * src/complain.c (set_warning_issued): New function to report that
2891 warnings are being treated as errors and to record an error if so.
2892 Invoke...
2893 (warn_at, warn): ... here.
2894 * src/getargs.c (warnings_args, warnings_types): Reorder so that
2895 "error - warnings are errors" does not appear above "all - all of the
2896 above".
2897 (getargs): For -W and --warnings without subarguments, don't let
2898 FLAGS_ARGMATCH set warnings_error in warnings_flag.
2899 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
2900
2901 2006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2902
2903 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
2904 empty subargument list. For example: `bison --warnings= parser.y'.
2905
2906 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2907
2908 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
2909 the parser header file so that gcc doesn't warn.
2910
2911 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2912
2913 Split the default %destructor/%printer into two kinds: <*> and <!>.
2914 Discussed starting at
2915 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
2916 * NEWS (2.3a+): Mention.
2917 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
2918 previous change today related to mid-rules.
2919 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
2920 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
2921 (TYPE_TAG_ANY): Add as <*>.
2922 (TYPE_TAG_NONE): Add as <!>.
2923 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
2924 for <*> and <!>.
2925 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
2926 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
2927 * src/symlist.c (symbol_list_default_new): Split into tagged and
2928 tagless versions.
2929 (symbol_list_destructor_set, symbol_list_printer_set): Split
2930 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
2931 SYMLIST_DEFAULT_TAGLESS.
2932 * src/symlist.h: Update symbol_list_default*_new prototypes.
2933 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
2934 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
2935 * src/symtab.c (default_destructor, default_destructor_location,
2936 default_printer, default_printer_location): Split each into tagged and
2937 tagless versions.
2938 (symbol_destructor_get, symbol_destructor_location_get,
2939 symbol_printer_get, symbol_printer_location_get): Implement tagged
2940 default and tagless default cases.
2941 (default_destructor_set, default_printer_set): Split each into tagged
2942 and tagless versions.
2943 * src/symtab.h: Update prototypes.
2944 * tests/actions.at (Default %printer and %destructor): Rename to...
2945 (Default tagless %printer and %destructor): ... this, and extend.
2946 (Per-type %printer and %destructor): Rename to...
2947 (Default tagged and per-type %printer and %destructor): ... this, and
2948 extend.
2949 (Default %printer and %destructor for user-defined end token): Extend.
2950 (Default %printer and %destructor are not for error or $undefined):
2951 Update.
2952 (Default %printer and %destructor are not for $accept): Update.
2953 (Default %printer and %destructor for mid-rule values): Extend.
2954 * tests/input.at (Default %printer and %destructor redeclared): Extend.
2955 (Unused values with default %destructor): Extend.
2956
2957 2006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2958
2959 Don't apply the default %destructor/%printer to an unreferenced midrule
2960 value. Mentioned at
2961 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
2962 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
2963 like $@n instead of just @n so that the default %destructor/%printer
2964 logic doesn't see them as user-defined symbols.
2965 (symbol_is_dummy): Check for both forms of the name.
2966 * src/reader.c (packgram): Remove the `$' from each midrule symbol
2967 name for which the midrule value is referenced in any action.
2968 * tests/actions.at (Default %printer and %destructor for mid-rule
2969 values): New test.
2970 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
2971 for change to dummy symbol names.
2972
2973 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2974
2975 Warn about unset midrule $$ if the corresponding $n is used.
2976 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
2977 $n usage.
2978 (packgram): Before invoking grammar_rule_check on any rule, make sure
2979 all actions have already been scanned in order to set `used' flags.
2980 Otherwise, checking that a midrule's $$ is set will not always work
2981 properly because the midrule check must forward-reference the midrule's
2982 parent rule.
2983 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
2984 warning.
2985
2986 2006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2987
2988 More improvements to the documentation of the prologue alternatives:
2989 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
2990 Bison manual.
2991 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
2992 some text to clarify the relative importance of the new directives and
2993 to show how these directives may be viewed as code labels.
2994
2995 2006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
2996
2997 Similar to the recently removed %before-header, add %code-top as the
2998 alternative to the pre-prologue. Mentioned at
2999 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
3000 Also, let the prologue alternatives appear in the grammar section.
3001 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
3002 (prologue_declaration): Move the existing prologue alternatives to...
3003 (grammar_declaration): ... here and add %code-top.
3004 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
3005
3006 Clean up and extend documentation for the prologue alternatives.
3007 * NEWS (2.3a+): Describe prologue alternatives.
3008 * doc/bison.texinfo (Prologue): Move discussion of prologue
3009 alternatives to...
3010 (Prologue Alternatives): ... this new section, and extend it to discuss
3011 all 4 directives in detail.
3012 (Table of Symbols): Clean up discussion of prologue alternatives and
3013 add %code-top.
3014
3015 2006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
3016
3017 DJGPP specific issues.
3018
3019 * djgpp/config.bat: config.hin has been moved to lib. Adjust
3020 config.bat accordingly.
3021 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
3022 * djgpp/config.site: Likewise.
3023
3024 2006-10-16 Paolo Bonzini <bonzini@gnu.org>
3025
3026 Replace %*-header with %provides, %requires, %code. See discussion at
3027 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
3028
3029 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
3030 (b4_user_start_header): Remove.
3031 * data/glr.c: Use new macros instead of b4_*start_header
3032 and b4_*end_header.
3033 * data/glr.cc: Likewise.
3034 * data/lalr1.cc: Likewise.
3035 * data/push.c: Likewise.
3036 * data/yacc.c: Likewise.
3037
3038 * doc/bison.texinfo: Remove %before-header, rename
3039 %{start,end,after}-header to %requires, %provides, %code.
3040
3041 * src/parse-gram.y: Likewise (also rename token names accordingly).
3042 * src/scan-gram.l: Likewise.
3043 * tests/actions.at: Likewise.
3044
3045 2006-10-14 Paul Eggert <eggert@cs.ucla.edu>
3046
3047 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
3048 Problem reported by Joel E. Denny.
3049
3050 2006-10-14 Jim Meyering <jim@meyering.net>
3051
3052 (Sync from coreutils.)
3053 Work also when the working directory (with e.g. coreutils sources)
3054 is version controlled with git, rather than CVS.
3055 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
3056 rather than CVS.
3057 In messages and comments, say e.g., "checked-out sources",
3058 rather than "CVS sources".
3059 (version_controlled_file): New function. Work for git as well as
3060 for CVS. Don't use grep's -q option.
3061 (slurp): Call it here, in place of CVS-specific code.
3062
3063 2006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
3064
3065 Fix testsuite for ./configure --enable-gcc-warnings:
3066 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
3067 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
3068 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
3069 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
3070 * test/regression.at (Diagnostic that expects two alternatives):
3071 Likewise.
3072
3073 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3074
3075 * bootstrap.conf (gnulib_modules): Add config-h.
3076 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
3077 worry about HAVE_CONFIG_H.
3078 * lib/abitset.c: Likewise.
3079 * lib/bitset.c: Likewise.
3080 * lib/bitset_stats.c: Likewise.
3081 * lib/bitsetv-print.c: Likewise.
3082 * lib/bitsetv.c: Likewise.
3083 * lib/ebitset.c: Likewise.
3084 * lib/get-errno.c: Likewise.
3085 * lib/lbitset.c: Likewise.
3086 * lib/subpipe.c: Likewise.
3087 * lib/timevar.c: Likewise.
3088 * lib/vbitset.c: Likewise.
3089 * lib/bitset.c: Include "bitset.h" first, to test interface.
3090 * lib/bitset_stats.c: Include "bitset_stats.h" first.
3091 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
3092 * lib/bitsetv.c: Include "bitsetv.h" first.
3093 * lib/get-errno.c: Include "get-errno.h" first.
3094 * m4/.cvsignore: Add config-h.m4.
3095 * tests/actions.at (Default %printer and %destructor for ...):
3096 Adjust expected line numbers in output to reflect removal of #if
3097 HAVE_CONFIG_H lines.
3098 * tests/glr-regression.at (Missed %merge type warnings when ...):
3099 Likewise.
3100 * tests/regression.at (Braced code in declaration in rules section):
3101 Likewise.
3102 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
3103 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
3104 Include <config.h> unconditionally.
3105
3106 * bootstrap: Sync from coreutils, as follows:
3107
3108 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3109
3110 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
3111 variable was sometimes used without being initialized. This
3112 messed up the installation of the INSTALL file in some cases.
3113
3114 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3115
3116 * bootstrap (usage, main program, symlink_to_gnulib): Add option
3117 --copy. Inspired by a suggestion from Bruno Haible.
3118
3119 2006-10-03 Jim Meyering <jim@meyering.net>
3120
3121 * bootstrap: Undo last change to this file, since now gnulib-tool
3122 sticks with the automake default in generating dependencies.
3123
3124 2006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3125
3126 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
3127 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
3128
3129 * doc/bison.1: Add copyright notice.
3130
3131 * data/glr.c: Don't include <stdarg.h>; not used.
3132
3133 * NEWS: The -g and --graph options now output graphs in Graphviz
3134 DOT format, not VCG format.
3135 * doc/bison.1: Likewise.
3136 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
3137 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
3138 of this change in
3139 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
3140 * TODO: Remove Graphviz entry.
3141 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
3142 remove vcg.c, vcg.h, vcg_defaults.h.
3143 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
3144 * src/graphviz.c, src/graphviz.h: New files.
3145 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
3146 * src/files.h: Make comment more generic.
3147 * src/main.c (main): Likewise.
3148 * src/print_graph.h: Likewise.
3149 * src/getargs.c (usage): Make usage description more generic.
3150 * src/print_graph.c: Include graphviz.h rather than vcg.h.
3151 (static_graph, fgraph): Remove. All uses changed to pass
3152 arguments instead of sharing a static var.
3153 (print_core, print_actions, print_state, print_graph):
3154 Output graphviz format rather than VCG format.
3155 * tests/.cvsignore: Remove *.vcg; add *.dot.
3156 * tests/output.at: Expect *.dot files, not *.vcg files.
3157
3158 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
3159 accommodates the 2006-10-08 change.
3160
3161 2006-10-11 Bob Rossi <bob@brasko.net>
3162
3163 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
3164 (b4_yyssa, b4_yyerror_range): New macros.
3165 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
3166 (yypvarsinit): Remove init of removed fields.
3167 (yypushparse): Remove use of removed fields; use new macros instead.
3168
3169 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3170
3171 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
3172 in a push parser. Reindent slightly to match yacc.c better.
3173
3174 2006-10-11 Bob Rossi <bob@brasko.net>
3175
3176 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
3177 yymsg_alloc fields.
3178 (yypvarsinit, yypushparse): Remove init of removed fields.
3179 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
3180
3181 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3182
3183 * THANKS: Add Paolo Bonzini and Bob Rossi.
3184
3185 2006-10-08 Paolo Bonzini <bonzini@gnu.org>
3186
3187 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
3188 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
3189 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
3190 b4_define_user_cde and uses): Remove.
3191 (b4_comment, b4_prefix, b4_sync_start): New.
3192 * data/bison.m4: New file, with most of the content removed from c.m4.
3193 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
3194 * src/output.c (output_skeleton): Pass bison.m4.
3195 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
3196 only if specified.
3197
3198 2006-10-05 Paul Eggert <eggert@cs.ucla.edu>
3199
3200 Fix test failure reported by Tom Lane in
3201 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
3202 and try to make such failures easier to catch in the future.
3203 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
3204 that's now the caller's responsibility.
3205 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
3206 Set yychar = YYEOF if it's negative.
3207 * tests/actions.at (yylex): Abort if asked to read past EOF.
3208 * tests/conflicts.at (yylex): Likewise.
3209 * tests/cxx-type.at (yylex): Likewise.
3210 * tests/glr-regression.at (yylex): Likewise.
3211 * tests/input.at (yylex): Likewise.
3212 * tests/regression.at (yylex): Likewise.
3213 * tests/torture.at (yylex): Likewise.
3214
3215 2006-10-01 Paul Eggert <eggert@cs.ucla.edu>
3216
3217 Fix problems with translating English-language diagnostics.
3218 * bootstrap: Fix bug introduced in recent bootstrap changes, with
3219 respect to bison-runtime pot generation. The YY_ stuff
3220 wasn't being captured.
3221 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
3222 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
3223 * runtime-po/POTFILES.in: Add data/push.c.
3224
3225 2006-09-29 Paul Eggert <eggert@cs.ucla.edu>
3226
3227 Merge bootstrap changes from coreutils.
3228
3229 2006-09-28 Jim Meyering <jim@meyering.net>
3230
3231 Automatically generated dependencies are important even
3232 when all of the sources in a directory come from gnulib.
3233 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
3234 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
3235
3236 2006-09-23 Jim Meyering <jim@meyering.net>
3237
3238 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
3239
3240 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3241
3242 * bootstrap: Add support for --force.
3243 (usage): New function. Describe usage less tersely.
3244 (CVS_only_file): New var.
3245
3246 2006-09-21 Paul Eggert <eggert@cs.ucla.edu>
3247
3248 * data/push.c (YYPUSH_MORE): Make it an enum instead.
3249 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
3250 Adjust white space and comments to match GNU style better.
3251
3252 2006-09-20 Bob Rossi <bob@brasko.net>
3253
3254 * data/push.c (yyresult_get): Remove function.
3255 (YYPUSH_MORE): Add #define.
3256 (yypushparse): Modify return value.
3257
3258 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3259
3260 * stamp-h.in: Remove; no longer needed.
3261 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
3262 Remove config.h, config.hin, intl (no longer created).
3263 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
3264 stamp-h1.
3265
3266 Sync bootstrap from coreutils, as follows:
3267
3268 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
3269
3270 * bootstrap (symlink_to_gnulib): New function.
3271 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
3272 to copies-of-gnulib.
3273 (cp_mark_as_generated, slurp, gnulib_files):
3274 Avoid making a copy if it's the same as the old version.
3275 (gnulib_files): Add support for this variable (used by Bison).
3276
3277 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3278
3279 * src/getargs.c (usage): Rework to use conventions similar to
3280 coreutils, to make translation a bit easier and the code a bit
3281 smaller. Problem reported by Tim Van Holder.
3282
3283 2006-09-15 Paul Eggert <eggert@cs.ucla.edu>
3284
3285 Use some of gnulib's new modules, taken from coreutils.
3286
3287 * bootstrap: Sync from coreutils, except add support for gnulib_files.
3288 * bootstrap.conf: New file.
3289 (gnulib_modules): Add configmake, inttypes, unistd.
3290 (XGETTEXT_OPTIONS): Add complain, complain_at,
3291 fatal, fatal_at, warn, warn_at, unexpected_end.
3292 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
3293 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
3294 (gl_EARLY): Add.
3295 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
3296 (gl_INIT): Add
3297 (GNULIB_AUTOCONF_SNIPPET): Remove.
3298 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
3299 the pickiest.
3300 * lib/.cvsignore: Add inttypes_.h.
3301 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
3302 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
3303 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
3304 no-longer-necessary initializations.
3305 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
3306 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
3307 use the unistd module.
3308 * src/system.h: Likewise.
3309 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
3310 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
3311 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
3312 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
3313 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
3314 * src/system.h: Include inttypes.h unconditionally, now that we
3315 use the inttypes module. Don't bother to include stdint.h, since
3316 inttypes.h now does that for us.
3317 (LOCALEDIR): Remove, now that we use the configmake module.
3318 * src/getargs.c: Include configmake.h.
3319 * src/main.c: Likewise.
3320 * src/output.c: Likewise.
3321 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
3322 not from $abs_top_builddir, since config.h moved.
3323
3324
3325 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
3326 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
3327
3328 * src/parse-gram.y (symbol_declaration): Don't put statements
3329 before declarations; it's not portable to C89.
3330 * src/scan-code.l (handle_action_at): Likewise.
3331
3332 * src/scan-code.l: Always initialize braces_level; the old code
3333 left it uninitialized and therefore had undefined behavior.
3334
3335 Don't attempt to redefine 'assert', since it runs afoul of
3336 systems where standard headers (mistakenly) include <assert.h>.
3337 Instead, define and use our own alternative, called 'aver'.
3338 * src/reader.c: Don't include assert.h, since we no longer
3339 use assert.
3340 * src/scan-code.l: Likewise.
3341 * src/system.h (assert): Remove, replacing with....
3342 (aver): New function, taking a bool arg. All uses changed.
3343 * src/tables.c (pack_vector): Ensure that aver arg is bool,
3344 not merely an integer.
3345
3346 2006-09-15 Bob Rossi <bob@brasko.net>
3347
3348 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
3349 * data/c.m4 (YYPUSH): New.
3350 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
3351 * src/getargs.c (push_parser): New var.
3352 * src/getargs.h (push_parser): New declaration.
3353 * src/output.c (prepare): Add macro insertion of `push_flag'.
3354 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
3355 (prologue_declaration): Parse %push-parser.
3356 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
3357 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
3358 list of removed lines from the traces observed.
3359 (AT_CHECK_CALC_LALR): Added push parser tests.
3360
3361 2006-09-13 Paul Eggert <eggert@cs.ucla.edu>
3362
3363 * NEWS: Version 2.3a.
3364 * configure.ac (AC_INIT): Likewise.
3365
3366 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
3367 "#define YYSTYPE int" that caused "make maintainer-check" to fail
3368 due to header ordering dependencies. I don't know why the #define
3369 was there.
3370
3371 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
3372 runtime cost when YYDEBUG is not defined, and so that some tests
3373 that used to fail now work. Problem and initial suggestion by
3374 Paolo Bonzini.
3375 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
3376 * data/glr.cc (b4_parser_class_name):
3377 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
3378 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
3379 (yydebug_) [YYDEBUG]: New member.
3380 (yycdebug_): Now defined only if YYDEBUG.
3381 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
3382 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
3383 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
3384 if YYYDEBUG.
3385 (debug_stream, set_debug_stream, debug_level, set_debug_level):
3386 Define only if YYDEBUG.
3387 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
3388 set_debug_level.
3389 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
3390 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
3391 AT_CHECK_CALC_GLR_CC that are working now.
3392
3393 2006-09-12 Paul Eggert <eggert@cs.ucla.edu>
3394
3395 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
3396 We don't need them in glr.cc, and glr.c defines them.
3397 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
3398 assumes that defining it to anything is the same as defining
3399 it to 1. Problem reported by Paolo Bonzini.
3400
3401 2006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
3402
3403 * data/c.m4 (b4_null, b4_case): Define.
3404 * src/output.c (prepare_symbols): Use b4_null.
3405 (user_actions_output): Use b4_case.
3406
3407 2006-09-11 Paul Eggert <eggert@cs.ucla.edu>
3408
3409 * data/glr.c (b4_shared_declarations): Put start-header first,
3410 before any #includes that we generate, so that feature-test
3411 macros work. Problem reported by Michael Deutschmann in
3412 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
3413 * data/lalr1.cc: Likewise.
3414 * doc/bison.texinfo (Prologue): Document that feature-test macros
3415 should be defined before any Bison declarations.
3416 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
3417 that depend on location.hh after, not before, Bison decls, since
3418 we now include location.hh after the first user prologue.
3419
3420 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
3421 Sander Brandenburg in
3422 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
3423 Also, fix minor white space and comment issues.
3424 (Prologue): Mention that it's better to define feature-test macros
3425 before Bison declarations. Problem reported by Michael Deutschmann.
3426
3427 * README-cvs: Fix typo: "&" should be "&&". Problem reported
3428 by Jim Meyering.
3429 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
3430 This adjusts to recent gnulib changes.
3431
3432 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3433
3434 Finish implementation of per-type %destructor/%printer. Discussed
3435 starting at
3436 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
3437 and
3438 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
3439 * NEWS (2.3+): Add a description of this feature to the default
3440 %destructor/%printer description.
3441 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
3442 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3443 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
3444 list node contains a semantic type.
3445 * src/symtab.c, src/symtab.h: Extend with a table that associates
3446 semantic types with their %destructor's and %printer's.
3447 (semantic_type_from_uniqstr, semantic_type_get,
3448 semantic_type_destructor_set, semantic_type_printer_set): New functions
3449 composing the public interface of that table.
3450 (symbol_destructor_get, symbol_destructor_location_get,
3451 symbol_printer_get, symbol_printer_location_get): If there's no
3452 per-symbol %destructor/%printer, look up the per-type before trying
3453 the default.
3454 * tests/actions.at (Per-type %printer and %destructor): New test case.
3455 * tests/input.at (Default %printer and %destructor redeclared):
3456 Extend to check that multiple occurrences of %symbol-default in a
3457 single %destructor/%printer declaration is an error.
3458 (Per-type %printer and %destructor redeclared, Unused values with
3459 per-type %destructor): New test cases.
3460
3461 2006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3462
3463 Require default %destructor/%printer to be declared using
3464 %symbol-default instead of an empty symbol list, and start working on
3465 new per-type %destructor/%printer. Discussed at
3466 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
3467 * NEWS (2.3+): Add %symbol-default to example.
3468 * bison.texinfo (Freeing Discarded Symbols): Likewise.
3469 (Table of Symbols): Add entry for %symbol-default.
3470 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
3471 (generic_symlist, generic_symlist_item): New nonterminals for creating
3472 a list in which each item is a symbol, semantic type, or
3473 %symbol-default.
3474 (grammar_declaration): Use generic_symlist in %destructor and %printer
3475 declarations instead of symbols.1 or an empty list.
3476 (symbol_declaration, precedence_declaration, symbols.1): Update actions
3477 for changes to symbol_list.
3478 * src/reader.c: Update for changes to symbol_list.
3479 * src/scan-code.l: Likewise.
3480 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
3481 * src/symlist.c, src/symlist.h: Extend such that a list node may
3482 represent a semantic type or a %symbol-default in addition to just an
3483 ordinary symbol. Add switched functions for setting %destructor's and
3484 %printer's.
3485 * tests/actions.at, tests/input.at: Add %symbol-default to all default
3486 %destructor/%printer declarations.
3487
3488 2006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
3489
3490 Whether the default %destructor/%printer applies to a particular symbol
3491 isn't a question of whether the user *declares* that symbol (in %token,
3492 for example). It's a question of whether the user by any means
3493 *defines* the symbol at all (by simply using a char token, for
3494 example). $end is defined by Bison whereas any other token with token
3495 number 0 is defined by the user. The error token is always defined by
3496 Bison regardless of whether the user declares it with %token, but we
3497 may one day let the user define error as a nonterminal instead.
3498 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
3499 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
3500 the meaning of "user-defined".
3501 * tests/actions.at (Default %printer and %destructor for user-declared
3502 end token): Rename to...
3503 (Default %printer and %destructor for user-defined end token): ...
3504 this.
3505
3506 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
3507 computation of whether to apply the default, don't maintain a list of
3508 every Bison-defined symbol. Instead, just check for a first character
3509 of '$', which a user symbol cannot have, and check for the error token.
3510
3511 2006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
3512
3513 Don't apply the default %destructor or %printer to the error token,
3514 $undefined, or $accept. This change fits the general rule that the
3515 default %destructor and %printer are only for user-declared symbols,
3516 and it solves several difficulties that are described in the new test
3517 cases listed below.
3518 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
3519 * tests/actions.at (Default %printer and %destructor are not for error
3520 or $undefined, Default %printer and %destructor are not for $accept):
3521 New test cases.
3522
3523 2006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
3524
3525 Allow %start after the first rule.
3526 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
3527 when parsing the first rule.
3528 (check_and_convert_grammar): Search for it here after all grammar
3529 declarations have been parsed. Skip midrules, which have dummy LHS
3530 nonterminals.
3531 * src/symtab.c (symbol_is_dummy): New function.
3532 * src/symtab.h (symbol_is_dummy): Declare it.
3533 * tests/input.at (%start after first rule): New test.
3534
3535 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3536
3537 Redo some of the previous commit: add back the ability to use
3538 non-aliased/undeclared string literals since it might be useful to
3539 those declaring %token-table.
3540 * src/reader.c (check_and_convert_grammar): Undo changes in previous
3541 commit: don't worry about complaints from symbols_pack.
3542 * src/symtab.c (symbol_new, symbol_class_set,
3543 symbol_check_alias_consistency): Undo changes in previous commit: count
3544 each string literal as a new symbol and token, assign it a symbol
3545 number, and don't complain about non-aliased string literals.
3546 (symbols_pack): Since symbol_make_alias still does not decrement symbol
3547 and token counts but does still set aliased tokens to the same number,
3548 symbol_pack_processor now leaves empty slots in the symbols array.
3549 Remove those slots.
3550 * tests/regression.at (Undeclared string literal): Remove test case
3551 added in previous commit since non-aliased string literals are allowed
3552 again.
3553 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
3554 remove unnecessary string literal declarations.
3555 * tests/sets.at (Firsts): Likewise.
3556
3557 2006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3558
3559 Don't allow an undeclared string literal, but allow a string literal to
3560 be used before its declaration.
3561 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
3562 symbols_pack complained.
3563 * src/symtab.c (symbol_new): Don't count a string literal as a new
3564 symbol.
3565 (symbol_class_set): Don't count a string literal as a new token, and
3566 don't assign it a symbol number since symbol_make_alias does that.
3567 (symbol_make_alias): It's not necessary to decrement the symbol and
3568 token counts anymore. Don't assume that an alias declaration occurs
3569 before any uses of the identifier or string, and thus don't assert that
3570 one of them has the highest symbol number so far.
3571 (symbol_check_alias_consistency): Complain if there's a string literal
3572 that wasn't declared as an alias.
3573 (symbols_pack): Bail if symbol_check_alias_consistency failed since
3574 symbol_pack asserts that every token has been assigned a symbol number
3575 although undeclared string literals have not.
3576 * tests/regression.at (String alias declared after use, Undeclared
3577 string literal): New test cases.
3578 (Characters Escapes, Web2c Actions): Declare string literals as
3579 aliases.
3580 * tests/sets.at (Firsts): Likewise.
3581
3582 2006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
3583
3584 In the grammar scanner, STRING_FINISH unclosed constructs and return
3585 them to the parser in order to improve error messages.
3586 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
3587 SC_BRACED_CODE, SC_PROLOGUE): Implement.
3588 * tests/input.at (Unclosed constructs): New test case.
3589 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
3590 seen.
3591
3592 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
3593 unused global.
3594
3595 2006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
3596
3597 Handle string aliases for character tokens correctly.
3598 * src/symtab.c (symbol_user_token_number_set): If the token has an
3599 alias, check and set its alias's user token number instead of its own,
3600 which is set to indicate the alias. Previously, every occurrence of
3601 the character token in the grammar overwrote that alias indicator with
3602 the character code.
3603 * tests/input.at (String aliases for character tokens): New test.
3604
3605 2006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
3606
3607 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
3608
3609 2006-08-11 Paul Eggert <eggert@cs.ucla.edu>
3610
3611 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
3612 to prevent failures when building on older platforms.
3613 Check for autopoint failure.
3614 Set XGETTEXT_OPTIONS to values that check for C format strings,
3615 so that translators are warned about them (this also helps
3616 prevent core dumps).
3617
3618 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
3619 function, since it simplifies our code a bit.
3620
3621 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
3622 rather than -W, so we don't get bogus warnings about sign comparisons.
3623 Add -Wpointer-arith, since that warning is useful (it reports code
3624 that does not conform to C89 and that some compilers reject).
3625 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
3626 since it's no longer needed.
3627
3628 2006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
3629
3630 Clean up scanners a bit.
3631 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
3632 definitions so gcc won't warn when obstack_for_string is unused.
3633 * src/scan-code.l: config.h and system.h are already #include'd by
3634 scan-code-c.c, so get rid of them here.
3635 * src/scan-gram.l: Likewise.
3636 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
3637 definitions rather than duplicating the rest of it.
3638 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
3639
3640 2006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
3641
3642 Suppress signed/unsigned comparison warnings for yycheck.
3643 * data/c.m4 (b4_safest_int_type): New macro.
3644 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
3645 a signed int type, cast it to b4_safest_int_type first.
3646 * data/yacc.c: Likewise.
3647 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
3648 also overwritten.
3649
3650 2006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3651
3652 * doc/bison.texinfo: Fix some typos.
3653
3654 2006-08-02 Paul Eggert <eggert@cs.ucla.edu>
3655
3656 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
3657 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
3658
3659 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
3660 the latest gnulib does this a different way.
3661 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
3662 translation was patched, so stop omitting it.
3663
3664 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3665
3666 Enable declaration of default %printer/%destructor. Make the parser
3667 use these for all user-declared grammar symbols for which the user does
3668 not declare a specific %printer/%destructor. Thus, the parser uses it
3669 for token 0 if the user declares it but not if Bison generates it as
3670 $end. Discussed starting at
3671 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
3672 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
3673 and
3674 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
3675 * NEWS (2.3+): Mention.
3676 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
3677 declare a %destructor for a mid-rule's semantic value. It's just
3678 impossible to declare one specific to it.
3679 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
3680 code. Describe default %destructor form.
3681 * src/parse-gram.y (grammar_declaration): Parse default
3682 %printer/%destructor declarations.
3683 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
3684 and symbol_destructor_location_get rather than accessing the destructor
3685 and destructor_location members of struct symbol.
3686 (symbol_printers_output): Likewise but for %printer's.
3687 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
3688 again.
3689 * src/symtab.c (default_destructor, default_destructor_location,
3690 default_printer, default_printer_location): New static global
3691 variables to record the default %destructor and %printer.
3692 (symbol_destructor_get, symbol_destructor_location_get,
3693 symbol_printer_get, symbol_printer_location_get): New functions to
3694 compute the appropriate %destructor and %printer for a symbol.
3695 (default_destructor_set, default_printer_set): New functions to set the
3696 default %destructor and %printer.
3697 * src/symtab.h: Prototype all those new functions.
3698 * tests/actions.at (Default %printer and %destructor): New test to
3699 check that the right %printer and %destructor are called, that they're
3700 not called for $end, and that $$ and @$ work correctly.
3701 (Default %printer and %destructor for user-declared end token): New
3702 test to check that the default %printer and %destructor are called for
3703 a user-declared end token.
3704 * tests/input.at (Default %printer and %destructor redeclared, Unused
3705 values with default %destructor): New tests to check related grammar
3706 warnings and errors.
3707
3708 2006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3709
3710 Clean up handling of %destructor for the end token (token 0).
3711 Discussed starting at
3712 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
3713 and
3714 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
3715
3716 Make the skeletons consistent in how they pop the end token and invoke
3717 its %destructor.
3718 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
3719 state, which has token number 0, since this would invoke the
3720 %destructor for the end token.
3721 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
3722 until after shifting the end token, or else it won't be popped.
3723 * data/yacc.c (yyparse): Likewise.
3724
3725 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
3726 it's the end token. Upon termination, destroy an unshifted lookahead
3727 even when it's the end token.
3728 * data/lalr1.cc (yy::parser::parse): Likewise.
3729 * data/yacc.c (yyparse): Likewise.
3730
3731 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
3732 value warnings for the end token when the user gives the end token a
3733 %destructor.
3734
3735 * tests/actions.at (Printers and Destructors): Test all the above.
3736
3737 2006-07-24 Paul Eggert <eggert@cs.ucla.edu>
3738
3739 Update to latest gnulib and gettext versions.
3740 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
3741 Add fopen-safer.
3742 (gnulib_files): Add m4/warning.m4. Don't worry about files
3743 overwritten by autopoint.
3744 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
3745 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
3746 rejects them.
3747 Don't use autoreconf; instead, invoke autopoint etc. by hand,
3748 so that we can remove the intl files at a better time.
3749 (intl_files_to_remove): Remove aclocal.m4, since it gets
3750 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
3751 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
3752 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
3753 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
3754 Remove datarootdir hack; no longer needed.
3755 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
3756 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
3757 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
3758 strdup.h.
3759 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
3760 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
3761
3762 2006-07-20 Paul Eggert <eggert@cs.ucla.edu>
3763
3764 * bootstrap: Adjust to today's change to gnulib-tool by invoking
3765 it with --assume-autoconf='latest-stable'.
3766
3767 2006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
3768
3769 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
3770 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
3771 YYSTYPE' and `{'.
3772 * src/muscle_tab.h (muscle_grow): Replace the header comments with
3773 those from muscle_tab.c since the old ones are misleading.
3774
3775 2006-07-13 Akim Demaille <akim@epita.fr>
3776
3777 Support %define "KEY" {VALUE}.
3778 * src/scan-code.h, src/scan-code.l (translate_action)
3779 (translate_rule_action, translate_symbol_action, translate_code):
3780 Return char *, not const char *.
3781 * src/parse-gram.y (declaration): Rename as...
3782 (prologue_declaration): this.
3783 (string_content): Remove this nonterminal, use STRING.
3784 (braceless, content, content.opt): New nonterminal.
3785 Use them.
3786 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
3787 as value.
3788 * src/scan-gram.l (getargs.h): Don't include it.
3789
3790 2006-07-12 Paul Eggert <eggert@cs.ucla.edu>
3791
3792 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
3793 rather than a for-loop that declares a local bool variable. This
3794 should work around a compatibility problem with a Cray x1e C++
3795 compiler reported by Hung Nguyen in
3796 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
3797 The for-loop was introduced in the 2004-11-17 change but I don't
3798 know why it was needed.
3799
3800 2006-07-12 Akim Demaille <akim@epita.fr>
3801
3802 * data/c.m4: Comment changes.
3803
3804 2006-07-10 Akim Demaille <akim@lrde.epita.fr>
3805
3806 * src/complain.c (error_message, ERROR_MESSAGE): New.
3807 To factor...
3808 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
3809 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
3810
3811 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3812
3813 * NEWS: Instead of %union, you can define and use your own union type
3814 YYSTYPE if your grammar contains at least one <type> tag.
3815 Your YYSTYPE need not be a macro; it can be a typedef.
3816 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
3817 (Union Decl, Decl Summary): Document this.
3818 * data/glr.c (YYSTYPE): Implement this.
3819 * data/glr.cc (YYSTYPE): Likewise.
3820 * data/lalr1.cc (YYSTYPE): Likewise.
3821 * data/yacc.c (YYSTYPE): Likewise.
3822 * src/output.c (prepare): Output tag_seen_flag.
3823 * src/parse-gram.y (declaration, grammar_declaration):
3824 Use 'union_seen' rather than 'typed' to determine whether
3825 %union has been seen, since grammars can now be typed without
3826 %union.
3827 (symbol_declaration, type.opt, symbol_def):
3828 Keep track of whether a tag has been seen.
3829 * src/reader.c (union_seen, tag_seen): New vars.
3830 (typed): remove.
3831 * src/reader.h (union_seen, tag_seen, typed): Likewise.
3832 * src/scan-code.l (untyped_var_seen): New variable.
3833 (handle_action_dollar): Adjust to above changes.
3834 (handle_action_dollar, handle_action_at):
3835 Improve overflow checking for outlandish numbers.
3836 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
3837 avoid new diagnostics generated by above changes.
3838 * tests/regression.at (YYSTYPE typedef): Add test to check
3839 for type tags without %union.
3840
3841 * src/symlist.c (symbol_list_length): Return int, not unsigned
3842 int, since callers expect int. This may need to get revisited
3843 once we have proper integer overflow checking.
3844
3845 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
3846 object is now static.
3847
3848 * src/getargs.c (flags_argmatch): Return void, not int,
3849 to pacify ./configure --enable-gcc-warnings.
3850
3851 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
3852 since last_string is already defined to FLEX_PREFIX (last_string).
3853
3854 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
3855
3856 Implement --warnings/-W.
3857 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
3858 replaced by...
3859 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
3860 Adjust callers.
3861 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
3862 (warnings_args, warnings_types): New.
3863 (getargs, short_options, long_options): Accept -W/--warnings.
3864 Sort the options by alphabetical order, upper case letter right
3865 before its lower case.
3866
3867 2006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3868
3869 Change %merge result type clash warnings to errors. Discussed at
3870 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
3871 * src/reader.c (record_merge_function_type): Use complain_at.
3872 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3873 declared later): Update test case results.
3874
3875 2006-07-09 Akim Demaille <akim@lrde.epita.fr>
3876
3877 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
3878 to be in alphabetical order.
3879 (trace_args): Spelling fixes.
3880
3881 2006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3882
3883 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
3884 so they don't collide with user-defined macros.
3885 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
3886 this was never guaranteed, and now that we're using gnulib stdint,
3887 which defines int_fast16_t to long int, the problem is exposed.
3888
3889 2006-07-08 Paul Eggert <eggert@cs.ucla.edu>
3890
3891 * data/c.m4 (b4_basename): Simplify a bit, since we don't
3892 need the full POSIX semantics (and weren't implementing them
3893 anyway).
3894
3895 Adjust to Autoconf 2.60 and today's gnulib.
3896 * bootstrap (gnulib_modules): Add stdint.
3897 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
3898 no longer copies it.
3899 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
3900 since stdint needs the former and wcwidth (which is now required
3901 by mbswidth) needs the latter.
3902 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
3903 work around a compatibility glitch between gettext 0.14.6 and
3904 Autoconf 2.60.
3905 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
3906 Do not check for uintptr_t, since new stdint module does the right
3907 thing.
3908 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
3909 Add stdint.h, stdint_.h, wcwidth.h.
3910 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
3911 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
3912 stdint.m4, wchar_t.m4, wcwidth.m4.
3913 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
3914 usual order for ../lib/*.h files.
3915 (file_name_split): Use last_component, not base_name, to adjust
3916 to gnulib changes.
3917 * src/parse-gram.h: Include <strverscmp.h> in the usual order
3918 for ../lib/*.h files.
3919 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
3920 Define unconditionally, since we now assume the stdint module.
3921 * src/scan-skel.l: Include <dirname.h>.
3922 (BASE_QPUTS): Use last_component, not base_name.
3923 * src/system.h: Include <unlocked-io.h> in the usual order
3924 for ../lib/*.h files. Include <stdint.h> unconditionally,
3925 since we now use the stdint module.
3926 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
3927 HAVE_UINTPTR_T, since we now use the stdint module.
3928 (base_name): Remove decl, since files now include <dirname.h>
3929 to get the decl.
3930
3931 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
3932
3933 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
3934 New, default to 1.
3935 * data/yacc.c, data/glr.c, data/location.cc: Use them.
3936 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
3937 default.
3938 * tests/calc.at: Adjust.
3939
3940 2006-07-08 Akim Demaille <akim@lrde.epita.fr>
3941
3942 * data/c.m4 (b4_basename): New.
3943 (b4_syncline): Also output the location of its invocation (from
3944 the skeleton).
3945 (b4_user_action, b4_define_user_action, b4_user_actions)
3946 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
3947 (b4_user_stype): New.
3948 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
3949
3950 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3951
3952 In the grammar file, the first column is 1 not 0 on the first line as
3953 on every other line.
3954 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
3955 * tests/input.at (Torturing the Scanner): Update output.
3956
3957 * src/scan-gram.l (scanner_cursor): Declare it static.
3958
3959 2006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3960
3961 In warnings, say "previous declaration" rather than "first
3962 declaration".
3963 * src/symtab.c (redeclaration): Do that here.
3964 * src/reader.c (record_merge_function_type): In the case of a result
3965 type clash, report the previous declaration rather than the very first
3966 one in the grammar file.
3967 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3968 declared later): Add a third declaration to check this behavior.
3969 * tests/input.at (Incompatible Aliases): Update output.
3970
3971 2006-06-27 Akim Demaille <akim@epita.fr>
3972
3973 * doc/Doxyfile.in: New.
3974 * doc/Makefile.am: Use it.
3975 * src/lalr.h, src/symtab.h: Initial doxygenation.
3976
3977 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3978
3979 Don't miss %merge result type warnings just because the LHS types are
3980 declared after the %merge. This continues the effort of the previous
3981 patch.
3982 * src/reader.c (get_merge_function): Don't set the merger type yet.
3983 (record_merge_function_type): New function for setting the merger type
3984 and checking for clashes.
3985 (grammar_current_rule_merge_set): Set the location of the %merge for
3986 the current rule.
3987 (packgram): Invoke record_merge_function_type for each rule now that
3988 all symbol type declarations have been parsed.
3989 * src/reader.h (merger_list.type_declaration_location): New member
3990 storing the location of the first %merge from which the type for this
3991 merging function was derived.
3992 * src/symlist.h (symbol_list.merger_declaration_location): New member
3993 storing the location of a rule's %merge, if any.
3994 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3995 declared later): New test to catch the error fixed by the above patch.
3996
3997 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3998
3999 Get action warnings (grammar_rule_check) right even when symbol
4000 declarations appear after the rules. Discussed at
4001 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
4002 and
4003 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
4004 Don't mistake the type of $$ in a midrule to be that of its parent
4005 rule's $$.
4006 * src/reader.c (grammar_current_rule_end): Don't invoke
4007 grammar_rule_check yet since not all symbol declarations may have been
4008 parsed yet.
4009 (grammar_midrule_action): Likewise.
4010 Don't record whether the midrule's $$ has been used yet since actions
4011 haven't been translated yet.
4012 Record the midrule's parent rule and its RHS index within the parent
4013 rule.
4014 (grammar_current_rule_action_append): Don't translate the action yet
4015 since not all symbol declarations may have been parsed yet and, thus,
4016 warnings about types for $$, $n, @$, and @n can't be reported yet.
4017 (packgram): Translate the action and invoke grammar_rule_check now that
4018 all symbol declarations have been parsed.
4019 * src/scan-code.l (handle_action_dollar): Now that this is invoked
4020 after parsing the entire grammar file, the symbol list here in the case
4021 of a midrule is actually the midrule's empty RHS, so reference its
4022 parent rule's RHS where necessary.
4023 On the other hand, now that you can already know it's a midrule, you
4024 aren't forced to think $$ has the same type as its parent rule's $$.
4025 (handle_action_at): In the case of a midrule, reference the parent rule
4026 where necessary.
4027 * src/symlist.c (symbol_list_new): Initialize new midrule-related
4028 members.
4029 (symbol_list_length): Now that this is invoked after all rules have
4030 been parsed, a NULL symbol (rather than a NULL symbol list node)
4031 terminates a rule. symbol_list_print already does this correctly.
4032 * src/symlist.h (symbol_list.midrule_parent_rule,
4033 symbol_list.midrule_parent_rhs_index): New members so that midrules can
4034 remember their relationships with their parents.
4035 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
4036 fixed by the above patch.
4037 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
4038 implementing...
4039 (Unused values): ... this old test case and...
4040 (Unused values before symbol declarations): ... this new test case.
4041 This one is the same as `Unused values' except that all symbol
4042 declarations appear after the rules in order to catch the rest of the
4043 errors fixed by the above patch.
4044
4045 2006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4046
4047 More cleanup.
4048 * src/reader.c (current_rule): Declare it static since it's no longer
4049 used outside this file.
4050 (grammar_current_rule_action_append): Remove redundant arguments from
4051 translate_rule_action invocation.
4052 * src/reader.h (current_rule): Remove this unused extern.
4053 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
4054 * src/scan-code.l (translate_rule_action): Likewise.
4055
4056 2006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
4057
4058 Clean up yesterday's patch.
4059 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
4060 to...
4061 * src/reader.c (grammar_current_rule_action_append): ... here for
4062 consistency with grammar_current_rule_symbol_append.
4063 * tests/regression.at (Braced code in declaration in rules section):
4064 Make yyerror and yylex static as usual.
4065
4066 2006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
4067
4068 Fix bug that mistakes braced code in a declaration in the rules section
4069 to be a rule action. Mentioned at
4070 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
4071 * src/scan-gram.l: Move midrule action detection from the start of the
4072 scanning of any braced code to...
4073 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
4074 action. For readability, use $2 and @2 rather than the equivalent
4075 global variables.
4076 * tests/regression.at (Braced code in declaration in rules section):
4077 New test to catch the error fixed by the above patch.
4078
4079 Work on code readability some.
4080 * src/scan-code.l (current_rule): Get rid of this misleading and
4081 redundant declaration: it's actually extern'ed in reader.h.
4082 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
4083 translate_action): Add a rule argument and use it instead of the global
4084 current_rule.
4085 (translate_rule_action): This already receives current_rule through an
4086 argument, so pass it on to translate_action instead of assigning
4087 current_rule to current_rule.
4088 (translate_symbol_action, translate_code): Pass rule = NULL to
4089 translate_action.
4090
4091 2006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
4092
4093 Rename %before-definitions to %start-header and %after-definitions to
4094 %end-header. Don't use these declarations to separate pre-prologue
4095 blocks from post-prologue blocks. Add new order-independent
4096 declarations %before-header and %after-header as alternatives to the
4097 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
4098 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
4099 * NEWS (2.3+): Update for these changes.
4100 * data/glr.c (b4_before_definitions): Update to...
4101 (b4_start_header): ... this.
4102 (b4_after_definitions): Update to...
4103 (b4_end_header): ... this.
4104 * data/glr.cc: Likewise.
4105 * data/lalr1.cc: Likewise.
4106 * data/yacc.c: Likewise.
4107 * doc/bison.texinfo (The prologue): Update names, and replace remaining
4108 prologue blocks with %*-header declarations.
4109 (Calc++ Parser): Likewise.
4110 (Decl Summary): Update names.
4111 (Table of Symbols): Update description.
4112 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
4113 (PERCENT_END_HEADER): ... this.
4114 (PERCENT_BEFORE_DEFINITIONS): Update to...
4115 (PERCENT_START_HEADER): ... this.
4116 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4117 (declaration): Update token names and m4 macro names.
4118 When parsing %end-header and %start-header, invoke translate_code
4119 before muscle_code_grow, and no longer set global booleans to remember
4120 whether these declarations have been seen.
4121 Parse new %after-header and %before-header.
4122 * src/reader.c (before_definitions, after_definitions): Remove.
4123 (prologue_augment): Accept a new bool argument to specify whether to
4124 augment the pre-prologue or post-prologue.
4125 * src/reader.h (before_definitions, after_definitions): Remove these
4126 extern's.
4127 (prologue_augment): Add new bool argument.
4128 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
4129 (PERCENT_END_HEADER): ... this.
4130 (PERCENT_BEFORE_DEFINITIONS): Update to...
4131 (PERCENT_START_HEADER): ... this.
4132 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4133 * tests/actions.at (Printers and Destructors): Update names.
4134
4135 2006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
4136
4137 Add comparison operators for C++ location classes. Discussed at
4138 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
4139 * data/c++.m4 (b4_define_location_comparison): New boolean %define
4140 declaration indicating whether filename_type has an operator==. If
4141 filename_type is `std::string', it defaults to `1', `0' otherwise.
4142 * data/location.cc: Iff b4_define_location_comparison is `1', add
4143 operator== and operator!= for class position and for class location.
4144
4145 Some minor fixes.
4146 * src/scan-action.l: Remove unused file.
4147 * src/symtab.c (symbol_printer_set): Use printer_location not
4148 destructor_location.
4149 * src/symtab.h (struct symbol): Replace incorrect source comment for
4150 printer members.
4151 * tests/input.at (Incompatible Aliases): Update output with correct
4152 printer location.
4153
4154 2006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
4155
4156 Don't put the pre-prologue in the header file. For the yacc.c code
4157 file and the glr.c header and code files, move the pre-prologue before
4158 the token definitions. Add new %before-definitions and
4159 %after-definitions to declare code that will go in both the header file
4160 and code file. Discussed at
4161 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
4162 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
4163 and
4164 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
4165 * NEWS (2.3+): Describe these changes.
4166 * data/glr.c (b4_pre_prologue): Move from within to before...
4167 (b4_shared_declarations): ... this.
4168 Add new b4_before_definitions before b4_token_enums.
4169 Add new b4_after_definitions at the end.
4170 * data/glr.cc (b4_pre_prologue): Replace with...
4171 (b4_before_definitions): ... this in the header file.
4172 (b4_after_definitions): New near the end of the header file.
4173 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
4174 code file right before including the header file.
4175 (b4_before_definitions): New in the previous position of
4176 b4_pre_prologue in the header file.
4177 (b4_after_definitions): New near the end of the header file.
4178 * data/yacc.c: Clean up some m4 quoting especially in the header file.
4179 (b4_token_enums_defines): In the code file, move to right before
4180 YYSTYPE for consistency with the header file.
4181 (b4_before_definitions): New right before b4_token_enums_defines in
4182 both the header and code file.
4183 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
4184 header and code file.
4185 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
4186 of prologues for %union dependencies.
4187 (Decl Summary): In %defines description, mention the effect of
4188 %before-definitions and %after-definitions on the header file.
4189 (Calc++ Parser): Forward declare driver in a %before-definitions rather
4190 than in the pre-prologue so that make check succeeds.
4191 (Table of Symbols): Add entries for %before-definitions and
4192 %after-definitions.
4193 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
4194 %before-definitions.
4195 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
4196 (declaration): Parse those declarations and append to
4197 b4_before_definitions and b4_after_definitions, respectively.
4198 * src/reader.c (before_definitions, after_definitions): New bools to
4199 track whether those declarations have been seen.
4200 (prologue_augment): Add to the post-prologue if %union,
4201 %before-definitions, or %after-definitions has been seen.
4202 * src/reader.h (before_definitions, after_definitions): New extern's.
4203 * src/scan-gram.l: Scan the new declarations.
4204 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
4205 prologue block in a %before-definitions or a %after-definitions based
4206 on whether the %union is declared.
4207 * tests/regression.at (Early token definitions with --yacc, Early token
4208 definitions without --yacc): Move tests for token definitions into the
4209 post-prologue since token names are no longer defined in the
4210 pre-prologue.
4211
4212 2006-06-20 Akim Demaille <akim@epita.fr>
4213
4214 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
4215 (symbol_get): Use it.
4216 * src/parse-gram.y: Use it.
4217
4218 2006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
4219
4220 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
4221 build succeeds when configured with --enable-gcc-warnings.
4222
4223 2006-06-19 Paul Eggert <eggert@cs.ucla.edu>
4224
4225 * src/parse-gram.y (char_name): New function.
4226 (CHAR, STRING, string_content): For %printer, properly escape.
4227 (ID): Prefer fputs to fprintf.
4228 (id): Reindent to be consistent with other rules.
4229 Properly quote char.
4230
4231 The Translation Project changed its way of publishing translations
4232 to maintainers. I haven't received any responses to my request
4233 for supporting the old way, or for documenting the new way. I
4234 have modified 'bootstrap' to use screen scraping
4235 (in this case, HTML scraping). This is unreliable and inelegant,
4236 but I don't see any better way. Yuck.
4237 * bootstrap (TP_URL, WGET_COMMAND): New vars.
4238 (get_translations): New function, which uses HTML scraping to
4239 deduce locations of latest translations.
4240 Use this function to grab both bison and bison-runtime .po files.
4241 Don't bother priming the pump for the runtime-po domain any more,
4242 as it's now translated better than bison is.
4243
4244 2006-06-19 Akim Demaille <akim@epita.fr>
4245
4246 * src/scan-gram.l: No longer "parse" things after `%union' until
4247 `{'. Rather, return a single "%union" token.
4248 No longer make symbols: return strings, and leave the conversion
4249 to symbols to the parser.
4250 (SC_PRE_CODE, token_type): Remove.
4251 * src/parse-gram.y (%union): New field `character'.
4252 Sort tokens.
4253 (CHAR): New token.
4254 (ID, ID_COLON): Now that the scanner no longer makes them
4255 identifiers, adjust all uses to invoke symbol_get.
4256 (id_colon): New, wraps the conversion from string to symbol.
4257 (%union): Accept a possible union_name.
4258 (symbol): Now can be a char.
4259 * data/c.m4 (b4_union_name): Leave a default value.
4260 * data/glr.c, data/yacc.c: Use it.
4261
4262 2006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
4263
4264 For associating token numbers with token names for "yacc.c", don't use
4265 #define statements unless `--yacc' is specified; always use enum
4266 yytokentype. Most important discussions start at:
4267 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
4268 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
4269 and
4270 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
4271 * NEWS (2.3+): Mention.
4272 * data/c.m4 (b4_yacc_if): New.
4273 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
4274 token #define's.
4275 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
4276 on token name definitions.
4277 * src/getargs.c (usage): Capitalize `Yacc' in English.
4278 * src/output.c (prepare): Define b4_yacc_flag.
4279 * tests/regression.at (Early token definitions): Test that tokens names
4280 are defined before the pre-prologue not just before the post-prologue.
4281 Remove this test case and copy to...
4282 (Early token definitions with --yacc): ... this to test #define's.
4283 (Early token definitions without --yacc): ... and this to test enums.
4284
4285 2006-06-11 Paul Eggert <eggert@cs.ucla.edu>
4286
4287 * NEWS: Reword the post-2.3 change to not be so optimistic about
4288 removing the old "look-ahead" spelling.
4289 Update previous look-ahead/lookahead change reports.
4290 * REFERENCES: look-ahead -> lookahead (since that's
4291 what he actually wrote).
4292 * doc/refcard.tex: look ahead -> lookahead,
4293 look-ahead -> lookahead
4294
4295 2006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
4296
4297 For consistency, use `lookahead' instead of `look-ahead' or
4298 `look_ahead'. Discussed starting at
4299 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
4300 and then at
4301 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
4302 * NEWS: For the next release, note the change to `--report'.
4303 * TODO, doc/bison.1: Update English.
4304 * doc/bison.texinfo: Update English.
4305 (Understanding Your Parser, Bison Options): Document as
4306 `--report=lookahead' rather than `--report=look-ahead'.
4307 * src/conflicts.c: Update English in comments.
4308 (lookahead_set): Rename from look_ahead_set.
4309 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
4310 (resolve_sr_conflict): Rename local look_ahead_tokens to
4311 lookahead_tokens, and update other uses.
4312 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
4313 count_rr_conflicts, conflicts_free): Update uses.
4314 * src/getargs.c (report_args): Move "lookahead" before alternate
4315 spellings.
4316 (report_types): Update uses.
4317 (usage): For `--report' usage description, state `lookahead' spelling
4318 rather than `look-ahead'.
4319 * src/getargs.h (report.report_lookahead_tokens): Rename from
4320 report_look_ahead_tokens.
4321 * src/lalr.c: Update English in comments.
4322 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
4323 (state_lookahead_tokens_count): Rename from
4324 state_look_ahead_tokens_count.
4325 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4326 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
4327 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4328 Update other uses.
4329 Update English in output.
4330 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
4331 * src/print.c: Update English in comments.
4332 (lookahead_set): Rename from look_ahead_set.
4333 (print_reduction): Rename argument lookahead_token from
4334 look_ahead_token.
4335 (print_core, state_default_rule, print_reductions, print_results):
4336 Update uses.
4337 * src/print_graph.c: Update English in comments.
4338 (print_core): Update uses.
4339 * src/state.c: Update English in comments.
4340 (reductions_new): Update uses.
4341 (state_rule_lookahead_tokens_print): Rename from
4342 state_rule_look_ahead_tokens_print, and update other uses.
4343 * src/state.h: Update English in comments.
4344 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
4345 (state_rule_lookahead_tokens_print): Rename from
4346 state_rule_look_ahead_tokens_print.
4347 * src/tables.c: Update English in comments.
4348 (conflict_row, action_row): Update uses.
4349 * tests/glr-regression.at
4350 (Incorrect lookahead during deterministic GLR,
4351 Incorrect lookahead during nondeterministic GLR): Rename
4352 print_look_ahead to print_lookahead.
4353 * tests/torture.at: Update English in comments.
4354 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
4355 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
4356 (Many lookahead tokens): Update uses.
4357 * data/glr.c: Update English in comments.
4358 * lalr1.cc: Likewise.
4359 * yacc.c: Likewise.
4360 * src/conflicts.h: Likewise.
4361 * src/lalr.h: Likewise.
4362 * src/main.c: Likewise.
4363 * src/output.c: Likewise.
4364 * src/parse-gram.c: Likewise.
4365 * src/tables.h: Likewise.
4366 * tests/calc.at: Likewise.
4367
4368 2006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
4369
4370 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
4371
4372 2006-06-07 Paul Eggert <eggert@cs.ucla.edu>
4373
4374 * TODO: Add request from Nelson H. F. Beebe to be able to install
4375 Bison without installing the yacc script.
4376
4377 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4378
4379 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
4380 and yytext if they're already #define'd.
4381 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
4382 * src/scan-code-c.c: ... here.
4383 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
4384 <config.h>.
4385
4386 2006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4387
4388 Get Bison to build again when configured with --enable-gcc-warnings.
4389 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
4390 missing #include's.
4391 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
4392 loc argument as it shadows a global.
4393 * src/scan-gram.l: Remove stray comma that prevents boundary_set
4394 invocation.
4395
4396 * src/.cvsignore: Add scan-code.c.
4397
4398 2006-06-07 Akim Demaille <akim@epita.fr>
4399
4400 * src/scan-gram.l: Move the "add a trailing ; to actions" code
4401 to...
4402 * src/scan-code.l: here.
4403 * tests/input.at (Torturing the Scanner): Fix another location
4404 error.
4405
4406 2006-06-07 Akim Demaille <akim@epita.fr>
4407
4408 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
4409
4410 2006-06-06 Akim Demaille <akim@epita.fr>
4411
4412 Extract the parsing of user actions from the grammar scanner.
4413 As a consequence, the relation between the grammar scanner and
4414 parser is much simpler. We can also split "composite tokens" back
4415 into simple tokens.
4416 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
4417 * src/scan-gram.l (add_column_width, adjust_location): Move to and
4418 rename as...
4419 * src/location.h, src/location.c (add_column_width)
4420 (location_compute): these.
4421 Fix the column count: the initial column is 0.
4422 (location_print): Be robust to ending column being 0.
4423 * src/location.h (boundary_set): New.
4424 * src/main.c: Adjust to scanner_free being renamed as
4425 gram_scanner_free.
4426 * src/output.c: Include scan-code.h.
4427 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
4428 Use boundary_set.
4429 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
4430 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
4431 which is now, again, a separate token.
4432 Adjust all dependencies.
4433 Whereever actions with $ and @ are used, use translate_code.
4434 (action): Remove this nonterminal which is now useless.
4435 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
4436 (grammar_current_rule_action_append): Use translate_code.
4437 (packgram): Bound check ruleno, itemno, and rule_length.
4438 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
4439 (last_string, last_braced_code_loc, max_left_semantic_context)
4440 (scanner_initialize, scanner_free, scanner_last_string_free)
4441 (gram_out, gram_lineno, YY_DECL_): Move to...
4442 * src/scan-gram.h: this new file.
4443 (YY_DECL): Rename as...
4444 (GRAM_DECL): this.
4445 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
4446 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4447 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4448 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4449 Move these declarations, and...
4450 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
4451 these to...
4452 * src/flex-scanner.h: this new file.
4453 * src/scan-gram.l (rule_length, rule_length_overflow)
4454 (increment_rule_length): Remove.
4455 (last_braced_code_loc): Rename as...
4456 (gram_last_braced_code_loc): this.
4457 Adjust to the changes of the parser.
4458 Move all the handling of $ and @ into...
4459 * src/scan-code.l: here.
4460 * src/scan-gram.l (handle_dollar, handle_at): Remove.
4461 (handle_action_dollar, handle_action_at): Move to...
4462 * src/scan-code.l: here.
4463 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
4464 scan-code.h, scan-code-c.c, scan-gram.h.
4465 (EXTRA_bison_SOURCES): Add scan-code.l.
4466 (BUILT_SOURCES): Add scan-code.c.
4467 (yacc): Be robust to white spaces.
4468
4469 * tests/conflicts.at, tests/input.at, tests/reduce.at,
4470 * tests/regression.at: Adjust the column numbers.
4471 * tests/regression.at: Adjust the error message.
4472
4473 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4474
4475 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4476 Use Akim's wording from
4477 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
4478
4479 2006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4480
4481 Between Bison releases, manually append `+' to the previous Bison
4482 release number, and use that as a signal to automatically print the
4483 ChangeLog's CVS Id keyword from --version. Discussed starting at
4484 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
4485 * ChangeLog: Add Id header.
4486 * configure.ac (AC_INIT): Append `+' to `2.3'.
4487 * src/.cvsignore: Add revision.c.
4488 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
4489 (BUILT_SOURCES): Add revision.c.
4490 (revision.c): New target rule. This file defines a new global variable
4491 named revision. It initializes it with either the Id from ChangeLog
4492 or, if VERSION doesn't contain `+', with the empty string.
4493 * src/getargs.c (version): Print the value of revision.
4494 * src/revision.h: Extern revision.
4495
4496 2006-06-05 Paul Eggert <eggert@cs.ucla.edu>
4497
4498 * NEWS: Version 2.3.
4499 * configure.ac (AC_INIT): Likewise.
4500
4501 2006-05-30 Paul Eggert <eggert@cs.ucla.edu>
4502
4503 * data/glr.c (YYRECOVERING): Define to be a function-like macro
4504 with no arguments, not as an object-like macro. This is for
4505 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
4506 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
4507 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
4508 Document this.
4509
4510 2006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
4511
4512 * src/getargs.c (usage): Back out yesterday's modification of the
4513 --help output so that we don't have to wait for translation before
4514 releasing 2.3.
4515
4516 2006-05-29 Paul Eggert <eggert@cs.ucla.edu>
4517
4518 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
4519 Problem reported by Akim Demaille.
4520
4521 2006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4522
4523 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4524
4525 2006-05-26 Paul Eggert <eggert@cs.ucla.edu>
4526
4527 * data/yacc.c (yy_reduce_print): Omit trailing white space in
4528 generated source code. Problem reported by Frans Englich in
4529 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
4530
4531 2006-05-22 Paul Eggert <eggert@cs.ucla.edu>
4532
4533 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
4534 shell, not within 'make', so that 'make' by an ordinary builder
4535 (using GNU make) does not worry about configuring gzip. This also
4536 works around a bug reported independently by Keith Thompson and by
4537 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
4538 stderr rather than stdout, messing up the build logs.
4539
4540 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4541
4542 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
4543 to make sure that YYID will never be unused. This fixes a 'make
4544 maintainer-check' failure caused by the recent changes to the 'Trivial
4545 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
4546 not used.
4547 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
4548
4549 2006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4550
4551 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
4552 state before an empty RHS is always resolved here. Only the location
4553 of that state is guaranteed to be resolved, and that's enough. This
4554 fixes the remaining bug reported by Derek M. Jones in
4555 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4556 * tests/glr-regression.at (Uninitialized location when reporting
4557 ambiguity): Test the above case.
4558 Also, the embedded comments in this test case claim it checks the case
4559 of an empty RHS that has inherited the initial location. However, the
4560 corresponding LHS was already resolved, so yyresolveLocations didn't
4561 actually have reason to modify it. Fix this by forcing
4562 nondeterministic operation at the beginning of the parse.
4563
4564 2006-05-20 Paul Eggert <eggert@cs.ucla.edu>
4565
4566 * data/c.m4 (b4_yy_symbol_print_generate):
4567 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
4568 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
4569 of the bugs reported today by Derek M Jones in
4570 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4571 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
4572 defined to be a type name without parens or brackets.
4573 (Location Type): Similarly for YYLTYPE.
4574 * tests/regression.at (Trivial grammars): Put in a test for this
4575 bug that will be caught by 'make maintainer-check' (though not,
4576 alas, by 'make check' unless your compiler is picky).
4577
4578 2006-05-19 Paul Eggert <eggert@cs.ucla.edu>
4579
4580 * NEWS: Version 2.2.
4581 * configure.ac (AC_INIT): Likewise.
4582
4583 2006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
4584
4585 * data/glr.c (yyreportTree): Make room in yystates for the state
4586 preceding the RHS. This fixes the segmentation fault reported by Derek
4587 M. Jones in
4588 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
4589 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
4590 to the user. Reported for yyreportTree by Derek M. Jones later in the
4591 same thread.
4592 * THANKS: Add Derek M. Jones.
4593 Update my email address.
4594 Fix typo in Steve Murphy's name.
4595
4596 2006-05-14 Paul Eggert <eggert@cs.ucla.edu>
4597
4598 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
4599 checking against YYLAST that caused the parser to miss a potential
4600 alternative in its diagnostic.
4601 Problem reported by Maria Jose Moron Fernandez in
4602 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
4603 * data/lalr1.cc (yysyntax_error_): Likewise.
4604 * data/yacc.c (yysyntax_error): Likewise.
4605 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
4606 tokens, in case we run into an older C compiler.
4607 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
4608 Use them to check for the off-by-one error fixed above.
4609
4610 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
4611 YYSIZE_T, not size_t.
4612 * tests/regression.at (Trivial grammars): New test, to catch
4613 the error fixed by the above patch.
4614
4615 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4616
4617 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
4618 scheme.
4619 Reported by Steve Murphy.
4620
4621 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4622
4623 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
4624 * data/glr.cc: b4_location_flag is now b4_locations_flag.
4625
4626 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4627
4628 Implement --trace=m4.
4629 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
4630 * src/output.c (output_skeleton): When set, pass -dV to m4.
4631
4632 Factor the handling of flags in m4.
4633 * src/output.c (prepare): Rename the muscle names debug, defines,
4634 error_verbose to debug_flag, defines_flag, error_verbose_flag.
4635 * data/c.m4: Adjust.
4636 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
4637 Use b4_define_flag_if to define other b4_FLAG_if macros.
4638 (b4_location_if): As a consequence, rename as...
4639 (b4_locations_if): this, for consistency.
4640 Adjust all the skeletons.
4641
4642 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4643
4644 * etc/bench.pm: Shorten bench names.
4645
4646 2006-05-14 Akim Demaille <akim@lrde.epita.fr>
4647
4648 * src/output.h, src/output.c (error_verbose): Move to...
4649 * src/getargs.h, src/getargs.c: here.
4650 Sort the flags.
4651 Adjust dependencies.
4652
4653 2006-05-13 Paul Eggert <eggert@cs.ucla.edu>
4654
4655 * data/c.m4 (b4_copyright): Put the special exception for Bison
4656 skeletons here, so we don't have to put it in each skeleton. All
4657 uses changed. Suggested by Akim Demaille. Also, wrap the
4658 copyright notice, in case it is longer than 80 columns. Replace
4659 comma by newline after title.
4660
4661 2006-05-11 Paul Eggert <eggert@cs.ucla.edu>
4662
4663 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
4664 incompatibility, not a bug. Mention that it wasn't fixed as of
4665 flex 2.5.33.
4666
4667 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
4668
4669 * examples/extexi: Enforce the precedence of concatenation over
4670 >>.
4671 Reported by Tommy Nordgren.
4672
4673 2006-05-11 Akim Demaille <akim@lrde.epita.fr>
4674
4675 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
4676 with the member "token".
4677 Reported by Martin Nylin.
4678
4679 2006-05-08 Paul Eggert <eggert@cs.ucla.edu>
4680
4681 * data/glr.c: Switch to Bison 2.2 special-exception language in
4682 the copyright notice. Use more-regular format for titles and
4683 copyright notices.
4684 * data/glr.cc: Likewise.
4685 * data/location.cc: Likewise.
4686 * data/yacc.cc: Likewise.
4687 * doc/bison.texinfo (Conditions): Document this.
4688 * NEWS: likewise. Upgrade version to 2.2.
4689
4690 2006-04-27 Akim Demaille <akim@lrde.epita.fr>
4691
4692 * data/glr.cc: Remove dead code.
4693
4694 2006-04-25 Paul Eggert <eggert@cs.ucla.edu>
4695
4696 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
4697 that variable and the line breaks the bootstrap. Problem reported
4698 by Juan M. Guerrero.
4699
4700 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
4701
4702 * doc/bison.texinfo (Multiple start-symbols): New.
4703
4704 2006-04-24 Akim Demaille <akim@lrde.epita.fr>
4705
4706 * etc/README, etc/bench.pl: New.
4707
4708 2006-04-03 Akim Demaille <akim@lrde.epita.fr>
4709
4710 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
4711 rule.
4712 Reported by Mickael Labau.
4713 * tests/input.at (Torturing the Scanner): Test it.
4714
4715 2006-03-16 Paul Eggert <eggert@cs.ucla.edu>
4716
4717 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
4718 Problem reported by Bob Rossi.
4719
4720 2006-03-13 Paul Eggert <eggert@cs.ucla.edu>
4721
4722 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
4723 and didn't really work.
4724 For the index, use @ifnotinfo, not @iftex.
4725 Minor cleanups of spacing and terminology.
4726
4727 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
4728
4729 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
4730 of AT_NAME_PREFIX when %name-prefix is not used.
4731
4732 2006-03-12 Akim Demaille <akim@lrde.epita.fr>
4733
4734 Apply --prefix to C++ skeletons too: they change the namespace.
4735 The test suite already exercize these cases.
4736 * data/c++.m4 (b4_namespace): New.
4737 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
4738 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
4739 * data/yacc.c, data/glr.c: Remove a useless `[]'.
4740 * doc/bison.texinfo: Document it.
4741 (Option Cross Key): Use @multitable in all formats. It looks
4742 nicer, even in TeX outputs.
4743 (Rules): Use the same code whatever the output type is.
4744 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
4745 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
4746 * tests/calc.at: Use it, instead of hard coding `yy'.
4747
4748 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
4749
4750 * TODO: Remove dead items.
4751
4752 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
4753
4754 * doc/FAQ: Remove, merged into...
4755 * doc/bison.texinfo (FAQ): this.
4756 * doc/Makefile.am (EXTRA_DIST): Adjust.
4757
4758 2006-03-10 Akim Demaille <akim@lrde.epita.fr>
4759
4760 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
4761 even if empty.
4762 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
4763 * doc/bison.texinfo (Calc++ Scanner): Use it.
4764
4765 2006-03-09 Paul Eggert <eggert@cs.ucla.edu>
4766
4767 Fix two nits reported by twlevo, plus one more that I discovered.
4768
4769 * src/assoc.h (assoc_to_string): Give a name to the arg, as
4770 this is the usual Bison style.
4771 * src/location.h (location_print): Likewise.
4772
4773 * src/reader.h (token_name): Likewise.
4774
4775 2006-03-08 Paul Eggert <eggert@cs.ucla.edu>
4776
4777 Fix some nits reported by twlevo.
4778 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
4779 and "POSIX". Use more-modern syntax for URLs. Mention C++
4780 and ask for Java. Don't hardwire OS version numbers. Add
4781 copyright notice.
4782 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
4783 * src/conflicts.c (solved_conflicts_obstack): Now static.
4784
4785 2006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4786
4787 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
4788 page. Say "you can use it" not "you may use it" as on the web page;
4789 we're describing capabilities not granting permission.
4790
4791 2006-03-06 Paul Eggert <eggert@cs.ucla.edu>
4792
4793 * data/glr.c (yyresolveLocations): Rename local variables to avoid
4794 shadowing warnings. Use usual patter for iterating through RHS.
4795 * tests/glr-regression.at
4796 (Uninitialized location when reporting ambiguity):
4797 Modify yylex so that it uses its argument, rather than trying
4798 to rely on ARGSUSED (which doesn't work for gcc with warnings).
4799 const char -> char const.
4800
4801 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
4802 Don't use tabs inside commands; it messes up 'ps'.
4803 Problem reported by twlevo.
4804
4805 2006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
4806
4807 * tests/glr-regression.at (Uninitialized location when reporting
4808 ambiguity): New test case.
4809 * data/glr.c (yyresolveLocations): New function, which uses
4810 YYLLOC_DEFAULT.
4811 (yyresolveValue): Invoke yyresolveLocations before reporting an
4812 ambiguity.
4813 * doc/bison.texinfo (Default Action for Locations): Note
4814 YYLLOC_DEFAULT's usage for ambiguity locations.
4815 (GLR Semantic Actions): Cross-reference those notes.
4816
4817 2006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
4818
4819 * tests/glr-regression.at (Leaked semantic values when reporting
4820 ambiguity): Remove unnecessary union and type declarations.
4821 (Leaked lookahead after nondeterministic parse syntax error): New test
4822 case.
4823 * data/glr.c (yyparse): Check for zero stacks remaining before
4824 attempting to shift the lookahead so that you don't lose it.
4825
4826 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4827
4828 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
4829 * tests/glr-regression.at (Leaked semantic values when reporting
4830 ambiguity): New test case.
4831 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
4832 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
4833 now unnecessary yystackp parameter.
4834 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
4835 destructors can be called.
4836
4837 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
4838 in existing testcases.
4839
4840 2006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4841
4842 Don't leak semantic values for parent RHS when a user action cuts the
4843 parser, and clean up related code a bit.
4844 * tests/glr-regression.at (Leaked merged semantic value if user action
4845 cuts parse): Rename to...
4846 (Leaked semantic values if user action cuts parse): ... this. Add check
4847 for leaked parent RHS values.
4848 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
4849 between an unresolved state (non-empty chain of semantic options) and
4850 an incomplete one (signaled by an empty chain).
4851 (yyresolveStates): Document the interface. Move all manipulation of a
4852 successfully or unsuccessfully resolved yyGLRState to...
4853 (yyresolveValue): ... here so that yyresolveValue always leaves a
4854 yyGLRState with consistent data and thus is easier to understand.
4855 Remove the yyvalp and yylocp parameters since they are always just
4856 taken from the yys parameter. When reporting a discarded merged value
4857 in debugging output, note that it is incompletely merged. Document the
4858 interface.
4859 (yyresolveAction): If resolving any of the RHS states fails, destroy
4860 them all rather than leaking them. Thus, as long as user actions are
4861 written to clean up the RHS correctly, yyresolveAction always cleans up
4862 the RHS of a semantic option. Document the interface.
4863
4864 2006-02-27 Paul Eggert <eggert@cs.ucla.edu>
4865
4866 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
4867 led to a segmentation fault in GNU Pascal. Problem reported
4868 by Waldek Hebisch.
4869
4870 2006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
4871
4872 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
4873 mid-rule action inside a nonterminal symbol in order to declare a
4874 destructor for its semantic value.
4875
4876 2006-02-16 Paul Eggert <eggert@cs.ucla.edu>
4877
4878 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
4879 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
4880 __cplusplus && ! defined _STDLIB_H && !
4881 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
4882 defined free))]: Include <stdlib.h> rather than rolling our own
4883 declarations of malloc and free, to avoid problems with
4884 incompatible declarations (using 'throw') C++'s stdlib.h. This
4885 should fix Debian bug 340012
4886 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
4887 reported by Guillaume Melquiond.
4888
4889 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4890
4891 * NEWS: Clarify symbols versus types in unused-value warnings.
4892
4893 * configure.ac (AC_INIT): Bump version number.
4894
4895 2006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4896
4897 * NEWS: Version 2.1a.
4898 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
4899 since C99 requires this.
4900
4901 2006-02-11 Paul Eggert <eggert@cs.ucla.edu>
4902
4903 * m4/c-working.m4: New file.
4904 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
4905
4906 2006-02-10 Paul Eggert <eggert@cs.ucla.edu>
4907
4908 * Makefile.maint: Merge from coreutils.
4909
4910 2006-02-09 Paul Eggert <eggert@cs.ucla.edu>
4911
4912 More portability fixes for problems summarized by Nelson H. F. Beebe.
4913
4914 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
4915 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
4916 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
4917 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
4918 messes up because C++ code is compiled in 32-bit mode but linked
4919 in 64-bit mode.
4920
4921 2006-02-08 Paul Eggert <eggert@cs.ucla.edu>
4922
4923 More portability fixes for problems summarized by Nelson H. F. Beebe.
4924
4925 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
4926 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
4927
4928 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
4929 nodist_PROGRAMS, since we don't need to actually compile the
4930 example if we're just doing a plain 'make'. This avoids bothering
4931 the installer unnecessarily about problems due to weird C++
4932 compilers.
4933
4934 2006-02-06 Paul Eggert <eggert@cs.ucla.edu>
4935
4936 More portability fixes for problems summarized by Nelson H. F. Beebe.
4937
4938 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
4939 than #include "...", and compile with -I'.'. The old method was
4940 not portable, according to Posix and the C standard, and it does
4941 not work with Sun C 5.7, where previous #line directives affect
4942 the working directory used in later #include "..." directives.
4943
4944 2006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4945
4946 Various DJGGP specific issues in /djgpp
4947
4948 2006-02-02 Paul Eggert <eggert@cs.ucla.edu>
4949
4950 More portability fixes for problems summarized by Nelson H. F. Beebe.
4951
4952 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
4953 '#include <map>' works and that you can apply ++ to iterators.
4954
4955 2006-02-01 Paul Eggert <eggert@cs.ucla.edu>
4956
4957 Work around portability problems summarized by Nelson H. F. Beebe in
4958 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
4959
4960 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4961 that '#include <string>' works.
4962
4963 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
4964 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
4965 "warning: sorry: semantics of inline function static data `const
4966 unsigned char translate_table[262]' are wrong (you'll wind up with
4967 multiple copies)".
4968
4969 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
4970 or, xor to not_, and_, or_, and xor_, respectively. This works
4971 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
4972 random system header somewhere that includes the equivalent of
4973 <iso646.h>.
4974
4975 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
4976 -E" works; it apparently doesn't work with PathScale EKO Compiler
4977 Suite Version 2.0.
4978
4979 2006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
4980
4981 During deterministic GLR operation, user actions should be able to
4982 influence the parse by changing yychar. To make this easier to fix and
4983 to make glr.c easier to evolve in general, don't maintain yytoken in
4984 parallel with yychar; just compute yytoken when needed.
4985 * tests/glr-regression.at (Incorrect lookahead during deterministic
4986 GLR): Check that setting yychar in a user action has the intended
4987 effect.
4988 * data/glr.c (yyGLRStack): Remove yytokenp member.
4989 (yyclearin): Don't set *yytokenp.
4990 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
4991 yychar rather than *yytokenp to determine the current lookahead.
4992 Compute yytoken locally when needed.
4993 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
4994 point to.
4995
4996 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
4997 after `--report' documentation.
4998
4999 2006-01-30 Paul Eggert <eggert@cs.ucla.edu>
5000
5001 * src/parse-gram.y (grammar_declaration): Location of printer
5002 symbol is @1, not list->location. Bug reported by twlevo.
5003 * tests/input.at (Incompatible Aliases): Adjust to above change.
5004
5005 2006-01-29 Paul Eggert <eggert@cs.ucla.edu>
5006
5007 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
5008 all the test at once. This makes the output easier to read in the
5009 normal case.
5010
5011 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
5012 got from <http://bro-ids.org/download.html>. The bug is that
5013 when two actions appeared in succession, the second one was
5014 scanned before the first one was added to the grammar rule
5015 as a midrule action. Bison then output the incorrect warning
5016 "parse.y:905.17-906.36: warning: unused value: $3".
5017 * src/parse-gram.y (BRACED_CODE, action): These are no longer
5018 associated with a value.
5019 (rhs): Don't invoke grammar_current_rule_action_append.
5020 (action): Invoke it here instead.
5021 * src/reader.c (grammar_midrule_action): Now extern.
5022 (grammar_current_rule_action_append): Don't invoke
5023 grammar_midrule_action; that is now the scanner's job.
5024 * src/reader.h (last_string, last_braced_code_loc):
5025 (grammar_midrule_action): New decls.
5026 * src/scan-gram.l (last_string): Now extern, sigh.
5027 (last_braced_code_loc): New extern variable.
5028 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
5029 rule already has an action.
5030 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
5031 * tests/input.at (AT_CHECK_UNUSED_VALUES):
5032 Add some tests to check that the above changes fixed the bug.
5033
5034 2006-01-27 Paul Eggert <eggert@cs.ucla.edu>
5035
5036 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
5037 All used changed. Check whether the symbol has a destructor,
5038 not whether it is typed.
5039 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
5040 that the values are still reported as unused. All line numbers
5041 adjusted.
5042
5043 2006-01-23 Paul Eggert <eggert@cs.ucla.edu>
5044
5045 Work around a bug in bro 0.8, which underparenthesizes its
5046 definition of YYLLOC_DEFAULT.
5047 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
5048 their arguments.
5049 * data/lalr1.cc: Likewise.
5050 * data/yacc.cc: Likewise.
5051
5052 2006-01-22 Paul Eggert <eggert@cs.ucla.edu>
5053
5054 Work around a bug in Pike 7.0, and give the Pike folks a
5055 better way to override the usual int widths.
5056 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
5057 user can override the types.
5058 (short): #undef, to work around a bug in Pike 7.0.
5059 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
5060 (union yyalloc.yyss): Use yytype_int16 rather than short.
5061 All uses changed.
5062 (yysigned_char): Remove.
5063 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
5064 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
5065 * tests/regression.at (Web2c Actions): Adjust to above changes.
5066
5067 * src/reader.c (check_and_convert_grammar): New function.
5068 (reader): Close the input file even if something went wrong during
5069 parsing. Minor file descriptor leak reported by twlevo.
5070
5071 * src/assoc.c (assoc_to_string): Use a default: abort (); case
5072 to pacify gcc -Wswitch-default.
5073 * src/scan-gram.l (adjust_location): Use a default: break; case
5074 to pacify gcc -Wswitch-default.
5075 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
5076 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5077 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5078 Move these decls to scan-skel.l, since they don't need to be
5079 visible elsewhere.
5080 * src/scan-skel.l: Accept the above decls.
5081 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
5082 is used.
5083
5084 2006-01-21 Paul Eggert <eggert@cs.ucla.edu>
5085
5086 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
5087 since we don't want to insist on a version number at the start
5088 of the changelog every time.
5089 * Makefile.maint: Sync from coreutils a bit better.
5090 (sc_trailing_blank): Renamed from sc_trailing_space.
5091 All uses changed.
5092 (sc_no_if_have_config_h, sc_require_config_h):
5093 (sc_prohibit_assert_without_use): New rules.
5094 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
5095 (sc_dd_max_sym_length): Fix leading spaces in rule.
5096 (sc_system_h_headers): Prefix with @.
5097 (sc_useless_cpp_parens, m4-check): Output line numbers.
5098 (changelog-check): Allow version only in head.
5099 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
5100 satisfy new Makefile.maint rule.
5101 * data/glr.c: Likewise.
5102 * data/glr.cc: Likewise.
5103 * data/lalr1.cc: Likewise.
5104 * data/yacc.c: Likewise.
5105 * lib/ebitsetv.c: Likewise.
5106 * lib/lbitset.c: Likewise.
5107 * lib/subpipe.c: Likewise.
5108 * lib/timevar.c: Likewise.
5109 * src/system.h: Likewise.
5110 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
5111 * djgpp/Makefile.maint: Add copyright notice.
5112 * djgpp/README.in: Likewise.
5113 * djgpp/config.bat: Likewise.
5114 * djgpp/config.site: Likewise.
5115 * djgpp/config_h.sed: Likewise.
5116 * djgpp/djunpack.bat: Likewise.
5117 * djgpp/config.sed: Fix copyright notice to match standard format.
5118 * djgpp/subpipe.h: Likewise.
5119 * lib/bitsetv-print.c: Likewise.
5120 * lib/bitsetv.c: Likewise.
5121 * lib/subpipe.h: Likewise.
5122 * lib/timevar.c: Likewise.
5123 * lib/timevar.h: Likewise.
5124 * djgpp/subpipe.c: Use standard recipe for config.h.
5125 * lib/abitset.c: Likewise.
5126 * lib/bitset.c: Likewise.
5127 * lib/bitset_stats.c: Likewise.
5128 * lib/bitsetv-print.c: Likewise.
5129 * lib/bitsetv.c: Likewise.
5130 * lib/ebitsetv.c: Likewise.
5131 * lib/get-errno.c: Likewise.
5132 * lib/lbitset.c: Likewise.
5133 * lib/subpipe.c: Likewise.
5134 * lib/timevar.c: Likewise.
5135 * lib/vbitset.c: Likewise.
5136 * tests/local.at: Likewise.
5137 * src/scan-gram.l: Don't include verify.h, since system.h does
5138 that for us.
5139 * .x-sc_require_config_h: New file.
5140 * .x-sc_unmarked_diagnostics: New file.
5141
5142 2006-01-20 Paul Eggert <eggert@cs.ucla.edu>
5143
5144 Be a bit more systematic about using 'abort'.
5145 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
5146 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
5147 Put 'default: abort ();' before some other case, to satisfy older
5148 pedantic compilers.
5149 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5150 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
5151 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
5152 * src/conflicts.c (resolve_sr_conflict): Likewise.
5153 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
5154 (get_decision_str, get_orientation_str, get_node_alignment_str):
5155 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
5156 (get_linestyle_str, get_arrowstyle_str): Likewise.
5157 * src/conflicts.c (resolve_sr_conflict):
5158 Use a default case rather than one for the one remaining enum
5159 value, to catch invalid enum values as well.
5160 * src/lalr.c (set_goto_map, map_goto):
5161 Prefer "assert (FOO);" to "if (!FOO) abort ();".
5162 * src/nullable.c (nullable_compute, token_definitions_output):
5163 Likewise.
5164 * src/reader.c (packgram, reader): Likewise.
5165 * src/state.c (transitions_to, state_new, state_reduction_find):
5166 Likewise.
5167 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
5168 (symbol_pack): Likewise.
5169 * src/tables.c (conflict_row, pack_vector): Likewise.
5170 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
5171 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
5172 * src/system.h: Don't include <assert.h>.
5173 (assert): New macro.
5174
5175 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
5176 (Destructor Decl, Parser Function, Pure Calling):
5177 Describe rules for braces inside C code more carefully.
5178
5179 2006-01-19 Paul Eggert <eggert@cs.ucla.edu>
5180
5181 Fix some porting glitches found by Nelson H. F. Beebe.
5182 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
5183 compilers that don't understand that abort () does not return.
5184 * src/state.c (transitions_to): Likewise.
5185 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
5186 that '#include <cstdlib>' works.
5187 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
5188 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
5189 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
5190 for the benefit of some pre-C99 compilers.
5191
5192 * bootstrap: Undo changes to gnulib files that autoreconf made.
5193
5194 Minor fixups to get 'make maintainer-check' to work.
5195 * configure.ac: Don't use -Wnested-externs, as it's incompatible
5196 with the new verify.h implementation.
5197 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
5198 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
5199 * data/yacc.c (YYUSE): Likewise.
5200 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
5201 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
5202 * src/parse-gram.y (declaration): Don't pass a string constant
5203 to a function that expects char *, since GCC might complain
5204 about the constant value.
5205 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
5206 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
5207 before #defining them.
5208 * tests/glr-regression.at
5209 (Incorrectly initialized location for empty right-hand side in GLR):
5210 In yyerror, use the msg arg.
5211 (Corrupted semantic options if user action cuts parse):
5212 (Incorrect lookahead during deterministic GLR):
5213 (Incorrect lookahead during nondeterministic GLR):
5214 Don't name a local var 'index'; it shadows string.h's 'index'.
5215
5216 2006-01-19 Akim Demaille <akim@epita.fr>
5217
5218 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
5219 location, not just parts of it.
5220
5221 2006-01-18 Paul Eggert <eggert@cs.ucla.edu>
5222
5223 * NEWS: Document the fact that multiple %unions are now allowed.
5224 * doc/bison.texinfo (Union Decl): Likewise.
5225 * TODO: This feature is now implemented, so remove it from
5226 the wishlist.
5227
5228 * Makefile.maint: Merge with coreutils Makefile.maint.
5229 (CVS_LIST): Use build-aux version if available.
5230 (VERSION_REGEXP): New macro.
5231 (syntax-check-rules): Add sc_no_if_have_config_h,
5232 sc_prohibit_assert_without_use, sc_require_config_h,
5233 sc_useless_cpp_parens.
5234 (sc_obsolete_symbols): Check for O_NDELAY.
5235 (sc_dd_max_sym_length): Track coreutils.
5236 (sc_unmarked_diagnostics): Look in all files, not just *.c.
5237 (sc_useless_cpp_parens): New rule.
5238 (news-date-check): Look for version or today's date.
5239 (changelog-check): Don't require version number near head.
5240 (copyright-check): Use current year instead of hardwiring 2005.
5241 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
5242 (announcement): Add --gpg-key-ID.
5243
5244 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
5245 with "file system".
5246
5247 Avoid undefined behavior that addressed just before the start of an
5248 array. Problem reported by twlevo.
5249 * src/reader.c (packgram): Prepend a new sentinel before ritem.
5250 * src/lalr.c (build_relations): Rely on new sentinel.
5251 * src/gram.c (gram_free): Adjust to new sentinel.
5252
5253 2006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
5254
5255 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
5256 yylookaheadNeeds. All uses updated.
5257 (yysplitStack): Rename local yynewLookaheadStatuses to
5258 yynewLookaheadNeeds.
5259 * data/glr-regression.at (Incorrect lookahead during nondeterministic
5260 GLR): In comments, change `lookahead status' to `lookahead need'.
5261
5262 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5263
5264 * data/glr.c (yysplitStack): A little stylistic rewrite.
5265
5266 2006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5267
5268 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
5269
5270 2006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
5271
5272 * doc/bison.texinfo: Fix some typos.
5273 (GLR Semantic Actions): New subsection discussing special
5274 considerations because GLR semantic actions might be deferred.
5275 (Actions): Mention look-ahead usage of yylval.
5276 (Actions and Locations): Mention look-ahead usage of yylloc.
5277 (Special Features for Use in Actions): Add YYEOF entry and mention it
5278 in the yychar entry.
5279 In the yychar entry, remove mention of the local yychar case (pure
5280 parser) since this is irrelevant information when writing semantic
5281 actions and since it's already discussed in `Table of Symbols' where
5282 yychar is otherwise described as an external variable.
5283 In the yychar entry, don't call it the `current' look-ahead since it
5284 isn't when semantic actions are deferred.
5285 In the yychar and yyclearin entries, add note about deferred semantic
5286 actions.
5287 Add yylloc and yylval entries discussing look-ahead usage.
5288 (Look-Ahead Tokens): When discussing yychar, don't call it the
5289 `current' look-ahead, and do mention yylval and yylloc.
5290 (Error Recovery): Cross-reference `Action Features' when mentioning
5291 yyclearin.
5292 (Table of Symbols): In the yychar entry, don't call it the `current'
5293 look-ahead.
5294 In the yylloc and yylval entries, mention look-ahead usage.
5295
5296 2006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
5297
5298 * tests/glr-regression.at: Update copyright year to 2006.
5299
5300 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5301
5302 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
5303 use during nondeterministic operation to track which stacks have
5304 actually needed the current lookahead.
5305 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
5306 Allocate, deallocate, resize, and otherwise shuffle space for
5307 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
5308 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
5309 appropriately during nondeterministic operation.
5310 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
5311 members to store the current lookahead to be used by the deferred
5312 user action.
5313 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
5314 from which the RHS is taken. Set the lookahead members of the new
5315 yySemanticOption according to the lookahead status for stack yyk.
5316 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
5317 yyaddDeferredAction.
5318 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
5319 members of yySemanticOption before invoking yyuserAction, and then set
5320 them back to their current values afterward.
5321 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
5322 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
5323 * tests/glr-regression.at: Remove `.' from the ends of recent test case
5324 titles for consistency.
5325 (Leaked merged semantic value if user action cuts parse): In order to
5326 suppress lint warnings, use arguments in merge function, and assign
5327 char value < 128 in main.
5328 (Incorrect lookahead during deterministic GLR): New test case.
5329 (Incorrect lookahead during nondeterministic GLR): New test case.
5330
5331 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5332
5333 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
5334 !yyvaluep as signal that no semantic value is available to print.
5335 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
5336 to print a semantic value.
5337
5338 2006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5339
5340 * tests/glr-regression.at: For consistency with my newer test cases,
5341 don't thank myself.
5342
5343 2006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5344
5345 * data/glr.c (yyresolveValue): When merging semantic options, if at
5346 least one user action succeeds but a later one cuts the parse, then
5347 destroy the semantic value before returning rather than leaking it.
5348 (yyresolveStates): If a user action cuts the parse and thus
5349 yyresolveValue fails, ignore the (unset) semantic value rather than
5350 corrupting the yyGLRState, and empty the semantic options list since
5351 the user actions should have called all necessary destructors.
5352 Simplify code with YYCHK.
5353 * tests/glr-regression.at (Corrupted semantic options if user action
5354 cuts parse): New test case.
5355 (Undesirable destructors if user action cuts parse): New test case.
5356 Before applying any of this patch, this test case never actually failed
5357 for me... but only because the corrupted semantic options usually
5358 masked this bug.
5359 (Leaked merged semantic value if user action cuts parse): New test
5360 case.
5361
5362 2006-01-05 Akim Demaille <akim@epita.fr>
5363
5364 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
5365
5366 2006-01-04 Paul Eggert <eggert@cs.ucla.edu>
5367
5368 * data/c.m4 (b4_c_modern): New macro, with a new provision for
5369 _MSC_VER. Problem reported by Cenzato Marco.
5370 (b4_c_function_def): Use it.
5371 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
5372 b4_c_modern.
5373 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
5374 than rolling our own.
5375
5376 2006-01-04 Akim Demaille <akim@epita.fr>
5377
5378 Also warn about non-used mid-rule values.
5379 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
5380 member.
5381 (symbol_list_new): Adjust.
5382 * src/reader.c (symbol_typed_p): New.
5383 (grammar_rule_check): Use it.
5384 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
5385 Check its rule.
5386 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
5387 Use it.
5388 * tests/actions.at (Exotic Dollars): Adjust.
5389
5390 2006-01-04 Akim Demaille <akim@epita.fr>
5391
5392 * src/reader.c (grammar_midrule_action): If $$ is set in a
5393 mid-rule, move the `used' bit to its lhs.
5394 * tests/input.at (Unused values): New.
5395 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
5396
5397 2006-01-03 Paul Eggert <eggert@cs.ucla.edu>
5398
5399 * doc/bison.texinfo (Bison Options): Say more accurately what
5400 --yacc does.
5401 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
5402 about declarations in the grammar when in Yacc mode, as POSIX does
5403 not require a diagnostic when the grammar uses extensions.
5404
5405 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
5406
5407 Warn about dubious constructions like "%token T T".
5408 Reported by twlevo.
5409 * src/symtab.h (struct symbol.declared): New member.
5410 * src/symtab.c (symbol_new): Initialize it to false.
5411 (symbol_class_set): New arg DECLARING, specifying whether
5412 this is a declaration that we want to warn about, if there
5413 is more than one of them. All uses changed.
5414
5415 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
5416 Allow multiple %union directives, whose contents concatenate.
5417 * src/parse-gram.y (grammar_declaration): Likewise.
5418 Use muscle_code_grow, so that we don't need stype_line any more.
5419 All uses changed.
5420
5421 * src/muscle_tab.c (muscle_grow): Fix comment.
5422
5423 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
5424 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
5425 Update copyright year to 2006.
5426
5427 2006-01-03 Akim Demaille <akim@epita.fr>
5428
5429 Have glr.cc pass (some of) the calc.at tests.
5430 * data/glr.cc (b4_parse_param_orig): New.
5431 (b4_parse_param): Improve its definition, and bound it more
5432 clearly in the skeleton.
5433 (b4_epilogue): Append, instead of prepending, in order to keep
5434 #line consistency.
5435 Simplify the generation of auxiliary functions: locations and
5436 purity are mandated.
5437 (b4_global_tokens_and_yystype): Honor it.
5438 * data/location.cc (c++.m4): Don't include it.
5439 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
5440 and AT_SKEL_CC_IF.
5441 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
5442 AT_LALR1_CC_IF.
5443 Be sure to initialize the first position's filename.
5444 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
5445 mandated anyway.
5446 (AT_CHECK_CALC_GLR_CC): New.
5447 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
5448
5449 2006-01-02 Akim Demaille <akim@epita.fr>
5450
5451 * src/output.c (output_skeleton): Don't hard wire the inclusion of
5452 c.m4.
5453 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
5454 * data/glr.cc: Do not include stack.hh.
5455
5456 2006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5457
5458 * data/glr.c: Reformat whitespace with tabs.
5459 (b4_lpure_formals): Remove this unused m4 macro.
5460 * tests/cxx-type.at: Reformat whitespace with tabs.
5461 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
5462 since it's a member. Rename type to isNterm for clarity.
5463
5464 2005-12-29 Akim <akim@sulaco.local>
5465
5466 Let glr.cc catch up with symbol_value_print.
5467 * data/glr.cc (b4_yysymprint_generate): Replace by...
5468 (b4_yy_symbol_print_generate): this.
5469 (yy_symbol_print, yy_symbol_value_print): Declare them.
5470
5471 2005-12-28 Paul Eggert <eggert@cs.ucla.edu>
5472
5473 * src/location.h (boundary): Note that a line or column equal
5474 to INT_MAX indicates an overflow.
5475 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
5476 (rule_length_overflow, increment_rule_length, add_column_width):
5477 New functions.
5478 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
5479 (<SC_BRACED_CODE>"}"):
5480 Use increment_rule_length rather than incrementing it by hand.
5481 (adjust_location, handle_syncline): Diagnose overflow.
5482 (handle_action_dollar, handle_action_at):
5483 Fix bug with monstrosities like $-2147483648.
5484 Remove now-unnecessary checks.
5485 (scan_integer): Verify assumptions and remove now-unnecessary checks.
5486 (convert_ucn_to_byte): Verify assumptions.
5487 (handle_syncline): New arg LOC. All callers changed.
5488 Don't store through a value derived from char const * pointer.
5489
5490 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
5491 GCC warnings.
5492
5493 2005-12-27 Paul Eggert <eggert@cs.ucla.edu>
5494
5495 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
5496 Remove unnecessary forward static decls.
5497
5498 2005-12-27 Akim Demaille <akim@epita.fr>
5499
5500 * src/reader.c (grammar_current_rule_check): Also check that $$
5501 is used.
5502 Take the rule to check as argument, hence rename as...
5503 (grammar_rule_check): this.
5504 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
5505 Rename as...
5506 (grammar_rule_begin, grammar_rule_end): these, for consistency.
5507 (grammar_midrule_action, grammar_symbol_append): Now static.
5508 * tests/torture.at (input): Don't rely on the default action
5509 being always performed.
5510 * tests/calc.at: "Set" $$ even when the action is "cut" with
5511 YYERROR or other.
5512 * tests/actions.at (Exotic Dollars): Instead of using unused
5513 values, check that the warning is issued.
5514
5515 2005-12-22 Paul Eggert <eggert@cs.ucla.edu>
5516
5517 * NEWS: Improve wording for unused-value warnings.
5518
5519 2005-12-22 Akim Demaille <akim@epita.fr>
5520
5521 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
5522 (b4_yysymprint_generate): Rename as...
5523 (b4_yy_symbol_print_generate): this.
5524 Generate yy_symbol_print instead of yysymprint.
5525 Generate also yy_symbol_value_print, and use it.
5526
5527 2005-12-22 Akim Demaille <akim@epita.fr>
5528
5529 * NEWS: Warn about unused values.
5530 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
5531 a `used' member.
5532 (symbol_list_n_get, symbol_list_n_used_set): New.
5533 (symbol_list_n_type_name_get): Use symbol_list_n_get.
5534 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
5535 * src/reader.c (grammar_current_rule_check): Check that values are
5536 used.
5537 * src/symtab.c (symbol_print): Accept 0.
5538 * tests/existing.at: Remove the type information.
5539 Empty the actions.
5540 Remove useless actions (beware of mid-rule actions: perl -000
5541 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
5542 * tests/actions.at (Exotic Dollars): Use unused values.
5543 * tests/calc.at: Likewise.
5544 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5545 Likewise.
5546
5547 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
5548 rule_useful_p.
5549
5550 2005-12-21 Paul Eggert <eggert@cs.ucla.edu>
5551
5552 Undo 2005-12-01 tentative license wording change. The wording is
5553 still being reviewed by the lawyers, and we don't want to wait for
5554 them before publishing a test release. For now, revert to the
5555 previous wording.
5556 * NEWS: Undo 2005-12-01 change.
5557 * data/glr.c: Revert to previous license wording.
5558 * data/glr.cc: Likewise.
5559 * data/lalr1.cc: Likewise.
5560 * data/location.cc: Likewise.
5561 * data/yacc.c: Likewise.
5562
5563 * NEWS: Reword %destructor vs YYABORT etc.
5564 * data/glr.c: Use American spacing, for consistency.
5565 * data/glr.cc: Likewise.
5566 * data/lalr1.cc: Likewise.
5567 * data/yacc.c: Likewise.
5568 * data/yacc.c: Reformat comments slightly.
5569 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
5570 for consistency. Fix some spelling errors and reword recently-included
5571 text slightly.
5572 * tests/cxx-type.at: Cast results of malloc, for C++.
5573
5574 2005-12-21 Joel E. Denny <address@hidden>
5575
5576 * tests/cxx-type.at: Construct a tree, count the parents of shared
5577 nodes, and free each node once and only once. Previously, the memory
5578 for semantic values was leaked instead.
5579
5580 2005-12-21 Joel E. Denny <address@hidden>
5581
5582 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
5583 (yylval, yylloc): If pure, #define to yystackp->yyval and
5584 yystackp->yyloc similar to yychar and yynerrs.
5585 (yyparse): If pure, remove local yylval and yylloc. Add local
5586 yystackp to accommodate pure definitions of yylval and yylloc.
5587 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
5588 yylvalp and yyllocp to &yylval and &yylloc.
5589 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
5590 namespace. Previously, nerrs and char were missing, but lval and lloc
5591 weren't necessary.
5592 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
5593 yylvalp and yyllocp parameters since, if pure, these are now always
5594 accessible through yystackp. If not pure, they are still accessible
5595 globally.
5596 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
5597 `if (YYID (N))' to pacify lint.
5598
5599 2005-12-21 Akim Demaille <akim@epita.fr>
5600
5601 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
5602 destroy the RHS symbols of a rule.
5603 * data/yacc.c (yylen): Initialize to 0.
5604 Keep its value to the number of items to possibly shift.
5605 In particular, a regular successful parse that ends on YYFINAL by
5606 a (internal) YYACCEPT must not have yylen != 0.
5607 (yyerrorlab, yyreturn): Pop the RHS.
5608 Reorder a bit to emphasize the `shifting' bits of code.
5609 (YYPOPSTACK): Now accept a number of items to pop.
5610 * data/lalr1.cc: Likewise.
5611 * data/glr.c: Formatting changes.
5612 Use goto instead of fall through.
5613 * doc/bison.texinfo (Destructor Decl): Complete.
5614
5615 2005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5616
5617 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5618 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
5619 * djgpp/config.bat: Replace every occurence of the file name
5620 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5621 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5622 * djgpp/config.sed: Replace every occurence of the file name
5623 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5624 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5625 * djgpp/djunpack.bat: DJGPP specific file.
5626 * djgpp/fnchange.lst: DJGPP specific file.
5627 * djgpp/README.in: Add new information about how to unpack the bison
5628 source on MSDOS and other systems which have 8.3 file name restrictions
5629 using djunpack.bat and fnchange.lst.
5630
5631 2005-12-12 Paul Eggert <eggert@cs.ucla.edu>
5632
5633 * bootstrap (build_cvs_prefix): Remove; unused.
5634 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
5635 when getting gnulib.
5636
5637 2005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
5638
5639 * data/glr.c: Reorder typedef declarations for structs to match order
5640 of struct declarations.
5641 Rename yystack everywhere to yystackp except in yyparse where it's not
5642 a pointer.
5643 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
5644 consistency.
5645 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
5646 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
5647 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
5648 lint.
5649
5650 2005-12-09 Paul Eggert <eggert@cs.ucla.edu>
5651
5652 * tests/sets.at (Accept): Fix typos in regular expression used to
5653 sed out the final state number.
5654
5655 Work around portability problem on Solaris 10: flex-generated
5656 files include <stdio.h> before <config.h>, which messes up
5657 because the latter defines __EXTENSIONS__. Address the problem
5658 by creating two new little files that include <config.h> first,
5659 then include the flex-generated files. Rewrite everyone else
5660 to include <config.h> first, as well.
5661 * lib/timevar.c: Always include "config.h".
5662 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
5663 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
5664 (EXTRA_bison_SOURCES): New macro.
5665 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
5666 * src/system.h: Don't include config.h.
5667 * src/LR0.c: Include <config.h> first.
5668 * src/assoc.c: Likewise.
5669 * src/closure.c: Likewise.
5670 * src/complain.c: Likewise.
5671 * src/conflicts.c: Likewise.
5672 * src/derives.c: Likewise.
5673 * src/files.c: Likewise.
5674 * src/getargs.c: Likewise.
5675 * src/gram.c: Likewise.
5676 * src/lalr.c: Likewise.
5677 * src/location.c: Likewise.
5678 * src/main.c: Likewise.
5679 * src/muscle_tab.c: Likewise.
5680 * src/nullable.c: Likewise.
5681 * src/output.c: Likewise.
5682 * src/parse-gram.y: Likewise.
5683 * src/print.c: Likewise.
5684 * src/print_graph.c: Likewise.
5685 * src/reader.c: Likewise.
5686 * src/reduce.c: Likewise.
5687 * src/relation.c: Likewise.
5688 * src/state.c: Likewise.
5689 * src/symlist.c: Likewise.
5690 * src/symtab.c: Likewise.
5691 * src/tables.c: Likewise.
5692 * src/uniqstr.c: Likewise.
5693 * src/vcg.c: Likewise.
5694
5695 * src/parse-gram.y: Fix minor problems uncovered by lint.
5696 (current_lhs, current_lhs_location): Now static.
5697 (current_assoc): Remove unused variable.
5698
5699 Cleanups so that Bison-generated parsers have less lint.
5700 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
5701 Prepend /*ARGSUSED*/, for lint's sake.
5702 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
5703 definition if 'lint' is defined.
5704 (YYID): New macro (or function, if lint).
5705 All uses of /*CONSTCOND*/0 replaced by YYID(0).
5706 * data/yacc.c: Likewise.
5707 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
5708 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
5709 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
5710 is C++ only.
5711 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
5712 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
5713 Use YYID(0) rather than 0, for lint.
5714 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
5715 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
5716
5717 2005-12-07 Paul Eggert <eggert@cs.ucla.edu>
5718
5719 * tests/glr-regression.at
5720 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5721 Close memory leak reported by twlevo.
5722
5723 2005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
5724
5725 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
5726 all stacks.
5727 (yyparse): Iterate another stack in order to call user destructors.
5728 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5729 New test case.
5730 (Duplicated user destructor for lookahead): This test now is expected
5731 to succeed.
5732
5733 2005-12-01 Paul Eggert <eggert@cs.ucla.edu>
5734
5735 * NEWS: Document the following change.
5736 * data/yacc.c: Say "parser skeleton" rather than "file", since
5737 it's no longer just a file.
5738 * data/glr.c: Grant a special exception for C GLR parsers, that
5739 reads like the already-existing exception for C LALR(1) parsers.
5740 * data/glr.cc: Likewise.
5741 * data/lalr1.cc: Likewise.
5742 * data/location.cc: Likewise.
5743 * data/yacc.c: Reword the "written by" statement to clarify that
5744 it was the parser skeleton, not the entire output file.
5745 * data/glr.c: Written by Paul Hilfinger.
5746 * data/glr.cc: Written by Akim Demaille.
5747 * data/lalr1.cc: Likewise.
5748
5749 2005-11-18 Paul Eggert <eggert@cs.ucla.edu>
5750
5751 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
5752 Fix typos in previous change that broke 'make check'.
5753 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
5754 supported in C.
5755 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
5756 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
5757 We can revert this once things settle down.
5758
5759 * src/conflicts.c (conflicts_print): Don't print file name twice
5760 when %expect fails because there were no conflicts.
5761 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
5762 change.
5763 * tests/conflicts.at (%expect not enough, %expect too much):
5764 (%expect with reduce conflicts): Adjust to new behavior.
5765
5766 2005-11-18 Akim Demaille <akim@epita.fr>
5767
5768 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
5769 errors.
5770 * NEWS: Document this.
5771 * doc/bison.texinfo (Expect Decl): Likewise.
5772
5773 2005-11-16 Akim Demaille <akim@epita.fr>
5774
5775 Generalize the display of semantic values and locations in traces.
5776 * data/glr.c (yy_reduce_print): Fix indices (again).
5777 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
5778 literal integers.
5779 * data/lalr1.cc (yyreduce_print): Rename as...
5780 (yy_reduce_print): this.
5781 Display values and locations.
5782 * data/yacc.c (yy_reduce_print): Likewise.
5783 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
5784 (yysymprint): Move higher to be visible from yy_reduce_print).
5785 (yyparse): Adjust.
5786 * tests/calc.at: Adjust the expected length of the traces.
5787
5788 2005-11-14 Akim Demaille <akim@epita.fr>
5789
5790 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
5791 from 1 to N, while values and location start at 0.
5792 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
5793
5794 2005-11-14 Akim Demaille <akim@epita.fr>
5795
5796 * data/glr.c (yy_reduce_print): Fix the $ number.
5797
5798 2005-11-14 Akim Demaille <akim@epita.fr>
5799
5800 "Use" parse parameters.
5801 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
5802 * data/glr.c, data/glr.cc: Use them.
5803 * data/glr.c (YYUSE): Have a C++ definition that supports
5804 non-pointer types.
5805
5806 2005-11-14 Akim Demaille <akim@epita.fr>
5807
5808 * data/glr.c (yyexpandGLRStack): Declare only if defined.
5809
5810 2005-11-14 Akim Demaille <akim@epita.fr>
5811
5812 * data/glr.cc: New.
5813 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5814
5815 2005-11-12 Akim Demaille <akim@epita.fr>
5816
5817 Let position and location be PODs.
5818 * data/location.cc (position::initialize, location::initialize): New.
5819 (position::position, location::location): Define only if
5820 b4_location_constructors is defined.
5821 * data/lalr1.cc (b4_location_constructors): Define it for backward
5822 compatibility.
5823 * doc/bison.texinfo (Initial Action Decl): Use initialize.
5824
5825 2005-11-12 Akim Demaille <akim@epita.fr>
5826
5827 * data/lalr1.cc: Move the body of the ctor and dtor into the
5828 parser file (instead of the header).
5829 Wrap the implementations in a "namespace yy".
5830
5831 2005-11-12 Akim Demaille <akim@epita.fr>
5832
5833 Have glr.c include its header file when created.
5834 * data/glr.c (b4_shared_declarations): New.
5835 Output them verbatim in the parser if !%defines, otherwise
5836 output then in the header file, and include it instead.
5837
5838 2005-11-11 Akim Demaille <akim@epita.fr>
5839
5840 * data/glr.c: Comment changes.
5841
5842 2005-11-11 Akim Demaille <akim@epita.fr>
5843
5844 When yydebug, report semantic and location values for reductions.
5845 * data/glr.c (yy_reduce_print): Report the semantic values and the
5846 locations.
5847 (YY_REDUCE_PRINT): Adjust.
5848 (yyglrReduce): Use them.
5849 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
5850 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
5851 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
5852 traces.
5853
5854 2005-11-10 Akim Demaille <akim@epita.fr>
5855
5856 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
5857 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
5858 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
5859
5860 2005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
5861
5862 * m4/cxx.m4, examples/Makefile.am: Don't build
5863 examples/calc++ if no C++ compiler is available. (trivial change)
5864
5865 2005-11-09 Akim Demaille <akim@epita.fr>
5866
5867 * src/scan-skel.l: Use a couple of asserts.
5868
5869 2005-11-03 Akim Demaille <akim@epita.fr>
5870
5871 In some (weird) cases, the final state number is incorrect.
5872 Reported by Alexandre Duret-Lutz.
5873 * src/LR0.c (state_list_append): Remove the computation of
5874 final_state.
5875 (save_reductions): Do it here.
5876 (get_state): Alpha conversion.
5877 (generate_states): Use a for loop.
5878 * src/gram.h (item_number_is_rule_number)
5879 (item_number_is_symbol_number): New.
5880 * src/state.c: Use assert.
5881 * src/system.h: Include assert.h.
5882 * tests/sets.at (Accept): New.
5883
5884 2005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5885
5886 * data/glr.c (yyfill): Adjust comment.
5887 (yyresolveAction): Initialize default location properly
5888 for empty right-hand sides.
5889 (yydoAction): Ditto.
5890 Add comment explaining apparently dead code.
5891 * tests/glr-regression.at
5892 (Incorrectly initialized location for empty right-hand side in GLR):
5893 New test.
5894
5895 2005-10-30 Paul Eggert <eggert@cs.ucla.edu>
5896
5897 * bootstrap (cleanup_gnulib): New function. Use it to clean up
5898 gnulib when interrupted. This fixes some race conditions and
5899 works around some portability problems (one noted by Paul
5900 Hilfinger).
5901
5902 2005-10-22 Akim <akim@epita.fr>
5903
5904 * Makefile.cfg: Adjust to config -> build-aux.
5905 Reported by twledo.
5906
5907 2005-10-21 Akim Demaille <akim@epita.fr>
5908
5909 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
5910 the %parse-params.
5911 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
5912 * data/yacc.c (b4_Pure_if): Rename as...
5913 (b4_yacc_pure_if): this.
5914 (YY_SYMBOL_PRINT, yyparse): Adjust.
5915 * doc/bison.texinfo: Formatting changes.
5916
5917 2005-10-21 Akim Demaille <akim@epita.fr>
5918
5919 Finish the transition config -> build-aux.
5920 * configure.ac, Makefile.am: Use build-aux.
5921 * config/prev-version, config/announce-gen, config/Makefile.am:
5922 Move to...
5923 * build-aux/prev-version, build-aux/announce-gen,
5924 * build-aux/Makefile.am: here.
5925
5926 2005-10-14 Akim Demaille <akim@epita.fr>
5927
5928 * examples/calc++/test: Use set -x only when VERBOSE.
5929
5930 2005-10-13 Paul Eggert <eggert@cs.ucla.edu>
5931
5932 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
5933 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
5934
5935 2005-10-13 Akim Demaille <akim@epita.fr>
5936
5937 * src/scan-skel.l: Output the base name parts of the parser and
5938 header file names.
5939 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
5940 additional checks.
5941 Use this to exercise C++ outputs in subdirs.
5942 Reported by Oleg Smolsky.
5943
5944 2005-10-12 Paul Eggert <eggert@cs.ucla.edu>
5945
5946 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
5947 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
5948 Problem reported by John P. Hartmann.
5949 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
5950 already defined it.
5951
5952 2005-10-12 Akim Demaille <akim@epita.fr>
5953
5954 * src/parse-gram.y (version_check): Exit 63 to please missing
5955 (stands for "version mismatch).
5956 * tests/input.at, doc/bison.texinfo: Adjust.
5957
5958 2005-10-10 Paul Eggert <eggert@cs.ucla.edu>
5959
5960 Work around portability problems with Visual Age C compiler
5961 (xlc and xlC_r) reported by John P. Hartmann.
5962 * data/location.cc (initial_column, initial_line): Remove.
5963 All uses replaced by 0 and 1.
5964 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
5965 that xlc complains about.
5966 * src/scan-skel.l (skel_wrap): Likewise.
5967 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
5968 as __STDC__.
5969 * data/yacc.c (YYMODERN_C): New macro, which also looks at
5970 __STDC_VERSION__. Use it everywhere instead of looking at
5971 __STDC__ and __cplusplus.
5972
5973 2005-10-10 Akim Demaille <akim@epita.fr>
5974
5975 * examples/calc++/test: Be quiet unless VERBOSE.
5976
5977 2005-10-05 Paul Eggert <eggert@cs.ucla.edu>
5978
5979 * data/c.m4 (yydestruct, yysymprint):
5980 Use YYUSE instead of casting to void.
5981 * data/glr.c (YYUSE): New macro.
5982 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5983 Use it instead of rolling our own.
5984 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5985 (YYCHK1):
5986 Use /*CONSTCOND*/ to suppress lint warnings.
5987 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5988 (YY_STACK_PRINT): Use 'false' not '0'.
5989 (YYUSE): New macro.
5990 (yysymprint_, yydestruct_): Use it instead of rolling our own.
5991 * data/yacc.c (YYUSE): New macro.
5992 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
5993 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
5994 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
5995
5996
5997 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
5998 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
5999
6000 2005-10-04 Paul Eggert <eggert@cs.ucla.edu>
6001
6002 Undo the parts of the unlocked-I/O change that substituted
6003 putc or puts for printf. This might hurt performance a bit,
6004 but some people prefer the printf style.
6005 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
6006 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
6007 All uses replaced by YYFPRINTF and YYDPRINTF.
6008 * data/yacc.c: Likewise.
6009 * lib/bitset.c (bitset_print): Likewise.
6010 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
6011 putc and puts.
6012 * lib/lbitset.c (debug_lbitset): Likewise.
6013 * src/closure.c (print_firsts, print_fderives): Likewise.
6014 * src/gram.c (grammar_dump): Likewise.
6015 * src/lalr.c (look_ahead_tokens_print): Likewise.
6016 * src/output.c (escaped_output): Likewise.
6017 (user_actions_output): Break apart two printfs.
6018 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
6019 * src/reduce.c (reduce_print): Likewise.
6020 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
6021 * src/system.h: Include unlocked-io.h rathe than stdio.h.
6022
6023 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
6024 Use assignments rather than casts-to-void to suppress
6025 unused-variable warnings. This pacifies 'lint'.
6026 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
6027 unused-variable warnings.
6028
6029 2005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6030
6031 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
6032
6033 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>
6034
6035 Use unlocked I/O for a minor performance improvement on hosts like
6036 GNU/Linux and Solaris that support unlocked I/O. The basic idea
6037 is to use the gnlib unlocked-io module, and to prefer putc and
6038 puts to printf when either will work (since the latter doesn't
6039 come in an unlocked flavor).
6040 * bootstrap (gnulib_modules): Add unlocked-io.
6041 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
6042 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
6043 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
6044 and similarly for puts and putc and printf.
6045 * data/yacc.c: Likewise.
6046 * lib/bitset.c (bitset_print): Likewise.
6047 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
6048 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
6049 to printf.
6050 * lib/lbitset.c (debug_lbitset): Likewise.
6051 * src/closure.c (print_firsts, print_fderives): Likewise.
6052 * src/gram.c (grammar_dump): Likewise.
6053 * src/lalr.c (look_ahead_tokens_print): Likewise.
6054 * src/output.c (escaped_output): Likewise.
6055 (user_actions_output): Coalesce two printfs.
6056 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
6057 * src/reduce.c (reduce_print): Likewise.
6058 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
6059 * src/system.h: Include unlocked-io.h rather than stdio.h.
6060
6061 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
6062 this confuses xgettext.
6063
6064 2005-10-02 Akim Demaille <akim@epita.fr>
6065
6066 * bootstrap (gnulib_modules): Add strverscmp.
6067 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
6068 * m4/.cvsignore: Add strverscmp.m4.
6069 * src/parse-gram.y (%require): New token, new rule.
6070 (version_check): New.
6071 * src/scan-gram.l (%require): Adjust.
6072 * tests/input.at (AT_REQUIRE): New.
6073 Use it.
6074 * doc/bison.texinfo (Require Decl): New.
6075 (Calc++ Parser): Use %require.
6076
6077 2005-10-02 Akim Demaille <akim@epita.fr>
6078
6079 * data/location.cc: New.
6080
6081 2005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
6082 Akim Demaille <akim@epita.fr>
6083
6084 Make sure -odir/foo.cc creates dir/location.hh etc.
6085 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
6086 (spec_file_prefix, spec_verbose_file, spec_graph_file)
6087 (spec_defines_file): Now const.
6088 (dir_prefix): New.
6089 (short_base_name): Remove.
6090 * src/files.c: Adjust.
6091 (dirname.h): Include.
6092 (base_name): Don't prototype it.
6093 (finput): Remove, duplicates gram_in.
6094 (full_base_name, short_base_name): Replace by...
6095 (all_but_ext, all_but_tab_ext): these.
6096 (compute_base_names): Rename as...
6097 (compute_file_name_parts): this.
6098 Update to compute the new variables, including dir_prefix.
6099 Adjust dependencies.
6100 * src/output.c (prepare): Output them.
6101 * src/reader.c: Adjust to use gram_in, not finput.
6102 * src/scan-skel.l (@dir_prefix@): New.
6103
6104 2005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6105
6106 * lib/subpipe.c: New function end_of_output_subpipe() added
6107 to allow support for non-posix systems. This is a no-op function
6108 for posix systems.
6109
6110 * lib/subpipe.h: New function end_of_output_subpipe() added
6111 to allow support for non-posix systems. This is a no-op function
6112 for posix systems.
6113
6114 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
6115 handle the lack of pipe/fork functionality on non-posix systems.
6116
6117 * djgpp/Makefile.maint: DJGPP specific file.
6118
6119 * djgpp/README.in: DJGPP specific file.
6120
6121 * djgpp/config.bat: DJGPP specific configuration file.
6122
6123 * djgpp/config.sed: DJGPP specific configuration file.
6124
6125 * djgpp/config.site: DJGPP specific configuration file.
6126
6127 * djgpp/config_h.sed: DJGPP specific configuration file.
6128
6129 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
6130
6131 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
6132
6133 2005-10-02 Akim Demaille <akim@epita.fr>
6134
6135 * data/location.cc: New, extract from...
6136 * data/lalr1.cc: here.
6137 (location.hh): Include it after the user prologue, in case the
6138 filename type is defined by the user.
6139 Forward declation location and position before the pre-prologue.
6140 (yyresult_): Rename as...
6141 (yyresult): this, it's a local variable, not an attribute.
6142 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
6143
6144 2005-10-01 Akim Demaille <akim@epita.fr>
6145
6146 * examples/extexi: Restore the #line generation.
6147
6148 2005-09-30 Akim Demaille <akim@epita.fr>,
6149 Alexandre Duret-Lutz <adl@gnu.org>
6150
6151 Move the token type and YYSTYPE in the parser class.
6152 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
6153 (parser::token): New, from the moved free definition of tokens.
6154 (parser::semantic_value): Now a full definition instead of an
6155 indirection to YYSTYPE.
6156 (b4_post_prologue): No longer included in the header file, but
6157 in the implementation file.
6158 * doc/bison.texi (C+ Language Interface): Update.
6159 * src/parse-gram.y: Support unary %define.
6160 * tests/actions.at: Define global_tokens_and_yystype for backward
6161 compatibility until we update the tests.
6162 * tests/calc.at: Idem.
6163 (first_line, first_column, last_line, last_column): Define for lalr1.cc
6164 to simplify the code.
6165
6166 2005-09-29 Paul Eggert <eggert@cs.ucla.edu>
6167
6168 Port to SunOS 4.1.4, which lacks strtoul and strerror.
6169 Ah, the good old days! Problem reported by Peter Klein.
6170 * bootstrap (gnulib_modules): Add strerror, strtoul.
6171 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
6172 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
6173
6174 2005-09-29 Akim Demaille <akim@epita.fr>
6175
6176 * data/c.m4 (b4_error_verbose_if): New.
6177 * data/lalr1.cc: Use it.
6178 (YYERROR_VERBOSE_IF): Remove.
6179 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
6180 parser members, replaced by...
6181 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
6182 local variables.
6183 (yysyntax_error_): Takes the state number as argument.
6184 (yyreduce_print_): Use the argument yyrule, not the former
6185 attribute yyn_.
6186
6187 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
6188
6189 * bootstrap (gnulib_modules): Add verify.
6190 * lib/.cvsignore: Add verify.h.
6191 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
6192 * src/system.h (verify): Remove.
6193 Include verify.h instead.
6194 * src/tables.c (tables_generate): Use new API for 'verify'.
6195
6196 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
6197
6198 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
6199 local variables whose names begin with 'yy'.
6200 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
6201 Trivial changes from Joel E. Denny.
6202
6203 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
6204 it itself.
6205 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
6206 don't use alloca any more.
6207
6208 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
6209 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
6210 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
6211 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
6212 to match yacc.c, to test more hosts.
6213
6214 2005-09-20 Paul Eggert <eggert@cs.ucla.edu>
6215
6216 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
6217 doesn't affect behavior.
6218 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
6219 Solaris, AIX, MSC.
6220 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
6221 This works a bit better with glibc, if user code has already included
6222 stdlib.h.
6223 * doc/bison.texinfo (Bison Parser): Document that users can't
6224 arbitrarily use malloc and free for other purposes. Document
6225 that <alloca.h> and <malloc.h> might be included.
6226 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
6227 user must declare alloca.
6228
6229 * HACKING (release): Forwarn the Translation Project about
6230 stable releses.
6231
6232 2005-09-20 Akim Demaille <akim@epita.fr>
6233
6234 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
6235
6236 2005-09-19 Paul Eggert <eggert@cs.ucla.edu>
6237
6238 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
6239 (YYSTACK_ALLOC_MAXIMUM): Use it.
6240 (yysyntax_error): New function.
6241 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
6242 multiple syntax errors are reported, and alloca is being used.
6243 Instead, reallocate buffers twice as big each time, so that
6244 we waste at most half the allocated memory. Start with a small
6245 (128-byte) buffer that will suffice in most cases anyway.
6246 Use yysyntax_error to do most of the work.
6247
6248 * doc/bison.texinfo (Error Reporting, Table of Symbols):
6249 yynerrs is the number of errors reported, not the number of
6250 errors encountered.
6251
6252 * tests/glr-regression.at (Duplicated user destructor for lookahead):
6253 Mark it as expected to fail.
6254 Cast result of malloc; problem reported by twlevo@xs4all.nl.
6255 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
6256 Don't start user-code symbols with "yy", to avoid name space problems.
6257
6258 2005-09-19 Akim Demaille <akim@epita.fr>
6259
6260 Remove the traits, failed experiment.
6261 It never proved useful, and anyway because of the current
6262 definition, it was not possible to have several specialization of
6263 this traits, making it useless.
6264 * data/lalr1.cc (yy:traits): Remove.
6265 Inline its definitions in the parser class.
6266
6267 2005-09-19 Akim Demaille <akim@epita.fr>
6268
6269 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
6270 least Mac OSX with a /usr/local install of gettext.
6271
6272 2005-09-19 Akim Demaille <akim@epita.fr>
6273
6274 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
6275 and yytoken for similarity with the other skeletons.
6276
6277 2005-09-19 Akim Demaille <akim@epita.fr>
6278
6279 * NEWS, configure.ac: update version number to 2.1a.
6280
6281 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
6282
6283 * NEWS: Version 2.1.
6284
6285 * NEWS: Remove notice of yytname change, since it was never in an
6286 official release.
6287 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
6288 diagnostic.
6289 * src/output.c (prepare): Likewise.
6290 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
6291 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
6292 is not defined. This is an awful hack, but it's enough for now.
6293 All callers changed.
6294 * tests/glr-regression-at (make_value): Args are const pointers now,
6295 to avoid GCC warning.
6296 (Duplicated user destructor for lookahead): New test. Currently
6297 skipped. It fails on my host but I'm not sure it'll always fail.
6298
6299 2005-09-16 Akim Demaille <akim@epita.fr>
6300
6301 * src/symtab.h (struct symbol): Declare the printer and destructor
6302 as const, to avoid accidental calls to free.
6303 (symbol_destructor_set, symbol_printer_set): Adjust.
6304 * src/symtab.c: Adjust.
6305
6306 2005-09-16 Akim Demaille <akim@epita.fr>
6307
6308 * data/c.m4 (b4_token_enums): New.
6309 (b4_token_defines): Rename as...
6310 (b4_token_enums_defines): this.
6311 (b4_token_defines): New, output only the #defines.
6312 * data/yacc.c, data/glr.c: Adjust.
6313 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
6314 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
6315 as default values.
6316
6317 2005-09-16 Akim Demaille <akim@epita.fr>
6318
6319 * data/lalr1.cc (yylex_): Remove, inline its code.
6320 (yyreport_syntax_error_): Remove, replaced by...
6321 (yysyntax_error_): this which returns a string and leaves to the
6322 caller the call to the users' error function.
6323 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
6324 Move from members of the parser object...
6325 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
6326 to local variables of the parse function.
6327
6328 2005-09-16 Akim Demaille <akim@epita.fr>
6329
6330 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
6331 since it's in Bison's name space.
6332
6333 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
6334
6335 * data/glr.c (yyresolveValue): Add default case to pacify
6336 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
6337
6338 * NEWS: Document when yyparse started to return 2.
6339 * doc/bison.texinfo (Parser Function): Document when yyparse
6340 returns 2.
6341
6342 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
6343 (b4_filename_type): Renamed back from b4_file_name_type. All uses
6344 changed.
6345 (class position): file_name -> filename (reverting). All uses changed.
6346
6347 2005-09-14 Paul Eggert <eggert@cs.ucla.edu>
6348
6349 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
6350 do anything if $@ exists. This reverts part of the 2005-07-07
6351 patch.
6352
6353 2005-09-11 Paul Eggert <eggert@cs.ucla.edu>
6354
6355 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
6356 contains obsolete information and isn't worth distributing as a
6357 separate file anyway.
6358 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
6359 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
6360 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
6361 (yyparse): Abort if user code uses longjmp to throw an unexpected
6362 value.
6363
6364 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
6365
6366 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
6367 Suggested by twlevo@xs4all.nl.
6368
6369 * data/glr.c (YYCHK1): Do not assume YYE is in range.
6370 This avoids a diagnostic from gcc -Wswitch-enum.
6371 Problem reported by twlevo@xs4all.nl.
6372
6373 * doc/bison.texinfo: Don't use "filename", as per GNU coding
6374 standards. Use "file name" or "file" or "name", depending on
6375 the context.
6376 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
6377 not to hack/foo.tab.c.
6378 (Calc++ Top Level): 2nd arg of main is not const.
6379 * data/glr.c: b4_filename -> b4_file_name.
6380 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
6381 All uses changed.
6382 (class position): filename -> file_name. All uses changed.
6383 * data/yacc.c: b4_filename -> b4_file_name.
6384 * lib/bitset.h: filename -> file_name in local vars.
6385 * lib/bitset_stats.c: Likewise.
6386 * src/files.c: Likewise.
6387 * src/scan-skel.l ("@output ".*\n): Likewise.
6388 * src/files.c (file_name_split): Renamed from filename_split.
6389 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
6390
6391 2005-09-08 Paul Eggert <eggert@cs.ucla.edu>
6392
6393 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
6394 to accommodate latest gnulib.
6395
6396 * tests/glr-regression.at (Duplicate representation of merged trees):
6397 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
6398
6399 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
6400 needed.
6401
6402 2005-08-26 Paul Eggert <eggert@cs.ucla.edu>
6403
6404 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
6405 All uses changed. Invoke user destructor after an error during a
6406 split parse (trivial change from Joel E. Denny).
6407
6408 * tests/glr-regression.at
6409 (User destructor after an error during a split parse): New test case.
6410 Problem reported by Joel E. Denny in:
6411 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
6412
6413 2005-08-25 Paul Eggert <eggert@cs.ucla.edu>
6414
6415 * README-cvs: Give URLs for recommended tools.
6416 Mention Gzip version problem, and bootstrapping issues.
6417 Remove troubleshooting section, as it's somewhat obsolete.
6418
6419 * bootstrap (no_cache): New var, to accommodate different wget
6420 variants. Use it instead of '-C off'. Problem reported by
6421 twlevo@xs4all.nl.
6422
6423 * data/glr.c (yydestroyStackItem): New function.
6424 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
6425 debugging information. Problem reported by Joel E. Denny.
6426
6427 2005-08-25 Akim Demaille <akim@epita.fr>
6428
6429 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
6430
6431 2005-08-24 Paul Eggert <eggert@cs.ucla.edu>
6432
6433 * data/glr.c (yyrecoverSyntaxError, yyreturn):
6434 Don't invoke destructor on unresolved entries.
6435 * tests/glr-regression.at
6436 (User destructor for unresolved GLR semantic value): New test case.
6437 Problem reported by Joel E. Denny in:
6438 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
6439
6440 2005-08-21 Paul Eggert <eggert@cs.ucla.edu>
6441
6442 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
6443 Add strnlen.c.
6444 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
6445 lib-prefix.m4, po.m4.
6446
6447 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
6448 in yydestruct diagnostic, since it might not be an error.
6449 Problem reported by Joel Denny near end of
6450 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6451 * data/lalr1.cc (yyerturn): Likewise.
6452 * data/yacc.c (yyreturn): Likewise.
6453 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
6454
6455 * src/files.c: Remove obsolete FIXME comment.
6456
6457 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
6458 with the other templates, and to fix bogus run-on messages such
6459 as the one reported at the end of
6460 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6461 All callers changed to avoid the newline.
6462 (yyprocessOneStack): Output two lines rather than one, to accommodate
6463 the above change. This changes the debug output format slightly.
6464
6465 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
6466 reported by Joel E. Denny in
6467 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
6468 (trivial change).
6469 * tests/glr-regression.at (Duplicate representation of merged trees):
6470 New test, from Joel E. Denny in:
6471 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
6472 * THANKS: Add Joel E. Denny.
6473
6474 * configure.ac (AC_INIT): Bump to 2.0c.
6475
6476 2005-07-24 Paul Eggert <eggert@cs.ucla.edu>
6477
6478 * NEWS: Version 2.0b.
6479
6480 * Makefile.am (SUBDIRS): Put examples before tests, so that
6481 "make check" doesn't finish with "All 1 tests passed".
6482
6483 * tests/regression.at (Token definitions): Don't rely on
6484 AT_PARSER_CHECK for data that contains backslashes. It currently
6485 uses 'echo', and 'echo' isn't portable if its argument contains
6486 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
6487 that the byte '\0xff' is not printable in the C locale; it is,
6488 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
6489 not printable, so use '\0x81' to test.
6490
6491 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
6492 version of GCC, since the macro is used with non-GCC compilers.
6493
6494 Fix core dump reported by Pablo De Napoli in
6495 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
6496 * tests/regression.at (Invalid inputs with {}): New test.
6497 * src/parse-gram.y (token_name): Translate type before using
6498 it as an index.
6499
6500 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
6501 the user's name space. All uses changed to __attribute__
6502 ((__unused__)).
6503 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
6504 Add __attribute__ ((__noreturn__)).
6505
6506 * etc/clcommit: Remove. We weren't using it, and it failed
6507 "make maintainer-distcheck".
6508 * Makefile.maint: Merge from coreutils.
6509 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
6510 (syntax-check-rules): Change list of rules as described below.
6511 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
6512 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
6513 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
6514 (sc_trailing_space): New rules.
6515 (sc_xalloc_h_in_src): Remove.
6516 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
6517 (sc_space_tab, sc_error_exit_success, sc_changelog):
6518 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
6519 (makefile-check, po-check, author_mark_check):
6520 (makefile_path_separator_check, copyright-check):
6521 Use grep -n, to make it easier to find violations.
6522 Use CVS_LIST and CVS_LIST_EXCEPT.
6523 (header_regexp, h_re): Remove.
6524 (dd_c): New macro.
6525 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
6526 (my-distcheck): Use more-modern GCC flags.
6527 (signatures, %.asc): Remove.
6528 (rel-files, announcement): Remove signatures.
6529 Restore old updating code, even though we don't use it, so
6530 that we're the same as coreutils.
6531 (alpha, beta, major): Depend on news-date-check.
6532 Make the upload commands.
6533
6534 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
6535 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
6536 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
6537 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
6538 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
6539 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
6540 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
6541 * tests/sets.at: Likewise.
6542
6543 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
6544 we comment out the Autoconf version number.
6545 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
6546 it's error-prone and "make maintainer-distcheck" rejects it.
6547
6548 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
6549 Indent calls to "error" to pacify "make maintainer-distcheck",
6550 when the calls are not intended to be translated.
6551 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
6552
6553 * src/Makefile.am (DEFS): Use +=, to pacify
6554 "make maintainer-distcheck".
6555 (bison_SOURCES): Add scan-skel.h.
6556 (sc_tight_scope): New rule, from coreutils.
6557
6558 * src/files.c (src_extension, header_extension):
6559 Now static, not extern.
6560 * src/getargs.c (short_options): Likewise.
6561 * src/muscle_tab.c (muscle_table): Likewise.
6562 * src/parse-gram.y (current_class, current_type, current_prec):
6563 Likewise.
6564 * src/reader.c (grammar_end, previous_rule_end): Likewise.
6565 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
6566 * src/main.c (main): Cast bindtextdomain and textdomain calls to
6567 void, to avoid warning when NLS is disabled.
6568 * src/output.c: Include scan-skel.h.
6569 (scan_skel): Remove decl, since scan-skel.h does this.
6570 (output_skeleton):
6571 Indent calls to "error" to pacify "make maintainer-distcheck".
6572 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
6573 * src/reader.h (gram_end, gram_lineno): New decls to pacify
6574 "make maintainer-distcheck".
6575 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
6576 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
6577 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
6578 (skel_lex_destroy, scan_skel): Move these decls to...
6579 * src/scan-skel.h: New file.
6580 * src/uniqstr.c (uniqstr_assert):
6581 Indent calls to "error" to pacify "make maintainer-distcheck".
6582
6583 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
6584 not @VAR@.
6585
6586 * tests/torture.at: Revamp to avoid misuse of atoi that
6587 "make maintainer-distcheck" complained about.
6588
6589 * examples/extexi (message): Don't print a message more than once,
6590 and omit line-number decoration that makes Emacs compile think
6591 that informative messages are worth worrying about.
6592
6593 2005-07-22 Paul Eggert <eggert@cs.ucla.edu>
6594
6595 * configure.ac: Update version number.
6596
6597 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
6598 accidentally.
6599 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
6600 autogenerated by the maintainer.
6601 * examples/calc++/.cvsignore: Add *.yy.
6602
6603 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
6604 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6605 * lib/bitsetv.c (bitsetv_alloc): Likewise.
6606
6607 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
6608
6609 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
6610 from maintainer-distcheck about casting the argument of 'free'.
6611
6612 * NEWS: Mention recent yytname changes.
6613 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
6614
6615 * bootstrap: For translations that have not yet been upgraded to
6616 the new runtime-po domain, prime the pump by extracting the
6617 relevant strings from the obsolete translations. This code can be
6618 removed once the bison-runtime domain has been translated by each
6619 team.
6620
6621 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
6622 now that token names are already quoted.
6623
6624 Fix problem reported by Anthony Heading.
6625 * data/glr.c (YYTOKEN_TABLE): New macro.
6626 (yytname): Define if YYTOKEN_TABLE.
6627 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
6628 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
6629 (YYERROR_VERBOSE): Define the same way the other skeletons do.
6630 * src/output.c (prepare_symbols): Output token_table_flag.
6631
6632 2005-07-21 Paul Eggert <eggert@cs.ucla.edu>
6633
6634 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
6635 again if the first call fails.
6636
6637 * data/glr.c (yytnamerr): New function.
6638 (yyreportSyntaxError): Use it to dequote most string literals.
6639 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
6640 with other skeletons. All uses changed.
6641 (yytnameerr_): New function.
6642 (yyreport_syntax_error): Use it to dequote most string literals.
6643 * data/yacc.c (yytnamerr): New function.
6644 (yyerrlab): Use it to decode most string literals.
6645 * doc/bison.texinfo (Decl Summary, Calling Convention):
6646 Clarify quoting convention of yytname.
6647 * src/output.c (prepare_symbols): Quote all names. This undoes
6648 the 2005-04-17 change, which is now accomplished (mostly) via
6649 changes in the parsers as described above.
6650 * tests/regression.at (Token definitions, Web2c Actions):
6651 Undo most 2005-04-17 change here, too.
6652
6653 2005-07-20 Paul Eggert <eggert@cs.ucla.edu>
6654
6655 Fix more problems reported by twlevo@xs4all.nl.
6656 * tests/cxx-type.at: Don't pipe output of ./types through sed to
6657 remove trailing spaces. This loses the exit status of ./types,
6658 and isn't needed since ./types shouldn't be emitting trailing
6659 spaces.
6660 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
6661 as the stack isn't valid in that case.
6662
6663 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6664 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6665 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6666 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
6667 is used.
6668 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
6669 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6670 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6671 Likewise.
6672
6673 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
6674 overly-picky compilers that reject 'char *foo = "bar";'.
6675
6676 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
6677 to FILE * parameter, not to stderr. This fixes a typo introduced
6678 in the 2005-07-12 change.
6679
6680 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
6681 warnings from GCC 4.
6682
6683 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
6684 (yyglrShiftDefer, yysplitStack):
6685 Remove unused parameters b4_pure_formals. All uses changed.
6686 (yyglrShift): Remove unused parameters b4_user_formals.
6687 All uses changed.
6688 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
6689
6690 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
6691
6692 Destructor cleanups and regularization among the three skeletons.
6693 * NEWS: Document the behavior changes.
6694 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
6695 stack before failing, as the cleanup code will do it for us now.
6696 * data/lalr1.cc (yyerrlab): Likewise.
6697 * data/glr.c (yyparse): Pop everything off the stack before
6698 freeing it, so that destructors get called properly.
6699 * data/lalr1.cc (yyreturn): Likewise.
6700 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
6701 This is more consistent.
6702 * doc/bison.texinfo (Destructor Decl): Mention more reasons
6703 why destructors might be called. 1.875 -> 2.1.
6704 (Destructor Decl, Decl Summary, Table of Symbols):
6705 Some English-language cleanups for %destructor.
6706 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6707 Add output line for destructor of start symbol.
6708 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
6709 because of that same extra output line.
6710
6711 * NEWS: Document minor wording changes in diagnostics of
6712 Bison-generated parsers.
6713 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
6714 Remove unused formals. All uses changed.
6715 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
6716 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
6717 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
6718 Rename yyoverflowab to yyexhaustedlab.
6719 When memory exhaustion occurs during syntax-error reporting,
6720 report it separately rather than in a single diagnostic; this
6721 eases translation.
6722 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
6723 (Memory Exhausted): Renamed from Parser Stack Overflow.
6724 Revamp wording slightly to prefer "memory exhaustion".
6725 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
6726
6727 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
6728
6729 Add i18n support to the GLR skeleton. Partially fix the C++
6730 skeleton; a C++ expert needs to finish this. Remove debugging
6731 msgids; there's little point to having them translated, since they
6732 can be understood only by someone who can read the
6733 (English-language) source code.
6734
6735 Generate runtime-po/bison-runtime.pot automatically, so that we
6736 don't have to worry about garbage getting in that file. We'll
6737 make sure after the next official release that old msgids don't
6738 get lost. See
6739 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
6740
6741 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
6742 Now auto-generated.
6743 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
6744 Fix typos in explanations of the runtime file.
6745 * bootstrap: Change gettext keyword from YYI18N to YY_.
6746 Use standard Makefile.in.in in runtime-po, since we'll arrange
6747 for backward-compatible bison-runtime.po files in a different way.
6748 * data/glr.c (YY_): New macro, from yacc.c.
6749 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
6750 Translate messages intended for users.
6751 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
6752 the wording in the other skeletons. We don't know that the memory
6753 is virtual.
6754 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
6755 Use same method that yacc.c uses.
6756 Don't translate debugging messages.
6757 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
6758 it doesn't work (yet), and requires C++ expertise to fix.
6759 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
6760 Move defn to a more logical place, to be consistent with other
6761 skeletons.
6762 Don't translate debugging messages.
6763 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
6764 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
6765 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
6766 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
6767
6768 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
6769 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
6770 void, not int.
6771 * tests/glr-regression.at (Badly Collapsed GLR States):
6772 Likewise.
6773 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6774 yylex should return 0 at EOF rather than aborting.
6775
6776 Improve tests for stack overflow in GLR parser.
6777 Problem reported by twlevo@xs4all.nl.
6778 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
6779 All uses removed.
6780 (yyStackOverflow): Just longjmp, but with value 2 so that caller
6781 can handle the problem.
6782 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
6783 (yyparse): New local variable yyresult to record the result.
6784 Use result of setjmp to set it, rather than storing itinto
6785 struct.
6786 (yyDone): Remove label.
6787 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
6788 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
6789 if YYABORT is used).
6790 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
6791 yyparse status; put status > 1 into diagnostic.
6792 Check that status==2 works.
6793 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
6794 Use exit status 3 for failure to open (which shouldn't happen).
6795
6796 2005-07-17 Paul Eggert <eggert@cs.ucla.edu>
6797
6798 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
6799 1 on syntax error; just let yyparse do its thing.
6800 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
6801 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
6802 (Exploding the Stack Size with Alloca):
6803 (Exploding the Stack Size with Malloc):
6804 Expect exit status 2, not 1, since the parser is supposed to blow
6805 its stack. Problem reported by twlevo@xs4all.nl.
6806
6807 * data/glr.c (yyparse): Don't assume that the initial calls
6808 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
6809 Print a stack-overflow message and fail instead.
6810 Initialize the line-number information before creating the stack,
6811 so that the stack-overflow message can report line zero safely.
6812
6813 2005-07-14 Paul Eggert <eggert@cs.ucla.edu>
6814
6815 Fix problems reported by twlevo@xs4all.nl.
6816 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
6817 (yyuserMerge): Provide a default case if b4_mergers is empty.
6818 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
6819 * tests/glr-regression.at
6820 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6821 Add casts to pacify C++ compilers.
6822 * tests/glr-regression.at (Improper merging of GLR delayed action
6823 sets): Declare yylex before using it.
6824 * tests/Makefile.am (maintainer-check-g++): Fix a stray
6825 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
6826 test for valgrind; valgrind is independent of g++.
6827 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
6828 for compatibility with POSIX 1003.1-2001 (if running coreutils).
6829 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
6830 Use a destructor, so that we can expand the stack. Change
6831 YYSTYPE to char * so that we can free it. Cast result of malloc.
6832
6833 2005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6834
6835 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
6836 a valgrind failure. Problem reported by twlevo@xs4all.nl.
6837
6838 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
6839
6840 * PACKAGING: New file, suggested by Bruno Haible and taken from
6841 similar wording in gettext's PACKAGING file.
6842 * NEWS: Mention PACKAGING.
6843 * Makefile.am (EXTRA_DIST): Add PACKAGING.
6844
6845 2005-07-12 Paul Eggert <eggert@cs.ucla.edu>
6846
6847 * NEWS: Document recent i18n improvements.
6848 * bootstrap: Get runtime translations into runtime-po.
6849 Create runtime-po files automatically, if possible.
6850 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
6851 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
6852 does not infringe on the user's name space.
6853 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
6854 * doc/bison.texinfo (Internationalization): Revamp the English
6855 and Texinfo syntax a bit, to try to make it clearer.
6856 (Bison Options, Option Cross Key): Mention --print-localedir.
6857 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
6858 YYENABLE_NLS. Quote a bit more.
6859 * runtime-po/.cvsignore: New file.
6860 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
6861 * runtime-po/Rules-quot: Remove; now created by bootstrap.
6862 * runtime-po/quot.sed: Likewise.
6863 * runtime-po/boldquot.sed: Likewise.
6864 * runtime-po/en@quot.header: Likewise.
6865 * runtime-po/en@boldquot.header: Likewise.
6866 * runtime-po/insert-header.sin: Likewise.
6867 * runtime-po/remove-potcdate.sin: Likewise.
6868 * runtime-po/Makevars: Likewise.
6869 * runtime-po/LINGUAS: Likewise.
6870 * runtime-po/de.po: Likewise; we will rely on the translation project
6871 to maintain this, so "bootstrap" should get it.
6872 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
6873 its value.
6874 * src/main.c (main): Bind the bison-runtime domain, too.
6875
6876 2005-07-12 Bruno Haible <bruno@clisp.org>
6877
6878 * data/yacc.c: Include <libintl.h> when NLS is enabled.
6879 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
6880 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
6881 * runtime-po: New directory.
6882 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
6883 $(DOMAIN).pot-update rule, so that old messages are never dropped.
6884 * runtime-po/Rules-quot: New file, copied from po/.
6885 * runtime-po/quot.sed: Likewise.
6886 * runtime-po/boldquot.sed: Likewise.
6887 * runtime-po/en@quot.header: Likewise.
6888 * runtime-po/en@boldquot.header: Likewise.
6889 * runtime-po/insert-header.sin: Likewise.
6890 * runtime-po/remove-potcdate.sin: Likewise.
6891 * runtime-po/Makevars: New file.
6892 * runtime-po/POTFILES.in: New file.
6893 * runtime-po/LINGUAS: New file.
6894 * runtime-po/bison-runtime.pot: New file.
6895 * runtime-po/de.po: New file.
6896 * m4/bison.m4: New file.
6897 * Makefile.am (SUBDIRS): Add runtime-po.
6898 (aclocaldir, aclocal_DATA): New variables.
6899 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
6900 Define aclocaldir.
6901 * src/getargs.c (usage): Document --print-localedir option.
6902 (PRINT_LOCALEDIR_OPTION): New enum item.
6903 (long_options): Add --print-localedir option.
6904 (getargs): Handle --print-localedir option.
6905 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
6906 (Internationalization): New section.
6907
6908 2005-07-12 Akim Demaille <akim@epita.fr>
6909
6910 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
6911 for consistency with the rest of the code.
6912 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
6913 Add separators.
6914
6915 2005-07-12 Akim Demaille <akim@epita.fr>
6916
6917 * src/parse-gram.y: Use %printer instead of YYPRINT.
6918
6919 2005-07-12 Akim Demaille <akim@epita.fr>
6920
6921 * src/symtab.h, src/symtab.c (symbol_print): New.
6922 * src/symlist.h, src/symlist.c (symbol_list_print): New.
6923 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
6924
6925 2005-07-12 Akim Demaille <akim@epita.fr>
6926
6927 * data/glr.c (b4_syncline): Fix (swap) the definitions of
6928 b4_at_dollar and b4_dollar_dollar.
6929
6930 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
6931
6932 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
6933 and Pennello's paper.
6934
6935 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
6936
6937 * data/yacc.c (yyparse): Undo previous patch. Instead,
6938 set yylsp[0] and yyvsp[0] only if the initial action
6939 sets yylloc and yylval, respectively.
6940
6941 * data/yacc.c (yyparse): In the initial action, set
6942 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
6943 This avoids the use of undefined variables if the initial
6944 action does not set yylloc and/or yylval.
6945
6946 2005-07-07 Paul Eggert <eggert@cs.ucla.edu>
6947
6948 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
6949 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
6950 Remove from CVS. These files are automatically generated.
6951 * examples/extexi: Clarify that this file is now part of Bison,
6952 not GNU M4, and that it works with any POSIX-compatible Awk.
6953 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
6954 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
6955 so that we also get calc++-parser.yy. Geneate it.
6956 Use $(AWK), not gawk, since any conforming Awk will do.
6957 Put comment before action, since older 'make' can't handle comment
6958 in action.
6959 $(BUILT_SOURCES): List all built sources, not just some of them.
6960 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
6961 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
6962 $($(calc_sources_generated)): Remove unnecessary test for existence
6963 of target. (This had a shell syntax error anyway; a stray "x".)
6964 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
6965 calc++-parser.yy.
6966 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
6967
6968 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
6969 implied by the other modules.
6970
6971 2005-07-06 Akim Demaille <akim@epita.fr>
6972
6973 Bind examples/calc++ to the package.
6974 * examples/calc++/Makefile: Remove, replaced by...
6975 * examples/calc++/Makefile.am: ... this new file.
6976 * examples/calc++/test: Remove input.
6977 * examples/calc++/compile: Remove.
6978 * examples/Makefile.am: New.
6979 * configure.ac, Makefile.am: Adjust.
6980 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
6981
6982 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
6983
6984 * data/glr.c (yyFail): Drastically simplify; since the format argument
6985 never had any % directives, we can simply pass it to yyerror.
6986 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
6987 be modified later, as that is the usual style in glr.c.
6988 Problems reported by Paul Hilfinger.
6989
6990 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
6991 and size overflow errors.
6992 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
6993 in case the user prolog sets feature-test macros like _GNU_SOURCE.
6994 (YYSIZEMAX): New macro.
6995 (yystpcpy): New function, taken from yacc.c.
6996 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
6997 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
6998 so that we don't have to maintain their signatures.
6999 (yyFail): Check for buffer overflow, by using vsnprintf rather
7000 than vsprintf. Allocate a bigger buffer if possible.
7001 Report an error if buffer allocation fails.
7002 (yyStackOverflow): New function.
7003 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
7004 the initialization was successful. It might fail if storage was
7005 exhausted.
7006 (yyexpandGLRStack): Add more checks for storage allocation failure.
7007 Use yyStackOverflow to report failures.
7008 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
7009 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
7010 Don't assume stack number fits in int.
7011 (yysplitStack): Check for storage allocation failure.
7012 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
7013 can print diagnostics on storage allocation failure. All callers
7014 changed.
7015 (yyresolveValue): Use yybool for boolean.
7016 (yyreportSyntaxError): Check for size-calculation overflow.
7017 This code is taken from yacc.c.
7018 (yyparse): Check for storage allocation errors when allocating
7019 the initial stack.
7020
7021 2005-07-05 Akim Demaille <akim@epita.fr>
7022
7023 Extract calc++ from the documentation.
7024 * doc/bison.texinfo (Calc++): Add the extraction marks.
7025 * examples/extexi: New, from the aborted GNU Programming 2E.
7026 Separate the different paragraph of a file with empty lines.
7027 * examples/Makefile: Use it to extract the whole calc++ example.
7028
7029 2005-06-24 Akim Demaille <akim@epita.fr>
7030
7031 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
7032 class typedefs.
7033
7034 2005-06-22 Akim Demaille <akim@epita.fr>
7035
7036 * doc/bison.texinfo (C++ Language Interface): First stab.
7037 (C++ Parsers): Remove.
7038
7039 2005-06-22 Akim Demaille <akim@epita.fr>
7040
7041 * data/lalr1.cc (yylex_): Honor %lex-param.
7042
7043 2005-06-22 Akim Demaille <akim@epita.fr>
7044
7045 Start a set of simple examples.
7046 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
7047 * examples/calc++/calc++-driver.hh,
7048 * examples/calc++/calc++-parser.yy,
7049 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
7050 * examples/calc++/compile, examples/calc++/test: New.
7051
7052 2005-06-09 Paul Eggert <eggert@cs.ucla.edu>
7053
7054 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
7055 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
7056 which stems from the 2005-05-27 patch.
7057
7058 2005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7059
7060 * data/glr.c: Modify treatment of unused parameters to permit use
7061 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
7062
7063 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
7064
7065 Fix infringement on user name space reported by Janos Zoltan Szabo.
7066 * data/yacc.c (yyparse): strlen -> yystrlen.
7067
7068 2005-05-30 Akim Demaille <akim@epita.fr>
7069
7070 * data/lalr1.cc (_): New.
7071 Translate the various messages.
7072
7073 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
7074
7075 Fix infringement on user name space reported by Bruno Haible.
7076 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
7077 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
7078 the user's name space.
7079 (alloca): Include <stdlib.h> to get it, if it's not built in.
7080 (YYMALLOC, YYFREE): Define only if needed.
7081 (malloc, free): Declare, but only if needed, as this infringes on
7082 the user name space.
7083
7084 2005-05-25 Paul Eggert <eggert@cs.ucla.edu>
7085
7086 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
7087 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
7088 with %d format.
7089 * lib/ebitset.c (min, max): Undef before defining.
7090 * lib/vbitset.c (min, max): Likewise.
7091 * lib/subpipe.c (create_subpipe): Save local variables in case
7092 vfork clobbers them.
7093
7094 2005-05-24 Bruno Haible <bruno@clisp.org>
7095
7096 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
7097 error message syntax used by gcc-4.0.
7098
7099 2005-05-23 Paul Eggert <eggert@cs.ucla.edu>
7100
7101 * README: Mention m4 1.4.3. Remove obsolete advice about
7102 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
7103
7104 * bootstrap: Remove workaround for problem I encountered with
7105 gettext 0.14.1; it seems to be fixed now.
7106
7107 2005-05-22 Paul Eggert <eggert@cs.ucla.edu>
7108
7109 * NEWS: Version 2.0a.
7110
7111 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
7112 the previous change.
7113
7114 Various maintainer cleanups.
7115 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
7116 conftest*, for benefit of CVS commands run at the same time as
7117 "configure". Add build-aux, since "bootstrap" now creates it and
7118 its subfiles.
7119 * Makefile.cfg (move_if_change): Remove.
7120 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
7121 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
7122 (po_repo, do-po-update, po-update, wget_files, get-targets):
7123 (config.guess-url_prefix, config.sub-url_prefix):
7124 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
7125 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
7126 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
7127 Remove.
7128 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
7129 this is now the recommended name.
7130 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
7131 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
7132 ylwrap. These files now go into build-aux.
7133 * config/move-if-change: Remove.
7134 * config/prev-version.txt: Bump from 1.75 to 2.0.
7135
7136 * bootstrap: Add stdio-safer, unistd-safer modules.
7137 Remove m4/glibc2.m4 (introduced by latest gnulib, but
7138 we don't need it).
7139 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
7140 fopen-safer.c, stdio-safer.h, unistd-safer.h.
7141 * lib/subpipe.c: Include "unistd-safer.h".
7142 (create_subpipe): Make sure all the newly-created
7143 file descriptors are > 2, so that diagnostics don't
7144 get sent down them (which might cause Bison to hang, in theory).
7145 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
7146 * src/files.c (xfopen): Use fopen_safer, not fopen.
7147
7148 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
7149 yesterday's yacc.c fix.
7150
7151 2005-05-21 Paul Eggert <eggert@cs.ucla.edu>
7152
7153 * data/glr.c, data/lalr1.cc: Update copyright date.
7154
7155 Fix a destructor bug reported by Wolfgang Spraul in
7156 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
7157 * data/yacc.c (yyabortlab): Don't call destructor, and
7158 don't set yychar to EMPTY.
7159 (yyoverflowlab): Don't call destructor.
7160 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
7161 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
7162 since we no longer output the message "discarding lookahead token
7163 end of input ()".
7164
7165 2005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7166
7167 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
7168 fix a small glitch in debugging output.
7169 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
7170 after YY_SYMBOL_PRINT where needed.
7171
7172 (struct yyGLRState): Add some comments.
7173 (struct yySemanticOption): Add some comments.
7174 (union yyGLRStackItem): Add comment.
7175
7176 (yymergeOptionSets): Correct this to properly perform the union,
7177 avoiding infinite reported by Michael Rosien.
7178 Update comment.
7179
7180 * tests/glr-regression.at: Add test for GLR merging error reported
7181 by M. Rosien.
7182
7183 2005-05-13 Paul Eggert <eggert@cs.ucla.edu>
7184
7185 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
7186 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
7187 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
7188 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
7189 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
7190 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
7191 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
7192 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
7193 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
7194 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
7195 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
7196 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
7197 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
7198 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
7199 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
7200 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
7201 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
7202 src/derives.h, src/files.c, src/files.h, src/getargs.c,
7203 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
7204 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
7205 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
7206 src/output.h, src/parse-gram.c, src/parse-gram.h,
7207 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
7208 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
7209 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
7210 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
7211 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
7212 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
7213 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
7214 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
7215 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
7216 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
7217 tests/reduce.at, tests/regression.at, tests/sets.at,
7218 tests/synclines.at, tests/testsuite.at, tests/torture.at:
7219 Update FSF postal mail address.
7220
7221 2005-05-11 Paul Eggert <eggert@cs.ucla.edu>
7222
7223 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
7224 Problem reported by Ralf Menzel.
7225
7226 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
7227
7228 * tests/actions.at: Test that stack overflow invokes destructors.
7229 From Marcus Holland-Moritz.
7230 * data/yacc.c (yyerrlab): Move the code that destroys the stack
7231 from here....
7232 (yyreturn): to here. That way, destructors are called properly
7233 even if the stack overflows, or the user calls YYACCEPT or
7234 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
7235 (yyoverflowlab): Destroy the lookahead.
7236
7237 2005-04-24 Paul Eggert <eggert@cs.ucla.edu>
7238
7239 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
7240
7241 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
7242
7243 * NEWS: Bison-generated C parsers no longer quote literal strings
7244 associated with tokens.
7245 * src/output.c (prepare_symbols): Don't escape strings,
7246 since users don't want to see C escapes.
7247 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
7248 in diagnostics.
7249 * tests/input.at (Torturing the Scanner): Likewise.
7250 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
7251
7252 2005-04-16 Paul Eggert <eggert@cs.ucla.edu>
7253
7254 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
7255 the data size is known to be too small and we can't increase it.
7256 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
7257
7258 2005-04-15 Paul Eggert <eggert@cs.ucla.edu>
7259
7260 * src/parse-gram.y: Include quotearg.h.
7261 (string_as_id): Quote $1 before using it as a key, since the
7262 lexer no longer quotes it for us.
7263 (string_content): Don't strip quotes, since lexer no longer
7264 quotes it for us.
7265 * src/scan-gram.l: Include quotearg.h.
7266 ("\""): Omit quote.
7267 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
7268 a key, since the rest of the lexer doesn't quote it.
7269 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
7270 * tests/regression.at (Token definitions): Check for backslashes
7271 in token strings.
7272
7273 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
7274 (YYSIZE_T): Define to unsigned long int when using an older compiler.
7275 (yyparse): Revamp code to generate long syntax error message, to
7276 make it easier to translate, and to avoid problems with arithmetic
7277 overflow. Change "virtual memory" to "memory" in diagnostic, since
7278 we don't know whether the memory is virtual.
7279
7280 2005-04-13 Paul Eggert <eggert@cs.ucla.edu>
7281
7282 * NEWS: Bison-generated C parsers now use the _ macro to
7283 translate strings.
7284 * data/yacc.c (_) [!defined _]: New macro.
7285 All English strings wrapped inside this macro.
7286 * doc/bison.texinfo (Bison Parser): Document _.
7287 * po/POTFILES.in: Include src/parse-gram.c, since it now
7288 includes translateable strings that parse-gram.y doesn't.
7289
7290 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
7291
7292 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
7293 reverting the 2004-10-11 change to this function.
7294 (symbol_check_alias_consistency): Don't call symbol_type_set
7295 if the type name is already correct.
7296 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
7297
7298 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
7299
7300 * tests/regression.at (Token definitions): Don't use a token named
7301 c, as that generates a "#define c ..." that runs afoul of buggy
7302 stdlib.h that uses the identifier c as a member of struct
7303 drand48_data. Problem reported by Horst Wente.
7304
7305 2005-03-21 Paul Eggert <eggert@cs.ucla.edu>
7306
7307 * bootstrap: Change translation URL from
7308 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
7309 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
7310 redirection glitches. Problem reported by twlevo@xs4all.nl.
7311
7312 2005-03-20 Paul Eggert <eggert@cs.ucla.edu>
7313
7314 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
7315 after operands; POSIX says this isn't portable for the c99 command.
7316
7317 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
7318
7319 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
7320 immediately if a data overrun has occurred; this may help us track
7321 down what may be a spurious failure on MacOS.
7322
7323 2005-03-17 Paul Eggert <eggert@cs.ucla.edu>
7324
7325 Respond to problems reported by twlevo@xs4all.nl.
7326
7327 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
7328
7329 * src/vcg.h: Comment fix.
7330 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
7331 (G_CMAX): Change to -1 instead of INT_MAX.
7332
7333 * data/yacc.c (yyparse): Omit spaces before #line.
7334
7335 2005-03-15 Paul Eggert <eggert@cs.ucla.edu>
7336
7337 * src/tables.c (state_number_to_vector_number): Put it inside an
7338 "#if 0", since it's not currently used. Problem reported by
7339 Roland McGrath.
7340
7341 2005-03-06 Paul Eggert <eggert@cs.ucla.edu>
7342
7343 * src/output.c (escaped_output): Renamed from
7344 escaped_file_name_output, since we now use it for symbol tags as
7345 well. All uses changed.
7346 (symbol_destructors_output, symbol_printers_output):
7347 Escape symbol tags too.
7348 Problem reported by Matyas Forstner in
7349 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
7350
7351 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
7352 not needed.
7353 * src/output.c (user_actions_output, token_definitions_output,
7354 symbol_destructors_output, symbol_printers_output): Likewise.
7355 * src/reader.c (prologue_augment): Likewise.
7356 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
7357
7358 * src/vcg.c (output_edge): Don't quote linestyle arg.
7359 Problem reported by twlevo@xs4all.nl.
7360
7361 2005-02-28 Paul Eggert <eggert@cs.ucla.edu>
7362
7363 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
7364 example, reported by Derek M Jones. Also, make the example even
7365 more outrageous, to better illustrate how bad the problem is.
7366
7367 2005-02-24 Paul Eggert <eggert@cs.ucla.edu>
7368
7369 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
7370 putsym. Typo reported by Sebastian Piping.
7371
7372 2005-02-23 Paul Eggert <eggert@cs.ucla.edu>
7373
7374 * doc/bison.texinfo (Language and Grammar): some -> same
7375 (Epilogue): int he -> in the
7376 Typos reported by Sebastian Piping via Justin Pence.
7377
7378 2005-02-07 Paul Eggert <eggert@cs.ucla.edu>
7379
7380 * tests/glr-regression.at (Improper handling of embedded actions
7381 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
7382 embedded actions and $-N in GLR parsers", work around an Autoconf bug
7383 with dollar signs in test names.
7384 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
7385 for a similar reason.
7386
7387 2005-01-28 Paul Eggert <eggert@cs.ucla.edu>
7388
7389 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
7390 wants to redefine G_VIEW.
7391
7392 2005-01-27 Paul Eggert <eggert@cs.ucla.edu>
7393
7394 * src/vcg.c (get_view_str): Remove case for normal_view.
7395 Problem reported by twlevo@xs4all.nl.
7396
7397 2005-01-24 Paul Eggert <eggert@cs.ucla.edu>
7398
7399 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
7400 Problem reported by twlevo@xs4all.nl.
7401
7402 * doc/bison.texinfo: Change @dircategory from "GNU programming
7403 tools" to "Software development". Requested by Richard Stallman
7404 via Karl Berry.
7405
7406 2005-01-23 Paul Eggert <eggert@cs.ucla.edu>
7407
7408 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
7409 Problem reported by twlevo@xs4all.nl.
7410
7411 2005-01-21 Paul Eggert <eggert@cs.ucla.edu>
7412
7413 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
7414 keyword; it's not needed with modern compilers, and it doesn't
7415 affect correctness with older compilers. Suggested by
7416 twlevo@xs4all.nl.
7417
7418 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
7419
7420 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
7421 gcc -Wswitch-default.
7422 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7423 * data/yacc.c (yyparse): Likewise.
7424
7425 2005-01-12 Paul Eggert <eggert@cs.ucla.edu>
7426
7427 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
7428 already. Let config.h define any nonstandard values.
7429
7430 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
7431
7432 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
7433 for the benefit of slower hosts. Problem reported by
7434 Nelson H. F. Beebe.
7435
7436 2005-01-07 Paul Eggert <eggert@cs.ucla.edu>
7437
7438 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
7439 being defined and not used.
7440 * data/lalr1.cc (yyparse): Likewise.
7441 Use "if (false)" rather than "if (0)".
7442
7443 2005-01-05 Paul Eggert <eggert@cs.ucla.edu>
7444
7445 * TODO: Mention that we should allow NUL bytes in tokens.
7446
7447 2005-01-02 Paul Eggert <eggert@cs.ucla.edu>
7448
7449 * src/scan-skel.l (<<EOF>>): Don't close standard output.
7450 Problem reported by Hans Aberg.
7451
7452 2005-01-01 Paul Eggert <eggert@cs.ucla.edu>
7453
7454 * src/getargs.c (version): Happy new year; update overall
7455 program copyright date from 2004 to 2005.
7456
7457 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
7458 Problem reported by Hans Aberg.
7459 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
7460 (Output file names.): Add a test for the case when standard output
7461 is closed.
7462
7463 2004-12-26 Paul Eggert <eggert@cs.ucla.edu>
7464
7465 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
7466 to fix an oversight in the Bison 2.0 manual.
7467
7468 2004-12-25 Paul Eggert <eggert@cs.ucla.edu>
7469
7470 * NEWS: Version 2.0. Reformat the existing news items since
7471 1.875, so that related items are grouped together.
7472 * configure.ac (AC_INIT): Bump version to 2.0.
7473 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
7474
7475 * tests/torture.at (Exploding the Stack Size with Alloca): Set
7476 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
7477 otherwise, we're not testing alloca. Unfortunately there's no
7478 simple way to consult HAVE_ALLOCA here.
7479
7480 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
7481 for yymsg, too.
7482
7483 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
7484 hand. This avoids a warning about comparing int to size_t when
7485 GCC warnings are enabled.
7486
7487 2004-12-22 Paul Eggert <eggert@cs.ucla.edu>
7488
7489 * NEWS: Bison-generated parsers no longer default to using the
7490 alloca function (when available) to extend the parser stack, due
7491 to widespread problems in unchecked stack-overflow detection.
7492 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
7493 responsibility to set it to a positive value. This lets the user
7494 specify a value that is not a preprocessor constant.
7495 * data/yacc.c (YYMAXDEPTH): Likewise.
7496 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
7497 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
7498 to be a compile-time constant. However, explain the constraints on it.
7499 Also, explain the constraints on YYINITDEPTH.
7500 (Table of Symbols): Explain that alloca is no longer the default.
7501 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
7502 to 1.
7503
7504 * doc/bison.texinfo (Location Default Action): Mention that n must
7505 be zero when k is zero. Suggested by Frank Heckenbach.
7506
7507 2004-12-22 Akim Demaille <akim@epita.fr>
7508
7509 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
7510 (parser::state_type, parser::semantic_type, parser::location_type):
7511 Private, not public.
7512 (parser::parse): Return ints, not bool.
7513 Returning a bool introduces a problem: 0 corresponds to false, and
7514 it seems weird to return false on success. Returning true changes
7515 the conventions for yyparse.
7516 Alternatively we could return void and send an exception.
7517 There is no clear consensus (yet?).
7518 (state_stack, semantic_stack, location_stack): Rename as...
7519 (state_stack_type, semantic_stack_type, location_stack_type): these.
7520 Private, not public.
7521 * tests/c++.at: New.
7522 * tests/testsuite.at, tests/Makefile.am: Adjust.
7523
7524 2004-12-21 Akim Demaille <akim@epita.fr>
7525
7526 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
7527
7528 2004-12-21 Akim Demaille <akim@epita.fr>
7529
7530 Don't impose std::string for filenames.
7531
7532 * data/lalr1.cc (b4_filename_type): New.
7533 (position::filename): Use it.
7534 (parser.hh): Move the inclusion of stack.hh and location.hh below
7535 the user code, so that needed headers for the filename type can be
7536 included first.
7537 Forward declare them before the user code.
7538 * tests/Makefile.am (check-local, installcheck-local): Pass
7539 TESTSUITEFLAGS to the TESTSUITE.
7540
7541 2004-12-20 Akim Demaille <akim@epita.fr>
7542
7543 Use more STL like names: my_class instead of MyClass.
7544
7545 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
7546 (SemanticStack, SemanticType, StateStack, StateType)
7547 (TokenNumberType, Stack, Slice, Traits, Parser::location)
7548 (Parser::value): Rename as...
7549 (location_stack, location_type, rhs_number_type, semantic_stack)
7550 (semantic_type, state_stack, state_type, token_number_type, stack)
7551 (slice, traits, parser::yylloc, parser::yylval): these.
7552
7553 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
7554
7555 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
7556
7557 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
7558 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7559
7560 2004-12-17 Paul Eggert <eggert@cs.ucla.edu>
7561
7562 Remove uses of 'short int' and 'unsigned short int'. This raises
7563 some arbitrary limits. It uses more memory but nowadays that's
7564 not much of an issue.
7565
7566 This change does not affect the generated parsers; that's a different
7567 task, as some users will want to conserve memory there.
7568
7569 Ideally we should use size_t to represent all object counts, and
7570 something like ptrdiff_t to represent signed differences of object
7571 counts; but that will require more code-cleanup than I have the
7572 time to do right now.
7573
7574 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
7575 Use size_t, not int or short int, to count objects.
7576 * src/closure.c (nritemset, closure): Likewise.
7577 * src/closure.h (nritemset, closure): Likewise.
7578 * src/nullable.c (nullable_compute): Likewise.
7579 * src/print.c (print_core): Likewise.
7580 * src/print_graph.c (print_core): Likewise.
7581 * src/state.c (state_compare, state_hash): Likewise.
7582 * src/state.h (struct state): Likewise.
7583 * src/tables.c (default_goto, goto_actions): Likewise.
7584
7585 * src/gram.h (rule_number, rule): Use int, not short int.
7586 * src/output.c (prepare_rules): Likewise.
7587 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
7588 errs, reductions): Likewise.
7589 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
7590 Likewise.
7591 * src/tables.c (vector_number, tally, action_number,
7592 ACTION_NUMBER_MINIMUM): Likewise.
7593 * src/output.c (muscle_insert_short_int_table): Remove.
7594
7595 2004-12-17 Akim Demaille <akim@epita.fr>
7596
7597 * data/lalr1.cc: Extensive Doxygenation.
7598 (error_): Rename as...
7599 (error): this, since it is visible to the user.
7600 Adjust callers.
7601 (Parser::message): Now an automatic variable from...
7602 (Parser::yyreport_syntax_error_): here.
7603 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
7604 Parser::error.
7605 * tests/input.at: Escape $.
7606
7607 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
7608
7609 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
7610 Parenthesize rhs to avoid obscure problems with mistakes like
7611 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
7612 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7613 b4_rhs_location): Likewise.
7614 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7615 b4_rhs_location): Likewise.
7616
7617 2004-12-16 Akim Demaille <akim@epita.fr>
7618
7619 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
7620 yacc.c: be sure to stay within yycheck_.
7621 * tests/actions.at: Re-enable C++ tests.
7622
7623 2004-12-16 Akim Demaille <akim@epita.fr>
7624
7625 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
7626 real.
7627
7628 2004-12-16 Akim Demaille <akim@epita.fr>
7629
7630 Use #define to handle the %name-prefix.
7631
7632 * data/glr.c, data/yacc.c: Comment changes.
7633 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
7634 so that one can refer to yylex in the parser file, and have it
7635 renamed, as is the case with other skeletons.
7636
7637 2004-12-16 Akim Demaille <akim@epita.fr>
7638
7639 Move lalr1.cc internals into yy*.
7640
7641 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
7642 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
7643 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
7644 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
7645 (empty_, final_, terror_, errcode_, ntokens_)
7646 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
7647 (looka_, ilooka_, error_range_, nerrs_):
7648 Rename as...
7649 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
7650 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
7651 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
7652 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
7653 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
7654 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
7655 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
7656 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
7657 these.
7658
7659 2004-12-15 Paul Eggert <eggert@cs.ucla.edu>
7660
7661 Fix some problems reported by twlevo at xs4all.
7662 * src/symtab.c (symbol_new): Report an error if the input grammar
7663 contains too many symbols. This is better than calling abort() later.
7664 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
7665 (struct node, struct graph):
7666 Rename member expand to stretch. All uses changed.
7667 (struct graph): Remove member layoutalgorithm. All uses removed.
7668 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
7669 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
7670 All uses changed.
7671 (N_STRETCH): Rename from N_EXPAND. All uses changed.
7672
7673 2004-12-15 Akim Demaille <akim@epita.fr>
7674
7675 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
7676 Add more Doxygen comments.
7677 (symprint_, stack_print_, reduce_print_, destruct_, pop)
7678 (report_syntax_error_, translate_): Rename as...
7679 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
7680 (yypop_, yyreport_syntax_error_, yytranslate_): this.
7681
7682 2004-12-15 Akim Demaille <akim@epita.fr>
7683
7684 * data/lalr1.cc (lex_): Rename as...
7685 (yylex_): this.
7686 Move the trace here.
7687 Take the %name-prefix into account.
7688 Reported by Alexandre Duret-Lutz.
7689
7690 2004-12-15 Akim Demaille <akim@epita.fr>
7691
7692 Simplify the C++ parser constructor.
7693
7694 * data/lalr1.cc (debug_): Rename as...
7695 (yydebug_): so that the parser's internals are always in the yy*
7696 pseudo namespace.
7697 Adjust uses.
7698 (b4_parse_param_decl): Remove the leading comma as it is now only
7699 called as unique argument list.
7700 (Parser::Parser): Remove the constructor accepting a location and
7701 an initial debugging level.
7702 Remove from the other ctor the argument for the debugging level.
7703 (debug_level_type, debug_level, set_debug_level): New.
7704
7705 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
7706 constructor calls.
7707
7708 2004-12-15 Akim Demaille <akim@epita.fr>
7709
7710 Remove b4_root related material: failure experiment
7711 (which goal was to allow to derive from a class).
7712
7713 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
7714 definitions and uses.
7715
7716 2004-12-14 Paul Eggert <eggert@cs.ucla.edu>
7717
7718 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
7719 not 2, since it's not portable to subtract 1 from the start of an
7720 array. The new item 0 is never set or used. All uses changed.
7721
7722 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
7723 the default definition of YYLLOC_DEFAULT. Problem reported
7724 by Frank Heckenbach.
7725
7726 2004-12-12 Paul Eggert <eggert@cs.ucla.edu>
7727
7728 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
7729 the normal case and one for the error case. Just use the
7730 first one uniformly. Problem reported by Frank Heckenbach.
7731 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
7732 use exactly the same macro in both places.
7733 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
7734 so that the normal-case YYRHSLOC works for the error case too.
7735 All uses changed.
7736 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
7737 (YYLLOC_DEFAULT): Use the same macro as glr.c.
7738 * doc/bison.texinfo (Location Default Action): Don't claim that
7739 we have an array of locations. Use the same macro for both glr
7740 and lalr parsers. Mention YYRHSLOC. Mention what happens when
7741 the index is 0.
7742
7743 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7744
7745 * HACKING: Update email addresses to send announcements to.
7746
7747 * configure.ac (AC_INIT): Bump version to 1.875f.
7748
7749 2004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7750
7751 * NEWS: Version 1.875e.
7752 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
7753
7754 * src/scan-skel.l: Include "complain.h", for "fatal".
7755
7756 * src/relation.h (relation_print, relation_digraph):
7757 Relation sizes are of type relation_node, not size_t (this is
7758 merely a doc fix, since the two types are equivalent).
7759 (relation_transpose): Relation sizes are of type relation_node,
7760 not int.
7761 * src/relation.c: Likewise.
7762 (top, infinity): Now of type relation_node, not int.
7763 (traverse, relation_transpose): Use relation_node, not int.
7764
7765 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
7766 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
7767 (yyparse): Remove unused local introduced in 2004-10-25 patch.
7768
7769 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
7770 specifying whether the test should be skipped. Use it tp
7771 specify that the [%defines %skeleton "lalr1.cc"] tests currently
7772 fail on some hosts, and should be skipped.
7773
7774 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
7775
7776 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
7777 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
7778 unless otherwise specified below.
7779
7780 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
7781 to allocate kernel_base, kernel_items, kernel_size, since
7782 they needn't be initialized to 0.
7783 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
7784 * src/closure.c (new_closure): Likewise, for itemset.
7785 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
7786 * src/lalr.c (set_goto_map): Likewise, for temp_map.
7787 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
7788 (build_relations): Likewise for edge, states1, includes.
7789 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
7790 * src/reader.c (packgram): Likewise, for ritem, rules.
7791 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
7792 * src/relation.c (relation_digraph): Likewise for VERTICES.
7793 (relation_transpose): Likewise for new_R, end_R.
7794 * src/symtab.c (symbols_token_translations_init): Likewise for
7795 token_translations.
7796 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
7797 (token_actions): Likewise for yydefact, actrow, conflrow,
7798 conflict_list.
7799 (save_column): Likewise for froms[symno], tos[symno].
7800 (goto_actions): Likewise for state_count.
7801 (pack_table): Likewise for base, pos, check.
7802 (tables_generate): Likewise for width.
7803
7804 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
7805 for initial core. Just have a separate core, so we needn't worry
7806 about whether kernel_size and kernel_base are initialized.
7807
7808 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
7809 kernel_size, kernel_items): Remove unnecessary initialization.
7810 * src/conflicts.c (conflicts): Likewise.
7811 * src/derives.c (derives): Likewise.
7812 * src/muscle_tablc (muscle_insert): Likewise.
7813 * src/relation.c (relation_digraph): Likewise.
7814 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
7815 conflrow, conflict_table, conflict_list, table, check):
7816 Likewise.
7817
7818 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
7819 This is because all callers pass unsigned int.
7820 * src/closure.h (new_closure): Likewise.
7821
7822 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
7823 (build_relations): Initialize includes[i] in all cases.
7824 * src/reader.c (packgram): Always initialize rules[ruleno].prec
7825 and rules[ruleno].precsym. Initialize members in order.
7826 * src/relation.c (relation_transpose): Always initialize new_R[i]
7827 and end_R[i].
7828 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
7829
7830 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
7831 conflict_list[0] was always 0, but now it isn't initialized.
7832
7833 * src/table.c (table_grow): When conflict_table grew, the grown
7834 area wasn't cleared. Fix this.
7835
7836 * lib/.cvsignore: Add strdup.c, strdup.h.
7837 * m4/.cvsignore: Add strdup.m4.
7838
7839 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
7840
7841 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
7842 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
7843 GOTO_NUMBER_MAXIMUM, since we occasionally compute
7844 ngotos + 1 without checking for overflow.
7845 (build_relations): Use END_NODE, not -1, to denote end of edges.
7846 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
7847 build_relations): Use goto_number, not int, for goto numbers.
7848 * src/tables.c (save_column, default_goto): Likewise.
7849
7850 2004-11-23 Akim Demaille <akim@epita.fr>
7851
7852 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
7853 of #defining from yystype.
7854 Don't typedef yystype, C++ does not need it.
7855 This lets it possible to forward declare it as union.
7856
7857 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
7858
7859 * bootstrap (gnulib_modules): Add extensions.
7860 Problem reported by Jim Meyering.
7861
7862 2004-11-22 Paul Eggert <eggert@cs.ucla.edu>
7863
7864 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
7865 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
7866 src/system.h, src/tables.c: XFREE -> free, to accommodate
7867 recent change to gnulib xalloc.h.
7868 Problem reported by Jim Meyering.
7869
7870 2004-11-17 Akim Demaille <akim@epita.fr>
7871
7872 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
7873
7874 2004-11-17 Akim Demaille <akim@epita.fr>,
7875 Alexandre Duret-Lutz <adl@gnu.org>
7876
7877 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
7878 changes.
7879 (YYCDEBUG): Adjust.
7880 Use it instead of cdebug_.
7881 (Parser::debug_stream, Parser::set_debug_stream): New.
7882 (Parser::symprint_): Define cdebug_ for temporary backward
7883 compatibility.
7884 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
7885 debug_stream ().
7886
7887 2004-11-17 Akim Demaille <akim@epita.fr>
7888
7889 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
7890 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
7891 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
7892 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
7893
7894 2004-10-27 Paul Eggert <eggert@cs.ucla.edu>
7895
7896 * data/glr.c (yyloc_default): Remove; not used.
7897 Problem reported by Frank Heckenbach.
7898
7899 2004-10-25 Akim Demaille <akim@epita.fr>
7900
7901 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
7902 Introduce another definition to address simple location arrays.
7903 (yyGLRStack): New member: yyerror_range.
7904 (yyrecoverSyntaxError, yyparse): Update it.
7905 (yyrecoverSyntaxError): Use it when shifting the error token to
7906 have an accurate range, equivalent to the one computed by both
7907 yacc.c and lalr1.cc.
7908 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
7909 that column numbers start at column 0, as per GNU Coding
7910 Standards, the others tests, and the doc.
7911 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
7912 Adjust to the above change (first column is 0).
7913 And adjust the location of the "<error>", now covering the whole
7914 line.
7915
7916 2004-10-22 Akim Demaille <akim@epita.fr>
7917 and Paul Eggert <eggert@cs.ucla.edu>
7918
7919 Remove some arbitrary limits on goto numbers and relations.
7920 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
7921 initial values, since they're never used.
7922 (set_goto_map): ngotos is now unsigned, so test for overflow
7923 by seeing whether it wraps around to zero.
7924 * src/lalr.h (goto_number): Now size_t, not short int.
7925 (GOTO_NUMBER_MAXIMUM): Remove.
7926 * src/relation.c (relation_print, traverse, relation_transpose):
7927 Check for END_NODE rather than looking at sign.
7928 * src/relation.h (END_NODE): New macro.
7929 (relation_node): Now size_t, not short int.
7930
7931 2004-10-22 Paul Eggert <eggert@cs.ucla.edu>
7932
7933 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
7934 keyword, not an identifier. Problem reported by Baron Schwartz in
7935 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
7936
7937 2004-10-11 Akim Demaille <akim@epita.fr>
7938
7939 * src/symtab.c (symbol_check_alias_consistency): Also check
7940 type names, destructors, and printers.
7941 Reported by Alexandre Duret-Lutz.
7942 Recode the handling of associativity and precedence in terms
7943 of symbol_precedence_set.
7944 Accept no redeclaration at all, not even equal to the previous
7945 value.
7946 (redeclaration): New.
7947 Use it to factor redeclaration complaints.
7948 (symbol_make_alias): Don't set the type of the alias, let
7949 symbol_check_alias_consistency do it as for other features.
7950 * src/symtab.h (symbol): Add new member prec_location, and
7951 type_location.
7952 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
7953 * tests/input.at (Incompatible Aliases): New.
7954
7955 2004-10-09 Paul Eggert <eggert@cs.ucla.edu>
7956
7957 .cvsignore fixes to accommodate gnulib changes,
7958 and the practice of naming build directories "_build".
7959 * .cvsignore: Add "_*". Sort.
7960 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
7961 * m4/.cvsignore: Add "*_gl.m4".
7962
7963 2004-10-06 Akim Demaille <akim@epita.fr>
7964
7965 * src/parse-gram.y (add_param): Fix the truncation of trailing
7966 spaces.
7967
7968 2004-10-05 Akim Demaille <akim@epita.fr>
7969
7970 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
7971 whether the reducion was empty or not. This leaves room to
7972 improve the use of YYLLOC_DEFAULT in such a case.
7973 lalr1.cc is still experimental, so changing this is acceptable.
7974 And finally, there are probably not many users who changed the
7975 handling of locations in GLR, so changing is admissible too.
7976
7977 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
7978 empty reduction, set @$ to an empty location ending the previously
7979 stacked symbol.
7980 Adjust uses to make sure the code is triggered on empty
7981 reductions.
7982 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
7983 expected output: empty reductions have empty locations.
7984
7985 2004-09-29 Akim Demaille <akim@epita.fr>
7986
7987 * data/lalr1.cc: Move towards a more standard C++ coding style
7988 for templates: Class < T > -> Class<T>.
7989
7990 2004-09-29 Akim Demaille <akim@epita.fr>
7991
7992 * data/lalr1.cc: Reinstall the former ctor, for sake of
7993 compatibility, but warn it will be removed.
7994 Move towards a more standard C++ coding style (i.e., type *var ->
7995 type* var).
7996
7997 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
7998
7999 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
8000 since it's less likely to work if NULs are involved in the future.
8001
8002 2004-09-27 Akim Demaille <akim@epita.fr>
8003
8004 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
8005
8006 2004-09-27 Akim Demaille <akim@epita.fr>
8007
8008 * data/lalr1.cc (b4_parse_param_decl_1): New.
8009 (b4_parse_param_decl): Use it to have different names between attribute
8010 and argument names.
8011 (b4_cc_constructor_call): Likewise.
8012
8013 2004-09-24 Akim Demaille <akim@epita.fr>
8014
8015 * src/parse-gram.y (add_param): Strip the leading and trailing
8016 blanks from a formal argument declaration.
8017 (YY_LOCATION_PRINT): New.
8018
8019 2004-09-24 Akim Demaille <akim@epita.fr>
8020
8021 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
8022 after the location.
8023
8024 2004-09-24 Akim Demaille <akim@epita.fr>
8025
8026 * doc/bison.texinfo (Table of Symbols): Sort.
8027
8028 2004-09-21 Akim Demaille <akim@epita.fr>
8029
8030 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
8031 the useless parentheses.
8032 Suggested by Paul Eggert.
8033
8034 2004-09-20 Akim Demaille <akim@epita.fr>
8035
8036 Let the initial-action act on the look-ahead, and use it for the
8037 "initial push" (corresponding to an hypothetical beginning-of-file).
8038 And let lalr1.cc honor %initial-action.
8039
8040 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
8041 example.
8042 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
8043 (Parser::Parser): Remove the ctor that used to initialize it.
8044 (Parser::parse): Like in the other skeletons, issue the "starting
8045 parse" message before any action.
8046 Honor %initial-action.
8047 Initialize the stacks with the lookahead.
8048 * data/yacc.c: Let $$ and @$ in %initial-action designate the
8049 look-ahead.
8050 Push them in the stacks.
8051 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
8052
8053 2004-09-20 Akim Demaille <akim@epita.fr>
8054
8055 * doc/bison.texinfo (Initial Action Decl): New.
8056
8057 2004-09-20 Akim Demaille <akim@epita.fr>
8058
8059 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
8060 clearer criterion to define it.
8061 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
8062 When reducing on an empty RHS, use the latest stacked location as
8063 location.
8064 yylloc is not always available.
8065 * data/glr.c: Likewise.
8066 Also, honor initial-actions.
8067
8068 2004-09-20 Akim Demaille <akim@epita.fr>
8069
8070 * data/yacc.c (YY_LOCATION_PRINT): New.
8071 Define when we know YYLTYPE's structure, i.e., when the default
8072 YYLLOC_DEFAULT is used.
8073 * data/c.m4 (b4_yysymprint_generate): Use it.
8074 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
8075 value of the result.
8076 (error_start_): Replace with...
8077 (error_range_): this location array.
8078 This allows to replace code relying on the implementation of
8079 locations by portable code.
8080 * data/yacc.c (yylerrsp): Replace with...
8081 (yyerror_range): this.
8082 Every time a token is popped, update yyerror_range[0], to have an
8083 accurate location for the error token.
8084 * data/glr.c (YY_LOCATION_PRINT): New.
8085 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
8086 deference a pointer.
8087 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
8088 report the location in %printers.
8089
8090 * src/scan-skel.l: Instead of abort, report error messages to ease
8091 understanding skeleton scanning failures.
8092
8093 2004-09-16 Akim Demaille <akim@epita.fr>
8094
8095 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
8096 (iterator, const_iterator): these, to be more in the C++ spirit.
8097 Also, return reverse iterators so that when displaying the stack
8098 we display its bottom first.
8099 (Parser::stack_print_, Parser::reduce_print_): Match the messages
8100 from yacc.c.
8101 We should probably use vector here though.
8102
8103 2004-09-16 Akim Demaille <akim@epita.fr>
8104
8105 Have more complete shift traces.
8106
8107 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
8108 to report Shifts instead of ad hoc YYDPRINTF invocations,
8109 including for the error token.
8110 * data/lalr1.cc (symprint_): Output the location.
8111 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
8112 output the location within the %printer.
8113 Activate GLR tests, at least to make sure they compile properly.
8114 They still don't pass though.
8115 * tests/calc.at: Adjust expect verbose output, since now "Entering
8116 state..." is on a different line than the "Shifting" message.
8117
8118 2004-09-08 Akim Demaille <akim@epita.fr>
8119
8120 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
8121 Bison directive from the Bison file to the invocation of this
8122 macro, so that these directives are passed to
8123 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
8124 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
8125 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
8126 the extra Bison directives instead of the whole series.
8127 Change the grammar so that there are recoverable errors, and
8128 unrecoverable errors. Now we can have the parser give up before
8129 consuming the whole input. As a result we now can observe that
8130 the lookahead is freed when needed.
8131 Change the parser source to parse argv[1] instead of a hard coded
8132 string.
8133 Simplify yylex, and give a value and location to EOF.
8134 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
8135 passed directives already coded in the file.
8136 Add some tests to check the location of "error".
8137 For some tests, the C++ parser is correct, and not yacc.c.
8138 For other tests, they provide different, but unsatisfying, values,
8139 so keep the C++ value so that at least one parser is "correct"
8140 according to the test suite.
8141 (Actions after errors): Remove, this is subsumed by the
8142 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
8143
8144 2004-09-06 Akim Demaille <akim@epita.fr>
8145
8146 * data/lalr1.cc: Adjust the indentation of the labels.
8147 (Parser::pop): New.
8148 Use it.
8149
8150 2004-09-06 Akim Demaille <akim@epita.fr>
8151
8152 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
8153 argument, an informative message.
8154 Call YY_SYMBOL_PRINT.
8155 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
8156 * data/lalr1.cc (destruct_): Likewise.
8157 In addition, no longer depend on b4_yysymprint_generate and
8158 b4_yydestruct_generate to generate these functions, do it "by
8159 hand".
8160
8161 2004-09-03 Akim Demaille <akim@epita.fr>
8162
8163 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
8164 invoked, yydestruct the lookahead.
8165 * tests/calc.at (Calculator $1): Update the expected lengths of
8166 traces: there is an added line for the discarded lookahead.
8167 * doc/bison.texinfo (Destructor Decl): Some rewording.
8168 Define "discarded" symbols.
8169
8170 2004-09-02 Akim Demaille <akim@epita.fr>
8171
8172 * data/lalr1.cc (translate_, destruct_): No reason to be static.
8173
8174 2004-09-02 Akim Demaille <akim@epita.fr>
8175
8176 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
8177 (YYDSYMPRINTF): Rename as...
8178 (YY_SYMBOL_PRINT): this.
8179 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
8180 two.
8181 Use it instead of direct symprint_ calls.
8182 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
8183 one.
8184
8185 2004-09-02 Akim Demaille <akim@epita.fr>
8186
8187 * data/lalr1.cc (b4_yysymprint_generate): New.
8188 (symprint_): New member function, defined when YYDEBUG.
8189 Use it consistently instead of token/nterm debugging output by
8190 hand.
8191 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
8192 %printer calls to use cdebug_ when using lalr1.cc.
8193
8194 2004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
8195
8196 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
8197 with #ifdef YYDEBUG.
8198
8199 2004-08-26 Akim Demaille <akim@epita.fr>
8200
8201 * doc/bison.texinfo (Implementing Loops): Rename as...
8202 (Implementing Gotos/Loops): this.
8203
8204 2004-08-13 Paul Eggert <eggert@cs.ucla.edu>
8205
8206 Adjust to latest gnulib.
8207 * bootstrap (gnulib_modules): Add xalloc-die.
8208 Set LC_ALL=C so that file names sort consistently.
8209 Prefer the gnulib copies of gettext.m4, glibc21.m4,
8210 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
8211 uintmax_t.m4, ulonglong.m4.
8212 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
8213 po.m4 since we are now using _gl.m4 instead.
8214
8215 2004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
8216
8217 * src/scan-action.l: Remove. Scanning of semantic actions is
8218 handled in scan-gram.l.
8219
8220 2004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
8221
8222 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
8223
8224 * src/location.h (struct): The file member is a uniqstr.
8225 (equal_boundaries): Use UNIQSTR_EQ for comparison.
8226
8227 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
8228
8229 Fix bug with non-%union parsers that have printers or destructors,
8230 which led to a Bison core dump. Reported by Peter Fales in
8231 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
8232
8233 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
8234 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
8235 not to our own type.
8236 * src/output.c (symbol_destructors_output, symbol_printers_output):
8237 Don't assume %union.
8238 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
8239 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
8240 UNION-FLAG. All callers changed.
8241 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
8242 Use type char, not unsigned int, when declaring an array of char;
8243 this lets us remove a cast.
8244 (Printers and Destructors): Add non-%union test cases.
8245
8246 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8247
8248 * doc/bison.texinfo: Minor editorial changes, mostly to the new
8249 GLR writeups. E.g., avoid frenchspacing and the future tense,
8250 change "lookahead" to "look-ahead", and change "wrt" to "with
8251 respect to".
8252
8253 2004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8254
8255 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
8256 New sections, split off from the GLR Parsers section. Put the new
8257 Simple GLR Parser near the start of the GLR section, for clarity.
8258 Rewrite connective text.
8259
8260 2004-06-21 Frank Heckenbach <frank@g-n-u.de>
8261
8262 * doc/bison.texinfo (Simple GLR Parsers): New section.
8263
8264 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8265
8266 * NEWS, TODO, doc/bison.texinfo:
8267 Use "look-ahead" instead of "lookahead", to be consistent.
8268 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
8269 while we're fixing "look-ahead".
8270 * src/conflicts.c (shift_set): Renamed from shiftset.
8271 (look_ahead_set): Renamed from lookaheadset.
8272 * src/print.c: Likewise.
8273 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
8274 name for "lookahead".
8275 (report_types, usage): Likewise.
8276 * src/getargs.h (report_look_ahead_tokens): Renamed from
8277 report_lookaheads.
8278 * src/lalr.c (compute_look_ahead_tokens): Renamed from
8279 compute_lookaheads.
8280 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
8281 (look_ahead_tokens_print): Renamed from lookaheads_print.
8282 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
8283 state_rule_lookaheads_print.
8284 * src/state.h: Likewise.
8285 (reductions.look_ahead_tokens): Renamed from lookaheads.
8286 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
8287 AT_DATA_LOOKAHEADS_GRAMMAR.
8288
8289 2004-06-03 Paul Eggert <eggert@cs.ucla.edu>
8290
8291 * README: Update location of patched M4 distribution.
8292
8293 2004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
8294
8295 Don't assume the C++ compiler takes the same arguments as the C compiler
8296 (trivial change).
8297 * configure.ac (O0CXXFLAGS): New var.
8298 * tests/atlocal.in (CXXFLAGS): Use it.
8299
8300 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
8301
8302 Fix some "make check" problems with C++ reported by
8303 Albert Chin-A-Young for Tru64 C++ in this thread:
8304 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
8305
8306 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
8307 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8308 Output to a .cc file for C++, not to a .c file.
8309 * tests/calc.at (AT_CHECK_CALC): Likewise.
8310 * tests/regression.at (AT_CHECK_DANCER): Likewise.
8311 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
8312
8313 2004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
8314
8315 * tests/calc.at, tests/actions.at: Workaround for SGI
8316 C++ compiler. (trivial change)
8317
8318 2004-05-27 Paul Eggert <eggert@cs.ucla.edu>
8319
8320 Spent a few hours checking out which prerequisite versions the
8321 current sources actually require. I went all the way back to
8322 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
8323 a seemingly endless set of combinations of versions more recent
8324 than that. The bottom line is that the current sources require
8325 fairly recent versions of the build tools, and it'll be some work
8326 to change this.
8327 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
8328 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
8329 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
8330 Add comments explaining why those particular versions are
8331 currently needed.
8332
8333 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
8334 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
8335 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
8336
8337 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
8338 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
8339
8340 2004-05-26 Paul Eggert <eggert@cs.ucla.edu>
8341
8342 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
8343 0.11.5. Suggested by Bruno Haible.
8344 * bootstrap: Remove gettext version checking.
8345
8346 * doc/bison.texinfo (Decl Summary): Also mention that %union
8347 can depend on prerequisite types. Problem reported by Tim
8348 Van Holder.
8349
8350 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
8351
8352 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
8353 * README-alpha: Don't tell people not to package this.
8354
8355 * bootstrap: Don't assume $(...) works; use `...` instead.
8356 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
8357 gettext better.
8358
8359 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
8360 put into the -d output file, and mention what to do if YYSTYPE is
8361 defined as a macro.
8362
8363 2004-05-24 Paul Eggert <eggert@cs.ucla.edu>
8364
8365 Undo change made earlier today: it caused autopoint to not bring
8366 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
8367 autopoint's.
8368
8369 * bootstrap: Check that gettext version matches what's in
8370 configure.ac. Warn users to ignore robots.txt ERROR 404.
8371 * bootstrap: Undo today's earlier change (logged below).
8372 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
8373
8374 The gettext version checking is causing more trouble than it's
8375 curing; remove it. Problem reported by Paul Hilfinger.
8376
8377 * bootstrap: Issue a warning that one can expect a message
8378 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
8379 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
8380
8381 2004-05-23 Paul Eggert <eggert@cs.ucla.edu>
8382
8383 Ensure that the C++ compiler used for testing actually works on a
8384 simple test program; if not, skip the C++-related tests. Problem
8385 reported by Vin Shelton in:
8386 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
8387
8388 * m4/cxx.m4: New file.
8389 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
8390 * tests/atlocal.in (BISON_CXX_WORKS): Add.
8391 * tests/local.at (AT_COMPILE_CXX): Use it.
8392
8393 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8394
8395 * data/glr.c (yylloc): Output this macro even if locations are not
8396 being generated, as the GLR parser needs it even in that case.
8397 Problem reported by Troy A. Johnson
8398 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
8399
8400 * configure.ac (AC_INIT): Update to 1.875e.
8401
8402 2004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8403
8404 * NEWS: Version 1.875d.
8405 * configure.ac (AC_INIT): Likewise.
8406 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
8407
8408 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
8409 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
8410 lalr1.cc runs afoul of the first, and the last two are no longer
8411 supported by GCC 3.4.0.
8412 * README: Mention GNU m4 1.4 or later; mention m4 patches.
8413 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
8414
8415 2004-05-06 Paul Eggert <eggert@cs.ucla.edu>
8416
8417 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
8418 unsigned int, for compatibility with latest gnulib hash module.
8419 * src/state.c (state_hash, state_hasher): Likewise.
8420 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
8421 * src/uniqstr.c (hash_uniqstr): Likewise.
8422
8423 2004-05-03 Paul Eggert <eggert@cs.ucla.edu>
8424
8425 * NEWS: Unescaped newlines are no longer allowed in char & strings.
8426
8427 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
8428 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
8429 character and string literals.
8430 (unexpected_end): New function.
8431 (unexpected_eof): Use it.
8432 (unexpected_newline): New function.
8433 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
8434 actions.
8435
8436 * NEWS: Document %expect-rr.
8437
8438 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
8439 Fix typo by replacing $1 with $option.
8440 Remove more 'intl'-related files.
8441 Don't DEFUN AM_INTL_SUBDIR twice.
8442
8443 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
8444 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
8445 strtoul.c.
8446 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
8447 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
8448 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
8449 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
8450 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
8451 * src/.cvsignore: Add *.output.
8452
8453 * src/parse-gram.y: Put copyright notice inside %{ %} so it
8454 gets copied to the output file.
8455
8456 2004-04-28 Paul Eggert <eggert@twinsun.com>
8457
8458 Get files from the gnulib and po repositories, instead of relying
8459 on them being in our CVS. Upgrade to latest versions of gnulib
8460 and Automake.
8461
8462 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
8463 * bootstrap: Bootstrap from gnulib and po repositories.
8464 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
8465 * README-cvs: Document these changes. Remove version numbers from
8466 mentions of build tools, since they change so often. Mention Flex.
8467
8468 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
8469 (gl_USE_SYSTEM_EXTENSIONS): Add.
8470 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
8471 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
8472 does this for us.
8473 (AC_ISC_POSIX): Remove; we no longer support this
8474 ancient OS, as it gets in the way of latest Autoconf & gnulib.
8475 (AC_HEADER_STDC): Remove: we now assume C89 or better.
8476 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
8477 Do not check for C89 headers, except for locale.h which is used
8478 by the Yacc library and must port to K&R hosts.
8479 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
8480 Do not check for C89 functions, except for setlocale which is
8481 used by the Yacc library.
8482 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
8483 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
8484 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
8485 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
8486 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
8487 AM_GNU_GETTEXT): Remove; now done by:
8488 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
8489 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
8490 for us.
8491
8492 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
8493 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
8494 Define to empty, as gnulib.mk will do the rest for us.
8495 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
8496 for us.
8497 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
8498 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
8499
8500 * src/files.c: Include gnulib's xstrndup.h.
8501
8502 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
8503 (REALLOC): Use xnrealloc, for likewise.
8504 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
8505 (strnlen, memrchr): Remove decls; functions no longer used.
8506 Include <stpcpy.h>.
8507
8508 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
8509 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
8510 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
8511 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
8512 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
8513 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
8514 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
8515 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
8516 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
8517 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
8518 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
8519 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8520 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
8521 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
8522 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
8523 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
8524 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
8525 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
8526 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
8527 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
8528 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
8529 Remove, as these files are now generated automatically
8530 by bootstrap or automake.
8531
8532 * po/ChangeLog: Remove: all but one entry was a duplicate
8533 of this file, and I moved that 2000-11-02 entry here.
8534
8535 * config/.cvsignore: Add Makefile, depcomp, install-sh.
8536 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
8537 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
8538 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
8539 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
8540 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
8541 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
8542 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
8543 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
8544 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
8545 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
8546 xstrndup.h.
8547 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
8548 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
8549 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
8550 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
8551 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
8552 * src/.cvsignore: Remove *_.c.
8553
8554
8555 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
8556 support it. (The latest stable gzip doesn't.)
8557
8558 2004-04-27 Paul Eggert <eggert@twinsun.com>
8559
8560 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
8561 case, as stos_ is now used by destructors due to the 2004-02-09
8562 change.
8563
8564 Remove more K&R C support.
8565 * lib/libiberty.y (PARAMS): Remove. All uses removed.
8566 * lib/subpipe.c (errno): Remove decl.
8567 Include <stdlib.h> unconditionally.
8568 (EXIT_FAILURE): Remove macro.
8569 * src/complain.c (vfprintf, strerror): Remove.
8570 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
8571 unconditionally.
8572 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
8573 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
8574 (strchr, strspn, memchr): Remove decls.
8575 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
8576 unconditionally. Do not declare perror.
8577 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
8578 unconditionally.
8579
8580 * src/complain.c (_): Remove useless defn, as system.h defines this.
8581
8582 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
8583 with latest obstack.h.
8584 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
8585 to procedure types, as obstack.h now does that for us.
8586 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
8587
8588 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
8589 so that this include file can stand alone.
8590 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
8591 does this now. Include subpipe.h first after config.h, to
8592 test whether it can stand alone.
8593
8594 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
8595 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
8596 unused declaration.
8597
8598 * tests/synclines.at (%union synch line): Put a dummy member in
8599 the union, because empty unions aren't allowed in C. Caught
8600 by GCC 3.4.0.
8601
8602 2004-04-13 Jim Meyering <jim@meyering.net>
8603
8604 * src/conflicts.c (conflicts_print): Correct format string typo:
8605 use `%%' to produce literal `%'. (trivial change)
8606
8607 2004-03-30 Paul Eggert <eggert@twinsun.com>
8608
8609 * src/getargs.c (version): Update copyright year to 2004.
8610
8611 * data/c.m4 (b4_int_type): Use 'short int' rather than
8612 'short', and similarly for 'long', 'unsigned', etc.
8613 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
8614 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
8615 yy_yypstack, yydumpstack): Likewise.
8616 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
8617 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
8618 Likewise.
8619 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
8620 yy_stack_print, yyparse): Likewise.
8621 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
8622 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
8623 * lib/bitset.c (bitset_print): Likewise.
8624 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
8625 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8626 * lib/bitsetv.c (bitsetv_dump): Likewise.
8627 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
8628 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
8629 Likewise.
8630 * src/LR0.c (allocate_itemsets): Likewise.
8631 * src/gram.h (rule_number, rule): Likewise.
8632 * src/lalr.h (goto_number): Likewise.
8633 * src/nullable.c (nullable_compute): Likewise.
8634 * src/output.c (prepare_rules): Likewise.
8635 * src/relation.c (relation_print, relation_digraph): Likewise.
8636 * src/relation.h (relation_node): Likewise.
8637 * src/state.h (state_number, transitions, errs, reductions,
8638 struct state): Likewise.
8639 * src/symtab.h (symbol_number, struct symbol): Likewise.
8640 * src/tables.c (vector_number, tally, action_number,
8641 default_goto, goto_actions): Likewise.
8642 * tests/existing.at (GNU Cim Grammar): Likewise.
8643 * tests/regression.at (Web2c Actions): Likewise.
8644
8645 * src/output.c (muscle_insert_short_int_table): Renamed from
8646 muscle_insert_short_table. All uses changed.
8647
8648 2004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8649
8650 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
8651 (declaration): Replace expected_conflicts with expected_sr_conflicts.
8652 Add %expect-rr rule.
8653
8654 * src/scan-gram.l: Recognize %expect-rr.
8655
8656 * src/conflicts.h (expected_sr_conflicts): Rename from
8657 expected_conflicts.
8658 (expected_rr_conflicts): Declare.
8659
8660 * src/conflicts.c (expected_sr_conflicts): Rename from
8661 expected_conflicts.
8662 (expected_rr_conflicts): Define.
8663 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
8664 for GLR parsers.
8665 Use expected_sr_conflicts in place of expected_conflicts.
8666 Warn if expected_rr_conflicts used in non-GLR parser.
8667
8668 * doc/bison.texinfo: Add documentation for %expect-rr.
8669
8670 2004-03-08 Paul Eggert <eggert@gnu.org>
8671
8672 Add support for hex token numbers. Suggested by Odd Arild Olsen in
8673 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
8674
8675 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
8676 in lalr1.cc.
8677 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
8678 * src/scan-gram.l (scan_integer): New function.
8679 ({int}): Use it.
8680 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
8681 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
8682 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
8683 Say "long int", not "long", for uniformity with GNU style.
8684
8685 2004-02-25 Paul Eggert <eggert@twinsun.com>
8686
8687 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
8688 compilers. This fixes a problem with Intel's C++ compiler being
8689 chatty, reported by Guido Trentalancia in
8690 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
8691
8692 2004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
8693
8694 Support %destructor and merge error locations in lalr1.cc.
8695
8696 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
8697 (Parser::stos_): Define unconditionally.
8698 (Parser::destruct_): New method. Generate its body with
8699 b4_yydestruct_generate.
8700 (Parser::error_start_): New attribute.
8701 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
8702 token which are discarded.
8703 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
8704 error_start_ when erroneous token are discarded.
8705 (Parser::parse) <yyerrlab1>: Compute the location of the error
8706 token so that it covers all the discarded tokens.
8707 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
8708 it can be called with `%skeleton "lalr1.cc"', and do that.
8709
8710 2004-02-02 Paul Eggert <eggert@twinsun.com>
8711
8712 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
8713 $(top_srcdir)/lib and ../lib. This fixes a bug reported
8714 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
8715 There's no need to mention top_builddir since Automake does that
8716 for us.
8717 (INCLUDES): Remove, as Automake says it's obsolescent.
8718 Contents migrated into AM_CPPFLAGS as described above.
8719 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
8720
8721 2004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8722
8723 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
8724 (yyreportSyntaxError): Handle case where lookahead token is
8725 YYEMPTY.
8726
8727 2004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8728
8729 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
8730 resulting parsers are compilable with C++.
8731
8732 2003-12-23 Paul Eggert <eggert@twinsun.com>
8733
8734 * config/depcomp, config/install-sh: Sync with Automake 1.8.
8735 * src/output.c (output_skeleton): Rename local var.
8736 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
8737 Bison tokens, as this runs afoul of the 2003-10-07 change that
8738 disallowed NUL bytes in character constants or string literals.
8739
8740 * tests/local.at: Require Autoconf 2.59's Autotest.
8741 * tests/testsuite.at: Don't include local.at, since we now assume
8742 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
8743 including it.
8744 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
8745 multiple inclusion warnings.
8746
8747 2003-12-02 Akim Demaille <akim@epita.fr>
8748
8749 * doc/bison.texinfo (How Can I Reset the Parser): More about start
8750 conditions.
8751 From Bruno Haible.
8752
8753 2003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
8754
8755 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
8756
8757 2003-10-07 Paul Eggert <eggert@twinsun.com>
8758
8759 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
8760 if testsuite doesn't exist.
8761
8762 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
8763 literals, unfortunately.
8764 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
8765 Complain about NUL bytes in character constants or string literals.
8766
8767 2003-10-05 Paul Eggert <eggert@twinsun.com>
8768
8769 * NEWS: Don't document %no-default-prec, as it's still
8770 too experimental.
8771 * doc/bison.texinfo: Document %no-default-prec only if
8772 the defaultprec flag is set. Normally it's not.
8773
8774 2003-10-04 Paul Eggert <eggert@twinsun.com>
8775
8776 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
8777 non-modifiable lvalue, instead of a modifiable one.
8778 * doc/bison.texinfo (Actions): Document that $$ can
8779 be assigned to. Do not claim that $$ and $N are
8780 array element references: user code should not rely on this.
8781
8782 2003-10-01 Paul Eggert <eggert@twinsun.com>
8783
8784 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
8785 (grammar_declaration): Use it.
8786 * src/scan-gram.l: New token %no-default-prec.
8787 * tests/conflicts.at: Revamp tests to use %no-default-prec.
8788 * NEWS, doc/bison.texinfo: Document the above.
8789
8790 2003-10-01 Akim Demaille <akim@epita.fr>
8791
8792 VCG no longer supports long_straight_phase.
8793
8794 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
8795 * src/print_graph.c (print_graph): Adjust.
8796
8797 2003-09-30 Frank Heckenbach <frank@g-n-u.de>
8798 and Paul Eggert <eggert@twinsun.com>
8799
8800 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
8801 Table of Symbols): Document %default-prec.
8802 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
8803 (grammar_declaration): Set default_prec on %default-prec.
8804 * src/scan-gram.l (%default-prec): New token.
8805 * src/reader.h (default_prec): New flag.
8806 * src/reader.c: Likewise.
8807 (packgram): Handle it.
8808 * tests/conflicts.at (%default-prec without %prec,
8809 %default-prec with %prec, %default-prec 1): New tests.
8810
8811 2003-09-30 Paul Eggert <eggert@twinsun.com>
8812
8813 * tests/testsuite.at: Include local.at, not input.at, fixing
8814 a typo in the 2003-08-25 patch.
8815
8816 2003-08-27 Akim Demaille <akim@epita.fr>
8817
8818 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
8819 GCC warnings.
8820
8821 2003-08-26 Akim Demaille <akim@epita.fr>
8822
8823 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
8824 "<\#" to avoid magic from Gnus when posting parts of this script.
8825
8826 2003-08-26 Akim Demaille <akim@epita.fr>
8827
8828 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
8829 (Parser::parse): here.
8830 Adjust: nerrs and errstatus is now replaced by...
8831 (Parser::nerrs_, Parser::errstatus_): New.
8832
8833 2003-08-25 Akim Demaille <akim@epita.fr>
8834
8835 * config/announce-gen, Makefile.cfg: New.
8836 * Makefile.am: Adjust.
8837 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
8838 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
8839
8840 2003-08-25 Akim Demaille <akim@epita.fr>
8841
8842 When reducing initial empty rules, Bison parser read an initial
8843 location that is not defined. This results in garbage, and that
8844 affects Bison's own parser. Therefore we need (i) to extend Bison
8845 to support a means to initialize this location, and (ii) to use
8846 this CVS Bison to fix CVS Bison's parser.
8847
8848 * src/reader.h, reader.c (epilogue_augment): Remove, replace
8849 with...
8850 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
8851 * src/parse-gram.y: Adjust.
8852 (%initial-action): New.
8853 (%error-verbose): Since we require CVS Bison, there is no reason
8854 not to use it.
8855 * src/scan-gram.l: Adjust.
8856 * src/Makefile.am (YACC): New, to make sure we use our own parser.
8857 * data/yacc.c (yyparse): Use b4_initial_action.
8858
8859 2003-08-25 Akim Demaille <akim@epita.fr>
8860
8861 * doc/bison.texinfo: Don't promote stdout for error messages.
8862
8863 2003-08-25 Akim Demaille <akim@epita.fr>
8864
8865 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
8866 From Alexandre Duret-Lutz.
8867
8868 2003-08-25 Akim Demaille <akim@epita.fr>
8869
8870 Version 1.875c.
8871
8872 2003-08-25 Akim Demaille <akim@epita.fr>
8873
8874 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
8875 Use them.
8876
8877 2003-08-25 Akim Demaille <akim@epita.fr>
8878
8879 * data/lalr1.cc (Parser::reduce_print_): New.
8880 Use it.
8881
8882 2003-08-25 Akim Demaille <akim@epita.fr>
8883
8884 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
8885 error recovery loops. This patch is based on
8886 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
8887 Also, augment the similarity between lalr1.cc and yacc.c.
8888 Note: the locations of error recovery rules are not correct yet.
8889
8890 * data/lalr1.cc: Comment changes to augment the similarity between
8891 lalr1.cc and yacc.c.
8892 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
8893 (yyerrlab1): Remove, but where it used to be (now the bottom part of
8894 yyerrlab), when hitting EOF, pop the whole stack here instead of
8895 merely falling thru the default error handling mechanism.
8896 (yyerrorlab): New label, with the old contents of YYERROR,
8897 plus the following change: pop the stack of rhs corresponding
8898 to the production that invoked YYERROR. That is how Yacc
8899 behaves (required by POSIX).
8900 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
8901 fail.
8902
8903 2003-08-25 Akim Demaille <akim@epita.fr>
8904
8905 Tune local.at so that people can "autom4te -l autotest calc.at -o
8906 calc" for instance, to extract a sub test suite.
8907
8908 * tests/testsuite.at: Move the initialization, Autotest version
8909 requirement, and AT_TESTED invocation into...
8910 * tests/local.at: here.
8911 * tests/testsuite.at: Include it for compatibility with Autoconf
8912 2.57.
8913 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
8914 be ignore.
8915
8916 2003-08-04 Paul Eggert <eggert@twinsun.com>
8917
8918 Rework code slightly to avoid gcc -Wtraditional warnings.
8919 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
8920 The returned value is now stored in *YY0. All callers changed.
8921 * src/output.c (merge_output): Adjust to the above change.
8922
8923 2003-07-26 Paul Eggert <eggert@twinsun.com>
8924
8925 * data/glr.c (YYASSERT): New macro.
8926 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
8927 yyresolveStates, yyprocessOneStack):
8928 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
8929 Derived from a suggestion by Frank Heckenbach.
8930
8931 2003-07-25 Paul Eggert <eggert@twinsun.com>
8932
8933 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
8934 for portability to K&R C (after ansi2knr, presumably). See
8935 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
8936 by Frank Heckenbach, though I have omitted the structure-initialization
8937 part of his glr-knr.diff patch since I recall that the Portable
8938 C Compiler didn't require that change.
8939
8940 Let the user specify how to allocate and free memory.
8941 Derived from a suggestion by Frank Heckenbach in
8942 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
8943 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
8944 All uses of free, malloc, realloc changed to use these macros,
8945 and unnecessary casts removed.
8946 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
8947
8948 2003-07-06 Matthias Mann <MatthiasMann@gmx.de>
8949
8950 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
8951 use s.empty() rather than s == "" to test for empty string; see
8952 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
8953 (trivial change)
8954
8955 2003-06-25 Akim Demaille <akim@epita.fr>
8956
8957 * config/depcomp, config/install-sh: Update from masters.
8958
8959 2003-06-20 Paul Eggert <eggert@twinsun.com>
8960
8961 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
8962 and return properly parenthesized result.
8963 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
8964 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8965 Remove unnecessary parentheses from uses.
8966 * doc/bison.texinfo (Location Default Action): Describe the
8967 conventions for parentheses.
8968
8969 2003-06-19 Paul Eggert <eggert@twinsun.com>
8970
8971 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
8972 yyreportTree): Do not assume that size_t is the same width as int,
8973 when printing sizes. Print sizes using an unsigned format.
8974 Problem reported by Frank Heckenbach in
8975 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
8976
8977 Port to Forte Developer 7 C compiler.
8978 * data/glr.c (struct YYLTYPE): If locations are not being used,
8979 declare a single dummy member, as empty structs do not conform
8980 to the C standard.
8981 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
8982 the Forte Developer 7 C compiler complains that end-of-loop
8983 code is not reached.
8984
8985 2003-06-17 Paul Eggert <eggert@twinsun.com>
8986
8987 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
8988 avoid warnings from picky compilers about redefinition of PARAMS.
8989
8990 2003-06-17 Paul Eggert <eggert@twinsun.com>
8991
8992 Version 1.875b.
8993
8994 * NEWS: Document 1.875b.
8995
8996 * lib/bbitset.h: Do not include config.h; that's the includer's job.
8997 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
8998 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
8999 Don't use 'index' in comments, as it's a builtin fn on some hosts.
9000 * lib/bitset_stats.c: Include gettext.h unconditionally, as
9001 per recent gettext manual's suggestion.
9002 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
9003 Use prototypes, not old-style definitions.
9004 * lib/lbitset.c (lbitset_unused_clear): Likewise.
9005 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
9006 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
9007 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
9008 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
9009 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
9010 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
9011 vbitset_or_and_cmp, vbitset_copy): Likewise.
9012
9013 * lib/libiberty.h: Do not include config.h; that's the includer's job.
9014 Do not include <stdlib.h>.
9015 (PARAMS): Define unconditionally for C89.
9016 (ATTRIBUTE_NORETURN): Remove.
9017 (ATTRIBUTE_UNUSED): Define unconditionally.
9018
9019 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
9020 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
9021 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
9022 * lib/vbitset.c, lib/vbitset.h: New files.
9023 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
9024 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
9025 from libbitset.
9026
9027 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
9028 `How Can I Reset @code{yyparse}', since texinfo does not allow
9029 arbitrary @ in node names.
9030
9031 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
9032 shouldn't be needed according to the gettext 0.12.1 documentation
9033 but which seem to be needed anyway: codeset.m4 glibc21.m4
9034 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
9035 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
9036 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
9037
9038 * lib/.cvsignore: Add stdbool.h.
9039 * m4/.cvsignore: Add nls.m4, po.m4.
9040
9041 Upgrade to CVS gnulib.
9042 * stdbool_.h: File renamed from stdbool.h.in.
9043 * configure.ac (AM_STDBOOL_H): Invoke this instead of
9044 AC_HEADER_STDBOOL.
9045 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
9046 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
9047 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
9048 (MOSTLYCLEANFILES): New var.
9049 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
9050 (stdbool.h): New rule.
9051 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
9052 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
9053 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
9054 m4/quote.m4: Upgrade to today's gnulib.
9055
9056 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
9057 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
9058 the tests right now.
9059 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
9060 yyerror are declared before use; C99 requires this.
9061
9062 2003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9063
9064 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
9065 first.
9066 (yyrecoverSyntaxError): Correct the logic for setting and testing
9067 yyerrState.
9068 Correct comment on handling EOF.
9069 Allow states with only a default reduction, rather than failing
9070 (I can't quite reconstruct why these were not allowed before).
9071
9072 Fixes to avoid problem that $-N rules in GLR parsers can cause
9073 buffer overruns, corrupting state.
9074
9075 * src/output.c (prepare_rules): Output max_left_semantic_context
9076 definition.
9077 * src/reader.h (max_left_semantic_context): New variable declaration.
9078 * src/scan-gram.l (max_left_semantic_context): Define.
9079 (handle_action_dollar): Update max_left_semantic_context.
9080 * data/glr.c (YYMAXLEFT): New definition.
9081 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
9082 (yyresolveAction): Ditto.
9083
9084 Fixes to problems with location handling in GLR parsers reported by
9085 Frank Heckenbach (2003/06/05).
9086
9087 * data/glr.c (YYLTYPE): Make trivial if locations not used.
9088 (YYRHSLOC): Add parentheses, and define only if locations used.
9089 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
9090 locations not used.
9091 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
9092 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
9093
9094 * tests/cxx-type.at: Exercise location information; update tests
9095 to differentiate output with and without locations.
9096 Remove forward declarations of yylex and yyerror---caused errors
9097 because default YYLTYPE not yet defined.
9098 Change semantic actions to compute strings, rather than printing
9099 them directly (to test proper passing of semantics values). Change
9100 output to prefix notation and update test data and expected results.
9101 (yylex): Track locations.
9102 (stmtMerge): Return value rather than printing, and include arguments
9103 in value.
9104
9105 2003-06-03 Paul Eggert <eggert@twinsun.com>
9106
9107 Avoid warnings generated by GCC 2.95.4 when Bison is
9108 configured with --enable-gcc-warnings.
9109 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
9110 yy::]b4_parser_class_name[::translate_,
9111 yy::Stack::operator[] (unsigned),
9112 yy::Stack::operator[] (unsigned) const,
9113 yy::Slice::operator[] (unsigned),
9114 yy::Slice::operator[] (unsigned) const):
9115 Rename local vars to avoid warnings.
9116 * tests/glr-regression.at (Improper handling of embedded actions
9117 and $-N in GLR parsers): Remove unused local variable from yylex.
9118 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
9119 (void) as arg when not pure, since we now assume C89 when building
9120 Bison. Pacify GCC by using parameter.
9121
9122 2003-06-02 Paul Eggert <eggert@twinsun.com>
9123
9124 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
9125 yy::Location::lines, yy::Location::columns): Rename arguments
9126 to avoid shadowing; this removes a warning generated by GCC 3.3.
9127
9128 2003-06-01 Paul Eggert <eggert@twinsun.com>
9129
9130 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
9131 to g++, as GCC 3.3 complains if you do it.
9132 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
9133 everything that WARNING_CFLAGS has, except omit warnings
9134 not suitable for C++.
9135 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
9136 * tests/atlocal.in (CXXFLAGS): New var.
9137 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
9138
9139 Fix a GLR parser bug I reported in February; see
9140 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
9141 The problem was that GLR parsers did not conform to the C standard,
9142 because actions like { $1 = $2 + $3; } expanded to expressions
9143 that invoked YYFILL in separate subexpressions, and YYFILL assigned
9144 to a local variable. The C standard says that expressions
9145 like (var = f ()) + (var = f ()) have undefined behavior.
9146 Another problem was that GCC sometimes issues warnings that
9147 yyfill and its parameters are unused.
9148
9149 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
9150 as possibly unused.
9151 (yyfill): New function.
9152 (YYFILL): Use it.
9153 (yyuserAction): Change type of yynormal to bool, so that it matches
9154 the new yyfill signature. Mark it as possibly unused.
9155
9156
9157 Follow up on a bug I reported in February, where a Bison-generated
9158 parser can loop. Provide a test case and a fix for yacc.c. I
9159 don't have a fix for lalr1.cc or for glr.c, unfortunately.
9160 The original bug report is in:
9161 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
9162
9163 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
9164 macro's size was becoming unwieldy.
9165 (yyerrlab): Do not discard an empty lookahead symbol, as this
9166 might destroy garbage.
9167 (yyerrorlab): New label, with the old contents of YYERROR,
9168 plus the following change: pop the stack of rhs corresponding
9169 to the production that invoked YYERROR. That is how Yacc
9170 behaves, and POSIX requires this behavior.
9171 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
9172 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
9173 Define 'alarm' to do nothing if unistd.h is not available.
9174 Add a new rule "exp: '-' error;" to test the above change to
9175 data/yacc.c. Use 'alarm' to abort any test taking longer than
9176 10 seconds, as it's probably looping.
9177 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
9178 Also, the new yacc.c generates two fewer diagnostics for an
9179 existing test.
9180
9181 2003-05-24 Paul Eggert <eggert@twinsun.com>
9182
9183 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
9184 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
9185 This fixes a problem reported by John Bowman when the Compaq/HP
9186 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
9187 -ansi -Wall -gall).
9188 * data/yacc.c (union yyalloc): Likewise.
9189 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
9190
9191 Switch from 'int' to 'bool' where that makes sense.
9192
9193 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
9194 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
9195 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
9196 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
9197 Return or accept bool, not int. All callers changed.
9198 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
9199 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
9200 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
9201 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
9202 bitset_or_and_cmp_): Likewise.
9203 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
9204 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
9205 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
9206 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
9207 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
9208 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
9209 bitset_stats_or_and_cmp): Likewise.
9210 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
9211 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
9212 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
9213 ebitset_xor_cmp): Likewise.
9214 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
9215 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
9216 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
9217 lbitset_xor_cmp): Likewise.
9218 * lib/bbitset.h: Include <stdbool.h>.
9219 (struct bitset_vtable): The following members now return bool, not
9220 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
9221 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
9222 or_and_cmp).
9223 * src/conflicts.c (count_rr_conflicts): Likewise.
9224 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
9225 All uses changed.
9226 * lib/ebitset.c (ebitset_obstack_init): Likewise.
9227 * lib/lbitset.c (lbitset_obstack_init): Likewise.
9228 * src/getargs.c (debug_flag, defines_flag, locations_flag,
9229 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9230 graph_flag): Likewise.
9231 * src/getargs.h (debug_flag, defines_flag, locations_flag,
9232 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9233 graph_flag): Likewise.
9234 * src/output.c (error_verbose): Likewise.
9235 * src/output.h (error_verbose): Likewise.
9236 * src/reader.c (start_flag, typed): Likewise.
9237 * src/reader.h (typed): Likewise.
9238 * src/getargs.c (LOCATIONS_OPTION): New constant.
9239 (long_options, getargs): Use it.
9240 * src/lalr.c (build_relations): Use bool, not int.
9241 * src/nullable.c (nullable_compute): Likewise.
9242 * src/print.c (print_reductions): Likewise.
9243 * src/tables.c (action_row, pack_vector): Likewise.
9244 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
9245 * src/output.c (prepare): Use it.
9246 * src/output.c (token_definitions_output,
9247 symbol_destructors_output, symbol_destructors_output): Use string,
9248 not boolean integer, to keep track of whether to output separator.
9249 * src/print_graph.c (print_core): Likewise.
9250 * src/state.c (state_rule_lookaheads_print): Likewise.
9251
9252 * config/install-sh: Sync from automake 1.7.5.
9253
9254 2003-05-14 Paul Eggert <eggert@twinsun.com>
9255
9256 * src/parse-gram.y (rules_or_grammar_declaration): Require a
9257 semicolon after a grammar declaration, in the interest of possible
9258 future changes to the Bison input language.
9259 Do not allow a stray semicolon at the start of the grammar.
9260 (rhses.1): Allow one or more semicolons after any rule, including
9261 just before "|" as required by POSIX.
9262 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
9263 grammar.
9264
9265 2003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
9266
9267 %parse-param support for lalr1.cc.
9268
9269 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
9270 b4_cc_constructor_calls, b4_cc_constructor_call,
9271 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
9272 definitions.
9273 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
9274 parse-param arguments.
9275 (yy::b4_parser_class_name): Declare instance variables to
9276 hold parse-param arguments.
9277 * tests/calc.at: s/value/semantic_value/ because value clashes
9278 with a member of yy::b4_parser_class_name. Adjust C++ code
9279 to handle %parse-param. Enable %parse-param test in C++.
9280
9281 2003-05-12 Paul Eggert <eggert@twinsun.com>
9282
9283 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
9284 English a bit. Fix fclose typo. Change "const char" to "char
9285 const", and use ANSI C rather than K&R for "main". Suggest
9286 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
9287 and suggest yy_switch_to_buffer.
9288
9289 2003-05-05 Paul Eggert <eggert@twinsun.com>
9290
9291 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
9292 C89. This avoids a diagnostic on compilers that define __STDC__
9293 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
9294 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
9295
9296 2003-05-03 Paul Eggert <eggert@twinsun.com>
9297
9298 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
9299 Do not overrun array bounds.
9300 This should fix a bug reported today by Olatunji Oluwabukunmi in
9301 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
9302
9303 2003-04-29 Akim Demaille <akim@epita.fr>
9304
9305 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
9306 * src/getargs.c, src/getargs.h: here, as bool, not int.
9307 (nondeterministic_parser): New.
9308 * src/parse-gram.y, src/scan-gram.l: Support
9309 %nondeterministic-parser.
9310 * src/output.c (prepare): Use nondeterministic_parser instead
9311 of glr_parser where appropriate.
9312 * src/tables.c (conflict_row, action_row, save_row)
9313 (token_actions, token_actions, pack_vector): Ditto.
9314
9315 2003-04-29 Akim Demaille <akim@epita.fr>
9316
9317 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
9318
9319 2003-04-29 Akim Demaille <akim@epita.fr>
9320
9321 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
9322 with %pure-parser and %locations to exercise the patch from Yakov
9323 Markovitch below.
9324
9325 2003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
9326
9327 * data/yacc.c: (b4_lex_param): Corrected for the case where
9328 %lex-param is provided and %pure-parser isn't.
9329
9330 2003-04-27 Paul Eggert <eggert@twinsun.com>
9331
9332 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
9333 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
9334 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
9335 if it is not defined.
9336 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
9337
9338 2003-04-26 Paul Eggert <eggert@twinsun.com>
9339
9340 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
9341 Declare to be of type suitable for the ninf value itself, not of
9342 type suitable for the corresponding table, since the latter might
9343 be unsigned but the ninf value might be negative. This fixes a
9344 bug reported by Alexandre Duret-Lutz in
9345 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
9346
9347 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
9348 invokes it. We shouldn't invoke it twice because it will attempt
9349 to put error.o in the archive twice. This fixes a glitch reported
9350 by Martin Mokrejs in
9351 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
9352
9353 2003-04-21 Paul Eggert <eggert@twinsun.com>
9354
9355 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
9356 to gnulib.
9357
9358 2003-04-21 Yakov Markovitch <Markovitch@iso.ru>
9359
9360 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
9361 Fix obvious typo that results in uncompilable GLR parsers
9362 when both %pure-parser and %locations are used. (trivial change)
9363
9364 2003-04-17 Paul Eggert <eggert@twinsun.com>
9365
9366 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
9367 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
9368 Do not insert the expected token via unput, as this runs afoul
9369 of a POSIX-compatibility bug in flex 2.5.31.
9370 All uses changed to BEGIN the parent state,
9371 since we no longer insert the expected token via unput.
9372 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
9373 that is no longer emitted after the above change.
9374
9375 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
9376 the first one. This change is from Paul Hilfinger, and it fixes
9377 regression reported by Werner Lemberg in
9378 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
9379
9380 (resolve_sr_conflict): Don't invoke state_errs_set
9381 unless one or more tokens have been explicitly made errors.
9382 Otherwise, the above change causes Bison to abort.
9383
9384 * tests/existing.at (GNU pic Grammar): New test case, taken from
9385 Lemberg's email.
9386
9387 2003-03-31 Akim Demaille <akim@epita.fr>
9388
9389 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
9390
9391 2003-03-31 Akim Demaille <akim@epita.fr>
9392
9393 * src/output.c (prepare_symbols): Avoid trailing spaces in the
9394 output.
9395
9396 2003-03-31 Akim Demaille <akim@epita.fr>
9397
9398 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
9399 From Paul Hilfinger.
9400
9401 2003-03-29 Akim Demaille <akim@epita.fr>
9402
9403 * m4/error.m4: Do not put under dynamic conditions some code which
9404 expansion is under static control.
9405
9406 2003-03-29 Akim Demaille <akim@epita.fr>
9407
9408 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
9409
9410 2003-03-29 Akim Demaille <akim@epita.fr>
9411
9412 * doc/bison.texinfo (Strings are Destroyed): New.
9413
9414 2003-03-13 Paul Eggert <eggert@twinsun.com>
9415
9416 * .cvsignore: Add configure.lineno.
9417 * src/.cvsignore: Add yacc.
9418 * tests/.cvsignore: Add testsuite.log.
9419 * doc/fdl.texi: Sync with latest FSF version.
9420
9421 2003-03-12 Paul Eggert <eggert@twinsun.com>
9422
9423 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
9424 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
9425 cursor, instead of leaving it undefined. This fixes a bug
9426 reported by Tim Van Holder in
9427 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
9428 * tests/input.at (Torturing the Scanner): Test the scanner on
9429 an empty input file, which was Tim Van Holder's test case.
9430
9431 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
9432 <sys/resource.h> can be included, include sys/time.h and
9433 sys/times.h first, if available. This works around the SunOS
9434 4.1.4 porting bug reported by Bruce Becker in
9435 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
9436
9437 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
9438 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
9439 AC_HEADER_SYS_WAIT.
9440
9441 Merge changes from gnulib. This was prompted because the CVS
9442 snapshot didn't build on Solaris 7 due to strnlen problems.
9443
9444 These changes need to be merged back into gnulib:
9445 * lib/hash.c: Include <stdbool.h> unconditionally.
9446 * m4/onceonly.m4 (m4_quote): New macro.
9447 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
9448 Quote AC_FOREACH variable-expansions properly.
9449 The 2003-01-03 obstack.h change also needs merging.
9450 {end of changes requiring merging}
9451
9452 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
9453 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
9454 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
9455 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
9456 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
9457 New files, imported from gnulib.
9458 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
9459 above.
9460
9461 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
9462 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
9463 gnulib sources.
9464
9465 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
9466 Add.
9467 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
9468 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
9469 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
9470 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
9471 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
9472 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
9473 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
9474 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
9475 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
9476 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
9477 (jm_PREREQ_ARGMATCH): Remove.
9478 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
9479 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
9480
9481 * src/system.h: Include <stdbool.h> unconditionally.
9482
9483 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
9484 assuming at least C89 in the bitset code for some time now.
9485
9486 2003-03-03 Akim Demaille <akim@epita.fr>
9487
9488 * ro.po: New.
9489
9490 2003-03-02 Akim Demaille <akim@epita.fr>
9491
9492 * doc/bison.texinfo (Table of Symbols): Reactivate the
9493 documentation for %lex-param, and %parse-param.
9494
9495 2003-03-02 Akim Demaille <akim@epita.fr>
9496
9497 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
9498 generate verbose error messages.
9499 Use the number of tokens as an upper bound in yytname, as it
9500 cannot be a non terminal.
9501
9502 2003-03-02 Akim Demaille <akim@epita.fr>
9503
9504 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
9505 message.
9506
9507 2003-03-02 Akim Demaille <akim@epita.fr>
9508
9509 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
9510 Use them to exercise yycheck overrun.
9511 Based on Andrew Suffield's grammar.
9512
9513 2003-03-02 Akim Demaille <akim@epita.fr>
9514
9515 Create tests/local.at for Bison generic testing macros.
9516
9517 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
9518 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
9519 This new file.
9520 * tests/calc.at (AT_CHECK_CALC): Adjust.
9521 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
9522 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
9523 * tests/local.at: here.
9524 (AT_COMPILE_CXX): Tags the tests using it as c++.
9525 Ignore the test if CXX is not functional.
9526
9527 2003-03-01 Paul Eggert <eggert@twinsun.com>
9528
9529 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
9530 not loc->end, since loc->end might contain garbage and this leads
9531 to undefined behavior on some platforms.
9532 (id_loc, token_start): Use (IF_LINTed) initial values that do not
9533 depend on *loc, so that the reader doesn't give the the false
9534 impression that *loc is initialized.
9535 (<INITIAL>"%%"): Do not bother setting code_start, since its value
9536 does not survive the return.
9537
9538 2003-03-01 Akim Demaille <akim@epita.fr>
9539
9540 * src/scan-gram.l (code_start): Always initialize it when entering
9541 into yylex, as SC_EPILOGUE is activated *before* the corresponding
9542 yylex invocation. An alternative would be making it static, but
9543 then it starts with the second %%'s beginning, instead of its end.
9544
9545 2003-02-28 Paul Eggert <eggert@twinsun.com>
9546
9547 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
9548 around a UnixWare 7.1.1 porting bug reported by John Hughes in
9549 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
9550
9551 2003-02-26 Paul Eggert <eggert@twinsun.com>
9552
9553 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
9554 Remove Sequent/Pyramid discussion (nobody uses them any more).
9555 Merge VMS and MS-DOS discussion; these ports may well be dead
9556 but let's keep mentioning them for now. Put <> around email
9557 addresses. Add copyright notice.
9558
9559 2003-02-24 Paul Eggert <eggert@twinsun.com>
9560
9561 * data/glr.c (yy_reduce_print): yylineno -> yylno,
9562 to avoid collision with flex use of yylineno.
9563 Problem reported by Bruce Lilly in
9564 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
9565 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9566 * data/yacc.c (yy_reduce_print): Likewise.
9567
9568 * config/depcomp: Sync with Automake 1.7.3.
9569
9570 2003-02-21 Akim Demaille <akim@epita.fr>
9571
9572 * data/lalr1.cc: Use temporary variables instead of casts to
9573 change integer types.
9574 Suggested by Paul Eggert.
9575
9576 2003-02-21 Akim Demaille <akim@epita.fr>
9577
9578 * doc/bison.texinfo: Use "location" consistently to refer to @n,
9579 to avoid confusions with lalr1.cc's notion of Position.
9580 Suggested by Paul Eggert.
9581
9582 2003-02-20 Akim Demaille <akim@epita.fr>
9583
9584 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
9585 before initial_columns.
9586 (location.hh): Use consistent variable names when defining the
9587 operator<<.
9588 Use "last" so that we subtract from Positions, not from unsigned.
9589
9590 2003-02-20 Akim Demaille <akim@epita.fr>
9591
9592 * data/lalr1.cc (position.hh): New subfile, including the extended
9593 and Doxygen'ed documentation of class Position.
9594 (location.hh): Use it.
9595 Document a` la Doxygen.
9596 With the help of Benoit Perrot.
9597
9598 2003-02-20 Akim Demaille <akim@epita.fr>
9599
9600 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
9601 AT_YACC_IF.
9602 Redefine AT_YYERROR_SEES_LOC_IF using it.
9603 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
9604 not defined.
9605 Don't use the location in yy::Parser::error_ and
9606 yy::Parser::print_ when not %locations.
9607 Activate more lalr1.cc tests.
9608
9609 2003-02-19 Akim Demaille <akim@epita.fr>
9610
9611 * data/lalr1.cc: When displaying a line number, be sure to make it
9612 an int.
9613
9614 2003-02-19 Akim Demaille <akim@epita.fr>
9615
9616 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
9617 Remove, useless.
9618 (YYABORT, YYACCEPT, YYERROR): New.
9619 * tests/calc.at: Renable the lalr1.cc test.
9620
9621 2003-02-19 Akim Demaille <akim@epita.fr>
9622
9623 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
9624 error recovery, mixing with/without pops and discarding of the
9625 lookahead.
9626 Exercise YYERROR.
9627 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
9628
9629 2003-02-17 Paul Eggert <eggert@twinsun.com>
9630
9631 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
9632 * tests/testsuite.at (AT_COMPILE): Use them.
9633 This fixes the testsuite problem reported by Robert Lentz in
9634 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
9635
9636 2003-02-12 Paul Eggert <eggert@twinsun.com>
9637
9638 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
9639 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
9640 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
9641 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
9642 Check for malloc failure, for consistency with yacc.c.
9643 (yytname_size): Remove, for consistency with yacc.c.
9644
9645 The bug still remains in data/lalr1.cc, as I didn't have time
9646 to fix it there.
9647
9648 2003-02-06 Akim Demaille <akim@epita.fr>
9649
9650 * configure.ac (GXX): Rename as...
9651 (CXX): this, to keep the original Autoconf semantics.
9652 Require 2.57.
9653 * data/lalr1.cc: Fix b4_copyright invocations.
9654 If YYDEBUG is not defined, don't depend upon name_ being defined.
9655 (location.hh): Include string and iostream.
9656 (Position::filename): New member.
9657 (Position::Position ()): New.
9658 (operator<< (Position)): New.
9659 (operator- (Position, int)): New.
9660 (Location::first, Location::last): Rename as...
9661 (Location::begin, Location::end): these, to mock the conventional
9662 iterator names.
9663 (operator<< (Location)): New.
9664 * tests/atlocal.in (CXX): New.
9665 * tests/testsuite.at (AT_COMPILE_CXX): New.
9666 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
9667 locations in a more synthetic way.
9668 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
9669 lalr1.cc is used.
9670 Adjust the C locations to match those from Emacs: first column is
9671 column 0.
9672 Change all the expected results.
9673 Conform to the GCS: simplify the locations when applicable.
9674 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
9675 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
9676 these CPP macros with the m4 macros new defined by...
9677 (AT_CHECK_PUSHDEFS): this, i.e.:
9678 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
9679 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
9680 New macros.
9681 (AT_CHECK_POPDEFS): Undefine them.
9682 (AT_CHECK_CALC_LALR1_CC): New.
9683 Use it for the first lalr1.cc test.
9684
9685 2003-02-04 Akim Demaille <akim@epita.fr>
9686
9687 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
9688 Location as is defined.
9689
9690 2003-02-04 Akim Demaille <akim@epita.fr>
9691
9692 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
9693 name_ being defined.
9694
9695 2003-02-03 Paul Eggert <eggert@twinsun.com>
9696
9697 * src/gram.h (start_symbol): Remove unused decl.
9698
9699 Use more-consistent naming conventions for local vars.
9700
9701 * src/derives.c (derives_compute): Change type of local var from
9702 int to rule_number.
9703 * src/gram.c (grammar_rules_partial_print): Likewise.
9704 * src/print.c (print_core): Likewise.
9705 * src/reduce.c (reduce_grammar_tables): Likewise.
9706
9707 * src/gram.c (grammar_dump): Change name of item_number *
9708 local var from r to rp.
9709 * src/nullable.c (nullable_compute): Likewise.
9710
9711 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
9712
9713 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
9714 for symbol or symbol_number var.
9715 * src/reader.c (grammar_start_symbol_set): Likewise.
9716 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
9717 Likewise.
9718 * src/state.c (transitions_to): Likewise.
9719 * src/state.h: Likewise.
9720 * src/tables.c (symbol_number_to_vector_number): Likewise.
9721
9722 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
9723 char * var.
9724
9725 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
9726 var.
9727
9728 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
9729 var.
9730
9731 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
9732 Use str, not s, for char * var. Use ch, not c, for character var.
9733 Use size for size var.
9734
9735 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
9736 char * var.
9737 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
9738 uniqstr var.
9739 * src/uniqstr.h: Likewise.
9740
9741 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9742 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9743 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
9744 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
9745 param to have same name as that of enum, so that we don't use
9746 "s" to stand for a non-state.
9747
9748 2003-02-02 Akim Demaille <akim@epita.fr>
9749
9750 * src/scan-skel.l: Scan more than one inert character per yylex
9751 invocation.
9752
9753 2003-02-01 Paul Eggert <eggert@twinsun.com>
9754
9755 Version 1.875a.
9756
9757 * po/LINGUAS: Add ms.
9758
9759 2003-01-30 Akim Demaille <akim@epita.fr>
9760
9761 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
9762
9763 2003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9764
9765 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
9766 of $1.
9767
9768 Changes in response to error report by S. Eken: GLR mode does not
9769 handle negative $ indices or $ indices in embedded rules correctly.
9770 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
9771
9772 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
9773 (b4_rhs_location): Ditto.
9774 (yyfill): New function to copy from stack tree into array
9775 incrementally.
9776 (yyuserAction): Modify to allow incremental move of semantic values
9777 to rhs array when in GLR mode.
9778 Define YYFILL to use in user-defined actions to fill semantic array
9779 as needed.
9780 Remove dummy use of yystack, as there is now a guaranteed use.
9781 (yydoAction): Modify to allow incremental move of semantic values
9782 to rhs array when in GLR mode.
9783 (yyresolveAction): Ditto.
9784 (yyglrShiftDefer): Update comment.
9785 (yyresolveStates): Use X == NULL for pointers, not !X.
9786 (yyglrReduce): Ditto.
9787 (yydoAction): Ditto
9788
9789 * tests/glr-regr1.at: Rename to ...
9790 * tests/glr-regression.at: Add new regression test for the problems
9791 described above (adapted from S. Eken).
9792 Update copyright notice.
9793 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
9794 * tests/Makefile.am: Ditto.
9795
9796 2003-01-28 Paul Eggert <eggert@twinsun.com>
9797
9798 * data/lalr1.cc: Do not use @output_header_name@ unless
9799 b4_defines_flag is set. This fixes two bugs reported by
9800 Tim Van Holder in
9801 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
9802 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
9803
9804 2003-01-21 Paul Eggert <eggert@twinsun.com>
9805
9806 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
9807 we don't need to worry about yyerrlab1 being reported as an
9808 "unused label" by non-GCC C compilers. The downside is that if
9809 locations are used then a couple of statements are duplicated each
9810 time YYERROR is invoked, but the upside is that the warnings
9811 should vanish.
9812 (yyerrlab1): Move code to YERROR.
9813 (yyerrlab2): Remove. Change uses back to yyerrlab1.
9814 This reverts some of the 2002-12-27 change.
9815
9816 2003-01-17 Paul Eggert <eggert@twinsun.com>
9817
9818 * src/output.c (symbol_printers_output): Fix typo that led
9819 to core dump. Problem reported by Antonio Rus in
9820 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
9821
9822 2003-01-13 Akim Demaille <akim@epita.fr>,
9823 Quoc Peyrot <chojin@lrde.epita.fr>,
9824 Robert Anisko <anisko_r@lrde.epita.fr>
9825
9826 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
9827 when the stacks contain one element, as the loop would otherwise
9828 free the last state, and then use the top state (the one we just
9829 popped). This means that the initial elements will not be freed
9830 explicitly, as is the case in yacc.c; it is not a problem, as
9831 these elements have fake values.
9832
9833 2003-01-11 Paul Eggert <eggert@twinsun.com>
9834
9835 * NEWS: %expect-violations are now just warnings, reverting
9836 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
9837 bootstrapping problem reported by Matthias Klose; see
9838 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
9839 * src/conflicts.c (conflicts_print): Likewise.
9840 * tests/conflicts.at (%expect not enough, %expect too much,
9841 %expect with reduce conflicts): Likewise.
9842 * doc/bison.texinfo (Expect Decl): Document this. Also mention
9843 that the warning is enabled if the number of conflicts changes
9844 (not necessarily increases).
9845
9846 * src/getargs.c (version): Update copyright year.
9847
9848 2003-01-09 Akim Demaille <akim@epita.fr>
9849
9850 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
9851
9852 2003-01-08 Paul Eggert <eggert@twinsun.com>
9853
9854 * Makefile.maint (WGETFLAGS):
9855 New macro, containing "-C off" to disable proxy caches.
9856 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
9857 (rel-check): Use $(WGET) instead of wget.
9858
9859 2003-01-06 Paul Eggert <eggert@twinsun.com>
9860
9861 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
9862 the GLR paper of Scott, Johnstone and Hussain.
9863
9864 2003-01-04 Paul Eggert <eggert@twinsun.com>
9865
9866 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
9867 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
9868 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
9869 (EXTRA_LIBRARIES): New var, for liby.a.
9870 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
9871 (EXTRA_SCRIPTS): New var, for yacc.
9872
9873 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
9874 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
9875 Problem reported by Nelson H. F. Beebe.
9876
9877 2003-01-03 Paul Eggert <eggert@twinsun.com>
9878
9879 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
9880 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
9881 when compiling Bison 1.875's `bitset bset = obstack_alloc
9882 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
9883
9884 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
9885 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
9886 grow to a huge size with typical invocation.
9887
9888 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
9889 Use the pattern recommended by Autoconf 2.57, except also protect
9890 against double-definition.
9891 * src/system.h: Likewise.
9892 Portability issues reported by Nelson H. F. Beebe.
9893
9894 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
9895 All uses changed. Provide a definition in both C and C++.
9896 (yytrue, yyfalse): Define even if defined (__cplusplus).
9897
9898 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
9899 Reported by Nelson H. F. Beebe.
9900
9901 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
9902
9903 2003-01-02 Paul Eggert <eggert@twinsun.com>
9904
9905 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
9906 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
9907 Bug reported by Nelson H. F. Beebe.
9908
9909 2003-01-01 Paul Eggert <eggert@twinsun.com>
9910
9911 * Version 1.875.
9912
9913 2002-12-30 Paul Eggert <eggert@twinsun.com>
9914
9915 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
9916 Moved here from...
9917 (<INITIAL>","): Here. This causes stray "," to be treated
9918 more uniformly.
9919
9920 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
9921 last brace in braced code when not in Yacc mode, for compatibility
9922 with Bison 1.35. This resurrects the 2001-12-15 patch to
9923 src/reader.c.
9924
9925 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
9926 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
9927
9928 2002-12-28 Paul Eggert <eggert@twinsun.com>
9929
9930 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
9931 that of SYM's type. This fixes Debian bug 168069, reported by
9932 Thomas Olsson.
9933
9934 2002-12-28 Paul Eggert <eggert@twinsun.com>
9935
9936 Version 1.75f.
9937
9938 Switch back to the Yacc style of conflict reports, undoing some
9939 of the 2002-07-30 change.
9940 * doc/bison.texinfo (Understanding): Use Yacc style for
9941 conflict reports. Also, use new way of locating rules.
9942 * src/conflicts.c (conflict_report):
9943 Renamed from conflict_report_yacc, removing the old
9944 'conflict_report'. Translate the entire conflict report at once,
9945 so that we don't assume that "," has the same interpretation in
9946 all languages.
9947 (conflicts_output): Use Yacc-style conflict report for each state,
9948 instead of our more-complicated style.
9949 (conflicts_print): Use Yacc-style conflict report, except print
9950 the input file name when not emulating Yacc.
9951 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
9952 Conflicted Reduction, %expect not enough, %expect too much,
9953 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
9954 * tests/existing.at (GNU Cim Grammar): Likewise.
9955 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
9956
9957 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
9958 fatal): Don't invoke fflush; it's not needed and it might even be
9959 harmful for stdout, as stdout might not be open.
9960 * src/reduce.c (reduce_print): Likewise.
9961
9962 2002-12-27 Paul Eggert <eggert@twinsun.com>
9963
9964 Fix a bug where error locations were not being recorded correctly.
9965 This problem was originally reported by Paul Hilfinger in
9966 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
9967
9968 * data/yacc.c (yyparse): New local var yylerrsp, to record the
9969 top of the location stack's error locations.
9970 (yyerrlab): Set it. When discarding a token, push its location
9971 onto yylerrsp so that we don't lose track of the error's end.
9972 (yyerrlab1): Now is only the target of YYERROR, so that we can
9973 properly record the location of the action that failed. For GCC
9974 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
9975 GCC warning about yyerrlab1 being unused if YYERROR is unused.
9976 (yyerrlab2): New label, which yyerrlab now falls through to.
9977 Compute the error's location by applying YYLLOC_DEFAULT to
9978 the locations of all the symbols that went into the error.
9979 * doc/bison.texinfo (Location Default Action): Mention that
9980 YYLLOC_DEFAULT is also invoked for syntax errors.
9981 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9982 Error locations include the locations of all the tokens that were
9983 discarded, not just the last token.
9984
9985 2002-12-26 Paul Eggert <eggert@twinsun.com>
9986
9987 * src/files.c: Include quote.h.
9988 (compute_output_file_names): Warn if we detect conflicting
9989 outputs to the same file. This should catch the misunderstanding
9990 exemplified by Debian Bug 165349, reported by Bruce Stephens..
9991
9992 * src/conflicts.c (conflicts_print): If the user specifies
9993 "%expect N", report an error if there are any reduce/reduce
9994 conflicts. This is what the manual says should happen.
9995 This fixes Debian bug 130890, reported by Anthony DeRobertis.
9996 * tests/conflicts.at (%expect with reduce conflicts): New test.
9997
9998 Don't use m4_include on relative file names, as it doesn't work as
9999 desired if there happens to be a file with that name under ".".
10000
10001 * m4sugar/version.m4: Remove; it was included but it wasn't used.
10002 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
10003 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
10004 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
10005 * src/output.c (output_skeleton): Use full path names when
10006 specifying a file to include; don't rely on include path, as
10007 it's unreliable when the working file contains a file with
10008 that name.
10009
10010 2002-12-25 Paul Eggert <eggert@twinsun.com>
10011
10012 Remove obsolete references to bison.simple and bison.hairy.
10013 Problem mentioned by Aubin Mahe in
10014 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
10015 * data/glr.c: Comment fix.
10016 * doc/bison.1: Remove references. Also, mention "yacc".
10017
10018 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
10019 with -g option.
10020
10021 * src/parse-gram.y (declaration): Use enum "report_states" rather
10022 than its numeric value 1.
10023
10024 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
10025 opening a new one. This fixes Debian bug 165349, reported by
10026 Bruce Stephens.
10027
10028 2002-12-24 Paul Eggert <eggert@twinsun.com>
10029
10030 Version 1.75e.
10031
10032 * Makefile.maint (cvs-update): Don't assume that the shell
10033 supports $(...), as Solaris sh doesn't.
10034
10035 * src/parse-gram.y (lloc_default): Remove test for empty
10036 nonterminals at the end, since it didn't change the result.
10037
10038 2002-12-24 Paul Eggert <eggert@twinsun.com>
10039
10040 If the user does not define YYSTYPE as a macro, Bison now declares it
10041 using typedef instead of defining it as a macro. POSIX requires this.
10042 For consistency, YYLTYPE is also declared instead of defined.
10043
10044 %union directives can now have a tag before the `{', e.g., the
10045 directive `%union foo {...}' now generates the C code
10046 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
10047 The default union tag is `YYSTYPE', for compatibility with Solaris 9
10048 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
10049 instead of `yyltype'.
10050
10051 `yystype' and `yyltype' are now obsolescent macros instead of being
10052 typedefs or tags; they are no longer documented and will be
10053 withdrawn in a future release.
10054
10055 * data/glr.c (b4_location_type): Remove.
10056 (YYSTYPE): Renamed from yystype.
10057 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
10058 (struct YYLTYPE): Renamed from struct yyltype.
10059 (YYLTYPE): Renamed from yyltype.
10060 (yyltype, yystype): New (and obsolescent) macros,
10061 for backward compatibility.
10062 * data/yacc.c: Likewise.
10063
10064 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
10065 does not specify a union tag. This is for compatibility with
10066 Solaris 9 yacc.
10067
10068 * src/parse-gram.y (add_param): 2nd arg is now char * not char
10069 const *, since it is now modified by stripping surrounding { }.
10070 (current_braced_code): Remove.
10071 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
10072 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
10073 trailing " {...}". Now of type <chars>.
10074 (grammar_declaration): Adjust to bundled tokens.
10075 (code_content): Remove; stripping is now done by add_param.
10076 (print_token_value): Print contents of bundled tokens.
10077 (token_name): New function.
10078
10079 * src/reader.h (braced_code, current_braced_code): Remove.
10080 (token_name): New decl.
10081
10082 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
10083 token_type, not braced_code code_kind. All uses changed.
10084 (SC_PRE_CODE): New state, for scanning after a keyword that
10085 has (or usually has) an immediately-following braced code.
10086 (token_type): New local var, to keep track of which token type
10087 to return when scanning braced code.
10088 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
10089 <INITIAL>"%parse-param", <INITIAL>"%printer",
10090 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
10091 instead of returning a token type immediately.
10092 (<INITIAL>"{"): Set token type.
10093 (<SC_BRACED_CODE>"}"): Use it.
10094 (handle_action_dollar, handle_action_at): Now returns bool
10095 indicating success. Fail if ! current_rule; this prevents a core dump.
10096 (handle_symbol_code_dollar, handle_symbol_code_at):
10097 Remove; merge body into caller.
10098 (handle_dollar, handle_at): Complain in invalid contexts.
10099
10100 * NEWS, doc/bison.texinfo: Document the above.
10101 * NEWS: Fix years and program names in copyright notice.
10102
10103 2002-12-17 Paul Eggert <eggert@twinsun.com>
10104
10105 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
10106 Reporting, Table of Symbols): Omit mentions of %lex-param and
10107 %parse-param from the documentation for now.
10108
10109 2002-12-15 Paul Eggert <eggert@twinsun.com>
10110
10111 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
10112 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
10113 lookahead symbol, and which sets yychar in parser actions) and it
10114 disagreed with the Bison documentation. Bug
10115 reported by Andrew Walrond.
10116
10117 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
10118 as the caller now does that.
10119 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
10120 (YYEMPTY): Parenthesize right hand side, since others use it.
10121 (yyparse): Don't assume that our generated code is the only code
10122 that sets yychar.
10123
10124 2002-12-13 Paul Eggert <eggert@twinsun.com>
10125
10126 Version 1.75d.
10127
10128 POSIX requires a "yacc" command.
10129 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
10130 (MOSTLYCLEANFILES): Add yacc.
10131 (yacc): New rule.
10132 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
10133 as an alias for bison y.
10134
10135 * po/LINGUAS: Add da.
10136
10137 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
10138 problem with latest <getopt.h>.
10139 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
10140
10141 * doc/fdl.texi: Upgrade to 1.2.
10142 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
10143 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
10144 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
10145 gnulib.
10146 * config/install-sh: Sync with autotools.
10147
10148 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
10149 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
10150 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
10151 locations are requested.
10152 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
10153 locations are requested.
10154
10155 2002-12-12 Paul Eggert <eggert@twinsun.com>
10156
10157 Remove unportable casts and storage allocation tricks.
10158 While we're at it, remove almost all casts, since they
10159 usually aren't needed and are a sign of trouble.
10160
10161 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
10162
10163 * src/derives.c (derives_compute): Do not subtract NTOKENS from
10164 the pointer DSET returned by malloc; this isn't portable.
10165 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
10166 Similarly for DERIVES.
10167 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
10168 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
10169 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
10170
10171 * src/derives.c (derives_compute): Do not bother invoking
10172 int_of_rule_number, since rule numbers are integers.
10173
10174 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
10175 rather than XMALLOC (char, N).
10176
10177 * src/files.c (filename_split): Rewrite to avoid cast.
10178
10179 * src/gram.h (symbol_number_as_item_number,
10180 item_number_as_symbol_number, rule_number_as_item_number,
10181 item_number_as_rule_number):
10182 Now inline functions rather than macros, to avoid casts.
10183 * src/state.h (state_number_as_int): Likewise.
10184 * src/tables.c (state_number_to_vector_number,
10185 symbol_number_to_vector_number): Likewise.
10186
10187 * src/gram.h (int_of_rule_number): Remove; no longer used.
10188
10189 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
10190 since the resulting storage is always stored into.
10191
10192 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
10193 where it's needed.
10194
10195 * src/muscle_tab.c (muscle_m4_output):
10196 Now inline. Return bool, not int.
10197 * src/state.c (state_compare): Likewise.
10198 * src/symtab.c (symbol_check_defined,
10199 symbol_check_alias_consistency, symbol_pack, symbol_translation,
10200 hash_compare_symbol, hash_symbol):
10201 Likewise.
10202 * src/uniqstr.c (uniqstr_print): Likewise.
10203 * src/muscle_tab.c (muscle_m4_output_processor):
10204 New function, to avoid casts.
10205 * src/state.c (state_comparator, stage_hasher): Likewise.
10206 * src/symtab.c (symbol_check_defined_processor,
10207 symbol_check_alias_consistency_processor, symbol_pack_processor,
10208 symbol_translation_processor, hash_symbol_comparator,
10209 hash_symbol_hasher): Likewise.
10210 * src/uniqstr.c (uniqstr_print_processor): Likewise.
10211 * src/muscle_tab.c (muscles_m4_output):
10212 Use new functions instead of casting old functions unportably.
10213 * src/state.c (state_hash_new): Likewise.
10214 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
10215 symbols_token_translations_init):
10216 Likewise.
10217 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
10218
10219 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
10220 var instead of casting to long, to avoid casts.
10221 (prepare_states): Use MALLOC rather than alloca, so that we don't
10222 have to worry about alloca.
10223 * src/state.c (state_hash_lookup): Likewise.
10224
10225 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
10226 local var instead of casting to unsigned char, to avoid casts.
10227
10228 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
10229 STATE_ALLOC): Remove.
10230 (transitions_new, errs_new, reductions_new, state_new): Use malloc
10231 rather than calloc, and use offsetof to avoid allocating slightly
10232 too much storage.
10233 (state_new): Initialize all members.
10234
10235 * src/state.c (state_hash): Use unsigned accumulator, not signed.
10236
10237 * src/symtab.c (symbol_free): Remove; unused.
10238 (symbol_get): Remove cast in lhs of assignment.
10239 (symbols_do): Now static. Accept generic arguments, not
10240 hashing-related ones.
10241
10242 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
10243 (symbol_processor): Remove.
10244 (symbols_do): Remove decl; now static.
10245
10246 * src/system.h (alloca): Remove; decl no longer needed.
10247 (<stddef.h>): Include, for offsetof.
10248 (<inttypes.>, <stdint.h>): Include if available.
10249 (uintptr_t): New type, if system lacks it.
10250 (CALLOC, MALLOC, REALLOC): New macros.
10251 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
10252 new macros.
10253
10254 * src/tables.c (table_size): Now int, to pacify GCC.
10255 (table_grow, table_ninf_remap): Use signed table size.
10256 (save_row): Don't bother initializing locals when not needed.
10257 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
10258 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
10259
10260 * src/vcg.h: Correct misspellings.
10261
10262 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
10263
10264
10265 * src/getargs.c (getargs): Don't assume EOF == -1.
10266
10267 2002-12-09 Paul Eggert <eggert@twinsun.com>
10268
10269 Change identifier spellings to avoid collisions with names
10270 that are reserved by POSIX.
10271
10272 Don't use names ending in _t, since POSIX reserves them.
10273 For consistency, remove _e and _s endings -- they're weren't
10274 needed to remove ambiguity. All uses changed.
10275 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
10276 turn was just renamed from struniq_t.
10277 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
10278 which in turn was just renamed from struniq_processor_t.
10279 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
10280 in turn was renamed from hash_compare_struniq_t.
10281 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
10282 (state_list): Renamed from state_list_t.
10283 * src/assoc.h (assoc): Renamed from assoc_t.
10284 * src/conflicts.c (enum conflict_resolution): Renamed from
10285 enum conflict_resolution_e.
10286 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
10287 (rule_list): Renamed from rule_list_t.
10288 * src/getargs.h (enum trace): Renamed from enum trace_e.
10289 (enum report): Renamed from enum report_e.
10290 * src/gram.h (item_number): Renamed from item_number_t.
10291 (rule_number): Renamed from rule_number_t.
10292 (struct rule_s): Remove the "rule_s" part; not used.
10293 (rule): Renamed from rule_t.
10294 (rule_filter): Renamed from rule_filter_t.
10295 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
10296 (goto_list): Renamed from goto_list_t.
10297 * src/lalr.h (goto_number): Renamed from goto_number_t.
10298 * src/location.h (location): Renamed from location_t.
10299 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
10300 and moved here from:
10301 * src/muscle_tab.h (muscle_entry_t): here.
10302 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
10303 (rule_list): Renamed from rule_list_t.
10304 * src/print_graph.c (static_graph): Renamed from graph.
10305 * src/reader.h (braced_code): Renamed from braced_code_t.
10306 Remove brace_code_e tag.
10307 * src/relation.h (relation_node): Renamed from relation_node_t.
10308 (relation_nodes): Renamed from relation_nodes_t.
10309 (relation): Renamed from relation_t.
10310 * src/state.h (state_number): Renamed from state_number_t.
10311 (struct state): Renamed from struct state_s.
10312 (state): Renamed from state_t.
10313 (transitions): Renamed from transitions_t. Unused (and
10314 misspelled) transtion_s tag removed.
10315 (errs): Renamed from errs_t. Unused errs_s tag removed.
10316 (reductions): Renamed from reductions_t. Unused tag
10317 reductions_s removed.
10318 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
10319 (struct symbol_list): Renamed from struct symbol_list_s.
10320 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
10321 (struct symbol): Renamed from struct symbol_s.
10322 (symbol): Renamed from symbol_t.
10323 * src/tables.c (vector_number): Renamed from vector_number_t.
10324 (action_number): Renamed from action_t.
10325 * src/tables.h (base_number): Renamed from base_t.
10326 * src/vcg.h (enum color): Renamed from enum color_e.
10327 (enum textmode): Renamed from enum textmode_e.
10328 (enum shape): Renamed from enum shape_e.
10329 (struct colorentry): Renamed from struct colorentry_s.
10330 (struct classname): Renamed from struct classname_s.
10331 (struct infoname): Renamed from struct infoname_s.
10332 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
10333 (enum decision): Renamed from enum decision_e.
10334 (enum orientation): Renamed from enum orientation_e.
10335 (enum alignment): Renamed from enum alignment_e.
10336 (enum arrow_mode): Renamed from enum arrow_mode_e.
10337 (enum crossing_type): Renamed from enum crossing_type_e.
10338 (enum view): Renamed from enum view_e.
10339 (struct node): Renamed from struct node_s.
10340 (node): Renamed from node_t.
10341 (enum linestyle): Renamed from enum linestyle_e.
10342 (enum arrowstyle): Renamed from enum arrowstyle_e.
10343 (struct edge): Renamed from struct edge.
10344 (edge): Renamed from edge_t.
10345 (struct graph): Renamed from struct graph_s.
10346 (graph): Renamed from graph_t.
10347 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
10348 Rename value_t -> value.
10349 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
10350 value_t_as_yystype -> value_as_yystype.
10351
10352 Don't include <errno.h> in the mainstream code, since it
10353 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
10354 * lib/get-errno.c, lib/get-errno.h: New files.
10355 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
10356 get-errno.c.
10357 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
10358 * src/output.c (output_skeleton): Likewise.
10359 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
10360 instead of errno.
10361 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
10362 Likewise.
10363 (handle_action_dollar, handle_action_at): Likewise.
10364 * src/system.h: Do not include <errno.h>.
10365 (TAB_EXT): Renamed from EXT_TAB.
10366 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
10367
10368 Avoid str[a-z]*, since <string.h> reserves that name space.
10369 Change all instances of "struniq" in names to "uniqstr", and
10370 likewise for "STRUNIQ" and "UNIQSTR".
10371 * src/uniqstr.c: Renamed from src/struniq.c.
10372 * src/uniqstr.h: Renamed from src/struniq.h.
10373 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
10374 * src/files.c (strsuffix): Remove; unused.
10375 (concat2): Renamed from stringappend. Now static.
10376 * src/files.h (strsuffix, stringappend): Remove; unused.
10377 * src/parse-gram.y (<chars>): Renamed from <string>.
10378 (<uniqstr>): Renamed from <struniq>.
10379 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
10380 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
10381 (struct graph_s.expand): Renamed from struct graph_s.stretch.
10382 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
10383 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
10384 (N_EXPAND): Renamed from N_STRETCH.
10385
10386 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
10387 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
10388 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
10389 Remove; unused.
10390 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
10391 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
10392 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
10393 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
10394 (BASE_MAXIMUM): Renamed from BASE_MAX.
10395 (BASE_MINIMUM): Renamed from BASE_MIN.
10396 (ACTION_MAX): Remove; unused.
10397 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
10398 Unnecessary casts removed from above defines.
10399
10400
10401 Fix misspelling in names.
10402 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
10403 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
10404 G_NODE_ALIGNEMENT.
10405
10406
10407 * lib/timevar.c (timevar_report): Renamed from time_report,
10408 for consistency with other names.
10409 * lib/timevar.h (timevar_report): New decl.
10410 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
10411
10412
10413 Sort include-file uses.
10414
10415 Reorder all include files under src to be in the order "system.h".
10416 then the ../lib include files in angle brackets (alphabetized),
10417 then the . include files in double-quotes (alphabetized). Fix
10418 dependency breakages encountered in this process, as follows:
10419 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
10420 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
10421 * src/state.h: Include "symtab.h".
10422
10423 2002-12-08 Paul Eggert <eggert@twinsun.com>
10424
10425 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
10426 since this causes problems when __file__ contains character
10427 sequences like "@" that are treated specially by src/scan-skel.l.
10428 Instead, just use the file's basename. This fixes the bug
10429 reported by Martin Mokrejs in
10430 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
10431
10432 2002-12-06 Paul Eggert <eggert@twinsun.com>
10433
10434 Add support for rules that do not have trailing semicolons, as
10435 POSIX requires. Improve the quality of locations in Bison
10436 diagnostics.
10437
10438 * src/location.c: Include <quotearg.h>.
10439 (empty_location): Now const.
10440 (location_print): New function. Follow the recommendation of the
10441 GNU Coding Standards for locations that span file boundaries.
10442 * src/location.h: Do not include <quotearg.h>; no longer needed.
10443 (boundary): New type.
10444 (location_t): Use it. This allows locations to span file boundaries.
10445 All member uses changed: file -> start.file or end.file (as needed),
10446 first_line -> start.line, first_column -> start.column,
10447 last_line -> end.line, last_column -> end.column.
10448 (equal_boundaries): New function.
10449 (LOCATION_RESET, LOCATION_STEP): Remove.
10450 (LOCATION_PRINT): Remove. All callers changed to use location_print.
10451 (empty_location): Now const.
10452 (location_print): New decl.
10453 * src/parse-gram.y (lloc_default): New function, which handles
10454 empty locations more accurately.
10455 (YYLLOC_DEFAULT): Use it.
10456 (%token COLON): Remove.
10457 (%token ID_COLON): New token.
10458 (rules): Use it.
10459 (declarations, rules): Remove trailing semicolon.
10460 (declaration, rules_or_grammar_declaration):
10461 Allow empty (";") declaration.
10462 (symbol_def): Remove empty actions; no longer needed.
10463 (rules_or_grammar_declaration): Remove trailing semicolon.
10464 (semi_colon.opt): Remove.
10465 * src/reader.h: Include location.h.
10466 (scanner_cursor): New decl.
10467 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
10468 rolling our own.
10469 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
10470 of *loc.
10471 (STEP): Remove. No longer needed, now that adjust_location does
10472 the work. All uses removed.
10473 (scanner_cursor): New var.
10474 (adjust_location): Renamed from extend_location. It now sets
10475 *loc and adjusts the scanner cursor. All uses changed.
10476 Don't bother testing for CR.
10477 (handle_syncline): Remove location arg; now updates scanner cursor.
10478 All callers changed.
10479 (unexpected_end_of_file): Now accepts start boundary of token or
10480 comment, not location. All callers changed. Update scanner cursor,
10481 not the location.
10482 (SC_AFTER_IDENTIFIER): New state.
10483 (context_state): Renamed from c_context. All uses changed.
10484 (id_loc, code_start, token_start): New local vars.
10485 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
10486 processing of Yacc white space and equivalents here.
10487 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
10488 instead of returning ID immediately, since we need to search for
10489 a subsequent colon.
10490 (<INITIAL>"'", "\""): Save token_start.
10491 (<INITIAL>"%{", "{", "%%"): Save code_start.
10492 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
10493 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
10494 BEGIN context_state at end, not INITIAL.
10495 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
10496 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
10497 Return correct token start.
10498 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
10499 the start of a character, string or multiline comment is found.
10500 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
10501 Reduction): Adjust reported locations to match the more-precise
10502 results now expected.
10503 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
10504 * tests/reduce.at (Useless Rules, Reduced Automaton,
10505 Underivable Rules): Likewise.
10506 * tests/regression.at (Invalid inputs): No longer `expecting ";"
10507 or "|"' now that so many other tokens are allowed by the new grammar.
10508
10509 * src/complain.h (current_file): Remove duplicate decl;
10510 current_file is now owned by files.h.
10511 * src/complain.c, src/scan-gram.l: Include files.h.
10512
10513 2002-12-06 Paul Eggert <eggert@twinsun.com>
10514
10515 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
10516 promotes to int; it might be unsigned int.
10517 * data/yacc.c (yy_reduce_print): Likewise.
10518
10519 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
10520 be #defined in the prologue, not in the Bison declarations.
10521 This fixes Debian Bug 102878, reported by Shaul Karl.
10522
10523 2002-12-02 Paul Eggert <eggert@twinsun.com>
10524
10525 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
10526 * lib/strtoul.c: New file, from gnulib.
10527 This fixes a porting bug reported by Peter Klein in
10528 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
10529
10530 2002-11-30 Paul Eggert <eggert@twinsun.com>
10531
10532 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
10533 and put only a forward declaration in the prologue. This is for
10534 consistency with the other scanner helper functions.
10535
10536 Type clashes now generate warnings, not errors, since it
10537 appears that POSIX may allow some grammars with type clashes.
10538 * src/reader.c (grammar_current_rule_check): Warn about
10539 type clashes instead of complaining.
10540 * tests/input.at (Type Clashes): Expect warnings, not complaints.
10541
10542 Add Yacc library, since POSIX requires it.
10543 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
10544 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
10545 * lib/main.c, lib/yyerror.c: New files.
10546
10547 gram_error can be static; it need not be extern.
10548 * src/reader.h (gram_error): Remove decl.
10549 * src/parse-gram.y (gram_error): Now static. Add static decl.
10550 (print_token_value): Omit parameter names from forward decl,
10551 for consistency.
10552
10553 2002-11-29 Paul Eggert <eggert@twinsun.com>
10554
10555 * doc/bison.texinfo: Emphasize that yylex and yyerror must
10556 be declared before being used. E.g., one should typically
10557 declare them in the prologue. Use GNU coding style in examples.
10558 Put "const" consistently after the type it modifies. Mention
10559 that C99 supports "inline". Mention that yyerror traditionally
10560 returns "int".
10561
10562 %parse-param and %lex-param now take just one argument, the
10563 declaration; the argument name is deduced from the declaration.
10564
10565 * doc/bison.texinfo (Parser Function, Pure Calling, Error
10566 Reporting, Table of Symbols): Document this.
10567 * src/parse-gram.y (add_param): New function.
10568 (COMMA): Remove.
10569 (declaration): Implement new rule for %parse-param and %lex-param.
10570 * src/scan-gram.l: "," now elicits a warning, rather than being
10571 a token; this is more compatible with byacc.
10572 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
10573
10574 2002-11-27 Paul Eggert <eggert@twinsun.com>
10575
10576 Rename identifiers to avoid real and potential collisions.
10577
10578 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
10579 to avoid collision with lex macro described by Bruce Lilly in
10580 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
10581 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10582 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
10583 * src/parse-gram.y (print_token_value): Renamed from yyprint.
10584 All uses changed.
10585 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
10586 The name "yycontrol" violates the name space rules, and this stuff
10587 wasn't being used anyway.
10588 (input): Remove action; this stuff wasn't being used.
10589 (gram_error): Rename local variable yylloc -> loc.
10590 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
10591 (YY_DECL): Don't use "yy" at start of local variables.
10592 All uses changed, e.g., yylloc -> loc.
10593 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
10594 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
10595 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
10596 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
10597
10598 * src/parse-gram.y (gram_error): loc is now const *.
10599 * src/reader.h (gram_error): Likewise.
10600
10601 2002-11-24 Paul Eggert <eggert@twinsun.com>
10602
10603 Version 1.75c.
10604
10605 * tests/actions.at (Actions after errors): Use an output format
10606 more similar to that of the Printers and Destructors test.
10607 Test the position of the ';' token too.
10608 (Printers and Destructors): Likewise.
10609 (Printers and Destructors: %glr-parser): Remove for now, to avoid
10610 unnecessarily alarming people when the test fails.
10611
10612 * data/yacc.c (yyerrlab1): Move this label down, so that the
10613 parser does not discard the lookahead token if the user code
10614 invokes YYERROR. This change is required for POSIX conformance.
10615
10616 * lib/error.c: Sync with gnulib.
10617
10618 2002-11-22 Paul Eggert <eggert@twinsun.com>
10619
10620 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
10621 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
10622 * lib/xmalloc.c: Likewise.
10623
10624 2002-11-20 Paul Eggert <eggert@twinsun.com>
10625
10626 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
10627
10628 2002-11-20 Paul Eggert <eggert@twinsun.com>
10629
10630 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
10631 should use `if (! x) abort ();' rather than `assert (x);', and
10632 anyway it's one less thing to worry about configuring.
10633
10634 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
10635 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
10636 and replace all instances of assert with abort.
10637 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10638 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
10639
10640 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
10641 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
10642 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
10643 hash_find_entry, hash_rehash, hash_insert): Likewise.
10644 * src/conflicts.c (resolve_sr_conflict): Likewise.
10645 * src/lalr.c (set_goto_map, map_goto): Likewise.
10646 * src/nullable.c (nullable_compute): Likewise.
10647 * src/output.c (prepare_rules, token_definitions_output): Likewise.
10648 * src/reader.c (packgram, reader): Likewise.
10649 * src/state.c (state_new, state_free, state_transitions_set,
10650 state_reduction_find): Likewise.
10651 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
10652 symbol_pack): Likewise.
10653 * src/tables.c (conflict_row, pack_vector): Likewise.
10654 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10655 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10656 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
10657 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
10658
10659 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
10660 (ARGMATCH_CONSTRAINT): New macro.
10661 (ARGMATCH_ASSERT): Use it.
10662
10663 * src/system.h (verify): New macro.
10664 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
10665 rather than assert.
10666 * src/tables.c (tables_generate): Likewise.
10667
10668 * src/struniq.c (struniq_assert): Now returns void, and aborts
10669 if the assertion is false.
10670 (struniq_assert_p): Remove.
10671 * src/struniq.h: Likewise.
10672
10673 2002-11-18 Paul Eggert <eggert@twinsun.com>
10674
10675 * data/glr.c (yygetLRActions): Replace `yyindex' with
10676 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
10677 This fixes the regression with Sun ONE Studio 7 cc that I reported in
10678 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
10679
10680 2002-11-18 Akim Demaille <akim@epita.fr>
10681
10682 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
10683 space.
10684 From Tim Van Holder.
10685
10686 2002-11-17 Paul Eggert <eggert@twinsun.com>
10687
10688 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
10689 to "SyntaxError" for consistency with my 2002-11-15 change.
10690
10691 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
10692 not define to {}, since this breaks the common use of `YYDPRINTF
10693 ((...));' if a single statement is desired (e.g. before `else').
10694 Work around GCC warnings by surrounding corresponding calls with
10695 {} if needed.
10696 (yyhasResolvedValue): Remove unused function.
10697 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
10698 loop body.
10699 (yyreportSyntaxError): Renamed from yyreportParseError.
10700 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
10701 All uses changed.
10702 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
10703 extern when possible. Remove unused initializations.
10704
10705 2002-11-16 Akim Demaille <akim@epita.fr>
10706
10707 Augment the similarity between GLR and LALR traces.
10708
10709 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
10710 (YY_REDUCE_PRINT): New.
10711 (yyparse): Use them.
10712 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
10713 YYDPRINT here.
10714 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
10715 state reached after the reduction/recovery, since...
10716 (yyparse, yyprocessOneStack): Report the state we are entering in.
10717
10718 2002-11-16 Akim Demaille <akim@epita.fr>
10719
10720 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
10721 Add support for --trace=skeleton.
10722 * src/scan-skel.l: %option debug.
10723 Scan strings of non-@ or \n instead of character by character.
10724 (scan_skel): Handle trace_skeleton.
10725 (QPUTS): New.
10726 (@output_parser_name@, @output_header_name@): ``Restore'' their
10727 support (used to be M4 macros).
10728 * data/yacc.c: Quote larger chunks, a la glr.c.
10729 * data/lalr1.cc: Likewise.
10730 The header guards are no longer available, so use some other
10731 string than `YYLSP_NEEDED'.
10732
10733 2002-11-16 Akim Demaille <akim@epita.fr>
10734
10735 Make the ``Printers and Destructors'' test more verbose, taking
10736 `yacc.c''s behavior as (possibly wrong) reference.
10737
10738 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
10739 instead of fprint on stdout.
10740 Set and report the last_line of the symbols.
10741 Consistently display values and locations.
10742
10743 2002-11-16 Paul Eggert <eggert@twinsun.com>
10744
10745 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
10746
10747 2002-11-15 Paul Eggert <eggert@twinsun.com>
10748
10749 * tests/actions.at (Actions after errors): New test case.
10750
10751 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
10752 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
10753 tests/action.at, tests/calc.at, tests/conflicts.at,
10754 tests/cxx-type.at, tests/regression.at:
10755 "parse error" -> "syntax error" for POSIX compatibility.
10756 "parsing stack overflow..." -> "parser stack overflow" so
10757 that code matches Bison documentation.
10758
10759 2002-11-15 Akim Demaille <akim@epita.fr>
10760
10761 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
10762 take two BRACED_CODE, not two string_content.
10763 Free the scanner's obstack when we are done.
10764 (code_content): New.
10765 * tests/calc.at: Adjust.
10766 * doc/bison.texinfo: Adjust.
10767 Also, make sure to include the `,' for these declarations.
10768
10769 2002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
10770
10771 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
10772 definition; avoids potential autoreconf problems.
10773
10774 2002-11-15 Akim Demaille <akim@epita.fr>
10775
10776 Always check the value returned by yyparse.
10777
10778 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
10779 returned by yyparse.
10780 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
10781 Adjust calls.
10782 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
10783 returned by yyparse.
10784
10785 2002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10786
10787 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
10788 on input.at test.
10789
10790 2002-11-14 Paul Eggert <eggert@twinsun.com>
10791
10792 * src/output.c (output_skeleton): Call xfopen instead of
10793 duplicating xfopen's body.
10794
10795 Fix bugs reported by Nelson H. F. Beebe in
10796 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
10797
10798 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
10799 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
10800 Group compiler. Instead, use "$CC -E bar.c". Include the .h
10801 file twice in the grammar, as an extra check.
10802
10803 * tests/input.at (Torturing the Scanner): Surround the
10804 backslash-newline tests with "#if 0", to make it less likely that
10805 we'll run into compiler bugs. Bring back solitary \ inside
10806 comment, but add a closing comment to work around HP C bug. Don't
10807 test backslash-newline in C character constant.
10808
10809 2002-11-14 Akim Demaille <akim@epita.fr>
10810
10811 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
10812 status of the compiler.
10813 Calling `exit 1' is no longer needed.
10814 Reported by Nelson H. F. Beebe.
10815
10816 2002-11-14 Akim Demaille <akim@epita.fr>
10817
10818 * tests/atlocal.in (CPPFLAGS): We have config.h.
10819 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
10820 New.
10821 * tests/actions.at, tests/calc.at, tests/conflicts.at,
10822 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
10823 * tests/regression.at, tests/torture.at: Use them for all the
10824 grammars that are to be compiled.
10825 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
10826 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
10827 * doc/bison.texinfo (GLR Parsers): Document `inline'.
10828
10829 2002-11-14 Akim Demaille <akim@epita.fr>
10830
10831 * doc/bison.texinfo: Various formatting changes (alignments in
10832 samples, additional @group/@end group, GCS in samples.
10833 Use @deffn instead of simple @table to define the directives,
10834 macros, variables etc.
10835
10836 2002-11-13 Paul Eggert <eggert@twinsun.com>
10837
10838 Fix some bugs reported by Albert Chin-A-Young in
10839 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
10840
10841 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
10842 -o c"; the HP C compiler chatters during compilation.
10843 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
10844 * tests/headers.at (export YYLTYPE): Likewise.
10845
10846 * tests/input.at (Torturing the Scanner): Remove lines containing
10847 solitary backslashes, as they tickle a bug in the HP C compiler.
10848
10849 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
10850 comments, since they're not portable. Use GNU coding style.
10851
10852 2002-11-13 Akim Demaille <akim@epita.fr>
10853
10854 * data/yacc.c: Leave bigger chunks of quoted text.
10855 (YYDSYMPRINTF): New.
10856 Use it to report symbol activities.
10857 * data/glr.c (YYDSYMPRINTF): New.
10858 Use it.
10859
10860 2002-11-12 Paul Eggert <eggert@twinsun.com>
10861
10862 Version 1.75b.
10863
10864 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
10865 (yyglrReduce): Return yyok, not 0.
10866 This should avoid the enumerated-type warnings reported
10867 by Nelson H. F. Beebe in
10868 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
10869
10870 * lib/bbitset.h (BITSET_INLINE): Remove.
10871 * lib/bitset.h [! BITSET_INLINE]: Remove.
10872 (bitset_set, bitset_reset, bitset_test): Rename local vars
10873 to avoid shadowing warnings by GCC.
10874
10875 * data/glr.c (inline): Remove #define. It's the user's
10876 responsibility to #define it away, just like 'const'.
10877 This fixes one of the bugs reported by Nelson H. F. Beebe in
10878 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
10879
10880 * Makefile.maint (po-check): Scan .l and .y files instead of the
10881 .c and the .h files that they generate. This fixes the bug
10882 reported by Tim Van Holder in:
10883 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
10884 Look for N_ as well as for _. Try to avoid matching #define for
10885 N_ and _.
10886 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
10887 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
10888 * src/scan-gram.l: Revamp regular expressions so that " and '
10889 do not confuse xgettext.
10890
10891 * src/struniq.h (struniq_new): Do not declare the return type
10892 to be 'const'; this violates the C standard.
10893 * src/struniq.c (struniq_new): Likewise.
10894
10895 2002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
10896
10897 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
10898 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
10899 linker.
10900
10901 2002-11-12 Akim Demaille <akim@epita.fr>
10902
10903 * Makefile.maint: Sync with Autoconf:
10904 (local_updates): New.
10905
10906 2002-11-12 Akim Demaille <akim@epita.fr>
10907
10908 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
10909
10910 2002-11-12 Akim Demaille <akim@epita.fr>
10911
10912 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
10913 locations.
10914
10915 2002-11-12 Akim Demaille <akim@epita.fr>
10916
10917 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
10918 not yyvalue.
10919
10920 2002-11-12 Akim Demaille <akim@epita.fr>
10921
10922 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
10923 Use it to test the GLR parser.
10924
10925 2002-11-12 Akim Demaille <akim@epita.fr>
10926
10927 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
10928 defines it.
10929 * data/glr.c (yystos): New.
10930 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
10931 (YYDSYMPRINT): New.
10932 (yyval): Don't define it, it is handled via M4.
10933 (yyrecoverParseError): Free verbosely the discarded symbols.
10934 * data/yacc.c (yysymprint): Remove, rather...
10935 (b4_yysymprint_generate): invoke.
10936 * data/c.m4 (b4_yysymprint_generate): New.
10937 Accept pointers as arguments, as opposed to the version from
10938 yacc.c.
10939 (b4_yydestruct_generate): Likewise.
10940 * tests/cations.at (Printers and Destructors): Use Bison directives
10941 instead of CPP macros.
10942 Don't rely on internal details.
10943
10944 2002-11-12 Akim Demaille <akim@epita.fr>
10945
10946 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
10947 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
10948 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
10949 it against YYEMPTY and so forth), work on yytoken (i.e., set
10950 it to YYEMPTY etc.).
10951 (yydestruct): Replace with a b4_yydestruct_generate invocation.
10952 (b4_symbol_actions): Remove.
10953 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
10954 for 0, end-of-input.
10955
10956 2002-11-12 Akim Demaille <akim@epita.fr>
10957
10958 * doc/bison.texinfo (Destructor Decl): New.
10959
10960 2002-11-12 Akim Demaille <akim@epita.fr>
10961
10962 * src/tables.c (tables_generate): Use free for pointers that
10963 cannot be NULL, not XFREE.
10964 (pack_vector): Use assert, not fatal, for bound violations.
10965 * src/state.c (state_new): Likewise.
10966 * src/reader.c (reader): Likewise.
10967 * src/lalr.c (set_goto_map): Likewise.
10968 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
10969 the file name.
10970
10971 2002-11-12 Akim Demaille <akim@epita.fr>
10972
10973 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
10974 Restore.
10975 * src/scan-gram.l (last_string): Is global to the file, not to
10976 yylex.
10977 * src/parse-gram.y (input): Don't append the epilogue here,
10978 (epilogue.opt): do it here, and free the scanner's obstack.
10979 * src/reader.c (epilogue_set): Rename as...
10980 (epilogue_augment): this.
10981 * data/c.m4 (b4_epilogue): Defaults to empty.
10982
10983 2002-11-12 Akim Demaille <akim@epita.fr>
10984
10985 * src/getargs.c (long_options): Remove duplicates.
10986 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
10987 Remove.
10988 * doc/bison.rnh: Remove.
10989 * doc/bison.texinfo (VMS Invocation): Remove.
10990
10991 2002-11-12 Akim Demaille <akim@epita.fr>
10992
10993 * src/struniq.h, src/struniq.c (struniq_t): Is const.
10994 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
10995
10996 Use struniq for symbols.
10997
10998 * src/symtab.h (symbol_t): The tag member is a struniq.
10999 (symbol_type_set): Adjust.
11000 * src/symtab.c (symbol_new): Takes a struniq.
11001 (symbol_free): Don't free the tag member.
11002 (hash_compare_symbol_t, hash_symbol_t): Rename as...
11003 (hash_compare_symbol, hash_symbol): these.
11004 Use the fact that tags as struniqs.
11005 (symbol_get): Use struniq_new.
11006 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
11007 Returns a strniq.
11008 * src/reader.h (merger_list, grammar_currentmerge_set): The name
11009 and type members are struniqs.
11010 * src/reader.c (get_merge_function)
11011 (grammar_current_rule_merge_set): Adjust.
11012 (TYPE, current_type): Are struniq.
11013
11014 Use struniq for file names.
11015
11016 * src/files.h, src/files.c (infile): Split into...
11017 (grammar_file, current_file): these.
11018 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
11019 * src/reduce.c (reduce_print): Likewise.
11020 * src/getargs.c (getargs): Likewise.
11021 * src/complain.h, src/complain.c: Likewise.
11022 * src/main.c (main): Call struniqs_new early enough to use it for
11023 file names.
11024 Don't free the input file name.
11025
11026 2002-11-12 Akim Demaille <akim@epita.fr>
11027
11028 * src/symtab.c (symbol_free): Remove dead deactivated code:
11029 type_name are properly removed.
11030 Don't use XFREE to free items that cannot be NULL.
11031 * src/struniq.h, src/struniq.c: New.
11032 * src/main.c (main): Initialize/free struniqs.
11033 * src/parse-gram.y (%union): Add astruniq member.
11034 (yyprint): Adjust.
11035 * src/scan-gram.l (<{tag}>): Return a struniq.
11036 Free the obstack bit that used to store it.
11037 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
11038
11039 2002-11-11 Paul Eggert <eggert@twinsun.com>
11040
11041 Revamp to fix many (but not all) of the C- and M4-related quoting
11042 problems. Among other things, this fixes the Bison bug reported
11043 by Jan Hubicka when processing the Bash grammar; see:
11044 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
11045
11046 Use new @ escapes consistently. Represent brackets with @{ and @}
11047 rather than @<:@ and @:>@, since this works a bit better with dumb
11048 editors like vi. Represent @ with @@, since @ is now consistently
11049 an escape. Use @oline@ and @ofile@ rather than __oline__ and
11050 __ofile__, to avoid unexpected expansions. Similarly, use @output
11051 rather than #output.
11052
11053 * data/c.m4 (b4_copyright): Omit file name from comment, since
11054 the file name could contain "*/".
11055 (b4_synclines_flag): Don't quote the 2nd argument; it should already
11056 be quoted. All uses changed.
11057
11058 * data/glr.c: Use new @ escapes consistently.
11059 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
11060 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
11061 Remove, since they couldn't handle arbitrary characters in file
11062 names.
11063 * data/lalr1.cc: Likewise.
11064 * data/yacc.c: Likewise.
11065
11066 * src/files.c (output_infix): Remove; all uses removed.
11067 * src/files.h: Likewise.
11068
11069 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
11070 mishandled funny characters in file names, and anyway it isn't
11071 needed any more.
11072 * data/yacc.c: Likewise.
11073 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
11074
11075 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
11076 * data/yacc.c: Likewise.
11077
11078 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
11079 strings now.
11080 (muscle_init): Quote filename as a C string.
11081 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
11082 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
11083 * src/output.c (escaped_file_name_output): New function.
11084 (prepare_symbols): Quote tokens for M4.
11085 (prepare): Don't insert output_infix, output_prefix,
11086 output_parser_name, output_header_name; this is now down by scan-skel.
11087 Insert skeleton as a C string.
11088
11089 * src/output.c (user_actions_output, symbol_destructors_output,
11090 symbol_printers_output): Quote filenames for C and M4.
11091 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11092
11093 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
11094 escapes other than \\ and \'; this simplifies the code.
11095 (<SC_STRING>): Likewise, for \\ and \".
11096 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
11097 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
11098 Use new escapes @{ and @} for [ and ].
11099
11100 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
11101 them with auto vars.
11102 Switch to new escape scheme, where @ is the escape character uniformly.
11103 Abort if a stray escape character is found. Avoid unbounded input
11104 buffer when parsing non-escaped text.
11105
11106 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
11107 __oline__, #output, $@, and @{ do not have unintended meanings.
11108
11109 2002-11-09 Paul Eggert <eggert@twinsun.com>
11110
11111 Fix the test failure due to GCC warnings described in
11112 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
11113 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
11114 evaluate to 0 if it's impossible for NINF to be in the respective
11115 table.
11116 (yygetLRActions, yyrecoverParseError): Use them.
11117
11118 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
11119 counted in the token inserted at end of file. Now takes
11120 location_t *, not location_t, so that the location can be
11121 adjusted. All uses changed.
11122
11123 * tests/regression.at (Invalid inputs): Adjust wording in
11124 diagnostic to match the new behavior.
11125
11126 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
11127 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
11128 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
11129 abort ();'. This reduces the runtime of the "Many lookaheads"
11130 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
11131 GCC 3.2.
11132
11133 2002-11-07 Paul Eggert <eggert@twinsun.com>
11134
11135 * src/parse-gram.y (CHARACTER): Remove unused token.
11136 All uses removed.
11137
11138 * src/scan-gram.l: Remove stack option. We no longer use the
11139 stack, since the stack was never deeper than 1; instead, use the
11140 new auto var c_context to record the stacked value.
11141
11142 Remove nounput option. At an unexpected end of file, we now unput
11143 the minimal input necessary to end cleanly; this simplifies the
11144 code.
11145
11146 Avoid unbounded token sizes where this is easy.
11147
11148 (unexpected_end_of_file): New function.
11149 Use it to systematize the error message on unexpected EOF.
11150 (last-string): Now auto, not static.
11151 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
11152 (scanner_last_string_free): Remove; not used.
11153 (percent_percent_count): Move decl to just before use.
11154 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
11155 not the (never otherwised-used) CHARACTER.
11156
11157 2002-11-07 Akim Demaille <akim@epita.fr>
11158
11159 Let yyerror always receive the msg as last argument, so that
11160 yyerror can be variadic.
11161
11162 * data/yacc.c (b4_yyerror_args): New.
11163 Use it when calling yyerror.
11164 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
11165 Use it when calling yyerror.
11166 * doc/bison.texinfo (Error Reporting): Adjust.
11167 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
11168 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
11169
11170 2002-11-06 Akim Demaille <akim@epita.fr>
11171
11172 #line should have quoted strings.
11173 Ideally, this should be done by m4_quotearg.
11174
11175 * src/scan-skel.l: Include quotearg.h.
11176 Quote __ofile__.
11177 * src/output.c (symbol_printers_output)
11178 (symbol_destructors_output): Quote the file name.
11179
11180 2002-11-06 Akim Demaille <akim@epita.fr>
11181
11182 * tests/regression.at (Invalid inputs): Adjust to the recent
11183 messages.
11184
11185 2002-11-06 Akim Demaille <akim@epita.fr>
11186
11187 Restore --no-lines.
11188 Reported by Jim Kent.
11189
11190 * data/c.m4 (b4_syncline): New.
11191 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
11192 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
11193 * src/output.c (user_actions_output): Likewise.
11194 (prepare): Define 'b4_synclines_flag'.
11195 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
11196
11197 2002-11-06 Akim Demaille <akim@epita.fr>
11198
11199 * src/main.c (main): Free `infile'.
11200 * src/scan-gram.l (handle_syncline): New.
11201 Recognize `#line'.
11202 * src/output.c (user_actions_output, symbol_destructors_output)
11203 (symbol_printers_output): Use the location's file name, not
11204 infile.
11205 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11206
11207 2002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11208
11209 * src/tables.c (matching_state): Don't allow states to match if
11210 either has GLR conflict entries.
11211
11212 2002-11-05 Paul Eggert <eggert@twinsun.com>
11213
11214 * src/scan-gram.l: Use more accurate diagnostics, e.g.
11215 "integer out of range" rather than "invalid value".
11216 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
11217 accordingly.
11218
11219 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
11220 Also, remove one static variable in the scanner.
11221
11222 * src/scan-gram.l (braces_level): Now auto, not static.
11223 Initialize to zero if the compiler is being picky.
11224 (INITIAL): Clear braces_level instead of incrementing it.
11225 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
11226 as POSIX 1003.1-2001 requires.
11227 * src/system.h (IF_LINT): New macro, taken from coreutils.
11228 * configure.ac: Define "lint" if --enable-gcc-warnings.
11229
11230 2002-11-05 Akim Demaille <akim@epita.fr>
11231
11232 * src/scan-gram.l: When it starts with `%', complain about the
11233 whole directive, not just that `invalid character: %'.
11234
11235 2002-11-04 Akim Demaille <akim@epita.fr>
11236
11237 * Makefile.maint: Update from Autoconf.
11238 (update, cvs-update, po-update, do-po-update): New.
11239
11240 2002-11-04 Akim Demaille <akim@epita.fr>
11241
11242 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
11243 and yyerror.
11244 Have yyerror `use' its arguments.
11245 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
11246 returns true when location & yacc & pure & parse-param.
11247 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
11248
11249 2002-11-04 Akim Demaille <akim@epita.fr>
11250
11251 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
11252 clashes.
11253 * src/scan-gram.l: Use [\'] instead of ['] to pacify
11254 font-lock-mode.
11255 Use complain_at.
11256 Use quote, not quote_n since LOCATION_PRINT no longer uses the
11257 slot 0.
11258
11259 2002-11-03 Paul Eggert <eggert@twinsun.com>
11260
11261 * src/reader.c (get_merge_function, grammar_current_rule_check):
11262 Use consistent diagnostics for reporting type name clashes.
11263 Quote the types with <>, for consistency with Yacc.
11264 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
11265
11266 2002-11-03 Akim Demaille <akim@epita.fr>
11267
11268 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
11269 New.
11270 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
11271 (b4_parse_param): Remove.
11272 Use b4_identification.
11273 Propagate b4_pure_args where needed to pass them to yyerror.
11274 * data/glr.m4 (b4_parse_param): Remove.
11275 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
11276 (b4_lpure_formals): New.
11277 Use b4_identification.
11278 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
11279 b4_user_formals and b4_user_args.
11280 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
11281 (yyreportAmbiguity): When using a pure parser, also need
11282 the location, and the parse-params.
11283 Adjust callers.
11284 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
11285 When using a pure parser, also need the parse-params.
11286 Adjust callers.
11287 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
11288 (%pure-parser + %parse-param) LALR and GLR parsers.
11289 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
11290 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
11291 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
11292 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
11293 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
11294 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
11295 * doc/bison.texinfo: Untabify the whole file.
11296 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
11297 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
11298 (Error Reporting): Adjust to these new directives.
11299 Document %error-verbose, deprecate YYERROR_VERBOSE.
11300
11301 2002-11-03 Akim Demaille <akim@epita.fr>
11302
11303 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
11304 AT_CHECK_CALC_GLR invocations to use % directives, instead of
11305 command line options.
11306 * tests/cxx-type.at: Formatting changes.
11307
11308 2002-11-03 Paul Eggert <eggert@twinsun.com>
11309
11310 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
11311 to count columns correctly, and to check for invalid inputs.
11312
11313 Use mbsnwidth to count columns correctly. Account for tabs, too.
11314 Include mbswidth.h.
11315 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
11316 (extend_location): New function.
11317 (YY_LINES): Remove.
11318
11319 Handle CRLF in C code rather than in Lex code.
11320 (YY_INPUT): New macro.
11321 (no_cr_read): New function.
11322
11323 Scan UCNs, even though we don't fully handle them yet.
11324 (convert_ucn_to_byte): New function.
11325
11326 Handle backslash-newline correctly in C code.
11327 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
11328 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
11329 all uses changed.
11330 (tag, splice): New EREs. Do not allow NUL or newline in tags.
11331 Use {splice} wherever C allows backslash-newline.
11332 YY_STEP after space, newline, vertical-tab.
11333 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
11334
11335 (letter, id): Don't assume ASCII; e.g., spell out a-z.
11336
11337 ({int}, handle_action_dollar, handle_action_at): Check for integer
11338 overflow.
11339
11340 (YY_STEP): Omit trailing semicolon, so that it's more like C.
11341
11342 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
11343 as well as \000. Check for UCHAR_MAX, not 255.
11344 Allow \x with an arbitrary positive number of digits, as in C.
11345 Check for overflow here.
11346 Allow \? and UCNs, for compatibility with C.
11347
11348 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
11349 with quote slot used by complain_at.
11350
11351 * tests/input.at: Add tests for backslash-newline, m4 quotes
11352 in symbols, long literals, and funny escapes in strings.
11353
11354 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
11355 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
11356 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
11357 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
11358 * m4/mbswidth.m4: New file, from GNU coreutils.
11359
11360 * doc/bison.texinfo (Grammar Outline): Document // comments.
11361 (Symbols): Document that trigraphs have no special meaning in Bison,
11362 nor is backslash-newline allowed.
11363 (Actions): Document that trigraphs have no special meaning.
11364
11365 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
11366 no longer used.
11367
11368 2002-11-02 Paul Eggert <eggert@twinsun.com>
11369
11370 * src/reader.c: Don't include quote.h; not needed.
11371 (get_merge_function): Reword warning to be consistent with
11372 type clash diagnostic in grammar_current_rule_check.
11373
11374 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
11375 bug in trigraph handling.
11376
11377 * src/output.c (prepare_symbols): When printing token names,
11378 escape "[" as "@<:@" and likewise for "]".
11379
11380 * src/system.h (errno): Remove declaration, as we are now
11381 assuming C89 or better, and C89 guarantees errno.
11382
11383 2002-10-30 Paul Eggert <eggert@twinsun.com>
11384
11385 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
11386 Check for close failures.
11387 * src/files.h (xfclose): Return void, not int, since it always
11388 returned zero.
11389 * src/files.c (xfclose): Likewise. Report I/O error if ferror
11390 indicates one.
11391 * src/output.c (output_skeleton): Use xfclose rather than fclose
11392 and ferror. xfclose now checks ferror.
11393
11394 * data/glr.c (YYLEFTMOST_STATE): Remove.
11395 (yyreportTree): Use a stack-based leftmost state. This avoids
11396 our continuing battles with bogus warnings about initializers.
11397
11398 2002-10-30 Akim Demaille <akim@epita.fr>
11399
11400 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
11401 #if.
11402
11403 2002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11404
11405 * tests/glr-regr1.at: New test for reported regressions.
11406 * tests/testsuite.at: Add glr-regr1.at test.
11407 * tests/Makefile.am: Add glr-regr1.at test.
11408
11409 2002-10-24 Paul Eggert <eggert@twinsun.com>
11410
11411 Version 1.75a.
11412
11413 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
11414 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
11415 we use malloc. Don't assume 'A' through 'Z' are contiguous.
11416 Don't assume strdup exists; POSIX says its an XSI extension.
11417 Check for buffer overflow on input.
11418
11419 2002-10-24 Akim Demaille <akim@epita.fr>
11420
11421 * src/output.c (output_skeleton): Don't disable M4sugar comments
11422 too soon: it results in comments being expanded.
11423 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
11424 first output.
11425
11426 2002-10-24 Akim Demaille <akim@epita.fr>
11427
11428 * data/yacc.c (m4_int_type): New.
11429 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
11430 char' as only yacc.c wants K&R portability.
11431 * data/glr.c (yysigned_char): Remove.
11432 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
11433 Reported by Quoc Peyrot.
11434
11435 2002-10-23 Paul Eggert <eggert@twinsun.com>
11436
11437 * src/main.c (main): With --trace=time, report times even if a
11438 non-fatal error occurs. Formerly, the times were reported in some
11439 such cases but not in others.
11440 * src/reader.c (reader): Just return if a complaint has been issued,
11441 instead of exiting, so that 'main' can report times.
11442
11443 2002-10-22 Akim Demaille <akim@epita.fr>
11444
11445 * src/system.h: Include sys/types.
11446 Reported by Bert Deknuydt.
11447
11448 2002-10-23 Paul Eggert <eggert@twinsun.com>
11449
11450 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
11451 Suggested by Art Haas.
11452
11453 2002-10-22 Paul Eggert <eggert@twinsun.com>
11454
11455 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
11456 decl; not needed any more.
11457 * src/main.c (main): Use return to exit, undoing yesterday's change.
11458 The last OS that we could find where this wouldn't work is
11459 SunOS 3.5, and that's too old to worry about now.
11460
11461 * data/glr.c (struct yyltype): Define members even when not
11462 doing locations. This is more consistent with yacc.c, and it
11463 works around the following bug reports:
11464 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
11465 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
11466
11467 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
11468 @acronym consistently. Standardize on "Yacc" instead of "YACC",
11469 "Algol" instead of "ALGOL". Give a bit more history about BNF.
11470
11471 2002-10-22 Akim Demaille <akim@epita.fr>
11472
11473 * data/README: New.
11474
11475 2002-10-21 Paul Eggert <eggert@twinsun.com>
11476
11477 Be consistent about 'bool'; the old code used an enum in one
11478 module and an int in another, and this violates the C standard.
11479 * m4/stdbool.m4: New file, from coreutils 4.5.3.
11480 * configure.ac (AC_HEADER_STDBOOL): Add.
11481 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
11482 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
11483 * src/symtab.c (hash_compare_symbol_t): Likewise.
11484 * src/system.h (bool, false, true): Use a definition consistent
11485 with ../lib/hash.c. All uses changed.
11486
11487 * src/complain.c (warning_issued): Renamed from warn_message_count,
11488 so that we needn't worry about integer overflow (!).
11489 Now of type bool. All uses changed.
11490 (complaint_issued): Renamed from complain_message_count; likewise.
11491
11492 * src/main.c (main): Use exit to exit with failure.
11493
11494 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
11495 rather than 1 and 0.
11496 * src/main.c (main): Likewise.
11497 * src/getargs.c (getargs): Likewise.
11498 * src/reader.c (reader): Likewise.
11499
11500 * src/getarg.c (getargs): Remove duplicate code for
11501 "Try `bison --help'".
11502
11503 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
11504 What was that "2" for?
11505
11506 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
11507 * src/getargs.c (usage): Likewise.
11508
11509 * src/getargs.c (getargs): When there are too few operands, report
11510 the last one. When there are too many, report the first extra
11511 one. This is how diffutils does it.
11512
11513 2002-10-20 Paul Eggert <eggert@twinsun.com>
11514
11515 Remove K&R vestiges.
11516 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
11517 * src/complain.c (VA_START): Remove. Assume prototypes.
11518 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
11519 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
11520 fatal): Assume prototypes.
11521 * src/complain.h: Assume prototypes.
11522 * src/system.h (PARAMS): Remove.
11523 Include <limits.h> unconditionally, since it's guaranteeed even
11524 for a freestanding C89 compiler.
11525 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
11526 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
11527
11528 2002-10-20 Akim Demaille <akim@epita.fr>
11529
11530 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
11531 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
11532 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
11533 (yyresolveStates, yyresolveAction, yyresolveStack)
11534 (yyprocessOneStack): Use them.
11535 (yy_reduce_print): New.
11536 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
11537
11538 2002-10-20 Akim Demaille <akim@epita.fr>
11539
11540 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
11541 arguments and output `void'.
11542 (b4_c_function): Rename as...
11543 (b4_c_function_def): this.
11544 (b4_c_function_decl, b4_c_ansi_function_def)
11545 (b4_c_ansi_function_decl): New.
11546 Change the interpretation of the arguments: before `int, foo', now
11547 `int foo, foo'.
11548 * data/yacc.c (yyparse): Prototype and define thanks to these.
11549 Adjust b4_c_function_def uses.
11550 * data/glr.c (yyparse): Likewise, but ANSI only.
11551
11552 2002-10-20 Akim Demaille <akim@epita.fr>
11553
11554 * src/output.c (prepare): Move the definition of `tokens_number',
11555 `nterms_number', `undef_token_number', `user_token_number_max'
11556 to...
11557 (prepare_tokens): Here.
11558 (prepare_tokens): Rename as...
11559 (prepare_symbols): this.
11560 (prepare): Move the definition of `rules_number' to...
11561 (prepare_rules): here.
11562 (prepare): Move the definition of `last', `final_state_number',
11563 `states_number' to...
11564 (prepare_states): here.
11565 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
11566
11567 2002-10-20 Akim Demaille <akim@epita.fr>
11568
11569 * src/tables.h, src/tables.c, src/output.c: Comment changes.
11570
11571 2002-10-20 Akim Demaille <akim@epita.fr>
11572
11573 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
11574 * data/c.m4: here.
11575
11576 2002-10-20 Akim Demaille <akim@epita.fr>
11577
11578 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
11579 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
11580 `pair'.
11581 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
11582 `name' to...
11583 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
11584 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
11585 These.
11586
11587 2002-10-19 Paul Eggert <eggert@twinsun.com>
11588
11589 Do not create a temporary file, as that involves security and
11590 cleanup headaches. Instead, use a pair of pipes.
11591 Derived from a suggestion by Florian Krohm.
11592 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
11593 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
11594 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
11595 (BISON_PREREQ_SUBPIPE): Add.
11596 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
11597 Add subpipe.h, subpipe.c.
11598 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
11599 * po/POTFILES.in: Add lib/subpipe.c.
11600 * src/output.c: Include "subpipe.h".
11601 (m4_invoke): Remove decl.
11602 (scan_skel): New decl.
11603 (output_skeleton): Use pipe rather than temporary file for m4 input.
11604 Check that m4sugar.m4 is readable, to avoid deadlock.
11605 Check for pipe I/O error.
11606 * src/scan-skel.l (readpipe): Remove decl.
11607 (scan_skel): New function, to be used in place of m4_invoke.
11608 Read from stream rather than file.
11609
11610 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
11611 float, as this generates a warning on Solaris 8 + GCC 3.2 with
11612 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
11613 this generates a more-accurate value anyway.
11614
11615 * lib/timevar.c (timervar_accumulate): Rename locals to
11616 avoid confusion with similarly-named more-global.
11617 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
11618
11619 * src/output.c (prepare): Use xstrdup to convert char const *
11620 to char *, to avoid GCC warning.
11621
11622 2002-10-19 Akim Demaille <akim@epita.fr>
11623
11624 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
11625 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
11626 Use them to have `calc.y' ready for %pure-parser.
11627 * data/yacc.c (YYLEX): Pass a yylex return type to
11628 b4_c_function_call.
11629
11630 2002-10-19 Akim Demaille <akim@epita.fr>
11631
11632 Prototype support of %lex-param and %parse-param.
11633
11634 * src/parse-gram.y: Add the definition of the %lex-param and
11635 %parse-param tokens, plus their rules.
11636 Drop the `_' version of %glr-parser.
11637 Add the "," token.
11638 * src/scan-gram.l (INITIAL): Scan them.
11639 * src/muscle_tab.c: Comment changes.
11640 (muscle_insert, muscle_find): Rename `pair' as `probe'.
11641 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
11642 (muscle_entry_s): The `value' member is no longer const.
11643 Adjust all dependencies.
11644 * src/muscle_tab.c (muscle_init): Adjust: use
11645 MUSCLE_INSERT_STRING.
11646 Initialize the obstack earlier.
11647 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
11648 (muscle_pair_list_grow): New.
11649 * data/c.m4 (b4_c_function_call, b4_c_args): New.
11650 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
11651 * tests/calc.at: Use %locations, not --locations.
11652 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
11653
11654 2002-10-19 Akim Demaille <akim@epita.fr>
11655
11656 * src/getargs.c (usage): Take status as argument and exit
11657 accordingly.
11658 Report the traditional `Try ... --help' message when status != 0.
11659 (usage, version): Don't take a FILE * as arg, it is pointless.
11660 (getargs): When there is an incorrect number of arguments, make it
11661 an error, and report it GNUlically thanks to `usage ()'.
11662
11663 2002-10-18 Paul Eggert <eggert@twinsun.com>
11664
11665 * data/glr.c (yyreportParseError): Don't assume that sprintf
11666 yields the length of the printed string, as this is not true
11667 on SunOS 4.1.4. Reported by Peter Klein.
11668
11669 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
11670 * tests/conflicts.at (%nonassoc and eof): Likewise.
11671 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
11672
11673 2002-10-17 Akim Demaille <akim@epita.fr>
11674
11675 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
11676 * src/getargs.c (trace_types, trace_args): Adjust.
11677 * src/reader.c (grammar_current_rule_prec_set)
11678 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
11679 Standardize error messages.
11680 And s/@prec/%prec/!
11681 (reader): Use trace_flag to enable scanner/parser debugging,
11682 instead of an adhoc scheme.
11683 * src/scan-gram.l: Remove trailing debugging code.
11684
11685 2002-10-16 Paul Eggert <eggert@twinsun.com>
11686
11687 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
11688 MUSCLE_TAB_H.
11689
11690 * NEWS: Officially drop support for building Bison with K&R C,
11691 since it didn't work anyway and it's not worth worrying about.
11692 * Makefile.maint (wget_files): Remove ansi2knr.c.
11693 (ansi2knr.c-url_prefix): Remove.
11694 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
11695 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11696 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11697
11698 2002-10-15 Paul Eggert <eggert@twinsun.com>
11699
11700 Stop using the "enum_" trick for K&R-style function definitions;
11701 it confused me, and I was the author! Instead, assume that people
11702 who want to use K&R C compilers (when using these modules in GCC,
11703 perhaps?) will run ansi2knr.
11704
11705 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
11706 All uses of "enum_" changed to "enum ".
11707 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11708 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11709
11710 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
11711 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
11712 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
11713 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
11714 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
11715 abitset_not, abitset_ones, abitset_or, abitset_or_and,
11716 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
11717 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
11718 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
11719 Use function prototypes; this removes the need for declaring
11720 static functions simply to provide their prototypes.
11721 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
11722 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
11723 bitset_count_, bitset_create, bitset_dump, bitset_first,
11724 bitset_free, bitset_init, bitset_last, bitset_next,
11725 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
11726 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
11727 bitset_print, bitset_release_memory, bitset_toggle_,
11728 bitset_type_choose, bitset_type_get, bitset_type_name_get,
11729 debug_bitset): Likewise.
11730 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
11731 * lib/bitset_stats.c (bitset_log_histogram_print,
11732 bitset_percent_histogram_print, bitset_stats_and,
11733 bitset_stats_and_cmp, bitset_stats_and_or,
11734 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
11735 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
11736 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
11737 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
11738 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
11739 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
11740 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
11741 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
11742 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
11743 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
11744 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
11745 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
11746 bitset_stats_zero): Likewise.
11747 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11748 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11749 bitsetv_dump, debug_bitsetv): Likewise.
11750 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
11751 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
11752 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
11753 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
11754 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
11755 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
11756 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
11757 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
11758 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
11759 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
11760 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
11761 Likewise.
11762 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
11763 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
11764 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
11765 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
11766 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
11767 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
11768 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
11769 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
11770 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
11771 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
11772 lbitset_xor_cmp, lbitset_zero): Likewise.
11773
11774 2002-10-14 Akim Demaille <akim@epita.fr>
11775
11776 Version 1.75.
11777
11778 2002-10-14 Akim Demaille <akim@epita.fr>
11779
11780 * tests/Makefile.am (maintainer-check-posix): New.
11781
11782 2002-10-14 Akim Demaille <akim@epita.fr>
11783
11784 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
11785 member.
11786
11787 2002-10-14 Akim Demaille <akim@epita.fr>
11788
11789 * src/tables.c (table_ninf_remap): base -> tab.
11790 Reported by Matt Rosing.
11791
11792 2002-10-14 Paul Eggert <eggert@twinsun.com>
11793
11794 * tests/action.at, tests/calc.at, tests/conflicts.at,
11795 tests/cxx-type.at, tests/headers.at, tests/input.at,
11796 tests/regression.at, tests/synclines.at, tests/torture.at:
11797 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
11798 so that the tests still work even if POSIXLY_CORRECT is set.
11799 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
11800
11801 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
11802 for portability to K&R hosts. Fix typo: signed char is guaranteed
11803 only to 127, not to 128.
11804 * data/glr.c (yysigned_char): New type.
11805 * data/yacc.c (yysigned_char): Likewise.
11806 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
11807
11808 2002-10-13 Paul Eggert <eggert@twinsun.com>
11809
11810 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
11811 true due to limited range of data type" warning from GCC.
11812
11813 * data/c.m4 (b4_token_defines): Protect against double-inclusion
11814 by wrapping enum yytokentype's definition inside #ifndef
11815 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
11816
11817 2002-10-13 Akim Demaille <akim@epita.fr>
11818
11819 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
11820 Un yy- yyrhs to avoid the name clash with the global YYRHS.
11821
11822 2002-10-13 Akim Demaille <akim@epita.fr>
11823
11824 * Makefile.maint: Update from Autoconf 2.54.
11825 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
11826
11827 2002-10-13 Akim Demaille <akim@epita.fr>
11828
11829 * src/print.c (print_state): Separate the list of solved conflicts
11830 from the other items.
11831 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
11832
11833 2002-10-13 Akim Demaille <akim@epita.fr>
11834
11835 Let nondeterministic skeletons be usable with deterministic
11836 tables.
11837
11838 With the patch, GAWK compiled by GCC without -O2 passes its test
11839 suite using a GLR parser driven by LALR tables. It fails with -O2
11840 because `struct stat' gives two different answers on my machine:
11841 88 (definition of an auto var) and later 96 (memset on this var).
11842 Hence the stack is badly corrumpted. The headers inclusion is to
11843 blame: if I move the awk.h inclusion before GLR's system header
11844 inclusion, the two struct stat have the same size.
11845
11846 * src/tables.c (pack_table): Always create conflict_table.
11847 (token_actions): Always create conflict_list.
11848 * data/glr.c (YYFLAG): Remove, unused.
11849
11850 2002-10-13 Akim Demaille <akim@epita.fr>
11851
11852 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
11853 (O0FLAGS): New.
11854 (VALGRIND, GXX): New.
11855 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
11856 * tests/bison.in: Run $PREBISON a pre-command.
11857 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
11858 (maintainer-check-g++): New.
11859 * Makefile.am (maintainer-check): New.
11860
11861 2002-10-13 Akim Demaille <akim@epita.fr>
11862
11863 * data/glr.c: Formatting changes.
11864 Tweak some trace messages to match yacc.c's.
11865
11866 2002-10-13 Akim Demaille <akim@epita.fr>
11867
11868 GLR parsers sometimes raise parse errors instead of performing the
11869 default reduction.
11870 Reported by Charles-Henry de Boysson.
11871
11872 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
11873 check the length of the traces when %glr.
11874 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
11875 GLR's traces.
11876 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
11877 Test GLR parsers.
11878 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
11879 (yyltype): Remove the yy prefix from the member names.
11880 (yytable): Complete its comment.
11881 (yygetLRActions): Map error action number from YYTABLE from
11882 YYTABLE_NINF to 0.
11883 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
11884 (which was a bug: it should have been YYTABEL_NINF, and yet it was
11885 not satisfying as we could compare an YYACTION computed from
11886 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
11887 only value for error actions.
11888 (yyreportParseError): In verbose parse error messages, don't issue
11889 `error' in the list of expected tokens.
11890 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
11891 next action to perform to match glr.c's decoding.
11892 (yytable): Complete its comment.
11893
11894 2002-10-13 Paul Eggert <eggert@twinsun.com>
11895
11896 Fix problem reported by Henrik Grubbstroem in
11897 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
11898 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
11899 because the Bison parser reads the second action before reducing
11900 the first one.
11901 * src/scan-gram.l (rule_length): New static var.
11902 Use it to keep track of the rule length in the scanner, since
11903 we can't expect the parser to be in lock-step sync with the scanner.
11904 (handle_action_dollar, handle_action_at): Use this var.
11905 * tests/actions.at (Exotic Dollars): Test for the problem.
11906
11907 2002-10-12 Paul Eggert <eggert@twinsun.com>
11908
11909 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
11910 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
11911 Include <sys/time.h> when checking for clock_t and struct tms.
11912 Use same include order as source.
11913 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
11914 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
11915
11916 * lib/timevar.c: Update copyright date and clarify comments.
11917 (get_time) [IN_GCC]: Keep the GCC version for reference.
11918
11919 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
11920 GCC version as of today, then merge Bison's changes.
11921 Change "GCC" to "Bison" in copyright notice. timevar.def's
11922 author is Akim, so change that too.
11923
11924 * src/reader.c (grammar_current_rule_check):
11925 Don't worry about the default action if $$ is untyped.
11926 Prevents bogus warnings reported by Jim Gifford in
11927 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
11928
11929 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
11930 * data/glr.c, data/lalr1.cc, data/yacc.c:
11931 Output token definitions before the first part of user declarations.
11932 Fixes compatibility problem reported by Jim Gifford for kbd in
11933 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
11934
11935 2002-10-11 Paul Eggert <eggert@twinsun.com>
11936
11937 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
11938 (yyparse): here. This undoes some of the 2002-07-25 change.
11939 Compatibility problem reported by Ralf S. Engelschall with
11940 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
11941
11942 2002-10-11 Akim Demaille <akim@epita.fr>
11943
11944 * tests/regression.at Characters Escapes): New.
11945 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
11946 characters.
11947 Reported by Jan Nieuwenhuizen.
11948
11949 2002-10-11 Akim Demaille <akim@epita.fr>
11950
11951 * po/id.po: New.
11952
11953 2002-10-10 Paul Eggert <eggert@twinsun.com>
11954
11955 Portability fixes for bitsets; this also avoids several GCC
11956 warnings.
11957
11958 * lib/abitset.c: Include <stddef.h>, for offsetof.
11959 * lib/lbitset.c: Likewise.
11960
11961 * lib/abitset.c (abitset_bytes): Return a size that is aligned
11962 properly for vectors of objects. Do not assume that adding a
11963 header size to a multiple of a word size yields a value that is
11964 properly aligned for the whole union.
11965 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11966
11967 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
11968 unique names for structures.
11969 * lib/ebitset.c (ebitset_bytes): Likewise.
11970 * lib/lbitset.c (lbitset_bytes): Likewise.
11971
11972 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
11973 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
11974 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
11975 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
11976 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
11977 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
11978 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
11979 to improve the type-checking that GCC can do.
11980 * lib/bitset.c (bitset_op4_cmp): Likewise.
11981 * lib/bitset_stats.c (bitset_stats_count,
11982 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
11983 bitset_stats_copy, bitset_stats_disjoint_p,
11984 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
11985 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
11986 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
11987 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
11988 bitset_stats_and_or_cmp, bitset_stats_andn_or,
11989 bitset_stats_andn_or_cmp, bitset_stats_or_and,
11990 bitset_stats_or_and_cmp): Likewise.
11991 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
11992 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
11993 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
11994 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
11995
11996 * lib/abitset.h: Include bitset.h, not bbitset.h.
11997 * lib/ebitset.h: Likewise.
11998 * lib/lbitset.h: Likewise.
11999
12000 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
12001 All instances of parameters of type enum bitset_opts are now of
12002 type enum_bitset_opts, to conform to the C Standard, and similarly
12003 for enum_bitset_type.
12004 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
12005 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
12006
12007 Do not use "struct bitset_struct" to mean different things in
12008 different modules. Not only is this confusing, it violates
12009 the C Standard, which requires that structure types in different
12010 modules must be compatible if one is to be passed to the other.
12011 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
12012 All instances of "struct bitset_struct *" replaced with "bitset".
12013 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
12014 (union bitset_union, struct abitset_struct, struct ebitset_struct,
12015 struct lbitset_struct, struct bitset_stats_struct): New types.
12016 All uses of struct bitset_struct changed to union bitset_union,
12017 etc.
12018 * lib/abitset.c (struct abitset_struct, abitset,
12019 struct bitset_struct): Remove.
12020 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
12021 struct bitset_struct): Remove.
12022 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
12023 bitset_struct): Remove.
12024 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
12025 Likewise.
12026
12027 Do not call a function of type T using a call that assumes the
12028 function is of a different type U. Standard C requires that a
12029 function must be called with a type that is compatible with its
12030 definition.
12031 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12032 New decls.
12033 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12034 New functions.
12035 * lib/ebitset.c (PFV): Remove.
12036 * lib/lbitset.c (PFV): Likewise.
12037 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
12038 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
12039 decls.
12040 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
12041 (ebitset_vtable): Use them.
12042 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
12043 lbitset_xor): New functions.
12044 (lbitset_vtable): Use them.
12045
12046 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
12047 Declare.
12048
12049 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
12050 GCC warning.
12051 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
12052 Use offsetof, for simplicity.
12053
12054 2002-10-06 Paul Eggert <eggert@twinsun.com>
12055
12056 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
12057 the same width as int. This reapplies a hunk of the 2002-08-12 patch
12058 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
12059 which was inadvertently undone by the 2002-09-30 patch.
12060 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
12061 the same width as int.
12062
12063 2002-10-04 Paul Eggert <eggert@twinsun.com>
12064
12065 Version 1.50.
12066
12067 * configure.ac (AC_INIT), NEWS: Increment version number.
12068
12069 * doc/bison.texinfo: Minor spelling, grammar, and white space
12070 fixes.
12071 (Symbols): Mention that any negative value returned from yylex
12072 signifies end-of-input. Warn about negative chars. Mention
12073 the portable Standard C character set.
12074
12075 The GNU coding standard says CFLAGS and YFLAGS are reserved
12076 for the installer to set.
12077 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
12078 * src/Makefile.am (AM_CFLAGS): Likewise.
12079 (AM_YFLAGS): Renamed from YFLAGS.
12080
12081 Fix some MAX and MIN problems.
12082 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
12083 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
12084 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
12085 * src/reader.c (reader): Use it.
12086
12087 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
12088 POSIX 1003.1-2001 has removed fgrep.
12089
12090 2002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
12091
12092 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
12093 interpreted as signed.
12094 * lib/ebitset.c (ebitset_list): Fix bug.
12095
12096 2002-10-01 Paul Eggert <eggert@twinsun.com>
12097
12098 More fixes for 64-bit hosts and large bitsets.
12099
12100 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
12101 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
12102 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
12103 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
12104 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
12105 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
12106 bitset_count_): Likewise.
12107 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
12108 bitset_first, bitset_last): Likewise.
12109 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
12110 bitset_stats_list_reverse, bitset_stats_size,
12111 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
12112 Likewise.
12113 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12114 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
12115 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
12116 bitsetv_reflexive_transitive_closure): Likewise.
12117 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
12118 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
12119 Likewise.
12120 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
12121 Likewise.
12122
12123 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
12124 Use size_t, not unsigned int, to count bytes.
12125 * lib/abitset.h (abitset_bytes): Likewise.
12126 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
12127 Likewise.
12128 * lib/bitset.h (bitset_bytes): Likewise.
12129 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
12130 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
12131 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12132 * lib/ebitset.c (ebitset_bytes): Likewise.
12133 * lib/ebitset.h (ebitset_bytes): Likewise.
12134 * lib/lbitset.c (lbitset_bytes): Likewise.
12135 * lib/lbitset.h (lbitset_bytes): Likewise.
12136
12137 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
12138 abitset_subset_p, abitset_disjoint_p, abitset_and,
12139 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
12140 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
12141 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
12142 abitset_or_and, abitset_or_and_cmp):
12143 Use bitset_windex instead of unsigned int.
12144 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12145 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
12146 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
12147 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
12148 Likewise.
12149 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
12150
12151 * lib/bitset.c (bitset_print):
12152 Use proper printf formats for widths of integer types.
12153 * lib/bitset_stats.c (bitset_percent_histogram_print,
12154 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
12155 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12156 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12157 * lib/lbitset.c (lbitset_bytes): Likewise.
12158
12159 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
12160 BITSET_SIZE_MAX): New macros.
12161 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
12162 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
12163 to BITSET_WINDEX_MAX.
12164
12165 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
12166 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
12167 since we now return the bitset_bindex type (not int).
12168
12169 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
12170 when computing sizes.
12171 * lib/ebitset.c (ebitset_elts_grow): Likewise.
12172
12173 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
12174 and avoid cast to unsigned.
12175
12176 2002-09-30 Akim Demaille <akim@epita.fr>
12177
12178 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12179 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
12180 Updates from Michael Hayes.
12181
12182 2002-09-30 Art Haas <ahaas@neosoft.com>
12183
12184 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
12185 invocations.
12186 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
12187 defined.
12188
12189 2002-09-27 Akim Demaille <akim@epita.fr>
12190
12191 Version 1.49c.
12192
12193 2002-09-27 Akim Demaille <akim@epita.fr>
12194
12195 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
12196 (Because of AC_LIBSOURCE).
12197
12198 2002-09-27 Akim Demaille <akim@epita.fr>
12199
12200 Playing with Autoscan.
12201
12202 * configure.ac: Remove the old LIBOBJ tweaks.
12203 (AC_REPLACE_FUNCS): Add strrchr and strtol.
12204 * lib/strrchr.c: New.
12205 * lib/strtol.c: New, from the Coreutils 4.5.1.
12206
12207 2002-09-27 Akim Demaille <akim@epita.fr>
12208
12209 Playing with Autoscan.
12210
12211 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
12212 * lib/Makefile.am (libbison_a_SOURCES): No longer include
12213 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
12214 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
12215 Coreutils 4.5.1.
12216
12217 2002-09-24 Akim Demaille <akim@epita.fr>
12218
12219 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
12220 (Frequently Asked Questions, Parser Stack Overflow): New.
12221
12222 2002-09-13 Akim Demaille <akim@epita.fr>
12223
12224 Playing with autoscan.
12225
12226 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
12227 * src/files.c (skeleton_find): Remove, unused.
12228 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
12229 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
12230
12231 2002-09-13 Akim Demaille <akim@epita.fr>
12232
12233 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
12234 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
12235
12236 2002-09-13 Akim Demaille <akim@epita.fr>
12237
12238 * configure.ac: Require 2.54.
12239 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
12240 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
12241 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
12242 Remove, provided by Autoconf macros.
12243
12244 2002-09-12 Akim Demaille <akim@epita.fr>
12245
12246 * m4/prereq.m4: Update, from Coreutils 4.5.1.
12247
12248 2002-09-12 Akim Demaille <akim@epita.fr>
12249
12250 * m4/prereq.m4: Update, from Fileutils 4.1.5.
12251 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
12252 Reported by Martin Mokrejs.
12253
12254 2002-09-10 Akim Demaille <akim@epita.fr>
12255
12256 * src/parse-gram.y: Associate a human readable string to each
12257 token type.
12258 * tests/regression.at (Invalid inputs): Adjust.
12259
12260 2002-09-10 Gary V. Vaughan <gary@gnu.org>
12261
12262 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
12263 with an Autoconf-2.5x style configure.ac.
12264
12265 2002-09-06 Paul Eggert <eggert@twinsun.com>
12266
12267 * doc/bison.texinfo (Conditions): Make explicit that the GPL
12268 exception applies only to yacc.c. This is a modification of a
12269 patch originally suggested by Akim Demaille.
12270
12271 2002-09-06 Akim Demaille <akim@epita.fr>
12272
12273 * data/c.m4 (b4_copyright): Move the GPL exception comment from
12274 here to...
12275 * data/yacc.c: here.
12276
12277 * data/lalr1.cc (struct yyltype): Don't define it, since we use
12278 LocationType.
12279 (b4_ltype): Default to yy::Location from location.hh.
12280
12281 2002-09-04 Jim Meyering <jim@meyering.net>
12282
12283 * data/yacc.c: Guard the declaration of yytoknum also with
12284 `#ifdef YYPRINT', so it is declared only when used.
12285
12286 2002-09-04 Akim Demaille <akim@epita.fr>
12287
12288 * configure.in: Rename as...
12289 * configure.ac: this.
12290 Bump to 1.49c.
12291
12292 2002-09-04 Akim Demaille <akim@epita.fr>
12293
12294 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
12295 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
12296 translate maintainer only messages.
12297
12298 2002-08-12 Paul Eggert <eggert@twinsun.com>
12299
12300 Version 1.49b.
12301
12302 * Makefile.am (SUBDIRS): Remove intl.
12303 (DISTCLEANFILES): Remove.
12304 * NEWS: Mention that GNU M4 is now required. Clarify what is
12305 meant by "larger grammars". Mention the pt_BR translation.
12306 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
12307 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
12308 Bump version from 0.11.2 to 0.11.5.
12309 (BISON_PREREQ_STAGE): Remove.
12310 (AM_GNU_GETTEXT): Use external gettext.
12311 (AC_OUTPUT): Remove intl/Makefile.
12312
12313 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
12314
12315 * data/glr.c: Include string.h, for strlen.
12316 (yyreportParseError): Use size_t for yysize.
12317 (yy_yypstack): No longer nested inside yypstates, as nested
12318 functions are not portable. Do not assume size_t is the
12319 same width as int.
12320 (yypstates): Do not assume that ptrdiff_t is the same width
12321 as int, and similarly for yyposn and YYINDEX.
12322
12323 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
12324
12325 * lib/Makefile.am (INCLUDES): Do not include from the intl
12326 directory, which has been removed.
12327 * src/Makefile.am (INCLUDES): Likewise.
12328
12329 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
12330 (bitsets_sources, additional_bitsets_sources, timevars_sources):
12331 New vars.
12332
12333 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
12334 * tests/Makefile.am (EXTRA_DIST): Likewise.
12335
12336 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
12337 Do not assume that bitset_windex is the same width as unsigned.
12338
12339 * lib/abitset.c (abitset_unused_clear): Do not assume that
12340 bitset_word is the same width as int.
12341 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
12342 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
12343 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
12344 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
12345 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
12346
12347 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
12348 portability to one's complement hosts!).
12349 * lib/ebitset.c (ebitset_op1): Likewise.
12350 * lib/lbitset.c (lbitset_op1): Likewise.
12351
12352 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
12353 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12354 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
12355 Sync with fileutils.
12356 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
12357 lib/gettext.h: Sync with diffutils.
12358
12359 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
12360 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
12361
12362 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
12363 PROTOTYPES to check for prototypes, and "defined __STDC__" to
12364 check for void *.
12365
12366 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
12367 size_t; the old version tried to do this but casted improperly.
12368 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
12369 (bitset_test): Now returns int, not unsigned long.
12370
12371 * lib/bitset_stats.c: Include "gettext.h".
12372 (_): New macro.
12373 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
12374 name locals "index", as it generates unnecessary warnings on some
12375 hosts that have an "index" function.
12376
12377 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
12378 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
12379 they need translation.
12380 * src/LR0.c (state_list_append, new_itemsets, get_state,
12381 append_states, generate_states): Likewise.
12382 * src/assoc.c (assoc_to_string): Likewise.
12383 * src/closure.c (print_closure, set_firsts, closure): Likewise.
12384 * src/gram.c (grammar_dump): Likewise.
12385 * src/injections.c (injections_compute): Likewise.
12386 * src/lalr.c (lookaheads_print): Likewise.
12387 * src/relation.c (relation_transpose): Likewise.
12388 * src/scan-gram.l: Likewise.
12389 * src/tables.c (table_grow, pack_vector): Likewise.
12390
12391 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
12392 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
12393 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
12394 * m4/mbstate_t.m4: Sync with fileutils.
12395 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
12396
12397 * po/LINGUAS: Add pt_BR.
12398 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
12399 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
12400 lib/timevar.c.
12401 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
12402 manual recommends.
12403 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
12404
12405 * src/complain.c (strerror_r): Remove decl; not needed.
12406 (strerror): Use same pattern as ../lib/error.c.
12407
12408 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
12409
12410 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
12411
12412 * src/main.c (main): Cast result of bindtextdomain and textdomain
12413 to void, to avoid a GCC warning when --disable-nls is in effect.
12414
12415 * src/scan-gram.l: Use strings rather than escapes when possible,
12416 to minimize the number of warnings from xgettext.
12417 (handle_action_dollar, handle_action_at): Don't use isdigit,
12418 as it mishandles negative chars and it may not work as expected
12419 outside the C locale.
12420
12421 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
12422 this is a GCC extension and is not portable to other compilers.
12423
12424 * src/system.h (alloca): Use same pattern as ../lib/error.c.
12425 Do not include <ctype.h>; no longer needed.
12426 Do not include <malloc.h>; no longer needed (and generates
12427 warnings on OpenBSD 3.0).
12428
12429 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
12430 it's not portable.
12431
12432 * tests/regression.at: Do not use 'cc -c input.c -o input';
12433 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
12434
12435 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
12436 exit status as failure, not just exit status 1. Sun C exits
12437 with status 2 sometimes.
12438
12439 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
12440 Use it for the two large tests.
12441
12442 2002-08-02 Akim Demaille <akim@epita.fr>
12443
12444 * src/conflicts.c (conflicts_output): Don't output rules never
12445 reduced here, since anyway that computation doesn't work.
12446 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
12447 (rule_useless_p, rule_never_reduced_p): New.
12448 (grammar_rules_partial_print): Use a filter instead of a range.
12449 Display the title only if needed.
12450 (grammar_rules_print): Adjust.
12451 (grammar_rules_never_reduced_report): New.
12452 * src/tables.c (action_row): Move the computation of rules never
12453 reduced to...
12454 (token_actions): here.
12455 * src/main.c (main): Make the parser before making the report, so
12456 that rules never reduced are computed.
12457 Call grammar_rules_never_reduced_report.
12458 * src/print.c (print_results): Report rules never reduced.
12459 * tests/conflicts.at, tests/reduce.at: Adjust.
12460
12461 2002-08-01 Akim Demaille <akim@epita.fr>
12462
12463 Instead of attaching lookaheads and duplicating the rules being
12464 reduced by a state, attach the lookaheads to the reductions.
12465
12466 * src/state.h (state_t): Remove the `lookaheads',
12467 `lookaheads_rule' member.
12468 (reductions_t): Add a `lookaheads' member.
12469 Use a regular array for the `rules'.
12470 * src/state.c (reductions_new): Initialize the lookaheads member
12471 to 0.
12472 (state_rule_lookaheads_print): Adjust.
12473 * src/state.h, src/state.c (state_reductions_find): New.
12474 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
12475 (count_rr_conflicts): Adjust.
12476 * src/lalr.c (LArule): Remove.
12477 (add_lookback_edge): Adjust.
12478 (state_lookaheads_count): New.
12479 (states_lookaheads_initialize): Merge into...
12480 (initialize_LA): this.
12481 (lalr_free): Adjust.
12482 * src/main.c (main): Don't free nullable and derives too early: it
12483 is used by --verbose.
12484 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
12485
12486 2002-08-01 Akim Demaille <akim@epita.fr>
12487
12488 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
12489 `rule_number_t**'.
12490 (set_derives, free_derives): Rename as...
12491 (derives_compute, derives_free): this.
12492 Adjust all dependencies.
12493 * src/nullable.c (set_nullable, free_nullable): Rename as...
12494 (nullable_compute, nullable_free): these.
12495 (rule_list_t): Store rule_t *, not rule_number_t.
12496 * src/state.c (state_rule_lookaheads_print): Directly compare rule
12497 pointers, instead of their numbers.
12498 * src/main.c (main): Call nullable_free, and derives_free earlier,
12499 as they were lo longer used.
12500
12501 2002-08-01 Akim Demaille <akim@epita.fr>
12502
12503 * lib/timevar.c (get_time): Include children time.
12504 * src/lalr.h (LA, LArule): Don't export them: used with the
12505 state_t.
12506 * src/lalr.c (LA, LArule): Static.
12507 * src/lalr.h, src/lalr.c (lalr_free): New.
12508 * src/main.c (main): Call it.
12509 * src/tables.c (pack_vector): Check whether loc is >= to the
12510 table_size, not >.
12511 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
12512 (tables_generate): do it, since that's also it which allocates
12513 them.
12514 Don't free LA and LArule, main does.
12515
12516 2002-07-31 Akim Demaille <akim@epita.fr>
12517
12518 Separate parser tables computation and output.
12519
12520 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
12521 (conflict_list, conflict_list_cnt, table, check, table_ninf)
12522 (yydefgoto, yydefact, high): Move to...
12523 * src/tables.h, src/tables.c: here.
12524 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12525 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12526 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
12527 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
12528 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
12529 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
12530 (action_row, save_row, token_actions, save_column, default_goto)
12531 (goto_actions, sort_actions, matching_state, pack_vector)
12532 (table_ninf_remap, pack_table, prepare_actions): Move to...
12533 * src/tables.c: here.
12534 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
12535 * src/output.c (token_actions, output_base, output_conflicts)
12536 (output_check): Merge into...
12537 (prepare_actions): this.
12538 (actions_output): Rename as...
12539 (user_actions_output): this.
12540 * src/main.c (main): Call tables_generate and tables_free.
12541
12542 2002-07-31 Akim Demaille <akim@epita.fr>
12543
12544 Steal GCC's --time-report support.
12545
12546 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
12547 stolen/adjusted from GCC.
12548 * m4/stage.m4: Remove time related checks.
12549 * m4/timevar.m4: New.
12550 * configure.in: Adjust.
12551 * src/system.h: Adjust to using timevar.h.
12552 * src/getargs.h, src/getargs.c: Support trace_time for
12553 --trace=time.
12554 * src/main.c (stage): Remove.
12555 (main): Replace `stage' invocations with timevar calls.
12556 * src/output.c: Insert pertinent timevar calls.
12557
12558 2002-07-31 Akim Demaille <akim@epita.fr>
12559
12560 Let --trace have arguments.
12561
12562 * src/getargs.h (enum trace_e): New.
12563 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
12564 (long_options, short_options): --trace/-T takes an optional
12565 argument.
12566 Change all the uses of trace_flag to reflect the new flags.
12567 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
12568
12569 Strengthen `stage' portability.
12570
12571 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
12572 * configure.in: Use it.
12573 Don't check for malloc.h and sys/times.h.
12574 * src/system.h: Include them when appropriate.
12575 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
12576 times and struct tms are available.
12577
12578 2002-07-30 Akim Demaille <akim@epita.fr>
12579
12580 In verbose parse error message, don't report `error' as an
12581 expected token.
12582 * tests/actions.at (Printers and Destructors): Adjust.
12583 * tests/calc.at (Calculator $1): Adjust.
12584 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
12585 error message, do not report the parser accepts the error token in
12586 that state.
12587
12588 2002-07-30 Akim Demaille <akim@epita.fr>
12589
12590 Normalize conflict related messages.
12591
12592 * src/complain.h, src/complain.c (warn, complain): New.
12593 * src/conflicts.c (conflicts_print): Use them.
12594 (conflict_report_yacc): New, extracted from...
12595 (conflicts_print): here.
12596 * tests/conflicts.at, tests/existing.at: Adjust.
12597
12598 2002-07-30 Akim Demaille <akim@epita.fr>
12599
12600 Report rules which are never reduced by the parser: those hidden
12601 by conflicts.
12602
12603 * src/LR0.c (save_reductions): Don't make the final state too
12604 different: save its reduction (accept) instead of having a state
12605 without any action (no shift or goto, no reduce).
12606 Note: the final state is now a ``regular'' state, i.e., the
12607 parsers now contain `reduce 0' as default reduction.
12608 Nevertheless, since they decide to `accept' when yystate =
12609 final_state, they still will not reduce rule 0.
12610 * src/print.c (print_actions, print_reduction): Adjust.
12611 * src/output.c (action_row): Track reduced rules.
12612 (token_actions): Report rules never reduced.
12613 * tests/conflicts.at, tests/regression.at: Adjust.
12614
12615 2002-07-30 Akim Demaille <akim@epita.fr>
12616
12617 `stage' was accidently included in a previous patch.
12618 Initiate its autoconfiscation.
12619
12620 * configure.in: Look for malloc.h and sys/times.h.
12621 * src/main.c (stage): Adjust.
12622 Report only when trace_flag.
12623
12624 2002-07-29 Akim Demaille <akim@epita.fr>
12625
12626 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
12627 state_number_t.
12628 (errs_t): symbol_t*, not symbol_number_t.
12629 (reductions_t): rule_t*, not rule_number_t.
12630 (FOR_EACH_SHIFT): New.
12631 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
12632 * src/print.c, src/print_graph.c: Adjust.
12633
12634 2002-07-29 Akim Demaille <akim@epita.fr>
12635
12636 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
12637
12638 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
12639 (endtoken, accept): these.
12640 * src/reader.c (reader): Set endtoken's default tag to "$end".
12641 Set undeftoken's tag to "$undefined" instead of "$undefined.".
12642 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
12643 Adjust.
12644
12645 2002-07-29 Akim Demaille <akim@epita.fr>
12646
12647 * src/reduce.c (reduce_grammar): When the language is empty,
12648 complain about the start symbol, not the axiom.
12649 Use its location.
12650 * tests/reduce.at (Empty Language): New.
12651
12652 2002-07-26 Akim Demaille <akim@epita.fr>
12653
12654 * src/reader.h, src/reader.c (gram_error): ... can't get
12655 yycontrol without making too strong assumptions on the parser
12656 itself.
12657 * src/output.c (prepare_tokens): Use the real 0th value of
12658 token_translations instead of `0'.
12659 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
12660 visible here.
12661 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
12662 for the time being: %locations ought to provide it to yyerror.
12663
12664 2002-07-25 Akim Demaille <akim@epita.fr>
12665
12666 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
12667 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
12668 * tests/regression.at (Web2c Actions): Adjust.
12669
12670 2002-07-25 Akim Demaille <akim@epita.fr>
12671
12672 Stop storing rules from 1 to nrules + 1.
12673
12674 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
12675 * src/nullable.c, src/output.c, src/print.c, src/reader.c
12676 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
12677 Iterate from 0 to nrules.
12678 Use rule_number_as_item_number and item_number_as_rule_number.
12679 Adjust to `derive' now containing possibly 0.
12680 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
12681 Handle the `- 1' part in rule numbers from/to item numbers.
12682 * src/conflicts.c (log_resolution): Fix the message which reversed
12683 shift and reduce.
12684 * src/output.c (action_row): Initialize default_rule to -1.
12685 (token_actions): Adjust.
12686 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
12687 expected output.
12688 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
12689
12690 2002-07-25 Akim Demaille <akim@epita.fr>
12691
12692 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
12693 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
12694 (b4_c_knr_arg_decl): New.
12695 * data/yacc.c: Use it to define yysymprint, yydestruct, and
12696 yyreport_parse_error.
12697
12698 2002-07-25 Akim Demaille <akim@epita.fr>
12699
12700 * data/yacc.c (yyreport_parse_error): New, extracted from...
12701 (yyparse): here.
12702 (yydestruct, yysymprint): Move above yyparse.
12703 Be K&R compliant.
12704
12705 2002-07-25 Akim Demaille <akim@epita.fr>
12706
12707 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
12708 replace...
12709 (b4_sint_type, b4_uint_type): these.
12710 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
12711 * tests/regression.at (Web2c Actions): Adjust.
12712
12713 2002-07-25 Akim Demaille <akim@epita.fr>
12714
12715 * src/gram.h (TIEM_NUMBER_MAX): New.
12716 (item_number_of_rule_number, rule_number_of_item_number): Rename
12717 as...
12718 (rule_number_as_item_number, item_number_as_rule_number): these.
12719 Adjust dependencies.
12720 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12721 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12722 (symbol_number_to_vector_number): New.
12723 (order): Of vector_number_t* type.
12724 (base_t, BASE_MAX, BASE_MIN): New.
12725 (froms, tos, width, pos, check): Of base_t type.
12726 (action_number_t, ACTION_MIN, ACTION_MAX): New.
12727 (actrow): Of action_number_t type.
12728 (conflrow): Of unsigned int type.
12729 (table_ninf, base_ninf): New.
12730 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
12731 (muscle_insert_int_table, muscle_insert_base_table)
12732 (muscle_insert_rule_number_table): New.
12733 (prepare_tokens): Output `toknum' as int_table.
12734 (action_row): Returns a rule_number_t.
12735 Use ACTION_MIN, not SHRT_MIN.
12736 (token_actions): yydefact is rule_number_t*.
12737 (table_ninf_remap): New.
12738 (pack_table): Use it for `base' and `table'.
12739 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
12740 replaced with...
12741 (YYPACT_NINF, YYTABLE_NINF): these.
12742 (yypact, yytable): Compute their types instead of hard-coded
12743 `short'.
12744 * tests/regression.at (Web2c Actions): Adjust.
12745
12746 2002-07-19 Akim Demaille <akim@epita.fr>
12747
12748 * src/scan-gram.l (id): Can start with an underscore.
12749
12750 2002-07-16 Akim Demaille <akim@epita.fr>
12751
12752 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
12753 Adjust all former `associativity' dependencies.
12754 * src/symtab.c (symbol_new): Default associativity is `undef', not
12755 `right'.
12756 (symbol_check_alias_consistence): Adjust.
12757
12758 2002-07-09 Akim Demaille <akim@epita.fr>
12759
12760 * doc/bison.texinfo: Properly set the ``header'' part.
12761 Use @dircategory ``GNU programming tools'' as per Texinfo's
12762 documentation.
12763 Use @copying.
12764
12765 2002-07-09 Akim Demaille <akim@epita.fr>
12766
12767 * lib/quotearg.h: Protect against multiple inclusions.
12768 * src/location.h (location_t): Add a `file' member.
12769 (LOCATION_RESET, LOCATION_PRINT): Adjust.
12770 * src/complain.c (warn_at, complain_at, fatal_at): Drop
12771 `error_one_per_line' support.
12772
12773 2002-07-09 Akim Demaille <akim@epita.fr>
12774
12775 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
12776 * src/reader.c (lineno): Remove.
12777 Adjust all dependencies.
12778 (get_merge_function): Take a location and use complain_at.
12779 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
12780 * tests/regression.at (Invalid inputs, Mixing %token styles):
12781 Adjust.
12782
12783 2002-07-09 Akim Demaille <akim@epita.fr>
12784
12785 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
12786 recovery rule, and forbid extensions when --yacc.
12787 (gram_error): Use complain_at.
12788 * src/reader.c (reader): Exit if there were parse errors.
12789
12790 2002-07-09 Akim Demaille <akim@epita.fr>
12791
12792 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
12793 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
12794 Reported by R Blake <blakers@mac.com>.
12795
12796 2002-07-09 Akim Demaille <akim@epita.fr>
12797
12798 * data/yacc.c: Output the copyright notive in the header.
12799
12800 2002-07-03 Akim Demaille <akim@epita.fr>
12801
12802 * src/output.c (froms, tos): Are state_number_t.
12803 (save_column): sp, sp1, and sp2 are state_number_t.
12804 (prepare): Rename `final' as `final_state_number', `nnts' as
12805 `nterms_number', `nrules' as `rules_number', `nstates' as
12806 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
12807 unused.
12808 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
12809 * data/lalr1.cc (nsym_): Remove, unused.
12810
12811 2002-07-03 Akim Demaille <akim@epita.fr>
12812
12813 * src/lalr.h, src/lalr.c (goto_number_t): New.
12814 * src/lalr.c (goto_list_t): New.
12815 Propagate them.
12816 * src/nullable.c (rule_list_t): New.
12817 Propagate.
12818 * src/types.h: Remove.
12819
12820 2002-07-03 Akim Demaille <akim@epita.fr>
12821
12822 * src/closure.c (print_fderives): Use rule_rhs_print.
12823 * src/derives.c (print_derives): Use rule_rhs_print.
12824 (rule_list_t): New, replaces `shorts'.
12825 (set_derives): Add comments.
12826 * tests/sets.at (Nullable, Firsts): Adjust.
12827
12828 2002-07-03 Akim Demaille <akim@epita.fr>
12829
12830 * src/output.c (prepare_actions): Free `tally' and `width'.
12831 (prepare_actions): Allocate and free `order'.
12832 * src/symtab.c (symbols_free): Free `symbols'.
12833 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
12834 * src/output.c (m4_invoke): Move to...
12835 * src/scan-skel.l: here.
12836 (<<EOF>>): Close yyout, and free its name.
12837
12838 2002-07-03 Akim Demaille <akim@epita.fr>
12839
12840 Fix some memory leaks, and fix a bug: state 0 was examined twice.
12841
12842 * src/LR0.c (new_state): Merge into...
12843 (state_list_append): this.
12844 (new_states): Merge into...
12845 (generate_states): here.
12846 (set_states): Don't ensure a proper `errs' state member here, do it...
12847 * src/conflicts.c (conflicts_solve): here.
12848 * src/state.h, src/state.c: Comment changes.
12849 (state_t): Rename member `shifts' as `transitions'.
12850 Adjust all dependencies.
12851 (errs_new): For consistency, also take the values as argument.
12852 (errs_dup): Remove.
12853 (state_errs_set): New.
12854 (state_reductions_set, state_transitions_set): Assert that no
12855 previous value was assigned.
12856 (state_free): New.
12857 (states_free): Use it.
12858 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
12859 temporary storage: use `errs' and `nerrs' as elsewhere.
12860 (set_conflicts): Allocate and free this `errs'.
12861
12862 2002-07-02 Akim Demaille <akim@epita.fr>
12863
12864 * lib/libiberty.h: New.
12865 * lib: Update the bitset implementation from upstream.
12866 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
12867 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
12868 * src/main.c: Adjust bitset stats calls.
12869
12870 2002-07-01 Paul Eggert <eggert@twinsun.com>
12871
12872 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
12873 char, so that negative chars don't collide with $.
12874
12875 2002-06-30 Akim Demaille <akim@epita.fr>
12876
12877 Have the GLR tests be `warning' checked, and fix the warnings.
12878
12879 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
12880 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
12881 (yyremoveDeletes): `yyi' and `yyj' are size_t.
12882 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
12883 (yyaddDeferredAction): static.
12884 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
12885 (yyreportParseError): yyprefix is const.
12886 yytokenp is used only when verbose.
12887 (yy__GNUC__): Replace with __GNUC__.
12888 (yypdumpstack): yyi is size_t.
12889 (yypreference): Un-yy local variables and arguments, to avoid
12890 clashes with `yyr1'. Anyway, we are not in the user name space.
12891 (yytname_size): be an int, as is compared with ints.
12892 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
12893 Use them.
12894 * tests/cxx-gram.at: Use quotation to protect $1.
12895 Use AT_COMPILE to enable warnings hunts.
12896 Prototype yylex and yyerror.
12897 `Use' argc.
12898 Include `string.h', not `strings.h'.
12899 Produce and prototype stmtMerge only when used.
12900 yylex takes a location.
12901
12902 2002-06-30 Akim Demaille <akim@epita.fr>
12903
12904 We spend a lot of time in quotearg, in particular when --verbose.
12905
12906 * src/symtab.c (symbol_get): Store a quoted version of the key.
12907 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
12908 Adjust all callers.
12909
12910 2002-06-30 Akim Demaille <akim@epita.fr>
12911
12912 * src/state.h (reductions_t): Rename member `nreds' as num.
12913 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
12914 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
12915
12916 2002-06-30 Akim Demaille <akim@epita.fr>
12917
12918 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
12919 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
12920 (shifts_to): Rename as...
12921 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
12922 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
12923 (TRANSITION_IS_DISABLED, transitions_to): these.
12924
12925 2002-06-30 Akim Demaille <akim@epita.fr>
12926
12927 * src/print.c (print_shifts, print_gotos): Merge into...
12928 (print_transitions): this.
12929 (print_transitions, print_errs, print_reductions): Align the
12930 lookaheads columns.
12931 (print_core, print_transitions, print_errs, print_state,
12932 print_grammar): Output empty lines separator before, not after.
12933 (state_default_rule_compute): Rename as...
12934 (state_default_rule): this.
12935 * tests/conflicts.at (Defaulted Conflicted Reduction),
12936 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
12937 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
12938
12939 2002-06-30 Akim Demaille <akim@epita.fr>
12940
12941 Display items as we display rules.
12942
12943 * src/gram.h, src/gram.c (rule_lhs_print): New.
12944 * src/gram.c (grammar_rules_partial_print): Use it.
12945 * src/print.c (print_core): Likewise.
12946 * tests/conflicts.at (Defaulted Conflicted Reduction),
12947 (Unresolved SR Conflicts): Adjust.
12948 (Unresolved SR Conflicts): Adjust and rename as...
12949 (Resolved SR Conflicts): this, as was meant.
12950 * tests/regression.at (Web2c Report): Adjust.
12951
12952 2002-06-30 Akim Demaille <akim@epita.fr>
12953
12954 * src/print.c (state_default_rule_compute): New, extracted from...
12955 (print_reductions): here.
12956 Pessimize, but clarify the code.
12957 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
12958
12959 2002-06-30 Akim Demaille <akim@epita.fr>
12960
12961 * src/output.c (action_row): Let default_rule be always a rule
12962 number.
12963
12964 2002-06-30 Akim Demaille <akim@epita.fr>
12965
12966 * src/closure.c (print_firsts, print_fderives, closure):
12967 Use BITSET_EXECUTE.
12968 * src/lalr.c (lookaheads_print): Likewise.
12969 * src/state.c (state_rule_lookaheads_print): Likewise.
12970 * src/print_graph.c (print_core): Likewise.
12971 * src/print.c (print_reductions): Likewise.
12972 * src/output.c (action_row): Likewise.
12973 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
12974
12975 2002-06-30 Akim Demaille <akim@epita.fr>
12976
12977 * src/print_graph.c: Use report_flag.
12978
12979 2002-06-30 Akim Demaille <akim@epita.fr>
12980
12981 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
12982 to...
12983 * src/relation.h, src/relation.c (traverse, relation_digraph)
12984 (relation_print, relation_transpose): New.
12985
12986 2002-06-30 Akim Demaille <akim@epita.fr>
12987
12988 * src/state.h, src/state.c (shifts_to): New.
12989 * src/lalr.c (build_relations): Use it.
12990
12991 2002-06-30 Akim Demaille <akim@epita.fr>
12992
12993 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
12994 (item_number_of_rule_number, rule_number_of_item_number): New.
12995 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
12996 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
12997 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
12998 Propagate their use.
12999 Much remains to be done, in particular wrt `shorts' from types.h.
13000
13001 2002-06-30 Akim Demaille <akim@epita.fr>
13002
13003 * src/symtab.c (symbol_new): Initialize the `printer' member.
13004
13005 2002-06-30 Akim Demaille <akim@epita.fr>
13006
13007 * src/LR0.c (save_reductions): Remove, replaced by...
13008 * src/state.h, src/state.c (state_reductions_set): New.
13009 (reductions, errs): Rename as...
13010 (reductions_t, errs_t): these.
13011 Adjust all dependencies.
13012
13013 2002-06-30 Akim Demaille <akim@epita.fr>
13014
13015 * src/LR0.c (state_list_t, state_list_append): New.
13016 (first_state, last_state): Now symbol_list_t.
13017 (this_state): Remove.
13018 (new_itemsets, append_states, save_reductions): Take a state_t as
13019 argument.
13020 (set_states, generate_states): Adjust.
13021 (save_shifts): Remove, replaced by...
13022 * src/state.h, src/state.c (state_shifts_set): New.
13023 (shifts): Rename as...
13024 (shifts_t): this.
13025 Adjust all dependencies.
13026 * src/state.h (state_t): Remove the `next' member.
13027
13028 2002-06-30 Akim Demaille <akim@epita.fr>
13029
13030 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
13031 escaped in slot 0.
13032
13033 2002-06-30 Akim Demaille <akim@epita.fr>
13034
13035 Use hash.h for the state hash table.
13036
13037 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
13038 (allocate_storage): Use state_hash_new.
13039 (free_storage): Use state_hash_free.
13040 (new_state, get_state): Adjust.
13041 * src/lalr.h, src/lalr.c (states): Move to...
13042 * src/states.h (state_t): Remove the `link' member, no longer
13043 used.
13044 * src/states.h, src/states.c: here.
13045 (state_hash_new, state_hash_free, state_hash_lookup)
13046 (state_hash_insert, states_free): New.
13047 * src/states.c (state_table, state_compare, state_hash): New.
13048 * src/output.c (output_actions): Do not free states now, since we
13049 still need to know the final_state number in `prepare', called
13050 afterwards. Do it...
13051 * src/main.c (main): here: call states_free after `output'.
13052
13053 2002-06-30 Akim Demaille <akim@epita.fr>
13054
13055 * src/state.h, src/state.c (state_new): New, extracted from...
13056 * src/LR0.c (new_state): here.
13057 * src/state.h (STATE_ALLOC): Move to...
13058 * src/state.c: here.
13059 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
13060 * src/state.h, src/state.c: here.
13061
13062 2002-06-30 Akim Demaille <akim@epita.fr>
13063
13064 * src/reader.c (gensym): Rename as...
13065 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
13066 (getsym): Rename as...
13067 (symbol_get): this.
13068
13069 2002-06-30 Akim Demaille <akim@epita.fr>
13070
13071 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
13072 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
13073 * src/output.c, src/print.c, src/print_graph.c: Propagate.
13074 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
13075
13076 2002-06-30 Akim Demaille <akim@epita.fr>
13077
13078 Make the test suite pass with warnings checked.
13079
13080 * tests/actions.at (Printers and Destructors): Improve.
13081 Avoid unsigned vs. signed issues.
13082 * tests/calc.at: Don't exercise the scanner here, do it...
13083 * tests/input.at (Torturing the Scanner): here.
13084
13085 2002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13086
13087 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
13088 reorganize first lines parallel to yacc.c.
13089
13090 2002-06-28 Akim Demaille <akim@epita.fr>
13091
13092 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
13093 (b4_token_enum, b4_token_defines): New, factored from...
13094 * data/lalr1.cc, data/yacc.c, glr.c: here.
13095
13096 2002-06-28 Akim Demaille <akim@epita.fr>
13097
13098 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
13099 unused variables.
13100 * src/output.c (merger_output): static.
13101
13102 2002-06-28 Akim Demaille <akim@epita.fr>
13103
13104 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
13105 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
13106 pacify GCC.
13107 * src/output.c (save_row): Initialize all the variables to pacify GCC.
13108
13109 2002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13110
13111 Accumulated changelog for new GLR parsing features.
13112
13113 * src/conflicts.c (count_total_conflicts): Change name to
13114 conflicts_total_count.
13115 * src/conflicts.h: Ditto.
13116 * src/output.c (token_actions): Use the new name.
13117 (output_conflicts): Change conflp => conflict_list_heads, and
13118 confl => conflict_list for better readability.
13119 * data/glr.c: Use the new names.
13120 * NEWS: Add self to GLR announcement.
13121
13122 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
13123
13124 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
13125 Akim Demaille.
13126
13127 * data/bison.glr: Change name to glr.c
13128 * data/glr.c: Renamed from bison.glr.
13129 * data/Makefile.am: Add glr.c
13130
13131 * src/getargs.c:
13132
13133 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
13134 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
13135
13136 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13137
13138 * data/bison.glr: Be sure to restore the
13139 current #line when returning to the skeleton contents after having
13140 exposed the input file's #line.
13141
13142 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13143
13144 * data/bison.glr: Bring up to date with changes to bison.simple.
13145
13146 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13147
13148 * data/bison.glr: Correct definitions that use b4_prefix.
13149 Various reformatting.
13150 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
13151 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
13152 yytokenp argument; now part of stack.
13153 (yychar): Define to behave as documented.
13154 (yyclearin): Ditto.
13155
13156 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13157
13158 * src/reader.h: Add declaration for free_merger_functions.
13159
13160 * src/reader.c (merge_functions): New variable.
13161 (get_merge_function): New function.
13162 (free_merger_functions): New function.
13163 (readgram): Check for %prec that is not followed by a symbol.
13164 Handle %dprec and %merge declarations.
13165 (packgram): Initialize dprec and merger fields in rules array.
13166
13167 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
13168 conflict_list_cnt, conflict_list_free): New variables.
13169 (table_grow): Also grow conflict_table.
13170 (prepare_rules): Output dprec and merger tables.
13171 (conflict_row): New function.
13172 (action_row): Output conflict lists for GLR parser. Don't use
13173 default reduction in conflicted states for GLR parser so that there
13174 are spaces for the conflict lists.
13175 (save_row): Also save conflict information.
13176 (token_actions): Allocate conflict list.
13177 (merger_output): New function.
13178 (pack_vector): Pack conflict table, too.
13179 (output_conflicts): New function to output yyconflp and yyconfl.
13180 (output_check): Allocate conflict_tos.
13181 (output_actions): Output conflict tables, also.
13182 (output_skeleton): Output b4_mergers definition.
13183 (prepare): Output b4_max_rhs_length definition.
13184 Use 'bison.glr' as default skeleton for GLR parsers.
13185
13186 * src/gram.c (glr_parser): New flag.
13187 (grammar_free): Call free_merger_functions.
13188
13189 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
13190 all pairs of conflicting reductions, rather than just all tokens
13191 causing conflicts. Needed to size conflict tables.
13192 (conflicts_output): Modify call to count_rr_conflicts for new
13193 interface.
13194 (conflicts_print): Ditto.
13195 (count_total_conflicts): New function.
13196
13197 * src/reader.h (merger_list): New type.
13198 (merge_functions): New variable.
13199
13200 * src/lex.h (tok_dprec, tok_merge): New token types.
13201
13202 * src/gram.h (rule_s): Add dprec and merger fields.
13203 (glr_parser): New flag.
13204
13205 * src/conflicts.h (count_total_conflicts): New function.
13206
13207 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
13208
13209 * doc/bison.texinfo (Generalized LR Parsing): New section.
13210 (GLR Parsers): New section.
13211 (Language and Grammar): Mention GLR parsing.
13212 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
13213 Correct typo ("tge" -> "the").
13214
13215 * data/bison.glr: New skeleton for GLR parsing.
13216
13217 * tests/cxx-gram.at: New tests for GLR parsing.
13218
13219 * tests/testsuite.at: Include cxx-gram.at.
13220
13221 * tests/Makefile.am: Add cxx-gram.at.
13222
13223 * src/parse-gram.y:
13224
13225 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
13226
13227 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
13228
13229 2002-06-27 Akim Demaille <akim@epita.fr>
13230
13231 * src/options.h, src/options.c: Remove.
13232 * src/getargs.c (short_options, long_options): New.
13233
13234 2002-06-27 Akim Demaille <akim@epita.fr>
13235
13236 * data/bison.simple, data/bison.c++: Rename as...
13237 * data/yacc.c, data/lalr1.cc: these.
13238 * doc/bison.texinfo (Environment Variables): Remove.
13239
13240 2002-06-25 Raja R Harinath <harinath@cs.umn.edu>
13241
13242 * src/getargs.c (report_argmatch): Initialize strtok().
13243
13244 2002-06-20 Akim Demaille <akim@epita.fr>
13245
13246 * data/bison.simple (b4_symbol_actions): New, replaces...
13247 (b4_symbol_destructor, b4_symbol_printer): these.
13248 (yysymprint): Be sure to call YYPRINT only for tokens, and using
13249 user token numbers.
13250
13251 2002-06-20 Akim Demaille <akim@epita.fr>
13252
13253 * data/bison.simple (yydestructor): Rename as...
13254 (yydestruct): this.
13255
13256 2002-06-20 Akim Demaille <akim@epita.fr>
13257
13258 * src/symtab.h, src/symtab.c (symbol_type_set)
13259 (symbol_destructor_set, symbol_precedence_set): The location is
13260 the last argument.
13261 Adjust all callers.
13262
13263 2002-06-20 Akim Demaille <akim@epita.fr>
13264
13265 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
13266 internals.
13267 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
13268 Takes a location.
13269 * src/symtab.h, src/symtab.c (symbol_class_set)
13270 (symbol_user_token_number_set): Likewise.
13271 Adjust all callers.
13272 Promote complain_at.
13273 * tests/input.at (Type Clashes): Adjust.
13274
13275 2002-06-20 Akim Demaille <akim@epita.fr>
13276
13277 * data/bison.simple (YYLEX): Fix the declaration when
13278 %pure-parser.
13279
13280 2002-06-20 Akim Demaille <akim@epita.fr>
13281
13282 * data/bison.simple (yysymprint): Don't print the token number,
13283 just its name.
13284 * tests/actions.at (Destructors): Rename as...
13285 (Printers and Destructors): this.
13286 Also exercise %printer.
13287
13288 2002-06-20 Akim Demaille <akim@epita.fr>
13289
13290 * data/bison.simple (YYDSYMPRINT): New.
13291 Use it to remove many of the #if YYDEBUG/if (yydebug).
13292
13293 2002-06-20 Akim Demaille <akim@epita.fr>
13294
13295 * src/symtab.h, src/symtab.c (symbol_t): printer and
13296 printer_location are new members.
13297 (symbol_printer_set): New.
13298 * src/parse-gram.y (PERCENT_PRINTER): New token.
13299 Handle its associated rule.
13300 * src/scan-gram.l: Adjust.
13301 (handle_destructor_at, handle_destructor_dollar): Rename as...
13302 (handle_symbol_code_at, handle_symbol_code_dollar): these.
13303 * src/output.c (symbol_printers_output): New.
13304 (output_skeleton): Call it.
13305 * data/bison.simple (yysymprint): New. Cannot be named yyprint
13306 since there are already many grammar files with a user `yyprint'.
13307 Replace the calls to YYPRINT to calls to yysymprint.
13308 * tests/calc.at: Adjust.
13309 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
13310 taking advantage of parser very internal details (stack size!).
13311
13312 2002-06-20 Akim Demaille <akim@epita.fr>
13313
13314 * src/scan-gram.l: Complete the scanner with the missing patterns
13315 to pacify Flex.
13316 Use `quote' and `symbol_tag_get' where appropriate.
13317
13318 2002-06-19 Akim Demaille <akim@epita.fr>
13319
13320 * tests/actions.at (Destructors): Augment to test locations.
13321 * data/bison.simple (yydestructor): Pass it the current location
13322 if locations are enabled.
13323 Prototype only when __STDC__ or C++.
13324 Change the argument names to move into the yy name space: there is
13325 user code here.
13326
13327 2002-06-19 Akim Demaille <akim@epita.fr>
13328
13329 * data/bison.simple (b4_pure_if): New.
13330 Use it instead of #ifdef YYPURE.
13331
13332 2002-06-19 Akim Demaille <akim@epita.fr>
13333
13334 * data/bison.simple (b4_location_if): New.
13335 Use it instead of #ifdef YYLSP_NEEDED.
13336
13337 2002-06-19 Akim Demaille <akim@epita.fr>
13338
13339 Prepare @$ in %destructor, but currently don't bind it in the
13340 skeleton, as %location use is not cleaned up yet.
13341
13342 * src/scan-gram.l (handle_dollar, handle_destructor_at)
13343 (handle_action_at): New.
13344 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
13345 a braced_code_t and a location as additional arguments.
13346 (handle_destructor_dollar): Instead of requiring `b4_eval', just
13347 unquote one when outputting `b4_dollar_dollar'.
13348 Adjust callers.
13349 * data/bison.simple (b4_eval): Remove.
13350 (b4_symbol_destructor): Adjust.
13351 * tests/input.at (Invalid @n): Adjust.
13352
13353 2002-06-19 Zack Weinberg <zack@codesourcery.com>
13354
13355 * doc/bison.texinfo: Document ability to have multiple
13356 prologue sections.
13357
13358 2002-06-18 Akim Demaille <akim@epita.fr>
13359
13360 * src/files.c (compute_base_names): When computing the output file
13361 names from the input file name, strip the directory part.
13362
13363 2002-06-18 Akim Demaille <akim@epita.fr>
13364
13365 * data/bison.simple.new: Comment changes.
13366 Reported by Andreas Schwab.
13367
13368 2002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
13369
13370 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
13371 there are no `label `yyoverflowlab' defined but not used' warnings
13372 when yyoverflow is defined.
13373
13374 2002-06-18 Akim Demaille <akim@epita.fr>
13375
13376 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
13377 new member.
13378 (symbol_destructor_set): Adjust.
13379 * src/output.c (symbol_destructors_output): Output the destructor
13380 locations.
13381 Output the symbol name.
13382 * data/bison.simple (b4_symbol_destructor): Adjust.
13383
13384 2002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
13385 and Akim Demaille <akim@epita.fr>
13386
13387 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
13388 what's left on the stack when the error recovery hits EOF.
13389 * tests/actions.at (Destructors): Complete to exercise this case.
13390
13391 2002-06-17 Akim Demaille <akim@epita.fr>
13392
13393 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
13394 arguments is really empty, not only equal to `[]'.
13395 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
13396 member.
13397 (symbol_destructor_set): New.
13398 * src/output.c (symbol_destructors_output): New.
13399 * src/reader.h (brace_code_t, current_braced_code): New.
13400 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
13401 (handle_dollar): Rename as...
13402 (handle_action_dollar): this.
13403 (handle_destructor_dollar): New.
13404 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
13405 (grammar_declaration): Use it.
13406 * data/bison.simple (yystos): Is always defined.
13407 (yydestructor): New.
13408 * tests/actions.at (Destructors): New.
13409 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
13410
13411 2002-06-17 Akim Demaille <akim@epita.fr>
13412
13413 * src/symlist.h, src/symlist.c (symbol_list_length): New.
13414 * src/scan-gram.l (handle_dollar, handle_at): Compute the
13415 rule_length only when needed.
13416 * src/output.c (actions_output, token_definitions_output): Output
13417 the full M4 block.
13418 * src/symtab.c: Don't access directly to the symbol tag, use
13419 symbol_tag_get.
13420 * src/parse-gram.y: Use symbol_list_free.
13421
13422 2002-06-17 Akim Demaille <akim@epita.fr>
13423
13424 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
13425 (symbol_list_prepend, get_type_name): Move to...
13426 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
13427 (symbol_list_prepend, symbol_list_n_type_name_get): here.
13428 Adjust all callers.
13429 (symbol_list_free): New.
13430 * src/scan-gram.l (handle_dollar): Takes a location.
13431 * tests/input.at (Invalid $n): Adjust.
13432
13433 2002-06-17 Akim Demaille <akim@epita.fr>
13434
13435 * src/reader.h, src/reader.c (symbol_list_new): Export it.
13436 (symbol_list_prepend): New.
13437 * src/parse-gram.y (%union): `list' is a new member.
13438 (symbols.1): New, replaces...
13439 (terms_to_prec.1, nterms_to_type.1): these.
13440 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
13441 Take a location as additional argument.
13442 Adjust all callers.
13443
13444 2002-06-15 Akim Demaille <akim@epita.fr>
13445
13446 * src/parse-gram.y: Move %token in the declaration section so that
13447 we don't depend upon CVS Bison.
13448
13449 2002-06-15 Akim Demaille <akim@epita.fr>
13450
13451 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
13452 * src/print.c (print_core): Use it.
13453
13454 2002-06-15 Akim Demaille <akim@epita.fr>
13455
13456 * src/conflicts.c (log_resolution): Accept the rule involved in
13457 the sr conflicts instead of the lookahead number that points to
13458 that rule.
13459 (flush_reduce): Accept the current lookahead vector as argument,
13460 instead of the index in LA.
13461 (resolve_sr_conflict): Accept the current number of lookahead
13462 bitset to consider for the STATE, instead of the index in LA.
13463 (set_conflicts): Adjust.
13464 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
13465
13466 2002-06-15 Akim Demaille <akim@epita.fr>
13467
13468 * src/state.h (state_t): Replace the `lookaheadsp' member, a
13469 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
13470 Adjust all dependencies.
13471 * src/lalr.c (initialize_lookaheads): Split into...
13472 (states_lookaheads_count, states_lookaheads_initialize): these.
13473 (lalr): Adjust.
13474
13475 2002-06-15 Akim Demaille <akim@epita.fr>
13476
13477 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
13478 out of...
13479 (grammar_rules_print): here.
13480 * src/reduce.c (reduce_output): Use it.
13481 * tests/reduce.at (Useless Rules, Reduced Automaton)
13482 (Underivable Rules): Adjust.
13483
13484 2002-06-15 Akim Demaille <akim@epita.fr>
13485
13486 Copy BYacc's nice way to report the grammar.
13487
13488 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
13489 New.
13490 Don't print the rules' location, it is confusing and useless.
13491 (rule_print): Use grammar_rhs_print.
13492 * src/print.c (print_grammar): Use grammar_rules_print.
13493
13494 2002-06-15 Akim Demaille <akim@epita.fr>
13495
13496 Complete and rationalize `useless thing' warnings.
13497
13498 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
13499 (symbol_tag_print): New.
13500 Use them everywhere in place of accessing directly the tag member.
13501 * src/gram.h, src/gram.c (rule_print): New.
13502 Use it where a rule used to be printed `by hand'.
13503 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
13504 (reduce_grammar_tables): Report the useless rules.
13505 (reduce_print): Useless things are a warning, not an error.
13506 Report it as such.
13507 * tests/reduce.at (Useless Nonterminals, Useless Rules):
13508 (Reduced Automaton, Underivable Rules): Adjust.
13509 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
13510 * tests/conflicts.at (Unresolved SR Conflicts)
13511 (Solved SR Conflicts): Adjust.
13512
13513 2002-06-15 Akim Demaille <akim@epita.fr>
13514
13515 Let symbols have a location.
13516
13517 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
13518 (getsym): Adjust.
13519 Adjust all callers.
13520 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
13521 Use location_t, not int.
13522 * src/symtab.c (symbol_check_defined): Take advantage of the
13523 location.
13524 * tests/regression.at (Invalid inputs): Adjust.
13525
13526 2002-06-15 Akim Demaille <akim@epita.fr>
13527
13528 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
13529 (input): Don't try to initialize yylloc here, do it in the
13530 scanner.
13531 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
13532 * src/gram.h (rule_t): Change line and action_line into location
13533 and action_location, of location_t type.
13534 Adjust all dependencies.
13535 * src/location.h, src/location.c (empty_location): New.
13536 * src/reader.h, src/reader.c (grammar_start_symbol_set)
13537 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
13538 (grammar_current_rule_symbol_append)
13539 (grammar_current_rule_action_append): Expect a location as argument.
13540 * src/reader.c (grammar_midrule_action): Adjust to attach an
13541 action's location as dummy symbol location.
13542 * src/symtab.h, src/symtab.c (startsymbol_location): New.
13543 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
13544 the line numbers.
13545
13546 2002-06-14 Akim Demaille <akim@epita.fr>
13547
13548 Grammar declarations may be found in the grammar section.
13549
13550 * src/parse-gram.y (rules_or_grammar_declaration): New.
13551 (declarations): Each declaration may end with a semicolon, not
13552 just...
13553 (grammar_declaration): `"%union"'.
13554 (grammar): Branch to rules_or_grammar_declaration.
13555
13556 2002-06-14 Akim Demaille <akim@epita.fr>
13557
13558 * src/main.c (main): Invoke scanner_free.
13559
13560 2002-06-14 Akim Demaille <akim@epita.fr>
13561
13562 * src/output.c (m4_invoke): Extracted from...
13563 (output_skeleton): here.
13564 Free tempfile.
13565
13566 2002-06-14 Akim Demaille <akim@epita.fr>
13567
13568 * src/parse-gram.y (directives, directive, gram)
13569 (grammar_directives, precedence_directives, precedence_directive):
13570 Rename as...
13571 (declarations, declaration, grammar, grammar_declaration)
13572 (precedence_declaration, precedence_declarator): these.
13573 (symbol_declaration): New.
13574
13575 2002-06-14 Akim Demaille <akim@epita.fr>
13576
13577 * src/files.c (action_obstack): Remove, unused.
13578 (output_obstack): Remove it, and all its dependencies, as it is no
13579 longer needed.
13580 * src/reader.c (epilogue_set): Build the epilogue in the
13581 muscle_obstack.
13582 * src/output.h, src/output.c (muscle_obstack): Move to...
13583 * src/muscle_tab.h, src/muscle_tab.h: here.
13584 (muscle_init): Initialize muscle_obstack.
13585 (muscle_free): New.
13586 * src/main.c (main): Call it.
13587
13588 2002-06-14 Akim Demaille <akim@epita.fr>
13589
13590 * src/location.h: New, extracted from...
13591 * src/reader.h: here.
13592 * src/Makefile.am (noinst_HEADERS): Merge into
13593 (bison_SOURCES): this.
13594 Add location.h.
13595 * src/parse-gram.y: Use location_t instead of Bison's.
13596 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
13597 Use location_t instead of ints.
13598
13599 2002-06-14 Akim Demaille <akim@epita.fr>
13600
13601 * data/bison.simple, data/bison.c++: Be sure to restore the
13602 current #line when returning to the skeleton contents after having
13603 exposed the input file's #line.
13604
13605 2002-06-12 Akim Demaille <akim@epita.fr>
13606
13607 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
13608 eager.
13609 * tests/actions.at (Exotic Dollars): New.
13610
13611 2002-06-12 Akim Demaille <akim@epita.fr>
13612
13613 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
13614 ['"/] too eagerly.
13615 * tests/input.at (Torturing the Scanner): New.
13616
13617 2002-06-11 Akim Demaille <akim@epita.fr>
13618
13619 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
13620 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
13621 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
13622 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
13623 * src/reader.c (reader): Use it.
13624
13625 2002-06-11 Akim Demaille <akim@epita.fr>
13626
13627 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
13628 Adjust all callers.
13629 (scanner_last_string_free): New.
13630
13631 2002-06-11 Akim Demaille <akim@epita.fr>
13632
13633 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
13634 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
13635 (last_string, YY_OBS_FREE): New.
13636 Use them when returning an ID.
13637
13638 2002-06-11 Akim Demaille <akim@epita.fr>
13639
13640 Have Bison grammars parsed by a Bison grammar.
13641
13642 * src/reader.c, src/reader.h (prologue_augment): New.
13643 * src/reader.c (copy_definition): Remove.
13644
13645 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
13646 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
13647 (grammar_current_rule_prec_set, grammar_current_rule_check)
13648 (grammar_current_rule_symbol_append)
13649 (grammar_current_rule_action_append): Export.
13650 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
13651 (symbol_list_action_append): Remove.
13652 Hook the routines from reader.
13653 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
13654 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
13655
13656 * src/reader.c (read_declarations): Remove, unused.
13657
13658 * src/parse-gram.y: Handle the epilogue.
13659 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
13660 (grammar_start_symbol_set): this.
13661 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
13662 * src/reader.c (readgram): Remove, unused.
13663 (reader): Adjust to insert eoftoken and axiom where appropriate.
13664
13665 * src/reader.c (copy_dollar): Replace with...
13666 * src/scan-gram.h (handle_dollar): this.
13667 * src/parse-gram.y: Remove `%thong'.
13668
13669 * src/reader.c (copy_at): Replace with...
13670 * src/scan-gram.h (handle_at): this.
13671
13672 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
13673 New.
13674
13675 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
13676 time being.
13677
13678 * src/reader.h, src/reader.c (grammar_rule_end): New.
13679
13680 * src/parse.y (current_type, current_class): New.
13681 Implement `%nterm', `%token' support.
13682 Merge `%term' into `%token'.
13683 (string_as_id): New.
13684 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
13685 type name.
13686
13687 * src/parse-gram.y: Be sure to handle properly the beginning of
13688 rules.
13689
13690 * src/parse-gram.y: Handle %type.
13691 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
13692
13693 * src/parse-gram.y: More directives support.
13694 * src/options.c: No longer handle source directives.
13695
13696 * src/parse-gram.y: Fix %output.
13697
13698 * src/parse-gram.y: Handle %union.
13699 Use the prologue locations.
13700 * src/reader.c (parse_union_decl): Remove.
13701
13702 * src/reader.h, src/reader.c (epilogue_set): New.
13703 * src/parse-gram.y: Use it.
13704
13705 * data/bison.simple, data/bison.c++: b4_stype is now either not
13706 defined, then default to int, or to the contents of %union,
13707 without `union' itself.
13708 Adjust.
13709 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
13710
13711 * src/output.c (actions_output): Don't output braces, as they are
13712 already handled by the scanner.
13713
13714 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
13715 characters to themselves.
13716
13717 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
13718 that the epilogue has a proper #line.
13719
13720 * src/parse-gram.y: Handle precedence/associativity.
13721
13722 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
13723 a terminal.
13724 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
13725 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
13726 at all to define terminals that cannot be emitted.
13727
13728 * src/scan-gram.l: Escape M4 characters.
13729
13730 * src/scan-gram.l: Working properly with escapes in user
13731 strings/characters.
13732
13733 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
13734 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
13735 grammar.
13736 Use more modest sizes, as for the time being the parser does not
13737 release memory, and therefore the process swallows a huge amount
13738 of memory.
13739
13740 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
13741 stricter %token grammar.
13742
13743 * src/symtab.h (associativity): Add `undef_assoc'.
13744 (symbol_precedence_set): Do nothing when passed an undef_assoc.
13745 * src/symtab.c (symbol_check_alias_consistence): Adjust.
13746
13747 * tests/regression.at (Invalid %directive): Remove, as it is now
13748 meaningless.
13749 (Invalid inputs): Adjust to the new error messages.
13750 (Token definitions): The new grammar doesn't allow too many
13751 eccentricities.
13752
13753 * src/lex.h, src/lex.c: Remove.
13754 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
13755 (copy_character, copy_string2, copy_string, copy_identifier)
13756 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
13757 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
13758 (parse_action): Remove.
13759 * po/POTFILES.in: Adjust.
13760
13761 2002-06-11 Akim Demaille <akim@epita.fr>
13762
13763 * src/reader.c (parse_action): Don't store directly into the
13764 rule's action member: return the action as a string.
13765 Don't require `rule_length' as an argument: compute it.
13766 (grammar_current_rule_symbol_append)
13767 (grammar_current_rule_action_append): New, eved out from
13768 (readgram): here.
13769 Remove `action_flag', `rulelength', unused now.
13770
13771 2002-06-11 Akim Demaille <akim@epita.fr>
13772
13773 * src/reader.c (grammar_current_rule_prec_set).
13774 (grammar_current_rule_check): New, eved out from...
13775 (readgram): here.
13776 Remove `xaction', `first_rhs': useless.
13777 * tests/input.at (Type clashes): New.
13778 * tests/existing.at (GNU Cim Grammar): Adjust.
13779
13780 2002-06-11 Akim Demaille <akim@epita.fr>
13781
13782 * src/reader.c (grammar_midrule_action): New, Eved out from
13783 (readgram): here.
13784
13785 2002-06-11 Akim Demaille <akim@epita.fr>
13786
13787 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
13788 New.
13789 (readgram): Use them as replacement of inlined code, crule and
13790 crule1.
13791
13792 2002-06-11 Akim Demaille <akim@epita.fr>
13793
13794 * src/reader.c (grammar_end, grammar_symbol_append): New.
13795 (readgram): Use them.
13796 Make the use of `p' as local as possible.
13797
13798 2002-06-10 Akim Demaille <akim@epita.fr>
13799
13800 GCJ's parser requires the tokens to be defined before the prologue.
13801
13802 * data/bison.simple: Output the token definition before the user's
13803 prologue.
13804 * tests/regression.at (Braces parsing, Duplicate string)
13805 (Mixing %token styles): Check the output from bison.
13806 (Early token definitions): New.
13807
13808 2002-06-10 Akim Demaille <akim@epita.fr>
13809
13810 * src/symtab.c (symbol_user_token_number_set): Don't complain when
13811 assigning twice the same user number to a token, so that we can
13812 use it in...
13813 * src/lex.c (lex): here.
13814 Also use `symbol_class_set' instead of hand written code.
13815 * src/reader.c (parse_assoc_decl): Likewise.
13816
13817 2002-06-10 Akim Demaille <akim@epita.fr>
13818
13819 * src/symtab.c, src/symtab.c (symbol_class_set)
13820 (symbol_user_token_number_set): New.
13821 * src/reader.c (parse_token_decl): Use them.
13822 Use a switch instead of ifs.
13823 Use a single argument.
13824
13825 2002-06-10 Akim Demaille <akim@epita.fr>
13826
13827 Remove `%thong' support as it is undocumented, unused, duplicates
13828 `%token's job, and creates useless e-mail traffic with people who
13829 want to know what it is, why it is undocumented, unused, and
13830 duplicates `%token's job.
13831
13832 * src/reader.c (parse_thong_decl): Remove.
13833 * src/options.c (option_table): Remove "thong".
13834 * src/lex.h (tok_thong): Remove.
13835
13836 2002-06-10 Akim Demaille <akim@epita.fr>
13837
13838 * src/symtab.c, src/symtab.c (symbol_type_set)
13839 (symbol_precedence_set): New.
13840 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
13841 (value_components_used): Remove, unused.
13842
13843 2002-06-09 Akim Demaille <akim@epita.fr>
13844
13845 Move symbols handling code out of the reader.
13846
13847 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
13848 (axiom): Move to...
13849 * src/symtab.h, src/symtab.c: here.
13850
13851 * src/gram.c (start_symbol): Remove: use startsymbol->number.
13852 * src/reader.c (startval): Rename as...
13853 * src/symtab.h, src/symtab.c (startsymbol): this.
13854 * src/reader.c: Adjust.
13855
13856 * src/reader.c (symbol_check_defined, symbol_make_alias)
13857 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13858 (token_translations_init)
13859 Move to...
13860 * src/symtab.c: here.
13861 * src/reader.c (packsymbols): Move to...
13862 * src/symtab.h, src/symtab.c (symbols_pack): here.
13863 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
13864 argument.
13865
13866 2002-06-03 Akim Demaille <akim@epita.fr>
13867
13868 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
13869 then statements.
13870
13871 2002-06-03 Akim Demaille <akim@epita.fr>
13872
13873 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
13874 structs with non literals.
13875 * src/scan-skel.l: never-interactive.
13876 * src/conflicts.c (enum conflict_resolution_e): No trailing
13877 comma.
13878 * src/getargs.c (usage): Split long literal strings.
13879 Reported by Hans Aberg.
13880
13881 2002-05-28 Akim Demaille <akim@epita.fr>
13882
13883 * data/bison.c++: Use C++ ostreams.
13884 (cdebug_): New member.
13885
13886 2002-05-28 Akim Demaille <akim@epita.fr>
13887
13888 * src/output.c (output_skeleton): Be sure to allocate enough room
13889 for `/' _and_ for `\0' in full_skeleton.
13890
13891 2002-05-28 Akim Demaille <akim@epita.fr>
13892
13893 * data/bison.c++: Catch up with bison.simple:
13894 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13895 and Paul Eggert <eggert@twinsun.com>: `error' handing.
13896 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
13897 and popping traces.
13898
13899 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13900
13901 * src/output.c (output_skeleton): Put an explicit path in front of
13902 the skeleton file name, rather than relying on the -I directory,
13903 to partially alleviate effects of having a skeleton file lying around
13904 in the current directory.
13905
13906 2002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13907
13908 * src/conflicts.c (log_resolution): Correct typo:
13909 obstack_printf should be obstack_fgrow1.
13910
13911 2002-05-26 Akim Demaille <akim@epita.fr>
13912
13913 * src/state.h (state_t): `solved_conflicts' is a new member.
13914 * src/LR0.c (new_state): Set it to 0.
13915 * src/conflicts.h, src/conflicts.c (print_conflicts)
13916 (free_conflicts, solve_conflicts): Rename as...
13917 (conflicts_print, conflicts_free, conflicts_solve): these.
13918 Adjust callers.
13919 * src/conflicts.c (enum conflict_resolution_e)
13920 (solved_conflicts_obstack): New, used by...
13921 (log_resolution): this.
13922 Adjust to attach the conflict resolution to each state.
13923 Complete the description with the precedence/associativity
13924 information.
13925 (resolve_sr_conflict): Adjust.
13926 * src/print.c (print_state): Output its solved_conflicts.
13927 * tests/conflicts.at (Unresolved SR Conflicts)
13928 (Solved SR Conflicts): Exercise --report=all.
13929
13930 2002-05-26 Akim Demaille <akim@epita.fr>
13931
13932 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13933 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13934 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
13935 (token_number_t, item_number_as_token_number)
13936 (token_number_as_item_number, muscle_insert_token_number_table):
13937 Rename as...
13938 (symbol_number_t, item_number_as_symbol_number)
13939 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
13940 these, since it is more appropriate.
13941
13942 2002-05-26 Akim Demaille <akim@epita.fr>
13943
13944 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
13945 `Error:' lines.
13946 * data/bison.simple (yystos) [YYDEBUG]: New.
13947 (yyparse) [YYDEBUG]: Display the symbols which are popped during
13948 error recovery.
13949 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
13950
13951 2002-05-25 Akim Demaille <akim@epita.fr>
13952
13953 * doc/bison.texinfo (Debugging): Split into...
13954 (Tracing): this new section, its former contents, and...
13955 (Understanding): this new section.
13956 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
13957 by...
13958 (report_flag): this.
13959 Adjust all dependencies.
13960 (report_args, report_types, report_argmatch): New.
13961 (usage, getargs): Report/support -r, --report.
13962 * src/options.h
13963 (struct option_table_struct): Rename as..,
13964 (struct option_table_s): this.
13965 Rename the `set_flag' member to `flag' to match with getopt_long's
13966 struct.
13967 * src/options.c (option_table): Split verbose into an entry for
13968 %verbose, and another for --verbose.
13969 Support --report/-r, so remove -r from the obsolete --raw.
13970 * src/print.c: Attach full item sets and lookaheads reports to
13971 report_flag instead of trace_flag.
13972 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
13973
13974 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13975 and Paul Eggert <eggert@twinsun.com>
13976
13977 * data/bison.simple (yyparse): Correct error handling to conform to
13978 POSIX and yacc. Specifically, after syntax error is discovered,
13979 do not reduce further before shifting the error token.
13980 Clean up the code a bit by removing the labels yyerrdefault,
13981 yyerrhandle, yyerrpop.
13982 * NEWS: Document the above.
13983
13984 2002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13985
13986 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
13987 type; it isn't always big enough, since it doesn't necessarily
13988 include non-terminals.
13989 (yytranslate): Expand definition of yy_token_number_type, so that
13990 the latter can be removed.
13991 (yy_token_number_type): Remove, only one use.
13992 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
13993 don't use TokenNumberType as element type.
13994
13995 * tests/regression.at: Modify expected output to agree with change
13996 to yyr1 and yytranslate.
13997
13998 2002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
13999
14000 * src/reader.c (parse_action): Use copy_character instead of
14001 obstack_1grow.
14002
14003 2002-05-13 Akim Demaille <akim@epita.fr>
14004
14005 * tests/regression.at (Token definitions): Prototype yylex and
14006 yyerror.
14007
14008 2002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
14009
14010 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
14011 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
14012 32-bit arithmetic.
14013 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
14014
14015 2002-05-07 Akim Demaille <akim@epita.fr>
14016
14017 * tests/synclines.at: Be sure to prototype yylex and yyerror to
14018 avoid GCC warnings.
14019
14020 2002-05-07 Akim Demaille <akim@epita.fr>
14021
14022 Kill GCC warnings.
14023
14024 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
14025 over the RHS of each rule.
14026 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
14027 * src/state.h (state_t): Member `nitems' is unsigned short.
14028 * src/LR0.c (get_state): Adjust.
14029 * src/reader.c (packgram): Likewise.
14030 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
14031 `Type'.
14032 (muscle_insert_int_table): Remove, unused.
14033 (prepare_rules): Remove `max'.
14034
14035 2002-05-06 Akim Demaille <akim@epita.fr>
14036
14037 * src/closure.c (print_firsts): Display of the symbol tags.
14038 (bitmatrix_print): Move to...
14039 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
14040 here.
14041 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
14042
14043 2002-05-06 Akim Demaille <akim@epita.fr>
14044
14045 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
14046 hash_do_for_each.
14047
14048 2002-05-06 Akim Demaille <akim@epita.fr>
14049
14050 * src/LR0.c (new_state, get_state): Instead of using the global
14051 `kernel_size' and `kernel_base', have two new arguments:
14052 `core_size' and `core'.
14053 Adjust callers.
14054
14055 2002-05-06 Akim Demaille <akim@epita.fr>
14056
14057 * src/reader.c (packgram): No longer end `ritem' with a 0
14058 sentinel: it is not used.
14059
14060 2002-05-05 Akim Demaille <akim@epita.fr>
14061
14062 New experimental feature: display the lookaheads in the report and
14063 graph.
14064
14065 * src/print (print_core): When --trace-flag, display the rules
14066 lookaheads.
14067 * src/print_graph.c (print_core): Likewise.
14068 Swap the arguments.
14069 Adjust caller.
14070
14071 2002-05-05 Akim Demaille <akim@epita.fr>
14072
14073 * tests/torture.at (Many lookaheads): New test.
14074
14075 2002-05-05 Akim Demaille <akim@epita.fr>
14076
14077 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
14078 (GENERATE_MUSCLE_INSERT_TABLE): this.
14079 (output_int_table, output_unsigned_int_table, output_short_table)
14080 (output_token_number_table, output_item_number_table): Replace with...
14081 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
14082 (muscle_insert_short_table, muscle_insert_token_number_table)
14083 (muscle_insert_item_number_table): these.
14084 Adjust all callers.
14085 (prepare_tokens): Don't free `translations', since...
14086 * src/reader.h, src/reader.c (grammar_free): do it.
14087 Move to...
14088 * src/gram.h, src/gram.c (grammar_free): here.
14089 * data/bison.simple, data/bison.c++: b4_token_number_max is now
14090 b4_translate_max.
14091
14092 2002-05-05 Akim Demaille <akim@epita.fr>
14093
14094 * src/output.c (output_unsigned_int_table): New.
14095 (prepare_rules): `i' is unsigned.
14096 `prhs', `rline', `r2' are unsigned int.
14097 Rename muscle `rhs_number_max' as `rhs_max'.
14098 Output muscles `prhs_max', `rline_max', and `r2_max'.
14099 Free rline and r1.
14100 * data/bison.simple, data/bison.c++: Adjust to use these muscles
14101 to compute types instead of constant types.
14102 * tests/regression.at (Web2c Actions): Adjust.
14103
14104 2002-05-04 Akim Demaille <akim@epita.fr>
14105
14106 * src/symtab.h (SALIAS, SUNDEF): Rename as...
14107 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
14108 Adjust dependencies.
14109 * src/output.c (token_definitions_output): Be sure not to output a
14110 `#define 'a'' when fed with `%token 'a' "a"'.
14111 * tests/regression.at (Token definitions): New.
14112
14113 2002-05-03 Paul Eggert <eggert@twinsun.com>
14114
14115 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
14116 for K&R C.
14117
14118 2002-05-03 gettextize <bug-gnu-gettext@gnu.org>
14119
14120 * Makefile.am (SUBDIRS): Remove intl.
14121 (EXTRA_DIST): Add config/config.rpath.
14122
14123 2002-05-03 Akim Demaille <akim@epita.fr>
14124
14125 * data/bison.simple (m4_if): Don't output empty enums.
14126 And actually, output valid enum definitions :(.
14127
14128 2002-05-03 Akim Demaille <akim@epita.fr>
14129
14130 * configure.bat: Remove, completely obsolete.
14131 * Makefile.am (EXTRA_DIST): Adjust.
14132 Don't distribute config.rpath...
14133 * config/Makefile.am (EXTRA_DIST): Do it.
14134
14135 2002-05-03 Akim Demaille <akim@epita.fr>
14136
14137 * configure.in (GETTEXT_VERSION): New.
14138 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
14139
14140 2002-05-03 Akim Demaille <akim@epita.fr>
14141
14142 * data/bison.simple (b4_token_enum): New.
14143 (b4_token_defines): Use it to output tokens both as #define and
14144 enums.
14145 Suggested by Paul Eggert.
14146 * src/output.c (token_definitions_output): Don't output spurious
14147 white spaces.
14148
14149 2002-05-03 Akim Demaille <akim@epita.fr>
14150
14151 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14152
14153 2002-05-02 Robert Anisko <robert@lrde.epita.fr>
14154
14155 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
14156 Update the stack class, give a try to deque as the default container.
14157
14158 2002-05-02 Akim Demaille <akim@epita.fr>
14159
14160 * data/bison.simple (yyparse): Do not implement @$ = @1.
14161 (YYLLOC_DEFAULT): Adjust to do it.
14162 * doc/bison.texinfo (Location Default Action): Fix.
14163
14164 2002-05-02 Akim Demaille <akim@epita.fr>
14165
14166 * src/reader.c (parse_braces): Merge into...
14167 (parse_action): this.
14168
14169 2002-05-02 Akim Demaille <akim@epita.fr>
14170
14171 * configure.in (ALL_LINGUAS): Remove.
14172 * po/LINGUAS, hr.po: New.
14173
14174 2002-05-02 Akim Demaille <akim@epita.fr>
14175
14176 Remove the so called hairy (semantic) parsers.
14177
14178 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
14179 * src/gram.h, src/gram.c (semantic_parser): Remove.
14180 (rule_t): Remove the guard and guard_line members.
14181 * src/lex.h (token_t): remove tok_guard.
14182 * src/options.c (option_table): Remove %guard and %semantic_parser
14183 support.
14184 * src/output.c, src/output.h (guards_output): Remove.
14185 (prepare): Adjust.
14186 (token_definitions_output): Don't output the `T'
14187 tokens (???).
14188 (output_skeleton): Don't output the guards.
14189 * src/files.c, src/files.c (attrsfile): Remove.
14190 * src/reader.c (symbol_list): Remove the guard and guard_line
14191 members.
14192 Adjust dependencies.
14193 (parse_guard): Remove.
14194 * data/bison.hairy: Remove.
14195 * doc/bison.texinfo (Environment Variables): Remove occurrences of
14196 BISON_HAIRY.
14197
14198 2002-05-02 Akim Demaille <akim@epita.fr>
14199
14200 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
14201 (parse_guard): Rename the formal argument `stack_offset' as
14202 `rule_length', which is more readable.
14203 Adjust callers.
14204 (copy_at, copy_dollar): Instead of outputting the hard coded
14205 values of $$, $n and so forth, output invocation to b4_lhs_value,
14206 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
14207 Note: this patch partially drops `semantic-parser' support: it
14208 always does `rule_length - n', where semantic parsers ought to
14209 always use `-n'.
14210 * data/bison.simple, data/bison.c++ (b4_lhs_value)
14211 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
14212
14213 2002-05-02 Akim Demaille <akim@epita.fr>
14214
14215 * configure.in (AC_INIT): Bump to 1.49b.
14216 (AM_INIT_AUTOMAKE): Short invocation.
14217
14218 2002-05-02 Akim Demaille <akim@epita.fr>
14219
14220 Version 1.49a.
14221
14222 2002-05-01 Akim Demaille <akim@epita.fr>
14223
14224 * src/skeleton.h: Remove.
14225
14226 2002-05-01 Akim Demaille <akim@epita.fr>
14227
14228 * src/skeleton.h: Fix the #endif.
14229 Reported by Magnus Fromreide.
14230
14231 2002-04-26 Paul Eggert <eggert@twinsun.com>
14232
14233 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
14234 Define if we define YYSTYPE and YYLTYPE, respectively.
14235 (YYCOPY): Fix [] quoting problem in the non-GCC case.
14236
14237 2002-04-25 Robert Anisko <robert@lrde.epita.fr>
14238
14239 * src/scan-skel.l: Postprocess quadrigraphs.
14240
14241 * src/reader.c (copy_character): New function, used to output
14242 single characters while replacing `[' and `]' with quadrigraphs, to
14243 avoid troubles with M4 quotes.
14244 (copy_comment): Output characters with copy_character.
14245 (read_additionnal_code): Likewise.
14246 (copy_string2): Likewise.
14247 (copy_definition): Likewise.
14248
14249 * tests/calc.at: Exercise M4 quoting.
14250
14251 2002-04-25 Akim Demaille <akim@epita.fr>
14252
14253 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
14254 between `!' and the command.
14255 Reported by Paul Eggert.
14256
14257 2002-04-24 Robert Anisko <robert@lrde.epita.fr>
14258
14259 * tests/calc.at: Exercise prologue splitting.
14260
14261 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
14262 `b4_post_prologue' instead of `b4_prologue'.
14263
14264 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
14265 muscles.
14266 (output): Free pre_prologue_obstack and post_prologue_obstack.
14267 * src/files.h, src/files.c (attrs_obstack): Remove.
14268 (pre_prologue_obstack, post_prologue_obstack): New.
14269 * src/reader.c (copy_definition): Add a parameter to specify the
14270 obstack to fill, instead of using attrs_obstack unconditionally.
14271 (read_declarations): Pass pre_prologue_obstack to copy_definition if
14272 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
14273
14274 2002-04-23 Paul Eggert <eggert@twinsun.com>
14275
14276 * data/bison.simple: Remove unnecessary commentary and white
14277 space differences from 1_29-branch.
14278 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
14279
14280 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
14281 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
14282 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
14283 constructors or destructors.
14284
14285 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
14286
14287 2002-04-23 Akim Demaille <akim@epita.fr>
14288
14289 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
14290 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
14291 location with columns.
14292 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
14293 All reported by Paul Eggert.
14294
14295 2002-04-22 Akim Demaille <akim@epita.fr>
14296
14297 * src/reduce.c (dump_grammar): Move to...
14298 * src/gram.h, src/gram.c (grammar_dump): here.
14299 Be sure to separate long item numbers.
14300 Don't read the members of a rule's prec if its nil.
14301
14302 2002-04-22 Akim Demaille <akim@epita.fr>
14303
14304 * src/output.c (table_size, table_grow): New.
14305 (MAXTABLE): Remove, replace uses with table_size.
14306 (pack_vector): Instead of dying when the table is too big, grow it.
14307
14308 2002-04-22 Akim Demaille <akim@epita.fr>
14309
14310 * data/bison.simple (yyr1): Its type is that of a token number.
14311 * data/bison.c++ (r1_): Likewise.
14312 * tests/regression.at (Web2c Actions): Adjust.
14313
14314 2002-04-22 Akim Demaille <akim@epita.fr>
14315
14316 * src/reader.c (token_translations_init): 256 is now the default
14317 value for the error token, i.e., it will be assigned another
14318 number if the user assigned 256 to one of her tokens.
14319 (reader): Don't force 256 to error.
14320 * doc/bison.texinfo (Symbols): Adjust.
14321 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
14322 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
14323 etc. instead of 10, 20, 30 (which was used to `jump' over error
14324 (256) and undefined (2)).
14325
14326 2002-04-22 Akim Demaille <akim@epita.fr>
14327
14328 Propagate more token_number_t.
14329
14330 * src/gram.h (token_number_as_item_number)
14331 (item_number_as_token_number): New.
14332 * src/output.c (GENERATE_OUTPUT_TABLE): New.
14333 Use it to create output_item_number_table and
14334 output_token_number_table.
14335 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14336 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
14337 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
14338 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
14339
14340 2002-04-22 Akim Demaille <akim@epita.fr>
14341
14342 * src/output.h, src/output.c (get_lines_number): Remove.
14343
14344 2002-04-19 Akim Demaille <akim@epita.fr>
14345
14346 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
14347 as Lex/Flex'.
14348 (Debugging): More details about enabling the debugging features.
14349 (Table of Symbols): Describe $$, $n, @$, and @n.
14350 Suggested by Tim Josling.
14351
14352 2002-04-19 Akim Demaille <akim@epita.fr>
14353
14354 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
14355
14356 2002-04-10 Akim Demaille <akim@epita.fr>
14357
14358 * src/system.h: Rely on HAVE_LIMITS_H.
14359 Suggested by Paul Eggert.
14360
14361 2002-04-09 Akim Demaille <akim@epita.fr>
14362
14363 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
14364 full stderr, and strip it according to the bison options, instead
14365 of composing the error message from different bits.
14366 This makes it easier to check for several error messages.
14367 Adjust all the invocations.
14368 Add an invocation exercising the error token.
14369 Add an invocation demonstrating a stupid error message.
14370 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
14371 Adjust the tests.
14372 Error message are for stderr, not stdout.
14373
14374 2002-04-09 Akim Demaille <akim@epita.fr>
14375
14376 * src/gram.h, src/gram.c (error_token_number): Remove, use
14377 errtoken->number.
14378 * src/reader.c (reader): Don't specify the user token number (2)
14379 for $undefined, as it uselessly prevents using it.
14380 * src/gram.h (token_number_t): Move to...
14381 * src/symtab.h: here.
14382 (state_t.number): Is a token_number_t.
14383 * src/print.c, src/reader.c: Use undeftoken->number instead of
14384 hard coded 2.
14385 (Even though this 2 is not the same as above: the number of the
14386 undeftoken remains being 2, it is its user token number which
14387 might not be 2).
14388 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
14389 `user_token_number_max'.
14390 Output `undef_token_number'.
14391 * data/bison.simple, data/bison.c++: Use them.
14392 Be sure to map invalid yylex return values to
14393 `undef_token_number'. This saves us from gratuitous SEGV.
14394
14395 * tests/conflicts.at (Solved SR Conflicts)
14396 (Unresolved SR Conflicts): Adjust.
14397 * tests/regression.at (Web2c Actions): Adjust.
14398
14399 2002-04-08 Akim Demaille <akim@epita.fr>
14400
14401 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
14402 Adding #line.
14403 Remove the duplicate `typedefs'.
14404 (RhsNumberType): Fix the declaration and various other typos.
14405 Use __ofile__.
14406 * data/bison.simple: Use __ofile__.
14407 * src/scan-skel.l: Handle __ofile__.
14408
14409 2002-04-08 Akim Demaille <akim@epita.fr>
14410
14411 * src/gram.h (item_number_t): New, the type of item numbers in
14412 RITEM. Note that it must be able to code symbol numbers as
14413 positive number, and the negation of rule numbers as negative
14414 numbers.
14415 Adjust all dependencies (pretty many).
14416 * src/reduce.c (rule): Remove this `short *' pointer: use
14417 item_number_t.
14418 * src/system.h (MINSHORT, MAXSHORT): Remove.
14419 Include `limits.h'.
14420 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
14421 (shortcpy): Remove.
14422 (MAXTABLE): Move to...
14423 * src/output.c (MAXTABLE): here.
14424 (prepare_rules): Use output_int_table to output rhs.
14425 * data/bison.simple, data/bison.c++: Adjust.
14426 * tests/torture.at (Big triangle): Move the limit from 254 to
14427 500.
14428 * tests/regression.at (Web2c Actions): Ajust.
14429
14430 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
14431 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
14432 passes, but produces negative #line number, once fixed, GCC is
14433 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
14434 C), it passes.
14435 * src/state.h (state_h): Code input lines on ints, not shorts.
14436
14437 2002-04-08 Akim Demaille <akim@epita.fr>
14438
14439 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
14440 and then the grammar.
14441
14442 2002-04-08 Akim Demaille <akim@epita.fr>
14443
14444 * src/system.h: No longer using strndup.
14445
14446 2002-04-07 Akim Demaille <akim@epita.fr>
14447
14448 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
14449 * src/output.c (output_table_data): Return the longest number.
14450 (prepare_tokens): Output `token_number_max').
14451 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
14452 New.
14453 Use them to define yy_token_number_type/TokenNumberType.
14454 Use this type for yytranslate.
14455 * tests/torture.at (Big triangle): Push the limit from 124 to
14456 253.
14457 * tests/regression.at (Web2c Actions): Adjust.
14458
14459 2002-04-07 Akim Demaille <akim@epita.fr>
14460
14461 * tests/torture.at (Big triangle): New.
14462 (GNU AWK Grammar, GNU Cim Grammar): Move to...
14463 * tests/existing.at: here.
14464
14465 2002-04-07 Akim Demaille <akim@epita.fr>
14466
14467 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
14468 nritems.
14469 Adjust dependencies.
14470
14471 2002-04-07 Akim Demaille <akim@epita.fr>
14472
14473 * src/reader.c: Normalize increments to prefix form.
14474
14475 2002-04-07 Akim Demaille <akim@epita.fr>
14476
14477 * src/reader.c, symtab.c: Remove debugging code.
14478
14479 2002-04-07 Akim Demaille <akim@epita.fr>
14480
14481 Rename all the `bucket's as `symbol_t'.
14482
14483 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
14484 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
14485 * src/symtab.c, src/symtab.h (bucket): Rename as...
14486 (symbol_t): this.
14487 (symbol_list_new, bucket_check_defined, bucket_make_alias)
14488 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
14489 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14490 (buckets_new, buckets_free, buckets_do): Rename as...
14491 (symbol_list_new, symbol_check_defined, symbol_make_alias)
14492 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
14493 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
14494 (symbols_new, symbols_free, symbols_do): these.
14495
14496 2002-04-07 Akim Demaille <akim@epita.fr>
14497
14498 Use lib/hash for the symbol table.
14499
14500 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
14501 EOF.
14502 * src/lex.c (lex): Set the `number' member of new terminals.
14503 * src/reader.c (bucket_check_defined, bucket_make_alias)
14504 (bucket_check_alias_consistence, bucket_translation): New.
14505 (reader, grammar_free, readgram, token_translations_init)
14506 (packsymbols): Adjust.
14507 (reader): Number the predefined tokens.
14508 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
14509 for predefined tokens.
14510 * src/symtab.h (bucket): Remove all the hash table related
14511 members.
14512 * src/symtab.c (symtab): Replace by...
14513 (bucket_table): this.
14514 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14515 (buckets_new, buckets_do): New.
14516
14517 2002-04-07 Akim Demaille <akim@epita.fr>
14518
14519 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
14520 (start_symbol, max_user_token_number, semantic_parser)
14521 (error_token_number): Initialize.
14522 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
14523 Initialize.
14524 (reader): Don't.
14525 (errtoken, eoftoken, undeftoken, axiom): Extern.
14526
14527 2002-04-07 Akim Demaille <akim@epita.fr>
14528
14529 * src/gram.h (rule_s): prec and precsym are now pointers
14530 to the bucket giving the priority/associativity.
14531 Member `associativity' removed: useless.
14532 * src/reduce.c, src/conflicts.c: Adjust.
14533
14534 2002-04-07 Akim Demaille <akim@epita.fr>
14535
14536 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
14537 Properly escape the symbols' TAG when outputting them.
14538
14539 2002-04-07 Akim Demaille <akim@epita.fr>
14540
14541 * src/lalr.h (LA): Is a bitsetv, not bitset*.
14542
14543 2002-04-07 Akim Demaille <akim@epita.fr>
14544
14545 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
14546 (LArule): this, which is an array to rule_t*.
14547 * src/print.c, src/conflicts.c: Adjust.
14548
14549 2002-04-07 Akim Demaille <akim@epita.fr>
14550
14551 * src/gram.h (rule_t): Rename `number' as `user_number'.
14552 `number' is a new member.
14553 Adjust dependencies.
14554 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
14555
14556 2002-04-07 Akim Demaille <akim@epita.fr>
14557
14558 As a result of the previous patch, it is no longer needed
14559 to reorder ritem itself.
14560
14561 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
14562
14563 2002-04-07 Akim Demaille <akim@epita.fr>
14564
14565 Be sure never to walk through RITEMS, but use only data related to
14566 the rules themselves. RITEMS should be banished.
14567
14568 * src/output.c (output_token_translations): Rename as...
14569 (prepare_tokens): this.
14570 In addition to `translate', prepare the muscles `tname' and
14571 `toknum', which were handled by...
14572 (output_rule_data): this.
14573 Remove, and move the remainder of its outputs into...
14574 (prepare_rules): this new routines, which also merges content from
14575 (output_gram): this.
14576 (prepare_rules): Be sure never to walk through RITEMS.
14577 (output_stos): Rename as...
14578 (prepare_stos): this.
14579 (output): Always invoke prepare_states, after all, just don't use it
14580 in the output if you don't need it.
14581
14582 2002-04-07 Akim Demaille <akim@epita.fr>
14583
14584 * src/LR0.c (new_state): Display `nstates' as the name of the
14585 newly created state.
14586 Adjust to initialize first_state and last_state if needed.
14587 Be sure to distinguish the initial from the final state.
14588 (new_states): Create the itemset of the initial state, and use
14589 new_state.
14590 * src/closure.c (closure): Now that the initial state has its
14591 items properly set, there is no need for a special case when
14592 creating `ruleset'.
14593
14594 As a result, now the rule 0, reducing to $axiom, is visible in the
14595 outputs. Adjust the test suite.
14596
14597 * tests/conflicts.at (Solved SR Conflicts)
14598 (Unresolved SR Conflicts): Adjust.
14599 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
14600 * tests/conflicts.at (S/R in initial): New.
14601
14602 2002-04-07 Akim Demaille <akim@epita.fr>
14603
14604 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
14605 the RHS of the rules.
14606 * src/output.c (output_gram): Likewise.
14607
14608 2002-04-07 Akim Demaille <akim@epita.fr>
14609
14610 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
14611 bucket.
14612 Adjust all dependencies.
14613 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
14614 `number' of the buckets too.
14615 * src/gram.h: Include `symtab.h'.
14616 (associativity): Move to...
14617 * src/symtab.h: here.
14618 No longer include `gram.h'.
14619
14620 2002-04-07 Akim Demaille <akim@epita.fr>
14621
14622 * src/gram.h, src/gram.c (rules_rhs_length): New.
14623 (ritem_longest_rhs): Use it.
14624 * src/gram.h (rule_t): `number' is a new member.
14625 * src/reader.c (packgram): Set it.
14626 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
14627 the end of `rules', and count them out of `nrules'.
14628 (reduce_output, dump_grammar): Adjust.
14629 * src/print.c (print_grammar): It is no longer needed to check for
14630 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
14631 * tests/reduce.at (Reduced Automaton): New test.
14632
14633 2002-04-07 Akim Demaille <akim@epita.fr>
14634
14635 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
14636 lacking `+ 1' to nrules, Bison reported as useless a token if it
14637 was used solely to set the precedence of the last rule...
14638
14639 2002-04-07 Akim Demaille <akim@epita.fr>
14640
14641 * data/bison.c++, data/bison.simple: Don't output the current file
14642 name in #line, to avoid useless diffs between two identical
14643 outputs under different names.
14644
14645 2002-04-07 Akim Demaille <akim@epita.fr>
14646
14647 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
14648 Normalize loops to using `< nrules + 1', not `<= nrules'.
14649
14650 2002-04-07 Akim Demaille <akim@epita.fr>
14651
14652 * TODO: Update.
14653
14654 2002-04-07 Akim Demaille <akim@epita.fr>
14655
14656 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
14657 bucket.value as bucket.number.
14658
14659 2002-04-07 Akim Demaille <akim@epita.fr>
14660
14661 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
14662 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14663 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
14664 RHS, instead of being an index in RITEMS.
14665
14666 2002-04-04 Paul Eggert <eggert@twinsun.com>
14667
14668 * doc/bison.texinfo: Update copyright date.
14669 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
14670 (Symbols): Warn about running Bison in one character set,
14671 but compiling and/or running in an incompatible one.
14672 Warn about character code 256, too.
14673
14674 2002-04-03 Paul Eggert <eggert@twinsun.com>
14675
14676 * src/bison.data (YYSTACK_ALLOC): Depend on whether
14677 YYERROR_VERBOSE is nonzero, not whether it is defined.
14678
14679 Merge changes from bison-1_29-branch.
14680
14681 2002-03-20 Paul Eggert <eggert@twinsun.com>
14682
14683 Merge fixes from Debian bison_1.34-1.diff.
14684
14685 * configure.in (AC_PREREQ): 2.53.
14686
14687 2002-03-20 Akim Demaille <akim@epita.fr>
14688
14689 * src/conflicts.c (log_resolution): Argument `resolution' is const.
14690
14691 2002-03-19 Paul Eggert <eggert@twinsun.com>
14692
14693 * src/bison.simple (YYCOPY): New macro.
14694 (YYSTACK_RELOCATE): Use it.
14695 Remove Type arg; no longer needed. All callers changed.
14696 (yymemcpy): Remove; no longer needed.
14697
14698 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
14699 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14700
14701 2002-03-19 Akim Demaille <akim@epita.fr>
14702
14703 Test and fix the #line outputs.
14704
14705 * tests/atlocal.at (GCC): New.
14706 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
14707 (Prologue synch line, %union synch line, Postprologue synch line)
14708 (Action synch line, Epilogue synch line): New tests.
14709 * src/reader.c (parse_union_decl): Define the muscle stype_line.
14710 * data/bison.simple, data/bison.c++: Use it.
14711
14712 2002-03-19 Akim Demaille <akim@epita.fr>
14713
14714 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
14715 (Solved SR Conflicts, %expect not enough, %expect right)
14716 (%expect too much): Move to...
14717 * tests/conflicts.at: this new file.
14718
14719 2002-03-19 Akim Demaille <akim@epita.fr>
14720
14721 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14722 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
14723 that we can move to enums for instance.
14724 * src/output.c (token_definitions_output): Output a list of
14725 `token-name, token-number' instead of the #define.
14726 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
14727
14728 2002-03-14 Akim Demaille <akim@epita.fr>
14729
14730 Use Gettext 0.11.1.
14731
14732 2002-03-09 Robert Anisko <robert@lrde.epita.fr>
14733
14734 * data/bison.c++: Make the user able to add members to the generated
14735 parser by subclassing.
14736
14737 2002-03-05 Robert Anisko <robert@lrde.epita.fr>
14738
14739 * src/reader.c (read_additionnal_code): `c' should be an integer, not
14740 a character.
14741 Reported by Nicolas Tisserand and Nicolas Burrus.
14742
14743 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
14744
14745 * src/reader.c: Warn about lacking semi-colons, do not complain.
14746
14747 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
14748
14749 * data/bison.c++: Remove a debug line.
14750
14751 2002-03-04 Robert Anisko <robert@lrde.epita.fr>
14752
14753 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
14754 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
14755 provide a default implementation.
14756
14757 2002-03-04 Akim Demaille <akim@epita.fr>
14758
14759 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
14760 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
14761 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
14762 * tests/semantic.at (Parsing Guards): Similarly.
14763 * src/reader.at (readgram): Complain if the last rule is not ended
14764 with a semi-colon.
14765
14766 2002-03-04 Akim Demaille <akim@epita.fr>
14767
14768 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
14769 * src/closure.c: here.
14770 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
14771 RTC.
14772 * src/warshall.h, src/warshall.c: Remove.
14773 * tests/sets.at (Broken Closure): Adjust.
14774
14775 2002-03-04 Akim Demaille <akim@epita.fr>
14776
14777 * src/output.c (output_skeleton): tempdir is const.
14778 bytes_read is unused.
14779
14780 2002-03-04 Akim Demaille <akim@epita.fr>
14781
14782 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14783 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
14784 Update.
14785 From Michael Hayes.
14786
14787 2002-03-04 Akim Demaille <akim@epita.fr>
14788
14789 * src/closure.c (closure): `r' is unused.
14790
14791 2002-03-04 Akim Demaille <akim@epita.fr>
14792
14793 * tests/sets.at (Broken Closure): Add the ending `;'.
14794 * src/reader.at (readgram): Complain if a rule is not ended with a
14795 semi-colon.
14796
14797 2002-03-04 Akim Demaille <akim@epita.fr>
14798
14799 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
14800 (count_sr_conflicts): Use bitset_count.
14801 * src/reduce.c (inaccessable_symbols): Ditto.
14802 (bits_size): Remove.
14803 * src/warshall.h, src/warshall.c: Convert to bitsetv.
14804
14805 2002-03-04 Akim Demaille <akim@epita.fr>
14806
14807 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
14808 * src/reduce.c: Remove the `bitset_zero's following the
14809 `bitset_create's, as now it is performed by the latter.
14810
14811 2002-03-04 Akim Demaille <akim@epita.fr>
14812
14813 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
14814 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
14815 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
14816 latest sources from Michael.
14817
14818 2002-03-04 Akim Demaille <akim@epita.fr>
14819
14820 * src/output.c (output): Don't free the grammar.
14821 * src/reader.c (grammar_free): New.
14822 * src/main.c (main): Call it and don't free symtab here.
14823
14824 2002-03-04 Akim Demaille <akim@epita.fr>
14825
14826 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
14827 before returning.
14828 Reported by Benoit Perrot.
14829
14830 2002-03-04 Akim Demaille <akim@epita.fr>
14831
14832 Use bitset operations when possible, not loops over bits.
14833
14834 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
14835 bitset_or.
14836 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
14837 * src/reduce.c (useless_nonterminals): Formatting changes.
14838 * src/warshall.c (TC): Use bitset_or.
14839
14840 2002-03-04 Akim Demaille <akim@epita.fr>
14841
14842 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
14843 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
14844 Ditto.
14845
14846 2002-03-04 Akim Demaille <akim@epita.fr>
14847
14848 * src/lalr.c (F): Now a bitset*.
14849 Adjust all dependencies.
14850
14851 2002-03-04 Akim Demaille <akim@epita.fr>
14852
14853 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
14854 Adjust all dependencies.
14855
14856 2002-03-04 Akim Demaille <akim@epita.fr>
14857
14858 * src/L0.c, src/LR0.h (nstates): Be size_t.
14859 Adjust comparisons (signed vs unsigned).
14860 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
14861 bitset*.
14862 Adjust all dependencies.
14863
14864 2002-03-04 Akim Demaille <akim@epita.fr>
14865
14866 * src/closure.c (firsts): Now, also a bitset.
14867 Adjust all dependencies.
14868 (varsetsize): Remove, now unused.
14869 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
14870
14871 2002-03-04 Akim Demaille <akim@epita.fr>
14872
14873 * src/print.c: Convert to use bitset.h, not hand coded iterations
14874 over ints.
14875
14876 2002-03-04 Akim Demaille <akim@epita.fr>
14877
14878 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
14879
14880 2002-03-04 Akim Demaille <akim@epita.fr>
14881
14882 * src/closure.c (ruleset): Be a bitset.
14883 (rulesetsize): Remove.
14884
14885 2002-03-04 Akim Demaille <akim@epita.fr>
14886
14887 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14888 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
14889 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
14890 * src/closure.c (fderives): Be an array of bitsets.
14891
14892 2002-02-28 Robert Anisko <robert@lrde.epita.fr>
14893
14894 * data/bison.c++: Merge the two generated headers. Insert a copyright
14895 notice in each output file.
14896
14897 2002-02-28 Akim Demaille <akim@epita.fr>
14898
14899 * data/bison.c++: Copy the prologue of bison.simple to fetch
14900 useful M4 definitions, such as b4_header_guard.
14901
14902 2002-02-25 Akim Demaille <akim@epita.fr>
14903
14904 * src/getargs.c (version): Give the name of the authors, and use a
14905 translator friendly scheme for the bgr
14906 copyright notice.
14907
14908 2002-02-25 Akim Demaille <akim@epita.fr>
14909
14910 * src/output.c (header_output): Remove, now handled completely via
14911 M4.
14912
14913 2002-02-25 Akim Demaille <akim@epita.fr>
14914
14915 * m4/m4.m4: New, from CVS Autoconf.
14916 * configure.in: Invoke it.
14917 * src/output.c (output_skeleton): Use its result instead of the
14918 hard coded name.
14919
14920 2002-02-25 Akim Demaille <akim@epita.fr>
14921
14922 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
14923 Fileutils 4.1.5.
14924 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
14925 * src/output.c (output_skeleton): Use mkstemp to create a real
14926 temporary file.
14927 Move the filling of `skeleton' and its muscle to...
14928 (prepare): here.
14929 (output): Move the definition of the prologue muscle to...
14930 (prepare): here.
14931 * src/system.h (DEFAULT_TMPDIR): New.
14932
14933 2002-02-14 Paul Eggert <eggert@twinsun.com>
14934
14935 Remove the support for C++ namespace cleanliness; it was
14936 causing more problems than it was curing, since it didn't work
14937 properly on some nonstandard C++ compilers. This can wait
14938 for a proper C++ parser.
14939
14940 * NEWS: Document this.
14941 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
14942 of C++, as it's treated like C now.
14943 * src/bison.simple (YYSTD): Remove.
14944 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
14945 Treat C++ just like Standard C instead of trying to support
14946 namespace cleanliness.
14947
14948 2002-02-14 Akim Demaille <akim@epita.fr>
14949
14950 * tests/regression.at (else): Adjust to Andreas' change.
14951
14952 2002-02-14 Akim Demaille <akim@epita.fr>
14953
14954 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
14955
14956 2002-02-13 Andreas Schwab <schwab@suse.de>
14957
14958 * src/output.c (output_rule_data): Don't output NULL, it might
14959 not be defined yet.
14960
14961 2002-02-11 Robert Anisko <robert@lrde.epita.fr>
14962
14963 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
14964 (Copyright notice): Update.
14965
14966 2002-02-11 Akim Demaille <akim@epita.fr>
14967
14968 * tests/regression.at (%nonassoc and eof): Don't include
14969 nonportable headers.
14970
14971 2002-02-08 Robert Anisko <robert@lrde.epita.fr>
14972
14973 * data/bison.c++: Correct error recovery. Make the user able to
14974 initialize the starting location.
14975
14976 2002-02-07 Akim Demaille <akim@epita.fr>
14977
14978 * tests/input.at: New.
14979
14980 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14981
14982 * data/bison.c++: Replace some direct m4 expansions by constants. Be
14983 more consistent when naming methods and variables. Put preprocessor
14984 directives around tables only needed for debugging.
14985
14986 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14987
14988 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
14989 C++ parsers.
14990 (yy::b4_name::parse): Use print_.
14991
14992 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14993
14994 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
14995
14996 2002-02-07 Robert Anisko <robert@lrde.epita.fr>
14997
14998 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
14999 C++ parsers.
15000 (yy::b4_name::parse): Build verbose error messages, and use error_.
15001
15002 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
15003
15004 * data/bison.c++: Fix m4 quoting in comments.
15005
15006 2002-02-06 Robert Anisko <robert@lrde.epita.fr>
15007
15008 * data/bison.c++: Adjust the parser code. Fix some muscles that were
15009 not expanded by m4.
15010
15011 2002-02-05 Akim Demaille <akim@epita.fr>
15012
15013 * data/bison.c++: Adjust to the M4 back end.
15014 More is certainly needed.
15015
15016 2002-02-05 Akim Demaille <akim@epita.fr>
15017
15018 Give a try to M4 as a back end.
15019
15020 * lib/readpipe.c: New, from wdiff.
15021 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
15022 BISON_HAIRY.
15023 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
15024 specific values. Now it is m4 that performs the lookup.
15025 * src/parse-skel.y: Remove.
15026 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
15027 * src/output.c (actions_output, guards_output)
15028 (token_definitions_output): No longer keeps track of the output
15029 line number, hence remove the second argument.
15030 (guards_output): Check against the guard member of a rule, not the
15031 action member.
15032 Adjust callers.
15033 (output_skeleton): Don't look for the skeleton location, let m4 do
15034 that.
15035 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
15036 file will be used.
15037 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
15038 (prepare): Given that for the time being changesyntax is not
15039 usable in M4, rename the muscles using `-' to `_'.
15040 Define `defines_flag', `output_parser_name' and `output_header_name'.
15041 * src/output.h (actions_output, guards_output)
15042 (token_definitions_output): Adjust prototypes.
15043 * src/scan-skel.l: Instead of scanning the skeletons, it now
15044 processes the output of m4: `__oline__' and `#output'.
15045 * data/bison.simple: Adjust to be used by M4(sugar).
15046 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
15047 to date.
15048 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
15049 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
15050 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
15051 shamelessly stolen from CVS Autoconf.
15052
15053 2002-02-05 Akim Demaille <akim@epita.fr>
15054
15055 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
15056 * configure.in: Check for the declarations of free and malloc.
15057 * src/muscle_tab.c: Adjust.
15058
15059 2002-02-05 Akim Demaille <akim@epita.fr>
15060
15061 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
15062 which have no values.
15063
15064 2002-02-05 Akim Demaille <akim@epita.fr>
15065
15066 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
15067 * data/: here.
15068
15069 2002-01-29 Paul Eggert <eggert@twinsun.com>
15070
15071 * src/bison.simple (YYSIZE_T): Do not define merely because
15072 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
15073 On some platforms, <alloca.h> does not declare YYSTD (size_t).
15074
15075 2002-01-27 Akim Demaille <akim@epita.fr>
15076
15077 Fix `%nonassoc and eof'.
15078
15079 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
15080 which were not properly copied! Replace
15081 memcpy (res->errs, src->errs, src->nerrs);
15082 with
15083 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
15084 !!!
15085 * tests/regression.at (%nonassoc and eof): Adjust to newest
15086 Autotest: `.' is not in the PATH.
15087
15088 2002-01-27 Akim Demaille <akim@epita.fr>
15089
15090 * tests/sets.at (AT_EXTRACT_SETS): New.
15091 (Nullable): Use it.
15092 (Firsts): New.
15093
15094 2002-01-26 Akim Demaille <akim@epita.fr>
15095
15096 * tests/actions.at, tests/calc.at, tests/headers.at,
15097 * tests/torture.at: Adjust to the newest Autotest which no longer
15098 forces `.' in the PATH.
15099
15100 2002-01-25 Akim Demaille <akim@epita.fr>
15101
15102 * tests/regression.at (%nonassoc and eof): New.
15103 Suggested by Robert Anisko.
15104
15105 2002-01-24 Akim Demaille <akim@epita.fr>
15106
15107 Bison dumps core when trying to complain about broken input files.
15108 Reported by Cris van Pelt.
15109
15110 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
15111 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
15112 into...
15113 (Invalid inputs): Strengthen: exercise parse_percent_token.
15114
15115 2002-01-24 Robert Anisko <robert.anisko@epita.fr>
15116
15117 * src/Makefile.am: Add bison.c++.
15118 * src/bison.c++: New skeleton.
15119
15120 2002-01-21 Paolo Bonzini <bonzini@gnu.org>
15121
15122 * po/it.po: New.
15123
15124 2002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
15125
15126 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
15127
15128 2002-01-20 Marc Autret <marc@gnu.org>
15129
15130 * src/files.c (compute_output_file_names): Fix
15131
15132 2002-01-20 Marc Autret <marc@gnu.org>
15133
15134 * tests/output.at: New test.
15135 * src/files.c (compute_base_names): Don't map extensions when
15136 the YACC flag is set, use defaults.
15137 Reported by Evgeny Stambulchik.
15138
15139 2002-01-20 Marc Autret <marc@gnu.org>
15140
15141 * src/system.h: Need to define __attribute__ away for non-GCC
15142 compilers as well (i.e., the vendor C compiler).
15143 Suggested by Albert Chin-A-Young.
15144
15145 2002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
15146
15147 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
15148 canonical definition.
15149 * src/system.h: Use the canonical definition for PARAMS (avoids
15150 a conflict with the macro from lib/hash.h).
15151
15152 2002-01-11 Akim Demaille <akim@epita.fr>
15153
15154 * configure.in: Use AC_FUNC_STRNLEN.
15155 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
15156
15157 2002-01-09 Akim Demaille <akim@epita.fr>
15158
15159 * src/files.c, src/files.h (output_infix): New.
15160 (tab_extension): Remove.
15161 (compute_base_names): Compute the former, drop the latter.
15162 * src/output.c (prepare): Insert the muscles `output-infix', and
15163 `output-suffix'.
15164 * src/parse-skel.y (string, string.1): New.
15165 (section.header): Use it.
15166 (section.yacc): Remove.
15167 (prefix): Remove too.
15168 * src/scan-skel.l: Adjust.
15169 * src/bison.simple, src/bison.hairy: Adjust.
15170
15171 2002-01-09 Akim Demaille <akim@epita.fr>
15172
15173 * configure.in (WERROR_CFLAGS): Compute it.
15174 * src/Makefile.am (CFLAGS): Pass it.
15175 * tests/atlocal.in (CFLAGS): Idem.
15176 * src/files.c: Fix a few warnings.
15177 (get_extension_index): Remove, unused.
15178
15179 2002-01-08 Akim Demaille <akim@epita.fr>
15180
15181 * src/getargs.c (AS_FILE_NAME): New.
15182 (getargs): Use it to convert DOSish file names.
15183 * src/files.c (base_name): Rename as full_base_name to avoid
15184 clashes with `base_name ()'.
15185 (filename_split): New.
15186 (compute_base_names): N-th rewrite, using filename_split.
15187
15188 2002-01-08 Akim Demaille <akim@epita.fr>
15189
15190 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
15191 New, stolen from the Fileutils 4.1.
15192 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
15193 * configure.in: Check for the presence of memrchr, and of its
15194 prototype.
15195
15196 2002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
15197
15198 * lib/hash.h (__P): Added definition for this macro.
15199 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
15200 BUILT_SOURCES, to ensure they are generated first.
15201 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
15202 %error-verbose to allow bootstrapping with bison 1.30x.
15203
15204 2002-01-06 Akim Demaille <akim@epita.fr>
15205
15206 * src/reader.c (parse_braces): Don't fetch the next char, the
15207 convention is to fetch on entry.
15208 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
15209 'switch' without a following semicolon.
15210 * tests/regression.at (braces parsing): New.
15211
15212 2002-01-06 Akim Demaille <akim@epita.fr>
15213
15214 Bison is dead wrong in its RR conflict reports.
15215
15216 * tests/torture.at (GNU Cim Grammar): New.
15217 * src/conflicts.c (count_rr_conflicts): Fix.
15218
15219 2002-01-06 Akim Demaille <akim@epita.fr>
15220
15221 Creating package.m4 from configure.ac causes too many problems.
15222
15223 * tests/Makefile.am (package.m4): Create it by hand,
15224 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
15225
15226 2002-01-06 Akim Demaille <akim@epita.fr>
15227
15228 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
15229 skeleton.h.
15230
15231 2002-01-04 Paul Eggert <eggert@twinsun.com>
15232
15233 * doc/bison.texinfo (Debugging):
15234 Remove YYSTDERR; it's no longer defined or used.
15235 Also, s/cstdio.h/cstdio/.
15236
15237 2002-01-03 Akim Demaille <akim@epita.fr>
15238
15239 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
15240
15241 2002-01-03 Akim Demaille <akim@epita.fr>
15242
15243 * src/parse-skel.y (process_skeleton): Don't bind the parser's
15244 tracing code to --trace, wait for a better --trace option, with
15245 args.
15246
15247 2002-01-03 Akim Demaille <akim@epita.fr>
15248
15249 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
15250 The ISO C++ standard is extremely clear about it: stderr is
15251 considered a macro, not a regular symbol (see table 94 `Header
15252 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
15253 Therefore std:: does not apply to it. It still does with fprintf.
15254 Also, s/cstdio.h/cstdio/.
15255
15256 2002-01-03 Akim Demaille <akim@epita.fr>
15257
15258 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
15259 for non system headers.
15260
15261 2002-01-02 Akim Demaille <akim@epita.fr>
15262
15263 Equip the skeleton chain with location tracking, runtime trace,
15264 pure parser and scanner.
15265
15266 * src/parse-skel.y: Request a pure parser, locations, and prefix
15267 renaming.
15268 (%union): Having several members with the same type does not help
15269 type mismatches, simplify.
15270 (YYPRINT, yyprint): New.
15271 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
15272 (skel_error): this.
15273 Handle locations.
15274 * src/scan-skel.l: Adjust to these changes.
15275 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
15276 (LOCATION_PRINT, skel_control_t): New.
15277
15278 2001-12-30 Akim Demaille <akim@epita.fr>
15279
15280 * src/parse-skel.y: Get rid of the shift/reduce conflict:
15281 replace `gb' with BLANKS.
15282 * src/scan-skel.l: Adjust.
15283
15284 2001-12-30 Akim Demaille <akim@epita.fr>
15285
15286 * src/system.h: We don't need nor want bcopy.
15287 Throw away MS-DOS crap: we don't need getpid.
15288 * configure.in: We don't need strndup. It was even causing
15289 problems: because Flex includes the headers *before* us,
15290 _GNU_SOURCE is not defined by config.h, and therefore strndup was
15291 not visible.
15292 * lib/xstrndup.c: New.
15293 * src/scan-skel.l: Use it.
15294 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
15295 * src/parse-skel.y: Use %directives instead of #defines.
15296
15297 2001-12-30 Akim Demaille <akim@epita.fr>
15298
15299 * src/skeleton.h: New.
15300 * src/output.c (output_parser, output_master_parser): Remove, dead
15301 code.
15302 * src/output.h (get_lines_number, actions_output, guards_output)
15303 (token_definitions_output): Prototype them.
15304 * src/parse-skel.y: Add the license notice.
15305 Include output.h and skeleton.h.
15306 (process_skeleton): Returns void, and takes a single parameter.
15307 * src/scan-skel.l: Add the license notice.
15308 Include skeleton.h.
15309 Don't use %option yylineno: it seems that then Flex imagines
15310 REJECT has been used, and therefore it won't reallocate its
15311 buffers (which makes no other sense to me than a bug). It results
15312 in warnings for `unused: yy_flex_realloc'.
15313
15314 2001-12-30 Robert Anisko <robert.anisko@epita.fr>
15315
15316 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15317 (MUSCLE_INSERT_PREFIX): ...to there.
15318 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15319 (MUSCLE_INSERT_PREFIX): Move from here...
15320
15321 * src/bison.hairy: Add a section directive. Put braces around muscle
15322 names. This parser skeleton is still broken, but Bison should not
15323 choke on a bad muscle 'syntax'.
15324 * src/bison.simple: Add a section directive. Put braces around muscle
15325 names.
15326
15327 * src/files.h (strsuffix, stringappend): Add declarations.
15328 (tab_extension): Add declaration.
15329 (short_base_name): Add declaration.
15330
15331 * src/files.c (strsuffix, stringappend): No longer static. These
15332 functions are used in the skeleton parser.
15333 (tab_extension): New.
15334 (compute_base_names): Use the computations done in this function
15335 to guess if the generated parsers should have '.tab' in their
15336 names.
15337 (short_base_name): No longer static.
15338
15339 * src/output.c (output_skeleton): New.
15340 (output): Disable call to output_master_parser, and give a try to
15341 a new skeleton handling system.
15342 (guards_output, actions_output): No longer static.
15343 (token_definitions_output, get_lines_number): No longer static.
15344
15345 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
15346
15347 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
15348 parse-skel.y.
15349
15350 * src/parse-skel.y: New file.
15351 * src/scan-skel.l: New file.
15352
15353 2001-12-29 Akim Demaille <akim@epita.fr>
15354
15355 %name-prefix is broken.
15356
15357 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
15358 Adjust all dependencies.
15359 * tests/headers.at (export YYLTYPE): Strengthen this test: use
15360 %name-prefix.
15361
15362 Renaming yylval but not yylloc is not consistent. Now we do.
15363
15364 * src/bison.simple: Prefix yylloc if used.
15365 * doc/bison.texinfo (Decl Summary): Document that.
15366
15367 2001-12-29 Akim Demaille <akim@epita.fr>
15368
15369 * doc/bison.texinfo: Promote `%long-directive' over
15370 `%long_directive'.
15371 Remove all references to fixed-output-files, yacc is enough.
15372
15373 2001-12-29 Akim Demaille <akim@epita.fr>
15374
15375 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
15376 user prologue. These are defaults.
15377 * tests/actions.at (Mid-rule actions): Make sure the user can
15378 define YYDEBUG and YYERROR_VERBOSE.
15379
15380 2001-12-29 Akim Demaille <akim@epita.fr>
15381
15382 * src/output.c (header_output): Don't forget to export YYLTYPE and
15383 yylloc.
15384 * tests/headers.at (export YYLTYPE): New, make sure it does.
15385 * tests/regression.at (%union and --defines, Invalid CPP headers):
15386 Move to...
15387 * tests/headers.at: here.
15388
15389 2001-12-29 Akim Demaille <akim@epita.fr>
15390
15391 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
15392
15393 2001-12-29 Akim Demaille <akim@epita.fr>
15394
15395 * tests/actions.at (Mid-rule actions): Output on a single line
15396 instead of several.
15397
15398 2001-12-29 Akim Demaille <akim@epita.fr>
15399
15400 * doc/bison.texinfo: Formatting changes.
15401
15402 2001-12-29 Akim Demaille <akim@epita.fr>
15403
15404 Don't store the token defs in a muscle, just be ready to output it
15405 on command. Now possible via `symbols'. Fixes a memory leak.
15406
15407 * src/output.c (token_definitions_output): New.
15408 (output_parser, header_output): Use it.
15409 * src/reader.c (symbols_save): Remove.
15410
15411 2001-12-29 Akim Demaille <akim@epita.fr>
15412
15413 * src/bison.simple: Do not provide a default for YYSTYPE and
15414 YYLTYPE before the user's prologue. Otherwise it's hardly... a
15415 default.
15416
15417 2001-12-29 Akim Demaille <akim@epita.fr>
15418
15419 Mid-rule actions are simply... ignored!
15420
15421 * src/reader.c (readgram): Be sure to attach mid-rule actions to
15422 the empty-rule associated to the dummy symbol, not to the host
15423 rule.
15424 * tests/actions.at (Mid-rule actions): New.
15425
15426 2001-12-29 Akim Demaille <akim@epita.fr>
15427
15428 Memory leak.
15429
15430 * src/reader.c (reader): Free grammar.
15431
15432 2001-12-29 Akim Demaille <akim@epita.fr>
15433
15434 Memory leak.
15435
15436 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
15437 since it allocates it for each state, although only one is needed.
15438 (allocate_storage): Do it here.
15439
15440 2001-12-29 Akim Demaille <akim@epita.fr>
15441
15442 * src/options.h, src/options.c (create_long_option_table): Rename
15443 as...
15444 (long_option_table_new): this, with a clearer prototype.
15445 (percent_table): Remove, unused,
15446 * src/getargs.c (getargs): Adjust.
15447
15448 2001-12-29 Akim Demaille <akim@epita.fr>
15449
15450 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
15451 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
15452 as states.
15453
15454 2001-12-29 Akim Demaille <akim@epita.fr>
15455
15456 * src/lalr.c (build_relations): Rename `states' as `states1'.
15457 Sorry, I don't understand exactly what it is, no better name...
15458
15459 2001-12-29 Akim Demaille <akim@epita.fr>
15460
15461 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
15462 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
15463 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
15464 as rules.
15465
15466 2001-12-29 Akim Demaille <akim@epita.fr>
15467
15468 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
15469 ago.
15470
15471 2001-12-29 Akim Demaille <akim@epita.fr>
15472
15473 * src/reader.c, src/reader.h (user_toknums): Remove.
15474 Adjust all users to use symbols[i]->user_token_number.
15475
15476 2001-12-29 Akim Demaille <akim@epita.fr>
15477
15478 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
15479 Adjust all users to use symbols[i]->prec or ->assoc.
15480
15481 2001-12-29 Akim Demaille <akim@epita.fr>
15482
15483 * src/reader.c, src/reader.h (tags): Remove.
15484 Adjust all users to use symbols[i]->tag.
15485
15486 2001-12-29 Akim Demaille <akim@epita.fr>
15487
15488 * src/gram.h, src/gram.c (symbols): New, similar to state_table
15489 and rule_table.
15490 * src/reader.c (packsymbols): Fill this table.
15491 Drop sprec.
15492 * src/conflicts.c (resolve_sr_conflict): Adjust.
15493 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
15494 single table.
15495 Use symbols[i]->tag instead of tags[i].
15496
15497 2001-12-29 Akim Demaille <akim@epita.fr>
15498
15499 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
15500 In addition, put a comment in there, to replace...
15501 * tests/regression.at (%union and C comments): Remove.
15502
15503 2001-12-29 Akim Demaille <akim@epita.fr>
15504
15505 * tests/regression.at (Web2c Actions): Blindly move the actual
15506 output as expected output. The contents *seem* right to me, but I
15507 can't pretend reading perfectly parser tables... Nonetheless, all
15508 the other tests pass correctly, the table look OK, even though the
15509 presence of `$axiom' is to be noted: AFAICS it is useless (but
15510 harmless).
15511
15512 2001-12-29 Akim Demaille <akim@epita.fr>
15513
15514 * src/reader.c (readgram): Don't add the rule 0 if there were no
15515 rules read. In other words, add it _after_ having performed
15516 grammar sanity checks.
15517 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
15518
15519 2001-12-29 Akim Demaille <akim@epita.fr>
15520
15521 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
15522 visible, and some states have now a different number.
15523
15524 2001-12-29 Akim Demaille <akim@epita.fr>
15525
15526 * src/reader.c (readgram): Bind the initial rule's lineno to that
15527 of the first rule.
15528 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
15529 (Solved SR Conflicts): Adjust rule 0's line number.
15530
15531 2001-12-29 Akim Demaille <akim@epita.fr>
15532
15533 Fix the `GAWK Grammar' failure.
15534
15535 * src/LR0.c (final_state): Initialize to -1 so that we do compute
15536 the reductions of the first state which was mistakenly confused
15537 with the final state because precisely final_state was initialized
15538 to 0.
15539 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
15540 now noticed by Bison.
15541 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
15542 have a reduction on $default.
15543
15544 2001-12-29 Akim Demaille <akim@epita.fr>
15545
15546 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
15547 rule line numbers.
15548 * src/closure.c (print_closure): Likewise.
15549 * src/derives.c (print_derives): Likewise.
15550 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
15551 now.
15552
15553 2001-12-29 Akim Demaille <akim@epita.fr>
15554
15555 * src/lalr.c (lookaheads_print): New.
15556 (lalr): Call it when --trace-flag.
15557 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
15558 are dumped.
15559
15560 2001-12-29 Akim Demaille <akim@epita.fr>
15561
15562 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
15563 when walking through ritem, even via rule->rhs.
15564 * src/reduce.c (dump_grammar, useful_production, reduce_output)
15565 (useful_production, useless_nonterminals): Likewise.
15566 (reduce_grammar_tables): Likewise, plus update nritems.
15567 * src/nullable.c (set_nullable): Likewise.
15568 * src/lalr.c (build_relations): Likewise.
15569 * tests/sets.at (Nullable): Adjust.
15570 Fortunately, now, the $axiom is no longer nullable.
15571
15572 2001-12-29 Akim Demaille <akim@epita.fr>
15573
15574 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
15575 the 0-sentinel.
15576 * src/gram.c (ritem_longest_rhs): Likewise.
15577 * src/reduce.c (nonterminals_reduce): Likewise.
15578 * src/print_graph.c (print_graph): Likewise.
15579 * src/output.c (output_rule_data): Likewise.
15580 * src/nullable.c (set_nullable): Likewise.
15581
15582 2001-12-29 Akim Demaille <akim@epita.fr>
15583
15584 * src/output.c: Comment changes.
15585
15586 2001-12-27 Paul Eggert <eggert@twinsun.com>
15587
15588 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
15589 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
15590 Sparc, as they were causing more porting problems than the
15591 (minor) performance improvement was worth.
15592
15593 Also, catch up with 1.31's YYSTD.
15594
15595 2001-12-27 Akim Demaille <akim@epita.fr>
15596
15597 * src/output.c (output_gram): Rely on nritems, not the
15598 0-sentinel. See below.
15599 Use -1 as separator, not 0.
15600 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
15601 Rely on -1 as separator in yyrhs, instead of 0.
15602 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
15603 twice `Now at end of input', therefore there are two lines less to
15604 expect.
15605
15606 2001-12-27 Akim Demaille <akim@epita.fr>
15607
15608 * tests/regression.at (Unresolved SR Conflicts):
15609 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
15610 below.
15611
15612 2001-12-27 Akim Demaille <akim@epita.fr>
15613
15614 * src/LR0.c (new_state): Recognize the final state by the fact it
15615 is reached by eoftoken.
15616 (insert_start_shifting_state, insert_eof_shifting_state)
15617 (insert_accepting_state, augment_automaton): Remove, since now
15618 these states are automatically computed from the initial state.
15619 (generate_states): Adjust.
15620 * src/print.c: When reporting a rule number to the user, substract
15621 1, so that the axiom rule is rule 0, and the first user rule is 1.
15622 * src/reduce.c: Likewise.
15623 * src/print_graph.c (print_core): For the time being, just as for
15624 the report, depend upon --trace-flags to dump the full set of
15625 items.
15626 * src/reader.c (readgram): Once the grammar read, insert the rule
15627 0: `$axiom: START-SYMBOL $'.
15628 * tests/set.at: Adjust: rule 0 is now displayed, and since the
15629 number of the states has changed (the final state is no longer
15630 necessarily the last), catch up.
15631
15632 2001-12-27 Akim Demaille <akim@epita.fr>
15633
15634 Try to make the use of the eoftoken valid. Given that its value
15635 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
15636 is used instead of > 0 where appropriate, (ii), depend upon nritems
15637 instead of the 0-sentinel.
15638
15639 * src/gram.h, src/gram.c (nritems): New.
15640 Expected to be duplication of nitems, but for the time being...
15641 * src/reader.c (packgram): Assert nritems and nitems are equal.
15642 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
15643 * src/closure.c (print_closure, print_fderives): Likewise.
15644 * src/gram.c (ritem_print): Likewise.
15645 * src/print.c (print_core, print_grammar): Likewise.
15646 * src/print_graph.c: Likewise.
15647
15648 2001-12-27 Akim Demaille <akim@epita.fr>
15649
15650 * src/main.c (main): If there are complains after grammar
15651 reductions, then output the report anyway if requested, then die.
15652 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
15653 * src/reader.c (eoftoken): New.
15654 (parse_token_decl): If the token being defined has value `0', it
15655 is the eoftoken.
15656 (packsymbols): No longer hack `tags' to insert `$' by hand.
15657 Be sure to preserve the value of the eoftoken.
15658 (reader): Make sure eoftoken is defined.
15659 Initialize nsyms to 0: now eoftoken is created just like the others.
15660 * src/print.c (print_grammar): Don't special case the eof token.
15661 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
15662 lie anyway, albeit pleasant.
15663 * tests/calc.at: Exercise error messages with eoftoken.
15664 Change the grammar so that empty input is invalid.
15665 Adjust expectations.
15666 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
15667
15668 2001-12-27 Akim Demaille <akim@epita.fr>
15669
15670 * configure.in: Check the protos of strchr ans strspn.
15671 Replace strchr if needed.
15672 * src/system.h: Provide the protos of strchr, strspn and memchr if
15673 missing.
15674 * lib/strchr.c: New.
15675 * src/reader.c (symbols_save): Use strchr.
15676
15677 2001-12-27 Akim Demaille <akim@epita.fr>
15678
15679 * src/print.c, src/print_graph.c (escape): New.
15680 Use it to quote the TAGS outputs.
15681 * src/print_graph.c (print_state): Now errors are in red, and
15682 reductions in green.
15683 Prefer high to wide: output the state number on a line of its own.
15684
15685 2001-12-27 Akim Demaille <akim@epita.fr>
15686
15687 * src/state.h, src/state.c (reductions_new): New.
15688 * src/LR0.c (set_state_table): Let all the states have a
15689 `reductions', even if reduced to 0.
15690 (save_reductions): Adjust.
15691 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
15692 * src/print.c (print_reductions, print_actions): Adjust.
15693 * src/output.c (action_row): Adjust.
15694
15695 2001-12-27 Akim Demaille <akim@epita.fr>
15696
15697 * src/state.h, src/state.c (errs_new, errs_dup): New.
15698 * src/LR0.c (set_state_table): Let all the states have an errs,
15699 even if reduced to 0.
15700 * src/print.c (print_errs, print_reductions): Adjust.
15701 * src/output.c (output_actions, action_row): Adjust.
15702 * src/conflicts.c (resolve_sr_conflict): Adjust.
15703
15704 2001-12-27 Akim Demaille <akim@epita.fr>
15705
15706 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
15707
15708 2001-12-27 Akim Demaille <akim@epita.fr>
15709
15710 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
15711 * src/print.c: here.
15712 (lookaheadset, shiftset): New, used as additional storage by
15713 print_reductions.
15714 (print_results): Adjust.
15715 (print_shifts, print_gotos, print_errs): New, extracted from...
15716 (print_actions): here.
15717 * src/print_graph.c (print_actions): Remove dead code.
15718
15719 2001-12-27 Akim Demaille <akim@epita.fr>
15720
15721 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
15722 `$n' and `@n'.
15723
15724 2001-12-27 Akim Demaille <akim@epita.fr>
15725
15726 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
15727 (build_relations): Adjust.
15728
15729 2001-12-27 Akim Demaille <akim@epita.fr>
15730
15731 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
15732 duplication.
15733
15734 2001-12-27 Akim Demaille <akim@epita.fr>
15735
15736 * src/reader.c (packgram): Catch nitems overflows.
15737
15738 2001-12-27 Akim Demaille <akim@epita.fr>
15739
15740 * src/files.c, src/files.h (guard_obstack): Remove.
15741 * src/output.c (output): Adjust.
15742 * src/reader.c (parse_braces): New, factoring...
15743 (copy_action, copy_guard): these two which are renamed as...
15744 (parse_action, parse_guard): these.
15745 As a voluntary consequence, using braces around guards is now
15746 mandatory.
15747
15748 2001-12-27 Akim Demaille <akim@epita.fr>
15749
15750 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
15751 * src/reader.c (symbol_list): `guard' and `guard_line' are new
15752 members.
15753 (symbol_list_new): Adjust.
15754 (copy_action): action_line is the first line, not the last.
15755 (copy_guard): Just as for actions, store the `action' only, not
15756 the switch/case/break flesh.
15757 Don't parse the user action that might follow the guard, let...
15758 (readgram): do it, i.e., now, there can be an action after a
15759 guard.
15760 In other words the guard is just explicitly optional.
15761 (packgram): Adjust.
15762 * src/output.c (guards_output): New.
15763 (output_parser): Call it when needed.
15764 (output): Also free the guard and attrs obstacks.
15765 * src/files.c, src/files.h (obstack_save): Remove.
15766 (output_files): Remove.
15767 As a result, if one needs the former `.act' file, using an
15768 appropriate skeleton which requires actions and guards is now
15769 required.
15770 * src/main.c (main): Adjust.
15771 * tests/semantic.at: New.
15772 * tests/regression.at: Use `input.y' as input file name.
15773 Avoid 8+3 problems by requiring input.c when the test needs the
15774 parser.
15775
15776 2001-12-27 Akim Demaille <akim@epita.fr>
15777
15778 * src/reader.c (symbol_list_new): Be sure to initialize all the
15779 fields.
15780
15781 2001-12-27 Akim Demaille <akim@epita.fr>
15782
15783 All the hacks using a final pseudo state are now useless.
15784
15785 * src/LR0.c (set_state_table): state_table holds exactly nstates.
15786 * src/lalr.c (nLA): New.
15787 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
15788 instead of lookaheadsp from the pseudo state (nstate + 1).
15789
15790 2001-12-27 Akim Demaille <akim@epita.fr>
15791
15792 * src/output.c (action_row, token_actions): Use a state_t instead
15793 of a integer, and nlookaheads instead of the following state's
15794 lookaheadsp.
15795
15796 2001-12-27 Akim Demaille <akim@epita.fr>
15797
15798 * src/conflicts.c (log_resolution, flush_shift)
15799 (resolve_sr_conflict, set_conflicts, solve_conflicts)
15800 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
15801 (conflicts_print, print_reductions): Use a state_t instead of an
15802 integer when referring to a state.
15803 As much as possible, depend upon nlookaheads, instead of the
15804 `lookaheadsp' member of the following state (since lookaheads of
15805 successive states are successive, the difference between state n + 1
15806 and n served as the number of lookaheads for state n).
15807 * src/lalr.c (add_lookback_edge): Likewise.
15808 * src/print.c (print_core, print_actions, print_state)
15809 (print_results): Likewise.
15810 * src/print_graph.c (print_core, print_actions, print_state)
15811 (print_graph): Likewise.
15812 * src/conflicts.h: Adjust.
15813
15814 2001-12-27 Akim Demaille <akim@epita.fr>
15815
15816 * src/bison.hairy: Formatting/comment changes.
15817 ANSIfy.
15818 Remove `register' indications.
15819 Add plenty of `static'.
15820
15821 2001-12-27 Akim Demaille <akim@epita.fr>
15822
15823 * src/output.c (prepare): Drop the muscle `ntbase' which
15824 duplicates ntokens.
15825 * src/bison.simple: Formatting/comment changes.
15826 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
15827 is an undocumented synonym.
15828
15829 2001-12-22 Akim Demaille <akim@epita.fr>
15830
15831 * src/output.c (output_table_data): Change the prototype to use
15832 `int' for array ranges: some invocations do pass an int, not a
15833 short.
15834 Reported by Wayne Green.
15835
15836 2001-12-22 Akim Demaille <akim@epita.fr>
15837
15838 Some actions of web2c.y are improperly triggered.
15839 Reported by Mike Castle.
15840
15841 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
15842 * tests/regression.at (Web2c): Rename as...
15843 (Web2c Report): this.
15844 (Web2c Actions): New.
15845
15846 2001-12-22 Akim Demaille <akim@epita.fr>
15847
15848 Reductions in web2c.y are improperly reported.
15849 Reported by Mike Castle.
15850
15851 * src/conflicts.c (print_reductions): Fix.
15852 * tests/regression.at (Web2c): New.
15853
15854 2001-12-18 Akim Demaille <akim@epita.fr>
15855
15856 Some host fail on `assert (!"foo")', which expands to
15857 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
15858 Reported by Nelson Beebee.
15859
15860 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
15861 `#define it_succeeded 0' and `assert (it_succeeded)'.
15862
15863 2001-12-17 Marc Autret <autret_m@epita.fr>
15864
15865 * src/bison.simple: Don't hard code the skeleton line and filename.
15866 * src/output.c (output_parser): Rename 'line' as 'output_line'.
15867 New line counter 'skeleton_line' (skeleton-line muscle).
15868
15869 2001-12-17 Paul Eggert <eggert@twinsun.com>
15870
15871 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
15872 YYDEBUG must be defined to a nonzero value.
15873
15874 * src/bison.simple (yytname): Do not assume that the user defines
15875 YYDEBUG to a properly parenthesized expression.
15876
15877 2001-12-17 Akim Demaille <akim@epita.fr>
15878
15879 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
15880 nlookaheads is a new member.
15881 Adjust all users.
15882 * src/lalr.h (nlookaheads): Remove this orphan declaration.
15883 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
15884 state.
15885
15886 2001-12-17 Akim Demaille <akim@epita.fr>
15887
15888 * src/files.h, src/files.c (open_files, close_files): Remove.
15889 * src/main.c (main): Don't open/close files, nor invoke lex_free,
15890 let...
15891 * src/reader.c (reader): Do it.
15892
15893 2001-12-17 Akim Demaille <akim@epita.fr>
15894
15895 * src/conflicts.c (print_reductions): Formatting changes.
15896
15897 2001-12-17 Akim Demaille <akim@epita.fr>
15898
15899 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
15900 (flush_reduce): New.
15901 (resolve_sr_conflict): Adjust.
15902
15903 2001-12-17 Akim Demaille <akim@epita.fr>
15904
15905 * src/output.c (output_obstack): Be static and rename as...
15906 (format_obstack): this, to avoid any confusion with files.c's
15907 output_obstack.
15908 * src/reader.h (muscle_obstack): Move to...
15909 * src/output.h: here, since it's defined in output.c.
15910
15911 2001-12-17 Akim Demaille <akim@epita.fr>
15912
15913 * src/output.c (action_row, save_column, default_goto)
15914 (sort_actions, matching_state, pack_vector): Better variable
15915 locality.
15916
15917 2001-12-17 Akim Demaille <akim@epita.fr>
15918
15919 * src/output.c: Various formatting changes.
15920
15921 2001-12-17 Akim Demaille <akim@epita.fr>
15922
15923 * src/files.c (output_files): Free the output_obstack.
15924 * src/main.c (main): Call print and print_graph conditionally.
15925 * src/print.c (print): Work unconditionally.
15926 * src/print_graph.c (print_graph): Work unconditionally.
15927 * src/conflicts.c (log_resolution): Output only if verbose_flag.
15928
15929 2001-12-16 Marc Autret <autret_m@epita.fr>
15930
15931 * src/output.c (actions_output): Fix. When we use %no-lines,
15932 there is one less line per action.
15933
15934 2001-12-16 Marc Autret <autret_m@epita.fr>
15935
15936 * src/bison.simple: Remove a useless #line directive.
15937 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
15938 * src/output.c (get_lines_number): New.
15939 (output_parser): Adjust, now takes care about the lines of a
15940 output muscles.
15941 Fix line numbering.
15942 (actions_output): Computes the number of lines taken by actions.
15943 (output_master_parser): Insert new skeleton which is the name of
15944 the output parser file name.
15945
15946 2001-12-15 Marc Autret <autret_m@epita.fr>
15947
15948 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
15949
15950 2001-12-15 Marc Autret <autret_m@epita.fr>
15951
15952 * src/output.c (output_gram): Keep track of the hairy one.
15953
15954 2001-12-15 Akim Demaille <akim@epita.fr>
15955
15956 Make `make distcheck' work.
15957
15958 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
15959 system.h which uses libgettext.h.
15960
15961 2001-12-15 Akim Demaille <akim@epita.fr>
15962
15963 * src/nullable.c (set_nullable): Useless rules must be skipped,
15964 otherwise, since we range over their symbols, we might look at a
15965 nonterminal which no longer ``exists'', i.e., it is not counted in
15966 `nvars', hence we overflow our arrays.
15967
15968 2001-12-15 Akim Demaille <akim@epita.fr>
15969
15970 The header can also be produced directly, without any obstack!
15971 Yahoo!
15972
15973 * src/files.c, src/files.h (defines_obstack): Remove.
15974 (compute_header_macro): Global.
15975 (defines_obstack_save): Remove.
15976 * src/reader.c (parse_union_decl): No longer output to
15977 defines_obstack: its content can be found in the `stype' muscle
15978 anyway.
15979 (output_token_translations): Merge into...
15980 (symbols_output): this.
15981 Rename as...
15982 (symbols_save): this.
15983 (reader): Adjust.
15984 * src/output.c (header_output): New.
15985 (output): Call it.
15986
15987 2001-12-15 Akim Demaille <akim@epita.fr>
15988
15989 * src/reader.c (parse_union_decl): Instead of handling two obstack
15990 simultaneously, use one to define the `stype' muscle, and use the
15991 value of the latter to fill defines_obstack.
15992 (copy_comment): Remove.
15993 (copy_comment2): Work for a single obstack.
15994 Rename as...
15995 (copy_comment): this.
15996
15997 2001-12-15 Akim Demaille <akim@epita.fr>
15998
15999 * src/lex.c, src/lex.h (xgetc): No longer static.
16000 * src/reader.c (parse_union_decl): Revamp.
16001
16002 2001-12-15 Akim Demaille <akim@epita.fr>
16003
16004 Still making progress in separating Bison into (i) input, (ii)
16005 process, (iii) output: now we can directly output the parser file
16006 without using table_obstack at all.
16007
16008 * src/files.c, src/files.h (table_obstack): Bye bye.
16009 (parser_file_name): New.
16010 * src/files.c (compute_output_file_names): Compute it.
16011 * src/output.c (actions_output, output_parser)
16012 (output_master_parser): To a file instead of an obstack.
16013
16014 2001-12-15 Akim Demaille <akim@epita.fr>
16015
16016 Attach actions to rules, instead of pre-outputting them to
16017 actions_obstack.
16018
16019 * src/gram.h (rule_t): action and action_line are new members.
16020 * src/reader.c (symbol_list): Likewise.
16021 (copy_action): Save the actions within the rule.
16022 (packgram): Save them in rule_table.
16023 * src/output.c (actions_output): New.
16024 (output_parser): Use it on `%%actions'.
16025 (output_rule_data): Don't free rule_table.
16026 (output): Do it.
16027 (prepare): Don't save the `action' muscle.
16028 * src/bison.simple: s/%%action/%%actions/.
16029
16030 2001-12-15 Akim Demaille <akim@epita.fr>
16031
16032 * src/reader.c (copy_action): When --yacc, don't append a `;'
16033 to the user action: let it fail if lacking.
16034 Suggested by Arnold Robbins and Tom Tromey.
16035
16036 2001-12-14 Akim Demaille <akim@epita.fr>
16037
16038 * src/lex.c (literalchar): Simply return the char you decoded, non
16039 longer mess around with obstacks and int pointers.
16040 Adjust all callers.
16041
16042 2001-12-14 Akim Demaille <akim@epita.fr>
16043
16044 * src/lex.c (literalchar): Don't escape the special characters,
16045 just decode them, and keep them as char (before, eol was output as
16046 the 2 char string `\n' etc.).
16047 * src/output.c (output_rule_data): Use quotearg to output the
16048 token strings.
16049
16050 2001-12-13 Paul Eggert <eggert@twinsun.com>
16051
16052 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
16053 Do not infringe on the global user namespace when using C++.
16054 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
16055 All uses of `fprintf' and `stderr' changed.
16056
16057 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
16058
16059 2001-12-13 Akim Demaille <akim@epita.fr>
16060
16061 The computation of nullable is broken: it doesn't handle empty
16062 RHS's properly.
16063
16064 * tests/torture.at (GNU AWK Grammar): New.
16065 * tests/sets.at (Nullable): New.
16066 * src/nullable.c (set_nullable): Instead of blindly looping over
16067 `ritems', loop over the rules, and then over their rhs's.
16068
16069 Work around Autotest bugs.
16070
16071 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
16072 frame, because Autotest understand lines starting with a `+' as
16073 traces from the shell. Then, they are not processed properly.
16074 Admittedly an Autotest bug, but we don't have time to wait for
16075 Autotest to catch up.
16076 * tests/regression.at (Broken Closure): Adjust to the new table
16077 frames.
16078 Move to...
16079 * tests/sets.at: here.
16080
16081 2001-12-13 Akim Demaille <akim@epita.fr>
16082
16083 * src/closure.c (closure): Use nrules instead of playing tricks
16084 with BITS_PER_WORD.
16085
16086 2001-12-13 Akim Demaille <akim@epita.fr>
16087
16088 * src/print.c (print_actions): Output the handling of `$' as the
16089 traces do: shifting the token EOF. Before EOF was treated as a
16090 nonterminal.
16091 * tests/regression.at: Adjust some tests.
16092 * src/print_graph.c (print_core): Complete the set of items via
16093 closure. The next-to-final and final states are still unsatisfying,
16094 but that's to be addressed elsewhere.
16095 No longer output the rule numbers, but do output the state number.
16096 A single loop for the shifts + gotos is enough, but picked a
16097 distinct color for each.
16098 (print_graph): Initialize and finalize closure.
16099
16100 2001-12-13 Akim Demaille <akim@epita.fr>
16101
16102 * src/reader.c (readgram): Remove dead code, an strip useless
16103 braces.
16104 (get_type): Remove, unused.
16105
16106 2001-12-12 Akim Demaille <akim@epita.fr>
16107
16108 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
16109 on that of lib/error.c.
16110
16111 2001-12-12 Akim Demaille <akim@epita.fr>
16112
16113 Some hosts don't like `/' in includes.
16114
16115 * src/system.h: Include libgettext.h without qualifying the path.
16116 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
16117 $(top_srcdir).
16118
16119 2001-12-11 Marc Autret <autret_m@epita.fr>
16120
16121 * src/output.c (output_parser): Remove useless muscle.
16122
16123 2001-12-11 Marc Autret <autret_m@epita.fr>
16124
16125 * src/bison.simple: Remove #line just before %%epilogue. It
16126 is now handled in ...
16127 * src/reader.c (read_additionnal_code): Add the output of a
16128 #line for the epilogue.
16129
16130 2001-12-10 Marc Autret <autret_m@epita.fr>
16131
16132 * src/reader.c (copy_definition): Re-use CPP-outed code which
16133 replace precedent remove.
16134 * src/bison.simple: Remove #line before %%prologue because
16135 %%input-line is wrong at this time.
16136
16137 2001-12-10 Marc Autret <autret_m@epita.fr>
16138
16139 * src/reader.c (symbols_output): Clean up.
16140 * src/output.c (output_gram, output): Clean up.
16141
16142 2001-12-10 Akim Demaille <akim@epita.fr>
16143
16144 * src/lalr.c (initialize_lookaheads): New. Extracted from...
16145 * src/LR0.c (set_state_table): here.
16146 * src/lalr.c (lalr): Call it.
16147
16148 2001-12-10 Akim Demaille <akim@epita.fr>
16149
16150 * src/state.h (shifts): Remove the `number' member: shifts are
16151 attached to state, hence no longer need to be labelled with a
16152 state number.
16153
16154 2001-12-10 Akim Demaille <akim@epita.fr>
16155
16156 Now that states have a complete set of members, the linked list of
16157 shifts is useless: just fill directly the state's shifts member.
16158
16159 * src/state.h (shifts): Remove the `next' member.
16160 * src/LR0.c (first_state, last_state): Remove.
16161 Adjust the callers.
16162 (augment_automaton): Don't look for the shifts that must be added
16163 a shift on EOF: it is those of the state we looked for! But now,
16164 since shifts are attached, it is no longer needed to looking
16165 merely by its id: its number.
16166
16167 2001-12-10 Akim Demaille <akim@epita.fr>
16168
16169 * src/LR0.c (augment_automaton): Better variable locality.
16170 Remove an impossible branch: if there is a state corresponding to
16171 the start symbol being shifted, then there is shift for the start
16172 symbol from the initial state.
16173
16174 2001-12-10 Akim Demaille <akim@epita.fr>
16175
16176 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
16177 only when appropriate: when insert_start_shifting_state' is not
16178 invoked.
16179 * tests/regression.at (Rule Line Numbers): Adjust.
16180
16181 2001-12-10 Akim Demaille <akim@epita.fr>
16182
16183 * src/LR0.c (augment_automaton): Now that all states have shifts,
16184 merge the two cases addition shifts to the initial state.
16185
16186 2001-12-10 Akim Demaille <akim@epita.fr>
16187
16188 * src/lalr.c (set_state_table): Move to...
16189 * src/LR0.c: here.
16190 * src/lalr.c (lalr): Don't call it...
16191 * src/LR0.c (generate_states): do it.
16192 * src/LR0.h (first_state): Remove, only the table is used.
16193
16194 2001-12-10 Akim Demaille <akim@epita.fr>
16195
16196 * src/LR0.h (first_shift, first_reduction): Remove.
16197 * src/lalr.c: Don't use first_shift: find shifts through the
16198 states.
16199
16200 2001-12-10 Akim Demaille <akim@epita.fr>
16201
16202 * src/LR0.c: Attach shifts to states as soon as they are
16203 computed.
16204 * src/lalr.c (set_state_table): Instead of assigning shifts to
16205 state, just assert that the mapping was properly done.
16206
16207 2001-12-10 Akim Demaille <akim@epita.fr>
16208
16209 * src/LR0.c (insert_start_shift): Rename as...
16210 (insert_start_shifting_state): this.
16211 (insert_eof_shifting_state, insert_accepting_state): New.
16212 (augment_automaton): Adjust.
16213 Better locality of the variables.
16214 When looking if the start_symbol is shifted from the initial
16215 state, using `while (... symbol != start_symbol ...)' sounds
16216 better than `while (... symbol < start_symbol ...)': If fail
16217 to see how the order between symbols could be relevant!
16218
16219 2001-12-10 Akim Demaille <akim@epita.fr>
16220
16221 * src/getargs.h: Don't declare `spec_name_prefix' and
16222 `spec_file_prefix', declared by src/files.h.
16223 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
16224 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
16225 * src/output.c (prepare): Adjust.
16226 * src/reader.c (symbols_output): Likewise.
16227 * src/vmsgetargs.c: Vaguely adjust, but who cares?
16228
16229 2001-12-10 Akim Demaille <akim@epita.fr>
16230
16231 * src/muscle_tab.c (muscle_init): NULL is a better default than
16232 `"0"'.
16233
16234 2001-12-10 Akim Demaille <akim@epita.fr>
16235
16236 * src/reader.c (reader): Calling symbols_output once is enough.
16237
16238 2001-12-10 Akim Demaille <akim@epita.fr>
16239
16240 Now that states have a complete set of members, the linked list of
16241 reductions is useless: just fill directly the state's reductions
16242 member.
16243
16244 * src/state.h (struct reductions): Remove member `number' and
16245 `next'.
16246 * src/LR0.c (first_reduction, last_reduction): Remove.
16247 (save_reductions): Don't link the new reductions, store them in
16248 this_state.
16249 * src/lalr.c (set_state_table): No need to attach reductions to
16250 states, it's already done.
16251 * src/output.c (output_actions): No longer free the shifts, then
16252 the reductions, then the states: free all the states and their
16253 members.
16254
16255 2001-12-10 Akim Demaille <akim@epita.fr>
16256
16257 * src/options.c (OPTN, DRTV, BOTH): New.
16258 (option_table): Use them.
16259
16260 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
16261 the job of system.h.
16262 * src/options.c: Don't include stdio.h and xalloc.h for the same
16263 reasons.
16264
16265 2001-12-10 Akim Demaille <akim@epita.fr>
16266
16267 * src/output.c (output, prepare): Make sure the values of the
16268 muscles `action' and `prologue' are 0-terminated.
16269
16270 2001-12-10 Akim Demaille <akim@epita.fr>
16271
16272 Clean up GCC warnings.
16273
16274 * src/reader.c (copy_action): `buf' is not used.
16275 (parse_skel_decl): Be static.
16276 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
16277 * src/options.h (create_long_option_table): Have a real prototype.
16278 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
16279 (hash_delete_at): Return const void *.
16280 Adjust casts to preserve the const.
16281
16282 2001-12-10 Akim Demaille <akim@epita.fr>
16283
16284 * configure.in: Require 2.52g.
16285 M4 is not needed, but AUTOM4TE is.
16286 * m4/m4.m4: Remove.
16287 * tests/Makefile.am: Adjust.
16288
16289 2001-12-10 Akim Demaille <akim@epita.fr>
16290
16291 One structure for states is enough, even though theoretically
16292 there are LR(0) states and LALR(1) states.
16293
16294 * src/lalr.h (state_t): Remove.
16295 (state_table): Be state_t **, not state_t *.
16296 * src/state.h (core, CORE_ALLOC): Rename as...
16297 (state_t, STATE_ALLOC): this.
16298 Add the LALR(1) members: shifts, reductions, errs.
16299 * src/LR0.c (state_table): Rename as...
16300 (state_hash): this, to avoid name clashes with the global
16301 `state_table'.
16302 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
16303 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
16304
16305 2001-12-10 Akim Demaille <akim@epita.fr>
16306
16307 Bison dumps core on bash.y.
16308 Reported by Pascal Bart.
16309
16310 * src/warshall.c (bitmatrix_print): New.
16311 (TC): Use it.
16312 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
16313 j must be the outer loop.
16314 * tests/regression.at (Broken Closure): New.
16315
16316 2001-12-05 Akim Demaille <akim@epita.fr>
16317
16318 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
16319 its argument.
16320 Reported by Peter Hamorsky.
16321
16322 2001-12-05 Akim Demaille <akim@epita.fr>
16323
16324 * src/conflicts.c (err_table): Remove.
16325 (resolve_sr_conflict): Adjust.
16326 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
16327 Rename as...
16328 (state_t.reductions, state_t.shifts): this.
16329
16330 2001-12-05 Akim Demaille <akim@epita.fr>
16331
16332 * src/reduce.c (reduce_grammar_tables): No longer disable the
16333 removal of useless rules via CPP but via `if (0)', so that the
16334 compiler still check the code is valid.
16335 For instance, it should have noticed `rline' no longer exists: use
16336 the `line' member of rule_t.
16337 * src/gram.c (dummy, rline): Remove, unused.
16338
16339 2001-12-05 Akim Demaille <akim@epita.fr>
16340
16341 * src/output.c (pack_vector): Use assert, not berror.
16342 * src/main.c (berror): Remove, unused.
16343
16344 2001-12-05 Akim Demaille <akim@epita.fr>
16345
16346 New experimental feature: if --verbose --trace output all the
16347 items of a state, not only its kernel.
16348
16349 * src/print.c (print_core): If `trace_flag', then invoke closure
16350 before outputting the items of the state (print_core is no longer
16351 a correct name them).
16352 (print_results): Invoke new_closure/free_closure if needed.
16353
16354 2001-12-05 Akim Demaille <akim@epita.fr>
16355
16356 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
16357 * src/closure.c, src/closure.h (itemsetsize): Rename as...
16358 (nitemset): for consistency with the rest of the project.
16359
16360 2001-12-05 Akim Demaille <akim@epita.fr>
16361
16362 * src/closure.c (print_closure): Improve.
16363 (closure): Use it for printing input and output.
16364
16365 2001-12-05 Akim Demaille <akim@epita.fr>
16366
16367 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
16368 indexed by nonterminals.
16369
16370 2001-12-05 Akim Demaille <akim@epita.fr>
16371
16372 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
16373 what it was!).
16374 * src/warshall.h: Remove accidental duplication of the content.
16375
16376 2001-12-05 Akim Demaille <akim@epita.fr>
16377
16378 * src/closure.c (set_fderives): De-obfuscate.
16379
16380 2001-12-05 Akim Demaille <akim@epita.fr>
16381
16382 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
16383
16384 2001-12-05 Akim Demaille <akim@epita.fr>
16385
16386 * src/closure.c (set_firsts): De-obfuscate.
16387
16388 2001-12-05 Akim Demaille <akim@epita.fr>
16389
16390 * src/output.c (action_row): De-obfuscate
16391 using the good o' techniques: arrays not pointers, variable
16392 locality, BITISSET, RESETBIT etc.
16393
16394 2001-12-05 Akim Demaille <akim@epita.fr>
16395
16396 Pessimize the code to simplify it: from now on, all the states
16397 have a valid SHIFTS, which NSHIFTS is possibly 0.
16398
16399 * src/LR0.c (shifts_new): Be global and move to..
16400 * src/state.c, src/state.h: here.
16401 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
16402 * src/print_graph: Adjust.
16403
16404 2001-12-05 Akim Demaille <akim@epita.fr>
16405
16406 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
16407 * src/conflicts.c: Use it.
16408 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
16409 incorrectly ``simplified''.
16410
16411 2001-12-05 Akim Demaille <akim@epita.fr>
16412
16413 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
16414 using the good o' techniques: arrays not pointers, variable
16415 locality, BITISSET, RESETBIT etc.
16416
16417 2001-12-05 Akim Demaille <akim@epita.fr>
16418
16419 * src/state.h (SHIFT_SYMBOL): New.
16420 * src/conflicts.c: Use it to deobfuscate.
16421
16422 2001-12-05 Akim Demaille <akim@epita.fr>
16423
16424 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
16425 (print_reductions): De-obfuscate using the good o' techniques:
16426 arrays not pointers, variable locality, BITISSET.
16427
16428 2001-12-05 Akim Demaille <akim@epita.fr>
16429
16430 * src/conflicts.c (print_reductions): Arrays, not pointers.
16431 Use BITISSET.
16432
16433 2001-12-05 Akim Demaille <akim@epita.fr>
16434
16435 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16436
16437 2001-12-05 Akim Demaille <akim@epita.fr>
16438
16439 * src/conflicts.c (print_reductions): Improve variable locality.
16440
16441 2001-12-05 Akim Demaille <akim@epita.fr>
16442
16443 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16444
16445 2001-12-05 Akim Demaille <akim@epita.fr>
16446
16447 * src/conflicts.c (print_reductions): Improve variable locality.
16448
16449 2001-12-05 Akim Demaille <akim@epita.fr>
16450
16451 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
16452 * src/lalr.c: Use them.
16453
16454 2001-12-05 Akim Demaille <akim@epita.fr>
16455
16456 * src/LR0.c (augment_automaton): Formatting changes.
16457 Better variable locality.
16458
16459 2001-12-05 Akim Demaille <akim@epita.fr>
16460
16461 * src/lalr.c (matrix_print): New.
16462 (transpose): Use it.
16463 Use arrays instead of pointers.
16464
16465 2001-12-05 Akim Demaille <akim@epita.fr>
16466
16467 * src/lalr.c (maxrhs): Move to...
16468 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
16469 * src/lalr.c (build_relations): Adjust.
16470
16471 2001-12-05 Akim Demaille <akim@epita.fr>
16472
16473 * src/lalr.c (transpose): Free the memory allocated to the
16474 argument, as it is replaced by the results by the unique caller.
16475 (build_relations): Merely invoke transpose: it handles the memory
16476 deallocation.
16477 Improve variable locality.
16478 Avoid variables used as mere abbreviations.
16479 (compute_lookaheads): Use arrays instead of pointers.
16480
16481 2001-12-05 Akim Demaille <akim@epita.fr>
16482
16483 * src/lalr.c (initialize_F): Improve variable locality.
16484 Avoid variables used as mere abbreviations.
16485
16486 2001-12-05 Akim Demaille <akim@epita.fr>
16487
16488 * src/derives.c (print_derives): Display the ruleno.
16489 * src/lalr.c (initialize_F, transpose): Better variable locality
16490 to improve readability.
16491 Avoid variables used as mere abbreviations.
16492
16493 2001-12-05 Akim Demaille <akim@epita.fr>
16494
16495 * src/lalr.c (traverse): Use arrays instead of pointers.
16496
16497 2001-12-05 Akim Demaille <akim@epita.fr>
16498
16499 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
16500 the handling of squeue.
16501 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16502
16503 2001-12-05 Akim Demaille <akim@epita.fr>
16504
16505 Because useless nonterminals are now kept alive (instead of being
16506 `destroyed'), we now sometimes examine them, and store information
16507 related to them. Hence we need to know their number, and adjust
16508 memory allocations.
16509
16510 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
16511 static.
16512 * src/LR0.c (allocate_itemsets): The memory allocated to
16513 `symbol_count' was used for two different purpose: once to count
16514 the number of occurrences of each symbol, and later reassigned to
16515 `shift_symbol', containing the symbol that can be shifted from a
16516 given state.
16517 Deobfuscate, i.e., allocate, use and free `symbol_count' here
16518 only, and...
16519 (new_itemsets): Allocate `shift_symbol' here.
16520 (allocate_itemsets): symbol_count includes useless nonterminals.
16521 Make room for them.
16522 (free_storage): Use `free', not `XFREE', for pointers that cannot
16523 be null.
16524
16525 2001-12-05 Akim Demaille <akim@epita.fr>
16526
16527 * src/nullable.c (set_nullable): Deobfuscate the handling of
16528 ritem.
16529 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16530
16531 2001-12-05 Akim Demaille <akim@epita.fr>
16532
16533 * src/gram.c, src/gram.h (ritem_print): New.
16534 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
16535 (This useless function was defined only to work around VMS linkers
16536 that can't handle compilation units with variables only).
16537 * src/reduce.c (dump_grammar): Use it to trace the construction of
16538 ritem.
16539
16540 2001-12-04 Paul Eggert <eggert@twinsun.com>
16541
16542 * src/bison.simple (union yyalloc): Change member names
16543 to be the same as the stack names.
16544 (yyparse): yyptr is now union yyalloc *, not char *.
16545 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
16546 and may generate better code on some machines.
16547 (yystpcpy): Use prototype if __STDC__ is defined, not just
16548 if __cplusplus is defined.
16549
16550 2001-11-30 Akim Demaille <akim@epita.fr>
16551
16552 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
16553 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
16554 Gettext doesn't compile cleanly, and dies with -Werror.
16555 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
16556 Include WARNING_CFLAGS here.
16557 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
16558 before being defined.
16559
16560 2001-11-27 Paul Eggert <eggert@twinsun.com>
16561
16562 * lib/quotearg.h (quotearg_n, quotearg_n_style):
16563 First arg is int, not unsigned.
16564 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
16565 (SIZE_MAX, UINT_MAX): New macros.
16566 (quotearg_n_options): Abort if N is negative.
16567 Avoid overflow check on hosts where size_t is 64 bits and int
16568 is 32 bits, as overflow is impossible there.
16569 Fix off-by-one typo that caused unnecessary reallocation.
16570
16571 2001-11-29 Paul Eggert <eggert@twinsun.com>
16572
16573 Name space cleanup in generated parser.
16574
16575 * doc/bison.texinfo (Bison Parser): Discuss system headers
16576 and their effect on the user name space.
16577
16578 * src/bison.simple:
16579 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
16580 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
16581 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
16582
16583 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
16584 on user names when possible.
16585
16586 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
16587 Simplify test for whather <alloca.h> exists.
16588
16589 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
16590
16591 (<stdio.h>): Include if YYDEBUG.
16592
16593 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
16594 ! defined (yyoverflow) && ! defined (yymemcpy).
16595
16596 (yymemcpy, yyparse): Rename local variables as needed so that
16597 they all begin with 'yy'.
16598
16599 (yystrlen, yystpcpy): New functions.
16600
16601 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
16602 All uses changed.
16603
16604 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
16605 instead of relying on string.h functions. Use YYSTACK_ALLOC
16606 and YYSTACK_FREE instead of malloc and free.
16607
16608 2001-11-30 Akim Demaille <akim@epita.fr>
16609
16610 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
16611 before their first uses.
16612 (YYBISON, YYPURE): Move to the top of the output.
16613
16614 2001-11-30 Akim Demaille <akim@epita.fr>
16615
16616 * tests/reduce.at (Useless Nonterminals): Fix.
16617
16618 2001-11-30 Akim Demaille <akim@epita.fr>
16619
16620 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
16621 if body instead of `;' to pacify GCC's warnings.
16622
16623 2001-11-30 Akim Demaille <akim@epita.fr>
16624
16625 Instead of mapping the LHS of unused rules to -1, keep the LHS
16626 valid, but flag the rules as invalid.
16627
16628 * src/gram.h (rule_t): `useful' is a new member.
16629 * src/print.c (print_grammar): Adjust.
16630 * src/derives.c (set_derives): Likewise.
16631 * src/reader.c (packgram, reduce_output): Likewise.
16632 * src/reduce.c (reduce_grammar_tables): Likewise.
16633 * tests/reduce.at (Underivable Rules, Useless Rules): New.
16634
16635 2001-11-30 Akim Demaille <akim@epita.fr>
16636
16637 * src/reduce.c (reduce_output): Formatting changes.
16638 * src/print.c (print_results, print_grammar): Likewise.
16639 * tests/regression.at (Rule Line Numbers)
16640 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
16641
16642 2001-11-30 Akim Demaille <akim@epita.fr>
16643
16644 * src/reduce.c (nonterminals_reduce): Instead of throwing away
16645 useless nonterminals, move them at the end of the symbol arrays.
16646 (reduce_output): Adjust.
16647 * tests/reduce.at (Useless Nonterminals): Adjust.
16648
16649 2001-11-30 Akim Demaille <akim@epita.fr>
16650
16651 * src/reduce.c: Various comment/formatting changes.
16652 (nonterminals_reduce): New, extracted from...
16653 (reduce_grammar_tables): here.
16654 (reduce_grammar): Call nonterminals_reduce.
16655
16656 2001-11-29 Paul Eggert <eggert@twinsun.com>
16657
16658 * src/bison.simple (YYSTACK_REALLOC): Remove.
16659 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
16660 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
16661 New macros.
16662 (union yyalloc): New type.
16663 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
16664 an arbitrary restriction on hosts where size_t is wider than int.
16665
16666 (yyparse): Don't dump core if alloca or malloc fails; instead, report
16667 a parser stack overflow. Allocate just one block of memory for all
16668 three stacks, instead of allocating three blocks; this typically is
16669 faster and reduces fragmentation.
16670
16671 Do not limit the number of items in the stack to a value that fits
16672 in 'int', as this is an arbitrary limit on hosts with 64-bit
16673 size_t and 32-bit int.
16674
16675 2001-11-29 Marc Autret <autret_m@epita.fr>
16676
16677 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
16678 of defining YYERROR_VERBOSE.
16679 [AT_DATA]: $4 is now out of C declarations in the prologue.
16680
16681 2001-11-28 Marc Autret <autret_m@epita.fr>
16682
16683 * src/reader.c (parse_dquoted_param): New.
16684 (parse_skel_decl): Use it.
16685 * src/lex.h: Add its prototype.
16686 * src/lex.c (literalchar): Become not static.
16687
16688 2001-11-28 Marc Autret <autret_m@epita.fr>
16689
16690 * src/output.h: And put its extern declaration here.
16691 * src/output.c (error_verbose): Define here.
16692 (prepare): Echo name modification.
16693 * src/getargs.h: Clean its extern declaration.
16694 * src/getargs.c (error_verbose_flag): Remove.
16695 (getargs): Remove case 'e'.
16696 * src/options.c (option_table): 'error-verbose' is now seen as simple
16697 percent option.
16698 Include output.h.
16699
16700 * src/reader.c (read_declarations): Remove case tok_include.
16701 (parse_include_decl): Remove.
16702 * src/lex.h (token_t): Remove tok_include.
16703 * src/options.c (option_table): 'include' is now a simple command line
16704 option.
16705
16706 2001-11-28 Marc Autret <autret_m@epita.fr>
16707
16708 * src/bison.simple: Adjust muscle names.
16709 * src/muscle_tab.c (muscle_init): Also rename the muscles.
16710 * src/output.c (prepare): s/_/-/ for the muscles names.
16711 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
16712
16713 2001-11-28 Marc Autret <autret_m@epita.fr>
16714
16715 * src/bison.simple: Fix debug.
16716 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
16717
16718 2001-11-28 Akim Demaille <akim@epita.fr>
16719
16720 * src/LR0.c (shifts_new): New.
16721 (save_shifts, insert_start_shift, augment_automaton): Use it.
16722
16723 2001-11-28 Akim Demaille <akim@epita.fr>
16724
16725 * src/closure.c (closure): `b' and `ruleno' denote the same value:
16726 keep ruleno only.
16727
16728 2001-11-28 Akim Demaille <akim@epita.fr>
16729
16730 * src/closure.c (closure): Instead of looping over word in array
16731 then bits in words, loop over bits in array.
16732
16733 2001-11-28 Akim Demaille <akim@epita.fr>
16734
16735 * src/closure.c (closure): No longer optimize the special case
16736 where all the bits of `ruleset[r]' are set to 0, to make the code
16737 clearer.
16738
16739 2001-11-28 Akim Demaille <akim@epita.fr>
16740
16741 * src/closure.c (closure): `r' and `c' are new variables, used to
16742 de-obfuscate accesses to RULESET and CORE.
16743
16744 2001-11-28 Akim Demaille <akim@epita.fr>
16745
16746 * src/reduce.c (reduce_print): Use ngettext.
16747 (dump_grammar): Improve the trace accuracy.
16748
16749 2001-11-28 Akim Demaille <akim@epita.fr>
16750
16751 * src/reduce.c (dump_grammar): Don't translate trace messages.
16752
16753 2001-11-28 Akim Demaille <akim@epita.fr>
16754
16755 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
16756 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
16757 as all tags are free'ed afterwards.
16758 From Enrico Scholz.
16759
16760 2001-11-27 Paul Eggert <eggert@twinsun.com>
16761
16762 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
16763 use alloca when we didn't want to, and vice versa.
16764
16765 2001-11-27 Marc Autret <autret_m@epita.fr>
16766
16767 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
16768 initialization.
16769 * src/output.c (prepare): Remove its update.
16770
16771 2001-11-27 Marc Autret <autret_m@epita.fr>
16772
16773 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
16774 Use %error-verbose.
16775
16776 2001-11-27 Marc Autret <autret_m@epita.fr>
16777
16778 * src/bison.simple: Remove YYERROR_VERBOSE using.
16779 Use %%error_verbose.
16780 (yyparse): Likewise.
16781 * src/output.c (prepare): Give its final value.
16782 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
16783 * src/getargs.h: Add its extern declaration.
16784 * src/getargs.c (error_verbose_flag): New int.
16785 (getargs): Update to catch new case.
16786 * src/options.c (option_table): 'error-verbose' is a new option.
16787 (shortopts): Update.
16788
16789 2001-11-27 Akim Demaille <akim@epita.fr>
16790
16791 * src/system.h: Use intl/libgettext.h.
16792 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
16793
16794 2001-11-27 Akim Demaille <akim@epita.fr>
16795
16796 * tests/torture.at (Exploding the Stack Size with Malloc):
16797 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
16798
16799 2001-11-27 Akim Demaille <akim@epita.fr>
16800
16801 * src/files.c: Include error.h.
16802 Reported by Hans Aberg.
16803
16804 2001-11-26 Marc Autret <autret_m@epita.fr>
16805
16806 * src/reader.c (parse_include_decl): New, not yet implemented.
16807 (read_declarations): Add case tok_include.
16808 * src/getargs.h (include): Add its extern definition.
16809 * src/getargs.c (include): New const char *.
16810 (getargs): Add case '-I'.
16811 * src/options.c (option_table): Add include as command line and
16812 percent option.
16813 * src/lex.h (token_t): Add tok_include.
16814
16815 2001-11-26 Akim Demaille <akim@epita.fr>
16816
16817 * src/reader.c (readgram): Make sure rules for mid-rule actions
16818 have a lineno equal to that of their host rule.
16819 Reported by Hans Aberg.
16820 * tests/regression.at (Rule Line Numbers): New.
16821
16822 2001-11-26 Akim Demaille <akim@epita.fr>
16823
16824 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
16825 size_ts.
16826
16827 2001-11-26 Akim Demaille <akim@epita.fr>
16828
16829 * src/complain.c, src/complain.h (error): Remove, provided by
16830 lib/error.[ch].
16831
16832 2001-11-26 Akim Demaille <akim@epita.fr>
16833
16834 * src/reader.c (read_declarations): Don't abort on tok_illegal,
16835 issue an error message.
16836 * tests/regression.at (Invalid %directive): New.
16837 Reported by Hans Aberg.
16838
16839 2001-11-26 Akim Demaille <akim@epita.fr>
16840
16841 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
16842 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16843
16844 2001-11-26 Akim Demaille <akim@epita.fr>
16845
16846 * src/conflicts.c (conflicts_print): Don't complain at all when
16847 there are no reduce/reduce conflicts, and as many shift/reduce
16848 conflicts as expected.
16849 * tests/regression.at (%expect right): Adjust.
16850
16851 2001-11-23 Akim Demaille <akim@epita.fr>
16852
16853 * lib/alloca.c: Update, from fileutils.
16854
16855 2001-11-23 Akim Demaille <akim@epita.fr>
16856
16857 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
16858
16859 2001-11-23 Akim Demaille <akim@epita.fr>
16860
16861 * src/system.h: Include alloca.h.
16862 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
16863
16864 2001-11-23 Akim Demaille <akim@epita.fr>
16865
16866 * src/print_graph.c (print_actions): Remove `rule', unused.
16867 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
16868 pacify GCC's signed < unsigned warnings.
16869 * src/closure.c (itemsetsize): Likewise.
16870 * src/reader.c (symbol_list_new): Static.
16871
16872 2001-11-23 Akim Demaille <akim@epita.fr>
16873
16874 Attaching lineno to buckets is stupid, since only one copy of each
16875 symbol is kept, only the line of the first occurrence is kept too.
16876
16877 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
16878 * src/reader.c (rline_allocated): Remove, unused.
16879 (symbol_list): Have a `line' member.
16880 (symbol_list_new): New.
16881 (readgram): Use it.
16882 * src/print.c (print_grammar): Output the rule line numbers.
16883 * tests/regression.at (Solved SR Conflicts)
16884 (Unresolved SR Conflicts): Adjust.
16885 Reported by Hans Aberg.
16886
16887 2001-11-22 Marc Autret <autret_m@epita.fr>
16888
16889 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
16890
16891 2001-11-22 Marc Autret <autret_m@epita.fr>
16892
16893 * src/muscle_tab.c (muscle_init): Remove initialization of
16894 skeleton muscle.
16895 * src/output.c (output_master_parser): Do it here.
16896
16897 2001-11-20 Akim Demaille <akim@epita.fr>
16898
16899 * po/sv.po: New.
16900 * configure.in (ALL_LINGUAS): Adjust.
16901 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
16902 longer contains strings to translate.
16903
16904 2001-11-19 Akim Demaille <akim@epita.fr>
16905
16906 * src/conflicts.c (conflicts_print): Add a missing \n.
16907
16908 2001-11-19 Akim Demaille <akim@epita.fr>
16909
16910 * src/nullable.c (nullable_print): New.
16911 (set_nullable): Call it when tracing.
16912 Better locality of variables.
16913
16914 2001-11-19 Akim Demaille <akim@epita.fr>
16915
16916 * src/print.c (print_actions): Better locality of variables.
16917
16918 2001-11-19 Akim Demaille <akim@epita.fr>
16919
16920 * src/derives.c (print_derives): Fix and enrich.
16921 * src/closure.c (print_fderives): Likewise.
16922
16923 2001-11-19 Akim Demaille <akim@epita.fr>
16924
16925 * src/closure.c (itemsetend): Remove, replaced with...
16926 (itemsetsize): new.
16927
16928 2001-11-19 Akim Demaille <akim@epita.fr>
16929
16930 * src/LR0.c (kernel_end): Remove, replaced with...
16931 (kernel_size): new.
16932
16933 2001-11-19 Akim Demaille <akim@epita.fr>
16934
16935 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
16936 to clarify.
16937
16938 2001-11-19 Akim Demaille <akim@epita.fr>
16939
16940 * src/closure.c (closure): Use arrays instead of pointers to clarify.
16941
16942 2001-11-19 Akim Demaille <akim@epita.fr>
16943
16944 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
16945 trace messages.
16946 * src/LR0.c: Likewise.
16947 (allocate_itemsets): Use arrays instead of pointers to clarify.
16948
16949 2001-11-19 Akim Demaille <akim@epita.fr>
16950
16951 * src/getargs.c (statistics_flag): Replace with...
16952 (trace_flag): New.
16953 (longopts): Accept --trace instead of --statistics.
16954 * src/getargs.h, src/options.c: Adjust.
16955 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
16956 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
16957
16958 2001-11-19 Akim Demaille <akim@epita.fr>
16959
16960 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
16961 pointers to clarify the code.
16962 (save_reductions, save_shifts): Factor common parts of alternatives.
16963
16964 2001-11-19 Akim Demaille <akim@epita.fr>
16965
16966 * src/LR0.c (new_state, get_state): Complete TRACE code.
16967 * src/closure.c: Include `reader.h' to get `tags', needed by the
16968 trace code.
16969 Rename the conditional DEBUG as TRACE.
16970 Output consistently TRACEs to stderr, not stdout.
16971 * src/derives.c: Likewise.
16972 * src/reduce.c: (inaccessable_symbols): Using if is better style
16973 than goto.
16974 Use `#if TRACE' instead of `#if 0' for tracing code.
16975
16976 2001-11-19 Akim Demaille <akim@epita.fr>
16977
16978 * src/system.h (LIST_FREE, shortcpy): New.
16979 * src/LR0.c: Use them.
16980 * src/output.c (free_itemsets, free_reductions, free_shifts):
16981 Remove, replaced by LIST_FREE.
16982
16983 2001-11-19 Akim Demaille <akim@epita.fr>
16984
16985 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
16986 (REDUCTIONS_ALLOC): New.
16987 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
16988 allocation.
16989
16990 2001-11-19 Akim Demaille <akim@epita.fr>
16991
16992 * src/LR0.c (new_state): Complete trace code.
16993 * src/nullable.c (set_nullable): Don't translate traces.
16994
16995 2001-11-19 Akim Demaille <akim@epita.fr>
16996
16997 * src/print_graph.c (print_core): Better locality of variables.
16998 * src/print.c (print_core): Likewise.
16999
17000 2001-11-19 Akim Demaille <akim@epita.fr>
17001
17002 * src/vcg.c: You do the output, so you are responsible of the
17003 handling of VCG syntax, in particular: use quotearg.
17004 * src/print_graph.c: Don't.
17005 (print_actions): Don't output the actions as part of the nodes,
17006 since that's the job of the edges.
17007 (print_state): Don't output by hand: fill the node description,
17008 and ask for its output.
17009
17010 2001-11-19 Akim Demaille <akim@epita.fr>
17011
17012 * src/bison.simple (yyparse): When verbosely reporting an error,
17013 no longer put additional quotes around token names.
17014 * tests/calc.at: Adjust.
17015
17016 2001-11-19 Akim Demaille <akim@epita.fr>
17017
17018 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
17019 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
17020 * src/output.c: Adjust.
17021
17022 2001-11-19 Akim Demaille <akim@epita.fr>
17023
17024 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
17025 (rule_t): this.
17026 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
17027
17028 2001-11-19 Akim Demaille <akim@epita.fr>
17029
17030 * src/gram.h (rule_t): New.
17031 (rule_table): New.
17032 (rrhs, rlhs): Remove, part of state_t.
17033 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
17034 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17035 * src/reader.c, src/reduce.c: Adjust.
17036
17037 2001-11-19 Akim Demaille <akim@epita.fr>
17038
17039 * src/reader.c (symbols_output): New, extracted from...
17040 (packsymbols): Here.
17041 (reader): Call it.
17042
17043 2001-11-19 Akim Demaille <akim@epita.fr>
17044
17045 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
17046 (maxrhs): this new function.
17047
17048 2001-11-19 Akim Demaille <akim@epita.fr>
17049
17050 * src/lalr.c (F): New macro to access the variable F.
17051 Adjust.
17052
17053 2001-11-19 Akim Demaille <akim@epita.fr>
17054
17055 * src/lalr.h (LA): New macro to access the variable LA.
17056 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17057 * src/lalr.c: Adjust.
17058
17059 2001-11-19 Akim Demaille <akim@epita.fr>
17060
17061 * src/lalr.c (initialize_LA): Only initialize LA. Let...
17062 (set_state_table): handle the `lookaheads' members.
17063
17064 2001-11-19 Akim Demaille <akim@epita.fr>
17065
17066 * src/lalr.h (lookaheads): Removed array, whose contents is now
17067 a member of...
17068 (state_t): this structure.
17069 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17070 Adjust.
17071
17072 2001-11-19 Akim Demaille <akim@epita.fr>
17073
17074 * src/lalr.h (consistent): Removed array, whose contents is now
17075 a member of...
17076 (state_t): this structure.
17077 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17078 Adjust.
17079
17080 2001-11-19 Akim Demaille <akim@epita.fr>
17081
17082 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
17083 contents are now members of...
17084 (state_t): this structure.
17085 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17086 Adjust.
17087
17088 2001-11-19 Akim Demaille <akim@epita.fr>
17089
17090 * src/lalr.h (state_t): New.
17091 (state_table): Be a state_t * instead of a core **.
17092 (accessing_symbol): Remove, part of state_t.
17093 * src/lalr.c: Adjust.
17094 (set_accessing_symbol): Merge into...
17095 (set_state_table): this.
17096 * src/print_graph.c, src/conflicts.c: Adjust.
17097
17098 2001-11-14 Akim Demaille <akim@epita.fr>
17099
17100 * tests/calc.at, tests/output.at, tests/regression.at,
17101 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
17102 now the tests are run in private dirs, therefore AC_CLEANUP and
17103 family can be simplified to 0-ary.
17104 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
17105 use abs. path to find config.h.
17106 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
17107 stderr, there can be way too much random noise.
17108 Instead pass -Werror to GCC and rely on the exit status.
17109 Reported by Wolfram Wagner.
17110
17111 2001-11-14 Akim Demaille <akim@epita.fr>
17112
17113 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
17114 defined only if yyoverflow is defined, to avoid `warning: unused
17115 variable `yyvs1''.
17116 Reported by The Test Suite.
17117
17118 2001-11-14 Akim Demaille <akim@epita.fr>
17119
17120 * src/print.c: Include reduce.h.
17121 Reported by Hans Aberg.
17122
17123 2001-11-14 Akim Demaille <akim@epita.fr>
17124
17125 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
17126 Revert a previous patch: these are really const.
17127 * src/conflicts.c (conflict_report): Additional useless pair of
17128 braces to pacify GCC's warnings for `if () if () {} else {}'.
17129 * src/lex.c (parse_percent_token): Replace equal_offset with
17130 arg_offset.
17131 arg is const.
17132 Be sure to strdup `arg' when used, since there is no reason for
17133 token_buffer not to change.
17134
17135 2001-11-14 Akim Demaille <akim@epita.fr>
17136
17137 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
17138 definition.
17139 * src/main.c (main): Use them.
17140 Suggested by Hans Aberg.
17141
17142 2001-11-12 Akim Demaille <akim@epita.fr>
17143
17144 * src/system.h (ngettext): Now that we use ngettext, be sure to
17145 provide a default definition when NLS are not used.
17146
17147 2001-11-12 Akim Demaille <akim@epita.fr>
17148
17149 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
17150 Use @kbd to denote user input.
17151 (Language and Grammar): ANSIfy the example.
17152 Adjust its layout for info/notinfo.
17153 (Location Tracking Calc): Output error messages to stderr.
17154 Output locations in a more GNUtically correct way.
17155 Fix a couple of Englishos.
17156 Adjust @group/@end group pairs.
17157
17158 2001-11-12 Akim Demaille <akim@epita.fr>
17159
17160 %expect was not functioning at all.
17161
17162 * src/conflicts.c (expected_conflicts): Set to -1.
17163 (conflict_report): Use ngettext.
17164 (conflicts_print): Check %expect and make its violation an error.
17165 * doc/bison.texinfo (Expect Decl): Adjust.
17166 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
17167 * tests/regression.at (%expect not enough, %expect right)
17168 (%expect too much): New.
17169
17170 2001-11-12 Akim Demaille <akim@epita.fr>
17171
17172 * tests/regression.at (Conflicts): Rename as...
17173 (Unresolved SR Conflicts): this.
17174 (Solved SR Conflicts): New.
17175
17176 2001-11-12 Akim Demaille <akim@epita.fr>
17177
17178 * src/reduce.c (print_results): Rename as...
17179 (reduce_output): This.
17180 Output to OUT, passed as argument, instead of output_obstack.
17181 (dump_grammar): Likewise.
17182 (reduce_free): New.
17183 Also free V1.
17184 (reduce_grammar): No longer call reduce_output, since...
17185 * src/print.c (print_results): do it.
17186 * src/main.c (main): Call reduce_free;
17187
17188 2001-11-12 Akim Demaille <akim@epita.fr>
17189
17190 * src/conflicts.c (print_reductions): Accept OUT as argument.
17191 Output to it, not to output_obstack.
17192 * src/print.c (print_actions): Adjust.
17193
17194 2001-11-12 Akim Demaille <akim@epita.fr>
17195
17196 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
17197 the result instead of using...
17198 (src_total, rrc_total, src_count, rrc_count): Remove.
17199 (any_conflicts): Remove.
17200 (print_conflicts): Split into...
17201 (conflicts_print, conflicts_output): New.
17202 * src/conflicts.h: Adjust.
17203 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
17204 * src/print.c (print_grammar): Issue `\n' between two rules.
17205 * tests/regression.at (Conflicts): New.
17206 Reported by Tom Lane.
17207
17208 2001-11-12 Akim Demaille <akim@epita.fr>
17209
17210 * tests/regression.at (Invalid input): Remove, duplicate with
17211 ``Invalid input: 1''.
17212
17213 2001-11-12 Akim Demaille <akim@epita.fr>
17214
17215 * tests/torture.at (AT_DATA_STACK_TORTURE)
17216 (Exploding the Stack Size with Alloca)
17217 (Exploding the Stack Size with Malloc): New.
17218
17219 2001-11-12 Akim Demaille <akim@epita.fr>
17220
17221 * src/bison.simple (YYSTACK_REALLOC): New.
17222 (yyparse) [!yyoverflow]: Use it and free the old stack.
17223 Reported by Per Allansson.
17224
17225 2001-11-12 Pascal Bart <pascal.bart@epita.fr>
17226
17227 * src/bison.simple: Define type yystype instead of YYSTYPE, and
17228 define CPP macro, which substitute YYSTYPE by yystype.
17229 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
17230 with yyltype/YYLTYPE. This allows inclusion of the generated
17231 header within the parser if the compiler, such as GGC, accepts
17232 multiple equivalent #defines.
17233 From Akim.
17234
17235 2001-11-05 Akim Demaille <akim@epita.fr>
17236
17237 * src/reader.c (symbols_output): New, extracted from...
17238 (packsymbols): here.
17239 (reader): Adjust.
17240
17241 2001-11-05 Akim Demaille <akim@epita.fr>
17242
17243 * src/lex.c (parse_percent_token): s/quotearg/quote/.
17244
17245 2001-11-05 Akim Demaille <akim@epita.fr>
17246
17247 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
17248 pattern.
17249
17250 2001-11-05 Akim Demaille <akim@epita.fr>
17251
17252 * src/options.h (struct option_table_struct): set_flags is void*.
17253 * src/options.c (longopts): Support `--output' and `%output'.
17254 (usage): Adjust.
17255 * src/lex.h (tok_setopt): Remove, replaced with...
17256 (tok_intopt, tok_stropt): these new guys.
17257 * src/lex.c (getopt.h): Not needed.
17258 (token_buffer, unlexed_token_buffer): Not const.
17259 (percent_table): Promote `-' over `_' in directive names.
17260 Active `%name-prefix', `file-prefix', and `output'.
17261 (parse_percent_token): Accept possible arguments to directives.
17262 Promote `-' over `_' in directive names.
17263
17264 2001-11-04 Akim Demaille <akim@epita.fr>
17265
17266 * doc/bison.texinfo (Decl Summary): Split the list into
17267 `directives for grammars' and `directives for bison'.
17268 Sort'em.
17269 Add description of `%name-prefix', `file-prefix', and `output'.
17270 Promote `-' over `_' in directive names.
17271 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
17272 Simplify the description of `--name-prefix'.
17273 Promote `-' over `_' in directive names.
17274 Promote `--output' over `--output-file'.
17275 Fix the description of `--defines'.
17276 * tests/output.at: Exercise %file-prefix and %output.
17277
17278 2001-11-02 Akim Demaille <akim@epita.fr>
17279
17280 * doc/refcard.tex: Update.
17281
17282 2001-11-02 Akim Demaille <akim@epita.fr>
17283
17284 * src/symtab.h (SUNDEF): New.
17285 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
17286 stand for `uninitialized', instead of 0.
17287 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
17288 * src/lex.c (lex): Adjust.
17289
17290 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
17291 Number it 0.
17292 Let yylex return it instead of a plain 0.
17293 Reported by Dick Streefland.
17294
17295 2001-11-02 Akim Demaille <akim@epita.fr>
17296
17297 * tests/regression.at (Mixing %token styles): New test.
17298
17299 2001-11-02 Akim Demaille <akim@epita.fr>
17300
17301 * src/reader.c (parse_thong_decl): Formatting changes.
17302 (token_translations_init): New, extracted from...
17303 (packsymbols): Here.
17304 Adjust.
17305
17306 2001-11-01 Akim Demaille <akim@epita.fr>
17307
17308 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
17309 Check that `9foo.y' produces correct cpp guards.
17310 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
17311 guards.
17312 Reported by Wwp.
17313
17314 2001-11-01 Akim Demaille <akim@epita.fr>
17315
17316 * tests/regression.at (Invalid input: 2): New.
17317 * src/lex.c (unlexed_token_buffer): New.
17318 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
17319 too.
17320 Reported by Wwp.
17321
17322 2001-11-01 Akim Demaille <akim@epita.fr>
17323
17324 * tests/calc.at: Catch up with 1.30.
17325 * configure.in: Bump to 1.49a.
17326 Adjust to newer Autotest.
17327
17328 2001-10-19 Pascal Bart <pascal.bart@epita.fr>
17329
17330 * src/conflicts.c: Move global variables rrc_total and src_total ...
17331 (print_conflicts): here.
17332 * src/output.c (output): Free global variable user_toknums.
17333 * src/lex.c (token_obstack): Become static.
17334
17335 2001-10-18 Akim Demaille <akim@epita.fr>
17336
17337 * tests/atlocal.in (GCC): Add.
17338 * tests/calc.at: s/m4_match/m4_bmatch/.
17339 s/m4_patsubst/m4_bpatsubst/.
17340 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
17341 * configure.in: AC_SUBST(GCC).
17342
17343 2001-10-14 Marc Autret <autret_m@epita.fr>
17344
17345 * src/options.c (create_long_option_table): Fix.
17346
17347 2001-10-10 Akim Demaille <akim@epita.fr>
17348
17349 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
17350
17351 2001-10-04 Akim Demaille <akim@epita.fr>
17352
17353 * src/reader.c (parse_union_decl): Push the caracters in
17354 union_obstack, not attrs_obstack.
17355
17356 2001-10-04 Akim Demaille <akim@epita.fr>
17357
17358 Merge in the branch 1.29.
17359
17360 * src/reader.c (packsymbols): Use a temporary obstack for
17361 `%%tokendef', since output_stack is already used elsewhere.
17362
17363 2001-10-02 Akim Demaille <akim@epita.fr>
17364
17365 Bump 1.29d.
17366
17367 2001-10-02 Akim Demaille <akim@epita.fr>
17368
17369 Version 1.29c.
17370
17371 2001-10-02 Akim Demaille <akim@epita.fr>
17372
17373 * tests/regression.at (Invalid CPP headers): New.
17374 From Alexander Belopolsky.
17375 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
17376
17377 2001-10-02 Akim Demaille <akim@epita.fr>
17378
17379 * tests/regression.at (Invalid input): New.
17380 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
17381 Reported by Shura.
17382
17383 2001-10-02 Akim Demaille <akim@epita.fr>
17384
17385 * tests/calc.at: Now that --debug works, the tests must be adjusted.
17386
17387 2001-10-02 Akim Demaille <akim@epita.fr>
17388
17389 * src/output.c (output_parser): Assert `skeleton'.
17390 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
17391 systems.
17392 From Shura.
17393
17394 2001-10-01 Marc Autret <autret_m@epita.fr>
17395
17396 * src/lex.h: Echo modifications.
17397 * src/lex.c (unlex): Parameter is now token_t.
17398 From Hans Aberg.
17399
17400 2001-10-01 Marc Autret <autret_m@epita.fr>
17401
17402 * src/main.c: Include lex.h.
17403 From Hans Aberg.
17404
17405 2001-09-29 Akim Demaille <akim@epita.fr>
17406
17407 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
17408
17409 2001-09-28 Akim Demaille <akim@epita.fr>
17410
17411 * tests/testsuite.at: Update to newer Autotest.
17412 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
17413
17414 2001-09-27 Akim Demaille <akim@epita.fr>
17415
17416 Position independent wrapper.
17417
17418 * tests/bison: Remove.
17419 * tests/bison.in: New.
17420 * configure.in: Adjust.
17421
17422 2001-09-27 Paul Eggert <eggert@twinsun.com>
17423
17424 Port quotearg fixes from tar 1.13.24.
17425
17426 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
17427 tm to be declared.
17428 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
17429 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
17430
17431 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
17432 * m4/mbrtowc.m4: New file.
17433 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
17434 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
17435
17436 2001-09-27 Akim Demaille <akim@epita.fr>
17437
17438 Bump to 1.29c.
17439
17440 2001-09-27 Akim Demaille <akim@epita.fr>
17441
17442 Version 1.29b.
17443
17444 2001-09-25 Akim Demaille <akim@epita.fr>
17445
17446 * src/system.h: Include `xalloc.h'.
17447 Remove it from the C files.
17448 * src/files.c (output_files): Free the obstacks.
17449 * src/lex.c (init_lex): Rename as...
17450 (lex_init): this.
17451 (lex_free): New.
17452 * src/main.c (main): Use it.
17453
17454 2001-09-24 Marc Autret <autret_m@epita.fr>
17455
17456 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
17457 to output informations in fout (FILE*).
17458 (open_graph, close_graph): Likewise.
17459 (output_graph, output_edge, output_node): Likewise.
17460 * src/vcg.h: Update function prototypes.
17461 * src/print_graph.c (print_graph): Open output graph file.
17462 (print_actions): Adjust.
17463 * src/files.h: Remove extern declaration.
17464 * src/files.c: Remove graph_obstack declaration.
17465 (open_files): Remove graph_obstack initialization.
17466 (output_files): Remove graph_obstack saving.
17467
17468 2001-09-24 Marc Autret <autret_m@epita.fr>
17469
17470 * src/files.c (compute_output_file_names): Fix.
17471
17472 2001-09-24 Marc Autret <autret_m@epita.fr>,
17473 Akim Demaille <akim@epita.fr>
17474
17475 * src/reader.c (reader): Remove call to free_symtab ().
17476 * src/main.c (main): Call it here.
17477 Include symtab.h.
17478 * src/conflicts.c (initialize_conflicts): Rename as...
17479 (solve_conflicts): this.
17480 * src/print.c (print_core, print_actions, print_state)
17481 (print_grammar): Dump to a file instead a `output_obstack'.
17482 (print_results): Dump `output_obstack', and then proceed with the
17483 FILE *.
17484 * src/files.c (compute_output_file_names, close_files): New.
17485 (output_files): Adjust.
17486 * src/main.c (main): Adjust.
17487
17488 2001-09-23 Marc Autret <autret_m@epita.fr>
17489
17490 * src/files.c (compute_header_macro): Computes header macro name
17491 from spec_defines_file when given.
17492
17493 2001-09-23 Marc Autret <autret_m@epita.fr>
17494
17495 * src/files.c (output_files): Add default extensions.
17496
17497 2001-09-22 Akim Demaille <akim@epita.fr>
17498
17499 * src/conflicts.c (finalize_conflicts): Rename as...
17500 (free_conflicts): this.
17501
17502 2001-09-22 Akim Demaille <akim@epita.fr>
17503
17504 * src/gram.c (gram_free): Rename back as...
17505 (dummy): this.
17506 (output_token_translations): Free `token_translations'.
17507 * src/symtab.c (free_symtab): Free the tag field.
17508
17509 2001-09-22 Akim Demaille <akim@epita.fr>
17510
17511 Remove `translations' as it is always set to true.
17512
17513 * src/gram.h: Adjust.
17514 * src/reader.c (packsymbols, parse_token_decl): Adjust
17515 * src/print.c (print_grammar): Adjust.
17516 * src/output.c (output_token_translations): Adjust.
17517 * src/lex.c (lex): Adjust.
17518 * src/gram.c: Be sure the set pointers to NULL.
17519 (dummy): Rename as...
17520 (gram_free): this.
17521
17522 2001-09-22 Akim Demaille <akim@epita.fr>
17523
17524 * configure.in: Invoke AM_LIB_DMALLOC.
17525 * src/system.h: Use dmalloc.
17526 * src/LR0.c: Be sure to have pointers initialized to NULL.
17527 (allocate_itemsets): Allocate kernel_items only if needed.
17528
17529 2001-09-22 Akim Demaille <akim@epita.fr>
17530
17531 * configure.in: Bump to 1.29b.
17532 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
17533 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
17534 need xmalloc.c in calc.y.
17535 From Pascal Bart.
17536
17537 2001-09-21 Akim Demaille <akim@epita.fr>
17538
17539 Version 1.29a.
17540 * Makefile.maint, config/config.guess, config/config.sub,
17541 * config/missing: Update from masters.
17542 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
17543 upon package.m4.
17544 * configure.in (ALL_LINGUAS): Add `tr'.
17545
17546 2001-09-21 Akim Demaille <akim@epita.fr>
17547
17548 * tests/Makefile.am (package.m4): Move to...
17549 ($(srcdir)/$(TESTSUITE)): here.
17550
17551 2001-09-20 Akim Demaille <akim@epita.fr>
17552
17553 * src/complain.c: No longer try to be standalone: use system.h.
17554 Don't assume __STDC__ is defined to 1. Just test if it is defined.
17555 * src/complain.h: Likewise.
17556 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
17557 Remove the unused variable `n'.
17558 From Albert Chin-A-Young.
17559
17560 2001-09-18 Marc Autret <autret_m@epita.fr>
17561
17562 * doc/bison.1: Update.
17563 * doc/bison.texinfo (Bison Options): Update --defines and --graph
17564 descriptions.
17565 (Option Cross Key): Update.
17566 Add --graph.
17567
17568 2001-09-18 Marc Autret <autret_m@epita.fr>
17569
17570 * tests/regression.at: New test (comment in %union).
17571
17572 2001-09-18 Marc Autret <autret_m@epita.fr>
17573
17574 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
17575 do that.
17576 Reported by Keith Browne.
17577
17578 2001-09-18 Marc Autret <autret_m@epita.fr>
17579
17580 * tests/output.at: Add tests for --defines and --graph.
17581
17582 2001-09-18 Marc Autret <autret_m@epita.fr>
17583
17584 * tests/output.at: Removes tests of %{header,src}_extension features.
17585
17586 2001-09-18 Akim Demaille <akim@epita.fr>
17587
17588 * tests/Makefile.am (package.m4): New.
17589 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
17590 (_AT_CHECK_CALC_ERROR): Likewise.
17591 Factor the `, ' part of verbose error messages.
17592
17593 2001-09-18 Marc Autret <autret_m@epita.fr>
17594
17595 * src/getargs.c (longopts): Declare --defines and --graph as options
17596 with optional arguments.
17597 * src/files.h: Add extern declarations.
17598 * src/files.c (spec_graph_file, spec_defines_file): New.
17599 (output_files): Update.
17600 Remove CPP-outed code.
17601
17602 2001-09-18 Marc Autret <autret_m@epita.fr>
17603
17604 Turn off %{source,header}_extension feature.
17605
17606 * src/files.c (compute_exts_from_gf): Update.
17607 (compute_exts_from_src): Update.
17608 (output_files): CPP-out useless code.
17609 * src/files.h: Remove {header,source}_extension extern declarations.
17610 * src/reader.c (parse_dquoted_param): CPP-out.
17611 (parse_header_extension_decl): Remove.
17612 (parse_source_extension_decl): Remove.
17613 (read_declarations): Remove cases tok_{hdrext,srcext}.
17614 * src/lex.c (percent_table): Remove {header,source}_extension entries.
17615 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
17616
17617 2001-09-10 Akim Demaille <akim@epita.fr>
17618
17619 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
17620 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
17621 (AT_CHECK_OUTPUT): this.
17622 Merely check ls' exit status, its output is useless.
17623
17624 2001-09-10 Akim Demaille <akim@epita.fr>
17625
17626 * tests/calc.at: Use m4_match.
17627 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
17628
17629 2001-09-10 Marc Autret <autret_m@epita.fr>,
17630 Akim Demaille <akim@epita.fr>
17631
17632 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
17633 enum color_e.
17634 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
17635 to `normal'.
17636 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
17637 * src/lex.h: Adjust prototype.
17638 (token_t): Add `tok_undef'.
17639 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
17640 (parse_percent_token): Now returns token_t.
17641 Add default statement in switch.
17642 (lex): Separate `c' as an input variable, from the token_t result
17643 part.
17644 (unlexed): Is a token_t.
17645
17646 2001-09-10 Akim Demaille <akim@epita.fr>
17647
17648 * configure.in: Bump to 1.29a.
17649
17650 2001-09-07 Akim Demaille <akim@epita.fr>
17651
17652 Version 1.29.
17653
17654 2001-08-30 Akim Demaille <akim@epita.fr>
17655
17656 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
17657 * m4/atconfig.m4: Remove.
17658 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
17659 * tests/bison: New.
17660 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
17661 m4_if, m4_patsubst, and m4_regexp.
17662 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
17663 `input' file instead of echo.
17664
17665 2001-08-29 Akim Demaille <akim@epita.fr>
17666
17667 Bump to 1.28e.
17668
17669 2001-08-29 Akim Demaille <akim@epita.fr>
17670
17671 Version 1.28d.
17672
17673 2001-08-29 Paul Eggert <eggert@twinsun.com>
17674
17675 * src/bison.simple (yyparse): Don't take the address of an
17676 item before the start of an array, as that doesn't conform to
17677 the C Standard.
17678
17679 2001-08-29 Robert Anisko <anisko_r@epita.fr>
17680
17681 * doc/bison.texinfo (Location Tracking Calc): New node.
17682
17683 2001-08-29 Paul Eggert <eggert@twinsun.com>
17684
17685 * src/output.c (output): Do not define const, as this now
17686 causes more problems than it cures.
17687
17688 2001-08-29 Akim Demaille <akim@epita.fr>
17689
17690 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
17691 the nodes.
17692 Be sure to tag the `detailmenu'.
17693
17694 2001-08-29 Akim Demaille <akim@epita.fr>
17695
17696 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
17697 download in a tmp dir.
17698
17699 2001-08-28 Marc Autret <autret_m@epita.fr>
17700
17701 * config/depcomp: New file.
17702
17703 2001-08-28 Marc Autret <autret_m@epita.fr>
17704
17705 * doc/bison.1 (mandoc): Adjust.
17706 From Juan Manuel Guerrero.
17707
17708 2001-08-28 Marc Autret <autret_m@epita.fr>
17709
17710 * src/print_graph.c (print_state): Fix.
17711
17712 2001-08-27 Marc Autret <autret_m@epita.fr>
17713
17714 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
17715 char * members.
17716 Echo modifications to the functions prototypes.
17717 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
17718
17719 2001-08-27 Marc Autret <autret_m@epita.fr>
17720
17721 * src/vcg.c: Include `xalloc.h'.
17722 (add_colorentry): New.
17723 (add_classname): New.
17724 (add_infoname): New.
17725 * src/vcg.h: Add new prototypes.
17726
17727 2001-08-27 Akim Demaille <akim@epita.fr>
17728
17729 * Makefile.maint: Sync. again with CVS Autoconf.
17730
17731 2001-08-27 Akim Demaille <akim@epita.fr>
17732
17733 * Makefile.maint: Formatting changes.
17734 (po-update, cvs-update, update): New targets.
17735 (AMTAR): Remove.
17736
17737 2001-08-27 Akim Demaille <akim@epita.fr>
17738
17739 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17740 * Makefile.maint: Sync. with CVS Autoconf.
17741
17742 2001-08-27 Marc Autret <autret_m@epita.fr>
17743
17744 * src/vcg.h (struct infoname_s): New.
17745 (struct colorentry_s): New.
17746 (graph_s): New fields {vertical,horizontal}_order in structure.
17747 Add `infoname' field.
17748 Add `colorentry' field;
17749 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
17750 (G_HORIZONTAL_ORDER): New.
17751 (G_INFONAME): New.
17752 (G_COLORENTRY): New.
17753 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
17754 Add output of `infoname'.
17755 Add output of `colorentry'.
17756
17757 2001-08-27 Marc Autret <autret_m@epita.fr>
17758
17759 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
17760 This one shadowed a global parameter.
17761
17762 2001-08-24 Marc Autret <autret_m@epita.fr>
17763
17764 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
17765 instead of `unsigned'.
17766 (print_state): Do not call obstack_object_size () in obstack_grow ()
17767 to avoid macro variables shadowing.
17768
17769 2001-08-23 Marc Autret <autret_m@epita.fr>
17770
17771 * src/lex.c (percent_table): Typo: s/naem/name/.
17772 Add graph option.
17773 Normalize new options declarations.
17774
17775 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
17776
17777 * tests/suite.at: Exercise %header_extension and %source_extension.
17778
17779 2001-08-16 Marc Autret <autret_m@epita.fr>
17780
17781 * src/reader.c (parse_dquoted_param): New.
17782 (parse_header_extension_decl): Use it.
17783 (parse_source_extension_decl): Likewise.
17784
17785 2001-08-16 Marc Autret <autret_m@epita.fr>
17786
17787 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
17788 (get_xxxx_str): Use assert () instead of complain ().
17789 Remove return invokations in default cases.
17790 (get_decision_str): Modify default behaviour. Remove second argument.
17791 Echo modifications on calls.
17792 (output_graph): Fix.
17793
17794 2001-08-16 Marc Autret <autret_m@epita.fr>
17795
17796 * src/getargs.c (usage): Update with ``-g, --graph''.
17797
17798 2001-08-16 Marc Autret <autret_m@epita.fr>
17799
17800 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
17801 (Option Cross Key): Likewise.
17802 * doc/bison.1: Update.
17803
17804 2001-09-25 Pascal Bart <pascal.bart@epita.fr>
17805
17806 * src/output.c (output_master_parser): Don't finish action_obstack.
17807 (output_parser): Don't care about the muscle action, here.
17808 (prepare): Copy the action_obstack in the action muscle.
17809 (output): Free action_obstack.
17810
17811 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
17812
17813 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
17814 will contain `%union' declaration.
17815 (parse_union_decl): Delete #line directive output.
17816 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
17817 informations about %union.
17818 (parse_union_decl): Copy the union_obstack in the muscle stype.
17819 * src/bison.simple: Add new #line directive.
17820 Add typdef %%stype YYSTYPE.
17821
17822 2001-09-23 Pascal Bart <pascal.bart@epita.fr>
17823
17824 * src/bison.simple: Add new `#line' directive.
17825
17826 2001-09-22 Pascal Bart <pascal.bart@epita.fr>
17827
17828 * src/bison.simple: New `#line' directive.
17829 * src/output.c (output_parser): Support new dynamic muscle input_line.
17830
17831 2001-09-22 Marc Autret <autret_m@epita.fr>
17832
17833 * src/output.c (output_master_parser): New.
17834 (output_parser): Be more re-entrant.
17835
17836 2001-09-21 Marc Autret <autret_m@epita.fr>
17837
17838 * src/reader.c (copy_definition, parse_union_decl): Update and use
17839 `linef' muscle.
17840 (copy_action): Likewise.
17841 Use obstack_1grow ().
17842 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
17843
17844 2001-09-21 Marc Autret <autret_m@epita.fr>
17845
17846 * src/options.c (option_table): Adjust.
17847 * src/lex.c (parse_percent_token): Fix.
17848
17849 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
17850
17851 * src/options.c (symtab.h): Include it, need by lex.h.
17852
17853 2001-09-20 Pascal Bart <pascal.bart@epita.fr>
17854
17855 * src/lex.c (parse_percent_token): Change type of variable `tx', which
17856 is now an option_table_struct*.
17857 (option_strcmp): New function option_strcmp.
17858 (parse_percent_token): Call option_strcmp.
17859 * src/getargs.c (xalloc.h, options.h): Include it.
17860 (getargs): Call create_long_option_table.
17861 (getargs): Free longopts at the end of the function.
17862 (shortopts): Move in options.c.
17863 * src/options.c (create_long_option_table): New function. Convert
17864 information from option_table to option structure.
17865 * src/reader.c (options.h): Include it.
17866
17867 * src/Makefile.am: Adjust.
17868 * src/options.c (option_table): Create from longopts and percent_table.
17869 * src/getargs.c (longopts): Delete.
17870 * src/lex.c (struct percent_table_struct): Delete.
17871 (percent_table): Delete.
17872 (options.h): Include it.
17873 * src/options.c: Create.
17874 * src/options.h: Create.
17875 Declare enum opt_access_e.
17876 Define struct option_table_struct.
17877
17878 2001-09-20 Marc Autret <autret_m@epita.fr>
17879
17880 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
17881 sections of Bison.
17882
17883 2001-09-19 Pascal Bart <pascal.bart@epita.fr>
17884
17885 * src/bison.simple: s/%%filename/%%skeleton.
17886 * src/muscle_tab.c (getargs.h): Include it.
17887 (muscle_init): Insert new muscle skeleton.
17888
17889 2001-09-18 Pascal Bart <pascal.bart@epita.fr>
17890
17891 * src/output.c (output_parser): Delete unused variable actions_dumped.
17892
17893 2001-09-07 Pascal Bart <pascal.bart@epita.fr>
17894
17895 * src/output.c (output): Delete call to reader_output_yylsp.
17896 * src/reader.c (reader): Likewise.
17897 * src/reader.h: Delete declaration of reader_output_yylsp.
17898
17899 2001-09-02 Marc Autret <autret_m@epita.fr>
17900
17901 * src/reader.c: Include muscle_tab.h.
17902 (parse_union_decl): Update.
17903 (parse_macro_decl): Rename parse_muscle_decl.
17904 Update to use renamed functions and variable.
17905 (read_declarations, copy_action, read_additionnal_code, : Updated
17906 with correct variables and functions names.
17907 (packsymbols, reader): Likewise.
17908
17909 * src/reader.h (muscle_obstack): Extern declaration update.
17910
17911 * src/output.c: Include muscle_tab.h
17912 In all functions using macro_insert, change by using muscle_insert ().
17913 (macro_obstack): Rename muscle_obstack.
17914 Echo modifications in the whole file.
17915 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
17916 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
17917 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
17918
17919 * src/muscle_tab.h: Update double inclusion macros.
17920 (macro_entry_s): Rename muscle_entry_s.
17921 Update prototypes.
17922
17923 * src/muscle_tab.c: Include muscle_tab.h.
17924 Rename macro_tabble to muscle_table.
17925 (mhash1, mhash2, mcmp): Use muscle_entry.
17926 (macro_init): Rename muscle_init. Update.
17927 (macro_insert): Rename muscle_insert. Update.
17928 (macro_find): Rename muscle_find. Update.
17929
17930 * src/main.c: Include muscle_tab.h.
17931 (main): Call muscle_init ().
17932 * src/Makefile.am (bison_SOURCES): Echo modifications.
17933
17934 2001-09-02 Marc Autret <autret_m@epita.fr>
17935
17936 Now the files macro_tab.[ch] are named muscle_tab.[ch].
17937
17938 * src/muscle_tab.c, src/muscle_tab.h: Add files.
17939
17940 2001-09-02 Marc Autret <autret_m@epita.fr>
17941
17942 * src/macrotab.c, src/macrotab.h: Remove.
17943
17944 2001-09-01 Pascal Bart <pascal.bart@epita.fr>
17945
17946 * src/reader.c (copy_guard): Use muscle to specify the `#line'
17947 filename.
17948
17949 2001-09-01 Marc Autret <autret_m@epita.fr>
17950
17951 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
17952 to an explicit value to activate the feature. We do it here.
17953
17954 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17955
17956 * src/output.c (prepare): Delete the `filename' muscule insertion.
17957 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
17958 (parse_union_decl): Likewise.
17959 * src/macrotab.c (macro_init): Initialize filename by infile.
17960
17961 2001-08-31 Marc Autret <autret_m@epita.fr>
17962
17963 * src/bison.simple (YYLSP_NEEDED): New definition.
17964 * src/output.c (prepare): Add macro insertion of `locations_flag'
17965
17966 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17967
17968 * src/output.c (prepare): Delete insertion of previous muscles,
17969 and insert the `prefix' muscles.
17970 * src/macrotab.c (macro_init): Likewise.
17971 (macro_init): Initialization prefix directive by `yy'.
17972 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17973 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
17974 yylval, yydebug, yyerror, yynerrs and yyparse.
17975 New directive `#define' to substitute yydebug, ... with option
17976 name_prefix.
17977
17978 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
17979
17980 * src/main.c (main): Standardize.
17981 * src/output.c (output_table_data, output_parser): Likewise.
17982 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
17983
17984 2001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
17985
17986 * src/reader.c (read_additionnal_code): Rename %%user_code to
17987 %%epilogue.
17988 * src/output.c (output): Rename %%declarations to %%prologue.
17989 * src/bison.simple: Echo modifications.
17990
17991 2001-08-31 Marc Autret <autret_m@epita.fr>
17992
17993 * src/reader.c (readgram): CleanUp.
17994 (output_token_defines): Likewise.
17995 (packsymbols): Likewise.
17996 (reader): Likewise.
17997 * src/output.c (output): CPP-out useless code.
17998
17999 2001-08-31 Pascal Bart <pascal.bart@epita.fr>
18000
18001 * src/reader.c (reader): Delete obsolete call to function
18002 output_trailers and output_headers.
18003 * src/output.h: Remove obsolete functions prototypes of output_headers
18004 and output_trailers.
18005
18006 2001-08-30 Pascal Bart <pascal.bart@epita.fr>
18007
18008 * src/main.c: Include macrotab.h.
18009 * src/macrotab.h (macro_entry_s): Constify fields.
18010 Adjust functions prototypes.
18011 * src/macrotab.c (macro_insert): Constify key and value.
18012 (macro_find): Constify key.
18013 (macro_insert): Include 'xalloc.h'
18014 (macro_insert): Use XMALLOC.
18015 (macro_find): Constify return value.
18016 * src/output.c (output_table_data): Rename table to table_data.
18017 (output_parser): Constify macro_key, macro_value.
18018
18019 2001-08-30 Marc Autret <autret_m@epita.fr>
18020
18021 * src/reader.c (parse_skel_decl): New.
18022 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
18023 * src/lex.h (token_t): New token `tok_skel'.
18024 * src/lex.c (percent_table): Add skeleton option entry.
18025 Standardize.
18026
18027 2001-08-29 Marc Autret <autret_m@epita.fr>
18028
18029 * src/bison.simple: Add %%user_code directive at the end.
18030 * src/reader.c (read_additionnal_code): New.
18031 (reader): Use it.
18032 * src/output.c (output_program): Remove.
18033 (output): Update.
18034
18035 2001-08-28 Marc Autret <autret_m@epita.fr>
18036
18037 * src/output.c (output_actions): Clean up.
18038 (output_gram): CPP-out useless code.
18039 * src/reader.c (reader): Clean up, CPP-out useless code.
18040
18041 2001-08-28 Pascal Bart <pascal.bart@epita.fr>
18042
18043 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
18044 directive.
18045 * src/bison.simple: Add `%%definitions'.
18046
18047 2001-08-28 Marc Autret <autret_m@epita.fr>
18048
18049 * config/depcomp: New file.
18050
18051 2001-08-27 Paul Eggert <eggert@twinsun.com>
18052
18053 * src/bison.simple (yyparse): Don't take the address of an
18054 item before the start of an array, as that doesn't conform to
18055 the C Standard.
18056
18057 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
18058
18059 * src/output.c (output): Remove the initialization of the macro
18060 obstack. It was done too late here.
18061
18062 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
18063 completely wrong.
18064 (reader): Initialize the macro obstack here, since we need it to grow
18065 '%define' directives.
18066
18067 * src/reader.h: Declare the macro obstack as extern.
18068
18069 2001-08-27 Robert Anisko <robert.anisko@epita.fr>
18070
18071 * src/output.c (output_parser): Fix. Store single '%' characters in
18072 the output obstack instead of throwing them away.
18073
18074 2001-08-27 Akim Demaille <akim@epita.fr>
18075
18076 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
18077
18078 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18079
18080 * lib/Makefile.am: Adjust.
18081
18082 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18083
18084 * src/bison.simple: Update and add '%%' directives.
18085
18086 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18087
18088 * src/reader.c (reader): Remove calls to 'output_headers' and
18089 'output_trailers'. Remove some C output.
18090 (readgram): Disable a piece of code that was writing a default
18091 definition for 'YYSTYPE'.
18092 (reader_output_yylsp): Remove.
18093 (packsymbols): Output token defintions to a macro.
18094 (copy_definition): Disable C output.
18095
18096 * src/reader.c (parse_macro_decl): New function used to parse macro
18097 declarations.
18098 (copy_string2): Put the body of copy_string into this new function.
18099 Add a parameter to let the caller choose whether he wants to copy the
18100 string delimiters or not.
18101 (copy_string): Be a simple call to copy_string2 with the last argument
18102 bound to true.
18103 (read_declarations): Add case for macro definition.
18104 (copy_identifier): New.
18105 (parse_macro_decl): Read macro identifiers using copy_identifier
18106 rather than lex.
18107
18108 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18109
18110 * src/output.c (prepare): Add prefixed names.
18111 (output_parser): Output semantic actions.
18112 (output_parser): Fix bug on '%%line' directives.
18113
18114 * src/output.c (output_headers): Remove. The C code printed by this
18115 function should now be in the skeletons.
18116 (output_trailers): Remove.
18117 (output): Disable call to 'reader_output_yylsp'.
18118 (output_rule_data): Do not output tables to the table obstack.
18119
18120 * src/output.c: Remove some C dedicated output.
18121 Improve the use of macro and output obstacks.
18122 (output_defines): Remove.
18123
18124 * src/output.c (output_token_translations): Associate 'translate'
18125 table with a macro. No output to the table obstack.
18126 (output_gram): Same for 'rhs' and 'prhs'.
18127 (output_stos): Same for 'stos'.
18128 (output_rule_data): Same for 'r1' and 'r2'.
18129 (token_actions): Same for 'defact'.
18130 (goto_actions): Same for 'defgoto'.
18131 (output_base): Same for 'pact' and 'pgoto'.
18132 (output_table): Same for 'table'.
18133 (output_check): Same for 'check'.
18134
18135 * src/output.c (output_table_data): New function.
18136 (output_short_table): Remove.
18137 (output_short_or_char_table): Remove.
18138
18139 * src/output.c (output_parser): Replace most of the skeleton copy code
18140 with something new. Skeletons are now processed character by character
18141 rather than line by line, and Bison looks for '%%' macros. This is the
18142 first step in making Bison's output process (a lot) more flexible.
18143 (output_parser): Use the macro table.
18144
18145 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18146
18147 * src/main.c (main): Initialize the macro table.
18148
18149 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18150
18151 * src/lex.c (percent_table): Add tok_define.
18152 * src/lex.h: Add tok_define.
18153
18154 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18155
18156 * src/macrotab.c: New file.
18157 * src/macrotab.h: New file.
18158 * src/Makefile.am: Update.
18159
18160 2001-08-25 Robert Anisko <robert.anisko@epita.fr>
18161
18162 * lib/hash.c: New file.
18163 * lib/hash.h: New file.
18164 * lib/Makefile.am: Update.
18165
18166 2001-08-15 Akim Demaille <akim@epita.fr>
18167
18168 Version 1.28c.
18169
18170 2001-08-15 Marc Autret <autret_m@epita.fr>
18171
18172 * src/reader.c (readgram): Indent output macro YYSTYPE.
18173 (packsymbols): Likewise.
18174 (output_token_defines): Likewise.
18175 * src/files.c: Standardize.
18176 (compute_header_macro): New.
18177 (defines_obstack_save): New. Use compute_header_macro.
18178 (output_files): Update. Use defines_obstack_save.
18179
18180 2001-08-15 Akim Demaille <akim@epita.fr>
18181
18182 * doc/bison.texinfo (Table of Symbols): Document
18183 YYSTACK_USE_ALLOCA.
18184
18185 2001-08-15 Akim Demaille <akim@epita.fr>
18186
18187 * missing: Update from CVS Automake.
18188 * config/config.guess, config/config.sub, config/texinfo.tex:
18189 Update from gnu.org.
18190
18191 2001-08-15 Akim Demaille <akim@epita.fr>
18192
18193 * Makefile.maint: Sync with CVS Autoconf.
18194
18195 2001-08-14 Pascal Bart <pascal.bart@epita.fr>
18196
18197 * doc/bison.texinfo: Include GNU Free Documentation License from
18198 `fdl.texi'.
18199 * doc/fdl.texi: Add to package.
18200
18201 2001-08-14 Marc Autret <autret_m@epita.fr>
18202
18203 Turn on %{source,header}_extension features.
18204
18205 * src/lex.c (percent_table): Un-CPP out header_extension and
18206 source_extension.
18207 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
18208 (compute_exts_from_src): Remove conditions. It restores priorities
18209 between options.
18210
18211 2001-08-14 Marc Autret <autret_m@epita.fr>
18212
18213 * src/files.c (compute_base_names): Add extensions computing when
18214 `--file-prefix' used.
18215 Standardize function calls.
18216
18217 2001-08-13 Marc Autret <autret_m@epita.fr>
18218
18219 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
18220 defining it (defined but null disables alloca).
18221
18222 2001-08-13 Marc Autret <autret_m@epita.fr>
18223
18224 * src/bison.simple (_yy_memcpy): CPP reformat.
18225
18226 2001-08-13 Pascal Bart <pascal.bart@epita.fr>
18227
18228 * tests/atconfig.in (CPPFLAGS): Fix.
18229
18230 2001-08-10 Pascal Bart <pascal.bart@epita.fr>
18231
18232 * doc/bison.texinfo: Include GNU General Public License from
18233 `gpl.texi'.
18234 * doc/gpl.texi: Add to package.
18235
18236 2001-08-10 Marc Autret <autret_m@epita.fr>
18237
18238 * src/print_graph.h: Fix.
18239 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
18240
18241 2001-08-10 Akim Demaille <akim@epita.fr>
18242
18243 * src/system.h: Provide default declarations for stpcpy, strndup,
18244 and strnlen.
18245
18246 2001-08-10 Robert Anisko <anisko_r@epita.fr>
18247
18248 * doc/bison.texinfo (Locations): Update @$ stuff.
18249
18250 2001-08-09 Robert Anisko <anisko_r@epita.fr>
18251
18252 * src/bison.simple (YYLLOC_DEFAULT): Update.
18253 (yyparse): Adjust.
18254
18255 2001-08-08 Marc Autret <autret_m@epita.fr>
18256
18257 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
18258 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
18259 Reported by Fabrice Bauzac.
18260
18261 2001-08-08 Marc Autret <autret_m@epita.fr>
18262
18263 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
18264 * src/vcg.c (output_node): Fix.
18265 * src/vcg.h: Cleanup.
18266 * src/print_graph.c: Add comments.
18267 (node_output_size): New global variable. Simplify the formatting of
18268 the VCG graph output.
18269 (print_actions): Unused code is now used. It notifies the final state
18270 and no action states in the VCG graph. It also give the reduce actions.
18271 The `shift and goto' edges are red and the `go to state' edges are
18272 blue.
18273 Get the current node name and node_obstack by argument.
18274 (node_obstack): New variable.
18275 (print_state): Manage node_obstack.
18276 (print_core): Use node_obstack given by argument.
18277 A node is not only computed here but in print_actions also.
18278 (print_graph): CPP out useless code instead of commenting it.
18279
18280 2001-08-07 Pascal Bart <pascal.bart@epita.fr>
18281
18282 * tests/atconfig.in (CPPFLAGS): Fix.
18283
18284 2001-08-07 Akim Demaille <akim@epita.fr>
18285
18286 * src/print_graph.c (quote): New.
18287 (print_core): Use it.
18288
18289 2001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
18290
18291 * src/vcg.c (complain.h): Include it.
18292 Unepitaize `return' invocations.
18293 [NDEBUG] (main): Remove.
18294 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
18295 * src/files.c (open_files): Initialize graph_obstack.
18296 * src/print_graph.c (print_actions): CPP out useless code.
18297 (print_core): Don't output the last `\n' in labels.
18298 Use `quote'.
18299 * src/files.c (output_files): Output the VCG file.
18300 * src/main.c (main): Invoke print_graph ();
18301
18302 2001-08-06 Marc Autret <autret_m@epita.fr>
18303
18304 Automaton VCG graph output.
18305 Using option ``-g'' or long option ``--graph'', you can generate
18306 a gram_filename.vcg file containing a VCG description of the LALR (1)
18307 automaton of your grammar.
18308
18309 * src/main.c: Call to print_graph() function.
18310 * src/getargs.h: Update.
18311 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
18312 (graph_flag): New flag.
18313 (longopts): Update.
18314 (getargs): Add case `g'.
18315 * src/files.c (graph_obstack): New obstack struct.
18316 (open_files): Initialize new obstack.
18317 (output_files): Saves graph_obstack if required.
18318 * src/files.h (graph_obstack): New extern declaration.
18319 * src/Makefile.am: Add new source files.
18320
18321 2001-08-06 Marc Autret <autret_m@epita.fr>
18322
18323 * src/print_graph.c, src/print_graph.h (graph): New.
18324 * src/vcg.h: New file.
18325 * src/vcg.c: New file, VCG graph handling.
18326
18327 2001-08-06 Marc Autret <autret_m@epita.fr>
18328
18329 Add of %source_extension and %header_extension which specify
18330 the source or/and the header output file extension.
18331
18332 * src/files.c (compute_base_names): Remove initialisation of
18333 src_extension and header_extension.
18334 (compute_exts_from_gf): Update.
18335 (compute_exts_from_src): Update.
18336 (output_files): Update.
18337 * src/reader.c (parse_header_extension_decl): New.
18338 (parse_source_extension_decl): New.
18339 (read_declarations): New case statements for the new tokens.
18340 * src/lex.c (percent_table): Add entries for %source_extension
18341 and %header_extension.
18342 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
18343
18344 2001-08-06 Marc Autret <autret_m@epita.fr>
18345
18346 * configure.in: Bump to 1.28c.
18347 * doc/bison.texinfo: Texinfo thingies.
18348
18349 2001-08-04 Pascal Bart <pascal.bart@epita.fr>
18350
18351 * tests/atconfig.in (CPPFLAGS): Add.
18352 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
18353
18354 2001-08-03 Akim Demaille <akim@epita.fr>
18355
18356 Version 1.28b.
18357
18358 2001-08-03 Akim Demaille <akim@epita.fr>
18359
18360 * tests/Makefile.am (check-local): Ship testsuite.
18361 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
18362 Include `string.h'.
18363
18364 2001-08-03 Akim Demaille <akim@epita.fr>
18365
18366 * configure.in: Try using -Wformat when compiling.
18367
18368 2001-08-03 Akim Demaille <akim@epita.fr>
18369
18370 * configure.in: Bump to 1.28b.
18371
18372 2001-08-03 Akim Demaille <akim@epita.fr>
18373
18374 * src/complain.c: Adjust strerror_r portability issues.
18375
18376 2001-08-03 Akim Demaille <akim@epita.fr>
18377
18378 Version 1.28a.
18379
18380 2001-08-03 Akim Demaille <akim@epita.fr>
18381
18382 * src/getargs.c, src/getarg.h (skeleton)): Constify.
18383 * src/lex.c (literalchar): Avoid name clashes on `buf'.
18384 * src/getargs.c: Include complain.h.
18385 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
18386 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
18387
18388 2001-08-03 Akim Demaille <akim@epita.fr>
18389
18390 * src/reader.c (readgram): Display hidden chars in error messages.
18391
18392 2001-08-03 Akim Demaille <akim@epita.fr>
18393
18394 Update to gettext 0.10.39.
18395
18396 2001-08-03 Akim Demaille <akim@epita.fr>
18397
18398 * lib/strspn.c: New.
18399
18400 2001-08-01 Marc Autret <autret_m@epita.fr>
18401
18402 * doc/bison.texinfo: Update.
18403 * doc/bison.1 (mandoc): Update.
18404 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
18405 * src/files.c: Support output files extensions computing.
18406 (src_extension): New static variable.
18407 (header_extension): New static variable.
18408 (tr): New function.
18409 (get_extension_index): New function, gets the index of an extension
18410 filename in a string.
18411 (compute_exts_from_gf): New function, computes extensions from the
18412 grammar file extension.
18413 (compute_exts_from_src): New functions, computes extensions from the
18414 C source file extension, file given by ``-o'' option.
18415 (compute_base_names): Update.
18416 (output_files): Update.
18417
18418 2001-08-01 Robert Anisko <anisko_r@epita.fr>
18419
18420 * doc/bison.texi: Document @$.
18421 (Locations): New section.
18422
18423 2001-07-18 Akim Demaille <akim@epita.fr>
18424
18425 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
18426 * config/prev-version.txt, config/move-if-change: New.
18427 * Makefile.am: Adjust.
18428
18429 2001-07-08 Pascal Bart <pascal.bart@epita.fr>
18430
18431 * src/bison.simple (yyparse): Suppress warning `comparaison
18432 between signed and unsigned'.
18433
18434 2001-07-05 Pascal Bart <pascal.bart@epita.fr>
18435
18436 * src/getargs.h (raw_flag): Remove.
18437 * src/getargs.c: Die on `-r'/`--raw'.
18438 * src/lex.c (parse_percent_token): Die on `%raw'.
18439 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
18440 * tests/calc.at: Suppress test with option `--raw'.
18441
18442 2001-07-14 Akim Demaille <akim@epita.fr>
18443
18444 * config/: New.
18445 * configure.in: Require Autoconf 2.50.
18446 Update to gettext 0.10.38.
18447
18448 2001-03-16 Akim Demaille <akim@epita.fr>
18449
18450 * doc/bison.texinfo: ANSIfy the examples.
18451
18452 2001-03-16 Akim Demaille <akim@epita.fr>
18453
18454 * getargs.c (skeleton): New variable.
18455 (longopts): --skeleton is a new option.
18456 (shortopts, getargs): -S is a new option.
18457 * getargs.h: Declare skeleton.
18458 * output.c (output_parser): Use it.
18459
18460 2001-03-16 Akim Demaille <akim@epita.fr>
18461
18462 * m4/strerror_r.m4: New.
18463 * m4/error.m4: Run AC_FUNC_STRERROR_R.
18464 * lib/error.h, lib/error.c: Update.
18465
18466 2001-03-16 Akim Demaille <akim@epita.fr>
18467
18468 * src/getargs.c (longopts): Clean up.
18469
18470 2001-02-21 Akim Demaille <akim@epita.fr>
18471
18472 * src/reader.c (gensym): `gensym_count' is your own.
18473 Use a static buf to create the symbol name, as token_buffer is no
18474 longer a buffer.
18475
18476 2001-02-08 Akim Demaille <akim@epita.fr>
18477
18478 * src/conflicts.c (conflict_report): Be sure not to append to res
18479 between two calls, which could happen if both first sprintf were
18480 skipped, but not the first cp += strlen.
18481
18482 2001-02-08 Akim Demaille <akim@epita.fr>
18483
18484 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
18485 New, from fileutils 4.0.37.
18486 * configure.in: Require Autoconf 2.49c. I took some time before
18487 making this decision. This is the only way out for portability
18488 issues in Bison, it would mean way too much duplicate effort to
18489 import in Bison features implemented in 2.49c since 2.13.
18490 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
18491
18492 2001-02-02 Akim Demaille <akim@epita.fr>
18493
18494 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
18495 * lib/xalloc.h, lib/xmalloc.c: Update.
18496
18497 2001-01-19 Akim Demaille <akim@epita.fr>
18498
18499 Get rid of the ad hoc handling of token_buffer in the scanner: use
18500 the obstacks.
18501
18502 * src/lex.c (token_obstack): New.
18503 (init_lex): Initialize it. No longer call...
18504 (grow_token_buffer): this. Remove it.
18505 Adjust all the places which used it to use the obstack.
18506
18507 2001-01-19 Akim Demaille <akim@epita.fr>
18508
18509 * src/lex.h: Rename all the tokens:
18510 s/\bENDFILE\b/tok_eof/g;
18511 s/\bIDENTIFIER\b/tok_identifier/g;
18512 etc.
18513 Let them be enums, not #define, to ease debugging.
18514 Adjust all the code.
18515
18516 2001-01-18 Akim Demaille <akim@epita.fr>
18517
18518 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
18519 * src/lex.c (maxtoken, grow_token_buffer): Static.
18520
18521 2001-01-18 Akim Demaille <akim@epita.fr>
18522
18523 Since we now use obstacks, more % directives can be enabled.
18524
18525 * src/lex.c (percent_table): Also accept `%yacc',
18526 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
18527 `%debug'.
18528 Handle the actions for `%semantic_parser' and `%pure_parser' here,
18529 instead of returning a token.
18530 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
18531 * src/reader.c (read_declarations): Adjust.
18532 * src/files.c (open_files): Don't call `compute_base_names', don't
18533 compute `attrsfile' since they depend upon data which might be
18534 *in* the input file now.
18535 (output_files): Do it here.
18536 * src/output.c (output_headers): Document the fact that this patch
18537 introduces a guaranteed SEGV for semantic parsers.
18538 * doc/bison.texinfo: Document them.
18539 * tests/suite.at: Exercise these %options.
18540
18541 2000-12-20 Akim Demaille <akim@epita.fr>
18542
18543 Also handle the output file (--verbose) with obstacks.
18544
18545 * files.c (foutput): Remove.
18546 (output_obstack): New.
18547 Adjust all dependencies.
18548 * src/conflicts.c: Return a string.
18549 * src/system.h (obstack_grow_string): Rename as...
18550 (obstack_sgrow): this. Be ready to work with non literals.
18551 (obstack_fgrow4): New.
18552
18553 2000-12-20 Akim Demaille <akim@epita.fr>
18554
18555 * src/files.c (open_files): Fix the computation of short_base_name
18556 in the case of `-o foo.tab.c'.
18557
18558 2000-12-20 Akim Demaille <akim@epita.fr>
18559
18560 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
18561 (copy_dollar): Now that everything uses obstacks, get rid of the
18562 FILE * parameters.
18563
18564 2000-12-20 Akim Demaille <akim@epita.fr>
18565
18566 * src/files.c (open_files): Actually the `.output' file is based
18567 on the short_base_name, not base_name.
18568 * tests/suite.at (Checking output file names): Adjust.
18569
18570 2000-12-20 Akim Demaille <akim@epita.fr>
18571
18572 * src/bison.s1: Remove, we now use directly...
18573 * src/bison.simple: this.
18574 * src/Makefile.am: Use pkgdata instead of data.
18575
18576 2000-12-20 Akim Demaille <akim@epita.fr>
18577
18578 * src/files.c (guard_obstack): New.
18579 (open_files): Initialize it.
18580 (output_files): Dump it...
18581 * src/files.h: Export it.
18582 * src/reader.c (copy_guard): Use it.
18583
18584 2000-12-19 Akim Demaille <akim@epita.fr>
18585
18586 * src/files.c (outfile, defsfile, actfile): Removed as global
18587 vars.
18588 (open_files): Don't compute them.
18589 (output_files): Adjust.
18590 (base_name, short_base_name): Be global.
18591 Adjust dependencies.
18592
18593 2000-12-19 Akim Demaille <akim@epita.fr>
18594
18595 * src/files.c (strsuffix): New.
18596 (stringappend): Be just like strcat but allocate.
18597 (base_names): Eve out from open_files.
18598 Try to simplify the rather hairy computation of base_name and
18599 short_base_name.
18600 (open_files): Use it.
18601 * tests/suite.at (Checking output file names): New test.
18602
18603 2000-12-19 Akim Demaille <akim@epita.fr>
18604
18605 * src/system.h (obstack_grow_literal_string): Rename as...
18606 (obstack_grow_string): this.
18607 * src/output.c (output_parser): Recognize `%% actions' instead of
18608 `$'.
18609 * src/bison.s1: s/$/%% actions/.
18610 * src/bison.hairy: Likewise.
18611
18612 2000-12-19 Akim Demaille <akim@epita.fr>
18613
18614 * src/output.c (output_parser): Compute the `#line' lines when
18615 there are.
18616 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
18617 Suggested by Hans Aberg.
18618
18619 2000-12-19 Akim Demaille <akim@epita.fr>
18620
18621 Let the handling of the skeleton files be local to the procedures
18622 that use it.
18623
18624 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
18625 longer static.
18626 (fparser, open_extra_files): Remove.
18627 (open_files, output_files): Don't take care of fparser.
18628 * src/files.h: Adjust.
18629 * src/output.c (output_parser): Open and close the file to the
18630 skeleton.
18631 * src/reader.c (read_declarations): When %semantic_parser, open
18632 fguard.
18633
18634 2000-12-19 Akim Demaille <akim@epita.fr>
18635
18636 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
18637 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
18638
18639 2000-12-19 Akim Demaille <akim@epita.fr>
18640
18641 * src/files.c (open_files): Yipee! We no longer need all the code
18642 looking for `/tmp' since we have no tmp file.
18643
18644 2000-12-19 Akim Demaille <akim@epita.fr>
18645
18646 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
18647 New macros.
18648 * src/files.c (open_files): Less dependency on MSDOS etc.
18649
18650 2000-12-14 Akim Demaille <akim@epita.fr>
18651
18652 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
18653 Provide a default definition.
18654 Use it when executing the default @ action.
18655 * src/reader.c (reader_output_yylsp): No longer include
18656 `timestamp' and `text' in the default YYLTYPE.
18657
18658 2000-12-12 Akim Demaille <akim@epita.fr>
18659
18660 * src/reader.c (copy_definition, parse_union_decl, copy_action)
18661 (copy_guard): Quote the file names.
18662 Reported by Laurent Mascherpa.
18663
18664 2000-12-12 Akim Demaille <akim@epita.fr>
18665
18666 * src/output.c (output_headers, output_program, output): Be sure
18667 to escape special characters when outputting filenames.
18668 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
18669 (output_headers): Don't depend on them, Use ACTSTR.
18670
18671 2000-11-17 Akim Demaille <akim@epita.fr>
18672
18673 * lib/obstack.h: Formatting changes.
18674 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
18675 prevents type checking.
18676 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
18677 cast the value to (void *): assigning a `foo *' to a `void *'
18678 variable is valid.
18679 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
18680 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
18681 append characters.
18682
18683 2000-11-17 Akim Demaille <akim@epita.fr>
18684
18685 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
18686 as...
18687 (suite.m4, regression.m4, calc.m4): these.
18688 * tests/atgeneral.m4: Update from CVS Autoconf.
18689
18690 2000-11-17 Akim Demaille <akim@epita.fr>
18691
18692 * tests/regression.m4 (%union and --defines): New test,
18693 demonstrating a current bug in the obstack implementation.
18694
18695 2000-11-17 Akim Demaille <akim@epita.fr>
18696
18697 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
18698 macros.
18699 Use them to declare the variables which are global or local to
18700 `yyparse'.
18701
18702 2000-11-17 Akim Demaille <akim@epita.fr>
18703
18704 * acconfig.h: Remove, no longer used.
18705
18706 2000-11-07 Akim Demaille <akim@epita.fr>
18707
18708 * src: s/Copyright (C)/Copyright/g.
18709
18710 2000-11-07 Akim Demaille <akim@epita.fr>
18711
18712 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
18713 defining.
18714 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
18715
18716 2000-11-07 Akim Demaille <akim@epita.fr>
18717
18718 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
18719 Merge in a single CPP if/else.
18720
18721 2000-11-07 Akim Demaille <akim@epita.fr>
18722
18723 * src/output.c (output): Remove useless variables.
18724 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
18725 argument `data' for consistency with the prototypes.
18726 Qualify it `const'.
18727 (obstack_copy, obstack_copy0): Rename the second argument as
18728 `address' for consistency. Qualify it `const'.
18729 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
18730 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
18731 `const' their input argument (`data' or `address').
18732 Adjust the corresponding macros to include `const' in casts.
18733
18734 2000-11-03 Akim Demaille <akim@epita.fr>
18735
18736 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
18737 s/PFILE1/BISON_HAIRY/.
18738 Adjust dependencies.
18739
18740 2000-11-03 Akim Demaille <akim@epita.fr>
18741
18742 For some reason, this was not applied.
18743
18744 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18745 `unlink': it's no longer used.
18746
18747 2000-11-03 Akim Demaille <akim@epita.fr>
18748
18749 * src/files.c (skeleton_find): New function, eved out of...
18750 (open_files, open_extra_files): here.
18751
18752 2000-11-03 Akim Demaille <akim@epita.fr>
18753
18754 Don't use `atexit'.
18755
18756 * src/files.c (obstack_save): New function.
18757 (done): Rename as...
18758 (output_files): this.
18759 Use `obstack_save'.
18760 * src/main.c (main): Don't use `atexit' to register `done', since
18761 it no longer has to remove tmp files, just call `output_files'
18762 when there are no errors.
18763
18764 2000-11-02 Akim Demaille <akim@epita.fr>
18765
18766 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18767 `unlink': it's no longer used.
18768 * src/files.h: Formatting changes.
18769
18770 2000-11-02 Akim Demaille <akim@epita.fr>
18771
18772 Remove the last uses of mktemp and unlink/delete.
18773
18774 * src/files.c (fdefines, ftable): Removed.
18775 (defines_ostack, table_obstack): New.
18776 Adjust dependencies of the former into uses of the latter.
18777 * src/output.c (output_short_or_char_table, output_short_table):
18778 Convert to using obstacks.
18779 * src/reader.c (copy_comment2): Accept one FILE * and two
18780 obstacks.
18781 (output_token_defines, reader_output_yylsp): Use obstacks.
18782 * src/system.h (obstack_fgrow3): New.
18783 * po/POTFILES.in: Adjust.
18784
18785 2000-11-01 Akim Demaille <akim@epita.fr>
18786
18787 Change each use of `fattrs' into a use of `attrs_obstack'.
18788
18789 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
18790 * src/files.c (fattrs): Remove.
18791 (attrs_obstack): New.
18792 Adjust all dependencies.
18793 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
18794
18795 2000-11-01 Akim Demaille <akim@epita.fr>
18796
18797 Introduce obstacks.
18798 Change each use of `faction' into a use of `action_obstack'.
18799
18800 * lib/obstack.h, lib/obstack.c: New files.
18801 * src/files.c (faction): Remove.
18802 (action_obstack): New.
18803 Adjust all dependencies.
18804
18805 2000-10-20 Akim Demaille <akim@epita.fr>
18806
18807 * lib/quote.h (PARAMS): New macro. Use it.
18808
18809 2000-10-16 Akim Demaille <akim@epita.fr>
18810
18811 * src/output.c (output_short_or_char_table): New function.
18812 (output_short_table, output_token_translations): Use it.
18813 (goto_actions): Use output_short_table.
18814
18815 2000-10-16 Akim Demaille <akim@epita.fr>
18816
18817 * src/symtab.c (bucket_new): New function.
18818 (getsym): Use it.
18819
18820 * src/output.c (output_short_table): New argument to display the
18821 comment associated with the table.
18822 Adjust dependencies.
18823 (output_gram): Use it.
18824 (output_rule_data): Nicer output layout for YYTNAME.
18825
18826 2000-10-16 Akim Demaille <akim@epita.fr>
18827
18828 * src/lex.c (read_typename): New function.
18829 (lex): Use it.
18830 * src/reader.c (copy_dollar): Likewise.
18831
18832 2000-10-16 Akim Demaille <akim@epita.fr>
18833
18834 * src/reader.c (copy_comment2): Expect the input stream to be on
18835 the `/' which is suspected to open a comment, instead of being
18836 called after `//' or `/*' was read.
18837 (copy_comment, copy_definition, parse_union_decl, copy_action)
18838 (copy_guard): Adjust.
18839
18840 2000-10-16 Akim Demaille <akim@epita.fr>
18841
18842 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
18843 `read_signed_integer'.
18844
18845 2000-10-16 Akim Demaille <akim@epita.fr>
18846
18847 * src/reader.c (copy_dollar): New function.
18848 (copy_guard, copy_action): Use it.
18849
18850 2000-10-16 Akim Demaille <akim@epita.fr>
18851
18852 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
18853 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
18854 New files, from Fileutils 4.0.27.
18855 * src/main.c (printable_version): Remove.
18856 * src/lex.c, src/reader.c: Use `quote'.
18857
18858 2000-10-04 Akim Demaille <akim@epita.fr>
18859
18860 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
18861
18862 2000-10-04 Akim Demaille <akim@epita.fr>
18863
18864 * doc/bison.texinfo: Various typos spotted by Neil Booth.
18865
18866 2000-10-04 Akim Demaille <akim@epita.fr>
18867
18868 When a literal string is used to define two different tokens,
18869 `bison -v' segfaults.
18870 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
18871
18872 * tests/regression.m4: New file.
18873 Include the core of the sample provided by Piotr Gackiewicz.
18874 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
18875 properly.
18876
18877 2000-10-04 Akim Demaille <akim@epita.fr>
18878
18879 * src/reader.c (parse_expect_decl): Keep `count' within the size
18880 of `buffer'.
18881 From Neil Booth.
18882
18883 2000-10-02 Paul Eggert <eggert@twinsun.com>
18884
18885 * bison.s1 (yyparse): Assign the default value
18886 unconditionally, to avoid a GCC warning and make the parser a
18887 tad smaller.
18888
18889 2000-10-02 Akim Demaille <akim@epita.fr>
18890
18891 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
18892 options.
18893
18894 2000-10-02 Akim Demaille <akim@epita.fr>
18895
18896 * src/derives.c, src/print.c, src/reduce.c: To ease the
18897 translation, move some `\n' out of the translated strings.
18898
18899 2000-10-02 Akim Demaille <akim@epita.fr>
18900
18901 The location tracking mechanism is precious for parse error
18902 messages. Nevertheless, it is enabled only when `@n' is used in
18903 the grammar, which is a different issue (you can use it in error
18904 message, but not in the grammar per se). Therefore, there should
18905 be another means to enable it.
18906
18907 * src/getargs.c (getargs): Support `--locations'.
18908 (usage): Report it.
18909 * src/getargs.h (locationsflag): Export it.
18910 * src/lex.c (percent_table): Support `%locations'.
18911 * src/reader.c (yylsp_needed): Remove this variable, now replaced
18912 with `locationsflag'.
18913 * doc/bison.texinfo: Document `--locations' and `%locations'.
18914 Sort the options.
18915 * tests/calc.m4: Test it.
18916
18917 For regularity of the names, replace each
18918 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
18919 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
18920 In addition replace each `flag' with `_flag'.
18921
18922 2000-10-02 Akim Demaille <akim@epita.fr>
18923
18924 Also test parse error messages, including with YYERROR_VERBOSE.
18925
18926 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
18927 associative).
18928 Use it to check the computations.
18929 Use it to check `nonassoc' is honored.
18930 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
18931 `--yyerror-verbose'.
18932 (_AT_CHECK_CALC): Adjust to this option.
18933 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
18934
18935 2000-10-02 Akim Demaille <akim@epita.fr>
18936
18937 Test also `--verbose', `--defines' and `--name-prefix'. Testing
18938 the latter demonstrates a flaw in the handling of non debugging
18939 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
18940 was used in order to simplify:
18941
18942 #if YYDEBUG
18943 if (yydebug)
18944 {
18945 ...
18946 }
18947 #endif
18948
18949 into
18950
18951 if (yydebug)
18952 {
18953 ...
18954 }
18955
18956 unfortunately this leads to a CPP conflict when
18957 `--name-prefix=foo' is used since it produces `#define yydebug
18958 foodebug'.
18959
18960 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
18961 (YYDPRINTF): New macro.
18962 Spread its use.
18963 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
18964 the bison options.
18965 Also test `--verbose', `--defines' and `--name-prefix'.
18966
18967 2000-10-02 Akim Demaille <akim@epita.fr>
18968
18969 Improve the readability of the produced parsers.
18970
18971 * src/bison.s1: Formatting changes.
18972 Improve the comment related to the `$' mark.
18973 (yydefault): Don't fall through to `yyresume': `goto' there.
18974 * src/output.c (output_parser): When the `$' is met, skip the end
18975 of its line.
18976 New variable, `number_of_dollar_signs', to check there's exactly
18977 one `$' in the parser skeleton.
18978
18979 2000-10-02 Akim Demaille <akim@epita.fr>
18980
18981 * lib/xstrdup.c: New file, from the fileutils.
18982 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
18983 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
18984 instead of strlen + xmalloc + strcpy.
18985 * src/symtab.c (copys): Remove, use xstrdup instead.
18986
18987 2000-10-02 Akim Demaille <akim@epita.fr>
18988
18989 * src/gram.h (associativity): New enum type which replaces the
18990 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
18991 `right_assoc', `left_assoc' and `non_assoc'.
18992 Adjust all dependencies.
18993 * src/reader.c: Formatting changes.
18994 (LTYPESTR): Don't define it, use it as a literal in
18995 `reader_output_yylsp'.
18996 * src/symtab.h (symbol_class): New enum type which replaces the
18997 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
18998 `sunknown', `stoken and `snterm'.
18999
19000 2000-10-02 Akim Demaille <akim@epita.fr>
19001
19002 * src/getargs.c (fixed_outfiles): Rename as...
19003 (yaccflag): for consistency and accuracy.
19004 Adjust dependencies.
19005
19006 2000-10-02 Akim Demaille <akim@epita.fr>
19007
19008 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
19009 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
19010 difficult and introduced a lot of core dump. It turns out that
19011 Bison used an implementation of `xmalloc' based on `calloc', and
19012 at various places it does depend upon the initialization to 0. I
19013 have not tried to isolate the pertinent places, and all the former
19014 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
19015 someone should address this issue.
19016
19017 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
19018 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
19019 files.
19020 Adjust dependencies.
19021 * src/warshall.h: New file.
19022 Propagate.
19023
19024 2000-10-02 Akim Demaille <akim@epita.fr>
19025
19026 Various anti-`extern in *.c' changes.
19027
19028 * src/system.h: Include `assert.h'.
19029
19030 2000-10-02 Akim Demaille <akim@epita.fr>
19031
19032 * src/state.h (nstates, final_state, first_state, first_shift)
19033 (first_reduction): Move their exportation from here...
19034 * src/LR0.h: to here.
19035 Adjust dependencies.
19036 * src/getargs.c (statisticsflag): New variable.
19037 Add support for `--statistics'.
19038 Adjust dependencies.
19039
19040 Remove a lot of now useless `extern' statements in most files.
19041
19042 2000-10-02 Akim Demaille <akim@epita.fr>
19043
19044 * src/LR0.h: New file.
19045 Propagate its use.
19046
19047 2000-10-02 Akim Demaille <akim@epita.fr>
19048
19049 * src/print.h: New file.
19050 Propagate its use.
19051 * src/print.c: Formatting and ordering changes.
19052 (verbose, terse): Replace with...
19053 (print_results): this new function.
19054 Adjust dependencies.
19055
19056 2000-10-02 Akim Demaille <akim@epita.fr>
19057
19058 * src/conflicts.c (conflict_report): New function.
19059 (conflict_log, verbose_conflict_log): Replace with...
19060 (print_conflicts): this function.
19061 Adjust dependencies.
19062 * src/conflicts.h: New file.
19063 Propagate its inclusion.
19064
19065 2000-10-02 Akim Demaille <akim@epita.fr>
19066
19067 * src/nullable.h: New file.
19068 Propagate its inclusion.
19069 * src/nullable.c: Formatting changes.
19070
19071 2000-10-02 Akim Demaille <akim@epita.fr>
19072
19073 * src/reduce.h: New file.
19074 Propagate its inclusion.
19075 * src/reduce.c: Topological sort and other formatting changes.
19076 (bool, TRUE, FALSE): Move their definition to...
19077 * src/system.h: here.
19078
19079 2000-10-02 Akim Demaille <akim@epita.fr>
19080
19081 * src/files.c: Formatting changes.
19082 (tryopen, tryclose, openfiles): Rename as...
19083 (xfopen, xfclose, open_files): this.
19084 (stringappend): static.
19085 * src/files.h: Complete the list of exported symbols.
19086 Propagate its use.
19087
19088 2000-10-02 Akim Demaille <akim@epita.fr>
19089
19090 * src/reader.h: New file.
19091 Propagate its use instead of tedious list of `extern' and
19092 prototypes.
19093 * src/reader.c: Formatting changes, topological sort,
19094 s/register//.
19095
19096 2000-10-02 Akim Demaille <akim@epita.fr>
19097
19098 * src/lex.h: Prototype `lex.c' exported functions.
19099 * src/reader.c: Adjust.
19100 * src/lex.c: Formatting changes.
19101 (safegetc): Rename as...
19102 (xgetc): this.
19103
19104 2000-10-02 Akim Demaille <akim@epita.fr>
19105
19106 * src/lalr.h: New file.
19107 Propagate its inclusion instead of prototypes and `extern'.
19108 * src/lalr.c: Formatting changes, topological sorting etc.
19109
19110 2000-10-02 Akim Demaille <akim@epita.fr>
19111
19112 * src/output.c (token_actions): Introduce a temporary array,
19113 YYDEFACT, that makes it possible for this function to use
19114 output_short_table.
19115
19116 2000-10-02 Akim Demaille <akim@epita.fr>
19117
19118 `user_toknums' is output as a `short[]' in `output.c', while it is
19119 defined as a `int[]' in `reader.c'. For consistency with the
19120 other output tables, `user_toknums' is now defined as a table of
19121 shorts.
19122
19123 * src/reader.c (user_toknums): Be a short table instead of an int
19124 table.
19125 Adjust dependencies.
19126
19127 Factor the short table outputs.
19128
19129 * src/output.c (output_short_table): New function.
19130 * src/output.c (output_gram, output_stos, output_rule_data)
19131 (output_base, output_table, output_check): Use it.
19132
19133 2000-10-02 Akim Demaille <akim@epita.fr>
19134
19135 * src/output.c (output): Topological sort of the functions, in
19136 order to get rid of the `static' prototypes.
19137 No longer use `register'.
19138 * src/output.h: New file.
19139 Propagate its inclusion in files explicitly prototyping functions
19140 from output.c.
19141
19142 2000-09-21 Akim Demaille <akim@epita.fr>
19143
19144 * src/atgeneral.m4: Update from Autoconf.
19145
19146 2000-09-21 Akim Demaille <akim@epita.fr>
19147
19148 * src/closure.h: New file.
19149 * src/closure.c: Formatting changes, topological sort over the
19150 functions, use of closure.h.
19151 (initialize_closure, finalize_closure): Rename as...
19152 (new_closure, free_closure): these. Adjust dependencies.
19153 * src/LR0.c: Formatting changes, topological sort, use of
19154 cloture.h.
19155 (initialize_states): Rename as...
19156 (new_states): this.
19157 * src/Makefile.am (noinst_HEADERS): Adjust.
19158
19159 2000-09-20 Akim Demaille <akim@epita.fr>
19160
19161 * src/acconfig.h: Don't protect config.h against multiple
19162 inclusion.
19163 Don't define PARAMS.
19164 * src/system.h: Define PARAMS.
19165 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
19166 purpose of config.h. system.h must not try to fix wrong
19167 definitions in config.h.
19168
19169 2000-09-20 Akim Demaille <akim@epita.fr>
19170
19171 * src/derives.h: New file.
19172 * src/main.c, src/derives.h: Use it.
19173 Formatting changes.
19174 * src/Makefile.am (noinst_HEADERS): Adjust.
19175
19176 2000-09-20 Akim Demaille <akim@epita.fr>
19177
19178 * tests/atgeneral.m4: Update from Autoconf.
19179 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
19180 (AT_CHECK_CALC): New macros.
19181 Use these macros to test bison with options `', `--raw',
19182 `--debug', `--yacc', `--yacc --debug'.
19183
19184 2000-09-19 Akim Demaille <akim@epita.fr>
19185
19186 * src/output.c: Formatting changes.
19187 * src/machine.h: Remove, leaving its contents in...
19188 * src/system.h: here.
19189 Include stdio.h.
19190 Adjust all dependencies on stdio.h and machine.h.
19191 * src/getargs.h: New file.
19192 Let all `extern' declarations about getargs.c be replaced with
19193 inclusion of `getargs.h'.
19194 * src/Makefile.am (noinst_HEADERS): Adjust.
19195
19196 * tests/calc.m4 (yyin): Be initialized in main, not on the global
19197 scope.
19198 (yyerror): Returns void, not int.
19199 * doc/bison.texinfo: Formatting changes.
19200
19201 2000-09-19 Akim Demaille <akim@epita.fr>
19202
19203 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
19204 portable.
19205
19206 2000-09-18 Akim Demaille <akim@epita.fr>
19207
19208 * configure.in: Append WARNING_CFLAGS to CFLAGS.
19209 * src/Makefile.am (INCLUDES): Don't.
19210 Be ready to fetch headers in lib/.
19211
19212 2000-09-18 Akim Demaille <akim@epita.fr>
19213
19214 * doc/bison.texinfo: Update the copyright.
19215 ANSIfy and GNUify the examples.
19216 Remove the old menu.
19217
19218 2000-09-18 Akim Demaille <akim@epita.fr>
19219
19220 First set of tests: use the `calc' example from the documentation.
19221
19222 * src/bison.s1 (yyparse): Condition the code using `yytname' which
19223 is defined only when YYDEBUG is.
19224 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
19225 * src/files.c (tryopen, tryclose): Formatting changes.
19226 Move to the top and be static.
19227 * src/reader.c (read_signed_integer): Likewise.
19228 * tests/calc.m4: New file.
19229 * Makefile.am, suite.m4: Adjust.
19230 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
19231
19232 2000-09-18 Akim Demaille <akim@epita.fr>
19233
19234 Add support for an Autotest test suite for Bison.
19235
19236 * m4/m4.m4, m4/atconfig.m4: New files.
19237 * m4/Makefile.am (EXTRA_DIST): Adjust.
19238 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
19239 files.
19240 * src/getargs.c: Display a more standard --version message.
19241 * src/reader.c (reader): Formatting changes.
19242 No longer depend upon VERSION_STRING.
19243 * configure.in: No longer use `dnl'.
19244 Set up the test suite and the new directory `tests/.
19245 (VERSION_STRING): Remove.
19246
19247 2000-04-14 Akim Demaille <akim@epita.fr>
19248
19249 * src/reader.c (copy_comment2): New function, same as former
19250 `copy_comment', but outputs into two FILE *.
19251 (copy_comment): Use it.
19252 (parse_union_decl): Use it.
19253 (get_type, parse_start_decl): Use the same `invalid' message.
19254 (parse_start_decl, parse_union_decl): Use the same `multiple'
19255 message.
19256 (parse_union_decl, copy_guard, copy_action): Use the same
19257 `unmatched' message.
19258 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
19259
19260 2000-03-31 Akim Demaille <akim@epita.fr>
19261
19262 * src/files.c (tryopen, tryclose): Move to the top.
19263 Be static.
19264
19265 2000-03-31 Akim Demaille <akim@epita.fr>
19266
19267 * src/main.c (main): Don't call `done', exit does it.
19268
19269 2000-03-31 Akim Demaille <akim@epita.fr>
19270
19271 * allocate.c: s/return (foo)/return foo/.
19272 * lalr.c: Likewise.
19273 * LR0.c: Likewise.
19274 * output.c: Likewise.
19275 * reader.c: Likewise.
19276 * symtab.c: Likewise.
19277 * vmsgetargs.c: Likewise.
19278
19279 2000-03-31 Akim Demaille <akim@epita.fr>
19280
19281 Clean up the error reporting functions.
19282
19283 * src/report.c: New file.
19284 * src/report.h: Likewise.
19285 * src/Makefile.am: Adjust.
19286 * m4/error.m4: New file.
19287 * m4/Makefile.am: Adjust.
19288 * configure.in (jm_PREREQ_ERROR): Call it.
19289 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
19290 Remove.
19291 (fatal, fatals): Remove. All callers use complain.c::fatal.
19292 (warn, warni, warns, warnss, warnss): Remove. All callers use
19293 complain.c::complain.
19294 (toomany): Remove, use fatal instead.
19295 * src/files.c (done): No argument, use complain_message_count.
19296 * src/main.c (main): Register `done' to `atexit'.
19297
19298 * src/getargs.c (usage): More `fputs', less `fprintf'.
19299
19300 2000-03-28 Akim Demaille <akim@epita.fr>
19301
19302 * lib/: New directory.
19303 * Makefile.am (SUBDIRS): Adjust.
19304 * configure.in: Adjust.
19305 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
19306 useless.
19307 * src/alloca.c: Moved to lib/.
19308 * src/getopt.c: Likewise.
19309 * src/getopt1.c: Likewise.
19310 * src/getopt.h: Likewise.
19311 * src/ansi2knr.c: Likewise.
19312 * src/ansi2knr.1: Likewise.
19313 * src/Makefile.am: Adjust.
19314 * lib/Makefile.am: New file.
19315
19316 2000-03-28 Akim Demaille <akim@epita.fr>
19317
19318 * src/getargs.c (usage): Refresh the help message.
19319
19320 2000-03-17 Akim Demaille <akim@epita.fr>
19321
19322 * src/getopt1.c: Updated from textutils 2.0e
19323 * src/getopt.c: Likewise.
19324 * src/getopt.h: Likewise.
19325
19326 2000-03-17 Akim Demaille <akim@epita.fr>
19327
19328 * src/Makefile.am (bison.simple): Fix the awk program: quote only
19329 the file name, not the whole `#line LINE FILE'.
19330
19331 2000-03-17 Akim Demaille <akim@epita.fr>
19332
19333 On syntax errors, report the token on which we choked.
19334
19335 * src/bison.s1 (yyparse): In the label yyerrlab, when
19336 YYERROR_VERBOSE, add yychar in msg.
19337
19338 2000-03-17 Akim Demaille <akim@epita.fr>
19339
19340 * src/reader.c (copy_at): New function.
19341 (copy_guard): Use it.
19342 (copy_action): Use it.
19343
19344 2000-03-17 Akim Demaille <akim@epita.fr>
19345
19346 Be kind to translators, save some useless translations.
19347
19348 * src/main.c (banner): New function.
19349 (fatal_banner): Use it.
19350 (warn_banner): Use it.
19351
19352 2000-03-17 Akim Demaille <akim@epita.fr>
19353
19354 * src/reader.c (copy_definition): Use copy_string and
19355 copy_comment. Removed now unused `match', `ended',
19356 `cplus_comment'.
19357 (copy_comment, copy_string): Moved, to be visible from
19358 copy_definition.
19359
19360 2000-03-17 Akim Demaille <akim@epita.fr>
19361
19362 * src/reader.c (copy_string): Declare `static inline'. No
19363 problems with inline, since it is checked by configure.
19364 (copy_comment): Likewise.
19365
19366 2000-03-17 Akim Demaille <akim@epita.fr>
19367
19368 * src/reader.c (packsymbols): Formatting changes.
19369
19370 2000-03-17 Akim Demaille <akim@epita.fr>
19371
19372 * src/reader.c (copy_comment): New function, factored out from:
19373 (copy_action): Use it. Removed now unused `match', `ended',
19374 `cplus_comment'.
19375 (copy_guard): Likewise.
19376
19377 2000-03-17 Akim Demaille <akim@epita.fr>
19378
19379 * src/reader.c (copy_string): New function, factored out from:
19380 (copy_action): Use it.
19381 (copy_guard): Likewise.
19382
19383 2000-03-17 Akim Demaille <akim@epita.fr>
19384
19385 Change the handling of @s so that they behave exactly like $s.
19386 There is now a pseudo variable @$ (readble and writable), location
19387 of the lhs of the rule (by default ranging from the location of
19388 the first symbol of the rhs, to the location of the last symbol,
19389 or, if the rhs is empty, YYLLOC).
19390
19391 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
19392 yyval.
19393 (yyparse): When providing a default semantic action, provide a
19394 default location action.
19395 (after the $): No longer change `*YYLSP', just stack YYLOC the
19396 same way you stack YYVAL.
19397 * src/reader.c (read_declarations): Use warns.
19398 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
19399 (copy_action, case '@'): Likewise.
19400 Use a standard error message, to save useless work from
19401 translators.
19402
19403 2000-03-17 Akim Demaille <akim@epita.fr>
19404
19405 * src/bison.s1: Formatting and cosmetics changes.
19406 * src/reader.c: Likewise.
19407 Update the Copyright notice.
19408
19409 2000-03-17 Akim Demaille <akim@epita.fr>
19410
19411 * src/bison.s1 (#line): All set to `#line' only, since the
19412 Makefile now handles them.
19413
19414 2000-03-16 Akim Demaille <akim@epita.fr>
19415
19416 * src/output.c (output_rule_data): Output the documentation of
19417 some of the tables.
19418 (Copyright notice): Update.
19419 Formatting changes.
19420
19421 2000-03-16 Akim Demaille <akim@epita.fr>
19422
19423 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
19424 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
19425 One `#if YYDEBUG' remains, since it uses variables which are
19426 defined only if `YYDEBUG != 0'.
19427
19428 2000-03-16 Akim Demaille <akim@epita.fr>
19429
19430 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
19431 and related variables so that the similarities are highlighted.
19432
19433 2000-03-16 Akim Demaille <akim@epita.fr>
19434
19435 * src/bison.s1: Properly indent CPP directives.
19436
19437 2000-03-16 Akim Demaille <akim@epita.fr>
19438
19439 * src/bison.s1: Properly indent the `alloca' CPP section.
19440
19441 2000-03-16 Akim Demaille <akim@epita.fr>
19442
19443 Do not hard code values of directories in `configure.in'.
19444 Update the `configure' tool chain.
19445
19446 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
19447 src/makefile.am.
19448 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
19449 (AC_OUTPUT): Add m4/Makefile.
19450 Bump to bison 1.28a, 1.29 has never been released.
19451 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
19452 handled via src/Makefile.am.
19453 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
19454 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
19455 autoheader.
19456 * Makefile.am (SUBDIRS): Add m4.
19457 (ACLOCAL_AM_FLAGS): New variable.
19458 (AUTOMAKE_OPTIONS): Add check-news.
19459 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
19460 the proper line number and file name.
19461 (DEFS): Propagate the location of bison library files and of the
19462 locale files.
19463 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
19464 builddir.
19465 * acinclude.m4: Remove, replaced by the directory m4.
19466 * m4/Makefile.am (EXTRA_DIST): New variable.
19467 * m4/gettext.m4: New file, from the fileutils.
19468 * m4/lcmessage.m4: Likewise
19469 * m4/progtest.m4: Likewise.
19470 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
19471
19472 2000-03-10 Akim Demaille <akim@epita.fr>
19473
19474 * src/closure.c:
19475 Formatting changes of various comments.
19476 Respect the GNU coding standards at various places.
19477 Don't use `_()' when no translation is needed.
19478
19479 1999-12-13 Jesse Thilo <jthilo@gnu.org>
19480
19481 * src/files.c:
19482 OS/2 honors TMPDIR environment variable.
19483
19484 1999-12-13 Jesse Thilo <jthilo@gnu.org>
19485
19486 * doc/bison.texinfo: Tweaked spelling and grammar.
19487 Updated ISBN.
19488 Removed reference to price of printed copy.
19489 Mention BISON_SIMPLE and BISON_HAIRY.
19490
19491 1999-12-13 Jesse Thilo <jthilo@gnu.org>
19492
19493 * configure.in, NEWS:
19494 Bison 1.29 released.
19495
19496 1999-10-27 Jesse Thilo <jthilo@gnu.org>
19497
19498 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
19499 Added reference card.
19500
19501 1999-07-26 Jesse Thilo <jthilo@gnu.org>
19502
19503 * po/ru.po: Added Russian translation.
19504
19505 1999-07-26 Jesse Thilo <jthilo@gnu.org>
19506
19507 * configure.in: Added Russian translation.
19508
19509 1999-07-06 Jesse Thilo <jthilo@gnu.org>
19510
19511 * configure.in, NEWS, README:
19512 Released version 1.28.
19513
19514 1999-06-14 Jesse Thilo <jthilo@gnu.org>
19515
19516 * src/system.h:
19517 Squashed redefinition warning on some systems.
19518
19519 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
19520 Have configure build version string instead of relying on ANSI string
19521 concatentation.
19522
19523 1999-06-14 Jesse Thilo <jthilo@gnu.org>
19524
19525 * po/POTFILES.in: Got rid of version.c.
19526
19527 1999-06-14 Jesse Thilo <jthilo@gnu.org>
19528
19529 * acconfig.h, configure.in:
19530 Have configure build version string instead of relying on ANSI string
19531 concatentation.
19532
19533 1999-06-08 Jesse Thilo <jthilo@gnu.org>
19534
19535 * doc/bison.1:
19536 Dropped mention of `+' for long-named options.
19537
19538 1999-05-30 Jesse Thilo <jthilo@gnu.org>
19539
19540 * src/files.c: Added <unistd.h> for unlink().
19541
19542 * src/Makefile.am, src/system.h:
19543 I18n fixes.
19544
19545 1999-05-30 Jesse Thilo <jthilo@gnu.org>
19546
19547 * README: Added a FAQ list.
19548
19549 * configure.in, acconfig.h:
19550 I18n fixes.
19551
19552 1999-05-30 Jesse Thilo <jthilo@gnu.org>
19553
19554 * doc/FAQ, doc/Makefile.am:
19555 Added a FAQ list.
19556
19557 1999-05-19 Jesse Thilo <jthilo@gnu.org>
19558
19559 * src/alloc.h, src/symtab.h, src/version.c:
19560 Protected inclusion of "config.h" with HAVE_CONFIG_H.
19561
19562 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19563
19564 * src/.cvsignore, src/Makefile.am:
19565 Reorganized: sources in `src', documentation in `doc'.
19566
19567 * src/lex.c (literalchar):
19568 fixed the code for escaping double quotes (thanks
19569 Jonathan Czisny.)
19570
19571 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19572
19573 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
19574 Adjusted paths to reflect directory reorganization.
19575
19576 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19577
19578 * doc/.cvsignore, doc/Makefile.am:
19579 Reorganized: sources in `src', documentation in `doc'.
19580
19581 1999-04-18 Jesse Thilo <jthilo@gnu.org>
19582
19583 * configure.in:
19584 Updated AC_INIT file to reflect directory reorganization.
19585
19586 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
19587 Reorganized: sources in `src', documentation in `doc'.
19588
19589 1999-04-13 Jesse Thilo <jthilo@gnu.org>
19590
19591 * src/allocate.c:
19592 Don't declare calloc() and realloc() if not necessary.
19593
19594 1999-04-13 Jesse Thilo <jthilo@gnu.org>
19595
19596 * configure.in, acconfig.h, acinclude.m4:
19597 Don't declare calloc() and realloc() if not necessary.
19598
19599 1999-03-23 Jesse Thilo <jthilo@gnu.org>
19600
19601 * po/.cvsignore: Added i18n support.
19602
19603 1999-03-23 Jesse Thilo <jthilo@gnu.org>
19604
19605 * acconfig.h, configure.in, Makefile.am:
19606 Added i18n support.
19607
19608 1999-03-22 Jesse Thilo <jthilo@gnu.org>
19609
19610 * src/bison.s1: Fixed #line numbers.
19611
19612 1999-03-15 Jesse Thilo <jthilo@gnu.org>
19613
19614 * po/es.po, po/fr.po, po/nl.po, po/de.po:
19615 Added PO files from Translation Project.
19616
19617 1999-03-03 Jesse Thilo <jthilo@gnu.org>
19618
19619 * Makefile.am:
19620 Added support for non-ANSI compilers (ansi2knr).
19621
19622 1999-02-16 Jesse Thilo <jthilo@gnu.org>
19623
19624 * configure.in: Bumped version number to 1.27.
19625
19626 * Makefile.am:
19627 Added `bison.simple' to list of files removed by `make distclean'.
19628
19629 1999-02-12 Jesse Thilo <jthilo@gnu.org>
19630
19631 * src/files.c, src/files.h:
19632 Defined locations of parser files in config.h instead of Makefile.
19633
19634 1999-02-12 Jesse Thilo <jthilo@gnu.org>
19635
19636 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
19637 Defined locations of parser files in config.h instead of Makefile.
19638
19639 1999-02-09 Jesse Thilo <jthilo@gnu.org>
19640
19641 * Makefile.am:
19642 Removed inappropriate use of $< macro.
19643
19644 1999-02-05 Jesse Thilo <jthilo@gnu.org>
19645
19646 * po/Makefile.in.in, po/POTFILES.in:
19647 Add `po' directory skeleton.
19648
19649 1999-01-27 Jesse Thilo <jthilo@gnu.org>
19650
19651 * README: Document help-bison list.
19652
19653 * configure.in: Add check for mkstemp().
19654
19655 1999-01-20 Jesse Thilo <jthilo@gnu.org>
19656
19657 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
19658 Hush a few compiler warnings.
19659
19660 * src/files.c:
19661 Add tryclose(), which verifies that fclose was successful.
19662 Hush a couple of compiler warnings.
19663
19664 1999-01-20 Jesse Thilo <jthilo@gnu.org>
19665
19666 * Makefile.am, OChangeLog:
19667 ChangeLog is now automatically generated. Include the old version as
19668 OChangeLog.
19669
19670 1999-01-14 Jesse Thilo <jthilo@gnu.org>
19671
19672 * 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:
19673 Update FSF address.
19674
19675 1999-01-14 Jesse Thilo <jthilo@gnu.org>
19676
19677 * doc/bison.texinfo: Fix formatting glitch.
19678
19679 * doc/bison.texinfo: Update FSF address.
19680
19681 1999-01-14 Jesse Thilo <jthilo@gnu.org>
19682
19683 * acconfig.h: Update FSF address.
19684
19685 1999-01-08 Jesse Thilo <jthilo@gnu.org>
19686
19687 * src/system.h:
19688 Don't define PACKAGE here, since config.h defines it.
19689
19690 1998-12-30 Jesse Thilo <jthilo@gnu.org>
19691
19692 * src/reader.c: Update copyright date.
19693
19694 * src/main.c:
19695 Ditch sprintf to statically-sized buffers in fatal/warn functions in
19696 favor of output directly to stderr (avoids buffer overruns).
19697
19698 * src/reader.c: Some checks for premature EOF.
19699
19700 * 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:
19701 Use prototypes if the compiler understands them.
19702
19703 * src/files.c: Honor TMPDIR on Unix hosts.
19704 Use prototypes if the compiler understands them.
19705
19706 * src/reader.c:
19707 Fix a couple of buffer overrun bugs.
19708 Use prototypes if the compiler understands them.
19709
19710 * src/system.h: Include unistd.h and ctype.h.
19711 Use #ifdef instead of #if for NLS symbols.
19712
19713 1998-12-30 Jesse Thilo <jthilo@gnu.org>
19714
19715 * doc/bison.texinfo:
19716 Delete comment "consider using @set for edition number, etc..." since
19717 we now are doing so.
19718
19719 1998-12-30 Jesse Thilo <jthilo@gnu.org>
19720
19721 * configure.in:
19722 Use prototypes if the compiler understands them.
19723
19724 * NEWS: Document 1.26 highlights.
19725
19726 * Makefile.am: Require Automake 1.3 or later.
19727
19728 * acconfig.h:
19729 Use prototypes if the compiler understands them.
19730
19731 1998-12-29 Jesse Thilo <jthilo@gnu.org>
19732
19733 * src/version.c:
19734 Use VERSION symbol from automake for version number.
19735
19736 1998-12-29 Jesse Thilo <jthilo@gnu.org>
19737
19738 * acconfig.h, configure.in, version.cin:
19739 Use VERSION symbol from automake for version number.
19740
19741 1998-11-28 Jesse Thilo <jthilo@gnu.org>
19742
19743 * Makefile.am:
19744 Distribute original version of simple parser (bison.s1), not built
19745 version (bison.simple).
19746
19747 1998-11-28 Jesse Thilo <jthilo@gnu.org>
19748
19749 * doc/bison.texinfo: Add info dir entry.
19750
19751 * doc/bison.texinfo:
19752 Let automake put version number into documentation.
19753
19754 1998-11-26 Jesse Thilo <jthilo@gnu.org>
19755
19756 * src/bison.cld, src/build.com, src/vmshlp.mar:
19757 Add non-RCS files from /gd/gnu/bison.
19758
19759 1998-11-26 Jesse Thilo <jthilo@gnu.org>
19760
19761 * doc/bison.1:
19762 Document the BISON_HAIRY and BISON_SIMPLE variables.
19763
19764 1998-11-25 Jesse Thilo <jthilo@gnu.org>
19765
19766 * src/version.c: Build version.c automatically.
19767
19768 * src/reader.c:
19769 Fix token numbering (used to start at 258, not 257).
19770
19771 * src/system.h: Include config.h.
19772
19773 * src/getargs.c: Update bug report address.
19774
19775 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
19776 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
19777
19778 1998-11-25 Jesse Thilo <jthilo@gnu.org>
19779
19780 * Makefile.am:
19781 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19782
19783 * configure.in, version.cin:
19784 Build version.c automatically.
19785
19786 * AUTHORS: Add AUTHORS file.
19787
19788 * README: Update bug report address.
19789
19790 * bison.simple:
19791 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19792
19793 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
19794 Add automake stuff.
19795
19796 1998-11-25 Jesse Thilo <jthilo@gnu.org>
19797
19798 * doc/bison.texinfo: Clean up some formatting.
19799
19800 1998-05-05 Richard Stallman <rms@gnu.org>
19801
19802 * doc/bison.texinfo:
19803 Explain better why to make a pure parser.
19804
19805 1998-01-05 Richard Stallman <rms@gnu.org>
19806
19807 * src/files.c (openfiles):
19808 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
19809 find a temporary directory, if possible. Do not unlink files while
19810 they are open.
19811
19812 1997-08-25 Richard Stallman <rms@gnu.org>
19813
19814 * src/reader.c (stack_offset;):
19815 Change some warni to warns.
19816
19817 * src/lex.c (literalchar): Use warns, not warni.
19818
19819 1997-06-28 Richard Stallman <rms@gnu.org>
19820
19821 * src/bison.s1: Add a Bison version comment.
19822
19823 * src/main.c (fatal, warn, berror):
19824 Use program_name.
19825
19826 1997-06-28 Richard Stallman <rms@gnu.org>
19827
19828 * Makefile.in (bison_version): New variable.
19829 (dist): Use that variable.
19830 (bison.s1): Substitute the Bison version into bison.simple.
19831
19832 * bison.simple: Add a Bison version comment.
19833
19834 1997-06-18 Richard Stallman <rms@gnu.org>
19835
19836 * src/main.c (fatal, warn, berror):
19837 Make error messages standard.
19838 (toomany): Improve error message text.
19839
19840 * 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:
19841 new.h renamed to alloc.h.
19842
19843 1997-06-18 Richard Stallman <rms@gnu.org>
19844
19845 * Makefile.in: new.h renamed to alloc.h.
19846
19847 1997-05-24 Richard Stallman <rms@gnu.org>
19848
19849 * src/lex.c (literalchar):
19850 Fix the code for escaping \, " and '.
19851
19852 (lex): Avoid trouble when there are many chars
19853 to discard in a char literal with just several chars in it.
19854
19855 1997-05-17 Richard Stallman <rms@gnu.org>
19856
19857 * src/bison.s1:
19858 Use malloc, if using alloca is troublesome.
19859 (YYSTACK_USE_ALLOCA): New flag macro.
19860 Define it for some systems and compilers.
19861 (YYSTACK_ALLOC): New macro.
19862 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19863 If it was malloc'd, free it.
19864
19865 1997-05-17 Richard Stallman <rms@gnu.org>
19866
19867 * bison.simple:
19868 Use malloc, if using alloca is troublesome.
19869 (YYSTACK_USE_ALLOCA): New flag macro.
19870 Define it for some systems and compilers.
19871 (YYSTACK_ALLOC): New macro.
19872 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19873 If it was malloc'd, free it.
19874
19875 1997-04-23 Richard Stallman <rms@gnu.org>
19876
19877 * src/bison.s1:
19878 (alloca) [__hpux]: Always define as __builtin_alloca.
19879
19880 1997-04-23 Richard Stallman <rms@gnu.org>
19881
19882 * bison.simple:
19883 (alloca) [__hpux]: Always define as __builtin_alloca.
19884
19885 1997-04-22 Richard Stallman <rms@gnu.org>
19886
19887 * src/bison.s1:
19888 [__hpux]: Include alloca.h (right for HPUX 10)
19889 instead of declaring alloca (right for HPUX 9).
19890
19891 * src/bison.s1 (__yy_memcpy):
19892 Declare arg `count' as unsigned int.
19893 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19894
19895 1997-04-22 Richard Stallman <rms@gnu.org>
19896
19897 * bison.simple:
19898 [__hpux]: Include alloca.h (right for HPUX 10)
19899 instead of declaring alloca (right for HPUX 9).
19900
19901 * bison.simple (__yy_memcpy):
19902 Declare arg `count' as unsigned int.
19903 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19904
19905 1997-01-03 Richard Stallman <rms@gnu.org>
19906
19907 * src/allocate.c: [__STDC__ or _MSC_VER]:
19908 Declare calloc and realloc to return void *.
19909
19910 1997-01-02 Richard Stallman <rms@gnu.org>
19911
19912 * src/system.h:
19913 [_MSC_VER]: Include stdlib.h and process.h.
19914 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
19915
19916 * src/main.c (main): Return FAILURE as a value.
19917 (printable_version): Declare arg as int, not char.
19918
19919 1997-01-02 Richard Stallman <rms@gnu.org>
19920
19921 * Makefile.in (dist):
19922 Explicitly check for symlinks, and copy them.
19923
19924 1996-12-19 Richard Stallman <rms@gnu.org>
19925
19926 * src/files.c:
19927 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
19928
19929 1996-12-18 Paul Eggert <eggert@gnu.org>
19930
19931 * src/bison.s1 (yyparse):
19932 If __GNUC__ and YYPARSE_PARAM are both defined,
19933 declare yyparse to have a void * argument.
19934
19935 1996-12-18 Paul Eggert <eggert@gnu.org>
19936
19937 * bison.simple (yyparse):
19938 If __GNUC__ and YYPARSE_PARAM are both defined,
19939 declare yyparse to have a void * argument.
19940
19941 1996-12-17 Richard Stallman <rms@gnu.org>
19942
19943 * src/reduce.c (nbits): Add some casts.
19944
19945 1996-08-12 Richard Stallman <rms@gnu.org>
19946
19947 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
19948
19949 1996-08-12 Richard Stallman <rms@gnu.org>
19950
19951 * bison.simple: Test _MSDOS as well as _MSDOS_.
19952
19953 1996-07-31 Richard Stallman <rms@gnu.org>
19954
19955 * src/bison.s1:
19956 [__sun && __i386]: Include alloca.h.
19957
19958 1996-07-31 Richard Stallman <rms@gnu.org>
19959
19960 * bison.simple:
19961 [__sun && __i386]: Include alloca.h.
19962
19963 1996-07-30 Richard Stallman <rms@gnu.org>
19964
19965 * src/bison.s1: Comment change.
19966
19967 * src/bison.s1: Test _MSDOS_, not MSDOS.
19968
19969 1996-07-30 Richard Stallman <rms@gnu.org>
19970
19971 * bison.simple: Comment change.
19972
19973 * bison.simple: Test _MSDOS_, not MSDOS.
19974
19975 1996-06-01 Richard Stallman <rms@gnu.org>
19976
19977 * 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:
19978 Insert `_' macro around many string constants.
19979
19980 * src/main.c:
19981 Insert `_' macro around many string constants.
19982
19983 (main): Call setlocale, bindtextdomain and textdomain.
19984
19985 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
19986 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
19987 [ENABLE_NLS]: Include libintl.h.
19988 [ENABLE_NLS] (gettext): Define.
19989 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
19990 (N_, PACKAGE, LOCALEDIR): New macros.
19991
19992 1996-06-01 Richard Stallman <rms@gnu.org>
19993
19994 * POTFILES.in: New file.
19995
19996 * Makefile.in (allocate.o):
19997 Define target explicitly.
19998
19999 * Makefile.in (CFLAGS): Set to @CFLAGS@.
20000 (LDFLAGS): Set to @LDFLAGS@.
20001 (configure): Run autoconf only if preceding `cd' succeeds.
20002 (bison.s1): Redirect output to temporary file then move the
20003 temporary to the target, rather than redirecting directly to bison.s1.
20004 (clean): Remove config.status and config.log.
20005 (distclean): Don't remove config.status here.
20006
20007 1996-05-12 Richard Stallman <rms@gnu.org>
20008
20009 * src/bison.s1:
20010 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
20011
20012 1996-05-12 Richard Stallman <rms@gnu.org>
20013
20014 * bison.simple:
20015 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
20016
20017 1996-05-11 Richard Stallman <rms@gnu.org>
20018
20019 * src/bison.s1 (__yy_memcpy):
20020 Really reorder the args, as was supposedly done on Feb 14 1995.
20021 (yyparse): Calls changed accordingly.
20022
20023 1996-05-11 Richard Stallman <rms@gnu.org>
20024
20025 * Makefile.in (dist): Don't use $(srcdir).
20026
20027 * bison.simple (__yy_memcpy):
20028 Really reorder the args, as was supposedly done on Feb 14 1995.
20029 (yyparse): Calls changed accordingly.
20030
20031 1996-01-27 Richard Stallman <rms@gnu.org>
20032
20033 * src/output.c (output_rule_data):
20034 Test YYERROR_VERBOSE in the conditional
20035 around the definition of ttyname.
20036
20037 1995-12-29 Richard Stallman <rms@gnu.org>
20038
20039 * src/bison.s1:
20040 Fix line numbers in #line commands.
20041
20042 1995-12-29 Richard Stallman <rms@gnu.org>
20043
20044 * bison.simple:
20045 Fix line numbers in #line commands.
20046
20047 1995-12-27 Richard Stallman <rms@gnu.org>
20048
20049 * src/bison.s1 (YYPARSE_PARAM_DECL):
20050 In C++, make it always null.
20051 (YYPARSE_PARAM_ARG): New macro.
20052 (yyparse): Use YYPARSE_PARAM_ARG.
20053
20054 1995-12-27 Richard Stallman <rms@gnu.org>
20055
20056 * bison.simple (YYPARSE_PARAM_DECL):
20057 In C++, make it always null.
20058 (YYPARSE_PARAM_ARG): New macro.
20059 (yyparse): Use YYPARSE_PARAM_ARG.
20060
20061 1995-11-29 Richard Stallman <rms@gnu.org>
20062
20063 * doc/bison.texinfo:
20064 Describe literal string tokens, %raw, %no_lines, %token_table.
20065
20066 1995-11-29 Daniel Hagerty <hag@gnu.org>
20067
20068 * doc/bison.texinfo: Fixed update date
20069
20070 1995-10-16 Richard Stallman <rms@gnu.org>
20071
20072 * src/version.c: Version 1.25.
20073
20074 1995-10-16 Richard Stallman <rms@gnu.org>
20075
20076 * NEWS: *** empty log message ***
20077
20078 1995-10-16 Richard Stallman <rms@gnu.org>
20079
20080 * doc/bison.1, doc/bison.rnh:
20081 Add new options.
20082
20083 1995-10-15 Richard Stallman <rms@gnu.org>
20084
20085 * src/vmsgetargs.c, src/getargs.c:
20086 Added -n, -k, and -raw switches.
20087 (noparserflag, toknumflag, rawtoknumflag): New variables.
20088
20089 * src/symtab.h (SALIAS):
20090 New #define for adding aliases to %token.
20091 (struct bucket): Added `alias' field.
20092
20093 * src/reduce.c (reduce_grammar):
20094 Revise error message.
20095 (print_notices): Remove final `.' from error message.
20096
20097 * src/reader.c (reader_output_yylsp):
20098 New function.
20099 (readgram): Use `#if 0' around code that accepted %command
20100 inside grammar rules: The documentation doesn't allow it,
20101 and it will fail since the %command processors scan for the next %.
20102 (parse_token_decl): Extended the %token
20103 declaration to allow a multi-character symbol as an alias.
20104 (parse_thong_decl): New function.
20105 (read_declarations): Added %thong declarations.
20106 (read_declarations): Handle NOOP to deal with allowing
20107 % declarations as another means to specify the flags.
20108 (readgram): Allow %prec prior to semantics embedded in a rule.
20109 (skip_to_char, read_declarations, copy_definition)
20110 (parse_token_decl, parse_start_decl, parse_type_decl)
20111 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
20112 (get_type_name, copy_guard, copy_action, readgram)
20113 (get_type, packsymbols): Revised most error messages.
20114 Changed `fatal' to `warnxxx' to avoid aborting for error.
20115 Revised and use multiple warnxxx functions to avoid using VARARGS1.
20116 (read_declarations): Improve the error message for
20117 an invalid character. Do not abort.
20118 (read_declarations, copy_guard, copy_action): Use
20119 printable_version to avoid unprintable characters in printed output.
20120 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
20121 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
20122 Allow the type of a non-terminal can be given
20123 more than once, as long as all specifications give the same type.
20124
20125 * src/output.c:
20126 (output_headers, output_trailers, output, output_gram)
20127 (output_rule_data): Implement noparserflag variable.
20128 Implement toknumflag variable.
20129 (output): Call reader_output_yylsp to output LTYPESTR.
20130
20131 * src/main.c (main):
20132 If reader sees an error, don't process the grammar.
20133 (fatals): Updated to not use VARARGS1.
20134 (printable_version, int_to_string, warn, warni, warns, warnss)
20135 (warnsss): New error reporting functions. Avoid abort for error.
20136
20137 * src/lex.h:
20138 Added THONG and NOOP for alias processing.
20139 Added SETOPT for the new code that allows setting options with %flags.
20140
20141 * src/lex.c:
20142 Include getopt.h. Add some extern decls.
20143 (safegetc): New function to deal with EOF gracefully.
20144 (literalchar); new function to deal with reading \ escapes.
20145 (lex): Use literalchar.
20146 (lex): Implemented "..." tokens.
20147 (literalchar, lex, parse_percent_token): Made tokenbuffer
20148 always contain the token. This includes growing the token
20149 buffer while reading an integer.
20150 (parse_percent_token): Replaced if-else statement with percent_table.
20151 (parse_percent_token): Added % declarations as another
20152 way to specify the flags -n, -l, and -r. Also added hooks for
20153 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
20154 major changes to files.c.
20155 (lex) Retain in the incoming stream a character following
20156 an incorrect '/'.
20157 (skip_white_space, lex): Revised most error messages
20158 and changed fatal to warn to avoid aborting.
20159 (percent_table): Added %thong declarations.
20160
20161 * src/gram.h: Comment changes.
20162
20163 * src/files.c (openfiles, open_extra_files, done):
20164 Add faction flag
20165 and actfile file. Handle noparserflag. Both for -n switch.
20166
20167 * src/conflicts.c (resolve_sr_conflict):
20168 Remove use of alloca.
20169
20170 1995-06-01 Jim Meyering <meyering@gnu.org>
20171
20172 * doc/bison.texinfo: *** empty log message ***
20173
20174 1995-05-06 Richard Stallman <rms@gnu.org>
20175
20176 * src/bison.s1: Comment change.
20177
20178 1995-05-06 Richard Stallman <rms@gnu.org>
20179
20180 * bison.simple: Comment change.
20181
20182 1995-05-03 Richard Stallman <rms@gnu.org>
20183
20184 * src/version.c: Version now 1.24.
20185
20186 * src/bison.s1: Change distribution terms.
20187
20188 * src/version.c: Version now 1.23.
20189
20190 1995-05-03 Richard Stallman <rms@gnu.org>
20191
20192 * doc/bison.texinfo:
20193 Rewrite "Conditions for Using Bison".
20194 Update version to 1.24.
20195
20196 1995-05-03 Richard Stallman <rms@gnu.org>
20197
20198 * bison.simple: Change distribution terms.
20199
20200 1995-02-23 Richard Stallman <rms@gnu.org>
20201
20202 * src/files.c: Test __VMS_POSIX as well as VMS.
20203
20204 1995-02-14 Jim Meyering <meyering@gnu.org>
20205
20206 * src/bison.s1 (__yy_memcpy):
20207 Renamed from __yy_bcopy to avoid
20208 confusion. Reverse FROM and TO arguments to be consistent with
20209 those of memcpy.
20210
20211 1995-02-14 Jim Meyering <meyering@gnu.org>
20212
20213 * bison.simple (__yy_memcpy):
20214 Renamed from __yy_bcopy to avoid
20215 confusion. Reverse FROM and TO arguments to be consistent with
20216 those of memcpy.
20217
20218 1994-11-10 David J. MacKenzie <djm@gnu.org>
20219
20220 * NEWS: reformat
20221
20222 * NEWS: New file.
20223
20224 * Makefile.in (DISTFILES): Include NEWS.
20225
20226 * Makefile.in (DISTFILES):
20227 Include install-sh, not install.sh.
20228
20229 * configure.in: Update to Autoconf v2 macro names.
20230
20231 1994-10-05 David J. MacKenzie <djm@gnu.org>
20232
20233 * Makefile.in: fix typo
20234
20235 * Makefile.in (prefix, exec_prefix):
20236 Let configure set them.
20237
20238 1994-09-28 David J. MacKenzie <djm@gnu.org>
20239
20240 * Makefile.in: Set datadir to $(prefix)/share.
20241
20242 1994-09-15 Richard Stallman <rms@gnu.org>
20243
20244 * src/bison.s1:
20245 Update copyright notice and GPL version.
20246
20247 1994-09-15 Richard Stallman <rms@gnu.org>
20248
20249 * bison.simple:
20250 Update copyright notice and GPL version.
20251
20252 1994-07-12 Richard Stallman <rms@gnu.org>
20253
20254 * src/reduce.c, src/reader.c:
20255 entered into RCS
20256
20257 1994-05-05 David J. MacKenzie <djm@gnu.org>
20258
20259 * Makefile.in: entered into RCS
20260
20261 1994-03-26 Richard Stallman <rms@gnu.org>
20262
20263 * src/bison.s1: entered into RCS
20264
20265 1994-03-26 Richard Stallman <rms@gnu.org>
20266
20267 * bison.simple: entered into RCS
20268
20269 1994-03-25 Richard Stallman <rms@gnu.org>
20270
20271 * src/main.c: entered into RCS
20272
20273 1994-03-24 Richard Stallman <rms@gnu.org>
20274
20275 * src/conflicts.c: entered into RCS
20276
20277 1994-01-02 Richard Stallman <rms@gnu.org>
20278
20279 * Makefile.in: *** empty log message ***
20280
20281 1993-11-21 Richard Stallman <rms@gnu.org>
20282
20283 * src/bison.s1: *** empty log message ***
20284
20285 1993-11-21 Richard Stallman <rms@gnu.org>
20286
20287 * doc/bison.texinfo: entered into RCS
20288
20289 * doc/bison.texinfo: *** empty log message ***
20290
20291 1993-11-21 Richard Stallman <rms@gnu.org>
20292
20293 * bison.simple: *** empty log message ***
20294
20295 1993-10-25 David J. MacKenzie <djm@gnu.org>
20296
20297 * doc/bison.texinfo: *** empty log message ***
20298
20299 1993-10-19 Richard Stallman <rms@gnu.org>
20300
20301 * src/bison.s1: *** empty log message ***
20302
20303 1993-10-19 Richard Stallman <rms@gnu.org>
20304
20305 * bison.simple: *** empty log message ***
20306
20307 1993-10-14 Richard Stallman <rms@gnu.org>
20308
20309 * src/bison.s1: *** empty log message ***
20310
20311 1993-10-14 Richard Stallman <rms@gnu.org>
20312
20313 * bison.simple: *** empty log message ***
20314
20315 1993-09-14 David J. MacKenzie <djm@gnu.org>
20316
20317 * doc/bison.texinfo: *** empty log message ***
20318
20319 1993-09-13 Noah Friedman <friedman@gnu.org>
20320
20321 * Makefile.in: *** empty log message ***
20322
20323 1993-09-10 Richard Stallman <rms@gnu.org>
20324
20325 * src/conflicts.c: *** empty log message ***
20326
20327 * src/system.h: entered into RCS
20328
20329 1993-09-10 Richard Stallman <rms@gnu.org>
20330
20331 * doc/bison.1: entered into RCS
20332
20333 1993-09-06 Noah Friedman <friedman@gnu.org>
20334
20335 * src/version.c: entered into RCS
20336
20337 1993-09-06 Noah Friedman <friedman@gnu.org>
20338
20339 * Makefile.in: *** empty log message ***
20340
20341 1993-07-30 David J. MacKenzie <djm@gnu.org>
20342
20343 * Makefile.in: *** empty log message ***
20344
20345 1993-07-24 Richard Stallman <rms@gnu.org>
20346
20347 * src/bison.s1: *** empty log message ***
20348
20349 1993-07-24 Richard Stallman <rms@gnu.org>
20350
20351 * bison.simple: *** empty log message ***
20352
20353 1993-07-08 David J. MacKenzie <djm@gnu.org>
20354
20355 * Makefile.in: *** empty log message ***
20356
20357 1993-07-04 Richard Stallman <rms@gnu.org>
20358
20359 * src/bison.s1: *** empty log message ***
20360
20361 1993-07-04 Richard Stallman <rms@gnu.org>
20362
20363 * bison.simple: *** empty log message ***
20364
20365 1993-06-26 David J. MacKenzie <djm@gnu.org>
20366
20367 * src/getargs.c: entered into RCS
20368
20369 1993-06-26 David J. MacKenzie <djm@gnu.org>
20370
20371 * doc/bison.texinfo: *** empty log message ***
20372
20373 * doc/bison.1: New file.
20374
20375 1993-06-25 Richard Stallman <rms@gnu.org>
20376
20377 * src/getargs.c: New file.
20378
20379 1993-06-16 Richard Stallman <rms@gnu.org>
20380
20381 * src/bison.s1: *** empty log message ***
20382
20383 1993-06-16 Richard Stallman <rms@gnu.org>
20384
20385 * bison.simple: *** empty log message ***
20386
20387 1993-06-03 Richard Stallman <rms@gnu.org>
20388
20389 * src/bison.s1: New file.
20390
20391 1993-06-03 Richard Stallman <rms@gnu.org>
20392
20393 * doc/bison.texinfo: *** empty log message ***
20394
20395 1993-06-03 Richard Stallman <rms@gnu.org>
20396
20397 * bison.simple: New file.
20398
20399 1993-05-19 Richard Stallman <rms@gnu.org>
20400
20401 * doc/bison.texinfo: New file.
20402
20403 1993-05-07 Noah Friedman <friedman@gnu.org>
20404
20405 * Makefile.in: *** empty log message ***
20406
20407 1993-04-28 Noah Friedman <friedman@gnu.org>
20408
20409 * src/reader.c: *** empty log message ***
20410
20411 1993-04-23 Noah Friedman <friedman@gnu.org>
20412
20413 * src/alloc.h: entered into RCS
20414
20415 1993-04-20 David J. MacKenzie <djm@gnu.org>
20416
20417 * src/version.c: *** empty log message ***
20418
20419 * src/files.c, src/allocate.c:
20420 entered into RCS
20421
20422 * src/reader.c: *** empty log message ***
20423
20424 * src/lex.c: entered into RCS
20425
20426 * src/conflicts.c: New file.
20427
20428 * src/symtab.c: entered into RCS
20429
20430 * src/alloc.h: New file.
20431
20432 * src/LR0.c: entered into RCS
20433
20434 1993-04-18 Noah Friedman <friedman@gnu.org>
20435
20436 * src/reader.c: New file.
20437
20438 * src/version.c: *** empty log message ***
20439
20440 1993-04-18 Noah Friedman <friedman@gnu.org>
20441
20442 * Makefile.in: *** empty log message ***
20443
20444 1993-04-17 Noah Friedman <friedman@gnu.org>
20445
20446 * Makefile.in: *** empty log message ***
20447
20448 1993-04-15 Richard Stallman <rms@gnu.org>
20449
20450 * src/main.c, src/files.c:
20451 New file.
20452
20453 1993-04-15 Noah Friedman <friedman@gnu.org>
20454
20455 * configure.in: entered into RCS
20456
20457 * configure.in: *** empty log message ***
20458
20459 * configure.in: New file.
20460
20461 1993-04-14 Richard Stallman <rms@gnu.org>
20462
20463 * Makefile.in: New file.
20464
20465 1993-04-13 Richard Stallman <rms@gnu.org>
20466
20467 * src/version.c: New file.
20468
20469 1993-03-25 Richard Stallman <rms@gnu.org>
20470
20471 * src/output.c: entered into RCS
20472
20473 1992-09-25 Richard Stallman <rms@gnu.org>
20474
20475 * configure.bat: entered into RCS
20476
20477 1992-06-22 Richard Stallman <rms@gnu.org>
20478
20479 * src/vmsgetargs.c: entered into RCS
20480
20481 1992-06-22 Richard Stallman <rms@gnu.org>
20482
20483 * doc/bison.rnh: entered into RCS
20484
20485 1992-04-20 David J. MacKenzie <djm@gnu.org>
20486
20487 * README: entered into RCS
20488
20489 1992-01-22 Richard Stallman <rms@gnu.org>
20490
20491 * src/machine.h: entered into RCS
20492
20493 1991-12-21 Richard Stallman <rms@gnu.org>
20494
20495 * src/lalr.c, src/closure.c:
20496 entered into RCS
20497
20498 1991-12-20 Richard Stallman <rms@gnu.org>
20499
20500 * src/state.h: entered into RCS
20501
20502 1991-12-18 Richard Stallman <rms@gnu.org>
20503
20504 * src/print.c, src/nullable.c, src/derives.c:
20505 entered into RCS
20506
20507 1991-11-03 David J. MacKenzie <djm@gnu.org>
20508
20509 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
20510 entered into RCS
20511
20512 1988-09-09 Richard Stallman <rms@gnu.org>
20513
20514 * src/bison.hairy: entered into RCS
20515
20516 1987-12-16 Richard Stallman <rms@gnu.org>
20517
20518 * REFERENCES: entered into RCS
20519
20520
20521 -----
20522
20523 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
20524 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
20525 Free Software Foundation, Inc.
20526
20527 Copying and distribution of this file, with or without
20528 modification, are permitted provided the copyright notice and this
20529 notice are preserved.
20530
20531 $Id$