]> git.saurik.com Git - bison.git/blame - ChangeLog
Revert prior patch, by working around autoconf regression.
[bison.git] / ChangeLog
CommitLineData
f55efa38
JD
12008-04-23 Eric Blake <ebb9@byu.net>
2
3 Revert prior patch, by working around autoconf regression.
4 * tests/output.at (m4_expand): Add workaround for autoconf 2.62.
5 ("Output file name: ("): Uncomment test.
6 ("Output file name: )"): Likewise.
7 Based on an idea from Noah Misch.
8
096c9f9d
JD
92008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
10
11 Work-around an Autoconf 2.62 AT_SETUP bug that was not present in
12 2.61. Reported by Juan Manuel Guerrero at
13 <http://lists.gnu.org/archive/html/bug-bison/2008-04/msg00011.html>.
14 * tests/output.at ("Output file name: ("): Comment out test case for
15 now.
16 ("Output file name: )"): Likewise.
17
0f664b89
JD
182008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
19
20 * GNUmakefile: Update git-version-gen invocation so make dist
21 succeeds.
22
1cfe6375
JD
232008-04-21 Joel E. Denny <jdenny@ces.clemson.edu>
24
25 Update to the current gnulib CVS repository, and fix trigraph handling
26 in Bison.
27 * bootstrap: Update gnulib CVS repository URL.
28 (symlink_to_dir): Encapsulate the code that guarantees the destination
29 directory exists into...
30 (check_dst_dir): ... this new function, and...
31 (cp_mark_as_generated): ... reuse it here so that bootstrap doesn't
32 fail when copying files into lib/uniwidth/.
33 * src/output.c (prepare_symbols): When writing yytname muscles, where
34 symbol names will be encoded in C-string literals, tell quotearg to
35 escape trigraphs. This used to be the default in gnulib.
36 * tests/regression.at (Token definitions): Because of the change in
37 gnulib's quotearg behavior, string_as_id in parse-gram.y no longer
38 escapes trigraphs in symbol names. Thus, yytname no longer has
39 trigraphs unnecessarily doubly escaped. Update test case output.
40 Extend test case to be sure Bison's own error messages will no longer
41 have trigraphs in symbol names unnecessarily escaped once.
42
74c52fc8
JD
432008-04-20 Joel E. Denny <jdenny@ces.clemson.edu>
44
45 Fix make dist infinite loop reported by Juan Manuel Guerrero at
46 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00009.html>.
47 * .cvsignore: Add .version.
48 * .version.in: New.
49 * bootstrap.conf (gnulib_modules): Add git-version-gen.
50 * configure.ac (AC_CONFIG_FILES): Add .version.
51 * build-aux/.cvsignore: Add git-version-gen.
52
8e55b3aa
JD
532008-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
54
55 * NEWS (2.3a+): Mention that -g now takes an argument.
56 * doc/bison.texinfo (Bison Options): Reword -W entry a little for
57 consistency. Update the -g and -x entries now that they take
58 arguments. Use brackets to indicate optional arguments.
59 * src/getargs.c (usage): Explain the relationship between arguments of
60 long and short options more completely. Document --defines and -d
61 separately since the former takes an argument but, for POSIX Yacc, the
62 latter does not.
63 (short_options): Let -W take an optional argument like --warnings.
8452fdd9 64 (getargs): Sort cases.
8e55b3aa 65
59c5ac72
AD
662008-02-28 Akim Demaille <demaille@gostai.com>
67
68 * doc/bison.texinfo: Fix a few typos.
69
118d4978
AD
702008-02-28 Akim Demaille <akim@epita.fr>
71
72 * doc/bison.texinfo (Bison Options): Document -W.
73 Based on Joel E. Denny's NEWS entry, and Automake's documentation.
74
7020f1e9
AD
752008-02-28 Akim Demaille <akim@epita.fr>
76
77 * src/getargs.c (short_options): Split and sort for readability.
78 -g and -x take optional arguments, just like their long options.
79 * build-aux/cross-options.pl: Use /x to make the regexp easier to
80 understand.
81 Fix the handling of $opt which resulted in all the argument to be
82 considered as optional.
83
59da312b
JD
842008-02-22 Joel E. Denny <jdenny@ces.clemson.edu>
85
86 * NEWS (2.3a+): Don't say %language is experimental. Mention Java and
87 say its interface is experimental.
88 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
89 Java.
90 (Bison Options): In the -L and --language entry, mention Java.
91 (Java Bison Interface): Say the interface is experimental.
92 * src/getargs.c (usage): Mention -L and --language.
93
94 * NEWS (2.3a+): Say the push parsing interface is experimental.
95 * doc/bison.texinfo (Push Decl): Likewise.
96 (Decl Summary): Likewise in the "%define api.push_pull" entry.
97 (Push Parser Function): Likewise.
98 (Pull Parser Function): Likewise.
99 (Parser Create Function): Likewise.
100 (Parser Delete Function): Likewise.
101 (Table of Symbols): Likewise in the yypstate_delete, yypstate_new,
102 yypull_parse, and yypush_parse entries.
103
104 * NEWS (2.3a+): Mention XML support, and say the schema is
105 experimental.
106 * doc/bison.texinfo (Bison Options): Mention -x and --xml.
107 * src/getargs.c (usage): Say the XML schema is experimental.
108
109 * NEWS (2.3a+): Say option instead of flag.
110
2bb3ebec
WP
1112008-02-21 Wojciech Polak <polak@gnu.org>
112
113 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Change footer
114 text.
115
333e670c
JD
1162008-02-20 Joel E. Denny <jdenny@ces.clemson.edu>
117
118 Fix impure push parser compile error reported by Bob Rossi at
119 <http://lists.gnu.org/archive/html/help-bison/2008-02/msg00023.html>.
120 * data/yacc.c: Clean up whitespace in the output a little.
121 (yypstate_allocated): Define for impure push parsers regardless of
122 whether the pull interface is also requested.
123 * tests/push.at (Push Parsing: Multiple impure instances): Extend to
124 check impure push parsers without the pull interface.
125
126 * data/yacc.c (yypstate_new): Don't try to invoke yyerror since
127 yyerror takes arguments specified by %parse-param while yypstate_new
128 does not.
129 * doc/bison.texinfo (Parser Create Function): Document that
130 yypstate_new returns 0 for multiple impure parser instances.
131 * tests/push.at (Push Parsing: Multiple impure instances): Update
132 expected stderr output.
133
798096e1
JD
1342008-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
135
136 * runtime-po/POTFILES.in (push.c): Remove.
137
9ca7f077
JD
1382008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
139
140 * data/Makefile.am (dist_pkgdata_DATA): Remove push.c.
141 * data/push.c: Rename to...
142 * data/yacc.c: ... this, overwriting it.
143 * etc/bench.pl.in (bench_grammar): `%pure-parser'-> `%define api.pure'.
144 `%push-pull-parser' -> `%define api.push_pull "both"'.
145 Remove old yacc.c tests, and update push.c tests to yacc.c.
146
42ee26bb
JD
1472008-02-17 Joel E. Denny <jdenny@ces.clemson.edu>
148
149 * data/bison.m4 (b4_percent_code_get): Output %code block comments like
150 `"%code top" blocks' instead of `%code "top" blocks'.
151 * data/push.c: Import yacc.c changes from 2008-01-09 and 2007-08-03.
152 Clean up whitespace in the output a little.
153
b1cc23c4
JD
1542008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
155
156 Fix documentation problems reported by Tim Josling at
157 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00013.html>.
158 * NEWS (2.3a+): Mention removal of --no-parser, -n, and %no-parser.
159 * doc/bison.texinfo (Token Decl): Token numbers are *nonnegative*
160 integers. Explain the effect of literal string aliases on error
161 messages. Copy token 0 documentation from the C++ skeleton
162 documentation.
163
ab7f29f8
JD
1642008-02-16 Joel E. Denny <jdenny@ces.clemson.edu>
165
166 Accept a token number in a %left, %right, or %nonassoc for POSIX
167 conformance. Reported by Tim Josling at
168 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00010.html>.
169 * NEWS (2.3a+): Mention.
170 * doc/bison.texinfo (Precedence Decl): Describe how literal strings
171 and code numbers are treated by precedence declarations.
172 * src/parse-gram.y (precedence_declaration): Use symbols.prec instead
173 of symbols.1.
174 (symbols.prec): New, just like symbols.1 but uses symbol.prec instead
175 of symbol.
176 (symbol.prec): New, just like symbol but allows INT.
177 * src/symtab.c (symbol_user_token_number_set): Remove an aver that no
178 longer holds.
179 * tests/regression.at (Token number in precedence declaration): New
180 test case.
181
a924ef36
JMG
1822008-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
183
184 DJGPP specific issues.
185 * djgpp/config.bat: Add filenames that are not 8.3 clean and that must
186 be changed. Copyright timestamp adjusted.
187 * djgpp/config.sed: Add filenames that are not 8.3 clean and that must
188 be changed. Copyright timestamp adjusted.
189 * djgpp/config.site: Copyright timestamp adjusted.
190 * djgpp/config_h.sed: Copyright timestamp adjusted.
191 * djgpp/djunpack.bat: Copyright timestamp adjusted.
192 * djgpp/fnchnage.lst: Add filenames that are not 8.3 clean to the
193 filename translation list.
194 * djgpp/subpipe.c (init_subpipe): Check the environment variables
195 TMPDIR, TMP and TEMP, in that order, to determinate where the temp
196 files shall be created. Before trying to use the temp dir where the
197 environment variable points to check that the dir really exists. If
198 not default to the cwd as temp dir. Copyright timestamp adjusted.
199 * djgpp/subpipe.h: Copyright timestamp adjusted.
200 * djgpp/testsuite.sed: Copyright timestamp adjusted.
201
389c8cfd
PE
2022008-01-30 Paul Eggert <eggert@cs.ucla.edu>
203
204 * doc/bison.texinfo: Update Back-Cover text to reflect new GNU wording.
205
5d1cfef4
PE
2062008-01-09 Paul Eggert <eggert@cs.ucla.edu>
207
208 * data/yacc.c (yyparse): Correct the comment when locations aren't used.
209 Problem reported by Claudio Saavedra in
210 <http://lists.gnu.org/archive/html/bug-bison/2008-01/msg00003.html>.
211
e2dcf996
WP
2122008-01-05 Wojciech Polak <polak@gnu.org>
213
214 * data/xslt/xml2xhtml.xsl (xsl:template match="/"): Precede an XHTML
215 document's title with the input grammar file name.
216
da730230
JD
2172007-12-22 Joel E. Denny <jdenny@ces.clemson.edu>
218
219 Automate regression testing of the XML/XSLT implementation. Discussed
220 starting at
221 <http://lists.gnu.org/archive/html/bison-patches/2007-11/msg00021.html>.
222 * configure.ac (XSLTPROC): New substitution.
223 * Makefile.am (maintainer-xml-check): New phony target invoking...
224 * tests/Makefile.am (maintainer-xml-check): ... this new phony target
225 invoking make maintainer-check with BISON_TEST_XML=1.
226 * tests/atlocal.in (XSLTPROC): New.
227 * tests/local.at (AT_BISON_CHECK): New macro to (1) instruct Valgrind
228 not to report reachable memory when Bison is expected to have a
229 non-zero exit status and (2) to compare XML/XSLT output with --graph
230 and --report=all output for every working grammar when
231 BISON_TEST_XML=1.
232 (AT_BISON_CHECK_NO_XML): Likewise, but skip XML checks.
233 (AT_BISON_CHECK_XML): New.
234 (AT_QUELL_VALGRIND): New.
235 * tests/testsuite.at (ORIGINAL_AT_CHECK): Remove this and...
236 (AT_CHECK): ... don't redefine this since this was the old way to
237 quell Valgrind.
238 * tests/actions.at: Rewrite all AT_CHECK invocations for bison as
239 AT_BISON_CHECK invocations.
240 * tests/c++.at: Likewise.
241 * tests/calc.at: Likewise.
242 * tests/conflicts.at: Likewise.
243 * tests/cxx-type.at: Likewise.
244 * tests/existing.at: Likewise.
245 * tests/glr-regression.at: Likewise.
246 * tests/headers.at: Likewise.
247 * tests/input.at: Likewise.
248 * tests/java.at: Likewise.
249 * tests/output.at: Likewise.
250 * tests/push.at: Likewise.
251 * tests/reduce.at: Likewise.
252 * tests/regression.at: Likewise.
253 * tests/sets.at: Likewise.
254 * tests/skeletons.at: Likewise.
255 * tests/synclines.at: Likewise.
256 * tests/torture.at: Likewise.
257 (Big triangle): Use AT_BISON_CHECK_NO_XML instead since this grammar
258 tends to hang xsltproc.
259 (Big horizontal): Likewise.
260
408476bc
JD
2612007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
262
263 In XML output, remove redundant class attribute on symbol element.
264 * data/xslt/bison.xsl (xsl:key name="bison:symbolByName"): New.
265 * data/xslt/xml2xhtml.xsl (xsl:template match="symbol"): Use it to
266 look up a symbol to determine whether it's a nonterminal or terminal.
267 * src/gram.c (rule_rhs_print_xml): Remove class attribute.
268 * src/state.c (state_rule_lookahead_tokens_print_xml): Likewise.
269
270 Add prec/assoc information to XML output.
271 * src/gram.c (grammar_rules_print_xml): For each rule that has a
272 %prec, add a percent_prec attribute.
273 * src/print-xml.c (print_grammar): For each terminal that has a
274 precedence or associativity, add a prec or assoc attribute.
275 (xml_indent): New.
276 (xml_puts): Use xml_indent.
277 (xml_printf): Use xml_indent.
278 * src/print-xml.h (xml_indent): Prototype.
279
280 * tests/existing.at (GNU pic Grammar): Fix a rule miscopied from
281 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
282
d4a26c48
JD
2832007-12-08 Joel E. Denny <jdenny@ces.clemson.edu>
284
285 * data/xslt/bison.xsl (bison:ruleNumber): Rename to...
286 (bison:ruleByNumber): ... this for clarity.
287 * data/xslt/xml2dot.xsl (xsl:template match="item"): Update.
288 * data/xslt/xml2text.xsl (xsl:template match="item"): Update.
289 (xsl:template match="reduction"): Update.
290 (xsl:template match="item"): Update.
291 (xsl:template match="reduction"): Update.
292
293 In the XML output, don't print the list of rules where symbols appear.
294 Compute it in XSLT instead. Discussed at
295 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00024.html>.
296 * data/xslt/bison.xsl (bison:ruleByLhs): New.
297 (bison:ruleByRhs): New.
298 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Use
299 bison:ruleByRhs.
300 (xsl:template match="terminal/rule"): Remove.
301 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
302 bison:ruleByRhs.
303 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
304 Remove.
305 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Use
306 bison:ruleByRhs and mode="number-link" for rule template.
307 (xsl:template match="terminal/rule"): Remove.
308 (xsl:template match="nonterminal"): Use bison:ruleByLhs and
309 bison:ruleByRhs and mode="number-link" for rule template.
310 (xsl:template match="nonterminal/left/rule|nonterminal/right/rule"):
311 Rewrite as...
312 (xsl:template match="rule" mode="number-link"): ... this.
313 * src/print-xml.c (print_grammar): Don't print the list of rules.
314
ef1b4273
JD
3152007-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
316
317 Don't let --report affect XML output; always print all information.
318 Discussed at
319 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00020.html>.
320 * src/conflicts.c (log_resolution): Implement.
321 * src/print-xml.c (print_core): Implement.
322 (print_state): Implement.
323 (print_xml): Implement.
324
325 * NEWS (2.3a+): Fix quotes.
326 * src/parse-gram.y (prologue_declaration): For consistency with -v,
327 don't let %verbose clear the list specified by --report.
328
0f6cd9e3
AD
3292007-11-26 Akim Demaille <akim@epita.fr>
330
331 * data/Makefile.am (dist_pkgdata_DATA): Ship and install bison.xsl.
332
d80fb37a
JD
3332007-11-24 Joel E. Denny <jdenny@ces.clemson.edu>
334
335 In the XML output, list useless and unused symbols and rules with the
336 useful ones and add a "usefulness" attribute. Discussed starting at
337 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00017.html>.
338 * src/gram.c (grammar_rules_partial_print_xml): Remove.
339 (grammar_rules_print_xml): Print all rules instead of just those
340 useful in the grammar, and add a "usefulness" attribute.
341 * src/gram.h (grammar_rules_partial_print_xml): Remove prototype.
342 * src/print-xml.c (print_rules_useless_in_parser): Remove.
343 (print_grammar): Print all nonterminals instead of just useful ones,
344 and add a "usefulness" attribute to nonterminals and terminals.
345 (print_xml): Don't print a separate "reductions" or
346 "rules-useless-in-parser" element.
347 * src/reduce.c (reduce_output): Use reduce_token_unused_in_grammar.
348 (reduce_xml): Remove.
349 (reduce_token_unused_in_grammar): New.
350 (reduce_nonterminal_useless_in_grammar): New.
351 * src/reduce.h (reduce_xml): Remove prototype.
352 (reduce_token_unused_in_grammar): Add prototype.
353 (reduce_nonterminal_useless_in_grammar): Add prototype.
354 * data/xslt/xml2text.xsl: Update for XML changes.
355 * data/xslt/xml2xhtml.xsl: Update for XML changes.
356 * tests/reduce.at (Useless Terminals): Update output.
357 (Useless Rules): Update output.
358 (Reduced Automaton): Update output.
359
360 Say "Terminals unused in grammar" instead of "Unused terminals".
361 * NEWS (2.3a+): Update.
362 * doc/bison.texinfo (Understanding): Update example output.
363 * src/reduce.c (reduce_output): Implement.
364 * data/xslt/xml2text.xsl: Implement.
365 * data/xslt/xml2xhtml.xsl: Implement.
366
1bb2bd75
JD
3672007-11-18 Joel E. Denny <jdenny@ces.clemson.edu>
368
369 Accept --report-file=FILE to override the default `.output' filename.
370 * NEWS (2.3a+): Mention.
371 * doc/bison.texinfo (Bison Options): Add an entry.
372 * src/files.c (compute_output_file_names): Don't override
373 spec_verbose_file if already set.
374 * src/getargs.c (usage): Document --report-file.
375 (REPORT_FILE_OPTION): New anonymous enum member.
376 (long_options): Add entry for it.
377 (getargs): Add case for it setting spec_verbose_file.
378
379 * build-aux/cross-options.pl: Don't record a short option just because
380 there's an arg.
381 * doc/.cvsignore: Add yacc.1.
382
a005a9c4
AD
3832007-11-14 Akim Demaille <akim@epita.fr>
384
385 * doc/yacc.1.in: New.
386 * configure.ac, doc/Makefile.am: Adjust.
387 * configure.ac (PACKAGE_COPYRIGHT_YEAR): New substitution, and new
388 config.h symbol.
389 Use AC_SUBST for assignments too.
390 * src/getargs.c (version): Use PACKAGE_COPYRIGHT_YEAR.
391
cff03fb2
JD
3922007-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
393
394 * src/gram.c: Remove comments that duplicate comments in gram.h.
395
396 When reporting useless rules and nonterminals, say "useless in grammar"
397 instead of "useless", and say "useless in parser" instead of "never
398 reduced". Discussed starting at
399 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00033.html>.
400 * NEWS (2.3a+): Mention this change.
401 * data/xslt/xml2text.xsl: Update output text and expected input XML
402 element names to match changes below.
403 * data/xslt/xml2xhtml.xsl: Likewise.
404 (xsl:template match="bison-xml-report"): Add missing entry in Table of
405 Contents: "Rules useless in parser due to conflicts".
406 * doc/bison.texinfo (Decl Summary): Reword a little.
407 (Understanding): Update example output for changes below.
408 * src/gram.c: (rule_useful_p): Rename to...
409 (rule_useful_in_grammar_p): ... this.
410 (rule_useless_p): Rename to...
411 (rule_useless_in_grammar_p): ... this.
412 (rule_never_reduced_p): Rename to...
413 (rule_useless_in_parser_p): ... this.
414 (grammar_rules_print): Update for renames.
415 (grammar_rules_print_xml): Update for renames.
416 (grammar_rules_never_reduced_report): Rename to...
417 (grammar_rules_useless_report): ... this since it is used for either
418 kind of useless rule.
419 * src/gram.h: Reword comments and update function names in prototypes.
420 * src/main.c (main): Say "rule useless in parser due to conflicts".
421 * src/print-xml.c (print_rules_never_reduced): Rename to...
422 (print_rules_useless_in_parser): ... this, and rename output XML
423 element "rules-never-reduced" to "rules-useless-in-parser".
424 (print_xml): Update for rename.
425 * src/print.c (print_results): Say "Rules useless in parser due to
426 conflicts".
427 * src/reduce.c (reduce_grammar_tables): Say "rule useless in grammar".
428 (nonterminals_reduce): Say "nonterminal useless in grammar".
429 (reduce_output): Say "Nonterminals useless in grammar".
430 Say "Rules useless in grammar".
431 (reduce_xml): Rename output XML element "useless" to
432 "useless-in-grammar".
433 (reduce_print): Don't report the count of grammatically useless rules
434 as "rules never reduced" just because %yacc is specified.
435 In the correct report of this count, say nonterminal(s) and rule(s)
436 "useless in grammar".
437 * tests/conflicts.at (S/R in initial): Update expected output.
438 (Defaulted Conflicted Reduction): Likewise.
439 (Unreachable States After Conflict Resolution): Likewise.
440 * tests/existing.at (GNU pic Grammar): Likewise.
441 * tests/reduce.at (Useless Nonterminals): Likewise.
442 (Useless Rules): Likewise.
443 (Reduced Automaton): Likewise.
444 (Underivable Rules): Likewise.
445 (Empty Language): Likewise.
446
66f0441d
JD
4472007-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
448
449 * data/bison.m4 (b4_cat): Put a newline after the end delimiter of the
450 here document and before the EOF so that BSD's implementation of Bourne
451 shell doesn't parse the delimiter as part of the here document.
452 * doc/.cvsignore: Add cross-options.texi.
453 * src/getargs.c (usage): Add a blank line after the warning categories.
454
d0ee4105
PB
4552007-11-08 Paolo Bonzini <bonzini@gnu.org>
456
457 * data/lalr1.java (Lexer): Remove usage of b4_pure_if.
458
e8b1fb9b
AD
4592007-11-05 Akim Demaille <akim@epita.fr>
460
461 Remove Id: from bison.1.
462 * doc/Makefile.am (remove_time_stamp): Include the sed invocation.
463 (perl -0777 -pi -e 's/\.PP\nId): New.
464 (.x.1): Use it to ignore the version control revision.
465
2f7a96b5
AD
4662007-11-05 Akim Demaille <demaille@gostai.com>
467
468 * build-aux/Makefile.am: Ship cross-options.pl.
469 * doc/Makefile.am: Always refer to cross-options.texi with
470 $(srcdir).
471 (MAINTAINERCLEANFILES): Add it.
472
f4101aa6
AD
4732007-11-04 Akim Demaille <demaille@gostai.com>
474
475 Generate the long/short option cross-table.
476 * build-aux/cross-options.pl: New.
477 * doc/Makefile.am (cross-options.texi): New.
478 * doc/bison.texinfo: Use it.
479
727a1401
AD
4802007-11-04 Akim Demaille <demaille@gostai.com>
481
482 Generate bison.1 using help2man.
483 * doc/common.x, doc/bison.x: New.
484 * doc/Makefile.am (bison.1, .x.1): New.
485 The code is taken from autoconf-2.61/man/Makefile.am.
486 * configure.ac: Look for help2man.
487
6aeb9c57
AD
4882007-11-04 Akim Demaille <demaille@gostai.com>
489
490 Complete --help.
491 * src/getargs.c (usage): Document -W, make it clear that -d,
492 -g and -x have optional arguments.
493
d7be4085
AD
4942007-11-04 Akim Demaille <demaille@gostai.com>
495
496 Find sha1sum when named gsha1sum.
497 * bootstrap (find_tool): New.
498 ($SHA1SUM): New.
499
d9df47b6
JD
5002007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
501
502 Deprecate %pure-parser and add `%define api.pure'. Discussed starting
503 at
504 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00006.html>.
505 * NEWS (2.3a+): Mention.
506 * data/bison.m4 (b4_pure_if): Don't define it here.
507 * data/c.m4 (b4_identification): Depend on individual skeletons to
508 define b4_pure_flag, b4_push_flag, or b4_pull_flag if they use the
509 values of the %define variables api.pure or api.push_pull. Define
510 YYPURE, YYPUSH, and YYPULL accordingly.
511 * data/glr.c: Define b4_pure_if based on `%define api.pure' unless
512 glr.cc has already defined b4_pure_flag.
513 * data/push.c: Define b4_pure_if based on `%define api.pure'.
514 Remove YYPUSH and YYPULL since they're back in b4_identification again.
42ee26bb 515 * data/yacc.c: Define b4_pure_if based on `%define api.pure'.
d9df47b6
JD
516 * doc/bison.texinfo (Pure Decl): Update.
517 (Push Decl): Update.
518 (Decl Summary): Add api.pure to %define entry.
519 In %pure-parser entry, say it's deprecated and reference %define.
520 (Pure Calling): Update.
521 (Error Reporting): Update.
522 (C++ Scanner Interface): Update.
523 (How Can I Reset the Parser): Update.
524 (Table of Symbols): In %pure-parser entry, say it's deprecated and
525 reference %define.
526 * src/getargs.c (pure_parser): Remove global variable.
527 * src/getargs.h (pure_parser): Remove extern.
528 * src/output.c (prepare): Don't define pure_flag muscle.
529 * src/parse-gram.y (prologue_declaration): Implement %pure-parser as a
530 wrapper around `%define api.pure'.
531 * tests/calc.at (Simple LALR Calculator): Update.
532 (Simple GLR Calculator): Update.
533 * tests/cxx-type.at (GLR: Resolve ambiguity, pure, no locations):
534 Update.
535 (GLR: Resolve ambiguity, pure, locations): Update.
536 (GLR: Merge conflicting parses, pure, no locations): Update.
537 (GLR: Merge conflicting parses, pure, locations): Update.
538 * tests/glr-regression.at (Uninitialized location when reporting
539 ambiguity): Update
540 * tests/input.at (Unused %define api.pure): New test case.
541 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Update definition for
542 AT_PURE_IF and AT_PURE_AND_LOC_IF.
543 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
544
c373bf8b
JD
5452007-10-28 Joel E. Denny <jdenny@ces.clemson.edu>
546
547 %define push_pull -> %define api.push_pull. Discussed starting at
548 <http://lists.gnu.org/archive/html/bison-patches/2007-09/msg00005.html>.
549 * data/push.c: Expect the new name.
550 * data/yacc.c: Likewise.
551 * doc/bison.texinfo (Push Decl): Update.
552 (Decl Summary): Update %define entry.
553 (Push Parser Function): Update.
554 (Pull Parser Function): Update.
555 (Parser Create Function): Update.
556 (Parser Delete Function): Update.
557 * tests/calc.at (Simple LALR Calculator): Update.
558 * tests/input.at (%define enum variables): Update.
559 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update.
560 (Push Parsing: Multiple impure instances): Update.
561 (Push Parsing: Unsupported Skeletons): Update.
562 * tests/torture.at (Exploding the Stack Size with Alloca): Update.
563 (Exploding the Stack Size with Malloc): Update.
564
565 * NEWS (2.3a+): Add an entry for the push parser, and clean up the
566 other entries some.
567
32f19b6b
JD
5682007-10-27 Joel E. Denny <jdenny@ces.clemson.edu>
569
570 For the XML output's terminal element, rename @number to @token-number,
571 and add @symbol-number. In the nonterminal element, rename @number to
572 @symbol-number. Discussed starting at
573 <http://lists.gnu.org/archive/html/bison-patches/2007-10/msg00040.html>.
574 * data/xslt/xml2text.xsl (xsl:template match="terminal"): Update for
575 renames.
576 (xsl:template match="nonterminal"): Likewise.
577 * data/xslt/xml2xhtml.xsl (xsl:template match="terminal"): Likewise.
578 (xsl:template match="nonterminal"): Likewise.
579 * src/print-xml.c (print_grammar): Implement.
580
255a6b90
JD
5812007-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
582
583 * data/xslt/xml2dot.xsl (xsl:template match="automaton/state"): After
584 2007-10-11 change, the child elements here are items not rules.
408476bc 585 (xsl:template match="item"): New.
255a6b90
JD
586 (xsl:template match="rule"): Update for new reduced itemset.
587 (xsl:template match="point"): Remove.
588 (xsl:template match="empty"): For consistency with --graph, don't
589 output "/* empty */".
590 * data/xslt/xml2text.xsl (xsl:template match="terminal"): When invoking
591 line-wrap, don't pass a negative value as first-line-length since this
592 won't work with the following changes.
593 (xsl:template name="line-wrap"): Simplify slightly.
594 (xsl:template name="ws-search"): Eliminate recursion.
595 * src/print_graph.c (print_core): Don't print a reduction's lookahead
596 set next to an item whose dot is not at the end of the RHS even if it
597 happens to be associated with the same rule.
598
88c78747
JD
5992007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
600
31984206
JD
601 Add %define lr.keep_unreachable_states.
602 * NEWS (2.3a+): Mention it in the entry for unreachable state removal.
603 * doc/bison.texinfo (Decl Summary): Mention it in the %define entry.
604 * src/main.c (main): Implement it.
605 * tests/conflicts.at (Unreachable States After Conflict Resolution):
606 Extend to test it, and fix a typo.
607
6082007-10-19 Joel E. Denny <jdenny@ces.clemson.edu>
609
610 * NEWS (2.3a+): Add entry for recent .output file lookahead set fix.
88c78747
JD
611 * doc/bison.texinfo (Understanding): Remove a bogus lookahead set in
612 the example .output text.
613 * tests/regression.at (Extra lookahead sets in report): Improve wording
614 of comments.
615
b7a70162
WP
6162007-10-17 Wojciech Polak <polak@gnu.org>
617
618 * src/print-xml.c (print_grammar): Renamed
619 <terminal> and <nonterminal> attributes:
620 "type" to "number" and "symbol" to "name".
621 * data/xslt/xml2text.xsl (xsl:template match="terminal"):
622 Use new attribute names.
623 (xsl:template match="nonterminal"): Likewise.
624 * data/xslt/xml2xhtml.xsl: Likewise.
625
a0de5091
JD
6262007-10-17 Joel E. Denny <jdenny@ces.clemson.edu>
627
628 * doc/bison.texinfo (Bison Options): Add entry for --print-datadir.
629 (Option Cross Key): Likewise.
630
631 * src/print-xml.c (print_core): Don't print a reduction's lookahead set
632 next to an item whose dot is not at the end of the RHS even if it
633 happens to be associated with the same rule.
634 * src/print.c (print_core): Likewise.
635 * tests/conflicts.at (Unresolved SR Conflicts): Update output.
636 (Resolved SR Conflicts): Update output.
637 * tests/regression.at (Extra lookahead sets in report): New test case.
638
4c20d18d
WP
6392007-10-11 Wojciech Polak <polak@gnu.org>
640
641 * src/print-xml.c (print_core): Remove item set
642 redundancy.
643 * data/xslt/bison.xsl (bison:ruleNumber): New key.
644 Improve processing time. Suggested by Joel E. Denny.
645 * data/xslt/xml2dot.xsl (xsl:template name="escape"):
646 Write xsl:param "required" attribute as comment.
647 * data/xslt/xml2text.xsl (xsl:template match="item"): New.
648 (xsl:template match="rule"): Support new reduced itemset.
649 (xsl:template match="point"): Remove.
650 * data/xslt/xml2xhtml.xsl: Likewise.
651
f506ad1c
JD
6522007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
653
654 * src/getargs.c (version): Update copyright year.
655
21f1b063
JD
6562007-10-09 Joel E. Denny <jdenny@ces.clemson.edu>
657
658 Make xml2dot.xsl and --graph produce the same output.
659 * data/xslt/xml2dot.xsl (xsl:template match="rule"): Use a `&#10;'
660 instead of a `\n'. That is, don't add escapes yet or they'll be doubly
661 escaped later.
662 (xsl:template name="output-node"): Use the new escape template instead
663 of the string-replace template directly.
664 (xsl:template name="output-edge"): Likewise.
665 (xsl:template name="escape"): New, escapes backslashes and newlines in
666 addition to quotation marks.
667 * src/graphviz.c (start_graph, output_node, output_edge): Add
668 whitespace to output for legibility.
669
670 Make xml2text.xsl and --report produce the same output, and remove the
671 XML "conflicts" element since a conflict summary is easily extracted
672 from the automaton.
673 * data/xslt/bison.xsl: New.
674 (xsl:template match="state" mode="bison:count-conflicts): New.
675 * data/xslt/xml2text.xsl: Import bison.xsl.
676 (xsl:template match="bison-xml-report"): Instead of styling the
677 "conflicts" element, style the "automaton" element with mode
678 "conflicts". Unlike the former, the latter lists S/R and R/R
679 conflicts for a state on the same line.
680 (xsl:template match="conflicts"): Remove.
681 (xsl:template match="conflict"): Remove.
682 (xsl:template match="terminal"): Line-wrap the list of rules in which
683 the terminal is used.
684 (xsl:template match="nonterminal"): Likewise for nonterminals.
685 (xsl:template match="automaton" mode="conflicts"): New.
686 (xsl:template match="state" mode="conflicts"): New.
687 (xsl:template name="line-wrap"): New.
688 (xsl:template name="ws-search"): New.
689 * data/xslt/xml2xhtml.xsl: Import bison.xsl.
690 (xsl:template match="bison-xml-report"): Instead of styling the
691 "conflicts" element, style the "automaton" element with mode
692 "conflicts."
693 (xsl:template match="conflicts"): Remove.
694 (xsl:template match="conflict"): Remove.
695 (xsl:template match="automaton" mode="conflicts"): New.
696 (xsl:template match="state" mode="conflicts): New.
697 * src/conflicts.c (conflicts_output_xml): Remove.
698 * src/conflicts.h (conflicts_output_xml): Remove prototype.
699 * src/print-xml.c (print_xml): Don't invoke conflicts_output_xml.
700 * src/print.c (print_grammar): Consistently wrap at the 66th column so
701 the corresponding XSLT is easier. Also, never wrap between a word and
702 the comma that follows it.
703
793fbca5
JD
7042007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
705
706 Improve C++ namespace support. Discussed starting at
707 <http://lists.gnu.org/archive/html/help-bison/2007-09/msg00016.html>.
708 * data/c++.m4: (b4_namespace_ref, b4_namespace_open,
709 b4_namespace_close): New macros that interpret the %define variable
710 "namespace" so its value can contain "::" to indicate nested
711 namespaces.
712 * data/glr.cc (b4_namespace): Don't define, and replace all uses with
713 the above macros.
714 * data/lalr1.cc (b4_namespace): Likewise.
715 * data/location.cc (b4_namespace): Likewise.
716 * doc/bison.texinfo (Decl Summary): Move `%define push_pull' entry
717 inside a new table in the general %define entry. Document `%define
718 namespace' there as well. Point the %name-prefix entry to it since it
719 explains it more completely in the case of C++.
720 (C++ Bison Interface): Mention `%define namespace' instead of
721 %name-prefix.
722 (Table of Symbols): Remove the `%define push_pull' entry. The %define
723 entry suffices.
724 * tests/c++.at (Relative namespace references): New test case.
725 (Absolute namespace references): New test case.
726 (Syntactically invalid namespace references): New test case.
727 * tests/input.at (C++ namespace reference errors): New test case.
728
35b8730d
JD
7292007-10-08 Joel E. Denny <jdenny@ces.clemson.edu>
730
731 Add syncline support and location accessor to internal %define
732 interfaces.
733 * data/bison.m4 (b4_percent_define_get_loc): New.
734 (b4_percent_define_get_syncline): New.
735 (b4_percent_define_flag_if): Use b4_percent_define_get_loc.
736 (b4_percent_define_default): Record defining location as line 1 rather
737 than 0 for the sake of synchronizing #line's, and define
738 b4_percent_define_syncline(VARIABLE).
739 (b4_percent_define_check_values): Use b4_percent_define_get_loc.
740 * src/muscle_tab.c (muscle_syncline_grow): New.
741 (muscle_code_grow): Use muscle_syncline_grow.
742 (muscle_percent_define_insert): Use muscle_percent_define_get_loc, and
743 define b4_percent_define_syncline(VARIABLE).
744 (muscle_percent_define_get_loc): New.
745 (muscle_percent_define_get_syncline): New.
746 (muscle_percent_define_flag_if): Use muscle_percent_define_get_loc, and
747 remove some unused variables.
748 (muscle_percent_define_default): Record defining location as line 1
749 rather than 0 for the sake of synchronizing #line's, and define
750 b4_percent_define_syncline(VARIABLE).
751 (muscle_percent_define_check_values): Use
752 muscle_percent_define_get_loc.
753 * src/muscle_tab.h (muscle_percent_define_get_loc): Prototype.
754 (muscle_percent_define_get_syncline): Prototype.
755 * tests/skeletons.at (%define Boolean variables: invalid skeleton
756 defaults): Update output for location change.
757 (Complaining during macro argument expansion): Extend to test
758 b4_percent_define_get_loc and b4_percent_define_get_syncline errors.
759
7dc4a694
JD
7602007-10-07 Joel E. Denny <jdenny@ces.clemson.edu>
761
762 Fix some error-reporting macro bugs.
763 * data/bison.m4 (b4_cat): New.
764 (b4_error, b4_error_at): Use b4_cat to send error directives directly
765 to stdout so they don't become arguments to other macros. Update
766 comments and add examples.
767 (b4_warn, b4_warn_at, b4_complain, b4_complain_at): Update comments and
768 add examples.
769 (b4_fatal, b4_fatal_at): Likewise, and invoke m4_exit(1) immediately
770 after printing the error directive so that M4 doesn't report subsequent
771 problems that are induced by this problem.
772 * src/scan-skel.l: Recognize @` digraph outside of directive arguments
773 instead of just in them. Recognize @\n in both places. Both expand to
774 the empty string. Needed by b4_cat.
775 * tests/skeletons.at (Complaining during macro argument expansion):
776 New test case.
777 (Fatal errors make M4 exit immediately): New test case.
778
d4bd2295
JD
7792007-10-04 Joel E. Denny <jdenny@ces.clemson.edu>
780
781 Implement --print-datadir.
782 * src/getargs.c (usage): Mention.
783 (PRINT_DATADIR_OPTION): New anonymous enum member.
784 (long_options): Add entry for it.
785 (getargs): Add case for it calling compute_pkgdatadir.
786 * src/output.c (output_skeleton): Encapsulate data directory
787 computation from here...
788 (prepare): ... and from here...
789 (compute_pkgdatadir): ... into this new function.
790 * src/output.h (compute_pkgdatadir): Prototype.
791
34cdeddf
JD
7922007-09-29 Joel E. Denny <jdenny@ces.clemson.edu>
793
794 * src/print-xml.c (escape_bufs): New static global variable
795 replacing...
796 (xml_escape_n): ... the static local variable buf here.
797 (print_xml): Free memory for escape_bufs.
798 * src/reduce.c (reduce_xml): XML-escape terminal symbol tags.
799
d782395d
JD
8002007-09-25 Joel E. Denny <jdenny@ces.clemson.edu>
801
802 Replace `%push-parser' and `%push-pull-parser' with
803 `%define push_pull "push"' and `%define push_pull "both"'.
804 `%define push_pull "pull"' is the default.
805 * doc/bison.texinfo (Push Decl, Push Parser Function,
806 Pull Parser Function, Parser Create Function, Parser Delete Function):
807 Update declarations.
808 (Decl Summary, Table of Symbols): Replace %push-parser and
809 %push-pull-parser entries with a %define push_pull entry.
810 * data/bison.m4 (b4_percent_define_check_values): New macro.
811 (b4_pull_if, b4_push_if, b4_use_push_for_pull_if): Move these
812 definitions...
813 * data/c.m4 (b4_identification): ... and the YYPUSH and YYPULL cpp
814 definitions...
815 * data/push.c: ... to here and compute them from the value of the
816 %define variable push_pull.
817 * data/c-skel.m4: Instead of choosing the push.c skeleton for push
818 parsing requests here...
819 * data/yacc.c: ... hack this to switch to push.c any time
820 b4_use_push_pull_flag or the %define variable push_pull is set. This
821 will go away when we mv push.c yacc.c.
822 * data/c++-skel.m4, data/glr.c, data/java-skel.m4: Don't report that
823 push parsing is not supported since unused %define variables are
824 reported anyway.
825 * src/getargs.c, src/getargs.h (pull_parser, push_parser): Remove.
826 * src/muscle_tab.h (muscle_percent_define_check_values): Update
827 comments for consistency with b4_percent_define_check_values.
828 * src/output.c (prepare): Don't insert b4_pull_flag and b4_push_flag
829 muscles.
830 * src/parse-gram.y (PERCENT_PUSH_PARSER, PERCENT_PUSH_PULL_PARSER):
831 Remove.
832 (prologue_declaration): Remove %push-parser and %push-pull-parser
833 rules.
834 * src/scan-gram.l (%push-parser, %push-pull-parser): Remove rules.
835 * tests/calc.at: Update declarations.
836 * tests/input.at (%define enum variables): New test case.
837 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Update
838 declaration.
839 (Push Parsing: Multiple impure instances): Update declaration.
840 (Push Parsing: Unsupported Skeletons): New test case.
841 * tests/torture.at (Exploding the Stack Size with Alloca): Update
842 declaration.
843 (Exploding the Stack Size with Malloc): Update declaration.
844
3f999f78
WP
8452007-09-24 Wojciech Polak <polak@gnu.org>
846
847 Add XSLT transformations.
848
849 * data/xslt/xml2dot.xsl: Transform XML into DOT.
850 * data/xslt/xml2text.xsl: Transform XML into plain text.
851 * data/xslt/xml2xhtml.xsl: Transform XML into XHTML.
852 * data/Makefile.am (xsltdir): New variable.
853 (dist_xslt_DATA): Add xslt/*.xsl files.
854
a4f75309
PE
8552007-09-23 Paul Eggert <eggert@cs.ucla.edu>
856
857 * src/conflicts.c (log_resolution): Fix indenting bugs I introduced.
858 Problem reported by Wojciech Polak.
859 * src/print-xml.c (xml_puts): Work even if LEVEL exceeds INT_MAX/2.
860 (xml_printf): Undo change I made on 21 September; that is,
861 indent 2 spaces, not 1.
862
ad5feac4
JD
8632007-09-23 Joel E. Denny <jdenny@ces.clemson.edu>
864
865 Pacify ./configure --enable-gcc-warnings.
866 * src/print-xml.c, src/print-xml.h (xml_puts): Make third argument
867 `char const *' instead of `char *'.
868 * src/state.c (state_rule_lookahead_tokens_print_xml): Remove unused
869 local variable `sep'.
870
41d7a5f2
PE
8712007-09-21 Paul Eggert <eggert@cs.ucla.edu>
872
873 * src/gram.c (rule_rhs_print_xml): Now static, since it isn't used
874 elsewhere.
875 * src/print-xml.c: Prefer "const" after types; that's more consistent.
876 (xml_printf): Indent just 1 space for level.
877 (e_char, xlate_char): Remove.
878 (xml_escape_string): Rewrite to avoid undefined behavior (used
879 storage that was freed from the stack).
880 (xml_escape_n): Don't bother checking for subscript error.
881
3f999f78
WP
8822007-09-21 Wojciech Polak <polak@gnu.org>
883
884 Add Bison XML Automaton Report.
41d7a5f2
PE
885
886 Add support for an -x option to generate an XML report.
887 It is not documented yet.
888 * src/print-xml.c: New file.
889 * src/print-xml.h: Likewise.
890 * lib/timevar.def (TV_XML): New var.
891 * src/Makefile.am (bison_SOURCES): Add print-xml.c, print-xml.h.
892 * src/conflicts.c: Include print-xml.h.
893 (solved_conflicts_xml_obstack): New var.
894 (log_resolution, conflicts_solve, conflicts_free):
895 Add support for XML report.
896 (conflicts_output_val): New function.
897 * src/conflicts.h (conflicts_output_val): New decl.
898 * src/files.c (spec_xml_file): New var.
899 (compute_output_file_names, output_file_names_free): Add XML support.
900 * src/files.h (spec_xml_file): New decl.
901 * src/getargs.c (xml_flag): New var.
902 (usage, short_options, long_options, getargs): Add XML support.
903 * src/getargs.h (xml_flag): New decl.
904 * src/gram.c: Include print-xml.h.
905 (rule_lhs_print_xml, rule_rhs_print_xml):
906 (grammar_rules_partial_print_xml, grammar_rules_print_xml):
907 New functions.
908 * src/gram.h: Declare external ones.
909 * src/main.c: Include print-xml.h.
910 (main): Add XML support.
911 * src/reduce.c: Include print-xml.h.
912 (reduce_xml): New function.
913 * src/reduce.h: Declare it.
914 * src/state.c: Include print-xml.h.
915 (state_new): Add XML support.
916 (state_rule_lookahead_tokens_print_xml): New function.
917 * src/state.h: Declare it.
918 (struct state): New member solved_conflicts_xml.
919 * src/symtab.c (symbol_class_get_string): New function.
920 * src/symtab.h: Declare it.
921
6d8e724d
PE
9222007-09-21 Paul Eggert <eggert@cs.ucla.edu>
923
924 * GNUmakefile: Switch to coreutils's version.
925 * bootstrap: Likewise.
926 * Makefile.cfg: Adjust to new GNUmakefile.
927 * README-hacking: Likewise.
928
929 Import from gnulib:
930
931 2006-08-18 Paul Eggert <eggert@cs.ucla.edu>
932 Bruno Haible <bruno@clisp.org>
933
934 * m4/bison-i18n.m4 (BISON_I18N): Also handle the case where yacc exists
935 and is a script that invokes bison. Tighten the code. Add comments.
936
922bdd7f
JD
9372007-08-28 Joel E. Denny <jdenny@ces.clemson.edu>
938
939 Spell "boolean" as "Boolean". Reported by Akim Demaille.
940 * data/bison.m4 (b4_percent_define_flag_if): Fix complaint.
941 * doc/bison.texinfo (Decl Summary): Fix.
942 * src/muscle_tab.c (muscle_percent_define_flag_if): Fix complaint.
943 * tests/input.at (Boolean %define variables): Update output.
944 * tests/skeletons.at (%define boolean variables: invalid skeleton
945 defaults): Rename to...
946 (%define Boolean variables: invalid skeleton defaults): ... this and
947 update output.
948
1b17b01d
JD
9492007-08-17 Joel E. Denny <jdenny@ces.clemson.edu>
950
951 In impure push mode, don't allow more than one yypstate to be allocated
952 since multiple impure parsers would corrupt yynerrs.
953 * data/push.c (yypstate_allocated): New static global variable
954 initialized to 0.
955 (yypull_parse): If yypstate_new returns 0, don't report it as memory
956 exhaustion if yypstate_allocated is 1, but still return 2.
957 (yypstate_new): Invoke yyerror and return 0 if yypstate_allocated is
958 already 1. Otherwise, set it to 1.
959 (yypstate_delete): Set it to 0.
960 * tests/push.at (Push Parsing: Multiple impure instances): New test
961 case.
962
9987d1b3
JD
9632007-08-17 Bob Rossi <bob@brasko.net>
964
965 * doc/bison.texinfo (Push Decl): Document the push parser.
966 (Table of Symbols): Ditto.
967 (Pure Decl): Ditto.
968 (Decl Summary): Ditto.
969 (Multiple Parsers, Push Parser Function, Pull Parser Function,
970 Parser Create Function, Parser Delete Function):
971 Add new push parser symbols.
972 (Table of Symbols): Document push-parser, push-pull-parser,
973 yypush_parse, yypull_parse, yypstate_new and yypstate_delete.
974
f16b0819
PE
9752007-08-15 Paul Eggert <eggert@cs.ucla.edu>
976
977 Update to GPLv3.
978 * doc/gpl-3.0.texi: New file.
979 * doc/gpl.texi: Remove.
980 * COPYING, GNUmakefile, HACKING, Makefile.am, Makefile.cfg:
981 * Makefile.maint, NEWS, PACKAGING, README, README-alpha:
982 * README-hacking, TODO, bootstrap, bootstrap.conf:
983 * configure.ac, data/Makefile.am, data/README, data/bison.m4:
984 * data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4:
985 * data/glr.c, data/glr.cc, data/java-skel.m4, data/java.m4:
986 * data/lalr1.cc, data/lalr1.java, data/location.cc:
987 * data/push.c, data/yacc.c, data/m4sugar/m4sugar.m4:
988 * djgpp/Makefile.maint, djgpp/README.in, djgpp/config.bat:
989 * djgpp/config.sed, djgpp/config.site, djgpp/config_h.sed:
990 * djgpp/djunpack.bat, djgpp/subpipe.c, djgpp/subpipe.h:
991 * djgpp/testsuite.sed, doc/Makefile.am, doc/bison.texinfo:
992 * doc/fdl.texi, doc/refcard.tex, etc/Makefile.am, etc/README:
993 * etc/bench.pl.in, examples/Makefile.am, examples/extexi:
994 * examples/calc++/Makefile.am, lib/Makefile.am, lib/abitset.c:
995 * lib/abitset.h, lib/bbitset.h, lib/bitset.c, lib/bitset.h:
996 * lib/bitset_stats.c, lib/bitset_stats.h, lib/bitsetv-print.c:
997 * lib/bitsetv-print.h, lib/bitsetv.c, lib/bitsetv.h:
998 * lib/ebitset.c, lib/ebitset.h, lib/get-errno.c:
999 * lib/get-errno.h, lib/lbitset.c, lib/lbitset.h:
1000 * lib/libiberty.h, lib/main.c, lib/subpipe.c, lib/subpipe.h:
1001 * lib/timevar.c, lib/timevar.def, lib/timevar.h:
1002 * lib/vbitset.c, lib/vbitset.h, lib/yyerror.c:
1003 * m4/c-working.m4, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4:
1004 * m4/timevar.m4, src/LR0.c, src/LR0.h, src/Makefile.am:
1005 * src/assoc.c, src/assoc.h, src/closure.c, src/closure.h:
1006 * src/complain.c, src/complain.h, src/conflicts.c:
1007 * src/conflicts.h, src/derives.c, src/derives.h, src/files.c:
1008 * src/files.h, src/flex-scanner.h, src/getargs.c:
1009 * src/getargs.h, src/gram.c, src/gram.h, src/graphviz.c:
1010 * src/lalr.c, src/lalr.h, src/location.c, src/location.h:
1011 * src/main.c, src/muscle_tab.c, src/muscle_tab.h:
1012 * src/nullable.c, src/nullable.h, src/output.c, src/output.h:
1013 * src/parse-gram.c, src/parse-gram.h, src/parse-gram.y:
1014 * src/print.c, src/print.h, src/print_graph.c:
1015 * src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c:
1016 * src/reduce.h, src/relation.c, src/relation.h:
1017 * src/revision.h, src/scan-code.h, src/scan-code.l:
1018 * src/scan-gram.h, src/scan-gram.l, src/scan-skel.h:
1019 * src/scan-skel.l, src/state.c, src/state.h, src/symlist.c:
1020 * src/symlist.h, src/symtab.c, src/symtab.h, src/system.h:
1021 * src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h:
1022 * tests/Makefile.am, tests/actions.at, tests/c++.at:
1023 * tests/calc.at, tests/conflicts.at, tests/cxx-type.at:
1024 * tests/existing.at, tests/glr-regression.at:
1025 * tests/headers.at, tests/input.at, tests/java.at:
1026 * tests/local.at, tests/output.at, tests/push.at:
1027 * tests/reduce.at, tests/regression.at, tests/sets.at:
1028 * tests/skeletons.at, tests/synclines.at, tests/testsuite.at:
1029 * tests/torture.at:
1030 Update to GPLv3.
1031
728c4be2
JD
10322007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1033
1034 Get rid of broken %no-parser, -n, and --no-parser implementation and
1035 documentation.
1036 * TODO: Don't mention them.
1037 * doc/bison.1: Likewise.
1038 * doc/bison.texinfo (Decl Summary): Likewise.
1039 (Bison Options): Likewise.
1040 (Option Cross Key): Likewise.
1041 * src/getargs.c (no_parser_flag): Remove global variable.
1042 (usage): Don't print description of -n and --no-parser.
1043 (long_options): Remove --no-parser entry here.
1044 (getargs): Remove -n case in the switch here.
1045 * src/getargs.h (no_parser_flag): Remove extern.
1046 * tests/regression.at (Web2c Actions): Remove comment that mentions
1047 --no-parser.
1048
5d31a216
JD
10492007-08-11 Joel E. Denny <jdenny@ces.clemson.edu>
1050
1051 * tests/push.at (Push Parsing: Memory Leak for Early Deletion): Do not
1052 name user variables starting with `yy'. Just pass NULL instead of a
1053 dummy local &yylval to yypush_parse.
1054 * tests/torture.at (AT_DATA_STACK_TORTURE): Do not name user variables
1055 starting with `yy'.
1056
a2ea208d
JD
10572007-08-03 Joel E. Denny <jdenny@ces.clemson.edu>
1058
1059 * data/yacc.c (yyexhaustedlab): Define it when YYERROR_VERBOSE is
1060 true since it's then always used regardless of whether yyoverflow is
1061 defined. Reported by Christian Burger at
1062 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00031.html>.
1063 * THANKS: Add Christian Burger.
1064
91661ebb
JD
1065 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1066 node names: say "Decl Summary" not "Bison Declaration Summary".
1067
cbd50549
JD
10682007-07-28 Joel E. Denny <jdenny@ces.clemson.edu>
1069
1070 * src/muscle_tab.c (muscle_percent_define_flag_if): In order to
1071 determine whether this function has already complained about an invalid
1072 value for a %define boolean variable, don't check whether Bison has
1073 ever examined the value. As written, the check was a tautology.
1074 Instead, record and check for this complaint using a separate muscle.
1075
eb1b0740
JD
10762007-07-27 Joel E. Denny <jdenny@ces.clemson.edu>
1077
1078 Fix push parsing memory leak reported by Brandon Lucia at
1079 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00032.html>.
1080 * THANKS: Add Brandon Lucia.
1081 * data/push.c (yypstate_delete): Free the stack if it was reallocated
1082 but the parse never completed and thus freed it.
1083 * tests/Makefile.am (TESTSUITE_AT): Add push.at.
1084 * tests/testsuite.at: Include push.at.
1085 * test/push.at: New.
1086 (Push Parsing: Memory Leak for Early Deletion): New test case.
1087
9d774aff
JD
10882007-07-17 Joel E. Denny <jdenny@ces.clemson.edu>
1089
1090 Improve handling of multiple S/R conflicts in the same state and of S/R
1091 conflicts involving multiple reductions.
1092 * src/conflicts.c (resolve_sr_conflict): Don't assign the error action
1093 set for a state here or Bison will abort if it is reassigned on a
1094 later conflicted reduction in the same state.
1095 Similarly, don't finalize and assign the solved conflicts report here
1096 or it will be lost if it is reassigned on a later conflicted reduction
1097 in the same state.
1098 (set_conflicts): Instead, assign them both here after all S/R conflicts
1099 in the state have been fully examined.
1100 * src/print.c (shift_set): Rename to...
1101 (no_reduce_set): ... this.
1102 (print_reductions): Update for rename, and add %nonassoc error action
1103 tokens to no_reduce_set so that, when printing the first remaining
1104 reduction on an error action token, the reduction is enclosed in
1105 brackets.
1106 (print_results): Update for rename.
1107 * tests/conflicts.at (Solved conflicts report for multiple reductions
1108 in a state): New test case.
1109 (%nonassoc error actions for multiple reductions in a state): New test
1110 case.
1111
1112 * src/main.c (main): Don't depend on C99 features.
1113
10159d2a
JD
11142007-07-16 Joel E. Denny <jdenny@ces.clemson.edu>
1115
1116 * build-aux/.cvsignore: Add compile.
b541ffdf
JD
1117 * lib/.cvsignore: Add charset.alias, ref-add.sed, ref-del.sed, and
1118 uniwidth.
10159d2a 1119
953b3935
JD
11202007-07-10 Joel E. Denny <jdenny@ces.clemson.edu>
1121
1122 * bootstrap (slurp): Create target directories that don't exist.
1123 Specifically, we need lib/uniwidth/ because of recent Gnulib changes.
1124
6ce2d93a
JD
11252007-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
1126
1127 * LR0.c (new_itemsets): Fix wording in comments: say item index rather
1128 than item number.
1129 * closure.c (closure): Likewise.
1130 * state.h (reductions): Comment sorting of rules.
1131 (state): Comment sorting of items.
1132
ce3448d5
JD
11332007-07-02 Joel E. Denny <jdenny@ces.clemson.edu>
1134
1135 Fix C++ test cases after recent Gnulib changes. Discussed starting at
1136 <http://lists.gnu.org/archive/html/bug-bison/2007-07/msg00000.html>.
1137 * examples/calc++/Makefile.am (DEFAULT_INCLUDES): Override Automake's
1138 definition in order to avoid Gnulib headers since we don't use config.h
1139 here.
1140 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): Use AT_DATA_GRAMMAR
1141 rather than AT_DATA so that config.h is included.
1142
8a86eef0
JD
11432007-07-01 Joel E. Denny <jdenny@ces.clemson.edu>
1144
1145 * data/glr.c (yy_yypstack, yypstates, yypdumpstack): Use YYFPRINTF
1146 instead of fprintf. Guard these functions with #if YYDEBUG instead of
1147 #ifdef YYDEBUG for consistency with all other uses of YYDEBUG in Bison
1148 and so that YYFPRINTF is guaranteed to be defined here.
1149
b1a81613
JD
11502007-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
1151
1152 * src/muscle_tab.c (muscle_percent_define_invalid_value): Replace
1153 with...
1154 (muscle_percent_define_check_values): ... this more helpful function.
1155 Again, it's not used yet, but it will be.
1156 * src/muscle_tab.h: Likewise.
1157
71b61d4d
JD
1158 Improve some comments in parser table construction.
1159 * src/LR0.c (new_itemsets): Explain sorting of itemset and kernel_base.
1160 (generate_states): Don't mention ruleset, which is internal to closure.
1161 * src/closure.c (closure): Explain sorting of core and itemset, which
1162 is required for this function to behave correctly.
1163 * src/closure.h (closure): Mention sorting.
1164
2a6b783d
JD
11652007-05-28 Joel E. Denny <jdenny@ces.clemson.edu>
1166
1167 * src/lalr.c (state_lookahead_tokens_count): For code readability,
1168 move the check for disabled transitions to an aver since conflict
1169 resolution hasn't happened yet.
1170
1171 * src/lalr.c (state_lookahead_tokens_count): Remove the check that
1172 labels a state as inconsistent just because it has error transitions.
1173 The original form of this check appeared in revision 1.1 of lalr.c,
1174 which was committed on 1991-12-21. Now (at least), changing the
1175 consistency label on such a state appears to have no useful effect in
1176 any of the places it is examined, which I enumerate below. The key
1177 point to understanding each item in this enumeration is that a state
1178 with an error transition is labelled consistent in the first place only
1179 if it has no rules, so the check cannot matter for states that have
1180 rules. (1) Labelling a state as inconsistent will cause set_conflicts
1181 to try to identify its conflicts, and a state must have *rules* to have
1182 conflicts. (2) Labelling a state as inconsistent will affect how
1183 action_row sets the default *rule* for the state. (3) Labelling a
1184 state as inconsistent will cause build_relations to add lookback edges
1185 to *rules* in that state.
1186 * src/state.h (struct state): Word the comment for member consistent
1187 more carefully.
1188
14462c2b
JD
11892007-05-27 Joel E. Denny <jdenny@ces.clemson.edu>
1190
1191 Don't depend on C99 features.
1192 * src/conflicts.c (conflicts_update_state_numbers): Fix for-loop.
1193 * src/lalr.c (lalr_update_state_numbers): Fix for-loop.
1194 * src/reader.c (check_and_convert_grammar): Fix for-loop.
1195 * src/state.c (state_mark_reachable_states): Fix for-loop.
1196 (state_remove_unreachable_states): Fix for-loop.
1197
1198 Don't widen struct state with member reachable just to temporarily
1199 record reachability. Instead, use a local bitset.
1200 * src/state.h (struct state): Remove member.
1201 * src/state.c (state_new): Don't initialize it.
1202 (state_mark_reachable_states): Rename to...
1203 (state_record_reachable_states): ... this, and use bitset.
1204 (state_remove_unreachable_states): Use bitset.
1205
5a43d418
JD
12062007-05-26 Joel E. Denny <jdenny@ces.clemson.edu>
1207
1208 * src/Makefile.am (yacc): Quote target action commands properly so
1209 that the yacc script isn't corrupt. Reported by Hans Aberg at
1210 <http://lists.gnu.org/archive/html/bug-bison/2007-05/msg00003.html>.
1211
0c650a20
JD
1212 * data/glr.c (yylval): As in yacc.c, don't extern in the header for
1213 the case of pure parsers. Reported by Frans Englich at
1214 <http://lists.gnu.org/archive/html/help-bison/2007-05/msg00018.html>.
1215 * THANKS: Add Frans Englich.
1216
61fee93e
JD
1217 * NEWS (2.3a+): In the %code entry, reference section `Bison
1218 Declaration Summary' from the manual now since the %code summary has
1219 moved there.
1220 * doc/bison.texinfo (Prologue Alternatives): Mention that directives
1221 in the rules section must be terminated by semicolons.
1222
f124d423
JD
12232007-05-20 Joel E. Denny <jdenny@ces.clemson.edu>
1224
1225 Extend the front-end API for %define variables to more completely
1226 mirror the back-end. This will be useful in the future.
1227 * data/bison.m4 (b4_percent_define_get, b4_percent_define_ifdef):
1228 Update comments to mention the new front-end counterparts of these
1229 macros.
1230 * src/muscle_tab.c (MUSCLE_COMMON_DECODE): New macro with common code
1231 for muscle_string_decode and muscle_location_decode.
1232 (muscle_string_decode): New static function.
1233 (muscle_location_decode): Use MUSCLE_COMMON_DECODE.
1234 (muscle_percent_define_get, muscle_percent_define_ifdef): New
1235 functions.
1236 (muscle_percent_define_flag_if): Use muscle_percent_define_ifdef and
1237 muscle_percent_define_get to mimic the b4_percent_define_flag_if
1238 implementation more closely.
1239 (muscle_percent_define_invalid_value): New function.
1240 * src/muscle_tab.h (muscle_percent_define_get,
1241 muscle_percent_define_ifdef, muscle_percent_define_invalid_value):
1242 Prototype.
1243
75ad86ee
JD
12442007-05-07 Joel E. Denny <jdenny@ces.clemson.edu>
1245
1246 * NEWS (2.3a+): Mention yesterday's state-removal change.
1247 (2.3a): Remove the %language entry, which was added after 2.3a.
1248 * src/LR0.c, src/closure.c, src/closure.h, src/conflicts.c,
1249 src/conflicts.h, src/lalr.c, src/lalr.h, src/print.c,
1250 src/print_graph.c, src/state.c, src/state.h, tests/conflicts.at,
1251 tests/existing.at: Update copyright date.
1252
5967f0cf
JD
12532007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1254
1255 If conflict resolution makes states unreachable, remove those states,
1256 report rules that are then unused, and don't report conflicts in those
1257 states.
1258 * src/conflicts.c, src/conflicts.h (conflicts_update_state_numbers):
1259 New global function.
1260 * src/lalr.c, src/lalr.h (lalr_update_state_numbers): New global
1261 function.
1262 * src/main.c (main): After conflict resolution, remove the unreachable
1263 states and update all data structures that reference states by number.
1264 * src/state.c (state_new): Initialize each state's reachable member to
1265 false.
1266 (state_mark_reachable_states): New static function.
1267 (state_remove_unreachable_states): New global function.
1268 * src/state.h (struct state): Add member bool reachable.
1269 (state_remove_unreachable_states): Prototype.
1270 * tests/conflicts.at (Unreachable States After Conflict Resolution):
1271 New test case.
1272 * tests/existing.at (GNU pic Grammar): Update test case output now that
1273 an unused rule is discovered.
1274
b09f4f48
JD
12752007-05-06 Joel E. Denny <jdenny@ces.clemson.edu>
1276
1277 Minor code cleanup in parser table construction.
1278 * src/LR0.c (new_itemsets): Use item_number_is_symbol_number.
1279 (new_itemsets, save_reductions): Update for rename to nitemset.
1280 * src/closure.c (nritemset): Rename to...
1281 (nitemset): ... this since the "r" appears to meaningless and isn't
1282 used in the comments.
1283 (closure): Update for rename.
1284 * src/closure.h (nritemset): Update extern to...
1285 (nitemset): ... this.
1286 * src/lalr.c (LA): Fix a typo in comments.
1287 * src/print.c (print_core): Update for rename to nitemset.
1288 * src/print_graph.c (print_graph): Likewise.
1289 * src/state.h: Fix some typos in header comments.
1290
bbb44d83
PE
12912007-04-04 Paul Eggert <eggert@cs.ucla.edu>
1292
9b33de72
PE
1293 * THANKS: Use ASCII for Sebastien Fricker's name. Bison source
1294 still sticks to ASCII. Sorry!
1295
bbb44d83
PE
1296 * README-hacking: New file, taken mostly from coreutils, with changes
1297 for Bison. Contains much of the contents of:
1298 * README-cvs: Remove.
1299 * bootstrap: Sync from gnulib.
1300 * build-aux/.cvsignore: Remove *.t, mkinstalldirs.
1301 * lib/.cvsignore: Add wchar.h, wctype.h. Remove exit.h.
1302
29553547
JD
13032007-03-10 Joel E. Denny <jdenny@ces.clemson.edu>
1304
1305 * doc/bison.texinfo (Destructor Decl): Fix typo reported by Sebastian
1306 Setzer.
1307 (Java Differences): Fix some typos.
1308 * THANKS: Add Sebastian Setzer.
1309
01b477c6
PB
13102007-03-07 Paolo Bonzini <bonzini@gnu.org>
1311
730739e4
AD
1312 * data/java.m4 (b4_single_class_if): Remove.
1313 (b4_abstract_if): Look at "%define abstract".
1314 (b4_lexer_if): New.
1315 (b4_union_name): Rename...
1316 (b4_yystype): ... to this. Map to "%define stype".
1317 (b4_rhs_value, b4_parse_param_decl, b4_lex_param_decl,
1318 b4_maybe_throws): Fix quoting.
1319 (b4_lex_param_call): Move below to keep b4_*_param_decl close.
1320 * data/lalr1.java (Lexer interface): Always define.
1321 (Lexer interface within parser class): Remove.
1322 (YYLexer class): New, used when "%code lexer" is present.
1323 (constructor): When "%code lexer" is used, pass %lex-param
1324 to the lexer constructor.
1325 (yylex, yyparse): Remove %lex-param from method invocations
1326 (YYStack, yyaction, yyparse): Rename b4_union_name to b4_yystype.
1327
1328 * doc/bison.texinfo (Java Bison Interface): Mention "%define
1329 abstract". Rename "%define union_name" to "%define stype".
1330 Rename method names according to previous patch.
1331 (Java Scanner Interface): Describe "%code lexer" instead of
1332 "%pure-parser" and "%define single_class".
1333 (Java Differences): Mention "%code lexer".
1334
1335 * tests/java.at (_AT_DATA_JAVA_CALC_Y): Remove final argument.
1336 Include scanner here, using macros from tests/local.at.
1337 (AT_DATA_CALC_Y): Remove final argument.
1338 (_AT_CHECK_JAVA_CALC): Likewise.
1339 (AT_CHECK_JAVA_CALC): Likewise. Test all four combinations
1340 of %locations and %error-verbose.
1341 (main): Test with and without %lex-param.
1342 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Push AT_LEXPARAM_IF.
1343 (AT_BISON_OPTION_POPDEFS): Pop it.
01b477c6 1344
122bea3a
JMG
13452007-03-07 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1346
1347 DJGPP spefic issue. Inhibit the use of disallowed characters for
1348 file name genertion on Win98, WinXP, etc. These are |<>":?*\
1349 and concern testsuite case 46.
1350 * Makefile.am: djgpp/testsuite.sed added to EXTRA_DIST
1351 * djgpp/testsuite.sed: Inhibit the use of disallowed characters.
1352 * djgpp/config.bat: Inhibit the use of disallowed characters.
1353
9611cfa2
JD
13542007-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
1355
1356 Miscellaneous %define and %code cleanup.
1357 * data/bison.m4 (b4_percent_define_flag_if): Correct comments on how
1358 values are interpreted.
1359 * doc/bison.texinfo (Decl Summary): Clean up and extend %define
1360 documentation a little more.
1361 * src/muscle_tab.c (MUSCLE_USER_NAME_CONVERT,
1362 muscle_percent_define_insert, muscle_percent_code_grow): New
1363 functions/macros.
1364 * src/muscle_tab.h (muscle_percent_define_insert,
1365 muscle_percent_code_grow): Prototype.
1366 * src/parse-gram.y (prologue_declaration): Use
1367 muscle_percent_define_insert and muscle_percent_code_grow when parsing
1368 %define and %code directives.
1369
1370 Make it easy to share %define boolean variables between the front-end
1371 and back-end. Though not used yet, this will be useful in the future.
1372 * data/bison.m4 (b4_check_user_names): Rewrite comments to talk about
1373 Bison uses of names rather than just skeleton uses of names.
1374 (b4_percent_define_get, b4_percent_define_ifdef): Rename
1375 b4_percent_define_skeleton_variables(VARIABLE) to
1376 b4_percent_define_bison_variables(VARIABLE).
1377 (b4_percent_code_get, b4_percent_code_ifdef): Rename
1378 b4_percent_code_skeleton_qualifiers(QUALIFIER) to
1379 b4_percent_code_bison_qualifiers(QUALIFIER).
1380 (b4_check_user_names_wrap): Update for renames.
1381 * src/muscle_tab.c, src/muscle_tab.h (muscle_percent_define_flag_if,
1382 muscle_percent_define_default): New functions mimicking
1383 b4_percent_define_flag_if and b4_percent_define_default.
1384
1385 For %define variables, report locations for invalid values and
bbb44d83 1386 redefinitions.
9611cfa2
JD
1387 * data/bison.m4 (b4_percent_define_flag_if): Read
1388 b4_percent_define_loc(VARIABLE) to report the location of an invalid
1389 value for VARIABLE.
1390 (b4_percent_define_default): Save a special location in
1391 b4_percent_define_loc(VARIABLE) in case the default value for VARIABLE
1392 must later be reported as invalid.
1393 * src/muscle_tab.c (muscle_location_grow, muscle_location_decode): New
1394 functions.
1395 (muscle_percent_define_insert): Record the location of VARIABLE in
1396 muscle percent_define_loc(VARIABLE), and use it to report the previous
1397 location for a redefinition.
1398 (muscle_percent_define_flag_if): Update like b4_percent_define_flag_if.
1399 (muscle_percent_define_default): Update like b4_percent_define_default.
1400 (muscle_grow_user_name_list): Rename to...
1401 (muscle_user_name_list_grow): ... this for consistency and use
1402 muscle_location_grow.
1403 * src/muscle_tab.h (muscle_location_grow): Prototype.
1404 * tests/input.at (%define errors): Update expected output.
1405 * tests/skeletons.at (%define boolean variables: invalid skeleton
1406 defaults): New test case.
1407
0bf92491
JD
14082007-02-28 Joel E. Denny <jdenny@ces.clemson.edu>
1409
1410 * src/print.c (lookahead_set, state_default_rule): Remove.
1411 (print_reductions): Replace state_default_rule invocation with
1412 equivalent use of yydefact, which was computed in token_actions in
1413 tables.c.
1414 (print_results): Don't allocate lookahead_set.
1415
d3b12988
PB
14162007-02-27 Paolo Bonzini <bonzini@gnu.org>
1417
1418 * data/lalr1.java: Prefix all private members with yy.
1419
f57a7536
JD
14202007-02-24 Joel E. Denny <jdenny@ces.clemson.edu>
1421
1422 Use YYFPRINTF instead of fprintf where appropriate. Reported by
9b33de72 1423 Sebastien Fricker at
f57a7536 1424 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00035.html>.
9b33de72 1425 * THANKS: Add Sebastien Fricker.
f57a7536
JD
1426 * data/glr.c, data/push.c, data/yacc.c (yy_reduce_print): Implement.
1427 * doc/bison.texinfo (Tracing): Make it clearer that YYFPRINTF must
1428 accept a variable number of arguments.
1429
6404a5bf
JD
14302007-02-19 Joel E. Denny <jdenny@ces.clemson.edu>
1431
1432 * bootstrap: Remove occurrences of .#bootmp from lib/Makefile.
1433
e4e09639
JMG
14342007-02-13 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1435
1436 * djgpp/config.bat: Adjustments concerning the use of autoconf 2.61.
1437 * djgpp/config.sed: Adjustments concerning the use of autoconf 2.61.
1438 * djgpp/config.site: Adjustments concerning the use of autoconf 2.61.
1439
d7e0a1a7
PE
14402007-02-11 Paul Eggert <eggert@cs.ucla.edu>
1441
1442 Undo my 2007-02-07 change, switching back to the c-strcase module
1443 introduced in the 2007-02-03 change. Bruno Haible reported that
1444 the 2007-02-07 change would be dangerous in Turkish if we add a
1445 language whose name contains "i", since "i" is not lowercase "I"
1446 in Turkish.
1447 * bootstrap.conf (gnulib_modules): Add c-strcase. Remove strcase.
1448 * lib/.cvsignore: Add c-ctype.c, c-ctype.h, c-strcase.h,
1449 c-strcasecomp.c, c-strncasecmp.c. Remove strcasecmp.c, strncasecmp.c.
1450 * m4/.cvsignore: Remove strcase.m4.
1451 * src/getargs.c: Revert 2007-02-07 change, as follows.
1452 Include c-strcase.h.
1453 (language_argmatch): Use c_strcasecmp rather than strcasecmp.
1454
deee93a1
JD
14552007-02-11 Bruno Haible <bruno@clisp.org>
1456
1457 Enable the Java related testsuite tests when the only Java compiler
1458 found is a gcj < 4.3. Discussed at
1459 <http://lists.gnu.org/archive/html/bug-bison/2007-02/msg00016.html>.
1460 * configure.ac (gt_JAVACOMP): Don't specify a target_version.
1461
574add85
JD
14622007-02-11 Joel E. Denny <jdenny@ces.clemson.edu>
1463
1464 * data/Makefile.am: Update copyright date.
1465 * data/push.c (yypull_parse): Report memory exhaustion and return 2 if
1466 yypstate_new returns NULL.
1467 (yypstate_new): Return NULL if malloc does.
1468 * src/reader.c (packgram): Move translation of rule actions from the
1469 beginning of packgram to...
1470 (check_and_convert_grammar): ... here right before packgram is invoked
1471 so it's easier to write more complete comments, and remove redundant
1472 code.
1473
e785ccf7
JD
14742007-02-10 Joel E. Denny <jdenny@ces.clemson.edu>
1475
1476 As in semantic actions, make @$ in %initial-action, %destructor, and
1477 %printer imply %locations.
1478 * src/scan-code.l (SC_SYMBOL_ACTION): Set locations_flag = true when
1479 scanning @$.
1480 * tests/actions.at (AT_CHECK_ACTION_LOCATIONS): New macro supporting...
1481 (@$ in %initial-action implies %locations,
1482 @$ in %destructor implies %locations,
1483 @$ in %printer implies %locations): ... these new test cases.
1484
1cfe1ed7
PE
14852007-02-07 Paul Eggert <eggert@cs.ucla.edu>
1486
1487 Undo most of the 2007-02-03 change, switching to the strcase module
1488 now that gnulib strcase has been fixed.
1489 * bootstrap.conf (gnulib_modules): Remove c-strcase. Add strcase.
1490 * lib/.cvsignore: Remove c-ctype.c, c-ctype.h, c-strcase.h,
1491 c-strcasecomp.c, c-strncasecmp.c. Add strcasecmp.c, strncasecmp.c
1492 * m4/.cvsignore: Add strcase.m4.
1493 * src/getargs.c: Revert 2007-02-03 change, as follows.
1494 Don't include c-strcase.h.
1495 (language_argmatch): Use strcasecmp rather than c_strcasecmp.
1496 strcasecmp has "unspecified behavior" outside the POSIX locale,
1497 but it works fine in practice if at least one argument is ASCII,
1498 as is the case in Bison.
1499
0049ec86
PB
15002007-02-07 Paolo Bonzini <bonzini@gnu.org>
1501
1502 * tests/java.at: Skip tests if only one of javac/java is present.
1503 Reported by Joel E. Denny.
1504 * tests/atlocal.in: Adjust copyright years.
1505
15062007-02-05 Paolo Bonzini <bonzini@gnu.org>
1507
1508 * data/lalr1.java (Stack): Work around old verifiers that disallow
1509 access to the private fields of an inner class, from the outer class.
1510 We can make Stack's fields public because user code doesn't have access
1511 to the instance of Stack used by parse(). Reported by Paul Eggert.
1512
2c2b7220
PE
15132007-02-03 Paul Eggert <eggert@cs.ucla.edu>
1514
1515 * .cvsignore: Add javacomp.sh, javaexec.sh. Is this really
1516 the right spot for these files?
1517 * bootstrap.conf (gnulib_modules): Add c-strcase.
1518 * lib/.cvsignore: Add c-ctype.c c-ctype.h, c-strcasecomp.c,
1519 c-strncasecmp.c.
1520 * src/getargs.c: Include c-strcase.h.
1521 (language_argmatch): Use c_strcasecmp rather than strcasecmp,
1522 to avoid unspecified behavior.
1523
b2b81dae
JD
15242007-02-01 Joel E. Denny <jdenny@ces.clemson.edu>
1525
1526 * doc/bison.texinfo (Decl Summary): Correct typo.
1527
c1d19e10
PB
15282007-01-30 Paolo Bonzini <bonzini@gnu.org>
1529
1530 * data/bison.m4 (b4_percent_define_flag_if): Don't treat 0 as false.
1531 Complain if the value does not match empty, "true" or "false".
1532 * data/c++.m4: Adjust default definitions of %define variables.
1533 * data/java.m4: Adjust default definitions of %define variables.
1534 * doc/bison.texinfo (Decl Summary): Adjust the %define entry according
1535 to above behavior.
1536 * tests/input.at (Boolean %define variables): Test new behavior.
1537
8405b70c
PB
15382007-01-29 Paolo Bonzini <bonzini@gnu.org>
1539
1540 * NEWS: Mention java.
1541 * TODO: Remove things that are done.
1542 * bootstrap.conf: Add javacomp-script and javaexec-script.
1543 * configure.ac: Invoke gt_JAVACOMP and gt_JAVAEXEC.
1544
1545 * data/Makefile.am: Add new files.
1546 * data/java-skel.m4: New.
1547 * data/java.m4: New.
1548 * data/lalr1.java: New.
1549
1550 * doc/bison.texinfo: Put "A Complete C++ Example" under
1551 C++ Parsers. Add Java Parsers. Put C++ Parsers and Java Parsers
1552 under Other Languages.
1553
1554 * src/getargs.c (valid_languages): Add Java.
1555 * src/getargs.h (struct bison_language): Update size of string fields.
1556
1557 * tests/Makefile.am: Add java.at.
1558 * tests/atlocal.in: Add CONF_JAVA and CONF_JAVAC.
1559 * tests/java.at: New.
1560 * tests/testsuite.at: Include it.
1561
3eb82471
JD
15622007-01-28 Joel E. Denny <jdenny@ces.clemson.edu>
1563
1564 Clean up.
1565 * src/scan-skel.l (at_directive_perform): Add at_directive_argc and
1566 at_directive_argv arguments so these no longer have to be global
1567 variables. Also, update the implementation for the following changes.
1568 (fail_for_at_directive_too_many_args,
1569 fail_for_at_directive_too_few_args): Add at_directive_name argument.
1570 (at_directive_name): Remove as at_directive_argv[0] will be used for
1571 this now.
1572 (AT_DIRECTIVE_ARGC_MAX): Increment to make space in at_directive_argv
1573 for the directive name.
1574 (at_directive_argc, at_directive_argv): Make these local within
1575 skel_lex instead of global.
1576 (INITIAL): Update directive start action for above changes.
1577 (SC_AT_DIRECTIVE_ARG): Rename to...
1578 (SC_AT_DIRECTIVE_ARGS): ... this, and update for above changes.
1579 (SC_AT_DIRECTIVE_SKIP_WS): Update.
1580 (scan_skel): Move yylex_destroy to...
1581 (skel_scanner_free): ... here.
1582 * tests/skeletons.at (installed skeleton file name): Rename to...
1583 (installed skeleton file names): ... this.
1584
148d66d8
JD
15852007-01-27 Joel E. Denny <jdenny@ces.clemson.edu>
1586
1587 * ChangeLog: For changes in doc/bison.texinfo, consistently reference
1588 node names: say "Table of Symbols" not "Bison Symbols", and say "Decl
1589 Summary" not "Directives".
1590 * doc/bison.texinfo (Decl Summary, Calc++ Parser): Cross-reference the
1591 %code entry in "Decl Summary" rather than the one in "Table of Symbols"
1592 since the former is now the more complete one.
1593 (Prologue Alternatives): Likewise and do the same for %defines.
1594 (Table of Symbols): Add summary of %code, add summary of %define, and
1595 move full %code documentation to...
1596 (Decl Summary): ... here for consistency with other entries in these
1597 sections.
1598 Move %define entry in order to keep this list alphabetized.
1599 Reword %define entry a little to put less emphasis on the skeleton
1600 concept, which most users shouldn't have to think about.
1601
665f0c24
PE
16022007-01-26 Paul Eggert <eggert@cs.ucla.edu>
1603
1604 Adjust to recent gnulib changes.
1605 * lib/.cvsignore: Remove stpcpy.h, strndup.h, strnlen.h.
1606 Add string.h, string_.h, unistd_.h, wchar_.h.
1607 * m4/.cvsignore: Add gnulib-common.m4, string_h.m4, wchar.m4.
1608 * src/system.h: Don't include <stpcpy.h>; this is now done by
1609 <string.h>.
1610
592d0b1e
PB
16112007-01-23 Paolo Bonzini <bonzini@gnu.org>
1612
1613 Simplify implementation of unqualified %code, implement macros for
1614 uniform treatment of boolean %define flags. Document %define.
1615 * data/bison.m4 (b4_percent_define_ifdef, b4_percent_define_flag_if,
1616 b4_percent_code_ifdef): New.
1617 (b4_percent_code_get): Map unqualified %code to b4_percent_code().
1618 * data/c++.m4: Define default value for global_tokens_and_yystype.
1619 * data/glr.cc: Likewise.
1620 * data/location.cc: Use b4_percent_define_flag_if.
1621
148d66d8 1622 * doc/bison.texinfo (Decl Summary): Document %define.
592d0b1e
PB
1623
1624 * src/parse-gram.y (Unqualified %code): Change muscle name to
1625 b4_percent_code().
1626 (content.opt): Default to empty.
1627
a7867f53
JD
16282007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1629
1630 Implement support for relative and absolute skeleton file names.
1631 Discussed starting at
1632 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00071.html>.
1633 * doc/bison.texinfo (Decl Summary): Document in %skeleton entry.
1634 (Bison Options): Document in --skeleton entry.
1635 * src/output.c (output_skeleton): Use strncpy rather than strcpy since
1636 full_skeleton can't necessarily hold all of pkgdatadir.
1637 If the specified skeleton file name contains a `/', don't prepend
1638 pkgdatadir.
1639 * src/parse-gram.y (prologue_declaration): If the specified skeleton
1640 file name contains a `/', prepend the grammar file directory.
1641 * tests/Makefile.am (TESTSUITE_AT): Add skeletons.at.
1642 * skeletons.at: New file.
1643 (relative skeleton file names): New test case.
1644 (installed skeleton file names): New test case.
1645 * tests/testsuite.at: Include skeletons.at.
1646
1647 * bootstrap: Update copyright to 2007.
1648
830c9b18
PB
16492007-01-17 Paolo Bonzini <bonzini@gnu.org>
1650
1651 * bootstrap: Remove occurrences of .#bootmp from the files.
1652
a8c2e813
AD
16532007-01-17 Akim Demaille <akim@epita.fr>
1654
1655 * doc/bison.texinfo (Calc++ Parser): Don't try to alias
1656 nonterminals.
1657 Use per-type %printer.
1658
279cabb6
JD
16592007-01-17 Joel E. Denny <jdenny@ces.clemson.edu>
1660
1661 * NEWS, data/c++-skel.m4, data/c++.m4, data/c-skel.m4, data/c.m4,
1662 data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1663 djgpp/config.site, src/files.c, src/files.h, src/main.c,
1664 src/muscle_tab.c, src/muscle_tab.h, src/parse-gram.y, src/reader.h,
1665 src/scan-skel.h, src/scan-skel.l, tests/actions.at, tests/calc.at,
1666 tests/glr-regression.at, tests/input.at, tests/local.at,
1667 tests/output.at, tests/torture.at: Update copyright to 2007.
1668
bb32f4f2
AD
16692007-01-16 Akim Demaille <akim@epita.fr>
1670
1671 * doc/bison.texinfo (Calc++ Parsing Driver): Let "parse" return an
1672 error code.
1673 (Calc++ Scanner): Exit with failure if we can't open the input
1674 file.
1675 Accept "-" standing for stdin.
1676 (Calc++ Top Level): Print the result only if the parsing was
1677 successful.
1678
7cff04b5
AD
16792007-01-16 Akim Demaille <akim@epita.fr>
1680
1681 * data/lalr1.cc (yy_reduce_print_): Add a missing end-of-line.
1682
a4e25e1d
JD
16832007-01-15 Paolo Bonzini <bonzini@gnu.org>
1684 and Joel E. Denny <jdenny@ces.clemson.edu>
1685
1686 Clean up %define and %code implementation in M4 some. Most
1687 importantly, rename all related macros to be in the b4_percent_define
1688 and b4_percent_code namespaces. Also, complete support for `.' in
1689 %define variable names and %code qualifiers.
1690 * data/bison.m4 (b4_check_user_names): Check for special
1691 "SKELETON-NAMESPACE(name)" macros instead of using two nested
1692 m4_foreach loops.
1693 (b4_get_percent_define, b4_get_percent_code): Rename to...
1694 (b4_percent_define_get, b4_percent_code_get): ... these.
1695 Extend documentation with examples.
1696 For SKELETON-NAMESPACE (as documented for b4_check_user_names), use
1697 b4_percent_define_skeleton_variables and
1698 b4_percent_code_skeleton_qualifiers.
1699 Expect any value for the %define variable `foo' to be stored in the
1700 macro named `b4_percent_define(foo)'; expect any %code blocks for the
1701 qualifier `foo' to be stored in a macro named `b4_percent_code(foo)';
1702 expect any unqualified %code blocks to be stored in a macro named
1703 `b4_percent_code_unqualified'.
1704 Use m4_indir so that %define variable names and %code qualifiers can
1705 contain `.', which is allowed by the grammar parser.
1706 (b4_percent_define_default): New macro to set a default value for a
1707 %define variable.
1708 (m4_wrap): Update wrapped code, and fix some underquoting.
1709 (b4_check_user_names_wrap): Update and define outside the m4_wrap.
1710 Expect grammar uses of %define variables and %code qualifiers to be
1711 defined in b4_percent_define_user_variables and
1712 b4_percent_code_user_qualifiers.
1713 * data/c++.m4: Use b4_percent_define_default rather than
1714 m4_define_default. Fix some underquoting. Skeleton usage of %define
1715 variable define_location_comparison now implies skeleton usage of
1716 %define variable filename_type.
1717 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1718 data/push.c, data/yacc.c: Update macro names.
1719 * src/parse-gram.y (prologue_declaration, grammar_declaration): Update
1720 muscle names.
1721
e37c665c
JMG
17222007-01-14 Juan Manuel Guerrero <juan.guerrero@gmx.de>
1723
1724 DJGPP specific issues.
1725
1726 * djgpp/config.site: Set ac_cv_path_mkdir to a sane DJGPP specific
1727 default. Set gl_cv_absolute_wctype_h to a sane DJGPP specific default.
1728
7d2d521f
JD
17292007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1730
1731 * tests/glr-regression.at: Use AT_PARSER_CHECK rather than AT_CHECK to
1732 run parsers in all tests so that Valgrind is invoked during
1733 maintainer-check-valgrind.
1734 (Duplicate representation of merged trees): Free all semantic values.
1735 (Duplicated user destructor for lookahead): Likewise.
1736
e0ac9b4b
JD
17372007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1738
1739 * tests/local.at (AT_PARSER_CHECK): Add a PRE argument to specify a
1740 command-line prefix.
1741 * tests/torture.at (Exploding the Stack Size with Alloca): Stderr is
1742 ignored, so use that PRE to set --log-fd=1 in VALGRIND_OPTS so we don't
1743 miss Valgrind messages.
1744 (Exploding the Stack Size with Malloc): Likewise.
1745
78143faa
JD
17462007-01-09 Joel E. Denny <jdenny@ces.clemson.edu>
1747
1748 Ignore YYSTACK_USE_ALLOCA for push parsers since the stacks can't be
1749 locals. Reported by Juan Manuel Guerrero at
1750 <http://lists.gnu.org/archive/html/bug-bison/2007-01/msg00000.html>.
1751 * data/push.c: Enclose the #ifdef YYSTACK_USE_ALLOCA in b4_push_if.
1752 Fix some indentation also.
1753 * tests/torture.at (Exploding the Stack Size with Alloca): Add comment
1754 explaining this issue.
1755
7ecec4dd
JD
17562007-01-09 Paolo Bonzini <bonzini@gnu.org>
1757 and Joel E. Denny <jdenny@ces.clemson.edu>
1758
1759 Simplify union and prologue handling, and escape union and lex/parse
1760 params with digraphs.
1761 * data/bison.m4 (b4_pre_prologue, b4_post_prologue): Set their default
1762 values to the empty string since these are no longer guaranteed
1763 initialized by the front-end.
1764 * data/glr.c, data/glr.cc, data/lalr1.cc, data/push.c, data/yacc.c: Add
1765 braces around b4_user_stype since this is no longer done by the
1766 front-end.
1767 * src/files.c, src/files.h (pre_prologue_obstack,
1768 post_prologue_obstack): Remove.
1769 * src/muscle_tab.c (muscle_pair_list_grow): Don't duplicate header
1770 comments here. Use MUSCLE_OBSTACK_SGROW so that values are escaped
1771 with digraphs. This fixes lex params and parse params.
1772 * src/muscle_tab.h (muscle_pair_list_grow): Update comments.
1773 * src/output.c (prepare): Remove muscle insertion of the prologues.
1774 (output): Remove freeing of pre_prologue_obstack and
1775 post_prologue_obstack.
1776 * src/parse-gram.y (prologue_declaration): Use muscle_code_grow rather
1777 than prologue_augment for prologue parsing so you don't need prologue
1778 obstacks.
5c80250c
JD
1779 (grammar_declaration): For %union RHS, use `braceless' instead of
1780 "{...}" so that braces are already stripped and code is escaped with
1781 digraphs.
7ecec4dd
JD
1782 * src/reader.c (prologue_augment): Remove.
1783 (reader): Remove initialization of pre_prologue_obstack and
1784 post_prologue_obstack.
1785 * src/reader.h (prologue_augment): Remove.
1786
1787 * data/c.m4: Remove stray parenthesis.
1788
16dc6a9e
JD
17892007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1790
1791 Remove quotes from variables names in %define directives and from
1792 qualifiers in %code directives, and restrict the characters that are
1793 allowed in them to M4-friendly ones. For %define, continue to support
1794 the quoted form as a deprecated feature. Discussed starting at
1795 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00023.html>.
1796 * NEWS (2.3a+): Add entry for the change to %define. Update entry for
1797 %code.
1798 * doc/bison.texinfo (Prologue Alternatives): Update.
91661ebb
JD
1799 (Decl Summary): In %defines entry, update mention of `%code requires'
1800 and `%code provides'.
16dc6a9e
JD
1801 (C++ Location Values): Update %define uses.
1802 (Calc++ Parser Interface): Likewise.
1803 (Calc++ Parser): Likewise, and update `%code requires' uses.
148d66d8 1804 (Table of Symbols): Update %code documentation.
16dc6a9e
JD
1805 * src/parse-gram.y (prologue_declaration): For %define variables, use
1806 `variable' instead of `STRING'.
1807 (grammar_declaration): For %code qualifiers, use `ID' instead of
1808 `STRING'.
1809 (variable): New nonterminal that takes an `ID' or a `STRING'.
1810 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update %code
1811 and %define uses.
1812 * tests/calc.at (_AT_DATA_CALC_Y): Update %define use.
1813 * tests/input.at (Reject unused %code qualifiers): Update %code uses.
1814 (%define errors): Update %define uses.
1815
e9813cd4
JD
18162007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1817
1818 * src/parse-gram.y (prologue_declaration): Use MUSCLE_INSERT_STRING
1819 instead of muscle_insert for %define values so that M4-special
1820 characters are replaced with digraphs.
1821 * tests/input.at (%define errors): Extend to check weird values.
1822
6afc30cc
JD
18232007-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
1824
1825 Instead of having skeletons declare all valid %define variables and
1826 %code qualifiers, provide macros that retrieve the associated values
1827 and build these lists automatically. Thus Bison will now warn when a
1828 variable or qualifier is not used by the skeleton in the current
1829 invocation regardless of whether it might sometimes be used by that
1830 skeleton in other invocations. Also, move all %define value macros to
1831 the b4_percent_define_ namespace, and remove the %define "NAME" {CODE}
1832 form, which is replaced by %code.
1833 * data/bison.m4 (b4_check_for_unrecognized_names): Rename to...
1834 (b4_check_user_names): ... this, and change the series of valid name
1835 arguments to a single list argument for names used in the skeleton
1836 similar to the existing list argument for names used in the grammar.
1837 Warn instead of complaining.
1838 (b4_get_percent_define, b4_get_percent_code): New to retrieve %define
1839 values and %code code, to format %code code properly, and to build
1840 lists of all %define variables and %code qualifiers used in the
1841 skeleton: b4_skeleton_percent_define_variables and
1842 b4_skeleton_percent_code_qualifiers.
1843 (b4_check_percent_define_variables, b4_check_percent_code_qualifiers):
1844 Remove, and...
1845 (m4_wrap): ... m4_wrap b4_check_user_names invocations instead so that
1846 the skeleton names lists can finish building first. In place of
1847 b4_used_percent_define_variables and b4_used_percent_code_qualifiers,
1848 expect the lists b4_user_percent_define_variables and
1849 b4_user_percent_code_qualifiers.
1850 * data/c++.m4: Where setting default values for b4_parser_class_name,
1851 b4_location_type, b4_filename_type, b4_namespace, and
1852 b4_define_location_comparison, update their names to the
1853 b4_percent_define_ namespace.
1854 * data/glr.c: Don't use b4_check_percent_define_variables and
1855 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1856 * data/glr.cc, data/lalr1.cc: Likewise, and use b4_get_percent_define.
1857 (b4_parser_class_name, b4_namespace): Define these using
a4e25e1d 1858 b4_get_percent_define for parser_class_name and namespace.
6afc30cc
JD
1859 * data/location.cc: Use b4_get_percent_define.
1860 * data/push.c: Don't use b4_check_percent_define_variables and
1861 b4_check_percent_code_qualifiers. Use b4_get_percent_code.
1862 * data/yacc.c: Likewise, and don't call m4_exit in
1863 b4_use_push_for_pull_if or m4_wrap code will never execute.
1864 * src/muscle_tab.c, src/muscle_tab.h (muscle_grow_used_name_list):
1865 Rename to...
1866 (muscle_grow_user_name_list): ... this for consistency with the
1867 terminology used in bison.m4.
1868 * src/parse-gram.y (prologue_declaration): Prepend "percent_define_" to
1869 %define variable names, and rename muscle used_percent_define_variables
1870 to user_percent_define_variables.
1871 (grammar_declaration): Rename muscle used_percent_code_qualifiers to
1872 user_percent_code_qualifiers.
1873 (content): Remove.
1874 (content.opt): Replace content RHS with STRING RHS so %define "NAME"
1875 {CODE} form is no longer accepted.
1876 * tests/input.at (Reject bad %code qualifiers): Rename to...
1877 (Reject unused %code qualifiers): ... this, and update test output.
1878 (%define error): Update test output.
1879
7eb8a0bc
JD
18802007-01-07 Joel E. Denny <jdenny@ces.clemson.edu>
1881
1882 Check for unrecognized %define variables similar to checking for
1883 unrecognized %code qualifiers. Check for redefined %define variables.
1884 * data/bison.m4 (b4_check_for_unrecognized_names): New macro that
1885 generalizes...
1886 (b4_check_percent_code_qualifiers): ... this, which now wraps it.
1887 (b4_check_percent_define_variables): New, also wraps it.
1888 * data/glr.c: Unless glr.cc is wrapping glr.c, declare no valid %define
1889 variables using b4_check_percent_define_variables.
1890 * data/glr.cc, data/lalr1.cc: Declare the valid %define variables as
1891 all those exercised in the test suite and all those listed in the
1892 `Default values' section of c++.m4. Are there others?
1893 * data/push.c, data/yacc.c: Declare no valid %define variables.
1894 * src/muscle_tab.c, src/muscle_tab.h (muscle_find_const): New function,
1895 similar to muscle_find, but it works even when the muscle stores a
1896 const value.
1897 (muscle_grow_used_name_list): New function for constructing the used
1898 name list muscles that b4_check_for_unrecognized_names requires.
1899 * src/parse-gram.y (prologue_declaration): Warn if a variable is
1900 %define'd more than once. Define the b4_used_percent_define_variables
1901 muscle with muscle_grow_used_name_list.
1902 (grammar_declaration): Abbreviate %code code with
1903 muscle_grow_used_name_list.
1904 * tests/input.at (%define errors): New.
1905
3fc65ead
JD
19062007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1907
1908 Provide warn_at, complain_at, and fatal_at function callbacks to the
1909 skeletons, and use this for %code qualifier complaints.
1910 * data/bison.m4 (b4_error_at): New, invoked by...
1911 (b4_warn_at, b4_complain_at, b4_fatal_at): ... these new macros to wrap
1912 the skeleton scanner's new @warn_at(...@), @complain_at(...@), and
1913 @fatal_at(...@) directives.
1914 (b4_check_percent_code_qualifiers): Rewrite to expect locations for
1915 qualifiers in b4_used_percent_code_qualifiers and to use
1916 b4_complain_at.
1917 * src/location.c, src/location.h (boundary_set_from_string): New global
1918 function.
1919 * src/muscle_tab.c, src/muscle_tab.h (muscle_boundary_grow): New global
1920 function.
1921 * src/parse-gram.y (grammar_declaration): Add locations for qualifiers
1922 to b4_used_percent_code_qualifiers.
1923 * src/scan-skel.l (fail_for_at_directive_too_few_args): New static
1924 function.
1925 (AT_DIRECTIVE_ARGC_MAX): Increase for boundary arguments.
1926 (lineno): Rename to...
1927 (out_lineno): ... this so I don't misunderstand it again.
1928 (SC_AT_DIRECTIVE_SKIP_WS): Don't increment out_lineno for newlines
1929 here; these newlines are in the input but not the output file.
1930 (SC_AT_DIRECTIVE_ARG): Likewise. Extract directive execution to...
1931 (at_directive_perform): ... this new static function, and add handling
1932 of new @warn_at(...@), @complain_at(...@), and @fatal_at(...@)
1933 directives.
1934 * tests/input.at (Reject bad %code qualifiers): Update test output with
1935 locations and extend.
1936
1937 * tests/output.at (Output file name: [, Output file name: ]): Remove
1938 bogus comment about these tests failing.
1939
1c7b7e1d
JD
19402007-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
1941
1942 Clean up b4_check_percent_code_qualifiers a little.
1943 * data/bison.m4 (b4_check_percent_code_qualifiers): Expect qualifiers
1944 in b4_used_percent_code_qualifiers to be double-M4-quoted. Rewrite
1945 documentation and add examples.
1946 * src/parse-gram.y (grammar_declaration): Double-M4-quote those
1947 qualifiers here.
1948
08af01c2
JD
19492007-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
1950
1951 Don't use m4_divert since it makes m4_divert_push and m4_divert_pop
1952 unreliable -- especially when they're hidden inside another macro.
1953 * data/bison.m4, data/c++-skel.m4, data/c++.m4, data/c-skel.m4,
1954 data/c.m4: Remove m4_divert(-1).
1955 * data/glr.c, data/glr.cc, data/lalr1.cc, data/location.cc,
1956 data/push.c, data/yacc.c: Likewise, and replace m4_divert(0) with
1957 m4_divert_push(0) and m4_divert_pop(0).
279cabb6 1958 * src/output.c (output_skeleton): Don't add an m4_divert_push(0) and
08af01c2
JD
1959 an m4_wrap([m4_divert_pop(0)]) to the M4. Diversion -1, which is
1960 pushed and popped by m4sugar, should be first on the stack.
1961
1962 Provide warn, complain, and fatal function callbacks to the skeletons.
1963 This provides more flexibility than m4_fatal, improves the error
1964 message format, and captures messages for translation. Discussed
1965 starting at
1966 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00063.html>.
1967 * data/bison.m4 (b4_error): New, invoked by...
1968 (b4_warn, b4_complain, b4_fatal): ... these new macros to wrap the
1969 skeleton scanner's new @warn(...@), @complain(...@), and @fatal(...@)
1970 directives. Because these M4 macros might be called when the current
1971 diversion is -1 or 0, m4_divert_push and m4_divert_pop is used; thus
1972 the previous removal of uses of m4_divert, which caused trouble.
1973 (b4_check_percent_code_qualifiers): Use b4_complain instead of
1974 m4_fatal to report unrecognized %code qualifiers.
1975 * data/c++-skel.m4: Use b4_complain instead of m4_fatal to report C++
1976 push parser requests.
1977 * data/glr.c: Use b4_complain instead of m4_fatal to report
1978 non-deterministic push parser requests.
1979 Update @output usage to @output(...@) form.
1980 * data/glr.cc, data/lalr1.cc: Use b4_fatal instead of m4_fatal to
1981 report missing %defines. Update @output usage to @output(...@) form.
1982 * data/location.cc, data/push.c, data/yacc.c: Update @output usage to
1983 @output(...@) form.
1984 * src/main.c (main): Invoke skel_scanner_free.
1985 * src/scan-skel.h (skel_scanner_free): Prototype new function.
1986 * src/scan-skel.l (FLEX_NO_OBSTACK): Don't define; we now need the
1987 obstack_for_string from flex-scanner.h.
1988 (YY_DECL): Use to declare skel_lex static.
1989 (decode_at_digraphs): Remove; now handled in the new
1990 SC_AT_DIRECTIVE_ARG start condition.
1991 (fail_for_at_directive_too_many_args, fail_for_invalid_at): New static
1992 functions.
1993 (at_directive_name, AT_DIRECTIVE_ARGC_MAX, at_directive_argc,
1994 at_directive_argv): New static globals.
1995 (INITIAL): Use fail_for_invalid_at.
1996 Don't parse `@output file_name\n' or `@basename(...@)'. Instead,
1997 recognize the start of a generalized `@directive(...@)' form and
1998 start...
1999 (SC_AT_DIRECTIVE_ARG): ... this new start condition to parse the
2000 directive args (using the new obstack_for_string), to decode the
2001 contained @ diagraphs, and to perform the directive. It recognizes
2002 @basename(...@), @warn(...@), @complain(...@), @fatal(...@), and
2003 @output(...@).
2004 (SC_AT_DIRECTIVE_SKIP_WS): New start condition started by
2005 SC_AT_DIRECTIVE_ARG to skip whitespace after the argument delimiter,
2006 `@,'.
2007 (scan_skel): Initialize obstack_for_string on the first call.
2008 (skel_scanner_free): New function to free obstack_for_string.
2009 * tests/input.at (Reject bad %code qualifiers): Update test output.
2010
8e0a5e9e
JD
20112007-01-04 Joel E. Denny <jdenny@ces.clemson.edu>
2012
2013 Consolidate the 4 prologue alternative directives (%code, %requires,
2014 %provides, and %code-top) into a single %code directive with an
2015 optional qualifier field. Discussed at
2016 <http://lists.gnu.org/archive/html/bison-patches/2007-01/msg00012.html>.
2017 * NEWS (2.3a+): Rewrite the existing entry for the prologue
2018 alternatives.
2019 * doc/bison.texinfo (Prologue Alternatives): Update.
2020 (Decl Summary): Update to %code "requires" and %code "provides".
2021 (Calc++ Parser): Update to %code "requires".
148d66d8 2022 (Table of Symbols): Remove entries for %requires, %provides, and
8e0a5e9e
JD
2023 %code-top. Rewrite %code entry, and add a %code "QUALIFIER" entry.
2024 * data/bison.m4 (b4_user_provides, b4_user_requires): Remove as these
2025 are replaced by b4_percent_code_provides and b4_percent_code_requires,
2026 which are skeleton-specific.
2027 (b4_check_percent_code_qualifiers): New. A skeleton can use this to
2028 declare what %code qualifiers it supports and to complain if any other
2029 qualifiers were used in the grammar.
2030 * data/glr.cc: Update to use b4_user_code([b4_percent_code_requires])
2031 and b4_user_code([b4_percent_code_provides]) in place of
2032 b4_user_requires and b4_user_provides.
2033 * data/glr.c, data/lalr1.cc, data/push.c, data/yacc.c: Likewise.
2034 Add b4_user_code([b4_percent_code_top]) and
2035 b4_user_code([b4_percent_code]).
2036 Invoke b4_check_percent_code_qualifiers.
2037 * src/parse-gram.y (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2038 PERCENT_REQUIRES): Remove.
2039 (grammar_declaration): Remove RHS's for %code-top, %provides, and
2040 %requires. Rewrite the %code RHS as the unqualified form defining the
2041 muscle b4_percent_code. Add another RHS for the qualified %code form,
2042 which defines muscles of the form b4_percent_code_QUALIFIER and the
2043 b4_used_percent_code_qualifiers muscle.
2044 * src/scan-gram.l (PERCENT_CODE_TOP, PERCENT_PROVIDES,
2045 PERCENT_REQUIRES): Remove.
2046 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Update to use
2047 %code "requires" and %code "provides".
2048 * tests/input.at (Reject bad %code qualifiers): New.
2049
95021767
JD
20502007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2051
2052 Use the new code_props interface for destructors and printers.
2053 * src/symtab.h (symbol, semantic_type): Remove destructor_location and
2054 printer_location members, and change the type of the destructor and
2055 printer members to code_props.
2056 (symbol_destructor_set, symbol_destructor_get, symbol_printer_set,
2057 symbol_printer_get, semantic_type_destructor_set,
2058 semantic_type_printer_set, default_tagged_destructor_set,
2059 default_tagless_destructor_set, default_tagged_printer_set,
2060 default_tagless_printer_set): Use code_props in arguments and return
2061 types in place of char const * and location.
2062 (symbol_destructor_location_get, symbol_printer_location_get): Remove
2063 since the locations are now contained in the return of
2064 symbol_destructor_get and symbol_printer_get.
2065 * src/output.c (symbol_destructors_output, symbol_printers_output):
2066 Replace with...
2067 (symbol_code_props_output): ... this to eliminate duplicate code.
2068 (output_skeleton): Update to use symbol_code_props_output.
2069 * src/reader.c (symbol_should_be_used): Update use of
2070 symbol_destructor_get.
2071 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
2072 Update uses of the various _destructor_set and _printer_set functions.
2073 * src/symtab.c: (default_tagged_destructor_location,
2074 default_tagless_destructor_location, default_tagged_printer_location,
2075 default_tagless_printer_location): Remove since we...
2076 (default_tagged_destructor, default_tagless_destructor,
2077 default_tagged_printer, default_tagless_printer): ... change the type
2078 of these to code_props.
2079 (symbol_new, semantic_type_new, symbol_destructor_set,
2080 semantic_type_destructor_set, symbol_destructor_get,
2081 symbol_printer_set, semantic_type_printer_set, symbol_printer_get,
2082 symbol_check_alias_consistency, default_tagged_destructor_set,
2083 default_tagless_destructor_set, default_tagged_printer_set,
2084 default_tagless_printer_set): Update.
2085 (symbol_destructor_location_get, symbol_printer_location_get): Remove.
2086 (SYMBOL_CODE_PRINT): New similar to SYMBOL_ATTR_PRINT but for
2087 code_props members.
2088 (symbol_print): Use SYMBOL_CODE_PRINT.
2089
f6857bbf
JD
20902007-01-03 Joel E. Denny <jdenny@ces.clemson.edu>
2091
2092 Use the new code_props interface for rule actions.
2093 * src/symlist.h (symbol_list): Replace action, action_location, and
2094 used members with a code_props action_props member.
2095 * src/reader.c (symbol_should_be_used, grammar_rule_check,
2096 grammar_midrule_action, grammar_current_rule_merge_set,
2097 grammar_current_rule_symbol_append, packgram): Update.
2098 * src/scan-code.h (translate_rule_action): Remove, no longer used.
2099 * src/scan-code.l (handle_action_dollar): Update.
2100 (translate_rule_action): Remove, no longer used.
2101 * src/symlist.c (symbol_list_sym_new, symbol_list_syms_print): Update.
2102
7c0c6181
JD
21032007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2104
2105 Use the new code_props interface in parse-gram.y.
2106 * src/parse-gram.y (prologue_declaration, braceless, epilogue.opt):
2107 Update all uses of translate_* functions to use the new code_props
2108 interface and to use gram_scanner_last_string_free and
2109 code_scanner_last_string_free where possible.
2110 (grammar_declaration): symbol_list_destructor_set and
2111 symbol_list_printer_set now perform the translation, so don't do it
2112 here. Use gram_scanner_last_string_free where possible.
2113 * src/scan-code.h, src/scan-code.l (translate_symbol_action,
2114 translate_code): Remove, no longer used.
2115 * src/symlist.h, src/symlist.c (symbol_list_destructor_set,
2116 symbol_list_printer_set): Perform code translation here rather than
2117 depending on the caller to do so.
2118
2119 * src/symlist.h (struct symbol_list): Correct some documentation typos.
2120 * src/scan-gram.h (gram_last_string): Remove declaration.
2121 * src/scan-gram.l (last_string): Declare it static.
2122
28e52c0d
JD
21232007-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
2124
2125 Encapsulate code properties and related functionality for the various
2126 destructors, printers, and actions into a code_props structure and
2127 interface. This patch merely implements code_props in scan-code.h and
2128 scan-code.l. Future patches will rewrite other modules to use it.
2129 Discussed starting at
2130 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00020.html>.
2131 * src/location.h (EMPTY_LOCATION_INIT): Define so that it's easier to
2132 consistently initialize const structs that have an empty location
2133 field.
2134 * src/location.c (empty_location): Initialize with EMPTY_LOCATION_INIT
2135 to ensure consistency.
2136 * src/scan-code.h (code_props): New structure.
2137 (code_props_none_init, CODE_PROPS_NONE_INIT, code_props_none): New
2138 function, macro, and const global variable for initializing a
2139 code_props with no code.
2140 (code_props_plain_init, code_props_symbol_action_init,
2141 code_props_rule_action_init, code_props_translate_code): The rest of
2142 the new code_props functional interface. Among other things, the init
2143 functions set the code_props kind field so that
2144 code_props_translate_code will know whether to behave like
2145 translate_symbol_action, translate_rule_action, or translate_code.
2146 These old translate functions must remain until all other modules are
2147 updated to use the new code_props interface.
2148 (code_scanner_last_string_free): New function similar to
2149 gram_scanner_last_string_free.
2150 (code_scanner_free): Add documentation.
2151 * src/scan-code.l: Implement the new interface.
2152 (code_lex): Make it static, add a code_props* argument, and remove the
2153 rule argument.
2154 (last_string): New static global similar to the one in scan-gram.l.
2155 (SC_RULE_ACTION): Update to use the code_props* argument to code_lex
2156 instead of rule.
2157 (SC_SYMBOL_ACTION): For $$, set the is_value_used member of the
2158 code_props since Bison may one day use this information for destructors
2159 and printers.
2160 (<*><<EOF>>): Use STRING_FINISH so that last_string is set.
2161 (handle_action_dollar): Use symbol_list_n_get and set used flag
2162 directly since symbol_list_n_used_set is removed.
2163 (translate_action): Add a code_props* argument and remove the rule,
2164 action, and location arguments. Pass the code_props* on to code_lex.
2165 (translate_rule_action, translate_symbol_action, translate_code):
2166 Rewrite as wrappers around the new code_props interface.
2167 * src/symlist.h, src/symlist.c (symbol_list_n_used_set): Remove since
2168 it would eventually need to break the encapsulation of code_props.
2169
96034983
JD
21702007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2171
2172 * etc/.cvsignore: New.
2173
945e396c
JD
21742007-01-01 Joel E. Denny <jdenny@ces.clemson.edu>
2175
2176 Add maintainer-push-check to run maintainer-check using push parsing in
2177 place of pull parsing where available.
2178 * Makefile.am (maintainer-push-check): New.
2179 * data/bison.m4 (b4_use_push_for_pull_if): New.
2180 * data/push.c: Redefine b4_push_if and b4_use_push_for_pull_if
2181 appropriately based on their existing values.
2182 (yypush_parse): Don't print push-parser-specific diagnostics if push
2183 parsing is being used in place of pull parsing.
2184 * data/yacc.c: If push parsing should replace pull parsing, redirect to
2185 push.c.
2186 * src/output.c (prepare): Check BISON_USE_PUSH_FOR_PULL environment
2187 variable, and insert b4_use_push_for_pull_flag into muscles.
2188 * tests/Makefile.am (maintainer-push-check): New.
2189
7d596384
JD
21902006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2191
2192 * data/push.c (yypush_parse): Set yynew = 1 at the end of a parse
2193 (whether successful or failed) so that yypush_parse can be invoked
2194 again to start a new parse using the same yypstate.
2195 * tests/torture.at (AT_DATA_STACK_TORTURE): For push mode, extend to
2196 check multiple yypull_parse invocations on the same yypstate. For pull
2197 mode, extend to check multiple yyparse invocations.
2198 (Exploding the Stack Size with Alloca): Extend to try with
2199 %push-pull-parser.
2200 (Exploding the Stack Size with Malloc): Likewise.
2201
2202 * tests/calc.at (Simple LALR Calculator): Don't specify
2203 %skeleton "push.c" since %push-pull-parser implies that now.
2204 * tests/headers.at (export YYLTYPE): Don't check for the push
2205 declarations. Otherwise, this test case can't be used to see if push
2206 mode can truly emulate pull mode.
2207 * tests/input.at (Torturing the Scanner): Likewise.
2208 * tests/local.at (AT_YACC_OR_PUSH_IF, AT_PUSH_IF): Remove.
2209 (AT_YYERROR_SEES_LOC_IF): Rather than AT_YACC_OR_PUSH_IF, use
2210 AT_YACC_IF, which now includes the case of push mode since %skeleton
2211 need not be used for push mode. This will be more intuitive once
2212 push.c is renamed to yacc.c.
2213
7172e23e
JD
22142006-12-31 Joel E. Denny <jdenny@ces.clemson.edu>
2215
2216 For push mode, convert yyparse from a macro to a function, invoke yylex
2217 instead of passing a yylexp argument to yypull_parse, and don't
2218 generate yypull_parse or yyparse unless %push-pull-parser is declared.
2219 Discussed starting at
2220 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00163.html>.
2221 * data/bison.m4 (b4_pull_if): New.
2222 * data/c.m4 (b4_identification): Define YYPULL similar to YYPUSH.
2223 * data/push.c: Improve M4 quoting a little.
2224 (b4_generate_macro_args, b4_parenthesize): Remove.
2225 (yyparse): If there's a b4_prefix, #define this to b4_prefix[parse]
2226 any time a pull parser is requested.
2227 Don't #define this as a wrapper around yypull_parse. Instead, when
2228 both push and pull are requested, make it a function that does that
2229 same thing.
2230 (yypull_parse): If there's a b4_prefix, #define this to
2231 b4_prefix[pull_parse] when both push and pull are requested.
2232 Don't define this as a function unless both push and pull are
2233 requested.
2234 Remove the yylexp argument and hard-code yylex invocation instead.
2235 * etc/bench.pl.in (bench_grammar): Use %push-pull-parser instead of
2236 %push-parser.
2237 * src/getargs.c (pull_parser): New global initialized to true.
2238 * getargs.h (pull_parser): extern it.
2239 * src/output.c (prepare): Insert pull_flag muscle.
2240 * src/parse-gram.y (PERCENT_PUSH_PULL_PARSER): New token.
2241 (prologue_declaration): Set both push_parser and pull_parser = true for
2242 %push-pull-parser. Set push_parser = true and pull_parser = false for
2243 %push-parser.
2244 * src/scan-gram.l: Don't accept %push_parser as an alternative to
2245 %push-parser since there's no backward-compatibility concern here.
2246 Scan %push-pull-parser.
2247 * tests/calc.at (Simple LALR(1) Calculator): Use %push-pull-parser
2248 instead of %push-parser.
2249 * tests/headers.at (export YYLTYPE): Make yylex static, and don't
2250 prototype it in the module that calls yyparse.
2251 * tests/input.at (Torturing the Scanner): Likewise.
2252 * tests/local.at (AT_PUSH_IF): Check for %push-pull-parser as well.
2253
2e7944cb
JD
22542006-12-26 Joel E. Denny <jdenny@ces.clemson.edu>
2255
2256 Update etc/bench.pl. Optimize push mode a little (the yyn change
2257 deserves most of the credit).
2258 * Makefile.am (SUBDIRS): Add etc subdirectory.
2259 * configure.ac (AC_CONFIG_FILES): Add etc/bench.pl and etc/Makefile.
2260 * data/push.c (b4_declare_parser_state_variables): Move yyn, yyresult,
2261 yytoken, yyval, and yyloc declarations to...
2262 (yyparse or yypush_parse): ... here to improve performance. For
2263 yypush_parse invocations after the first, be sure to assign yyn its old
2264 value again.
2265 (yypstate_new): Don't bother initializing the yyresult field since the
2266 initial value isn't used.
2267 (yyn, yyresult, yytoken, yyval, yyloc): For each NAME in this list,
2268 remove the #define that, in push mode, set it to yyps->NAME.
2269 * etc/Makefile.am: New.
2270 * etc/bench.pl: Remove and build it instead from...
2271 * etc/bench.pl.in: ... this new file. Use @abs_top_builddir@ to invoke
2272 "tests/bison" from the build directory by default rather than just
2273 invoking "bison" from $PATH.
2274 (calc_grammar): Update push parser code: don't declare yylval globally,
2275 don't define yyparse_wrapper, and don't #define yyparse.
2276 (bench_grammar): Update to check all working combinations of yacc.c,
2277 push.c, impure, pure, pull, and push.
2278
c3d50342
JD
22792006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2280
2281 For push mode, add pull wrappers around yypush_parse.
2282 * data/push.c: (b4_generate_macro_args, b4_parenthesize): New macros.
2283 (yypull_parse): New function wrapping yypush_parse.
2284 (yyparse): New #define wrapping yypull_parse.
2285 * tests/calc.at (_AT_DATA_CALC_Y): Call yyparse even when %push-parser
2286 is declared.
2287 * tests/headers.at (export YYLTYPE): Make yylex global. For push mode,
2288 prototype yylex in the module that calls yyparse, and don't prototype
2289 yyparse there. Otherwise, the yyparse expansion won't compile.
2290 * tests/input.at (Torturing the Scanner): Likewise.
2291
94ebeba5
JD
22922006-12-25 Joel E. Denny <jdenny@ces.clemson.edu>
2293
2294 Enable push parsers to operate in impure mode. Thus, %push-parser no
2295 longer implies %pure-parser. The point of this change is to move
2296 towards being able to test the push parser code by running the entire
2297 test suite as if %push-parser had been declared.
2298 * data/push.c (yypush_parse): For impure mode, remove the
2299 yypushed_char, yypushed_val, and yypushed_loc arguments.
2300 Instead, declare these as local variables initialized to the global
2301 yychar, yylval, and yylloc.
2302 For the first yypush_parse invocation only, restore the initial values
2303 of these global variables when it's time to read a token since they
2304 have been overwritten.
2305 * src/parse-gram.y (prologue_declaration): Don't set pure_parser for
2306 %push-parser.
2307 * tests/calc.at (Simple LALR(1) Calculator): Always declare
2308 %pure-parser along with %push-parser since this test case was designed
2309 for pure push parsers.
2310 * tests/local.at (AT_PURE_OR_PUSH_IF): Remove unused.
2311 (AT_YACC_OR_PUSH_IF): New.
2312 (AT_YYERROR_SEES_LOC_IF): Fix enough that the test suite passes, but
2313 add a note that it's still wrong for some cases (as it has been for a
2314 while).
2315 (AT_PURE_LEX_IF): Use AT_PURE_IF instead of AT_PURE_OR_PUSH_IF since
2316 %push-parser no longer implies %pure-parser.
2317
a0633178
JD
23182006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2319
2320 Remove some unnecessary differences between the pull parser code and
2321 the push parser code. This patch enables yynerrs in push mode.
2322 * data/push.c: Reformat M4 a little.
2323 (b4_yyerror_range): Remove and convert all uses to just yyerror_range.
2324 (b4_declare_scanner_communication_variables): Don't omit yynerrs just
2325 because push mode is on. Instead, if pure mode is on, move yynerrs
2326 to...
2327 (b4_declare_parser_state_variables): ... here.
2328 (yynerrs, yyerror_range): For push mode, #define each NAME in this list
2329 to yyps->NAME so it can be used in yypush_parse.
2330 (yypush_parse): Don't omit uses of yynerrs in push mode.
2331
8646b6a3
JD
23322006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2333
2334 Fix bug such that the first pushed token's value and location are
2335 sometimes overwritten (sometimes by %initial-action) before being used.
2336 * data/push.c (yypush_parse): Rename arguments yynchar, yynlval, and
2337 yynlloc to yypushed_char, yypushed_val, and yypushed_loc for clarity.
2338 For the first yypush_parse invocation, initialize yychar to YYEMPTY to
2339 more closely mimic the pull parser logic.
2340 Don't copy the pushed token to yychar, yylval, and yylloc until it's
2341 time to read a token, which is after any initialization of yylval and
2342 yylloc.
2343 (gottoken): Rename label to...
2344 (yyread_pushed_token): ... for clarity and to avoid infringing on the
2345 user namespace.
2346
9baf4d74
JD
23472006-12-20 Joel E. Denny <jdenny@ces.clemson.edu>
2348
2349 Rearrange initialization of the parser state variables so that the
2350 skeleton doesn't have to have a copy for pull mode and another for push
2351 mode. This patch also fixes at least a bug such that yylloc was not
2352 initialized (with b4_location_initial_line and
2353 b4_location_initial_column) upon calling yypush_parse. However, that
2354 initialization now overwrites the first token's location;
2355 %initial-action assigning @$ already did the same thing, and both bugs
2356 will be fixed in a later patch.
2357 * data/push.c (b4_yyssa): Remove and convert all uses to just yyssa.
2358 (b4_declare_parser_state_variables): Remove initialization of yytoken,
2359 yyss, yyvs, yyls, and yystacksize.
2360 (yypstate_new): Remove initialization of some yypstate fields: yystate,
2361 yyerrstatus, yytoken, yyss, yyvs, yyls, yystacksize, yyssp, yyvsp, and
2362 yylsp.
2363 (yyssa, yyvsa, yylsa): For push mode, #define each NAME in this list to
2364 yyps->NAME so it can be used in yypush_parse.
2365 (yyparse or yypush_parse): For yypush_parse, don't print the
2366 "Starting parse" diagnostic for invocations after the first.
2367 Add initialization of yytoken, yyss, yyvs, yyls, and yystacksize; for
2368 yypush_parse, only do it for the first invocation.
2369 Allow yystate, yyerrstatus, yyssp, yyvsp, yylsp, and yylloc
2370 initialization to occur in yypush_parse but only on the first
2371 invocation.
2372
23522164
JD
23732006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2374
2375 * data/push.c: Add CPP guards around push parser declarations in both
2376 the header and the code file.
2377 In the code file, move the push parser declarations to the same place
2378 they appear in the header file.
2379 Clean up the M4 some, especially the inconsistent underquoting in
2380 some b4_c_function_def and b4_c_function_decl uses.
2381
bb010fe5
JD
23822006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2383
2384 Encapsulate the push parser state variables into an M4 macro so the
2385 push skeleton doesn't have to list them again for pull mode's yyparse.
2386 For push mode, remove yypush_parse's local equivalents of these
2387 variables to eliminate unnecessary copying between the two sets at
2388 run-time. This patch also fixes at least a bug related to multiple
2389 %initial-action invocations in push mode.
2390 * data/push.c (b4_declare_parser_variables): Rename to...
2391 (b4_declare_scanner_communication_variables): ... this for clarity and
2392 update both uses.
2393 (b4_declare_yyparse_variables): Remove and move its contents to the one
2394 spot where it was invoked.
2395 (b4_declare_parser_state_variables): New macro containing the parser
2396 state variables required by push mode.
2397 (struct yypstate): Replace all fields but yynew with
2398 b4_declare_parser_state_variables.
2399 (yystate, yyn, yyresult, yyerrstatus, yytoken, yyss, yyssp, yyvs,
2400 yyvsp, yyls, yylsp, yystacksize, yyval, yyloc): For push mode, #define
2401 each NAME in this list to yyps->NAME so it can be used in yypush_parse.
2402 (yyparse or yypush_parse): For yyparse in pull mode, replace local
2403 parser state variable declarations with
2404 b4_declare_parser_state_variables.
2405 Don't initialize parser state variables when calling yypush_parse since
2406 yypstate_new already does that.
2407 Invoke the user's initial action only upon the first yypush_parse
2408 invocation.
2409 Remove all code that copies between the local parser state variables
2410 and the yypstate.
2411
2d212f8c
JD
24122006-12-19 Joel E. Denny <jdenny@ces.clemson.edu>
2413
2414 * data/push.c (union yyalloc): Rename yyss, yyvs, and yyls fields to
2415 prevent a name collision in a future patch where these names will
2416 sometimes be #define'd.
2417 (YYSTACK_RELOCATE): Add an argument to select a union yyalloc field
2418 since it no longer has the same name as the existing argument.
2419 (yyparse or yypush_parse): Update all uses of YYSTACK_RELOCATE.
2420
e6e704dc
JD
24212006-12-19 Paolo Bonzini <bonzini@gnu.org>
2422 and Joel E. Denny <jdenny@ces.clemson.edu>
2423
2424 * doc/bison.texinfo (Decl Summary): In the %language entry, mention
2425 that the argument is case-insensitive, and there's no `=' here.
2426 For the %skeleton entry, mention that %language is better.
2427 (Bison Options): Likewise for --language and --skeleton. Move the
2428 --skeleton entry so that the `Tuning the parser' section is sorted
2429 alphabetically on long options.
2430 (C++ Bison Interface): Don't use the word skeleton. Don't explain the
2431 %language directive in detail here; cross-reference the %language
2432 documentation instead.
2433 (Calc++ Parser): Use `%require "@value{VERSION}"' rather than
2434 `%require "2.3b"' so that the example is always up-to-date.
148d66d8 2435 (Table of Symbols): Add entries for %language and %skeleton.
e6e704dc
JD
2436 * examples/extexi (normalize): Instead of replacing every %require
2437 argument with the current Bison version, just substitute for
2438 `@value{VERSION}'. This guarantees that we're testing what actually
2439 appears in the documentation.
2440 * examples/calc++/Makefile.am ($(calc_extracted)): Use `$(VERSION)'
2441 rather than `@VERSION@'.
2442
0e021770
PE
24432006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2444
fd575f05
PE
2445 * NEWS: Reword the %language news a bit, and put it earlier.
2446
0e021770
PE
2447 * src/getargs.c (skeleton_arg): Last arg is now location const *.
2448 Rewrite to simplify the logic.
2449 (language_argmatch): Likewise.
fd575f05
PE
2450 (program_name): We now own this var.
2451 * src/getargs.h (struct bison_language): Use char[] rather than
2452 const char *.
0e021770
PE
2453
2454 * doc/bison.texinfo (Decl Summary, Bison Options): Don't claim
2455 Java is supported.
2456 * src/complain.c (program_name): Remove decl; no longer needed.
2457 * src/main.c (program_name): Remove; now belongs to getargs.
2458
24592006-12-18 Paolo Bonzini <bonzini@gnu.org>
2460
2461 * NEWS: Document %language.
2462
2463 * data/Makefile.am (dist_pkgdata_DATA): Add c-skel.m4, c++-skel.m4.
2464
2465 * data/c-skel.m4, data/c++-skel.m4: New files.
2466 * data/glr.c: Complain on push parsers.
2467
2468 * doc/bison.texinfo (C++ Parser Interface): Prefer %language
2469 over %skeleton.
148d66d8 2470 (Decl Summary): Document %language and %skeleton.
0e021770
PE
2471 (Command line): Document -L.
2472
2473 * examples/extexi: Rewrite %require directive.
2474 * examples/calc++/Makefile.am: Pass VERSION to extexi.
2475
2476 * src/files.c (compute_exts_from_gc): Look in language structure
2477 for .y extension.
2478 (compute_file_name_parts): Check whether .tab should be added.
2479 * src/getargs.c (valid_languages, skeleton_prio, language_prio):
2480 (language, skeleton_arg, language_argmatch): New.
2481 (long_options): Add --language.
2482 (getargs): Use skeleton_arg, add -L/--language.
2483 * src/getargs.h: Include location.h.
2484 (struct bison_language, language, skeleton_arg, language_argmatch): New.
2485 * src/output.c (prepare): Pick default skeleton from struct language.
2486 Don't dispatch C skeletons here.
2487 * src/parse-gram.y (PERCENT_LANGUAGE): New.
2488 (prologue_declaration): Add "%language" rule, use skeleton_arg.
2489 * src/scan-gram.l ("%language"): New rule.
2490
2491 * tests/calc.at: Test %skeleton and %language.
2492 * tests/local.at (AT_SKEL_CC_IF): Look for %language.
2493 (AT_GLR_IF): Look for %skeleton "glr.cc".
2494 (AT_LALR1_CC_IF, AT_GLR_CC_IF): Rewrite.
2495 (AT_YACC_IF): Reject %language.
2496
5691bf57
PE
24972006-12-18 Paul Eggert <eggert@cs.ucla.edu>
2498
db06f0ce
PE
2499 * src/symtab.h (struct semantic_type): Remove the tag 'semantic_type',
2500 since it wasn't used; only the typedef name 'semantic_type' is needed.
2501 Also, omit trailing white space.
2502
5691bf57
PE
2503 * bootstrap: Sync from coreutils.
2504 (gnulib_extra_files): Add build-aux/announce.gen.
2505 (slurp): Adjust .gitignore files like .cvsignore files.
2506 * build-aux/announce-gen: Remove from CVS, since bootstrap
2507 now creates this.
2508
791934e4
JD
25092006-12-16 Joel E. Denny <jdenny@ces.clemson.edu>
2510
2511 Make %push-parser imply %pure-parser. This fixes several bugs; see
2512 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00148.html>.
2513 * src/parse-gram.y (prologue_declaration): For %push-parser, also set
2514 pure_parser = true.
2515 * data/push.c: Don't bother testing b4_push_if when deciding whether
2516 to expand b4_declare_parser_variables globally.
2517 (yypush_parse): Likewise in here.
2518
2519 * data/push.c (yypush_parse): Add b4_parse_param to arguments.
2520 (yy_reduce_print): Reformat M4 for readability.
2521
ee5abb37
JD
25222006-12-15 Bob Rossi <bob@brasko.net>
2523 and Joel Denny <jdenny@ces.clemson.edu>
2524
2525 * data/push.c (yypstate): Add typedef, and update all uses of
2526 struct yypstate to just yypstate.
2527 * tests/calc.at (_AT_DATA_CALC_Y): Update here as well.
2528
16ca01f9
JD
25292006-12-14 Bob Rossi <bob@brasko.net>
2530
2531 * data/push.c (yypush_parse): Declare prototype regardless of
2532 %locations option.
2533
ab8e7e1a
JD
25342006-12-14 Bob Rossi <bob@brasko.net>
2535
2536 * data/push.c (yyparse): Remove the prototype and the #define when in
2537 push-parser mode.
2538
9bf32be3
JD
25392006-12-13 Bob Rossi <bob@brasko.net>
2540
2541 * data/push.c (yypstate_init): Rename to...
2542 (yypstate_new): ... this and use b4_c_function_def.
2543 (yypstate_delete): New.
2544 (yypush_parse): Change parameters yynval and yynlloc to be const.
2545 * tests/calc.at (_AT_DATA_CALC_Y): Use new yypstate_new and
2546 yypstate_delete functions.
2547
f02e2948
JD
25482006-12-13 Joel E. Denny <jdenny@ces.clemson.edu>
2549
2550 * configure.ac (AC_PREREQ): Require Autoconf 2.61 because of our
2551 strange test case titles. Reported by Bob Rossi.
2552
38eb7751
PE
25532006-12-13 Paul Eggert <eggert@cs.ucla.edu>
2554
2555 * TODO: Add pointer to Sylvain Schmitz's work on static detection
2556 of potential ambiguities in GLR grammers.
2557
bd9d212b
JD
25582006-12-12 Joel E. Denny <jdenny@ces.clemson.edu>
2559
2560 * tests/testsuite.at (AT_CHECK): When checking if $1 starts with
2561 `bison ', use m4_index instead of m4_substr since chopping up a string
2562 containing M4-special characters causes problems here.
2563
2564 Fix a couple of bugs related to special characters in user-specified
2565 file names, and make it easier for skeletons to compute output file
2566 names with the same file name prefix as Bison-computed output file
2567 names.
2568 * data/glr.cc, data/push.c, data/yacc.c: In @output, use
2569 b4_parser_file_name and b4_spec_defines_file instead of
2570 @output_parser_name@ and @output_header_name@, which are now redundant.
2571 * data/glr.c, data/lalr1.cc: Likewise. Also, in header #include's, use
2572 b4_parser_file_name, b4_spec_defines_file, and the new
2573 @basename(FILENAME@) instead of @output_parser_name@ and
2574 @output_header_name@, which inappropriately escaped the file names as
2575 C string literals.
2576 * src/files.c (all_but_ext): Remove static qualifier.
2577 (compute_output_file_names): Move `free (all_but_ext)' to...
2578 (output_file_names_free): ... here since all_but_ext is needed later.
2579 * src/files.h (all_but_ext): Extern.
2580 * src/muscle_tab.h (MUSCLE_INSERT_STRING_RAW): New macro that does
2581 exactly what MUSCLE_INSERT_STRING used to do.
2582 (MUSCLE_INSERT_STRING): Use MUSCLE_OBSTACK_SGROW so that M4-special
2583 characters are escaped properly.
2584 * src/output.c (prepare): Define muscle file_name_all_but_ext as
2585 all_but_ext.
2586 For pkgdatadir muscle, maintain previous functionality by using
2587 MUSCLE_INSERT_STRING_RAW instead of MUSCLE_INSERT_STRING. The problem
2588 is that b4_pkgdatadir is used inside m4_include in the skeletons, so
2589 digraphs would never be expanded. Hopefully no one has M4-special
2590 characters in his Bison installation path.
2591 * src/scan-skel.l: Don't parse @output_header_name@ and
2592 @output_parser_name@ anymore since they're now redundant.
2593 In @output, use decode_at_digraphs.
2594 Parse a new @basename command that invokes last_component.
2595 (decode_at_digraphs): New.
2596 (BASE_QPUTS): Remove unused.
2597 * tests/output.at (AT_CHECK_OUTPUT_FILE_NAME): New macro.
2598 (Output file name): New tests.
2599
3f7ca628
JD
26002006-12-09 Joel E. Denny <jdenny@ces.clemson.edu>
2601
2602 Warn about output files that are generated by the skeletons and that
2603 conflict with other output files.
2604 * data/glr.c: Don't generate the header file here when glr.cc does.
2605 * src/files.c (file_names, file_names_count): New static globals.
2606 (compute_output_file_names): Invoke output_file_name_check for files
2607 not generated by the skeletons and remove existing checks.
2608 (output_file_name_check): New function that warns about conflicting
2609 output file names.
2610 (output_file_names_free): Free file_names.
2611 * src/files.h (output_file_name_check): Declare.
2612 * src/scan-skel.l: Invoke output_file_name_check for files generated by
2613 the skeletons.
2614 * tests/output.at (AT_CHECK_CONFLICTING_OUTPUT): New.
2615 (Conflicting output files): New tests.
2616
178e123e
PE
26172006-12-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
2618
2619 * doc/bison.texinfo: Fix a couple of typos.
2620
26212006-12-08 Bob Rossi <bob@brasko.net>
8def5cd0
JD
2622
2623 * data/push.c: (yypvarsinit, yypvars, struct yypvars, yypushparse):
2624 Rename to...
2625 (yypstate_init, yypstate, struct yypstate, yypush_parse): ... these and
2626 update all uses.
2627 (b4_yyssa, b4_yyerror_range, yypstate_init): Rename pv to yyps.
2628 (yypush_parse): Rename yypvars argument to yyps and remove redundant
2629 local pv.
2630 (yypstate_init, yypush_parse): Declare in Bison-generated header file.
2631 * tests/calc.at (_AT_DATA_CALC_Y): Use newly named functions.
2632
ea17f233
JD
26332006-12-07 Bob Rossi <bob@brasko.net>
2634 and Joel Denny <jdenny@ces.clemson.edu>
2635
2636 * data/push.c (yypvarsinit): Change return type from void* to struct
2637 yypvars*. No longer cast to void* on return.
2638 (struct yypvars): Remove yylen since it need not be remembered between
2639 yypushparse invocations.
2640 (yypushparse): Don't copy between yylen and pv->yylen.
2641
55a30bda
JD
26422006-12-05 Bob Rossi <bob@brasko.net>
2643
2644 * data/push.c (yychar_set, yylval_set, yylloc_set): Delete.
2645 (yypushparse): Add yynchar, yynlval, yynlloc parameters.
2646 (b4_declare_parser_variables): Do not declare yynerrs for push mode.
2647 (struct yypvars): Remove b4_declare_parser_variables.
2648 (yypvarsinit): Remove init code for removed variables.
2649 (global scope): Do not declare b4_declare_parser_variables if
2650 push or pure mode.
2651 (yypushparse): Add b4_declare_parser_variables.
2652 Init new local variables, and remove init code for removed
2653 yypvars variables.
2654 (yyparse): Delete.
2655 * tests/calc.at (_AT_DATA_CALC_Y): Call yypushparse for push mode
2656 and yyparse for other modes.
2657 (AT_CHECK_CALC_LALR): Added '%skeleton "push.c"' for push tests.
2658 * tests/local.at (AT_PUSH_IF, AT_PURE_OR_PUSH_IF): Added.
2659 (AT_YYERROR_SEES_LOC_IF): push-parser makes this false.
2660 (AT_PURE_LEX_IF): True if pure or push parser.
2661
85894313
JD
26622006-12-05 Joel E. Denny <jdenny@ces.clemson.edu>
2663
2664 Document Yacc prologue alternatives and default %destructor's and
2665 %printer's as experimental. Don't mention Java yet. Discussed at
2666 <http://lists.gnu.org/archive/html/bison-patches/2006-12/msg00002.html>.
2667 * NEWS (2.3a+): Say they're experimental. Remove any mention of Java.
2668 (2.3a): Annotate this entry to say the old forms of these features were
2669 also experimental.
2670 * doc/bison.texinfo (Prologue Alternatives, Freeing Discarded Symbols,
148d66d8 2671 Table of Symbols): Say they're experimental. Comment out any mention
85894313
JD
2672 of Java (we'll want this back eventually).
2673
02975b9a
JD
26742006-12-01 Joel E. Denny <jdenny@ces.clemson.edu>
2675
2676 Support a file name argument to %defines. Deprecate `=' in
2677 %file-prefix, %name-prefix, and %output. Discussed at
2678 <http://lists.gnu.org/archive/html/help-bison/2006-09/msg00001.html>.
2679 * NEWS (2.3a+): Mention.
148d66d8 2680 * doc/bison.texinfo (Decl Summary, Table of Symbols): Add entry for new
02975b9a
JD
2681 form of %defines, and remove `=' from entries for %file-prefix,
2682 %name-prefix, and %output.
2683 * src/parse-gram.y (prologue_declaration): Implement.
2684 * tests/calc.at (Simple LALR Calculator, Simple GLR Calculator, Simple
2685 LALR1 C++ Calculator, Simple GLR C++ Calculator): Remove the `=' from
2686 all but one occurrence of %name-prefix.
2687 * tests/headers.at (export YYLTYPE): Remove the `=' from %name-prefix.
2688 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Likewise.
2689 * tests/output.at (AT_CHECK_OUTPUT): Remove the `=' from all but one
2690 occurrence of each of %file-prefix and %output. Add check for %defines
2691 with argument.
2692 * tests/reduce.at (Useless Terminals, Useless Nonterminals,
2693 Useless Rules, Reduced Automaton, Underivable Rules, Empty Language):
2694 Remove the `=' from %output.
2695
287b314e
JD
26962006-11-21 Joel E. Denny <jdenny@ces.clemson.edu>
2697
2698 Don't escape $ in test case titles since Autoconf 2.61 now does that
2699 correctly.
2700 * tests/actions.at (Default %printer and %destructor are not for error
2701 or $undefined): Here.
2702 (Default %printer and %destructor are not for $accept): Here.
2703 * tests/input.at (Invalid $n and @n): Here.
2704
3ebecc24
JD
27052006-11-20 Joel E. Denny <jdenny@ces.clemson.edu>
2706
2707 Rename <!> to <>. Discussed starting at
2708 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00039.html>.
2709 * NEWS (2.3a+): Update.
148d66d8 2710 * doc/bison.texinfo (Freeing Discarded Symbols, Table of Symbols):
3ebecc24
JD
2711 Update.
2712 * src/parse-gram.y (TYPE_TAG_NONE, generic_symlist_item): Implement.
2713 * src/scan-gram.l (INITIAL): Implement.
2714 * src/symlist.c (symbol_list_default_tagless_new): Update comment.
2715 * src/symlist.h (symbol_list, symbol_list_default_tagless_new): Update
2716 comment.
2717 * tests/actions.at (Default tagless %printer and %destructor,
2718 Default tagged and per-type %printer and %destructor,
2719 Default %printer and %destructor are not for error or $undefined,
2720 Default %printer and %destructor are not for $accept,
2721 Default %printer and %destructor for mid-rule values): Update.
2722 * tests/input.at (Default %printer and %destructor redeclared,
2723 Unused values with default %destructor): Update.
2724
26b8a438
JD
27252006-11-17 Joel E. Denny <jdenny@ces.clemson.edu>
2726
2727 Don't let %prec take a nonterminal.
2728 * src/reader.c (grammar_current_rule_prec_set): Make the %prec symbol a
2729 token.
2730 * tests/input.at (%prec takes a token): New test checking that %prec
2731 won't take a nonterminal.
2732
07c39ae9
JD
27332006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2734
405d53b7
JD
2735 * tests/testsuite.at (AT_CHECK): Don't miss an exit value of 0 because
2736 it was double-quoted.
07c39ae9
JD
2737 * src/Makefile.am (YACC): Use --warnings=all,error so that Bison's own
2738 grammar is maintained with Bison's highest standards.
2739 * src/getargs.c: Fix some typos in Doxygen comments.
2740
580b8926
JD
27412006-11-10 Joel E. Denny <jdenny@ces.clemson.edu>
2742
2743 Fix memory leaks in scanners generated by at least Flex 2.5.9 and
2744 later. Reported by Paul Eggert in
2745 <http://lists.gnu.org/archive/html/bison-patches/2006-11/msg00014.html>.
2746 * src/flex-scanner.h (yylex_destroy): Define for Flex before 2.5.9.
2747 * src/scan-code.l (translate_action): Don't bother invoking
2748 yy_delete_buffer (YY_CURRENT_BUFFER) before creating the first buffer.
2749 (code_scanner_free): Instead of invoking
2750 yy_delete_buffer (YY_CURRENT_BUFFER) directly, invoke yylex_destroy,
2751 which frees more.
2752 * src/scan-gram.l (gram_scanner_free): Likewise.
2753 * src/scan-skel.l (scan_skel): Likewise.
2754
4502eadc
JD
27552006-11-09 Joel E. Denny <jdenny@ces.clemson.edu>
2756
2757 * src/files.c (tr): Change return type to void.
2758 * src/muscle_tab.c (muscle_insert): Free storage in case muscle_grow
2759 has been called previously for the same key.
2760 (muscle_find): Return storage instead of value so that
2761 --enable-gcc-warnings doesn't produce warnings that the return discards
2762 const. aver that the value and storage are the same since storage
2763 could potentially be NULL when value is not.
2764 * tests/testsuite.at (AT_CHECK): Treat an unspecified exit value the
2765 same as 0.
2766
7746c8f6
PE
27672006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2768
2769 * bootstrap.conf (excluded_files): Exclude m4/codeset.m4 (undoing
2770 the earlier change today), m4/intl.m4, m4/intldir.m4. This gives
2771 us a slightly cleaner distribution, and also works.
2772 * m4/.cvsignore: Add inline.m4, wint_t.m4 to accommodate recent
2773 gnulib changes.
2774
eb095650
PE
27752006-11-08 Joel E. Denny <jdenny@ces.clemson.edu>
2776 and Paul Eggert <eggert@cs.ucla.edu>
2777
2778 Don't let Bison leak memory except when it complains.
2779 * src/files.h (parser_file_name, spec_verbose_file, spec_graph_file):
2780 (spec_defines_file, dir_prefix): Now char *, not const char *,
2781 since they are freed.
2782 * src/files.c: Likewise.
2783 (all_but_ext, all_but_tab_ext, src_extension, header_extension):
2784 Likewise.
2785 (tr): Now operates in-place. All uses changed.
2786 (compute_exts_from_gf, compute_exts_from_src): Don't leak temporary
2787 values.
2788 (compute_file_name_parts, compute_output_file_names): Don't store
2789 read-only data in variables that will be freed.
2790 (compute_output_file_names): Free all_but_ext, all_but_tab_ext,
2791 src_extension, and header_extension.
2792 (output_file_names_free): New public function to free
2793 spec_verbose_file, spec_graph_file, spec_defines_file,
2794 parser_file_name, and dir_prefix.
2795 * src/getargs.c (getargs): Don't store read-only data in variables that
2796 will be freed.
2797 * src/main.c (main): Invoke output_file_names_free, code_scanner_free
2798 (which previously existed but was unused), and quotearg_free.
2799 * src/muscle_tab.h (muscle_insert): value arg is now a `char const *'.
2800 * src/muscle_tab.c: Likewise.
2801 (muscle_entry): Make the value char const *,
2802 and add a new storage member that is char * and can be freed.
2803 (muscle_entry_free): New private function.
2804 (muscle_init): Use it instead of free.
2805 (muscle_insert, muscle_grow): Update and use new storage member.
2806 (muscle_code_grow): Free the string passed to muscle_grow
2807 since it's not needed anymore.
2808 * src/parse-gram.y (%union): Make `chars' member a `char const *', and
2809 add a new `char *code' member.
2810 ("{...}"): Declare semantic type as code.
2811 * src/scan-code.h (translate_rule_action):
2812 (translate_symbol_action, translate_code, translate_action): Return
2813 `char const *' rather than `char *' since external code should not free
2814 these strings.
2815 * src/scan-code.l: Likewise.
2816 * src/scan-gram.l (<SC_BRACED_CODE>): Use val->code for BRACED_CODE,
2817 which is "{...}" in the parser.
2818 * tests/Makefile.am (maintainer-check-valgrind): Set
2819 VALGRIND_OPTS='--leak-check=full --show-reacheable=yes' before invoking
2820 Valgrind.
2821 * tests/calc.at (_AT_DATA_CALC_Y): fclose the FILE* so Valgrind doesn't
2822 complain.
2823 * tests/testsuite.at (AT_CHECK): Redefine so that running Bison and
2824 expecting a non-zero exit status sets --leak-check=summary and
2825 --show-reachable=no for Valgrind. Bison unabashedly leaks memory in
2826 this case, and we don't want to hear about it.
2827
ac564be4
PE
28282006-11-08 Paul Eggert <eggert@cs.ucla.edu>
2829
2830 * bootstrap (runtime-po/Makevars): Derive from po/Makevars
2831 instead of from the template, to simplify configuration a bit.
2832 * bootstrap.conf (excluded_files): Don't exclude m4/codeset.m4
2833 and m4/wint_t.m4, as they are needed with the latest gnulib.
2834
17bd8a73
JD
28352006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2836
2837 Disable unset/unused mid-rule value warnings by default, and recognize
2838 --warnings=midrule-values to enable them. Discussed starting at
2839 <http://lists.gnu.org/archive/html/help-bison/2006-10/msg00030.html>.
2840 * NEWS (2.3a+): Mention.
2841 * src/getargs.c, src/getargs.h (warnings_args, warnings_types, enum
2842 warnings): Add entry for midrule-values subargument.
2843 * src/reader.c (symbol_should_be_used): Don't return true just because
2844 the value is a set/used mid-rule value unless
2845 --warnings=midrule-values was specified.
2846 * tests/input.at (Unused values, Unused values before symbol
2847 declarations): Run tests with and without --warnings=midrule-values.
2848
2849 * src/reader.c (check_and_convert_grammar): Use symbol_list_free rather
2850 than LIST_FREE directly.
2851
89eb3c76
JD
28522006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2853
2854 Finish implementing --warnings=error, which should not be implied by
2855 --warnings=all (or by its synonyms -W and --warnings without
2856 subarguments).
2857 * src/complain.c (set_warning_issued): New function to report that
2858 warnings are being treated as errors and to record an error if so.
2859 Invoke...
2860 (warn_at, warn): ... here.
2861 * src/getargs.c (warnings_args, warnings_types): Reorder so that
2862 "error - warnings are errors" does not appear above "all - all of the
2863 above".
2864 (getargs): For -W and --warnings without subarguments, don't let
2865 FLAGS_ARGMATCH set warnings_error in warnings_flag.
2866 * src/getargs.h (enum warnings): Unset warnings_error in warnings_all.
2867
ba7560e2
JD
28682006-10-31 Joel E. Denny <jdenny@ces.clemson.edu>
2869
2870 * src/getargs.c (flags_argmatch): Don't cause segmentation fault for
2871 empty subargument list. For example: `bison --warnings= parser.y'.
2872
31283fc3
JD
28732006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2874
2875 * data/push.c, data/yacc.c: Make sure there's a newline at the end of
2876 the parser header file so that gcc doesn't warn.
2877
12e35840
JD
28782006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2879
2880 Split the default %destructor/%printer into two kinds: <*> and <!>.
2881 Discussed starting at
2882 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00060.html>.
2883 * NEWS (2.3a+): Mention.
2884 * doc/bison.texinfo (Freeing Discarded Symbols): Document this and the
2885 previous change today related to mid-rules.
148d66d8 2886 (Table of Symbols): Remove %symbol-default and add <*> and <!>.
3ebecc24 2887 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): Remove.
12e35840
JD
2888 (TYPE_TAG_ANY): Add as <*>.
2889 (TYPE_TAG_NONE): Add as <!>.
2890 (generic_symlist_item): Remove RHS for %symbol-default and add RHS's
2891 for <*> and <!>.
2892 * src/scan-gram.l (PERCENT_SYMBOL_DEFAULT): Remove.
2893 (TYPE_TAG_ANY, TYPE_TAG_NONE): Add.
2894 * src/symlist.c (symbol_list_default_new): Split into tagged and
2895 tagless versions.
2896 (symbol_list_destructor_set, symbol_list_printer_set): Split
2897 SYMLIST_DEFAULT case into SYMLIST_DEFAULT_TAGGED and
2898 SYMLIST_DEFAULT_TAGLESS.
2899 * src/symlist.h: Update symbol_list_default*_new prototypes.
2900 (symbol_list.content_type): Split enum value SYMLIST_DEFAULT into
2901 SYMLIST_DEFAULT_TAGGED and SYMLIST_DEFAULT_TAGLESS.
2902 * src/symtab.c (default_destructor, default_destructor_location,
2903 default_printer, default_printer_location): Split each into tagged and
2904 tagless versions.
2905 (symbol_destructor_get, symbol_destructor_location_get,
2906 symbol_printer_get, symbol_printer_location_get): Implement tagged
2907 default and tagless default cases.
2908 (default_destructor_set, default_printer_set): Split each into tagged
2909 and tagless versions.
2910 * src/symtab.h: Update prototypes.
2911 * tests/actions.at (Default %printer and %destructor): Rename to...
2912 (Default tagless %printer and %destructor): ... this, and extend.
2913 (Per-type %printer and %destructor): Rename to...
2914 (Default tagged and per-type %printer and %destructor): ... this, and
2915 extend.
2916 (Default %printer and %destructor for user-defined end token): Extend.
2917 (Default %printer and %destructor are not for error or $undefined):
2918 Update.
2919 (Default %printer and %destructor are not for $accept): Update.
2920 (Default %printer and %destructor for mid-rule values): Extend.
2921 * tests/input.at (Default %printer and %destructor redeclared): Extend.
2922 (Unused values with default %destructor): Extend.
2923
f91b1629
JD
29242006-10-21 Joel E. Denny <jdenny@ces.clemson.edu>
2925
2926 Don't apply the default %destructor/%printer to an unreferenced midrule
2927 value. Mentioned at
2928 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00104.html>.
2929 * src/symtab.c (dummy_symbol_get): Name all dummy symbols initially
2930 like $@n instead of just @n so that the default %destructor/%printer
2931 logic doesn't see them as user-defined symbols.
2932 (symbol_is_dummy): Check for both forms of the name.
2933 * src/reader.c (packgram): Remove the `$' from each midrule symbol
2934 name for which the midrule value is referenced in any action.
2935 * tests/actions.at (Default %printer and %destructor for mid-rule
2936 values): New test.
2937 * tests/regression.at (Rule Line Numbers, Web2c Report): Update output
2938 for change to dummy symbol names.
2939
519d0004
JD
29402006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2941
2942 Warn about unset midrule $$ if the corresponding $n is used.
2943 * src/reader.c (symbol_should_be_used): Check midrule parent rule for
2944 $n usage.
2945 (packgram): Before invoking grammar_rule_check on any rule, make sure
2946 all actions have already been scanned in order to set `used' flags.
2947 Otherwise, checking that a midrule's $$ is set will not always work
2948 properly because the midrule check must forward-reference the midrule's
2949 parent rule.
2950 * tests/input.at (AT_CHECK_UNUSED_VALUES): Extend to check the new
2951 warning.
2952
a501eca9
JD
29532006-10-20 Joel E. Denny <jdenny@ces.clemson.edu>
2954
2955 More improvements to the documentation of the prologue alternatives:
2956 * NEWS (2.3a+): Mention the new `Prologue Alternatives' section in the
2957 Bison manual.
2958 * doc/bison.texinfo (Prologue Alternatives): Correct some errors. Add
2959 some text to clarify the relative importance of the new directives and
2960 to show how these directives may be viewed as code labels.
2961
2cbe6b7f
JD
29622006-10-16 Joel E. Denny <jdenny@ces.clemson.edu>
2963
2964 Similar to the recently removed %before-header, add %code-top as the
2965 alternative to the pre-prologue. Mentioned at
2966 <http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00063.html>.
2967 Also, let the prologue alternatives appear in the grammar section.
2968 * src/parse-gram.y (PERCENT_CODE_TOP): New token.
2969 (prologue_declaration): Move the existing prologue alternatives to...
2970 (grammar_declaration): ... here and add %code-top.
2971 * src/scan-gram.l (PERCENT_CODE_TOP): New token.
2972
2973 Clean up and extend documentation for the prologue alternatives.
2974 * NEWS (2.3a+): Describe prologue alternatives.
2975 * doc/bison.texinfo (Prologue): Move discussion of prologue
2976 alternatives to...
2977 (Prologue Alternatives): ... this new section, and extend it to discuss
2978 all 4 directives in detail.
148d66d8
JD
2979 (Table of Symbols): Clean up discussion of prologue alternatives and
2980 add %code-top.
2cbe6b7f 2981
e557d3ea
JMG
29822006-10-16 Juan Manuel Guerrero <juan.guerrero@gmx.de>
2983
2984 DJGPP specific issues.
2985
2986 * djgpp/config.bat: config.hin has been moved to lib. Adjust
2987 config.bat accordingly.
2988 * djgpp/config.sed: Adjust config.sed for the use of autoconf 2.60.
2989 * djgpp/config.site: Likewise.
2990
136a0f76
PB
29912006-10-16 Paolo Bonzini <bonzini@gnu.org>
2992
27bd5d67
PB
2993 Replace %*-header with %provides, %requires, %code. See discussion at
2994 http://lists.gnu.org/archive/html/bison-patches/2006-10/msg00002.html
2995
136a0f76
PB
2996 * data/bison.m4 (b4_user_requires, b4_user_provides): New.
2997 (b4_user_start_header): Remove.
2998 * data/glr.c: Use new macros instead of b4_*start_header
2999 and b4_*end_header.
3000 * data/glr.cc: Likewise.
3001 * data/lalr1.cc: Likewise.
3002 * data/push.c: Likewise.
3003 * data/yacc.c: Likewise.
3004
3005 * doc/bison.texinfo: Remove %before-header, rename
3006 %{start,end,after}-header to %requires, %provides, %code.
3007
3008 * src/parse-gram.y: Likewise (also rename token names accordingly).
3009 * src/scan-gram.l: Likewise.
3010 * tests/actions.at: Likewise.
3011
10f429ef
PE
30122006-10-14 Paul Eggert <eggert@cs.ucla.edu>
3013
3014 * lib/Makefile.am (AM_CFLAGS): Remove $(WERROR_CFLAGS).
3015 Problem reported by Joel E. Denny.
3016
30172006-10-14 Jim Meyering <jim@meyering.net>
3018
3019 (Sync from coreutils.)
3020 Work also when the working directory (with e.g. coreutils sources)
3021 is version controlled with git, rather than CVS.
3022 * bootstrap (CVS_only_file): Test for the existence of README-cvs,
3023 rather than CVS.
3024 In messages and comments, say e.g., "checked-out sources",
3025 rather than "CVS sources".
3026 (version_controlled_file): New function. Work for git as well as
3027 for CVS. Don't use grep's -q option.
3028 (slurp): Call it here, in place of CVS-specific code.
3029
c4bd5bf7
JD
30302006-10-14 Joel E. Denny <jdenny@ces.clemson.edu>
3031
3032 Fix testsuite for ./configure --enable-gcc-warnings:
3033 * configure.ac (gcc-warnings): Move -Wall before -Wno-sign-compare.
3034 Otherwise, gcc 4.1.0 (at least) warns about sign comparisons in
3035 __AT_CHECK_PRINTER_AND_DESTRUCTOR in tests/actions.at.
3036 * test/input.at (Torturing the Scanner): #include <stdlib.h> for abort.
3037 * test/regression.at (Diagnostic that expects two alternatives):
3038 Likewise.
3039
46356ea4
PE
30402006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3041
231ed89a
PE
3042 * bootstrap.conf (gnulib_modules): Add config-h.
3043 * djgpp/subpipe.c: Include <config.h> unconditionally; don't
3044 worry about HAVE_CONFIG_H.
3045 * lib/abitset.c: Likewise.
3046 * lib/bitset.c: Likewise.
3047 * lib/bitset_stats.c: Likewise.
3048 * lib/bitsetv-print.c: Likewise.
3049 * lib/bitsetv.c: Likewise.
3050 * lib/ebitset.c: Likewise.
3051 * lib/get-errno.c: Likewise.
3052 * lib/lbitset.c: Likewise.
3053 * lib/subpipe.c: Likewise.
3054 * lib/timevar.c: Likewise.
3055 * lib/vbitset.c: Likewise.
3056 * lib/bitset.c: Include "bitset.h" first, to test interface.
3057 * lib/bitset_stats.c: Include "bitset_stats.h" first.
3058 * lib/bitsetv-print.c: Include "bitsetv-print.h" first.
3059 * lib/bitsetv.c: Include "bitsetv.h" first.
3060 * lib/get-errno.c: Include "get-errno.h" first.
3061 * m4/.cvsignore: Add config-h.m4.
3062 * tests/actions.at (Default %printer and %destructor for ...):
3063 Adjust expected line numbers in output to reflect removal of #if
3064 HAVE_CONFIG_H lines.
3065 * tests/glr-regression.at (Missed %merge type warnings when ...):
3066 Likewise.
3067 * tests/regression.at (Braced code in declaration in rules section):
3068 Likewise.
3069 * tests/atlocal.in (CPPFLAGS): Don't define HAVE_CONFIG_H.
3070 * tests/local.at (AT_DATA_GRAMMAR_PROLOGUE):
3071 Include <config.h> unconditionally.
3072
46356ea4
PE
3073 * bootstrap: Sync from coreutils, as follows:
3074
3075 2006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3076
3077 * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
3078 variable was sometimes used without being initialized. This
3079 messed up the installation of the INSTALL file in some cases.
3080
3081 2006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3082
3083 * bootstrap (usage, main program, symlink_to_gnulib): Add option
3084 --copy. Inspired by a suggestion from Bruno Haible.
3085
3086 2006-10-03 Jim Meyering <jim@meyering.net>
3087
3088 * bootstrap: Undo last change to this file, since now gnulib-tool
3089 sticks with the automake default in generating dependencies.
3090
dd4bf078
PE
30912006-10-12 Paul Eggert <eggert@cs.ucla.edu>
3092
cf2a5f7c
PE
3093 * configure.ac: Use AC_PROG_CC_STDC; this is more modern than
3094 the old AC_PROG_CC / AM_PROG_CC_STDC combination.
3095
3096 * doc/bison.1: Add copyright notice.
3097
3098 * data/glr.c: Don't include <stdarg.h>; not used.
3099
35fe0834
PE
3100 * NEWS: The -g and --graph options now output graphs in Graphviz
3101 DOT format, not VCG format.
3102 * doc/bison.1: Likewise.
3103 * doc/bison.texinfo (Understanding, Bison Options): Likewise.
fcab4a2e
PE
3104 * THANKS: Add Satya Kiran Popuri, who proposed the initial version
3105 of this change in
3106 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00158.html>.
35fe0834
PE
3107 * TODO: Remove Graphviz entry.
3108 * src/Makefile.am (bison_SOURCES): Add graphviz.c and graphviz.h;
3109 remove vcg.c, vcg.h, vcg_defaults.h.
3110 * src/vcg.c, src/vcg.h, src/vcg_defaults.h: Remove.
3111 * src/graphviz.c, src/graphviz.h: New files.
3112 * src/files.c (compute_output_file_names): Output .dot, not .vcg.
3113 * src/files.h: Make comment more generic.
3114 * src/main.c (main): Likewise.
3115 * src/print_graph.h: Likewise.
3116 * src/getargs.c (usage): Make usage description more generic.
3117 * src/print_graph.c: Include graphviz.h rather than vcg.h.
3118 (static_graph, fgraph): Remove. All uses changed to pass
3119 arguments instead of sharing a static var.
3120 (print_core, print_actions, print_state, print_graph):
3121 Output graphviz format rather than VCG format.
3122 * tests/.cvsignore: Remove *.vcg; add *.dot.
3123 * tests/output.at: Expect *.dot files, not *.vcg files.
3124
dd4bf078
PE
3125 * data/Makefile.am (dist_pkgdata_DATA): Add bison.m4; this
3126 accommodates the 2006-10-08 change.
3127
efdd7421
PE
31282006-10-11 Bob Rossi <bob@brasko.net>
3129
3130 * data/push.c (yypushparse, yypvarsinit, yypvars): Wrap in b4_push_if.
3131 (b4_yyssa, b4_yyerror_range): New macros.
3132 (struct yypvars): Remove yyssa_ptr and yyerror_range_ptr fields.
3133 (yypvarsinit): Remove init of removed fields.
3134 (yypushparse): Remove use of removed fields; use new macros instead.
3135
96a1981a
PE
31362006-10-11 Paul Eggert <eggert@cs.ucla.edu>
3137
3138 * data/push.c (yypushparse): Fix memory leak if yymsg is malloced
3139 in a push parser. Reindent slightly to match yacc.c better.
3140
31412006-10-11 Bob Rossi <bob@brasko.net>
3142
46356ea4
PE
3143 * data/push.c (struct yypvars): Remove yymsgbuf, yymsgbuf_ptr, yymsg,
3144 yymsg_alloc fields.
3145 (yypvarsinit, yypushparse): Remove init of removed fields.
3146 (yypushparse): Use yymsgbuf instead of yymsgbuf_ptr.
96a1981a 3147
c1630a8b
PE
31482006-10-09 Paul Eggert <eggert@cs.ucla.edu>
3149
3150 * THANKS: Add Paolo Bonzini and Bob Rossi.
3151
90b9908d
PB
31522006-10-08 Paolo Bonzini <bonzini@gnu.org>
3153
3154 * data/c.m4 (b4_copyright, b4_epilogue, b4_location_initial_column,
3155 b4_location_initial_line, p4_parse_param, b4_ints_in, b4_flag_if,
3156 b4_define_flag_if and uses, b4_basename, b4_syncline, b4_user_code,
3157 b4_define_user_cde and uses): Remove.
3158 (b4_comment, b4_prefix, b4_sync_start): New.
3159 * data/bison.m4: New file, with most of the content removed from c.m4.
3160 * src/muscle_tab.h: Use "do {...} while(0)" throughout.
3161 * src/output.c (output_skeleton): Pass bison.m4.
3162 (prepare): Pass glr_flag and nondeterministic_flag. Pass prefix
3163 only if specified.
3164
cf806753
PE
31652006-10-05 Paul Eggert <eggert@cs.ucla.edu>
3166
3167 Fix test failure reported by Tom Lane in
3168 <http://lists.gnu.org/archive/html/bug-bison/2006-10/msg00000.html>
3169 and try to make such failures easier to catch in the future.
3170 * data/glr.c (YYTRANSLATE): Don't check for nonpositive arg;
3171 that's now the caller's responsibility.
3172 (yyprocessOneStack, yyrecoverSyntaxError, yyparse):
3173 Set yychar = YYEOF if it's negative.
3174 * tests/actions.at (yylex): Abort if asked to read past EOF.
3175 * tests/conflicts.at (yylex): Likewise.
3176 * tests/cxx-type.at (yylex): Likewise.
3177 * tests/glr-regression.at (yylex): Likewise.
3178 * tests/input.at (yylex): Likewise.
3179 * tests/regression.at (yylex): Likewise.
3180 * tests/torture.at (yylex): Likewise.
3181
0e2f006a
PE
31822006-10-01 Paul Eggert <eggert@cs.ucla.edu>
3183
3184 Fix problems with translating English-language diagnostics.
3185 * bootstrap: Fix bug introduced in recent bootstrap changes, with
3186 respect to bison-runtime pot generation. The YY_ stuff
3187 wasn't being captured.
3188 * bootstrap.conf (XGETTEXT_OPTIONS_RUNTIME): New var.
3189 * po/POTFILES.in: Add src/location.c, src/scan-code.l.
3190 * runtime-po/POTFILES.in: Add data/push.c.
3191
e3ddc1e3
PE
31922006-09-29 Paul Eggert <eggert@cs.ucla.edu>
3193
3194 Merge bootstrap changes from coreutils.
3195
3196 2006-09-28 Jim Meyering <jim@meyering.net>
3197
3198 Automatically generated dependencies are important even
3199 when all of the sources in a directory come from gnulib.
3200 * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
3201 option that gnulib-tool adds to what becomes our lib/gnulib.mk.
3202
3203 2006-09-23 Jim Meyering <jim@meyering.net>
3204
3205 * bootstrap (gnulib_tool_options): Add "--local-dir gl".
3206
3207 2006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3208
3209 * bootstrap: Add support for --force.
3210 (usage): New function. Describe usage less tersely.
3211 (CVS_only_file): New var.
3212
01e972b3
PE
32132006-09-21 Paul Eggert <eggert@cs.ucla.edu>
3214
3215 * data/push.c (YYPUSH_MORE): Make it an enum instead.
3216 (yypushparse): Use YYPUSH_MORE instead of the mystery constant.
3217 Adjust white space and comments to match GNU style better.
3218
c63d3e90
PE
32192006-09-20 Bob Rossi <bob@brasko.net>
3220
3221 * data/push.c (yyresult_get): Remove function.
3222 (YYPUSH_MORE): Add #define.
3223 (yypushparse): Modify return value.
3224
e70f46d1
PE
32252006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3226
3227 * stamp-h.in: Remove; no longer needed.
3228 * .cvsignore: Replace autom4te.cache and config.cache with *.cache.
3229 Remove config.h, config.hin, intl (no longer created).
3230 * lib/.cvsignore: Add config.h, config.hin, configmake.h, inttypes.h,
3231 stamp-h1.
3232
3233 Sync bootstrap from coreutils, as follows:
3234
3235 2006-09-18 Paul Eggert <eggert@cs.ucla.edu>
3236
3237 * bootstrap (symlink_to_gnulib): New function.
3238 (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
3239 to copies-of-gnulib.
3240 (cp_mark_as_generated, slurp, gnulib_files):
3241 Avoid making a copy if it's the same as the old version.
3242 (gnulib_files): Add support for this variable (used by Bison).
3243
a92be413
PE
32442006-09-20 Paul Eggert <eggert@cs.ucla.edu>
3245
3246 * src/getargs.c (usage): Rework to use conventions similar to
3247 coreutils, to make translation a bit easier and the code a bit
3248 smaller. Problem reported by Tim Van Holder.
3249
4f82b42a
PE
32502006-09-15 Paul Eggert <eggert@cs.ucla.edu>
3251
3b2942e6
PE
3252 Use some of gnulib's new modules, taken from coreutils.
3253
3254 * bootstrap: Sync from coreutils, except add support for gnulib_files.
3255 * bootstrap.conf: New file.
3256 (gnulib_modules): Add configmake, inttypes, unistd.
3257 (XGETTEXT_OPTIONS): Add complain, complain_at,
3258 fatal, fatal_at, warn, warn_at, unexpected_end.
3259 * configure.ac (AC_CONFIG_HEADERS): config.h is now in lib, not here.
3260 (gl_USE_SYSTEM_EXTENSIONS): Remove; gl_EARLY now does this.
3261 (gl_EARLY): Add.
3262 (AM_STDBOOL_H): Remove; gl_INIT now dows this.
3263 (gl_INIT): Add
3264 (GNULIB_AUTOCONF_SNIPPET): Remove.
3265 (AM_GNU_GETTEXT): Add; require formatstring macros since that's
3266 the pickiest.
3267 * lib/.cvsignore: Add inttypes_.h.
3268 * lib/Makefile.am: Include gnulib.mk first so we can append to it.
3269 (AM_CFLAGS): Add WERROR_CFLAGS, to be more like coreutils.
3270 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES): Remove
3271 no-longer-necessary initializations.
3272 (lib_SOURCES): Remove, replacing by libbison_a_SOURCES.
3273 * lib/subpipe.c: Include <unistd.h> unconditionally, now that we
3274 use the unistd module.
3275 * src/system.h: Likewise.
3276 * m4/.cvsignore: Remove *_gl.m4, gnulib.m4, inttypes_h.m4, uintmax_t.m4,
3277 ulonglong.m4. Add gettext.m4, gnulib-cache.m4, gnulib-comp.m4,
3278 gnulib-tool.m4, inttypes-h.m4, inttypes-pri.m4, inttypes.m4.
3279 * src/Makefile.am (DEFS): Remove, since configmake does this for us.
3280 (AM_CPPFLAGS): Remove -I../lib, since Automake does that for us.
3281 * src/system.h: Include inttypes.h unconditionally, now that we
3282 use the inttypes module. Don't bother to include stdint.h, since
3283 inttypes.h now does that for us.
3284 (LOCALEDIR): Remove, now that we use the configmake module.
3285 * src/getargs.c: Include configmake.h.
3286 * src/main.c: Likewise.
3287 * src/output.c: Likewise.
3288 * tests/atlocal.in (CPPFLAGS): Include from $abs_top_builddir/lib,
3289 not from $abs_top_builddir, since config.h moved.
3290
3291
4f82b42a
PE
3292 Port to GCC 2.95. First two problems reported by Michael Deutschmann in
3293 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00018.html>.
3294
3295 * src/parse-gram.y (symbol_declaration): Don't put statements
3296 before declarations; it's not portable to C89.
3297 * src/scan-code.l (handle_action_at): Likewise.
3298
3299 * src/scan-code.l: Always initialize braces_level; the old code
3300 left it uninitialized and therefore had undefined behavior.
3301
3302 Don't attempt to redefine 'assert', since it runs afoul of
3303 systems where standard headers (mistakenly) include <assert.h>.
3304 Instead, define and use our own alternative, called 'aver'.
3305 * src/reader.c: Don't include assert.h, since we no longer
3306 use assert.
3307 * src/scan-code.l: Likewise.
3308 * src/system.h (assert): Remove, replacing with....
3309 (aver): New function, taking a bool arg. All uses changed.
3310 * src/tables.c (pack_vector): Ensure that aver arg is bool,
3311 not merely an integer.
3312
31c10e38
PE
33132006-09-15 Bob Rossi <bob@brasko.net>
3314
3315 * data/Makefile.am (dist_pkgdata_DATA): Add push.c.
3316 * data/c.m4 (YYPUSH): New.
3317 (b4_push_if): New macro. Use it instead of #ifdef YYPUSH.
3318 * src/getargs.c (push_parser): New var.
3319 * src/getargs.h (push_parser): New declaration.
3320 * src/output.c (prepare): Add macro insertion of `push_flag'.
3321 * src/parse-gram.y (PERCENT_PUSH_PARSER): New token.
3322 (prologue_declaration): Parse %push-parser.
3323 * src/scan-gram.l: Scan new PERCENT_PUSH_PARSER token.
3324 * tests/calc.at (_AT_CHECK_CALC_ERROR): Add "Return" and "Now" to
3325 list of removed lines from the traces observed.
3326 (AT_CHECK_CALC_LALR): Added push parser tests.
3327
fa7b79c0
PE
33282006-09-13 Paul Eggert <eggert@cs.ucla.edu>
3329
21fe08ca
PE
3330 * NEWS: Version 2.3a.
3331 * configure.ac (AC_INIT): Likewise.
3332
e8ec4d9b
PE
3333 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Remove
3334 "#define YYSTYPE int" that caused "make maintainer-check" to fail
3335 due to header ordering dependencies. I don't know why the #define
3336 was there.
3337
fa7b79c0
PE
3338 Fix glr.cc and lalr1.cc's use of YYDEBUG so that there's zero
3339 runtime cost when YYDEBUG is not defined, and so that some tests
3340 that used to fail now work. Problem and initial suggestion by
3341 Paolo Bonzini.
3342 * data/c++.m4 (b4_parse_param_cons): Omit leading ','.
3343 * data/glr.cc (b4_parser_class_name):
3344 Initialize yycdebug_ only if YYDEBUG. Also, initialize yydebug_.
3345 (debug_level, set_debug_level): Affect yydebug_, not ::yydebug.
3346 (yydebug_) [YYDEBUG]: New member.
3347 (yycdebug_): Now defined only if YYDEBUG.
3348 * data/lalr1.cc (yydebug_, yycdebug_): Now defined only if YYDEBUG.
3349 (YYCDEBUG) [!YYDEBUG]: Don't use yydebug_ and yycdebug_.
3350 (b4_parser_class_name): Initialize yydebug_ and yycdebug_ only
3351 if YYYDEBUG.
3352 (debug_stream, set_debug_stream, debug_level, set_debug_level):
3353 Define only if YYDEBUG.
3354 * tests/calc.at (_AT_DATA_CALC_Y) [!YYDEBUG]: Omit call to
3355 set_debug_level.
3356 * tests/regression.at (_AT_DATA_DANCER_Y) [!YYDEBUG]: Likewise.
3357 * tests/calc.at (AT_CHECK_CALC_GLR_CC): Uncomment calls to
3358 AT_CHECK_CALC_GLR_CC that are working now.
3359
4ec13d60
PE
33602006-09-12 Paul Eggert <eggert@cs.ucla.edu>
3361
3362 * data/glr.cc (YYERROR_VERBOSE, YYTOKEN_TABLE): Remove.
3363 We don't need them in glr.cc, and glr.c defines them.
3364 Defining YYERROR_VERBOSE to 0 here breaks glr.c, since glr.c
3365 assumes that defining it to anything is the same as defining
3366 it to 1. Problem reported by Paolo Bonzini.
3367
8e1687ae
PE
33682006-09-12 Paolo Bonzini <bonzini@gnu.org> (tiny change)
3369
3370 * data/c.m4 (b4_null, b4_case): Define.
3371 * src/output.c (prepare_symbols): Use b4_null.
3372 (user_actions_output): Use b4_case.
3373
3dc5e96b
PE
33742006-09-11 Paul Eggert <eggert@cs.ucla.edu>
3375
aef3da86
PE
3376 * data/glr.c (b4_shared_declarations): Put start-header first,
3377 before any #includes that we generate, so that feature-test
3378 macros work. Problem reported by Michael Deutschmann in
3379 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00004.html>.
3380 * data/lalr1.cc: Likewise.
3381 * doc/bison.texinfo (Prologue): Document that feature-test macros
3382 should be defined before any Bison declarations.
3383 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Put defns
3384 that depend on location.hh after, not before, Bison decls, since
3385 we now include location.hh after the first user prologue.
3386
3dc5e96b
PE
3387 * doc/bison.texinfo (Calc++ Parser): Fix memory leak reported by
3388 Sander Brandenburg in
3389 <http://lists.gnu.org/archive/html/bug-bison/2006-09/msg00002.html>.
3390 Also, fix minor white space and comment issues.
aef3da86
PE
3391 (Prologue): Mention that it's better to define feature-test macros
3392 before Bison declarations. Problem reported by Michael Deutschmann.
3393
3394 * README-cvs: Fix typo: "&" should be "&&". Problem reported
3395 by Jim Meyering.
3396 * m4/.cvsignore: Add argmatch.m4. Remove obstack.m4, strerror_r.m4.
3397 This adjusts to recent gnulib changes.
3dc5e96b 3398
b2a0b7ca
JD
33992006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3400
3401 Finish implementation of per-type %destructor/%printer. Discussed
3402 starting at
3403 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>
3404 and
3405 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>.
3406 * NEWS (2.3+): Add a description of this feature to the default
3407 %destructor/%printer description.
3408 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise.
3409 * src/symlist.c (symbol_list_destructor_set, symbol_list_printer_set):
3410 Invoke semantic_type_destructor_set or semantic_type_printer_set when a
3411 list node contains a semantic type.
3412 * src/symtab.c, src/symtab.h: Extend with a table that associates
3413 semantic types with their %destructor's and %printer's.
3414 (semantic_type_from_uniqstr, semantic_type_get,
3415 semantic_type_destructor_set, semantic_type_printer_set): New functions
3416 composing the public interface of that table.
3417 (symbol_destructor_get, symbol_destructor_location_get,
3418 symbol_printer_get, symbol_printer_location_get): If there's no
3419 per-symbol %destructor/%printer, look up the per-type before trying
3420 the default.
3421 * tests/actions.at (Per-type %printer and %destructor): New test case.
3422 * tests/input.at (Default %printer and %destructor redeclared):
3423 Extend to check that multiple occurrences of %symbol-default in a
3424 single %destructor/%printer declaration is an error.
3425 (Per-type %printer and %destructor redeclared, Unused values with
3426 per-type %destructor): New test cases.
3427
3be03b13
JD
34282006-09-04 Joel E. Denny <jdenny@ces.clemson.edu>
3429
3430 Require default %destructor/%printer to be declared using
3431 %symbol-default instead of an empty symbol list, and start working on
3432 new per-type %destructor/%printer. Discussed at
3433 <http://lists.gnu.org/archive/html/bison-patches/2006-09/msg00007.html>.
3434 * NEWS (2.3+): Add %symbol-default to example.
3435 * bison.texinfo (Freeing Discarded Symbols): Likewise.
148d66d8 3436 (Table of Symbols): Add entry for %symbol-default.
3be03b13
JD
3437 * src/parse-gram.y (PERCENT_SYMBOL_DEFAULT): New token.
3438 (generic_symlist, generic_symlist_item): New nonterminals for creating
3439 a list in which each item is a symbol, semantic type, or
3440 %symbol-default.
3441 (grammar_declaration): Use generic_symlist in %destructor and %printer
3442 declarations instead of symbols.1 or an empty list.
3443 (symbol_declaration, precedence_declaration, symbols.1): Update actions
3444 for changes to symbol_list.
3445 * src/reader.c: Update for changes to symbol_list.
3446 * src/scan-code.l: Likewise.
3447 * src/scan-gram.l: Scan new PERCENT_SYMBOL_DEFAULT token.
3448 * src/symlist.c, src/symlist.h: Extend such that a list node may
3449 represent a semantic type or a %symbol-default in addition to just an
3450 ordinary symbol. Add switched functions for setting %destructor's and
3451 %printer's.
3452 * tests/actions.at, tests/input.at: Add %symbol-default to all default
3453 %destructor/%printer declarations.
3454
3508ce36
JD
34552006-08-23 Joel E. Denny <jdenny@ces.clemson.edu>
3456
3457 Whether the default %destructor/%printer applies to a particular symbol
3458 isn't a question of whether the user *declares* that symbol (in %token,
3459 for example). It's a question of whether the user by any means
3460 *defines* the symbol at all (by simply using a char token, for
3461 example). $end is defined by Bison whereas any other token with token
3462 number 0 is defined by the user. The error token is always defined by
3463 Bison regardless of whether the user declares it with %token, but we
3464 may one day let the user define error as a nonterminal instead.
3465 * NEWS (2.3+): Say "user-defined" instead of "user-declared".
3466 * doc/bison.texinfo (Freeing Discarded Symbols): Likewise, and document
3467 the meaning of "user-defined".
3468 * tests/actions.at (Default %printer and %destructor for user-declared
3469 end token): Rename to...
3470 (Default %printer and %destructor for user-defined end token): ...
3471 this.
3472
3473 * src/symtab.c (symbol_destructor_get, symbol_printer_get): In the
3474 computation of whether to apply the default, don't maintain a list of
3475 every Bison-defined symbol. Instead, just check for a first character
3476 of '$', which a user symbol cannot have, and check for the error token.
3477
9350499c
JD
34782006-08-21 Joel E. Denny <jdenny@ces.clemson.edu>
3479
3480 Don't apply the default %destructor or %printer to the error token,
3481 $undefined, or $accept. This change fits the general rule that the
3482 default %destructor and %printer are only for user-declared symbols,
3483 and it solves several difficulties that are described in the new test
3484 cases listed below.
3485 * src/symtab.c (symbol_destructor_get, symbol_printer_get): Implement.
3486 * tests/actions.at (Default %printer and %destructor are not for error
3487 or $undefined, Default %printer and %destructor are not for $accept):
3488 New test cases.
3489
4d7370cb
JD
34902006-08-19 Joel E. Denny <jdenny@ces.clemson.edu>
3491
3492 Allow %start after the first rule.
3493 * src/reader.c (grammar_current_rule_begin): Don't set the start symbol
3494 when parsing the first rule.
3495 (check_and_convert_grammar): Search for it here after all grammar
3496 declarations have been parsed. Skip midrules, which have dummy LHS
3497 nonterminals.
3498 * src/symtab.c (symbol_is_dummy): New function.
3499 * src/symtab.h (symbol_is_dummy): Declare it.
3500 * tests/input.at (%start after first rule): New test.
3501
6d0ef4ec
JD
35022006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3503
3504 Redo some of the previous commit: add back the ability to use
3505 non-aliased/undeclared string literals since it might be useful to
3506 those declaring %token-table.
3507 * src/reader.c (check_and_convert_grammar): Undo changes in previous
3508 commit: don't worry about complaints from symbols_pack.
3509 * src/symtab.c (symbol_new, symbol_class_set,
3510 symbol_check_alias_consistency): Undo changes in previous commit: count
3511 each string literal as a new symbol and token, assign it a symbol
3512 number, and don't complain about non-aliased string literals.
3513 (symbols_pack): Since symbol_make_alias still does not decrement symbol
3514 and token counts but does still set aliased tokens to the same number,
3515 symbol_pack_processor now leaves empty slots in the symbols array.
3516 Remove those slots.
3517 * tests/regression.at (Undeclared string literal): Remove test case
3518 added in previous commit since non-aliased string literals are allowed
3519 again.
3520 (Characters Escapes, Web2c Actions): Undo changes in previous commit:
3521 remove unnecessary string literal declarations.
3522 * tests/sets.at (Firsts): Likewise.
3523
965537bc
JD
35242006-08-18 Joel E. Denny <jdenny@ces.clemson.edu>
3525
3526 Don't allow an undeclared string literal, but allow a string literal to
3527 be used before its declaration.
3528 * src/reader.c (check_and_convert_grammar): Don't invoke packgram if
3529 symbols_pack complained.
3530 * src/symtab.c (symbol_new): Don't count a string literal as a new
3531 symbol.
3532 (symbol_class_set): Don't count a string literal as a new token, and
3533 don't assign it a symbol number since symbol_make_alias does that.
3534 (symbol_make_alias): It's not necessary to decrement the symbol and
3535 token counts anymore. Don't assume that an alias declaration occurs
3536 before any uses of the identifier or string, and thus don't assert that
3537 one of them has the highest symbol number so far.
3538 (symbol_check_alias_consistency): Complain if there's a string literal
3539 that wasn't declared as an alias.
3540 (symbols_pack): Bail if symbol_check_alias_consistency failed since
3541 symbol_pack asserts that every token has been assigned a symbol number
3542 although undeclared string literals have not.
3543 * tests/regression.at (String alias declared after use, Undeclared
6d0ef4ec 3544 string literal): New test cases.
965537bc
JD
3545 (Characters Escapes, Web2c Actions): Declare string literals as
3546 aliases.
3547 * tests/sets.at (Firsts): Likewise.
3548
47aee066
JD
35492006-08-14 Joel E. Denny <jdenny@ces.clemson.edu>
3550
3551 In the grammar scanner, STRING_FINISH unclosed constructs and return
3552 them to the parser in order to improve error messages.
3553 * src/scan-gram.l (SC_ESCAPED_STRING, SC_ESCAPED_CHARACTER,
3554 SC_BRACED_CODE, SC_PROLOGUE): Implement.
3555 * tests/input.at (Unclosed constructs): New test case.
3556 * tests/regression.at (Invalid inputs): Update now that unclosed %{ is
3557 seen.
3558
3559 * src/scan-gram.h, src/scan-gram.l (gram_last_braced_code_loc): Remove
3560 unused global.
3561
1f6b3679
JD
35622006-08-13 Joel E. Denny <jdenny@ces.clemson.edu>
3563
3564 Handle string aliases for character tokens correctly.
3565 * src/symtab.c (symbol_user_token_number_set): If the token has an
3566 alias, check and set its alias's user token number instead of its own,
3567 which is set to indicate the alias. Previously, every occurrence of
3568 the character token in the grammar overwrote that alias indicator with
3569 the character code.
3570 * tests/input.at (String aliases for character tokens): New test.
3571
219741d8
JD
35722006-08-12 Joel E. Denny <jdenny@ces.clemson.edu>
3573
3574 * src/parse-gram.y: Add `%expect 0' so we don't overlook conflicts.
3575
11daa4e7
PE
35762006-08-11 Paul Eggert <eggert@cs.ucla.edu>
3577
3578 * bootstrap: Put in need-ngettext argument to AM_GNU_GETTEXT,
3579 to prevent failures when building on older platforms.
3580 Check for autopoint failure.
3581 Set XGETTEXT_OPTIONS to values that check for C format strings,
3582 so that translators are warned about them (this also helps
3583 prevent core dumps).
3584
3585 * lib/subpipe.c (create_subpipe): Use new gnulib pipe_safer
3586 function, since it simplifies our code a bit.
3587
3588 * configure.ac (AC_ARG_ENABLE): Use -Wextra -Wno-sign-compare
3589 rather than -W, so we don't get bogus warnings about sign comparisons.
3590 Add -Wpointer-arith, since that warning is useful (it reports code
3591 that does not conform to C89 and that some compilers reject).
3592 * data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c: Undo latest change,
3593 since it's no longer needed.
3594
f9bfc42a
JD
35952006-08-10 Joel E. Denny <jdenny@ces.clemson.edu>
3596
3597 Clean up scanners a bit.
3598 * src/flex-scanner.h (FLEX_NO_OBSTACK): New macro that blocks obstack
3599 definitions so gcc won't warn when obstack_for_string is unused.
3600 * src/scan-code.l: config.h and system.h are already #include'd by
3601 scan-code-c.c, so get rid of them here.
3602 * src/scan-gram.l: Likewise.
3603 * src/scan-skel.l: Likewise, and use flex-scanner.h without obstack
3604 definitions rather than duplicating the rest of it.
3605 * src/scan-gram-c.c, scan-skel-c.c: #include "system.h".
3606
06e8700a
JD
36072006-08-09 Joel E. Denny <jdenny@ces.clemson.edu>
3608
3609 Suppress signed/unsigned comparison warnings for yycheck.
3610 * data/c.m4 (b4_safest_int_type): New macro.
3611 * data/glr.c, data/lalr1.cc: Wherever you compare yycheck[i] against
3612 a signed int type, cast it to b4_safest_int_type first.
3613 * data/yacc.c: Likewise.
3614 (b4_safest_int_type): Overwrite the one from c.m4 since b4_int_type is
3615 also overwritten.
3616
9c437126
PE
36172006-08-09 Ralf Wildenhues <Ralf.Wildenhues@gmx.de> (tiny change)
3618
3619 * doc/bison.texinfo: Fix some typos.
3620
284d8a13
PE
36212006-08-02 Paul Eggert <eggert@cs.ucla.edu>
3622
3623 * m4/.cvsignore: Add inttypes_h.m4,lib-ld.m4, lib-prefix.m4,
3624 po.m4, stdint_h.m4, uintmax_t.m4, ulonglong.m4, warning.m4.
3625
3626 * bootstrap (gnulib_tool): Stop using --assume-autoconf;
3627 the latest gnulib does this a different way.
3628 (get_translations): Sharuzzaman Ahmat Raslan reported that the ms
3629 translation was patched, so stop omitting it.
3630
ec5479ce
JD
36312006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3632
3633 Enable declaration of default %printer/%destructor. Make the parser
3634 use these for all user-declared grammar symbols for which the user does
3635 not declare a specific %printer/%destructor. Thus, the parser uses it
3636 for token 0 if the user declares it but not if Bison generates it as
3637 $end. Discussed starting at
3638 <http://lists.gnu.org/archive/html/bison-patches/2006-02/msg00064.html>,
3639 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00091.html>,
3640 and
3641 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>.
3642 * NEWS (2.3+): Mention.
3643 * doc/bison.texinfo (Actions in Mid-Rule): It's no longer impossible to
3644 declare a %destructor for a mid-rule's semantic value. It's just
3645 impossible to declare one specific to it.
3646 (Freeing Discarded Symbols): Mention that @$ can be used in %destructor
3647 code. Describe default %destructor form.
3648 * src/parse-gram.y (grammar_declaration): Parse default
3649 %printer/%destructor declarations.
3650 * src/output.c (symbol_destructors_output): Use symbol_destructor_get
3651 and symbol_destructor_location_get rather than accessing the destructor
3652 and destructor_location members of struct symbol.
3653 (symbol_printers_output): Likewise but for %printer's.
3654 * src/reader.c (symbol_should_be_used): Likewise but for %destructor's
3655 again.
3656 * src/symtab.c (default_destructor, default_destructor_location,
3657 default_printer, default_printer_location): New static global
3658 variables to record the default %destructor and %printer.
3659 (symbol_destructor_get, symbol_destructor_location_get,
3660 symbol_printer_get, symbol_printer_location_get): New functions to
3661 compute the appropriate %destructor and %printer for a symbol.
3662 (default_destructor_set, default_printer_set): New functions to set the
3663 default %destructor and %printer.
3664 * src/symtab.h: Prototype all those new functions.
3665 * tests/actions.at (Default %printer and %destructor): New test to
3666 check that the right %printer and %destructor are called, that they're
3667 not called for $end, and that $$ and @$ work correctly.
3668 (Default %printer and %destructor for user-declared end token): New
3669 test to check that the default %printer and %destructor are called for
3670 a user-declared end token.
3671 * tests/input.at (Default %printer and %destructor redeclared, Unused
3672 values with default %destructor): New tests to check related grammar
3673 warnings and errors.
3674
868d2d96
JD
36752006-07-29 Joel E. Denny <jdenny@ces.clemson.edu>
3676
3677 Clean up handling of %destructor for the end token (token 0).
3678 Discussed starting at
3679 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00019.html>
3680 and
3681 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00013.html>.
3682
3683 Make the skeletons consistent in how they pop the end token and invoke
3684 its %destructor.
3685 * data/glr.c (yyrecoverSyntaxError, yyparse): Don't pop the start
3686 state, which has token number 0, since this would invoke the
3687 %destructor for the end token.
3688 * data/lalr1.cc (yy::parser::parse): Don't check for the final state
3689 until after shifting the end token, or else it won't be popped.
3690 * data/yacc.c (yyparse): Likewise.
3691
3692 * data/glr.c (yyparse): Clear the lookahead after shifting it even when
3693 it's the end token. Upon termination, destroy an unshifted lookahead
3694 even when it's the end token.
3695 * data/lalr1.cc (yy::parser::parse): Likewise.
3696 * data/yacc.c (yyparse): Likewise.
3697
3698 * src/reader.c (packgram): Don't check rule 0. This suppresses unused
3699 value warnings for the end token when the user gives the end token a
3700 %destructor.
3701
3702 * tests/actions.at (Printers and Destructors): Test all the above.
3703
62a9592d
PE
37042006-07-24 Paul Eggert <eggert@cs.ucla.edu>
3705
3706 Update to latest gnulib and gettext versions.
3707 * bootstrap (gnulib-modules): Remove hard-locale, stdio-safer.
3708 Add fopen-safer.
3709 (gnulib_files): Add m4/warning.m4. Don't worry about files
3710 overwritten by autopoint.
3711 Replace gt_INTL_SUBDIR_CORE with an empty body in m4/gettext_gl.m4.
3712 Suppress "id", "ms", "tr" translations for now, since gettext 0.15
3713 rejects them.
3714 Don't use autoreconf; instead, invoke autopoint etc. by hand,
3715 so that we can remove the intl files at a better time.
3716 (intl_files_to_remove): Remove aclocal.m4, since it gets
3717 rebuilt anyway. Remove m4/inttypes_h.m4, m4/inttypes.m4,
3718 m4/isc-posix.m4, m4/lib-ld.m4, m4/lib-prefix.m4, m4/po.m4,
3719 m4/stdint_h.m4, m4/uintmax_t.m4, m4/ulonglong.m4.
3720 Add m4/inttypes-h.m4, m4/lock.m4, m4/visibility.m4.
3721 Remove datarootdir hack; no longer needed.
3722 * configure.ac: Use gl_WARNING_CFLAGS rather than BISON_WARNING.
3723 (AM_GNU_GETTEXT_VERSION): Bump from 0.12 to 0.15.
3724 * lib/.cvsignore: Remove hard-locale.c, hard-locale.h, strdup.c,
3725 strdup.h.
3726 * m4/.cvsignore: Remove hard-locale.m4, strdup.m4.
3727 * m4/warning.m4: Remove from CVS, since we now use gnulib's version.
3728
10d6970f
PE
37292006-07-20 Paul Eggert <eggert@cs.ucla.edu>
3730
3731 * bootstrap: Adjust to today's change to gnulib-tool by invoking
3732 it with --assume-autoconf='latest-stable'.
3733
50a33993
JD
37342006-07-13 Joel E. Denny <jdenny@ces.clemson.edu>
3735
3736 * src/parse-gram.y (grammar_declaration): Don't confuse Doxygen (at
3737 least 1.4.7 and 1.4.4) by putting a #line between `typedef union
3738 YYSTYPE' and `{'.
3739 * src/muscle_tab.h (muscle_grow): Replace the header comments with
3740 those from muscle_tab.c since the old ones are misleading.
3741
2ce4ed68
AD
37422006-07-13 Akim Demaille <akim@epita.fr>
3743
3744 Support %define "KEY" {VALUE}.
3745 * src/scan-code.h, src/scan-code.l (translate_action)
3746 (translate_rule_action, translate_symbol_action, translate_code):
3747 Return char *, not const char *.
3748 * src/parse-gram.y (declaration): Rename as...
3749 (prologue_declaration): this.
3750 (string_content): Remove this nonterminal, use STRING.
3751 (braceless, content, content.opt): New nonterminal.
3752 Use them.
3753 (%define): Now accept content.opt, i.e., accept also BRACED_CODE
3754 as value.
3755 * src/scan-gram.l (getargs.h): Don't include it.
3756
db7e5eb5
PE
37572006-07-12 Paul Eggert <eggert@cs.ucla.edu>
3758
3759 * data/lalr1.cc (YYCDEBUG): Use 'if (yydebug_) (*yycdebug_)'
3760 rather than a for-loop that declares a local bool variable. This
3761 should work around a compatibility problem with a Cray x1e C++
3762 compiler reported by Hung Nguyen in
3763 <http://lists.gnu.org/archive/html/help-bison/2006-07/msg00022.html>.
3764 The for-loop was introduced in the 2004-11-17 change but I don't
3765 know why it was needed.
3766
a5d80ba5
AD
37672006-07-12 Akim Demaille <akim@epita.fr>
3768
3769 * data/c.m4: Comment changes.
3770
23eb2a69
AD
37712006-07-10 Akim Demaille <akim@lrde.epita.fr>
3772
3773 * src/complain.c (error_message, ERROR_MESSAGE): New.
3774 To factor...
3775 (fatal_at, fatal, warn_at, warn, complain_at, complain): these.
3776 * src/complain.h, src/complain.c (warning_issued): Remove, unused.
3777
ddc8ede1
PE
37782006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3779
3780 * NEWS: Instead of %union, you can define and use your own union type
3781 YYSTYPE if your grammar contains at least one <type> tag.
3782 Your YYSTYPE need not be a macro; it can be a typedef.
3783 * doc/bison.texinfo (Value Type, Multiple Types, Location Type):
3784 (Union Decl, Decl Summary): Document this.
3785 * data/glr.c (YYSTYPE): Implement this.
3786 * data/glr.cc (YYSTYPE): Likewise.
3787 * data/lalr1.cc (YYSTYPE): Likewise.
3788 * data/yacc.c (YYSTYPE): Likewise.
3789 * src/output.c (prepare): Output tag_seen_flag.
3790 * src/parse-gram.y (declaration, grammar_declaration):
3791 Use 'union_seen' rather than 'typed' to determine whether
3792 %union has been seen, since grammars can now be typed without
3793 %union.
3794 (symbol_declaration, type.opt, symbol_def):
3795 Keep track of whether a tag has been seen.
3796 * src/reader.c (union_seen, tag_seen): New vars.
3797 (typed): remove.
3798 * src/reader.h (union_seen, tag_seen, typed): Likewise.
3799 * src/scan-code.l (untyped_var_seen): New variable.
3800 (handle_action_dollar): Adjust to above changes.
3801 (handle_action_dollar, handle_action_at):
3802 Improve overflow checking for outlandish numbers.
3803 * tests/input.at (AT_CHECK_UNUSED_VALUES): Redo test to
3804 avoid new diagnostics generated by above changes.
3805 * tests/regression.at (YYSTYPE typedef): Add test to check
3806 for type tags without %union.
3807
3808 * src/symlist.c (symbol_list_length): Return int, not unsigned
3809 int, since callers expect int. This may need to get revisited
3810 once we have proper integer overflow checking.
3811
3812 * src/scan-gram.h (gram_scanner_cursor): Remove decl, since this
3813 object is now static.
3814
3815 * src/getargs.c (flags_argmatch): Return void, not int,
3816 to pacify ./configure --enable-gcc-warnings.
3817
3818 * src/flex-scanner.h (STRING_FREE): Don't use FLEX_PREFIX (last_string)
3819 since last_string is already defined to FLEX_PREFIX (last_string).
3820
7b42569e
AD
38212006-07-09 Akim Demaille <akim@lrde.epita.fr>
3822
3823 Implement --warnings/-W.
3824 * src/getargs.c (report_argmatch, trace_argmatch): Remove,
3825 replaced by...
3826 (flags_argmatch, FLAGS_ARGMATCH): this new function and macro.
3827 Adjust callers.
3828 * src/getargs.h, src/getargs.c (warnings, warnings_flags)
3829 (warnings_args, warnings_types): New.
3830 (getargs, short_options, long_options): Accept -W/--warnings.
3831 Sort the options by alphabetical order, upper case letter right
3832 before its lower case.
3833
3b452f4e
JD
38342006-07-09 Joel E. Denny <jdenny@ces.clemson.edu>
3835
3836 Change %merge result type clash warnings to errors. Discussed at
3837 <http://lists.gnu.org/archive/html/bison-patches/2006-07/msg00026.html>.
3838 * src/reader.c (record_merge_function_type): Use complain_at.
3839 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3840 declared later): Update test case results.
3841
b8a41559
AD
38422006-07-09 Akim Demaille <akim@lrde.epita.fr>
3843
3844 * src/getargs.h, src/getargs.c: Swap --report and --trace handling
3845 to be in alphabetical order.
3846 (trace_args): Spelling fixes.
3847
cd9e1ba2
PE
38482006-07-09 Paul Eggert <eggert@cs.ucla.edu>
3849
3850 * data/yacc.c (YYID, yy_stack_print): Prefix local vars with "yy"
3851 so they don't collide with user-defined macros.
3852 (yy_stack_print): Don't assume that yytype_int16 promotes to int;
3853 this was never guaranteed, and now that we're using gnulib stdint,
3854 which defines int_fast16_t to long int, the problem is exposed.
3855
cb48f191
PE
38562006-07-08 Paul Eggert <eggert@cs.ucla.edu>
3857
b8445a15
PE
3858 * data/c.m4 (b4_basename): Simplify a bit, since we don't
3859 need the full POSIX semantics (and weren't implementing them
3860 anyway).
3861
cb48f191
PE
3862 Adjust to Autoconf 2.60 and today's gnulib.
3863 * bootstrap (gnulib_modules): Add stdint.
3864 Remove special case for m4/onceonly_2_57.m4, since gnulib-tool
3865 no longer copies it.
3866 (intl_files_to_remove): Remove m4/longlong.m4 and m4/wchar_t.m4,
3867 since stdint needs the former and wcwidth (which is now required
3868 by mbswidth) needs the latter.
3869 Append 'datarootdir = @datarootdir@' to po/Makefile.in.in, to
3870 work around a compatibility glitch between gettext 0.14.6 and
3871 Autoconf 2.60.
3872 * configure.ac (AC_PREREQ): Require Autoconf 2.60.
3873 Do not check for uintptr_t, since new stdint module does the right
3874 thing.
3875 * lib/.cvsignore: Remove alloca.c, alloca.h, alloca_.h.
3876 Add stdint.h, stdint_.h, wcwidth.h.
3877 * m4/.cvsignore: Remove alloca.m4, onceonly.m4.
3878 Add absolute-header.m4, double-slash-root.m4, longlong.m4,
3879 stdint.m4, wchar_t.m4, wcwidth.m4.
3880 * src/files.c: Include <dirname.h> and <stdio-safer.h> in the
3881 usual order for ../lib/*.h files.
3882 (file_name_split): Use last_component, not base_name, to adjust
3883 to gnulib changes.
3884 * src/parse-gram.h: Include <strverscmp.h> in the usual order
3885 for ../lib/*.h files.
3886 (YYTYPE_INT16, YYTYPE_INT8, YYTYPE_UINT16, YYTYPE_UINT8):
3887 Define unconditionally, since we now assume the stdint module.
3888 * src/scan-skel.l: Include <dirname.h>.
3889 (BASE_QPUTS): Use last_component, not base_name.
3890 * src/system.h: Include <unlocked-io.h> in the usual order
3891 for ../lib/*.h files. Include <stdint.h> unconditionally,
3892 since we now use the stdint module.
3893 (uintptr_t): Declare if UINTPTR_MAX is not defined, not
3894 HAVE_UINTPTR_T, since we now use the stdint module.
3895 (base_name): Remove decl, since files now include <dirname.h>
3896 to get the decl.
3897
cd48d21d
AD
38982006-07-08 Akim Demaille <akim@lrde.epita.fr>
3899
3900 * data/c.m4 (b4_location_initial_column, b4_location_initial_line):
3901 New, default to 1.
3902 * data/yacc.c, data/glr.c, data/location.cc: Use them.
3903 * NEWS, doc/bison.texinfo: The initial column and line are 1 by
3904 default.
3905 * tests/calc.at: Adjust.
3906
8ec0a172
AD
39072006-07-08 Akim Demaille <akim@lrde.epita.fr>
3908
b8445a15 3909 * data/c.m4 (b4_basename): New.
8ec0a172
AD
3910 (b4_syncline): Also output the location of its invocation (from
3911 the skeleton).
3912 (b4_user_action, b4_define_user_action, b4_user_actions)
3913 (b4_user_initial_action, b4_user_post_prologue, b4_user_start_header)
3914 (b4_user_stype): New.
3915 * data/yacc.c, data/glr.c, data/lalr1.cc, data/glr.cc: Use them.
3916
4a678af8
JD
39172006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3918
3919 In the grammar file, the first column is 1 not 0 on the first line as
3920 on every other line.
3921 * src/parse-gram.y (%initial-action): Initialize @$ correctly.
3922 * tests/input.at (Torturing the Scanner): Update output.
3923
3924 * src/scan-gram.l (scanner_cursor): Declare it static.
3925
dd60572a
JD
39262006-07-07 Joel E. Denny <jdenny@ces.clemson.edu>
3927
3928 In warnings, say "previous declaration" rather than "first
3929 declaration".
3930 * src/symtab.c (redeclaration): Do that here.
3931 * src/reader.c (record_merge_function_type): In the case of a result
3932 type clash, report the previous declaration rather than the very first
3933 one in the grammar file.
3934 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3935 declared later): Add a third declaration to check this behavior.
3936 * tests/input.at (Incompatible Aliases): Update output.
3937
2073e1b6
AD
39382006-06-27 Akim Demaille <akim@epita.fr>
3939
3940 * doc/Doxyfile.in: New.
3941 * doc/Makefile.am: Use it.
3942 * src/lalr.h, src/symtab.h: Initial doxygenation.
3943
8ee5b538
JD
39442006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3945
3946 Don't miss %merge result type warnings just because the LHS types are
fab044e6
JD
3947 declared after the %merge. This continues the effort of the previous
3948 patch.
8ee5b538
JD
3949 * src/reader.c (get_merge_function): Don't set the merger type yet.
3950 (record_merge_function_type): New function for setting the merger type
3951 and checking for clashes.
3952 (grammar_current_rule_merge_set): Set the location of the %merge for
3953 the current rule.
3954 (packgram): Invoke record_merge_function_type for each rule now that
3955 all symbol type declarations have been parsed.
3956 * src/reader.h (merger_list.type_declaration_location): New member
3957 storing the location of the first %merge from which the type for this
3958 merging function was derived.
3959 * src/symlist.h (symbol_list.merger_declaration_location): New member
3960 storing the location of a rule's %merge, if any.
3961 * tests/glr-regression.at (Missed %merge type warnings when LHS type is
3962 declared later): New test to catch the error fixed by the above patch.
3963
ffa4ba3a
JD
39642006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
3965
3966 Get action warnings (grammar_rule_check) right even when symbol
fab044e6
JD
3967 declarations appear after the rules. Discussed at
3968 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00108.html>
3969 and
3970 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00151.html>.
3971 Don't mistake the type of $$ in a midrule to be that of its parent
3972 rule's $$.
ffa4ba3a
JD
3973 * src/reader.c (grammar_current_rule_end): Don't invoke
3974 grammar_rule_check yet since not all symbol declarations may have been
3975 parsed yet.
3976 (grammar_midrule_action): Likewise.
3977 Don't record whether the midrule's $$ has been used yet since actions
3978 haven't been translated yet.
3979 Record the midrule's parent rule and its RHS index within the parent
3980 rule.
3981 (grammar_current_rule_action_append): Don't translate the action yet
3982 since not all symbol declarations may have been parsed yet and, thus,
3983 warnings about types for $$, $n, @$, and @n can't be reported yet.
3984 (packgram): Translate the action and invoke grammar_rule_check now that
3985 all symbol declarations have been parsed.
3986 * src/scan-code.l (handle_action_dollar): Now that this is invoked
3987 after parsing the entire grammar file, the symbol list here in the case
3988 of a midrule is actually the midrule's empty RHS, so reference its
3989 parent rule's RHS where necessary.
3990 On the other hand, now that you can already know it's a midrule, you
3991 aren't forced to think $$ has the same type as its parent rule's $$.
3992 (handle_action_at): In the case of a midrule, reference the parent rule
3993 where necessary.
3994 * src/symlist.c (symbol_list_new): Initialize new midrule-related
3995 members.
3996 (symbol_list_length): Now that this is invoked after all rules have
3997 been parsed, a NULL symbol (rather than a NULL symbol list node)
3998 terminates a rule. symbol_list_print already does this correctly.
3999 * src/symlist.h (symbol_list.midrule_parent_rule,
4000 symbol_list.midrule_parent_rhs_index): New members so that midrules can
4001 remember their relationships with their parents.
4002 * tests/input.at (Type Clashes): Extend to catch the midrule $$ error
4003 fixed by the above patch.
4004 (_AT_UNUSED_VALUES_DECLARATIONS, AT_CHECK_UNUSED_VALUES): New m4 macros
4005 implementing...
4006 (Unused values): ... this old test case and...
4007 (Unused values before symbol declarations): ... this new test case.
4008 This one is the same as `Unused values' except that all symbol
4009 declarations appear after the rules in order to catch the rest of the
4010 errors fixed by the above patch.
4011
e256e17f
JD
40122006-06-26 Joel E. Denny <jdenny@ces.clemson.edu>
4013
300a1930
JD
4014 More cleanup.
4015 * src/reader.c (current_rule): Declare it static since it's no longer
4016 used outside this file.
4017 (grammar_current_rule_action_append): Remove redundant arguments from
4018 translate_rule_action invocation.
4019 * src/reader.h (current_rule): Remove this unused extern.
4020 * src/scan-code.h (translate_rule_action): Remove redundant arguments.
4021 * src/scan-code.l (translate_rule_action): Likewise.
e256e17f 4022
381ecb06
JD
40232006-06-25 Joel E. Denny <jdenny@ces.clemson.edu>
4024
4025 Clean up yesterday's patch.
4026 * parse-gram.y (rhs): Move grammar_midrule_action invocation from here
4027 to...
4028 * src/reader.c (grammar_current_rule_action_append): ... here for
4029 consistency with grammar_current_rule_symbol_append.
4030 * tests/regression.at (Braced code in declaration in rules section):
4031 Make yyerror and yylex static as usual.
4032
4210cd0b
JD
40332006-06-24 Joel E. Denny <jdenny@ces.clemson.edu>
4034
4035 Fix bug that mistakes braced code in a declaration in the rules section
4036 to be a rule action. Mentioned at
4037 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00105.html>.
4038 * src/scan-gram.l: Move midrule action detection from the start of the
4039 scanning of any braced code to...
4040 * src/parse-gram.y (rhs): ... the parsing of braced code as a rule
4041 action. For readability, use $2 and @2 rather than the equivalent
4042 global variables.
4043 * tests/regression.at (Braced code in declaration in rules section):
4044 New test to catch the error fixed by the above patch.
4045
4046 Work on code readability some.
4047 * src/scan-code.l (current_rule): Get rid of this misleading and
4048 redundant declaration: it's actually extern'ed in reader.h.
4049 (YY_DECL, code_lex, handle_action_dollar, handle_action_at,
4050 translate_action): Add a rule argument and use it instead of the global
4051 current_rule.
4052 (translate_rule_action): This already receives current_rule through an
4053 argument, so pass it on to translate_action instead of assigning
4054 current_rule to current_rule.
4055 (translate_symbol_action, translate_code): Pass rule = NULL to
4056 translate_action.
4057
34f98f46
JD
40582006-06-23 Joel E. Denny <jdenny@ces.clemson.edu>
4059
4060 Rename %before-definitions to %start-header and %after-definitions to
4061 %end-header. Don't use these declarations to separate pre-prologue
4062 blocks from post-prologue blocks. Add new order-independent
4063 declarations %before-header and %after-header as alternatives to the
4064 traditional Yacc pre-prologue and post-prologue blocks. Discussed at
4065 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00110.html>.
4066 * NEWS (2.3+): Update for these changes.
4067 * data/glr.c (b4_before_definitions): Update to...
4068 (b4_start_header): ... this.
4069 (b4_after_definitions): Update to...
4070 (b4_end_header): ... this.
4071 * data/glr.cc: Likewise.
4072 * data/lalr1.cc: Likewise.
4073 * data/yacc.c: Likewise.
4074 * doc/bison.texinfo (The prologue): Update names, and replace remaining
4075 prologue blocks with %*-header declarations.
4076 (Calc++ Parser): Likewise.
91661ebb 4077 (Decl Summary): Update names.
148d66d8 4078 (Table of Symbols): Update description.
34f98f46
JD
4079 * src/parse-gram.y (PERCENT_AFTER_DEFINITIONS): Update to...
4080 (PERCENT_END_HEADER): ... this.
4081 (PERCENT_BEFORE_DEFINITIONS): Update to...
4082 (PERCENT_START_HEADER): ... this.
4083 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4084 (declaration): Update token names and m4 macro names.
4085 When parsing %end-header and %start-header, invoke translate_code
4086 before muscle_code_grow, and no longer set global booleans to remember
4087 whether these declarations have been seen.
4088 Parse new %after-header and %before-header.
4089 * src/reader.c (before_definitions, after_definitions): Remove.
4090 (prologue_augment): Accept a new bool argument to specify whether to
4091 augment the pre-prologue or post-prologue.
4092 * src/reader.h (before_definitions, after_definitions): Remove these
4093 extern's.
4094 (prologue_augment): Add new bool argument.
4095 * src/scan-gram.l (PERCENT_AFTER_DEFINITIONS): Update to...
4096 (PERCENT_END_HEADER): ... this.
4097 (PERCENT_BEFORE_DEFINITIONS): Update to...
4098 (PERCENT_START_HEADER): ... this.
4099 (PERCENT_AFTER_HEADER, PERCENT_BEFORE_HEADER): New tokens.
4100 * tests/actions.at (Printers and Destructors): Update names.
4101
31b2b07e
JD
41022006-06-22 Joel E. Denny <jdenny@ces.clemson.edu>
4103
4104 Add comparison operators for C++ location classes. Discussed at
4105 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00092.html>.
4106 * data/c++.m4 (b4_define_location_comparison): New boolean %define
4107 declaration indicating whether filename_type has an operator==. If
4108 filename_type is `std::string', it defaults to `1', `0' otherwise.
4109 * data/location.cc: Iff b4_define_location_comparison is `1', add
4110 operator== and operator!= for class position and for class location.
4111
4112 Some minor fixes.
4113 * src/scan-action.l: Remove unused file.
4114 * src/symtab.c (symbol_printer_set): Use printer_location not
4115 destructor_location.
4116 * src/symtab.h (struct symbol): Replace incorrect source comment for
4117 printer members.
4118 * tests/input.at (Incompatible Aliases): Update output with correct
4119 printer location.
4120
9bc0dd67
JD
41212006-06-20 Joel E. Denny <jdenny@ces.clemson.edu>
4122
4123 Don't put the pre-prologue in the header file. For the yacc.c code
4124 file and the glr.c header and code files, move the pre-prologue before
4125 the token definitions. Add new %before-definitions and
4126 %after-definitions to declare code that will go in both the header file
4127 and code file. Discussed at
4128 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00000.html>,
4129 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00016.html>,
4130 and
4131 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00055.html>.
4132 * NEWS (2.3+): Describe these changes.
4133 * data/glr.c (b4_pre_prologue): Move from within to before...
4134 (b4_shared_declarations): ... this.
4135 Add new b4_before_definitions before b4_token_enums.
4136 Add new b4_after_definitions at the end.
4137 * data/glr.cc (b4_pre_prologue): Replace with...
4138 (b4_before_definitions): ... this in the header file.
4139 (b4_after_definitions): New near the end of the header file.
4140 * data/lalr1.cc (b4_pre_prologue): Move from the header file to the
4141 code file right before including the header file.
4142 (b4_before_definitions): New in the previous position of
4143 b4_pre_prologue in the header file.
4144 (b4_after_definitions): New near the end of the header file.
4145 * data/yacc.c: Clean up some m4 quoting especially in the header file.
4146 (b4_token_enums_defines): In the code file, move to right before
4147 YYSTYPE for consistency with the header file.
4148 (b4_before_definitions): New right before b4_token_enums_defines in
4149 both the header and code file.
4150 (b4_after_definitions): New right after YYLTYPE and yylloc in both the
4151 header and code file.
4152 * doc/bison.texinfo (Prologue): Show use of %before-definitions instead
4153 of prologues for %union dependencies.
91661ebb
JD
4154 (Decl Summary): In %defines description, mention the effect of
4155 %before-definitions and %after-definitions on the header file.
9bc0dd67
JD
4156 (Calc++ Parser): Forward declare driver in a %before-definitions rather
4157 than in the pre-prologue so that make check succeeds.
148d66d8 4158 (Table of Symbols): Add entries for %before-definitions and
9bc0dd67
JD
4159 %after-definitions.
4160 * src/parse-gram.y (PERCENT_BEFORE_DEFINITIONS): New token for
4161 %before-definitions.
4162 (PERCENT_AFTER_DEFINITIONS): New token for %after-definitions.
4163 (declaration): Parse those declarations and append to
4164 b4_before_definitions and b4_after_definitions, respectively.
4165 * src/reader.c (before_definitions, after_definitions): New bools to
4166 track whether those declarations have been seen.
4167 (prologue_augment): Add to the post-prologue if %union,
4168 %before-definitions, or %after-definitions has been seen.
4169 * src/reader.h (before_definitions, after_definitions): New extern's.
4170 * src/scan-gram.l: Scan the new declarations.
4171 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Place the second
4172 prologue block in a %before-definitions or a %after-definitions based
4173 on whether the %union is declared.
4174 * tests/regression.at (Early token definitions with --yacc, Early token
4175 definitions without --yacc): Move tests for token definitions into the
4176 post-prologue since token names are no longer defined in the
4177 pre-prologue.
4178
203b9274
AD
41792006-06-20 Akim Demaille <akim@epita.fr>
4180
4181 * src/symtab.h, src/symtab.c (symbol_from_uniqstr): New.
4182 (symbol_get): Use it.
4183 * src/parse-gram.y: Use it.
4184
a7ee59cf
JD
41852006-06-19 Joel E. Denny <jdenny@ces.clemson.edu>
4186
4187 * src/scan-gram.l: Remove unused declaration of last_string_1 so the
4188 build succeeds when configured with --enable-gcc-warnings.
4189
5a2baae7
PE
41902006-06-19 Paul Eggert <eggert@cs.ucla.edu>
4191
33ad1a9c
PE
4192 * src/parse-gram.y (char_name): New function.
4193 (CHAR, STRING, string_content): For %printer, properly escape.
4194 (ID): Prefer fputs to fprintf.
4195 (id): Reindent to be consistent with other rules.
4196 Properly quote char.
4197
5a2baae7
PE
4198 The Translation Project changed its way of publishing translations
4199 to maintainers. I haven't received any responses to my request
4200 for supporting the old way, or for documenting the new way. I
4201 have modified 'bootstrap' to use screen scraping
4202 (in this case, HTML scraping). This is unreliable and inelegant,
4203 but I don't see any better way. Yuck.
4204 * bootstrap (TP_URL, WGET_COMMAND): New vars.
4205 (get_translations): New function, which uses HTML scraping to
4206 deduce locations of latest translations.
4207 Use this function to grab both bison and bison-runtime .po files.
4208 Don't bother priming the pump for the runtime-po domain any more,
4209 as it's now translated better than bison is.
4210
58d7a1a1
AD
42112006-06-19 Akim Demaille <akim@epita.fr>
4212
4213 * src/scan-gram.l: No longer "parse" things after `%union' until
4214 `{'. Rather, return a single "%union" token.
4215 No longer make symbols: return strings, and leave the conversion
4216 to symbols to the parser.
4217 (SC_PRE_CODE, token_type): Remove.
4218 * src/parse-gram.y (%union): New field `character'.
4219 Sort tokens.
4220 (CHAR): New token.
4221 (ID, ID_COLON): Now that the scanner no longer makes them
4222 identifiers, adjust all uses to invoke symbol_get.
4223 (id_colon): New, wraps the conversion from string to symbol.
4224 (%union): Accept a possible union_name.
4225 (symbol): Now can be a char.
4226 * data/c.m4 (b4_union_name): Leave a default value.
4227 * data/glr.c, data/yacc.c: Use it.
4228
b931235e
JD
42292006-06-11 Joel E. Denny <jdenny@ces.clemson.edu>
4230
4231 For associating token numbers with token names for "yacc.c", don't use
4232 #define statements unless `--yacc' is specified; always use enum
4233 yytokentype. Most important discussions start at:
4234 <http://lists.gnu.org/archive/html/bison-patches/2005-09/msg00053.html>,
4235 <http://lists.gnu.org/archive/html/bison-patches/2005-12/msg00052.html>,
4236 and
4237 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00043.html>.
4238 * NEWS (2.3+): Mention.
4239 * data/c.m4 (b4_yacc_if): New.
4240 (b4_token_enums_defines): Use b4_yacc_if to decide whether to add the
4241 token #define's.
4242 * doc/bison.texinfo (Bison Options): Describe the effect of `--yacc'
4243 on token name definitions.
4244 * src/getargs.c (usage): Capitalize `Yacc' in English.
4245 * src/output.c (prepare): Define b4_yacc_flag.
4246 * tests/regression.at (Early token definitions): Test that tokens names
4247 are defined before the pre-prologue not just before the post-prologue.
4248 Remove this test case and copy to...
4249 (Early token definitions with --yacc): ... this to test #define's.
4250 (Early token definitions without --yacc): ... and this to test enums.
4251
9e6e7ed2
PE
42522006-06-11 Paul Eggert <eggert@cs.ucla.edu>
4253
4254 * NEWS: Reword the post-2.3 change to not be so optimistic about
4255 removing the old "look-ahead" spelling.
4256 Update previous look-ahead/lookahead change reports.
4257 * REFERENCES: look-ahead -> lookahead (since that's
4258 what he actually wrote).
4259 * doc/refcard.tex: look ahead -> lookahead,
4260 look-ahead -> lookahead
4261
742e4900
JD
42622006-06-09 Joel E. Denny <jdenny@ces.clemson.edu>
4263
4264 For consistency, use `lookahead' instead of `look-ahead' or
4265 `look_ahead'. Discussed starting at
4266 <http://lists.gnu.org/archive/html/bison-patches/2006-01/msg00049.html>
4267 and then at
4268 <http://lists.gnu.org/archive/html/bison-patches/2006-06/msg00017.html>.
4269 * NEWS: For the next release, note the change to `--report'.
4270 * TODO, doc/bison.1: Update English.
4271 * doc/bison.texinfo: Update English.
4272 (Understanding Your Parser, Bison Options): Document as
4273 `--report=lookahead' rather than `--report=look-ahead'.
4274 * src/conflicts.c: Update English in comments.
4275 (lookahead_set): Rename from look_ahead_set.
4276 (flush_reduce): Rename argument look_ahead_tokens to lookahead_tokens.
4277 (resolve_sr_conflict): Rename local look_ahead_tokens to
4278 lookahead_tokens, and update other uses.
4279 (flush_shift, set_conflicts, conflicts_solve, count_sr_conflicts,
4280 count_rr_conflicts, conflicts_free): Update uses.
4281 * src/getargs.c (report_args): Move "lookahead" before alternate
4282 spellings.
4283 (report_types): Update uses.
4284 (usage): For `--report' usage description, state `lookahead' spelling
4285 rather than `look-ahead'.
4286 * src/getargs.h (report.report_lookahead_tokens): Rename from
4287 report_look_ahead_tokens.
4288 * src/lalr.c: Update English in comments.
4289 (compute_lookahead_tokens): Rename from compute_look_ahead_tokens.
4290 (state_lookahead_tokens_count): Rename from
4291 state_look_ahead_tokens_count.
4292 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4293 (lookahead_tokens_print): Rename from look_ahead_tokens_print.
4294 Rename local n_look_ahead_tokens to n_lookahead_tokens.
4295 Update other uses.
4296 Update English in output.
4297 (add_lookback_edge, initialize_LA, lalr, lalr_free): Update uses.
4298 * src/print.c: Update English in comments.
4299 (lookahead_set): Rename from look_ahead_set.
4300 (print_reduction): Rename argument lookahead_token from
4301 look_ahead_token.
4302 (print_core, state_default_rule, print_reductions, print_results):
4303 Update uses.
4304 * src/print_graph.c: Update English in comments.
4305 (print_core): Update uses.
4306 * src/state.c: Update English in comments.
4307 (reductions_new): Update uses.
4308 (state_rule_lookahead_tokens_print): Rename from
4309 state_rule_look_ahead_tokens_print, and update other uses.
4310 * src/state.h: Update English in comments.
4311 (reductions.lookahead_tokens): Rename from look_ahead_tokens.
4312 (state_rule_lookahead_tokens_print): Rename from
4313 state_rule_look_ahead_tokens_print.
4314 * src/tables.c: Update English in comments.
4315 (conflict_row, action_row): Update uses.
4316 * tests/glr-regression.at
4317 (Incorrect lookahead during deterministic GLR,
4318 Incorrect lookahead during nondeterministic GLR): Rename
4319 print_look_ahead to print_lookahead.
4320 * tests/torture.at: Update English in comments.
4321 (AT_DATA_LOOKAHEAD_TOKENS_GRAMMAR): Rename from
4322 AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR.
4323 (Many lookahead tokens): Update uses.
4324 * data/glr.c: Update English in comments.
4325 * lalr1.cc: Likewise.
4326 * yacc.c: Likewise.
4327 * src/conflicts.h: Likewise.
4328 * src/lalr.h: Likewise.
4329 * src/main.c: Likewise.
4330 * src/output.c: Likewise.
4331 * src/parse-gram.c: Likewise.
4332 * src/tables.h: Likewise.
4333 * tests/calc.at: Likewise.
4334
3c40d0b5
JD
43352006-06-08 Joel E. Denny <jdenny@ces.clemson.edu>
4336
4337 * src/flex-scanner.h (yytext): Remove stray `*/' in #define.
4338
5d278082
PE
43392006-06-07 Paul Eggert <eggert@cs.ucla.edu>
4340
4341 * TODO: Add request from Nelson H. F. Beebe to be able to install
4342 Bison without installing the yacc script.
4343
9e668899
JD
43442006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4345
4346 * src/flex-scanner.h: For the sake of Flex 2.5.4, don't #define yyleng
4347 and yytext if they're already #define'd.
4348 * src/flex-scanner.h, src/location.h: Move #include "system.h" to...
4349 * src/scan-code-c.c: ... here.
4350 * src/scan-code.l, src/scan-gram.l: ... and here. Also #include
4351 <config.h>.
4352
0c8e079f
JD
43532006-06-07 Joel E. Denny <jdenny@ces.clemson.edu>
4354
4355 Get Bison to build again when configured with --enable-gcc-warnings.
4356 * src/location.c, src/location.h, src/main.c, src/scan-code.l: Add some
4357 missing #include's.
4358 * src/scan-code.l (handle_action_dollar, handle_action_at): Rename
4359 loc argument as it shadows a global.
4360 * src/scan-gram.l: Remove stray comma that prevents boundary_set
4361 invocation.
4362
4363 * src/.cvsignore: Add scan-code.c.
4364
2346344a
AD
43652006-06-07 Akim Demaille <akim@epita.fr>
4366
4367 * src/scan-gram.l: Move the "add a trailing ; to actions" code
4368 to...
4369 * src/scan-code.l: here.
4370 * tests/input.at (Torturing the Scanner): Fix another location
4371 error.
4372
4862bdfd
AD
43732006-06-07 Akim Demaille <akim@epita.fr>
4374
4375 * src/Makefile.am (BUILT_SOURCES): Fix the trailing backslash.
4376
e9071366
AD
43772006-06-06 Akim Demaille <akim@epita.fr>
4378
4379 Extract the parsing of user actions from the grammar scanner.
4380 As a consequence, the relation between the grammar scanner and
4381 parser is much simpler. We can also split "composite tokens" back
4382 into simple tokens.
4383 * src/gram.h (ITEM_NUMBER_MAX, RULE_NUMBER_MAX): New.
4384 * src/scan-gram.l (add_column_width, adjust_location): Move to and
4385 rename as...
4386 * src/location.h, src/location.c (add_column_width)
4387 (location_compute): these.
4388 Fix the column count: the initial column is 0.
4389 (location_print): Be robust to ending column being 0.
4390 * src/location.h (boundary_set): New.
4391 * src/main.c: Adjust to scanner_free being renamed as
4392 gram_scanner_free.
4393 * src/output.c: Include scan-code.h.
4394 * src/parse-gram.y: Include scan-gram.h and scan-code.h.
4395 Use boundary_set.
4396 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_INITIAL_ACTION)
4397 (PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Remove the {...} part,
4398 which is now, again, a separate token.
4399 Adjust all dependencies.
4400 Whereever actions with $ and @ are used, use translate_code.
4401 (action): Remove this nonterminal which is now useless.
4402 * src/reader.c: Include assert.h, scan-gram.h and scan-code.h.
4403 (grammar_current_rule_action_append): Use translate_code.
4404 (packgram): Bound check ruleno, itemno, and rule_length.
4405 * src/reader.h (gram_in, gram__flex_debug, scanner_cursor)
4406 (last_string, last_braced_code_loc, max_left_semantic_context)
4407 (scanner_initialize, scanner_free, scanner_last_string_free)
4408 (gram_out, gram_lineno, YY_DECL_): Move to...
4409 * src/scan-gram.h: this new file.
4410 (YY_DECL): Rename as...
4411 (GRAM_DECL): this.
4412 * src/scan-code.h, src/scan-code.l, src/scan-code-c.c: New.
4413 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
4414 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
4415 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
4416 Move these declarations, and...
4417 (obstack_for_string, STRING_GROW, STRING_FINISH, STRING_FREE):
4418 these to...
4419 * src/flex-scanner.h: this new file.
4420 * src/scan-gram.l (rule_length, rule_length_overflow)
4421 (increment_rule_length): Remove.
4422 (last_braced_code_loc): Rename as...
4423 (gram_last_braced_code_loc): this.
4424 Adjust to the changes of the parser.
4425 Move all the handling of $ and @ into...
4426 * src/scan-code.l: here.
4427 * src/scan-gram.l (handle_dollar, handle_at): Remove.
4428 (handle_action_dollar, handle_action_at): Move to...
4429 * src/scan-code.l: here.
4430 * src/Makefile.am (bison_SOURCES): Add flex-scanner.h,
4431 scan-code.h, scan-code-c.c, scan-gram.h.
4432 (EXTRA_bison_SOURCES): Add scan-code.l.
4433 (BUILT_SOURCES): Add scan-code.c.
4434 (yacc): Be robust to white spaces.
4435
4436 * tests/conflicts.at, tests/input.at, tests/reduce.at,
4437 * tests/regression.at: Adjust the column numbers.
4438 * tests/regression.at: Adjust the error message.
7891a7c4 4439
184e42f0
JD
44402006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4441
4442 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4443 Use Akim's wording from
4444 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00056.html>.
4445
7891a7c4
JD
44462006-06-06 Joel E. Denny <jdenny@ces.clemson.edu>
4447
4448 Between Bison releases, manually append `+' to the previous Bison
4449 release number, and use that as a signal to automatically print the
4450 ChangeLog's CVS Id keyword from --version. Discussed starting at
4451 <http://lists.gnu.org/archive/html/bison-patches/2006-05/msg00028.html>.
4452 * ChangeLog: Add Id header.
4453 * configure.ac (AC_INIT): Append `+' to `2.3'.
4454 * src/.cvsignore: Add revision.c.
4455 * src/Makefile.am (bison_SOURCES): Add revision.c and revision.h.
4456 (BUILT_SOURCES): Add revision.c.
4457 (revision.c): New target rule. This file defines a new global variable
4458 named revision. It initializes it with either the Id from ChangeLog
4459 or, if VERSION doesn't contain `+', with the empty string.
4460 * src/getargs.c (version): Print the value of revision.
4461 * src/revision.h: Extern revision.
4462
4ad3ed84
PE
44632006-06-05 Paul Eggert <eggert@cs.ucla.edu>
4464
4465 * NEWS: Version 2.3.
4466 * configure.ac (AC_INIT): Likewise.
4467
02103984
PE
44682006-05-30 Paul Eggert <eggert@cs.ucla.edu>
4469
4470 * data/glr.c (YYRECOVERING): Define to be a function-like macro
4471 with no arguments, not as an object-like macro. This is for
4472 compatibility with data/yacc.c. Problem reported by John P. Hartmann in
4473 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00059.html>.
4474 * doc/bison.texinfo (Action Features, Error Recovery, Table of Symbols):
4475 Document this.
4476
2c08afa5
JD
44772006-05-30 Joel E. Denny <jdenny@ces.clemson.edu>
4478
4479 * src/getargs.c (usage): Back out yesterday's modification of the
4480 --help output so that we don't have to wait for translation before
4481 releasing 2.3.
4482
6077da58
PE
44832006-05-29 Paul Eggert <eggert@cs.ucla.edu>
4484
4485 * doc/bison.texinfo (Introduction): Don't say "GLR grammar".
4486 Problem reported by Akim Demaille.
4487
2a26b6c2
JD
44882006-05-29 Joel E. Denny <jdenny@ces.clemson.edu>
4489
4490 * src/getargs.c (usage): Mention GLR not just LALR(1) in --help output.
4491
aefef0d6
PE
44922006-05-26 Paul Eggert <eggert@cs.ucla.edu>
4493
4494 * data/yacc.c (yy_reduce_print): Omit trailing white space in
4495 generated source code. Problem reported by Frans Englich in
4496 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00049.html>.
4497
fcd8e201
PE
44982006-05-22 Paul Eggert <eggert@cs.ucla.edu>
4499
4500 * Makefile.maint (gzip_rsyncable, GZIP_ENV): Compute within the
4501 shell, not within 'make', so that 'make' by an ordinary builder
4502 (using GNU make) does not worry about configuring gzip. This also
4503 works around a bug reported independently by Keith Thompson and by
4504 Georg Schwarz, whereby gzip 1.2.4 --help would output usage on
4505 stderr rather than stdout, messing up the build logs.
4506
7b5cdcbd
JD
45072006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4508
4509 * data/yacc.c (yyparse): Wrap the final return from yyparse inside YYID
4510 to make sure that YYID will never be unused. This fixes a 'make
4511 maintainer-check' failure caused by the recent changes to the 'Trivial
4512 grammars' test case, which caused g++ 4.1.0 to complain that YYID was
4513 not used.
4514 * data/glr.c (yyparse): Wrap yyparse's return inside YYID just in case.
4515
5ad0a449
JD
45162006-05-21 Joel E. Denny <jdenny@ces.clemson.edu>
4517
4518 * data/glr.c (yyresolveLocations): Remove bogus YYASSERT that the
4519 state before an empty RHS is always resolved here. Only the location
4520 of that state is guaranteed to be resolved, and that's enough. This
4521 fixes the remaining bug reported by Derek M. Jones in
4522 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4523 * tests/glr-regression.at (Uninitialized location when reporting
4524 ambiguity): Test the above case.
4525 Also, the embedded comments in this test case claim it checks the case
4526 of an empty RHS that has inherited the initial location. However, the
4527 corresponding LHS was already resolved, so yyresolveLocations didn't
4528 actually have reason to modify it. Fix this by forcing
4529 nondeterministic operation at the beginning of the parse.
4530
50cce58e
PE
45312006-05-20 Paul Eggert <eggert@cs.ucla.edu>
4532
4533 * data/c.m4 (b4_yy_symbol_print_generate):
4534 (b4_yy_symbol_print_generate): Use 'YYSTYPE const' rather than
4535 'const YYSTYPE', and similarly for YYLTYPE. This fixes one
4536 of the bugs reported today by Derek M Jones in
4537 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00027.html>.
4538 * doc/bison.texinfo (Value Type): Document that YYSTYPE must be
4539 defined to be a type name without parens or brackets.
4540 (Location Type): Similarly for YYLTYPE.
4541 * tests/regression.at (Trivial grammars): Put in a test for this
4542 bug that will be caught by 'make maintainer-check' (though not,
4543 alas, by 'make check' unless your compiler is picky).
4544
ab8d9dc5
PE
45452006-05-19 Paul Eggert <eggert@cs.ucla.edu>
4546
0d2c8934 4547 * NEWS: Version 2.2.
ab8d9dc5
PE
4548 * configure.ac (AC_INIT): Likewise.
4549
9138c575
JD
45502006-05-17 Joel E. Denny <jdenny@ces.clemson.edu>
4551
4552 * data/glr.c (yyreportTree): Make room in yystates for the state
4553 preceding the RHS. This fixes the segmentation fault reported by Derek
4554 M. Jones in
4555 <http://lists.gnu.org/archive/html/help-bison/2006-05/msg00035.html>.
4556 (yyreportTree, yypdumpstack): Subtract 1 from yyrule before printing
4557 to the user. Reported for yyreportTree by Derek M. Jones later in the
4558 same thread.
4559 * THANKS: Add Derek M. Jones.
4560 Update my email address.
4561 Fix typo in Steve Murphy's name.
4562
276f48df
PE
45632006-05-14 Paul Eggert <eggert@cs.ucla.edu>
4564
d6645148
PE
4565 * data/glr.c (yyreportSyntaxError): Fix off-by-one error in
4566 checking against YYLAST that caused the parser to miss a potential
4567 alternative in its diagnostic.
4568 Problem reported by Maria Jose Moron Fernandez in
4569 <http://lists.gnu.org/archive/html/bug-bison/2006-05/msg00024.html>.
4570 * data/lalr1.cc (yysyntax_error_): Likewise.
4571 * data/yacc.c (yysyntax_error): Likewise.
4572 * tests/regression.at (_AT_DATA_DANCER_Y): Use static array for
4573 tokens, in case we run into an older C compiler.
4574 (_AT_DATA_EXPECT2_Y, AT_CHECK_EXPECT2): New macros.
4575 Use them to check for the off-by-one error fixed above.
4576
276f48df
PE
4577 * data/yacc.c (yytnamerr): Fix typo: local var should be of type
4578 YYSIZE_T, not size_t.
4579 * tests/regression.at (Trivial grammars): New test, to catch
4580 the error fixed by the above patch.
4581
cd8b5791
AD
45822006-05-14 Akim Demaille <akim@lrde.epita.fr>
4583
4584 * doc/bison.texinfo (C++ Bison Interface): Clarify the naming
4585 scheme.
4586 Reported by Steve Murphy.
4587
34376418
AD
45882006-05-14 Akim Demaille <akim@lrde.epita.fr>
4589
4590 * data/glr.cc, data/lalr1.cc: Using %defines is mandatory.
4591 * data/glr.cc: b4_location_flag is now b4_locations_flag.
4592
327afc7c
AD
45932006-05-14 Akim Demaille <akim@lrde.epita.fr>
4594
4595 Implement --trace=m4.
4596 * src/getargs.c (trace_types, trace_args): Accept trace_m4.
4597 * src/output.c (output_skeleton): When set, pass -dV to m4.
4598
4599 Factor the handling of flags in m4.
4600 * src/output.c (prepare): Rename the muscle names debug, defines,
4601 error_verbose to debug_flag, defines_flag, error_verbose_flag.
4602 * data/c.m4: Adjust.
4603 (_b4_define_flag_if, b4_define_flag_if, b4_defines_if): New.
4604 Use b4_define_flag_if to define other b4_FLAG_if macros.
4605 (b4_location_if): As a consequence, rename as...
4606 (b4_locations_if): this, for consistency.
4607 Adjust all the skeletons.
4608
ba9ecd19
AD
46092006-05-14 Akim Demaille <akim@lrde.epita.fr>
4610
4611 * etc/bench.pm: Shorten bench names.
4612
4e83ea15
AD
46132006-05-14 Akim Demaille <akim@lrde.epita.fr>
4614
4615 * src/output.h, src/output.c (error_verbose): Move to...
4616 * src/getargs.h, src/getargs.c: here.
4617 Sort the flags.
4618 Adjust dependencies.
4619
6e93d810
PE
46202006-05-13 Paul Eggert <eggert@cs.ucla.edu>
4621
4622 * data/c.m4 (b4_copyright): Put the special exception for Bison
4623 skeletons here, so we don't have to put it in each skeleton. All
b15296ff
PE
4624 uses changed. Suggested by Akim Demaille. Also, wrap the
4625 copyright notice, in case it is longer than 80 columns. Replace
4626 comma by newline after title.
6e93d810 4627
eaea13f5
PE
46282006-05-11 Paul Eggert <eggert@cs.ucla.edu>
4629
4630 * doc/bison.texinfo (Calc++ Scanner): The flex behavior is an
4631 incompatibility, not a bug. Mention that it wasn't fixed as of
4632 flex 2.5.33.
4633
3cf084ec
AD
46342006-05-11 Akim Demaille <akim@lrde.epita.fr>
4635
4636 * examples/extexi: Enforce the precedence of concatenation over
4637 >>.
0a9f1c7d 4638 Reported by Tommy Nordgren.
3cf084ec 4639
32c96bd7
AD
46402006-05-11 Akim Demaille <akim@lrde.epita.fr>
4641
4642 * data/lalr1.cc (yytranslate_): Rename token as t to avoid clashes
4643 with the member "token".
f94705b2 4644 Reported by Martin Nylin.
32c96bd7 4645
eaea13f5
PE
46462006-05-08 Paul Eggert <eggert@cs.ucla.edu>
4647
4648 * data/glr.c: Switch to Bison 2.2 special-exception language in
4649 the copyright notice. Use more-regular format for titles and
4650 copyright notices.
4651 * data/glr.cc: Likewise.
4652 * data/location.cc: Likewise.
4653 * data/yacc.cc: Likewise.
4654 * doc/bison.texinfo (Conditions): Document this.
4655 * NEWS: likewise. Upgrade version to 2.2.
4656
6e2d1146
AD
46572006-04-27 Akim Demaille <akim@lrde.epita.fr>
4658
4659 * data/glr.cc: Remove dead code.
4660
47671055
PE
46612006-04-25 Paul Eggert <eggert@cs.ucla.edu>
4662
4663 * bootstrap: Comment out the AM_CPPFLAGS line, since we don't use
4664 that variable and the line breaks the bootstrap. Problem reported
4665 by Juan M. Guerrero.
4666
ed2e6384
AD
46672006-04-24 Akim Demaille <akim@lrde.epita.fr>
4668
4669 * doc/bison.texinfo (Multiple start-symbols): New.
4670
3cedc2dc
AD
46712006-04-24 Akim Demaille <akim@lrde.epita.fr>
4672
4673 * etc/README, etc/bench.pl: New.
4674
b2ddc3f3
AD
46752006-04-03 Akim Demaille <akim@lrde.epita.fr>
4676
4677 * src/scan-gram.l: Be robust to BRACED_CODE appearing before any
4678 rule.
4679 Reported by Mickael Labau.
4680 * tests/input.at (Torturing the Scanner): Test it.
4681
91e3ac9a
PE
46822006-03-16 Paul Eggert <eggert@cs.ucla.edu>
4683
4684 * doc/bison.texinfo (Decl Summary): Don't mention yylloc twice.
4685 Problem reported by Bob Rossi.
4686
46872006-03-13 Paul Eggert <eggert@cs.ucla.edu>
4688
4689 * doc/bison.texinfo: Remove @shorttitlepage stuff; it wasn't used
4690 and didn't really work.
4691 For the index, use @ifnotinfo, not @iftex.
4692 Minor cleanups of spacing and terminology.
4693
5cf61e93
AD
46942006-03-12 Akim Demaille <akim@lrde.epita.fr>
4695
4696 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Fix the definition
4697 of AT_NAME_PREFIX when %name-prefix is not used.
4698
aa08666d
AD
46992006-03-12 Akim Demaille <akim@lrde.epita.fr>
4700
4701 Apply --prefix to C++ skeletons too: they change the namespace.
4702 The test suite already exercize these cases.
4703 * data/c++.m4 (b4_namespace): New.
4704 * data/lalr1.cc, data/glr.cc, data/location.cc: Use it instead of `yy'.
4705 * data/lalr1.cc (yytnameerr_): Move its definition into the namespace.
4706 * data/yacc.c, data/glr.c: Remove a useless `[]'.
4707 * doc/bison.texinfo: Document it.
4708 (Option Cross Key): Use @multitable in all formats. It looks
4709 nicer, even in TeX outputs.
4710 (Rules): Use the same code whatever the output type is.
4711 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS)
4712 (_AT_BISON_OPTION_POPDEFS): Support AT_NAME_PREFIX.
4713 * tests/calc.at: Use it, instead of hard coding `yy'.
91e3ac9a 4714
45567173
AD
47152006-03-10 Akim Demaille <akim@lrde.epita.fr>
4716
4717 * TODO: Remove dead items.
4718
e9d8f881 47192006-03-10 Akim Demaille <akim@lrde.epita.fr>
55ba27be
AD
4720
4721 * doc/FAQ: Remove, merged into...
4722 * doc/bison.texinfo (FAQ): this.
4723 * doc/Makefile.am (EXTRA_DIST): Adjust.
4724
c095d689
AD
47252006-03-10 Akim Demaille <akim@lrde.epita.fr>
4726
4727 * data/c.m4 (b4_token_enum): Always define the enum of tokens,
4728 even if empty.
4729 * data/lalrl1.cc, data/glr.cc (parser::token_type): New.
4730 * doc/bison.texinfo (Calc++ Scanner): Use it.
4731
6e0f8287
PE
47322006-03-09 Paul Eggert <eggert@cs.ucla.edu>
4733
4734 Fix two nits reported by twlevo, plus one more that I discovered.
4735
4736 * src/assoc.h (assoc_to_string): Give a name to the arg, as
4737 this is the usual Bison style.
4738 * src/location.h (location_print): Likewise.
4739
4740 * src/reader.h (token_name): Likewise.
4741
d6b771c3
PE
47422006-03-08 Paul Eggert <eggert@cs.ucla.edu>
4743
4744 Fix some nits reported by twlevo.
4745 * doc/FAQ: Remove ancient Y2K FAQ, replacing it with "secure"
4746 and "POSIX". Use more-modern syntax for URLs. Mention C++
4747 and ask for Java. Don't hardwire OS version numbers. Add
4748 copyright notice.
4749 * m4/.cvsignore: Add unistd_h.m4, for latest gnulib.
4750 * src/conflicts.c (solved_conflicts_obstack): Now static.
4751
1e137b71
JD
47522006-03-08 Joel E. Denny <jdenny@ces.clemson.edu>
4753
4754 * doc/bison.texinfo (Introduction): Mention GLR and C++ as on the web
4755 page. Say "you can use it" not "you may use it" as on the web page;
4756 we're describing capabilities not granting permission.
4757
73f2e47e
PE
47582006-03-06 Paul Eggert <eggert@cs.ucla.edu>
4759
6d05403d
PE
4760 * data/glr.c (yyresolveLocations): Rename local variables to avoid
4761 shadowing warnings. Use usual patter for iterating through RHS.
4762 * tests/glr-regression.at
4763 (Uninitialized location when reporting ambiguity):
4764 Modify yylex so that it uses its argument, rather than trying
4765 to rely on ARGSUSED (which doesn't work for gcc with warnings).
4766 const char -> char const.
4767
73f2e47e
PE
4768 * tests/Makefile.am ($(srcdir)/package.m4, maintainer-check-valgrind):
4769 Don't use tabs inside commands; it messes up 'ps'.
4770 Problem reported by twlevo.
4771
8710fc41
JD
47722006-03-06 Joel E. Denny <jdenny@ces.clemson.edu>
4773
4774 * tests/glr-regression.at (Uninitialized location when reporting
4775 ambiguity): New test case.
4776 * data/glr.c (yyresolveLocations): New function, which uses
4777 YYLLOC_DEFAULT.
4778 (yyresolveValue): Invoke yyresolveLocations before reporting an
4779 ambiguity.
4780 * doc/bison.texinfo (Default Action for Locations): Note
4781 YYLLOC_DEFAULT's usage for ambiguity locations.
4782 (GLR Semantic Actions): Cross-reference those notes.
4783
ae952af2
JD
47842006-03-04 Joel E. Denny <jdenny@ces.clemson.edu>
4785
4786 * tests/glr-regression.at (Leaked semantic values when reporting
4787 ambiguity): Remove unnecessary union and type declarations.
4788 (Leaked lookahead after nondeterministic parse syntax error): New test
4789 case.
4790 * data/glr.c (yyparse): Check for zero stacks remaining before
4791 attempting to shift the lookahead so that you don't lose it.
4792
35ee866a
JD
47932006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4794
4795 Avoid memory leaks by not invoking longjmp in yyreportAmbiguity.
4796 * tests/glr-regression.at (Leaked semantic values when reporting
4797 ambiguity): New test case.
4798 * data/glr.c (yyreportAmbiguity): Invoke yyyerror directly and return
4799 yyabort rather than invoking yyFail, which invokes longjmp. Remove the
4800 now unnecessary yystackp parameter.
4801 (yyresolveValue): Return yyreportAmbiguity's result. Now the necessary
4802 destructors can be called.
4803
4804 * tests/glr-regression.at: Don't invoke bison with `-t' unnecessarily
4805 in existing testcases.
4806
520181ab
JD
48072006-03-02 Joel E. Denny <jdenny@ces.clemson.edu>
4808
4809 Don't leak semantic values for parent RHS when a user action cuts the
4810 parser, and clean up related code a bit.
4811 * tests/glr-regression.at (Leaked merged semantic value if user action
35ee866a
JD
4812 cuts parse): Rename to...
4813 (Leaked semantic values if user action cuts parse): ... this. Add check
520181ab
JD
4814 for leaked parent RHS values.
4815 * data/glr.c (yydestroyGLRState): In debugging output, distinguish
4816 between an unresolved state (non-empty chain of semantic options) and
4817 an incomplete one (signaled by an empty chain).
ae952af2 4818 (yyresolveStates): Document the interface. Move all manipulation of a
520181ab
JD
4819 successfully or unsuccessfully resolved yyGLRState to...
4820 (yyresolveValue): ... here so that yyresolveValue always leaves a
4821 yyGLRState with consistent data and thus is easier to understand.
4822 Remove the yyvalp and yylocp parameters since they are always just
4823 taken from the yys parameter. When reporting a discarded merged value
4824 in debugging output, note that it is incompletely merged. Document the
4825 interface.
4826 (yyresolveAction): If resolving any of the RHS states fails, destroy
4827 them all rather than leaking them. Thus, as long as user actions are
4828 written to clean up the RHS correctly, yyresolveAction always cleans up
4829 the RHS of a semantic option. Document the interface.
4830
18d9185c
PE
48312006-02-27 Paul Eggert <eggert@cs.ucla.edu>
4832
4833 * data/glr.c (yyexpandGLRStack): Catch an off-by-one error that
4834 led to a segmentation fault in GNU Pascal. Problem reported
4835 by Waldek Hebisch.
4836
841a7737
JD
48372006-02-21 Joel E. Denny <jdenny@ces.clemson.edu>
4838
4839 * doc/bison.texinfo (Mid-Rule Actions): Explain how to bury a
4840 mid-rule action inside a nonterminal symbol in order to declare a
4841 destructor for its semantic value.
4842
fc3f467f
PE
48432006-02-16 Paul Eggert <eggert@cs.ucla.edu>
4844
4845 * data/yacc.c [(! defined yyoverflow || YYERROR_VERBOSE) && !
4846 YYSTACK_USE_ALLOCA && ! defined YYSTACK_ALLOC && defined
4847 __cplusplus && ! defined _STDLIB_H && !
4848 ((defined YYMALLOC || defined malloc) && (defined YYFREE ||
4849 defined free))]: Include <stdlib.h> rather than rolling our own
4850 declarations of malloc and free, to avoid problems with
4851 incompatible declarations (using 'throw') C++'s stdlib.h. This
4852 should fix Debian bug 340012
4853 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=340012>,
4854 reported by Guillaume Melquiond.
4855
a3af26dd
PE
48562006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4857
4d7bc38c
PE
4858 * NEWS: Clarify symbols versus types in unused-value warnings.
4859
a3af26dd
PE
4860 * configure.ac (AC_INIT): Bump version number.
4861
4e26c69e
PE
48622006-02-13 Paul Eggert <eggert@cs.ucla.edu>
4863
4864 * NEWS: Version 2.1a.
4865 * tests/headers.at (AT_TEST_CPP_GUARD_H): Declare yyerror and yylex,
4866 since C99 requires this.
4867
498e897c
PE
48682006-02-11 Paul Eggert <eggert@cs.ucla.edu>
4869
4870 * m4/c-working.m4: New file.
4871 * configure.ac (BISON_TEST_FOR_WORKING_C_COMPILER): Use it.
4872
57bb17ca
PE
48732006-02-10 Paul Eggert <eggert@cs.ucla.edu>
4874
4875 * Makefile.maint: Merge from coreutils.
4876
0be105dc
PE
48772006-02-09 Paul Eggert <eggert@cs.ucla.edu>
4878
4879 More portability fixes for problems summarized by Nelson H. F. Beebe.
4880
4881 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Catch a
4882 configuration screwup "./configure CC=/opt/SUNWspro/bin/c89
4883 CFLAGS="-xarch=generic64" CXX=/opt/SUNWspro/bin/CC
4884 LDFLAGS="-xarch=generic64" with Sun C 5.7 on Solaris 10; this
4885 messes up because C++ code is compiled in 32-bit mode but linked
4886 in 64-bit mode.
4887
6fc0c024
PE
48882006-02-08 Paul Eggert <eggert@cs.ucla.edu>
4889
4890 More portability fixes for problems summarized by Nelson H. F. Beebe.
4891
7870f699
PE
4892 * doc/bison.texinfo (Calc++ Scanner): Work around a bug in flex
4893 2.5.31. This resembles the 2005-10-10 patch to src/scan-skel.l.
4894
6fc0c024
PE
4895 * examples/calc++/Makefile.am (check_PROGRAMS): Renamed from
4896 nodist_PROGRAMS, since we don't need to actually compile the
4897 example if we're just doing a plain 'make'. This avoids bothering
4898 the installer unnecessarily about problems due to weird C++
4899 compilers.
4900
fe6c2fde
PE
49012006-02-06 Paul Eggert <eggert@cs.ucla.edu>
4902
4903 More portability fixes for problems summarized by Nelson H. F. Beebe.
4904
4905 * tests/headers.at (AT_TEST_CPP_GUARD_H): Use #include <...> rather
4906 than #include "...", and compile with -I'.'. The old method was
4907 not portable, according to Posix and the C standard, and it does
4908 not work with Sun C 5.7, where previous #line directives affect
4909 the working directory used in later #include "..." directives.
4910
927b425b
JMG
49112006-02-06 Juan Manuel Guerrero <juan.guerrero@gmx.de>
4912
4913 Various DJGGP specific issues in /djgpp
4914
d9735e9e
PE
49152006-02-02 Paul Eggert <eggert@cs.ucla.edu>
4916
4917 More portability fixes for problems summarized by Nelson H. F. Beebe.
4918
4919 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check that
4920 '#include <map>' works and that you can apply ++ to iterators.
4921
5a6755af
PE
49222006-02-01 Paul Eggert <eggert@cs.ucla.edu>
4923
67a0dc4f
PE
4924 Work around portability problems summarized by Nelson H. F. Beebe in
4925 <http://lists.gnu.org/archive/html/bug-bison/2005-09/msg00021.html>.
4926
8c86f0ef
PE
4927 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
4928 that '#include <string>' works.
4929
de35dd59
PE
4930 * data/lalr1.cc (yytranslate_): No longer inline, to work around a
4931 porting problem to g++ 3.4.3 on Darwin 7.9.0, where g++ complained
4932 "warning: sorry: semantics of inline function static data `const
4933 unsigned char translate_table[262]' are wrong (you'll wind up with
4934 multiple copies)".
4935
67a0dc4f
PE
4936 * lib/bbitset.h (struct bitset_vtable): Rename members not, and,
4937 or, xor to not_, and_, or_, and xor_, respectively. This works
4938 around a bug in GCC 3.4.3 on Irix 6.5, which apparently has a
4939 random system header somewhere that includes the equivalent of
4940 <iso646.h>.
4941
5a6755af
PE
4942 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that "$CC
4943 -E" works; it apparently doesn't work with PathScale EKO Compiler
67a0dc4f 4944 Suite Version 2.0.
5a6755af 4945
3f001415
JD
49462006-01-30 Joel E. Denny <jdenny@ces.clemson.edu>
4947
4948 During deterministic GLR operation, user actions should be able to
4949 influence the parse by changing yychar. To make this easier to fix and
4950 to make glr.c easier to evolve in general, don't maintain yytoken in
4951 parallel with yychar; just compute yytoken when needed.
4952 * tests/glr-regression.at (Incorrect lookahead during deterministic
4953 GLR): Check that setting yychar in a user action has the intended
4954 effect.
4955 * data/glr.c (yyGLRStack): Remove yytokenp member.
4956 (yyclearin): Don't set *yytokenp.
4957 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Examine
4958 yychar rather than *yytokenp to determine the current lookahead.
4959 Compute yytoken locally when needed.
4960 (yyparse): Likewise. Remove the local yytoken that yytokenp used to
4961 point to.
4962
4963 * doc/bison.texinfo (Bison Options): Remove stray sentence fragment
4964 after `--report' documentation.
4965
e2a8c0f5
PE
49662006-01-30 Paul Eggert <eggert@cs.ucla.edu>
4967
4968 * src/parse-gram.y (grammar_declaration): Location of printer
4969 symbol is @1, not list->location. Bug reported by twlevo.
4970 * tests/input.at (Incompatible Aliases): Adjust to above change.
4971
6b702268
PE
49722006-01-29 Paul Eggert <eggert@cs.ucla.edu>
4973
27622431
PE
4974 * tests/input.at (AT_CHECK_UNUSED_VALUES): Remove. Instead, do
4975 all the test at once. This makes the output easier to read in the
4976 normal case.
4977
6b702268
PE
4978 Fix a longstanding bug uncovered by bro-0.9a9/src/parse.y, which I
4979 got from <http://bro-ids.org/download.html>. The bug is that
4980 when two actions appeared in succession, the second one was
4981 scanned before the first one was added to the grammar rule
4982 as a midrule action. Bison then output the incorrect warning
4983 "parse.y:905.17-906.36: warning: unused value: $3".
4984 * src/parse-gram.y (BRACED_CODE, action): These are no longer
4985 associated with a value.
4986 (rhs): Don't invoke grammar_current_rule_action_append.
4987 (action): Invoke it here instead.
4988 * src/reader.c (grammar_midrule_action): Now extern.
4989 (grammar_current_rule_action_append): Don't invoke
4990 grammar_midrule_action; that is now the scanner's job.
4991 * src/reader.h (last_string, last_braced_code_loc):
4992 (grammar_midrule_action): New decls.
4993 * src/scan-gram.l (last_string): Now extern, sigh.
4994 (last_braced_code_loc): New extern variable.
4995 (<INITIAL>"{"): Invoke grammar_midrule_action if the current
4996 rule already has an action.
4997 (<SC_BRACED_CODE>"}"): Set last_braced_code_loc before returning.
4998 * tests/input.at (AT_CHECK_UNUSED_VALUES):
4999 Add some tests to check that the above changes fixed the bug.
5000
d40ba6c2
PE
50012006-01-27 Paul Eggert <eggert@cs.ucla.edu>
5002
5003 * src/reader.c (symbol_should_be_used): Renamed from symbol_typed_p.
5004 All used changed. Check whether the symbol has a destructor,
5005 not whether it is typed.
5006 * tests/input.at (AT_CHECK_UNUSED_VALUES): Add a destructor, so
5007 that the values are still reported as unused. All line numbers
5008 adjusted.
5009
401aace6
PE
50102006-01-23 Paul Eggert <eggert@cs.ucla.edu>
5011
5012 Work around a bug in bro 0.8, which underparenthesizes its
5013 definition of YYLLOC_DEFAULT.
5014 * data/glr.c: Change all uses of YYLLOC_DEFAULT to parenthesize
5015 their arguments.
5016 * data/lalr1.cc: Likewise.
5017 * data/yacc.cc: Likewise.
5018
06f01bc4
PE
50192006-01-22 Paul Eggert <eggert@cs.ucla.edu>
5020
401aace6
PE
5021 Work around a bug in Pike 7.0, and give the Pike folks a
5022 better way to override the usual int widths.
5023 * data/yacc.c (b4_int_type): Use yytype_uint8, etc., so that the
5024 user can override the types.
5025 (short): #undef, to work around a bug in Pike 7.0.
5026 (yytype_uint8, yytype_int8, yytype_uint16, yytype_int16): New types.
5027 (union yyalloc.yyss): Use yytype_int16 rather than short.
5028 All uses changed.
5029 (yysigned_char): Remove.
5030 * src/parse-gram.y (YYTYPE_UINT8, YYTYPE_INT8, YYTYPE_UINT16):
5031 (YYTYPE_INT16): New macros, to test the new facility in yacc.c.
5032 * tests/regression.at (Web2c Actions): Adjust to above changes.
5033
5034 * src/reader.c (check_and_convert_grammar): New function.
5035 (reader): Close the input file even if something went wrong during
5036 parsing. Minor file descriptor leak reported by twlevo.
5037
06f01bc4
PE
5038 * src/assoc.c (assoc_to_string): Use a default: abort (); case
5039 to pacify gcc -Wswitch-default.
5040 * src/scan-gram.l (adjust_location): Use a default: break; case
5041 to pacify gcc -Wswitch-default.
5042 * src/scan-skel.h (skel_get_lineno, skel_get_in, skel_get_out):
5043 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
5044 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
5045 Move these decls to scan-skel.l, since they don't need to be
5046 visible elsewhere.
5047 * src/scan-skel.l: Accept the above decls.
5048 (skel_lex): New decl, to pacify GCC when unpatched flex 2.5.31
5049 is used.
5050
02650b7f
PE
50512006-01-21 Paul Eggert <eggert@cs.ucla.edu>
5052
5053 * Makefile.cfg (local-checks-to-skip): Add changelog-check,
5054 since we don't want to insist on a version number at the start
5055 of the changelog every time.
5056 * Makefile.maint: Sync from coreutils a bit better.
5057 (sc_trailing_blank): Renamed from sc_trailing_space.
5058 All uses changed.
5059 (sc_no_if_have_config_h, sc_require_config_h):
5060 (sc_prohibit_assert_without_use): New rules.
5061 (sc_obsolete_symbols): Don't catch Makefile.maint itself.
5062 (sc_dd_max_sym_length): Fix leading spaces in rule.
5063 (sc_system_h_headers): Prefix with @.
5064 (sc_useless_cpp_parens, m4-check): Output line numbers.
5065 (changelog-check): Allow version only in head.
5066 * data/c.m4: Use "defined FOO" instead of "defined (FOO)", to
5067 satisfy new Makefile.maint rule.
5068 * data/glr.c: Likewise.
5069 * data/glr.cc: Likewise.
5070 * data/lalr1.cc: Likewise.
5071 * data/yacc.c: Likewise.
5072 * lib/ebitsetv.c: Likewise.
5073 * lib/lbitset.c: Likewise.
5074 * lib/subpipe.c: Likewise.
5075 * lib/timevar.c: Likewise.
5076 * src/system.h: Likewise.
5077 * data/yacc.c (YYSTYPE): Don't generate trailing spaces in output.
5078 * djgpp/Makefile.maint: Add copyright notice.
5079 * djgpp/README.in: Likewise.
5080 * djgpp/config.bat: Likewise.
5081 * djgpp/config.site: Likewise.
5082 * djgpp/config_h.sed: Likewise.
5083 * djgpp/djunpack.bat: Likewise.
5084 * djgpp/config.sed: Fix copyright notice to match standard format.
5085 * djgpp/subpipe.h: Likewise.
5086 * lib/bitsetv-print.c: Likewise.
5087 * lib/bitsetv.c: Likewise.
5088 * lib/subpipe.h: Likewise.
5089 * lib/timevar.c: Likewise.
5090 * lib/timevar.h: Likewise.
5091 * djgpp/subpipe.c: Use standard recipe for config.h.
5092 * lib/abitset.c: Likewise.
5093 * lib/bitset.c: Likewise.
5094 * lib/bitset_stats.c: Likewise.
5095 * lib/bitsetv-print.c: Likewise.
5096 * lib/bitsetv.c: Likewise.
5097 * lib/ebitsetv.c: Likewise.
5098 * lib/get-errno.c: Likewise.
5099 * lib/lbitset.c: Likewise.
5100 * lib/subpipe.c: Likewise.
5101 * lib/timevar.c: Likewise.
5102 * lib/vbitset.c: Likewise.
5103 * tests/local.at: Likewise.
5104 * src/scan-gram.l: Don't include verify.h, since system.h does
5105 that for us.
5106 * .x-sc_require_config_h: New file.
5107 * .x-sc_unmarked_diagnostics: New file.
5108
287c78f6
PE
51092006-01-20 Paul Eggert <eggert@cs.ucla.edu>
5110
287c78f6
PE
5111 Be a bit more systematic about using 'abort'.
5112 * lib/abitset.c (abitset_test): Remove ATTRIBUTE_UNUSED; not needed.
5113 * lib/bitset.c (bitset_bytes, bitset_init, bitset_op4_cmp):
5114 Put 'default: abort ();' before some other case, to satisfy older
5115 pedantic compilers.
5116 * lib/bitset_stats.c (bitset_stats_init): Likewise.
5117 * lib/ebitset.c (ebitset_elt_find, ebitset_op3_cmp): Likewise.
5118 * lib/lbitset.c (lbitset_elt_find, lbitset_op3_cmp): Likewise.
5119 * src/conflicts.c (resolve_sr_conflict): Likewise.
68cae94e
PE
5120 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str):
5121 (get_decision_str, get_orientation_str, get_node_alignment_str):
5122 (get_arrow_mode_str, get_crossing_type_str, get_view_str):
5123 (get_linestyle_str, get_arrowstyle_str): Likewise.
5124 * src/conflicts.c (resolve_sr_conflict):
5125 Use a default case rather than one for the one remaining enum
5126 value, to catch invalid enum values as well.
5127 * src/lalr.c (set_goto_map, map_goto):
5128 Prefer "assert (FOO);" to "if (!FOO) abort ();".
5129 * src/nullable.c (nullable_compute, token_definitions_output):
5130 Likewise.
5131 * src/reader.c (packgram, reader): Likewise.
5132 * src/state.c (transitions_to, state_new, state_reduction_find):
5133 Likewise.
5134 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias):
5135 (symbol_pack): Likewise.
5136 * src/tables.c (conflict_row, pack_vector): Likewise.
287c78f6
PE
5137 * src/scan-skel.l (QPUTS): Remove unnecessary parens.
5138 (BASE_QPUTS, "@output ".*\n): Remove unnecessary asserts.
68cae94e
PE
5139 * src/system.h: Don't include <assert.h>.
5140 (assert): New macro.
5141
5142 * doc/bison.texinfo (Prologue, Rules, Actions, Union Decl, Action Decl):
5143 (Destructor Decl, Parser Function, Pure Calling):
5144 Describe rules for braces inside C code more carefully.
287c78f6 5145
c66dfadd
PE
51462006-01-19 Paul Eggert <eggert@cs.ucla.edu>
5147
c21493b8
PE
5148 Fix some porting glitches found by Nelson H. F. Beebe.
5149 * lib/abitset.c (abitset_resize): Rewrite to avoid warnings from
5150 compilers that don't understand that abort () does not return.
5151 * src/state.c (transitions_to): Likewise.
5152 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check
5153 that '#include <cstdlib>' works.
5154 * src/system.h (INT8_MIN, INT16_MIN, INT32_MIN, INT8_MAX):
5155 (INT16_MAX, UINT8_MAX, INT32_MAX, UINT16_MAX, UINT32_MAX):
5156 #undef if ! defined __STDC_VERSION__ || __STDC_VERSION__ < 199901,
5157 for the benefit of some pre-C99 compilers.
5158
b6e3facf
PE
5159 * bootstrap: Undo changes to gnulib files that autoreconf made.
5160
c66dfadd
PE
5161 Minor fixups to get 'make maintainer-check' to work.
5162 * configure.ac: Don't use -Wnested-externs, as it's incompatible
5163 with the new verify.h implementation.
5164 * data/c.m4 (b4_yy_symbol_print_generate): YYUSE (yyoutput).
5165 * data/glr.c (YYUSE): Depend on __GNUC__ as well.
5166 * data/yacc.c (YYUSE): Likewise.
5167 * data/lalr1.cc (yysyntax_error_): YYUSE (yystate).
5168 * lib/subpipe.c (end_of_output_subpipe): The args are unused.
5169 * src/parse-gram.y (declaration): Don't pass a string constant
5170 to a function that expects char *, since GCC might complain
5171 about the constant value.
5172 * src/reader.c (symbol_typed_p): Add parens to pacify GCC.
5173 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): #undef yylloc and yylval
5174 before #defining them.
5175 * tests/glr-regression.at
5176 (Incorrectly initialized location for empty right-hand side in GLR):
5177 In yyerror, use the msg arg.
5178 (Corrupted semantic options if user action cuts parse):
5179 (Incorrect lookahead during deterministic GLR):
5180 (Incorrect lookahead during nondeterministic GLR):
5181 Don't name a local var 'index'; it shadows string.h's 'index'.
5182
ed94ef2a
AD
51832006-01-19 Akim Demaille <akim@epita.fr>
5184
5185 * tests/calc.at (_AT_DATA_CALC_Y): Initialize the whole initial
5186 location, not just parts of it.
5187
e9ad4aec
PE
51882006-01-18 Paul Eggert <eggert@cs.ucla.edu>
5189
d6ca7905
PE
5190 * NEWS: Document the fact that multiple %unions are now allowed.
5191 * doc/bison.texinfo (Union Decl): Likewise.
51cbef6f
PE
5192 * TODO: This feature is now implemented, so remove it from
5193 the wishlist.
d6ca7905 5194
ef1b70e0
PE
5195 * Makefile.maint: Merge with coreutils Makefile.maint.
5196 (CVS_LIST): Use build-aux version if available.
5197 (VERSION_REGEXP): New macro.
5198 (syntax-check-rules): Add sc_no_if_have_config_h,
5199 sc_prohibit_assert_without_use, sc_require_config_h,
5200 sc_useless_cpp_parens.
5201 (sc_obsolete_symbols): Check for O_NDELAY.
5202 (sc_dd_max_sym_length): Track coreutils.
5203 (sc_unmarked_diagnostics): Look in all files, not just *.c.
5204 (sc_useless_cpp_parens): New rule.
5205 (news-date-check): Look for version or today's date.
5206 (changelog-check): Don't require version number near head.
5207 (copyright-check): Use current year instead of hardwiring 2005.
5208 (my-distcheck): Depend on $(release_archive_dir)/$(prev-tgz).
5209 (announcement): Add --gpg-key-ID.
5210
5211 * djgpp/config.sed: Add copyright notice, and replace "filesystem"
5212 with "file system".
5213
2073ce56 5214 Avoid undefined behavior that addressed just before the start of an
e9ad4aec
PE
5215 array. Problem reported by twlevo.
5216 * src/reader.c (packgram): Prepend a new sentinel before ritem.
5217 * src/lalr.c (build_relations): Rely on new sentinel.
5218 * src/gram.c (gram_free): Adjust to new sentinel.
5219
b7691f15
JD
52202006-01-12 Joel E. Denny <jdenny@ces.clemson.edu>
5221
5222 * data/glr.c (yyGLRStateSet): Rename yylookaheadStatuses to
5223 yylookaheadNeeds. All uses updated.
5224 (yysplitStack): Rename local yynewLookaheadStatuses to
5225 yynewLookaheadNeeds.
5226 * data/glr-regression.at (Incorrect lookahead during nondeterministic
5227 GLR): In comments, change `lookahead status' to `lookahead need'.
5228
ddee1b06
PH
52292006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5230
5231 * data/glr.c (yysplitStack): A little stylistic rewrite.
5232
12f4614d
PH
52332006-01-11 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5234
5235 * data/glr.c (yyaddDeferredAction): Flesh out the comment.
5236
32c29292
JD
52372006-01-11 Joel E. Denny <jdenny@ces.clemson.edu>
5238
5239 * doc/bison.texinfo: Fix some typos.
5240 (GLR Semantic Actions): New subsection discussing special
5241 considerations because GLR semantic actions might be deferred.
5242 (Actions): Mention look-ahead usage of yylval.
5243 (Actions and Locations): Mention look-ahead usage of yylloc.
5244 (Special Features for Use in Actions): Add YYEOF entry and mention it
5245 in the yychar entry.
5246 In the yychar entry, remove mention of the local yychar case (pure
5247 parser) since this is irrelevant information when writing semantic
148d66d8 5248 actions and since it's already discussed in `Table of Symbols' where
32c29292
JD
5249 yychar is otherwise described as an external variable.
5250 In the yychar entry, don't call it the `current' look-ahead since it
5251 isn't when semantic actions are deferred.
5252 In the yychar and yyclearin entries, add note about deferred semantic
5253 actions.
5254 Add yylloc and yylval entries discussing look-ahead usage.
5255 (Look-Ahead Tokens): When discussing yychar, don't call it the
5256 `current' look-ahead, and do mention yylval and yylloc.
5257 (Error Recovery): Cross-reference `Action Features' when mentioning
5258 yyclearin.
148d66d8 5259 (Table of Symbols): In the yychar entry, don't call it the `current'
32c29292
JD
5260 look-ahead.
5261 In the yylloc and yylval entries, mention look-ahead usage.
5262
de366a2f 52632006-01-08 Joel E. Denny <jdenny@ces.clemson.edu>
2781dbd1
JD
5264
5265 * tests/glr-regression.at: Update copyright year to 2006.
5266
bf70fa87
JD
52672006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5268
5269 * data/glr.c (yyGLRStateSet): Add yybool* yylookaheadStatuses member to
5270 use during nondeterministic operation to track which stacks have
5271 actually needed the current lookahead.
5272 (yyinitStateSet, yyfreeStateSet, yyremoveDeletes, yysplitStack):
5273 Allocate, deallocate, resize, and otherwise shuffle space for
5274 yylookaheadStatuses in parallel with yystates member of yyGLRStateSet.
5275 (yysplitStack, yyprocessOneStack, yyparse): Set lookahead status
5276 appropriately during nondeterministic operation.
5277 (yySemanticOption): Add int yyrawchar, YYSTYPE yyval, and YYLTYPE yyloc
5278 members to store the current lookahead to be used by the deferred
5279 user action.
5280 (yyaddDeferredAction): Add size_t yyk parameter specifying the stack
5281 from which the RHS is taken. Set the lookahead members of the new
5282 yySemanticOption according to the lookahead status for stack yyk.
5283 (yyglrShiftDefer, yyglrReduce): Pass yyk parameter on to
5284 yyaddDeferredAction.
5285 (yyresolveAction): Set yychar, yylval, and yylloc to the lookahead
5286 members of yySemanticOption before invoking yyuserAction, and then set
5287 them back to their current values afterward.
5288 (yyparse): Set yychar = YYEMPTY where yytoken = YYEMPTY.
5289 (yyreportAmbiguity): Add /*ARGSUSED*/ to pacify lint.
5290 * tests/glr-regression.at: Remove `.' from the ends of recent test case
5291 titles for consistency.
5292 (Leaked merged semantic value if user action cuts parse): In order to
5293 suppress lint warnings, use arguments in merge function, and assign
5294 char value < 128 in main.
5295 (Incorrect lookahead during deterministic GLR): New test case.
5296 (Incorrect lookahead during nondeterministic GLR): New test case.
5297
05449a2c
JD
52982006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
5299
de366a2f 5300 * data/c.m4 (b4_yy_symbol_print_generate): In yy_symbol_print, accept
05449a2c
JD
5301 !yyvaluep as signal that no semantic value is available to print.
5302 * data/glr.c (yydestroyGLRState): If state is not resolved, don't try
5303 to print a semantic value.
5304
4158e0a1 53052006-01-06 Joel E. Denny <jdenny@ces.clemson.edu>
fd2493f7 5306
4158e0a1
JD
5307 * tests/glr-regression.at: For consistency with my newer test cases,
5308 don't thank myself.
5309
d659304d
JD
53102006-01-05 Joel E. Denny <jdenny@ces.clemson.edu>
5311
5312 * data/glr.c (yyresolveValue): When merging semantic options, if at
5313 least one user action succeeds but a later one cuts the parse, then
5314 destroy the semantic value before returning rather than leaking it.
5315 (yyresolveStates): If a user action cuts the parse and thus
5316 yyresolveValue fails, ignore the (unset) semantic value rather than
5317 corrupting the yyGLRState, and empty the semantic options list since
5318 the user actions should have called all necessary destructors.
5319 Simplify code with YYCHK.
5320 * tests/glr-regression.at (Corrupted semantic options if user action
5321 cuts parse): New test case.
5322 (Undesirable destructors if user action cuts parse): New test case.
5323 Before applying any of this patch, this test case never actually failed
5324 for me... but only because the corrupted semantic options usually
5325 masked this bug.
5326 (Leaked merged semantic value if user action cuts parse): New test
5327 case.
5328
6ec2c0f2
AD
53292006-01-05 Akim Demaille <akim@epita.fr>
5330
5331 * src/reader.c, src/symlist.h, src/symlist.c: s/mid_rule/midrule/.
5332
1b9c21fb
PE
53332006-01-04 Paul Eggert <eggert@cs.ucla.edu>
5334
5335 * data/c.m4 (b4_c_modern): New macro, with a new provision for
5336 _MSC_VER. Problem reported by Cenzato Marco.
5337 (b4_c_function_def): Use it.
5338 * data/yacc.c (YYMODERN_C): Remove. All uses replaced by
5339 b4_c_modern.
5340 (yystrlen, yystpcpy, yyparse): Use b4_c_function... macros rather
5341 than rolling our own.
5342
84866159
AD
53432006-01-04 Akim Demaille <akim@epita.fr>
5344
5345 Also warn about non-used mid-rule values.
5346 * src/symlist.h, src/symlist.c (symbol_list): Add a mid_rule
5347 member.
5348 (symbol_list_new): Adjust.
5349 * src/reader.c (symbol_typed_p): New.
5350 (grammar_rule_check): Use it.
5351 (grammar_midrule_action): Bind a mid-rule LHS to its rule.
5352 Check its rule.
5353 * tests/input.at (AT_CHECK_UNUSED_VALUES): New.
5354 Use it.
5355 * tests/actions.at (Exotic Dollars): Adjust.
5356
378f4bd8
AD
53572006-01-04 Akim Demaille <akim@epita.fr>
5358
5359 * src/reader.c (grammar_midrule_action): If $$ is set in a
5360 mid-rule, move the `used' bit to its lhs.
5361 * tests/input.at (Unused values): New.
5362 * tests/actions.at (Exotic Dollars): Adjust: exp is not typed.
5363
e2a21b6f
PE
53642006-01-03 Paul Eggert <eggert@cs.ucla.edu>
5365
54662697
PE
5366 * doc/bison.texinfo (Bison Options): Say more accurately what
5367 --yacc does.
5368 * src/parse-gram.y (rules_or_grammar_declaration): Don't complain
5369 about declarations in the grammar when in Yacc mode, as POSIX does
5370 not require a diagnostic when the grammar uses extensions.
5371
5372 * src/reduce.c (reduce_grammar): Remove unnecessary cast to bool.
5373
073f9288
PE
5374 Warn about dubious constructions like "%token T T".
5375 Reported by twlevo.
5376 * src/symtab.h (struct symbol.declared): New member.
5377 * src/symtab.c (symbol_new): Initialize it to false.
5378 (symbol_class_set): New arg DECLARING, specifying whether
5379 this is a declaration that we want to warn about, if there
5380 is more than one of them. All uses changed.
5381
1221b78a
PE
5382 * data/glr.c, data/glr.cc, data/lalr1.cc, data/yacc.c:
5383 Allow multiple %union directives, whose contents concatenate.
5384 * src/parse-gram.y (grammar_declaration): Likewise.
5385 Use muscle_code_grow, so that we don't need stype_line any more.
5386 All uses changed.
5387
5388 * src/muscle_tab.c (muscle_grow): Fix comment.
5389
e2a21b6f
PE
5390 * ChangeLog, data/c.m4, data/glr.c, data/glr.cc, data/location.cc:
5391 * data/yacc.c, src/getargs.c, src/output.c, tests/cxx-type.at:
5392 Update copyright year to 2006.
5393
8f7e3cf9
AD
53942006-01-03 Akim Demaille <akim@epita.fr>
5395
5396 Have glr.cc pass (some of) the calc.at tests.
5397 * data/glr.cc (b4_parse_param_orig): New.
5398 (b4_parse_param): Improve its definition, and bound it more
5399 clearly in the skeleton.
5400 (b4_epilogue): Append, instead of prepending, in order to keep
5401 #line consistency.
5402 Simplify the generation of auxiliary functions: locations and
5403 purity are mandated.
5404 (b4_global_tokens_and_yystype): Honor it.
5405 * data/location.cc (c++.m4): Don't include it.
5406 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Define AT_GLR_CC_IF
5407 and AT_SKEL_CC_IF.
5408 * tests/calc.at (AT_CHECK_CALC): Rely on AT_SKEL_CC_IF instead of
5409 AT_LALR1_CC_IF.
5410 Be sure to initialize the first position's filename.
5411 (AT_CHECK_CALC_LALR1_CC): Add %location and %defines, they are
5412 mandated anyway.
5413 (AT_CHECK_CALC_GLR_CC): New.
5414 Use it to exercise glr.cc as a lalr1.cc drop-in replacement.
5415
3953ed88
AD
54162006-01-02 Akim Demaille <akim@epita.fr>
5417
5418 * src/output.c (output_skeleton): Don't hard wire the inclusion of
5419 c.m4.
0a96ba81 5420 * data/c++.m4, data/glr.c, data/yacc.c: Include c.m4.
3953ed88
AD
5421 * data/glr.cc: Do not include stack.hh.
5422
9ecafbbf
AD
54232006-01-02 Joel E. Denny <jdenny@ces.clemson.edu>
5424
5425 * data/glr.c: Reformat whitespace with tabs.
5426 (b4_lpure_formals): Remove this unused m4 macro.
5427 * tests/cxx-type.at: Reformat whitespace with tabs.
5428 (_AT_TEST_GLR_CXXTYPES): In union Node, rename node_info to nodeInfo
5429 since it's a member. Rename type to isNterm for clarity.
5430
c4d497a0
AD
54312005-12-29 Akim <akim@sulaco.local>
5432
5433 Let glr.cc catch up with symbol_value_print.
5434 * data/glr.cc (b4_yysymprint_generate): Replace by...
5435 (b4_yy_symbol_print_generate): this.
5436 (yy_symbol_print, yy_symbol_value_print): Declare them.
5437
4517da37
PE
54382005-12-28 Paul Eggert <eggert@cs.ucla.edu>
5439
5440 * src/location.h (boundary): Note that a line or column equal
5441 to INT_MAX indicates an overflow.
5442 * src/scan-gram.l: Include verify.h. Don't include get-errno.h.
5443 (rule_length_overflow, increment_rule_length, add_column_width):
5444 New functions.
5445 (<INITIAL>{id}, <SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'"):
5446 (<SC_BRACED_CODE>"}"):
5447 Use increment_rule_length rather than incrementing it by hand.
5448 (adjust_location, handle_syncline): Diagnose overflow.
5449 (handle_action_dollar, handle_action_at):
5450 Fix bug with monstrosities like $-2147483648.
5451 Remove now-unnecessary checks.
5452 (scan_integer): Verify assumptions and remove now-unnecessary checks.
5453 (convert_ucn_to_byte): Verify assumptions.
5454 (handle_syncline): New arg LOC. All callers changed.
5455 Don't store through a value derived from char const * pointer.
5456
5457 * src/reader.c (grammar_rule_check): Rewrite slightly to avoid
5458 GCC warnings.
5459
e3233bf6
PE
54602005-12-27 Paul Eggert <eggert@cs.ucla.edu>
5461
5462 * src/reader.c (grammar_midrule_action, grammar_symbol_append):
5463 Remove unnecessary forward static decls.
5464
8f3596a6
AD
54652005-12-27 Akim Demaille <akim@epita.fr>
5466
5467 * src/reader.c (grammar_current_rule_check): Also check that $$
5468 is used.
5469 Take the rule to check as argument, hence rename as...
5470 (grammar_rule_check): this.
5471 * src/reader.h, src/reader.c (grammar_rule_begin, grammar_rule_end):
5472 Rename as...
5473 (grammar_rule_begin, grammar_rule_end): these, for consistency.
5474 (grammar_midrule_action, grammar_symbol_append): Now static.
5475 * tests/torture.at (input): Don't rely on the default action
5476 being always performed.
5477 * tests/calc.at: "Set" $$ even when the action is "cut" with
5478 YYERROR or other.
5479 * tests/actions.at (Exotic Dollars): Instead of using unused
5480 values, check that the warning is issued.
5481
721be13c
PE
54822005-12-22 Paul Eggert <eggert@cs.ucla.edu>
5483
5484 * NEWS: Improve wording for unused-value warnings.
5485
a0af42fc
AD
54862005-12-22 Akim Demaille <akim@epita.fr>
5487
5488 * data/lalr1.cc, data/yacc.c, data/glr.c, data/c.m4
5489 (b4_yysymprint_generate): Rename as...
5490 (b4_yy_symbol_print_generate): this.
5491 Generate yy_symbol_print instead of yysymprint.
5492 Generate also yy_symbol_value_print, and use it.
5493
affac613
AD
54942005-12-22 Akim Demaille <akim@epita.fr>
5495
721be13c 5496 * NEWS: Warn about unused values.
affac613
AD
5497 * src/symlist.h, src/symlist.c (symbol_list, symbol_list_new): Add
5498 a `used' member.
5499 (symbol_list_n_get, symbol_list_n_used_set): New.
5500 (symbol_list_n_type_name_get): Use symbol_list_n_get.
5501 * src/scan-gram.l (handle_action_dollar): Flag used symbols.
5502 * src/reader.c (grammar_current_rule_check): Check that values are
5503 used.
5504 * src/symtab.c (symbol_print): Accept 0.
5505 * tests/existing.at: Remove the type information.
5506 Empty the actions.
5507 Remove useless actions (beware of mid-rule actions: perl -000
5508 -pi -e 's/\s*\{\}(?=[\n\s]*[|;])//g').
5509 * tests/actions.at (Exotic Dollars): Use unused values.
5510 * tests/calc.at: Likewise.
5511 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5512 Likewise.
5513
5514 * src/gram.c (rule_useful_p, rule_never_reduced_p): Use
5515 rule_useful_p.
5516
9d9b8b70
PE
55172005-12-21 Paul Eggert <eggert@cs.ucla.edu>
5518
8bb4c753
PE
5519 Undo 2005-12-01 tentative license wording change. The wording is
5520 still being reviewed by the lawyers, and we don't want to wait for
5521 them before publishing a test release. For now, revert to the
5522 previous wording.
5523 * NEWS: Undo 2005-12-01 change.
5524 * data/glr.c: Revert to previous license wording.
5525 * data/glr.cc: Likewise.
5526 * data/lalr1.cc: Likewise.
5527 * data/location.cc: Likewise.
5528 * data/yacc.c: Likewise.
5529
9d9b8b70
PE
5530 * NEWS: Reword %destructor vs YYABORT etc.
5531 * data/glr.c: Use American spacing, for consistency.
5532 * data/glr.cc: Likewise.
5533 * data/lalr1.cc: Likewise.
5534 * data/yacc.c: Likewise.
5535 * data/yacc.c: Reformat comments slightly.
5536 * doc/bison.texinfo: Replace "non-" with "non" when that makes sense,
5537 for consistency. Fix some spelling errors and reword recently-included
5538 text slightly.
5539 * tests/cxx-type.at: Cast results of malloc, for C++.
5540
2c3b392a
AD
55412005-12-21 Joel E. Denny <address@hidden>
5542
5543 * tests/cxx-type.at: Construct a tree, count the parents of shared
5544 nodes, and free each node once and only once. Previously, the memory
5545 for semantic values was leaked instead.
5546
d6cff4dc
AD
55472005-12-21 Joel E. Denny <address@hidden>
5548
5549 * data/glr.c (struct yyGLRStack): If pure, add yyval and yyloc members.
5550 (yylval, yylloc): If pure, #define to yystackp->yyval and
5551 yystackp->yyloc similar to yychar and yynerrs.
5552 (yyparse): If pure, remove local yylval and yylloc. Add local
5553 yystackp to accommodate pure definitions of yylval and yylloc.
5554 (b4_lex_param, b4_lyyerror_args, b4_lpure_args): If pure, change
5555 yylvalp and yyllocp to &yylval and &yylloc.
5556 (nerrs, char, lval, lloc): If pure, add #define's for b4_prefix[]
5557 namespace. Previously, nerrs and char were missing, but lval and lloc
5558 weren't necessary.
5559 (yyprocessOneStack, yyreportSyntaxError, yyrecoverSyntaxError): Remove
5560 yylvalp and yyllocp parameters since, if pure, these are now always
5561 accessible through yystackp. If not pure, they are still accessible
5562 globally.
5563 * data/glr.c, data/yacc.c (YYLLOC_DEFAULT): Change `if (N)' to
5564 `if (YYID (N))' to pacify lint.
5565
a85284cf
AD
55662005-12-21 Akim Demaille <akim@epita.fr>
5567
5568 YYACCEPT, YYERROR, and YYABORT, as user actions, should not
5569 destroy the RHS symbols of a rule.
5570 * data/yacc.c (yylen): Initialize to 0.
5571 Keep its value to the number of items to possibly shift.
5572 In particular, a regular successful parse that ends on YYFINAL by
5573 a (internal) YYACCEPT must not have yylen != 0.
5574 (yyerrorlab, yyreturn): Pop the RHS.
5575 Reorder a bit to emphasize the `shifting' bits of code.
5576 (YYPOPSTACK): Now accept a number of items to pop.
5577 * data/lalr1.cc: Likewise.
5578 * data/glr.c: Formatting changes.
5579 Use goto instead of fall through.
5580 * doc/bison.texinfo (Destructor Decl): Complete.
5581
d508c281
JMG
55822005-12-20 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5583
5584 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5585 * djgpp/Makefile.maint: Fix PACKAGE variable computation.
5586 * djgpp/config.bat: Replace every occurence of the file name
5587 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5588 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5589 * djgpp/config.sed: Replace every occurence of the file name
5590 scan-gram-c.c with c-scan-gram.c. The same for scan-skel-c.c with
5591 c-scan-skel.c to conform with the 8.3 file name restriction on MSDOS.
5592 * djgpp/djunpack.bat: DJGPP specific file.
5593 * djgpp/fnchange.lst: DJGPP specific file.
5594 * djgpp/README.in: Add new information about how to unpack the bison
5595 source on MSDOS and other systems which have 8.3 file name restrictions
5596 using djunpack.bat and fnchange.lst.
5597
3e7a2cd9
PE
55982005-12-12 Paul Eggert <eggert@cs.ucla.edu>
5599
5600 * bootstrap (build_cvs_prefix): Remove; unused.
5601 (CVS_PREFIX): Adjust to yesterday's Savannah reorganization
5602 when getting gnulib.
5603
56042005-12-12 "Joel E. Denny" <jdenny@ces.clemson.edu>
5605
5606 * data/glr.c: Reorder typedef declarations for structs to match order
5607 of struct declarations.
5608 Rename yystack everywhere to yystackp except in yyparse where it's not
5609 a pointer.
5610 (yyglrShift): Change parameter YYSTYPE yysval to YYSTYPE* yyvalp for
5611 consistency.
5612 (yyis_table_ninf): Change 0 to YYID (0) to pacify lint.
5613 (yyreportSyntaxError): Add /*ARGSUSED*/ to pacify lint.
5614 (yyparse): Change while (yytrue) to while ( YYID (yytrue)) to pacify
5615 lint.
5616
877519f8
PE
56172005-12-09 Paul Eggert <eggert@cs.ucla.edu>
5618
0eca5a39
PE
5619 * tests/sets.at (Accept): Fix typos in regular expression used to
5620 sed out the final state number.
5621
2cec9080
PE
5622 Work around portability problem on Solaris 10: flex-generated
5623 files include <stdio.h> before <config.h>, which messes up
5624 because the latter defines __EXTENSIONS__. Address the problem
5625 by creating two new little files that include <config.h> first,
5626 then include the flex-generated files. Rewrite everyone else
5627 to include <config.h> first, as well.
5628 * lib/timevar.c: Always include "config.h".
5629 * src/Makefile.am (bison_SOURCES): Replace scan-gram.l with
5630 scan-gram-c.c, and scan-skel.l with scan-skel-c.c.
5631 (EXTRA_bison_SOURCES): New macro.
5632 * src/scan-gram-c.c, src/scan-skel-c.c: New files.
5633 * src/system.h: Don't include config.h.
5634 * src/LR0.c: Include <config.h> first.
5635 * src/assoc.c: Likewise.
5636 * src/closure.c: Likewise.
5637 * src/complain.c: Likewise.
5638 * src/conflicts.c: Likewise.
5639 * src/derives.c: Likewise.
5640 * src/files.c: Likewise.
5641 * src/getargs.c: Likewise.
5642 * src/gram.c: Likewise.
5643 * src/lalr.c: Likewise.
5644 * src/location.c: Likewise.
5645 * src/main.c: Likewise.
5646 * src/muscle_tab.c: Likewise.
5647 * src/nullable.c: Likewise.
5648 * src/output.c: Likewise.
5649 * src/parse-gram.y: Likewise.
5650 * src/print.c: Likewise.
5651 * src/print_graph.c: Likewise.
5652 * src/reader.c: Likewise.
5653 * src/reduce.c: Likewise.
5654 * src/relation.c: Likewise.
5655 * src/state.c: Likewise.
5656 * src/symlist.c: Likewise.
5657 * src/symtab.c: Likewise.
5658 * src/tables.c: Likewise.
5659 * src/uniqstr.c: Likewise.
5660 * src/vcg.c: Likewise.
5661
877519f8
PE
5662 * src/parse-gram.y: Fix minor problems uncovered by lint.
5663 (current_lhs, current_lhs_location): Now static.
5664 (current_assoc): Remove unused variable.
5665
5666 Cleanups so that Bison-generated parsers have less lint.
5667 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate):
5668 Prepend /*ARGSUSED*/, for lint's sake.
5669 * data/glr.c (YYUSE): Properly parenthesize, and use an alternate
5670 definition if 'lint' is defined.
5671 (YYID): New macro (or function, if lint).
5672 All uses of /*CONSTCOND*/0 replaced by YYID(0).
5673 * data/yacc.c: Likewise.
5674 * data/glr.c (yyuserAction, yyuserMerge, yy_reduce_print):
5675 (yyrecoverSyntaxError): Prepend /*ARGSUSED*/.
5676 * data/glr.cc (YYLLOC_DEFAULT): Omit /*CONSTCOND*/ since this code
5677 is C++ only.
5678 * data/lalr1.cc (YYUSE): Just use a cast, since this code is C++ only.
5679 * data/yacc.c (YYSTACK_FREE) [defined YYSTACK_ALLOC]:
5680 Use YYID(0) rather than 0, for lint.
5681 (yystrlen): Rewrite to avoid lint warning about ptrdiff_t overflow.
5682 (yysyntax_error): Rewrite to avoid lint warnings about parenthesization.
5683
f5228370
PE
56842005-12-07 Paul Eggert <eggert@cs.ucla.edu>
5685
5686 * tests/glr-regression.at
5687 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
5688 Close memory leak reported by twlevo.
5689
69ce078b
PE
56902005-12-06 "Joel E. Denny" <jdenny@ces.clemson.edu>
5691
6ff99711
PE
5692 * data/glr.c (yyprocessOneStack, yyparse): Synchronize the shift for
5693 all stacks.
5694 (yyparse): Iterate another stack in order to call user destructors.
69ce078b
PE
5695 * tests/glr-regression.at (No users destructors if stack 0 deleted):
5696 New test case.
5697 (Duplicated user destructor for lookahead): This test now is expected
5698 to succeed.
5699
af3412cd
PE
57002005-12-01 Paul Eggert <eggert@cs.ucla.edu>
5701
32b5b719 5702 * NEWS: Document the following change.
af3412cd
PE
5703 * data/yacc.c: Say "parser skeleton" rather than "file", since
5704 it's no longer just a file.
5705 * data/glr.c: Grant a special exception for C GLR parsers, that
5706 reads like the already-existing exception for C LALR(1) parsers.
5707 * data/glr.cc: Likewise.
5708 * data/lalr1.cc: Likewise.
5709 * data/location.cc: Likewise.
5710 * data/yacc.c: Reword the "written by" statement to clarify that
5711 it was the parser skeleton, not the entire output file.
5712 * data/glr.c: Written by Paul Hilfinger.
5713 * data/glr.cc: Written by Akim Demaille.
5714 * data/lalr1.cc: Likewise.
5715
035aa4a0
PE
57162005-11-18 Paul Eggert <eggert@cs.ucla.edu>
5717
d9963c85
PE
5718 * data/yacc.c (yy_reduce_print, YY_REDUCE_PRINT):
5719 Fix typos in previous change that broke 'make check'.
5720 YY_REDUCE_PRINT cannot be a pseudo-varargs macro; that isn't
5721 supported in C.
5722 * tests/calc.at (_AT_CHECK_CALC,_AT_CHECK_CALC_ERROR):
5723 Don't check NUM-STDERR-LINES, since the output format is fluctuating.
5724 We can revert this once things settle down.
5725
035aa4a0
PE
5726 * src/conflicts.c (conflicts_print): Don't print file name twice
5727 when %expect fails because there were no conflicts.
5728 * doc/bison.texinfo (Expect Decl): Tighten up wording in previous
5729 change.
5730 * tests/conflicts.at (%expect not enough, %expect too much):
5731 (%expect with reduce conflicts): Adjust to new behavior.
5732
57332005-11-18 Akim Demaille <akim@epita.fr>
5734
5735 * src/conflicts.c (conflicts_print): Unsatisfied %expectation are
5736 errors.
5737 * NEWS: Document this.
5738 * doc/bison.texinfo (Expect Decl): Likewise.
5739
d1ff7a7c
AD
57402005-11-16 Akim Demaille <akim@epita.fr>
5741
5742 Generalize the display of semantic values and locations in traces.
5743 * data/glr.c (yy_reduce_print): Fix indices (again).
5744 * data/c++.m4 (b4_rhs_value, b4_rhs_location): Don't expect
5745 literal integers.
5746 * data/lalr1.cc (yyreduce_print): Rename as...
5747 (yy_reduce_print): this.
5748 Display values and locations.
5749 * data/yacc.c (yy_reduce_print): Likewise.
5750 (YY_REDUCE_PRINT): Adjust to pass the required arguments.
5751 (yysymprint): Move higher to be visible from yy_reduce_print).
5752 (yyparse): Adjust.
5753 * tests/calc.at: Adjust the expected length of the traces.
5754
6de5398d
AD
57552005-11-14 Akim Demaille <akim@epita.fr>
5756
5757 * data/glr.c (yy_reduce_print): The loop was quite wrong: type are
5758 from 1 to N, while values and location start at 0.
5759 (b4_rhs_location, b4_rhs_value): Add parens around $1 and $2.
5760
a1373f55
AD
57612005-11-14 Akim Demaille <akim@epita.fr>
5762
5763 * data/glr.c (yy_reduce_print): Fix the $ number.
5764
613d8952
AD
57652005-11-14 Akim Demaille <akim@epita.fr>
5766
5767 "Use" parse parameters.
5768 * data/c.m4 (b4_parse_param_for, b4_parse_param_use): New.
5769 * data/glr.c, data/glr.cc: Use them.
5770 * data/glr.c (YYUSE): Have a C++ definition that supports
5771 non-pointer types.
5772
b2741627
AD
57732005-11-14 Akim Demaille <akim@epita.fr>
5774
5775 * data/glr.c (yyexpandGLRStack): Declare only if defined.
5776
5059b5c8
AD
57772005-11-14 Akim Demaille <akim@epita.fr>
5778
42249483
AD
5779 * data/glr.cc: New.
5780 * data/m4sugar/m4sugar.m4 (m4_prepend): New.
5059b5c8 5781
4626a15d
AD
57822005-11-12 Akim Demaille <akim@epita.fr>
5783
5784 Let position and location be PODs.
5785 * data/location.cc (position::initialize, location::initialize): New.
5786 (position::position, location::location): Define only if
5787 b4_location_constructors is defined.
5788 * data/lalr1.cc (b4_location_constructors): Define it for backward
5789 compatibility.
5790 * doc/bison.texinfo (Initial Action Decl): Use initialize.
5791
57922005-11-12 Akim Demaille <akim@epita.fr>
98ae9643
AD
5793
5794 * data/lalr1.cc: Move the body of the ctor and dtor into the
5795 parser file (instead of the header).
5796 Wrap the implementations in a "namespace yy".
5797
57982005-11-12 Akim Demaille <akim@epita.fr>
5799
5800 Have glr.c include its header file when created.
5801 * data/glr.c (b4_shared_declarations): New.
5802 Output them verbatim in the parser if !%defines, otherwise
5803 output then in the header file, and include it instead.
5804
1989d947
AD
58052005-11-11 Akim Demaille <akim@epita.fr>
5806
5807 * data/glr.c: Comment changes.
5808
58092005-11-11 Akim Demaille <akim@epita.fr>
62b08cfc
AD
5810
5811 When yydebug, report semantic and location values for reductions.
5812 * data/glr.c (yy_reduce_print): Report the semantic values and the
5813 locations.
5814 (YY_REDUCE_PRINT): Adjust.
5815 (yyglrReduce): Use them.
5816 (b4_rhs_value, b4_rhs_location): Remove m4_eval invocations.
5817 * data/c.m4 (b4_yysymprint_generate): Specify the const arguments.
5818 * tests/calc.at (_AT_CHECK_CALC_ERROR): Remove the reduction
5819 traces.
5820
02998094
AD
58212005-11-10 Akim Demaille <akim@epita.fr>
5822
5823 * data/glr.c (yynewGLRStackItem, YY_RESERVE_GLRSTACK): New.
5824 (yyaddDeferredAction, yyglrShift, yyglrShiftDefer): Use them.
5825 (yyexpandGLRStack, YYRELOC): Define only when YYSTACKEXPANDABLE.
5826
5210672f
PE
58272005-11-09 Albert Chin-A-Young <china@thewrittenword.com>
5828
5829 * m4/cxx.m4, examples/Makefile.am: Don't build
5830 examples/calc++ if no C++ compiler is available. (trivial change)
5831
a8991a1d
AD
58322005-11-09 Akim Demaille <akim@epita.fr>
5833
5834 * src/scan-skel.l: Use a couple of asserts.
5835
36b5e963
AD
58362005-11-03 Akim Demaille <akim@epita.fr>
5837
5838 In some (weird) cases, the final state number is incorrect.
5839 Reported by Alexandre Duret-Lutz.
5840 * src/LR0.c (state_list_append): Remove the computation of
5841 final_state.
5842 (save_reductions): Do it here.
5843 (get_state): Alpha conversion.
5844 (generate_states): Use a for loop.
5845 * src/gram.h (item_number_is_rule_number)
5846 (item_number_is_symbol_number): New.
5847 * src/state.c: Use assert.
5848 * src/system.h: Include assert.h.
5849 * tests/sets.at (Accept): New.
5850
44e7ead1
PH
58512005-10-30 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
5852
5853 * data/glr.c (yyfill): Adjust comment.
36b5e963 5854 (yyresolveAction): Initialize default location properly
44e7ead1
PH
5855 for empty right-hand sides.
5856 (yydoAction): Ditto.
5857 Add comment explaining apparently dead code.
36b5e963
AD
5858 * tests/glr-regression.at
5859 (Incorrectly initialized location for empty right-hand side in GLR):
44e7ead1 5860 New test.
36b5e963 5861
e10a80ee
PE
58622005-10-30 Paul Eggert <eggert@cs.ucla.edu>
5863
5864 * bootstrap (cleanup_gnulib): New function. Use it to clean up
5865 gnulib when interrupted. This fixes some race conditions and
5866 works around some portability problems (one noted by Paul
5867 Hilfinger).
5868
067b32ee
AD
58692005-10-22 Akim <akim@epita.fr>
5870
5871 * Makefile.cfg: Adjust to config -> build-aux.
5872 Reported by twledo.
5873
4b367315
AD
58742005-10-21 Akim Demaille <akim@epita.fr>
5875
5876 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Pass
5877 the %parse-params.
5878 * data/glr.c (YY_SYMBOL_PRINT, yydestroyGLRState): Adjust.
5879 * data/yacc.c (b4_Pure_if): Rename as...
5880 (b4_yacc_pure_if): this.
5881 (YY_SYMBOL_PRINT, yyparse): Adjust.
5882 * doc/bison.texinfo: Formatting changes.
5883
24cc23d9
AD
58842005-10-21 Akim Demaille <akim@epita.fr>
5885
5886 Finish the transition config -> build-aux.
5887 * configure.ac, Makefile.am: Use build-aux.
5888 * config/prev-version, config/announce-gen, config/Makefile.am:
5889 Move to...
5890 * build-aux/prev-version, build-aux/announce-gen,
5891 * build-aux/Makefile.am: here.
5892
d4476375
AD
58932005-10-14 Akim Demaille <akim@epita.fr>
5894
5895 * examples/calc++/test: Use set -x only when VERBOSE.
5896
302c0aee
PE
58972005-10-13 Paul Eggert <eggert@cs.ucla.edu>
5898
5899 * NEWS: Bison now warns if it finds a stray `$' or `@' in an action.
5900 * src/scan-gram.l (<SC_BRACED_CODE>[$@]): Implement this.
5901
7625ec2c
AD
59022005-10-13 Akim Demaille <akim@epita.fr>
5903
5904 * src/scan-skel.l: Output the base name parts of the parser and
5905 header file names.
302c0aee 5906 * tests/output.at (AT_CHECK_OUTPUT): Support subdirectories, and
7625ec2c
AD
5907 additional checks.
5908 Use this to exercise C++ outputs in subdirs.
5909 Reported by Oleg Smolsky.
5910
ba0fe3c7
PE
59112005-10-12 Paul Eggert <eggert@cs.ucla.edu>
5912
5913 * data/c.m4 (b4_c_function_def): Look at __C99_FUNC__, not at
5914 __STDC_VERSION__, as IBM cc 7.0 doesn't define the latter either.
5915 Problem reported by John P. Hartmann.
5916 * data/yacc.c (YYMODERN_C): Likewise. Don't define if the user has
5917 already defined it.
5918
9b8a5ce0
AD
59192005-10-12 Akim Demaille <akim@epita.fr>
5920
5921 * src/parse-gram.y (version_check): Exit 63 to please missing
5922 (stands for "version mismatch).
5923 * tests/input.at, doc/bison.texinfo: Adjust.
5924
4f6e011e
PE
59252005-10-10 Paul Eggert <eggert@cs.ucla.edu>
5926
5927 Work around portability problems with Visual Age C compiler
5928 (xlc and xlC_r) reported by John P. Hartmann.
5929 * data/location.cc (initial_column, initial_line): Remove.
5930 All uses replaced by 0 and 1.
5931 * src/scan-gram.l (gram_wrap): Redefine to avoid bug in flex 2.5.31
5932 that xlc complains about.
5933 * src/scan-skel.l (skel_wrap): Likewise.
4d7aa45e 5934 * data/c.m4 (b4_c_function_def): Look at __STDC_VERSION__ as well
ba0fe3c7 5935 as __STDC__.
4d7aa45e
PE
5936 * data/yacc.c (YYMODERN_C): New macro, which also looks at
5937 __STDC_VERSION__. Use it everywhere instead of looking at
5938 __STDC__ and __cplusplus.
4f6e011e 5939
a1b3bf8c
AD
59402005-10-10 Akim Demaille <akim@epita.fr>
5941
5942 * examples/calc++/test: Be quiet unless VERBOSE.
5943
412e44aa
PE
59442005-10-05 Paul Eggert <eggert@cs.ucla.edu>
5945
2a4647a3
PE
5946 * data/c.m4 (yydestruct, yysymprint):
5947 Use YYUSE instead of casting to void.
5948 * data/glr.c (YYUSE): New macro.
5949 (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5950 Use it instead of rolling our own.
5951 (YYLLOC_DEFAULT, YYCHK, YYDPRINTF, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5952 (YYCHK1):
5953 Use /*CONSTCOND*/ to suppress lint warnings.
5954 * data/lalr1.cc (YYLLOC_DEFAULT, YY_SYMBOL_PRINT, YY_REDUCE_PRINT):
5955 (YY_STACK_PRINT): Use 'false' not '0'.
5956 (YYUSE): New macro.
5957 (yysymprint_, yydestruct_): Use it instead of rolling our own.
5958 * data/yacc.c (YYUSE): New macro.
5959 (YYCOPY, YYSTACK_RELOCATE, YYBACKUP, YYLLOC_DEFAULT):
5960 (YYDPRINTF, YY_SYMBOL_PRINT, YY_STACK_PRINT, YY_REDUCE_PRINT):
5961 (yyerrorlab): Use /*CONSTCOND*/ to suppress lint warnings.
5962
5963
412e44aa
PE
5964 * data/m4sugar/m4sugar.m4 (_m4_map): New macro.
5965 (m4_map, m4_map_sep): Use it. Handle the empty list correctly.
5966
88c6637f
PE
59672005-10-04 Paul Eggert <eggert@cs.ucla.edu>
5968
2f4f028d
PE
5969 Undo the parts of the unlocked-I/O change that substituted
5970 putc or puts for printf. This might hurt performance a bit,
5971 but some people prefer the printf style.
5972 * data/c.m4 (yysymprint): Prefer printf to puts and putc.
5973 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): Remove.
5974 All uses replaced by YYFPRINTF and YYDPRINTF.
5975 * data/yacc.c: Likewise.
5976 * lib/bitset.c (bitset_print): Likewise.
5977 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer printf to
5978 putc and puts.
5979 * lib/lbitset.c (debug_lbitset): Likewise.
5980 * src/closure.c (print_firsts, print_fderives): Likewise.
5981 * src/gram.c (grammar_dump): Likewise.
5982 * src/lalr.c (look_ahead_tokens_print): Likewise.
5983 * src/output.c (escaped_output): Likewise.
5984 (user_actions_output): Break apart two printfs.
5985 * src/parse-gram.y (%printer): Prefer printf to putc and puts.
5986 * src/reduce.c (reduce_print): Likewise.
5987 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
5988 * src/system.h: Include unlocked-io.h rathe than stdio.h.
5989
88c6637f
PE
5990 * data/glr.c (yyuserMerge, yyreportAmbiguity, yyreportSyntaxError):
5991 Use assignments rather than casts-to-void to suppress
5992 unused-variable warnings. This pacifies 'lint'.
5993 * data/lalr1.cc (yysymprint_, yydestruct_): Use a call to suppress
5994 unused-variable warnings.
5995
fb32e373
JMG
59962005-10-03 Juan Manuel Guerrero <juan.guerrero@gmx.de>
5997
5998 * Makefile.am: DJGPP specific files added to EXTRA_DIST.
5999
edb8f44f
PE
60002005-10-02 Paul Eggert <eggert@cs.ucla.edu>
6001
fb9c0b33
PE
6002 Use unlocked I/O for a minor performance improvement on hosts like
6003 GNU/Linux and Solaris that support unlocked I/O. The basic idea
6004 is to use the gnlib unlocked-io module, and to prefer putc and
6005 puts to printf when either will work (since the latter doesn't
6006 come in an unlocked flavor).
6007 * bootstrap (gnulib_modules): Add unlocked-io.
6008 * data/c.m4 (yysymprint): Prefer puts and putc to printf.
6009 * data/glr.c (YYFPUTC, YYFPUTS, YYDPUTS): New macros.
6010 Prefer them to YYFPRINTF and YYDPRINTF if either will do,
6011 and similarly for puts and putc and printf.
6012 * data/yacc.c: Likewise.
6013 * lib/bitset.c (bitset_print): Likewise.
6014 * lib/bitset.h [USE_UNLOCKED_IO]: Include unlocked-io.h.
6015 * lib/bitsetv.c (bitsetv_dump, debug-bitsetv): Prefer putc and puts
6016 to printf.
6017 * lib/lbitset.c (debug_lbitset): Likewise.
6018 * src/closure.c (print_firsts, print_fderives): Likewise.
6019 * src/gram.c (grammar_dump): Likewise.
6020 * src/lalr.c (look_ahead_tokens_print): Likewise.
6021 * src/output.c (escaped_output): Likewise.
6022 (user_actions_output): Coalesce two printfs.
2f4f028d 6023 * src/parse-gram.y (%printer): Prefer putc and puts to printf.
fb9c0b33
PE
6024 * src/reduce.c (reduce_print): Likewise.
6025 * src/state.c (state_rule_look_ahead_tokens_print): Likewise.
2f4f028d 6026 * src/system.h: Include unlocked-io.h rather than stdio.h.
fb9c0b33 6027
edb8f44f
PE
6028 * data/lalr1.cc: Don't put an unmatched ' in a dnl comment, as
6029 this confuses xgettext.
6030
b50d2359
AD
60312005-10-02 Akim Demaille <akim@epita.fr>
6032
6033 * bootstrap (gnulib_modules): Add strverscmp.
6034 * lib/.cvsignore: Add strverscmp.c, strverscmp.h.
6035 * m4/.cvsignore: Add strverscmp.m4.
6036 * src/parse-gram.y (%require): New token, new rule.
6037 (version_check): New.
6038 * src/scan-gram.l (%require): Adjust.
6039 * tests/input.at (AT_REQUIRE): New.
6040 Use it.
6041 * doc/bison.texinfo (Require Decl): New.
6042 (Calc++ Parser): Use %require.
6043
21667f64
AD
60442005-10-02 Akim Demaille <akim@epita.fr>
6045
6046 * data/location.cc: New.
6047
2b81e969
AD
60482005-10-02 Paul Eggert <eggert@cs.ucla.edu>,
6049 Akim Demaille <akim@epita.fr>
6050
6051 Make sure -odir/foo.cc creates dir/location.hh etc.
6052 * src/files.h (spec_outfile, parser_file_name, spec_name_prefix)
6053 (spec_file_prefix, spec_verbose_file, spec_graph_file)
6054 (spec_defines_file): Now const.
6055 (dir_prefix): New.
6056 (short_base_name): Remove.
6057 * src/files.c: Adjust.
6058 (dirname.h): Include.
6059 (base_name): Don't prototype it.
6060 (finput): Remove, duplicates gram_in.
6061 (full_base_name, short_base_name): Replace by...
6062 (all_but_ext, all_but_tab_ext): these.
6063 (compute_base_names): Rename as...
6064 (compute_file_name_parts): this.
6065 Update to compute the new variables, including dir_prefix.
6066 Adjust dependencies.
6067 * src/output.c (prepare): Output them.
6068 * src/reader.c: Adjust to use gram_in, not finput.
6069 * src/scan-skel.l (@dir_prefix@): New.
6070
ad6a9b97
JMG
60712005-10-02 Juan Manuel Guerrero <juan.guerrero@gmx.de>
6072
6073 * lib/subpipe.c: New function end_of_output_subpipe() added
6074 to allow support for non-posix systems. This is a no-op function
6075 for posix systems.
6076
6077 * lib/subpipe.h: New function end_of_output_subpipe() added
6078 to allow support for non-posix systems. This is a no-op function
6079 for posix systems.
6080
6081 * src/output.c (output_skeleton): Use end_of_output_subpipe() to
6082 handle the lack of pipe/fork functionality on non-posix systems.
6083
6084 * djgpp/Makefile.maint: DJGPP specific file.
6085
6086 * djgpp/README.in: DJGPP specific file.
6087
6088 * djgpp/config.bat: DJGPP specific configuration file.
6089
6090 * djgpp/config.sed: DJGPP specific configuration file.
6091
6092 * djgpp/config.site: DJGPP specific configuration file.
6093
6094 * djgpp/config_h.sed: DJGPP specific configuration file.
6095
6096 * djgpp/subpipe.c: DJGPP specific replacement file for lib/subpipe.c.
6097
6098 * djgpp/subpipe.h: DJGPP specific replacement file for lib/subpipe.h.
6099
fc695704
AD
61002005-10-02 Akim Demaille <akim@epita.fr>
6101
6102 * data/location.cc: New, extract from...
6103 * data/lalr1.cc: here.
6104 (location.hh): Include it after the user prologue, in case the
6105 filename type is defined by the user.
6106 Forward declation location and position before the pre-prologue.
6107 (yyresult_): Rename as...
6108 (yyresult): this, it's a local variable, not an attribute.
6109 * data/Makefile.am (dist_pkgdata_DATA): Adjust.
6110
61112005-10-01 Akim Demaille <akim@epita.fr>
5215c87f
AD
6112
6113 * examples/extexi: Restore the #line generation.
6114
fb9712a9
AD
61152005-09-30 Akim Demaille <akim@epita.fr>,
6116 Alexandre Duret-Lutz <adl@gnu.org>
6117
6118 Move the token type and YYSTYPE in the parser class.
6119 * data/lalr1.cc (stack.hh, location.hh): Include earlier.
6120 (parser::token): New, from the moved free definition of tokens.
6121 (parser::semantic_value): Now a full definition instead of an
6122 indirection to YYSTYPE.
6123 (b4_post_prologue): No longer included in the header file, but
6124 in the implementation file.
6125 * doc/bison.texi (C+ Language Interface): Update.
6126 * src/parse-gram.y: Support unary %define.
6127 * tests/actions.at: Define global_tokens_and_yystype for backward
6128 compatibility until we update the tests.
6129 * tests/calc.at: Idem.
6130 (first_line, first_column, last_line, last_column): Define for lalr1.cc
6131 to simplify the code.
6132
55f0c7b1
PE
61332005-09-29 Paul Eggert <eggert@cs.ucla.edu>
6134
6135 Port to SunOS 4.1.4, which lacks strtoul and strerror.
6136 Ah, the good old days! Problem reported by Peter Klein.
6137 * bootstrap (gnulib_modules): Add strerror, strtoul.
6138 * lib/.cvsignore: Add strerror.c, strtol.c, strtoul.c
6139 * m4/.cvsignore: Add strerror.m4, strtol.m4, strtoul.m4.
6140
fb9712a9 61412005-09-29 Akim Demaille <akim@epita.fr>
d4fb5e3c
AD
6142
6143 * data/c.m4 (b4_error_verbose_if): New.
6144 * data/lalr1.cc: Use it.
6145 (YYERROR_VERBOSE_IF): Remove.
6146 (yyn_, yylen_, yystate_, yynerrs_, yyerrstatus_): Remove as
6147 parser members, replaced by...
6148 (yyn, yylen, yystate, yynerss, yyerrstatus): these parser::parse
6149 local variables.
6150 (yysyntax_error_): Takes the state number as argument.
6151 (yyreduce_print_): Use the argument yyrule, not the former
6152 attribute yyn_.
6153
8a6f72f3
PE
61542005-09-26 Paul Eggert <eggert@cs.ucla.edu>
6155
6156 * bootstrap (gnulib_modules): Add verify.
6157 * lib/.cvsignore: Add verify.h.
6158 * src/getargs.c: Use ARGMATCH_VERIFY rather than verify.
6159 * src/system.h (verify): Remove.
6160 Include verify.h instead.
6161 * src/tables.c (tables_generate): Use new API for 'verify'.
6162
0d50976f
PE
61632005-09-21 Paul Eggert <eggert@cs.ucla.edu>
6164
ebc3737e
PE
6165 * tests/local.at (_AT_BISON_OPTION_PUSHDEFS): Do not use
6166 local variables whose names begin with 'yy'.
6167 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
6168 Trivial changes from Joel E. Denny.
6169
0d50976f
PE
6170 * bootstrap (gnulib_modules): Remove alloca. Bison doesn't need
6171 it itself.
6172 * src/main.c (main) [C_ALLOCA]: Don't flush alloca'ed memory; we
6173 don't use alloca any more.
6174
6175 * data/yacc.c [YYSTACK_USE_ALLOCA && !defined __GNUC__ && ! defined
6176 __BUILTIN_VA_ARG_INCR && ! defined _AIX && ! defined _MSC_VER &&
62c4328e 6177 defined _ALLOCA_H]: Don't include <stdlib.h>; not needed in this case.
0d50976f
PE
6178 * tests/torture.at (Exploding the Stack Size with Alloca): Adjust
6179 to match yacc.c, to test more hosts.
6180
a05b79df
PE
61812005-09-20 Paul Eggert <eggert@cs.ucla.edu>
6182
55289366
PE
6183 * data/yacc.c (YYSIZE_T): Reindent to make it clearer. This
6184 doesn't affect behavior.
6185 (YYSTACK_ALLOC) [YYSTACK_USE_ALLOCA]: Improve support for
6186 Solaris, AIX, MSC.
6187 (_STDLIB_H): Renamed from YYINCLUDED_STDLIB_H. All uses changed.
6188 This works a bit better with glibc, if user code has already included
6189 stdlib.h.
6190 * doc/bison.texinfo (Bison Parser): Document that users can't
6191 arbitrarily use malloc and free for other purposes. Document
6192 that <alloca.h> and <malloc.h> might be included.
6193 (Table of Symbols): Under YYSTACK_USE_ALLOCA, Don't claim that the
6194 user must declare alloca.
6195
a05b79df
PE
6196 * HACKING (release): Forwarn the Translation Project about
6197 stable releses.
6198
3ab2ca22
AD
61992005-09-20 Akim Demaille <akim@epita.fr>
6200
6201 * data/glr.c: Use b4_token_enums, not b4_token_enums_defines.
6202
a9739e7c
PE
62032005-09-19 Paul Eggert <eggert@cs.ucla.edu>
6204
a702593e
PE
6205 * data/yacc.c (YYSIZE_MAXIMUM): New macro.
6206 (YYSTACK_ALLOC_MAXIMUM): Use it.
6207 (yysyntax_error): New function.
6208 (yyparse) [YYERROR_VERBOSE]: Don't leak memory indefinitely if
6209 multiple syntax errors are reported, and alloca is being used.
6210 Instead, reallocate buffers twice as big each time, so that
6211 we waste at most half the allocated memory. Start with a small
6212 (128-byte) buffer that will suffice in most cases anyway.
6213 Use yysyntax_error to do most of the work.
6214
6215 * doc/bison.texinfo (Error Reporting, Table of Symbols):
6216 yynerrs is the number of errors reported, not the number of
6217 errors encountered.
6218
a9739e7c
PE
6219 * tests/glr-regression.at (Duplicated user destructor for lookahead):
6220 Mark it as expected to fail.
6221 Cast result of malloc; problem reported by twlevo@xs4all.nl.
6222 * tests/actions.at, tests/calc.at, tests/glr-regression.at:
6223 Don't start user-code symbols with "yy", to avoid name space problems.
6224
f479c6c6
AD
62252005-09-19 Akim Demaille <akim@epita.fr>
6226
6227 Remove the traits, failed experiment.
6228 It never proved useful, and anyway because of the current
6229 definition, it was not possible to have several specialization of
6230 this traits, making it useless.
6231 * data/lalr1.cc (yy:traits): Remove.
6232 Inline its definitions in the parser class.
6233
e2586f82
AD
62342005-09-19 Akim Demaille <akim@epita.fr>
6235
6236 * tests/atlocal.in (LIBS): Pass INTLLIBS to address failures on at
6237 least Mac OSX with a /usr/local install of gettext.
6238
2e8cf949
AD
62392005-09-19 Akim Demaille <akim@epita.fr>
6240
6241 * data/lalr1.cc (yyparse): Rename yylooka and yyilooka as yychar
6242 and yytoken for similarity with the other skeletons.
6243
c7fb0b90
AD
62442005-09-19 Akim Demaille <akim@epita.fr>
6245
4e26c69e 6246 * NEWS, configure.ac: update version number to 2.1a.
c7fb0b90 6247
1bd0deda
PE
62482005-09-16 Paul Eggert <eggert@cs.ucla.edu>
6249
6250 * NEWS: Version 2.1.
6251
6252 * NEWS: Remove notice of yytname change, since it was never in an
6253 official release.
6254 * data/glr.c (yydestroyGLRState): Rename local var to avoid shadowing
6255 diagnostic.
6256 * src/output.c (prepare): Likewise.
6257 * data/lalr1.cc (YYERROR_VERBOSE_IF): New macro.
6258 (yysyntax_error_): Use it to avoid GCC warning when YYERROR_VERBOSE
6259 is not defined. This is an awful hack, but it's enough for now.
6260 All callers changed.
6261 * tests/glr-regression-at (make_value): Args are const pointers now,
6262 to avoid GCC warning.
6263 (Duplicated user destructor for lookahead): New test. Currently
6264 skipped. It fails on my host but I'm not sure it'll always fail.
6265
62662005-09-16 Akim Demaille <akim@epita.fr>
c1432f65
AD
6267
6268 * src/symtab.h (struct symbol): Declare the printer and destructor
6269 as const, to avoid accidental calls to free.
6270 (symbol_destructor_set, symbol_printer_set): Adjust.
6271 * src/symtab.c: Adjust.
6272
1bd0deda 62732005-09-16 Akim Demaille <akim@epita.fr>
cf147260
AD
6274
6275 * data/c.m4 (b4_token_enums): New.
6276 (b4_token_defines): Rename as...
6277 (b4_token_enums_defines): this.
6278 (b4_token_defines): New, output only the #defines.
6279 * data/yacc.c, data/glr.c: Adjust.
6280 * data/lalr1.cc: Use b4_token_enums instead of b4_token_enums_defines.
6281 * data/c.m4 (b4_yydestruct_generate, b4_yysymprint_generate): Define
6282 as default values.
6283
dbcdae2d
AD
62842005-09-16 Akim Demaille <akim@epita.fr>
6285
6286 * data/lalr1.cc (yylex_): Remove, inline its code.
6287 (yyreport_syntax_error_): Remove, replaced by...
6288 (yysyntax_error_): this which returns a string and leaves to the
6289 caller the call to the users' error function.
6290 (yylooka_, yyilooka_, yylval, yylloc, yyerror_range_, yyval, yyloc):
6291 Move from members of the parser object...
6292 (yylooka, yyilooka, yylval, yylloc, yyerror_range, yyval, yyloc):
6293 to local variables of the parse function.
6294
70d8f291
AD
62952005-09-16 Akim Demaille <akim@epita.fr>
6296
6297 * doc/bison.texinfo (Calc++ Parser): Don't promote defining YYEOF
6298 since it's in Bison's name space.
6299
b47dbebe
PE
63002005-09-15 Paul Eggert <eggert@cs.ucla.edu>
6301
ae199bf1
PE
6302 * data/glr.c (yyresolveValue): Add default case to pacify
6303 gcc -Wswitch-default. Problem reported by twlevo@xs4all.nl.
6304
b47dbebe
PE
6305 * NEWS: Document when yyparse started to return 2.
6306 * doc/bison.texinfo (Parser Function): Document when yyparse
6307 returns 2.
6308
6309 * data/lalr1.cc: Revert part of previous change, as it's incompatible.
6310 (b4_filename_type): Renamed back from b4_file_name_type. All uses
6311 changed.
6312 (class position): file_name -> filename (reverting). All uses changed.
6313
63142005-09-14 Paul Eggert <eggert@cs.ucla.edu>
6315
6316 * examples/calc++/Makefile.am ($(calc_sources_generated)): Don't
6317 do anything if $@ exists. This reverts part of the 2005-07-07
6318 patch.
6319
00292f66
PE
63202005-09-11 Paul Eggert <eggert@cs.ucla.edu>
6321
6322 * Makefile.am (EXTRA_DIST): Do not distribute REFERENCES; it
6323 contains obsolete information and isn't worth distributing as a
6324 separate file anyway.
6325 * data/glr.c [defined YYSETJMP]: Don't include <setjmp.h>.
6326 (YYJMP_BUF, YYSETJMP, YYLONGJMP) [!defined YYSETJMP]: New macros.
6327 All uses of jmp_buf, setjmp, longjmp changed to use these instead.
6328 (yyparse): Abort if user code uses longjmp to throw an unexpected
6329 value.
6330
a420f962
PE
63312005-09-09 Paul Eggert <eggert@cs.ucla.edu>
6332
00292f66
PE
6333 * data/c.m4 (b4_identification): Define YYBISON_VERSION.
6334 Suggested by twlevo@xs4all.nl.
6335
127287e9
PE
6336 * data/glr.c (YYCHK1): Do not assume YYE is in range.
6337 This avoids a diagnostic from gcc -Wswitch-enum.
6338 Problem reported by twlevo@xs4all.nl.
6339
a420f962
PE
6340 * doc/bison.texinfo: Don't use "filename", as per GNU coding
6341 standards. Use "file name" or "file" or "name", depending on
6342 the context.
6343 (Invocation): The output of "bison hack/foo.y" goes to foo.tab.c,
6344 not to hack/foo.tab.c.
6345 (Calc++ Top Level): 2nd arg of main is not const.
48b16bbc
PE
6346 * data/glr.c: b4_filename -> b4_file_name.
6347 * data/lalr1.cc: Likewise. Also, b4_filename_type -> b4_file_name_type.
6348 All uses changed.
6349 (class position): filename -> file_name. All uses changed.
6350 * data/yacc.c: b4_filename -> b4_file_name.
6351 * lib/bitset.h: filename -> file_name in local vars.
6352 * lib/bitset_stats.c: Likewise.
6353 * src/files.c: Likewise.
6354 * src/scan-skel.l ("@output ".*\n): Likewise.
6355 * src/files.c (file_name_split): Renamed from filename_split.
6356 * src/muscle_tab.c (muscle_init): Output b4_file_name, not b4_filename.
a420f962
PE
6357
63582005-09-08 Paul Eggert <eggert@cs.ucla.edu>
6359
6360 * lib/.cvsignore: Add pipe-safer.c, stdio--.h, unistd--.h,
6361 to accommodate latest gnulib.
6362
6363 * tests/glr-regression.at (Duplicate representation of merged trees):
6364 Add casts to pacify g++. Problem reported by twlevo@xs4all.nl.
6365
6366 * bootstrap: Add comment as to why the AM_LANGINFO_CODESET hack is
6367 needed.
6368
42a6501d
PE
63692005-08-26 Paul Eggert <eggert@cs.ucla.edu>
6370
6371 * data/glr.c (yydestroyGLRState): Renamed from yydestroyStackItem.
6372 All uses changed. Invoke user destructor after an error during a
6373 split parse (trivial change from Joel E. Denny).
6374
6375 * tests/glr-regression.at
6376 (User destructor after an error during a split parse): New test case.
6377 Problem reported by Joel E. Denny in:
6378 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00029.html
6379
ef9a1faf
PE
63802005-08-25 Paul Eggert <eggert@cs.ucla.edu>
6381
5b4aaf78
PE
6382 * README-cvs: Give URLs for recommended tools.
6383 Mention Gzip version problem, and bootstrapping issues.
6384 Remove troubleshooting section, as it's somewhat obsolete.
6385
b5240ba5
PE
6386 * bootstrap (no_cache): New var, to accommodate different wget
6387 variants. Use it instead of '-C off'. Problem reported by
6388 twlevo@xs4all.nl.
6389
ef9a1faf
PE
6390 * data/glr.c (yydestroyStackItem): New function.
6391 (yyrecoverSyntaxError, yyreturn): Use it to improve quality of
6392 debugging information. Problem reported by Joel E. Denny.
6393
e6efa9da
AD
63942005-08-25 Akim Demaille <akim@epita.fr>
6395
6396 * tests/local.at (AT_COMPILE_CXX): Pass $LINKS too.
6397
adc90f13
PE
63982005-08-24 Paul Eggert <eggert@cs.ucla.edu>
6399
6400 * data/glr.c (yyrecoverSyntaxError, yyreturn):
6401 Don't invoke destructor on unresolved entries.
6402 * tests/glr-regression.at
6403 (User destructor for unresolved GLR semantic value): New test case.
6404 Problem reported by Joel E. Denny in:
6405 http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00016.html
6406
f9315de5
PE
64072005-08-21 Paul Eggert <eggert@cs.ucla.edu>
6408
15d29c1f
PE
6409 * lib/.cvsignore: Remove realloc.c, strncasecmp.c, xstrdup.c.
6410 Add strnlen.c.
6411 * m4/.cvsignore: Remove codeset.m4, gettext.m4, lib-ld.m4,
6412 lib-prefix.m4, po.m4.
6413
dd5f2af2
PE
6414 * data/glr.c (yyreturn): Use "Cleanup:" rather than "Error:"
6415 in yydestruct diagnostic, since it might not be an error.
6416 Problem reported by Joel Denny near end of
6417 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6250acbd 6418 * data/lalr1.cc (yyerturn): Likewise.
dd5f2af2
PE
6419 * data/yacc.c (yyreturn): Likewise.
6420 * tests/calc.at (_AT_CHECK_CALC_ERROR): Adjust to the above change.
6421
6422 * src/files.c: Remove obsolete FIXME comment.
6423
6424 * data/glr.c (YY_SYMBOL_PRINT): Append a newline, for consistency
6425 with the other templates, and to fix bogus run-on messages such
6426 as the one reported at the end of
6427 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00040.html>.
6428 All callers changed to avoid the newline.
6429 (yyprocessOneStack): Output two lines rather than one, to accommodate
6430 the above change. This changes the debug output format slightly.
6431
f9315de5
PE
6432 * data/glr.c (yyresolveValue): Fix redundant parse tree problem
6433 reported by Joel E. Denny in
6434 <http://lists.gnu.org/archive/html/bison-patches/2005-08/msg00004.html>
6435 (trivial change).
6436 * tests/glr-regression.at (Duplicate representation of merged trees):
6437 New test, from Joel E. Denny in:
6438 <http://lists.gnu.org/archive/html/help-bison/2005-07/msg00013.html>.
6439 * THANKS: Add Joel E. Denny.
6440
6441 * configure.ac (AC_INIT): Bump to 2.0c.
6442
04098407
PE
64432005-07-24 Paul Eggert <eggert@cs.ucla.edu>
6444
6445 * NEWS: Version 2.0b.
6446
ca5d2013
PE
6447 * Makefile.am (SUBDIRS): Put examples before tests, so that
6448 "make check" doesn't finish with "All 1 tests passed".
6449
3d54b576
PE
6450 * tests/regression.at (Token definitions): Don't rely on
6451 AT_PARSER_CHECK for data that contains backslashes. It currently
6452 uses 'echo', and 'echo' isn't portable if its argument contains
6453 backslashes. Problem found on OpenBSD 3.4. Also, do not assume
6454 that the byte '\0xff' is not printable in the C locale; it is,
6455 under OpenBSD 3.4 (!). Luckily, '\0x80' through '\0x9e' are
6456 not printable, so use '\0x81' to test.
6457
d53ae497
PE
6458 * data/glr.c (YYOPTIONAL_LOC): Define even if it's not a recent
6459 version of GCC, since the macro is used with non-GCC compilers.
6460
fc01665e
PE
6461 Fix core dump reported by Pablo De Napoli in
6462 <http://lists.gnu.org/archive/html/bug-bison/2005-07/msg00053.html>.
6463 * tests/regression.at (Invalid inputs with {}): New test.
6464 * src/parse-gram.y (token_name): Translate type before using
6465 it as an index.
6466
04098407
PE
6467 * data/glr.c (ATTRIBUTE_UNUSED): Remove, since it infringes on
6468 the user's name space. All uses changed to __attribute__
6469 ((__unused__)).
6470 (yyFail, yyMemoryExhausted, yyreportAmbiguity):
6471 Add __attribute__ ((__noreturn__)).
6472
6473 * etc/clcommit: Remove. We weren't using it, and it failed
6474 "make maintainer-distcheck".
6475 * Makefile.maint: Merge from coreutils.
6476 (CVS_LIST, CVS_LIST_EXCEPT): New macros.
6477 (syntax-check-rules): Change list of rules as described below.
6478 (sc_cast_of_alloca_return_value, sc_dd_max_sym_length):
6479 (sc_file_system, sc_obsolete_symbols, sc_prohibit_atoi_atof):
6480 (sc_prohibit_jm_in_m4, sc_root_tests, sc_tight_scope):
6481 (sc_trailing_space): New rules.
6482 (sc_xalloc_h_in_src): Remove.
6483 (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
6484 (sc_space_tab, sc_error_exit_success, sc_changelog):
6485 (sc_system_h_headers, sc_sun_os_names, sc_unmarked_diagnostics):
6486 (makefile-check, po-check, author_mark_check):
6487 (makefile_path_separator_check, copyright-check):
6488 Use grep -n, to make it easier to find violations.
6489 Use CVS_LIST and CVS_LIST_EXCEPT.
6490 (header_regexp, h_re): Remove.
6491 (dd_c): New macro.
6492 (sc_dd_max_sym_length, .re-list, news-date-check): New rules.
6493 (my-distcheck): Use more-modern GCC flags.
6494 (signatures, %.asc): Remove.
6495 (rel-files, announcement): Remove signatures.
6496 Restore old updating code, even though we don't use it, so
6497 that we're the same as coreutils.
6498 (alpha, beta, major): Depend on news-date-check.
6499 Make the upload commands.
6500
6501 * data/c.m4, data/lalr1.cc, data/yacc.c: Normalize white space.
6502 * lib/abitset.h, lib/bbitset.h, lib/bitset.h: Likewise.
6503 * lib/bitset_stats.c, lib/ebitset.h, lib/lbitset.c: Likewise.
6504 * lib/libitset.h, lib/timevar.c, lib/vbitset.h: Likewise.
6505 * src/Makefile.am, src/gram.c, src/muscle_tab.h: Likewise.
6506 * src/parse-gram.y, src/system.h, src/tables.c, src/vcg.c: Likewise.
6507 * src/vcg_defaults.h, tests/cxx-type.at, tests/existing.at: Likewise.
6508 * tests/sets.at: Likewise.
6509
6510 * data/m4sugar/m4sugar.m4: Sync from Autoconf, except that
6511 we comment out the Autoconf version number.
6512 * doc/bison.texinfo (Calc++ Scanner): Don't use atoi, as
6513 it's error-prone and "make maintainer-distcheck" rejects it.
6514
6515 * lib/subpipe.c: Include <fcntl.h> without checking for HAVE_FCNTL_H.
6516 Indent calls to "error" to pacify "make maintainer-distcheck",
6517 when the calls are not intended to be translated.
6518 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't check for fcntl.h.
6519
6520 * src/Makefile.am (DEFS): Use +=, to pacify
6521 "make maintainer-distcheck".
6522 (bison_SOURCES): Add scan-skel.h.
6523 (sc_tight_scope): New rule, from coreutils.
6524
6525 * src/files.c (src_extension, header_extension):
6526 Now static, not extern.
6527 * src/getargs.c (short_options): Likewise.
6528 * src/muscle_tab.c (muscle_table): Likewise.
6529 * src/parse-gram.y (current_class, current_type, current_prec):
6530 Likewise.
6531 * src/reader.c (grammar_end, previous_rule_end): Likewise.
6532 * src/getargs.h: Redo comments to pacify "make maintainer-distcheck".
6533 * src/main.c (main): Cast bindtextdomain and textdomain calls to
6534 void, to avoid warning when NLS is disabled.
6535 * src/output.c: Include scan-skel.h.
6536 (scan_skel): Remove decl, since scan-skel.h does this.
6537 (output_skeleton):
6538 Indent calls to "error" to pacify "make maintainer-distcheck".
6539 * src/print_graph.c: Don't include <obstack.h>, as system.h does this.
6540 * src/reader.h (gram_end, gram_lineno): New decls to pacify
6541 "make maintainer-distcheck".
6542 * src/scan-skel.l (skel_lex, skel_get_lineno, skel_get_in):
6543 (skel_get_out, skel_get_leng, skel_get_text, skel_set_lineno):
6544 (skel_set_in, skel_set_out, skel_get_debug, skel_set_debug):
6545 (skel_lex_destroy, scan_skel): Move these decls to...
6546 * src/scan-skel.h: New file.
6547 * src/uniqstr.c (uniqstr_assert):
6548 Indent calls to "error" to pacify "make maintainer-distcheck".
6549
6550 * tests/Makefile.am ($(srcdir)/package.m4): Use $(VAR),
6551 not @VAR@.
6552
6553 * tests/torture.at: Revamp to avoid misuse of atoi that
6554 "make maintainer-distcheck" complained about.
6555
6556 * examples/extexi (message): Don't print a message more than once,
6557 and omit line-number decoration that makes Emacs compile think
6558 that informative messages are worth worrying about.
6559
65602005-07-22 Paul Eggert <eggert@cs.ucla.edu>
6561
6562 * configure.ac: Update version number.
6563
6564 * Makefile.am (SUBDIRS): Add examples; somehow this got removed
6565 accidentally.
6566 * examples/calc++/calc++-parser.yy: Remove from CVS, as it's
6567 autogenerated by the maintainer.
6568 * examples/calc++/.cvsignore: Add *.yy.
6569
6570 * lib/bitset.c (bitset_alloc): Don't cast xcalloc result.
6571 * lib/bitset_stats.c (bitset_stats_init): Likewise.
6572 * lib/bitsetv.c (bitsetv_alloc): Likewise.
6573
6574 * po/POTFILES.in: Add lib/xalloc-die.c; remove lib/xmalloc.c.
6575
6576 * src/relation.c (relation_transpose): Rewrite to avoid bogus complaint
6577 from maintainer-distcheck about casting the argument of 'free'.
6578
6579 * NEWS: Mention recent yytname changes.
6580 * THANKS: Add Anthony Heading, twlevo@xs4all.nl.
6581
6582 * bootstrap: For translations that have not yet been upgraded to
6583 the new runtime-po domain, prime the pump by extracting the
6584 relevant strings from the obsolete translations. This code can be
6585 removed once the bison-runtime domain has been translated by each
6586 team.
6587
6588 * src/scan-gram.l (<SC_PRE_CODE>.): Don't double-quote token names,
6589 now that token names are already quoted.
6590
6591 Fix problem reported by Anthony Heading.
6592 * data/glr.c (YYTOKEN_TABLE): New macro.
6593 (yytname): Define if YYTOKEN_TABLE.
6594 * data/yacc.c (YYTOKEN_TABLE, yytname): Likewise.
6595 * data/lalr1.cc (YYTOKEN_TABLE, yytname_): Likewise.
6596 (YYERROR_VERBOSE): Define the same way the other skeletons do.
6597 * src/output.c (prepare_symbols): Output token_table_flag.
6598
0ffda363
PE
65992005-07-21 Paul Eggert <eggert@cs.ucla.edu>
6600
6601 * data/glr.c (yyinitGLRStack, yyreturn): Don't call malloc
6602 again if the first call fails.
6603
6604 * data/glr.c (yytnamerr): New function.
6605 (yyreportSyntaxError): Use it to dequote most string literals.
6606 * data/lalr1.c (yytname_): Renamed from yyname_, for compatibility
6607 with other skeletons. All uses changed.
6608 (yytnameerr_): New function.
6609 (yyreport_syntax_error): Use it to dequote most string literals.
6610 * data/yacc.c (yytnamerr): New function.
6611 (yyerrlab): Use it to decode most string literals.
6612 * doc/bison.texinfo (Decl Summary, Calling Convention):
6613 Clarify quoting convention of yytname.
6614 * src/output.c (prepare_symbols): Quote all names. This undoes
6615 the 2005-04-17 change, which is now accomplished (mostly) via
6616 changes in the parsers as described above.
6617 * tests/regression.at (Token definitions, Web2c Actions):
6618 Undo most 2005-04-17 change here, too.
6619
66202005-07-20 Paul Eggert <eggert@cs.ucla.edu>
6621
6622 Fix more problems reported by twlevo@xs4all.nl.
6623 * tests/cxx-type.at: Don't pipe output of ./types through sed to
6624 remove trailing spaces. This loses the exit status of ./types,
6625 and isn't needed since ./types shouldn't be emitting trailing
6626 spaces.
6627 * data/glr.c (yyreturn): Don't pop stack if yyinitStateSet failed,
6628 as the stack isn't valid in that case.
6629
6630 * src/scan-gram.l (gram_get_lineno, gram_get_in, gram_get_out):
6631 (gram_get_leng, gram_get_text, gram_set_lineno, gram_set_in):
6632 (gram_set_out, gram_get_debug, gram_set_debug, gram_lex_destroy):
6633 Add declarations to pacify "gcc -Wmissing-prototypes" when flex 2.5.31
6634 is used.
6635 * src/scan-skel.l (skel_get_lineno, skel_get_in, skel_get_out):
6636 (skel_get_leng, skel_get_text, skel_set_lineno, skel_set_in):
6637 (skel_set_out, skel_get_debug, skel_set_debug, skel_lex_destroy):
6638 Likewise.
6639
6640 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Work even with
6641 overly-picky compilers that reject 'char *foo = "bar";'.
6642
6643 * src/symtab.c (SYMBOL_ATTR_PRINT, symbol_print): Direct output
6644 to FILE * parameter, not to stderr. This fixes a typo introduced
6645 in the 2005-07-12 change.
6646
6647 * lib/subpipe.c (create_subpipe): Rewrite slightly to avoid
6648 warnings from GCC 4.
6649
6650 * data/glr.c (yyexpandGLRStack, yyaddDeferredAction, yyexpandGLRStack):
6651 (yyglrShiftDefer, yysplitStack):
6652 Remove unused parameters b4_pure_formals. All uses changed.
6653 (yyglrShift): Remove unused parameters b4_user_formals.
6654 All uses changed.
6655 (yyglrReduce): Removed unused parameter yylocp. All uses changed.
6656
6100a9aa
PE
66572005-07-18 Paul Eggert <eggert@cs.ucla.edu>
6658
258b75ca
PE
6659 Destructor cleanups and regularization among the three skeletons.
6660 * NEWS: Document the behavior changes.
6661 * data/glr.c (yyrecoverSyntaxError): Don't bother to pop the
6662 stack before failing, as the cleanup code will do it for us now.
6663 * data/lalr1.cc (yyerrlab): Likewise.
6664 * data/glr.c (yyparse): Pop everything off the stack before
6665 freeing it, so that destructors get called properly.
6666 * data/lalr1.cc (yyreturn): Likewise.
6667 * data/yacc.c (yyreturn): Pop and destroy the start symbol, too.
6668 This is more consistent.
6669 * doc/bison.texinfo (Destructor Decl): Mention more reasons
6670 why destructors might be called. 1.875 -> 2.1.
6671 (Destructor Decl, Decl Summary, Table of Symbols):
6672 Some English-language cleanups for %destructor.
6673 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
6674 Add output line for destructor of start symbol.
6675 * tests/calc.at (AT_CHECK_CALC): Add one to line counts,
6676 because of that same extra output line.
6677
1a059451
PE
6678 * NEWS: Document minor wording changes in diagnostics of
6679 Bison-generated parsers.
6680 * data/glr.c (yyMemoryExhausted): Renamed from yyStackOverflow.
6681 Remove unused formals. All uses changed.
6682 (yyreportAmbiguity): "ambiguity detected" -> "syntax is ambiguous".
6683 (yyparse): Rename yyoverflowlab to yyexhaustedlab.
6684 * data/yacc.c (yyparse): "parser stack overflow" -> "memory exhausted".
6685 Rename yyoverflowab to yyexhaustedlab.
6686 When memory exhaustion occurs during syntax-error reporting,
6687 report it separately rather than in a single diagnostic; this
6688 eases translation.
6689 * doc/bison.texinfo (Memory Management): Renamed from Stack Overflow.
6690 (Memory Exhausted): Renamed from Parser Stack Overflow.
6691 Revamp wording slightly to prefer "memory exhaustion".
6692 * tests/actions.at: "parser stack overflow" -> "memory exhausted".
6693
97460c78
PE
6694 * data/c.m4 (b4_yysymprint_generate): Use YYFPRINTF, not fprintf.
6695
30757c8c
PE
6696 Add i18n support to the GLR skeleton. Partially fix the C++
6697 skeleton; a C++ expert needs to finish this. Remove debugging
6698 msgids; there's little point to having them translated, since they
6699 can be understood only by someone who can read the
6700 (English-language) source code.
6701
6702 Generate runtime-po/bison-runtime.pot automatically, so that we
6703 don't have to worry about garbage getting in that file. We'll
6704 make sure after the next official release that old msgids don't
6705 get lost. See
6706 <http://lists.gnu.org/archive/html/bison-patches/2005-07/msg00119.html>.
6707
6708 * runtime-po/Makefile.in.in, runtime-po/bison-runtime.pot: Remove.
6709 Now auto-generated.
6710 * PACKAGING: Don't claim that Gawk, GCC, Perl use this method yet.
6711 Fix typos in explanations of the runtime file.
6712 * bootstrap: Change gettext keyword from YYI18N to YY_.
6713 Use standard Makefile.in.in in runtime-po, since we'll arrange
6714 for backward-compatible bison-runtime.po files in a different way.
6715 * data/glr.c (YY_): New macro, from yacc.c.
6716 (yyuserAction, yyreportAmbiguity, yyreportSyntaxError, yyparse):
6717 Translate messages intended for users.
6718 (yyreportSyntaxError): Change "virtual memory" to "memory" to match
6719 the wording in the other skeletons. We don't know that the memory
6720 is virtual.
6721 * data/lalr1.cc (YY_): Renamed from _. All uses changed.
6722 Use same method that yacc.c uses.
6723 Don't translate debugging messages.
6724 (yy::yyreport_syntax_error): Put in a FIXME for the i18n stuff;
6725 it doesn't work (yet), and requires C++ expertise to fix.
6726 * data/yacc.c (YY_): Renamed from YY18N. All uses changed.
6727 Move defn to a more logical place, to be consistent with other
6728 skeletons.
6729 Don't translate debugging messages.
6730 Don't assume line numbers fit in unsigned int; use unsigned long fmts.
6731 * doc/bison.texinfo: Mention <libintl.h>. Change glibc cross reference
6732 to gettext cross reference. Add indexing terms. Mention YYENABLE_NLS.
6733 * runtime-po/POTFILES.in: Add data/glr.c, data/lalr1.cc.
6734
ac8c5689
PE
6735 Fix yyerror / yylex test glitches noted by twlevo@xs4all.nl.
6736 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Have yyerror return
6737 void, not int.
6738 * tests/glr-regression.at (Badly Collapsed GLR States):
6739 Likewise.
6740 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
6741 yylex should return 0 at EOF rather than aborting.
6742
6100a9aa
PE
6743 Improve tests for stack overflow in GLR parser.
6744 Problem reported by twlevo@xs4all.nl.
6745 * data/glr.c (struct yyGLRStack): Remove yyerrflag member.
6746 All uses removed.
6747 (yyStackOverflow): Just longjmp, but with value 2 so that caller
6748 can handle the problem.
6749 (YYCHK1): Use goto (a la yacc.c) rather than setting a flag.
6750 (yyparse): New local variable yyresult to record the result.
6751 Use result of setjmp to set it, rather than storing itinto
6752 struct.
6753 (yyDone): Remove label.
6754 (yyacceptlab, yyabortlab, yyoverflowlab, yyreturn): New labels,
6755 to mimic yacc.c. Do not discard lookahead if it's EOF (possible
6756 if YYABORT is used).
6757 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Exit with
6758 yyparse status; put status > 1 into diagnostic.
6759 Check that status==2 works.
6760 * tests/calc.at, tests/cxx-type.at, tests/glr-regression.at:
6761 Use exit status 3 for failure to open (which shouldn't happen).
6762
15f40952
PE
67632005-07-17 Paul Eggert <eggert@cs.ucla.edu>
6764
67fd79c4
PE
6765 * tests/conflicts.at (%nonassoc and eof): Don't exit with status
6766 1 on syntax error; just let yyparse do its thing.
6767 * tests/glr-regression.at (Badly Collapsed GLR States): Likewise.
6768 * tests/torture.at (AT_DATA_STACK_TORTURE): Likewise.
6769 (Exploding the Stack Size with Alloca):
6770 (Exploding the Stack Size with Malloc):
6771 Expect exit status 2, not 1, since the parser is supposed to blow
6772 its stack. Problem reported by twlevo@xs4all.nl.
6773
15f40952
PE
6774 * data/glr.c (yyparse): Don't assume that the initial calls
6775 to YYMALLOC succeed; in that case, yyparse incorrectly returned 0.
6776 Print a stack-overflow message and fail instead.
6777 Initialize the line-number information before creating the stack,
6778 so that the stack-overflow message can report line zero safely.
6779
f32c66b5
PE
67802005-07-14 Paul Eggert <eggert@cs.ucla.edu>
6781
a22ff96f 6782 Fix problems reported by twlevo@xs4all.nl.
e2688cd9
PE
6783 * data/glr.c (YYSTACKEXPANDABLE): Don't define if already defined.
6784 (yyuserMerge): Provide a default case if b4_mergers is empty.
6785 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Define YYSTACKEXPANDABLE.
6786 * tests/glr-regression.at
6787 (Improper handling of embedded actions and dollar(-N) in GLR parsers):
c70fdfcd 6788 Add casts to pacify C++ compilers.
1beb0b24
PE
6789 * tests/glr-regression.at (Improper merging of GLR delayed action
6790 sets): Declare yylex before using it.
f32c66b5 6791 * tests/Makefile.am (maintainer-check-g++): Fix a stray
a22ff96f
PE
6792 $(GXX) that escaped the renaming of GXX to CXX. Remove bogus
6793 test for valgrind; valgrind is independent of g++.
6794 (maintainer-check-posix): Add _POSIX2_VERSION=200112, to check
6795 for compatibility with POSIX 1003.1-2001 (if running coreutils).
6796 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Port to stricter C++.
6797 Use a destructor, so that we can expand the stack. Change
6798 YYSTYPE to char * so that we can free it. Cast result of malloc.
f32c66b5 6799
d741bd1b
PE
68002005-07-13 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
6801
6802 * data/glr.c (yyuserAction): Fix uninitialized variable that caused
6803 a valgrind failure. Problem reported by twlevo@xs4all.nl.
6804
0410a6e0
PE
68052005-07-13 Paul Eggert <eggert@cs.ucla.edu>
6806
6807 * PACKAGING: New file, suggested by Bruno Haible and taken from
6808 similar wording in gettext's PACKAGING file.
6809 * NEWS: Mention PACKAGING.
6810 * Makefile.am (EXTRA_DIST): Add PACKAGING.
6811
f7ab6a50
PE
68122005-07-12 Paul Eggert <eggert@cs.ucla.edu>
6813
baf785db 6814 * NEWS: Document recent i18n improvements.
f7ab6a50
PE
6815 * bootstrap: Get runtime translations into runtime-po.
6816 Create runtime-po files automatically, if possible.
6817 * configure.ac: Invoke BISON_I18N, so that we eat our own dog food.
6818 * data/yacc.c: Rewrite inclusion of <libintl.h> so that ENABLE_NLS
6819 does not infringe on the user's name space.
6820 (YYENABLE_NLS): Renamed from ENABLE_BISON_NLS.
6821 * doc/bison.texinfo (Internationalization): Revamp the English
6822 and Texinfo syntax a bit, to try to make it clearer.
6823 (Bison Options, Option Cross Key): Mention --print-localedir.
6824 * m4/bison-i18n.m4 (BISON_I18N): Rename ENABLE_BISON_NLS to
6825 YYENABLE_NLS. Quote a bit more.
6826 * runtime-po/.cvsignore: New file.
6827 * runtime-po/Makefile.in.in (mostlyclean): Remove *.old.pot.
6828 * runtime-po/Rules-quot: Remove; now created by bootstrap.
6829 * runtime-po/quot.sed: Likewise.
6830 * runtime-po/boldquot.sed: Likewise.
6831 * runtime-po/en@quot.header: Likewise.
6832 * runtime-po/en@boldquot.header: Likewise.
6833 * runtime-po/insert-header.sin: Likewise.
6834 * runtime-po/remove-potcdate.sin: Likewise.
6835 * runtime-po/Makevars: Likewise.
6836 * runtime-po/LINGUAS: Likewise.
6837 * runtime-po/de.po: Likewise; we will rely on the translation project
6838 to maintain this, so "bootstrap" should get it.
0410a6e0 6839 * src/getarg.c (PRINT_LOCALEDIR_OPTION): Let the C compiler determine
f7ab6a50
PE
6840 its value.
6841 * src/main.c (main): Bind the bison-runtime domain, too.
6842
68432005-07-12 Bruno Haible <bruno@clisp.org>
6844
6845 * data/yacc.c: Include <libintl.h> when NLS is enabled.
6846 (YYI18N): Renamed from _. Use dgettext when NLS is enabled.
6847 * po/POTFILES.in: Remove autogenerated file src/parse-gram.c.
6848 * runtime-po: New directory.
6849 * runtime-po/Makefile.in.in: New file, copied from po/, with modified
6850 $(DOMAIN).pot-update rule, so that old messages are never dropped.
6851 * runtime-po/Rules-quot: New file, copied from po/.
6852 * runtime-po/quot.sed: Likewise.
6853 * runtime-po/boldquot.sed: Likewise.
6854 * runtime-po/en@quot.header: Likewise.
6855 * runtime-po/en@boldquot.header: Likewise.
6856 * runtime-po/insert-header.sin: Likewise.
6857 * runtime-po/remove-potcdate.sin: Likewise.
6858 * runtime-po/Makevars: New file.
6859 * runtime-po/POTFILES.in: New file.
6860 * runtime-po/LINGUAS: New file.
6861 * runtime-po/bison-runtime.pot: New file.
6862 * runtime-po/de.po: New file.
6863 * m4/bison.m4: New file.
6864 * Makefile.am (SUBDIRS): Add runtime-po.
6865 (aclocaldir, aclocal_DATA): New variables.
6866 * configure.ac: Add AC_CONFIG_FILES of runtime-po/Makefile.in.
6867 Define aclocaldir.
6868 * src/getargs.c (usage): Document --print-localedir option.
6869 (PRINT_LOCALEDIR_OPTION): New enum item.
6870 (long_options): Add --print-localedir option.
6871 (getargs): Handle --print-localedir option.
6872 * doc/bison.texinfo (Bison Parser): Remove paragraph about _().
6873 (Internationalization): New section.
6874
22dda0f0
AD
68752005-07-12 Akim Demaille <akim@epita.fr>
6876
6877 * src/symtab.h, src/symtab.c (symbol_print): Swap the arguments,
6878 for consistency with the rest of the code.
6879 * src/symlist.h, src/symlist.c (symbol_list_print): Ditto.
6880 Add separators.
6881
82b248ad
AD
68822005-07-12 Akim Demaille <akim@epita.fr>
6883
6884 * src/parse-gram.y: Use %printer instead of YYPRINT.
6885
fa0e9314
AD
68862005-07-12 Akim Demaille <akim@epita.fr>
6887
867a3e00
AD
6888 * src/symtab.h, src/symtab.c (symbol_print): New.
6889 * src/symlist.h, src/symlist.c (symbol_list_print): New.
6890 * src/symlist.c (symbol_list_n_type_name_get): Report the culprit.
6891
68922005-07-12 Akim Demaille <akim@epita.fr>
6893
6894 * data/glr.c (b4_syncline): Fix (swap) the definitions of
fa0e9314
AD
6895 b4_at_dollar and b4_dollar_dollar.
6896
e054b190
PE
68972005-07-11 Paul Eggert <eggert@cs.ucla.edu>
6898
6899 * doc/bison.texinfo (Mystery Conflicts): Add reference to DeRemer
6900 and Pennello's paper.
6901
34160ec4
PE
69022005-07-09 Paul Eggert <eggert@cs.ucla.edu>
6903
407d4a75
PE
6904 * data/yacc.c (yyparse): Undo previous patch. Instead,
6905 set yylsp[0] and yyvsp[0] only if the initial action
6906 sets yylloc and yylval, respectively.
6907
34160ec4
PE
6908 * data/yacc.c (yyparse): In the initial action, set
6909 yylsp[0] and yyvsp[0] rather than yylloc and yylval.
6910 This avoids the use of undefined variables if the initial
6911 action does not set yylloc and/or yylval.
6912
c3d5a4a7
PE
69132005-07-07 Paul Eggert <eggert@cs.ucla.edu>
6914
b34d96c1
PE
6915 * examples/calc++/calc++-driver.cc, examples/calc++/calc++-driver.hh:
6916 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc:
6917 Remove from CVS. These files are automatically generated.
6918 * examples/extexi: Clarify that this file is now part of Bison,
6919 not GNU M4, and that it works with any POSIX-compatible Awk.
6920 * examples/calc++/Makefile.am (run_extexi): Remove; not used.
6921 ($(calc_extracted)): Renamed from $(calc_sources_extracted),
6922 so that we also get calc++-parser.yy. Geneate it.
6923 Use $(AWK), not gawk, since any conforming Awk will do.
6924 Put comment before action, since older 'make' can't handle comment
6925 in action.
6926 $(BUILT_SOURCES): List all built sources, not just some of them.
6927 $(MAINTAINERCLEANFILES): Remove *.stamp, and all built sources.
6928 $($(srcdir)/calc++-parser.stamp): Work even if POSIXLY_CORRECT.
6929 $($(calc_sources_generated)): Remove unnecessary test for existence
6930 of target. (This had a shell syntax error anyway; a stray "x".)
6931 (calc_extracted): List $(srcdir)/calc++-parser.yy, not
6932 calc++-parser.yy.
6933 * examples/.cvsignore, examples/calc++/.cvsignore: New files.
6934
c3d5a4a7
PE
6935 * bootstrap (gnulib_modules): Add gettext, now that it's no longer
6936 implied by the other modules.
6937
828c373b
AD
69382005-07-06 Akim Demaille <akim@epita.fr>
6939
6940 Bind examples/calc++ to the package.
6941 * examples/calc++/Makefile: Remove, replaced by...
6942 * examples/calc++/Makefile.am: ... this new file.
6943 * examples/calc++/test: Remove input.
6944 * examples/calc++/compile: Remove.
6945 * examples/Makefile.am: New.
6946 * configure.ac, Makefile.am: Adjust.
6947 * doc/Makefile.am (clean-local): New, for more recent texi2dvis.
6948
63cb01d6
PE
69492005-07-05 Paul Eggert <eggert@cs.ucla.edu>
6950
fd2df2ed
PE
6951 * data/glr.c (yyFail): Drastically simplify; since the format argument
6952 never had any % directives, we can simply pass it to yyerror.
6953 (yyparse): Use "t a; a=b;" rather than "t a = b;" when a will
6954 be modified later, as that is the usual style in glr.c.
6955 Problems reported by Paul Hilfinger.
6956
63cb01d6
PE
6957 Rewrite GLR parser to catch more buffer overrun, storage exhaustion,
6958 and size overflow errors.
6959 * data/glr.c: Include <stdio.h> etc. after user prolog, not before,
6960 in case the user prolog sets feature-test macros like _GNU_SOURCE.
6961 (YYSIZEMAX): New macro.
6962 (yystpcpy): New function, taken from yacc.c.
6963 (struct yyGLRStack.yyspaceLeft): Now size_t, not int.
6964 (yyinitGLRStack, yyfreeGLRstack): Remove unnecessary forward decls,
6965 so that we don't have to maintain their signatures.
6966 (yyFail): Check for buffer overflow, by using vsnprintf rather
6967 than vsprintf. Allocate a bigger buffer if possible.
6968 Report an error if buffer allocation fails.
6969 (yyStackOverflow): New function.
6970 (yyinitStateSet, yyinitGLRStack): Return a boolean indicating whether
6971 the initialization was successful. It might fail if storage was
6972 exhausted.
6973 (yyexpandGLRStack): Add more checks for storage allocation failure.
6974 Use yyStackOverflow to report failures.
6975 (yymarkStackDeleted, yyglrShift, yyglrShiftDefer, yydoAction):
6976 (yysplitStack, yyprocessOneStack, yyparse, yypstack):
6977 Don't assume stack number fits in int.
6978 (yysplitStack): Check for storage allocation failure.
6979 (yysplitStack, yyprocessOneStack): Add pure_formals, so that we
6980 can print diagnostics on storage allocation failure. All callers
6981 changed.
6982 (yyresolveValue): Use yybool for boolean.
6983 (yyreportSyntaxError): Check for size-calculation overflow.
6984 This code is taken from yacc.c.
6985 (yyparse): Check for storage allocation errors when allocating
6986 the initial stack.
6987
1c59e0a1
AD
69882005-07-05 Akim Demaille <akim@epita.fr>
6989
6990 Extract calc++ from the documentation.
6991 * doc/bison.texinfo (Calc++): Add the extraction marks.
6992 * examples/extexi: New, from the aborted GNU Programming 2E.
6993 Separate the different paragraph of a file with empty lines.
6994 * examples/Makefile: Use it to extract the whole calc++ example.
6995
8a0adb01
AD
69962005-06-24 Akim Demaille <akim@epita.fr>
6997
6998 * doc/bison.texinfo (C++ Parser Interface): Use defcv to define
6999 class typedefs.
7000
12545799
AD
70012005-06-22 Akim Demaille <akim@epita.fr>
7002
7003 * doc/bison.texinfo (C++ Language Interface): First stab.
7004 (C++ Parsers): Remove.
7005
99be0235
AD
70062005-06-22 Akim Demaille <akim@epita.fr>
7007
7008 * data/lalr1.cc (yylex_): Honor %lex-param.
7009
0ffd4fd1
AD
70102005-06-22 Akim Demaille <akim@epita.fr>
7011
7012 Start a set of simple examples.
7013 * examples/calc++/Makefile, examples/calc++/calc++-driver.cc,
7014 * examples/calc++/calc++-driver.hh,
7015 * examples/calc++/calc++-parser.yy,
7016 * examples/calc++/calc++-scanner.ll, examples/calc++/calc++.cc,
7017 * examples/calc++/compile, examples/calc++/test: New.
7018
0925ebb4
PE
70192005-06-09 Paul Eggert <eggert@cs.ucla.edu>
7020
7021 * data/yacc.c (malloc, free) [defined __cplusplus]: Wrap inside
7022 extern "C" {}. This fixes a problem reported by Paul Hilfinger,
7023 which stems from the 2005-05-27 patch.
7024
43d3b664
PH
70252005-06-06 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
7026
7027 * data/glr.c: Modify treatment of unused parameters to permit use
7028 of g++ (which doesn't allow __attribute__ ((unused)) for parameters).
7029
3062864d
PE
70302005-05-30 Paul Eggert <eggert@cs.ucla.edu>
7031
7032 Fix infringement on user name space reported by Janos Zoltan Szabo.
7033 * data/yacc.c (yyparse): strlen -> yystrlen.
7034
989b5b8e
AD
70352005-05-30 Akim Demaille <akim@epita.fr>
7036
7037 * data/lalr1.cc (_): New.
7038 Translate the various messages.
7039
bedf57f5
PE
70402005-05-27 Paul Eggert <eggert@cs.ucla.edu>
7041
7042 Fix infringement on user name space reported by Bruno Haible.
7043 * data/yacc.c (YYSIZE_T): Define first, so that later decls can use it.
7044 Prefer GCC's __SIZE_TYPE__ if available, so that we don't infringe on
7045 the user's name space.
7046 (alloca): Include <stdlib.h> to get it, if it's not built in.
7047 (YYMALLOC, YYFREE): Define only if needed.
7048 (malloc, free): Declare, but only if needed, as this infringes on
7049 the user name space.
7050
4d1801f1
PE
70512005-05-25 Paul Eggert <eggert@cs.ucla.edu>
7052
7053 Fix BeOS, FreeBSD, MacOS porting problems reported by Bruno Haible.
7054 * lib/bitset.c (bitset_print): Don't assume size_t can be printed
7055 with %d format.
7056 * lib/ebitset.c (min, max): Undef before defining.
7057 * lib/vbitset.c (min, max): Likewise.
7058 * lib/subpipe.c (create_subpipe): Save local variables in case
7059 vfork clobbers them.
7060
70612005-05-24 Bruno Haible <bruno@clisp.org>
7062
7063 * tests/synclines.at (AT_SYNCLINES_COMPILE): Add support for the
7064 error message syntax used by gcc-4.0.
7065
b94a9e1e
PE
70662005-05-23 Paul Eggert <eggert@cs.ucla.edu>
7067
85ac3861
PE
7068 * README: Mention m4 1.4.3. Remove obsolete advice about
7069 Sun Forte Developer 6 update 2, VMS, and MS-DOS.
7070
b94a9e1e
PE
7071 * bootstrap: Remove workaround for problem I encountered with
7072 gettext 0.14.1; it seems to be fixed now.
7073
51c30d21
PE
70742005-05-22 Paul Eggert <eggert@cs.ucla.edu>
7075
009ce67d
PE
7076 * NEWS: Version 2.0a.
7077
f2a97c62
PE
7078 * src/files.c: Include "stdio-safer.h"; this fixes a typo in
7079 the previous change.
7080
c8775f93
PE
7081 Various maintainer cleanups.
7082 * .cvsignore: Add a.exe, a.out, b.out,, conf[0-9]*, confdefs*,
7083 conftest*, for benefit of CVS commands run at the same time as
7084 "configure". Add build-aux, since "bootstrap" now creates it and
7085 its subfiles.
7086 * Makefile.cfg (move_if_change): Remove.
7087 * Makefile.maint: Remove the update stuff; we now use "bootstrap".
7088 (ftp-gnu, www-gnu, move_if_change, local_updates, update):
7089 (po_repo, do-po-update, po-update, wget_files, get-targets):
7090 (config.guess-url_prefix, config.sub-url_prefix):
7091 (ansi2knr.c-url_prefix, texinfo.tex-url_prefix):
7092 (standards.texi-url_prefix, make-stds.texi-url_prefix, taget, url):
7093 ($(get-targets), cvs-files, automake_repo, wget-update, cvs-update):
7094 Remove.
7095 * configure.ac (AC_CONFIG_AUX_DIR): Change from config to build-aux;
7096 this is now the recommended name.
7097 * config/.cvsignore: Remove config.guess, config.rpath, config.sub,
7098 depcomp, install-sh, mdate-sh, missing, mkinstalldirs, texinfo.tex,
7099 ylwrap. These files now go into build-aux.
7100 * config/move-if-change: Remove.
7101 * config/prev-version.txt: Bump from 1.75 to 2.0.
7102
3ea5f0ec
PE
7103 * bootstrap: Add stdio-safer, unistd-safer modules.
7104 Remove m4/glibc2.m4 (introduced by latest gnulib, but
7105 we don't need it).
7106 * lib/.cvsignore: Add dup-safer.c, fd-safer.c,
7107 fopen-safer.c, stdio-safer.h, unistd-safer.h.
7108 * lib/subpipe.c: Include "unistd-safer.h".
7109 (create_subpipe): Make sure all the newly-created
7110 file descriptors are > 2, so that diagnostics don't
7111 get sent down them (which might cause Bison to hang, in theory).
7112 * m4/.cvsignore: Add stdio-safer.m4, unistd-safer.m4.
7113 * src/files.c (xfopen): Use fopen_safer, not fopen.
7114
51c30d21
PE
7115 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Port
7116 yesterday's yacc.c fix.
7117
cea1469d
PE
71182005-05-21 Paul Eggert <eggert@cs.ucla.edu>
7119
3ea5f0ec
PE
7120 * data/glr.c, data/lalr1.cc: Update copyright date.
7121
cea1469d
PE
7122 Fix a destructor bug reported by Wolfgang Spraul in
7123 <http://lists.gnu.org/archive/html/bug-bison/2005-05/msg00042.html>.
7124 * data/yacc.c (yyabortlab): Don't call destructor, and
7125 don't set yychar to EMPTY.
7126 (yyoverflowlab): Don't call destructor.
7127 (yyreturn): Call destructor, if yychar is neither YYEOF nor YYEMPTY.
7128 * tests/calc.at (AT_CHECK_CALC): Expect one fewer output lines,
7129 since we no longer output the message "discarding lookahead token
7130 end of input ()".
7131
5e6f62f2
PH
71322005-05-20 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
7133
7134 * data/glr.c (YY_SYMBOL_PRINT): Don't print newline at end to
7135 fix a small glitch in debugging output.
7136 (yyprocessOneStack, yyrecoverSyntaxError, yyparse): Print newline
7137 after YY_SYMBOL_PRINT where needed.
7138
7139 (struct yyGLRState): Add some comments.
7140 (struct yySemanticOption): Add some comments.
7141 (union yyGLRStackItem): Add comment.
7142
7143 (yymergeOptionSets): Correct this to properly perform the union,
7144 avoiding infinite reported by Michael Rosien.
7145 Update comment.
7146
7147 * tests/glr-regression.at: Add test for GLR merging error reported
7148 by M. Rosien.
cea1469d 7149
0fb669f9
PE
71502005-05-13 Paul Eggert <eggert@cs.ucla.edu>
7151
7152 * COPYING, ChangeLog, GNUmakefile, HACKING, Makefile.am,
7153 Makefile.cfg, Makefile.maint, NEWS, README, README-alpha,
7154 README-cvs, TODO, bootstrap, configure.ac, data/Makefile.am,
7155 data/README, data/c.m4, data/glr.c, data/lalr1.cc, data/yacc.c,
7156 data/m4sugar/m4sugar.m4, doc/Makefile.am, doc/bison.texinfo,
7157 doc/fdl.texi, doc/gpl.texi, doc/refcard.tex, lib/Makefile.am,
7158 lib/abitset.c, lib/abitset.h, lib/bbitset.h, lib/bitset.c,
7159 lib/bitset.h, lib/bitset_stats.c, lib/bitset_stats.h,
7160 lib/bitsetv-print.c, lib/bitsetv-print.h, lib/bitsetv.c,
7161 lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/get-errno.c,
7162 lib/get-errno.h, lib/lbitset.c, lib/lbitset.h, lib/libiberty.h,
7163 lib/main.c, lib/subpipe.c, lib/subpipe.h, lib/timevar.c,
7164 lib/timevar.def, lib/timevar.h, lib/vbitset.c, lib/vbitset.h,
7165 lib/yyerror.c, m4/cxx.m4, m4/m4.m4, m4/subpipe.m4, m4/timevar.m4,
7166 m4/warning.m4, src/LR0.c, src/LR0.h, src/Makefile.am, src/assoc.c,
7167 src/assoc.h, src/closure.c, src/closure.h, src/complain.c,
7168 src/complain.h, src/conflicts.c, src/conflicts.h, src/derives.c,
7169 src/derives.h, src/files.c, src/files.h, src/getargs.c,
7170 src/getargs.h, src/gram.c, src/gram.h, src/lalr.c, src/lalr.h,
7171 src/location.c, src/location.h, src/main.c, src/muscle_tab.c,
7172 src/muscle_tab.h, src/nullable.c, src/nullable.h, src/output.c,
7173 src/output.h, src/parse-gram.c, src/parse-gram.h,
7174 src/parse-gram.y, src/print.c, src/print.h, src/print_graph.c,
7175 src/print_graph.h, src/reader.c, src/reader.h, src/reduce.c,
7176 src/reduce.h, src/relation.c, src/relation.h, src/scan-gram.l,
7177 src/scan-skel.l, src/state.c, src/state.h, src/symlist.c,
7178 src/symlist.h, src/symtab.c, src/symtab.h, src/system.h,
7179 src/tables.c, src/tables.h, src/uniqstr.c, src/uniqstr.h,
7180 src/vcg.c, src/vcg.h, src/vcg_defaults.h, tests/Makefile.am,
7181 tests/actions.at, tests/c++.at, tests/calc.at, tests/conflicts.at,
7182 tests/cxx-type.at, tests/existing.at, tests/glr-regression.at,
7183 tests/headers.at, tests/input.at, tests/local.at, tests/output.at,
7184 tests/reduce.at, tests/regression.at, tests/sets.at,
7185 tests/synclines.at, tests/testsuite.at, tests/torture.at:
7186 Update FSF postal mail address.
7187
51f4735e
PE
71882005-05-11 Paul Eggert <eggert@cs.ucla.edu>
7189
7190 * tests/local.at (AT_COMPILE_CXX): Treat LDFLAGS like AT_COMPILE does.
7191 Problem reported by Ralf Menzel.
7192
80ce3401
PE
71932005-05-01 Paul Eggert <eggert@cs.ucla.edu>
7194
7195 * tests/actions.at: Test that stack overflow invokes destructors.
7196 From Marcus Holland-Moritz.
7197 * data/yacc.c (yyerrlab): Move the code that destroys the stack
7198 from here....
7199 (yyreturn): to here. That way, destructors are called properly
7200 even if the stack overflows, or the user calls YYACCEPT or
7201 YYABORT. Stack-overflow problem reported by Marcus Holland-Moritz.
7202 (yyoverflowlab): Destroy the lookahead.
7203
72042005-04-24 Paul Eggert <eggert@cs.ucla.edu>
7205
7206 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): Add more-descriptive comment.
7207
72f000b0
PE
72082005-04-17 Paul Eggert <eggert@cs.ucla.edu>
7209
7210 * NEWS: Bison-generated C parsers no longer quote literal strings
7211 associated with tokens.
7212 * src/output.c (prepare_symbols): Don't escape strings,
7213 since users don't want to see C escapes.
7214 * tests/calc.at (AT_CHECK_CALC): Adjust to lack of quotes
7215 in diagnostics.
c19683bb 7216 * tests/input.at (Torturing the Scanner): Likewise.
72f000b0
PE
7217 * tests/regression.at (Token definitions, Web2c Actions): Likewise.
7218
1094323f
PE
72192005-04-16 Paul Eggert <eggert@cs.ucla.edu>
7220
7221 * tests/torture.at (AT_INCREASE_DATA_SIZE): Skip the test if
7222 the data size is known to be too small and we can't increase it.
7223 This works around an HP-UX 11.00 glitch reported by Andrew Benham.
7224
ca407bdf
PE
72252005-04-15 Paul Eggert <eggert@cs.ucla.edu>
7226
7227 * src/parse-gram.y: Include quotearg.h.
7228 (string_as_id): Quote $1 before using it as a key, since the
7229 lexer no longer quotes it for us.
7230 (string_content): Don't strip quotes, since lexer no longer
7231 quotes it for us.
7232 * src/scan-gram.l: Include quotearg.h.
7233 ("\""): Omit quote.
7234 ("'"<SC_ESCAPED_CHARACTER>): Quote symbol before using it as
7235 a key, since the rest of the lexer doesn't quote it.
7236 * src/symtab.c (symbol_get): Don't quote symbol; caller does it now.
7237 * tests/regression.at (Token definitions): Check for backslashes
7238 in token strings.
7239
7240 * data/yacc.c (YYSTACK_ALLOC_MAXIMUM): New macro.
7241 (YYSIZE_T): Define to unsigned long int when using an older compiler.
7242 (yyparse): Revamp code to generate long syntax error message, to
7243 make it easier to translate, and to avoid problems with arithmetic
7244 overflow. Change "virtual memory" to "memory" in diagnostic, since
7245 we don't know whether the memory is virtual.
7246
1ce59070
PE
72472005-04-13 Paul Eggert <eggert@cs.ucla.edu>
7248
7249 * NEWS: Bison-generated C parsers now use the _ macro to
7250 translate strings.
7251 * data/yacc.c (_) [!defined _]: New macro.
7252 All English strings wrapped inside this macro.
7253 * doc/bison.texinfo (Bison Parser): Document _.
7254 * po/POTFILES.in: Include src/parse-gram.c, since it now
7255 includes translateable strings that parse-gram.y doesn't.
7256
a749a695
PE
72572005-04-12 Paul Eggert <eggert@cs.ucla.edu>
7258
7259 * src/symtab.c (symbol_make_alias): Call symbol_type_set,
7260 reverting the 2004-10-11 change to this function.
7261 (symbol_check_alias_consistency): Don't call symbol_type_set
7262 if the type name is already correct.
7263 * tests/input.at (Typed symbol aliases): New test, from Tim Van Holder.
7264
8fb1053b
PE
72652005-03-25 Paul Eggert <eggert@cs.ucla.edu>
7266
7267 * tests/regression.at (Token definitions): Don't use a token named
7268 c, as that generates a "#define c ..." that runs afoul of buggy
7269 stdlib.h that uses the identifier c as a member of struct
7270 drand48_data. Problem reported by Horst Wente.
7271
ff498c4a
PE
72722005-03-21 Paul Eggert <eggert@cs.ucla.edu>
7273
7274 * bootstrap: Change translation URL from
7275 http://www2.iro.umontreal.ca/~gnutra/po/maint/bison/ to
7276 http://www.iro.umontreal.ca/translation/maint/bison/ to avoid
7277 redirection glitches. Problem reported by twlevo@xs4all.nl.
7278
65211d70
PE
72792005-03-20 Paul Eggert <eggert@cs.ucla.edu>
7280
7281 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Don't put options
7282 after operands; POSIX says this isn't portable for the c99 command.
7283
9577fb1f
PE
72842005-03-18 Paul Eggert <eggert@cs.ucla.edu>
7285
7286 * tests/glr-regression.at (glr-regr2a.y): Try to dump core
7287 immediately if a data overrun has occurred; this may help us track
7288 down what may be a spurious failure on MacOS.
7289
78b178f7
PE
72902005-03-17 Paul Eggert <eggert@cs.ucla.edu>
7291
a2599d0f
PE
7292 Respond to problems reported by twlevo@xs4all.nl.
7293
7294 * bootstrap: Use "trap - 0" rather than the unportable "trap 0".
7295
78b178f7
PE
7296 * src/vcg.h: Comment fix.
7297 * src/vcg_defaults.h: Parenthesize macro bodies to make them safe.
7298 (G_CMAX): Change to -1 instead of INT_MAX.
7299
7300 * data/yacc.c (yyparse): Omit spaces before #line.
78b178f7 7301
7296e729
PE
73022005-03-15 Paul Eggert <eggert@cs.ucla.edu>
7303
7304 * src/tables.c (state_number_to_vector_number): Put it inside an
7305 "#if 0", since it's not currently used. Problem reported by
7306 Roland McGrath.
7307
05ac60f3
PE
73082005-03-06 Paul Eggert <eggert@cs.ucla.edu>
7309
7310 * src/output.c (escaped_output): Renamed from
7311 escaped_file_name_output, since we now use it for symbol tags as
7312 well. All uses changed.
7313 (symbol_destructors_output, symbol_printers_output):
7314 Escape symbol tags too.
7315 Problem reported by Matyas Forstner in
7316 <http://lists.gnu.org/archive/html/bug-bison/2005-03/msg00009.html>.
7317
7318 * src/muscle_tab.c (muscle_code_grow): Don't quote numbers; it's
7319 not needed.
7320 * src/output.c (user_actions_output, token_definitions_output,
7321 symbol_destructors_output, symbol_printers_output): Likewise.
7322 * src/reader.c (prologue_augment): Likewise.
7323 * src/scan-gram.l (handle_action_dollar, handle_action_at): Likewise.
7324
7325 * src/vcg.c (output_edge): Don't quote linestyle arg.
7326 Problem reported by twlevo@xs4all.nl.
7327
7eb453ac
PE
73282005-02-28 Paul Eggert <eggert@cs.ucla.edu>
7329
7330 * doc/bison.texinfo (Semantic Tokens): Fix scoping problem in
7331 example, reported by Derek M Jones. Also, make the example even
7332 more outrageous, to better illustrate how bad the problem is.
7333
4c04c52a
PE
73342005-02-24 Paul Eggert <eggert@cs.ucla.edu>
7335
7336 * doc/bison.texinfo (Mfcalc Symtab): Correct the prototype for
7337 putsym. Typo reported by Sebastian Piping.
7338
a61e1620
PE
73392005-02-23 Paul Eggert <eggert@cs.ucla.edu>
7340
7341 * doc/bison.texinfo (Language and Grammar): some -> same
7342 (Epilogue): int he -> in the
7343 Typos reported by Sebastian Piping via Justin Pence.
7344
9ec93868
PE
73452005-02-07 Paul Eggert <eggert@cs.ucla.edu>
7346
7347 * tests/glr-regression.at (Improper handling of embedded actions
7348 and dollar(-N) in GLR parsers): Renamed from "Improper handling of
7349 embedded actions and $-N in GLR parsers", work around an Autoconf bug
7350 with dollar signs in test names.
7351 * tests/input.at (Invalid dollar-n): Renamed from "Invalid \$n",
7352 for a similar reason.
7353
73ce7e7e
PE
73542005-01-28 Paul Eggert <eggert@cs.ucla.edu>
7355
7356 * src/vcg.c (output_graph): G_VIEW -> normal_view in case someone
7357 wants to redefine G_VIEW.
7358
2e72b98e
PE
73592005-01-27 Paul Eggert <eggert@cs.ucla.edu>
7360
7361 * src/vcg.c (get_view_str): Remove case for normal_view.
7362 Problem reported by twlevo@xs4all.nl.
7363
e0d634e5
PE
73642005-01-24 Paul Eggert <eggert@cs.ucla.edu>
7365
ccf830a4
PE
7366 * configure.ac (O0CFLAGS, O0CXXFLAGS): Fix quoting bug.
7367 Problem reported by twlevo@xs4all.nl.
7368
e0d634e5
PE
7369 * doc/bison.texinfo: Change @dircategory from "GNU programming
7370 tools" to "Software development". Requested by Richard Stallman
7371 via Karl Berry.
7372
7bbc8cb0
PE
73732005-01-23 Paul Eggert <eggert@cs.ucla.edu>
7374
7375 * tests/c++.at (AT_CHECK_DOXYGEN): Don't use options after operands.
7376 Problem reported by twlevo@xs4all.nl.
7377
08b770bc
PE
73782005-01-21 Paul Eggert <eggert@cs.ucla.edu>
7379
7380 * data/yacc.c (YYCOPY, yystpcpy, yyparse): Remove "register"
7381 keyword; it's not needed with modern compilers, and it doesn't
7382 affect correctness with older compilers. Suggested by
7383 twlevo@xs4all.nl.
7384
95f22ad2
PE
73852005-01-17 Paul Eggert <eggert@cs.ucla.edu>
7386
7387 * data/glr.c (yyuserAction): Add "default: break;" case to pacify
7388 gcc -Wswitch-default.
7389 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
7390 * data/yacc.c (yyparse): Likewise.
7391
d229d15c
PE
73922005-01-12 Paul Eggert <eggert@cs.ucla.edu>
7393
7394 * src/system.h (OUTPUT_EXT, TAB_EXT): Define only if not defined
7395 already. Let config.h define any nonstandard values.
7396
ecadd90f
PE
73972005-01-10 Paul Eggert <eggert@cs.ucla.edu>
7398
7399 * tests/calc.at (_AT_DATA_CALC_Y): Use alarm (100), not alarm (10),
7400 for the benefit of slower hosts. Problem reported by
7401 Nelson H. F. Beebe.
7402
213744b5
PE
74032005-01-07 Paul Eggert <eggert@cs.ucla.edu>
7404
7405 * data/yacc.c (yyparse): Pacify non-GCC compilers about yyerrorlab
7406 being defined and not used.
7407 * data/lalr1.cc (yyparse): Likewise.
7408 Use "if (false)" rather than "if (0)".
7409
249d3236
PE
74102005-01-05 Paul Eggert <eggert@cs.ucla.edu>
7411
7412 * TODO: Mention that we should allow NUL bytes in tokens.
7413
987cc1fb
PE
74142005-01-02 Paul Eggert <eggert@cs.ucla.edu>
7415
7416 * src/scan-skel.l (<<EOF>>): Don't close standard output.
7417 Problem reported by Hans Aberg.
7418
08fe02d9
PE
74192005-01-01 Paul Eggert <eggert@cs.ucla.edu>
7420
7421 * src/getargs.c (version): Happy new year; update overall
7422 program copyright date from 2004 to 2005.
7423
7424 * src/scan-skel.l ("@output ".*\n): Don't close standard output.
7425 Problem reported by Hans Aberg.
7426 * tests/output.at (AT_CHECK_OUTPUT): New arg SHELLIO.
7427 (Output file names.): Add a test for the case when standard output
7428 is closed.
7429
010c0266
PE
74302004-12-26 Paul Eggert <eggert@cs.ucla.edu>
7431
7432 * doc/bison.texinfo (@copying): Update FDL version number to 1.2,
7433 to fix an oversight in the Bison 2.0 manual.
7434
da12206a
PE
74352004-12-25 Paul Eggert <eggert@cs.ucla.edu>
7436
7437 * NEWS: Version 2.0. Reformat the existing news items since
7438 1.875, so that related items are grouped together.
3a4734aa 7439 * configure.ac (AC_INIT): Bump version to 2.0.
da12206a
PE
7440 * src/parse-gram.c, src/parse-gram.h: Regenerate with 2.0.
7441
c935d934
PE
7442 * tests/torture.at (Exploding the Stack Size with Alloca): Set
7443 YYSTACK_USE_ALLOCA to 1 if __GNUC__ or alloca are defined;
7444 otherwise, we're not testing alloca. Unfortunately there's no
7445 simple way to consult HAVE_ALLOCA here.
7446
da12206a
PE
7447 * data/lalr1.cc (yydestruct_): Pacify unused variable warning
7448 for yymsg, too.
7449
7450 * src/LR0.c (new_itemsets): Use memset rather than zeroing by
7451 hand. This avoids a warning about comparing int to size_t when
7452 GCC warnings are enabled.
7453
0a2c5137
PE
74542004-12-22 Paul Eggert <eggert@cs.ucla.edu>
7455
d7e14fc0
PE
7456 * NEWS: Bison-generated parsers no longer default to using the
7457 alloca function (when available) to extend the parser stack, due
7458 to widespread problems in unchecked stack-overflow detection.
7459 * data/glr.c (YYMAXDEPTH): Remove undef when zero. It's the user's
7460 responsibility to set it to a positive value. This lets the user
7461 specify a value that is not a preprocessor constant.
7462 * data/yacc.c (YYMAXDEPTH): Likewise.
7463 (YYSTACK_ALLOC): Define only if YYSTACK_USE_ALLOCA is nonzero.
7464 * doc/bison.texinfo (Stack Overflow): YYMAXDEPTH no longer needs
7465 to be a compile-time constant. However, explain the constraints on it.
7466 Also, explain the constraints on YYINITDEPTH.
7467 (Table of Symbols): Explain that alloca is no longer the default.
7468 Explain the user's responsibility if they define YYSTACK_USE_ALLOCA
7469 to 1.
7470
0a2c5137
PE
7471 * doc/bison.texinfo (Location Default Action): Mention that n must
7472 be zero when k is zero. Suggested by Frank Heckenbach.
7473
e019c247
AD
74742004-12-22 Akim Demaille <akim@epita.fr>
7475
7476 * data/lalr1.cc (parser::token_number_type, parser::rhs_number_type)
7477 (parser::state_type, parser::semantic_type, parser::location_type):
7478 Private, not public.
7479 (parser::parse): Return ints, not bool.
7480 Returning a bool introduces a problem: 0 corresponds to false, and
7481 it seems weird to return false on success. Returning true changes
7482 the conventions for yyparse.
7483 Alternatively we could return void and send an exception.
7484 There is no clear consensus (yet?).
7485 (state_stack, semantic_stack, location_stack): Rename as...
7486 (state_stack_type, semantic_stack_type, location_stack_type): these.
7487 Private, not public.
7488 * tests/c++.at: New.
7489 * tests/testsuite.at, tests/Makefile.am: Adjust.
7490
72731bb7
AD
74912004-12-21 Akim Demaille <akim@epita.fr>
7492
7493 * data/lalr1.cc (parser::parse): Return a bool instead of an int.
7494
9a0d8bec
AD
74952004-12-21 Akim Demaille <akim@epita.fr>
7496
7497 Don't impose std::string for filenames.
7498
7499 * data/lalr1.cc (b4_filename_type): New.
7500 (position::filename): Use it.
7501 (parser.hh): Move the inclusion of stack.hh and location.hh below
7502 the user code, so that needed headers for the filename type can be
7503 included first.
72731bb7
AD
7504 Forward declare them before the user code.
7505 * tests/Makefile.am (check-local, installcheck-local): Pass
7506 TESTSUITEFLAGS to the TESTSUITE.
9a0d8bec 7507
99880de5
AD
75082004-12-20 Akim Demaille <akim@epita.fr>
7509
7510 Use more STL like names: my_class instead of MyClass.
7511
7512 * data/lalr1.cc (LocationStack, LocationType, RhsNumberType)
7513 (SemanticStack, SemanticType, StateStack, StateType)
7514 (TokenNumberType, Stack, Slice, Traits, Parser::location)
7515 (Parser::value): Rename as...
7516 (location_stack, location_type, rhs_number_type, semantic_stack)
7517 (semantic_type, state_stack, state_type, token_number_type, stack)
7518 (slice, traits, parser::yylloc, parser::yylval): these.
7519
7520 * tests/calc.at, tests/regression.at, tests/actions.at: Adjust.
7521
9bec482e
PE
75222004-12-19 Paul Eggert <eggert@cs.ucla.edu>
7523
7524 * data/glr.c (YYLLOC_DEFAULT): Use GNU spacing conventions.
7525 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
7526
f6fbd3da
PE
75272004-12-17 Paul Eggert <eggert@cs.ucla.edu>
7528
7529 Remove uses of 'short int' and 'unsigned short int'. This raises
7530 some arbitrary limits. It uses more memory but nowadays that's
7531 not much of an issue.
7532
7533 This change does not affect the generated parsers; that's a different
7534 task, as some users will want to conserve memory there.
7535
7536 Ideally we should use size_t to represent all object counts, and
7537 something like ptrdiff_t to represent signed differences of object
7538 counts; but that will require more code-cleanup than I have the
7539 time to do right now.
7540
7541 * src/LR0.c (allocate_itemsets, new_itemsets, save_reductions):
7542 Use size_t, not int or short int, to count objects.
7543 * src/closure.c (nritemset, closure): Likewise.
7544 * src/closure.h (nritemset, closure): Likewise.
7545 * src/nullable.c (nullable_compute): Likewise.
7546 * src/print.c (print_core): Likewise.
7547 * src/print_graph.c (print_core): Likewise.
7548 * src/state.c (state_compare, state_hash): Likewise.
7549 * src/state.h (struct state): Likewise.
7550 * src/tables.c (default_goto, goto_actions): Likewise.
7551
7552 * src/gram.h (rule_number, rule): Use int, not short int.
7553 * src/output.c (prepare_rules): Likewise.
7554 * src/state.h (state_number, STATE_NUMBER_MAXIMUM, transitions,
7555 errs, reductions): Likewise.
7556 * src/symtab.h (symbol_number, SYMBOL_NUMBER_MAXIMUM, struct symbol):
7557 Likewise.
7558 * src/tables.c (vector_number, tally, action_number,
7559 ACTION_NUMBER_MINIMUM): Likewise.
7560 * src/output.c (muscle_insert_short_int_table): Remove.
7561
efeed023
AD
75622004-12-17 Akim Demaille <akim@epita.fr>
7563
7564 * data/lalr1.cc: Extensive Doxygenation.
7565 (error_): Rename as...
7566 (error): this, since it is visible to the user.
7567 Adjust callers.
7568 (Parser::message): Now an automatic variable from...
7569 (Parser::yyreport_syntax_error_): here.
7570 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust to
7571 Parser::error.
7572 * tests/input.at: Escape $.
7573
bc82c5a5
PE
75742004-12-16 Paul Eggert <eggert@cs.ucla.edu>
7575
7576 * data/glr.c (b4_lhs_value, b4_rhs_value, b4_rhs-location):
7577 Parenthesize rhs to avoid obscure problems with mistakes like
7578 "foo$$bar = foo$1bar;". Problem reported by twlevo at xs4all.
7579 * data/lalr1.cc (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7580 b4_rhs_location): Likewise.
7581 * data/yacc.c (b4_lhs_value, b4_rhs_value, b4_lhs_location,
7582 b4_rhs_location): Likewise.
7583
fd19f271
AD
75842004-12-16 Akim Demaille <akim@epita.fr>
7585
7586 * data/lalr1.cc (yyreport_syntax_error_): Catch up with glr.c and
7587 yacc.c: be sure to stay within yycheck_.
7588 * tests/actions.at: Re-enable C++ tests.
7589
10454ea4
AD
75902004-12-16 Akim Demaille <akim@epita.fr>
7591
7592 * src/print_graph.c (print_graph): Remove layoutalgorithm uses for
7593 real.
7594
c5b95ccf
AD
75952004-12-16 Akim Demaille <akim@epita.fr>
7596
7597 Use #define to handle the %name-prefix.
7598
7599 * data/glr.c, data/yacc.c: Comment changes.
7600 * data/lalr1.cc (yylex): Use #define to select the name of yylex,
7601 so that one can refer to yylex in the parser file, and have it
7602 renamed, as is the case with other skeletons.
7603
617a8f12
AD
76042004-12-16 Akim Demaille <akim@epita.fr>
7605
7606 Move lalr1.cc internals into yy*.
7607
7608 * data/lalr1.cc (semantic_stack_, location_stack_, state_stack_)
7609 (semantic_stack_, location_stack_, pact_, pact_ninf_, defact_)
7610 (pgoto_, defgoto_, table_, table_ninf_, check_, stos_, r1_, r2_)
7611 (name_, rhs_, prhs_, rline_, token_number_, eof_, last_, nnts_)
7612 (empty_, final_, terror_, errcode_, ntokens_)
7613 (user_token_number_max_, undef_token_, n_, len_, state_, nerrs_)
7614 (looka_, ilooka_, error_range_, nerrs_):
7615 Rename as...
7616 (yysemantic_stack_, yylocation_stack_, yystate_stack_)
7617 (yysemantic_stack_, yylocation_stack_, yypact_, yypact_ninf_)
7618 (yydefact_, yypgoto_, yydefgoto_, yytable_, yytable_ninf_)
7619 (yycheck_, yystos_, yyr1_, yyr2_, yyname_, yyrhs_, yyprhs_)
7620 (yyrline_, yytoken_number_, yyeof_, yylast_, yynnts_, yyempty_)
7621 (yyfinal_, yyterror_, yyerrcode_, yyntokens_)
7622 (yyuser_token_number_max_, yyundef_token_, yyn_, yylen_, yystate_)
7623 (yynerrs_, yylooka_, yyilooka_, yyerror_range_, yynerrs_):
7624 these.
7625
1e547e6e
PE
76262004-12-15 Paul Eggert <eggert@cs.ucla.edu>
7627
7628 Fix some problems reported by twlevo at xs4all.
7629 * src/symtab.c (symbol_new): Report an error if the input grammar
7630 contains too many symbols. This is better than calling abort() later.
7631 * src/vcg.h (enum layoutalgorithm): Remove. All uses removed.
7632 (struct node, struct graph):
7633 Rename member expand to stretch. All uses changed.
7634 (struct graph): Remove member layoutalgorithm. All uses removed.
7635 * src/vcg.c (get_layoutalgorithm_str): Remove. All uses removed.
7636 * src/vcg_defaults.h (G_STRETCH): Renamed from G_EXPAND.
7637 All uses changed.
7638 (N_STRETCH): Rename from N_EXPAND. All uses changed.
7639
735d6bd4
AD
76402004-12-15 Akim Demaille <akim@epita.fr>
7641
7642 * data/lalr1.cc: Normalize /** \brief ... */ to ///.
7643 Add more Doxygen comments.
7644 (symprint_, stack_print_, reduce_print_, destruct_, pop)
7645 (report_syntax_error_, translate_): Rename as...
7646 (yysymprint_, yystack_print_, yyreduce_print_, yydestruct_)
7647 (yypop_, yyreport_syntax_error_, yytranslate_): this.
7648
2e1f5829
AD
76492004-12-15 Akim Demaille <akim@epita.fr>
7650
7651 * data/lalr1.cc (lex_): Rename as...
7652 (yylex_): this.
7653 Move the trace here.
7654 Take the %name-prefix into account.
7655 Reported by Alexandre Duret-Lutz.
7656
a3cb6248
AD
76572004-12-15 Akim Demaille <akim@epita.fr>
7658
7659 Simplify the C++ parser constructor.
7660
7661 * data/lalr1.cc (debug_): Rename as...
7662 (yydebug_): so that the parser's internals are always in the yy*
7663 pseudo namespace.
7664 Adjust uses.
7665 (b4_parse_param_decl): Remove the leading comma as it is now only
7666 called as unique argument list.
7667 (Parser::Parser): Remove the constructor accepting a location and
7668 an initial debugging level.
7669 Remove from the other ctor the argument for the debugging level.
7670 (debug_level_type, debug_level, set_debug_level): New.
7671
7672 * tests/actions.at, tests/calc.at, tests/regression.at: Adjust
7673 constructor calls.
7674
07fed891
AD
76752004-12-15 Akim Demaille <akim@epita.fr>
7676
7677 Remove b4_root related material: failure experiment
a3cb6248 7678 (which goal was to allow to derive from a class).
07fed891
AD
7679
7680 * data/lalr1.cc (b4_root, b4_param, b4_constructor): Remove
7681 definitions and uses.
7682
e603eaa5
PE
76832004-12-14 Paul Eggert <eggert@cs.ucla.edu>
7684
7685 * data/glr.c (struct yyGLRStack): yyerror_range now has 3 items,
7686 not 2, since it's not portable to subtract 1 from the start of an
7687 array. The new item 0 is never set or used. All uses changed.
7688
7689 (yyrecoverSyntaxError): Use YYLLOC_DEFAULT instead of assuming
7690 the default definition of YYLLOC_DEFAULT. Problem reported
7691 by Frank Heckenbach.
7692
fafb007d
PE
76932004-12-12 Paul Eggert <eggert@cs.ucla.edu>
7694
7695 * data/glr.c (YYRHSLOC): Don't have two definitions, one for
7696 the normal case and one for the error case. Just use the
7697 first one uniformly. Problem reported by Frank Heckenbach.
7698 (YYLLOC_DEFAULT): Use the conventions of yacc.c, so we can
7699 use exactly the same macro in both places.
7700 (yyerror_range): Now of type yyGLRStackItem, not YYLTYPE,
7701 so that the normal-case YYRHSLOC works for the error case too.
7702 All uses changed.
7703 * data/yacc.c (YYRHSLOC): New macro, taken from glr.c.
7704 (YYLLOC_DEFAULT): Use the same macro as glr.c.
7705 * doc/bison.texinfo (Location Default Action): Don't claim that
7706 we have an array of locations. Use the same macro for both glr
7707 and lalr parsers. Mention YYRHSLOC. Mention what happens when
7708 the index is 0.
7709
48814dcd
PE
77102004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7711
a4e1a53b
PE
7712 * HACKING: Update email addresses to send announcements to.
7713
48814dcd
PE
7714 * configure.ac (AC_INIT): Bump version to 1.875f.
7715
337116ba
PE
77162004-12-10 Paul Eggert <eggert@cs.ucla.edu>
7717
7718 * NEWS: Version 1.875e.
7719 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875e.
7720
7721 * src/scan-skel.l: Include "complain.h", for "fatal".
7722
7723 * src/relation.h (relation_print, relation_digraph):
7724 Relation sizes are of type relation_node, not size_t (this is
7725 merely a doc fix, since the two types are equivalent).
7726 (relation_transpose): Relation sizes are of type relation_node,
7727 not int.
7728 * src/relation.c: Likewise.
7729 (top, infinity): Now of type relation_node, not int.
7730 (traverse, relation_transpose): Use relation_node, not int.
7731
7732 * data/glr.c (yyuserAction, yyrecoverSyntaxError): Mark args
7733 with ATTRIBUTE_UNUSED if they're not used, to avoid GCC warning.
7734 (yyparse): Remove unused local introduced in 2004-10-25 patch.
7735
7736 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): New arg
68b082af 7737 specifying whether the test should be skipped. Use it tp
337116ba 7738 specify that the [%defines %skeleton "lalr1.cc"] tests currently
68b082af 7739 fail on some hosts, and should be skipped.
337116ba 7740
da2a7671
PE
77412004-12-08 Paul Eggert <eggert@cs.ucla.edu>
7742
7743 * src/system.h (CALLOC, MALLOC, REALLOC): Remove. All callers
7744 changed to use xcalloc, xnmalloc, xnrealloc, respectively,
7745 unless otherwise specified below.
7746
7747 * src/LR0.c (allocate_itemsets): Use xnmalloc, not xcalloc,
7748 to allocate kernel_base, kernel_items, kernel_size, since
7749 they needn't be initialized to 0.
7750 (allocate_storgae): Likewise, for shiftset, redset, shift_symbol.
7751 * src/closure.c (new_closure): Likewise, for itemset.
7752 * src/derives.c (derives_compute): Likewise, for delts, derives, q.
7753 * src/lalr.c (set_goto_map): Likewise, for temp_map.
7754 (initialize_F): Likewise, for reads, edge, reads[i], includes[i].
7755 (build_relations): Likewise for edge, states1, includes.
7756 * src/nullable.c (nullable_compute): Likewise, for squeue, relts.
7757 * src/reader.c (packgram): Likewise, for ritem, rules.
7758 * src/reduce.c (nonterminals_reduce): Likewise for nontermmap.
7759 * src/relation.c (relation_digraph): Likewise for VERTICES.
7760 (relation_transpose): Likewise for new_R, end_R.
7761 * src/symtab.c (symbols_token_translations_init): Likewise for
7762 token_translations.
7763 * src/tables.c (save_row): Likewise for froms, tos, conflict_tos.
7764 (token_actions): Likewise for yydefact, actrow, conflrow,
7765 conflict_list.
7766 (save_column): Likewise for froms[symno], tos[symno].
7767 (goto_actions): Likewise for state_count.
7768 (pack_table): Likewise for base, pos, check.
7769 (tables_generate): Likewise for width.
7770
7771 * src/LR0.c (set_states): Don't reuse kernel_size and kernel_base
7772 for initial core. Just have a separate core, so we needn't worry
7773 about whether kernel_size and kernel_base are initialized.
7774
7775 * src/LR0.c (shift_symbol, redset, shiftset, kernel_base,
7776 kernel_size, kernel_items): Remove unnecessary initialization.
7777 * src/conflicts.c (conflicts): Likewise.
7778 * src/derives.c (derives): Likewise.
7779 * src/muscle_tablc (muscle_insert): Likewise.
7780 * src/relation.c (relation_digraph): Likewise.
7781 * src/tables.c (froms, tos, conflict_tos, tally, width, actrow, order,
7782 conflrow, conflict_table, conflict_list, table, check):
7783 Likewise.
7784
7785 * src/closure.c (new_closure): Arg is of type unsigned int, not int.
7786 This is because all callers pass unsigned int.
7787 * src/closure.h (new_closure): Likewise.
7788
7789 * src/lalr.c (initialize_F): Initialize reads[i] in all cases.
7790 (build_relations): Initialize includes[i] in all cases.
7791 * src/reader.c (packgram): Always initialize rules[ruleno].prec
7792 and rules[ruleno].precsym. Initialize members in order.
7793 * src/relation.c (relation_transpose): Always initialize new_R[i]
7794 and end_R[i].
7795 * src/table.c (conflict_row): Initialize 0 at end of conflict_list.
7796
7797 * src/output.c (prepare_actions): Pass 0 instead of conflict_list[0];
7798 conflict_list[0] was always 0, but now it isn't initialized.
7799
7800 * src/table.c (table_grow): When conflict_table grew, the grown
7801 area wasn't cleared. Fix this.
7802
7803 * lib/.cvsignore: Add strdup.c, strdup.h.
7804 * m4/.cvsignore: Add strdup.m4.
7805
00baeeac
PE
78062004-12-07 Paul Eggert <eggert@cs.ucla.edu>
7807
7808 * src/lalr.h (GOTO_NUMBER_MAXIMUM): New macro.
7809 * src/lalr.c (set_goto_map): Don't allow ngotos to equal
7810 GOTO_NUMBER_MAXIMUM, since we occasionally compute
7811 ngotos + 1 without checking for overflow.
7812 (build_relations): Use END_NODE, not -1, to denote end of edges.
7813 * src/lalr.c (set_goto_map, map_goto, initialize_F, add_loopback_edge,
7814 build_relations): Use goto_number, not int, for goto numbers.
7815 * src/tables.c (save_column, default_goto): Likewise.
7816
be3d9d42
AD
78172004-11-23 Akim Demaille <akim@epita.fr>
7818
7819 * data/lalr1.cc (YYSTYPE): Define it as is done for C, instead
7820 of #defining from yystype.
7821 Don't typedef yystype, C++ does not need it.
7822 This lets it possible to forward declare it as union.
7823
78e526d5
PE
78242004-11-23 Paul Eggert <eggert@cs.ucla.edu>
7825
7826 * bootstrap (gnulib_modules): Add extensions.
7827 Problem reported by Jim Meyering.
7828
afbb696d
PE
78292004-11-22 Paul Eggert <eggert@cs.ucla.edu>
7830
7831 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c,
7832 src/lalr.c, src/nullable.c, src/relation.c, src/scan-skel.l,
7833 src/system.h, src/tables.c: XFREE -> free, to accommodate
7834 recent change to gnulib xalloc.h.
78e526d5 7835 Problem reported by Jim Meyering.
afbb696d 7836
c1f8f16a
AD
78372004-11-17 Akim Demaille <akim@epita.fr>
7838
7839 * data/lalr1.cc (symprint_): Use cdebug_ to avoid warnings.
7840
db7e5eb5 78412004-11-17 Akim Demaille <akim@epita.fr>,
9a1e9989
AD
7842 Alexandre Duret-Lutz <adl@gnu.org>
7843
7844 * data/lalr1.cc (Parser::yycdebug_): New, a pointer, to allow
7845 changes.
7846 (YYCDEBUG): Adjust.
7847 Use it instead of cdebug_.
7848 (Parser::debug_stream, Parser::set_debug_stream): New.
7849 (Parser::symprint_): Define cdebug_ for temporary backward
7850 compatibility.
7851 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use
7852 debug_stream ().
7853
68e11668
AD
78542004-11-17 Akim Demaille <akim@epita.fr>
7855
7856 * data/lalr1.cc (Parser:print_): Remove, use %printer instead.
7857 * tests/regression.at (_AT_DATA_DANCER_Y): Adjust.
7858 * tests/calc.at (_AT_DATA_CALC_Y): Ditto.
7859 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
7860
97cbc73e
PE
78612004-10-27 Paul Eggert <eggert@cs.ucla.edu>
7862
7863 * data/glr.c (yyloc_default): Remove; not used.
7864 Problem reported by Frank Heckenbach.
7865
e342c3be
AD
78662004-10-25 Akim Demaille <akim@epita.fr>
7867
7868 * data/glr.c (YYRHSLOC): Move its definition next to its uses.
7869 Introduce another definition to address simple location arrays.
7870 (yyGLRStack): New member: yyerror_range.
7871 (yyrecoverSyntaxError, yyparse): Update it.
7872 (yyrecoverSyntaxError): Use it when shifting the error token to
7873 have an accurate range, equivalent to the one computed by both
7874 yacc.c and lalr1.cc.
7875 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Change its yylex so
7876 that column numbers start at column 0, as per GNU Coding
7877 Standards, the others tests, and the doc.
7878 (_AT_RESOLVED_GLR_OUTPUT_WITH_LOC, _AT_AMBIG_GLR_OUTPUT_WITH_LOC):
7879 Adjust to the above change (first column is 0).
7880 And adjust the location of the "<error>", now covering the whole
7881 line.
7882
93602feb 78832004-10-22 Akim Demaille <akim@epita.fr>
04098407 7884 and Paul Eggert <eggert@cs.ucla.edu>
93602feb
PE
7885
7886 Remove some arbitrary limits on goto numbers and relations.
7887 * src/lalr.c (goto_map, ngotos, from_state, to_state): Omit
7888 initial values, since they're never used.
7889 (set_goto_map): ngotos is now unsigned, so test for overflow
7890 by seeing whether it wraps around to zero.
7891 * src/lalr.h (goto_number): Now size_t, not short int.
7892 (GOTO_NUMBER_MAXIMUM): Remove.
7893 * src/relation.c (relation_print, traverse, relation_transpose):
7894 Check for END_NODE rather than looking at sign.
7895 * src/relation.h (END_NODE): New macro.
7896 (relation_node): Now size_t, not short int.
7897
dba08b04
PE
78982004-10-22 Paul Eggert <eggert@cs.ucla.edu>
7899
7900 * doc/bison.texinfo (Language and Grammar): In example, "int" is a
7901 keyword, not an identifier. Problem reported by Baron Schwartz in
7902 <http://lists.gnu.org/archive/html/bug-bison/2004-10/msg00017.html>.
7903
df09ef2e
AD
79042004-10-11 Akim Demaille <akim@epita.fr>
7905
7906 * src/symtab.c (symbol_check_alias_consistency): Also check
7907 type names, destructors, and printers.
7908 Reported by Alexandre Duret-Lutz.
7909 Recode the handling of associativity and precedence in terms
7910 of symbol_precedence_set.
7911 Accept no redeclaration at all, not even equal to the previous
7912 value.
7913 (redeclaration): New.
7914 Use it to factor redeclaration complaints.
7915 (symbol_make_alias): Don't set the type of the alias, let
7916 symbol_check_alias_consistency do it as for other features.
7917 * src/symtab.h (symbol): Add new member prec_location, and
7918 type_location.
7919 * src/symtab.c (symbol_precedence_set, symbol_type_set): Set them.
7920 * tests/input.at (Incompatible Aliases): New.
7921
146bc99d
PE
79222004-10-09 Paul Eggert <eggert@cs.ucla.edu>
7923
7924 .cvsignore fixes to accommodate gnulib changes,
7925 and the practice of naming build directories "_build".
7926 * .cvsignore: Add "_*". Sort.
7927 * lib/.cvsignore: Add getopt_.h, xalloc-die.c.
7928 * m4/.cvsignore: Add "*_gl.m4".
7929
e503aa60
AD
79302004-10-06 Akim Demaille <akim@epita.fr>
7931
7932 * src/parse-gram.y (add_param): Fix the truncation of trailing
7933 spaces.
7934
b4a20338
AD
79352004-10-05 Akim Demaille <akim@epita.fr>
7936
7937 In Bison 1.875's yacc.c, YYLLOC_DEFAULT was called regardless
7938 whether the reducion was empty or not. This leaves room to
7939 improve the use of YYLLOC_DEFAULT in such a case.
7940 lalr1.cc is still experimental, so changing this is acceptable.
7941 And finally, there are probably not many users who changed the
7942 handling of locations in GLR, so changing is admissible too.
7943
7944 * data/glr.c, data/lalr1.cc, data/yacc.c (YYLLOC_DEFAULT): On an
7945 empty reduction, set @$ to an empty location ending the previously
7946 stacked symbol.
7947 Adjust uses to make sure the code is triggered on empty
7948 reductions.
7949 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust the
7950 expected output: empty reductions have empty locations.
7951
f85a5e6f
AD
79522004-09-29 Akim Demaille <akim@epita.fr>
7953
7954 * data/lalr1.cc: Move towards a more standard C++ coding style
7955 for templates: Class < T > -> Class<T>.
7956
b203fc2c
AD
79572004-09-29 Akim Demaille <akim@epita.fr>
7958
7959 * data/lalr1.cc: Reinstall the former ctor, for sake of
7960 compatibility, but warn it will be removed.
7961 Move towards a more standard C++ coding style (i.e., type *var ->
7962 type* var).
7963
5b7e1e73
PE
79642004-09-27 Paul Eggert <eggert@cs.ucla.edu>
7965
3fee967f
PE
7966 * src/parse-gram.y (add_param): Rewrite to avoid strchr,
7967 since it's less likely to work if NULs are involved in the future.
5b7e1e73 7968
0dcca5c2
AD
79692004-09-27 Akim Demaille <akim@epita.fr>
7970
7971 * data/yacc.c (YY_LOCATION_PRINT): Fix its default declaration.
7972
6dde1c82
AD
79732004-09-27 Akim Demaille <akim@epita.fr>
7974
7975 * data/lalr1.cc (b4_parse_param_decl_1): New.
b203fc2c 7976 (b4_parse_param_decl): Use it to have different names between attribute
6dde1c82
AD
7977 and argument names.
7978 (b4_cc_constructor_call): Likewise.
7979
b233d555
AD
79802004-09-24 Akim Demaille <akim@epita.fr>
7981
7982 * src/parse-gram.y (add_param): Strip the leading and trailing
7983 blanks from a formal argument declaration.
7984 (YY_LOCATION_PRINT): New.
7985
619404e3
AD
79862004-09-24 Akim Demaille <akim@epita.fr>
7987
7988 * data/c.m4 (b4_yysymprint_generate): Move the YYINPUT invocation
7989 after the location.
7990
dd8d9022
AD
79912004-09-24 Akim Demaille <akim@epita.fr>
7992
7993 * doc/bison.texinfo (Table of Symbols): Sort.
7994
0092f063
AD
79952004-09-21 Akim Demaille <akim@epita.fr>
7996
7997 * data/yacc.c, data/glr.c (b4_at_dollar, b4_dollar_dollar): Remove
7998 the useless parentheses.
7999 Suggested by Paul Eggert.
8000
451364ed
AD
80012004-09-20 Akim Demaille <akim@epita.fr>
8002
8003 Let the initial-action act on the look-ahead, and use it for the
8004 "initial push" (corresponding to an hypothetical beginning-of-file).
8005 And let lalr1.cc honor %initial-action.
8006
8007 * doc/bison.texinfo (Initial Action Decl): Clarify, and add an
8008 example.
8009 * data/lalr1.cc (Parser::initlocation_): Remove, bad experiment.
8010 (Parser::Parser): Remove the ctor that used to initialize it.
8011 (Parser::parse): Like in the other skeletons, issue the "starting
8012 parse" message before any action.
8013 Honor %initial-action.
8014 Initialize the stacks with the lookahead.
8015 * data/yacc.c: Let $$ and @$ in %initial-action designate the
8016 look-ahead.
8017 Push them in the stacks.
8018 * tests/actions.at, tests/calc.at: Adjust the C++ ctor invocations.
8019
18d192f0
AD
80202004-09-20 Akim Demaille <akim@epita.fr>
8021
8022 * doc/bison.texinfo (Initial Action Decl): New.
8023
b8458aa5
AD
80242004-09-20 Akim Demaille <akim@epita.fr>
8025
8026 * data/yacc.c (YY_LOCATION_PRINT): Use YYLTYPE_IS_TRIVIAL as a
8027 clearer criterion to define it.
8028 (parse): Initialize the initial location when YYLTYPE_IS_TRIVIAL.
8029 When reducing on an empty RHS, use the latest stacked location as
8030 location.
8031 yylloc is not always available.
8032 * data/glr.c: Likewise.
8033 Also, honor initial-actions.
8034
3fc16193
AD
80352004-09-20 Akim Demaille <akim@epita.fr>
8036
8037 * data/yacc.c (YY_LOCATION_PRINT): New.
8038 Define when we know YYLTYPE's structure, i.e., when the default
8039 YYLLOC_DEFAULT is used.
8040 * data/c.m4 (b4_yysymprint_generate): Use it.
8041 * data/lalr1.cc (YYLLOC_DEFAULT): Stop relying on the initial
8042 value of the result.
8043 (error_start_): Replace with...
8044 (error_range_): this location array.
8045 This allows to replace code relying on the implementation of
8046 locations by portable code.
8047 * data/yacc.c (yylerrsp): Replace with...
8048 (yyerror_range): this.
8049 Every time a token is popped, update yyerror_range[0], to have an
8050 accurate location for the error token.
8051 * data/glr.c (YY_LOCATION_PRINT): New.
8052 (yyprocessOneStack): Fix an invocation of YY_SYMBOL_PRINT:
8053 deference a pointer.
8054 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): No longer
8055 report the location in %printers.
8056
8057 * src/scan-skel.l: Instead of abort, report error messages to ease
8058 understanding skeleton scanning failures.
8059
ecfe33e7
AD
80602004-09-16 Akim Demaille <akim@epita.fr>
8061
8062 * data/lalr1.cc (Stack::Iterator, Stack::ConstIterator): Rename as...
8063 (iterator, const_iterator): these, to be more in the C++ spirit.
8064 Also, return reverse iterators so that when displaying the stack
8065 we display its bottom first.
8066 (Parser::stack_print_, Parser::reduce_print_): Match the messages
8067 from yacc.c.
8068 We should probably use vector here though.
8069
1576d44d
AD
80702004-09-16 Akim Demaille <akim@epita.fr>
8071
8072 Have more complete shift traces.
8073
8074 * data/yacc.c, data/lalr1.c, data/glr.c: Use YY_SYMBOL_PRINT
8075 to report Shifts instead of ad hoc YYDPRINTF invocations,
8076 including for the error token.
8077 * data/lalr1.cc (symprint_): Output the location.
8078 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): In C++, don't
8079 output the location within the %printer.
8080 Activate GLR tests, at least to make sure they compile properly.
8081 They still don't pass though.
8082 * tests/calc.at: Adjust expect verbose output, since now "Entering
8083 state..." is on a different line than the "Shifting" message.
8084
9c66f418
AD
80852004-09-08 Akim Demaille <akim@epita.fr>
8086
8087 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Move the
8088 Bison directive from the Bison file to the invocation of this
8089 macro, so that these directives are passed to
8090 AT_BISON_OPTION_PUSHDEFS to get correct help macros.
8091 Use these helping macros (e.g., AT_LOC, AT_VAL and so forth).
8092 Move the AT_SETUP/AT_CLEANUP outside, to report as test title
8093 the extra Bison directives instead of the whole series.
8094 Change the grammar so that there are recoverable errors, and
8095 unrecoverable errors. Now we can have the parser give up before
8096 consuming the whole input. As a result we now can observe that
8097 the lookahead is freed when needed.
8098 Change the parser source to parse argv[1] instead of a hard coded
8099 string.
8100 Simplify yylex, and give a value and location to EOF.
8101 Simplify some invocations of AT_CHECK_PRINTER_AND_DESTRUCTOR that
8102 passed directives already coded in the file.
8103 Add some tests to check the location of "error".
8104 For some tests, the C++ parser is correct, and not yacc.c.
8105 For other tests, they provide different, but unsatisfying, values,
8106 so keep the C++ value so that at least one parser is "correct"
8107 according to the test suite.
8108 (Actions after errors): Remove, this is subsumed by the
8109 AT_CHECK_PRINTER_AND_DESTRUCTOR series.
8110
52d5733f
AD
81112004-09-06 Akim Demaille <akim@epita.fr>
8112
8113 * data/lalr1.cc: Adjust the indentation of the labels.
04098407 8114 (Parser::pop): New.
52d5733f
AD
8115 Use it.
8116
a0e68930
AD
81172004-09-06 Akim Demaille <akim@epita.fr>
8118
8119 * data/yacc.cc, data/glr.cc (yydestruct): Accept an additional
8120 argument, an informative message.
8121 Call YY_SYMBOL_PRINT.
8122 Adjust all callers: integrate the associated YY_SYMBOL_PRINT.
8123 * data/lalr1.cc (destruct_): Likewise.
8124 In addition, no longer depend on b4_yysymprint_generate and
8125 b4_yydestruct_generate to generate these functions, do it "by
8126 hand".
8127
e757bb10
AD
81282004-09-03 Akim Demaille <akim@epita.fr>
8129
8130 * data/glr.c, data/lalr1.cc, data/yacc.c: When YYABORT was
8131 invoked, yydestruct the lookahead.
8132 * tests/calc.at (Calculator $1): Update the expected lengths of
8133 traces: there is an added line for the discarded lookahead.
8134 * doc/bison.texinfo (Destructor Decl): Some rewording.
8135 Define "discarded" symbols.
8136
0fe1f06d
AD
81372004-09-02 Akim Demaille <akim@epita.fr>
8138
8139 * data/lalr1.cc (translate_, destruct_): No reason to be static.
8140
284acc8b
AD
81412004-09-02 Akim Demaille <akim@epita.fr>
8142
8143 * data/glr.c, yacc.c (YYDSYMPRINT): Remove, not used.
8144 (YYDSYMPRINTF): Rename as...
8145 (YY_SYMBOL_PRINT): this.
8146 * data/lalr1.cc (YY_SYMBOL_PRINT): New, modeled after the previous
8147 two.
8148 Use it instead of direct symprint_ calls.
8149 (yybackup): Tweak the "Now at end of input" case to match yacc.c's
8150 one.
8151
a5eb1ed2
AD
81522004-09-02 Akim Demaille <akim@epita.fr>
8153
b7c72fe1
AD
8154 * data/lalr1.cc (b4_yysymprint_generate): New.
8155 (symprint_): New member function, defined when YYDEBUG.
8156 Use it consistently instead of token/nterm debugging output by
8157 hand.
a5eb1ed2
AD
8158 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust
8159 %printer calls to use cdebug_ when using lalr1.cc.
8160
417141dd
AD
81612004-08-30 Florian Krohm <florian@edamail.fishkill.ibm.com>
8162
8163 * data/glr.c: Guard the declarations of yypstack and yypdumpstack
8164 with #ifdef YYDEBUG.
8165
2fa09258
AD
81662004-08-26 Akim Demaille <akim@epita.fr>
8167
8168 * doc/bison.texinfo (Implementing Loops): Rename as...
8169 (Implementing Gotos/Loops): this.
8170
9378b508
PE
81712004-08-13 Paul Eggert <eggert@cs.ucla.edu>
8172
8173 Adjust to latest gnulib.
8174 * bootstrap (gnulib_modules): Add xalloc-die.
8175 Set LC_ALL=C so that file names sort consistently.
8176 Prefer the gnulib copies of gettext.m4, glibc21.m4,
8177 inttypes_h.m4, lib-ld.m4, lib-prefix.m4, po.m4, stdint_h.m4,
8178 uintmax_t.m4, ulonglong.m4.
8179 (intl_files_to_remove): Add gettext.m4, lib-ld.m4, lib-prefix.m4,
8180 po.m4 since we are now using _gl.m4 instead.
8181
87a8ad5c
PE
81822004-08-10 Florian Krohm <florian@edamail.fishkill.ibm.com>
8183
8184 * src/scan-action.l: Remove. Scanning of semantic actions is
8185 handled in scan-gram.l.
8186
dca81a78
PE
81872004-08-07 Florian Krohm <florian@edamail.fishkill.ibm.com>
8188
8189 * src/scan-gram.l (handle_syncline): Use uniqstr_new not xstrdup.
8190
8191 * src/location.h (struct): The file member is a uniqstr.
8192 (equal_boundaries): Use UNIQSTR_EQ for comparison.
8193
c9cbf7c5
PE
81942004-07-22 Paul Eggert <eggert@cs.ucla.edu>
8195
8196 Fix bug with non-%union parsers that have printers or destructors,
8197 which led to a Bison core dump. Reported by Peter Fales in
8198 <http://lists.gnu.org/archive/html/bug-bison/2004-07/msg00014.html>.
2fa09258 8199
c9cbf7c5
PE
8200 * data/c.m4 (b4_symbol_actions): Don't assume %union was used.
8201 * data/lalr1.cc (yystype) [defined YYSTYPE]: Define to YYSTYPE,
8202 not to our own type.
8203 * src/output.c (symbol_destructors_output, symbol_printers_output):
8204 Don't assume %union.
8205 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR,
8206 AT_CHECK_PRINTER_AND_DESTRUCTOR): New argument
8207 UNION-FLAG. All callers changed.
8208 (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't assume %union.
8209 Use type char, not unsigned int, when declaring an array of char;
8210 this lets us remove a cast.
8211 (Printers and Destructors): Add non-%union test cases.
8212
fa7e68c3
PE
82132004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8214
8215 * doc/bison.texinfo: Minor editorial changes, mostly to the new
8216 GLR writeups. E.g., avoid frenchspacing and the future tense,
8217 change "lookahead" to "look-ahead", and change "wrt" to "with
8218 respect to".
2fa09258 8219
fa7e68c3
PE
82202004-06-21 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8221
8222 * doc/bison.texinfo (Merging GLR Parses, Compiler Requirements):
8223 New sections, split off from the GLR Parsers section. Put the new
8224 Simple GLR Parser near the start of the GLR section, for clarity.
8225 Rewrite connective text.
8226
99a9344e
PE
82272004-06-21 Frank Heckenbach <frank@g-n-u.de>
8228
8229 * doc/bison.texinfo (Simple GLR Parsers): New section.
8230
8dd162d3
PE
82312004-06-21 Paul Eggert <eggert@cs.ucla.edu>
8232
8233 * NEWS, TODO, doc/bison.texinfo:
8234 Use "look-ahead" instead of "lookahead", to be consistent.
8235 * REFERENCES: Fix incorrect reference to DeRemer and Pennello,
8236 while we're fixing "look-ahead".
8237 * src/conflicts.c (shift_set): Renamed from shiftset.
8238 (look_ahead_set): Renamed from lookaheadset.
8239 * src/print.c: Likewise.
8240 * src/getargs.c (report_args): Add "look-ahead" as the new canonical
8241 name for "lookahead".
8242 (report_types, usage): Likewise.
8243 * src/getargs.h (report_look_ahead_tokens): Renamed from
8244 report_lookaheads.
8245 * src/lalr.c (compute_look_ahead_tokens): Renamed from
8246 compute_lookaheads.
8247 (state_look_ahead_tokens_count): Renamed from state_lookaheads_count.
8248 (look_ahead_tokens_print): Renamed from lookaheads_print.
8249 * src/state.c (state_rule_look_ahead_tokens_print): Renamed from
8250 state_rule_lookaheads_print.
8251 * src/state.h: Likewise.
8252 (reductions.look_ahead_tokens): Renamed from lookaheads.
8253 * tests/torture.at (AT_DATA_LOOK_AHEAD_TOKENS_GRAMMAR): Renamed from
8254 AT_DATA_LOOKAHEADS_GRAMMAR.
8255
57a90331
PE
82562004-06-03 Paul Eggert <eggert@cs.ucla.edu>
8257
8258 * README: Update location of patched M4 distribution.
8259
8ed3234a
PE
82602004-05-30 Albert Chin-A-Young <china@thewrittenword.com>
8261
8262 Don't assume the C++ compiler takes the same arguments as the C compiler
8263 (trivial change).
8264 * configure.ac (O0CXXFLAGS): New var.
8265 * tests/atlocal.in (CXXFLAGS): Use it.
8266
07971983
PE
82672004-05-29 Paul Eggert <eggert@cs.ucla.edu>
8268
8269 Fix some "make check" problems with C++ reported by
8270 Albert Chin-A-Young for Tru64 C++ in this thread:
8271 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00049.html
8272
8273 * m4/cxx.m4 (BISON_TEST_FOR_WORKING_CXX_COMPILER): Check for std::cerr.
8274 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
8275 Output to a .cc file for C++, not to a .c file.
8276 * tests/calc.at (AT_CHECK_CALC): Likewise.
8277 * tests/regression.at (AT_CHECK_DANCER): Likewise.
8278 * tests/local.at (AT_COMPILE_CXX): Default to OUTPUT.cc, not OUTPUT.c.
8279
29058652
PE
82802004-05-28 Albert Chin-A-Young <china@thewrittenword.com>
8281
8282 * tests/calc.at, tests/actions.at: Workaround for SGI
8283 C++ compiler. (trivial change)
8284
62cb8a99
PE
82852004-05-27 Paul Eggert <eggert@cs.ucla.edu>
8286
fd418816
PE
8287 Spent a few hours checking out which prerequisite versions the
8288 current sources actually require. I went all the way back to
8289 Gettext 0.10.40, Automake 1.4, and Autoconf 2.57 and investigated
8290 a seemingly endless set of combinations of versions more recent
8291 than that. The bottom line is that the current sources require
8292 fairly recent versions of the build tools, and it'll be some work
8293 to change this.
8294 * configure.ac (AC_PREREQ): Increase from 2.58 to 2.59.
8295 (AM_INIT_AUTOMAKE): Increase from 1.7 to 1.8.
8296 (AM_GNU_GETTEXT_VERSION): Increase from 0.11.5 to 0.12.
8297 Add comments explaining why those particular versions are
8298 currently needed.
2fa09258 8299
62cb8a99
PE
8300 * src/parse-gram.y (lloc_default): Rewrite to avoid compiler bug
8301 in SGI MIPSpro 7.4.1m. Problem reported by Albert Chin-A-Young in
161a71f3 8302 <http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00037.html>.
62cb8a99
PE
8303
8304 * configure.ac (AC_PREREQ): Bump to 2.58, since 2.57 doesn't work
8305 (it fails with a Autoconf-without-aclocal-m4 diagnostic).
8306
caa52c10
PE
83072004-05-26 Paul Eggert <eggert@cs.ucla.edu>
8308
8309 * configure.ac (AM_GNU_GETTEXT_VERSION): Lower it from 0.14.1 to
8310 0.11.5. Suggested by Bruno Haible.
8311 * bootstrap: Remove gettext version checking.
8312
8313 * doc/bison.texinfo (Decl Summary): Also mention that %union
8314 can depend on prerequisite types. Problem reported by Tim
8315 Van Holder.
8316
4bfd5e4e
PE
83172004-05-25 Paul Eggert <eggert@cs.ucla.edu>
8318
2cef3017
PE
8319 * README: Mention GNU m4 1.4 bugs and Akim's patched version.
8320 * README-alpha: Don't tell people not to package this.
8321
b9c85d5c
PE
8322 * bootstrap: Don't assume $(...) works; use `...` instead.
8323 Problem reported by Paul Hilfinger. Also, diagnose non-GNU
8324 gettext better.
8325
4bfd5e4e
PE
8326 * doc/bison.texinfo (Decl Summary, Bison Options): Clarify what's
8327 put into the -d output file, and mention what to do if YYSTYPE is
8328 defined as a macro.
8329
6a36ff94
PE
83302004-05-24 Paul Eggert <eggert@cs.ucla.edu>
8331
6712933e
PE
8332 Undo change made earlier today: it caused autopoint to not bring
8333 in ABOUT-NLS. Ouch. Instead, substitute our own diagnostic for
8334 autopoint's.
8335
8336 * bootstrap: Check that gettext version matches what's in
8337 configure.ac. Warn users to ignore robots.txt ERROR 404.
8338 * bootstrap: Undo today's earlier change (logged below).
8339 * configure.ac (AM_GNU_GETTEXT_VERSION): Likewise.
b9c85d5c 8340
6a36ff94
PE
8341 The gettext version checking is causing more trouble than it's
8342 curing; remove it. Problem reported by Paul Hilfinger.
8343
8344 * bootstrap: Issue a warning that one can expect a message
8345 'AM_GNU_GETTEXT is used, but not AM_GNU_GETTEXT_VERSION'.
8346 * configure.ac (AM_GNU_GETTEXT_VERSION): Remove.
8347
209ea708
PE
83482004-05-23 Paul Eggert <eggert@cs.ucla.edu>
8349
8350 Ensure that the C++ compiler used for testing actually works on a
8351 simple test program; if not, skip the C++-related tests. Problem
8352 reported by Vin Shelton in:
161a71f3 8353 http://lists.gnu.org/archive/html/bug-bison/2004-05/msg00026.html
209ea708
PE
8354
8355 * m4/cxx.m4: New file.
8356 * configure.ac (BISON_TEST_FOR_WORKING_CXX_COMPILER): Add.
8357 * tests/atlocal.in (BISON_CXX_WORKS): Add.
8358 * tests/local.at (AT_COMPILE_CXX): Use it.
8359
41ca2549
PE
83602004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8361
383e69dc
PE
8362 * data/glr.c (yylloc): Output this macro even if locations are not
8363 being generated, as the GLR parser needs it even in that case.
8364 Problem reported by Troy A. Johnson
8365 <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=195946>.
8366
41ca2549
PE
8367 * configure.ac (AC_INIT): Update to 1.875e.
8368
e476c87d
PE
83692004-05-21 Paul Eggert <eggert@cs.ucla.edu>
8370
8371 * NEWS: Version 1.875d.
8372 * configure.ac (AC_INIT): Likewise.
8373 * src/parse-gram.c, src/parse-gram.h: Regenerate with 1.875d.
8374
8375 * configure.ac (--enable-gcc-warnings): Do not enable -Wshadow,
8376 -Wmissing-prototypes, or -Wstrict-prototypes for C++. The current
8377 lalr1.cc runs afoul of the first, and the last two are no longer
8378 supported by GCC 3.4.0.
8379 * README: Mention GNU m4 1.4 or later; mention m4 patches.
8380 * HACKING: Use ./bootstrap, not "make update" to import foreign files.
8381
233a88ad
PE
83822004-05-06 Paul Eggert <eggert@cs.ucla.edu>
8383
8384 * src/muscle_tab.c (hash_muscle): Accept and return size_t, not
8385 unsigned int, for compatibility with latest gnulib hash module.
8386 * src/state.c (state_hash, state_hasher): Likewise.
8387 * src/symtab.c (hash_symbol, hash_symbol_hasher): Likewise.
8388 * src/uniqstr.c (hash_uniqstr): Likewise.
e476c87d 8389
12ffdd28
PE
83902004-05-03 Paul Eggert <eggert@cs.ucla.edu>
8391
8392 * NEWS: Unescaped newlines are no longer allowed in char & strings.
8393
8394 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER,
8395 SC_CHARACTER,SC_STRING>): Reject unescaped newlines in
8396 character and string literals.
8397 (unexpected_end): New function.
8398 (unexpected_eof): Use it.
8399 (unexpected_newline): New function.
8400 (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>): Coalesce duplicate
8401 actions.
e476c87d 8402
12ffdd28
PE
8403 * NEWS: Document %expect-rr.
8404
8405 * bootstrap (--gnulib-srcdir=*, --cvs-user=*):
8406 Fix typo by replacing $1 with $option.
8407 Remove more 'intl'-related files.
9668e2be 8408 Don't DEFUN AM_INTL_SUBDIR twice.
12ffdd28
PE
8409
8410 * lib/.cvsignore: Add strndup.h. Remove memchr.c, memcmp.c,
8411 memrchr.c, strcasecmp.c, strchr.c, strrchr.c, strspn.c, strtol.c,
8412 strtoul.c.
8413 * m4/.cvsignore: Add exitfail.m4, extensions.m4, gnulib.m4,
8414 hard-locale.m4, mbstate_t.m4, strerror_r.m4, strndup.m4,
8415 xstrndup.m4. Remove glibc21.m4, intdiv0.m4, inttypes-pri.m4,
8416 inttypes.m4, inttypes_h.m4, isc-posix.m4, lcmessage.m4,
8417 stdint_h.m4, uintmax_t.m4, ulonglong.m4.
8418 * src/.cvsignore: Add *.output.
8419
8420 * src/parse-gram.y: Put copyright notice inside %{ %} so it
8421 gets copied to the output file.
e476c87d 8422
1f65350a
PE
84232004-04-28 Paul Eggert <eggert@twinsun.com>
8424
8425 Get files from the gnulib and po repositories, instead of relying
8426 on them being in our CVS. Upgrade to latest versions of gnulib
8427 and Automake.
8428
8429 * Makefile.am (SUBDIRS): Remove m4; Automake now does m4.
8430 * bootstrap: Bootstrap from gnulib and po repositories.
8431 Much of this code was stolen from GNU diff and GNU tar's bootstrap.
8432 * README-cvs: Document these changes. Remove version numbers from
8433 mentions of build tools, since they change so often. Mention Flex.
8434
8435 * configure.ac (AC_CONFIG_MACRO_DIR): Add, with m4 as arg.
8436 (gl_USE_SYSTEM_EXTENSIONS): Add.
12ffdd28
PE
8437 (AC_GNU_SOURCE, AC_AIX, AC_MINIX):
8438 Remove; no longer needed, as gl_USE_SYSTEM_EXTENSIONS
1f65350a 8439 does this for us.
12ffdd28
PE
8440 (AC_ISC_POSIX): Remove; we no longer support this
8441 ancient OS, as it gets in the way of latest Autoconf & gnulib.
1f65350a
PE
8442 (AC_HEADER_STDC): Remove: we now assume C89 or better.
8443 (AC_CHECK_HEADERS_ONCE): Use instead of AC_CHECK_HEADERS.
8444 Do not check for C89 headers, except for locale.h which is used
8445 by the Yacc library and must port to K&R hosts.
8446 (AC_CHECK_FUNCS_ONCE): Use instead of AC_CHECK_FUNCS.
8447 Do not check for C89 functions, except for setlocale which is
8448 used by the Yacc library.
8449 (AC_CHECK_DECLS, AC_REPLACE_FUNCS): Remove; no longer needed.
8450 (gl_DIRNAME, gl_ERROR, gl_FUNC_ALLOCA, gl_FUNC_MEMCHR,
8451 gl_FUNC_MEMRCHR, gl_FUNC_STPCPY, gl_FUNC_STRNLEN, gl_FUNC_STRTOL,
8452 gl_GETOPT, gl_HASH, gl_MBSWIDTH, gl_OBSTACK, gl_QUOTE,
8453 gl_QUOTEARG, gl_XALLOC, jm_FUNC_GLIBC_UNLOCKED_IO, jm_FUNC_MALLOC,
8454 AM_GNU_GETTEXT): Remove; now done by:
8455 (GNULIB_AUTOCONF_SNIPPET): Add. "bootstrap" builds this for us.
8456 (AC_CONFIG_FILES): Remove m4/Makefile, as Automake now does this
8457 for us.
8458
8459 * lib/Makefile.am: Include gnulib.mk, built for us by "bootstrap".
8460 (BUILT_SOURCES, EXTRA_DIST, MOSTLYCLEANFILES):
8461 Define to empty, as gnulib.mk will do the rest for us.
8462 ($(libbison_a_OBJECTS), stdbool.h): Remove, as gnulib.mk does this
8463 for us.
8464 (libbison_a_SOURCES): Define to $(lib_SOURCES) now.
8465 (lib_SOURCES): New symbol, containing only the non-gnulib libs.
8466
8467 * src/files.c: Include gnulib's xstrndup.h.
8468
8469 * src/system.h (MALLOC): Use xnmalloc, for better overflow checking.
8470 (REALLOC): Use xnrealloc, for likewise.
8471 (xstrndup, stpcpy): Remove decls, as gnulib does this for us now.
8472 (strnlen, memrchr): Remove decls; functions no longer used.
8473 Include <stpcpy.h>.
8474
8475 * config/depcomp, config/install-sh, lib/alloca.c, lib/argmatch.c,
8476 lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
8477 lib/error.c, lib/error.h, lib/getopt.c, lib/getopt.h,
8478 lib/getopt1.c, lib/gettext.h, lib/hash.c, lib/hash.h,
8479 lib/malloc.c, lib/mbswidth.c, lib/mbswidth.h, lib/memchr.c,
8480 lib/memcmp.c, lib/memrchr.c, lib/obstack.c, lib/obstack.h,
8481 lib/quote.c, lib/quote.h, lib/quotearg.c, lib/quotearg.h,
8482 lib/realloc.c, lib/stdbool_.h, lib/stpcpy.c, lib/strcasecmp.c,
8483 lib/strchr.c, lib/strncasecmp.c, lib/strnlen.c, lib/strrchr.c,
8484 lib/strspn.c, lib/strtol.c, lib/strtoul.c, lib/unlocked-io.h,
8485 lib/xalloc.h, lib/xmalloc.c, lib/xstrdup.c, lib/xstrndup.c,
8486 m4/Makefile.am, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
8487 m4/error.m4, m4/getopt.m4, m4/hash.m4, m4/malloc.m4,
8488 m4/mbrtowc.m4, m4/mbswidth.m4, m4/memchr.m4, m4/memcmp.m4,
8489 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/prereq.m4,
8490 m4/quote.m4, m4/quotearg.m4, m4/realloc.m4, m4/stdbool.m4,
8491 m4/stpcpy.m4, m4/strnlen.m4, m4/strtol.m4, m4/strtoul.m4,
8492 m4/unlocked-io.m4, m4/xalloc.m4, po/LINGUAS, po/Makefile.in.in,
8493 po/Makevars, po/da.po, po/de.po, po/es.po, po/et.po, po/fr.po,
8494 po/hr.po, po/id.po, po/it.po, po/ja.po, po/ms.po, po/nl.po,
8495 po/pt_BR.po, po/ro.po, po/ru.po, po/sv.po, po/tr.po:
8496 Remove, as these files are now generated automatically
8497 by bootstrap or automake.
8498
8499 * po/ChangeLog: Remove: all but one entry was a duplicate
8500 of this file, and I moved that 2000-11-02 entry here.
8501
8502 * config/.cvsignore: Add Makefile, depcomp, install-sh.
8503 * lib/.cvsignore: Add alloca.c, alloca.h, alloca_.h, argmatch.c,
8504 argmatch.h, basename.c, dirname.c, dirname.h, error.c, error.h,
8505 exit.h, exitfail.c, exitfail.h, getopt.c, getopt.h, getopt1.c,
8506 getopt_int.h, gettext.h, gnulib.mk, hard-locale.c, hard-locale.h,
8507 hash.c, hash.h, malloc.c, mbswidth.c, mbswidth.h, memchr.c,
8508 memcmp.c, memrchr.c, obstack.c, obstack.h, quote.c, quote.h,
8509 quotearg.c, quotearg.h, realloc.c, stdbool_.h, stpcpy.c, stpcpy.h,
8510 strcasecmp.c, strchr.c, stripslash.c, strncasecmp.c, strndup.c,
8511 strnlen.c, strrchr.c, strspn.c, strtol.c, strtoul.c,
8512 unlocked-io.h, xalloc.h, xmalloc.c, xstrdup.c, xstrndup.c,
8513 xstrndup.h.
8514 * m4/.cvsignore: Remove Makefile, Makefile.in. Add alloca.m4,
8515 dirname.m4, dos.m4, error.m4, getopt.m4, hash.m4, mbrtowc.m4,
8516 mbswidth.m4, obstack.m4, onceonly.m4, quote.m4, quotearg.m4,
8517 stdbool.m4, stpcpy.m4, strnlen.m4, unlocked-io.m4, xalloc.m4.
8518 * po/.cvsignore: Add *.po, LINGUAS, Makefile.in.in, Makevars.
8519 * src/.cvsignore: Remove *_.c.
8520
8521
8522 * Makefile.maint (GZIP_ENV): Don't use --rsyncable if gzip doesn't
8523 support it. (The latest stable gzip doesn't.)
8524
85252004-04-27 Paul Eggert <eggert@twinsun.com>
8526
8527 * data/lalr1.cc (Parser::stos_) [! YYDEBUG]: Define even in this
8528 case, as stos_ is now used by destructors due to the 2004-02-09
8529 change.
8530
8531 Remove more K&R C support.
8532 * lib/libiberty.y (PARAMS): Remove. All uses removed.
8533 * lib/subpipe.c (errno): Remove decl.
8534 Include <stdlib.h> unconditionally.
8535 (EXIT_FAILURE): Remove macro.
8536 * src/complain.c (vfprintf, strerror): Remove.
8537 * src/system.h: Include limits.h, stdlib.h, string.h, locale.h
8538 unconditionally.
8539 (EXIT_FAILURE, EXIT_SUCCESS, setlocale): Remove defns.
8540 Use latest Autoconf recommendations for including inttypes.h, stdint.h.
8541 (strchr, strspn, memchr): Remove decls.
8542 * tests/calc.at (_AT_DATA_CALC_Y): Include stdlib.h, string.h
8543 unconditionally. Do not declare perror.
8544 * tests/conflicts.at (%nonassoc and eof): Include stdlib.h
8545 unconditionally.
8546
8547 * src/complain.c (_): Remove useless defn, as system.h defines this.
8548
8549 * lib/bitset.h (__INT_TO_PTR): Remove; workaround no longer needed
8550 with latest obstack.h.
8551 * lib/ebitset.c (ebitset_elt_alloc): Don't bother to cast args
8552 to procedure types, as obstack.h now does that for us.
8553 * lib/lbitset.c (lbitset_elt_alloc): Likewise.
8554
8555 * lib/subpipe.h [HAVE_SYS_TYPES_H]: Include <sys/types.h>,
8556 so that this include file can stand alone.
8557 * lib/subpipe.c: Do not include <sys/types.h>, as subpipe.h
8558 does this now. Include subpipe.h first after config.h, to
8559 test whether it can stand alone.
8560
8561 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Don't
8562 declare yyerror when using lalr.cc, as GCC 3.4.0 warns about the
8563 unused declaration.
8564
8565 * tests/synclines.at (%union synch line): Put a dummy member in
8566 the union, because empty unions aren't allowed in C. Caught
8567 by GCC 3.4.0.
8568
4f16766c
PE
85692004-04-13 Jim Meyering <jim@meyering.net>
8570
8571 * src/conflicts.c (conflicts_print): Correct format string typo:
8572 use `%%' to produce literal `%'. (trivial change)
8573
779e7ceb
PE
85742004-03-30 Paul Eggert <eggert@twinsun.com>
8575
8576 * src/getargs.c (version): Update copyright year to 2004.
8577
8578 * data/c.m4 (b4_int_type): Use 'short int' rather than
8579 'short', and similarly for 'long', 'unsigned', etc.
8580 * data/glr.c (YYTRANSLATE, yyconfl, yySymbol, yyItemNum,
8581 yygetLRActions, yyprocessOneStack, yyrecoverSyntaxError,
8582 yy_yypstack, yydumpstack): Likewise.
8583 * data/lalr1.cc (user_token_number_max_, user_token_number_max_,
8584 translate_, seq_, [], pop, Slice, range_, operator+, operator+=):
8585 Likewise.
8586 * data/yacc.c (b4_int_type, yyss, YYSTACK_BYTES, yysigned_char,
8587 yy_stack_print, yyparse): Likewise.
8588 * doc/bison.texinfo (Prologue, Multiple Types): Likewise.
8589 * lib/bbitset.h (bitset_word, BITSET_WORD_BITS): Likewise.
8590 * lib/bitset.c (bitset_print): Likewise.
8591 * lib/bitset_stats.c (bitste_log_histogram_print): Likewise.
8592 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
8593 * lib/bitsetv.c (bitsetv_dump): Likewise.
8594 * lib/ebitset.c (EBITSET_ELT_BITS, ebitset_elt_alloc): Likewise.
8595 * lib/lbitset.c (LBITSET_ELT_BITS, lbitset_elt_alloc, debug_lbitset):
8596 Likewise.
8597 * src/LR0.c (allocate_itemsets): Likewise.
8598 * src/gram.h (rule_number, rule): Likewise.
8599 * src/lalr.h (goto_number): Likewise.
8600 * src/nullable.c (nullable_compute): Likewise.
8601 * src/output.c (prepare_rules): Likewise.
8602 * src/relation.c (relation_print, relation_digraph): Likewise.
8603 * src/relation.h (relation_node): Likewise.
8604 * src/state.h (state_number, transitions, errs, reductions,
8605 struct state): Likewise.
8606 * src/symtab.h (symbol_number, struct symbol): Likewise.
8607 * src/tables.c (vector_number, tally, action_number,
8608 default_goto, goto_actions): Likewise.
8609 * tests/existing.at (GNU Cim Grammar): Likewise.
8610 * tests/regression.at (Web2c Actions): Likewise.
8611
8612 * src/output.c (muscle_insert_short_int_table): Renamed from
8613 muscle_insert_short_table. All uses changed.
8614
d6328241
PH
86152004-03-25 Paul Hilfinger <hilfingr@tully.CS.Berkeley.EDU>
8616
8617 * src/parse-gram.y: Define PERCENT_EXPECT_RR.
8618 (declaration): Replace expected_conflicts with expected_sr_conflicts.
8619 Add %expect-rr rule.
4f16766c 8620
d6328241
PH
8621 * src/scan-gram.l: Recognize %expect-rr.
8622
4f16766c 8623 * src/conflicts.h (expected_sr_conflicts): Rename from
d6328241 8624 expected_conflicts.
4f16766c 8625 (expected_rr_conflicts): Declare.
d6328241
PH
8626
8627 * src/conflicts.c (expected_sr_conflicts): Rename from
8628 expected_conflicts.
8629 (expected_rr_conflicts): Define.
8630 (conflicts_print): Check r/r conflicts against expected_rr_conflicts
8631 for GLR parsers.
8632 Use expected_sr_conflicts in place of expected_conflicts.
8633 Warn if expected_rr_conflicts used in non-GLR parser.
4f16766c 8634
d6328241 8635 * doc/bison.texinfo: Add documentation for %expect-rr.
4f16766c 8636
1452af69
PE
86372004-03-08 Paul Eggert <eggert@gnu.org>
8638
8639 Add support for hex token numbers. Suggested by Odd Arild Olsen in
161a71f3 8640 <http://lists.gnu.org/archive/html/bison-patches/2004-03/msg00000.html>.
1452af69
PE
8641
8642 * NEWS: Document hexadecimal tokens, no NUL bytes, %destructor
8643 in lalr1.cc.
8644 * doc/bison.texinfo (Token Decl): Add hexadecimal token numbers.
8645 * src/scan-gram.l (scan_integer): New function.
8646 ({int}): Use it.
8647 (0[xX][0-9abcdefABCDEF]+): New pattern, to support hex numbers.
8648 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>, \\x[0-9abcdefABCDEF]+,
8649 handle_action_dollar, handle_action_at, convert_ucn_to_byte):
8650 Say "long int", not "long", for uniformity with GNU style.
8651
006d217d
PE
86522004-02-25 Paul Eggert <eggert@twinsun.com>
8653
8654 * tests/local.at (AT_COMPILE, AT_COMPILE_CXX): Ignore stdout from
8655 compilers. This fixes a problem with Intel's C++ compiler being
8656 chatty, reported by Guido Trentalancia in
161a71f3 8657 <http://lists.gnu.org/archive/html/bug-bison/2004-02/msg00030.html>.
006d217d 8658
c2729758
ADL
86592004-02-09 Alexandre Duret-Lutz <adl@gnu.org>
8660
8661 Support %destructor and merge error locations in lalr1.cc.
8662
8663 * data/lalr1.cc (b4_cxx_destruct_def): New macro.
8664 (Parser::stos_): Define unconditionally.
8665 (Parser::destruct_): New method. Generate its body with
8666 b4_yydestruct_generate.
8667 (Parser::error_start_): New attribute.
8668 (Parser::parse) <yyerrlab, yyerrlab1>: Call destruct_ on erroneous
8669 token which are discarded.
8670 (Parser::parse) <yyerrlab, yyerrorlab, yyerrlab1>: Update
8671 error_start_ when erroneous token are discarded.
8672 (Parser::parse) <yyerrlab1>: Compute the location of the error
8673 token so that it covers all the discarded tokens.
8674 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Adjust so
8675 it can be called with `%skeleton "lalr1.cc"', and do that.
8676
dd0e0635
PE
86772004-02-02 Paul Eggert <eggert@twinsun.com>
8678
8679 * src/Makefile.am (AM_CPPFLAGS): New macro. It mentions
8680 $(top_srcdir)/lib and ../lib. This fixes a bug reported
8681 by Paul Hilfinger; the old INCLUDES value didn't mention ../lib.
8682 There's no need to mention top_builddir since Automake does that
8683 for us.
8684 (INCLUDES): Remove, as Automake says it's obsolescent.
8685 Contents migrated into AM_CPPFLAGS as described above.
8686 * lib/Makefile.am (INCLUDES): Remove; obsolescent.
8687
86882004-01-14 Paul Hilfinger <hilfingr@CS.Berkeley.EDU>
8689
8690 * data/glr.c (yytokenName): Bullet-proof against YYEMPTY token.
8691 (yyreportSyntaxError): Handle case where lookahead token is
8692 YYEMPTY.
8693
be16239b
PH
86942004-01-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
8695
8696 * data/glr.c: Put casts on uses of YYREALLOC and YYMALLOC so that
8697 resulting parsers are compilable with C++.
8698
5fa90832
PE
86992003-12-23 Paul Eggert <eggert@twinsun.com>
8700
8701 * config/depcomp, config/install-sh: Sync with Automake 1.8.
8702 * src/output.c (output_skeleton): Rename local var.
8703 * tests/input.at (Torturing the Scanner): Don't use \x0 or \0 in
8704 Bison tokens, as this runs afoul of the 2003-10-07 change that
8705 disallowed NUL bytes in character constants or string literals.
8706
8707 * tests/local.at: Require Autoconf 2.59's Autotest.
8708 * tests/testsuite.at: Don't include local.at, since we now assume
8709 Autoconf 2.59 or later. Autoconf 2.59 had some problems with
8710 including it.
8711 * tests/Makefile.am ($(TESTSUITE)): Remove warning about ignoring
8712 multiple inclusion warnings.
dd0e0635 8713
b165c324
AD
87142003-12-02 Akim Demaille <akim@epita.fr>
8715
8716 * doc/bison.texinfo (How Can I Reset the Parser): More about start
8717 conditions.
8718 From Bruno Haible.
8719
26e06a21
ADL
87202003-11-18 Alexandre Duret-Lutz <adl@gnu.org>
8721
8722 * doc/bison.texinfo (Bison Options): Escape `@' in `$@'.
8723
92ac3705
PE
87242003-10-07 Paul Eggert <eggert@twinsun.com>
8725
6a5ecb38
PE
8726 * tests/Makefile.am (clean-local): Don't run 'testsuite --clean'
8727 if testsuite doesn't exist.
8728
92ac3705
PE
8729 * doc/bison.texinfo (Symbols): NUL bytes are not allowed in string
8730 literals, unfortunately.
8731 * src/scan-gram.l (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>):
8732 Complain about NUL bytes in character constants or string literals.
8733
91d2c560
PE
87342003-10-05 Paul Eggert <eggert@twinsun.com>
8735
8736 * NEWS: Don't document %no-default-prec, as it's still
8737 too experimental.
8738 * doc/bison.texinfo: Document %no-default-prec only if
8739 the defaultprec flag is set. Normally it's not.
8740
0cc3da3a
PE
87412003-10-04 Paul Eggert <eggert@twinsun.com>
8742
8743 * data/glr.c (b4_rhs_value, b4_rhs_location): Yield a
8744 non-modifiable lvalue, instead of a modifiable one.
8745 * doc/bison.texinfo (Actions): Document that $$ can
8746 be assigned to. Do not claim that $$ and $N are
8747 array element references: user code should not rely on this.
8748
22fccf95
PE
87492003-10-01 Paul Eggert <eggert@twinsun.com>
8750
8751 * src/parse-gram.h (PERCENT_NO_DEFAULT_PREC): New token.
8752 (grammar_declaration): Use it.
8753 * src/scan-gram.l: New token %no-default-prec.
8754 * tests/conflicts.at: Revamp tests to use %no-default-prec.
8755 * NEWS, doc/bison.texinfo: Document the above.
8756
fc8f2965
AD
87572003-10-01 Akim Demaille <akim@epita.fr>
8758
8759 VCG no longer supports long_straight_phase.
8760
8761 * src/vcg.c, src/vcg.h: Remove the handling of long_straight_phase.
8762 * src/print_graph.c (print_graph): Adjust.
8763
39a06c25
PE
87642003-09-30 Frank Heckenbach <frank@g-n-u.de>
8765 and Paul Eggert <eggert@twinsun.com>
8766
8767 * doc/bison.texinfo (Decl Summary, Contextual Precedence,
8768 Table of Symbols): Document %default-prec.
8769 * src/parse-gram.y (PERCENT_DEFAULT_PREC): New token.
8770 (grammar_declaration): Set default_prec on %default-prec.
8771 * src/scan-gram.l (%default-prec): New token.
8772 * src/reader.h (default_prec): New flag.
8773 * src/reader.c: Likewise.
8774 (packgram): Handle it.
8775 * tests/conflicts.at (%default-prec without %prec,
8776 %default-prec with %prec, %default-prec 1): New tests.
fc8f2965 8777
39a06c25
PE
87782003-09-30 Paul Eggert <eggert@twinsun.com>
8779
8780 * tests/testsuite.at: Include local.at, not input.at, fixing
8781 a typo in the 2003-08-25 patch.
8782
62b6aef9
AD
87832003-08-27 Akim Demaille <akim@epita.fr>
8784
8785 * data/lalr1.cc (yyparse) [__GNUC__]: "Use" yyerrorlab to pacify
8786 GCC warnings.
8787
89e1cc61
AD
87882003-08-26 Akim Demaille <akim@epita.fr>
8789
8790 * config/announce-gen (print_changelog_deltas): Neutralize "<#" as
8791 "<\#" to avoid magic from Gnus when posting parts of this script.
8792
a08460b0
AD
87932003-08-26 Akim Demaille <akim@epita.fr>
8794
8795 * data/lalr1.cc (Parser::report_syntax_error_): New, extracted from
8796 (Parser::parse): here.
8797 Adjust: nerrs and errstatus is now replaced by...
8798 (Parser::nerrs_, Parser::errstatus_): New.
8799
603f1cfd
AD
88002003-08-25 Akim Demaille <akim@epita.fr>
8801
8802 * config/announce-gen, Makefile.cfg: New.
8803 * Makefile.am: Adjust.
8804 * GNUmakefile, Makefile.maint: Update from CVS Autoconf, but
8805 keeping local WGET and WGETFLAGS modifications from Paul Eggert.
8806
cd3684cf
AD
88072003-08-25 Akim Demaille <akim@epita.fr>
8808
8809 When reducing initial empty rules, Bison parser read an initial
8810 location that is not defined. This results in garbage, and that
8811 affects Bison's own parser. Therefore we need (i) to extend Bison
8812 to support a means to initialize this location, and (ii) to use
8813 this CVS Bison to fix CVS Bison's parser.
8814
8815 * src/reader.h, reader.c (epilogue_augment): Remove, replace
8816 with...
8817 * src/muscle_tab.h, src/muscle_tab.c (muscle_code_grow): this.
8818 * src/parse-gram.y: Adjust.
8819 (%initial-action): New.
8820 (%error-verbose): Since we require CVS Bison, there is no reason
8821 not to use it.
8822 * src/scan-gram.l: Adjust.
8823 * src/Makefile.am (YACC): New, to make sure we use our own parser.
8824 * data/yacc.c (yyparse): Use b4_initial_action.
8825
4e03e201
AD
88262003-08-25 Akim Demaille <akim@epita.fr>
8827
8828 * doc/bison.texinfo: Don't promote stdout for error messages.
8829
8c182d05
AD
88302003-08-25 Akim Demaille <akim@epita.fr>
8831
8832 * data/lalr1.cc (Parser::reduce_print_): Remove unused yyi.
8833 From Alexandre Duret-Lutz.
8834
6a60c4cf
PE
88352003-08-25 Akim Demaille <akim@epita.fr>
8836
8837 Version 1.875c.
8838
25f66e1a
AD
88392003-08-25 Akim Demaille <akim@epita.fr>
8840
8841 * data/lalr1.cc (Parser::stack_print_, YY_STACK_PRINT): New.
8842 Use them.
8843
5348bfbe
AD
88442003-08-25 Akim Demaille <akim@epita.fr>
8845
8846 * data/lalr1.cc (Parser::reduce_print_): New.
8847 Use it.
8848
47301314
AD
88492003-08-25 Akim Demaille <akim@epita.fr>
8850
8851 Have lalr1.cc catch with Paul Eggert's patch to fix the infinite
8852 error recovery loops. This patch is based on
161a71f3 8853 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00000.html>.
47301314
AD
8854 Also, augment the similarity between lalr1.cc and yacc.c.
8855 Note: the locations of error recovery rules are not correct yet.
8856
8857 * data/lalr1.cc: Comment changes to augment the similarity between
8858 lalr1.cc and yacc.c.
8859 (YYERROR): Goto to yyerrorlab, not yyerrlab1.
8860 (yyerrlab1): Remove, but where it used to be (now the bottom part of
8861 yyerrlab), when hitting EOF, pop the whole stack here instead of
8862 merely falling thru the default error handling mechanism.
8863 (yyerrorlab): New label, with the old contents of YYERROR,
8864 plus the following change: pop the stack of rhs corresponding
8865 to the production that invoked YYERROR. That is how Yacc
8866 behaves (required by POSIX).
8867 * tests/calc.at (AT_CHECK_CALC_LALR1_CC): No longer expected to
8868 fail.
8869
1f7a61ff
AD
88702003-08-25 Akim Demaille <akim@epita.fr>
8871
8872 Tune local.at so that people can "autom4te -l autotest calc.at -o
8873 calc" for instance, to extract a sub test suite.
8874
8875 * tests/testsuite.at: Move the initialization, Autotest version
8876 requirement, and AT_TESTED invocation into...
8877 * tests/local.at: here.
8878 * tests/testsuite.at: Include it for compatibility with Autoconf
8879 2.57.
8880 * tests/Makefile.am ($(TESTSUITE)): Report that the warning should
8881 be ignore.
8882
327b5b56
PE
88832003-08-04 Paul Eggert <eggert@twinsun.com>
8884
8885 Rework code slightly to avoid gcc -Wtraditional warnings.
8886 * data/glr.c (yyuserMerge): Return void, not YYSTYPE.
8887 The returned value is now stored in *YY0. All callers changed.
8888 * src/output.c (merge_output): Adjust to the above change.
8889
0051e3ed
PE
88902003-07-26 Paul Eggert <eggert@twinsun.com>
8891
8892 * data/glr.c (YYASSERT): New macro.
8893 (yyfillin, yydoAction, yyglrReduce, yysplitStack,
8894 yyresolveStates, yyprocessOneStack):
8895 Use `YYASSERT (FOO);' rather than `if (! (FOO)) abort ();'.
8896 Derived from a suggestion by Frank Heckenbach.
1f7a61ff 8897
137437c6
PE
88982003-07-25 Paul Eggert <eggert@twinsun.com>
8899
5b620e06
PE
8900 * data/glr.c (yyglrReduce): Don't use C89 string concatenation,
8901 for portability to K&R C (after ansi2knr, presumably). See
161a71f3 8902 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>
5b620e06
PE
8903 by Frank Heckenbach, though I have omitted the structure-initialization
8904 part of his glr-knr.diff patch since I recall that the Portable
8905 C Compiler didn't require that change.
8906
137437c6
PE
8907 Let the user specify how to allocate and free memory.
8908 Derived from a suggestion by Frank Heckenbach in
161a71f3 8909 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00041.html>.
137437c6
PE
8910 * data/glr.c (YYFREE, YYMALLOC, YYREALLOC): New macros.
8911 All uses of free, malloc, realloc changed to use these macros,
8912 and unnecessary casts removed.
8913 * data/yacc.c (YYFREE, YYMALLOC): Likewise.
8914
ddb85ca5
PE
89152003-07-06 Matthias Mann <MatthiasMann@gmx.de>
8916
8917 * data/lalr1.cc (operator<<(std::ostream&, const Position&)):
8918 use s.empty() rather than s == "" to test for empty string; see
161a71f3 8919 <http://lists.gnu.org/archive/html/bison-patches/2003-07/msg00003.html>
ddb85ca5
PE
8920 (trivial change)
8921
39910e09
AD
89222003-06-25 Akim Demaille <akim@epita.fr>
8923
8924 * config/depcomp, config/install-sh: Update from masters.
8925
0ae99356
PE
89262003-06-20 Paul Eggert <eggert@twinsun.com>
8927
8928 * data/glr.c (YYLLOC_DEFAULT): Parenthesize arguments as needed,
8929 and return properly parenthesized result.
8930 * data/lalar1.cc (YYLLOC_DEFAULT): Likewise.
8931 * data/yacc.c (YYLLOC_DEFAULT): Likewise.
8932 Remove unnecessary parentheses from uses.
8933 * doc/bison.texinfo (Location Default Action): Describe the
8934 conventions for parentheses.
8935
cd05d13c
PE
89362003-06-19 Paul Eggert <eggert@twinsun.com>
8937
81fd08ca
PE
8938 * data/glr.c (yyremoveDeletes, yy_reduce_print, yyglrReduce,
8939 yyreportTree): Do not assume that size_t is the same width as int,
8940 when printing sizes. Print sizes using an unsigned format.
8941 Problem reported by Frank Heckenbach in
161a71f3 8942 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00035.html>.
4dcf140b 8943
cd05d13c
PE
8944 Port to Forte Developer 7 C compiler.
8945 * data/glr.c (struct YYLTYPE): If locations are not being used,
8946 declare a single dummy member, as empty structs do not conform
8947 to the C standard.
8948 (YYERROR, YYBACKUP): Do not use "do { ...; return foo; } while (0)";
8949 the Forte Developer 7 C compiler complains that end-of-loop
8950 code is not reached.
8951
4dcf140b
PE
89522003-06-17 Paul Eggert <eggert@twinsun.com>
8953
8954 * lib/libiberty.h (PARAMS): Spell argument as Args, not as X, to
8955 avoid warnings from picky compilers about redefinition of PARAMS.
8956
8dd76bee
PE
89572003-06-17 Paul Eggert <eggert@twinsun.com>
8958
8959 Version 1.875b.
8960
8961 * NEWS: Document 1.875b.
8962
8963 * lib/bbitset.h: Do not include config.h; that's the includer's job.
8964 Do not include <sys/types.h>; shouldn't be needed on a C89 host.
8965 * lib/bitset.h (bitset_compatible_p): Indent as per GNU standard.
8966 Don't use 'index' in comments, as it's a builtin fn on some hosts.
8967 * lib/bitset_stats.c: Include gettext.h unconditionally, as
8968 per recent gettext manual's suggestion.
8969 * lib/ebitset.c (ebitset_resize, ebitset_unused_clear):
8970 Use prototypes, not old-style definitions.
8971 * lib/lbitset.c (lbitset_unused_clear): Likewise.
8972 * lib/vbitset.c (vbitset_resize, vbitset_ones, vbitset_zero,
8973 vbitset_empty_p, vbitset_copy1, vbitset_not, vbitset_equal_p,
8974 vbitset_subset_p, vbitset_disjoint_p, vbitset_and, vbitset_and_cmp,
8975 vbitset_andn, vbitset_andn_cmp, vbitset_or, vbitset_or_cmp,
8976 vbitset_xor, vbitset_xor_cmp, vbitset_and_or, vbitset_and_or_cmp,
8977 vbitset_andn_or, vbitset_andn_or_cmp, vbitset_or_and,
8978 vbitset_or_and_cmp, vbitset_copy): Likewise.
8979
8980 * lib/libiberty.h: Do not include config.h; that's the includer's job.
8981 Do not include <stdlib.h>.
8982 (PARAMS): Define unconditionally for C89.
8983 (ATTRIBUTE_NORETURN): Remove.
8984 (ATTRIBUTE_UNUSED): Define unconditionally.
8985
8986 Upgrade to 2003-06-08 libbitset, submitted by Michael Hayes in:
161a71f3 8987 <http://lists.gnu.org/archive/html/bison-patches/2003-06/msg00005.html>
8dd76bee
PE
8988 * lib/Makefile.am (bitsets_sources): Add vbitset.c, vbitset.h.
8989 * lib/vbitset.c, lib/vbitset.h: New files.
8990 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
8991 lib/bitset_stats.c, lib/ebitset.c, lib/lbitset.c: Import
8992 from libbitset.
8993
8994 * doc/bison.texinfo (How Can I Reset the Parser): Renamed from
8995 `How Can I Reset @code{yyparse}', since texinfo does not allow
8996 arbitrary @ in node names.
8997
8998 * m4/Makefile.am (EXTRA_DIST): Add the following files, which
8999 shouldn't be needed according to the gettext 0.12.1 documentation
9000 but which seem to be needed anyway: codeset.m4 glibc21.m4
f8e8262e 9001 intdiv0.m4 inttypes-pri.m4 inttypes.m4 inttypes_h.m4 isc-posix.m4
8dd76bee 9002 lcmessage.m4 nls.m4 po.m4 stdint_h.m4 uintmax_t.m4 ulonglong.m4.
f8e8262e 9003 * po/Makefile.in.in: Upgrade to gettext 0.12.1 version.
cd05d13c 9004
8dd76bee
PE
9005 * lib/.cvsignore: Add stdbool.h.
9006 * m4/.cvsignore: Add nls.m4, po.m4.
9007
9008 Upgrade to CVS gnulib.
9009 * stdbool_.h: File renamed from stdbool.h.in.
9010 * configure.ac (AM_STDBOOL_H): Invoke this instead of
9011 AC_HEADER_STDBOOL.
9012 (AM_GNU_GETTEXT): Put brackets around args, as latest manual suggests.
9013 (AM_GNU_GETTEXT_VERSION): Update to 0.12.1.
9014 * lib/Makefile.am (EXTRA_DIST): Add stdbool_.h.
9015 (MOSTLYCLEANFILES): New var.
9016 ($(libbison_a_OBJECTS)): Depend on $(STDBOOL_H).
9017 (stdbool.h): New rule.
9018 * lib/dirname.c, lib/dirname.h, lib/hash.c, lib/hash.h,
9019 lib/malloc.c, lib/obstack.h, lib/quote.c, lib/realloc.c,
9020 lib/strcasecmp.c, lib/xalloc.h, m4/alloca.m4, m4/onceonly.m4,
9021 m4/quote.m4: Upgrade to today's gnulib.
9022
9023 * tests/calc.at (AT_CHECK_CALC): New option EXPECTED-TO-FAIL.
9024 (AT_CHECK_CALC_LALR1_CC): Use it, since the C++ LALR parser fails
9025 the tests right now.
9026 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Ensure yylex and
9027 yyerror are declared before use; C99 requires this.
9028
25005f6a
PH
90292003-06-09 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9030
9031 * data/glr.c (YYERROR): Update definition to reset yyerrState to 0
9032 first.
9033 (yyrecoverSyntaxError): Correct the logic for setting and testing
9034 yyerrState.
9035 Correct comment on handling EOF.
9036 Allow states with only a default reduction, rather than failing
8dd76bee 9037 (I can't quite reconstruct why these were not allowed before).
25005f6a 9038
137437c6 9039 Fixes to avoid problem that $-N rules in GLR parsers can cause
25005f6a 9040 buffer overruns, corrupting state.
8dd76bee
PE
9041
9042 * src/output.c (prepare_rules): Output max_left_semantic_context
25005f6a
PH
9043 definition.
9044 * src/reader.h (max_left_semantic_context): New variable declaration.
9045 * src/scan-gram.l (max_left_semantic_context): Define.
9046 (handle_action_dollar): Update max_left_semantic_context.
9047 * data/glr.c (YYMAXLEFT): New definition.
9048 (yydoAction): Increase size of yyrhsVals by YYMAXLEFT.
9049 (yyresolveAction): Ditto.
9050
9051 Fixes to problems with location handling in GLR parsers reported by
9052 Frank Heckenbach (2003/06/05).
9053
9054 * data/glr.c (YYLTYPE): Make trivial if locations not used.
9055 (YYRHSLOC): Add parentheses, and define only if locations used.
9056 (YYLLOC_DEFAULT): Add parentheses, and give trivial definition if
9057 locations not used.
9058 (yyuserAction): Use YYLLOC_DEFAULT to set *yylocp.
9059 (yydoAction): Remove redundant initialization of *yyvalp and *yylocp.
8dd76bee 9060
25005f6a
PH
9061 * tests/cxx-type.at: Exercise location information; update tests
9062 to differentiate output with and without locations.
8dd76bee 9063 Remove forward declarations of yylex and yyerror---caused errors
25005f6a
PH
9064 because default YYLTYPE not yet defined.
9065 Change semantic actions to compute strings, rather than printing
9066 them directly (to test proper passing of semantics values). Change
9067 output to prefix notation and update test data and expected results.
9068 (yylex): Track locations.
9069 (stmtMerge): Return value rather than printing, and include arguments
9070 in value.
8dd76bee 9071
711f40b7
PE
90722003-06-03 Paul Eggert <eggert@twinsun.com>
9073
9074 Avoid warnings generated by GCC 2.95.4 when Bison is
9075 configured with --enable-gcc-warnings.
9076 * data/lalr1.cc (yy::]b4_parser_class_name[::parse,
9077 yy::]b4_parser_class_name[::translate_,
9078 yy::Stack::operator[] (unsigned),
9079 yy::Stack::operator[] (unsigned) const,
9080 yy::Slice::operator[] (unsigned),
9081 yy::Slice::operator[] (unsigned) const):
9082 Rename local vars to avoid warnings.
9083 * tests/glr-regression.at (Improper handling of embedded actions
9084 and $-N in GLR parsers): Remove unused local variable from yylex.
9085 * tests/regression.at (_AT_DATA_DANCER_Y): Declare yylex to take
9086 (void) as arg when not pure, since we now assume C89 when building
9087 Bison. Pacify GCC by using parameter.
9088
ac695f7d
PE
90892003-06-02 Paul Eggert <eggert@twinsun.com>
9090
9091 * data/lalr1.cc (yy::Position::lines, yy::Position::columns,
9092 yy::Location::lines, yy::Location::columns): Rename arguments
9093 to avoid shadowing; this removes a warning generated by GCC 3.3.
9094
26ec81e0
PE
90952003-06-01 Paul Eggert <eggert@twinsun.com>
9096
9097 Don't pass C-only warning optins (e.g., -Wmissing-declarations)
9098 to g++, as GCC 3.3 complains if you do it.
9099 * configure.ac (WARNING_CXXFLAGS): New subst. Set it to
9100 everything that WARNING_CFLAGS has, except omit warnings
9101 not suitable for C++.
9102 (AC_PROG_CXX): Use this instead of AC_CHECK_PROGS([CXX], [g++]).
9103 * tests/atlocal.in (CXXFLAGS): New var.
9104 * tests/local.at (AT_COMPILE_CXX): Use it instead of CFLAGS.
9105
9106 Fix a GLR parser bug I reported in February; see
161a71f3 9107 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00008.html>.
26ec81e0
PE
9108 The problem was that GLR parsers did not conform to the C standard,
9109 because actions like { $1 = $2 + $3; } expanded to expressions
9110 that invoked YYFILL in separate subexpressions, and YYFILL assigned
9111 to a local variable. The C standard says that expressions
9112 like (var = f ()) + (var = f ()) have undefined behavior.
9113 Another problem was that GCC sometimes issues warnings that
9114 yyfill and its parameters are unused.
9115
9116 * data/glr.c (yyfillin): Renamed from the old yyfill. Mark
9117 as possibly unused.
9118 (yyfill): New function.
9119 (YYFILL): Use it.
9120 (yyuserAction): Change type of yynormal to bool, so that it matches
9121 the new yyfill signature. Mark it as possibly unused.
9122
9123
9124 Follow up on a bug I reported in February, where a Bison-generated
9125 parser can loop. Provide a test case and a fix for yacc.c. I
9126 don't have a fix for lalr1.cc or for glr.c, unfortunately.
9127 The original bug report is in:
161a71f3 9128 <http://lists.gnu.org/archive/html/bison-patches/2003-02/msg00044.html>
26ec81e0
PE
9129
9130 * data/yacc.c (YYERROR): Now just 'goto yyerrorlab', since the
9131 macro's size was becoming unwieldy.
9132 (yyerrlab): Do not discard an empty lookahead symbol, as this
9133 might destroy garbage.
9134 (yyerrorlab): New label, with the old contents of YYERROR,
9135 plus the following change: pop the stack of rhs corresponding
9136 to the production that invoked YYERROR. That is how Yacc
9137 behaves, and POSIX requires this behavior.
9138 (yyerrlab1): Use YYPOPSTACK instead of its definiens.
9139 * tests/calc.at (_AT_DATA_CALC_Y): Include unistd.h if available.
9140 Define 'alarm' to do nothing if unistd.h is not available.
9141 Add a new rule "exp: '-' error;" to test the above change to
9142 data/yacc.c. Use 'alarm' to abort any test taking longer than
9143 10 seconds, as it's probably looping.
9144 (AT_CHECK_CALC): Test recovery from error in new grammar rule.
9145 Also, the new yacc.c generates two fewer diagnostics for an
9146 existing test.
9147
d0829076
PE
91482003-05-24 Paul Eggert <eggert@twinsun.com>
9149
c6ae27df
PE
9150 * data/glr.c (YYSTACKEXPANDABLE): Do not evaluate
9151 YYSTYPE_IS_TRIVIAL or YYSTYPE_IS_TRIVIAL unless they are defined.
9152 This fixes a problem reported by John Bowman when the Compaq/HP
9153 Alpha cxx compiler happy (e.g. using cxx -D__USE_STD_IOSTREAM
9154 -ansi -Wall -gall).
9155 * data/yacc.c (union yyalloc): Likewise.
9156 (YYCOPY): Do not evaluate __GNUC__ unless it is defined.
26ec81e0 9157
d0829076
PE
9158 Switch from 'int' to 'bool' where that makes sense.
9159
9160 * lib/abitset.c (abitset_test, abitset_empty_p, abitset_equal_p,
9161 abitset_subset_p, abitset_disjoint_p, abitset_and_cmp,
9162 abitset_andn_cmp, abitset_or_cmp, abitset_xor_cmp, abitset_and_or,
9163 abitset_and_or_cmp, abitset_andn_or_cmp, abitset_or_and_cmp):
9164 Return or accept bool, not int. All callers changed.
9165 * lib/bbitset.h: (bitset_toggle_, bitset_copy_, bitset_and_or_cmp_,
9166 bitset_andn_or_cmp_, bitset_or_and_cmp_): Likewise.
9167 * lib/bitset.c (bitset_only_set_p, bitset_print, bitset_toggle_,
9168 bitset_copy_, bitset_op4_cmp, bitset_and_or_cmp_, bitset_andn_or_cmp_,
9169 bitset_or_and_cmp_): Likewise.
9170 * lib/bitset.h (bitset_test, bitset_only_set_p): Likewise.
9171 * lib/bitset_stats.c (bitset_stats_print, bitset_stats_toggle,
9172 bitset_stats_test, bitset_stats_empty_p, bitset_stats_disjoint_p,
9173 bitset_stats_equal_p, bitset_stats_subset_p, bitset_stats_and_cmp,
9174 bitset_stats_andn_cmp, bitset_stats_or_cmp, bitset_stats_xor_cmp,
9175 bitset_stats_and_or_cmp, bitset_stats_andn_or_cmp,
9176 bitset_stats_or_and_cmp): Likewise.
9177 * lib/ebitset.c (ebitset_elt_zero_p, ebitset_equal_p, ebitset_copy_cmp,
9178 ebitset_test, ebitset_empty_p, ebitset_subset_p, ebitset_disjoint_p,
9179 ebitset_op3_cmp, ebitset_and_cmp, ebitset_andn_cmp, ebitset_or_cmp,
9180 ebitset_xor_cmp): Likewise.
9181 * lib/lbitset.c (lbitset_elt_zero_p, lbitset_equal_p, lbitset_copy_cmp,
9182 lbitset_test, lbitset_empty_p, lbitset_subset_p, lbitset_disjoint_p,
9183 lbitset_op3_cmp, lbitset_and_cmp, lbitset_andn_cmp, lbitset_or_cmp,
9184 lbitset_xor_cmp): Likewise.
9185 * lib/bbitset.h: Include <stdbool.h>.
9186 (struct bitset_vtable): The following members now return bool, not
9187 int: toggle, test, empty_p, disjoint_p, equal_p, subset_p,
9188 and_cmp, andn_cmp, or_cmp, xor_cmp, and_or_cmp, andn_or_cmp,
9189 or_and_cmp).
9190 * src/conflicts.c (count_rr_conflicts): Likewise.
9191 * lib/bitset_stats.h (bitset_stats_enabled): Now bool, not int.
9192 All uses changed.
9193 * lib/ebitset.c (ebitset_obstack_init): Likewise.
9194 * lib/lbitset.c (lbitset_obstack_init): Likewise.
9195 * src/getargs.c (debug_flag, defines_flag, locations_flag,
9196 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9197 graph_flag): Likewise.
9198 * src/getargs.h (debug_flag, defines_flag, locations_flag,
9199 no_lines_flag, no_parser_flag, token_table_flag, yacc_flag,
9200 graph_flag): Likewise.
9201 * src/output.c (error_verbose): Likewise.
9202 * src/output.h (error_verbose): Likewise.
9203 * src/reader.c (start_flag, typed): Likewise.
9204 * src/reader.h (typed): Likewise.
9205 * src/getargs.c (LOCATIONS_OPTION): New constant.
9206 (long_options, getargs): Use it.
9207 * src/lalr.c (build_relations): Use bool, not int.
9208 * src/nullable.c (nullable_compute): Likewise.
9209 * src/print.c (print_reductions): Likewise.
9210 * src/tables.c (action_row, pack_vector): Likewise.
9211 * src/muscle_tab.h (MUSCLE_INSERT_BOOL): New macro.
9212 * src/output.c (prepare): Use it.
9213 * src/output.c (token_definitions_output,
9214 symbol_destructors_output, symbol_destructors_output): Use string,
9215 not boolean integer, to keep track of whether to output separator.
9216 * src/print_graph.c (print_core): Likewise.
9217 * src/state.c (state_rule_lookaheads_print): Likewise.
9218
9219 * config/install-sh: Sync from automake 1.7.5.
9220
6b2584b7
PE
92212003-05-14 Paul Eggert <eggert@twinsun.com>
9222
9223 * src/parse-gram.y (rules_or_grammar_declaration): Require a
9224 semicolon after a grammar declaration, in the interest of possible
9225 future changes to the Bison input language.
9226 Do not allow a stray semicolon at the start of the grammar.
9227 (rhses.1): Allow one or more semicolons after any rule, including
9228 just before "|" as required by POSIX.
9229 * tests/input.at (Torturing the Scanner): Add tests for ";|" in a
9230 grammar.
9231
caf37a36
ADL
92322003-05-14 Alexandre Duret-Lutz <adl@gnu.org>
9233
9234 %parse-param support for lalr1.cc.
9235
9236 * data/lalr1.cc (b4_parse_param_decl, b4_parse_param_cons,
9237 b4_cc_constructor_calls, b4_cc_constructor_call,
9238 b4_parse_param_vars, b4_cc_var_decls, b4_cc_var_decl): New m4
9239 definitions.
9240 (yy::b4_parser_class_name::b4_parser_class_name): Take extra
9241 parse-param arguments.
9242 (yy::b4_parser_class_name): Declare instance variables to
9243 hold parse-param arguments.
9244 * tests/calc.at: s/value/semantic_value/ because value clashes
9245 with a member of yy::b4_parser_class_name. Adjust C++ code
9246 to handle %parse-param. Enable %parse-param test in C++.
9247
3ab37077
PE
92482003-05-12 Paul Eggert <eggert@twinsun.com>
9249
9250 * doc/bison.texinfo (How Can I Reset @code{yyparse}): Reword the
9251 English a bit. Fix fclose typo. Change "const char" to "char
9252 const", and use ANSI C rather than K&R for "main". Suggest
9253 YY_FLUSH_BUFFER over yyrestart (as that is what Flex recommends)
9254 and suggest yy_switch_to_buffer.
9255
92562003-05-05 Paul Eggert <eggert@twinsun.com>
163ab321
PE
9257
9258 * lib/bitset.h (__INT_TO_PTR): Define to a value that presumes
9259 C89. This avoids a diagnostic on compilers that define __STDC__
9260 to 0, fixing a problem with Tru64 cc reported by Martin Mokrejs in
161a71f3 9261 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
163ab321 9262
e743727f
PE
92632003-05-03 Paul Eggert <eggert@twinsun.com>
9264
9265 * lib/bitset.h (BITSET_FOR_EACH, BITSET_FOR_EACH_REVERSE):
9266 Do not overrun array bounds.
9267 This should fix a bug reported today by Olatunji Oluwabukunmi in
161a71f3 9268 <http://lists.gnu.org/archive/html/bug-bison/2003-05/msg00004.html>.
e743727f 9269
916708d5
AD
92702003-04-29 Akim Demaille <akim@epita.fr>
9271
9272 * src/gram.h, src/gram.c (pure_parser, glr_parser): Move to...
9273 * src/getargs.c, src/getargs.h: here, as bool, not int.
9274 (nondeterministic_parser): New.
9275 * src/parse-gram.y, src/scan-gram.l: Support
9276 %nondeterministic-parser.
9277 * src/output.c (prepare): Use nondeterministic_parser instead
9278 of glr_parser where appropriate.
9279 * src/tables.c (conflict_row, action_row, save_row)
9280 (token_actions, token_actions, pack_vector): Ditto.
9281
a06ea4aa
AD
92822003-04-29 Akim Demaille <akim@epita.fr>
9283
9284 * doc/bison.texinfo (C++ Parsers, Implementing Loops): New.
9285
211074ca
AD
92862003-04-29 Akim Demaille <akim@epita.fr>
9287
9288 * tests/calc.at: Also test yacc.c and glr.c (but not lalr1.cc yet)
9289 with %pure-parser and %locations to exercise the patch from Yakov
9290 Markovitch below.
9291
6175ffe3
PE
92922003-04-28 Tim Van Holder <tim.van.holder@pandora.be>
9293
9294 * data/yacc.c: (b4_lex_param): Corrected for the case where
9295 %lex-param is provided and %pure-parser isn't.
9296
b1e95857
PE
92972003-04-27 Paul Eggert <eggert@twinsun.com>
9298
9299 Avoid gcc -Wundef warnings reported by Gerald Pfeifer in
161a71f3 9300 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00044.html>.
b1e95857
PE
9301 * data/yacc.c (YYSTACK_ALLOC): Don't evaluate YYSTACK_USE_ALLOCA
9302 if it is not defined.
9303 (YYMAXDEPTH): Don't evaluate YYMAXDEPTH if it is not defined.
9304
acda9df6
PE
93052003-04-26 Paul Eggert <eggert@twinsun.com>
9306
3470c57b
PE
9307 * data/lalr1.cc (yy::Parser::pact_ninf_, yy::Parser::table_ninf_):
9308 Declare to be of type suitable for the ninf value itself, not of
9309 type suitable for the corresponding table, since the latter might
9310 be unsigned but the ninf value might be negative. This fixes a
9311 bug reported by Alexandre Duret-Lutz in
161a71f3 9312 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00017.html>.
3470c57b 9313
acda9df6
PE
9314 * configure.ac (AC_FUNC_ERROR_AT_LINE): Remove, since gl_ERROR
9315 invokes it. We shouldn't invoke it twice because it will attempt
9316 to put error.o in the archive twice. This fixes a glitch reported
9317 by Martin Mokrejs in
161a71f3 9318 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00041.html>.
acda9df6 9319
b5250f26
PE
93202003-04-21 Paul Eggert <eggert@twinsun.com>
9321
9322 * m4/error.m4: Update from Bruno Haible's 2003-04-14 patch
9323 to gnulib.
9324
089ac0f1
PE
93252003-04-21 Yakov Markovitch <Markovitch@iso.ru>
9326
9327 * data/glr.c (yyexpandGLRStack) [!YYSTACKEXPANDABLE]:
9328 Fix obvious typo that results in uncompilable GLR parsers
9329 when both %pure-parser and %locations are used. (trivial change)
9330
5ededac6
PE
93312003-04-17 Paul Eggert <eggert@twinsun.com>
9332
1b8f2fff
PE
9333 * src/scan-gram.l: Add %option nounput, since we no longer use unput.
9334 (unexpected_eof): Renamed from unexpected_end_of_file, for brevity.
9335 Do not insert the expected token via unput, as this runs afoul
9336 of a POSIX-compatibility bug in flex 2.5.31.
9337 All uses changed to BEGIN the parent state,
9338 since we no longer insert the expected token via unput.
9339 * tests/regression.at (Invalid inputs): Remove cascaded diagnostic
9340 that is no longer emitted after the above change.
9341
5ededac6
PE
9342 * src/conflicts.c (set_conflicts): Resolve all conflicts, not just
9343 the first one. This change is from Paul Hilfinger, and it fixes
9344 regression reported by Werner Lemberg in
161a71f3 9345 <http://lists.gnu.org/archive/html/bug-bison/2003-04/msg00026.html>.
5ededac6
PE
9346
9347 (resolve_sr_conflict): Don't invoke state_errs_set
9348 unless one or more tokens have been explicitly made errors.
9349 Otherwise, the above change causes Bison to abort.
9350
9351 * tests/existing.at (GNU pic Grammar): New test case, taken from
9352 Lemberg's email.
9353
b8be9132
AD
93542003-03-31 Akim Demaille <akim@epita.fr>
9355
9356 * doc/Makefile.am (AM_MAKEINFOFLAGS): Don't split the info file.
9357
d423d460
AD
93582003-03-31 Akim Demaille <akim@epita.fr>
9359
9360 * src/output.c (prepare_symbols): Avoid trailing spaces in the
9361 output.
9362
c7e441b4
AD
93632003-03-31 Akim Demaille <akim@epita.fr>
9364
9365 * doc/bison.texinfo (Strings are Destroyed): s/losses/loses/.
9366 From Paul Hilfinger.
9367
231897ad
AD
93682003-03-29 Akim Demaille <akim@epita.fr>
9369
9370 * m4/error.m4: Do not put under dynamic conditions some code which
9371 expansion is under static control.
9372
5b066063
AD
93732003-03-29 Akim Demaille <akim@epita.fr>
9374
9375 * doc/bison.texinfo (How Can I Reset @code{yyparse}): New.
9376
22a74fec
AD
93772003-03-29 Akim Demaille <akim@epita.fr>
9378
9379 * doc/bison.texinfo (Strings are Destroyed): New.
9380
0eee27e7
PE
93812003-03-13 Paul Eggert <eggert@twinsun.com>
9382
9383 * .cvsignore: Add configure.lineno.
9384 * src/.cvsignore: Add yacc.
9385 * tests/.cvsignore: Add testsuite.log.
9386 * doc/fdl.texi: Sync with latest FSF version.
9387
f61aad93
PE
93882003-03-12 Paul Eggert <eggert@twinsun.com>
9389
537636c7
PE
9390 * scan-gram.l (YY_USER_INIT): Initialize code_start, too.
9391 (<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner
9392 cursor, instead of leaving it undefined. This fixes a bug
9393 reported by Tim Van Holder in
161a71f3 9394 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
537636c7
PE
9395 * tests/input.at (Torturing the Scanner): Test the scanner on
9396 an empty input file, which was Tim Van Holder's test case.
9397
9398 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): When checking whether
9399 <sys/resource.h> can be included, include sys/time.h and
9400 sys/times.h first, if available. This works around the SunOS
9401 4.1.4 porting bug reported by Bruce Becker in
161a71f3 9402 <http://lists.gnu.org/archive/html/bug-bison/2003-03/msg00018.html>.
537636c7
PE
9403
9404 * m4/subpipe.m4 (BISON_PREREQ_SUBPIPE): Don't
9405 AC_CHECK_HEADERS([sys/wait.h]), as this interferes with
9406 AC_HEADER_SYS_WAIT.
9407
f61aad93
PE
9408 Merge changes from gnulib. This was prompted because the CVS
9409 snapshot didn't build on Solaris 7 due to strnlen problems.
9410
9411 These changes need to be merged back into gnulib:
9412 * lib/hash.c: Include <stdbool.h> unconditionally.
9413 * m4/onceonly.m4 (m4_quote): New macro.
9414 (AC_CHECK_HEADERS_ONCE, AC_CHECK_FUNCS_ONCE, AC_CHECK_DECLS_ONCE):
9415 Quote AC_FOREACH variable-expansions properly.
9416 The 2003-01-03 obstack.h change also needs merging.
9417 {end of changes requiring merging}
5b066063 9418
f61aad93
PE
9419 * lib/stdbool.h.in, m4/alloca.m4, m4/dirname.m4, m4/dos.m4,
9420 m4/getopt.m4, m4/hash.m4, m4/malloc.m4, m4/memchr.m4,
9421 m4/memrchr.m4, m4/obstack.m4, m4/onceonly.m4, m4/quote.m4,
9422 m4/quotearg.m4, m4/realloc.m4, m4/stpcpy.m4, m4/strnlen.m4,
9423 m4/strtol.m4, m4/strtoul.m4, m4/unlocked-io.m4, m4/xalloc.m4:
9424 New files, imported from gnulib.
9425 * m4/Makefile.am (EXTRA_DIST): Add the new m4/*.m4 files mentioned
9426 above.
9427
9428 * lib/mbswidth.c, m4/error.m4, m4/mbrtowc.m4, m4/mbswidth.m4,
9429 m4/memcmp.m4, m4/prereq.m4, m4/stdbool.m4: Update to current
9430 gnulib sources.
9431
9432 * configure.ac (gl_DIRNAME, gl_GETOPT, gl_HASH, gl_QUOTE, gl_XALLOC):
9433 Add.
9434 (gl_ERROR): New, replacing jm_PREREQ_ERROR.
9435 (gl_FUNC_ALLOCA): New, replacing AC_FUNC_ALLOCA.
9436 (gl_FUNC_STPCPY): New, replacing AC_REPLACE_FUNCS(stpcpy).
9437 (gl_FUNC_STRNLEN): New, replacing AC_FUNC_STRNLEN.
9438 (gl_MBSWIDTH): New, replacing jm_PREREQ_MBSWIDTH.
9439 (gl_OBSTACK): New, replacing AC_FUNC_OBSTACK.
9440 (gl_QUOTEARG): New, replacing jm_PREREQ_QUOTEARG.
9441 (jm_FUNC_GLIBC_UNLOCKED_IO, gl_FUNC_STPCPY, gl_FUNC_STRTOL): New.
9442 (jm_FUNC_MALLOC): New, replacing AC_FUNC_MALLOC.
9443 (jm_FUNC_REALLOC): New, replacing AC_FUNC_REALLOC.
9444 (jm_PREREQ_ARGMATCH): Remove.
9445 (AC_REPLACE_FUNCS): Remove memchr, memrchr, stpcpy, strtol, strtoul.
9446 * lib/Makefile.am (libbison_a_SOURCES): Add argmatch.c, argmatch.h.
9447
9448 * src/system.h: Include <stdbool.h> unconditionally.
9449
9450 * lib/bbitset.h: Include <limits.h> unconditionally. We have been
9451 assuming at least C89 in the bitset code for some time now.
9452
d2ffe116
AD
94532003-03-03 Akim Demaille <akim@epita.fr>
9454
9455 * ro.po: New.
9456
052826fd
AD
94572003-03-02 Akim Demaille <akim@epita.fr>
9458
9459 * doc/bison.texinfo (Table of Symbols): Reactivate the
9460 documentation for %lex-param, and %parse-param.
9461
c4749565
AD
94622003-03-02 Akim Demaille <akim@epita.fr>
9463
9464 * data/yacc.c, data/glr.c, data/lal1.cc: Use similar code to
9465 generate verbose error messages.
9466 Use the number of tokens as an upper bound in yytname, as it
9467 cannot be a non terminal.
9468
d5286af1
AD
94692003-03-02 Akim Demaille <akim@epita.fr>
9470
9471 * tests/regression.at (_AT_DATA_DANCER_Y): Fix the expected error
9472 message.
9473
22e304a6
AD
94742003-03-02 Akim Demaille <akim@epita.fr>
9475
22e304a6
AD
9476 * tests/regression.at (_AT_DATA_DANCER_Y, AT_CHECK_DANCER): New.
9477 Use them to exercise yycheck overrun.
9478 Based on Andrew Suffield's grammar.
9479
67a25fed
AD
94802003-03-02 Akim Demaille <akim@epita.fr>
9481
9482 Create tests/local.at for Bison generic testing macros.
9483
9484 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Move to...
9485 * tests/local.at (AT_BISON_OPTION_PUSHDEFS, AT_BISON_OPTION_POPDEFS):
9486 This new file.
9487 * tests/calc.at (AT_CHECK_CALC): Adjust.
9488 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR)
9489 (AT_COMPILE, AT_COMPILE_CXX, AT_PARSER_CHECK): Move to...
9490 * tests/local.at: here.
9491 (AT_COMPILE_CXX): Tags the tests using it as c++.
9492 Ignore the test if CXX is not functional.
9493
9c2b381f
PE
94942003-03-01 Paul Eggert <eggert@twinsun.com>
9495
9496 * src/scan-gram.l (code_start): Initialize it to scanner_cursor,
9497 not loc->end, since loc->end might contain garbage and this leads
9498 to undefined behavior on some platforms.
9499 (id_loc, token_start): Use (IF_LINTed) initial values that do not
9500 depend on *loc, so that the reader doesn't give the the false
9501 impression that *loc is initialized.
9502 (<INITIAL>"%%"): Do not bother setting code_start, since its value
9503 does not survive the return.
9504
0433ba88
AD
95052003-03-01 Akim Demaille <akim@epita.fr>
9506
9507 * src/scan-gram.l (code_start): Always initialize it when entering
9508 into yylex, as SC_EPILOGUE is activated *before* the corresponding
9509 yylex invocation. An alternative would be making it static, but
9510 then it starts with the second %%'s beginning, instead of its end.
9511
b305ea69
PE
95122003-02-28 Paul Eggert <eggert@twinsun.com>
9513
9514 * lib/mbswidth.c: Include <wchar.h> before "mbswidth.h", to work
9515 around a UnixWare 7.1.1 porting bug reported by John Hughes in
161a71f3 9516 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00030.html>.
b305ea69 9517
c3d25e01
PE
95182003-02-26 Paul Eggert <eggert@twinsun.com>
9519
9520 * README: Mention compiler bug in Sun Forte Developer 6 update 2.
9521 Remove Sequent/Pyramid discussion (nobody uses them any more).
9522 Merge VMS and MS-DOS discussion; these ports may well be dead
9523 but let's keep mentioning them for now. Put <> around email
9524 addresses. Add copyright notice.
9525
c267ffbc
PE
95262003-02-24 Paul Eggert <eggert@twinsun.com>
9527
9528 * data/glr.c (yy_reduce_print): yylineno -> yylno,
9529 to avoid collision with flex use of yylineno.
9530 Problem reported by Bruce Lilly in
161a71f3 9531 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00016.html>.
c267ffbc
PE
9532 * data/lalr1.cc (yy::]b4_parser_class_name[::parse): Likewise.
9533 * data/yacc.c (yy_reduce_print): Likewise.
9534
9535 * config/depcomp: Sync with Automake 1.7.3.
9536
f939fc12
AD
95372003-02-21 Akim Demaille <akim@epita.fr>
9538
9539 * data/lalr1.cc: Use temporary variables instead of casts to
9540 change integer types.
9541 Suggested by Paul Eggert.
9542
95923bd6
AD
95432003-02-21 Akim Demaille <akim@epita.fr>
9544
9545 * doc/bison.texinfo: Use "location" consistently to refer to @n,
9546 to avoid confusions with lalr1.cc's notion of Position.
9547 Suggested by Paul Eggert.
9548
2cdc240e
AD
95492003-02-20 Akim Demaille <akim@epita.fr>
9550
9551 * data/lalr1.cc (position.hh): Make sure "columns" never pushes
9552 before initial_columns.
9553 (location.hh): Use consistent variable names when defining the
9554 operator<<.
9555 Use "last" so that we subtract from Positions, not from unsigned.
9556
5d003116
AD
95572003-02-20 Akim Demaille <akim@epita.fr>
9558
9559 * data/lalr1.cc (position.hh): New subfile, including the extended
9560 and Doxygen'ed documentation of class Position.
9561 (location.hh): Use it.
9562 Document a` la Doxygen.
ba1ecc07 9563 With the help of Benoit Perrot.
5d003116 9564
d02b25f9
AD
95652003-02-20 Akim Demaille <akim@epita.fr>
9566
9567 * tests/calc.at (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): Define
9568 AT_YACC_IF.
9569 Redefine AT_YYERROR_SEES_LOC_IF using it.
9570 (_AT_DATA_CALC_Y): Don't declare yyerror when lalr1.cc, as it is
9571 not defined.
9572 Don't use the location in yy::Parser::error_ and
9573 yy::Parser::print_ when not %locations.
9574 Activate more lalr1.cc tests.
9575
0d1c3a04
AD
95762003-02-19 Akim Demaille <akim@epita.fr>
9577
9578 * data/lalr1.cc: When displaying a line number, be sure to make it
9579 an int.
9580
60a777aa
AD
95812003-02-19 Akim Demaille <akim@epita.fr>
9582
9583 * data/lalr1.cc (b4_stack_depth_init, yy::Parser::initdepth_):
9584 Remove, useless.
9585 (YYABORT, YYACCEPT, YYERROR): New.
9586 * tests/calc.at: Renable the lalr1.cc test.
9587
0b86fc41
AD
95882003-02-19 Akim Demaille <akim@epita.fr>
9589
9590 * tests/calc.at (AT_CHECK_CALC): Check different scenarios of
9591 error recovery, mixing with/without pops and discarding of the
9592 lookahead.
9593 Exercise YYERROR.
9594 Disable the lalr1.cc tests as currently it doesn't support YYERROR.
9595
da99a5dc
PE
95962003-02-17 Paul Eggert <eggert@twinsun.com>
9597
9598 * tests/atlocal.in (LDFLAGS, LIBS): New vars.
9599 * tests/testsuite.at (AT_COMPILE): Use them.
9600 This fixes the testsuite problem reported by Robert Lentz in
161a71f3 9601 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00011.html>.
da99a5dc 9602
93b8c255
PE
96032003-02-12 Paul Eggert <eggert@twinsun.com>
9604
9605 * data/yacc.c (yyerrlab) [YYERROR_VERBOSE]:
9606 Avoid subscript error in yycheck. Bug reported by Andrew Suffield in
161a71f3 9607 <http://lists.gnu.org/archive/html/bug-bison/2003-02/msg00003.html>.
93b8c255
PE
9608 * data/glr.c (yyreportSyntaxError) [YYERROR_VERBOSE]: Likewise.
9609 Check for malloc failure, for consistency with yacc.c.
9610 (yytname_size): Remove, for consistency with yacc.c.
9611
9612 The bug still remains in data/lalr1.cc, as I didn't have time
9613 to fix it there.
9614
7548fed2
AD
96152003-02-06 Akim Demaille <akim@epita.fr>
9616
9617 * configure.ac (GXX): Rename as...
9618 (CXX): this, to keep the original Autoconf semantics.
9619 Require 2.57.
9620 * data/lalr1.cc: Fix b4_copyright invocations.
9621 If YYDEBUG is not defined, don't depend upon name_ being defined.
9622 (location.hh): Include string and iostream.
9623 (Position::filename): New member.
9624 (Position::Position ()): New.
9625 (operator<< (Position)): New.
9626 (operator- (Position, int)): New.
9627 (Location::first, Location::last): Rename as...
9628 (Location::begin, Location::end): these, to mock the conventional
9629 iterator names.
9630 (operator<< (Location)): New.
9631 * tests/atlocal.in (CXX): New.
9632 * tests/testsuite.at (AT_COMPILE_CXX): New.
9633 * tests/calc.at (_AT_DATA_CALC_Y): Adjust yyerror to report the
9634 locations in a more synthetic way.
9635 (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF is positive if
9636 lalr1.cc is used.
9637 Adjust the C locations to match those from Emacs: first column is
9638 column 0.
9639 Change all the expected results.
9640 Conform to the GCS: simplify the locations when applicable.
9641 (LOC, VAL, YYLLOC_FORMAL, YYLLOC_ARG, USE_YYLLOC, LEX_FORMALS)
9642 (LEX_ARGS, USE_LEX_ARGS, LEX_PRE_FORMALS, LEX_PRE_ARGS): Replace
9643 these CPP macros with the m4 macros new defined by...
9644 (AT_CHECK_PUSHDEFS): this, i.e.:
9645 (AT_LALR1_CC_IF, AT_PURE_LEX_IF, AT_LOC, AT_VAL, AT_LEX_FORMALS)
d02b25f9 9646 (AT_LEX_ARGS, AT_USE_LEX_ARGS, AT_LEX_PRE_FORMALS, AT_LEX_PRE_ARGS)
7548fed2
AD
9647 New macros.
9648 (AT_CHECK_POPDEFS): Undefine them.
9649 (AT_CHECK_CALC_LALR1_CC): New.
9650 Use it for the first lalr1.cc test.
9651
43a176ef
AD
96522003-02-04 Akim Demaille <akim@epita.fr>
9653
9654 * data/lalr1.cc (YYLLOC_DEFAULT): Fix its definition: be based on
9655 Location as is defined.
9656
fc049e9c
AD
96572003-02-04 Akim Demaille <akim@epita.fr>
9658
9659 * data/lalr1.cc: If YYDEBUG is not defined, don't depend upon
9660 name_ being defined.
9661
a737b216
PE
96622003-02-03 Paul Eggert <eggert@twinsun.com>
9663
9664 * src/gram.h (start_symbol): Remove unused decl.
9665
9666 Use more-consistent naming conventions for local vars.
9667
9668 * src/derives.c (derives_compute): Change type of local var from
9669 int to rule_number.
9670 * src/gram.c (grammar_rules_partial_print): Likewise.
9671 * src/print.c (print_core): Likewise.
9672 * src/reduce.c (reduce_grammar_tables): Likewise.
9673
9674 * src/gram.c (grammar_dump): Change name of item_number *
9675 local var from r to rp.
9676 * src/nullable.c (nullable_compute): Likewise.
9677
9678 * src/gram.h (ISTOKEN, ISVAR): Use i, not s, for int var.
9679
9680 * src/gram.h (symbol_number_as_item_number): Use sym, not s,
9681 for symbol or symbol_number var.
9682 * src/reader.c (grammar_start_symbol_set): Likewise.
9683 * src/reader.h (grammar_start_symbol_set, grammar_symbol_append):
9684 Likewise.
9685 * src/state.c (transitions_to): Likewise.
9686 * src/state.h: Likewise.
9687 * src/tables.c (symbol_number_to_vector_number): Likewise.
9688
9689 * src/muscle_tab.h (MUSCLE_OBSTACK_SGROW): Use p, not s, for
9690 char * var.
9691
9692 * src/parse-gram.y (lloc_default): Use loc, not r, for YYLTYPE
9693 var.
9694
9695 * src/scan-gram.l (no_cr_read): Use bytes_read, not s, for size
9696 var.
9697
9698 * src/system.h (xstrndup, strchr, strspn, strnlen, memchr, memrchr):
9699 Use str, not s, for char * var. Use ch, not c, for character var.
9700 Use size for size var.
9701
9702 * src/uniqstr.c (uniqstr_new, uniqstr_assert): Use str, not s, for
9703 char * var.
9704 (uniqstr_print, uniqst_print_processor): Use ustr, not s, for
9705 uniqstr var.
9706 * src/uniqstr.h: Likewise.
9707
9708 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
9709 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
9710 get_node_alignment_str, get_arrow_mode_str, get_crossing_type_str,
9711 get_view_str, get_linestyle_str, get_arrowstyle_str): Rename
9712 param to have same name as that of enum, so that we don't use
9713 "s" to stand for a non-state.
9714
68e93ad5
AD
97152003-02-02 Akim Demaille <akim@epita.fr>
9716
9717 * src/scan-skel.l: Scan more than one inert character per yylex
9718 invocation.
9719
92898986
PE
97202003-02-01 Paul Eggert <eggert@twinsun.com>
9721
9722 Version 1.875a.
9723
1d9d5d71
PE
9724 * po/LINGUAS: Add ms.
9725
0435d061
AD
97262003-01-30 Akim Demaille <akim@epita.fr>
9727
9728 * doc/Makefile.am (CLEANFILES): Add bison.fns for distcheck.
9729
6029a57f
PH
97302003-01-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
9731
9732 * tests/cxx-type.at: Correct apparent typo in Bison input: $$ instead
9733 of $1.
0435d061
AD
9734
9735 Changes in response to error report by S. Eken: GLR mode does not
6029a57f 9736 handle negative $ indices or $ indices in embedded rules correctly.
161a71f3 9737 See <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00076.html>.
0435d061 9738
6029a57f
PH
9739 * data/glr.c (b4_rhs_value): Change to use YYFILL macro.
9740 (b4_rhs_location): Ditto.
0435d061 9741 (yyfill): New function to copy from stack tree into array
6029a57f 9742 incrementally.
0435d061
AD
9743 (yyuserAction): Modify to allow incremental move of semantic values
9744 to rhs array when in GLR mode.
9745 Define YYFILL to use in user-defined actions to fill semantic array
6029a57f
PH
9746 as needed.
9747 Remove dummy use of yystack, as there is now a guaranteed use.
9748 (yydoAction): Modify to allow incremental move of semantic values
9749 to rhs array when in GLR mode.
9750 (yyresolveAction): Ditto.
9751 (yyglrShiftDefer): Update comment.
0435d061 9752 (yyresolveStates): Use X == NULL for pointers, not !X.
6029a57f
PH
9753 (yyglrReduce): Ditto.
9754 (yydoAction): Ditto
0435d061 9755
6029a57f
PH
9756 * tests/glr-regr1.at: Rename to ...
9757 * tests/glr-regression.at: Add new regression test for the problems
9758 described above (adapted from S. Eken).
9759 Update copyright notice.
9760 * tests/testsuite.at: Rename glr-regr1.at to glr-regression.at.
9761 * tests/Makefile.am: Ditto.
9762
6cee6297
PE
97632003-01-28 Paul Eggert <eggert@twinsun.com>
9764
9765 * data/lalr1.cc: Do not use @output_header_name@ unless
9766 b4_defines_flag is set. This fixes two bugs reported by
9767 Tim Van Holder in
161a71f3
PE
9768 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00071.html>
9769 and <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00073.html>.
6cee6297 9770
b2a836b5
PE
97712003-01-21 Paul Eggert <eggert@twinsun.com>
9772
9773 * data/yacc.c (YYERROR): Move code from yyerrlab1 to here, so that
9774 we don't need to worry about yyerrlab1 being reported as an
9775 "unused label" by non-GCC C compilers. The downside is that if
9776 locations are used then a couple of statements are duplicated each
9777 time YYERROR is invoked, but the upside is that the warnings
9778 should vanish.
9779 (yyerrlab1): Move code to YERROR.
9780 (yyerrlab2): Remove. Change uses back to yyerrlab1.
9781 This reverts some of the 2002-12-27 change.
9782
4196b931
PE
97832003-01-17 Paul Eggert <eggert@twinsun.com>
9784
9785 * src/output.c (symbol_printers_output): Fix typo that led
9786 to core dump. Problem reported by Antonio Rus in
161a71f3 9787 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00058.html>.
4196b931 9788
3ae831b4
AD
97892003-01-13 Akim Demaille <akim@epita.fr>,
9790 Quoc Peyrot <chojin@lrde.epita.fr>,
9791 Robert Anisko <anisko_r@lrde.epita.fr>
9792
9793 * data/lalr1.cc (parse::yyerrlab1): When popping the stack, stop
9794 when the stacks contain one element, as the loop would otherwise
9795 free the last state, and then use the top state (the one we just
9796 popped). This means that the initial elements will not be freed
9797 explicitly, as is the case in yacc.c; it is not a problem, as
9798 these elements have fake values.
9799
e3aa65c5
PE
98002003-01-11 Paul Eggert <eggert@twinsun.com>
9801
9802 * NEWS: %expect-violations are now just warnings, reverting
9803 to Bison 1.30 and 1.75 behavior. This fixes the GCC 3.2
9804 bootstrapping problem reported by Matthias Klose; see
161a71f3 9805 <http://lists.gnu.org/archive/html/bug-bison/2003-01/msg00053.html>.
e3aa65c5
PE
9806 * src/conflicts.c (conflicts_print): Likewise.
9807 * tests/conflicts.at (%expect not enough, %expect too much,
9808 %expect with reduce conflicts): Likewise.
9809 * doc/bison.texinfo (Expect Decl): Document this. Also mention
9810 that the warning is enabled if the number of conflicts changes
9811 (not necessarily increases).
9812
9813 * src/getargs.c (version): Update copyright year.
9814
f0057011
AD
98152003-01-09 Akim Demaille <akim@epita.fr>
9816
9817 * src/Makefile.am, lib/Makefile.am: Use $(VAR) instead of @VAR@.
9818
1ee6d2a0
PE
98192003-01-08 Paul Eggert <eggert@twinsun.com>
9820
9821 * Makefile.maint (WGETFLAGS):
9822 New macro, containing "-C off" to disable proxy caches.
9823 All uses of $(WGET) changed to $(WGET) $(WGETFLAGS).
9824 (rel-check): Use $(WGET) instead of wget.
9825
d4fd77c4
PE
98262003-01-06 Paul Eggert <eggert@twinsun.com>
9827
9828 * doc/bison.texinfo (Generalized LR Parsing): Add a reference to
9829 the GLR paper of Scott, Johnstone and Hussain.
9830
464c6927
PE
98312003-01-04 Paul Eggert <eggert@twinsun.com>
9832
d600ee67
PE
9833 * configure.ac (AC_ARG_ENABLE): Add --disable-yacc.
9834 (YACC_SCRIPT, YACC_LIBRARY): New vars to AC_SUBST.
9835 * lib/Makefile.am (lib_LIBRARIES): liby.a -> @YACC_LIBRARY@.
9836 (EXTRA_LIBRARIES): New var, for liby.a.
9837 * src/Makefile.am (bin_SCRIPTS): yacc -> @YACC_SCRIPT@.
9838 (EXTRA_SCRIPTS): New var, for yacc.
9839
464c6927
PE
9840 * data/yacc.c (yyerrlab1): Omit attribute if __cplusplus is defined,
9841 since GNU C++ (as of 3.2.1) does not allow attributes on labels.
9842 Problem reported by Nelson H. F. Beebe.
9843
98442003-01-03 Paul Eggert <eggert@twinsun.com>
9845
9846 * lib/obstack.h (__INT_TO_PTR) [__STDC__]: Cast result to
9847 (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
9848 when compiling Bison 1.875's `bitset bset = obstack_alloc
9849 (bobstack, bytes);'. Problem reported by Nelson H. F. Beebe.
9850
9851 * src/scan-skel.l (QPUTS): Omit redundant `;' from macro definition.
9852 ([^@\n]): Renamed from [^@\n]+ so that the token buffer does not
9853 grow to a huge size with typical invocation.
d600ee67 9854
464c6927
PE
9855 * lib/hash.c (_Bool, bool, false, true, __bool_true_false_are_defined):
9856 Use the pattern recommended by Autoconf 2.57, except also protect
9857 against double-definition.
9858 * src/system.h: Likewise.
9859 Portability issues reported by Nelson H. F. Beebe.
d600ee67 9860
464c6927
PE
9861 * data/glr.c (yybool): Renamed from bool, to avoid collisions in C.
9862 All uses changed. Provide a definition in both C and C++.
9863 (yytrue, yyfalse): Define even if defined (__cplusplus).
9864
9865 * lib/bitset_stats.c (bitset_stats_list): Remove unused var.
9866 Reported by Nelson H. F. Beebe.
d600ee67 9867
464c6927
PE
9868 * src/scan-skel.l ("@oline@"): Output lineno+1, not lineno.
9869
0f42c7d5
PE
98702003-01-02 Paul Eggert <eggert@twinsun.com>
9871
9872 * data/yacc.c (yyerrlab1): Append `;' after attribute, to
9873 pacify the buggy "smart preprocessor" in MacOS 10.2.3.
9874 Bug reported by Nelson H. F. Beebe.
9875
dc546b0f
PE
98762003-01-01 Paul Eggert <eggert@twinsun.com>
9877
9878 * Version 1.875.
9879
2c09b6a7
PE
98802002-12-30 Paul Eggert <eggert@twinsun.com>
9881
9882 * src/scan-gram.l (<INITIAL,SC_AFTER_IDENTIFIER,SC_PRE_CODE>","):
9883 Moved here from...
9884 (<INITIAL>","): Here. This causes stray "," to be treated
9885 more uniformly.
9886
dc546b0f 9887 * src/scan-gram.l (<SC_BRACED_CODE>"}"): Output ";" before the
2c09b6a7
PE
9888 last brace in braced code when not in Yacc mode, for compatibility
9889 with Bison 1.35. This resurrects the 2001-12-15 patch to
9890 src/reader.c.
9891
9892 * src/reader.h (YYDECL): Use YYSTYPE, not its deprecated alias
9893 yystype. This follows up the 2002-12-24 YYSTYPE bug fix.
9894
535c0f63
PE
98952002-12-28 Paul Eggert <eggert@twinsun.com>
9896
9897 * src/symtab.c (symbol_make_alias): Set type of SYMVAL to be
9898 that of SYM's type. This fixes Debian bug 168069, reported by
9899 Thomas Olsson.
d600ee67 9900
963fcc17
PE
99012002-12-28 Paul Eggert <eggert@twinsun.com>
9902
9903 Version 1.75f.
9904
9905 Switch back to the Yacc style of conflict reports, undoing some
9906 of the 2002-07-30 change.
9907 * doc/bison.texinfo (Understanding): Use Yacc style for
9908 conflict reports. Also, use new way of locating rules.
9909 * src/conflicts.c (conflict_report):
9910 Renamed from conflict_report_yacc, removing the old
9911 'conflict_report'. Translate the entire conflict report at once,
9912 so that we don't assume that "," has the same interpretation in
9913 all languages.
9914 (conflicts_output): Use Yacc-style conflict report for each state,
9915 instead of our more-complicated style.
9916 (conflicts_print): Use Yacc-style conflict report, except print
9917 the input file name when not emulating Yacc.
9918 * tests/conflicts.at (Unresolved SR Conflicts, Defaulted
9919 Conflicted Reduction, %expect not enough, %expect too much,
9920 %expect with reduce conflicts): Switch to Yacc-style conflict reports.
9921 * tests/existing.at (GNU Cim Grammar): Likewise.
9922 * tests/glr-regr1.at (Badly Collapsed GLR States): Likewise.
9923
9924 * src/complain.c (warn_at, warn, complain_at, complain, fatal_at,
9925 fatal): Don't invoke fflush; it's not needed and it might even be
9926 harmful for stdout, as stdout might not be open.
9927 * src/reduce.c (reduce_print): Likewise.
9928
b1efe548
PE
99292002-12-27 Paul Eggert <eggert@twinsun.com>
9930
9931 Fix a bug where error locations were not being recorded correctly.
9932 This problem was originally reported by Paul Hilfinger in
161a71f3 9933 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00086.html>.
b1efe548
PE
9934
9935 * data/yacc.c (yyparse): New local var yylerrsp, to record the
9936 top of the location stack's error locations.
9937 (yyerrlab): Set it. When discarding a token, push its location
9938 onto yylerrsp so that we don't lose track of the error's end.
9939 (yyerrlab1): Now is only the target of YYERROR, so that we can
9940 properly record the location of the action that failed. For GCC
9941 2.93 and later, insert an __attribute__ ((__unused__)) to avoid
9942 GCC warning about yyerrlab1 being unused if YYERROR is unused.
9943 (yyerrlab2): New label, which yyerrlab now falls through to.
9944 Compute the error's location by applying YYLLOC_DEFAULT to
9945 the locations of all the symbols that went into the error.
9946 * doc/bison.texinfo (Location Default Action): Mention that
9947 YYLLOC_DEFAULT is also invoked for syntax errors.
9948 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR):
9949 Error locations include the locations of all the tokens that were
9950 discarded, not just the last token.
d600ee67 9951
983c5c2c
PE
99522002-12-26 Paul Eggert <eggert@twinsun.com>
9953
b1efe548
PE
9954 * src/files.c: Include quote.h.
9955 (compute_output_file_names): Warn if we detect conflicting
9956 outputs to the same file. This should catch the misunderstanding
9957 exemplified by Debian Bug 165349, reported by Bruce Stephens..
9958
9959 * src/conflicts.c (conflicts_print): If the user specifies
9960 "%expect N", report an error if there are any reduce/reduce
9961 conflicts. This is what the manual says should happen.
9962 This fixes Debian bug 130890, reported by Anthony DeRobertis.
9963 * tests/conflicts.at (%expect with reduce conflicts): New test.
9964
983c5c2c
PE
9965 Don't use m4_include on relative file names, as it doesn't work as
9966 desired if there happens to be a file with that name under ".".
d600ee67 9967
983c5c2c
PE
9968 * m4sugar/version.m4: Remove; it was included but it wasn't used.
9969 * data/Makefile.am (dist_m4sugar_DATA): Remove m4sugar/version.m4.
9970 * data/m4sugar/m4sugar.m4: Don't include m4sugar/version.m4.
9971 * data/glr.c, data/lalr1.cc, data/yacc.c: Don't include c.m4.
9972 * src/output.c (output_skeleton): Use full path names when
9973 specifying a file to include; don't rely on include path, as
9974 it's unreliable when the working file contains a file with
9975 that name.
d600ee67 9976
983c5c2c
PE
99772002-12-25 Paul Eggert <eggert@twinsun.com>
9978
9979 Remove obsolete references to bison.simple and bison.hairy.
9980 Problem mentioned by Aubin Mahe in
161a71f3 9981 <http://lists.gnu.org/archive/html/help-bison/2002-12/msg00010.html>.
983c5c2c
PE
9982 * data/glr.c: Comment fix.
9983 * doc/bison.1: Remove references. Also, mention "yacc".
9984
9985 * src/getargs.c (getargs) [MSDOS]: Don't assume optarg != NULL
9986 with -g option.
9987
9988 * src/parse-gram.y (declaration): Use enum "report_states" rather
9989 than its numeric value 1.
9990
9991 * src/scan-skel.l ("@output ".*\n): Close any old yyout before
9992 opening a new one. This fixes Debian bug 165349, reported by
9993 Bruce Stephens.
9994
23f2d9dc
PE
99952002-12-24 Paul Eggert <eggert@twinsun.com>
9996
9997 Version 1.75e.
9998
9999 * Makefile.maint (cvs-update): Don't assume that the shell
10000 supports $(...), as Solaris sh doesn't.
10001
10002 * src/parse-gram.y (lloc_default): Remove test for empty
10003 nonterminals at the end, since it didn't change the result.
10004
100052002-12-24 Paul Eggert <eggert@twinsun.com>
33167b8b
PE
10006
10007 If the user does not define YYSTYPE as a macro, Bison now declares it
10008 using typedef instead of defining it as a macro. POSIX requires this.
10009 For consistency, YYLTYPE is also declared instead of defined.
10010
10011 %union directives can now have a tag before the `{', e.g., the
10012 directive `%union foo {...}' now generates the C code
10013 `typedef union foo { ... } YYSTYPE;'; this is for Yacc compatibility.
10014 The default union tag is `YYSTYPE', for compatibility with Solaris 9
10015 Yacc. For consistency, YYLTYPE's struct tag is now `YYLTYPE'
10016 instead of `yyltype'.
10017
10018 `yystype' and `yyltype' are now obsolescent macros instead of being
10019 typedefs or tags; they are no longer documented and will be
10020 withdrawn in a future release.
10021
10022 * data/glr.c (b4_location_type): Remove.
10023 (YYSTYPE): Renamed from yystype.
10024 (YYSTYPE_IS_DECLARED): New macro, used to prevent double-typedef.
10025 (struct YYLTYPE): Renamed from struct yyltype.
10026 (YYLTYPE): Renamed from yyltype.
10027 (yyltype, yystype): New (and obsolescent) macros,
10028 for backward compatibility.
10029 * data/yacc.c: Likewise.
10030
10031 * data/yacc.c (YYSTYPE): Declare as union YYSTYPE if the user
10032 does not specify a union tag. This is for compatibility with
10033 Solaris 9 yacc.
10034
10035 * src/parse-gram.y (add_param): 2nd arg is now char * not char
10036 const *, since it is now modified by stripping surrounding { }.
10037 (current_braced_code): Remove.
10038 (PERCENT_DESTRUCTOR, PERCENT_PRINTER, PERCENT_UNION,
10039 PERCENT_LEX_PARAM, PERCENT_PARSE_PARAM): Change names to include
10040 trailing " {...}". Now of type <chars>.
10041 (grammar_declaration): Adjust to bundled tokens.
10042 (code_content): Remove; stripping is now done by add_param.
10043 (print_token_value): Print contents of bundled tokens.
10044 (token_name): New function.
10045
10046 * src/reader.h (braced_code, current_braced_code): Remove.
10047 (token_name): New decl.
10048
10049 * src/scan-gram.l (handle_dollar, handle_at): Now takes int
10050 token_type, not braced_code code_kind. All uses changed.
10051 (SC_PRE_CODE): New state, for scanning after a keyword that
10052 has (or usually has) an immediately-following braced code.
10053 (token_type): New local var, to keep track of which token type
10054 to return when scanning braced code.
10055 (<INITIAL>"%destructor", <INITIAL>"%lex-param",
dc546b0f 10056 <INITIAL>"%parse-param", <INITIAL>"%printer",
33167b8b
PE
10057 <INITIAL>"%union"): Set token type and BEGIN SC_PRE_CODE
10058 instead of returning a token type immediately.
10059 (<INITIAL>"{"): Set token type.
10060 (<SC_BRACED_CODE>"}"): Use it.
10061 (handle_action_dollar, handle_action_at): Now returns bool
10062 indicating success. Fail if ! current_rule; this prevents a core dump.
10063 (handle_symbol_code_dollar, handle_symbol_code_at):
10064 Remove; merge body into caller.
10065 (handle_dollar, handle_at): Complain in invalid contexts.
10066
10067 * NEWS, doc/bison.texinfo: Document the above.
10068 * NEWS: Fix years and program names in copyright notice.
10069
879ca4f8
PE
100702002-12-17 Paul Eggert <eggert@twinsun.com>
10071
10072 * NEWS, doc/bison.texinfo (Parser Function, Pure Calling, Error
10073 Reporting, Table of Symbols): Omit mentions of %lex-param and
10074 %parse-param from the documentation for now.
10075
1c5fe69d
PE
100762002-12-15 Paul Eggert <eggert@twinsun.com>
10077
10078 Undo most of the 2002-11-12 yychar -> yytoken patch, as it broke
10079 GCC 3.2.1 (which depends on yychar == YYEMPTY when there is no
10080 lookahead symbol, and which sets yychar in parser actions) and it
7ea9026a
PE
10081 disagreed with the Bison documentation. Bug
10082 reported by Andrew Walrond.
d600ee67 10083
1c5fe69d
PE
10084 * data/yacc.c (YYTRANSLATE): Don't check for negative argument,
10085 as the caller now does that.
10086 (yyclearin, YYBACKUP, yyparse): Use yychar, not yytoken.
10087 (YYEMPTY): Parenthesize right hand side, since others use it.
10088 (yyparse): Don't assume that our generated code is the only code
10089 that sets yychar.
10090
d1de5372
PE
100912002-12-13 Paul Eggert <eggert@twinsun.com>
10092
10093 Version 1.75d.
10094
10095 POSIX requires a "yacc" command.
10096 * src/Makefile.am (bin_SCRIPTS): New macro, for yacc.
10097 (MOSTLYCLEANFILES): Add yacc.
10098 (yacc): New rule.
1c5fe69d 10099 * doc/bison.texinfo (Invocation, Bison Options): Mention yacc
d1de5372
PE
10100 as an alias for bison y.
10101
10102 * po/LINGUAS: Add da.
d600ee67 10103
d1de5372
PE
10104 * src/getargs.c (__GNU_LIBRARY__) [lint]: Define to work around
10105 problem with latest <getopt.h>.
10106 (HACK_FOR___GNU_LIBRARY___PROTOTYPE): New macro.
10107
10108 * doc/fdl.texi: Upgrade to 1.2.
10109 * lib/alloca.c, lib/error.c, lib/getopt.c, lib/getopt.h
10110 lib/getopt1.c, lib/gettext.h, lib/memrchr.c, lib/obstack.c,
10111 lib/obstack.h, lib/strnlen.c, lib/unlocked-io.h: Sync with
10112 gnulib.
10113 * config/install-sh: Sync with autotools.
10114
10115 Fix a bad interaction with flex 2.5.23 reported by Bruce Lilly in
161a71f3 10116 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
d1de5372
PE
10117 * data/yacc.c (YYLTYPE, struct yyltype): Do not define unless
10118 locations are requested.
10119 (union yyalloc): Do not depend on YYLTYPE_IS_TRIVIAL unless
10120 locations are requested.
10121
d0f3fe23
PE
101222002-12-12 Paul Eggert <eggert@twinsun.com>
10123
10124 Remove unportable casts and storage allocation tricks.
10125 While we're at it, remove almost all casts, since they
10126 usually aren't needed and are a sign of trouble.
10127
10128 * configure.ac (AC_CHECK_TYPES): Check for uintptr_t.
10129
10130 * src/derives.c (derives_compute): Do not subtract NTOKENS from
10131 the pointer DSET returned by malloc; this isn't portable.
10132 Instead, always use DSET[i - NTOKENS] rather than DSET[i].
10133 Similarly for DERIVES.
10134 * src/lalr.c (set_goto_map): Likewise, for GOTO_MAP and TEMP_MAP.
10135 * src/nullable.c (nullable_compute): Likewise, for RSETS and NULLABLE.
10136 * src/reduce.c (reduce_grammar_tables): Likewise, for nontermmap
10137
10138 * src/derives.c (derives_compute): Do not bother invoking
10139 int_of_rule_number, since rule numbers are integers.
10140
10141 * src/files.c (concat2, tr, compute_base_name): Use xmalloc (N)
10142 rather than XMALLOC (char, N).
10143
10144 * src/files.c (filename_split): Rewrite to avoid cast.
10145
10146 * src/gram.h (symbol_number_as_item_number,
10147 item_number_as_symbol_number, rule_number_as_item_number,
10148 item_number_as_rule_number):
10149 Now inline functions rather than macros, to avoid casts.
10150 * src/state.h (state_number_as_int): Likewise.
10151 * src/tables.c (state_number_to_vector_number,
10152 symbol_number_to_vector_number): Likewise.
10153
10154 * src/gram.h (int_of_rule_number): Remove; no longer used.
10155
10156 * src/lalr.c (add_lookback_edge): Use malloc rather than calloc,
10157 since the resulting storage is always stored into.
10158
10159 * src/main.c (alloca) [C_ALLOCA]: Add decl here, the only place
10160 where it's needed.
10161
10162 * src/muscle_tab.c (muscle_m4_output):
10163 Now inline. Return bool, not int.
10164 * src/state.c (state_compare): Likewise.
10165 * src/symtab.c (symbol_check_defined,
10166 symbol_check_alias_consistency, symbol_pack, symbol_translation,
10167 hash_compare_symbol, hash_symbol):
10168 Likewise.
10169 * src/uniqstr.c (uniqstr_print): Likewise.
10170 * src/muscle_tab.c (muscle_m4_output_processor):
10171 New function, to avoid casts.
10172 * src/state.c (state_comparator, stage_hasher): Likewise.
10173 * src/symtab.c (symbol_check_defined_processor,
10174 symbol_check_alias_consistency_processor, symbol_pack_processor,
10175 symbol_translation_processor, hash_symbol_comparator,
10176 hash_symbol_hasher): Likewise.
10177 * src/uniqstr.c (uniqstr_print_processor): Likewise.
10178 * src/muscle_tab.c (muscles_m4_output):
10179 Use new functions instead of casting old functions unportably.
10180 * src/state.c (state_hash_new): Likewise.
10181 * src/symtab.c (symbols_new, symbols_do, symbols_check_defined,
10182 symbols_token_translations_init):
10183 Likewise.
10184 * src/uniqstr.c (uniqstrs_new, hash_initialize, uniqstrs_do): Likewise.
10185
10186 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): Use long local
10187 var instead of casting to long, to avoid casts.
10188 (prepare_states): Use MALLOC rather than alloca, so that we don't
10189 have to worry about alloca.
10190 * src/state.c (state_hash_lookup): Likewise.
10191
10192 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>"'"): Use unsigned char
10193 local var instead of casting to unsigned char, to avoid casts.
10194
10195 * src/state.c (TRANSITIONS_ALLOC, ERRS_ALLOC, REDUCTIONS_ALLOC,
10196 STATE_ALLOC): Remove.
10197 (transitions_new, errs_new, reductions_new, state_new): Use malloc
10198 rather than calloc, and use offsetof to avoid allocating slightly
10199 too much storage.
10200 (state_new): Initialize all members.
10201
10202 * src/state.c (state_hash): Use unsigned accumulator, not signed.
10203
10204 * src/symtab.c (symbol_free): Remove; unused.
10205 (symbol_get): Remove cast in lhs of assignment.
10206 (symbols_do): Now static. Accept generic arguments, not
10207 hashing-related ones.
10208
10209 * src/symtab.h: (NUMBER_UNDEFINED): Remove unnecessary cast.
10210 (symbol_processor): Remove.
10211 (symbols_do): Remove decl; now static.
10212
10213 * src/system.h (alloca): Remove; decl no longer needed.
10214 (<stddef.h>): Include, for offsetof.
10215 (<inttypes.>, <stdint.h>): Include if available.
10216 (uintptr_t): New type, if system lacks it.
10217 (CALLOC, MALLOC, REALLOC): New macros.
10218 All uses of XCALLOC, XMALLOC, and XREALLOC changed to use these
10219 new macros.
10220
10221 * src/tables.c (table_size): Now int, to pacify GCC.
10222 (table_grow, table_ninf_remap): Use signed table size.
10223 (save_row): Don't bother initializing locals when not needed.
10224 (default_goto, goto_actions, pack_vector): Remove unnecessary casts.
10225 * src/uniqstr.c (hash_compare_uniqstr): Likewise.
10226
10227 * src/vcg.h: Correct misspellings.
10228
10229 * src/vcg_defaults.h (G_CMAX): Now INT_MAX.
10230
10231
10232 * src/getargs.c (getargs): Don't assume EOF == -1.
10233
26b4a969
PE
102342002-12-09 Paul Eggert <eggert@twinsun.com>
10235
10236 Change identifier spellings to avoid collisions with names
10237 that are reserved by POSIX.
10238
10239 Don't use names ending in _t, since POSIX reserves them.
10240 For consistency, remove _e and _s endings -- they're weren't
10241 needed to remove ambiguity. All uses changed.
10242 * src/uniqstr.h (uniqstr): Renamed from uniqstr_t, which in
10243 turn was just renamed from struniq_t.
10244 * src/uniqstr.c (uniqstr_processor): Renamed from struniq_processor,
10245 which in turn was just renamed from struniq_processor_t.
10246 (hash_compare_uniqstr): Renamed from hash_compare_struniq, which
10247 in turn was renamed from hash_compare_struniq_t.
10248 * src/LR0.c (struct state_list): Renamed from struct state_list_s.
10249 (state_list): Renamed from state_list_t.
10250 * src/assoc.h (assoc): Renamed from assoc_t.
10251 * src/conflicts.c (enum conflict_resolution): Renamed from
10252 enum conflict_resolution_e.
10253 * src/derives.c (struct rule_list): Renamed from struct rule_list_s.
10254 (rule_list): Renamed from rule_list_t.
10255 * src/getargs.h (enum trace): Renamed from enum trace_e.
10256 (enum report): Renamed from enum report_e.
10257 * src/gram.h (item_number): Renamed from item_number_t.
10258 (rule_number): Renamed from rule_number_t.
10259 (struct rule_s): Remove the "rule_s" part; not used.
10260 (rule): Renamed from rule_t.
10261 (rule_filter): Renamed from rule_filter_t.
10262 * src/lalr.c (struct goto_list): Renamed from struct goto_list_s.
10263 (goto_list): Renamed from goto_list_t.
10264 * src/lalr.h (goto_number): Renamed from goto_number_t.
10265 * src/location.h (location): Renamed from location_t.
10266 * src/muscle_tab.c (muscle_entry): Renamed from muscle_entry_t,
10267 and moved here from:
10268 * src/muscle_tab.h (muscle_entry_t): here.
10269 * src/nullable.c (struct rule_list): Renamed from struct rule_list_s.
10270 (rule_list): Renamed from rule_list_t.
10271 * src/print_graph.c (static_graph): Renamed from graph.
10272 * src/reader.h (braced_code): Renamed from braced_code_t.
10273 Remove brace_code_e tag.
10274 * src/relation.h (relation_node): Renamed from relation_node_t.
10275 (relation_nodes): Renamed from relation_nodes_t.
10276 (relation): Renamed from relation_t.
10277 * src/state.h (state_number): Renamed from state_number_t.
10278 (struct state): Renamed from struct state_s.
10279 (state): Renamed from state_t.
10280 (transitions): Renamed from transitions_t. Unused (and
10281 misspelled) transtion_s tag removed.
10282 (errs): Renamed from errs_t. Unused errs_s tag removed.
10283 (reductions): Renamed from reductions_t. Unused tag
10284 reductions_s removed.
10285 * src/symlist.h (symbol_list): Renamed from symbol_list_t.
10286 (struct symbol_list): Renamed from struct symbol_list_s.
10287 * src/symtab.h (symbol_number): Renamed from symbol_number_t.
10288 (struct symbol): Renamed from struct symbol_s.
10289 (symbol): Renamed from symbol_t.
10290 * src/tables.c (vector_number): Renamed from vector_number_t.
10291 (action_number): Renamed from action_t.
10292 * src/tables.h (base_number): Renamed from base_t.
10293 * src/vcg.h (enum color): Renamed from enum color_e.
10294 (enum textmode): Renamed from enum textmode_e.
10295 (enum shape): Renamed from enum shape_e.
10296 (struct colorentry): Renamed from struct colorentry_s.
10297 (struct classname): Renamed from struct classname_s.
10298 (struct infoname): Renamed from struct infoname_s.
10299 (enum layoutalgorithm): Renamed from enum layoutalgorithm_e.
10300 (enum decision): Renamed from enum decision_e.
10301 (enum orientation): Renamed from enum orientation_e.
10302 (enum alignment): Renamed from enum alignment_e.
10303 (enum arrow_mode): Renamed from enum arrow_mode_e.
10304 (enum crossing_type): Renamed from enum crossing_type_e.
10305 (enum view): Renamed from enum view_e.
10306 (struct node): Renamed from struct node_s.
10307 (node): Renamed from node_t.
10308 (enum linestyle): Renamed from enum linestyle_e.
10309 (enum arrowstyle): Renamed from enum arrowstyle_e.
10310 (struct edge): Renamed from struct edge.
10311 (edge): Renamed from edge_t.
10312 (struct graph): Renamed from struct graph_s.
10313 (graph): Renamed from graph_t.
10314 * tests/calc.at (_AT_DATA_CALC_Y, Simple LALR Calculator):
10315 Rename value_t -> value.
10316 * tests/input.at (Torturing the Scanner): Rename value_t -> value,
10317 value_t_as_yystype -> value_as_yystype.
10318
10319 Don't include <errno.h> in the mainstream code, since it
10320 reserves E[A-Z0-9]* and we want to use symbols like 'EQUALS'.
10321 * lib/get-errno.c, lib/get-errno.h: New files.
10322 * lib/Makefile.am (libbison_a_SOURCES): Add get-errno.h,
10323 get-errno.c.
10324 * src/files.c (xfopen, xfclose): Use get_errno instead of errno.
10325 * src/output.c (output_skeleton): Likewise.
10326 * src/scan-gram.l (<INITIAL>{int}): Use set_errno and get_errno
10327 instead of errno.
10328 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>\\x[0-9abcdefABCDEF]+):
10329 Likewise.
10330 (handle_action_dollar, handle_action_at): Likewise.
10331 * src/system.h: Do not include <errno.h>.
10332 (TAB_EXT): Renamed from EXT_TAB.
10333 (OUTPUT_EXT): Renamed from EXT_OUTPUT.
10334
10335 Avoid str[a-z]*, since <string.h> reserves that name space.
10336 Change all instances of "struniq" in names to "uniqstr", and
10337 likewise for "STRUNIQ" and "UNIQSTR".
10338 * src/uniqstr.c: Renamed from src/struniq.c.
10339 * src/uniqstr.h: Renamed from src/struniq.h.
10340 * src/Makefile.am (bison_SOURCES): Adjust to these renamings.
10341 * src/files.c (strsuffix): Remove; unused.
10342 (concat2): Renamed from stringappend. Now static.
10343 * src/files.h (strsuffix, stringappend): Remove; unused.
10344 * src/parse-gram.y (<chars>): Renamed from <string>.
10345 (<uniqstr>): Renamed from <struniq>.
10346 * src/scan-gram.l (obstack_for_string): Renamed from string_obstack.
10347 * src/vcg.h (struct node_s.expand): Renamed from struct node_s.stretch.
10348 (struct graph_s.expand): Renamed from struct graph_s.stretch.
10349 * src/vcg_defaults.h (G_EXPAND): Renamed from G_STRETCH.
10350 (G_LONG_STRAIGHT_PHASE): Renamed from G_STRAIGHT_PHASE.
10351 (N_EXPAND): Renamed from N_STRETCH.
10352
10353 Avoid *_MAX and *_MIN, since <limits.h> reserves that name space.
10354 * data/yacc.c (YYSTACK_GAP_MAXIMUM): Renamed from YYSTACK_GAP_MAX.
10355 * src/gram.h (ITEM_NUMBER_MAX, ITEM_NUMBER_MIN, RULE_NUMBER_MAX):
10356 Remove; unused.
10357 * src/lalr.h (GOTO_NUMBER_MAXIMUM): Renamed from GOTO_NUMBER_MAX.
10358 * src/state.h (STATE_NUMBER_MAXIMUM): Renamed from STATE_NUMBER_MAX.
10359 * src/symtab.h (SYMBOL_NUMBER_MAXIMUM): Renamed from SYMBOL_NUMBER_MAX.
10360 * src/tables.c (VECTOR_NUMBER_MAX, VECTOR_NUMBER_MIN): Remove; unused.
10361 (BASE_MAXIMUM): Renamed from BASE_MAX.
10362 (BASE_MINIMUM): Renamed from BASE_MIN.
10363 (ACTION_MAX): Remove; unused.
10364 (ACTION_NUMBER_MINIMUM): Renamed from ACTION_MIN.
10365 Unnecessary casts removed from above defines.
10366
10367
10368 Fix misspelling in names.
10369 * src/vcg.h (enum_alignment_e): Renamed from enum_alignement_e.
10370 * src/vcg_defaults.h (G_NODE_ALIGNMENT): Renamed from
10371 G_NODE_ALIGNEMENT.
10372
10373
10374 * lib/timevar.c (timevar_report): Renamed from time_report,
10375 for consistency with other names.
10376 * lib/timevar.h (timevar_report): New decl.
10377 * src/system.h (time_report): Remove; decl is now in lib/timevar.h.
10378
10379
10380 Sort include-file uses.
10381
10382 Reorder all include files under src to be in the order "system.h".
10383 then the ../lib include files in angle brackets (alphabetized),
10384 then the . include files in double-quotes (alphabetized). Fix
10385 dependency breakages encountered in this process, as follows:
10386 * src/closure.h, src/derives.h, src/state.h: Include "gram.h".
10387 * src/complain.c: Don't include stdlib.h, string.h _LIBC stuff.
10388 * src/state.h: Include "symtab.h".
10389
996b1c7e
PE
103902002-12-08 Paul Eggert <eggert@twinsun.com>
10391
10392 * data/glr.c, data/lalr1.cc, data/yacc.c: Do not use __file__,
10393 since this causes problems when __file__ contains character
10394 sequences like "@" that are treated specially by src/scan-skel.l.
10395 Instead, just use the file's basename. This fixes the bug
10396 reported by Martin Mokrejs in
161a71f3 10397 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00007.html>.
996b1c7e 10398
e19c4e5d
PE
103992002-12-06 Paul Eggert <eggert@twinsun.com>
10400
10401 Add support for rules that do not have trailing semicolons, as
10402 POSIX requires. Improve the quality of locations in Bison
10403 diagnostics.
26b4a969 10404
e19c4e5d
PE
10405 * src/location.c: Include <quotearg.h>.
10406 (empty_location): Now const.
10407 (location_print): New function. Follow the recommendation of the
10408 GNU Coding Standards for locations that span file boundaries.
10409 * src/location.h: Do not include <quotearg.h>; no longer needed.
10410 (boundary): New type.
10411 (location_t): Use it. This allows locations to span file boundaries.
10412 All member uses changed: file -> start.file or end.file (as needed),
10413 first_line -> start.line, first_column -> start.column,
10414 last_line -> end.line, last_column -> end.column.
10415 (equal_boundaries): New function.
10416 (LOCATION_RESET, LOCATION_STEP): Remove.
10417 (LOCATION_PRINT): Remove. All callers changed to use location_print.
10418 (empty_location): Now const.
10419 (location_print): New decl.
10420 * src/parse-gram.y (lloc_default): New function, which handles
10421 empty locations more accurately.
10422 (YYLLOC_DEFAULT): Use it.
10423 (%token COLON): Remove.
10424 (%token ID_COLON): New token.
26b4a969 10425 (rules): Use it.
e19c4e5d
PE
10426 (declarations, rules): Remove trailing semicolon.
10427 (declaration, rules_or_grammar_declaration):
10428 Allow empty (";") declaration.
10429 (symbol_def): Remove empty actions; no longer needed.
10430 (rules_or_grammar_declaration): Remove trailing semicolon.
10431 (semi_colon.opt): Remove.
10432 * src/reader.h: Include location.h.
10433 (scanner_cursor): New decl.
10434 * src/reduce.c (nonterminals_reduce): Use warn_at rather than
10435 rolling our own.
10436 * src/scan-gram.l (YY_USER_INIT): Initialize scanner_cursor instead
10437 of *loc.
10438 (STEP): Remove. No longer needed, now that adjust_location does
10439 the work. All uses removed.
10440 (scanner_cursor): New var.
10441 (adjust_location): Renamed from extend_location. It now sets
10442 *loc and adjusts the scanner cursor. All uses changed.
10443 Don't bother testing for CR.
10444 (handle_syncline): Remove location arg; now updates scanner cursor.
10445 All callers changed.
10446 (unexpected_end_of_file): Now accepts start boundary of token or
10447 comment, not location. All callers changed. Update scanner cursor,
10448 not the location.
10449 (SC_AFTER_IDENTIFIER): New state.
10450 (context_state): Renamed from c_context. All uses changed.
10451 (id_loc, code_start, token_start): New local vars.
10452 (<INITIAL,SC_AFTER_IDENTIFIER>): New initial context. Move all
10453 processing of Yacc white space and equivalents here.
10454 (<INITIAL>{id}): Save id_loc. Begin state SC_AFTER_IDENTIFIER
10455 instead of returning ID immediately, since we need to search for
10456 a subsequent colon.
10457 (<INITIAL>"'", "\""): Save token_start.
10458 (<INITIAL>"%{", "{", "%%"): Save code_start.
10459 (<SC_AFTER_IDENTIFIER>): New state, looking for a colon.
10460 (<SC_YACC_COMMENT>, <SC_COMMENT>, <SC_LINE_COMMENT>):
10461 BEGIN context_state at end, not INITIAL.
10462 (<SC_ESCAPED_STRING>"\"", <SC_ESCAPED_CHARACTER>"'",
10463 <SC_BRACED_CODE>"}", <SC_PROLOGUE>"%}", <SC_EPILOGUE><<EOF>>):
10464 Return correct token start.
10465 (<SC_BRACED_CODE,SC_PROLOGUE,SC_EPILOGUE>): Save start boundary when
10466 the start of a character, string or multiline comment is found.
10467 * tests/conflicts.at (S/R in initial, Defaulted Conflicted
10468 Reduction): Adjust reported locations to match the more-precise
10469 results now expected.
10470 * tests/input.at (Invalid $n, Invalid @n, Type Clashes): Likewise.
10471 * tests/reduce.at (Useless Rules, Reduced Automaton,
10472 Underivable Rules): Likewise.
10473 * tests/regression.at (Invalid inputs): No longer `expecting ";"
10474 or "|"' now that so many other tokens are allowed by the new grammar.
10475
10476 * src/complain.h (current_file): Remove duplicate decl;
10477 current_file is now owned by files.h.
10478 * src/complain.c, src/scan-gram.l: Include files.h.
10479
104802002-12-06 Paul Eggert <eggert@twinsun.com>
26b4a969 10481
e19c4e5d
PE
10482 * data/glr.c (yy_reduce_print): Don't assume that yyrline[yyrule]
10483 promotes to int; it might be unsigned int.
10484 * data/yacc.c (yy_reduce_print): Likewise.
10485
10486 * doc/bison.texinfo (Table of Symbols): YYERROR_VERBOSE should
10487 be #defined in the prologue, not in the Bison declarations.
10488 This fixes Debian Bug 102878, reported by Shaul Karl.
26b4a969 10489
b64755e3
PE
104902002-12-02 Paul Eggert <eggert@twinsun.com>
10491
10492 * configure.ac (AC_REPLACE_FUNCS): Add strtoul.
10493 * lib/strtoul.c: New file, from gnulib.
10494 This fixes a porting bug reported by Peter Klein in
161a71f3 10495 <http://lists.gnu.org/archive/html/bug-bison/2002-12/msg00000.html>.
b64755e3 10496
6e746484
PE
104972002-11-30 Paul Eggert <eggert@twinsun.com>
10498
b64755e3
PE
10499 * src/scan-gram.l (no_cr_read, extend_location): Move to epilogue,
10500 and put only a forward declaration in the prologue. This is for
10501 consistency with the other scanner helper functions.
10502
6ba55592
PE
10503 Type clashes now generate warnings, not errors, since it
10504 appears that POSIX may allow some grammars with type clashes.
10505 * src/reader.c (grammar_current_rule_check): Warn about
10506 type clashes instead of complaining.
10507 * tests/input.at (Type Clashes): Expect warnings, not complaints.
10508
6e746484
PE
10509 Add Yacc library, since POSIX requires it.
10510 * doc/bison.texinfo (Yacc Library): New node. Regenerate top menu.
10511 * lib/Makefile.am (lib_LIBRARIES, liby_a_SOURCES): New macros.
10512 * lib/main.c, lib/yyerror.c: New files.
10513
10514 gram_error can be static; it need not be extern.
10515 * src/reader.h (gram_error): Remove decl.
10516 * src/parse-gram.y (gram_error): Now static. Add static decl.
10517 (print_token_value): Omit parameter names from forward decl,
10518 for consistency.
10519
88510f9c
PE
105202002-11-29 Paul Eggert <eggert@twinsun.com>
10521
6e746484
PE
10522 * doc/bison.texinfo: Emphasize that yylex and yyerror must
10523 be declared before being used. E.g., one should typically
10524 declare them in the prologue. Use GNU coding style in examples.
10525 Put "const" consistently after the type it modifies. Mention
10526 that C99 supports "inline". Mention that yyerror traditionally
10527 returns "int".
10528
88510f9c
PE
10529 %parse-param and %lex-param now take just one argument, the
10530 declaration; the argument name is deduced from the declaration.
10531
10532 * doc/bison.texinfo (Parser Function, Pure Calling, Error
10533 Reporting, Table of Symbols): Document this.
10534 * src/parse-gram.y (add_param): New function.
10535 (COMMA): Remove.
10536 (declaration): Implement new rule for %parse-param and %lex-param.
10537 * src/scan-gram.l: "," now elicits a warning, rather than being
10538 a token; this is more compatible with byacc.
10539 * tests/calc.at (Simple LALR Calculator): Adopt new convention.
10540
bb92250c
PE
105412002-11-27 Paul Eggert <eggert@twinsun.com>
10542
10543 Rename identifiers to avoid real and potential collisions.
10544
10545 * data/c.m4 (b4_yysymprint_generate): yyout -> yyoutput,
10546 to avoid collision with lex macro described by Bruce Lilly in
161a71f3 10547 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00114.html>.
bb92250c
PE
10548 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise.
10549 * doc/bison.texinfo (Prologue, Tracing): yyprint -> print_token_value.
10550 * src/parse-gram.y (print_token_value): Renamed from yyprint.
10551 All uses changed.
10552 (YYPARSE_PARAM, YYLEX_PARAM, yycontrol): Remove. All uses changed.
10553 The name "yycontrol" violates the name space rules, and this stuff
10554 wasn't being used anyway.
10555 (input): Remove action; this stuff wasn't being used.
10556 (gram_error): Rename local variable yylloc -> loc.
10557 * src/reader.h (struct gram_control_s, gram_control_t): Remove.
10558 (YY_DECL): Don't use "yy" at start of local variables.
10559 All uses changed, e.g., yylloc -> loc.
10560 * src/scan-gram.l (STEP): Renamed from YY_STEP. All uses changed.
10561 (STRING_GROW): Renamed from YY_OBS_GROW. All uses changed.
10562 (STRING_FINISH): Renamed from YY_OBS_FINISH. All uses changed.
10563 (STRING_FREE): Renamed from YY_OBS_FREE. All uses changed.
10564
10565 * src/parse-gram.y (gram_error): loc is now const *.
10566 * src/reader.h (gram_error): Likewise.
10567
3af4feb2
PE
105682002-11-24 Paul Eggert <eggert@twinsun.com>
10569
10570 Version 1.75c.
10571
10572 * tests/actions.at (Actions after errors): Use an output format
10573 more similar to that of the Printers and Destructors test.
10574 Test the position of the ';' token too.
10575 (Printers and Destructors): Likewise.
10576 (Printers and Destructors: %glr-parser): Remove for now, to avoid
10577 unnecessarily alarming people when the test fails.
10578
10579 * data/yacc.c (yyerrlab1): Move this label down, so that the
10580 parser does not discard the lookahead token if the user code
10581 invokes YYERROR. This change is required for POSIX conformance.
10582
10583 * lib/error.c: Sync with gnulib.
10584
105852002-11-22 Paul Eggert <eggert@twinsun.com>
10586
10587 * lib/quotearg.c, lib/quotearg.h: Sync with gnulib.
10588 * lib/mbswidth.c, lib/mbswidth.h: Likewise.
10589 * lib/xmalloc.c: Likewise.
26b4a969 10590
58004308
PE
105912002-11-20 Paul Eggert <eggert@twinsun.com>
10592
10593 * lib/argmatch.c, lib/argmatch.h: Sync with gnulib.
10594
105952002-11-20 Paul Eggert <eggert@twinsun.com>
26b4a969 10596
58004308
PE
10597 Avoid use of <assert.h>, as the GNU Coding Standards hint that one
10598 should use `if (! x) abort ();' rather than `assert (x);', and
10599 anyway it's one less thing to worry about configuring.
10600
10601 * data/glr.c, lib/hash.c, src/system.h: Do not include <assert.h>.
10602 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Likewise,
10603 and replace all instances of assert with abort.
10604 * tests/calc.at (_AT_DATA_CALC_Y): Likewise.
10605 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): Likewise.
10606
10607 * data/glr.c (yydoAction, yyglrReduce, yysplitStack, yyresolveStates,
10608 yyresolveAction, yyprocessOneStack): Use abort rather than assert.
10609 * lib/hash.c (hash_lookup, hash_get_first, hash_get_next,
10610 hash_find_entry, hash_rehash, hash_insert): Likewise.
10611 * src/conflicts.c (resolve_sr_conflict): Likewise.
10612 * src/lalr.c (set_goto_map, map_goto): Likewise.
10613 * src/nullable.c (nullable_compute): Likewise.
10614 * src/output.c (prepare_rules, token_definitions_output): Likewise.
10615 * src/reader.c (packgram, reader): Likewise.
10616 * src/state.c (state_new, state_free, state_transitions_set,
10617 state_reduction_find): Likewise.
10618 * src/symtab.c (symbol_user_token_number_set, symbol_make_alias,
10619 symbol_pack): Likewise.
10620 * src/tables.c (conflict_row, pack_vector): Likewise.
10621 * src/vcg.c (get_color_str, get_textmode_str, get_shape_str,
10622 get_layoutalgorithm_str, get_decision_str, get_orientation_str,
10623 get_node_alignement_str, get_arrow_mode_str, get_crossing_type_str,
10624 get_view_str, get_linestyle_str, get_arrowstyle_str): Likewise.
10625
10626 * lib/argmatch.h (ARRAY_CARDINALITY): Do not bother to #undef.
10627 (ARGMATCH_CONSTRAINT): New macro.
10628 (ARGMATCH_ASSERT): Use it.
10629
10630 * src/system.h (verify): New macro.
10631 * src/getargs.c (trace_argmatch, report_argmatch): Use verify
10632 rather than assert.
10633 * src/tables.c (tables_generate): Likewise.
10634
10635 * src/struniq.c (struniq_assert): Now returns void, and aborts
10636 if the assertion is false.
10637 (struniq_assert_p): Remove.
10638 * src/struniq.h: Likewise.
10639
76ae8198
PE
106402002-11-18 Paul Eggert <eggert@twinsun.com>
10641
10642 * data/glr.c (yygetLRActions): Replace `yyindex' with
10643 `yytable[yyindex]' to fix typo introduced in my 2002-11-09 patch.
10644 This fixes the regression with Sun ONE Studio 7 cc that I reported in
161a71f3 10645 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00077.html>.
76ae8198 10646
d3c4e709
AD
106472002-11-18 Akim Demaille <akim@epita.fr>
10648
10649 * doc/bison.texinfo (Tracing): `yyprint' shouldn't prepend a
10650 space.
10651 From Tim Van Holder.
10652
8d8a7238
PE
106532002-11-17 Paul Eggert <eggert@twinsun.com>
10654
10655 Pacify Sun ONE Studio 7 lint. Also, rename "ParseError"
10656 to "SyntaxError" for consistency with my 2002-11-15 change.
10657
10658 * data/glr.c (YYDPRINTF, YYDSYMPRINT, YYDSYMPRINTF) [!YYDEBUG]: Do
10659 not define to {}, since this breaks the common use of `YYDPRINTF
10660 ((...));' if a single statement is desired (e.g. before `else').
10661 Work around GCC warnings by surrounding corresponding calls with
10662 {} if needed.
10663 (yyhasResolvedValue): Remove unused function.
10664 (yymergeOptionSets, yyresolvStack): Use `continue;' for empty
10665 loop body.
10666 (yyreportSyntaxError): Renamed from yyreportParseError.
10667 (yyrecoverSyntaxError): Renamed from yyrecoverParseError.
10668 All uses changed.
10669 * tests/calc.at (_AT_DATA_CALC_Y): Make vars static instead of
10670 extern when possible. Remove unused initializations.
10671
b0937b22
AD
106722002-11-16 Akim Demaille <akim@epita.fr>
10673
10674 Augment the similarity between GLR and LALR traces.
10675
10676 * data/yacc.c (yy_stack_print, YY_STACK_PRINT, yy_reduce_print)
10677 (YY_REDUCE_PRINT): New.
10678 (yyparse): Use them.
10679 * data/glr.c (yy_reduce_print): Use YYFPRINTF, no need for
10680 YYDPRINT here.
10681 (yyglrReduce, yyrecoverParseError, yyparse): Don't report the
10682 state reached after the reduction/recovery, since...
10683 (yyparse, yyprocessOneStack): Report the state we are entering in.
10684
c5e3e510
AD
106852002-11-16 Akim Demaille <akim@epita.fr>
10686
10687 * src/getargs.h, src/getargs.c (trace_e, trace_args, trace_types):
10688 Add support for --trace=skeleton.
10689 * src/scan-skel.l: %option debug.
10690 Scan strings of non-@ or \n instead of character by character.
10691 (scan_skel): Handle trace_skeleton.
10692 (QPUTS): New.
10693 (@output_parser_name@, @output_header_name@): ``Restore'' their
10694 support (used to be M4 macros).
10695 * data/yacc.c: Quote larger chunks, a la glr.c.
10696 * data/lalr1.cc: Likewise.
10697 The header guards are no longer available, so use some other
10698 string than `YYLSP_NEEDED'.
10699
4c6cc1db
AD
107002002-11-16 Akim Demaille <akim@epita.fr>
10701
10702 Make the ``Printers and Destructors'' test more verbose, taking
10703 `yacc.c''s behavior as (possibly wrong) reference.
10704
10705 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Use printf
10706 instead of fprint on stdout.
10707 Set and report the last_line of the symbols.
10708 Consistently display values and locations.
10709
6d9e8019
PE
107102002-11-16 Paul Eggert <eggert@twinsun.com>
10711
10712 * data/yacc.c: Avoid over-quoting of __line__ and __file__.
10713
6e649e65
PE
107142002-11-15 Paul Eggert <eggert@twinsun.com>
10715
b25d88f6
PE
10716 * tests/actions.at (Actions after errors): New test case.
10717
6e649e65
PE
10718 * data/glr.c, data/lalr1.cc, data/yacc.cc, doc/bison.texinfo,
10719 src/conflicts.c, src/parse-gram.y, src/tables.c, src/tables.h,
10720 tests/action.at, tests/calc.at, tests/conflicts.at,
10721 tests/cxx-type.at, tests/regression.at:
10722 "parse error" -> "syntax error" for POSIX compatibility.
10723 "parsing stack overflow..." -> "parser stack overflow" so
10724 that code matches Bison documentation.
10725
0f39aab9
AD
107262002-11-15 Akim Demaille <akim@epita.fr>
10727
10728 * src/parse-gram.y (declaration): Have %parse-param and %lex-param
10729 take two BRACED_CODE, not two string_content.
10730 Free the scanner's obstack when we are done.
10731 (code_content): New.
10732 * tests/calc.at: Adjust.
10733 * doc/bison.texinfo: Adjust.
10734 Also, make sure to include the `,' for these declarations.
10735
761c1926
AD
107362002-11-15 Tim Van Holder <tim.van.holder@pandora.be>
10737
10738 * m4/prereq.m4: Removed the commented jm_PREREQ_HASH
10739 definition; avoids potential autoreconf problems.
10740
b0f98b10
AD
107412002-11-15 Akim Demaille <akim@epita.fr>
10742
10743 Always check the value returned by yyparse.
10744
10745 * tests/calc.at (_AT_DATA_CALC_Y): Have `main' exit with the value
10746 returned by yyparse.
10747 (_AT_CHECK_CALC_ERROR): Take the expected exit value as argument.
10748 Adjust calls.
10749 * tests/glr-regr1.at (glr-regr1.y): Have `main' exit with the value
10750 returned by yyparse.
10751
970785f1
PH
107522002-11-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
10753
10754 * data/glr.c (yyFail): Always set yyerrflag. Corrects regression
10755 on input.at test.
10756
8fcc7db1
PE
107572002-11-14 Paul Eggert <eggert@twinsun.com>
10758
7ec1b48e
PE
10759 * src/output.c (output_skeleton): Call xfopen instead of
10760 duplicating xfopen's body.
10761
cfff7583 10762 Fix bugs reported by Nelson H. F. Beebe in
161a71f3 10763 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00078.html>.
cfff7583 10764
8fcc7db1
PE
10765 * tests/headers.at (AT_TEST_CPP_GUARD_H): Don't assume that
10766 "$CC -E foo.h" is allowed, as this doesn't work with the Portland
10767 Group compiler. Instead, use "$CC -E bar.c". Include the .h
10768 file twice in the grammar, as an extra check.
10769
10770 * tests/input.at (Torturing the Scanner): Surround the
10771 backslash-newline tests with "#if 0", to make it less likely that
10772 we'll run into compiler bugs. Bring back solitary \ inside
10773 comment, but add a closing comment to work around HP C bug. Don't
e3aa65c5 10774 test backslash-newline in C character constant.
8fcc7db1 10775
4e8d992c
AD
107762002-11-14 Akim Demaille <akim@epita.fr>
10777
10778 * tests/synclines.at (AT_SYNCLINES_COMPILE): Ignore the exit
10779 status of the compiler.
f32b346d 10780 Calling `exit 1' is no longer needed.
4e8d992c
AD
10781 Reported by Nelson H. F. Beebe.
10782
9501dc6e
AD
107832002-11-14 Akim Demaille <akim@epita.fr>
10784
10785 * tests/atlocal.in (CPPFLAGS): We have config.h.
10786 * tests/testsuite.at (AT_DATA_GRAMMAR_PROLOGUE, AT_DATA_GRAMMAR):
10787 New.
10788 * tests/actions.at, tests/calc.at, tests/conflicts.at,
10789 * tests/cxx-type.at, tests/glr-regr1.at, tests/headers.at,
10790 * tests/regression.at, tests/torture.at: Use them for all the
10791 grammars that are to be compiled.
10792 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Rename as...
10793 * tests/cxx-type.at (_AT_TEST_GLR_CXXTYPES): this.
10794 * doc/bison.texinfo (GLR Parsers): Document `inline'.
10795
18b519c0
AD
107962002-11-14 Akim Demaille <akim@epita.fr>
10797
10798 * doc/bison.texinfo: Various formatting changes (alignments in
10799 samples, additional @group/@end group, GCS in samples.
10800 Use @deffn instead of simple @table to define the directives,
10801 macros, variables etc.
10802
9a86cdb9
PE
108032002-11-13 Paul Eggert <eggert@twinsun.com>
10804
daa33def 10805 Fix some bugs reported by Albert Chin-A-Young in
161a71f3 10806 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00066.html>.
18b519c0 10807
daa33def 10808 * tests/input.at (Torturing the Scanner): Don't invoke "cc a.c b.c
8fcc7db1 10809 -o c"; the HP C compiler chatters during compilation.
daa33def
PE
10810 Instead, invoke "cc -c a.c -o a.o; cc -c b.c -o b.o; cc a.o b.o -o c".
10811 * tests/headers.at (export YYLTYPE): Likewise.
10812
10813 * tests/input.at (Torturing the Scanner): Remove lines containing
8fcc7db1 10814 solitary backslashes, as they tickle a bug in the HP C compiler.
daa33def 10815
9a86cdb9
PE
10816 * tests/glr-regr1.at (Badly Collapsed GLR States): Avoid //
10817 comments, since they're not portable. Use GNU coding style.
10818
9c1e26bd
AD
108192002-11-13 Akim Demaille <akim@epita.fr>
10820
10821 * data/yacc.c: Leave bigger chunks of quoted text.
10822 (YYDSYMPRINTF): New.
10823 Use it to report symbol activities.
10824 * data/glr.c (YYDSYMPRINTF): New.
10825 Use it.
10826
87f721cc
PE
108272002-11-12 Paul Eggert <eggert@twinsun.com>
10828
10829 Version 1.75b.
10830
10831 * data/glr.c (yydoAction): Return YYRESULTTAG, not int.
10832 (yyglrReduce): Return yyok, not 0.
10833 This should avoid the enumerated-type warnings reported
464c6927 10834 by Nelson H. F. Beebe in
161a71f3 10835 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00057.html>.
87f721cc
PE
10836
10837 * lib/bbitset.h (BITSET_INLINE): Remove.
10838 * lib/bitset.h [! BITSET_INLINE]: Remove.
10839 (bitset_set, bitset_reset, bitset_test): Rename local vars
10840 to avoid shadowing warnings by GCC.
10841
10842 * data/glr.c (inline): Remove #define. It's the user's
10843 responsibility to #define it away, just like 'const'.
464c6927 10844 This fixes one of the bugs reported by Nelson H. F. Beebe in
161a71f3 10845 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00058.html>.
18b519c0 10846
87f721cc
PE
10847 * Makefile.maint (po-check): Scan .l and .y files instead of the
10848 .c and the .h files that they generate. This fixes the bug
10849 reported by Tim Van Holder in:
161a71f3 10850 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00062.html>
87f721cc
PE
10851 Look for N_ as well as for _. Try to avoid matching #define for
10852 N_ and _.
10853 * po/POTFILES.in: Remove src/parse-gram.c, src/scan-gram.c,
10854 src/system.h. Add src/parse-gram.y, src/scan-gram.l.
10855 * src/scan-gram.l: Revamp regular expressions so that " and '
10856 do not confuse xgettext.
10857
10858 * src/struniq.h (struniq_new): Do not declare the return type
10859 to be 'const'; this violates the C standard.
10860 * src/struniq.c (struniq_new): Likewise.
10861
be14ade5
AD
108622002-11-12 Albert Chin-A-Young <china@thewrittenword.com>
10863
10864 * src/Makefile.am (LDADD): Link $(LIBINTL) last to avoid the
10865 duplicate definition of optind on Tru64 UNIX 4.0D with the Compaq
10866 linker.
10867
05291fbc
AD
108682002-11-12 Akim Demaille <akim@epita.fr>
10869
10870 * Makefile.maint: Sync with Autoconf:
10871 (local_updates): New.
10872
1f5fd52e
AD
108732002-11-12 Akim Demaille <akim@epita.fr>
10874
10875 * po/POTFILES.in (src/lalr.c, src/state.c): Remove
10876
283f1e64
AD
108772002-11-12 Akim Demaille <akim@epita.fr>
10878
10879 * tests/actions.at (_AT_CHECK_PRINTER_AND_DESTRUCTOR): Display the
10880 locations.
10881
886b69d1
AD
108822002-11-12 Akim Demaille <akim@epita.fr>
10883
10884 * data/c.m4 (b4_yysymprint_generate): Pass *yyvaluep to YYPRINT,
10885 not yyvalue.
10886
3df37415
AD
108872002-11-12 Akim Demaille <akim@epita.fr>
10888
10889 * tests/actions.at (AT_CHECK_PRINTER_AND_DESTRUCTOR): New.
10890 Use it to test the GLR parser.
10891
7bd6c77e
AD
108922002-11-12 Akim Demaille <akim@epita.fr>
10893
10894 * tests/regression.at (input.y): s/YYEOF/MYEOF/, as the skeleton
10895 defines it.
10896 * data/glr.c (yystos): New.
10897 (b4_yysymprint_generate, b4_yydestruct_generate): Invoke.
10898 (YYDSYMPRINT): New.
10899 (yyval): Don't define it, it is handled via M4.
10900 (yyrecoverParseError): Free verbosely the discarded symbols.
10901 * data/yacc.c (yysymprint): Remove, rather...
10902 (b4_yysymprint_generate): invoke.
10903 * data/c.m4 (b4_yysymprint_generate): New.
10904 Accept pointers as arguments, as opposed to the version from
10905 yacc.c.
10906 (b4_yydestruct_generate): Likewise.
10907 * tests/cations.at (Printers and Destructors): Use Bison directives
10908 instead of CPP macros.
10909 Don't rely on internal details.
10910
b0400cc6
AD
109112002-11-12 Akim Demaille <akim@epita.fr>
10912
10913 * data/c.m4 (b4_yydestruct_generate, b4_symbol_actions): New.
10914 * data/yacc.c: Rename yychar1 as yytoken, as in glr.c.
10915 Don't work on yychar (i.e., do set it to YYEMPTY, don't match
10916 it against YYEMPTY and so forth), work on yytoken (i.e., set
10917 it to YYEMPTY etc.).
10918 (yydestruct): Replace with a b4_yydestruct_generate invocation.
10919 (b4_symbol_actions): Remove.
10920 * data/glr.c (YYTRANSLATE): As for yacc.c, if negative, it stands
10921 for 0, end-of-input.
10922
72f889cc
AD
109232002-11-12 Akim Demaille <akim@epita.fr>
10924
10925 * doc/bison.texinfo (Destructor Decl): New.
10926
b1ae9233
AD
109272002-11-12 Akim Demaille <akim@epita.fr>
10928
10929 * src/tables.c (tables_generate): Use free for pointers that
10930 cannot be NULL, not XFREE.
10931 (pack_vector): Use assert, not fatal, for bound violations.
10932 * src/state.c (state_new): Likewise.
10933 * src/reader.c (reader): Likewise.
10934 * src/lalr.c (set_goto_map): Likewise.
72f889cc 10935 * src/location.h (LOCATION_PRINT): If first_line is 0, just issue
b1ae9233
AD
10936 the file name.
10937
7ec2d4cd
AD
109382002-11-12 Akim Demaille <akim@epita.fr>
10939
10940 * src/scan-gram.l, src/reader.h (scanner_last_string_free):
10941 Restore.
10942 * src/scan-gram.l (last_string): Is global to the file, not to
10943 yylex.
10944 * src/parse-gram.y (input): Don't append the epilogue here,
10945 (epilogue.opt): do it here, and free the scanner's obstack.
10946 * src/reader.c (epilogue_set): Rename as...
10947 (epilogue_augment): this.
10948 * data/c.m4 (b4_epilogue): Defaults to empty.
10949
573a6cd3
AD
109502002-11-12 Akim Demaille <akim@epita.fr>
10951
10952 * src/getargs.c (long_options): Remove duplicates.
10953 * src/vmsgetargs.c, src/build.com, src/bison.cld, src/vmshlp.mar:
10954 Remove.
10955 * doc/bison.rnh: Remove.
10956 * doc/bison.texinfo (VMS Invocation): Remove.
10957
95612cfa
AD
109582002-11-12 Akim Demaille <akim@epita.fr>
10959
10960 * src/struniq.h, src/struniq.c (struniq_t): Is const.
10961 (STRUNIQ_EQ, struniq_assert, struniq_assert_p): New.
10962
10963 Use struniq for symbols.
10964
10965 * src/symtab.h (symbol_t): The tag member is a struniq.
10966 (symbol_type_set): Adjust.
10967 * src/symtab.c (symbol_new): Takes a struniq.
10968 (symbol_free): Don't free the tag member.
10969 (hash_compare_symbol_t, hash_symbol_t): Rename as...
10970 (hash_compare_symbol, hash_symbol): these.
10971 Use the fact that tags as struniqs.
10972 (symbol_get): Use struniq_new.
10973 * src/symlist.h, src/symlist.c (symbol_list_n_type_name_get):
10974 Returns a strniq.
10975 * src/reader.h (merger_list, grammar_currentmerge_set): The name
10976 and type members are struniqs.
10977 * src/reader.c (get_merge_function)
10978 (grammar_current_rule_merge_set): Adjust.
10979 (TYPE, current_type): Are struniq.
10980
10981 Use struniq for file names.
10982
10983 * src/files.h, src/files.c (infile): Split into...
10984 (grammar_file, current_file): these.
10985 * src/scan-gram.c (YY_USER_INIT, handle_syncline): Adjust.
10986 * src/reduce.c (reduce_print): Likewise.
10987 * src/getargs.c (getargs): Likewise.
10988 * src/complain.h, src/complain.c: Likewise.
10989 * src/main.c (main): Call struniqs_new early enough to use it for
10990 file names.
10991 Don't free the input file name.
10992
3e6656f9
AD
109932002-11-12 Akim Demaille <akim@epita.fr>
10994
10995 * src/symtab.c (symbol_free): Remove dead deactivated code:
10996 type_name are properly removed.
10997 Don't use XFREE to free items that cannot be NULL.
10998 * src/struniq.h, src/struniq.c: New.
10999 * src/main.c (main): Initialize/free struniqs.
11000 * src/parse-gram.y (%union): Add astruniq member.
11001 (yyprint): Adjust.
11002 * src/scan-gram.l (<{tag}>): Return a struniq.
11003 Free the obstack bit that used to store it.
11004 * src/symtab.h (symbol_t): The 'type_name' member is a struniq.
11005
7672019c
PE
110062002-11-11 Paul Eggert <eggert@twinsun.com>
11007
11008 Revamp to fix many (but not all) of the C- and M4-related quoting
11009 problems. Among other things, this fixes the Bison bug reported
11010 by Jan Hubicka when processing the Bash grammar; see:
161a71f3 11011 <http://lists.gnu.org/archive/html/bison-patches/2002-11/msg00039.html>
7672019c
PE
11012
11013 Use new @ escapes consistently. Represent brackets with @{ and @}
11014 rather than @<:@ and @:>@, since this works a bit better with dumb
11015 editors like vi. Represent @ with @@, since @ is now consistently
11016 an escape. Use @oline@ and @ofile@ rather than __oline__ and
11017 __ofile__, to avoid unexpected expansions. Similarly, use @output
11018 rather than #output.
11019
11020 * data/c.m4 (b4_copyright): Omit file name from comment, since
11021 the file name could contain "*/".
11022 (b4_synclines_flag): Don't quote the 2nd argument; it should already
11023 be quoted. All uses changed.
11024
11025 * data/glr.c: Use new @ escapes consistently.
11026 (b4_input_suffix, b4_output_parser_suffix, b4_output_parser_name,
11027 b4_output_header_suffix, b4_output_header_name, b4_header_guard):
11028 Remove, since they couldn't handle arbitrary characters in file
11029 names.
11030 * data/lalr1.cc: Likewise.
11031 * data/yacc.c: Likewise.
11032
11033 * src/files.c (output_infix): Remove; all uses removed.
11034 * src/files.h: Likewise.
11035
11036 * data/glr.c: Remove use of "#ifdef b4_header_guard", since it
11037 mishandled funny characters in file names, and anyway it isn't
11038 needed any more.
11039 * data/yacc.c: Likewise.
11040 * data/lalr1.cc: Use YYSLP_NEEDED instead of b4_header_guard.
11041
11042 * data/glr.c (YYSTYPE_IS_TRIVIAL): Define when the .h file would.
11043 * data/yacc.c: Likewise.
11044
11045 * src/muscle_tab.c: Include quotearg.h, since we need to quote C
11046 strings now.
11047 (muscle_init): Quote filename as a C string.
11048 * src/muscle_tab.h (MUSCLE_GROW_STRING_PAIR): Remove; unused.
11049 (MUSCLE_OBSTACK_SGROW, MUSCLE_INSERT_C_STRING): New macros.
11050 * src/output.c (escaped_file_name_output): New function.
11051 (prepare_symbols): Quote tokens for M4.
11052 (prepare): Don't insert output_infix, output_prefix,
11053 output_parser_name, output_header_name; this is now down by scan-skel.
11054 Insert skeleton as a C string.
11055
11056 * src/output.c (user_actions_output, symbol_destructors_output,
11057 symbol_printers_output): Quote filenames for C and M4.
11058 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11059
11060 * src/scan-gram.l (<SC_CHARACTER>): Don't worry about any backslash
11061 escapes other than \\ and \'; this simplifies the code.
11062 (<SC_STRING>): Likewise, for \\ and \".
11063 (<SC_COMMENT,SC_LINE_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,
11064 SC_PROLOGUE,SC_EPILOGUE>): Escape $ and @, too.
11065 Use new escapes @{ and @} for [ and ].
11066
11067 * src/scan-skel.l (yylineno, yyoutname): Remove static vars, replacing
11068 them with auto vars.
11069 Switch to new escape scheme, where @ is the escape character uniformly.
11070 Abort if a stray escape character is found. Avoid unbounded input
11071 buffer when parsing non-escaped text.
11072
11073 * tests/input.at (Torturing the Scanner): Add tests that @oline@,
11074 __oline__, #output, $@, and @{ do not have unintended meanings.
11075
acea4f3b
PE
110762002-11-09 Paul Eggert <eggert@twinsun.com>
11077
11078 Fix the test failure due to GCC warnings described in
161a71f3 11079 <http://lists.gnu.org/archive/html/bug-bison/2002-11/msg00000.html>.
acea4f3b
PE
11080 * data/glr.c (yyis_pact_ninf, yyis_table_ninf): New macros, which
11081 evaluate to 0 if it's impossible for NINF to be in the respective
11082 table.
11083 (yygetLRActions, yyrecoverParseError): Use them.
11084
11085 * src/scan-gram.l (unexpected_end_of_file): Fix bug: columns were
11086 counted in the token inserted at end of file. Now takes
11087 location_t *, not location_t, so that the location can be
11088 adjusted. All uses changed.
11089
11090 * tests/regression.at (Invalid inputs): Adjust wording in
11091 diagnostic to match the new behavior.
11092
11093 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR,
11094 AT_DATA_HORIZONTAL_GRAMMAR, AT_DATA_LOOKAHEADS_GRAMMAR,
11095 AT_DATA_STACK_TORTURE): Replace `assert (x);' with `if (! (x))
11096 abort ();'. This reduces the runtime of the "Many lookaheads"
11097 test from 27.6 to 2.7 minutes on a 440 MHz Ultrasparc III running
11098 GCC 3.2.
11099
20ef1ad5
PE
111002002-11-07 Paul Eggert <eggert@twinsun.com>
11101
11102 * src/parse-gram.y (CHARACTER): Remove unused token.
11103 All uses removed.
11104
11105 * src/scan-gram.l: Remove stack option. We no longer use the
11106 stack, since the stack was never deeper than 1; instead, use the
11107 new auto var c_context to record the stacked value.
11108
11109 Remove nounput option. At an unexpected end of file, we now unput
11110 the minimal input necessary to end cleanly; this simplifies the
11111 code.
11112
11113 Avoid unbounded token sizes where this is easy.
11114
11115 (unexpected_end_of_file): New function.
11116 Use it to systematize the error message on unexpected EOF.
11117 (last-string): Now auto, not static.
11118 (YY_OBS_FREE): Remove unnecessary do while (0) wrapper.
11119 (scanner_last_string_free): Remove; not used.
11120 (percent_percent_count): Move decl to just before use.
11121 (SC_ESCAPED_CHARACTER): Return ID at unexpected end of file,
11122 not the (never otherwised-used) CHARACTER.
11123
93724f13
AD
111242002-11-07 Akim Demaille <akim@epita.fr>
11125
11126 Let yyerror always receive the msg as last argument, so that
11127 yyerror can be variadic.
11128
11129 * data/yacc.c (b4_yyerror_args): New.
11130 Use it when calling yyerror.
11131 * data/glr.c (b4_yyerror_args, b4_lyyerror_args): New.
11132 Use it when calling yyerror.
11133 * doc/bison.texinfo (Error Reporting): Adjust.
11134 * tests/calc.at (_AT_DATA_CALC_Y): Adjust.
11135 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Adjust.
11136
6e40b4eb
AD
111372002-11-06 Akim Demaille <akim@epita.fr>
11138
11139 #line should have quoted strings.
11140 Ideally, this should be done by m4_quotearg.
11141
11142 * src/scan-skel.l: Include quotearg.h.
11143 Quote __ofile__.
11144 * src/output.c (symbol_printers_output)
11145 (symbol_destructors_output): Quote the file name.
11146
2dfbfc12
AD
111472002-11-06 Akim Demaille <akim@epita.fr>
11148
11149 * tests/regression.at (Invalid inputs): Adjust to the recent
11150 messages.
11151
437c2d80
AD
111522002-11-06 Akim Demaille <akim@epita.fr>
11153
11154 Restore --no-lines.
11155 Reported by Jim Kent.
11156
11157 * data/c.m4 (b4_syncline): New.
11158 * data/glr.c, data/yacc.c, data/lalr1.cc: Use it.
11159 * src/reader.c (prologue_augment, epilogue_set): Use b4_syncline.
11160 * src/output.c (user_actions_output): Likewise.
11161 (prepare): Define 'b4_synclines_flag'.
2dfbfc12 11162 * src/muscle_tab.c (muscle_init): Don't define b4_linef.
437c2d80 11163
900c5db5
AD
111642002-11-06 Akim Demaille <akim@epita.fr>
11165
11166 * src/main.c (main): Free `infile'.
11167 * src/scan-gram.l (handle_syncline): New.
11168 Recognize `#line'.
11169 * src/output.c (user_actions_output, symbol_destructors_output)
11170 (symbol_printers_output): Use the location's file name, not
11171 infile.
11172 * src/reader.c (prologue_augment, epilogue_set): Likewise.
11173
e183b123 111742002-11-05 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
51b4a04c 11175
e183b123 11176 * src/tables.c (matching_state): Don't allow states to match if
51b4a04c 11177 either has GLR conflict entries.
e183b123 11178
193eb6b7
PE
111792002-11-05 Paul Eggert <eggert@twinsun.com>
11180
e183b123
PE
11181 * src/scan-gram.l: Use more accurate diagnostics, e.g.
11182 "integer out of range" rather than "invalid value".
11183 * tests/input.at (Invalid $n, Invalid @n): Change expected wording
11184 accordingly.
11185
193eb6b7
PE
11186 Scan <% and %> digraphs in C code as POSIX 1003.1-2001 requires.
11187 Also, remove one static variable in the scanner.
11188
11189 * src/scan-gram.l (braces_level): Now auto, not static.
11190 Initialize to zero if the compiler is being picky.
11191 (INITIAL): Clear braces_level instead of incrementing it.
11192 (SC_BRACED_CODE): Treat <% and %> as { and } when inside C code,
11193 as POSIX 1003.1-2001 requires.
11194 * src/system.h (IF_LINT): New macro, taken from coreutils.
11195 * configure.ac: Define "lint" if --enable-gcc-warnings.
11196
29c01725
AD
111972002-11-05 Akim Demaille <akim@epita.fr>
11198
11199 * src/scan-gram.l: When it starts with `%', complain about the
11200 whole directive, not just that `invalid character: %'.
11201
8aeac3ca
AD
112022002-11-04 Akim Demaille <akim@epita.fr>
11203
11204 * Makefile.maint: Update from Autoconf.
11205 (update, cvs-update, po-update, do-po-update): New.
11206
793a58bb
AD
112072002-11-04 Akim Demaille <akim@epita.fr>
11208
11209 * tests/glr-regr1.at (Badly Collapsed GLR States): Prototype yylex
11210 and yyerror.
11211 Have yyerror `use' its arguments.
11212 * tests/calc.at (AT_CHECK_PUSHDEFS): AT_YYERROR_SEES_LOC_IF
11213 returns true when location & yacc & pure & parse-param.
11214 (_AT_DATA_CALC_Y): Let yyerror ``use'' its arguments.
11215
c4d720cd
AD
112162002-11-04 Akim Demaille <akim@epita.fr>
11217
11218 * src/location.h (LOCATION_PRINT): Use quotearg slot 3 to avoid
11219 clashes.
11220 * src/scan-gram.l: Use [\'] instead of ['] to pacify
11221 font-lock-mode.
11222 Use complain_at.
11223 Use quote, not quote_n since LOCATION_PRINT no longer uses the
11224 slot 0.
11225
613a0dc5
PE
112262002-11-03 Paul Eggert <eggert@twinsun.com>
11227
11228 * src/reader.c (get_merge_function, grammar_current_rule_check):
11229 Use consistent diagnostics for reporting type name clashes.
11230 Quote the types with <>, for consistency with Yacc.
11231 * tests/input.at (Type Clashes): Adjust to diagnostic changes.
11232
2a8d363a
AD
112332002-11-03 Akim Demaille <akim@epita.fr>
11234
11235 * data/c.m4 (b4_identification, b4_user_args, b4_parse_param):
11236 New.
11237 * data/yacc.m4 (b4_pure_args, b4_Pure_args): New.
11238 (b4_parse_param): Remove.
11239 Use b4_identification.
11240 Propagate b4_pure_args where needed to pass them to yyerror.
11241 * data/glr.m4 (b4_parse_param): Remove.
11242 (b4_user_formals, b4_pure_args, b4_pure_formals, b4_lpure_args)
11243 (b4_lpure_formals): New.
11244 Use b4_identification.
11245 (YY_USER_FORMALS, YY_USER_ARGS): Remove, replaced by
11246 b4_user_formals and b4_user_args.
11247 (yyexpandGLRStack, yyFail, yyaddDeferredAction, yyglrShiftDefer)
11248 (yyreportAmbiguity): When using a pure parser, also need
11249 the location, and the parse-params.
11250 Adjust callers.
11251 (yyuserAction, yyglrShift, yyreportParseError, yyrecoverParseError):
11252 When using a pure parser, also need the parse-params.
11253 Adjust callers.
11254 * tests/calc.at: Test pure (%pure-parser) and absolutely pure
11255 (%pure-parser + %parse-param) LALR and GLR parsers.
11256 (AT_CHECK_PUSHDEFS, AT_CHECK_POPDEFS): New, define AT_PARAM_IF,
11257 AT_LOCATION_IF, AT_PURE_IF, AT_GLR_IF, AAT_PURE_AND_LOC_IF,
11258 AT_GLR_OR_PARAM_IF, AT_YYERROR_ARG_LOC_IF, AT_YYERROR_SEES_LOC_IF.
11259 (_AT_DATA_CALC_Y): Equip for purity of yyerror.
11260 (_AT_CHECK_CALC_ERROR): Use AT_YYERROR_SEES_LOC_IF.
11261 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Equip for yyerror purity.
11262 * doc/bison.texinfo: Untabify the whole file.
11263 (Parser Function): Document %parse-param, deprecate YYPARSE_PARAM.
11264 (Pure Calling): Document %lex-param, deprecate YYLEX_PARAM.
11265 (Error Reporting): Adjust to these new directives.
11266 Document %error-verbose, deprecate YYERROR_VERBOSE.
11267
9e32add8
AD
112682002-11-03 Akim Demaille <akim@epita.fr>
11269
11270 * tests/calc.at: Change all the AT_CHECK_CALC_LALR and
11271 AT_CHECK_CALC_GLR invocations to use % directives, instead of
11272 command line options.
11273 * tests/cxx-type.at: Formatting changes.
11274
b02d90a5
PE
112752002-11-03 Paul Eggert <eggert@twinsun.com>
11276
11277 * src/scan-gram.l: Revamp to fix POSIX incompatibilities,
11278 to count columns correctly, and to check for invalid inputs.
9e32add8 11279
b02d90a5
PE
11280 Use mbsnwidth to count columns correctly. Account for tabs, too.
11281 Include mbswidth.h.
11282 (YY_USER_ACTION): Invoke extend_location rather than LOCATION_COLUMNS.
11283 (extend_location): New function.
11284 (YY_LINES): Remove.
11285
11286 Handle CRLF in C code rather than in Lex code.
11287 (YY_INPUT): New macro.
11288 (no_cr_read): New function.
11289
11290 Scan UCNs, even though we don't fully handle them yet.
11291 (convert_ucn_to_byte): New function.
11292
11293 Handle backslash-newline correctly in C code.
11294 (SC_LINE_COMMENT, SC_YACC_COMMENT): New states.
11295 (eols, blanks): Remove. YY_USER_ACTION now counts newlines etc.;
11296 all uses changed.
11297 (tag, splice): New EREs. Do not allow NUL or newline in tags.
11298 Use {splice} wherever C allows backslash-newline.
11299 YY_STEP after space, newline, vertical-tab.
11300 ("/*"): BEGIN SC_YACC_COMMENT, not yy_push_state (SC_COMMENT).
9e32add8 11301
b02d90a5
PE
11302 (letter, id): Don't assume ASCII; e.g., spell out a-z.
11303
11304 ({int}, handle_action_dollar, handle_action_at): Check for integer
11305 overflow.
9e32add8 11306
b02d90a5
PE
11307 (YY_STEP): Omit trailing semicolon, so that it's more like C.
11308
11309 (<SC_ESCAPED_STRING,SC_ESCAPED_CHARACTER>): Allow \0 and \00
11310 as well as \000. Check for UCHAR_MAX, not 255.
11311 Allow \x with an arbitrary positive number of digits, as in C.
11312 Check for overflow here.
11313 Allow \? and UCNs, for compatibility with C.
11314
11315 (handle_symbol_code_dollar): Use quote_n slot 1 to avoid collision
11316 with quote slot used by complain_at.
11317
11318 * tests/input.at: Add tests for backslash-newline, m4 quotes
11319 in symbols, long literals, and funny escapes in strings.
11320
11321 * configure.ac (jm_PREREQ_MBSWIDTH): Add.
11322 * lib/Makefile.am (libbison_a_SOURCES): Add mbswidth.h, mbswidth.c.
11323 * lib/mbswidth.h, lib/mbswidth.c: New files, from GNU gettext.
11324 * m4/Makefile.am (EXTRA_DIST): Add mbswidth.m4.
11325 * m4/mbswidth.m4: New file, from GNU coreutils.
11326
11327 * doc/bison.texinfo (Grammar Outline): Document // comments.
11328 (Symbols): Document that trigraphs have no special meaning in Bison,
11329 nor is backslash-newline allowed.
11330 (Actions): Document that trigraphs have no special meaning.
11331
11332 * src/location.h (LOCATION_COLUMNS, LOCATION_LINES): Remove;
11333 no longer used.
11334
113352002-11-02 Paul Eggert <eggert@twinsun.com>
11336
11337 * src/reader.c: Don't include quote.h; not needed.
11338 (get_merge_function): Reword warning to be consistent with
11339 type clash diagnostic in grammar_current_rule_check.
11340
11341 * lib/quotearg.c (quotearg_buffer_restyled): Fix off-by-two
11342 bug in trigraph handling.
11343
11344 * src/output.c (prepare_symbols): When printing token names,
11345 escape "[" as "@<:@" and likewise for "]".
11346
11347 * src/system.h (errno): Remove declaration, as we are now
11348 assuming C89 or better, and C89 guarantees errno.
11349
762b212b
PE
113502002-10-30 Paul Eggert <eggert@twinsun.com>
11351
11352 * lib/bitset_stats.c (bitset_stats_read, bitset_stats_write):
11353 Check for close failures.
11354 * src/files.h (xfclose): Return void, not int, since it always
11355 returned zero.
11356 * src/files.c (xfclose): Likewise. Report I/O error if ferror
11357 indicates one.
11358 * src/output.c (output_skeleton): Use xfclose rather than fclose
11359 and ferror. xfclose now checks ferror.
11360
11361 * data/glr.c (YYLEFTMOST_STATE): Remove.
11362 (yyreportTree): Use a stack-based leftmost state. This avoids
11363 our continuing battles with bogus warnings about initializers.
11364
56100c60
AD
113652002-10-30 Akim Demaille <akim@epita.fr>
11366
11367 * src/system.h: Don't use #ifdef/#ifndef on HAVE_ values, only
11368 #if.
11369
51b4a04c
PH
113702002-10-29 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
11371
11372 * tests/glr-regr1.at: New test for reported regressions.
11373 * tests/testsuite.at: Add glr-regr1.at test.
11374 * tests/Makefile.am: Add glr-regr1.at test.
e183b123 11375
bf1ebda2
PE
113762002-10-24 Paul Eggert <eggert@twinsun.com>
11377
5c16c6b1
PE
11378 Version 1.75a.
11379
bf1ebda2
PE
11380 * tests/calc.at (_AT_DATA_CALC_Y): Remove unused strcat declaration.
11381 * tests/cxx-type.at (_AT_TEST_GLR_CALC): Include stdlib.h, since
11382 we use malloc. Don't assume 'A' through 'Z' are contiguous.
11383 Don't assume strdup exists; POSIX says its an XSI extension.
11384 Check for buffer overflow on input.
11385
b526ee61
AD
113862002-10-24 Akim Demaille <akim@epita.fr>
11387
11388 * src/output.c (output_skeleton): Don't disable M4sugar comments
11389 too soon: it results in comments being expanded.
11390 * data/yacc.c, data/glr.c, data/lalr1.cc: Do it right before the
11391 first output.
11392
f1886bb2
AD
113932002-10-24 Akim Demaille <akim@epita.fr>
11394
11395 * data/yacc.c (m4_int_type): New.
11396 * data/c.m4 (m4_int_type): Don't use yysigned_char, but `signed
11397 char' as only yacc.c wants K&R portability.
11398 * data/glr.c (yysigned_char): Remove.
11399 * data/lalr1.cc: Rename the trailing b4_name as b4_parser_class_name.
11400 Reported by Quoc Peyrot.
11401
c5576256
PE
114022002-10-23 Paul Eggert <eggert@twinsun.com>
11403
11404 * src/main.c (main): With --trace=time, report times even if a
11405 non-fatal error occurs. Formerly, the times were reported in some
11406 such cases but not in others.
11407 * src/reader.c (reader): Just return if a complaint has been issued,
11408 instead of exiting, so that 'main' can report times.
11409
27b0ffea
AD
114102002-10-22 Akim Demaille <akim@epita.fr>
11411
11412 * src/system.h: Include sys/types.
11413 Reported by Bert Deknuydt.
11414
223a7883
PE
114152002-10-23 Paul Eggert <eggert@twinsun.com>
11416
11417 * configure.ac (AC_PROG_LEX): Use instead of AM_PROG_LEX.
11418 Suggested by Art Haas.
11419
114202002-10-22 Paul Eggert <eggert@twinsun.com>
11421
11422 * src/complain.c (exit) [! (STDC_HEADERS || _LIBC)]: Remove exit
11423 decl; not needed any more.
11424 * src/main.c (main): Use return to exit, undoing yesterday's change.
11425 The last OS that we could find where this wouldn't work is
11426 SunOS 3.5, and that's too old to worry about now.
11427
11428 * data/glr.c (struct yyltype): Define members even when not
11429 doing locations. This is more consistent with yacc.c, and it
11430 works around the following bug reports:
161a71f3
PE
11431 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00106.html
11432 http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00111.html
27b0ffea 11433
223a7883
PE
11434 * doc/bison.texinfo: Minor spelling and typographical fixes. Use
11435 @acronym consistently. Standardize on "Yacc" instead of "YACC",
11436 "Algol" instead of "ALGOL". Give a bit more history about BNF.
11437
8b76775a
AD
114382002-10-22 Akim Demaille <akim@epita.fr>
11439
11440 * data/README: New.
11441
6db10d14
PE
114422002-10-21 Paul Eggert <eggert@twinsun.com>
11443
11444 Be consistent about 'bool'; the old code used an enum in one
11445 module and an int in another, and this violates the C standard.
11446 * m4/stdbool.m4: New file, from coreutils 4.5.3.
11447 * configure.ac (AC_HEADER_STDBOOL): Add.
11448 * m4/Makefile.am (EXTRA_DIST): Add stdbool.m4.
11449 * src/muscle_tab.c (hash_compare_muscles): (a ? FALSE : TRUE) -> (! a)
11450 * src/symtab.c (hash_compare_symbol_t): Likewise.
11451 * src/system.h (bool, false, true): Use a definition consistent
11452 with ../lib/hash.c. All uses changed.
11453
11454 * src/complain.c (warning_issued): Renamed from warn_message_count,
11455 so that we needn't worry about integer overflow (!).
11456 Now of type bool. All uses changed.
11457 (complaint_issued): Renamed from complain_message_count; likewise.
11458
11459 * src/main.c (main): Use exit to exit with failure.
27b0ffea 11460
6db10d14
PE
11461 * src/complain.c (fatal_at, fatal): Use EXIT_FAILURE and EXIT_SUCCESS
11462 rather than 1 and 0.
11463 * src/main.c (main): Likewise.
11464 * src/getargs.c (getargs): Likewise.
11465 * src/reader.c (reader): Likewise.
11466
11467 * src/getarg.c (getargs): Remove duplicate code for
11468 "Try `bison --help'".
11469
11470 * src/files.c (xfopen, xfclose): Use EXIT_FAILURE rather than 2.
11471 What was that "2" for?
11472
11473 * src/complain.h (fatal, fatal_at): Add __attribute__((__noreturn__)).
11474 * src/getargs.c (usage): Likewise.
11475
11476 * src/getargs.c (getargs): When there are too few operands, report
11477 the last one. When there are too many, report the first extra
11478 one. This is how diffutils does it.
11479
92a060fd
PE
114802002-10-20 Paul Eggert <eggert@twinsun.com>
11481
11482 Remove K&R vestiges.
11483 * configure.ac (AC_C_CONST, AM_C_PROTOTYPES): Remove.
11484 * src/complain.c (VA_START): Remove. Assume prototypes.
11485 (vfprintf) [! (HAVE_VPRINTF || defined vfprintf)]: New macro.
11486 (private_strerror, warn_at, warn, complain_at, complain, fatal_at,
11487 fatal): Assume prototypes.
11488 * src/complain.h: Assume prototypes.
11489 * src/system.h (PARAMS): Remove.
11490 Include <limits.h> unconditionally, since it's guaranteeed even
11491 for a freestanding C89 compiler.
11492 (SHRT_MIN, SHRT_MAX): Remove, since C89 guarantees them.
11493 * src/vmsgetargs.c (getargs, cli_present, cli_get_value): Prototype.
8b76775a 11494
e7cb57c0
AD
114952002-10-20 Akim Demaille <akim@epita.fr>
11496
11497 * src/muscle_tab.c (muscle_grow): Remove trailing debugging code.
11498 * data/glr.c (YY_USER_FORMALS, YY_USER_ARGS): New.
11499 (yyuserAction, yydoAction, yyglrReduce, yyresolveValue)
11500 (yyresolveStates, yyresolveAction, yyresolveStack)
11501 (yyprocessOneStack): Use them.
11502 (yy_reduce_print): New.
11503 * tests/calc.at (_AT_DATA_CALC_Y): Exercise %parse-param.
11504
0245f82d
AD
115052002-10-20 Akim Demaille <akim@epita.fr>
11506
11507 * data/c.m4 (b4_c_ansi_args): Recognize functions with no
11508 arguments and output `void'.
11509 (b4_c_function): Rename as...
11510 (b4_c_function_def): this.
11511 (b4_c_function_decl, b4_c_ansi_function_def)
11512 (b4_c_ansi_function_decl): New.
11513 Change the interpretation of the arguments: before `int, foo', now
11514 `int foo, foo'.
11515 * data/yacc.c (yyparse): Prototype and define thanks to these.
11516 Adjust b4_c_function_def uses.
11517 * data/glr.c (yyparse): Likewise, but ANSI only.
11518
39912f52
AD
115192002-10-20 Akim Demaille <akim@epita.fr>
11520
11521 * src/output.c (prepare): Move the definition of `tokens_number',
11522 `nterms_number', `undef_token_number', `user_token_number_max'
11523 to...
11524 (prepare_tokens): Here.
11525 (prepare_tokens): Rename as...
11526 (prepare_symbols): this.
11527 (prepare): Move the definition of `rules_number' to...
11528 (prepare_rules): here.
11529 (prepare): Move the definition of `last', `final_state_number',
11530 `states_number' to...
11531 (prepare_states): here.
11532 * data/yacc.c, data/lalr1.cc, data/glr.c: Normalize `>' into `<'.
11533
20c1e2ad
AD
115342002-10-20 Akim Demaille <akim@epita.fr>
11535
11536 * src/tables.h, src/tables.c, src/output.c: Comment changes.
11537
21964f43
AD
115382002-10-20 Akim Demaille <akim@epita.fr>
11539
11540 * data/yacc.c, data/yacc.c (b4_location_if, b4_pure_if): Move to...
11541 * data/c.m4: here.
11542
66d30cd4
AD
115432002-10-20 Akim Demaille <akim@epita.fr>
11544
11545 * src/output.c (prepare): Use MUSCLE_INSERT_STRING.
11546 * src/muscle_tab.c (muscle_pair_list_grow): Rename `val as
11547 `pair'.
11548 (muscle_init): Move the `b4_ltype', `b4_maxdepth', `b4_initdepth',
11549 `name' to...
11550 * data/glr.c, data/lalr1.cc, data/yacc.c (b4_location_type)
11551 (b4_stack_depth_init, b4_stack_depth_max, b4_parser_class_name):
11552 These.
11553
95f2c9fe
PE
115542002-10-19 Paul Eggert <eggert@twinsun.com>
11555
11556 Do not create a temporary file, as that involves security and
11557 cleanup headaches. Instead, use a pair of pipes.
11558 Derived from a suggestion by Florian Krohm.
11559 * lib/subpipe.c, lib/subpipe.h, m4/subpipe.m4: New files.
11560 * lib/mkstemp.c, lib/readpipe.c, lib/tempname.c, m4/mkstemp.m4: Remove.
11561 * configure.ac (UTILS_FUNC_MKSTEMP, jm_PREREQ_TEMPNAME): Remove.
11562 (BISON_PREREQ_SUBPIPE): Add.
11563 * lib/Makefile.am (libbison_a_SOURCES): Remove readpipe.c.
11564 Add subpipe.h, subpipe.c.
11565 * m4/Makefile.am (EXTRA_DIST): Remove mkstemp.m4. Add subpipe.m4.
11566 * po/POTFILES.in: Add lib/subpipe.c.
11567 * src/output.c: Include "subpipe.h".
11568 (m4_invoke): Remove decl.
11569 (scan_skel): New decl.
11570 (output_skeleton): Use pipe rather than temporary file for m4 input.
11571 Check that m4sugar.m4 is readable, to avoid deadlock.
11572 Check for pipe I/O error.
11573 * src/scan-skel.l (readpipe): Remove decl.
11574 (scan_skel): New function, to be used in place of m4_invoke.
11575 Read from stream rather than file.
66d30cd4 11576
95f2c9fe
PE
11577 * lib/timevar.c (TICKS_TO_MSEC, CLOCKS_TO_MSEC): Do not cast to
11578 float, as this generates a warning on Solaris 8 + GCC 3.2 with
11579 --enable-gcc-warnings. Instead, divide into 1.0 rather than 1;
11580 this generates a more-accurate value anyway.
11581
11582 * lib/timevar.c (timervar_accumulate): Rename locals to
11583 avoid confusion with similarly-named more-global.
11584 * src/muscle_tab.c (muscle_pair_list_grow): Likewise.
11585
11586 * src/output.c (prepare): Use xstrdup to convert char const *
11587 to char *, to avoid GCC warning.
11588
c19988b7
AD
115892002-10-19 Akim Demaille <akim@epita.fr>
11590
11591 * tests/calc.at (_AT_DATA_CALC_Y): Define VAL, LOC, LEX_FORMALS,
11592 LEX_PRE_FORMALS, LEX_ARGS, LEX_PRE_ARGS, USE_LEX_ARGS.
11593 Use them to have `calc.y' ready for %pure-parser.
11594 * data/yacc.c (YYLEX): Pass a yylex return type to
11595 b4_c_function_call.
11596
ae7453f2
AD
115972002-10-19 Akim Demaille <akim@epita.fr>
11598
11599 Prototype support of %lex-param and %parse-param.
11600
11601 * src/parse-gram.y: Add the definition of the %lex-param and
11602 %parse-param tokens, plus their rules.
11603 Drop the `_' version of %glr-parser.
11604 Add the "," token.
11605 * src/scan-gram.l (INITIAL): Scan them.
11606 * src/muscle_tab.c: Comment changes.
11607 (muscle_insert, muscle_find): Rename `pair' as `probe'.
11608 * src/muscle_tab.h (MUSCLE_INSERT_PREFIX): Remove unused.
11609 (muscle_entry_s): The `value' member is no longer const.
11610 Adjust all dependencies.
11611 * src/muscle_tab.c (muscle_init): Adjust: use
11612 MUSCLE_INSERT_STRING.
11613 Initialize the obstack earlier.
11614 * src/muscle_tab.h, src/muscle_tab.c (muscle_grow)
11615 (muscle_pair_list_grow): New.
11616 * data/c.m4 (b4_c_function_call, b4_c_args): New.
11617 * data/yacc.c (YYLEX): Use b4_c_function_call to honor %lex-param.
11618 * tests/calc.at: Use %locations, not --locations.
11619 (AT_CHECK_CALC_GLR): Use %glr-parser, not %glr_parser.
11620
0e575721
AD
116212002-10-19 Akim Demaille <akim@epita.fr>
11622
11623 * src/getargs.c (usage): Take status as argument and exit
11624 accordingly.
11625 Report the traditional `Try ... --help' message when status != 0.
11626 (usage, version): Don't take a FILE * as arg, it is pointless.
11627 (getargs): When there is an incorrect number of arguments, make it
11628 an error, and report it GNUlically thanks to `usage ()'.
11629
724ce7f5
PE
116302002-10-18 Paul Eggert <eggert@twinsun.com>
11631
3a781eb2
PE
11632 * data/glr.c (yyreportParseError): Don't assume that sprintf
11633 yields the length of the printed string, as this is not true
11634 on SunOS 4.1.4. Reported by Peter Klein.
11635
724ce7f5
PE
11636 * tests/calc.at (_AT_DATA_CALC_Y): #undef memcmp and realloc.
11637 * tests/conflicts.at (%nonassoc and eof): Likewise.
11638 Fixes SunOS 4.1.4 test failure reported by Peter Klein.
11639
473d0a75
AD
116402002-10-17 Akim Demaille <akim@epita.fr>
11641
11642 * src/getargs.h (trace_e): Add trace_scan, and trace_parse.
11643 * src/getargs.c (trace_types, trace_args): Adjust.
11644 * src/reader.c (grammar_current_rule_prec_set)
11645 (grammar_current_rule_dprec_set, grammar_current_rule_merge_set):
11646 Standardize error messages.
11647 And s/@prec/%prec/!
11648 (reader): Use trace_flag to enable scanner/parser debugging,
11649 instead of an adhoc scheme.
11650 * src/scan-gram.l: Remove trailing debugging code.
11651
e76d2469
PE
116522002-10-16 Paul Eggert <eggert@twinsun.com>
11653
93e2236a
PE
11654 * src/muscle_tab.h (MUSCLE_TAB_H_): Was misspelled as
11655 MUSCLE_TAB_H.
11656
e76d2469
PE
11657 * NEWS: Officially drop support for building Bison with K&R C,
11658 since it didn't work anyway and it's not worth worrying about.
11659 * Makefile.maint (wget_files): Remove ansi2knr.c.
11660 (ansi2knr.c-url_prefix): Remove.
11661 * lib/.cvsignore: Remove ansi2knr, ansi2knr.*.
11662 * lib/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11663 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove.
11664
5bd1c419
PE
116652002-10-15 Paul Eggert <eggert@twinsun.com>
11666
11667 Stop using the "enum_" trick for K&R-style function definitions;
11668 it confused me, and I was the author! Instead, assume that people
11669 who want to use K&R C compilers (when using these modules in GCC,
11670 perhaps?) will run ansi2knr.
11671
11672 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): Remove.
11673 All uses of "enum_" changed to "enum ".
11674 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11675 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
e76d2469 11676
5bd1c419
PE
11677 * lib/abitset.c (abitset_and, abitset_and_cmp, abitset_and_or,
11678 abitset_and_or_cmp, abitset_andn, abitset_andn_cmp,
11679 abitset_andn_or, abitset_andn_or_cmp, abitset_bytes, abitset_copy,
11680 abitset_copy1, abitset_disjoint_p, abitset_empty_p,
11681 abitset_equal_p, abitset_init, abitset_list, abitset_list_reverse,
11682 abitset_not, abitset_ones, abitset_or, abitset_or_and,
11683 abitset_or_and_cmp, abitset_or_cmp, abitset_reset, abitset_set,
11684 abitset_size, abitset_small_list, abitset_subset_p, abitset_test,
11685 abitset_unused_clear, abitset_xor, abitset_xor_cmp, abitset_zero):
11686 Use function prototypes; this removes the need for declaring
11687 static functions simply to provide their prototypes.
11688 * lib/bitset.c (bitset_alloc, bitset_and_or_, bitset_and_or_cmp_,
11689 bitset_andn_or_, bitset_andn_or_cmp_, bitset_bytes, bitset_copy_,
11690 bitset_count_, bitset_create, bitset_dump, bitset_first,
11691 bitset_free, bitset_init, bitset_last, bitset_next,
11692 bitset_obstack_alloc, bitset_obstack_free, bitset_only_set_p,
11693 bitset_op4_cmp, bitset_or_and_, bitset_or_and_cmp_, bitset_prev,
11694 bitset_print, bitset_release_memory, bitset_toggle_,
11695 bitset_type_choose, bitset_type_get, bitset_type_name_get,
11696 debug_bitset): Likewise.
11697 * lib/bitset.h (bitset_set, bitset_reset, bitset_test): Likewise.
11698 * lib/bitset_stats.c (bitset_log_histogram_print,
11699 bitset_percent_histogram_print, bitset_stats_and,
11700 bitset_stats_and_cmp, bitset_stats_and_or,
11701 bitset_stats_and_or_cmp, bitset_stats_andn, bitset_stats_andn_cmp,
11702 bitset_stats_andn_or, bitset_stats_andn_or_cmp, bitset_stats_copy,
11703 bitset_stats_count, bitset_stats_disable, bitset_stats_disjoint_p,
11704 bitset_stats_dump, bitset_stats_empty_p, bitset_stats_enable,
11705 bitset_stats_equal_p, bitset_stats_free, bitset_stats_init,
11706 bitset_stats_list, bitset_stats_list_reverse, bitset_stats_not,
11707 bitset_stats_ones, bitset_stats_or, bitset_stats_or_and,
11708 bitset_stats_or_and_cmp, bitset_stats_or_cmp, bitset_stats_print,
11709 bitset_stats_print_1, bitset_stats_read, bitset_stats_reset,
11710 bitset_stats_set, bitset_stats_size, bitset_stats_subset_p,
11711 bitset_stats_test, bitset_stats_toggle, bitset_stats_type_get,
11712 bitset_stats_write, bitset_stats_xor, bitset_stats_xor_cmp,
11713 bitset_stats_zero): Likewise.
11714 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
11715 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
11716 bitsetv_dump, debug_bitsetv): Likewise.
11717 * lib/ebitset.c (ebitset_and, ebitset_and_cmp, ebitset_andn,
11718 ebitset_andn_cmp, ebitset_bytes, ebitset_copy, ebitset_copy_,
11719 ebitset_copy_cmp, ebitset_disjoint_p, ebitset_elt_add,
11720 ebitset_elt_alloc, ebitset_elt_calloc, ebitset_elt_find,
11721 ebitset_elt_free, ebitset_elt_last, ebitset_elt_remove,
11722 ebitset_elt_zero_p, ebitset_elts_grow, ebitset_empty_p,
11723 ebitset_equal_p, ebitset_free, ebitset_init, ebitset_list,
11724 ebitset_list_reverse, ebitset_not, ebitset_ones, ebitset_op3_cmp,
11725 ebitset_or, ebitset_or_cmp, ebitset_release_memory, ebitset_reset,
11726 ebitset_set, ebitset_size, ebitset_subset_p, ebitset_test,
11727 ebitset_weed, ebitset_xor, ebitset_xor_cmp, ebitset_zero):
11728 Likewise.
11729 * lib/lbitset.c (debug_lbitset, lbitset_and, lbitset_and_cmp,
11730 lbitset_andn, lbitset_andn_cmp, lbitset_bytes, lbitset_copy,
11731 lbitset_copy_cmp, lbitset_disjoint_p, lbitset_elt_alloc,
11732 lbitset_elt_calloc, lbitset_elt_find, lbitset_elt_free,
11733 lbitset_elt_link, lbitset_elt_unlink, lbitset_elt_zero_p,
11734 lbitset_empty_p, lbitset_equal_p, lbitset_free, lbitset_init,
11735 lbitset_list, lbitset_list_reverse, lbitset_not, lbitset_ones,
11736 lbitset_op3_cmp, lbitset_or, lbitset_or_cmp, lbitset_prune,
11737 lbitset_release_memory, lbitset_reset, lbitset_set, lbitset_size,
11738 lbitset_subset_p, lbitset_test, lbitset_weed, lbitset_xor,
11739 lbitset_xor_cmp, lbitset_zero): Likewise.
e76d2469 11740
ae26e1f0
AD
117412002-10-14 Akim Demaille <akim@epita.fr>
11742
11743 Version 1.75.
11744
d43baf71
AD
117452002-10-14 Akim Demaille <akim@epita.fr>
11746
11747 * tests/Makefile.am (maintainer-check-posix): New.
11748
7ebc83e3
AD
117492002-10-14 Akim Demaille <akim@epita.fr>
11750
11751 * data/glr.c [YYDEBUG] (YYLEFTMOST_STATE): Initialize the yyloc
11752 member.
11753
05846dae
AD
117542002-10-14 Akim Demaille <akim@epita.fr>
11755
11756 * src/tables.c (table_ninf_remap): base -> tab.
11757 Reported by Matt Rosing.
11758
1318e37d
PE
117592002-10-14 Paul Eggert <eggert@twinsun.com>
11760
447fbb17
PE
11761 * tests/action.at, tests/calc.at, tests/conflicts.at,
11762 tests/cxx-type.at, tests/headers.at, tests/input.at,
11763 tests/regression.at, tests/synclines.at, tests/torture.at:
11764 Say "bison -o foo.c foo.y", not "bison foo.y -o foo.c",
11765 so that the tests still work even if POSIXLY_CORRECT is set.
11766 * doc/bison.texinfo (Rpcalc Compile, Invocation): Likewise.
05846dae 11767
1318e37d
PE
11768 * data/c.m4 (b4_int_type): Use yysigned_char instead of signed char,
11769 for portability to K&R hosts. Fix typo: signed char is guaranteed
11770 only to 127, not to 128.
11771 * data/glr.c (yysigned_char): New type.
11772 * data/yacc.c (yysigned_char): Likewise.
11773 * tests/regression.at (Web2c Actions): signed char -> yysigned_char.
11774
cc0f0794
PE
117752002-10-13 Paul Eggert <eggert@twinsun.com>
11776
5038f418
PE
11777 * data/yacc.c (yyparse): Rewrite to avoid "comparison is always
11778 true due to limited range of data type" warning from GCC.
11779
cc0f0794
PE
11780 * data/c.m4 (b4_token_defines): Protect against double-inclusion
11781 by wrapping enum yytokentype's definition inside #ifndef
11782 YYTOKENTYPE. This undoes a bug I introduced on 2002-10-12.
11783
6fed0802
AD
117842002-10-13 Akim Demaille <akim@epita.fr>
11785
11786 * data/glr.c (yyglrShiftDefer, yyaddDeferredAction, yydoAction):
11787 Un yy- yyrhs to avoid the name clash with the global YYRHS.
11788
32f0598d
AD
117892002-10-13 Akim Demaille <akim@epita.fr>
11790
11791 * Makefile.maint: Update from Autoconf 2.54.
11792 * m4/strerror_r.m4 (AC_FUNC_STRERROR_R): Remove, shipped with 2.54.
11793
7ea9a33f
AD
117942002-10-13 Akim Demaille <akim@epita.fr>
11795
11796 * src/print.c (print_state): Separate the list of solved conflicts
11797 from the other items.
11798 * tests/conflicts.at (Resolved SR Conflicts): Adjust.
11799
ea99527d
AD
118002002-10-13 Akim Demaille <akim@epita.fr>
11801
11802 Let nondeterministic skeletons be usable with deterministic
11803 tables.
11804
11805 With the patch, GAWK compiled by GCC without -O2 passes its test
11806 suite using a GLR parser driven by LALR tables. It fails with -O2
11807 because `struct stat' gives two different answers on my machine:
11808 88 (definition of an auto var) and later 96 (memset on this var).
11809 Hence the stack is badly corrumpted. The headers inclusion is to
11810 blame: if I move the awk.h inclusion before GLR's system header
11811 inclusion, the two struct stat have the same size.
11812
11813 * src/tables.c (pack_table): Always create conflict_table.
11814 (token_actions): Always create conflict_list.
11815 * data/glr.c (YYFLAG): Remove, unused.
11816
f377f69f
AD
118172002-10-13 Akim Demaille <akim@epita.fr>
11818
11819 * configure.ac (AC_GNU_SOURCE): Use it instead of hand written code.
11820 (O0FLAGS): New.
11821 (VALGRIND, GXX): New.
11822 * tests/atlocal.in (CFLAGS): Use O0FLAGS.
11823 * tests/bison.in: Run $PREBISON a pre-command.
11824 * tests/Makefile.am (maintainer-check, maintainer-check-valgrind)
11825 (maintainer-check-g++): New.
11826 * Makefile.am (maintainer-check): New.
11827
2a1fe6ed
AD
118282002-10-13 Akim Demaille <akim@epita.fr>
11829
11830 * data/glr.c: Formatting changes.
11831 Tweak some trace messages to match yacc.c's.
11832
f50adbbd
AD
118332002-10-13 Akim Demaille <akim@epita.fr>
11834
11835 GLR parsers sometimes raise parse errors instead of performing the
11836 default reduction.
11837 Reported by Charles-Henry de Boysson.
11838
11839 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Don't
ba0fe3c7 11840 check the length of the traces when %glr.
f50adbbd
AD
11841 (_AT_CHECK_CALC_ERROR): Also skip `^Stack' lines, coming from
11842 GLR's traces.
11843 (AT_CHECK_CALC_LALR, AT_CHECK_CALC_GLR): New.
11844 Test GLR parsers.
11845 * data/glr.c (YYLEFTMOST_STATE): Fix its value.
11846 (yyltype): Remove the yy prefix from the member names.
11847 (yytable): Complete its comment.
11848 (yygetLRActions): Map error action number from YYTABLE from
11849 YYTABLE_NINF to 0.
11850 (yyisErrorAction): No longer compare YYACTION to YYPACT_NINF
11851 (which was a bug: it should have been YYTABEL_NINF, and yet it was
11852 not satisfying as we could compare an YYACTION computed from
11853 YYDEFACT to YYTABLE_NINF although they are unrelated): 0 is the
11854 only value for error actions.
11855 (yyreportParseError): In verbose parse error messages, don't issue
11856 `error' in the list of expected tokens.
11857 * data/yacc.c (yyparse) <yybackup>: Rewrite the decoding of the
11858 next action to perform to match glr.c's decoding.
11859 (yytable): Complete its comment.
11860
bcbad5b9
PE
118612002-10-13 Paul Eggert <eggert@twinsun.com>
11862
11863 Fix problem reported by Henrik Grubbstroem in
161a71f3 11864 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00098.html>:
bcbad5b9
PE
11865 "nonterm: { $$ = 123; } { $$ = $1; };" was wrongly rejected,
11866 because the Bison parser reads the second action before reducing
11867 the first one.
11868 * src/scan-gram.l (rule_length): New static var.
11869 Use it to keep track of the rule length in the scanner, since
11870 we can't expect the parser to be in lock-step sync with the scanner.
11871 (handle_action_dollar, handle_action_at): Use this var.
11872 * tests/actions.at (Exotic Dollars): Test for the problem.
05846dae 11873
14904b89
PE
118742002-10-12 Paul Eggert <eggert@twinsun.com>
11875
1fe611e5
PE
11876 * lib/timevar.c [! IN_GCC && HAVE_SYS_TIME_H]: Include <sys/time.h>.
11877 * m4/timevar.m4 (BISON_PREREQ_TIMEVAR): Check for <sys/time.h>.
11878 Include <sys/time.h> when checking for clock_t and struct tms.
11879 Use same include order as source.
11880 This is for the SunOS 4.1.4 porting bug reported by Peter Klein in
161a71f3 11881 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00016.html>.
05846dae 11882
1fe611e5
PE
11883 * lib/timevar.c: Update copyright date and clarify comments.
11884 (get_time) [IN_GCC]: Keep the GCC version for reference.
05846dae 11885
1fe611e5
PE
11886 * lib/timevar.c, lib/timevar.h, lib/timevar.def: Import
11887 GCC version as of today, then merge Bison's changes.
11888 Change "GCC" to "Bison" in copyright notice. timevar.def's
11889 author is Akim, so change that too.
11890
98194095
PE
11891 * src/reader.c (grammar_current_rule_check):
11892 Don't worry about the default action if $$ is untyped.
11893 Prevents bogus warnings reported by Jim Gifford in
161a71f3 11894 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00015.html>.
98194095 11895
14904b89
PE
11896 * data/c.m4 (b4_token_enum): Do not define YYTOKENTYPE.
11897 * data/glr.c, data/lalr1.cc, data/yacc.c:
11898 Output token definitions before the first part of user declarations.
11899 Fixes compatibility problem reported by Jim Gifford for kbd in
161a71f3 11900 <http://lists.gnu.org/archive/html/bug-bison/2002-10/msg00014.html>.
14904b89 11901
ff6dca18
PE
119022002-10-11 Paul Eggert <eggert@twinsun.com>
11903
11904 * data/yacc.c (yyreport_parse_error): Remove, putting its body into...
11905 (yyparse): here. This undoes some of the 2002-07-25 change.
11906 Compatibility problem reported by Ralf S. Engelschall with
11907 OSSP cfg <http://www.ossp.org/pkg/lib/cfg/>.
11908
eb714592
AD
119092002-10-11 Akim Demaille <akim@epita.fr>
11910
11911 * tests/regression.at Characters Escapes): New.
11912 * src/scan-gram.l (SC_ESCAPED_CHARACTER): Accept \' in strings and
11913 characters.
11914 Reported by Jan Nieuwenhuizen.
11915
b7195100
AD
119162002-10-11 Akim Demaille <akim@epita.fr>
11917
11918 * po/id.po: New.
11919
f28a0f2d
PE
119202002-10-10 Paul Eggert <eggert@twinsun.com>
11921
11922 Portability fixes for bitsets; this also avoids several GCC
11923 warnings.
11924
11925 * lib/abitset.c: Include <stddef.h>, for offsetof.
11926 * lib/lbitset.c: Likewise.
11927
11928 * lib/abitset.c (abitset_bytes): Return a size that is aligned
11929 properly for vectors of objects. Do not assume that adding a
11930 header size to a multiple of a word size yields a value that is
11931 properly aligned for the whole union.
11932 * lib/bitsetv.c (bitsetv_alloc): Likewise.
11933
11934 * lib/bitset_stats.c (bitset_stats_bytes): Adjust to new,
11935 unique names for structures.
11936 * lib/ebitset.c (ebitset_bytes): Likewise.
11937 * lib/lbitset.c (lbitset_bytes): Likewise.
11938
11939 * lib/abitset.c (abitset_ones, abitset_zero, abitset_empty_p,
11940 abitset_copy1, abitset_not, abitset_equal_p, abitset_subset_p,
11941 abitset_disjoint_p, abitset_and, abitset_and_cmp, abitset_andn,
11942 abitset_andn_cmp, abitset_or, abitset_or_cmp, abitset_xor,
11943 abitset_xor_cmp, abitset_and_or, abitset_and_or_cmp,
11944 abitset_andn_or, abitset_andn_or_cmp, abitset_or_and,
11945 abitset_or_and_cmp, abitset_copy): Supply prototype decls,
11946 to improve the type-checking that GCC can do.
11947 * lib/bitset.c (bitset_op4_cmp): Likewise.
11948 * lib/bitset_stats.c (bitset_stats_count,
11949 bitset_stats_empty_p, bitset_stats_ones, bitset_stats_zero,
11950 bitset_stats_copy, bitset_stats_disjoint_p,
11951 bitset_stats_equal_p, bitset_stats_not, bitset_stats_subset_p,
11952 bitset_stats_and, bitset_stats_and_cmp, bitset_stats_andn,
11953 bitset_stats_andn_cmp, bitset_stats_or, bitset_stats_or_cmp,
11954 bitset_stats_xor, bitset_stats_xor_cmp, bitset_stats_and_or,
11955 bitset_stats_and_or_cmp, bitset_stats_andn_or,
11956 bitset_stats_andn_or_cmp, bitset_stats_or_and,
11957 bitset_stats_or_and_cmp): Likewise.
11958 * lib/lbitset.c (lbitset_and, lbitset_and_cmp, lbitset_andn,
11959 lbitset_andn_cmp, lbitset_or, lbitset_or_cmp, lbitset_xor,
11960 lbitset_xor_cmp, lbitset_empty_p, lbitset_ones, lbitset_not,
11961 lbitset_subset_p, lbitset_disjoint_p, debug_lbitset): Likewise.
11962
11963 * lib/abitset.h: Include bitset.h, not bbitset.h.
11964 * lib/ebitset.h: Likewise.
11965 * lib/lbitset.h: Likewise.
11966
11967 * lib/bbitset.h: (enum_bitset_ops, enum_bitset_type): New types.
11968 All instances of parameters of type enum bitset_opts are now of
11969 type enum_bitset_opts, to conform to the C Standard, and similarly
11970 for enum_bitset_type.
11971 * lib/ebitset.c (enum_ebitset_find_mode): Likewise.
11972 * lib/lbitset.c (enum_lbitset_find_mode): Likewise.
11973
11974 Do not use "struct bitset_struct" to mean different things in
11975 different modules. Not only is this confusing, it violates
11976 the C Standard, which requires that structure types in different
11977 modules must be compatible if one is to be passed to the other.
11978 * lib/bbitset.h (bitset): Now points to a union, not to a struct.
11979 All instances of "struct bitset_struct *" replaced with "bitset".
11980 * lib/bitset.h (struct bitset_struct): Remove, replacing with....
11981 (union bitset_union, struct abitset_struct, struct ebitset_struct,
11982 struct lbitset_struct, struct bitset_stats_struct): New types.
11983 All uses of struct bitset_struct changed to union bitset_union,
11984 etc.
ba0fe3c7 11985 * lib/abitset.c (struct abitset_struct, abitset,
f28a0f2d
PE
11986 struct bitset_struct): Remove.
11987 * lib/bitset_stats.c (struct bitset_stats_struct, bitset_stats,
11988 struct bitset_struct): Remove.
11989 * lib/ebitset.c (struct ebitset_struct, ebitset, struct
11990 bitset_struct): Remove.
11991 * lib/lbitset.c (struct lbitset_struct, lbitset, bitset_struct):
11992 Likewise.
11993
11994 Do not call a function of type T using a call that assumes the
11995 function is of a different type U. Standard C requires that a
11996 function must be called with a type that is compatible with its
11997 definition.
11998 * lib/bbitset.h (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
11999 New decls.
12000 * lib/bitset.c (bitset_and_or_, bitset_andn_or_, bitset_or_and_):
12001 New functions.
12002 * lib/ebitset.c (PFV): Remove.
12003 * lib/lbitset.c (PFV): Likewise.
12004 * lib/ebitset.c (ebitset_and, ebitset_andn, ebitset_or,
12005 ebitset_xor, ebitset_copy, ebitset_ones, ebitset_empty_p): New
12006 decls.
12007 (ebitset_and, ebitset_andn, ebitset_or, ebitset_xor): New functions.
12008 (ebitset_vtable): Use them.
12009 * lib/lbitset.c (lbitset_and, lbitset_andn, lbitset_or,
12010 lbitset_xor): New functions.
12011 (lbitset_vtable): Use them.
12012
12013 * lib/bitset.h (bitset_next, bitset_prev, bitset_only_set_p):
12014 Declare.
12015
12016 * lib/bitsetv.c (bitsetv_alloc): Add a cast to (void *) to avoid a
12017 GCC warning.
12018 * lib/lbitset.c (LBITSET_CURRENT1): Likewise.
12019 Use offsetof, for simplicity.
12020
6fbe4984
PE
120212002-10-06 Paul Eggert <eggert@twinsun.com>
12022
12023 * lib/bitset.h (bitset_reset): Do not assume that bitset_word is
12024 the same width as int. This reapplies a hunk of the 2002-08-12 patch
161a71f3 12025 <http://lists.gnu.org/archive/html/bison-patches/2002-08/msg00007.html>,
6fbe4984
PE
12026 which was inadvertently undone by the 2002-09-30 patch.
12027 * lib/lbitset.c (debug_lbitset): Do not assume that bitset_word is
12028 the same width as int.
12029
420f93c8
PE
120302002-10-04 Paul Eggert <eggert@twinsun.com>
12031
12032 Version 1.50.
12033
12034 * configure.ac (AC_INIT), NEWS: Increment version number.
12035
12036 * doc/bison.texinfo: Minor spelling, grammar, and white space
12037 fixes.
12038 (Symbols): Mention that any negative value returned from yylex
12039 signifies end-of-input. Warn about negative chars. Mention
12040 the portable Standard C character set.
12041
12042 The GNU coding standard says CFLAGS and YFLAGS are reserved
12043 for the installer to set.
12044 * lib/Makefile.am (AM_CFLAGS): Renamed from CFLAGS.
12045 * src/Makefile.am (AM_CFLAGS): Likewise.
12046 (AM_YFLAGS): Renamed from YFLAGS.
12047
12048 Fix some MAX and MIN problems.
12049 * src/gram.h (ITEM_NUMBER_MIN): MIN_MAX -> INT_MIN.
12050 * src/lalr.h (GOTO_NUMBER_MAX): INT_MAX -> SHRT_MAX.
12051 * src/symtab.h (SYMBOL_NUMBER_MAX): New macro.
12052 * src/reader.c (reader): Use it.
12053
12054 * tests/regression.at (Braces parsing): Use grep, not fgrep, as
12055 POSIX 1003.1-2001 has removed fgrep.
12056
120572002-10-04 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
12058
12059 * lib/bbitset.h (BITSET_WINDEX_MAX): Redefine so that it cannot be
12060 interpreted as signed.
12061 * lib/ebitset.c (ebitset_list): Fix bug.
12062
ff68026d
PE
120632002-10-01 Paul Eggert <eggert@twinsun.com>
12064
12065 More fixes for 64-bit hosts and large bitsets.
12066
12067 * lib/abitset.c (struct abitset_struct.n_bits, abitset_small_list,
12068 abitset_size, abitset_list, abitset_list_reverse, abitset_list):
12069 Use bitset_bindex, not int or unsigned int or size_t, to count bits.
12070 * lib/bbitset.h (struct bitset_vtable.size, struct bitset_vtable.count,
12071 struct bitset_vtable.list, struct bitset_vtable.list_reverse,
12072 bitset_count_, bitset_next, bitset_prev, bitset_first, bitset_last,
12073 bitset_count_): Likewise.
12074 * lib/bitset.h (bitset_iterator.num, bitset_iterator.i,
12075 bitset_first, bitset_last): Likewise.
12076 * lib/bitset_stats.c (bitset_stats_size, bitset_stats_list,
12077 bitset_stats_list_reverse, bitset_stats_size,
12078 bitset_stats_count, bitset_stats_list, bitset_stat_list_reverse):
12079 Likewise.
12080 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12081 * lib/bitsetv.c (bitsetv_alloc, bitsetv_create, bitsetv_free,
12082 bitsetv_zero, bitsetv_ones, bitsetv_transitive_closure,
12083 bitsetv_reflexive_transitive_closure): Likewise.
12084 * lib/bitsetv.h (bitsetv_alloc, bitsetv_create): Likewise.
12085 * lib/ebitset.c (ebitset_size, ebitset_list, ebitset_list_reverse):
12086 Likewise.
12087 * lib/lbitset.c (lbitset_size, lbitset_list, lbitset_list_merge):
12088 Likewise.
420f93c8 12089
ff68026d
PE
12090 * lib/abitset.c (abitset_ones, abitset_zero, abitset_bytes):
12091 Use size_t, not unsigned int, to count bytes.
12092 * lib/abitset.h (abitset_bytes): Likewise.
12093 * lib/bitset.c (bitset_bytes, bitset_alloc, bitset_obstack_alloc):
12094 Likewise.
12095 * lib/bitset.h (bitset_bytes): Likewise.
12096 * lib/bitset_stats.c (bitset_stats_bytes, bitset_stats_init): Likewise.
12097 * lib/bitset_stats.h (bitset_stats_bytes): Likewise.
12098 * lib/bitsetv.c (bitsetv_alloc): Likewise.
12099 * lib/ebitset.c (ebitset_bytes): Likewise.
12100 * lib/ebitset.h (ebitset_bytes): Likewise.
12101 * lib/lbitset.c (lbitset_bytes): Likewise.
12102 * lib/lbitset.h (lbitset_bytes): Likewise.
420f93c8 12103
ff68026d
PE
12104 * lib/abitset.c (abitset_empty_p, abitset_not, abitset_equal_p,
12105 abitset_subset_p, abitset_disjoint_p, abitset_and,
12106 abitset_and_cmp, abitset_andn, abitset_andn_cmp, abitset_or,
12107 abitset_or_cmp, abitset_xor, abitset_xor_cmp, abitset_and_or,
12108 abitset_and_or_cmp, abitset_andn_or, abitset_andn_or_cmp,
12109 abitset_or_and, abitset_or_and_cmp):
12110 Use bitset_windex instead of unsigned int.
12111 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12112 * lib/ebitset.c (struct ebitset_struct.size, ebitset_elts_grow,
12113 ebitset_elt_add, ebitset_elt_remove, ebitset_weed,
12114 ebitset_elt_find, ebitset_list_reverse, ebitset_list, ebitset_init):
12115 Likewise.
12116 * lib/lbitset.c (lbitset_ones, lbitset_not): Likewise.
420f93c8 12117
ff68026d
PE
12118 * lib/bitset.c (bitset_print):
12119 Use proper printf formats for widths of integer types.
12120 * lib/bitset_stats.c (bitset_percent_histogram_print,
12121 bitset_log_histogram_print, bitset_stats_print_1): Likewise.
12122 * lib/bitsetv-print.c (bitsetv_matrix_dump): Likewise.
12123 * lib/bitsetv.c (bitsetv_dump, debug_bitsetv): Likewise.
12124 * lib/lbitset.c (lbitset_bytes): Likewise.
420f93c8 12125
ff68026d
PE
12126 * lib/bbitset.h (BITSET_BINDEX_MAX, BITSET_WINDEX_MAX,
12127 BITSET_SIZE_MAX): New macros.
12128 (BITSET_INDEX_MAX): Remove. It wasn't right, since it assumed that
12129 sizeof (bitset_word) == sizeof (bitset_windex). All uses changed
12130 to BITSET_WINDEX_MAX.
12131
12132 * lib/bitset.c (bitset_next, bitset_prev, bitset_first,
12133 bitset_last): Return BITSET_BINDEX_MAX (not -1) for no value,
12134 since we now return the bitset_bindex type (not int).
12135
12136 * lib/bitsetv.c (bitsetv_alloc): Check for arithmetic overflow
12137 when computing sizes.
12138 * lib/ebitset.c (ebitset_elts_grow): Likewise.
12139
12140 * lib/lbitset.c (lbitset_elt_find): Simplify windex calculation
12141 and avoid cast to unsigned.
12142
6aa452a6
AD
121432002-09-30 Akim Demaille <akim@epita.fr>
12144
12145 * lib/abitset.c, lib/bbitset.h, lib/bitset.c, lib/bitset.h,
12146 * lib/bitset_stats.c, lib/bitsetv.c, lib/ebitset.c, lib/lbitset.c:
12147 Updates from Michael Hayes.
12148
927f7817
AD
121492002-09-30 Art Haas <ahaas@neosoft.com>
12150
12151 * configure.ac: Update AC_OUTPUT and AM_CONFIG_HEADER
12152 invocations.
12153 * tests/cxx-type.at (declarator): Don't rely on NDEBUG being not
12154 defined.
12155
9738f41e
AD
121562002-09-27 Akim Demaille <akim@epita.fr>
12157
12158 Version 1.49c.
12159
a5c75d7f
AD
121602002-09-27 Akim Demaille <akim@epita.fr>
12161
12162 * configure.ac (AM_INIT_AUTOMAKE): We _need_ 1.7.
12163 (Because of AC_LIBSOURCE).
12164
8280e179
AD
121652002-09-27 Akim Demaille <akim@epita.fr>
12166
12167 Playing with Autoscan.
12168
12169 * configure.ac: Remove the old LIBOBJ tweaks.
12170 (AC_REPLACE_FUNCS): Add strrchr and strtol.
12171 * lib/strrchr.c: New.
12172 * lib/strtol.c: New, from the Coreutils 4.5.1.
12173
ae64af35
AD
121742002-09-27 Akim Demaille <akim@epita.fr>
12175
12176 Playing with Autoscan.
12177
12178 * m4/prereq.m4 (jm_PREREQ_ARGMATCH, jm_FUNC_ARGMATCH): New.
12179 * lib/Makefile.am (libbison_a_SOURCES): No longer include
12180 argmatch.c and argmatch.h, since they are AC_LIBSOURCE'd.
12181 * lib/strcasecmp.c, lib/strncasecmp.c, lib/memcmp.c: New, from the
12182 Coreutils 4.5.1.
12183
d1a1114f
AD
121842002-09-24 Akim Demaille <akim@epita.fr>
12185
12186 * doc/bison.texinfo (Stack Overflow): xref to Recursion.
12187 (Frequently Asked Questions, Parser Stack Overflow): New.
12188
b906441c
AD
121892002-09-13 Akim Demaille <akim@epita.fr>
12190
12191 Playing with autoscan.
12192
12193 * src/reader.c (get_merge_function): Use xstrdup, not strdup.
12194 * src/files.c (skeleton_find): Remove, unused.
12195 * m4/memcmp.m4: New, from the Coreutils 4.5.1.
12196 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Run jm_FUNC_MEMCMP.
12197
bd701811
AD
121982002-09-13 Akim Demaille <akim@epita.fr>
12199
12200 * configure.ac (AM_INIT_AUTOMAKE): Require Automake 1.6.3.
12201 * Makefile.am (AUTOMAKE_OPTIONS): Don't.
12202
e0a13e7b
AD
122032002-09-13 Akim Demaille <akim@epita.fr>
12204
12205 * configure.ac: Require 2.54.
12206 s/jm_FUNC_MALLOC/AC_FUNC_MALLOC/.
12207 s/jm_FUNC_REALLOC/AC_FUNC_REALLOC/.
12208 * m4/c-bs-a.m4, m4/malloc.m4, m4/mbstate_t.m4, m4/realloc.m4:
12209 Remove, provided by Autoconf macros.
12210
c97011bf
AD
122112002-09-12 Akim Demaille <akim@epita.fr>
12212
12213 * m4/prereq.m4: Update, from Coreutils 4.5.1.
12214
d862b1be
AD
122152002-09-12 Akim Demaille <akim@epita.fr>
12216
12217 * m4/prereq.m4: Update, from Fileutils 4.1.5.
12218 * configure.ac (jm_PREREQ_TEMPNAME): Invoke it.
12219 Reported by Martin Mokrejs.
12220
3d38c03a
AD
122212002-09-10 Akim Demaille <akim@epita.fr>
12222
12223 * src/parse-gram.y: Associate a human readable string to each
12224 token type.
12225 * tests/regression.at (Invalid inputs): Adjust.
12226
b6347355
AD
122272002-09-10 Gary V. Vaughan <gary@gnu.org>
12228
12229 * tests/Makefile.am ($(srcdir)/package.m4): Bison now ships
12230 with an Autoconf-2.5x style configure.ac.
12231
09ba4ab2
PE
122322002-09-06 Paul Eggert <eggert@twinsun.com>
12233
12234 * doc/bison.texinfo (Conditions): Make explicit that the GPL
12235 exception applies only to yacc.c. This is a modification of a
12236 patch originally suggested by Akim Demaille.
12237
21846f69
AD
122382002-09-06 Akim Demaille <akim@epita.fr>
12239
09ba4ab2
PE
12240 * data/c.m4 (b4_copyright): Move the GPL exception comment from
12241 here to...
12242 * data/yacc.c: here.
12243
21846f69
AD
12244 * data/lalr1.cc (struct yyltype): Don't define it, since we use
12245 LocationType.
12246 (b4_ltype): Default to yy::Location from location.hh.
12247
c0ad8bf3
AD
122482002-09-04 Jim Meyering <jim@meyering.net>
12249
12250 * data/yacc.c: Guard the declaration of yytoknum also with
12251 `#ifdef YYPRINT', so it is declared only when used.
12252
3a93251e
AD
122532002-09-04 Akim Demaille <akim@epita.fr>
12254
12255 * configure.in: Rename as...
12256 * configure.ac: this.
12257 Bump to 1.49c.
12258
427c0dda
AD
122592002-09-04 Akim Demaille <akim@epita.fr>
12260
12261 * src/assoc.c, src/closure.c, src/gram.c, src/injections.c,
12262 * src/lalr.c, src/LR0.c, src/relation.c, src/tables.c: Don't
12263 translate maintainer only messages.
12264
6a254321
PE
122652002-08-12 Paul Eggert <eggert@twinsun.com>
12266
645e30d1
PE
12267 Version 1.49b.
12268
6a254321
PE
12269 * Makefile.am (SUBDIRS): Remove intl.
12270 (DISTCLEANFILES): Remove.
12271 * NEWS: Mention that GNU M4 is now required. Clarify what is
12272 meant by "larger grammars". Mention the pt_BR translation.
12273 * configure.in (AC_CHECK_DECLS): Add getenv, getopt.
12274 (AM_GNU_GETTEXT_VERSION): New macro, replacing GETTEXT_VERSION var.
12275 Bump version from 0.11.2 to 0.11.5.
12276 (BISON_PREREQ_STAGE): Remove.
12277 (AM_GNU_GETTEXT): Use external gettext.
12278 (AC_OUTPUT): Remove intl/Makefile.
12279
12280 * config/depcomp, config/install-sh: Sync with Automake 1.6.3.
12281
12282 * data/glr.c: Include string.h, for strlen.
12283 (yyreportParseError): Use size_t for yysize.
12284 (yy_yypstack): No longer nested inside yypstates, as nested
12285 functions are not portable. Do not assume size_t is the
12286 same width as int.
12287 (yypstates): Do not assume that ptrdiff_t is the same width
12288 as int, and similarly for yyposn and YYINDEX.
12289
12290 * data/yacc.c: Fix comment about `$$ = $1': it can copy garbage.
12291
12292 * lib/Makefile.am (INCLUDES): Do not include from the intl
12293 directory, which has been removed.
12294 * src/Makefile.am (INCLUDES): Likewise.
12295
12296 * lib/Makefile.am (libbison_a_SOURCES): Add unlocked-io.h.
12297 (bitsets_sources, additional_bitsets_sources, timevars_sources):
12298 New vars.
12299
12300 * lib/Makefile.am (libbison_a_SOURCES): Avoid +=, a GNU make extension.
12301 * tests/Makefile.am (EXTRA_DIST): Likewise.
12302
12303 * lib/abitset.c (abitset_reverse_list, ebitset_reverse_list):
12304 Do not assume that bitset_windex is the same width as unsigned.
12305
12306 * lib/abitset.c (abitset_unused_clear): Do not assume that
12307 bitset_word is the same width as int.
12308 * lib/bbitset.h (BITSET_INDEX_MAX, BITSET_MSB): Likewise.
12309 * lib/bitset.h (bitset_set, bitset_reset): Likewise.
12310 * lib/bitset_stats.c (bitset_stats_set, bitset_stats_reset): Likewise.
12311 * lib/ebitset.c (ebitset_set, ebitset_reset): Likewise.
12312 * lib/lbitset.c (lbitset_set, lbitset_reset): Likewise.
12313
12314 * lib/abitset.c (abitset_op1): Use -1, not ~0, as memset arg (for
12315 portability to one's complement hosts!).
12316 * lib/ebitset.c (ebitset_op1): Likewise.
12317 * lib/lbitset.c (lbitset_op1): Likewise.
12318
12319 * lib/argmatch.c, lib/quotearg.c, quotearg.h: Sync with GNU tar.
12320 * lib/argmatch.h, lib/basename.c, lib/dirname.c, lib/dirname.h,
12321 lib/hash.c, lib/hash.h, lib/strnlen.c, lib/xmalloc.c:
12322 Sync with fileutils.
12323 * lib/error.c, lib/getopt.c, lib/getopt.h, lib/getopt1.c,
12324 lib/gettext.h: Sync with diffutils.
12325
12326 * lib/memrchr.c, lib/mkstemp.c, lib/strchr.c, lib/strnlen.c,
12327 lib/strspn.c, lib/tempname.c: Use GPL, not LGPL.
12328
12329 * lib/obstack.c, lib/obstack.h: Sync with fileutils, except use
12330 PROTOTYPES to check for prototypes, and "defined __STDC__" to
12331 check for void *.
12332
12333 * lib/bbitset.h (BITSET_WORD_BITS): Now of type unsigned, not
12334 size_t; the old version tried to do this but casted improperly.
12335 (bitset_bindex, bitset_windex): Now size_t, not unsigned long.
12336 (bitset_test): Now returns int, not unsigned long.
12337
12338 * lib/bitset_stats.c: Include "gettext.h".
12339 (_): New macro.
12340 (bitset_stats_set, bitset_stats_reset, bitset_stats_test): Don't
12341 name locals "index", as it generates unnecessary warnings on some
12342 hosts that have an "index" function.
12343
12344 * lib/bitset_stats.c (bitset_stats_print_1, bitset_stats_print,
12345 bitset_stats_read, bitset_stats_write): Wrap strings in _() if
12346 they need translation.
12347 * src/LR0.c (state_list_append, new_itemsets, get_state,
12348 append_states, generate_states): Likewise.
12349 * src/assoc.c (assoc_to_string): Likewise.
12350 * src/closure.c (print_closure, set_firsts, closure): Likewise.
12351 * src/gram.c (grammar_dump): Likewise.
12352 * src/injections.c (injections_compute): Likewise.
12353 * src/lalr.c (lookaheads_print): Likewise.
12354 * src/relation.c (relation_transpose): Likewise.
12355 * src/scan-gram.l: Likewise.
12356 * src/tables.c (table_grow, pack_vector): Likewise.
12357
12358 * m4/Makefile.am (EXTRA_DIST): Remove codeset.m4,
12359 glibc21.m4, isc-posix.m4 lcmessage.m4, stage.m4.
12360 * m4/malloc.m4, m4/realloc.m4: Sync with diffutils.
12361 * m4/mbstate_t.m4: Sync with fileutils.
12362 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): AC_MBSTATE_T -> AC_TYPE_MBSTATE_T.
12363
12364 * po/LINGUAS: Add pt_BR.
12365 * po/POTFILES.in: Add src/assoc.c, src/closure.c, src/gram.c,
12366 src/main.c, src/relation.c, src/state.c, lib/bitset_stats.c,
12367 lib/timevar.c.
12368 Use src/parse-gram.y instead of src/parse-gram.c, as the gettext
12369 manual recommends.
12370 Similarly, use src/scan-gram.l instead of src/scan-gram.c.
12371
12372 * src/complain.c (strerror_r): Remove decl; not needed.
12373 (strerror): Use same pattern as ../lib/error.c.
12374
12375 * src/files.c, src/files.h (compute_header_macro): Remove; unused.
12376
12377 * src/gram.c (grammar_dump): Do not assume ptrdiff_t fits in int.
12378
12379 * src/main.c (main): Cast result of bindtextdomain and textdomain
12380 to void, to avoid a GCC warning when --disable-nls is in effect.
12381
12382 * src/scan-gram.l: Use strings rather than escapes when possible,
12383 to minimize the number of warnings from xgettext.
12384 (handle_action_dollar, handle_action_at): Don't use isdigit,
12385 as it mishandles negative chars and it may not work as expected
12386 outside the C locale.
12387
12388 * src/symtab.c (symbol_get): Don't cast LHS of an assignment;
12389 this is a GCC extension and is not portable to other compilers.
12390
12391 * src/system.h (alloca): Use same pattern as ../lib/error.c.
12392 Do not include <ctype.h>; no longer needed.
12393 Do not include <malloc.h>; no longer needed (and generates
12394 warnings on OpenBSD 3.0).
12395
12396 * tests/cxx-type.at (yylex): Do not pass signed char to isupper;
12397 it's not portable.
12398
12399 * tests/regression.at: Do not use 'cc -c input.c -o input';
12400 Sun C rejects this. Instead, use 'cc -c input.c -o input.o'.
12401
12402 * tests/synclines.at (AC_SYNCLINES_COMPILE): Accept any nonzero
12403 exit status as failure, not just exit status 1. Sun C exits
12404 with status 2 sometimes.
12405
12406 * tests/torture.at (AT_INCREASE_DATA_SIZE): New macro.
12407 Use it for the two large tests.
12408
c8f002c7
AD
124092002-08-02 Akim Demaille <akim@epita.fr>
12410
12411 * src/conflicts.c (conflicts_output): Don't output rules never
12412 reduced here, since anyway that computation doesn't work.
12413 * src/gram.h, src/gram.h (rule_filter_t, rule_useful_p)
12414 (rule_useless_p, rule_never_reduced_p): New.
12415 (grammar_rules_partial_print): Use a filter instead of a range.
12416 Display the title only if needed.
12417 (grammar_rules_print): Adjust.
12418 (grammar_rules_never_reduced_report): New.
12419 * src/tables.c (action_row): Move the computation of rules never
12420 reduced to...
12421 (token_actions): here.
12422 * src/main.c (main): Make the parser before making the report, so
12423 that rules never reduced are computed.
12424 Call grammar_rules_never_reduced_report.
12425 * src/print.c (print_results): Report rules never reduced.
12426 * tests/conflicts.at, tests/reduce.at: Adjust.
12427
cd08e51e
AD
124282002-08-01 Akim Demaille <akim@epita.fr>
12429
12430 Instead of attaching lookaheads and duplicating the rules being
12431 reduced by a state, attach the lookaheads to the reductions.
12432
12433 * src/state.h (state_t): Remove the `lookaheads',
12434 `lookaheads_rule' member.
12435 (reductions_t): Add a `lookaheads' member.
12436 Use a regular array for the `rules'.
12437 * src/state.c (reductions_new): Initialize the lookaheads member
12438 to 0.
12439 (state_rule_lookaheads_print): Adjust.
12440 * src/state.h, src/state.c (state_reductions_find): New.
12441 * src/conflicts.c (resolve_sr_conflict, set_conflicts)
12442 (count_rr_conflicts): Adjust.
12443 * src/lalr.c (LArule): Remove.
12444 (add_lookback_edge): Adjust.
12445 (state_lookaheads_count): New.
12446 (states_lookaheads_initialize): Merge into...
12447 (initialize_LA): this.
12448 (lalr_free): Adjust.
12449 * src/main.c (main): Don't free nullable and derives too early: it
12450 is used by --verbose.
12451 * src/print.c, src/print_graph.c, src/tables.c: Adjust.
12452
bb0027a9
AD
124532002-08-01 Akim Demaille <akim@epita.fr>
12454
12455 * src/derives.h, src/derives.c (derives): A `rule_t***' instead of
12456 `rule_number_t**'.
12457 (set_derives, free_derives): Rename as...
12458 (derives_compute, derives_free): this.
12459 Adjust all dependencies.
12460 * src/nullable.c (set_nullable, free_nullable): Rename as...
12461 (nullable_compute, nullable_free): these.
12462 (rule_list_t): Store rule_t *, not rule_number_t.
12463 * src/state.c (state_rule_lookaheads_print): Directly compare rule
12464 pointers, instead of their numbers.
12465 * src/main.c (main): Call nullable_free, and derives_free earlier,
12466 as they were lo longer used.
12467
3325ddc4
AD
124682002-08-01 Akim Demaille <akim@epita.fr>
12469
12470 * lib/timevar.c (get_time): Include children time.
12471 * src/lalr.h (LA, LArule): Don't export them: used with the
12472 state_t.
12473 * src/lalr.c (LA, LArule): Static.
12474 * src/lalr.h, src/lalr.c (lalr_free): New.
12475 * src/main.c (main): Call it.
12476 * src/tables.c (pack_vector): Check whether loc is >= to the
12477 table_size, not >.
12478 (pack_tables): Don't free froms, tos, conflict_tos, and pos...
12479 (tables_generate): do it, since that's also it which allocates
12480 them.
12481 Don't free LA and LArule, main does.
12482
c6f1a33c
AD
124832002-07-31 Akim Demaille <akim@epita.fr>
12484
12485 Separate parser tables computation and output.
12486
12487 * src/output.c (nvectors, base_t, base, base_ninf, conflict_table)
12488 (conflict_list, conflict_list_cnt, table, check, table_ninf)
12489 (yydefgoto, yydefact, high): Move to...
12490 * src/tables.h, src/tables.c: here.
12491 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12492 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12493 (symbol_number_to_vector_number, nvectors, BASE_MAX, BASE_MIN)
12494 (froms, tos, conflict_tos, tally, width, action_t, ACTION_MAX)
12495 (ACTION_MIN, actrow, order, nentries, pos, conflrow)
12496 (conflict_list_free, table_size, lowzero, table_grow, conflict_row)
12497 (action_row, save_row, token_actions, save_column, default_goto)
12498 (goto_actions, sort_actions, matching_state, pack_vector)
12499 (table_ninf_remap, pack_table, prepare_actions): Move to...
12500 * src/tables.c: here.
12501 * src/tables.h, src/tables.c(tables_generate, tables_free): New.
12502 * src/output.c (token_actions, output_base, output_conflicts)
12503 (output_check): Merge into...
12504 (prepare_actions): this.
12505 (actions_output): Rename as...
12506 (user_actions_output): this.
12507 * src/main.c (main): Call tables_generate and tables_free.
12508
1509d42f
AD
125092002-07-31 Akim Demaille <akim@epita.fr>
12510
12511 Steal GCC's --time-report support.
12512
12513 * lib/timevar.c, lib/timevar.h, lib/timevar.def: New,
12514 stolen/adjusted from GCC.
12515 * m4/stage.m4: Remove time related checks.
12516 * m4/timevar.m4: New.
12517 * configure.in: Adjust.
12518 * src/system.h: Adjust to using timevar.h.
12519 * src/getargs.h, src/getargs.c: Support trace_time for
12520 --trace=time.
12521 * src/main.c (stage): Remove.
12522 (main): Replace `stage' invocations with timevar calls.
12523 * src/output.c: Insert pertinent timevar calls.
12524
273a74fa
AD
125252002-07-31 Akim Demaille <akim@epita.fr>
12526
12527 Let --trace have arguments.
12528
12529 * src/getargs.h (enum trace_e): New.
12530 * src/getargs.c (trace_args, trace_types, trace_argmatch): New.
12531 (long_options, short_options): --trace/-T takes an optional
12532 argument.
12533 Change all the uses of trace_flag to reflect the new flags.
12534 * tests/sets.at (Firsts, Nullable, Broken Closure): Use --trace=sets.
12535
12536 Strengthen `stage' portability.
12537
12538 * m4/stage.m4 (BISON_PREREQ_STAGE): New.
12539 * configure.in: Use it.
12540 Don't check for malloc.h and sys/times.h.
12541 * src/system.h: Include them when appropriate.
12542 * src/main.c (stage): Compile only when mallinfo, struct mallinfo,
12543 times and struct tms are available.
12544
217598da
AD
125452002-07-30 Akim Demaille <akim@epita.fr>
12546
12547 In verbose parse error message, don't report `error' as an
12548 expected token.
12549 * tests/actions.at (Printers and Destructors): Adjust.
12550 * tests/calc.at (Calculator $1): Adjust.
12551 * data/yacc.c, data/glr.c, data/lalr1.c: When making the verbose
12552 error message, do not report the parser accepts the error token in
12553 that state.
12554
52489d44
AD
125552002-07-30 Akim Demaille <akim@epita.fr>
12556
12557 Normalize conflict related messages.
12558
12559 * src/complain.h, src/complain.c (warn, complain): New.
12560 * src/conflicts.c (conflicts_print): Use them.
12561 (conflict_report_yacc): New, extracted from...
12562 (conflicts_print): here.
12563 * tests/conflicts.at, tests/existing.at: Adjust.
12564
e8832397
AD
125652002-07-30 Akim Demaille <akim@epita.fr>
12566
12567 Report rules which are never reduced by the parser: those hidden
12568 by conflicts.
12569
12570 * src/LR0.c (save_reductions): Don't make the final state too
12571 different: save its reduction (accept) instead of having a state
12572 without any action (no shift or goto, no reduce).
12573 Note: the final state is now a ``regular'' state, i.e., the
12574 parsers now contain `reduce 0' as default reduction.
12575 Nevertheless, since they decide to `accept' when yystate =
12576 final_state, they still will not reduce rule 0.
12577 * src/print.c (print_actions, print_reduction): Adjust.
12578 * src/output.c (action_row): Track reduced rules.
12579 (token_actions): Report rules never reduced.
12580 * tests/conflicts.at, tests/regression.at: Adjust.
12581
caf23d24
AD
125822002-07-30 Akim Demaille <akim@epita.fr>
12583
12584 `stage' was accidently included in a previous patch.
12585 Initiate its autoconfiscation.
12586
12587 * configure.in: Look for malloc.h and sys/times.h.
12588 * src/main.c (stage): Adjust.
12589 Report only when trace_flag.
12590
640748ee
AD
125912002-07-29 Akim Demaille <akim@epita.fr>
12592
12593 * src/state.h, src/state.c (transitions_t): Holds state_t*'s, not
12594 state_number_t.
12595 (errs_t): symbol_t*, not symbol_number_t.
12596 (reductions_t): rule_t*, not rule_number_t.
12597 (FOR_EACH_SHIFT): New.
12598 * src/LR0.c, src/conflicts.c, src/lalr.c, src/output.c
12599 * src/print.c, src/print_graph.c: Adjust.
12600
88bce5a2
AD
126012002-07-29 Akim Demaille <akim@epita.fr>
12602
12603 Use $accept and $end, as BYacc and BTYacc do, instead of $axiom and $.
12604
12605 * src/symtab.h, src/symtab.c (eoftoken, axiom): Rename as...
12606 (endtoken, accept): these.
12607 * src/reader.c (reader): Set endtoken's default tag to "$end".
12608 Set undeftoken's tag to "$undefined" instead of "$undefined.".
12609 * doc/bison.texinfo (Table of Symbols): Mention $accept and $end.
12610 Adjust.
12611
1bfb97db
AD
126122002-07-29 Akim Demaille <akim@epita.fr>
12613
12614 * src/reduce.c (reduce_grammar): When the language is empty,
12615 complain about the start symbol, not the axiom.
12616 Use its location.
12617 * tests/reduce.at (Empty Language): New.
12618
fc5734fe
AD
126192002-07-26 Akim Demaille <akim@epita.fr>
12620
12621 * src/reader.h, src/reader.c (gram_error): ... can't get
12622 yycontrol without making too strong assumptions on the parser
12623 itself.
12624 * src/output.c (prepare_tokens): Use the real 0th value of
12625 token_translations instead of `0'.
12626 * src/parse-gram.y (yyerror): Don't rely on yycontrol being
12627 visible here.
12628 * data/yacc.c (yyreport_parse_error): Rename yylocation as yylloc
12629 for the time being: %locations ought to provide it to yyerror.
12630
3650b4b8
AD
126312002-07-25 Akim Demaille <akim@epita.fr>
12632
12633 * src/output.c (prepare_tokens): Go up to ntokens, not ntokens + 1.
12634 * doc/bison.texinfo (Decl Summary): s/$illegal/$undefined./.
12635 * tests/regression.at (Web2c Actions): Adjust.
12636
4b3d3a8e
AD
126372002-07-25 Akim Demaille <akim@epita.fr>
12638
12639 Stop storing rules from 1 to nrules + 1.
12640
12641 * src/LR0.c, src/closure.c, src/derives.c, src/gram.c, src/lalr.c
12642 * src/nullable.c, src/output.c, src/print.c, src/reader.c
12643 * src/reduce.c: Allocate and free from &rules[0], not &rules[1].
12644 Iterate from 0 to nrules.
12645 Use rule_number_as_item_number and item_number_as_rule_number.
12646 Adjust to `derive' now containing possibly 0.
12647 * src/gram.h (rule_number_as_item_number, item_number_as_rule_number):
12648 Handle the `- 1' part in rule numbers from/to item numbers.
12649 * src/conflicts.c (log_resolution): Fix the message which reversed
12650 shift and reduce.
12651 * src/output.c (action_row): Initialize default_rule to -1.
12652 (token_actions): Adjust.
12653 * tests/sets.at (Nullable, Firsts): Fix the previously bogus
12654 expected output.
12655 * tests/conflicts.at (Resolved SR Conflicts): Likewise.
12656
4a2a22f4
AD
126572002-07-25 Akim Demaille <akim@epita.fr>
12658
12659 * data/c.m4 (b4_c_function, b4_c_ansi_args, b4_c_ansi_arg)
12660 (b4_c_knr_arg_names, b4_c_knr_arg_name, b4_c_knr_arg_decls)
12661 (b4_c_knr_arg_decl): New.
12662 * data/yacc.c: Use it to define yysymprint, yydestruct, and
12663 yyreport_parse_error.
12664
b8df3223
AD
126652002-07-25 Akim Demaille <akim@epita.fr>
12666
12667 * data/yacc.c (yyreport_parse_error): New, extracted from...
12668 (yyparse): here.
12669 (yydestruct, yysymprint): Move above yyparse.
12670 Be K&R compliant.
12671
a762e609
AD
126722002-07-25 Akim Demaille <akim@epita.fr>
12673
12674 * data/c.m4 (b4_ints_in, b4_int_type, b4_int_type_for): New,
12675 replace...
12676 (b4_sint_type, b4_uint_type): these.
12677 * data/yacc.c, data/glr.c, data/lalr1.cc: Use b4_int_type_for.
12678 * tests/regression.at (Web2c Actions): Adjust.
12679
12b0043a
AD
126802002-07-25 Akim Demaille <akim@epita.fr>
12681
12682 * src/gram.h (TIEM_NUMBER_MAX): New.
12683 (item_number_of_rule_number, rule_number_of_item_number): Rename
12684 as...
12685 (rule_number_as_item_number, item_number_as_rule_number): these.
12686 Adjust dependencies.
12687 * src/output.c (vector_number_t, VECTOR_NUMBER_MAX)
12688 (VECTOR_NUMBER_MIN, state_number_to_vector_number)
12689 (symbol_number_to_vector_number): New.
12690 (order): Of vector_number_t* type.
12691 (base_t, BASE_MAX, BASE_MIN): New.
12692 (froms, tos, width, pos, check): Of base_t type.
12693 (action_number_t, ACTION_MIN, ACTION_MAX): New.
12694 (actrow): Of action_number_t type.
12695 (conflrow): Of unsigned int type.
12696 (table_ninf, base_ninf): New.
12697 (GENERATE_MUSCLE_INSERT_TABLE): Also output the `*_min' value.
12698 (muscle_insert_int_table, muscle_insert_base_table)
12699 (muscle_insert_rule_number_table): New.
12700 (prepare_tokens): Output `toknum' as int_table.
12701 (action_row): Returns a rule_number_t.
12702 Use ACTION_MIN, not SHRT_MIN.
12703 (token_actions): yydefact is rule_number_t*.
12704 (table_ninf_remap): New.
12705 (pack_table): Use it for `base' and `table'.
12706 * data/yacc.c, data/glr.c, data/lalr1.cc (YYFLAG): Remove,
12707 replaced with...
12708 (YYPACT_NINF, YYTABLE_NINF): these.
12709 (yypact, yytable): Compute their types instead of hard-coded
12710 `short'.
12711 * tests/regression.at (Web2c Actions): Adjust.
12712
5dde258a
AD
127132002-07-19 Akim Demaille <akim@epita.fr>
12714
12715 * src/scan-gram.l (id): Can start with an underscore.
12716
a945ec39
AD
127172002-07-16 Akim Demaille <akim@epita.fr>
12718
12719 * src/assoc.c, src/asssoc.h (assoc_t, assoc_to_string): New.
12720 Adjust all former `associativity' dependencies.
12721 * src/symtab.c (symbol_new): Default associativity is `undef', not
12722 `right'.
12723 (symbol_check_alias_consistence): Adjust.
12724
fae437e8
AD
127252002-07-09 Akim Demaille <akim@epita.fr>
12726
12727 * doc/bison.texinfo: Properly set the ``header'' part.
12728 Use @dircategory ``GNU programming tools'' as per Texinfo's
12729 documentation.
12730 Use @copying.
12731
1a715ef2
AD
127322002-07-09 Akim Demaille <akim@epita.fr>
12733
12734 * lib/quotearg.h: Protect against multiple inclusions.
12735 * src/location.h (location_t): Add a `file' member.
12736 (LOCATION_RESET, LOCATION_PRINT): Adjust.
12737 * src/complain.c (warn_at, complain_at, fatal_at): Drop
12738 `error_one_per_line' support.
12739
a5d50994
AD
127402002-07-09 Akim Demaille <akim@epita.fr>
12741
12742 * src/complain.h, src/complain.c (warn, complain): Remove, unused.
12743 * src/reader.c (lineno): Remove.
12744 Adjust all dependencies.
12745 (get_merge_function): Take a location and use complain_at.
12746 * src/symtab.h, src/symtab.c (symbol_make_alias): Likewise.
12747 * tests/regression.at (Invalid inputs, Mixing %token styles):
12748 Adjust.
12749
b275314e
AD
127502002-07-09 Akim Demaille <akim@epita.fr>
12751
12752 * src/parse-gram.y (rules_or_grammar_declaration): Add an error
12753 recovery rule, and forbid extensions when --yacc.
12754 (gram_error): Use complain_at.
12755 * src/reader.c (reader): Exit if there were parse errors.
12756
865b9df1
AD
127572002-07-09 Akim Demaille <akim@epita.fr>
12758
12759 * tests/synclines.at (AT_SYNCLINES_COMPILE): New.
12760 (AT_TEST_SYNCLINE): Adjust to unusual GCC outputs.
12761 Reported by R Blake <blakers@mac.com>.
12762
c76e14da
AD
127632002-07-09 Akim Demaille <akim@epita.fr>
12764
12765 * data/yacc.c: Output the copyright notive in the header.
12766
7db2ed2d
AD
127672002-07-03 Akim Demaille <akim@epita.fr>
12768
12769 * src/output.c (froms, tos): Are state_number_t.
12770 (save_column): sp, sp1, and sp2 are state_number_t.
12771 (prepare): Rename `final' as `final_state_number', `nnts' as
12772 `nterms_number', `nrules' as `rules_number', `nstates' as
12773 `states_number', and `ntokens' as `tokens_number'. Remove `nsym',
12774 unused.
12775 * data/yacc.c, data/glr.c, data/lalr1.cc: Adjust.
12776 * data/lalr1.cc (nsym_): Remove, unused.
12777
e68e0410
AD
127782002-07-03 Akim Demaille <akim@epita.fr>
12779
12780 * src/lalr.h, src/lalr.c (goto_number_t): New.
12781 * src/lalr.c (goto_list_t): New.
12782 Propagate them.
12783 * src/nullable.c (rule_list_t): New.
12784 Propagate.
12785 * src/types.h: Remove.
12786
e1a4f3a4
AD
127872002-07-03 Akim Demaille <akim@epita.fr>
12788
12789 * src/closure.c (print_fderives): Use rule_rhs_print.
12790 * src/derives.c (print_derives): Use rule_rhs_print.
12791 (rule_list_t): New, replaces `shorts'.
12792 (set_derives): Add comments.
12793 * tests/sets.at (Nullable, Firsts): Adjust.
12794
536545f3
AD
127952002-07-03 Akim Demaille <akim@epita.fr>
12796
12797 * src/output.c (prepare_actions): Free `tally' and `width'.
12798 (prepare_actions): Allocate and free `order'.
12799 * src/symtab.c (symbols_free): Free `symbols'.
12800 * src/scan-gram.l (scanner_free): Clear Flex's scanners memory.
12801 * src/output.c (m4_invoke): Move to...
12802 * src/scan-skel.l: here.
12803 (<<EOF>>): Close yyout, and free its name.
12804
8b752b00
AD
128052002-07-03 Akim Demaille <akim@epita.fr>
12806
12807 Fix some memory leaks, and fix a bug: state 0 was examined twice.
12808
12809 * src/LR0.c (new_state): Merge into...
12810 (state_list_append): this.
12811 (new_states): Merge into...
12812 (generate_states): here.
12813 (set_states): Don't ensure a proper `errs' state member here, do it...
12814 * src/conflicts.c (conflicts_solve): here.
12815 * src/state.h, src/state.c: Comment changes.
12816 (state_t): Rename member `shifts' as `transitions'.
12817 Adjust all dependencies.
12818 (errs_new): For consistency, also take the values as argument.
12819 (errs_dup): Remove.
12820 (state_errs_set): New.
12821 (state_reductions_set, state_transitions_set): Assert that no
12822 previous value was assigned.
12823 (state_free): New.
12824 (states_free): Use it.
12825 * src/conflicts.c (resolve_sr_conflict): Don't use an `errs_t' as
12826 temporary storage: use `errs' and `nerrs' as elsewhere.
12827 (set_conflicts): Allocate and free this `errs'.
12828
613f5e1a
AD
128292002-07-02 Akim Demaille <akim@epita.fr>
12830
12831 * lib/libiberty.h: New.
12832 * lib: Update the bitset implementation from upstream.
12833 * src/closure.c, src/lalr.c, src/output.c, src/print_graph.c,
12834 * src/state.c: Use BITSET_FOR_EACH, not BITSET_EXECUTE.
12835 * src/main.c: Adjust bitset stats calls.
12836
26e0cadc
PE
128372002-07-01 Paul Eggert <eggert@twinsun.com>
12838
12839 * src/scan-gram.l (<SC_ESCAPED_CHARACTER>): Convert to unsigned
12840 char, so that negative chars don't collide with $.
12841
1154cced
AD
128422002-06-30 Akim Demaille <akim@epita.fr>
12843
12844 Have the GLR tests be `warning' checked, and fix the warnings.
12845
12846 * data/glr.c (YYFPRINTF): Always define it, not only when YYDEBUG
12847 (yyuserAction, yyreportAmbiguity): `Use' all the arguments.
12848 (yyremoveDeletes): `yyi' and `yyj' are size_t.
12849 Use YYFPRINTF when under if (YYDEBUG) to avoid empty `if' bodies.
12850 (yyaddDeferredAction): static.
12851 (yyglrReduce): yyi, yyk, amd yyposn are size_t.
12852 (yyreportParseError): yyprefix is const.
12853 yytokenp is used only when verbose.
12854 (yy__GNUC__): Replace with __GNUC__.
12855 (yypdumpstack): yyi is size_t.
12856 (yypreference): Un-yy local variables and arguments, to avoid
12857 clashes with `yyr1'. Anyway, we are not in the user name space.
12858 (yytname_size): be an int, as is compared with ints.
12859 * tests/testsuite.at (AT_COMPILE, AT_PARSER_CHECK): New.
12860 Use them.
12861 * tests/cxx-gram.at: Use quotation to protect $1.
12862 Use AT_COMPILE to enable warnings hunts.
12863 Prototype yylex and yyerror.
12864 `Use' argc.
12865 Include `string.h', not `strings.h'.
12866 Produce and prototype stmtMerge only when used.
12867 yylex takes a location.
12868
97650f4e
AD
128692002-06-30 Akim Demaille <akim@epita.fr>
12870
12871 We spend a lot of time in quotearg, in particular when --verbose.
12872
12873 * src/symtab.c (symbol_get): Store a quoted version of the key.
12874 (symbol_tag_get, symbol_tag_get_n, symbol_tag_print): Remove.
12875 Adjust all callers.
12876
d2576365
AD
128772002-06-30 Akim Demaille <akim@epita.fr>
12878
12879 * src/state.h (reductions_t): Rename member `nreds' as num.
12880 (errs_t): Rename members `nerrs' and `errs' as `num' and `symbols'.
12881 * src/state.c (ERRS_ALLOC, REDUCTIONS_ALLOC): Use the correct types.
12882
ccaf65bc
AD
128832002-06-30 Akim Demaille <akim@epita.fr>
12884
12885 * src/state.h, src/state.c (shift_t, SHIFT_SYMBOL, SHIFT_IS_SHIFT)
12886 (SHIFT_IS_GOTO, SHIFT_IS_ERROR, SHIFT_DISABLE, SHIFT_IS_DISABLED)
12887 (shifts_to): Rename as...
12888 (transition_t, TRANSITION_SYMBOL, TRANSITION_IS_TRANSITION)
12889 (TRANSITION_IS_GOTO, TRANSITION_IS_ERROR, TRANSITION_DISABLE)
12890 (TRANSITION_IS_DISABLED, transitions_to): these.
12891
87675353
AD
128922002-06-30 Akim Demaille <akim@epita.fr>
12893
12894 * src/print.c (print_shifts, print_gotos): Merge into...
12895 (print_transitions): this.
12896 (print_transitions, print_errs, print_reductions): Align the
12897 lookaheads columns.
12898 (print_core, print_transitions, print_errs, print_state,
12899 print_grammar): Output empty lines separator before, not after.
12900 (state_default_rule_compute): Rename as...
12901 (state_default_rule): this.
12902 * tests/conflicts.at (Defaulted Conflicted Reduction),
12903 (Unresolved SR Conflicts, Resolved SR Conflicts): Adjust.
12904 * tests/regression.at (Rule Line Numbers, Web2c Report): Adjust.
12905
ce4ccb4b
AD
129062002-06-30 Akim Demaille <akim@epita.fr>
12907
12908 Display items as we display rules.
12909
12910 * src/gram.h, src/gram.c (rule_lhs_print): New.
12911 * src/gram.c (grammar_rules_partial_print): Use it.
12912 * src/print.c (print_core): Likewise.
12913 * tests/conflicts.at (Defaulted Conflicted Reduction),
12914 (Unresolved SR Conflicts): Adjust.
12915 (Unresolved SR Conflicts): Adjust and rename as...
12916 (Resolved SR Conflicts): this, as was meant.
12917 * tests/regression.at (Web2c Report): Adjust.
12918
bc933ef1
AD
129192002-06-30 Akim Demaille <akim@epita.fr>
12920
12921 * src/print.c (state_default_rule_compute): New, extracted from...
12922 (print_reductions): here.
12923 Pessimize, but clarify the code.
12924 * tests/conflicts.at (Defaulted Conflicted Reduction): New.
12925
53d4308d
AD
129262002-06-30 Akim Demaille <akim@epita.fr>
12927
12928 * src/output.c (action_row): Let default_rule be always a rule
12929 number.
12930
574fb2d5
AD
129312002-06-30 Akim Demaille <akim@epita.fr>
12932
12933 * src/closure.c (print_firsts, print_fderives, closure):
12934 Use BITSET_EXECUTE.
12935 * src/lalr.c (lookaheads_print): Likewise.
12936 * src/state.c (state_rule_lookaheads_print): Likewise.
12937 * src/print_graph.c (print_core): Likewise.
12938 * src/print.c (print_reductions): Likewise.
12939 * src/output.c (action_row): Likewise.
12940 Use SHIFT_IS_DISABLED, SHIFT_IS_SHIFT and SHIFT_SYMBOL.
12941
05811fd7
AD
129422002-06-30 Akim Demaille <akim@epita.fr>
12943
12944 * src/print_graph.c: Use report_flag.
12945
0e4d5753
AD
129462002-06-30 Akim Demaille <akim@epita.fr>
12947
12948 * src/lalr.c (traverse, digraph, matrix_print, transpose): Move
12949 to...
12950 * src/relation.h, src/relation.c (traverse, relation_digraph)
12951 (relation_print, relation_transpose): New.
12952
24c7d800
AD
129532002-06-30 Akim Demaille <akim@epita.fr>
12954
12955 * src/state.h, src/state.c (shifts_to): New.
12956 * src/lalr.c (build_relations): Use it.
12957
9222837b
AD
129582002-06-30 Akim Demaille <akim@epita.fr>
12959
12960 * src/gram.h (rule_number_t, RULE_NUMBER_MAX, int_of_rule_number)
12961 (item_number_of_rule_number, rule_number_of_item_number): New.
12962 * src/LR0.c, src/closure.c, src/derives.c, src/derives.h,
12963 * src/gram.c, src/lalr.c, src/nullable.c, src/output.c, src/print.c,
12964 * src/print_graph.c, src/reader.c, src/reduce.c, src/reduce.h:
12965 Propagate their use.
12966 Much remains to be done, in particular wrt `shorts' from types.h.
12967
260008e5
AD
129682002-06-30 Akim Demaille <akim@epita.fr>
12969
12970 * src/symtab.c (symbol_new): Initialize the `printer' member.
12971
8a731ca8
AD
129722002-06-30 Akim Demaille <akim@epita.fr>
12973
12974 * src/LR0.c (save_reductions): Remove, replaced by...
12975 * src/state.h, src/state.c (state_reductions_set): New.
12976 (reductions, errs): Rename as...
12977 (reductions_t, errs_t): these.
12978 Adjust all dependencies.
12979
32e1e0a4
AD
129802002-06-30 Akim Demaille <akim@epita.fr>
12981
12982 * src/LR0.c (state_list_t, state_list_append): New.
12983 (first_state, last_state): Now symbol_list_t.
12984 (this_state): Remove.
12985 (new_itemsets, append_states, save_reductions): Take a state_t as
12986 argument.
12987 (set_states, generate_states): Adjust.
12988 (save_shifts): Remove, replaced by...
12989 * src/state.h, src/state.c (state_shifts_set): New.
12990 (shifts): Rename as...
12991 (shifts_t): this.
12992 Adjust all dependencies.
12993 * src/state.h (state_t): Remove the `next' member.
12994
e5fb6710
AD
129952002-06-30 Akim Demaille <akim@epita.fr>
12996
12997 * src/vcg.c (quote): Use slot 2, since we often pass symbol tag
12998 escaped in slot 0.
12999
c7ca99d4
AD
130002002-06-30 Akim Demaille <akim@epita.fr>
13001
13002 Use hash.h for the state hash table.
13003
13004 * src/LR0.c (STATE_HASH_SIZE, state_hash): Remove.
13005 (allocate_storage): Use state_hash_new.
13006 (free_storage): Use state_hash_free.
13007 (new_state, get_state): Adjust.
13008 * src/lalr.h, src/lalr.c (states): Move to...
13009 * src/states.h (state_t): Remove the `link' member, no longer
13010 used.
13011 * src/states.h, src/states.c: here.
13012 (state_hash_new, state_hash_free, state_hash_lookup)
13013 (state_hash_insert, states_free): New.
13014 * src/states.c (state_table, state_compare, state_hash): New.
13015 * src/output.c (output_actions): Do not free states now, since we
13016 still need to know the final_state number in `prepare', called
13017 afterwards. Do it...
13018 * src/main.c (main): here: call states_free after `output'.
13019
df0e7316
AD
130202002-06-30 Akim Demaille <akim@epita.fr>
13021
13022 * src/state.h, src/state.c (state_new): New, extracted from...
13023 * src/LR0.c (new_state): here.
13024 * src/state.h (STATE_ALLOC): Move to...
13025 * src/state.c: here.
13026 * src/LR0.h, src/LR0.c (nstates, final_state): Move to...
13027 * src/state.h, src/state.c: here.
13028
39f41916
AD
130292002-06-30 Akim Demaille <akim@epita.fr>
13030
13031 * src/reader.c (gensym): Rename as...
13032 * src/symtab.h, src/symtab.c (dummy_symbol_get): this.
13033 (getsym): Rename as...
13034 (symbol_get): this.
13035
d57650a5
AD
130362002-06-30 Akim Demaille <akim@epita.fr>
13037
13038 * src/state.h (state_number_t, STATE_NUMBER_MAX): New.
13039 * src/LR0.c, src/LR0.h, src/conflicts.c, src/lalr.c, src/lalr.h,
13040 * src/output.c, src/print.c, src/print_graph.c: Propagate.
13041 * src/LR0.h, src/LR0.h (final_state): Is a state_t*.
13042
5a08f1ce
AD
130432002-06-30 Akim Demaille <akim@epita.fr>
13044
13045 Make the test suite pass with warnings checked.
13046
13047 * tests/actions.at (Printers and Destructors): Improve.
13048 Avoid unsigned vs. signed issues.
13049 * tests/calc.at: Don't exercise the scanner here, do it...
13050 * tests/input.at (Torturing the Scanner): here.
13051
720623af
PH
130522002-06-28 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13053
88e7e941 13054 * data/glr.c: Correct typo in Emacs-mode directive. Slightly
720623af
PH
13055 reorganize first lines parallel to yacc.c.
13056
fb8135fa
AD
130572002-06-28 Akim Demaille <akim@epita.fr>
13058
13059 * data/c.m4 (b4_copyright, b4_sint_type, b4_uint_type, b4_token_define)
13060 (b4_token_enum, b4_token_defines): New, factored from...
13061 * data/lalr1.cc, data/yacc.c, glr.c: here.
13062
41442480
AD
130632002-06-28 Akim Demaille <akim@epita.fr>
13064
13065 * data/yacc.c (yydestruct, yysymprint): Pacify GCC warnings for
13066 unused variables.
13067 * src/output.c (merger_output): static.
13068
e0e5bf84
AD
130692002-06-28 Akim Demaille <akim@epita.fr>
13070
ba0fe3c7 13071 * src/reader.h: s/grammer_current_rule_merge_set/grammar_.../.
e0e5bf84
AD
13072 * src/conflicts.c (conflicts_total_count): `i' is unsigned, to
13073 pacify GCC.
13074 * src/output.c (save_row): Initialize all the variables to pacify GCC.
e0e5bf84 13075
676385e2
PH
130762002-06-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13077
13078 Accumulated changelog for new GLR parsing features.
13079
6a254321 13080 * src/conflicts.c (count_total_conflicts): Change name to
676385e2
PH
13081 conflicts_total_count.
13082 * src/conflicts.h: Ditto.
13083 * src/output.c (token_actions): Use the new name.
13084 (output_conflicts): Change conflp => conflict_list_heads, and
13085 confl => conflict_list for better readability.
13086 * data/glr.c: Use the new names.
13087 * NEWS: Add self to GLR announcement.
e0e5bf84 13088
676385e2
PH
13089 * src/reader.c (free_merger_functions): Cleanup: XFREE->free.
13090
13091 * doc/bison.texinfo (GLR Parsers): Make corrections suggested by
13092 Akim Demaille.
13093
13094 * data/bison.glr: Change name to glr.c
13095 * data/glr.c: Renamed from bison.glr.
13096 * data/Makefile.am: Add glr.c
e0e5bf84
AD
13097
13098 * src/getargs.c:
13099
676385e2 13100 * src/symlist.h: Add dprec and merger fields to symbol_list_s.
ba0fe3c7 13101 * src/symlist.c (symbol_list_new): Initialize dprec and merger fields.
e0e5bf84 13102
676385e2
PH
13103 Originally 2002-06-16 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13104
13105 * data/bison.glr: Be sure to restore the
13106 current #line when returning to the skeleton contents after having
13107 exposed the input file's #line.
13108
13109 Originally 2002-06-13 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13110
13111 * data/bison.glr: Bring up to date with changes to bison.simple.
13112
13113 Originally 2002-06-03 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13114
13115 * data/bison.glr: Correct definitions that use b4_prefix.
13116 Various reformatting.
13117 (GLRStack): Make yychar (in YYPURE case) and yytokenp as part of stack.
13118 (yyreportParseError, yyrecoverParseError, yyprocessOneStack): remove
13119 yytokenp argument; now part of stack.
13120 (yychar): Define to behave as documented.
13121 (yyclearin): Ditto.
e0e5bf84 13122
676385e2
PH
13123 Originally 2002-05-14 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13124
13125 * src/reader.h: Add declaration for free_merger_functions.
13126
13127 * src/reader.c (merge_functions): New variable.
13128 (get_merge_function): New function.
13129 (free_merger_functions): New function.
13130 (readgram): Check for %prec that is not followed by a symbol.
13131 Handle %dprec and %merge declarations.
13132 (packgram): Initialize dprec and merger fields in rules array.
13133
13134 * src/output.c (conflict_tos, conflrow, conflict_table, conflict_list,
13135 conflict_list_cnt, conflict_list_free): New variables.
13136 (table_grow): Also grow conflict_table.
e0e5bf84 13137 (prepare_rules): Output dprec and merger tables.
676385e2 13138 (conflict_row): New function.
e0e5bf84 13139 (action_row): Output conflict lists for GLR parser. Don't use
676385e2
PH
13140 default reduction in conflicted states for GLR parser so that there
13141 are spaces for the conflict lists.
13142 (save_row): Also save conflict information.
13143 (token_actions): Allocate conflict list.
13144 (merger_output): New function.
13145 (pack_vector): Pack conflict table, too.
13146 (output_conflicts): New function to output yyconflp and yyconfl.
13147 (output_check): Allocate conflict_tos.
13148 (output_actions): Output conflict tables, also.
13149 (output_skeleton): Output b4_mergers definition.
13150 (prepare): Output b4_max_rhs_length definition.
13151 Use 'bison.glr' as default skeleton for GLR parsers.
13152
13153 * src/gram.c (glr_parser): New flag.
13154 (grammar_free): Call free_merger_functions.
13155
13156 * src/conflicts.c (count_rr_conflicts): Augment to optionally count
13157 all pairs of conflicting reductions, rather than just all tokens
13158 causing conflicts. Needed to size conflict tables.
e0e5bf84 13159 (conflicts_output): Modify call to count_rr_conflicts for new
676385e2
PH
13160 interface.
13161 (conflicts_print): Ditto.
13162 (count_total_conflicts): New function.
13163
13164 * src/reader.h (merger_list): New type.
13165 (merge_functions): New variable.
13166
13167 * src/lex.h (tok_dprec, tok_merge): New token types.
13168
13169 * src/gram.h (rule_s): Add dprec and merger fields.
13170 (glr_parser): New flag.
13171
13172 * src/conflicts.h (count_total_conflicts): New function.
13173
13174 * src/options.c (option_table): Add %dprec, %merge, and %glr-parser.
13175
13176 * doc/bison.texinfo (Generalized LR Parsing): New section.
13177 (GLR Parsers): New section.
13178 (Language and Grammar): Mention GLR parsing.
13179 (Table of Symbols): Add %dprec, %glr-parser, %merge, GLR
13180 Correct typo ("tge" -> "the").
13181
13182 * data/bison.glr: New skeleton for GLR parsing.
13183
13184 * tests/cxx-gram.at: New tests for GLR parsing.
13185
13186 * tests/testsuite.at: Include cxx-gram.at.
13187
13188 * tests/Makefile.am: Add cxx-gram.at.
e0e5bf84 13189
676385e2
PH
13190 * src/parse-gram.y:
13191
13192 * src/scan-gram.l: Add %dprec, %glr-parser, %merge.
13193
13194 * src/parse-gram.y: Grammar for %dprec, %merge, %glr-parser.
e0e5bf84 13195
b5480d74 131962002-06-27 Akim Demaille <akim@epita.fr>
e2aaf4c4
AD
13197
13198 * src/options.h, src/options.c: Remove.
13199 * src/getargs.c (short_options, long_options): New.
13200
60491a94
AD
132012002-06-27 Akim Demaille <akim@epita.fr>
13202
13203 * data/bison.simple, data/bison.c++: Rename as...
13204 * data/yacc.c, data/lalr1.cc: these.
13205 * doc/bison.texinfo (Environment Variables): Remove.
13206
9be0c25b
AD
132072002-06-25 Raja R Harinath <harinath@cs.umn.edu>
13208
13209 * src/getargs.c (report_argmatch): Initialize strtok().
13210
1ae72863
AD
132112002-06-20 Akim Demaille <akim@epita.fr>
13212
13213 * data/bison.simple (b4_symbol_actions): New, replaces...
13214 (b4_symbol_destructor, b4_symbol_printer): these.
13215 (yysymprint): Be sure to call YYPRINT only for tokens, and using
13216 user token numbers.
13217
87542d29
AD
132182002-06-20 Akim Demaille <akim@epita.fr>
13219
13220 * data/bison.simple (yydestructor): Rename as...
13221 (yydestruct): this.
13222
1a31ed21
AD
132232002-06-20 Akim Demaille <akim@epita.fr>
13224
13225 * src/symtab.h, src/symtab.c (symbol_type_set)
13226 (symbol_destructor_set, symbol_precedence_set): The location is
13227 the last argument.
13228 Adjust all callers.
13229
e776192e
AD
132302002-06-20 Akim Demaille <akim@epita.fr>
13231
13232 * src/parse-gram.y (YYPRINT, yyprint): Don't mess with the parser
13233 internals.
13234 * src/reader.h, src/reader.c (grammar_current_rule_prec_set):
13235 Takes a location.
13236 * src/symtab.h, src/symtab.c (symbol_class_set)
13237 (symbol_user_token_number_set): Likewise.
13238 Adjust all callers.
13239 Promote complain_at.
13240 * tests/input.at (Type Clashes): Adjust.
13241
5c1180b3
AD
132422002-06-20 Akim Demaille <akim@epita.fr>
13243
13244 * data/bison.simple (YYLEX): Fix the declaration when
13245 %pure-parser.
13246
e3170060
AD
132472002-06-20 Akim Demaille <akim@epita.fr>
13248
13249 * data/bison.simple (yysymprint): Don't print the token number,
13250 just its name.
13251 * tests/actions.at (Destructors): Rename as...
13252 (Printers and Destructors): this.
13253 Also exercise %printer.
13254
253862fd
AD
132552002-06-20 Akim Demaille <akim@epita.fr>
13256
13257 * data/bison.simple (YYDSYMPRINT): New.
13258 Use it to remove many of the #if YYDEBUG/if (yydebug).
13259
366eea36
AD
132602002-06-20 Akim Demaille <akim@epita.fr>
13261
13262 * src/symtab.h, src/symtab.c (symbol_t): printer and
13263 printer_location are new members.
13264 (symbol_printer_set): New.
13265 * src/parse-gram.y (PERCENT_PRINTER): New token.
13266 Handle its associated rule.
13267 * src/scan-gram.l: Adjust.
13268 (handle_destructor_at, handle_destructor_dollar): Rename as...
13269 (handle_symbol_code_at, handle_symbol_code_dollar): these.
13270 * src/output.c (symbol_printers_output): New.
13271 (output_skeleton): Call it.
13272 * data/bison.simple (yysymprint): New. Cannot be named yyprint
13273 since there are already many grammar files with a user `yyprint'.
13274 Replace the calls to YYPRINT to calls to yysymprint.
13275 * tests/calc.at: Adjust.
13276 * tests/torture.at (AT_DATA_STACK_TORTURE): Remove YYPRINT: it was
13277 taking advantage of parser very internal details (stack size!).
13278
4f25ebb0
AD
132792002-06-20 Akim Demaille <akim@epita.fr>
13280
13281 * src/scan-gram.l: Complete the scanner with the missing patterns
13282 to pacify Flex.
13283 Use `quote' and `symbol_tag_get' where appropriate.
13284
93b68a0e
AD
132852002-06-19 Akim Demaille <akim@epita.fr>
13286
13287 * tests/actions.at (Destructors): Augment to test locations.
13288 * data/bison.simple (yydestructor): Pass it the current location
13289 if locations are enabled.
13290 Prototype only when __STDC__ or C++.
13291 Change the argument names to move into the yy name space: there is
13292 user code here.
13293
58612f1d
AD
132942002-06-19 Akim Demaille <akim@epita.fr>
13295
74310291
AD
13296 * data/bison.simple (b4_pure_if): New.
13297 Use it instead of #ifdef YYPURE.
13298
132992002-06-19 Akim Demaille <akim@epita.fr>
13300
13301 * data/bison.simple (b4_location_if): New.
58612f1d
AD
13302 Use it instead of #ifdef YYLSP_NEEDED.
13303
f25bfb75
AD
133042002-06-19 Akim Demaille <akim@epita.fr>
13305
13306 Prepare @$ in %destructor, but currently don't bind it in the
13307 skeleton, as %location use is not cleaned up yet.
13308
13309 * src/scan-gram.l (handle_dollar, handle_destructor_at)
13310 (handle_action_at): New.
13311 (handle_at, handle_action_dollar, handle_destructor_dollar): Take
13312 a braced_code_t and a location as additional arguments.
13313 (handle_destructor_dollar): Instead of requiring `b4_eval', just
13314 unquote one when outputting `b4_dollar_dollar'.
13315 Adjust callers.
13316 * data/bison.simple (b4_eval): Remove.
13317 (b4_symbol_destructor): Adjust.
13318 * tests/input.at (Invalid @n): Adjust.
13319
c732d2c6
AD
133202002-06-19 Zack Weinberg <zack@codesourcery.com>
13321
13322 * doc/bison.texinfo: Document ability to have multiple
13323 prologue sections.
13324
8c165d89
AD
133252002-06-18 Akim Demaille <akim@epita.fr>
13326
13327 * src/files.c (compute_base_names): When computing the output file
13328 names from the input file name, strip the directory part.
13329
ca98bf57
AD
133302002-06-18 Akim Demaille <akim@epita.fr>
13331
13332 * data/bison.simple.new: Comment changes.
13333 Reported by Andreas Schwab.
13334
0bfb02ff
AD
133352002-06-18 Matt Kraai <kraai@alumni.cmu.edu>
13336
13337 * data/bison.simple (yyoverflowlab): #ifndef yyoverflow, so that
13338 there are no `label `yyoverflowlab' defined but not used' warnings
13339 when yyoverflow is defined.
13340
24c0aad7
AD
133412002-06-18 Akim Demaille <akim@epita.fr>
13342
13343 * src/symtab.h, src/symtab.c (symbol_t): destructor_location is a
13344 new member.
13345 (symbol_destructor_set): Adjust.
13346 * src/output.c (symbol_destructors_output): Output the destructor
13347 locations.
13348 Output the symbol name.
13349 * data/bison.simple (b4_symbol_destructor): Adjust.
13350
5719c109
AD
133512002-06-18 Cris Bailiff <c.bailiff@awayweb.com>
13352 and Akim Demaille <akim@epita.fr>
13353
13354 * data/bison.simple.new (yyerrlab1): Be sure to pop and destroy
13355 what's left on the stack when the error recovery hits EOF.
13356 * tests/actions.at (Destructors): Complete to exercise this case.
13357
9280d3ef
AD
133582002-06-17 Akim Demaille <akim@epita.fr>
13359
13360 * data/m4sugar/m4sugar.m4 (m4_map): Recognize when the list of
13361 arguments is really empty, not only equal to `[]'.
13362 * src/symtab.h, src/symtab.c (symbol_t): `destructor' is a new
13363 member.
13364 (symbol_destructor_set): New.
13365 * src/output.c (symbol_destructors_output): New.
13366 * src/reader.h (brace_code_t, current_braced_code): New.
13367 * src/scan-gram.l (BRACED_CODE): Use it to branch on...
13368 (handle_dollar): Rename as...
13369 (handle_action_dollar): this.
13370 (handle_destructor_dollar): New.
13371 * src/parse-gram.y (PERCENT_DESTRUCTOR): New.
13372 (grammar_declaration): Use it.
13373 * data/bison.simple (yystos): Is always defined.
13374 (yydestructor): New.
13375 * tests/actions.at (Destructors): New.
13376 * tests/calc.at (_AT_CHECK_CALC_ERROR): Don't rely on egrep.
13377
dafdc66f
AD
133782002-06-17 Akim Demaille <akim@epita.fr>
13379
13380 * src/symlist.h, src/symlist.c (symbol_list_length): New.
13381 * src/scan-gram.l (handle_dollar, handle_at): Compute the
13382 rule_length only when needed.
13383 * src/output.c (actions_output, token_definitions_output): Output
13384 the full M4 block.
13385 * src/symtab.c: Don't access directly to the symbol tag, use
13386 symbol_tag_get.
13387 * src/parse-gram.y: Use symbol_list_free.
13388
56c47203
AD
133892002-06-17 Akim Demaille <akim@epita.fr>
13390
13391 * src/reader.h, src/reader.c (symbol_list, symbol_list_new)
13392 (symbol_list_prepend, get_type_name): Move to...
13393 * src/symlist.h, src/symlist.c (symbol_list_t, symbol_list_new)
13394 (symbol_list_prepend, symbol_list_n_type_name_get): here.
13395 Adjust all callers.
13396 (symbol_list_free): New.
13397 * src/scan-gram.l (handle_dollar): Takes a location.
13398 * tests/input.at (Invalid $n): Adjust.
13399
1e0bab92
AD
134002002-06-17 Akim Demaille <akim@epita.fr>
13401
13402 * src/reader.h, src/reader.c (symbol_list_new): Export it.
13403 (symbol_list_prepend): New.
13404 * src/parse-gram.y (%union): `list' is a new member.
13405 (symbols.1): New, replaces...
13406 (terms_to_prec.1, nterms_to_type.1): these.
13407 * src/symtab.h, src/symtab.c (symbol_type_set, symbol_precedence_set)
13408 Take a location as additional argument.
13409 Adjust all callers.
13410
04e60654
AD
134112002-06-15 Akim Demaille <akim@epita.fr>
13412
13413 * src/parse-gram.y: Move %token in the declaration section so that
13414 we don't depend upon CVS Bison.
13415
10e5b8bd
AD
134162002-06-15 Akim Demaille <akim@epita.fr>
13417
13418 * src/state.h, src/state.c (state_rule_lookaheads_print): New.
13419 * src/print.c (print_core): Use it.
13420
9801d40c
AD
134212002-06-15 Akim Demaille <akim@epita.fr>
13422
13423 * src/conflicts.c (log_resolution): Accept the rule involved in
13424 the sr conflicts instead of the lookahead number that points to
13425 that rule.
13426 (flush_reduce): Accept the current lookahead vector as argument,
13427 instead of the index in LA.
13428 (resolve_sr_conflict): Accept the current number of lookahead
13429 bitset to consider for the STATE, instead of the index in LA.
13430 (set_conflicts): Adjust.
13431 * src/lalr.c, src/lalr.h, src/state.h: Comment changes.
13432
c0263492
AD
134332002-06-15 Akim Demaille <akim@epita.fr>
13434
13435 * src/state.h (state_t): Replace the `lookaheadsp' member, a
13436 short, with `lookaheads' (bitsetv), `lookaheads_rule' (rule_t**).
13437 Adjust all dependencies.
13438 * src/lalr.c (initialize_lookaheads): Split into...
13439 (states_lookaheads_count, states_lookaheads_initialize): these.
13440 (lalr): Adjust.
13441
9757c359
AD
134422002-06-15 Akim Demaille <akim@epita.fr>
13443
13444 * src/gram.h, src/gram.c (grammar_rules_partial_print): New, eved
13445 out of...
13446 (grammar_rules_print): here.
13447 * src/reduce.c (reduce_output): Use it.
13448 * tests/reduce.at (Useless Rules, Reduced Automaton)
13449 (Underivable Rules): Adjust.
13450
6b98e4b5
AD
134512002-06-15 Akim Demaille <akim@epita.fr>
13452
13453 Copy BYacc's nice way to report the grammar.
13454
13455 * src/gram.h, src/gram.c (grammar_rhs_print, grammar_rules_print):
13456 New.
13457 Don't print the rules' location, it is confusing and useless.
13458 (rule_print): Use grammar_rhs_print.
13459 * src/print.c (print_grammar): Use grammar_rules_print.
13460
6b98e4b5
AD
134612002-06-15 Akim Demaille <akim@epita.fr>
13462
13463 Complete and rationalize `useless thing' warnings.
13464
13465 * src/symtab.h, src/symtab.c (symbol_tag_get, symbol_tag_get_n)
13466 (symbol_tag_print): New.
13467 Use them everywhere in place of accessing directly the tag member.
13468 * src/gram.h, src/gram.c (rule_print): New.
13469 Use it where a rule used to be printed `by hand'.
13470 * src/reduce.c (nonterminals_reduce): Report the use nonterminals.
13471 (reduce_grammar_tables): Report the useless rules.
13472 (reduce_print): Useless things are a warning, not an error.
13473 Report it as such.
13474 * tests/reduce.at (Useless Nonterminals, Useless Rules):
13475 (Reduced Automaton, Underivable Rules): Adjust.
13476 * tests/regression.at (Web2c Report, Web2c Report): Adjust.
13477 * tests/conflicts.at (Unresolved SR Conflicts)
13478 (Solved SR Conflicts): Adjust.
13479
ee000ba4
AD
134802002-06-15 Akim Demaille <akim@epita.fr>
13481
13482 Let symbols have a location.
13483
13484 * src/symtab.h, src/symtab.c (symbol_t): Location is a new member.
13485 (getsym): Adjust.
13486 Adjust all callers.
13487 * src/complain.h, src/complain.c (complain_at, fatal_at, warn_at):
13488 Use location_t, not int.
13489 * src/symtab.c (symbol_check_defined): Take advantage of the
13490 location.
13491 * tests/regression.at (Invalid inputs): Adjust.
13492
8efe435c
AD
134932002-06-15 Akim Demaille <akim@epita.fr>
13494
13495 * src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
13496 (input): Don't try to initialize yylloc here, do it in the
13497 scanner.
13498 * src/scan-gram.l (YY_USER_INIT): Initialize yylloc.
13499 * src/gram.h (rule_t): Change line and action_line into location
13500 and action_location, of location_t type.
13501 Adjust all dependencies.
13502 * src/location.h, src/location.c (empty_location): New.
13503 * src/reader.h, src/reader.c (grammar_start_symbol_set)
13504 (grammar_symbol_append, grammar_rule_begin, grammar_rule_end)
13505 (grammar_current_rule_symbol_append)
13506 (grammar_current_rule_action_append): Expect a location as argument.
13507 * src/reader.c (grammar_midrule_action): Adjust to attach an
13508 action's location as dummy symbol location.
13509 * src/symtab.h, src/symtab.c (startsymbol_location): New.
13510 * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust
13511 the line numbers.
13512
1921f1d7
AD
135132002-06-14 Akim Demaille <akim@epita.fr>
13514
13515 Grammar declarations may be found in the grammar section.
13516
13517 * src/parse-gram.y (rules_or_grammar_declaration): New.
13518 (declarations): Each declaration may end with a semicolon, not
13519 just...
13520 (grammar_declaration): `"%union"'.
13521 (grammar): Branch to rules_or_grammar_declaration.
13522
4515534c
AD
135232002-06-14 Akim Demaille <akim@epita.fr>
13524
13525 * src/main.c (main): Invoke scanner_free.
13526
f958596b
AD
135272002-06-14 Akim Demaille <akim@epita.fr>
13528
13529 * src/output.c (m4_invoke): Extracted from...
13530 (output_skeleton): here.
13531 Free tempfile.
13532
2c569025
AD
135332002-06-14 Akim Demaille <akim@epita.fr>
13534
13535 * src/parse-gram.y (directives, directive, gram)
13536 (grammar_directives, precedence_directives, precedence_directive):
13537 Rename as...
13538 (declarations, declaration, grammar, grammar_declaration)
13539 (precedence_declaration, precedence_declarator): these.
13540 (symbol_declaration): New.
13541
592e8d4d
AD
135422002-06-14 Akim Demaille <akim@epita.fr>
13543
13544 * src/files.c (action_obstack): Remove, unused.
13545 (output_obstack): Remove it, and all its dependencies, as it is no
13546 longer needed.
13547 * src/reader.c (epilogue_set): Build the epilogue in the
13548 muscle_obstack.
13549 * src/output.h, src/output.c (muscle_obstack): Move to...
13550 * src/muscle_tab.h, src/muscle_tab.h: here.
13551 (muscle_init): Initialize muscle_obstack.
13552 (muscle_free): New.
13553 * src/main.c (main): Call it.
13554
0c15323d
AD
135552002-06-14 Akim Demaille <akim@epita.fr>
13556
13557 * src/location.h: New, extracted from...
13558 * src/reader.h: here.
13559 * src/Makefile.am (noinst_HEADERS): Merge into
13560 (bison_SOURCES): this.
13561 Add location.h.
13562 * src/parse-gram.y: Use location_t instead of Bison's.
13563 * src/reader.h, src/reader.c (prologue_augment, epilogue_set):
13564 Use location_t instead of ints.
13565
e96c9728
AD
135662002-06-14 Akim Demaille <akim@epita.fr>
13567
13568 * data/bison.simple, data/bison.c++: Be sure to restore the
13569 current #line when returning to the skeleton contents after having
13570 exposed the input file's #line.
13571
75d1fe16
AD
135722002-06-12 Akim Demaille <akim@epita.fr>
13573
13574 * src/scan-gram.l (SC_BRACED_CODE): Don't use `<.*>', it is too
13575 eager.
13576 * tests/actions.at (Exotic Dollars): New.
13577
6c35d22c
AD
135782002-06-12 Akim Demaille <akim@epita.fr>
13579
13580 * src/scan-gram.l (SC_PROLOGUE): Don't eat characters amongst
13581 ['"/] too eagerly.
13582 * tests/input.at (Torturing the Scanner): New.
13583
1d6412ad
AD
135842002-06-11 Akim Demaille <akim@epita.fr>
13585
13586 * src/scan-gram.l (YY_OBS_INIT): Remove, replace with...
13587 [SC_COMMENT,SC_STRING,SC_CHARACTER,SC_BRACED_CODE,SC_PROLOGUE]
13588 [SC_EPILOGUE]: Output the quadrigraphs only when not in a comment.
13589 * src/reader.h, src/scan-gram.l (scanner_initialize): this.
13590 * src/reader.c (reader): Use it.
13591
4cdb01db
AD
135922002-06-11 Akim Demaille <akim@epita.fr>
13593
13594 * src/scan-gram.l (YY_OBS_FINISH): Don't set yylval.
13595 Adjust all callers.
13596 (scanner_last_string_free): New.
13597
44995b2e
AD
135982002-06-11 Akim Demaille <akim@epita.fr>
13599
13600 * src/scan-gram.l (YY_INIT, YY_GROW, YY_FINISH): Rename as...
13601 (YY_OBS_INIT, YY_OBS_GROW, YY_OBS_FINISH): these.
13602 (last_string, YY_OBS_FREE): New.
13603 Use them when returning an ID.
13604
e9955c83
AD
136052002-06-11 Akim Demaille <akim@epita.fr>
13606
13607 Have Bison grammars parsed by a Bison grammar.
13608
13609 * src/reader.c, src/reader.h (prologue_augment): New.
13610 * src/reader.c (copy_definition): Remove.
13611
13612 * src/reader.h, src/reader.c (gram_start_symbol_set, prologue_augment)
13613 (grammar_symbol_append, grammar_rule_begin, grammar_midrule_action)
13614 (grammar_current_rule_prec_set, grammar_current_rule_check)
13615 (grammar_current_rule_symbol_append)
13616 (grammar_current_rule_action_append): Export.
13617 * src/parse-gram.y (symbol_list_new, symbol_list_symbol_append_
13618 (symbol_list_action_append): Remove.
13619 Hook the routines from reader.
13620 * src/scan-gram.l: In INITIAL, characters and strings are tokens.
13621 * src/system.h (ATTRIBUTE_NORETURN, ATTRIBUTE_UNUSED): Now.
13622
13623 * src/reader.c (read_declarations): Remove, unused.
13624
13625 * src/parse-gram.y: Handle the epilogue.
13626 * src/reader.h, src/reader.c (gram_start_symbol_set): Rename as...
13627 (grammar_start_symbol_set): this.
13628 * src/scan-gram.l: Be sure to ``use'' yycontrol to keep GCC quiet.
13629 * src/reader.c (readgram): Remove, unused.
13630 (reader): Adjust to insert eoftoken and axiom where appropriate.
13631
13632 * src/reader.c (copy_dollar): Replace with...
13633 * src/scan-gram.h (handle_dollar): this.
13634 * src/parse-gram.y: Remove `%thong'.
13635
13636 * src/reader.c (copy_at): Replace with...
13637 * src/scan-gram.h (handle_at): this.
13638
13639 * src/complain.h, src/complain.c (warn_at, complain_at, fatal_at):
13640 New.
13641
13642 * src/scan-gram.l (YY_LINES): Keep lineno synchronized for the
13643 time being.
13644
13645 * src/reader.h, src/reader.c (grammar_rule_end): New.
13646
13647 * src/parse.y (current_type, current_class): New.
13648 Implement `%nterm', `%token' support.
13649 Merge `%term' into `%token'.
13650 (string_as_id): New.
13651 * src/symtab.h, src/symtab.c (symbol_make_alias): Don't pass the
13652 type name.
13653
13654 * src/parse-gram.y: Be sure to handle properly the beginning of
13655 rules.
13656
13657 * src/parse-gram.y: Handle %type.
13658 * src/reader.c (grammar_rule_end): Call grammar_current_rule_check.
13659
13660 * src/parse-gram.y: More directives support.
13661 * src/options.c: No longer handle source directives.
13662
13663 * src/parse-gram.y: Fix %output.
13664
13665 * src/parse-gram.y: Handle %union.
13666 Use the prologue locations.
13667 * src/reader.c (parse_union_decl): Remove.
13668
13669 * src/reader.h, src/reader.c (epilogue_set): New.
13670 * src/parse-gram.y: Use it.
13671
13672 * data/bison.simple, data/bison.c++: b4_stype is now either not
13673 defined, then default to int, or to the contents of %union,
13674 without `union' itself.
13675 Adjust.
13676 * src/muscle_tab.c (muscle_init): Don't predefine `stype'.
13677
13678 * src/output.c (actions_output): Don't output braces, as they are
13679 already handled by the scanner.
13680
13681 * src/scan-gram.l (SC_CHARACTER): Set the user_token_number of
13682 characters to themselves.
13683
13684 * tests/reduce.at (Reduced Automaton): End the grammars with %% so
13685 that the epilogue has a proper #line.
13686
13687 * src/parse-gram.y: Handle precedence/associativity.
13688
13689 * src/symtab.c (symbol_precedence_set): Requires the symbol to be
13690 a terminal.
13691 * src/scan-gram.l (SC_BRACED_CODE): Catch strings and characters.
13692 * tests/calc.at: Do not use `%token "foo"' as it makes not sense
13693 at all to define terminals that cannot be emitted.
13694
13695 * src/scan-gram.l: Escape M4 characters.
13696
13697 * src/scan-gram.l: Working properly with escapes in user
13698 strings/characters.
13699
13700 * tests/torture.at (AT_DATA_TRIANGULAR_GRAMMAR)
13701 (AT_DATA_HORIZONTAL_GRAMMAR): Respect the `%token ID NUM STRING'
13702 grammar.
13703 Use more modest sizes, as for the time being the parser does not
13704 release memory, and therefore the process swallows a huge amount
13705 of memory.
13706
13707 * tests/torture.at (AT_DATA_LOOKAHEADS_GRAMMAR): Adjust to the
13708 stricter %token grammar.
13709
13710 * src/symtab.h (associativity): Add `undef_assoc'.
13711 (symbol_precedence_set): Do nothing when passed an undef_assoc.
13712 * src/symtab.c (symbol_check_alias_consistence): Adjust.
13713
13714 * tests/regression.at (Invalid %directive): Remove, as it is now
13715 meaningless.
13716 (Invalid inputs): Adjust to the new error messages.
13717 (Token definitions): The new grammar doesn't allow too many
13718 eccentricities.
13719
13720 * src/lex.h, src/lex.c: Remove.
13721 * src/reader.c (lastprec, skip_to_char, read_signed_integer)
13722 (copy_character, copy_string2, copy_string, copy_identifier)
13723 (copy_comment, parse_token_decl, parse_type_decl, parse_assoc_decl)
13724 (parse_muscle_decl, parse_dquoted_param, parse_skel_decl)
13725 (parse_action): Remove.
13726 * po/POTFILES.in: Adjust.
13727
2e047461
AD
137282002-06-11 Akim Demaille <akim@epita.fr>
13729
cd05d13c 13730 * src/reader.c (parse_action): Don't store directly into the
2e047461
AD
13731 rule's action member: return the action as a string.
13732 Don't require `rule_length' as an argument: compute it.
13733 (grammar_current_rule_symbol_append)
13734 (grammar_current_rule_action_append): New, eved out from
13735 (readgram): here.
13736 Remove `action_flag', `rulelength', unused now.
13737
9af3fbce
AD
137382002-06-11 Akim Demaille <akim@epita.fr>
13739
13740 * src/reader.c (grammar_current_rule_prec_set).
13741 (grammar_current_rule_check): New, eved out from...
13742 (readgram): here.
13743 Remove `xaction', `first_rhs': useless.
13744 * tests/input.at (Type clashes): New.
13745 * tests/existing.at (GNU Cim Grammar): Adjust.
13746
1485e106
AD
137472002-06-11 Akim Demaille <akim@epita.fr>
13748
13749 * src/reader.c (grammar_midrule_action): New, Eved out from
13750 (readgram): here.
13751
da4160c3
AD
137522002-06-11 Akim Demaille <akim@epita.fr>
13753
13754 * src/reader.c (grammar_rule_begin, previous_rule, current_rule):
13755 New.
13756 (readgram): Use them as replacement of inlined code, crule and
13757 crule1.
13758
f6d0f937
AD
137592002-06-11 Akim Demaille <akim@epita.fr>
13760
13761 * src/reader.c (grammar_end, grammar_symbol_append): New.
13762 (readgram): Use them.
13763 Make the use of `p' as local as possible.
13764
69078d4b
AD
137652002-06-10 Akim Demaille <akim@epita.fr>
13766
13767 GCJ's parser requires the tokens to be defined before the prologue.
13768
13769 * data/bison.simple: Output the token definition before the user's
13770 prologue.
13771 * tests/regression.at (Braces parsing, Duplicate string)
13772 (Mixing %token styles): Check the output from bison.
13773 (Early token definitions): New.
13774
5e424082
AD
137752002-06-10 Akim Demaille <akim@epita.fr>
13776
13777 * src/symtab.c (symbol_user_token_number_set): Don't complain when
13778 assigning twice the same user number to a token, so that we can
13779 use it in...
13780 * src/lex.c (lex): here.
13781 Also use `symbol_class_set' instead of hand written code.
13782 * src/reader.c (parse_assoc_decl): Likewise.
13783
44536b35
AD
137842002-06-10 Akim Demaille <akim@epita.fr>
13785
13786 * src/symtab.c, src/symtab.c (symbol_class_set)
13787 (symbol_user_token_number_set): New.
13788 * src/reader.c (parse_token_decl): Use them.
13789 Use a switch instead of ifs.
13790 Use a single argument.
13791
8b9f2372
AD
137922002-06-10 Akim Demaille <akim@epita.fr>
13793
13794 Remove `%thong' support as it is undocumented, unused, duplicates
13795 `%token's job, and creates useless e-mail traffic with people who
13796 want to know what it is, why it is undocumented, unused, and
13797 duplicates `%token's job.
13798
13799 * src/reader.c (parse_thong_decl): Remove.
13800 * src/options.c (option_table): Remove "thong".
13801 * src/lex.h (tok_thong): Remove.
13802
3ae2b51f
AD
138032002-06-10 Akim Demaille <akim@epita.fr>
13804
13805 * src/symtab.c, src/symtab.c (symbol_type_set)
13806 (symbol_precedence_set): New.
13807 * src/reader.c (parse_type_decl, parse_assoc_decl): Use them.
13808 (value_components_used): Remove, unused.
13809
2f1afb73
AD
138102002-06-09 Akim Demaille <akim@epita.fr>
13811
13812 Move symbols handling code out of the reader.
13813
13814 * src/reader.h, src/reader.c (errtoken, undeftoken, eoftoken)
13815 (axiom): Move to...
13816 * src/symtab.h, src/symtab.c: here.
13817
13818 * src/gram.c (start_symbol): Remove: use startsymbol->number.
13819 * src/reader.c (startval): Rename as...
13820 * src/symtab.h, src/symtab.c (startsymbol): this.
13821 * src/reader.c: Adjust.
13822
13823 * src/reader.c (symbol_check_defined, symbol_make_alias)
13824 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
13825 (token_translations_init)
13826 Move to...
13827 * src/symtab.c: here.
13828 * src/reader.c (packsymbols): Move to...
13829 * src/symtab.h, src/symtab.c (symbols_pack): here.
13830 * src/symtab.h, src/symtab.c (symbol_make_alias): Takes SYMVAL as
13831 argument.
13832
e9bca3ad
AD
138332002-06-03 Akim Demaille <akim@epita.fr>
13834
13835 * src/muscle_tab.c (muscle_insert, muscle_find): Declarations,
13836 then statements.
13837
86eff183
AD
138382002-06-03 Akim Demaille <akim@epita.fr>
13839
13840 * src/muscle_tab.c (muscle_find, muscle_insert): Don't initialize
13841 structs with non literals.
13842 * src/scan-skel.l: never-interactive.
13843 * src/conflicts.c (enum conflict_resolution_e): No trailing
13844 comma.
13845 * src/getargs.c (usage): Split long literal strings.
13846 Reported by Hans Aberg.
13847
717be197
AD
138482002-05-28 Akim Demaille <akim@epita.fr>
13849
13850 * data/bison.c++: Use C++ ostreams.
13851 (cdebug_): New member.
13852
670ddffd
AD
138532002-05-28 Akim Demaille <akim@epita.fr>
13854
13855 * src/output.c (output_skeleton): Be sure to allocate enough room
13856 for `/' _and_ for `\0' in full_skeleton.
13857
769b430f
AD
138582002-05-28 Akim Demaille <akim@epita.fr>
13859
13860 * data/bison.c++: Catch up with bison.simple:
13861 2002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13862 and Paul Eggert <eggert@twinsun.com>: `error' handing.
13863 2002-05-26 Akim Demaille <akim@epita.fr>: stos_, token_number_,
13864 and popping traces.
13865
7067cb36
PH
138662002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13867
13868 * src/output.c (output_skeleton): Put an explicit path in front of
13869 the skeleton file name, rather than relying on the -I directory,
13870 to partially alleviate effects of having a skeleton file lying around
13871 in the current directory.
769b430f 13872
4a713ec2
PH
138732002-05-27 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13874
769b430f 13875 * src/conflicts.c (log_resolution): Correct typo:
4a713ec2
PH
13876 obstack_printf should be obstack_fgrow1.
13877
b408954b
AD
138782002-05-26 Akim Demaille <akim@epita.fr>
13879
13880 * src/state.h (state_t): `solved_conflicts' is a new member.
13881 * src/LR0.c (new_state): Set it to 0.
13882 * src/conflicts.h, src/conflicts.c (print_conflicts)
13883 (free_conflicts, solve_conflicts): Rename as...
13884 (conflicts_print, conflicts_free, conflicts_solve): these.
13885 Adjust callers.
13886 * src/conflicts.c (enum conflict_resolution_e)
13887 (solved_conflicts_obstack): New, used by...
13888 (log_resolution): this.
13889 Adjust to attach the conflict resolution to each state.
13890 Complete the description with the precedence/associativity
13891 information.
13892 (resolve_sr_conflict): Adjust.
13893 * src/print.c (print_state): Output its solved_conflicts.
13894 * tests/conflicts.at (Unresolved SR Conflicts)
13895 (Solved SR Conflicts): Exercise --report=all.
13896
a49aecd5
AD
138972002-05-26 Akim Demaille <akim@epita.fr>
13898
13899 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
13900 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
13901 * src/reader.c, src/reduce.c, src/state.h, src/symtab.h
13902 (token_number_t, item_number_as_token_number)
13903 (token_number_as_item_number, muscle_insert_token_number_table):
13904 Rename as...
13905 (symbol_number_t, item_number_as_symbol_number)
13906 (symbol_number_as_item_number, muscle_insert_symbol_number_table):
13907 these, since it is more appropriate.
13908
5504898e
AD
139092002-05-26 Akim Demaille <akim@epita.fr>
13910
13911 * tests/calc.at (AT_CHECK_CALC): Adjust: there are now additional
13912 `Error:' lines.
13913 * data/bison.simple (yystos) [YYDEBUG]: New.
13914 (yyparse) [YYDEBUG]: Display the symbols which are popped during
13915 error recovery.
13916 * tests/regression.at (Web2c Actions): Adjust: yystos is output now.
13917
ec3bc396
AD
139182002-05-25 Akim Demaille <akim@epita.fr>
13919
13920 * doc/bison.texinfo (Debugging): Split into...
13921 (Tracing): this new section, its former contents, and...
13922 (Understanding): this new section.
13923 * src/getargs.h, src/getargs.c (verbose_flag): Remove, replaced
13924 by...
13925 (report_flag): this.
13926 Adjust all dependencies.
13927 (report_args, report_types, report_argmatch): New.
13928 (usage, getargs): Report/support -r, --report.
13929 * src/options.h
13930 (struct option_table_struct): Rename as..,
13931 (struct option_table_s): this.
13932 Rename the `set_flag' member to `flag' to match with getopt_long's
13933 struct.
13934 * src/options.c (option_table): Split verbose into an entry for
13935 %verbose, and another for --verbose.
13936 Support --report/-r, so remove -r from the obsolete --raw.
13937 * src/print.c: Attach full item sets and lookaheads reports to
13938 report_flag instead of trace_flag.
13939 * lib/argmatch.h, lib/argmatch.c: New, from Fileutils 4.1.
13940
78df8250
PE
139412002-05-24 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13942 and Paul Eggert <eggert@twinsun.com>
769b430f 13943
78df8250
PE
13944 * data/bison.simple (yyparse): Correct error handling to conform to
13945 POSIX and yacc. Specifically, after syntax error is discovered,
13946 do not reduce further before shifting the error token.
13947 Clean up the code a bit by removing the labels yyerrdefault,
13948 yyerrhandle, yyerrpop.
13949 * NEWS: Document the above.
13950
c0c9ea05
PH
139512002-05-20 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13952
13953 * data/bison.simple (yyr1): Don't use yy_token_number_type as element
13954 type; it isn't always big enough, since it doesn't necessarily
13955 include non-terminals.
769b430f 13956 (yytranslate): Expand definition of yy_token_number_type, so that
c0c9ea05
PH
13957 the latter can be removed.
13958 (yy_token_number_type): Remove, only one use.
13959 * data/bison.c++ (r1_): Parallel change to yyr1 in bison.simple---
13960 don't use TokenNumberType as element type.
769b430f 13961
c0c9ea05
PH
13962 * tests/regression.at: Modify expected output to agree with change
13963 to yyr1 and yytranslate.
769b430f 13964
6390a83f
FK
139652002-05-13 Florian Krohm <florian@edamail.fishkill.ibm.com>
13966
13967 * src/reader.c (parse_action): Use copy_character instead of
13968 obstack_1grow.
13969
db7c8e9a
AD
139702002-05-13 Akim Demaille <akim@epita.fr>
13971
13972 * tests/regression.at (Token definitions): Prototype yylex and
13973 yyerror.
13974
fcc61800
PH
139752002-05-12 Paul Hilfinger <Hilfinger@CS.Berkeley.EDU>
13976
158c687b 13977 * src/scan-skel.l: Correct off-by-one error in handling of __oline__.
fcc61800
PH
13978 * data/bison.simple (b4_sint_type, b4_uint_type): Correct to reflect
13979 32-bit arithmetic.
13980 * data/bison.c++ (b4_sint_type, b4_uint_type): Ditto.
13981
5683e9b2
AD
139822002-05-07 Akim Demaille <akim@epita.fr>
13983
13984 * tests/synclines.at: Be sure to prototype yylex and yyerror to
13985 avoid GCC warnings.
13986
0c2d3f4c
AD
139872002-05-07 Akim Demaille <akim@epita.fr>
13988
13989 Kill GCC warnings.
13990
13991 * src/reduce.c (nonterminals_reduce): Don't loop over RITEM: loop
13992 over the RHS of each rule.
13993 * src/gram.h, src/gram.c (nritems): Is `unsigned int', not int.
13994 * src/state.h (state_t): Member `nitems' is unsigned short.
13995 * src/LR0.c (get_state): Adjust.
13996 * src/reader.c (packgram): Likewise.
13997 * src/output.c (GENERATE_MUSCLE_INSERT_TABLE): `max' is of type
13998 `Type'.
13999 (muscle_insert_int_table): Remove, unused.
14000 (prepare_rules): Remove `max'.
14001
1565b720
AD
140022002-05-06 Akim Demaille <akim@epita.fr>
14003
14004 * src/closure.c (print_firsts): Display of the symbol tags.
14005 (bitmatrix_print): Move to...
14006 * lib/bitsetv-print.h, lib/bitsetv-print.c (bitsetv_matrix_dump):
14007 here.
14008 * tests/sets.at (Nullable, Broken Closure, Firsts): Adjust.
14009
cfaee611
AD
140102002-05-06 Akim Demaille <akim@epita.fr>
14011
14012 * src/muscle_tab.c (muscle_m4_output): Must return TRUE for
14013 hash_do_for_each.
14014
458be8e0
AD
140152002-05-06 Akim Demaille <akim@epita.fr>
14016
14017 * src/LR0.c (new_state, get_state): Instead of using the global
14018 `kernel_size' and `kernel_base', have two new arguments:
14019 `core_size' and `core'.
14020 Adjust callers.
14021
a900a624
AD
140222002-05-06 Akim Demaille <akim@epita.fr>
14023
14024 * src/reader.c (packgram): No longer end `ritem' with a 0
14025 sentinel: it is not used.
14026
d4e7d3a1
AD
140272002-05-05 Akim Demaille <akim@epita.fr>
14028
14029 New experimental feature: display the lookaheads in the report and
14030 graph.
14031
14032 * src/print (print_core): When --trace-flag, display the rules
14033 lookaheads.
14034 * src/print_graph.c (print_core): Likewise.
14035 Swap the arguments.
14036 Adjust caller.
14037
39ceb25b
AD
140382002-05-05 Akim Demaille <akim@epita.fr>
14039
14040 * tests/torture.at (Many lookaheads): New test.
14041
5372019f
AD
140422002-05-05 Akim Demaille <akim@epita.fr>
14043
14044 * src/output.c (GENERATE_OUTPUT_TABLE): Replace with...
14045 (GENERATE_MUSCLE_INSERT_TABLE): this.
14046 (output_int_table, output_unsigned_int_table, output_short_table)
14047 (output_token_number_table, output_item_number_table): Replace with...
14048 (muscle_insert_int_table, muscle_insert_unsigned_int_table)
14049 (muscle_insert_short_table, muscle_insert_token_number_table)
14050 (muscle_insert_item_number_table): these.
14051 Adjust all callers.
14052 (prepare_tokens): Don't free `translations', since...
14053 * src/reader.h, src/reader.c (grammar_free): do it.
14054 Move to...
14055 * src/gram.h, src/gram.c (grammar_free): here.
14056 * data/bison.simple, data/bison.c++: b4_token_number_max is now
14057 b4_translate_max.
14058
5df5f6d5
AD
140592002-05-05 Akim Demaille <akim@epita.fr>
14060
14061 * src/output.c (output_unsigned_int_table): New.
14062 (prepare_rules): `i' is unsigned.
14063 `prhs', `rline', `r2' are unsigned int.
14064 Rename muscle `rhs_number_max' as `rhs_max'.
14065 Output muscles `prhs_max', `rline_max', and `r2_max'.
14066 Free rline and r1.
14067 * data/bison.simple, data/bison.c++: Adjust to use these muscles
14068 to compute types instead of constant types.
14069 * tests/regression.at (Web2c Actions): Adjust.
14070
b87f8b21
AD
140712002-05-04 Akim Demaille <akim@epita.fr>
14072
14073 * src/symtab.h (SALIAS, SUNDEF): Rename as...
14074 (USER_NUMBER_ALIAS, USER_NUMBER_UNDEFINED): these.
14075 Adjust dependencies.
14076 * src/output.c (token_definitions_output): Be sure not to output a
14077 `#define 'a'' when fed with `%token 'a' "a"'.
14078 * tests/regression.at (Token definitions): New.
14079
8bb936e4
PE
140802002-05-03 Paul Eggert <eggert@twinsun.com>
14081
14082 * data/bison.simple (b4_token_defines): Also define YYTOKENTYPE
14083 for K&R C.
14084
140852002-05-03 gettextize <bug-gnu-gettext@gnu.org>
14086
14087 * Makefile.am (SUBDIRS): Remove intl.
14088 (EXTRA_DIST): Add config/config.rpath.
14089
53c71a12
AD
140902002-05-03 Akim Demaille <akim@epita.fr>
14091
14092 * data/bison.simple (m4_if): Don't output empty enums.
14093 And actually, output valid enum definitions :(.
14094
289dd0cf
AD
140952002-05-03 Akim Demaille <akim@epita.fr>
14096
14097 * configure.bat: Remove, completely obsolete.
14098 * Makefile.am (EXTRA_DIST): Adjust.
14099 Don't distribute config.rpath...
14100 * config/Makefile.am (EXTRA_DIST): Do it.
14101
db85e524
AD
141022002-05-03 Akim Demaille <akim@epita.fr>
14103
14104 * configure.in (GETTEXT_VERSION): New.
14105 Suggested by Bruno Haible for the forthcoming Gettext 0.10.3.
14106
83ccf991
AD
141072002-05-03 Akim Demaille <akim@epita.fr>
14108
14109 * data/bison.simple (b4_token_enum): New.
14110 (b4_token_defines): Use it to output tokens both as #define and
14111 enums.
14112 Suggested by Paul Eggert.
14113 * src/output.c (token_definitions_output): Don't output spurious
14114 white spaces.
14115
1f418995
AD
141162002-05-03 Akim Demaille <akim@epita.fr>
14117
14118 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14119
45119f04
RA
141202002-05-02 Robert Anisko <robert@lrde.epita.fr>
14121
14122 * data/bison.c++: Adapt expansion of $s and @s to the C++ parser.
14123 Update the stack class, give a try to deque as the default container.
14124
b2d52318
AD
141252002-05-02 Akim Demaille <akim@epita.fr>
14126
14127 * data/bison.simple (yyparse): Do not implement @$ = @1.
14128 (YYLLOC_DEFAULT): Adjust to do it.
14129 * doc/bison.texinfo (Location Default Action): Fix.
14130
3a8b4109
AD
141312002-05-02 Akim Demaille <akim@epita.fr>
14132
14133 * src/reader.c (parse_braces): Merge into...
14134 (parse_action): this.
14135
84614e13
AD
141362002-05-02 Akim Demaille <akim@epita.fr>
14137
14138 * configure.in (ALL_LINGUAS): Remove.
14139 * po/LINGUAS, hr.po: New.
14140
fdbcd8e2
AD
141412002-05-02 Akim Demaille <akim@epita.fr>
14142
14143 Remove the so called hairy (semantic) parsers.
14144
14145 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove.
14146 * src/gram.h, src/gram.c (semantic_parser): Remove.
14147 (rule_t): Remove the guard and guard_line members.
14148 * src/lex.h (token_t): remove tok_guard.
14149 * src/options.c (option_table): Remove %guard and %semantic_parser
14150 support.
14151 * src/output.c, src/output.h (guards_output): Remove.
14152 (prepare): Adjust.
14153 (token_definitions_output): Don't output the `T'
14154 tokens (???).
14155 (output_skeleton): Don't output the guards.
14156 * src/files.c, src/files.c (attrsfile): Remove.
14157 * src/reader.c (symbol_list): Remove the guard and guard_line
14158 members.
14159 Adjust dependencies.
14160 (parse_guard): Remove.
14161 * data/bison.hairy: Remove.
14162 * doc/bison.texinfo (Environment Variables): Remove occurrences of
14163 BISON_HAIRY.
14164
82b6cb3f
AD
141652002-05-02 Akim Demaille <akim@epita.fr>
14166
14167 * src/reader.c (copy_at, copy_dollarm parse_braces, parse_action)
14168 (parse_guard): Rename the formal argument `stack_offset' as
14169 `rule_length', which is more readable.
14170 Adjust callers.
14171 (copy_at, copy_dollar): Instead of outputting the hard coded
14172 values of $$, $n and so forth, output invocation to b4_lhs_value,
14173 b4_lhs_location, b4_rhs_value, and b4_rhs_location.
900c877b
AD
14174 Note: this patch partially drops `semantic-parser' support: it
14175 always does `rule_length - n', where semantic parsers ought to
14176 always use `-n'.
82b6cb3f
AD
14177 * data/bison.simple, data/bison.c++ (b4_lhs_value)
14178 (b4_lhs_location, b4_rhs_value, and b4_rhs_location: New.
14179
6cbfbcc5
AD
141802002-05-02 Akim Demaille <akim@epita.fr>
14181
14182 * configure.in (AC_INIT): Bump to 1.49b.
14183 (AM_INIT_AUTOMAKE): Short invocation.
14184
b8548114
AD
141852002-05-02 Akim Demaille <akim@epita.fr>
14186
14187 Version 1.49a.
14188
c20cd1fa
AD
141892002-05-01 Akim Demaille <akim@epita.fr>
14190
14191 * src/skeleton.h: Remove.
14192
8a9566d4
AD
141932002-05-01 Akim Demaille <akim@epita.fr>
14194
14195 * src/skeleton.h: Fix the #endif.
14196 Reported by Magnus Fromreide.
14197
8c6d399a
PE
141982002-04-26 Paul Eggert <eggert@twinsun.com>
14199
14200 * data/bison.simple (YYSTYPE_IS_TRIVIAL, YYLTYPE_IS_TRIVIAL):
14201 Define if we define YYSTYPE and YYLTYPE, respectively.
b756bb75 14202 (YYCOPY): Fix [] quoting problem in the non-GCC case.
8a9566d4 14203
2b7ed18a
RA
142042002-04-25 Robert Anisko <robert@lrde.epita.fr>
14205
14206 * src/scan-skel.l: Postprocess quadrigraphs.
14207
14208 * src/reader.c (copy_character): New function, used to output
14209 single characters while replacing `[' and `]' with quadrigraphs, to
14210 avoid troubles with M4 quotes.
14211 (copy_comment): Output characters with copy_character.
14212 (read_additionnal_code): Likewise.
14213 (copy_string2): Likewise.
14214 (copy_definition): Likewise.
14215
14216 * tests/calc.at: Exercise M4 quoting.
14217
34a89c50
AD
142182002-04-25 Akim Demaille <akim@epita.fr>
14219
14220 * tests/sets.at (AT_EXTRACT_SETS): Sed portability issue: no space
14221 between `!' and the command.
14222 Reported by Paul Eggert.
14223
0dd1580a
RA
142242002-04-24 Robert Anisko <robert@lrde.epita.fr>
14225
14226 * tests/calc.at: Exercise prologue splitting.
14227
14228 * data/bison.simple, data/bison.c++: Use `b4_pre_prologue' and
14229 `b4_post_prologue' instead of `b4_prologue'.
14230
14231 * src/output.c (prepare): Add the `pre_prologue' and `post_prologue'
14232 muscles.
14233 (output): Free pre_prologue_obstack and post_prologue_obstack.
14234 * src/files.h, src/files.c (attrs_obstack): Remove.
14235 (pre_prologue_obstack, post_prologue_obstack): New.
14236 * src/reader.c (copy_definition): Add a parameter to specify the
14237 obstack to fill, instead of using attrs_obstack unconditionally.
14238 (read_declarations): Pass pre_prologue_obstack to copy_definition if
14239 `%union' has not yet been seen, pass post_prologue_obstack otherwise.
14240
83c1796f
PE
142412002-04-23 Paul Eggert <eggert@twinsun.com>
14242
14243 * data/bison.simple: Remove unnecessary commentary and white
14244 space differences from 1_29-branch.
14245 Depend on YYERROR_VERBOSE, not defined (YYERROR_VERBOSE).
14246
14247 (union yyalloc, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYCOPY,
14248 YYSTACK_RELOCATE): Do not define if yyoverflow is defined, or
14249 if this is a C++ parser and YYSTYPE or YYLTYPE has nontrivial
14250 constructors or destructors.
14251
14252 (yyparse) [! defined YYSTACK_RELOCATE]: Do not relocate the stack.
14253
1207eeac
AD
142542002-04-23 Akim Demaille <akim@epita.fr>
14255
14256 * tests/sets.at (AT_EXTRACT_SETS): Don't use 8 char long sed labels.
14257 * tests/synclines.at (AT_TEST_SYNCLINE): Be robust to GCC's
14258 location with columns.
14259 * tests/conflicts.at (%nonassoc and eof): Don't use `error.h'.
14260 All reported by Paul Eggert.
14261
78ab8f67
AD
142622002-04-22 Akim Demaille <akim@epita.fr>
14263
14264 * src/reduce.c (dump_grammar): Move to...
14265 * src/gram.h, src/gram.c (grammar_dump): here.
14266 Be sure to separate long item numbers.
14267 Don't read the members of a rule's prec if its nil.
14268
133c20e2
AD
142692002-04-22 Akim Demaille <akim@epita.fr>
14270
14271 * src/output.c (table_size, table_grow): New.
14272 (MAXTABLE): Remove, replace uses with table_size.
14273 (pack_vector): Instead of dying when the table is too big, grow it.
14274
9515e8a7
AD
142752002-04-22 Akim Demaille <akim@epita.fr>
14276
14277 * data/bison.simple (yyr1): Its type is that of a token number.
14278 * data/bison.c++ (r1_): Likewise.
14279 * tests/regression.at (Web2c Actions): Adjust.
14280
23c5a174
AD
142812002-04-22 Akim Demaille <akim@epita.fr>
14282
14283 * src/reader.c (token_translations_init): 256 is now the default
14284 value for the error token, i.e., it will be assigned another
14285 number if the user assigned 256 to one of her tokens.
14286 (reader): Don't force 256 to error.
14287 * doc/bison.texinfo (Symbols): Adjust.
14288 * tests/torture.at (AT_DATA_HORIZONTAL_GRAMMAR)
14289 (AT_DATA_TRIANGULAR_GRAMMAR): Number the tokens as 1, 2, 3
14290 etc. instead of 10, 20, 30 (which was used to `jump' over error
14291 (256) and undefined (2)).
14292
5fbb0954
AD
142932002-04-22 Akim Demaille <akim@epita.fr>
14294
14295 Propagate more token_number_t.
14296
14297 * src/gram.h (token_number_as_item_number)
14298 (item_number_as_token_number): New.
14299 * src/output.c (GENERATE_OUTPUT_TABLE): New.
14300 Use it to create output_item_number_table and
14301 output_token_number_table.
14302 * src/LR0.c, src/derives.c, src/gram.c, src/gram.h, src/lalr.c,
14303 * src/lex.c, src/nullable.c, src/output.c, src/print.c,
14304 * src/print_graph.c, src/reader.c, src/reduce.c, src/state.h,
14305 * src/symtab.c, src/symtab.h: Use token_number_t instead of shorts.
14306
4f940944
AD
143072002-04-22 Akim Demaille <akim@epita.fr>
14308
14309 * src/output.h, src/output.c (get_lines_number): Remove.
14310
3ded9a63
AD
143112002-04-19 Akim Demaille <akim@epita.fr>
14312
14313 * doc/bison.texinfo (Actions): Make clear that `|' is not the same
14314 as Lex/Flex'.
14315 (Debugging): More details about enabling the debugging features.
14316 (Table of Symbols): Describe $$, $n, @$, and @n.
14317 Suggested by Tim Josling.
14318
e0c471a9
AD
143192002-04-19 Akim Demaille <akim@epita.fr>
14320
14321 * doc/bison.texinfo: Remove the uses of the obsolete @refill.
14322
fecc10cd
AD
143232002-04-10 Akim Demaille <akim@epita.fr>
14324
14325 * src/system.h: Rely on HAVE_LIMITS_H.
14326 Suggested by Paul Eggert.
14327
51dec47b
AD
143282002-04-09 Akim Demaille <akim@epita.fr>
14329
14330 * tests/calc.at (_AT_CHECK_CALC_ERROR): Receive as argument the
14331 full stderr, and strip it according to the bison options, instead
14332 of composing the error message from different bits.
14333 This makes it easier to check for several error messages.
14334 Adjust all the invocations.
14335 Add an invocation exercising the error token.
14336 Add an invocation demonstrating a stupid error message.
14337 (_AT_DATA_CALC_Y): Follow the GCS: initial column is 1, not 0.
14338 Adjust the tests.
14339 Error message are for stderr, not stdout.
14340
007a50a4
AD
143412002-04-09 Akim Demaille <akim@epita.fr>
14342
14343 * src/gram.h, src/gram.c (error_token_number): Remove, use
14344 errtoken->number.
14345 * src/reader.c (reader): Don't specify the user token number (2)
14346 for $undefined, as it uselessly prevents using it.
14347 * src/gram.h (token_number_t): Move to...
14348 * src/symtab.h: here.
14349 (state_t.number): Is a token_number_t.
14350 * src/print.c, src/reader.c: Use undeftoken->number instead of
14351 hard coded 2.
14352 (Even though this 2 is not the same as above: the number of the
14353 undeftoken remains being 2, it is its user token number which
14354 might not be 2).
14355 * src/output.c (prepare_tokens): Rename the `maxtok' muscle with
14356 `user_token_number_max'.
14357 Output `undef_token_number'.
14358 * data/bison.simple, data/bison.c++: Use them.
14359 Be sure to map invalid yylex return values to
14360 `undef_token_number'. This saves us from gratuitous SEGV.
14361
14362 * tests/conflicts.at (Solved SR Conflicts)
14363 (Unresolved SR Conflicts): Adjust.
14364 * tests/regression.at (Web2c Actions): Adjust.
14365
06446ccf
AD
143662002-04-08 Akim Demaille <akim@epita.fr>
14367
14368 * data/bison.c++: s/b4_item_number_max/b4_rhs_number_max/.
14369 Adding #line.
14370 Remove the duplicate `typedefs'.
14371 (RhsNumberType): Fix the declaration and various other typos.
14372 Use __ofile__.
14373 * data/bison.simple: Use __ofile__.
14374 * src/scan-skel.l: Handle __ofile__.
14375
62a3e4f0
AD
143762002-04-08 Akim Demaille <akim@epita.fr>
14377
14378 * src/gram.h (item_number_t): New, the type of item numbers in
14379 RITEM. Note that it must be able to code symbol numbers as
14380 positive number, and the negation of rule numbers as negative
14381 numbers.
14382 Adjust all dependencies (pretty many).
14383 * src/reduce.c (rule): Remove this `short *' pointer: use
14384 item_number_t.
14385 * src/system.h (MINSHORT, MAXSHORT): Remove.
14386 Include `limits.h'.
14387 Adjust dependencies to using SHRT_MAX and SHRT_MIN.
14388 (shortcpy): Remove.
14389 (MAXTABLE): Move to...
14390 * src/output.c (MAXTABLE): here.
14391 (prepare_rules): Use output_int_table to output rhs.
14392 * data/bison.simple, data/bison.c++: Adjust.
14393 * tests/torture.at (Big triangle): Move the limit from 254 to
14394 500.
14395 * tests/regression.at (Web2c Actions): Ajust.
14396
14397 Trying with bigger grammars shows various phenomena: at 3000 (28Mb
14398 of grammar file) bison is killed by my system, at 2000 (12Mb) bison
14399 passes, but produces negative #line number, once fixed, GCC is
14400 killed while compiling 14Mb, at 1500 (6.7 Mb of grammar, 8.2Mb of
14401 C), it passes.
14402 * src/state.h (state_h): Code input lines on ints, not shorts.
14403
bb88b0fc
AD
144042002-04-08 Akim Demaille <akim@epita.fr>
14405
14406 * src/reduce.c (reduce_grammar): First reduce the nonterminals,
14407 and then the grammar.
14408
9a636f47
AD
144092002-04-08 Akim Demaille <akim@epita.fr>
14410
14411 * src/system.h: No longer using strndup.
14412
680e8701
AD
144132002-04-07 Akim Demaille <akim@epita.fr>
14414
14415 * src/muscle_tab.h (MUSCLE_INSERT_LONG_INT): New.
14416 * src/output.c (output_table_data): Return the longest number.
14417 (prepare_tokens): Output `token_number_max').
14418 * data/bison.simple, data/bison.c++ (b4_sint_type, b4_uint_type):
14419 New.
14420 Use them to define yy_token_number_type/TokenNumberType.
14421 Use this type for yytranslate.
14422 * tests/torture.at (Big triangle): Push the limit from 124 to
14423 253.
14424 * tests/regression.at (Web2c Actions): Adjust.
14425
817e9f41
AD
144262002-04-07 Akim Demaille <akim@epita.fr>
14427
14428 * tests/torture.at (Big triangle): New.
14429 (GNU AWK Grammar, GNU Cim Grammar): Move to...
14430 * tests/existing.at: here.
14431
5123689b
AD
144322002-04-07 Akim Demaille <akim@epita.fr>
14433
14434 * src/gram.h, src/gram.c (nitems): Remove, it is an alias of
14435 nritems.
14436 Adjust dependencies.
14437
f3849179
AD
144382002-04-07 Akim Demaille <akim@epita.fr>
14439
14440 * src/reader.c: Normalize increments to prefix form.
14441
bd02036a
AD
144422002-04-07 Akim Demaille <akim@epita.fr>
14443
14444 * src/reader.c, symtab.c: Remove debugging code.
14445
db8837cb
AD
144462002-04-07 Akim Demaille <akim@epita.fr>
14447
14448 Rename all the `bucket's as `symbol_t'.
14449
14450 * src/gram.c, src/gram.h, src/lex.c, src/lex.h, src/output.c,
14451 * src/reader.c, src/reader.h, src/reduce.c, src/state.h,
14452 * src/symtab.c, src/symtab.h (bucket): Rename as...
14453 (symbol_t): this.
14454 (symbol_list_new, bucket_check_defined, bucket_make_alias)
14455 (bucket_check_alias_consistence, bucket_pack, bucket_translation)
14456 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14457 (buckets_new, buckets_free, buckets_do): Rename as...
14458 (symbol_list_new, symbol_check_defined, symbol_make_alias)
14459 (symbol_check_alias_consistence, symbol_pack, symbol_translation)
14460 (symbol_new, symbol_free, hash_compare_symbol_t, hash_symbol_t)
14461 (symbols_new, symbols_free, symbols_do): these.
14462
72a23c97
AD
144632002-04-07 Akim Demaille <akim@epita.fr>
14464
14465 Use lib/hash for the symbol table.
14466
14467 * src/gram.c (ntokens): Initialize to 1, to reserve a slot for
14468 EOF.
14469 * src/lex.c (lex): Set the `number' member of new terminals.
14470 * src/reader.c (bucket_check_defined, bucket_make_alias)
14471 (bucket_check_alias_consistence, bucket_translation): New.
14472 (reader, grammar_free, readgram, token_translations_init)
14473 (packsymbols): Adjust.
14474 (reader): Number the predefined tokens.
14475 * src/reduce.c (inaccessable_symbols): Just use hard coded numbers
14476 for predefined tokens.
14477 * src/symtab.h (bucket): Remove all the hash table related
14478 members.
14479 * src/symtab.c (symtab): Replace by...
14480 (bucket_table): this.
14481 (bucket_new, bucket_free, hash_compare_bucket, hash_bucket)
14482 (buckets_new, buckets_do): New.
14483
280a38c3
AD
144842002-04-07 Akim Demaille <akim@epita.fr>
14485
14486 * src/gram.c (nitems, nrules, nsyms, ntokens, nvars, nritems)
14487 (start_symbol, max_user_token_number, semantic_parser)
14488 (error_token_number): Initialize.
14489 * src/reader.c (grammar, start_flag, startval, typed, lastprec):
14490 Initialize.
14491 (reader): Don't.
14492 (errtoken, eoftoken, undeftoken, axiom): Extern.
14493
03b31c0c
AD
144942002-04-07 Akim Demaille <akim@epita.fr>
14495
14496 * src/gram.h (rule_s): prec and precsym are now pointers
14497 to the bucket giving the priority/associativity.
14498 Member `associativity' removed: useless.
14499 * src/reduce.c, src/conflicts.c: Adjust.
14500
8b3df748
AD
145012002-04-07 Akim Demaille <akim@epita.fr>
14502
14503 * src/lalr.c, src/LR0.c, src/closure.c, src/gram.c, src/reduce.c:
14504 Properly escape the symbols' TAG when outputting them.
14505
e601aa1d
AD
145062002-04-07 Akim Demaille <akim@epita.fr>
14507
14508 * src/lalr.h (LA): Is a bitsetv, not bitset*.
14509
b0299a2e
AD
145102002-04-07 Akim Demaille <akim@epita.fr>
14511
14512 * src/lalr.h, src/lalr.c (LAruleno): Replace with...
14513 (LArule): this, which is an array to rule_t*.
14514 * src/print.c, src/conflicts.c: Adjust.
14515
d7e1f00c
AD
145162002-04-07 Akim Demaille <akim@epita.fr>
14517
14518 * src/gram.h (rule_t): Rename `number' as `user_number'.
14519 `number' is a new member.
14520 Adjust dependencies.
14521 * src/reduce.c (reduce_grammar_tables): Renumber rule_t.number.
14522
cc9305dd
AD
145232002-04-07 Akim Demaille <akim@epita.fr>
14524
14525 As a result of the previous patch, it is no longer needed
14526 to reorder ritem itself.
14527
14528 * src/reduce.c (reduce_grammar_tables): Don't sort RITEM.
14529
b0940840
AD
145302002-04-07 Akim Demaille <akim@epita.fr>
14531
14532 Be sure never to walk through RITEMS, but use only data related to
14533 the rules themselves. RITEMS should be banished.
14534
14535 * src/output.c (output_token_translations): Rename as...
14536 (prepare_tokens): this.
14537 In addition to `translate', prepare the muscles `tname' and
14538 `toknum', which were handled by...
14539 (output_rule_data): this.
14540 Remove, and move the remainder of its outputs into...
14541 (prepare_rules): this new routines, which also merges content from
14542 (output_gram): this.
14543 (prepare_rules): Be sure never to walk through RITEMS.
14544 (output_stos): Rename as...
14545 (prepare_stos): this.
14546 (output): Always invoke prepare_states, after all, just don't use it
14547 in the output if you don't need it.
14548
643a5994
AD
145492002-04-07 Akim Demaille <akim@epita.fr>
14550
14551 * src/LR0.c (new_state): Display `nstates' as the name of the
14552 newly created state.
14553 Adjust to initialize first_state and last_state if needed.
14554 Be sure to distinguish the initial from the final state.
14555 (new_states): Create the itemset of the initial state, and use
14556 new_state.
14557 * src/closure.c (closure): Now that the initial state has its
14558 items properly set, there is no need for a special case when
14559 creating `ruleset'.
14560
14561 As a result, now the rule 0, reducing to $axiom, is visible in the
14562 outputs. Adjust the test suite.
14563
14564 * tests/conflicts.at (Solved SR Conflicts)
14565 (Unresolved SR Conflicts): Adjust.
14566 * tests/regression.at (Web2c Report, Rule Line Numbers): Idem.
14567 * tests/conflicts.at (S/R in initial): New.
14568
b4c4ccc2
AD
145692002-04-07 Akim Demaille <akim@epita.fr>
14570
14571 * src/LR0.c (allocate_itemsets): Don't loop over ritem: loop over
14572 the RHS of the rules.
14573 * src/output.c (output_gram): Likewise.
14574
bba97eb2
AD
145752002-04-07 Akim Demaille <akim@epita.fr>
14576
14577 * src/gram.h (rule_t): `lhs' is now a pointer to the symbol's
14578 bucket.
14579 Adjust all dependencies.
14580 * src/reduce.c (nonterminals_reduce): Don't forget to renumber the
14581 `number' of the buckets too.
14582 * src/gram.h: Include `symtab.h'.
14583 (associativity): Move to...
14584 * src/symtab.h: here.
14585 No longer include `gram.h'.
14586
c3b407f4
AD
145872002-04-07 Akim Demaille <akim@epita.fr>
14588
14589 * src/gram.h, src/gram.c (rules_rhs_length): New.
14590 (ritem_longest_rhs): Use it.
14591 * src/gram.h (rule_t): `number' is a new member.
14592 * src/reader.c (packgram): Set it.
14593 * src/reduce.c (reduce_grammar_tables): Move the useless rules at
14594 the end of `rules', and count them out of `nrules'.
14595 (reduce_output, dump_grammar): Adjust.
14596 * src/print.c (print_grammar): It is no longer needed to check for
14597 the usefulness of a rule, as useless rules are beyond `nrules + 1'.
14598 * tests/reduce.at (Reduced Automaton): New test.
14599
11652ab3
AD
146002002-04-07 Akim Demaille <akim@epita.fr>
14601
14602 * src/reduce.c (inaccessable_symbols): Fix a buglet: because of a
14603 lacking `+ 1' to nrules, Bison reported as useless a token if it
14604 was used solely to set the precedence of the last rule...
14605
26b23c1a
AD
146062002-04-07 Akim Demaille <akim@epita.fr>
14607
14608 * data/bison.c++, data/bison.simple: Don't output the current file
14609 name in #line, to avoid useless diffs between two identical
14610 outputs under different names.
14611
18bcecb0
AD
146122002-04-07 Akim Demaille <akim@epita.fr>
14613
14614 * src/closure.c, src/print.c, src/reader.c, src/reduce.c:
14615 Normalize loops to using `< nrules + 1', not `<= nrules'.
14616
fa770c86
AD
146172002-04-07 Akim Demaille <akim@epita.fr>
14618
14619 * TODO: Update.
14620
d9b739c3
AD
146212002-04-07 Akim Demaille <akim@epita.fr>
14622
14623 * src/output.c, src/reader.c, src/symtab.c, src/symtab.h: Rename
14624 bucket.value as bucket.number.
14625
99013900
AD
146262002-04-07 Akim Demaille <akim@epita.fr>
14627
14628 * src/closure.c, src/derives.c, src/gram.h, src/lalr.c,
14629 * src/nullable.c, src/output.c, src/print.c, src/print_graph.c,
14630 * src/reader.c, src/reduce.c: Let rule_t.rhs point directly to the
14631 RHS, instead of being an index in RITEMS.
14632
e966383b
PE
146332002-04-04 Paul Eggert <eggert@twinsun.com>
14634
14635 * doc/bison.texinfo: Update copyright date.
14636 (Rpcalc Lexer, Symbols, Token Decl): Don't assume ASCII.
14637 (Symbols): Warn about running Bison in one character set,
14638 but compiling and/or running in an incompatible one.
14639 Warn about character code 256, too.
14640
146412002-04-03 Paul Eggert <eggert@twinsun.com>
14642
14643 * src/bison.data (YYSTACK_ALLOC): Depend on whether
14644 YYERROR_VERBOSE is nonzero, not whether it is defined.
14645
14646 Merge changes from bison-1_29-branch.
c307773e 14647
8d6c48b9
PE
146482002-03-20 Paul Eggert <eggert@twinsun.com>
14649
14650 Merge fixes from Debian bison_1.34-1.diff.
14651
14652 * configure.in (AC_PREREQ): 2.53.
14653
e53c6322
AD
146542002-03-20 Akim Demaille <akim@epita.fr>
14655
14656 * src/conflicts.c (log_resolution): Argument `resolution' is const.
14657
9ffbeca7
PE
146582002-03-19 Paul Eggert <eggert@twinsun.com>
14659
21db0b2a
PE
14660 * src/bison.simple (YYCOPY): New macro.
14661 (YYSTACK_RELOCATE): Use it.
14662 Remove Type arg; no longer needed. All callers changed.
14663 (yymemcpy): Remove; no longer needed.
14664
9ffbeca7
PE
14665 * Makefile.am (AUTOMAKE_OPTIONS): 1.6.
14666 * doc/Makefile.am (AUTOMAKE_OPTIONS): Remove.
14667
642cb8f8
AD
146682002-03-19 Akim Demaille <akim@epita.fr>
14669
14670 Test and fix the #line outputs.
14671
14672 * tests/atlocal.at (GCC): New.
14673 * tests/synclines.at (AT_TEST_SYNCLINE): New macro.
0ffd4fd1 14674 (Prologue synch line, %union synch line, Postprologue synch line)
642cb8f8
AD
14675 (Action synch line, Epilogue synch line): New tests.
14676 * src/reader.c (parse_union_decl): Define the muscle stype_line.
14677 * data/bison.simple, data/bison.c++: Use it.
14678
3c31a486
AD
146792002-03-19 Akim Demaille <akim@epita.fr>
14680
14681 * tests/regression.at (%nonassoc and eof, Unresolved SR Conflicts)
14682 (Solved SR Conflicts, %expect not enough, %expect right)
14683 (%expect too much): Move to...
14684 * tests/conflicts.at: this new file.
14685
0d8bed56
AD
146862002-03-19 Akim Demaille <akim@epita.fr>
14687
14688 * data/m4sugar/m4sugar.m4: Update from CVS Autoconf.
14689 * data/bison.simple, data/bison.c++: Handle the `#define' part, so
14690 that we can move to enums for instance.
14691 * src/output.c (token_definitions_output): Output a list of
14692 `token-name, token-number' instead of the #define.
14693 (output_skeleton): Name this list `b4_tokens', not `b4_tokendefs'.
14694
9208d17f
AD
146952002-03-14 Akim Demaille <akim@epita.fr>
14696
14697 Use Gettext 0.11.1.
14698
af27eacb
RA
146992002-03-09 Robert Anisko <robert@lrde.epita.fr>
14700
14701 * data/bison.c++: Make the user able to add members to the generated
14702 parser by subclassing.
14703
9101a310
RA
147042002-03-05 Robert Anisko <robert@lrde.epita.fr>
14705
14706 * src/reader.c (read_additionnal_code): `c' should be an integer, not
14707 a character.
14708 Reported by Nicolas Tisserand and Nicolas Burrus.
14709
fff9bf0b
RA
147102002-03-04 Robert Anisko <robert@lrde.epita.fr>
14711
14712 * src/reader.c: Warn about lacking semi-colons, do not complain.
14713
64dba31e
RA
147142002-03-04 Robert Anisko <robert@lrde.epita.fr>
14715
14716 * data/bison.c++: Remove a debug line.
14717
374f5a14
RA
147182002-03-04 Robert Anisko <robert@lrde.epita.fr>
14719
14720 * data/bison.c++: Unmerge value as yylval and value as yyval. Unmerge
14721 location as yylloc and location as yyloc. Use YYLLOC_DEFAULT, and
14722 provide a default implementation.
14723
bfcf1f3a
AD
147242002-03-04 Akim Demaille <akim@epita.fr>
14725
14726 * tests/input.at (Invalid $n, Invalid @n): Add the ending `;'.
14727 * tests/output.at (AT_CHECK_OUTPUT): Likewise.
14728 * tests/headers.at (AT_TEST_CPP_GUARD_H): Ditto.
14729 * tests/semantic.at (Parsing Guards): Similarly.
14730 * src/reader.at (readgram): Complain if the last rule is not ended
14731 with a semi-colon.
14732
65ccf9fc
AD
147332002-03-04 Akim Demaille <akim@epita.fr>
14734
14735 * src/warshall.h, src/warshall.c (bitmatrix_print): Move to...
14736 * src/closure.c: here.
14737 (set_firsts): Use bitsetv_reflexive_transitive_closure instead of
14738 RTC.
14739 * src/warshall.h, src/warshall.c: Remove.
14740 * tests/sets.at (Broken Closure): Adjust.
14741
d0039cbc
AD
147422002-03-04 Akim Demaille <akim@epita.fr>
14743
14744 * src/output.c (output_skeleton): tempdir is const.
14745 bytes_read is unused.
14746
345cea78
AD
147472002-03-04 Akim Demaille <akim@epita.fr>
14748
14749 * lib/bbitset.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14750 * lib/bitsetv.h, lib/ebitset.c, lib/lbitset.c, lib/sbitset.c:
14751 Update.
14752 From Michael Hayes.
14753
564801f7
AD
147542002-03-04 Akim Demaille <akim@epita.fr>
14755
14756 * src/closure.c (closure): `r' is unused.
14757
e5352bc7
AD
147582002-03-04 Akim Demaille <akim@epita.fr>
14759
14760 * tests/sets.at (Broken Closure): Add the ending `;'.
14761 * src/reader.at (readgram): Complain if a rule is not ended with a
14762 semi-colon.
14763
914feea9
AD
147642002-03-04 Akim Demaille <akim@epita.fr>
14765
14766 * src/conflicts.c (set_conflicts): Use bitset_disjoint_p.
14767 (count_sr_conflicts): Use bitset_count.
14768 * src/reduce.c (inaccessable_symbols): Ditto.
14769 (bits_size): Remove.
14770 * src/warshall.h, src/warshall.c: Convert to bitsetv.
14771
f0250de6
AD
147722002-03-04 Akim Demaille <akim@epita.fr>
14773
14774 * src/closure.c, src/conflicts.c, src/lalr.c, src/print.c,
14775 * src/reduce.c: Remove the `bitset_zero's following the
14776 `bitset_create's, as now it is performed by the latter.
14777
ef017502
AD
147782002-03-04 Akim Demaille <akim@epita.fr>
14779
14780 * lib/bitset.c, lib/bitset.h, lib/bitsetv.c, lib/bitsetv.h,
14781 * lib/ebitset.c, lib/ebitset.h, lib/lbitset.c, lib/lbitset.h,
14782 * lib/sbitset.c, lib/sbitset.h, lib/bbitset.h: Update from the
14783 latest sources from Michael.
14784
76514394
AD
147852002-03-04 Akim Demaille <akim@epita.fr>
14786
14787 * src/output.c (output): Don't free the grammar.
14788 * src/reader.c (grammar_free): New.
14789 * src/main.c (main): Call it and don't free symtab here.
14790
55024580
AD
147912002-03-04 Akim Demaille <akim@epita.fr>
14792
14793 * src/lex.c (parse_percent_token): Be sure to 0-end token_buffer
14794 before returning.
14795 Reported by Benoit Perrot.
14796
f9abaa2c
AD
147972002-03-04 Akim Demaille <akim@epita.fr>
14798
14799 Use bitset operations when possible, not loops over bits.
14800
14801 * src/conflicts.c (set_conflicts, count_sr_conflicts): Use
14802 bitset_or.
14803 * src/print.c (print_reductions): Use bitset_and, bitset_andn.
14804 * src/reduce.c (useless_nonterminals): Formatting changes.
14805 * src/warshall.c (TC): Use bitset_or.
14806
0e721e75
AD
148072002-03-04 Akim Demaille <akim@epita.fr>
14808
14809 * src/lalr.h, src/lalr.c (tokensetsize): Remove, unused.
14810 * src/system.h (BITS_PER_WORD, WORDSIZE, SETBIT, RESETBIT, BITISSET):
14811 Ditto.
14812
0fb1ffb1
AD
148132002-03-04 Akim Demaille <akim@epita.fr>
14814
14815 * src/lalr.c (F): Now a bitset*.
14816 Adjust all dependencies.
14817
b86796bf
AD
148182002-03-04 Akim Demaille <akim@epita.fr>
14819
14820 * src/conflicts.c (shiftset, lookaheadset): Now bitset.
14821 Adjust all dependencies.
14822
602bbf31
AD
148232002-03-04 Akim Demaille <akim@epita.fr>
14824
14825 * src/L0.c, src/LR0.h (nstates): Be size_t.
14826 Adjust comparisons (signed vs unsigned).
14827 * src/conflics.c, src/lalr.c, src/lalr.h, src/output.c (LA): Now a
14828 bitset*.
14829 Adjust all dependencies.
14830
d8a0245c
AD
148312002-03-04 Akim Demaille <akim@epita.fr>
14832
14833 * src/closure.c (firsts): Now, also a bitset.
14834 Adjust all dependencies.
14835 (varsetsize): Remove, now unused.
14836 * src/warshall.h, src/warshall.c: Now work on arrays of bitsets.
14837
34ba9743
AD
148382002-03-04 Akim Demaille <akim@epita.fr>
14839
14840 * src/print.c: Convert to use bitset.h, not hand coded iterations
14841 over ints.
14842
ed86e78c
AD
148432002-03-04 Akim Demaille <akim@epita.fr>
14844
14845 * src/reduce.c: Convert to use bitset.h, not hand coded BSet.
14846
dfdb1797
AD
148472002-03-04 Akim Demaille <akim@epita.fr>
14848
14849 * src/closure.c (ruleset): Be a bitset.
14850 (rulesetsize): Remove.
14851
7086e707
AD
148522002-03-04 Akim Demaille <akim@epita.fr>
14853
14854 * lib/bitset-int.h, lib/bitset.c, lib/bitset.h, lib/bitsetv.c,
14855 * lib/bitsetv.h, lib/ebitset.c, lib/ebitset.h, lib/lbitset.c,
14856 * lib/lbitset.h, lib/sbitset.c, lib/sbitset.h: New.
14857 * src/closure.c (fderives): Be an array of bitsets.
14858
98254360
RA
148592002-02-28 Robert Anisko <robert@lrde.epita.fr>
14860
14861 * data/bison.c++: Merge the two generated headers. Insert a copyright
14862 notice in each output file.
14863
a75c057f
AD
148642002-02-28 Akim Demaille <akim@epita.fr>
14865
14866 * data/bison.c++: Copy the prologue of bison.simple to fetch
14867 useful M4 definitions, such as b4_header_guard.
14868
06b00abc
AD
148692002-02-25 Akim Demaille <akim@epita.fr>
14870
14871 * src/getargs.c (version): Give the name of the authors, and use a
a75c057f
AD
14872 translator friendly scheme for the bgr
14873 copyright notice.
06b00abc 14874
70e7d534
AD
148752002-02-25 Akim Demaille <akim@epita.fr>
14876
14877 * src/output.c (header_output): Remove, now handled completely via
14878 M4.
14879
abe017f6
AD
148802002-02-25 Akim Demaille <akim@epita.fr>
14881
14882 * m4/m4.m4: New, from CVS Autoconf.
14883 * configure.in: Invoke it.
14884 * src/output.c (output_skeleton): Use its result instead of the
14885 hard coded name.
14886
381fb12e
AD
148872002-02-25 Akim Demaille <akim@epita.fr>
14888
14889 * lib/tempname.c, lib/mkstemp.c, m4/mkstemp.m4: New, stolen from
14890 Fileutils 4.1.5.
14891 * configure.in: Invoke UTILS_FUNC_MKSTEMP.
14892 * src/output.c (output_skeleton): Use mkstemp to create a real
14893 temporary file.
14894 Move the filling of `skeleton' and its muscle to...
14895 (prepare): here.
14896 (output): Move the definition of the prologue muscle to...
14897 (prepare): here.
14898 * src/system.h (DEFAULT_TMPDIR): New.
14899
6f38107f
PE
149002002-02-14 Paul Eggert <eggert@twinsun.com>
14901
14902 Remove the support for C++ namespace cleanliness; it was
14903 causing more problems than it was curing, since it didn't work
14904 properly on some nonstandard C++ compilers. This can wait
14905 for a proper C++ parser.
14906
14907 * NEWS: Document this.
14908 * doc/bison.texinfo (Bison Parser, Debugging): Remove special mention
14909 of C++, as it's treated like C now.
14910 * src/bison.simple (YYSTD): Remove.
14911 (YYSIZE_T, YYFPRINTF, YYPARSE_PARAM_ARG, YYPARSE_PARAM_DECL):
14912 Treat C++ just like Standard C instead of trying to support
14913 namespace cleanliness.
14914
80cce3da
AD
149152002-02-14 Akim Demaille <akim@epita.fr>
14916
14917 * tests/regression.at (else): Adjust to Andreas' change.
14918
842e8679
AD
149192002-02-14 Akim Demaille <akim@epita.fr>
14920
14921 * lib/Makefile.am (EXTRA_DIST): Ship strnlen.c.
14922
4bda3f10
AD
149232002-02-13 Andreas Schwab <schwab@suse.de>
14924
14925 * src/output.c (output_rule_data): Don't output NULL, it might
14926 not be defined yet.
14927
4162fa07 149282002-02-11 Robert Anisko <robert@lrde.epita.fr>
b418ecd8 14929
4162fa07
RA
14930 * data/bison.c++ (YYDEBUG, YYERROR_VERBOSE): After the prologue.
14931 (Copyright notice): Update.
b418ecd8 14932
bd16a5dc
AD
149332002-02-11 Akim Demaille <akim@epita.fr>
14934
14935 * tests/regression.at (%nonassoc and eof): Don't include
14936 nonportable headers.
14937
8d69a1a3
RA
149382002-02-08 Robert Anisko <robert@lrde.epita.fr>
14939
14940 * data/bison.c++: Correct error recovery. Make the user able to
14941 initialize the starting location.
14942
9b2d0677
AD
149432002-02-07 Akim Demaille <akim@epita.fr>
14944
14945 * tests/input.at: New.
14946
69e2658b
RA
149472002-02-07 Robert Anisko <robert@lrde.epita.fr>
14948
14949 * data/bison.c++: Replace some direct m4 expansions by constants. Be
9b2d0677 14950 more consistent when naming methods and variables. Put preprocessor
69e2658b
RA
14951 directives around tables only needed for debugging.
14952
4aacc3a7
RA
149532002-02-07 Robert Anisko <robert@lrde.epita.fr>
14954
14955 * data/bison.c++ (yy::b4_name::print_): New method, replaces yyprint in
14956 C++ parsers.
14957 (yy::b4_name::parse): Use print_.
14958
762a801e
RA
149592002-02-07 Robert Anisko <robert@lrde.epita.fr>
14960
14961 * data/bison.c++ (yy::b4_name::parse): Error recovery is back.
14962
4bb2bc3f
RA
149632002-02-07 Robert Anisko <robert@lrde.epita.fr>
14964
14965 * data/bison.c++ (yy::b4_name::error_): New method, replaces yyerror in
14966 C++ parsers.
14967 (yy::b4_name::parse): Build verbose error messages, and use error_.
14968
6b45a3ca
RA
149692002-02-06 Robert Anisko <robert@lrde.epita.fr>
14970
14971 * data/bison.c++: Fix m4 quoting in comments.
14972
50997c6e
RA
149732002-02-06 Robert Anisko <robert@lrde.epita.fr>
14974
14975 * data/bison.c++: Adjust the parser code. Fix some muscles that were
14976 not expanded by m4.
14977
3f3eed27
AD
149782002-02-05 Akim Demaille <akim@epita.fr>
14979
14980 * data/bison.c++: Adjust to the M4 back end.
14981 More is certainly needed.
14982
be2a1a68
AD
149832002-02-05 Akim Demaille <akim@epita.fr>
14984
14985 Give a try to M4 as a back end.
14986
14987 * lib/readpipe.c: New, from wdiff.
14988 * src/Makefile.am (DEFS): Define PKGDATADIR, not BISON_SIMPLE and
14989 BISON_HAIRY.
14990 * src/system.h (BISON_HAIRY, BISON_SIMPLE): Remove the DOS and VMS
14991 specific values. Now it is m4 that performs the lookup.
14992 * src/parse-skel.y: Remove.
14993 * src/muscle_tab.c, src/muscle_tab.h (muscles_m4_output): New.
14994 * src/output.c (actions_output, guards_output)
14995 (token_definitions_output): No longer keeps track of the output
14996 line number, hence remove the second argument.
14997 (guards_output): Check against the guard member of a rule, not the
14998 action member.
14999 Adjust callers.
15000 (output_skeleton): Don't look for the skeleton location, let m4 do
15001 that.
15002 Create `/tmp/muscles.m4'. This is temporary, a proper temporary
15003 file will be used.
15004 Invoke `m4' on m4sugar.m4, muscles.m4, and the skeleton.
15005 (prepare): Given that for the time being changesyntax is not
15006 usable in M4, rename the muscles using `-' to `_'.
15007 Define `defines_flag', `output_parser_name' and `output_header_name'.
15008 * src/output.h (actions_output, guards_output)
15009 (token_definitions_output): Adjust prototypes.
15010 * src/scan-skel.l: Instead of scanning the skeletons, it now
15011 processes the output of m4: `__oline__' and `#output'.
15012 * data/bison.simple: Adjust to be used by M4(sugar).
15013 * tests/Makefile.am: Use check_SCRIPTS to make sure `bison' is up
15014 to date.
15015 * tests/bison.in: Use the secrete envvar `BISON_PKGDATADIR'
15016 instead of the dead `BISON_SIMPLE' and `BISON_HAIRY'.
15017 * data/m4sugar/m4sugar.m4, data/m4sugar/version.m4: New,
15018 shamelessly stolen from CVS Autoconf.
15019
beda758b
AD
150202002-02-05 Akim Demaille <akim@epita.fr>
15021
15022 * lib/hash.c, lib/hash.h: Replace with Fileutils 4.1's version.
15023 * configure.in: Check for the declarations of free and malloc.
15024 * src/muscle_tab.c: Adjust.
15025
5ece6d43
AD
150262002-02-05 Akim Demaille <akim@epita.fr>
15027
15028 * src/muscle_tab.c (muscle_init): Don't default to NULL muscle
15029 which have no values.
15030
5bb18f9a
AD
150312002-02-05 Akim Demaille <akim@epita.fr>
15032
15033 * src/bison.simple, src/bison.hairy, src/bison.c++: Move to...
15034 * data/: here.
15035
894dd62e
PE
150362002-01-29 Paul Eggert <eggert@twinsun.com>
15037
15038 * src/bison.simple (YYSIZE_T): Do not define merely because
15039 YYSTACK_USE_ALLOCA is nonzero or alloca or _ALLOCA_H are defined.
15040 On some platforms, <alloca.h> does not declare YYSTD (size_t).
15041
82841af7
AD
150422002-01-27 Akim Demaille <akim@epita.fr>
15043
15044 Fix `%nonassoc and eof'.
15045
15046 * src/state.c (errs_dup): Aaaah! The failure was due to bytes
15047 which were not properly copied! Replace
15048 memcpy (res->errs, src->errs, src->nerrs);
15049 with
15050 memcpy (res->errs, src->errs, src->nerrs * sizeof (src->errs[0]));
15051 !!!
15052 * tests/regression.at (%nonassoc and eof): Adjust to newest
15053 Autotest: `.' is not in the PATH.
15054
318b76e9
AD
150552002-01-27 Akim Demaille <akim@epita.fr>
15056
15057 * tests/sets.at (AT_EXTRACT_SETS): New.
15058 (Nullable): Use it.
15059 (Firsts): New.
15060
30d2f3d5
AD
150612002-01-26 Akim Demaille <akim@epita.fr>
15062
15063 * tests/actions.at, tests/calc.at, tests/headers.at,
15064 * tests/torture.at: Adjust to the newest Autotest which no longer
15065 forces `.' in the PATH.
15066
30f8c395
AD
150672002-01-25 Akim Demaille <akim@epita.fr>
15068
15069 * tests/regression.at (%nonassoc and eof): New.
15070 Suggested by Robert Anisko.
15071
29ae55f1
AD
150722002-01-24 Akim Demaille <akim@epita.fr>
15073
15074 Bison dumps core when trying to complain about broken input files.
15075 Reported by Cris van Pelt.
15076
15077 * src/lex.c (parse_percent_token): Be sure to set token_buffer.
15078 * tests/regression.at (Invalid input: 1, Invalid input: 2): Merge
15079 into...
15080 (Invalid inputs): Strengthen: exercise parse_percent_token.
15081
2b548aa6
RA
150822002-01-24 Robert Anisko <robert.anisko@epita.fr>
15083
15084 * src/Makefile.am: Add bison.c++.
15085 * src/bison.c++: New skeleton.
15086
bb0146c2
AD
150872002-01-21 Paolo Bonzini <bonzini@gnu.org>
15088
15089 * po/it.po: New.
15090
bec30531
AD
150912002-01-21 Kees Zeelenberg <kzlg@users.sourceforge.net>
15092
15093 * src/files.c (skeleton_find) [MSDOS]: Fix cp definition.
15094
fc6edc45
MA
150952002-01-20 Marc Autret <marc@gnu.org>
15096
15097 * src/files.c (compute_output_file_names): Fix
15098
5e5d5415
MA
150992002-01-20 Marc Autret <marc@gnu.org>
15100
15101 * tests/output.at: New test.
15102 * src/files.c (compute_base_names): Don't map extensions when
15103 the YACC flag is set, use defaults.
15104 Reported by Evgeny Stambulchik.
15105
44ea3fbd
MA
151062002-01-20 Marc Autret <marc@gnu.org>
15107
ba0fe3c7
PE
15108 * src/system.h: Need to define __attribute__ away for non-GCC
15109 compilers as well (i.e., the vendor C compiler).
44ea3fbd
MA
15110 Suggested by Albert Chin-A-Young.
15111
338963d1
TVH
151122002-01-11 Tim Van Holder <tim.van.holder@pandora.be>
15113
15114 * lib/hash.h, lib/hash.c: Renamed __P to PARAMS and used the
15115 canonical definition.
15116 * src/system.h: Use the canonical definition for PARAMS (avoids
15117 a conflict with the macro from lib/hash.h).
15118
c57b2479
AD
151192002-01-11 Akim Demaille <akim@epita.fr>
15120
15121 * configure.in: Use AC_FUNC_STRNLEN.
d9e9746c 15122 Fixes the failures observed on AIX 4.3 by H.Merijn Brand.
c57b2479 15123
b85810ae
AD
151242002-01-09 Akim Demaille <akim@epita.fr>
15125
15126 * src/files.c, src/files.h (output_infix): New.
15127 (tab_extension): Remove.
15128 (compute_base_names): Compute the former, drop the latter.
15129 * src/output.c (prepare): Insert the muscles `output-infix', and
15130 `output-suffix'.
15131 * src/parse-skel.y (string, string.1): New.
15132 (section.header): Use it.
15133 (section.yacc): Remove.
15134 (prefix): Remove too.
15135 * src/scan-skel.l: Adjust.
15136 * src/bison.simple, src/bison.hairy: Adjust.
15137
cae60122
AD
151382002-01-09 Akim Demaille <akim@epita.fr>
15139
15140 * configure.in (WERROR_CFLAGS): Compute it.
15141 * src/Makefile.am (CFLAGS): Pass it.
15142 * tests/atlocal.in (CFLAGS): Idem.
15143 * src/files.c: Fix a few warnings.
15144 (get_extension_index): Remove, unused.
15145
ae404801
AD
151462002-01-08 Akim Demaille <akim@epita.fr>
15147
15148 * src/getargs.c (AS_FILE_NAME): New.
15149 (getargs): Use it to convert DOSish file names.
15150 * src/files.c (base_name): Rename as full_base_name to avoid
15151 clashes with `base_name ()'.
15152 (filename_split): New.
15153 (compute_base_names): N-th rewrite, using filename_split.
15154
22312b71
AD
151552002-01-08 Akim Demaille <akim@epita.fr>
15156
15157 * lib/basename.c, lib/dirname.h, lib/dirname.c, lib/memrchr.c:
15158 New, stolen from the Fileutils 4.1.
15159 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
15160 * configure.in: Check for the presence of memrchr, and of its
15161 prototype.
15162
a67cef01
TVH
151632002-01-07 Tim Van Holder <tim.van.holder@pandora.be>
15164
15165 * lib/hash.h (__P): Added definition for this macro.
15166 * src/Makefile.am: Add parse-skel.c and scan-skel.c to
15167 BUILT_SOURCES, to ensure they are generated first.
15168 * src/parse-skel.y: Use YYERROR_VERBOSE instead of
15169 %error-verbose to allow bootstrapping with bison 1.30x.
15170
2b25d624
AD
151712002-01-06 Akim Demaille <akim@epita.fr>
15172
15173 * src/reader.c (parse_braces): Don't fetch the next char, the
15174 convention is to fetch on entry.
15175 * tests/torture.at (GNU Cim Grammar): Reintroduce their weird
15176 'switch' without a following semicolon.
15177 * tests/regression.at (braces parsing): New.
15178
3460813b
AD
151792002-01-06 Akim Demaille <akim@epita.fr>
15180
15181 Bison is dead wrong in its RR conflict reports.
15182
15183 * tests/torture.at (GNU Cim Grammar): New.
15184 * src/conflicts.c (count_rr_conflicts): Fix.
15185
73784c64
AD
151862002-01-06 Akim Demaille <akim@epita.fr>
15187
15188 Creating package.m4 from configure.ac causes too many problems.
15189
15190 * tests/Makefile.am (package.m4): Create it by hand,
15191 AC_CONFIG_TESTDIR no longer does in the most recent CVS Autoconf.
15192
25d81090
AD
151932002-01-06 Akim Demaille <akim@epita.fr>
15194
15195 * src/Makefile.am (bison_SOURCES): Add parse-skel.h and
15196 skeleton.h.
15197
a9b8959e
PE
151982002-01-04 Paul Eggert <eggert@twinsun.com>
15199
15200 * doc/bison.texinfo (Debugging):
15201 Remove YYSTDERR; it's no longer defined or used.
15202 Also, s/cstdio.h/cstdio/.
15203
25d81090
AD
152042002-01-03 Akim Demaille <akim@epita.fr>
15205
15206 * tests/bison.in, tests/atlocal.in: Adjust to CVS Autoconf.
15207
1109455c
AD
152082002-01-03 Akim Demaille <akim@epita.fr>
15209
15210 * src/parse-skel.y (process_skeleton): Don't bind the parser's
15211 tracing code to --trace, wait for a better --trace option, with
15212 args.
15213
7ea5e977
AD
152142002-01-03 Akim Demaille <akim@epita.fr>
15215
15216 * src/bison.simple (YYSTDERR): Remove, replace `stderr'.
15217 The ISO C++ standard is extremely clear about it: stderr is
15218 considered a macro, not a regular symbol (see table 94 `Header
15219 <cstdio> synopsis', [lib.c.files] 27.8.2 C Library files).
15220 Therefore std:: does not apply to it. It still does with fprintf.
15221 Also, s/cstdio.h/cstdio/.
15222
fab5b110
AD
152232002-01-03 Akim Demaille <akim@epita.fr>
15224
15225 * lib/quotearg.c: Use `#include "..."' instead of `#include <...>'
15226 for non system headers.
15227
aed7fd9b
AD
152282002-01-02 Akim Demaille <akim@epita.fr>
15229
15230 Equip the skeleton chain with location tracking, runtime trace,
15231 pure parser and scanner.
15232
15233 * src/parse-skel.y: Request a pure parser, locations, and prefix
15234 renaming.
15235 (%union): Having several members with the same type does not help
15236 type mismatches, simplify.
15237 (YYPRINT, yyprint): New.
15238 (yyerror): ``Rename'' (there is a #define yyerror skel_error) as...
15239 (skel_error): this.
15240 Handle locations.
15241 * src/scan-skel.l: Adjust to these changes.
15242 * src/skeleton.h (LOCATION_RESET, LOCATION_LINES, LOCATION_STEP)
15243 (LOCATION_PRINT, skel_control_t): New.
15244
24fad99e
AD
152452001-12-30 Akim Demaille <akim@epita.fr>
15246
15247 * src/parse-skel.y: Get rid of the shift/reduce conflict:
15248 replace `gb' with BLANKS.
15249 * src/scan-skel.l: Adjust.
15250
a4b36db4
AD
152512001-12-30 Akim Demaille <akim@epita.fr>
15252
15253 * src/system.h: We don't need nor want bcopy.
15254 Throw away MS-DOS crap: we don't need getpid.
15255 * configure.in: We don't need strndup. It was even causing
15256 problems: because Flex includes the headers *before* us,
15257 _GNU_SOURCE is not defined by config.h, and therefore strndup was
15258 not visible.
15259 * lib/xstrndup.c: New.
15260 * src/scan-skel.l: Use it.
15261 Be sure to initialize yylval.muscle member when scanning a MUSCLE.
15262 * src/parse-skel.y: Use %directives instead of #defines.
15263
1239777d
AD
152642001-12-30 Akim Demaille <akim@epita.fr>
15265
15266 * src/skeleton.h: New.
15267 * src/output.c (output_parser, output_master_parser): Remove, dead
15268 code.
15269 * src/output.h (get_lines_number, actions_output, guards_output)
15270 (token_definitions_output): Prototype them.
15271 * src/parse-skel.y: Add the license notice.
15272 Include output.h and skeleton.h.
15273 (process_skeleton): Returns void, and takes a single parameter.
15274 * src/scan-skel.l: Add the license notice.
15275 Include skeleton.h.
15276 Don't use %option yylineno: it seems that then Flex imagines
15277 REJECT has been used, and therefore it won't reallocate its
15278 buffers (which makes no other sense to me than a bug). It results
15279 in warnings for `unused: yy_flex_realloc'.
15280
9b3add5b
RA
152812001-12-30 Robert Anisko <robert.anisko@epita.fr>
15282
15283 * src/muscle_tab.h (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15284 (MUSCLE_INSERT_PREFIX): ...to there.
15285 * src/output.c (MUSCLE_INSERT_INT, MUSCLE_INSERT_STRING)
15286 (MUSCLE_INSERT_PREFIX): Move from here...
15287
15288 * src/bison.hairy: Add a section directive. Put braces around muscle
15289 names. This parser skeleton is still broken, but Bison should not
15290 choke on a bad muscle 'syntax'.
15291 * src/bison.simple: Add a section directive. Put braces around muscle
15292 names.
15293
15294 * src/files.h (strsuffix, stringappend): Add declarations.
15295 (tab_extension): Add declaration.
15296 (short_base_name): Add declaration.
15297
15298 * src/files.c (strsuffix, stringappend): No longer static. These
15299 functions are used in the skeleton parser.
15300 (tab_extension): New.
15301 (compute_base_names): Use the computations done in this function
fab5b110 15302 to guess if the generated parsers should have '.tab' in their
9b3add5b
RA
15303 names.
15304 (short_base_name): No longer static.
15305
15306 * src/output.c (output_skeleton): New.
15307 (output): Disable call to output_master_parser, and give a try to
15308 a new skeleton handling system.
15309 (guards_output, actions_output): No longer static.
15310 (token_definitions_output, get_lines_number): No longer static.
15311
15312 * configure.in: Use AM_PROG_LEX and AC_PROG_YACC.
15313
fab5b110 15314 * src/Makefile.am (bison_SOURCES): Add scan-skel.l and
9b3add5b
RA
15315 parse-skel.y.
15316
15317 * src/parse-skel.y: New file.
15318 * src/scan-skel.l: New file.
15319
b5b61c61
AD
153202001-12-29 Akim Demaille <akim@epita.fr>
15321
15322 %name-prefix is broken.
15323
15324 * src/files.c (spec_name_prefix): Initialize to NULL, not to "yy".
15325 Adjust all dependencies.
15326 * tests/headers.at (export YYLTYPE): Strengthen this test: use
15327 %name-prefix.
15328
15329 Renaming yylval but not yylloc is not consistent. Now we do.
15330
15331 * src/bison.simple: Prefix yylloc if used.
15332 * doc/bison.texinfo (Decl Summary): Document that.
15333
8c9a50be
AD
153342001-12-29 Akim Demaille <akim@epita.fr>
15335
15336 * doc/bison.texinfo: Promote `%long-directive' over
15337 `%long_directive'.
15338 Remove all references to fixed-output-files, yacc is enough.
15339
d99361e6
AD
153402001-12-29 Akim Demaille <akim@epita.fr>
15341
15342 * src/bison.simple: Define YYDEBUG and YYERROR_VERBOSE *after* the
15343 user prologue. These are defaults.
15344 * tests/actions.at (Mid-rule actions): Make sure the user can
15345 define YYDEBUG and YYERROR_VERBOSE.
15346
b9cecb91
AD
153472001-12-29 Akim Demaille <akim@epita.fr>
15348
15349 * src/output.c (header_output): Don't forget to export YYLTYPE and
15350 yylloc.
15351 * tests/headers.at (export YYLTYPE): New, make sure it does.
15352 * tests/regression.at (%union and --defines, Invalid CPP headers):
15353 Move to...
15354 * tests/headers.at: here.
15355
aea13e97
AD
153562001-12-29 Akim Demaille <akim@epita.fr>
15357
15358 * src/gram.h (rule_s): Member `assoc' is of type `associativity'.
15359
931394cb
AD
153602001-12-29 Akim Demaille <akim@epita.fr>
15361
15362 * tests/actions.at (Mid-rule actions): Output on a single line
15363 instead of several.
15364
704a47c4
AD
153652001-12-29 Akim Demaille <akim@epita.fr>
15366
15367 * doc/bison.texinfo: Formatting changes.
15368
091e20bb
AD
153692001-12-29 Akim Demaille <akim@epita.fr>
15370
15371 Don't store the token defs in a muscle, just be ready to output it
15372 on command. Now possible via `symbols'. Fixes a memory leak.
15373
15374 * src/output.c (token_definitions_output): New.
15375 (output_parser, header_output): Use it.
15376 * src/reader.c (symbols_save): Remove.
15377
cce71710
AD
153782001-12-29 Akim Demaille <akim@epita.fr>
15379
15380 * src/bison.simple: Do not provide a default for YYSTYPE and
15381 YYLTYPE before the user's prologue. Otherwise it's hardly... a
15382 default.
15383
82c035a8
AD
153842001-12-29 Akim Demaille <akim@epita.fr>
15385
15386 Mid-rule actions are simply... ignored!
15387
15388 * src/reader.c (readgram): Be sure to attach mid-rule actions to
15389 the empty-rule associated to the dummy symbol, not to the host
15390 rule.
15391 * tests/actions.at (Mid-rule actions): New.
15392
8419d367
AD
153932001-12-29 Akim Demaille <akim@epita.fr>
15394
15395 Memory leak.
15396
15397 * src/reader.c (reader): Free grammar.
15398
375d5806
AD
153992001-12-29 Akim Demaille <akim@epita.fr>
15400
15401 Memory leak.
15402
15403 * src/LR0.c (new_itemsets): Don't allocate `shift_symbol' here,
15404 since it allocates it for each state, although only one is needed.
15405 (allocate_storage): Do it here.
15406
f51cb8ff
AD
154072001-12-29 Akim Demaille <akim@epita.fr>
15408
15409 * src/options.h, src/options.c (create_long_option_table): Rename
15410 as...
15411 (long_option_table_new): this, with a clearer prototype.
15412 (percent_table): Remove, unused,
15413 * src/getargs.c (getargs): Adjust.
15414
29e88316
AD
154152001-12-29 Akim Demaille <akim@epita.fr>
15416
15417 * src/LR0.c, src/conflicts.c, src/lalr.c, src/lalr.h, src/output.c
15418 * src/print.c, src/print_graph.c, src/state.h: Rename state_table
15419 as states.
15420
b9f71f19
AD
154212001-12-29 Akim Demaille <akim@epita.fr>
15422
15423 * src/lalr.c (build_relations): Rename `states' as `states1'.
15424 Sorry, I don't understand exactly what it is, no better name...
15425
1a2b5d37
AD
154262001-12-29 Akim Demaille <akim@epita.fr>
15427
15428 * src/closure.c, src/conflicts.c, src/derives.c, src/gram.c
15429 * src/gram.h, src/lalr.c, src/nullable.c, src/output.c, src/print.c
15430 * src/print_graph.c, src/reader.c, src/reduce.c: Rename rule_table
15431 as rules.
15432
1cca533e
AD
154332001-12-29 Akim Demaille <akim@epita.fr>
15434
15435 * src/gram.c (rprec, rprecsym, rassoc): Remove, unused since long
15436 ago.
15437
c03ae966
AD
154382001-12-29 Akim Demaille <akim@epita.fr>
15439
15440 * src/reader.c, src/reader.h (user_toknums): Remove.
15441 Adjust all users to use symbols[i]->user_token_number.
15442
5a670b1e
AD
154432001-12-29 Akim Demaille <akim@epita.fr>
15444
15445 * src/gram.c, src/gram.h (sprec, sassoc): Remove.
15446 Adjust all users to use symbols[i]->prec or ->assoc.
15447
ad949da9
AD
154482001-12-29 Akim Demaille <akim@epita.fr>
15449
15450 * src/reader.c, src/reader.h (tags): Remove.
15451 Adjust all users to use symbols[i]->tag.
15452
0e78e603
AD
154532001-12-29 Akim Demaille <akim@epita.fr>
15454
15455 * src/gram.h, src/gram.c (symbols): New, similar to state_table
15456 and rule_table.
15457 * src/reader.c (packsymbols): Fill this table.
15458 Drop sprec.
15459 * src/conflicts.c (resolve_sr_conflict): Adjust.
15460 * src/reduce.c (reduce_grammar): Adjust: just sort symbols, a
15461 single table.
15462 Use symbols[i]->tag instead of tags[i].
15463
213e640e
AD
154642001-12-29 Akim Demaille <akim@epita.fr>
15465
15466 * tests/calc.at (_AT_DATA_CALC_Y): Also use %union.
15467 In addition, put a comment in there, to replace...
15468 * tests/regression.at (%union and C comments): Remove.
15469
e7b8bef1
AD
154702001-12-29 Akim Demaille <akim@epita.fr>
15471
15472 * tests/regression.at (Web2c Actions): Blindly move the actual
15473 output as expected output. The contents *seem* right to me, but I
15474 can't pretend reading perfectly parser tables... Nonetheless, all
15475 the other tests pass correctly, the table look OK, even though the
15476 presence of `$axiom' is to be noted: AFAICS it is useless (but
15477 harmless).
15478
b68e7744
AD
154792001-12-29 Akim Demaille <akim@epita.fr>
15480
15481 * src/reader.c (readgram): Don't add the rule 0 if there were no
15482 rules read. In other words, add it _after_ having performed
15483 grammar sanity checks.
15484 Fixes the `tests/regression.at (Invalid input: 1)' Failure.
15485
78d5bae9
AD
154862001-12-29 Akim Demaille <akim@epita.fr>
15487
15488 * tests/regression.at (Web2c Report): Catch up: the rule 0 is now
15489 visible, and some states have now a different number.
15490
ff442794
AD
154912001-12-29 Akim Demaille <akim@epita.fr>
15492
15493 * src/reader.c (readgram): Bind the initial rule's lineno to that
15494 of the first rule.
15495 * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts):
15496 (Solved SR Conflicts): Adjust rule 0's line number.
15497
610ab194
AD
154982001-12-29 Akim Demaille <akim@epita.fr>
15499
15500 Fix the `GAWK Grammar' failure.
15501
15502 * src/LR0.c (final_state): Initialize to -1 so that we do compute
15503 the reductions of the first state which was mistakenly confused
15504 with the final state because precisely final_state was initialized
15505 to 0.
15506 * tests/sets.at (Nullable): Adjust: state 0 does have lookaheads,
15507 now noticed by Bison.
15508 * tests/regression.at (Rule Line Numbers): Adjust: state 0 does
15509 have a reduction on $default.
15510
29d29c8f
AD
155112001-12-29 Akim Demaille <akim@epita.fr>
15512
15513 * src/gram.c (ritem_print): Be sure to subtract 1 when displaying
15514 rule line numbers.
15515 * src/closure.c (print_closure): Likewise.
15516 * src/derives.c (print_derives): Likewise.
15517 * tests/sets.at (Nullable): Adjust: the rule numbers are correct
15518 now.
15519
7c6b64d0
AD
155202001-12-29 Akim Demaille <akim@epita.fr>
15521
15522 * src/lalr.c (lookaheads_print): New.
15523 (lalr): Call it when --trace-flag.
15524 * tests/sets.at (Nullable): Adjust: when tracing, the lookaheads
15525 are dumped.
15526
3d4daee3
AD
155272001-12-29 Akim Demaille <akim@epita.fr>
15528
15529 * src/derives.c (print_derives): Be sure to use `>= 0', not `> 0',
15530 when walking through ritem, even via rule->rhs.
15531 * src/reduce.c (dump_grammar, useful_production, reduce_output)
15532 (useful_production, useless_nonterminals): Likewise.
15533 (reduce_grammar_tables): Likewise, plus update nritems.
15534 * src/nullable.c (set_nullable): Likewise.
15535 * src/lalr.c (build_relations): Likewise.
15536 * tests/sets.at (Nullable): Adjust.
15537 Fortunately, now, the $axiom is no longer nullable.
15538
9e7f6bbd
AD
155392001-12-29 Akim Demaille <akim@epita.fr>
15540
15541 * src/LR0.c (generate_states): Use nritems, not nitems, nor using
15542 the 0-sentinel.
15543 * src/gram.c (ritem_longest_rhs): Likewise.
15544 * src/reduce.c (nonterminals_reduce): Likewise.
15545 * src/print_graph.c (print_graph): Likewise.
15546 * src/output.c (output_rule_data): Likewise.
15547 * src/nullable.c (set_nullable): Likewise.
15548
255ef638
AD
155492001-12-29 Akim Demaille <akim@epita.fr>
15550
15551 * src/output.c: Comment changes.
15552
0d8a7363
AD
155532001-12-27 Paul Eggert <eggert@twinsun.com>
15554
15555 * src/bison.simple (YYSTACK_ALLOC, YYSIZE_T): Remove special
15556 cases for non-GNU systems like AIX, HP-UX, SGI, Sun, and
15557 Sparc, as they were causing more porting problems than the
15558 (minor) performance improvement was worth.
15559
15560 Also, catch up with 1.31's YYSTD.
15561
3db472b9
AD
155622001-12-27 Akim Demaille <akim@epita.fr>
15563
15564 * src/output.c (output_gram): Rely on nritems, not the
15565 0-sentinel. See below.
15566 Use -1 as separator, not 0.
15567 * src/bison.simple (yyparse): Subtract 1 to the rule numbers.
15568 Rely on -1 as separator in yyrhs, instead of 0.
15569 * tests/calc.at (AT_CHECK_CALC): Now, the parsers no longer issue
15570 twice `Now at end of input', therefore there are two lines less to
15571 expect.
15572
b365aa05
AD
155732001-12-27 Akim Demaille <akim@epita.fr>
15574
15575 * tests/regression.at (Unresolved SR Conflicts):
15576 (Solved SR Conflicts, Rule Line Numbers): Adjust to the changes
15577 below.
15578
30171f79
AD
155792001-12-27 Akim Demaille <akim@epita.fr>
15580
15581 * src/LR0.c (new_state): Recognize the final state by the fact it
15582 is reached by eoftoken.
15583 (insert_start_shifting_state, insert_eof_shifting_state)
15584 (insert_accepting_state, augment_automaton): Remove, since now
15585 these states are automatically computed from the initial state.
15586 (generate_states): Adjust.
15587 * src/print.c: When reporting a rule number to the user, substract
15588 1, so that the axiom rule is rule 0, and the first user rule is 1.
15589 * src/reduce.c: Likewise.
15590 * src/print_graph.c (print_core): For the time being, just as for
15591 the report, depend upon --trace-flags to dump the full set of
15592 items.
15593 * src/reader.c (readgram): Once the grammar read, insert the rule
15594 0: `$axiom: START-SYMBOL $'.
15595 * tests/set.at: Adjust: rule 0 is now displayed, and since the
15596 number of the states has changed (the final state is no longer
15597 necessarily the last), catch up.
15598
75142d45
AD
155992001-12-27 Akim Demaille <akim@epita.fr>
15600
15601 Try to make the use of the eoftoken valid. Given that its value
15602 is 0 which was also used as a sentinel in ritem, (i) make sure >= 0
15603 is used instead of > 0 where appropriate, (ii), depend upon nritems
15604 instead of the 0-sentinel.
15605
15606 * src/gram.h, src/gram.c (nritems): New.
15607 Expected to be duplication of nitems, but for the time being...
15608 * src/reader.c (packgram): Assert nritems and nitems are equal.
15609 * src/LR0.c (allocate_itemsets, new_itemsets): Adjust.
15610 * src/closure.c (print_closure, print_fderives): Likewise.
15611 * src/gram.c (ritem_print): Likewise.
15612 * src/print.c (print_core, print_grammar): Likewise.
15613 * src/print_graph.c: Likewise.
15614
b7c49edf
AD
156152001-12-27 Akim Demaille <akim@epita.fr>
15616
15617 * src/main.c (main): If there are complains after grammar
15618 reductions, then output the report anyway if requested, then die.
15619 * src/symtab.c (bucket_new): Initialize `value' to -1, not 0.
15620 * src/reader.c (eoftoken): New.
15621 (parse_token_decl): If the token being defined has value `0', it
15622 is the eoftoken.
15623 (packsymbols): No longer hack `tags' to insert `$' by hand.
15624 Be sure to preserve the value of the eoftoken.
15625 (reader): Make sure eoftoken is defined.
15626 Initialize nsyms to 0: now eoftoken is created just like the others.
15627 * src/print.c (print_grammar): Don't special case the eof token.
15628 * src/regression.at: Adjust: `$' has value 0, not -1, which was a
15629 lie anyway, albeit pleasant.
15630 * tests/calc.at: Exercise error messages with eoftoken.
15631 Change the grammar so that empty input is invalid.
15632 Adjust expectations.
15633 When yyungeting, be sure to use a valid yylloc: use last_yylloc.
15634
ec2da99f
AD
156352001-12-27 Akim Demaille <akim@epita.fr>
15636
15637 * configure.in: Check the protos of strchr ans strspn.
15638 Replace strchr if needed.
15639 * src/system.h: Provide the protos of strchr, strspn and memchr if
15640 missing.
15641 * lib/strchr.c: New.
15642 * src/reader.c (symbols_save): Use strchr.
15643
8adfa272
AD
156442001-12-27 Akim Demaille <akim@epita.fr>
15645
15646 * src/print.c, src/print_graph.c (escape): New.
15647 Use it to quote the TAGS outputs.
15648 * src/print_graph.c (print_state): Now errors are in red, and
15649 reductions in green.
15650 Prefer high to wide: output the state number on a line of its own.
15651
80dac38c
AD
156522001-12-27 Akim Demaille <akim@epita.fr>
15653
15654 * src/state.h, src/state.c (reductions_new): New.
15655 * src/LR0.c (set_state_table): Let all the states have a
15656 `reductions', even if reduced to 0.
15657 (save_reductions): Adjust.
15658 * src/lalr.c (initialize_LA, initialize_lookaheads): Adjust.
15659 * src/print.c (print_reductions, print_actions): Adjust.
15660 * src/output.c (action_row): Adjust.
15661
2cec70b9
AD
156622001-12-27 Akim Demaille <akim@epita.fr>
15663
15664 * src/state.h, src/state.c (errs_new, errs_dup): New.
15665 * src/LR0.c (set_state_table): Let all the states have an errs,
15666 even if reduced to 0.
15667 * src/print.c (print_errs, print_reductions): Adjust.
15668 * src/output.c (output_actions, action_row): Adjust.
15669 * src/conflicts.c (resolve_sr_conflict): Adjust.
15670
13ca549a
AD
156712001-12-27 Akim Demaille <akim@epita.fr>
15672
15673 * src/lalr.c (set_goto_map, initialize_F): Use SHIFT_SYMBOL.
15674
5092aba5
AD
156752001-12-27 Akim Demaille <akim@epita.fr>
15676
15677 * src/conflicts.c, src/conflicts.h (print_reductions): Move to...
15678 * src/print.c: here.
15679 (lookaheadset, shiftset): New, used as additional storage by
15680 print_reductions.
15681 (print_results): Adjust.
15682 (print_shifts, print_gotos, print_errs): New, extracted from...
15683 (print_actions): here.
15684 * src/print_graph.c (print_actions): Remove dead code.
15685
11e2beca
AD
156862001-12-27 Akim Demaille <akim@epita.fr>
15687
15688 * src/reader.c (copy_dollar, copy_at): Better checking of `n' in
15689 `$n' and `@n'.
15690
dac3c910
AD
156912001-12-27 Akim Demaille <akim@epita.fr>
15692
15693 * src/lalr.c (add_lookback_edge): Use state_t instead of ints.
15694 (build_relations): Adjust.
15695
d0b0fefa
AD
156962001-12-27 Akim Demaille <akim@epita.fr>
15697
15698 * src/lalr.c (set_goto_map): Remove a wrong but benign loop
15699 duplication.
15700
adc8c848
AD
157012001-12-27 Akim Demaille <akim@epita.fr>
15702
15703 * src/reader.c (packgram): Catch nitems overflows.
15704
14d293ac
AD
157052001-12-27 Akim Demaille <akim@epita.fr>
15706
15707 * src/files.c, src/files.h (guard_obstack): Remove.
15708 * src/output.c (output): Adjust.
15709 * src/reader.c (parse_braces): New, factoring...
15710 (copy_action, copy_guard): these two which are renamed as...
15711 (parse_action, parse_guard): these.
15712 As a voluntary consequence, using braces around guards is now
15713 mandatory.
15714
f499b062
AD
157152001-12-27 Akim Demaille <akim@epita.fr>
15716
15717 * src/gram.h (rule_t): `guard' and `guard_line' are new members.
15718 * src/reader.c (symbol_list): `guard' and `guard_line' are new
15719 members.
15720 (symbol_list_new): Adjust.
15721 (copy_action): action_line is the first line, not the last.
15722 (copy_guard): Just as for actions, store the `action' only, not
15723 the switch/case/break flesh.
15724 Don't parse the user action that might follow the guard, let...
15725 (readgram): do it, i.e., now, there can be an action after a
15726 guard.
15727 In other words the guard is just explicitly optional.
15728 (packgram): Adjust.
15729 * src/output.c (guards_output): New.
15730 (output_parser): Call it when needed.
15731 (output): Also free the guard and attrs obstacks.
15732 * src/files.c, src/files.h (obstack_save): Remove.
15733 (output_files): Remove.
15734 As a result, if one needs the former `.act' file, using an
15735 appropriate skeleton which requires actions and guards is now
15736 required.
15737 * src/main.c (main): Adjust.
15738 * tests/semantic.at: New.
15739 * tests/regression.at: Use `input.y' as input file name.
15740 Avoid 8+3 problems by requiring input.c when the test needs the
15741 parser.
15742
d945f5cd
AD
157432001-12-27 Akim Demaille <akim@epita.fr>
15744
15745 * src/reader.c (symbol_list_new): Be sure to initialize all the
15746 fields.
15747
d200e455
AD
157482001-12-27 Akim Demaille <akim@epita.fr>
15749
15750 All the hacks using a final pseudo state are now useless.
15751
15752 * src/LR0.c (set_state_table): state_table holds exactly nstates.
15753 * src/lalr.c (nLA): New.
15754 (initialize_LA, compute_lookaheads, initialize_lookaheads): Use it
15755 instead of lookaheadsp from the pseudo state (nstate + 1).
15756
f9507c28
AD
157572001-12-27 Akim Demaille <akim@epita.fr>
15758
15759 * src/output.c (action_row, token_actions): Use a state_t instead
15760 of a integer, and nlookaheads instead of the following state's
15761 lookaheadsp.
15762
065fbd27
AD
157632001-12-27 Akim Demaille <akim@epita.fr>
15764
15765 * src/conflicts.c (log_resolution, flush_shift)
15766 (resolve_sr_conflict, set_conflicts, solve_conflicts)
15767 (count_sr_conflicts, count_rr_conflicts, conflicts_output)
15768 (conflicts_print, print_reductions): Use a state_t instead of an
15769 integer when referring to a state.
15770 As much as possible, depend upon nlookaheads, instead of the
15771 `lookaheadsp' member of the following state (since lookaheads of
15772 successive states are successive, the difference between state n + 1
15773 and n served as the number of lookaheads for state n).
15774 * src/lalr.c (add_lookback_edge): Likewise.
15775 * src/print.c (print_core, print_actions, print_state)
15776 (print_results): Likewise.
15777 * src/print_graph.c (print_core, print_actions, print_state)
15778 (print_graph): Likewise.
15779 * src/conflicts.h: Adjust.
15780
1b177bd7
AD
157812001-12-27 Akim Demaille <akim@epita.fr>
15782
15783 * src/bison.hairy: Formatting/comment changes.
15784 ANSIfy.
15785 Remove `register' indications.
15786 Add plenty of `static'.
15787
7742ddeb
AD
157882001-12-27 Akim Demaille <akim@epita.fr>
15789
15790 * src/output.c (prepare): Drop the muscle `ntbase' which
15791 duplicates ntokens.
15792 * src/bison.simple: Formatting/comment changes.
15793 Use YYNTOKENS only, which is documented, but not YYNTBASE, which
15794 is an undocumented synonym.
15795
1fa14068
AD
157962001-12-22 Akim Demaille <akim@epita.fr>
15797
15798 * src/output.c (output_table_data): Change the prototype to use
15799 `int' for array ranges: some invocations do pass an int, not a
15800 short.
15801 Reported by Wayne Green.
15802
b9752825
AD
158032001-12-22 Akim Demaille <akim@epita.fr>
15804
15805 Some actions of web2c.y are improperly triggered.
15806 Reported by Mike Castle.
15807
15808 * src/lalr.c (traverse): s/F (i)[k] = F (j)[k]/F (j)[k] = F (i)[k]/.
15809 * tests/regression.at (Web2c): Rename as...
15810 (Web2c Report): this.
15811 (Web2c Actions): New.
15812
776209d6
AD
158132001-12-22 Akim Demaille <akim@epita.fr>
15814
15815 Reductions in web2c.y are improperly reported.
15816 Reported by Mike Castle.
15817
15818 * src/conflicts.c (print_reductions): Fix.
15819 * tests/regression.at (Web2c): New.
15820
275fc3ad
AD
158212001-12-18 Akim Demaille <akim@epita.fr>
15822
15823 Some host fail on `assert (!"foo")', which expands to
15824 ((!"foo") ? (void)0 : __assert("!"foo."", __FILE__, __LINE__))
15825 Reported by Nelson Beebee.
15826
15827 * src/output.c, src/vcg.c: Replace `assert (!"it succeeded")' with
15828 `#define it_succeeded 0' and `assert (it_succeeded)'.
15829
897668ee
MA
158302001-12-17 Marc Autret <autret_m@epita.fr>
15831
15832 * src/bison.simple: Don't hard code the skeleton line and filename.
15833 * src/output.c (output_parser): Rename 'line' as 'output_line'.
15834 New line counter 'skeleton_line' (skeleton-line muscle).
15835
ab3399e0
PE
158362001-12-17 Paul Eggert <eggert@twinsun.com>
15837
15838 * NEWS, doc/bison.texinfo, doc/bison.1, doc/bison.rnh: Document that
15839 YYDEBUG must be defined to a nonzero value.
15840
15841 * src/bison.simple (yytname): Do not assume that the user defines
15842 YYDEBUG to a properly parenthesized expression.
15843
3877f72b
AD
158442001-12-17 Akim Demaille <akim@epita.fr>
15845
15846 * src/state.h (state_t): Rename lookaheads as lookaheadsp.
15847 nlookaheads is a new member.
15848 Adjust all users.
15849 * src/lalr.h (nlookaheads): Remove this orphan declaration.
15850 * src/lalr.c (initialize_lookaheads): Set nlookaheads for each
15851 state.
776209d6 15852
331dbc1b
AD
158532001-12-17 Akim Demaille <akim@epita.fr>
15854
15855 * src/files.h, src/files.c (open_files, close_files): Remove.
15856 * src/main.c (main): Don't open/close files, nor invoke lex_free,
15857 let...
15858 * src/reader.c (reader): Do it.
776209d6 15859
be750e4c
AD
158602001-12-17 Akim Demaille <akim@epita.fr>
15861
15862 * src/conflicts.c (print_reductions): Formatting changes.
776209d6 15863
709ae8c6
AD
158642001-12-17 Akim Demaille <akim@epita.fr>
15865
15866 * src/conflicts.c (flush_shift): Also adjust lookaheadset.
15867 (flush_reduce): New.
15868 (resolve_sr_conflict): Adjust.
776209d6 15869
f87685c3
AD
158702001-12-17 Akim Demaille <akim@epita.fr>
15871
15872 * src/output.c (output_obstack): Be static and rename as...
15873 (format_obstack): this, to avoid any confusion with files.c's
15874 output_obstack.
15875 * src/reader.h (muscle_obstack): Move to...
15876 * src/output.h: here, since it's defined in output.c.
15877
837491d8
AD
158782001-12-17 Akim Demaille <akim@epita.fr>
15879
15880 * src/output.c (action_row, save_column, default_goto)
15881 (sort_actions, matching_state, pack_vector): Better variable
15882 locality.
15883
796d61fb
AD
158842001-12-17 Akim Demaille <akim@epita.fr>
15885
15886 * src/output.c: Various formatting changes.
776209d6 15887
64d15509
AD
158882001-12-17 Akim Demaille <akim@epita.fr>
15889
15890 * src/files.c (output_files): Free the output_obstack.
15891 * src/main.c (main): Call print and print_graph conditionally.
15892 * src/print.c (print): Work unconditionally.
15893 * src/print_graph.c (print_graph): Work unconditionally.
15894 * src/conflicts.c (log_resolution): Output only if verbose_flag.
15895
fbc8ecb7
MA
158962001-12-16 Marc Autret <autret_m@epita.fr>
15897
15898 * src/output.c (actions_output): Fix. When we use %no-lines,
15899 there is one less line per action.
15900
f0440388
MA
159012001-12-16 Marc Autret <autret_m@epita.fr>
15902
15903 * src/bison.simple: Remove a useless #line directive.
15904 s/#line %%line %%skeleton/#line %%line "%%parser-file-name"/'.
15905 * src/output.c (get_lines_number): New.
776209d6 15906 (output_parser): Adjust, now takes care about the lines of a
f0440388
MA
15907 output muscles.
15908 Fix line numbering.
15909 (actions_output): Computes the number of lines taken by actions.
15910 (output_master_parser): Insert new skeleton which is the name of
15911 the output parser file name.
15912
a79986b8
MA
159132001-12-15 Marc Autret <autret_m@epita.fr>
15914
15915 * src/bison.simple [YYERROR_VERBOSE]: Restore backward compatibility.
15916
4ec8e00f
MA
159172001-12-15 Marc Autret <autret_m@epita.fr>
15918
15919 * src/output.c (output_gram): Keep track of the hairy one.
15920
1a4648ff
AD
159212001-12-15 Akim Demaille <akim@epita.fr>
15922
15923 Make `make distcheck' work.
15924
15925 * lib/Makefile.am (INCLUDES): Add top_srcdir/intl, since hash uses
15926 system.h which uses libgettext.h.
15927
9c2c67e6
AD
159282001-12-15 Akim Demaille <akim@epita.fr>
15929
15930 * src/nullable.c (set_nullable): Useless rules must be skipped,
15931 otherwise, since we range over their symbols, we might look at a
15932 nonterminal which no longer ``exists'', i.e., it is not counted in
15933 `nvars', hence we overflow our arrays.
15934
93ede233
AD
159352001-12-15 Akim Demaille <akim@epita.fr>
15936
15937 The header can also be produced directly, without any obstack!
15938 Yahoo!
15939
15940 * src/files.c, src/files.h (defines_obstack): Remove.
15941 (compute_header_macro): Global.
15942 (defines_obstack_save): Remove.
15943 * src/reader.c (parse_union_decl): No longer output to
15944 defines_obstack: its content can be found in the `stype' muscle
15945 anyway.
15946 (output_token_translations): Merge into...
15947 (symbols_output): this.
15948 Rename as...
15949 (symbols_save): this.
15950 (reader): Adjust.
15951 * src/output.c (header_output): New.
15952 (output): Call it.
15953
2666f928
AD
159542001-12-15 Akim Demaille <akim@epita.fr>
15955
15956 * src/reader.c (parse_union_decl): Instead of handling two obstack
15957 simultaneously, use one to define the `stype' muscle, and use the
15958 value of the latter to fill defines_obstack.
15959 (copy_comment): Remove.
15960 (copy_comment2): Work for a single obstack.
15961 Rename as...
15962 (copy_comment): this.
15963
428046f8
AD
159642001-12-15 Akim Demaille <akim@epita.fr>
15965
15966 * src/lex.c, src/lex.h (xgetc): No longer static.
15967 * src/reader.c (parse_union_decl): Revamp.
15968
ea52d706
AD
159692001-12-15 Akim Demaille <akim@epita.fr>
15970
15971 Still making progress in separating Bison into (i) input, (ii)
15972 process, (iii) output: now we can directly output the parser file
15973 without using table_obstack at all.
15974
15975 * src/files.c, src/files.h (table_obstack): Bye bye.
15976 (parser_file_name): New.
15977 * src/files.c (compute_output_file_names): Compute it.
15978 * src/output.c (actions_output, output_parser)
15979 (output_master_parser): To a file instead of an obstack.
15980
3f96f4dc
AD
159812001-12-15 Akim Demaille <akim@epita.fr>
15982
15983 Attach actions to rules, instead of pre-outputting them to
15984 actions_obstack.
15985
15986 * src/gram.h (rule_t): action and action_line are new members.
15987 * src/reader.c (symbol_list): Likewise.
15988 (copy_action): Save the actions within the rule.
15989 (packgram): Save them in rule_table.
15990 * src/output.c (actions_output): New.
15991 (output_parser): Use it on `%%actions'.
15992 (output_rule_data): Don't free rule_table.
15993 (output): Do it.
15994 (prepare): Don't save the `action' muscle.
15995 * src/bison.simple: s/%%action/%%actions/.
15996
51576fb3
AD
159972001-12-15 Akim Demaille <akim@epita.fr>
15998
15999 * src/reader.c (copy_action): When --yacc, don't append a `;'
16000 to the user action: let it fail if lacking.
dee049eb 16001 Suggested by Arnold Robbins and Tom Tromey.
51576fb3 16002
2648a72d
AD
160032001-12-14 Akim Demaille <akim@epita.fr>
16004
16005 * src/lex.c (literalchar): Simply return the char you decoded, non
16006 longer mess around with obstacks and int pointers.
16007 Adjust all callers.
16008
92790e5b
AD
160092001-12-14 Akim Demaille <akim@epita.fr>
16010
16011 * src/lex.c (literalchar): Don't escape the special characters,
16012 just decode them, and keep them as char (before, eol was output as
16013 the 2 char string `\n' etc.).
16014 * src/output.c (output_rule_data): Use quotearg to output the
16015 token strings.
16016
927c1557
PE
160172001-12-13 Paul Eggert <eggert@twinsun.com>
16018
16019 * src/bison.simple (YYSIZE_T, YYSTACK_ALLOC, YYSTACK_FREE):
16020 Do not infringe on the global user namespace when using C++.
16021 (YYFPRINTF, YYSTDERR): New macros, needed for the above.
16022 All uses of `fprintf' and `stderr' changed.
16023
16024 * doc/bison.texinfo: Document YYFPRINTF, YYSTDERR.
16025
ed8e1f68
AD
160262001-12-13 Akim Demaille <akim@epita.fr>
16027
16028 The computation of nullable is broken: it doesn't handle empty
16029 RHS's properly.
16030
16031 * tests/torture.at (GNU AWK Grammar): New.
16032 * tests/sets.at (Nullable): New.
16033 * src/nullable.c (set_nullable): Instead of blindly looping over
16034 `ritems', loop over the rules, and then over their rhs's.
16035
16036 Work around Autotest bugs.
16037
16038 * src/warshall.c (bitmatrix_print): Don't use `+--+' as table
16039 frame, because Autotest understand lines starting with a `+' as
16040 traces from the shell. Then, they are not processed properly.
16041 Admittedly an Autotest bug, but we don't have time to wait for
16042 Autotest to catch up.
16043 * tests/regression.at (Broken Closure): Adjust to the new table
16044 frames.
16045 Move to...
16046 * tests/sets.at: here.
16047
cb581495
AD
160482001-12-13 Akim Demaille <akim@epita.fr>
16049
16050 * src/closure.c (closure): Use nrules instead of playing tricks
16051 with BITS_PER_WORD.
16052
2e729273
AD
160532001-12-13 Akim Demaille <akim@epita.fr>
16054
16055 * src/print.c (print_actions): Output the handling of `$' as the
16056 traces do: shifting the token EOF. Before EOF was treated as a
16057 nonterminal.
16058 * tests/regression.at: Adjust some tests.
16059 * src/print_graph.c (print_core): Complete the set of items via
16060 closure. The next-to-final and final states are still unsatisfying,
16061 but that's to be addressed elsewhere.
16062 No longer output the rule numbers, but do output the state number.
16063 A single loop for the shifts + gotos is enough, but picked a
16064 distinct color for each.
16065 (print_graph): Initialize and finalize closure.
16066
107f7dfb
AD
160672001-12-13 Akim Demaille <akim@epita.fr>
16068
16069 * src/reader.c (readgram): Remove dead code, an strip useless
16070 braces.
16071 (get_type): Remove, unused.
16072
9b53a24f
AD
160732001-12-12 Akim Demaille <akim@epita.fr>
16074
16075 * src/complain.h, src/complain.c: Remove error_one_per_line, rely
16076 on that of lib/error.c.
16077
dbfb6dcd
AD
160782001-12-12 Akim Demaille <akim@epita.fr>
16079
16080 Some hosts don't like `/' in includes.
16081
16082 * src/system.h: Include libgettext.h without qualifying the path.
16083 * src/Makefile.am (INCLUDES): Add $(top_srcdir)/intl, remove
16084 $(top_srcdir).
16085
c25fb648
MA
160862001-12-11 Marc Autret <autret_m@epita.fr>
16087
16088 * src/output.c (output_parser): Remove useless muscle.
16089
710ddc4f
MA
160902001-12-11 Marc Autret <autret_m@epita.fr>
16091
16092 * src/bison.simple: Remove #line just before %%epilogue. It
16093 is now handled in ...
16094 * src/reader.c (read_additionnal_code): Add the output of a
16095 #line for the epilogue.
16096
e83d80b8
MA
160972001-12-10 Marc Autret <autret_m@epita.fr>
16098
927c1557 16099 * src/reader.c (copy_definition): Re-use CPP-outed code which
e83d80b8
MA
16100 replace precedent remove.
16101 * src/bison.simple: Remove #line before %%prologue because
16102 %%input-line is wrong at this time.
16103
971d5158
MA
161042001-12-10 Marc Autret <autret_m@epita.fr>
16105
16106 * src/reader.c (symbols_output): Clean up.
927c1557 16107 * src/output.c (output_gram, output): Clean up.
971d5158 16108
5edafffd
AD
161092001-12-10 Akim Demaille <akim@epita.fr>
16110
16111 * src/lalr.c (initialize_lookaheads): New. Extracted from...
16112 * src/LR0.c (set_state_table): here.
16113 * src/lalr.c (lalr): Call it.
16114
0279f8e9
AD
161152001-12-10 Akim Demaille <akim@epita.fr>
16116
16117 * src/state.h (shifts): Remove the `number' member: shifts are
16118 attached to state, hence no longer need to be labelled with a
16119 state number.
16120
190c4f5f
AD
161212001-12-10 Akim Demaille <akim@epita.fr>
16122
16123 Now that states have a complete set of members, the linked list of
16124 shifts is useless: just fill directly the state's shifts member.
16125
16126 * src/state.h (shifts): Remove the `next' member.
16127 * src/LR0.c (first_state, last_state): Remove.
16128 Adjust the callers.
16129 (augment_automaton): Don't look for the shifts that must be added
16130 a shift on EOF: it is those of the state we looked for! But now,
16131 since shifts are attached, it is no longer needed to looking
16132 merely by its id: its number.
16133
2a73b93d
AD
161342001-12-10 Akim Demaille <akim@epita.fr>
16135
16136 * src/LR0.c (augment_automaton): Better variable locality.
16137 Remove an impossible branch: if there is a state corresponding to
16138 the start symbol being shifted, then there is shift for the start
16139 symbol from the initial state.
16140
74392f6a
AD
161412001-12-10 Akim Demaille <akim@epita.fr>
16142
16143 * src/LR0.c (augment_automaton): Call `insert_eof_shifting_state'
16144 only when appropriate: when insert_start_shifting_state' is not
16145 invoked.
16146 * tests/regression.at (Rule Line Numbers): Adjust.
16147
37c82725
AD
161482001-12-10 Akim Demaille <akim@epita.fr>
16149
16150 * src/LR0.c (augment_automaton): Now that all states have shifts,
16151 merge the two cases addition shifts to the initial state.
16152
6a164e0c
AD
161532001-12-10 Akim Demaille <akim@epita.fr>
16154
16155 * src/lalr.c (set_state_table): Move to...
16156 * src/LR0.c: here.
16157 * src/lalr.c (lalr): Don't call it...
16158 * src/LR0.c (generate_states): do it.
16159 * src/LR0.h (first_state): Remove, only the table is used.
16160
7215de24
AD
161612001-12-10 Akim Demaille <akim@epita.fr>
16162
16163 * src/LR0.h (first_shift, first_reduction): Remove.
16164 * src/lalr.c: Don't use first_shift: find shifts through the
16165 states.
16166
80e25d4d
AD
161672001-12-10 Akim Demaille <akim@epita.fr>
16168
16169 * src/LR0.c: Attach shifts to states as soon as they are
16170 computed.
16171 * src/lalr.c (set_state_table): Instead of assigning shifts to
16172 state, just assert that the mapping was properly done.
16173
0ab3728b
AD
161742001-12-10 Akim Demaille <akim@epita.fr>
16175
16176 * src/LR0.c (insert_start_shift): Rename as...
16177 (insert_start_shifting_state): this.
16178 (insert_eof_shifting_state, insert_accepting_state): New.
16179 (augment_automaton): Adjust.
16180 Better locality of the variables.
16181 When looking if the start_symbol is shifted from the initial
16182 state, using `while (... symbol != start_symbol ...)' sounds
16183 better than `while (... symbol < start_symbol ...)': If fail
16184 to see how the order between symbols could be relevant!
16185
78af9bbc
AD
161862001-12-10 Akim Demaille <akim@epita.fr>
16187
16188 * src/getargs.h: Don't declare `spec_name_prefix' and
16189 `spec_file_prefix', declared by src/files.h.
16190 * src/files.c, src/files.h: Default for spec_name_prefix is "yy".
16191 * src/muscle_tab.c (muscle_init): Default prefix to NULL.
16192 * src/output.c (prepare): Adjust.
16193 * src/reader.c (symbols_output): Likewise.
16194 * src/vmsgetargs.c: Vaguely adjust, but who cares?
16195
bdef2a41
AD
161962001-12-10 Akim Demaille <akim@epita.fr>
16197
16198 * src/muscle_tab.c (muscle_init): NULL is a better default than
16199 `"0"'.
16200
3735969c
AD
162012001-12-10 Akim Demaille <akim@epita.fr>
16202
16203 * src/reader.c (reader): Calling symbols_output once is enough.
16204
49701457
AD
162052001-12-10 Akim Demaille <akim@epita.fr>
16206
16207 Now that states have a complete set of members, the linked list of
16208 reductions is useless: just fill directly the state's reductions
16209 member.
16210
16211 * src/state.h (struct reductions): Remove member `number' and
16212 `next'.
16213 * src/LR0.c (first_reduction, last_reduction): Remove.
16214 (save_reductions): Don't link the new reductions, store them in
16215 this_state.
16216 * src/lalr.c (set_state_table): No need to attach reductions to
16217 states, it's already done.
16218 * src/output.c (output_actions): No longer free the shifts, then
16219 the reductions, then the states: free all the states and their
16220 members.
16221
0edad749
AD
162222001-12-10 Akim Demaille <akim@epita.fr>
16223
16224 * src/options.c (OPTN, DRTV, BOTH): New.
16225 (option_table): Use them.
16226
0edad749
AD
16227 * src/muscle_tab.c: Don't include xalloc.h and string.h: that's
16228 the job of system.h.
16229 * src/options.c: Don't include stdio.h and xalloc.h for the same
16230 reasons.
16231
5449dd0f
AD
162322001-12-10 Akim Demaille <akim@epita.fr>
16233
16234 * src/output.c (output, prepare): Make sure the values of the
16235 muscles `action' and `prologue' are 0-terminated.
16236
a870c567
AD
162372001-12-10 Akim Demaille <akim@epita.fr>
16238
16239 Clean up GCC warnings.
16240
16241 * src/reader.c (copy_action): `buf' is not used.
16242 (parse_skel_decl): Be static.
16243 * src/muscle_tab.c (mhash1, mhash2, muscle_insert): Preserve `const'.
16244 * src/options.h (create_long_option_table): Have a real prototype.
16245 * lib/hash.c, lib/hash.h (hash_insert, hash_insert_at, hash_delete)
16246 (hash_delete_at): Return const void *.
16247 Adjust casts to preserve the const.
16248
80df8768
AD
162492001-12-10 Akim Demaille <akim@epita.fr>
16250
16251 * configure.in: Require 2.52g.
16252 M4 is not needed, but AUTOM4TE is.
16253 * m4/m4.m4: Remove.
16254 * tests/Makefile.am: Adjust.
16255
f693ad14
AD
162562001-12-10 Akim Demaille <akim@epita.fr>
16257
16258 One structure for states is enough, even though theoretically
16259 there are LR(0) states and LALR(1) states.
16260
16261 * src/lalr.h (state_t): Remove.
16262 (state_table): Be state_t **, not state_t *.
16263 * src/state.h (core, CORE_ALLOC): Rename as...
16264 (state_t, STATE_ALLOC): this.
16265 Add the LALR(1) members: shifts, reductions, errs.
16266 * src/LR0.c (state_table): Rename as...
16267 (state_hash): this, to avoid name clashes with the global
16268 `state_table'.
16269 * src/print_graph.c, src/LR0.c, src/LR0.h, src/conflicts.c
16270 * src/lalr.c, src/lalr.h, src/output.c, src/print.c: Adjust.
16271
74ffbcb6
AD
162722001-12-10 Akim Demaille <akim@epita.fr>
16273
16274 Bison dumps core on bash.y.
16275 Reported by Pascal Bart.
16276
16277 * src/warshall.c (bitmatrix_print): New.
16278 (TC): Use it.
ba0fe3c7 16279 When performing a transitive closure R(i, j) && R(j, k) => R(i, k),
74ffbcb6
AD
16280 j must be the outer loop.
16281 * tests/regression.at (Broken Closure): New.
16282
07708e19
AD
162832001-12-05 Akim Demaille <akim@epita.fr>
16284
16285 * tests/atlocal.in (CPPFLAGS): Do not leave a space between -I and
16286 its argument.
ba1ecc07 16287 Reported by Peter Hamorsky.
07708e19 16288
92b16366
AD
162892001-12-05 Akim Demaille <akim@epita.fr>
16290
16291 * src/conflicts.c (err_table): Remove.
16292 (resolve_sr_conflict): Adjust.
16293 * src/lalr.h (state_t.reduction_table, state_t.shift_table):
16294 Rename as...
16295 (state_t.reductions, state_t.shifts): this.
16296
076ab033
AD
162972001-12-05 Akim Demaille <akim@epita.fr>
16298
16299 * src/reduce.c (reduce_grammar_tables): No longer disable the
16300 removal of useless rules via CPP but via `if (0)', so that the
16301 compiler still check the code is valid.
16302 For instance, it should have noticed `rline' no longer exists: use
16303 the `line' member of rule_t.
16304 * src/gram.c (dummy, rline): Remove, unused.
16305
3843c413
AD
163062001-12-05 Akim Demaille <akim@epita.fr>
16307
16308 * src/output.c (pack_vector): Use assert, not berror.
16309 * src/main.c (berror): Remove, unused.
16310
43168960
AD
163112001-12-05 Akim Demaille <akim@epita.fr>
16312
16313 New experimental feature: if --verbose --trace output all the
16314 items of a state, not only its kernel.
16315
16316 * src/print.c (print_core): If `trace_flag', then invoke closure
16317 before outputting the items of the state (print_core is no longer
16318 a correct name them).
16319 (print_results): Invoke new_closure/free_closure if needed.
16320
b2872512
AD
163212001-12-05 Akim Demaille <akim@epita.fr>
16322
16323 * src/LR0.c (new_itemsets): Use nshifts only, not shiftcount.
16324 * src/closure.c, src/closure.h (itemsetsize): Rename as...
16325 (nitemset): for consistency with the rest of the project.
16326
23cbcc6c
AD
163272001-12-05 Akim Demaille <akim@epita.fr>
16328
16329 * src/closure.c (print_closure): Improve.
16330 (closure): Use it for printing input and output.
16331
03ec521c
AD
163322001-12-05 Akim Demaille <akim@epita.fr>
16333
16334 * src/closure.c (FIRSTS, FDERIVES): Adjust to reality: they are
16335 indexed by nonterminals.
16336
3a7456dd
AD
163372001-12-05 Akim Demaille <akim@epita.fr>
16338
16339 * src/warshall.c (TC, RTC): De-obsfucate (source reduced to 22% of
16340 what it was!).
16341 * src/warshall.h: Remove accidental duplication of the content.
16342
1cbcf2e7
AD
163432001-12-05 Akim Demaille <akim@epita.fr>
16344
16345 * src/closure.c (set_fderives): De-obfuscate.
16346
84182270
AD
163472001-12-05 Akim Demaille <akim@epita.fr>
16348
16349 * src/closure.c (print_firsts, print_fderives): De-obfuscate.
16350
3f6f053c
AD
163512001-12-05 Akim Demaille <akim@epita.fr>
16352
16353 * src/closure.c (set_firsts): De-obfuscate.
16354
7a5350ba
AD
163552001-12-05 Akim Demaille <akim@epita.fr>
16356
16357 * src/output.c (action_row): De-obfuscate
16358 using the good o' techniques: arrays not pointers, variable
16359 locality, BITISSET, RESETBIT etc.
16360
d954473d
AD
163612001-12-05 Akim Demaille <akim@epita.fr>
16362
16363 Pessimize the code to simplify it: from now on, all the states
16364 have a valid SHIFTS, which NSHIFTS is possibly 0.
16365
16366 * src/LR0.c (shifts_new): Be global and move to..
16367 * src/state.c, src/state.h: here.
16368 * src/conflicts, src/lalr.c, src/output.c, src/print.c,
16369 * src/print_graph: Adjust.
16370
9839bbe5
AD
163712001-12-05 Akim Demaille <akim@epita.fr>
16372
16373 * src/state.h (SHIFT_DISABLE, SHIFT_IS_DISABLED): New.
16374 * src/conflicts.c: Use it.
16375 Restore a few missing `if (!SHIFT_IS_DISABLED)' which were
16376 incorrectly ``simplified''.
16377
9f136c07
AD
163782001-12-05 Akim Demaille <akim@epita.fr>
16379
16380 * src/conflicts.c (flush_shift, resolve_sr_conflict): De-obfuscate
16381 using the good o' techniques: arrays not pointers, variable
16382 locality, BITISSET, RESETBIT etc.
16383
b608206e
AD
163842001-12-05 Akim Demaille <akim@epita.fr>
16385
16386 * src/state.h (SHIFT_SYMBOL): New.
16387 * src/conflicts.c: Use it to deobfuscate.
16388
52afa962
AD
163892001-12-05 Akim Demaille <akim@epita.fr>
16390
16391 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts)
16392 (print_reductions): De-obfuscate using the good o' techniques:
16393 arrays not pointers, variable locality, BITISSET.
16394
e74dc321
AD
163952001-12-05 Akim Demaille <akim@epita.fr>
16396
16397 * src/conflicts.c (print_reductions): Arrays, not pointers.
16398 Use BITISSET.
16399
768fca83
AD
164002001-12-05 Akim Demaille <akim@epita.fr>
16401
16402 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16403
a17e599f
AD
164042001-12-05 Akim Demaille <akim@epita.fr>
16405
16406 * src/conflicts.c (print_reductions): Improve variable locality.
16407
a04bc341
AD
164082001-12-05 Akim Demaille <akim@epita.fr>
16409
16410 * src/conflicts.c (print_reductions): Pessimize, but clarify.
16411
c8ea038e
AD
164122001-12-05 Akim Demaille <akim@epita.fr>
16413
16414 * src/conflicts.c (print_reductions): Improve variable locality.
16415
aa2aab3c
AD
164162001-12-05 Akim Demaille <akim@epita.fr>
16417
16418 * src/state.h (SHIFT_IS_ERROR, SHIFT_IS_GOTO, SHIFT_IS_SHIFT): New.
16419 * src/lalr.c: Use them.
16420
b178c8cc
AD
164212001-12-05 Akim Demaille <akim@epita.fr>
16422
16423 * src/LR0.c (augment_automaton): Formatting changes.
16424 Better variable locality.
16425
f67d13aa
AD
164262001-12-05 Akim Demaille <akim@epita.fr>
16427
16428 * src/lalr.c (matrix_print): New.
16429 (transpose): Use it.
16430 Use arrays instead of pointers.
16431
c2713865
AD
164322001-12-05 Akim Demaille <akim@epita.fr>
16433
16434 * src/lalr.c (maxrhs): Move to...
16435 * src/gram.c, src/gram.h (ritem_longest_rhs): here.
16436 * src/lalr.c (build_relations): Adjust.
16437
9887c18a
AD
164382001-12-05 Akim Demaille <akim@epita.fr>
16439
16440 * src/lalr.c (transpose): Free the memory allocated to the
16441 argument, as it is replaced by the results by the unique caller.
16442 (build_relations): Merely invoke transpose: it handles the memory
16443 deallocation.
16444 Improve variable locality.
16445 Avoid variables used as mere abbreviations.
16446 (compute_lookaheads): Use arrays instead of pointers.
16447
4d4f699c
AD
164482001-12-05 Akim Demaille <akim@epita.fr>
16449
16450 * src/lalr.c (initialize_F): Improve variable locality.
16451 Avoid variables used as mere abbreviations.
16452
80a69750
AD
164532001-12-05 Akim Demaille <akim@epita.fr>
16454
16455 * src/derives.c (print_derives): Display the ruleno.
16456 * src/lalr.c (initialize_F, transpose): Better variable locality
16457 to improve readability.
16458 Avoid variables used as mere abbreviations.
16459
fe961097
AD
164602001-12-05 Akim Demaille <akim@epita.fr>
16461
16462 * src/lalr.c (traverse): Use arrays instead of pointers.
16463
e3e4e814
AD
164642001-12-05 Akim Demaille <akim@epita.fr>
16465
16466 * src/nullable.c (set_nullable): Use a for loop to de-obfuscate
16467 the handling of squeue.
16468 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16469
630e182b
AD
164702001-12-05 Akim Demaille <akim@epita.fr>
16471
16472 Because useless nonterminals are now kept alive (instead of being
16473 `destroyed'), we now sometimes examine them, and store information
16474 related to them. Hence we need to know their number, and adjust
16475 memory allocations.
16476
16477 * src/reduce.c, src/reduce.h (nuseless_nonterminals): No longer
16478 static.
16479 * src/LR0.c (allocate_itemsets): The memory allocated to
16480 `symbol_count' was used for two different purpose: once to count
16481 the number of occurrences of each symbol, and later reassigned to
16482 `shift_symbol', containing the symbol that can be shifted from a
16483 given state.
16484 Deobfuscate, i.e., allocate, use and free `symbol_count' here
16485 only, and...
16486 (new_itemsets): Allocate `shift_symbol' here.
16487 (allocate_itemsets): symbol_count includes useless nonterminals.
16488 Make room for them.
16489 (free_storage): Use `free', not `XFREE', for pointers that cannot
16490 be null.
16491
81b51460
AD
164922001-12-05 Akim Demaille <akim@epita.fr>
16493
16494 * src/nullable.c (set_nullable): Deobfuscate the handling of
16495 ritem.
16496 `symbol >= 0' is wrong now, use `rule_table[ruleno].useful'.
16497
3067fbef
AD
164982001-12-05 Akim Demaille <akim@epita.fr>
16499
16500 * src/gram.c, src/gram.h (ritem_print): New.
16501 * src/gram.c (dummy): Remove, now there is actual code in gram.c.
16502 (This useless function was defined only to work around VMS linkers
16503 that can't handle compilation units with variables only).
16504 * src/reduce.c (dump_grammar): Use it to trace the construction of
16505 ritem.
16506
c2bea5f9
PE
165072001-12-04 Paul Eggert <eggert@twinsun.com>
16508
7d27c823
PE
16509 * src/bison.simple (union yyalloc): Change member names
16510 to be the same as the stack names.
16511 (yyparse): yyptr is now union yyalloc *, not char *.
16512 (YYSTACK_RELOCATE): Likewise. This avoids a GCC warning,
16513 and may generate better code on some machines.
c2bea5f9
PE
16514 (yystpcpy): Use prototype if __STDC__ is defined, not just
16515 if __cplusplus is defined.
35687a9d 16516
2c8a9dfa
AD
165172001-11-30 Akim Demaille <akim@epita.fr>
16518
16519 * configure.in (WARNING_CFLAGS): Add -Werror when possible.
16520 (CFLAGS): Do not include the WARNING_CFLAGS here, since GNU
16521 Gettext doesn't compile cleanly, and dies with -Werror.
16522 * src/Makefile.am, lib/Makefile.am, tests/atlocal.in (CFLAGS):
16523 Include WARNING_CFLAGS here.
16524 * lib/xstrdup.c: Include xalloc.h, so that xstrdup be declared
16525 before being defined.
16526
f4e421e6
AD
165272001-11-27 Paul Eggert <eggert@twinsun.com>
16528
16529 * lib/quotearg.h (quotearg_n, quotearg_n_style):
16530 First arg is int, not unsigned.
16531 * lib/quotearg.c (quotearg_n, quotearg_n_style): Likewise.
16532 (SIZE_MAX, UINT_MAX): New macros.
16533 (quotearg_n_options): Abort if N is negative.
16534 Avoid overflow check on hosts where size_t is 64 bits and int
16535 is 32 bits, as overflow is impossible there.
16536 Fix off-by-one typo that caused unnecessary reallocation.
16537
7093d0f5
AD
165382001-11-29 Paul Eggert <eggert@twinsun.com>
16539
16540 Name space cleanup in generated parser.
16541
16542 * doc/bison.texinfo (Bison Parser): Discuss system headers
16543 and their effect on the user name space.
16544
16545 * src/bison.simple:
16546 (YYSTACK_ALLOC, YYSTACK_FREE, union yyalloc, YYSTACK_GAP_MAX,
16547 YYSTACK_BYTES, YYSTACK_RELOCATE): Do not define unless necessary,
16548 i.e. unless ! defined (yyoverflow) || defined (YYERROR_VERBOSE).
16549
16550 (YYSIZE_T): New macro. Use it instead of size_t, to avoid infringing
16551 on user names when possible.
16552
16553 (YYSTACK_USE_ALLOCA): Do not define; just use any existing defn.
16554 Simplify test for whather <alloca.h> exists.
16555
16556 (<stdlib.h>): Include if we will use malloc, and if standard C or C++.
16557
16558 (<stdio.h>): Include if YYDEBUG.
16559
16560 (yymemcpy): Renamed from __yy_memcpy. Do not define unless
16561 ! defined (yyoverflow) && ! defined (yymemcpy).
16562
16563 (yymemcpy, yyparse): Rename local variables as needed so that
16564 they all begin with 'yy'.
16565
16566 (yystrlen, yystpcpy): New functions.
16567
16568 (YY_DECL_NON_LSP_VARIABLES): Renamed from _YY_DECL_VARIABLES.
16569 All uses changed.
16570
16571 (yyparse): size_t -> YYSIZE_T. Use yystrlen and yystpcpy
16572 instead of relying on string.h functions. Use YYSTACK_ALLOC
16573 and YYSTACK_FREE instead of malloc and free.
16574
fd51e5ff
AD
165752001-11-30 Akim Demaille <akim@epita.fr>
16576
16577 * src/bison.simple (YYSTYPE, YYLTYPE): Move their definitions
16578 before their first uses.
16579 (YYBISON, YYPURE): Move to the top of the output.
16580
7d13ff5f
AD
165812001-11-30 Akim Demaille <akim@epita.fr>
16582
16583 * tests/reduce.at (Useless Nonterminals): Fix.
16584
892a3995
AD
165852001-11-30 Akim Demaille <akim@epita.fr>
16586
16587 * src/bison.simple (YYSTACK_FREE): Use `do {;} while (0)' as empty
16588 if body instead of `;' to pacify GCC's warnings.
16589
68f1e3ed
AD
165902001-11-30 Akim Demaille <akim@epita.fr>
16591
16592 Instead of mapping the LHS of unused rules to -1, keep the LHS
16593 valid, but flag the rules as invalid.
16594
16595 * src/gram.h (rule_t): `useful' is a new member.
16596 * src/print.c (print_grammar): Adjust.
16597 * src/derives.c (set_derives): Likewise.
16598 * src/reader.c (packgram, reduce_output): Likewise.
16599 * src/reduce.c (reduce_grammar_tables): Likewise.
16600 * tests/reduce.at (Underivable Rules, Useless Rules): New.
16601
d2d1b42b
AD
166022001-11-30 Akim Demaille <akim@epita.fr>
16603
16604 * src/reduce.c (reduce_output): Formatting changes.
16605 * src/print.c (print_results, print_grammar): Likewise.
16606 * tests/regression.at (Rule Line Numbers)
16607 (Solved SR Conflicts, Unresolved SR Conflicts): Adjust.
16608
760b53a8
AD
166092001-11-30 Akim Demaille <akim@epita.fr>
16610
16611 * src/reduce.c (nonterminals_reduce): Instead of throwing away
16612 useless nonterminals, move them at the end of the symbol arrays.
16613 (reduce_output): Adjust.
16614 * tests/reduce.at (Useless Nonterminals): Adjust.
16615
00238958
AD
166162001-11-30 Akim Demaille <akim@epita.fr>
16617
16618 * src/reduce.c: Various comment/formatting changes.
16619 (nonterminals_reduce): New, extracted from...
16620 (reduce_grammar_tables): here.
16621 (reduce_grammar): Call nonterminals_reduce.
16622
396452de
PE
166232001-11-29 Paul Eggert <eggert@twinsun.com>
16624
16625 * src/bison.simple (YYSTACK_REALLOC): Remove.
16626 (YYSTACK_ALLOC): Resurrect this macro, with its old meaning.
16627 (YYSTACK_FREE, YYSTACK_GAP_MAX, YYSTACK_BYTES, YYSTACK_RELOCATE):
16628 New macros.
16629 (union yyalloc): New type.
16630 (__yy_memcpy): Last arg is size_t, not unsigned int, to remove
16631 an arbitrary restriction on hosts where size_t is wider than int.
16632
16633 (yyparse): Don't dump core if alloca or malloc fails; instead, report
16634 a parser stack overflow. Allocate just one block of memory for all
16635 three stacks, instead of allocating three blocks; this typically is
16636 faster and reduces fragmentation.
16637
16638 Do not limit the number of items in the stack to a value that fits
16639 in 'int', as this is an arbitrary limit on hosts with 64-bit
16640 size_t and 32-bit int.
16641
147e184c
MA
166422001-11-29 Marc Autret <autret_m@epita.fr>
16643
16644 * tests/calc.at [AT_DATA_CALC_Y]: Use %error-verbose instead
16645 of defining YYERROR_VERBOSE.
16646 [AT_DATA]: $4 is now out of C declarations in the prologue.
16647
426cf563
MA
166482001-11-28 Marc Autret <autret_m@epita.fr>
16649
16650 * src/reader.c (parse_dquoted_param): New.
16651 (parse_skel_decl): Use it.
16652 * src/lex.h: Add its prototype.
16653 * src/lex.c (literalchar): Become not static.
16654
c7925b99
MA
166552001-11-28 Marc Autret <autret_m@epita.fr>
16656
16657 * src/output.h: And put its extern declaration here.
16658 * src/output.c (error_verbose): Define here.
16659 (prepare): Echo name modification.
16660 * src/getargs.h: Clean its extern declaration.
16661 * src/getargs.c (error_verbose_flag): Remove.
16662 (getargs): Remove case 'e'.
16663 * src/options.c (option_table): 'error-verbose' is now seen as simple
16664 percent option.
16665 Include output.h.
16666
16667 * src/reader.c (read_declarations): Remove case tok_include.
16668 (parse_include_decl): Remove.
16669 * src/lex.h (token_t): Remove tok_include.
16670 * src/options.c (option_table): 'include' is now a simple command line
16671 option.
16672
5b5d1929
MA
166732001-11-28 Marc Autret <autret_m@epita.fr>
16674
16675 * src/bison.simple: Adjust muscle names.
16676 * src/muscle_tab.c (muscle_init): Also rename the muscles.
16677 * src/output.c (prepare): s/_/-/ for the muscles names.
16678 (output_parser): When scanning for a muscle, allow '-' instead of '_'.
16679
8850be4b
MA
166802001-11-28 Marc Autret <autret_m@epita.fr>
16681
16682 * src/bison.simple: Fix debug.
16683 [YYERROR_VERBOSE]: Re-integrate as an internal macro.
16684
4a38e613
AD
166852001-11-28 Akim Demaille <akim@epita.fr>
16686
16687 * src/LR0.c (shifts_new): New.
16688 (save_shifts, insert_start_shift, augment_automaton): Use it.
16689
4b35e1c1
AD
166902001-11-28 Akim Demaille <akim@epita.fr>
16691
16692 * src/closure.c (closure): `b' and `ruleno' denote the same value:
16693 keep ruleno only.
16694
d2b04478
AD
166952001-11-28 Akim Demaille <akim@epita.fr>
16696
16697 * src/closure.c (closure): Instead of looping over word in array
16698 then bits in words, loop over bits in array.
16699
2c4c30aa
AD
167002001-11-28 Akim Demaille <akim@epita.fr>
16701
16702 * src/closure.c (closure): No longer optimize the special case
16703 where all the bits of `ruleset[r]' are set to 0, to make the code
16704 clearer.
16705
576890b7
AD
167062001-11-28 Akim Demaille <akim@epita.fr>
16707
16708 * src/closure.c (closure): `r' and `c' are new variables, used to
16709 de-obfuscate accesses to RULESET and CORE.
16710
cb487d7d
AD
167112001-11-28 Akim Demaille <akim@epita.fr>
16712
16713 * src/reduce.c (reduce_print): Use ngettext.
16714 (dump_grammar): Improve the trace accuracy.
16715
6013d43f
AD
167162001-11-28 Akim Demaille <akim@epita.fr>
16717
16718 * src/reduce.c (dump_grammar): Don't translate trace messages.
16719
cb4956ee
AD
167202001-11-28 Akim Demaille <akim@epita.fr>
16721
16722 * tests/reduce.at (Useless Terminals, Useless Nonterminals): New.
16723 * src/reduce.c (reduce_grammar_tables): Do not free useless tags,
16724 as all tags are free'ed afterwards.
16725 From Enrico Scholz.
16726
648185ab
PE
167272001-11-27 Paul Eggert <eggert@twinsun.com>
16728
16729 * src/bison.simple (YYSTACK_REALLOC): Fix typo that caused us to
16730 use alloca when we didn't want to, and vice versa.
16731
68254a03
MA
167322001-11-27 Marc Autret <autret_m@epita.fr>
16733
9113b58f
AD
16734 * src/muscle_tab.c (muscle_init): Remove 'verbose' muscle
16735 initialization.
68254a03
MA
16736 * src/output.c (prepare): Remove its update.
16737
04d843a2
MA
167382001-11-27 Marc Autret <autret_m@epita.fr>
16739
16740 * tests/torture.at [AT_DATA]: Remove YYERROR_VERBOSE definition.
16741 Use %error-verbose.
16742
d2079671 167432001-11-27 Marc Autret <autret_m@epita.fr>
eeeb962b
MA
16744
16745 * src/bison.simple: Remove YYERROR_VERBOSE using.
16746 Use %%error_verbose.
16747 (yyparse): Likewise.
16748 * src/output.c (prepare): Give its final value.
16749 * src/muscle_tab.c (muscle_init): Init new muscle 'error_verbose'.
16750 * src/getargs.h: Add its extern declaration.
16751 * src/getargs.c (error_verbose_flag): New int.
16752 (getargs): Update to catch new case.
16753 * src/options.c (option_table): 'error-verbose' is a new option.
16754 (shortopts): Update.
16755
e0327bc8
AD
167562001-11-27 Akim Demaille <akim@epita.fr>
16757
16758 * src/system.h: Use intl/libgettext.h.
16759 * src/Makefile.am (INCLUDES): Add -I $(top_srcdir).
16760
000f1a3c
AD
167612001-11-27 Akim Demaille <akim@epita.fr>
16762
16763 * tests/torture.at (Exploding the Stack Size with Malloc):
16764 s/YYSTACK_USE_ALLOCA_ALLOCA/YYSTACK_USE_ALLOCA/.
16765
26cfe0be
AD
167662001-11-27 Akim Demaille <akim@epita.fr>
16767
16768 * src/files.c: Include error.h.
16769 Reported by Hans Aberg.
16770
f6bd5427
MA
167712001-11-26 Marc Autret <autret_m@epita.fr>
16772
d2079671 16773 * src/reader.c (parse_include_decl): New, not yet implemented.
f6bd5427
MA
16774 (read_declarations): Add case tok_include.
16775 * src/getargs.h (include): Add its extern definition.
16776 * src/getargs.c (include): New const char *.
16777 (getargs): Add case '-I'.
16778 * src/options.c (option_table): Add include as command line and
16779 percent option.
16780 * src/lex.h (token_t): Add tok_include.
16781
2ca209c1
AD
167822001-11-26 Akim Demaille <akim@epita.fr>
16783
16784 * src/reader.c (readgram): Make sure rules for mid-rule actions
16785 have a lineno equal to that of their host rule.
16786 Reported by Hans Aberg.
16787 * tests/regression.at (Rule Line Numbers): New.
16788
0e41b407
AD
167892001-11-26 Akim Demaille <akim@epita.fr>
16790
16791 * src/LR0.c (allocate_itemsets): kernel_size contains ints, not
16792 size_ts.
16793
167942001-11-26 Akim Demaille <akim@epita.fr>
16795
16796 * src/complain.c, src/complain.h (error): Remove, provided by
16797 lib/error.[ch].
16798
e0c40012
AD
167992001-11-26 Akim Demaille <akim@epita.fr>
16800
16801 * src/reader.c (read_declarations): Don't abort on tok_illegal,
16802 issue an error message.
16803 * tests/regression.at (Invalid %directive): New.
16804 Reported by Hans Aberg.
16805
5e147124
AD
168062001-11-26 Akim Demaille <akim@epita.fr>
16807
16808 * configure.in: Invoke AC_FUNC_OBSTACK and AC_FUNC_ERROR_AT_LINE.
16809 * lib/Makefile.am (libbison_a_SOURCES): Adjust.
16810
a034c8b8
AD
168112001-11-26 Akim Demaille <akim@epita.fr>
16812
16813 * src/conflicts.c (conflicts_print): Don't complain at all when
16814 there are no reduce/reduce conflicts, and as many shift/reduce
16815 conflicts as expected.
16816 * tests/regression.at (%expect right): Adjust.
16817
c64a20f3
AD
168182001-11-23 Akim Demaille <akim@epita.fr>
16819
16820 * lib/alloca.c: Update, from fileutils.
16821
5b0d29bb
AD
168222001-11-23 Akim Demaille <akim@epita.fr>
16823
16824 * lib/Makefile.am (libbison_a_LIBADD): Add @ALLOCA@.
16825
722c4bfe
AD
168262001-11-23 Akim Demaille <akim@epita.fr>
16827
16828 * src/system.h: Include alloca.h.
16829 * src/main.c (main) [C_ALLOCA]: Call alloca (0).
16830
6255b435
AD
168312001-11-23 Akim Demaille <akim@epita.fr>
16832
16833 * src/print_graph.c (print_actions): Remove `rule', unused.
16834 * src/LR0.c (kernel_size): Contain `int' instead of `size_t' to
16835 pacify GCC's signed < unsigned warnings.
16836 * src/closure.c (itemsetsize): Likewise.
16837 * src/reader.c (symbol_list_new): Static.
16838
b29b2ed5
AD
168392001-11-23 Akim Demaille <akim@epita.fr>
16840
16841 Attaching lineno to buckets is stupid, since only one copy of each
16842 symbol is kept, only the line of the first occurrence is kept too.
16843
16844 * src/symtab.h, src/symtab.c (bucket): Remove the line member.
16845 * src/reader.c (rline_allocated): Remove, unused.
16846 (symbol_list): Have a `line' member.
16847 (symbol_list_new): New.
16848 (readgram): Use it.
16849 * src/print.c (print_grammar): Output the rule line numbers.
16850 * tests/regression.at (Solved SR Conflicts)
16851 (Unresolved SR Conflicts): Adjust.
16852 Reported by Hans Aberg.
16853
a81b1d4a
MA
168542001-11-22 Marc Autret <autret_m@epita.fr>
16855
16856 * src/bison.simple [YYERROR_VERBOSE]: Force its value to be 1 or 0.
16857
c1ecb3c1
MA
168582001-11-22 Marc Autret <autret_m@epita.fr>
16859
16860 * src/muscle_tab.c (muscle_init): Remove initialization of
16861 skeleton muscle.
16862 * src/output.c (output_master_parser): Do it here.
16863
fbe01355
AD
168642001-11-20 Akim Demaille <akim@epita.fr>
16865
16866 * po/sv.po: New.
16867 * configure.in (ALL_LINGUAS): Adjust.
16868 * po/POTFILE.in: Remove `nullable.c' and `derives.c' which no
16869 longer contains strings to translate.
16870
81e895c0
AD
168712001-11-19 Akim Demaille <akim@epita.fr>
16872
16873 * src/conflicts.c (conflicts_print): Add a missing \n.
16874
6bb1878b
AD
168752001-11-19 Akim Demaille <akim@epita.fr>
16876
16877 * src/nullable.c (nullable_print): New.
16878 (set_nullable): Call it when tracing.
16879 Better locality of variables.
16880
d9ec2d07
AD
168812001-11-19 Akim Demaille <akim@epita.fr>
16882
16883 * src/print.c (print_actions): Better locality of variables.
16884
720e5c1b
AD
168852001-11-19 Akim Demaille <akim@epita.fr>
16886
16887 * src/derives.c (print_derives): Fix and enrich.
16888 * src/closure.c (print_fderives): Likewise.
16889
fb908786
AD
168902001-11-19 Akim Demaille <akim@epita.fr>
16891
16892 * src/closure.c (itemsetend): Remove, replaced with...
16893 (itemsetsize): new.
16894
125ecb56
AD
168952001-11-19 Akim Demaille <akim@epita.fr>
16896
16897 * src/LR0.c (kernel_end): Remove, replaced with...
16898 (kernel_size): new.
16899
d8cf039f
AD
169002001-11-19 Akim Demaille <akim@epita.fr>
16901
16902 * src/conflicts.c (set_conflicts): Use arrays instead of pointers
16903 to clarify.
16904
7bec0760
AD
169052001-11-19 Akim Demaille <akim@epita.fr>
16906
16907 * src/closure.c (closure): Use arrays instead of pointers to clarify.
16908
c87d4863
AD
169092001-11-19 Akim Demaille <akim@epita.fr>
16910
16911 * src/closure.c, src/derives.c, src/nullable.c: Adjust various
16912 trace messages.
16913 * src/LR0.c: Likewise.
16914 (allocate_itemsets): Use arrays instead of pointers to clarify.
16915
9bfe901c
AD
169162001-11-19 Akim Demaille <akim@epita.fr>
16917
16918 * src/getargs.c (statistics_flag): Replace with...
16919 (trace_flag): New.
16920 (longopts): Accept --trace instead of --statistics.
16921 * src/getargs.h, src/options.c: Adjust.
16922 * src/LR0.c, src/closure.c, src/derives.c, src/nullable.c,
16923 * src/reduce.c: Use trace_flags instead of the CPP conditional TRACE.
16924
97db7bd4
AD
169252001-11-19 Akim Demaille <akim@epita.fr>
16926
cc72668c 16927 * src/LR0.c (new_itemsets, get_state): Use more arrays and fewer
97db7bd4
AD
16928 pointers to clarify the code.
16929 (save_reductions, save_shifts): Factor common parts of alternatives.
16930
2c5f66ed
AD
169312001-11-19 Akim Demaille <akim@epita.fr>
16932
16933 * src/LR0.c (new_state, get_state): Complete TRACE code.
16934 * src/closure.c: Include `reader.h' to get `tags', needed by the
16935 trace code.
16936 Rename the conditional DEBUG as TRACE.
16937 Output consistently TRACEs to stderr, not stdout.
16938 * src/derives.c: Likewise.
16939 * src/reduce.c: (inaccessable_symbols): Using if is better style
16940 than goto.
16941 Use `#if TRACE' instead of `#if 0' for tracing code.
16942
300f275f
AD
169432001-11-19 Akim Demaille <akim@epita.fr>
16944
16945 * src/system.h (LIST_FREE, shortcpy): New.
16946 * src/LR0.c: Use them.
16947 * src/output.c (free_itemsets, free_reductions, free_shifts):
16948 Remove, replaced by LIST_FREE.
16949
f59c437a
AD
169502001-11-19 Akim Demaille <akim@epita.fr>
16951
16952 * src/state.h (CORE_ALLOC, SHIFTS_ALLOC, ERRS_ALLOC)
16953 (REDUCTIONS_ALLOC): New.
16954 * src/LR0.c, src/conflicts.c: Use them to de-obfuscate memory
16955 allocation.
16956
6986fd9e
AD
169572001-11-19 Akim Demaille <akim@epita.fr>
16958
16959 * src/LR0.c (new_state): Complete trace code.
16960 * src/nullable.c (set_nullable): Don't translate traces.
16961
4bc30f78
AD
169622001-11-19 Akim Demaille <akim@epita.fr>
16963
16964 * src/print_graph.c (print_core): Better locality of variables.
16965 * src/print.c (print_core): Likewise.
16966
08a946e0
AD
169672001-11-19 Akim Demaille <akim@epita.fr>
16968
16969 * src/vcg.c: You do the output, so you are responsible of the
16970 handling of VCG syntax, in particular: use quotearg.
16971 * src/print_graph.c: Don't.
16972 (print_actions): Don't output the actions as part of the nodes,
16973 since that's the job of the edges.
16974 (print_state): Don't output by hand: fill the node description,
9bfe901c 16975 and ask for its output.
08a946e0 16976
f0473484
AD
169772001-11-19 Akim Demaille <akim@epita.fr>
16978
cc72668c
AD
16979 * src/bison.simple (yyparse): When verbosely reporting an error,
16980 no longer put additional quotes around token names.
f0473484
AD
16981 * tests/calc.at: Adjust.
16982
e41dc700
AD
169832001-11-19 Akim Demaille <akim@epita.fr>
16984
16985 * src/symtab.h, src/symtab.c: `line' is a new member of `bucket'.
16986 * src/reader.c (record_rule_lines, rline, rline_allocated): Remove.
16987 * src/output.c: Adjust.
16988
652a871c
AD
169892001-11-19 Akim Demaille <akim@epita.fr>
16990
16991 * src/gram.h (rprec, rprecsym, rassoc): Remove, now part of...
16992 (rule_t): this.
16993 * src/conflicts.c, src/reader.c, src/reduce.c: Adjust.
16994
b2ed6e58
AD
169952001-11-19 Akim Demaille <akim@epita.fr>
16996
16997 * src/gram.h (rule_t): New.
16998 (rule_table): New.
16999 (rrhs, rlhs): Remove, part of state_t.
17000 * src/print_graph.c, src/closure.c, src/conflicts.c, src/derives.c,
17001 * src/lalr.c, src/nullable.c, src/output.c, src/print.c,
17002 * src/reader.c, src/reduce.c: Adjust.
17003
edad7067
AD
170042001-11-19 Akim Demaille <akim@epita.fr>
17005
17006 * src/reader.c (symbols_output): New, extracted from...
17007 (packsymbols): Here.
17008 (reader): Call it.
17009
3feec034
AD
170102001-11-19 Akim Demaille <akim@epita.fr>
17011
17012 * src/lalr.c (set_maxrhs, maxrhs): Remove, replaced with...
17013 (maxrhs): this new function.
17014
ddcd5fdf
AD
170152001-11-19 Akim Demaille <akim@epita.fr>
17016
cc72668c 17017 * src/lalr.c (F): New macro to access the variable F.
ddcd5fdf
AD
17018 Adjust.
17019
bb527fc2
AD
170202001-11-19 Akim Demaille <akim@epita.fr>
17021
cc72668c 17022 * src/lalr.h (LA): New macro to access the variable LA.
bb527fc2
AD
17023 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17024 * src/lalr.c: Adjust.
17025
a845a697
AD
170262001-11-19 Akim Demaille <akim@epita.fr>
17027
17028 * src/lalr.c (initialize_LA): Only initialize LA. Let...
17029 (set_state_table): handle the `lookaheads' members.
17030
f004bf6a
AD
170312001-11-19 Akim Demaille <akim@epita.fr>
17032
cc72668c
AD
17033 * src/lalr.h (lookaheads): Removed array, whose contents is now
17034 a member of...
f004bf6a
AD
17035 (state_t): this structure.
17036 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17037 Adjust.
17038
de326cc0
AD
170392001-11-19 Akim Demaille <akim@epita.fr>
17040
cc72668c
AD
17041 * src/lalr.h (consistent): Removed array, whose contents is now
17042 a member of...
de326cc0
AD
17043 (state_t): this structure.
17044 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17045 Adjust.
17046
90b4416b
AD
170472001-11-19 Akim Demaille <akim@epita.fr>
17048
cc72668c
AD
17049 * src/lalr.h (reduction_table, shift_table): Removed arrays, whose
17050 contents are now members of...
90b4416b
AD
17051 (state_t): this structure.
17052 * src/output.c, src/lalr.c, src/print_graph.c, src/conflicts.c:
17053 Adjust.
17054
9703cc49
AD
170552001-11-19 Akim Demaille <akim@epita.fr>
17056
17057 * src/lalr.h (state_t): New.
17058 (state_table): Be a state_t * instead of a core **.
17059 (accessing_symbol): Remove, part of state_t.
17060 * src/lalr.c: Adjust.
17061 (set_accessing_symbol): Merge into...
17062 (set_state_table): this.
17063 * src/print_graph.c, src/conflicts.c: Adjust.
17064
d803322e
AD
170652001-11-14 Akim Demaille <akim@epita.fr>
17066
17067 * tests/calc.at, tests/output.at, tests/regression.at,
17068 * tests/testsuite.at, tests/torture.at: Rely on Autotest 2.52g:
17069 now the tests are run in private dirs, therefore AC_CLEANUP and
17070 family can be simplified to 0-ary.
17071 * tests/atlocal.in: Now that we run `elsewhere' than in tests/,
17072 use abs. path to find config.h.
17073 * tests/calc.at (AT_CHECK_CALC): Don't try to check the compiler's
17074 stderr, there can be way too much random noise.
17075 Instead pass -Werror to GCC and rely on the exit status.
17076 Reported by Wolfram Wagner.
17077
3d76b07d
AD
170782001-11-14 Akim Demaille <akim@epita.fr>
17079
17080 * src/bison.simple (yyparse): Let yyls1, yyss1 and yyvs1 be
17081 defined only if yyoverflow is defined, to avoid `warning: unused
17082 variable `yyvs1''.
17083 Reported by The Test Suite.
17084
09b503c8
AD
170852001-11-14 Akim Demaille <akim@epita.fr>
17086
17087 * src/print.c: Include reduce.h.
17088 Reported by Hans Aberg.
17089
170902001-11-14 Akim Demaille <akim@epita.fr>
17091
17092 * src/lex.c, src/lex.h (token_buffer, unlexed_token_buffer):
17093 Revert a previous patch: these are really const.
17094 * src/conflicts.c (conflict_report): Additional useless pair of
17095 braces to pacify GCC's warnings for `if () if () {} else {}'.
17096 * src/lex.c (parse_percent_token): Replace equal_offset with
17097 arg_offset.
17098 arg is const.
17099 Be sure to strdup `arg' when used, since there is no reason for
17100 token_buffer not to change.
17101
0f37a994
AD
171022001-11-14 Akim Demaille <akim@epita.fr>
17103
17104 * src/system.h (EXIT_SUCCESS, EXIT_FAILURE): Ensure a proper
17105 definition.
17106 * src/main.c (main): Use them.
17107 Suggested by Hans Aberg.
17108
d39d93b8
AD
171092001-11-12 Akim Demaille <akim@epita.fr>
17110
17111 * src/system.h (ngettext): Now that we use ngettext, be sure to
17112 provide a default definition when NLS are not used.
17113
9edcd895
AD
171142001-11-12 Akim Demaille <akim@epita.fr>
17115
17116 * doc/bison.texinfo: Use `$' as shell prompt, not `%'.
17117 Use @kbd to denote user input.
17118 (Language and Grammar): ANSIfy the example.
17119 Adjust its layout for info/notinfo.
17120 (Location Tracking Calc): Output error messages to stderr.
17121 Output locations in a more GNUtically correct way.
17122 Fix a couple of Englishos.
17123 Adjust @group/@end group pairs.
17124
7da99ede
AD
171252001-11-12 Akim Demaille <akim@epita.fr>
17126
e3aa65c5 17127 %expect was not functioning at all.
7da99ede
AD
17128
17129 * src/conflicts.c (expected_conflicts): Set to -1.
17130 (conflict_report): Use ngettext.
17131 (conflicts_print): Check %expect and make its violation an error.
17132 * doc/bison.texinfo (Expect Decl): Adjust.
17133 * configure.in (AM_GNU_GETTEXT): Ask for ngettext.
17134 * tests/regression.at (%expect not enough, %expect right)
17135 (%expect too much): New.
17136
ba9dda1a
AD
171372001-11-12 Akim Demaille <akim@epita.fr>
17138
17139 * tests/regression.at (Conflicts): Rename as...
17140 (Unresolved SR Conflicts): this.
17141 (Solved SR Conflicts): New.
17142
337c5bd1
AD
171432001-11-12 Akim Demaille <akim@epita.fr>
17144
17145 * src/reduce.c (print_results): Rename as...
17146 (reduce_output): This.
17147 Output to OUT, passed as argument, instead of output_obstack.
17148 (dump_grammar): Likewise.
17149 (reduce_free): New.
17150 Also free V1.
17151 (reduce_grammar): No longer call reduce_output, since...
17152 * src/print.c (print_results): do it.
17153 * src/main.c (main): Call reduce_free;
17154
c73a41af
AD
171552001-11-12 Akim Demaille <akim@epita.fr>
17156
17157 * src/conflicts.c (print_reductions): Accept OUT as argument.
17158 Output to it, not to output_obstack.
17159 * src/print.c (print_actions): Adjust.
17160
0df87bb6
AD
171612001-11-12 Akim Demaille <akim@epita.fr>
17162
17163 * src/conflicts.c (count_sr_conflicts, count_rr_conflicts): Return
17164 the result instead of using...
17165 (src_total, rrc_total, src_count, rrc_count): Remove.
17166 (any_conflicts): Remove.
17167 (print_conflicts): Split into...
17168 (conflicts_print, conflicts_output): New.
17169 * src/conflicts.h: Adjust.
17170 * src/main.c (main): Invoke both conflicts_output and conflicts_print.
0f37a994 17171 * src/print.c (print_grammar): Issue `\n' between two rules.
0df87bb6
AD
17172 * tests/regression.at (Conflicts): New.
17173 Reported by Tom Lane.
17174
e4d3d4de
AD
171752001-11-12 Akim Demaille <akim@epita.fr>
17176
17177 * tests/regression.at (Invalid input): Remove, duplicate with
17178 ``Invalid input: 1''.
17179
6d7d248e
AD
171802001-11-12 Akim Demaille <akim@epita.fr>
17181
17182 * tests/torture.at (AT_DATA_STACK_TORTURE)
17183 (Exploding the Stack Size with Alloca)
17184 (Exploding the Stack Size with Malloc): New.
17185
e9e4c321
AD
171862001-11-12 Akim Demaille <akim@epita.fr>
17187
17188 * src/bison.simple (YYSTACK_REALLOC): New.
17189 (yyparse) [!yyoverflow]: Use it and free the old stack.
0f37a994 17190 Reported by Per Allansson.
e9e4c321 17191
5f7e0832
AD
171922001-11-12 Pascal Bart <pascal.bart@epita.fr>
17193
17194 * src/bison.simple: Define type yystype instead of YYSTYPE, and
17195 define CPP macro, which substitute YYSTYPE by yystype.
17196 * src/reader.c (parse_union_decl): Output yystype/YYSTYPE as we do
17197 with yyltype/YYLTYPE. This allows inclusion of the generated
17198 header within the parser if the compiler, such as GGC, accepts
17199 multiple equivalent #defines.
17200 From Akim.
17201
e3f1699f
AD
172022001-11-05 Akim Demaille <akim@epita.fr>
17203
17204 * src/reader.c (symbols_output): New, extracted from...
17205 (packsymbols): here.
17206 (reader): Adjust.
17207
65be0866
AD
172082001-11-05 Akim Demaille <akim@epita.fr>
17209
17210 * src/lex.c (parse_percent_token): s/quotearg/quote/.
17211
e4d910bf
AD
172122001-11-05 Akim Demaille <akim@epita.fr>
17213
17214 * tests/regression.at (AT_TEST_CPP_GUARD_H): Adjust the clean up
17215 pattern.
17216
951366c1
AD
172172001-11-05 Akim Demaille <akim@epita.fr>
17218
17219 * src/options.h (struct option_table_struct): set_flags is void*.
17220 * src/options.c (longopts): Support `--output' and `%output'.
17221 (usage): Adjust.
17222 * src/lex.h (tok_setopt): Remove, replaced with...
17223 (tok_intopt, tok_stropt): these new guys.
17224 * src/lex.c (getopt.h): Not needed.
17225 (token_buffer, unlexed_token_buffer): Not const.
17226 (percent_table): Promote `-' over `_' in directive names.
17227 Active `%name-prefix', `file-prefix', and `output'.
17228 (parse_percent_token): Accept possible arguments to directives.
17229 Promote `-' over `_' in directive names.
17230
d8988b2f
AD
172312001-11-04 Akim Demaille <akim@epita.fr>
17232
17233 * doc/bison.texinfo (Decl Summary): Split the list into
17234 `directives for grammars' and `directives for bison'.
17235 Sort'em.
17236 Add description of `%name-prefix', `file-prefix', and `output'.
17237 Promote `-' over `_' in directive names.
17238 (Bison Options): s/%locactions/%locations/. Nice Freudian slip.
17239 Simplify the description of `--name-prefix'.
17240 Promote `-' over `_' in directive names.
17241 Promote `--output' over `--output-file'.
17242 Fix the description of `--defines'.
17243 * tests/output.at: Exercise %file-prefix and %output.
17244
6468d18e
AD
172452001-11-02 Akim Demaille <akim@epita.fr>
17246
17247 * doc/refcard.tex: Update.
17248
6b7e85b9
AD
172492001-11-02 Akim Demaille <akim@epita.fr>
17250
17251 * src/symtab.h (SUNDEF): New.
17252 * src/symtab.c (bucket_new): Init user_token_number to SUNDEF to
17253 stand for `uninitialized', instead of 0.
17254 * src/reader.c (packsymbols, parse_thong_decl): Adjust.
17255 * src/lex.c (lex): Adjust.
17256
17257 * tests/calc.at (_AT_DATA_CALC_Y): Declare a token for EOF.
17258 Number it 0.
17259 Let yylex return it instead of a plain 0.
17260 Reported by Dick Streefland.
17261
cd5aafcf
AD
172622001-11-02 Akim Demaille <akim@epita.fr>
17263
17264 * tests/regression.at (Mixing %token styles): New test.
17265
037ca2f1
AD
172662001-11-02 Akim Demaille <akim@epita.fr>
17267
17268 * src/reader.c (parse_thong_decl): Formatting changes.
17269 (token_translations_init): New, extracted from...
17270 (packsymbols): Here.
17271 Adjust.
17272
270a173c
AD
172732001-11-01 Akim Demaille <akim@epita.fr>
17274
17275 * tests/regression.at (AT_TEST_CPP_GUARD_H): New.
17276 Check that `9foo.y' produces correct cpp guards.
17277 * src/files.c (compute_header_macro): Prepend `BISON_' to CPP
17278 guards.
17279 Reported by Wwp.
17280
561f9a30
AD
172812001-11-01 Akim Demaille <akim@epita.fr>
17282
17283 * tests/regression.at (Invalid input: 2): New.
17284 * src/lex.c (unlexed_token_buffer): New.
17285 (lex, unlex): Adjust: when unlexing, be sure to save token_buffer
17286 too.
17287 Reported by Wwp.
17288
f987e9d2
AD
172892001-11-01 Akim Demaille <akim@epita.fr>
17290
17291 * tests/calc.at: Catch up with 1.30.
17292 * configure.in: Bump to 1.49a.
17293 Adjust to newer Autotest.
17294
0846f581
PB
172952001-10-19 Pascal Bart <pascal.bart@epita.fr>
17296
17297 * src/conflicts.c: Move global variables rrc_total and src_total ...
17298 (print_conflicts): here.
17299 * src/output.c (output): Free global variable user_toknums.
17300 * src/lex.c (token_obstack): Become static.
17301
3c1a79b3
AD
173022001-10-18 Akim Demaille <akim@epita.fr>
17303
17304 * tests/atlocal.in (GCC): Add.
17305 * tests/calc.at: s/m4_match/m4_bmatch/.
17306 s/m4_patsubst/m4_bpatsubst/.
17307 (AT_CHECK_CALC): Check the compiler's stderr only if it's GCC.
17308 * configure.in: AC_SUBST(GCC).
17309
5d52e7d0
MA
173102001-10-14 Marc Autret <autret_m@epita.fr>
17311
17312 * src/options.c (create_long_option_table): Fix.
17313
631aa1d3
AD
173142001-10-10 Akim Demaille <akim@epita.fr>
17315
17316 * src/bison.simple: Be sure to set YYSTACK_USE_ALLOCA.
17317
f6ec6d13
AD
173182001-10-04 Akim Demaille <akim@epita.fr>
17319
17320 * src/reader.c (parse_union_decl): Push the caracters in
17321 union_obstack, not attrs_obstack.
17322
342b8b6e
AD
173232001-10-04 Akim Demaille <akim@epita.fr>
17324
17325 Merge in the branch 1.29.
17326
17327 * src/reader.c (packsymbols): Use a temporary obstack for
17328 `%%tokendef', since output_stack is already used elsewhere.
17329
17330 2001-10-02 Akim Demaille <akim@epita.fr>
17331
17332 Bump 1.29d.
17333
17334 2001-10-02 Akim Demaille <akim@epita.fr>
17335
17336 Version 1.29c.
17337
17338 2001-10-02 Akim Demaille <akim@epita.fr>
17339
17340 * tests/regression.at (Invalid CPP headers): New.
17341 From Alexander Belopolsky.
17342 * src/files.c (compute_header_macro): Map non alnum chars to `_'.
17343
17344 2001-10-02 Akim Demaille <akim@epita.fr>
17345
17346 * tests/regression.at (Invalid input): New.
17347 * src/lex.c (lex): Be sure to set `token_buffer' in any case.
17348 Reported by Shura.
17349
17350 2001-10-02 Akim Demaille <akim@epita.fr>
17351
17352 * tests/calc.at: Now that --debug works, the tests must be adjusted.
17353
17354 2001-10-02 Akim Demaille <akim@epita.fr>
17355
17356 * src/output.c (output_parser): Assert `skeleton'.
17357 * src/files.c (skeleton_find): Look harder for skeletons on DOSish
17358 systems.
17359 From Shura.
17360
17361 2001-10-01 Marc Autret <autret_m@epita.fr>
17362
17363 * src/lex.h: Echo modifications.
17364 * src/lex.c (unlex): Parameter is now token_t.
17365 From Hans Aberg.
17366
17367 2001-10-01 Marc Autret <autret_m@epita.fr>
17368
17369 * src/main.c: Include lex.h.
17370 From Hans Aberg.
17371
17372 2001-09-29 Akim Demaille <akim@epita.fr>
17373
17374 * src/getargs.c (longopts): `--debug' is `-t', not `-d'.
17375
17376 2001-09-28 Akim Demaille <akim@epita.fr>
17377
17378 * tests/testsuite.at: Update to newer Autotest.
17379 * tests/Makefile.am (EXTRA_DIST): bison is not to be shipped.
17380
17381 2001-09-27 Akim Demaille <akim@epita.fr>
17382
17383 Position independent wrapper.
17384
17385 * tests/bison: Remove.
17386 * tests/bison.in: New.
17387 * configure.in: Adjust.
17388
17389 2001-09-27 Paul Eggert <eggert@twinsun.com>
17390
17391 Port quotearg fixes from tar 1.13.24.
17392
17393 * lib/quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
17394 tm to be declared.
17395 (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
17396 (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
17397
17398 * m4/Makefile.am (EXTRA_DIST): Add mbrtowc.m4.
17399 * m4/mbrtowc.m4: New file.
17400 * m4/prereq.m4 (jm_PREREQ_QUOTEARG): Check for mbsinit and stddef.h.
17401 Use jm_FUNC_MBRTOWC instead of AC_CHECK_FUNCS(mbrtowc).
17402
17403 2001-09-27 Akim Demaille <akim@epita.fr>
17404
17405 Bump to 1.29c.
17406
17407 2001-09-27 Akim Demaille <akim@epita.fr>
17408
17409 Version 1.29b.
17410
17411 2001-09-25 Akim Demaille <akim@epita.fr>
17412
17413 * src/system.h: Include `xalloc.h'.
17414 Remove it from the C files.
17415 * src/files.c (output_files): Free the obstacks.
17416 * src/lex.c (init_lex): Rename as...
17417 (lex_init): this.
17418 (lex_free): New.
17419 * src/main.c (main): Use it.
17420
17421 2001-09-24 Marc Autret <autret_m@epita.fr>
17422
17423 * src/vcg.c (open_edge, close_edge, open_node, close_node): Change
17424 to output informations in fout (FILE*).
17425 (open_graph, close_graph): Likewise.
17426 (output_graph, output_edge, output_node): Likewise.
17427 * src/vcg.h: Update function prototypes.
17428 * src/print_graph.c (print_graph): Open output graph file.
17429 (print_actions): Adjust.
17430 * src/files.h: Remove extern declaration.
17431 * src/files.c: Remove graph_obstack declaration.
17432 (open_files): Remove graph_obstack initialization.
17433 (output_files): Remove graph_obstack saving.
17434
17435 2001-09-24 Marc Autret <autret_m@epita.fr>
17436
17437 * src/files.c (compute_output_file_names): Fix.
17438
17439 2001-09-24 Marc Autret <autret_m@epita.fr>,
17440 Akim Demaille <akim@epita.fr>
17441
17442 * src/reader.c (reader): Remove call to free_symtab ().
17443 * src/main.c (main): Call it here.
17444 Include symtab.h.
17445 * src/conflicts.c (initialize_conflicts): Rename as...
17446 (solve_conflicts): this.
17447 * src/print.c (print_core, print_actions, print_state)
17448 (print_grammar): Dump to a file instead a `output_obstack'.
17449 (print_results): Dump `output_obstack', and then proceed with the
17450 FILE *.
17451 * src/files.c (compute_output_file_names, close_files): New.
17452 (output_files): Adjust.
17453 * src/main.c (main): Adjust.
17454
17455 2001-09-23 Marc Autret <autret_m@epita.fr>
17456
17457 * src/files.c (compute_header_macro): Computes header macro name
17458 from spec_defines_file when given.
17459
17460 2001-09-23 Marc Autret <autret_m@epita.fr>
17461
17462 * src/files.c (output_files): Add default extensions.
17463
17464 2001-09-22 Akim Demaille <akim@epita.fr>
17465
17466 * src/conflicts.c (finalize_conflicts): Rename as...
17467 (free_conflicts): this.
17468
17469 2001-09-22 Akim Demaille <akim@epita.fr>
17470
17471 * src/gram.c (gram_free): Rename back as...
17472 (dummy): this.
17473 (output_token_translations): Free `token_translations'.
17474 * src/symtab.c (free_symtab): Free the tag field.
17475
17476 2001-09-22 Akim Demaille <akim@epita.fr>
17477
17478 Remove `translations' as it is always set to true.
17479
17480 * src/gram.h: Adjust.
17481 * src/reader.c (packsymbols, parse_token_decl): Adjust
17482 * src/print.c (print_grammar): Adjust.
17483 * src/output.c (output_token_translations): Adjust.
17484 * src/lex.c (lex): Adjust.
17485 * src/gram.c: Be sure the set pointers to NULL.
17486 (dummy): Rename as...
17487 (gram_free): this.
17488
17489 2001-09-22 Akim Demaille <akim@epita.fr>
17490
17491 * configure.in: Invoke AM_LIB_DMALLOC.
17492 * src/system.h: Use dmalloc.
17493 * src/LR0.c: Be sure to have pointers initialized to NULL.
17494 (allocate_itemsets): Allocate kernel_items only if needed.
17495
17496 2001-09-22 Akim Demaille <akim@epita.fr>
17497
17498 * configure.in: Bump to 1.29b.
17499 * tests/Makefile.am (DISTCLEANFILES): Add package.m4.
17500 * tests/calc.at (_AT_DATA_CALC_Y): #undef malloc so that we don't
17501 need xmalloc.c in calc.y.
17502 From Pascal Bart.
17503
17504 2001-09-21 Akim Demaille <akim@epita.fr>
17505
17506 Version 1.29a.
17507 * Makefile.maint, config/config.guess, config/config.sub,
17508 * config/missing: Update from masters.
17509 * tests/Makefile.am ($(srcdir)/$(TESTSUITE)): No longer depend
17510 upon package.m4.
17511 * configure.in (ALL_LINGUAS): Add `tr'.
17512
17513 2001-09-21 Akim Demaille <akim@epita.fr>
17514
17515 * tests/Makefile.am (package.m4): Move to...
17516 ($(srcdir)/$(TESTSUITE)): here.
17517
17518 2001-09-20 Akim Demaille <akim@epita.fr>
17519
17520 * src/complain.c: No longer try to be standalone: use system.h.
17521 Don't assume __STDC__ is defined to 1. Just test if it is defined.
17522 * src/complain.h: Likewise.
17523 * src/reduce.c (useless_nonterminals, inaccessable_symbols):
17524 Remove the unused variable `n'.
17525 From Albert Chin-A-Young.
17526
17527 2001-09-18 Marc Autret <autret_m@epita.fr>
17528
17529 * doc/bison.1: Update.
17530 * doc/bison.texinfo (Bison Options): Update --defines and --graph
17531 descriptions.
17532 (Option Cross Key): Update.
17533 Add --graph.
17534
17535 2001-09-18 Marc Autret <autret_m@epita.fr>
17536
17537 * tests/regression.at: New test (comment in %union).
17538
17539 2001-09-18 Marc Autret <autret_m@epita.fr>
17540
17541 * src/reader.c (parse_union_decl): Do not output '/'. Let copy_comment
17542 do that.
17543 Reported by Keith Browne.
17544
17545 2001-09-18 Marc Autret <autret_m@epita.fr>
17546
17547 * tests/output.at: Add tests for --defines and --graph.
17548
17549 2001-09-18 Marc Autret <autret_m@epita.fr>
17550
17551 * tests/output.at: Removes tests of %{header,src}_extension features.
17552
17553 2001-09-18 Akim Demaille <akim@epita.fr>
17554
17555 * tests/Makefile.am (package.m4): New.
17556 * tests/calc.at (_AT_CHECK_CALC): Just run `calc input'.
17557 (_AT_CHECK_CALC_ERROR): Likewise.
17558 Factor the `, ' part of verbose error messages.
17559
17560 2001-09-18 Marc Autret <autret_m@epita.fr>
17561
17562 * src/getargs.c (longopts): Declare --defines and --graph as options
17563 with optional arguments.
17564 * src/files.h: Add extern declarations.
17565 * src/files.c (spec_graph_file, spec_defines_file): New.
17566 (output_files): Update.
17567 Remove CPP-outed code.
17568
17569 2001-09-18 Marc Autret <autret_m@epita.fr>
17570
17571 Turn off %{source,header}_extension feature.
17572
17573 * src/files.c (compute_exts_from_gf): Update.
17574 (compute_exts_from_src): Update.
17575 (output_files): CPP-out useless code.
17576 * src/files.h: Remove {header,source}_extension extern declarations.
17577 * src/reader.c (parse_dquoted_param): CPP-out.
17578 (parse_header_extension_decl): Remove.
17579 (parse_source_extension_decl): Remove.
17580 (read_declarations): Remove cases tok_{hdrext,srcext}.
17581 * src/lex.c (percent_table): Remove {header,source}_extension entries.
17582 * src/lex.h (token_t): Remove tok_hdrext and tok_srcext.
17583
17584 2001-09-10 Akim Demaille <akim@epita.fr>
17585
17586 * tests/output.at (AT_CHECK_BISON_FLAGS, AT_CHECK_BISON_PERCENT):
17587 (AT_CHECK_BISON_PERCENT_FLAGS): Merge into...
17588 (AT_CHECK_OUTPUT): this.
17589 Merely check ls' exit status, its output is useless.
17590
17591 2001-09-10 Akim Demaille <akim@epita.fr>
17592
17593 * tests/calc.at: Use m4_match.
17594 (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.
17595
17596 2001-09-10 Marc Autret <autret_m@epita.fr>,
17597 Akim Demaille <akim@epita.fr>
17598
17599 * src/vcg.h (graph_s): color, textcolor, bordercolor are now
17600 enum color_e.
17601 * src/print_graph.c (print_graph): Initalize graph.layoutalgorithm
17602 to `normal'.
17603 * src/reader.c (parse_token_decl): Initialize token with tok_eof.
17604 * src/lex.h: Adjust prototype.
17605 (token_t): Add `tok_undef'.
17606 * src/lex.c (struct percent_table_struct): Retval is now a token_t.
17607 (parse_percent_token): Now returns token_t.
17608 Add default statement in switch.
17609 (lex): Separate `c' as an input variable, from the token_t result
17610 part.
17611 (unlexed): Is a token_t.
17612
17613 2001-09-10 Akim Demaille <akim@epita.fr>
17614
17615 * configure.in: Bump to 1.29a.
17616
17617 2001-09-07 Akim Demaille <akim@epita.fr>
17618
17619 Version 1.29.
17620
17621 2001-08-30 Akim Demaille <akim@epita.fr>
17622
17623 * tests/atgeneral.m4, tests/atconfig.in, tests/suite.at: Remove.
17624 * m4/atconfig.m4: Remove.
17625 * tests/testsuite.at, tests/atlocal.in, tests/output.at,
17626 * tests/bison: New.
17627 * tests/regression.at, tests/calc.at: Use m4_define, AT_BANNER,
17628 m4_if, m4_patsubst, and m4_regexp.
17629 * tests/calc.at (_AT_CHECK_CALC, _AT_CHECK_CALC_ERROR): Use an
17630 `input' file instead of echo.
17631
17632 2001-08-29 Akim Demaille <akim@epita.fr>
17633
17634 Bump to 1.28e.
17635
17636 2001-08-29 Akim Demaille <akim@epita.fr>
17637
17638 Version 1.28d.
17639
17640 2001-08-29 Paul Eggert <eggert@twinsun.com>
17641
17642 * src/bison.simple (yyparse): Don't take the address of an
17643 item before the start of an array, as that doesn't conform to
17644 the C Standard.
17645
17646 2001-08-29 Robert Anisko <anisko_r@epita.fr>
17647
17648 * doc/bison.texinfo (Location Tracking Calc): New node.
17649
17650 2001-08-29 Paul Eggert <eggert@twinsun.com>
17651
17652 * src/output.c (output): Do not define const, as this now
17653 causes more problems than it cures.
17654
17655 2001-08-29 Akim Demaille <akim@epita.fr>
17656
17657 * doc/bison.texinfo: Modernize `@node' and `@top' use: just name
17658 the nodes.
17659 Be sure to tag the `detailmenu'.
17660
17661 2001-08-29 Akim Demaille <akim@epita.fr>
17662
17663 * Makefile.maint (do-po-update): Wget refuses to overwrite files:
17664 download in a tmp dir.
17665
17666 2001-08-28 Marc Autret <autret_m@epita.fr>
17667
17668 * config/depcomp: New file.
17669
17670 2001-08-28 Marc Autret <autret_m@epita.fr>
17671
17672 * doc/bison.1 (mandoc): Adjust.
17673 From Juan Manuel Guerrero.
17674
17675 2001-08-28 Marc Autret <autret_m@epita.fr>
17676
17677 * src/print_graph.c (print_state): Fix.
17678
17679 2001-08-27 Marc Autret <autret_m@epita.fr>
17680
17681 * src/vcg.h (classname_s, infoname_s, node_s): Constify the
17682 char * members.
17683 Echo modifications to the functions prototypes.
17684 * src/vcg.c (add_classname, add_infoname): Adjust arguments.
17685
17686 2001-08-27 Marc Autret <autret_m@epita.fr>
17687
17688 * src/vcg.c: Include `xalloc.h'.
17689 (add_colorentry): New.
17690 (add_classname): New.
17691 (add_infoname): New.
17692 * src/vcg.h: Add new prototypes.
17693
17694 2001-08-27 Akim Demaille <akim@epita.fr>
17695
17696 * Makefile.maint: Sync. again with CVS Autoconf.
17697
17698 2001-08-27 Akim Demaille <akim@epita.fr>
17699
17700 * Makefile.maint: Formatting changes.
17701 (po-update, cvs-update, update): New targets.
17702 (AMTAR): Remove.
17703
17704 2001-08-27 Akim Demaille <akim@epita.fr>
17705
17706 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
17707 * Makefile.maint: Sync. with CVS Autoconf.
17708
17709 2001-08-27 Marc Autret <autret_m@epita.fr>
17710
17711 * src/vcg.h (struct infoname_s): New.
17712 (struct colorentry_s): New.
17713 (graph_s): New fields {vertical,horizontal}_order in structure.
17714 Add `infoname' field.
17715 Add `colorentry' field;
17716 * src/vcg_defaults.h (G_VERTICAL_ORDER): New.
17717 (G_HORIZONTAL_ORDER): New.
17718 (G_INFONAME): New.
17719 (G_COLORENTRY): New.
17720 * src/vcg.c (output_graph): Add output of {vertical,horizontal}_order.
17721 Add output of `infoname'.
17722 Add output of `colorentry'.
17723
17724 2001-08-27 Marc Autret <autret_m@epita.fr>
17725
17726 * src/reader.c (parse_dquoted_param): Rename variable `index' to `i'.
17727 This one shadowed a global parameter.
17728
17729 2001-08-24 Marc Autret <autret_m@epita.fr>
17730
17731 * src/print_graph.c (node_output_size): Declared POSIX `size_t' type,
17732 instead of `unsigned'.
17733 (print_state): Do not call obstack_object_size () in obstack_grow ()
17734 to avoid macro variables shadowing.
17735
17736 2001-08-23 Marc Autret <autret_m@epita.fr>
17737
17738 * src/lex.c (percent_table): Typo: s/naem/name/.
17739 Add graph option.
17740 Normalize new options declarations.
17741
17742 2001-08-20 Pascal Bart <pascal.bart@epita.fr>
17743
17744 * tests/suite.at: Exercise %header_extension and %source_extension.
17745
17746 2001-08-16 Marc Autret <autret_m@epita.fr>
17747
17748 * src/reader.c (parse_dquoted_param): New.
17749 (parse_header_extension_decl): Use it.
17750 (parse_source_extension_decl): Likewise.
17751
17752 2001-08-16 Marc Autret <autret_m@epita.fr>
17753
17754 * src/vcg.c: Remove includes of `complain.h' and `xalloc.h'.
17755 (get_xxxx_str): Use assert () instead of complain ().
17756 Remove return invokations in default cases.
17757 (get_decision_str): Modify default behaviour. Remove second argument.
17758 Echo modifications on calls.
17759 (output_graph): Fix.
17760
17761 2001-08-16 Marc Autret <autret_m@epita.fr>
17762
17763 * src/getargs.c (usage): Update with ``-g, --graph''.
17764
17765 2001-08-16 Marc Autret <autret_m@epita.fr>
17766
17767 * doc/bison.texinfo (Bison Options): Add items `-g', `--graph'.
17768 (Option Cross Key): Likewise.
17769 * doc/bison.1: Update.
17770
1c8c2190
PB
177712001-09-25 Pascal Bart <pascal.bart@epita.fr>
17772
17773 * src/output.c (output_master_parser): Don't finish action_obstack.
17774 (output_parser): Don't care about the muscle action, here.
17775 (prepare): Copy the action_obstack in the action muscle.
17776 (output): Free action_obstack.
17777
180d45ba
PB
177782001-09-23 Pascal Bart <pascal.bart@epita.fr>
17779
17780 * src/reader.c (parse_union_decl): Add new obstack union_obstack. Which
17781 will contain `%union' declaration.
17782 (parse_union_decl): Delete #line directive output.
17783 (parse_union_decl): Substitute /attrs_obstack/union_obstack for all
17784 informations about %union.
17785 (parse_union_decl): Copy the union_obstack in the muscle stype.
17786 * src/bison.simple: Add new #line directive.
17787 Add typdef %%stype YYSTYPE.
17788
c51d1a19
PB
177892001-09-23 Pascal Bart <pascal.bart@epita.fr>
17790
17791 * src/bison.simple: Add new `#line' directive.
17792
6f9344da
PB
177932001-09-22 Pascal Bart <pascal.bart@epita.fr>
17794
17795 * src/bison.simple: New `#line' directive.
17796 * src/output.c (output_parser): Support new dynamic muscle input_line.
17797
652def80
MA
177982001-09-22 Marc Autret <autret_m@epita.fr>
17799
17800 * src/output.c (output_master_parser): New.
17801 (output_parser): Be more re-entrant.
17802
25b222fa
MA
178032001-09-21 Marc Autret <autret_m@epita.fr>
17804
17805 * src/reader.c (copy_definition, parse_union_decl): Update and use
17806 `linef' muscle.
17807 (copy_action): Likewise.
17808 Use obstack_1grow ().
17809 * src/muscle_tab.c (muscle_init): Add muscle `linef'.
17810
6bc35ae5
MA
178112001-09-21 Marc Autret <autret_m@epita.fr>
17812
17813 * src/options.c (option_table): Adjust.
17814 * src/lex.c (parse_percent_token): Fix.
17815
c0629aa1
PB
178162001-09-20 Pascal Bart <pascal.bart@epita.fr>
17817
17818 * src/options.c (symtab.h): Include it, need by lex.h.
342b8b6e 17819
82b6d266
PB
178202001-09-20 Pascal Bart <pascal.bart@epita.fr>
17821
17822 * src/lex.c (parse_percent_token): Change type of variable `tx', which
17823 is now an option_table_struct*.
17824 (option_strcmp): New function option_strcmp.
17825 (parse_percent_token): Call option_strcmp.
17826 * src/getargs.c (xalloc.h, options.h): Include it.
17827 (getargs): Call create_long_option_table.
17828 (getargs): Free longopts at the end of the function.
17829 (shortopts): Move in options.c.
17830 * src/options.c (create_long_option_table): New function. Convert
17831 information from option_table to option structure.
17832 * src/reader.c (options.h): Include it.
17833
17834 * src/Makefile.am: Adjust.
17835 * src/options.c (option_table): Create from longopts and percent_table.
17836 * src/getargs.c (longopts): Delete.
17837 * src/lex.c (struct percent_table_struct): Delete.
17838 (percent_table): Delete.
17839 (options.h): Include it.
17840 * src/options.c: Create.
17841 * src/options.h: Create.
17842 Declare enum opt_access_e.
17843 Define struct option_table_struct.
17844
75f5aaea
MA
178452001-09-20 Marc Autret <autret_m@epita.fr>
17846
17847 * doc/bison.texinfo: Adjust terminologies about prologue and epilogue
17848 sections of Bison.
17849
f508cb0a
PB
178502001-09-19 Pascal Bart <pascal.bart@epita.fr>
17851
17852 * src/bison.simple: s/%%filename/%%skeleton.
17853 * src/muscle_tab.c (getargs.h): Include it.
17854 (muscle_init): Insert new muscle skeleton.
17855
13105fc1
PB
178562001-09-18 Pascal Bart <pascal.bart@epita.fr>
17857
17858 * src/output.c (output_parser): Delete unused variable actions_dumped.
17859
b0c4483e
PB
178602001-09-07 Pascal Bart <pascal.bart@epita.fr>
17861
17862 * src/output.c (output): Delete call to reader_output_yylsp.
17863 * src/reader.c (reader): Likewise.
ba0fe3c7 17864 * src/reader.h: Delete declaration of reader_output_yylsp.
342b8b6e 17865
11d82f03
MA
178662001-09-02 Marc Autret <autret_m@epita.fr>
17867
17868 * src/reader.c: Include muscle_tab.h.
17869 (parse_union_decl): Update.
17870 (parse_macro_decl): Rename parse_muscle_decl.
17871 Update to use renamed functions and variable.
17872 (read_declarations, copy_action, read_additionnal_code, : Updated
17873 with correct variables and functions names.
17874 (packsymbols, reader): Likewise.
342b8b6e 17875
11d82f03 17876 * src/reader.h (muscle_obstack): Extern declaration update.
342b8b6e 17877
11d82f03
MA
17878 * src/output.c: Include muscle_tab.h
17879 In all functions using macro_insert, change by using muscle_insert ().
17880 (macro_obstack): Rename muscle_obstack.
17881 Echo modifications in the whole file.
17882 (MACRO_INSERT_INT): Rename MUSCLE_INSERT_INT.
17883 (MACRO_INSERT_STRING): Rename MUSCLE_INSERT_STRING.
17884 (MACRO_INSERT_PREFIX): Rename MUSCLE_INSERT_PREFIX.
17885
17886 * src/muscle_tab.h: Update double inclusion macros.
17887 (macro_entry_s): Rename muscle_entry_s.
17888 Update prototypes.
342b8b6e 17889
11d82f03
MA
17890 * src/muscle_tab.c: Include muscle_tab.h.
17891 Rename macro_tabble to muscle_table.
17892 (mhash1, mhash2, mcmp): Use muscle_entry.
17893 (macro_init): Rename muscle_init. Update.
17894 (macro_insert): Rename muscle_insert. Update.
17895 (macro_find): Rename muscle_find. Update.
17896
17897 * src/main.c: Include muscle_tab.h.
17898 (main): Call muscle_init ().
17899 * src/Makefile.am (bison_SOURCES): Echo modifications.
17900
93a37297
MA
179012001-09-02 Marc Autret <autret_m@epita.fr>
17902
f753cd62 17903 Now the files macro_tab.[ch] are named muscle_tab.[ch].
342b8b6e 17904
f753cd62
MA
17905 * src/muscle_tab.c, src/muscle_tab.h: Add files.
17906
179072001-09-02 Marc Autret <autret_m@epita.fr>
17908
17909 * src/macrotab.c, src/macrotab.h: Remove.
93a37297 17910
682d48cd
PB
179112001-09-01 Pascal Bart <pascal.bart@epita.fr>
17912
342b8b6e 17913 * src/reader.c (copy_guard): Use muscle to specify the `#line'
682d48cd
PB
17914 filename.
17915
087c8fda
MA
179162001-09-01 Marc Autret <autret_m@epita.fr>
17917
17918 * tests/calc.at (exp): Now, YYERROR_VERBOSE need to be set
17919 to an explicit value to activate the feature. We do it here.
17920
dda680cb
PB
179212001-08-31 Pascal Bart <pascal.bart@epita.fr>
17922
17923 * src/output.c (prepare): Delete the `filename' muscule insertion.
17924 * src/reader.c (copy_action): Use `filename' muscule with `#line'.
17925 (parse_union_decl): Likewise.
17926 * src/macrotab.c (macro_init): Initialize filename by infile.
17927
9e644e64
MA
179282001-08-31 Marc Autret <autret_m@epita.fr>
17929
17930 * src/bison.simple (YYLSP_NEEDED): New definition.
17931 * src/output.c (prepare): Add macro insertion of `locations_flag'
17932
17da6427
PB
179332001-08-31 Pascal Bart <pascal.bart@epita.fr>
17934
17935 * src/output.c (prepare): Delete insertion of previous muscles,
17936 and insert the `prefix' muscles.
17937 * src/macrotab.c (macro_init): Likewise.
17938 (macro_init): Initialization prefix directive by `yy'.
342b8b6e 17939 * src/bison.simple: Substitute all %%yylex, %%yychar, %%yylval,
17da6427
PB
17940 %%yydebug, %%yyerror, %%yynerrs and %%yyparse by yylex, yychar,
17941 yylval, yydebug, yyerror, yynerrs and yyparse.
342b8b6e 17942 New directive `#define' to substitute yydebug, ... with option
17da6427
PB
17943 name_prefix.
17944
e8cb70b9
PB
179452001-08-31 Pascal Bart <pascal.bart@epita.fr>
17946
17947 * src/main.c (main): Standardize.
17948 * src/output.c (output_table_data, output_parser): Likewise.
17949 * src/macrotab.h, src/macrotab.c, src/bison.simple: Likewise.
17950
63c2d5de
MA
179512001-08-31 Pascal Bart <pascal.bart@epita.fr>, Marc Autret <autret_m@epita.fr>
17952
342b8b6e 17953 * src/reader.c (read_additionnal_code): Rename %%user_code to
63c2d5de
MA
17954 %%epilogue.
17955 * src/output.c (output): Rename %%declarations to %%prologue.
17956 * src/bison.simple: Echo modifications.
342b8b6e 17957
d8cb5183
MA
179582001-08-31 Marc Autret <autret_m@epita.fr>
17959
17960 * src/reader.c (readgram): CleanUp.
17961 (output_token_defines): Likewise.
17962 (packsymbols): Likewise.
17963 (reader): Likewise.
17964 * src/output.c (output): CPP-out useless code.
17965
6c686258
PB
179662001-08-31 Pascal Bart <pascal.bart@epita.fr>
17967
342b8b6e 17968 * src/reader.c (reader): Delete obsolete call to function
6c686258
PB
17969 output_trailers and output_headers.
17970 * src/output.h: Remove obsolete functions prototypes of output_headers
17971 and output_trailers.
17972
8f451ef7
PB
179732001-08-30 Pascal Bart <pascal.bart@epita.fr>
17974
17975 * src/main.c: Include macrotab.h.
342b8b6e 17976 * src/macrotab.h (macro_entry_s): Constify fields.
8f451ef7
PB
17977 Adjust functions prototypes.
17978 * src/macrotab.c (macro_insert): Constify key and value.
17979 (macro_find): Constify key.
17980 (macro_insert): Include 'xalloc.h'
17981 (macro_insert): Use XMALLOC.
17982 (macro_find): Constify return value.
17983 * src/output.c (output_table_data): Rename table to table_data.
17984 (output_parser): Constify macro_key, macro_value.
17985
997b6fd0 179862001-08-30 Marc Autret <autret_m@epita.fr>
2ba3b73c
MA
17987
17988 * src/reader.c (parse_skel_decl): New.
342b8b6e 17989 (read_declarations): Add case `tok_skel', call parse_skel_decl ().
2ba3b73c
MA
17990 * src/lex.h (token_t): New token `tok_skel'.
17991 * src/lex.c (percent_table): Add skeleton option entry.
17992 Standardize.
17993
ff48177d
MA
179942001-08-29 Marc Autret <autret_m@epita.fr>
17995
17996 * src/bison.simple: Add %%user_code directive at the end.
17997 * src/reader.c (read_additionnal_code): New.
17998 (reader): Use it.
17999 * src/output.c (output_program): Remove.
18000 (output): Update.
18001
b33160bf
MA
180022001-08-28 Marc Autret <autret_m@epita.fr>
18003
18004 * src/output.c (output_actions): Clean up.
4e5caae2 18005 (output_gram): CPP-out useless code.
b33160bf
MA
18006 * src/reader.c (reader): Clean up, CPP-out useless code.
18007
d1a2daf7
PB
180082001-08-28 Pascal Bart <pascal.bart@epita.fr>
18009
342b8b6e 18010 * src/output.c (output): Copy attrs_obstack in the '%%definitions'
535c0e75 18011 directive.
d1a2daf7
PB
18012 * src/bison.simple: Add `%%definitions'.
18013
2b763dfe
MA
180142001-08-28 Marc Autret <autret_m@epita.fr>
18015
18016 * config/depcomp: New file.
18017
f1a87ef6
PE
180182001-08-27 Paul Eggert <eggert@twinsun.com>
18019
18020 * src/bison.simple (yyparse): Don't take the address of an
18021 item before the start of an array, as that doesn't conform to
18022 the C Standard.
18023
82e236e2
RA
180242001-08-27 Robert Anisko <robert.anisko@epita.fr>
18025
f1a87ef6 18026 * src/output.c (output): Remove the initialization of the macro
82e236e2
RA
18027 obstack. It was done too late here.
18028
18029 * src/reader.c (parse_macro_decl): Fix. Use of the macro obstack was
18030 completely wrong.
18031 (reader): Initialize the macro obstack here, since we need it to grow
18032 '%define' directives.
18033
18034 * src/reader.h: Declare the macro obstack as extern.
18035
b0cfa28a
RA
180362001-08-27 Robert Anisko <robert.anisko@epita.fr>
18037
18038 * src/output.c (output_parser): Fix. Store single '%' characters in
18039 the output obstack instead of throwing them away.
18040
6fc74234
AD
180412001-08-27 Akim Demaille <akim@epita.fr>
18042
18043 * Makefile.am (AUTOMAKE_OPTIONS): 1.5.
18044
9c76d118
RA
180452001-08-25 Robert Anisko <robert.anisko@epita.fr>
18046
18047 * lib/Makefile.am: Adjust.
18048
a8289c62
RA
180492001-08-25 Robert Anisko <robert.anisko@epita.fr>
18050
18051 * src/bison.simple: Update and add '%%' directives.
18052
b6610515
RA
180532001-08-25 Robert Anisko <robert.anisko@epita.fr>
18054
18055 * src/reader.c (reader): Remove calls to 'output_headers' and
18056 'output_trailers'. Remove some C output.
18057 (readgram): Disable a piece of code that was writing a default
18058 definition for 'YYSTYPE'.
18059 (reader_output_yylsp): Remove.
18060 (packsymbols): Output token defintions to a macro.
18061 (copy_definition): Disable C output.
6fc74234 18062
b6610515
RA
18063 * src/reader.c (parse_macro_decl): New function used to parse macro
18064 declarations.
18065 (copy_string2): Put the body of copy_string into this new function.
18066 Add a parameter to let the caller choose whether he wants to copy the
18067 string delimiters or not.
18068 (copy_string): Be a simple call to copy_string2 with the last argument
18069 bound to true.
18070 (read_declarations): Add case for macro definition.
18071 (copy_identifier): New.
6fc74234 18072 (parse_macro_decl): Read macro identifiers using copy_identifier
b6610515
RA
18073 rather than lex.
18074
26f609ff
RA
180752001-08-25 Robert Anisko <robert.anisko@epita.fr>
18076
18077 * src/output.c (prepare): Add prefixed names.
18078 (output_parser): Output semantic actions.
18079 (output_parser): Fix bug on '%%line' directives.
6fc74234 18080
26f609ff
RA
18081 * src/output.c (output_headers): Remove. The C code printed by this
18082 function should now be in the skeletons.
18083 (output_trailers): Remove.
18084 (output): Disable call to 'reader_output_yylsp'.
18085 (output_rule_data): Do not output tables to the table obstack.
18086
18087 * src/output.c: Remove some C dedicated output.
18088 Improve the use of macro and output obstacks.
18089 (output_defines): Remove.
6fc74234 18090
26f609ff
RA
18091 * src/output.c (output_token_translations): Associate 'translate'
18092 table with a macro. No output to the table obstack.
18093 (output_gram): Same for 'rhs' and 'prhs'.
18094 (output_stos): Same for 'stos'.
18095 (output_rule_data): Same for 'r1' and 'r2'.
18096 (token_actions): Same for 'defact'.
18097 (goto_actions): Same for 'defgoto'.
18098 (output_base): Same for 'pact' and 'pgoto'.
18099 (output_table): Same for 'table'.
18100 (output_check): Same for 'check'.
6fc74234 18101
26f609ff
RA
18102 * src/output.c (output_table_data): New function.
18103 (output_short_table): Remove.
18104 (output_short_or_char_table): Remove.
6fc74234 18105
26f609ff
RA
18106 * src/output.c (output_parser): Replace most of the skeleton copy code
18107 with something new. Skeletons are now processed character by character
18108 rather than line by line, and Bison looks for '%%' macros. This is the
18109 first step in making Bison's output process (a lot) more flexible.
18110 (output_parser): Use the macro table.
18111
6f43b113
RA
181122001-08-25 Robert Anisko <robert.anisko@epita.fr>
18113
18114 * src/main.c (main): Initialize the macro table.
18115
dd3127cf
RA
181162001-08-25 Robert Anisko <robert.anisko@epita.fr>
18117
18118 * src/lex.c (percent_table): Add tok_define.
18119 * src/lex.h: Add tok_define.
18120
aa321494
RA
181212001-08-25 Robert Anisko <robert.anisko@epita.fr>
18122
18123 * src/macrotab.c: New file.
18124 * src/macrotab.h: New file.
18125 * src/Makefile.am: Update.
18126
68bd3b6b
RA
181272001-08-25 Robert Anisko <robert.anisko@epita.fr>
18128
18129 * lib/hash.c: New file.
18130 * lib/hash.h: New file.
18131 * lib/Makefile.am: Update.
18132
45f8dd1e
AD
181332001-08-15 Akim Demaille <akim@epita.fr>
18134
18135 Version 1.28c.
18136
40a64a7a 181372001-08-15 Marc Autret <autret_m@epita.fr>
0b8afb77
AD
18138
18139 * src/reader.c (readgram): Indent output macro YYSTYPE.
18140 (packsymbols): Likewise.
18141 (output_token_defines): Likewise.
18142 * src/files.c: Standardize.
18143 (compute_header_macro): New.
18144 (defines_obstack_save): New. Use compute_header_macro.
18145 (output_files): Update. Use defines_obstack_save.
18146
f9a8293a
AD
181472001-08-15 Akim Demaille <akim@epita.fr>
18148
18149 * doc/bison.texinfo (Table of Symbols): Document
18150 YYSTACK_USE_ALLOCA.
18151
150ca7a7
AD
181522001-08-15 Akim Demaille <akim@epita.fr>
18153
18154 * missing: Update from CVS Automake.
18155 * config/config.guess, config/config.sub, config/texinfo.tex:
18156 Update from gnu.org.
18157
69b5cec4
AD
181582001-08-15 Akim Demaille <akim@epita.fr>
18159
18160 * Makefile.maint: Sync with CVS Autoconf.
18161
f2b5126e
PB
181622001-08-14 Pascal Bart <pascal.bart@epita.fr>
18163
69b5cec4 18164 * doc/bison.texinfo: Include GNU Free Documentation License from
f2b5126e
PB
18165 `fdl.texi'.
18166 * doc/fdl.texi: Add to package.
18167
4ecbf796
MA
181682001-08-14 Marc Autret <autret_m@epita.fr>
18169
18170 Turn on %{source,header}_extension features.
18171
69b5cec4 18172 * src/lex.c (percent_table): Un-CPP out header_extension and
4ecbf796
MA
18173 source_extension.
18174 * src/files.c (compute_exts_from_gf): Compare pointers with NULL.
69b5cec4 18175 (compute_exts_from_src): Remove conditions. It restores priorities
4ecbf796
MA
18176 between options.
18177
95fb5662
MA
181782001-08-14 Marc Autret <autret_m@epita.fr>
18179
18180 * src/files.c (compute_base_names): Add extensions computing when
18181 `--file-prefix' used.
18182 Standardize function calls.
18183
78d09da9
MA
181842001-08-13 Marc Autret <autret_m@epita.fr>
18185
69b5cec4 18186 * src/bison.simple (YYSTACK_USE_ALLOCA): Changed to allow users
78d09da9
MA
18187 defining it (defined but null disables alloca).
18188
5a009f2c
MA
181892001-08-13 Marc Autret <autret_m@epita.fr>
18190
18191 * src/bison.simple (_yy_memcpy): CPP reformat.
18192
1e41465a
PB
181932001-08-13 Pascal Bart <pascal.bart@epita.fr>
18194
18195 * tests/atconfig.in (CPPFLAGS): Fix.
18196
c67a198d
PB
181972001-08-10 Pascal Bart <pascal.bart@epita.fr>
18198
79282c6c 18199 * doc/bison.texinfo: Include GNU General Public License from
c67a198d
PB
18200 `gpl.texi'.
18201 * doc/gpl.texi: Add to package.
18202
09a6de7e
MA
182032001-08-10 Marc Autret <autret_m@epita.fr>
18204
18205 * src/print_graph.h: Fix.
18206 * src/reader.c (read_declarations): Use parse_header_extension_decl ().
18207
b77b9ee0
AD
182082001-08-10 Akim Demaille <akim@epita.fr>
18209
18210 * src/system.h: Provide default declarations for stpcpy, strndup,
18211 and strnlen.
18212
3e259915
MA
182132001-08-10 Robert Anisko <anisko_r@epita.fr>
18214
18215 * doc/bison.texinfo (Locations): Update @$ stuff.
18216
ca96bc2d
MA
182172001-08-09 Robert Anisko <anisko_r@epita.fr>
18218
18219 * src/bison.simple (YYLLOC_DEFAULT): Update.
18220 (yyparse): Adjust.
18221
fdc6758b
MA
182222001-08-08 Marc Autret <autret_m@epita.fr>
18223
b77b9ee0 18224 * doc/bison.texinfo: Change @samp{$<@dots{}>} to
fdc6758b
MA
18225 @samp{$<@dots{}>@var{n}} in Section Actions in Mid-Rule.
18226 Reported by Fabrice Bauzac.
957d4dbf 18227
600cad3b
MA
182282001-08-08 Marc Autret <autret_m@epita.fr>
18229
18230 * src/vcg_default.h: Use NULL instead of 0 to initialize pointers.
18231 * src/vcg.c (output_node): Fix.
18232 * src/vcg.h: Cleanup.
18233 * src/print_graph.c: Add comments.
b77b9ee0 18234 (node_output_size): New global variable. Simplify the formatting of
600cad3b 18235 the VCG graph output.
b77b9ee0 18236 (print_actions): Unused code is now used. It notifies the final state
600cad3b 18237 and no action states in the VCG graph. It also give the reduce actions.
b77b9ee0 18238 The `shift and goto' edges are red and the `go to state' edges are
600cad3b
MA
18239 blue.
18240 Get the current node name and node_obstack by argument.
18241 (node_obstack): New variable.
18242 (print_state): Manage node_obstack.
18243 (print_core): Use node_obstack given by argument.
18244 A node is not only computed here but in print_actions also.
18245 (print_graph): CPP out useless code instead of commenting it.
18246
976e528f
AD
182472001-08-07 Pascal Bart <pascal.bart@epita.fr>
18248
18249 * tests/atconfig.in (CPPFLAGS): Fix.
18250
20e8e5ca
AD
182512001-08-07 Akim Demaille <akim@epita.fr>
18252
18253 * src/print_graph.c (quote): New.
18254 (print_core): Use it.
18255
957d4dbf 182562001-08-06 Akim Demaille <akim@epita.fr>, Marc Autret <autret_m@epita.fr>
3e3da797 18257
3e3da797
AD
18258 * src/vcg.c (complain.h): Include it.
18259 Unepitaize `return' invocations.
c4b66126 18260 [NDEBUG] (main): Remove.
79282c6c 18261 * src/vcg.h (node_t, edge_t, graph_t): Constify the char * members.
c4b66126
AD
18262 * src/files.c (open_files): Initialize graph_obstack.
18263 * src/print_graph.c (print_actions): CPP out useless code.
18264 (print_core): Don't output the last `\n' in labels.
18265 Use `quote'.
18266 * src/files.c (output_files): Output the VCG file.
18267 * src/main.c (main): Invoke print_graph ();
3e3da797 18268
957d4dbf 182692001-08-06 Marc Autret <autret_m@epita.fr>
22c2cbc0
AD
18270
18271 Automaton VCG graph output.
18272 Using option ``-g'' or long option ``--graph'', you can generate
18273 a gram_filename.vcg file containing a VCG description of the LALR (1)
18274 automaton of your grammar.
18275
18276 * src/main.c: Call to print_graph() function.
18277 * src/getargs.h: Update.
18278 * src/getargs.c (options): Update to catch `-g' and `--graph' options.
18279 (graph_flag): New flag.
18280 (longopts): Update.
18281 (getargs): Add case `g'.
18282 * src/files.c (graph_obstack): New obstack struct.
18283 (open_files): Initialize new obstack.
18284 (output_files): Saves graph_obstack if required.
18285 * src/files.h (graph_obstack): New extern declaration.
18286 * src/Makefile.am: Add new source files.
18287
927c1557 182882001-08-06 Marc Autret <autret_m@epita.fr>
ce4d5ce0
AD
18289
18290 * src/print_graph.c, src/print_graph.h (graph): New.
18291 * src/vcg.h: New file.
18292 * src/vcg.c: New file, VCG graph handling.
18293
7333d403
AD
182942001-08-06 Marc Autret <autret_m@epita.fr>
18295
18296 Add of %source_extension and %header_extension which specify
18297 the source or/and the header output file extension.
18298
18299 * src/files.c (compute_base_names): Remove initialisation of
18300 src_extension and header_extension.
18301 (compute_exts_from_gf): Update.
18302 (compute_exts_from_src): Update.
18303 (output_files): Update.
18304 * src/reader.c (parse_header_extension_decl): New.
18305 (parse_source_extension_decl): New.
18306 (read_declarations): New case statements for the new tokens.
18307 * src/lex.c (percent_table): Add entries for %source_extension
18308 and %header_extension.
18309 * src/lex.h (token_e): New tokens tok_hdrext and tok_srcext.
18310
84163231
AD
183112001-08-06 Marc Autret <autret_m@epita.fr>
18312
18313 * configure.in: Bump to 1.28c.
18314 * doc/bison.texinfo: Texinfo thingies.
18315
8303fc42
AD
183162001-08-04 Pascal Bart <pascal.bart@epita.fr>
18317
18318 * tests/atconfig.in (CPPFLAGS): Add.
18319 * tests/calc.at (AT_CHECK): Use CPPFLAGS.
18320
70a84437
AD
183212001-08-03 Akim Demaille <akim@epita.fr>
18322
18323 Version 1.28b.
18324
2ce10144
AD
183252001-08-03 Akim Demaille <akim@epita.fr>
18326
18327 * tests/Makefile.am (check-local): Ship testsuite.
18328 * tests/calc.at (_AT_DATA_CALC_Y): Prototype all the functions.
18329 Include `string.h'.
18330
1e3e4bc1
AD
183312001-08-03 Akim Demaille <akim@epita.fr>
18332
18333 * configure.in: Try using -Wformat when compiling.
18334
42b45b7f
AD
183352001-08-03 Akim Demaille <akim@epita.fr>
18336
18337 * configure.in: Bump to 1.28b.
18338
8f13fe33
AD
183392001-08-03 Akim Demaille <akim@epita.fr>
18340
18341 * src/complain.c: Adjust strerror_r portability issues.
18342
b37ba92c
AD
183432001-08-03 Akim Demaille <akim@epita.fr>
18344
18345 Version 1.28a.
18346
b0ce6046
AD
183472001-08-03 Akim Demaille <akim@epita.fr>
18348
18349 * src/getargs.c, src/getarg.h (skeleton)): Constify.
18350 * src/lex.c (literalchar): Avoid name clashes on `buf'.
18351 * src/getargs.c: Include complain.h.
18352 * src/files.c, src/files.h (skeleton_find): Avoid name clashes.
18353 * lib/quotearg.c, lib/quotearg.h: Update from fileutils 4.1.
18354
d01c415b
AD
183552001-08-03 Akim Demaille <akim@epita.fr>
18356
18357 * src/reader.c (readgram): Display hidden chars in error messages.
18358
459dd1a6
AD
183592001-08-03 Akim Demaille <akim@epita.fr>
18360
18361 Update to gettext 0.10.39.
18362
53b74c0c
AD
183632001-08-03 Akim Demaille <akim@epita.fr>
18364
18365 * lib/strspn.c: New.
18366
234a3be3
AD
183672001-08-01 Marc Autret <autret_m@epita.fr>
18368
18369 * doc/bison.texinfo: Update.
18370 * doc/bison.1 (mandoc): Update.
18371 * src/system.h (EXT_GUARD_C, EXT_STYPE_H): Remove .c and .h.
18372 * src/files.c: Support output files extensions computing.
18373 (src_extension): New static variable.
18374 (header_extension): New static variable.
18375 (tr): New function.
18376 (get_extension_index): New function, gets the index of an extension
18377 filename in a string.
18378 (compute_exts_from_gf): New function, computes extensions from the
18379 grammar file extension.
18380 (compute_exts_from_src): New functions, computes extensions from the
18381 C source file extension, file given by ``-o'' option.
18382 (compute_base_names): Update.
18383 (output_files): Update.
18384
847bf1f5
AD
183852001-08-01 Robert Anisko <anisko_r@epita.fr>
18386
d995fee7 18387 * doc/bison.texi: Document @$.
847bf1f5
AD
18388 (Locations): New section.
18389
d074a105
AD
183902001-07-18 Akim Demaille <akim@epita.fr>
18391
18392 * Makefile.maint, GNUmakefile: New, from Autoconf 2.52.
18393 * config/prev-version.txt, config/move-if-change: New.
18394 * Makefile.am: Adjust.
18395
3419715d
AD
183962001-07-08 Pascal Bart <pascal.bart@epita.fr>
18397
18398 * src/bison.simple (yyparse): Suppress warning `comparaison
18399 between signed and unsigned'.
18400
62ab6972
AD
184012001-07-05 Pascal Bart <pascal.bart@epita.fr>
18402
18403 * src/getargs.h (raw_flag): Remove.
18404 * src/getargs.c: Die on `-r'/`--raw'.
18405 * src/lex.c (parse_percent_token): Die on `%raw'.
18406 * src/reader.c (output_token_defines): Suppress call to `raw_flag'.
18407 * tests/calc.at: Suppress test with option `--raw'.
18408
1e24cc5b
AD
184092001-07-14 Akim Demaille <akim@epita.fr>
18410
18411 * config/: New.
18412 * configure.in: Require Autoconf 2.50.
18413 Update to gettext 0.10.38.
18414
32dfccf8
AD
184152001-03-16 Akim Demaille <akim@epita.fr>
18416
18417 * doc/bison.texinfo: ANSIfy the examples.
18418
cd5bd6ac
AD
184192001-03-16 Akim Demaille <akim@epita.fr>
18420
18421 * getargs.c (skeleton): New variable.
18422 (longopts): --skeleton is a new option.
18423 (shortopts, getargs): -S is a new option.
18424 * getargs.h: Declare skeleton.
18425 * output.c (output_parser): Use it.
18426
5141b016
AD
184272001-03-16 Akim Demaille <akim@epita.fr>
18428
18429 * m4/strerror_r.m4: New.
18430 * m4/error.m4: Run AC_FUNC_STRERROR_R.
18431 * lib/error.h, lib/error.c: Update.
18432
447992b9
AD
184332001-03-16 Akim Demaille <akim@epita.fr>
18434
18435 * src/getargs.c (longopts): Clean up.
18436
274d42ce
AD
184372001-02-21 Akim Demaille <akim@epita.fr>
18438
18439 * src/reader.c (gensym): `gensym_count' is your own.
18440 Use a static buf to create the symbol name, as token_buffer is no
18441 longer a buffer.
18442
22c821f3
AD
184432001-02-08 Akim Demaille <akim@epita.fr>
18444
18445 * src/conflicts.c (conflict_report): Be sure not to append to res
18446 between two calls, which could happen if both first sprintf were
18447 skipped, but not the first cp += strlen.
18448
18569462
AD
184492001-02-08 Akim Demaille <akim@epita.fr>
18450
18451 * lib/memchr.c, lib/stpcpy.c, lib/strndup.c, lib/strnlen.c:
18452 New, from fileutils 4.0.37.
18453 * configure.in: Require Autoconf 2.49c. I took some time before
18454 making this decision. This is the only way out for portability
18455 issues in Bison, it would mean way too much duplicate effort to
18456 import in Bison features implemented in 2.49c since 2.13.
18457 AC_REPLACE_FUNCS and AC_CHECK_DECLS the functions above.
18458
0d8f3c8a
AD
184592001-02-02 Akim Demaille <akim@epita.fr>
18460
18461 * lib/malloc.c, lib/realloc.c: New, from the fileutils 4.0.37.
66075dcf 18462 * lib/xalloc.h, lib/xmalloc.c: Update.
0d8f3c8a 18463
f17bcd1f
AD
184642001-01-19 Akim Demaille <akim@epita.fr>
18465
18466 Get rid of the ad hoc handling of token_buffer in the scanner: use
18467 the obstacks.
18468
18469 * src/lex.c (token_obstack): New.
18470 (init_lex): Initialize it. No longer call...
18471 (grow_token_buffer): this. Remove it.
18472 Adjust all the places which used it to use the obstack.
18473
511e79b3
AD
184742001-01-19 Akim Demaille <akim@epita.fr>
18475
18476 * src/lex.h: Rename all the tokens:
18477 s/\bENDFILE\b/tok_eof/g;
18478 s/\bIDENTIFIER\b/tok_identifier/g;
18479 etc.
18480 Let them be enums, not #define, to ease debugging.
18481 Adjust all the code.
18482
0d6508ef
AD
184832001-01-18 Akim Demaille <akim@epita.fr>
18484
18485 * src/lex.h (MAXTOKEN, maxtoken, grow_token_buffer): Remove, private.
18486 * src/lex.c (maxtoken, grow_token_buffer): Static.
18487
6deb4447
AD
184882001-01-18 Akim Demaille <akim@epita.fr>
18489
18490 Since we now use obstacks, more % directives can be enabled.
18491
18492 * src/lex.c (percent_table): Also accept `%yacc',
18493 `%fixed_output_files', `%defines', `%no_parser', `%verbose', and
18494 `%debug'.
18495 Handle the actions for `%semantic_parser' and `%pure_parser' here,
18496 instead of returning a token.
18497 * src/lex.h (SEMANTIC_PARSER, PURE_PARSER): Remove, unused.
18498 * src/reader.c (read_declarations): Adjust.
18499 * src/files.c (open_files): Don't call `compute_base_names', don't
18500 compute `attrsfile' since they depend upon data which might be
18501 *in* the input file now.
18502 (output_files): Do it here.
18503 * src/output.c (output_headers): Document the fact that this patch
18504 introduces a guaranteed SEGV for semantic parsers.
18505 * doc/bison.texinfo: Document them.
18506 * tests/suite.at: Exercise these %options.
18507
ff4423cc
AD
185082000-12-20 Akim Demaille <akim@epita.fr>
18509
18510 Also handle the output file (--verbose) with obstacks.
18511
18512 * files.c (foutput): Remove.
18513 (output_obstack): New.
18514 Adjust all dependencies.
18515 * src/conflicts.c: Return a string.
18516 * src/system.h (obstack_grow_string): Rename as...
18517 (obstack_sgrow): this. Be ready to work with non literals.
18518 (obstack_fgrow4): New.
18519
956dba3a
AD
185202000-12-20 Akim Demaille <akim@epita.fr>
18521
18522 * src/files.c (open_files): Fix the computation of short_base_name
18523 in the case of `-o foo.tab.c'.
18524
337bab46
AD
185252000-12-20 Akim Demaille <akim@epita.fr>
18526
18527 * src/reader.c (copy_string, copy_comment, copy_comment2, copy_at)
18528 (copy_dollar): Now that everything uses obstacks, get rid of the
18529 FILE * parameters.
18530
5d3214b8
AD
185312000-12-20 Akim Demaille <akim@epita.fr>
18532
18533 * src/files.c (open_files): Actually the `.output' file is based
18534 on the short_base_name, not base_name.
18535 * tests/suite.at (Checking output file names): Adjust.
18536
29092a57
AD
185372000-12-20 Akim Demaille <akim@epita.fr>
18538
18539 * src/bison.s1: Remove, we now use directly...
18540 * src/bison.simple: this.
18541 * src/Makefile.am: Use pkgdata instead of data.
18542
ea5607fd
AD
185432000-12-20 Akim Demaille <akim@epita.fr>
18544
18545 * src/files.c (guard_obstack): New.
18546 (open_files): Initialize it.
18547 (output_files): Dump it...
18548 * src/files.h: Export it.
18549 * src/reader.c (copy_guard): Use it.
18550
27110317
AD
185512000-12-19 Akim Demaille <akim@epita.fr>
18552
18553 * src/files.c (outfile, defsfile, actfile): Removed as global
18554 vars.
18555 (open_files): Don't compute them.
18556 (output_files): Adjust.
18557 (base_name, short_base_name): Be global.
18558 Adjust dependencies.
18559
19c50364
AD
185602000-12-19 Akim Demaille <akim@epita.fr>
18561
18562 * src/files.c (strsuffix): New.
18563 (stringappend): Be just like strcat but allocate.
18564 (base_names): Eve out from open_files.
18565 Try to simplify the rather hairy computation of base_name and
18566 short_base_name.
18567 (open_files): Use it.
18568 * tests/suite.at (Checking output file names): New test.
18569
573c1d9f
AD
185702000-12-19 Akim Demaille <akim@epita.fr>
18571
18572 * src/system.h (obstack_grow_literal_string): Rename as...
18573 (obstack_grow_string): this.
18574 * src/output.c (output_parser): Recognize `%% actions' instead of
18575 `$'.
18576 * src/bison.s1: s/$/%% actions/.
18577 * src/bison.hairy: Likewise.
18578
ef7ddedd
AD
185792000-12-19 Akim Demaille <akim@epita.fr>
18580
18581 * src/output.c (output_parser): Compute the `#line' lines when
18582 there are.
18583 * src/Makefile.am (bison.simple): Be a simple copy of bison.s1.
18584 Suggested by Hans Aberg.
18585
ff61dabd
AD
185862000-12-19 Akim Demaille <akim@epita.fr>
18587
18588 Let the handling of the skeleton files be local to the procedures
18589 that use it.
18590
18591 * src/files.c (xfopen, xfclose, skeleton_find, guardfile): No
18592 longer static.
18593 (fparser, open_extra_files): Remove.
18594 (open_files, output_files): Don't take care of fparser.
18595 * src/files.h: Adjust.
18596 * src/output.c (output_parser): Open and close the file to the
18597 skeleton.
18598 * src/reader.c (read_declarations): When %semantic_parser, open
18599 fguard.
18600
55b96341
AD
186012000-12-19 Akim Demaille <akim@epita.fr>
18602
18603 * src/file.h (BISON_SIMPLE, BISON_HAIRY): Move from here...
18604 * src/system.h (BISON_SIMPLE, BISON_HAIRY): ... to here.
18605
358c15b7
AD
186062000-12-19 Akim Demaille <akim@epita.fr>
18607
18608 * src/files.c (open_files): Yipee! We no longer need all the code
18609 looking for `/tmp' since we have no tmp file.
18610
7de3329e
AD
186112000-12-19 Akim Demaille <akim@epita.fr>
18612
18613 * src/system.h (EXT_TAB, EXT_OUTPUT, EXT_STYPE_H, EXT_GUARD_C):
18614 New macros.
18615 * src/files.c (open_files): Less dependency on MSDOS etc.
18616
3abcd459
AD
186172000-12-14 Akim Demaille <akim@epita.fr>
18618
18619 * src/bison.s1 (YYLLOC_DEFAULT): New macro.
18620 Provide a default definition.
18621 Use it when executing the default @ action.
18622 * src/reader.c (reader_output_yylsp): No longer include
18623 `timestamp' and `text' in the default YYLTYPE.
18624
2a91a95e
AD
186252000-12-12 Akim Demaille <akim@epita.fr>
18626
18627 * src/reader.c (copy_definition, parse_union_decl, copy_action)
18628 (copy_guard): Quote the file names.
18629 Reported by Laurent Mascherpa.
18630
14d3eb9b
AD
186312000-12-12 Akim Demaille <akim@epita.fr>
18632
18633 * src/output.c (output_headers, output_program, output): Be sure
18634 to escape special characters when outputting filenames.
18635 (ACTSTR_PROLOGUE, ACTSTR_EPILOGUE): Remove.
18636 (output_headers): Don't depend on them, Use ACTSTR.
18637
d7045ec6
AD
186382000-11-17 Akim Demaille <akim@epita.fr>
18639
18640 * lib/obstack.h: Formatting changes.
18641 (obstack_grow, obstack_grow0): Don't cast WHERE at all: it
18642 prevents type checking.
18643 (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
18644 cast the value to (void *): assigning a `foo *' to a `void *'
18645 variable is valid.
18646 (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
18647 * src/reader.c (parse_union_decl): Typo: use obstack_1grow to
18648 append characters.
18649
6fd54b73
AD
186502000-11-17 Akim Demaille <akim@epita.fr>
18651
18652 * tests/Makefile.am (suite.m4, regression.m4, calc.m4): Rename
18653 as...
18654 (suite.m4, regression.m4, calc.m4): these.
18655 * tests/atgeneral.m4: Update from CVS Autoconf.
18656
4c50eae6
AD
186572000-11-17 Akim Demaille <akim@epita.fr>
18658
18659 * tests/regression.m4 (%union and --defines): New test,
18660 demonstrating a current bug in the obstack implementation.
18661
a35f64ea
AD
186622000-11-17 Akim Demaille <akim@epita.fr>
18663
18664 * src/bison.s1 (_YY_DECL_VARIABLES, YY_DECL_VARIABLES): New
18665 macros.
18666 Use them to declare the variables which are global or local to
18667 `yyparse'.
18668
7de23534
AD
186692000-11-17 Akim Demaille <akim@epita.fr>
18670
18671 * acconfig.h: Remove, no longer used.
18672
aa7815f5
AD
186732000-11-07 Akim Demaille <akim@epita.fr>
18674
18675 * src: s/Copyright (C)/Copyright/g.
18676
5af1f549
AD
186772000-11-07 Akim Demaille <akim@epita.fr>
18678
18679 * src/reader.c (reader): #define YYLSP_NEEDED to 1 instead of just
18680 defining.
18681 * src/bison.s1: s/#ifdef YYLSP_NEEDED/#if YYLSP_NEEDED/.
18682
553e2b22
AD
186832000-11-07 Akim Demaille <akim@epita.fr>
18684
18685 * src/bison.s1 (YYLEX): Use #if instead of #ifdef.
18686 Merge in a single CPP if/else.
18687
8a4f41d6
AD
186882000-11-07 Akim Demaille <akim@epita.fr>
18689
18690 * src/output.c (output): Remove useless variables.
18691 * lib/obstack.c (obstack_grow, obstack_grow0): Rename the second
18692 argument `data' for consistency with the prototypes.
18693 Qualify it `const'.
18694 (obstack_copy, obstack_copy0): Rename the second argument as
18695 `address' for consistency. Qualify it `const'.
18696 * lib/obstack.h (obstack_copy, obstack_copy0, obstack_grow)
18697 (obstack_grow0, obstack_ptr_grow, obstack_ptr_grow_fast): Qualify
18698 `const' their input argument (`data' or `address').
18699 Adjust the corresponding macros to include `const' in casts.
18700
095a3fb5
AD
187012000-11-03 Akim Demaille <akim@epita.fr>
18702
18703 * src/Makefile.am (INCLUDES): s/PFILE/BISON_SIMPLE/.
18704 s/PFILE1/BISON_HAIRY/.
18705 Adjust dependencies.
18706
d1cdce7c
AD
187072000-11-03 Akim Demaille <akim@epita.fr>
18708
090c5ebf 18709 For some reason, this was not applied.
d1cdce7c
AD
18710
18711 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18712 `unlink': it's no longer used.
18713
9311529b
AD
187142000-11-03 Akim Demaille <akim@epita.fr>
18715
18716 * src/files.c (skeleton_find): New function, eved out of...
18717 (open_files, open_extra_files): here.
18718
d8880f69
AD
187192000-11-03 Akim Demaille <akim@epita.fr>
18720
18721 Don't use `atexit'.
18722
18723 * src/files.c (obstack_save): New function.
18724 (done): Rename as...
18725 (output_files): this.
18726 Use `obstack_save'.
18727 * src/main.c (main): Don't use `atexit' to register `done', since
18728 it no longer has to remove tmp files, just call `output_files'
18729 when there are no errors.
18730
0dbb648e
AD
187312000-11-02 Akim Demaille <akim@epita.fr>
18732
18733 * src/files.c [VMS]: No longer include `ssdef.h', no longer define
18734 `unlink': it's no longer used.
18735 * src/files.h: Formatting changes.
18736
896fe5c1
AD
187372000-11-02 Akim Demaille <akim@epita.fr>
18738
18739 Remove the last uses of mktemp and unlink/delete.
18740
18741 * src/files.c (fdefines, ftable): Removed.
18742 (defines_ostack, table_obstack): New.
18743 Adjust dependencies of the former into uses of the latter.
18744 * src/output.c (output_short_or_char_table, output_short_table):
18745 Convert to using obstacks.
18746 * src/reader.c (copy_comment2): Accept one FILE * and two
18747 obstacks.
18748 (output_token_defines, reader_output_yylsp): Use obstacks.
18749 * src/system.h (obstack_fgrow3): New.
1f65350a 18750 * po/POTFILES.in: Adjust.
896fe5c1 18751
dd60faec
AD
187522000-11-01 Akim Demaille <akim@epita.fr>
18753
18754 Change each use of `fattrs' into a use of `attrs_obstack'.
18755
18756 * src/reader.c (copy_at): Typo: s/yylloc/yyloc/.
18757 * src/files.c (fattrs): Remove.
18758 (attrs_obstack): New.
18759 Adjust all dependencies.
18760 (done): If SEMANTIC_PARSER, dump attrs_obstack into attrsfile.
18761
8c7ebe49
AD
187622000-11-01 Akim Demaille <akim@epita.fr>
18763
18764 Introduce obstacks.
18765 Change each use of `faction' into a use of `action_obstack'.
18766
18767 * lib/obstack.h, lib/obstack.c: New files.
18768 * src/files.c (faction): Remove.
18769 (action_obstack): New.
18770 Adjust all dependencies.
18771
77aee789
AD
187722000-10-20 Akim Demaille <akim@epita.fr>
18773
18774 * lib/quote.h (PARAMS): New macro. Use it.
18775
43591cec
AD
187762000-10-16 Akim Demaille <akim@epita.fr>
18777
18778 * src/output.c (output_short_or_char_table): New function.
18779 (output_short_table, output_token_translations): Use it.
18780 (goto_actions): Use output_short_table.
18781
1e9798d5
AD
187822000-10-16 Akim Demaille <akim@epita.fr>
18783
18784 * src/symtab.c (bucket_new): New function.
18785 (getsym): Use it.
18786
18787 * src/output.c (output_short_table): New argument to display the
18788 comment associated with the table.
18789 Adjust dependencies.
18790 (output_gram): Use it.
18791 (output_rule_data): Nicer output layout for YYTNAME.
18792
f282676b
AD
187932000-10-16 Akim Demaille <akim@epita.fr>
18794
18795 * src/lex.c (read_typename): New function.
18796 (lex): Use it.
18797 * src/reader.c (copy_dollar): Likewise.
18798
550a72a3
AD
187992000-10-16 Akim Demaille <akim@epita.fr>
18800
18801 * src/reader.c (copy_comment2): Expect the input stream to be on
18802 the `/' which is suspected to open a comment, instead of being
18803 called after `//' or `/*' was read.
18804 (copy_comment, copy_definition, parse_union_decl, copy_action)
18805 (copy_guard): Adjust.
18806
131e2fef
AD
188072000-10-16 Akim Demaille <akim@epita.fr>
18808
18809 * src/reader.c (parse_expect_decl): Use `skip_white_space' and
18810 `read_signed_integer'.
18811
79282c5a
AD
188122000-10-16 Akim Demaille <akim@epita.fr>
18813
18814 * src/reader.c (copy_dollar): New function.
18815 (copy_guard, copy_action): Use it.
18816
ff4a34be
AD
188172000-10-16 Akim Demaille <akim@epita.fr>
18818
18819 * lib/quote.h, lib/quote.c, lib/quotearg.h, lib/quotearg.c:
18820 * m4/prereq.m4, m4/c-bs-a.m4, m4/mbstate.m4:
18821 New files, from Fileutils 4.0.27.
18822 * src/main.c (printable_version): Remove.
18823 * src/lex.c, src/reader.c: Use `quote'.
18824
188252000-10-04 Akim Demaille <akim@epita.fr>
18826
18827 * lib/error.c, lib/error.h: New files, needed by xmalloc.c.
18828
14ded682
AD
188292000-10-04 Akim Demaille <akim@epita.fr>
18830
18831 * doc/bison.texinfo: Various typos spotted by Neil Booth.
18832
8e03724b
AD
188332000-10-04 Akim Demaille <akim@epita.fr>
18834
18835 When a literal string is used to define two different tokens,
18836 `bison -v' segfaults.
18837 Reported by Piotr Gackiewicz, and fixed by Neil Booth.
18838
18839 * tests/regression.m4: New file.
18840 Include the core of the sample provided by Piotr Gackiewicz.
18841 * src/reader.c (parse_token_decl): Diagnose bad cases, and proceed
18842 properly.
18843
a9e64249
AD
188442000-10-04 Akim Demaille <akim@epita.fr>
18845
18846 * src/reader.c (parse_expect_decl): Keep `count' within the size
18847 of `buffer'.
18848 From Neil Booth.
18849
da9abf43
AD
188502000-10-02 Paul Eggert <eggert@twinsun.com>
18851
18852 * bison.s1 (yyparse): Assign the default value
18853 unconditionally, to avoid a GCC warning and make the parser a
18854 tad smaller.
18855
c33638bb
AD
188562000-10-02 Akim Demaille <akim@epita.fr>
18857
18858 * src/getargs.c (getargs): Don't dump `--help' on unrecognized
18859 options.
18860
444c570a
AD
188612000-10-02 Akim Demaille <akim@epita.fr>
18862
18863 * src/derives.c, src/print.c, src/reduce.c: To ease the
18864 translation, move some `\n' out of the translated strings.
18865
89cab50d
AD
188662000-10-02 Akim Demaille <akim@epita.fr>
18867
18868 The location tracking mechanism is precious for parse error
18869 messages. Nevertheless, it is enabled only when `@n' is used in
18870 the grammar, which is a different issue (you can use it in error
18871 message, but not in the grammar per se). Therefore, there should
18872 be another means to enable it.
18873
18874 * src/getargs.c (getargs): Support `--locations'.
18875 (usage): Report it.
18876 * src/getargs.h (locationsflag): Export it.
18877 * src/lex.c (percent_table): Support `%locations'.
18878 * src/reader.c (yylsp_needed): Remove this variable, now replaced
18879 with `locationsflag'.
18880 * doc/bison.texinfo: Document `--locations' and `%locations'.
18881 Sort the options.
18882 * tests/calc.m4: Test it.
18883
18884 For regularity of the names, replace each
18885 (nolineflag, toknumflag, rawtokenumflag, noparserflag): with...
18886 (no_lineflag, token_tableflag, rawflag, no_parserflag): this.
18887 In addition replace each `flag' with `_flag'.
18888
d6c2cba0
AD
188892000-10-02 Akim Demaille <akim@epita.fr>
18890
18891 Also test parse error messages, including with YYERROR_VERBOSE.
18892
18893 * tests/calc.m4 (calc.y): Add support for `exp = exp' (non
18894 associative).
18895 Use it to check the computations.
18896 Use it to check `nonassoc' is honored.
18897 (AT_DATA_CALC_Y): Equip `calc.y' with YYERROR_VERBOSE when passed
18898 `--yyerror-verbose'.
18899 (_AT_CHECK_CALC): Adjust to this option.
18900 (_AT_CHECK_CALC_ERROR): New macro to check parse error messages.
18901
5a35a6cb
AD
189022000-10-02 Akim Demaille <akim@epita.fr>
18903
18904 Test also `--verbose', `--defines' and `--name-prefix'. Testing
18905 the latter demonstrates a flaw in the handling of non debugging
18906 parsers introduced by myself on 2000-03-16: `#define yydebug 0'
18907 was used in order to simplify:
18908
18909 #if YYDEBUG
18910 if (yydebug)
18911 {
18912 ...
18913 }
18914 #endif
18915
18916 into
18917
18918 if (yydebug)
18919 {
18920 ...
18921 }
18922
18923 unfortunately this leads to a CPP conflict when
18924 `--name-prefix=foo' is used since it produces `#define yydebug
18925 foodebug'.
18926
18927 * src/bison.s1 [!YYDEBUG]: Do not define yydebug.
18928 (YYDPRINTF): New macro.
18929 Spread its use.
18930 * tests/calc.m4 (AT_CHECK_CALC): Do require a title, build it from
18931 the bison options.
18932 Also test `--verbose', `--defines' and `--name-prefix'.
18933
71da9eea
AD
189342000-10-02 Akim Demaille <akim@epita.fr>
18935
18936 Improve the readability of the produced parsers.
18937
18938 * src/bison.s1: Formatting changes.
18939 Improve the comment related to the `$' mark.
18940 (yydefault): Don't fall through to `yyresume': `goto' there.
18941 * src/output.c (output_parser): When the `$' is met, skip the end
18942 of its line.
18943 New variable, `number_of_dollar_signs', to check there's exactly
18944 one `$' in the parser skeleton.
18945
95e36146
AD
189462000-10-02 Akim Demaille <akim@epita.fr>
18947
18948 * lib/xstrdup.c: New file, from the fileutils.
18949 * src/reader.c (parse_token_decl, get_type_name, parse_type_decl)
18950 (parse_assoc_decl, parse_thong_decl, get_type): Use `xstrdup'
18951 instead of strlen + xmalloc + strcpy.
18952 * src/symtab.c (copys): Remove, use xstrdup instead.
18953
d7020c20
AD
189542000-10-02 Akim Demaille <akim@epita.fr>
18955
18956 * src/gram.h (associativity): New enum type which replaces the
18957 former CPP macros `RIGHT_ASSOC', `LEFT_ASSOC' and `NON_ASSOC' with
18958 `right_assoc', `left_assoc' and `non_assoc'.
18959 Adjust all dependencies.
18960 * src/reader.c: Formatting changes.
18961 (LTYPESTR): Don't define it, use it as a literal in
18962 `reader_output_yylsp'.
18963 * src/symtab.h (symbol_class): New enum type which replaces the
18964 former CPP macros `SUNKNOWN', `STOKEN and `SNTERM' with
18965 `sunknown', `stoken and `snterm'.
18966
1916f98e
AD
189672000-10-02 Akim Demaille <akim@epita.fr>
18968
18969 * src/getargs.c (fixed_outfiles): Rename as...
18970 (yaccflag): for consistency and accuracy.
18971 Adjust dependencies.
18972
d7913476
AD
189732000-10-02 Akim Demaille <akim@epita.fr>
18974
18975 Use the more standard files `xalloc.h' and `xmalloc.c' instead of
18976 Bison's `allocate.c' and `alloc.h'. This patch was surprisingly
18977 difficult and introduced a lot of core dump. It turns out that
18978 Bison used an implementation of `xmalloc' based on `calloc', and
18979 at various places it does depend upon the initialization to 0. I
18980 have not tried to isolate the pertinent places, and all the former
18981 calls to Bison's `xmalloc' are now using `XCALLOC'. Someday,
18982 someone should address this issue.
18983
18984 * src/allocate.c, src/alloc.h, m4/bison-decl.m4: Remove.
18985 * lib/xmalloc.c, lib/xalloc.h, m4/malloc.m4, m4/realloc.m4: New
18986 files.
18987 Adjust dependencies.
18988 * src/warshall.h: New file.
18989 Propagate.
18990
340ef489
AD
189912000-10-02 Akim Demaille <akim@epita.fr>
18992
18993 Various anti-`extern in *.c' changes.
18994
18995 * src/system.h: Include `assert.h'.
18996
b2ca4022
AD
189972000-10-02 Akim Demaille <akim@epita.fr>
18998
18999 * src/state.h (nstates, final_state, first_state, first_shift)
19000 (first_reduction): Move their exportation from here...
19001 * src/LR0.h: to here.
19002 Adjust dependencies.
19003 * src/getargs.c (statisticsflag): New variable.
19004 Add support for `--statistics'.
19005 Adjust dependencies.
19006
19007 Remove a lot of now useless `extern' statements in most files.
19008
403b315b
AD
190092000-10-02 Akim Demaille <akim@epita.fr>
19010
19011 * src/LR0.h: New file.
19012 Propagate its use.
19013
07a58c13
AD
190142000-10-02 Akim Demaille <akim@epita.fr>
19015
19016 * src/print.h: New file.
19017 Propagate its use.
19018 * src/print.c: Formatting and ordering changes.
19019 (verbose, terse): Replace with...
19020 (print_results): this new function.
19021 Adjust dependencies.
19022
0619caf0
AD
190232000-10-02 Akim Demaille <akim@epita.fr>
19024
19025 * src/conflicts.c (conflict_report): New function.
19026 (conflict_log, verbose_conflict_log): Replace with...
19027 (print_conflicts): this function.
19028 Adjust dependencies.
19029 * src/conflicts.h: New file.
19030 Propagate its inclusion.
19031
3519ec76
AD
190322000-10-02 Akim Demaille <akim@epita.fr>
19033
19034 * src/nullable.h: New file.
19035 Propagate its inclusion.
19036 * src/nullable.c: Formatting changes.
19037
015acc48
AD
190382000-10-02 Akim Demaille <akim@epita.fr>
19039
19040 * src/reduce.h: New file.
19041 Propagate its inclusion.
19042 * src/reduce.c: Topological sort and other formatting changes.
19043 (bool, TRUE, FALSE): Move their definition to...
19044 * src/system.h: here.
19045
8963a27b
AD
190462000-10-02 Akim Demaille <akim@epita.fr>
19047
19048 * src/files.c: Formatting changes.
19049 (tryopen, tryclose, openfiles): Rename as...
19050 (xfopen, xfclose, open_files): this.
19051 (stringappend): static.
19052 * src/files.h: Complete the list of exported symbols.
19053 Propagate its use.
19054
a70083a3
AD
190552000-10-02 Akim Demaille <akim@epita.fr>
19056
19057 * src/reader.h: New file.
19058 Propagate its use instead of tedious list of `extern' and
19059 prototypes.
19060 * src/reader.c: Formatting changes, topological sort,
19061 s/register//.
19062
abadc117
AD
190632000-10-02 Akim Demaille <akim@epita.fr>
19064
19065 * src/lex.h: Prototype `lex.c' exported functions.
19066 * src/reader.c: Adjust.
19067 * src/lex.c: Formatting changes.
19068 (safegetc): Rename as...
19069 (xgetc): this.
19070
720d742f
AD
190712000-10-02 Akim Demaille <akim@epita.fr>
19072
19073 * src/lalr.h: New file.
19074 Propagate its inclusion instead of prototypes and `extern'.
19075 * src/lalr.c: Formatting changes, topological sorting etc.
19076
f2acea59
AD
190772000-10-02 Akim Demaille <akim@epita.fr>
19078
19079 * src/output.c (token_actions): Introduce a temporary array,
19080 YYDEFACT, that makes it possible for this function to use
19081 output_short_table.
19082
d019d655
AD
190832000-10-02 Akim Demaille <akim@epita.fr>
19084
19085 `user_toknums' is output as a `short[]' in `output.c', while it is
19086 defined as a `int[]' in `reader.c'. For consistency with the
19087 other output tables, `user_toknums' is now defined as a table of
19088 shorts.
19089
19090 * src/reader.c (user_toknums): Be a short table instead of an int
19091 table.
19092 Adjust dependencies.
19093
19094 Factor the short table outputs.
19095
19096 * src/output.c (output_short_table): New function.
19097 * src/output.c (output_gram, output_stos, output_rule_data)
19098 (output_base, output_table, output_check): Use it.
19099
6c89f1c1
AD
191002000-10-02 Akim Demaille <akim@epita.fr>
19101
19102 * src/output.c (output): Topological sort of the functions, in
19103 order to get rid of the `static' prototypes.
19104 No longer use `register'.
19105 * src/output.h: New file.
19106 Propagate its inclusion in files explicitly prototyping functions
19107 from output.c.
19108
d9efd181
AD
191092000-09-21 Akim Demaille <akim@epita.fr>
19110
19111 * src/atgeneral.m4: Update from Autoconf.
19112
c29240e7 191132000-09-21 Akim Demaille <akim@epita.fr>
2fa6973e
AD
19114
19115 * src/closure.h: New file.
19116 * src/closure.c: Formatting changes, topological sort over the
19117 functions, use of closure.h.
19118 (initialize_closure, finalize_closure): Rename as...
19119 (new_closure, free_closure): these. Adjust dependencies.
19120 * src/LR0.c: Formatting changes, topological sort, use of
19121 cloture.h.
19122 (initialize_states): Rename as...
19123 (new_states): this.
19124 * src/Makefile.am (noinst_HEADERS): Adjust.
19125
499daa50
AD
191262000-09-20 Akim Demaille <akim@epita.fr>
19127
19128 * src/acconfig.h: Don't protect config.h against multiple
19129 inclusion.
19130 Don't define PARAMS.
19131 * src/system.h: Define PARAMS.
19132 Remove some of the ad-hoc CPP magic for DOS, VMS etc.: this is the
19133 purpose of config.h. system.h must not try to fix wrong
19134 definitions in config.h.
19135
cc84fd5d
AD
191362000-09-20 Akim Demaille <akim@epita.fr>
19137
19138 * src/derives.h: New file.
19139 * src/main.c, src/derives.h: Use it.
19140 Formatting changes.
19141 * src/Makefile.am (noinst_HEADERS): Adjust.
19142
db5b3a89
AD
191432000-09-20 Akim Demaille <akim@epita.fr>
19144
19145 * tests/atgeneral.m4: Update from Autoconf.
19146 * tests/calc.m4 (_AT_DATA_CALC_Y, AT_DATA_CALC_Y, _AT_CHECK_CALC)
19147 (AT_CHECK_CALC): New macros.
19148 Use these macros to test bison with options `', `--raw',
19149 `--debug', `--yacc', `--yacc --debug'.
19150
ceed8467
AD
191512000-09-19 Akim Demaille <akim@epita.fr>
19152
19153 * src/output.c: Formatting changes.
19154 * src/machine.h: Remove, leaving its contents in...
19155 * src/system.h: here.
19156 Include stdio.h.
19157 Adjust all dependencies on stdio.h and machine.h.
19158 * src/getargs.h: New file.
19159 Let all `extern' declarations about getargs.c be replaced with
19160 inclusion of `getargs.h'.
19161 * src/Makefile.am (noinst_HEADERS): Adjust.
19162
19163 * tests/calc.m4 (yyin): Be initialized in main, not on the global
19164 scope.
19165 (yyerror): Returns void, not int.
19166 * doc/bison.texinfo: Formatting changes.
19167
05a1d24b
AD
191682000-09-19 Akim Demaille <akim@epita.fr>
19169
19170 * tests/calc.m4 (calc.y): Do not assign to stdin, as it's not
19171 portable.
19172
cbd25751
AD
191732000-09-18 Akim Demaille <akim@epita.fr>
19174
19175 * configure.in: Append WARNING_CFLAGS to CFLAGS.
19176 * src/Makefile.am (INCLUDES): Don't.
19177 Be ready to fetch headers in lib/.
19178
13863333
AD
191792000-09-18 Akim Demaille <akim@epita.fr>
19180
19181 * doc/bison.texinfo: Update the copyright.
19182 ANSIfy and GNUify the examples.
19183 Remove the old menu.
19184
0d533154
AD
191852000-09-18 Akim Demaille <akim@epita.fr>
19186
19187 First set of tests: use the `calc' example from the documentation.
19188
19189 * src/bison.s1 (yyparse): Condition the code using `yytname' which
19190 is defined only when YYDEBUG is.
19191 * m4/atconfig.m4 (AT_CONFIG): Adjust to Autoconf 2.13.
19192 * src/files.c (tryopen, tryclose): Formatting changes.
19193 Move to the top and be static.
19194 * src/reader.c (read_signed_integer): Likewise.
19195 * tests/calc.m4: New file.
19196 * Makefile.am, suite.m4: Adjust.
19197 * m4/atconfig.m4: Set BISON_SIMPLE and BISON_HAIRY.
19198
e79137ac
AD
191992000-09-18 Akim Demaille <akim@epita.fr>
19200
19201 Add support for an Autotest test suite for Bison.
19202
19203 * m4/m4.m4, m4/atconfig.m4: New files.
19204 * m4/Makefile.am (EXTRA_DIST): Adjust.
19205 * tests/suite.m4, tests/Makefile.am, tests/atgeneral.m4: New
19206 files.
19207 * src/getargs.c: Display a more standard --version message.
19208 * src/reader.c (reader): Formatting changes.
19209 No longer depend upon VERSION_STRING.
19210 * configure.in: No longer use `dnl'.
19211 Set up the test suite and the new directory `tests/.
19212 (VERSION_STRING): Remove.
19213
27821bff
AD
192142000-04-14 Akim Demaille <akim@epita.fr>
19215
19216 * src/reader.c (copy_comment2): New function, same as former
19217 `copy_comment', but outputs into two FILE *.
19218 (copy_comment): Use it.
19219 (parse_union_decl): Use it.
19220 (get_type, parse_start_decl): Use the same `invalid' message.
19221 (parse_start_decl, parse_union_decl): Use the same `multiple'
19222 message.
19223 (parse_union_decl, copy_guard, copy_action): Use the same
19224 `unmatched' message.
19225 * m4/Makefile.am (EXTRA_DIST): Add `warning.m4'.
19226
cfe5fbc0
AD
192272000-03-31 Akim Demaille <akim@epita.fr>
19228
19229 * src/files.c (tryopen, tryclose): Move to the top.
19230 Be static.
19231
cb7db13e
AD
192322000-03-31 Akim Demaille <akim@epita.fr>
19233
19234 * src/main.c (main): Don't call `done', exit does it.
19235
a0f6b076
AD
192362000-03-31 Akim Demaille <akim@epita.fr>
19237
36281465
AD
19238 * allocate.c: s/return (foo)/return foo/.
19239 * lalr.c: Likewise.
19240 * LR0.c: Likewise.
19241 * output.c: Likewise.
19242 * reader.c: Likewise.
19243 * symtab.c: Likewise.
19244 * vmsgetargs.c: Likewise.
19245
192462000-03-31 Akim Demaille <akim@epita.fr>
19247
19248 Clean up the error reporting functions.
a0f6b076
AD
19249
19250 * src/report.c: New file.
19251 * src/report.h: Likewise.
19252 * src/Makefile.am: Adjust.
19253 * m4/error.m4: New file.
19254 * m4/Makefile.am: Adjust.
19255 * configure.in (jm_PREREQ_ERROR): Call it.
19256 * src/main.c (int_to_string, banner, fatal_banner, warn_banner):
19257 Remove.
19258 (fatal, fatals): Remove. All callers use complain.c::fatal.
19259 (warn, warni, warns, warnss, warnss): Remove. All callers use
19260 complain.c::complain.
19261 (toomany): Remove, use fatal instead.
19262 * src/files.c (done): No argument, use complain_message_count.
19263 * src/main.c (main): Register `done' to `atexit'.
19264
19265 * src/getargs.c (usage): More `fputs', less `fprintf'.
19266
18539825
AD
192672000-03-28 Akim Demaille <akim@epita.fr>
19268
19269 * lib/: New directory.
19270 * Makefile.am (SUBDIRS): Adjust.
19271 * configure.in: Adjust.
19272 (LIBOBJS): Although not used yet, AC_SUBST it, otherwise it's
19273 useless.
19274 * src/alloca.c: Moved to lib/.
19275 * src/getopt.c: Likewise.
19276 * src/getopt1.c: Likewise.
19277 * src/getopt.h: Likewise.
19278 * src/ansi2knr.c: Likewise.
19279 * src/ansi2knr.1: Likewise.
19280 * src/Makefile.am: Adjust.
19281 * lib/Makefile.am: New file.
19282
9f306f2a
AD
192832000-03-28 Akim Demaille <akim@epita.fr>
19284
19285 * src/getargs.c (usage): Refresh the help message.
19286
0ba347b6
AD
192872000-03-17 Akim Demaille <akim@epita.fr>
19288
19289 * src/getopt1.c: Updated from textutils 2.0e
19290 * src/getopt.c: Likewise.
19291 * src/getopt.h: Likewise.
19292
dbe7f271
AD
192932000-03-17 Akim Demaille <akim@epita.fr>
19294
19295 * src/Makefile.am (bison.simple): Fix the awk program: quote only
19296 the file name, not the whole `#line LINE FILE'.
19297
75bbe78d
AD
192982000-03-17 Akim Demaille <akim@epita.fr>
19299
19300 On syntax errors, report the token on which we choked.
19301
aa5fd0ee
AD
19302 * src/bison.s1 (yyparse): In the label yyerrlab, when
19303 YYERROR_VERBOSE, add yychar in msg.
75bbe78d 19304
7b306f52
AD
193052000-03-17 Akim Demaille <akim@epita.fr>
19306
aa5fd0ee 19307 * src/reader.c (copy_at): New function.
7b306f52
AD
19308 (copy_guard): Use it.
19309 (copy_action): Use it.
19310
e87b5700
AD
193112000-03-17 Akim Demaille <akim@epita.fr>
19312
19313 Be kind to translators, save some useless translations.
19314
aa5fd0ee 19315 * src/main.c (banner): New function.
e87b5700
AD
19316 (fatal_banner): Use it.
19317 (warn_banner): Use it.
19318
ae3c3164
AD
193192000-03-17 Akim Demaille <akim@epita.fr>
19320
aa5fd0ee
AD
19321 * src/reader.c (copy_definition): Use copy_string and
19322 copy_comment. Removed now unused `match', `ended',
19323 `cplus_comment'.
ae3c3164
AD
19324 (copy_comment, copy_string): Moved, to be visible from
19325 copy_definition.
19326
4dc58e7c
AD
193272000-03-17 Akim Demaille <akim@epita.fr>
19328
aa5fd0ee
AD
19329 * src/reader.c (copy_string): Declare `static inline'. No
19330 problems with inline, since it is checked by configure.
4dc58e7c
AD
19331 (copy_comment): Likewise.
19332
0a6384c4
AD
193332000-03-17 Akim Demaille <akim@epita.fr>
19334
aa5fd0ee 19335 * src/reader.c (packsymbols): Formatting changes.
0a6384c4 19336
3cef001a
AD
193372000-03-17 Akim Demaille <akim@epita.fr>
19338
aa5fd0ee 19339 * src/reader.c (copy_comment): New function, factored out from:
3cef001a
AD
19340 (copy_action): Use it. Removed now unused `match', `ended',
19341 `cplus_comment'.
19342 (copy_guard): Likewise.
19343
ca36d2ef
AD
193442000-03-17 Akim Demaille <akim@epita.fr>
19345
aa5fd0ee 19346 * src/reader.c (copy_string): New function, factored out from:
ca36d2ef
AD
19347 (copy_action): Use it.
19348 (copy_guard): Likewise.
19349
6666f98f
AD
193502000-03-17 Akim Demaille <akim@epita.fr>
19351
19352 Change the handling of @s so that they behave exactly like $s.
19353 There is now a pseudo variable @$ (readble and writable), location
19354 of the lhs of the rule (by default ranging from the location of
19355 the first symbol of the rhs, to the location of the last symbol,
19356 or, if the rhs is empty, YYLLOC).
19357
19358 * src/bison.s1 [YYLSP_NEEDED] (yyloc): New variable, twin of
19359 yyval.
19360 (yyparse): When providing a default semantic action, provide a
19361 default location action.
19362 (after the $): No longer change `*YYLSP', just stack YYLOC the
19363 same way you stack YYVAL.
19364 * src/reader.c (read_declarations): Use warns.
19365 (copy_guard, case '@'): Also recognize `@$', expanded as `YYLOC'.
19366 (copy_action, case '@'): Likewise.
19367 Use a standard error message, to save useless work from
19368 translators.
19369
41aca2e0
AD
193702000-03-17 Akim Demaille <akim@epita.fr>
19371
aa5fd0ee
AD
19372 * src/bison.s1: Formatting and cosmetics changes.
19373 * src/reader.c: Likewise.
41aca2e0
AD
19374 Update the Copyright notice.
19375
dc08c1d5
AD
193762000-03-17 Akim Demaille <akim@epita.fr>
19377
aa5fd0ee
AD
19378 * src/bison.s1 (#line): All set to `#line' only, since the
19379 Makefile now handles them.
dc08c1d5 19380
9ee3c97b
AD
193812000-03-16 Akim Demaille <akim@epita.fr>
19382
19383 * src/output.c (output_rule_data): Output the documentation of
19384 some of the tables.
19385 (Copyright notice): Update.
19386 Formatting changes.
19387
0de741ca
AD
193882000-03-16 Akim Demaille <akim@epita.fr>
19389
19390 * src/bison.s1 [!YYDEBUG]: Define yydebug to 0. This allows to
19391 remove most `#if YYDEBUG != 0', since `if (yydebug)' is enough.
19392 One `#if YYDEBUG' remains, since it uses variables which are
19393 defined only if `YYDEBUG != 0'.
19394
bb10be54
AD
193952000-03-16 Akim Demaille <akim@epita.fr>
19396
19397 * src/bison.s1 (yyparse): Reorganize the definitions of the stacks
19398 and related variables so that the similarities are highlighted.
19399
b07b484a
AD
194002000-03-16 Akim Demaille <akim@epita.fr>
19401
19402 * src/bison.s1: Properly indent CPP directives.
19403
361f60b3
AD
194042000-03-16 Akim Demaille <akim@epita.fr>
19405
19406 * src/bison.s1: Properly indent the `alloca' CPP section.
19407
8c44d3ec
AD
194082000-03-16 Akim Demaille <akim@epita.fr>
19409
19410 Do not hard code values of directories in `configure.in'.
19411 Update the `configure' tool chain.
19412
19413 * configure.in (XPFILE, XPFILE1, LOCALEDIR): Remove, handled by
19414 src/makefile.am.
19415 (VERSION_STRING): Use the third arg of AC_DEFINE_UNQUOTED.
19416 (AC_OUTPUT): Add m4/Makefile.
19417 Bump to bison 1.28a, 1.29 has never been released.
19418 * acconfig.h (XPFILE, XPFILE1, LOCALEDIR): Remove, since they are
19419 handled via src/Makefile.am.
19420 (VERSION_STRING, PROTOTYPES, ENABLE_NLS, HAVE_CATGETS,
19421 HAVE_GETTEXT, HAVE_LC_MESSAGES, HAVE_STPCPY): Remove, handled by
19422 autoheader.
19423 * Makefile.am (SUBDIRS): Add m4.
19424 (ACLOCAL_AM_FLAGS): New variable.
19425 (AUTOMAKE_OPTIONS): Add check-news.
19426 * src/Makefile.am (bison.simple): Use awk to replace #line lines with
19427 the proper line number and file name.
19428 (DEFS): Propagate the location of bison library files and of the
19429 locale files.
19430 (INCLUDES): Added `-I ..' so that one can compile with srcdir !=
19431 builddir.
19432 * acinclude.m4: Remove, replaced by the directory m4.
19433 * m4/Makefile.am (EXTRA_DIST): New variable.
19434 * m4/gettext.m4: New file, from the fileutils.
19435 * m4/lcmessage.m4: Likewise
19436 * m4/progtest.m4: Likewise.
19437 * m4/bison-decl.m4: New file, extracted from former acinclude.m4.
19438
f95997e7
AD
194392000-03-10 Akim Demaille <akim@epita.fr>
19440
19441 * src/closure.c:
19442 Formatting changes of various comments.
19443 Respect the GNU coding standards at various places.
19444 Don't use `_()' when no translation is needed.
19445
194461999-12-13 Jesse Thilo <jthilo@gnu.org>
19447
19448 * src/files.c:
19449 OS/2 honors TMPDIR environment variable.
19450
194511999-12-13 Jesse Thilo <jthilo@gnu.org>
19452
19453 * doc/bison.texinfo: Tweaked spelling and grammar.
19454 Updated ISBN.
19455 Removed reference to price of printed copy.
19456 Mention BISON_SIMPLE and BISON_HAIRY.
19457
194581999-12-13 Jesse Thilo <jthilo@gnu.org>
19459
19460 * configure.in, NEWS:
19461 Bison 1.29 released.
19462
194631999-10-27 Jesse Thilo <jthilo@gnu.org>
19464
19465 * doc/.cvsignore, doc/Makefile.am, doc/refcard.tex:
19466 Added reference card.
19467
194681999-07-26 Jesse Thilo <jthilo@gnu.org>
19469
19470 * po/ru.po: Added Russian translation.
19471
194721999-07-26 Jesse Thilo <jthilo@gnu.org>
19473
19474 * configure.in: Added Russian translation.
19475
194761999-07-06 Jesse Thilo <jthilo@gnu.org>
19477
19478 * configure.in, NEWS, README:
19479 Released version 1.28.
19480
194811999-06-14 Jesse Thilo <jthilo@gnu.org>
19482
19483 * src/system.h:
19484 Squashed redefinition warning on some systems.
19485
19486 * src/getargs.c, src/Makefile.am, src/reader.c, src/version.c:
19487 Have configure build version string instead of relying on ANSI string
19488 concatentation.
19489
194901999-06-14 Jesse Thilo <jthilo@gnu.org>
19491
19492 * po/POTFILES.in: Got rid of version.c.
19493
194941999-06-14 Jesse Thilo <jthilo@gnu.org>
19495
19496 * acconfig.h, configure.in:
19497 Have configure build version string instead of relying on ANSI string
19498 concatentation.
19499
195001999-06-08 Jesse Thilo <jthilo@gnu.org>
19501
19502 * doc/bison.1:
19503 Dropped mention of `+' for long-named options.
19504
195051999-05-30 Jesse Thilo <jthilo@gnu.org>
19506
19507 * src/files.c: Added <unistd.h> for unlink().
19508
19509 * src/Makefile.am, src/system.h:
19510 I18n fixes.
19511
195121999-05-30 Jesse Thilo <jthilo@gnu.org>
19513
19514 * README: Added a FAQ list.
19515
19516 * configure.in, acconfig.h:
19517 I18n fixes.
19518
195191999-05-30 Jesse Thilo <jthilo@gnu.org>
19520
19521 * doc/FAQ, doc/Makefile.am:
19522 Added a FAQ list.
19523
195241999-05-19 Jesse Thilo <jthilo@gnu.org>
19525
19526 * src/alloc.h, src/symtab.h, src/version.c:
19527 Protected inclusion of "config.h" with HAVE_CONFIG_H.
19528
195291999-04-18 Jesse Thilo <jthilo@gnu.org>
19530
19531 * src/.cvsignore, src/Makefile.am:
19532 Reorganized: sources in `src', documentation in `doc'.
19533
19534 * src/lex.c (literalchar):
19535 fixed the code for escaping double quotes (thanks
19536 Jonathan Czisny.)
19537
195381999-04-18 Jesse Thilo <jthilo@gnu.org>
19539
19540 * po/de.po, po/es.po, po/fr.po, po/nl.po, po/POTFILES.in:
19541 Adjusted paths to reflect directory reorganization.
19542
195431999-04-18 Jesse Thilo <jthilo@gnu.org>
19544
19545 * doc/.cvsignore, doc/Makefile.am:
19546 Reorganized: sources in `src', documentation in `doc'.
19547
195481999-04-18 Jesse Thilo <jthilo@gnu.org>
19549
19550 * configure.in:
19551 Updated AC_INIT file to reflect directory reorganization.
19552
19553 * configure.in, .cvsignore, Makefile.am, POTFILES.in:
19554 Reorganized: sources in `src', documentation in `doc'.
19555
195561999-04-13 Jesse Thilo <jthilo@gnu.org>
19557
19558 * src/allocate.c:
19559 Don't declare calloc() and realloc() if not necessary.
19560
195611999-04-13 Jesse Thilo <jthilo@gnu.org>
19562
19563 * configure.in, acconfig.h, acinclude.m4:
19564 Don't declare calloc() and realloc() if not necessary.
19565
195661999-03-23 Jesse Thilo <jthilo@gnu.org>
19567
19568 * po/.cvsignore: Added i18n support.
19569
195701999-03-23 Jesse Thilo <jthilo@gnu.org>
19571
19572 * acconfig.h, configure.in, Makefile.am:
19573 Added i18n support.
19574
195751999-03-22 Jesse Thilo <jthilo@gnu.org>
19576
19577 * src/bison.s1: Fixed #line numbers.
19578
195791999-03-15 Jesse Thilo <jthilo@gnu.org>
19580
19581 * po/es.po, po/fr.po, po/nl.po, po/de.po:
19582 Added PO files from Translation Project.
19583
195841999-03-03 Jesse Thilo <jthilo@gnu.org>
19585
19586 * Makefile.am:
19587 Added support for non-ANSI compilers (ansi2knr).
19588
195891999-02-16 Jesse Thilo <jthilo@gnu.org>
19590
19591 * configure.in: Bumped version number to 1.27.
19592
19593 * Makefile.am:
19594 Added `bison.simple' to list of files removed by `make distclean'.
19595
195961999-02-12 Jesse Thilo <jthilo@gnu.org>
19597
19598 * src/files.c, src/files.h:
19599 Defined locations of parser files in config.h instead of Makefile.
19600
196011999-02-12 Jesse Thilo <jthilo@gnu.org>
19602
19603 * acconfig.h, acinclude.m4, configure.in, Makefile.am:
19604 Defined locations of parser files in config.h instead of Makefile.
19605
196061999-02-09 Jesse Thilo <jthilo@gnu.org>
19607
19608 * Makefile.am:
19609 Removed inappropriate use of $< macro.
19610
196111999-02-05 Jesse Thilo <jthilo@gnu.org>
19612
19613 * po/Makefile.in.in, po/POTFILES.in:
19614 Add `po' directory skeleton.
19615
196161999-01-27 Jesse Thilo <jthilo@gnu.org>
19617
19618 * README: Document help-bison list.
19619
19620 * configure.in: Add check for mkstemp().
19621
196221999-01-20 Jesse Thilo <jthilo@gnu.org>
19623
19624 * src/conflicts.c, src/LR0.c, src/output.c, src/reader.c:
19625 Hush a few compiler warnings.
19626
19627 * src/files.c:
19628 Add tryclose(), which verifies that fclose was successful.
19629 Hush a couple of compiler warnings.
19630
196311999-01-20 Jesse Thilo <jthilo@gnu.org>
19632
19633 * Makefile.am, OChangeLog:
19634 ChangeLog is now automatically generated. Include the old version as
19635 OChangeLog.
19636
196371999-01-14 Jesse Thilo <jthilo@gnu.org>
19638
19639 * 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:
19640 Update FSF address.
19641
196421999-01-14 Jesse Thilo <jthilo@gnu.org>
19643
19644 * doc/bison.texinfo: Fix formatting glitch.
19645
19646 * doc/bison.texinfo: Update FSF address.
19647
196481999-01-14 Jesse Thilo <jthilo@gnu.org>
19649
19650 * acconfig.h: Update FSF address.
19651
196521999-01-08 Jesse Thilo <jthilo@gnu.org>
19653
19654 * src/system.h:
19655 Don't define PACKAGE here, since config.h defines it.
19656
196571998-12-30 Jesse Thilo <jthilo@gnu.org>
19658
19659 * src/reader.c: Update copyright date.
19660
19661 * src/main.c:
19662 Ditch sprintf to statically-sized buffers in fatal/warn functions in
19663 favor of output directly to stderr (avoids buffer overruns).
19664
19665 * src/reader.c: Some checks for premature EOF.
19666
19667 * 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:
19668 Use prototypes if the compiler understands them.
19669
19670 * src/files.c: Honor TMPDIR on Unix hosts.
19671 Use prototypes if the compiler understands them.
19672
19673 * src/reader.c:
19674 Fix a couple of buffer overrun bugs.
19675 Use prototypes if the compiler understands them.
19676
19677 * src/system.h: Include unistd.h and ctype.h.
19678 Use #ifdef instead of #if for NLS symbols.
19679
196801998-12-30 Jesse Thilo <jthilo@gnu.org>
19681
19682 * doc/bison.texinfo:
19683 Delete comment "consider using @set for edition number, etc..." since
19684 we now are doing so.
19685
196861998-12-30 Jesse Thilo <jthilo@gnu.org>
19687
19688 * configure.in:
19689 Use prototypes if the compiler understands them.
19690
19691 * NEWS: Document 1.26 highlights.
19692
19693 * Makefile.am: Require Automake 1.3 or later.
19694
19695 * acconfig.h:
19696 Use prototypes if the compiler understands them.
19697
196981998-12-29 Jesse Thilo <jthilo@gnu.org>
19699
19700 * src/version.c:
19701 Use VERSION symbol from automake for version number.
19702
197031998-12-29 Jesse Thilo <jthilo@gnu.org>
19704
19705 * acconfig.h, configure.in, version.cin:
19706 Use VERSION symbol from automake for version number.
19707
197081998-11-28 Jesse Thilo <jthilo@gnu.org>
19709
19710 * Makefile.am:
19711 Distribute original version of simple parser (bison.s1), not built
19712 version (bison.simple).
19713
197141998-11-28 Jesse Thilo <jthilo@gnu.org>
19715
19716 * doc/bison.texinfo: Add info dir entry.
19717
19718 * doc/bison.texinfo:
19719 Let automake put version number into documentation.
19720
197211998-11-26 Jesse Thilo <jthilo@gnu.org>
19722
19723 * src/bison.cld, src/build.com, src/vmshlp.mar:
19724 Add non-RCS files from /gd/gnu/bison.
19725
197261998-11-26 Jesse Thilo <jthilo@gnu.org>
19727
19728 * doc/bison.1:
19729 Document the BISON_HAIRY and BISON_SIMPLE variables.
19730
197311998-11-25 Jesse Thilo <jthilo@gnu.org>
19732
19733 * src/version.c: Build version.c automatically.
19734
19735 * src/reader.c:
19736 Fix token numbering (used to start at 258, not 257).
19737
19738 * src/system.h: Include config.h.
19739
19740 * src/getargs.c: Update bug report address.
19741
19742 * src/alloca.c, src/getopt1.c, src/getopt.c, src/getopt.h:
19743 Get latest copies of alloca.c, getopt.c, getopt.h, getopt1.c from gnu.org.
19744
197451998-11-25 Jesse Thilo <jthilo@gnu.org>
19746
19747 * Makefile.am:
19748 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19749
19750 * configure.in, version.cin:
19751 Build version.c automatically.
19752
19753 * AUTHORS: Add AUTHORS file.
19754
19755 * README: Update bug report address.
19756
19757 * bison.simple:
19758 Rename bison.simple to bison.s1 (bison.simple is then built from bison.s1).
19759
19760 * configure.in, Makefile.am, Makefile.in, stamp-h.in:
19761 Add automake stuff.
19762
197631998-11-25 Jesse Thilo <jthilo@gnu.org>
19764
19765 * doc/bison.texinfo: Clean up some formatting.
19766
197671998-05-05 Richard Stallman <rms@gnu.org>
19768
19769 * doc/bison.texinfo:
19770 Explain better why to make a pure parser.
19771
197721998-01-05 Richard Stallman <rms@gnu.org>
19773
19774 * src/files.c (openfiles):
19775 [_WIN32 && !__CYGWIN32__] Use TEMP or Temp to
19776 find a temporary directory, if possible. Do not unlink files while
19777 they are open.
19778
197791997-08-25 Richard Stallman <rms@gnu.org>
19780
19781 * src/reader.c (stack_offset;):
19782 Change some warni to warns.
19783
19784 * src/lex.c (literalchar): Use warns, not warni.
19785
197861997-06-28 Richard Stallman <rms@gnu.org>
19787
19788 * src/bison.s1: Add a Bison version comment.
19789
19790 * src/main.c (fatal, warn, berror):
19791 Use program_name.
19792
197931997-06-28 Richard Stallman <rms@gnu.org>
19794
19795 * Makefile.in (bison_version): New variable.
19796 (dist): Use that variable.
19797 (bison.s1): Substitute the Bison version into bison.simple.
19798
19799 * bison.simple: Add a Bison version comment.
19800
198011997-06-18 Richard Stallman <rms@gnu.org>
19802
19803 * src/main.c (fatal, warn, berror):
19804 Make error messages standard.
19805 (toomany): Improve error message text.
19806
19807 * 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:
19808 new.h renamed to alloc.h.
19809
198101997-06-18 Richard Stallman <rms@gnu.org>
19811
19812 * Makefile.in: new.h renamed to alloc.h.
19813
198141997-05-24 Richard Stallman <rms@gnu.org>
19815
19816 * src/lex.c (literalchar):
19817 Fix the code for escaping \, " and '.
19818
19819 (lex): Avoid trouble when there are many chars
19820 to discard in a char literal with just several chars in it.
19821
198221997-05-17 Richard Stallman <rms@gnu.org>
19823
19824 * src/bison.s1:
19825 Use malloc, if using alloca is troublesome.
19826 (YYSTACK_USE_ALLOCA): New flag macro.
19827 Define it for some systems and compilers.
19828 (YYSTACK_ALLOC): New macro.
19829 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19830 If it was malloc'd, free it.
19831
198321997-05-17 Richard Stallman <rms@gnu.org>
19833
19834 * bison.simple:
19835 Use malloc, if using alloca is troublesome.
19836 (YYSTACK_USE_ALLOCA): New flag macro.
19837 Define it for some systems and compilers.
19838 (YYSTACK_ALLOC): New macro.
19839 (yyparse): Use YYSTACK_ALLOC to allocate stack.
19840 If it was malloc'd, free it.
19841
198421997-04-23 Richard Stallman <rms@gnu.org>
19843
19844 * src/bison.s1:
19845 (alloca) [__hpux]: Always define as __builtin_alloca.
19846
198471997-04-23 Richard Stallman <rms@gnu.org>
19848
19849 * bison.simple:
19850 (alloca) [__hpux]: Always define as __builtin_alloca.
19851
198521997-04-22 Richard Stallman <rms@gnu.org>
19853
19854 * src/bison.s1:
19855 [__hpux]: Include alloca.h (right for HPUX 10)
19856 instead of declaring alloca (right for HPUX 9).
19857
19858 * src/bison.s1 (__yy_memcpy):
19859 Declare arg `count' as unsigned int.
19860 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19861
198621997-04-22 Richard Stallman <rms@gnu.org>
19863
19864 * bison.simple:
19865 [__hpux]: Include alloca.h (right for HPUX 10)
19866 instead of declaring alloca (right for HPUX 9).
19867
19868 * bison.simple (__yy_memcpy):
19869 Declare arg `count' as unsigned int.
19870 (yyparse): Cast third arg to __yy_memcpy to unsigned int.
19871
198721997-01-03 Richard Stallman <rms@gnu.org>
19873
19874 * src/allocate.c: [__STDC__ or _MSC_VER]:
19875 Declare calloc and realloc to return void *.
19876
198771997-01-02 Richard Stallman <rms@gnu.org>
19878
19879 * src/system.h:
19880 [_MSC_VER]: Include stdlib.h and process.h.
19881 [_MSC_VER] (getpid): Define as macro--translate it to _getpid.
19882
19883 * src/main.c (main): Return FAILURE as a value.
19884 (printable_version): Declare arg as int, not char.
19885
198861997-01-02 Richard Stallman <rms@gnu.org>
19887
19888 * Makefile.in (dist):
19889 Explicitly check for symlinks, and copy them.
19890
198911996-12-19 Richard Stallman <rms@gnu.org>
19892
19893 * src/files.c:
19894 [_MSC_VER] (XPFILE, XPFILE1): Define, if not already defined.
19895
198961996-12-18 Paul Eggert <eggert@gnu.org>
19897
19898 * src/bison.s1 (yyparse):
19899 If __GNUC__ and YYPARSE_PARAM are both defined,
19900 declare yyparse to have a void * argument.
19901
199021996-12-18 Paul Eggert <eggert@gnu.org>
19903
19904 * bison.simple (yyparse):
19905 If __GNUC__ and YYPARSE_PARAM are both defined,
19906 declare yyparse to have a void * argument.
19907
199081996-12-17 Richard Stallman <rms@gnu.org>
19909
19910 * src/reduce.c (nbits): Add some casts.
19911
199121996-08-12 Richard Stallman <rms@gnu.org>
19913
19914 * src/bison.s1: Test _MSDOS as well as _MSDOS_.
19915
199161996-08-12 Richard Stallman <rms@gnu.org>
19917
19918 * bison.simple: Test _MSDOS as well as _MSDOS_.
19919
199201996-07-31 Richard Stallman <rms@gnu.org>
19921
19922 * src/bison.s1:
19923 [__sun && __i386]: Include alloca.h.
19924
199251996-07-31 Richard Stallman <rms@gnu.org>
19926
19927 * bison.simple:
19928 [__sun && __i386]: Include alloca.h.
19929
199301996-07-30 Richard Stallman <rms@gnu.org>
19931
19932 * src/bison.s1: Comment change.
19933
19934 * src/bison.s1: Test _MSDOS_, not MSDOS.
19935
199361996-07-30 Richard Stallman <rms@gnu.org>
19937
19938 * bison.simple: Comment change.
19939
19940 * bison.simple: Test _MSDOS_, not MSDOS.
19941
199421996-06-01 Richard Stallman <rms@gnu.org>
19943
19944 * 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:
19945 Insert `_' macro around many string constants.
19946
19947 * src/main.c:
19948 Insert `_' macro around many string constants.
19949
19950 (main): Call setlocale, bindtextdomain and textdomain.
19951
19952 * src/system.h: [HAVE_LOCALE_H]: Include locale.h.
19953 [! HAVE_LOCALE_H] (setlocale): Define as no-op.
19954 [ENABLE_NLS]: Include libintl.h.
19955 [ENABLE_NLS] (gettext): Define.
19956 [! ENABLE_NLS] (bintextdomain, textdomain, _): Consolation definitions.
19957 (N_, PACKAGE, LOCALEDIR): New macros.
19958
199591996-06-01 Richard Stallman <rms@gnu.org>
19960
19961 * POTFILES.in: New file.
19962
19963 * Makefile.in (allocate.o):
19964 Define target explicitly.
19965
19966 * Makefile.in (CFLAGS): Set to @CFLAGS@.
19967 (LDFLAGS): Set to @LDFLAGS@.
19968 (configure): Run autoconf only if preceding `cd' succeeds.
19969 (bison.s1): Redirect output to temporary file then move the
19970 temporary to the target, rather than redirecting directly to bison.s1.
19971 (clean): Remove config.status and config.log.
19972 (distclean): Don't remove config.status here.
19973
199741996-05-12 Richard Stallman <rms@gnu.org>
19975
19976 * src/bison.s1:
19977 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19978
199791996-05-12 Richard Stallman <rms@gnu.org>
19980
19981 * bison.simple:
19982 (__yy_memcpy) [__cplusplus]: Reorder declarations of variables f and t.
19983
199841996-05-11 Richard Stallman <rms@gnu.org>
19985
19986 * src/bison.s1 (__yy_memcpy):
19987 Really reorder the args, as was supposedly done on Feb 14 1995.
19988 (yyparse): Calls changed accordingly.
19989
199901996-05-11 Richard Stallman <rms@gnu.org>
19991
19992 * Makefile.in (dist): Don't use $(srcdir).
19993
19994 * bison.simple (__yy_memcpy):
19995 Really reorder the args, as was supposedly done on Feb 14 1995.
19996 (yyparse): Calls changed accordingly.
19997
199981996-01-27 Richard Stallman <rms@gnu.org>
19999
20000 * src/output.c (output_rule_data):
20001 Test YYERROR_VERBOSE in the conditional
20002 around the definition of ttyname.
20003
200041995-12-29 Richard Stallman <rms@gnu.org>
20005
20006 * src/bison.s1:
20007 Fix line numbers in #line commands.
20008
200091995-12-29 Richard Stallman <rms@gnu.org>
20010
20011 * bison.simple:
20012 Fix line numbers in #line commands.
20013
200141995-12-27 Richard Stallman <rms@gnu.org>
20015
20016 * src/bison.s1 (YYPARSE_PARAM_DECL):
20017 In C++, make it always null.
20018 (YYPARSE_PARAM_ARG): New macro.
20019 (yyparse): Use YYPARSE_PARAM_ARG.
20020
200211995-12-27 Richard Stallman <rms@gnu.org>
20022
20023 * bison.simple (YYPARSE_PARAM_DECL):
20024 In C++, make it always null.
20025 (YYPARSE_PARAM_ARG): New macro.
20026 (yyparse): Use YYPARSE_PARAM_ARG.
20027
200281995-11-29 Richard Stallman <rms@gnu.org>
20029
20030 * doc/bison.texinfo:
20031 Describe literal string tokens, %raw, %no_lines, %token_table.
20032
200331995-11-29 Daniel Hagerty <hag@gnu.org>
20034
20035 * doc/bison.texinfo: Fixed update date
20036
200371995-10-16 Richard Stallman <rms@gnu.org>
20038
20039 * src/version.c: Version 1.25.
20040
200411995-10-16 Richard Stallman <rms@gnu.org>
20042
20043 * NEWS: *** empty log message ***
20044
200451995-10-16 Richard Stallman <rms@gnu.org>
20046
20047 * doc/bison.1, doc/bison.rnh:
20048 Add new options.
20049
200501995-10-15 Richard Stallman <rms@gnu.org>
20051
20052 * src/vmsgetargs.c, src/getargs.c:
20053 Added -n, -k, and -raw switches.
20054 (noparserflag, toknumflag, rawtoknumflag): New variables.
20055
20056 * src/symtab.h (SALIAS):
20057 New #define for adding aliases to %token.
20058 (struct bucket): Added `alias' field.
20059
20060 * src/reduce.c (reduce_grammar):
20061 Revise error message.
20062 (print_notices): Remove final `.' from error message.
20063
20064 * src/reader.c (reader_output_yylsp):
20065 New function.
20066 (readgram): Use `#if 0' around code that accepted %command
20067 inside grammar rules: The documentation doesn't allow it,
20068 and it will fail since the %command processors scan for the next %.
20069 (parse_token_decl): Extended the %token
20070 declaration to allow a multi-character symbol as an alias.
20071 (parse_thong_decl): New function.
20072 (read_declarations): Added %thong declarations.
20073 (read_declarations): Handle NOOP to deal with allowing
20074 % declarations as another means to specify the flags.
20075 (readgram): Allow %prec prior to semantics embedded in a rule.
20076 (skip_to_char, read_declarations, copy_definition)
20077 (parse_token_decl, parse_start_decl, parse_type_decl)
20078 (parse_assoc_decl, parse_union_decl, parse_expect_decl)
20079 (get_type_name, copy_guard, copy_action, readgram)
20080 (get_type, packsymbols): Revised most error messages.
20081 Changed `fatal' to `warnxxx' to avoid aborting for error.
20082 Revised and use multiple warnxxx functions to avoid using VARARGS1.
20083 (read_declarations): Improve the error message for
20084 an invalid character. Do not abort.
20085 (read_declarations, copy_guard, copy_action): Use
20086 printable_version to avoid unprintable characters in printed output.
20087 (parse_expect_decl): Error if argument to %expect exceeds 10 digits.
20088 (parse_token_decl, parse_assoc_decl, parse_type_decl, get_type):
20089 Allow the type of a non-terminal can be given
20090 more than once, as long as all specifications give the same type.
20091
20092 * src/output.c:
20093 (output_headers, output_trailers, output, output_gram)
20094 (output_rule_data): Implement noparserflag variable.
20095 Implement toknumflag variable.
20096 (output): Call reader_output_yylsp to output LTYPESTR.
20097
20098 * src/main.c (main):
20099 If reader sees an error, don't process the grammar.
20100 (fatals): Updated to not use VARARGS1.
20101 (printable_version, int_to_string, warn, warni, warns, warnss)
20102 (warnsss): New error reporting functions. Avoid abort for error.
20103
20104 * src/lex.h:
20105 Added THONG and NOOP for alias processing.
20106 Added SETOPT for the new code that allows setting options with %flags.
20107
20108 * src/lex.c:
20109 Include getopt.h. Add some extern decls.
20110 (safegetc): New function to deal with EOF gracefully.
20111 (literalchar); new function to deal with reading \ escapes.
20112 (lex): Use literalchar.
20113 (lex): Implemented "..." tokens.
20114 (literalchar, lex, parse_percent_token): Made tokenbuffer
20115 always contain the token. This includes growing the token
20116 buffer while reading an integer.
20117 (parse_percent_token): Replaced if-else statement with percent_table.
20118 (parse_percent_token): Added % declarations as another
20119 way to specify the flags -n, -l, and -r. Also added hooks for
20120 -d, -k, -y, -v, -t, -p, -b, -o, but implementation requires
20121 major changes to files.c.
20122 (lex) Retain in the incoming stream a character following
20123 an incorrect '/'.
20124 (skip_white_space, lex): Revised most error messages
20125 and changed fatal to warn to avoid aborting.
20126 (percent_table): Added %thong declarations.
20127
20128 * src/gram.h: Comment changes.
20129
20130 * src/files.c (openfiles, open_extra_files, done):
20131 Add faction flag
20132 and actfile file. Handle noparserflag. Both for -n switch.
20133
20134 * src/conflicts.c (resolve_sr_conflict):
20135 Remove use of alloca.
20136
201371995-06-01 Jim Meyering <meyering@gnu.org>
20138
20139 * doc/bison.texinfo: *** empty log message ***
20140
201411995-05-06 Richard Stallman <rms@gnu.org>
20142
20143 * src/bison.s1: Comment change.
20144
201451995-05-06 Richard Stallman <rms@gnu.org>
20146
20147 * bison.simple: Comment change.
20148
201491995-05-03 Richard Stallman <rms@gnu.org>
20150
20151 * src/version.c: Version now 1.24.
20152
20153 * src/bison.s1: Change distribution terms.
20154
20155 * src/version.c: Version now 1.23.
20156
201571995-05-03 Richard Stallman <rms@gnu.org>
20158
20159 * doc/bison.texinfo:
20160 Rewrite "Conditions for Using Bison".
20161 Update version to 1.24.
20162
201631995-05-03 Richard Stallman <rms@gnu.org>
20164
20165 * bison.simple: Change distribution terms.
20166
201671995-02-23 Richard Stallman <rms@gnu.org>
20168
20169 * src/files.c: Test __VMS_POSIX as well as VMS.
20170
201711995-02-14 Jim Meyering <meyering@gnu.org>
20172
20173 * src/bison.s1 (__yy_memcpy):
20174 Renamed from __yy_bcopy to avoid
20175 confusion. Reverse FROM and TO arguments to be consistent with
20176 those of memcpy.
20177
201781995-02-14 Jim Meyering <meyering@gnu.org>
20179
20180 * bison.simple (__yy_memcpy):
20181 Renamed from __yy_bcopy to avoid
20182 confusion. Reverse FROM and TO arguments to be consistent with
20183 those of memcpy.
20184
201851994-11-10 David J. MacKenzie <djm@gnu.org>
20186
20187 * NEWS: reformat
20188
20189 * NEWS: New file.
20190
20191 * Makefile.in (DISTFILES): Include NEWS.
20192
20193 * Makefile.in (DISTFILES):
20194 Include install-sh, not install.sh.
20195
20196 * configure.in: Update to Autoconf v2 macro names.
20197
201981994-10-05 David J. MacKenzie <djm@gnu.org>
20199
20200 * Makefile.in: fix typo
20201
20202 * Makefile.in (prefix, exec_prefix):
20203 Let configure set them.
20204
202051994-09-28 David J. MacKenzie <djm@gnu.org>
20206
20207 * Makefile.in: Set datadir to $(prefix)/share.
20208
202091994-09-15 Richard Stallman <rms@gnu.org>
20210
20211 * src/bison.s1:
20212 Update copyright notice and GPL version.
20213
202141994-09-15 Richard Stallman <rms@gnu.org>
20215
20216 * bison.simple:
20217 Update copyright notice and GPL version.
20218
202191994-07-12 Richard Stallman <rms@gnu.org>
20220
20221 * src/reduce.c, src/reader.c:
20222 entered into RCS
20223
202241994-05-05 David J. MacKenzie <djm@gnu.org>
20225
20226 * Makefile.in: entered into RCS
20227
202281994-03-26 Richard Stallman <rms@gnu.org>
20229
20230 * src/bison.s1: entered into RCS
20231
202321994-03-26 Richard Stallman <rms@gnu.org>
20233
20234 * bison.simple: entered into RCS
20235
202361994-03-25 Richard Stallman <rms@gnu.org>
20237
20238 * src/main.c: entered into RCS
20239
202401994-03-24 Richard Stallman <rms@gnu.org>
20241
20242 * src/conflicts.c: entered into RCS
20243
202441994-01-02 Richard Stallman <rms@gnu.org>
20245
20246 * Makefile.in: *** empty log message ***
20247
202481993-11-21 Richard Stallman <rms@gnu.org>
20249
20250 * src/bison.s1: *** empty log message ***
20251
202521993-11-21 Richard Stallman <rms@gnu.org>
20253
20254 * doc/bison.texinfo: entered into RCS
20255
20256 * doc/bison.texinfo: *** empty log message ***
20257
202581993-11-21 Richard Stallman <rms@gnu.org>
20259
20260 * bison.simple: *** empty log message ***
20261
202621993-10-25 David J. MacKenzie <djm@gnu.org>
20263
20264 * doc/bison.texinfo: *** empty log message ***
20265
202661993-10-19 Richard Stallman <rms@gnu.org>
20267
20268 * src/bison.s1: *** empty log message ***
20269
202701993-10-19 Richard Stallman <rms@gnu.org>
20271
20272 * bison.simple: *** empty log message ***
20273
202741993-10-14 Richard Stallman <rms@gnu.org>
20275
20276 * src/bison.s1: *** empty log message ***
20277
202781993-10-14 Richard Stallman <rms@gnu.org>
20279
20280 * bison.simple: *** empty log message ***
20281
202821993-09-14 David J. MacKenzie <djm@gnu.org>
20283
20284 * doc/bison.texinfo: *** empty log message ***
20285
202861993-09-13 Noah Friedman <friedman@gnu.org>
20287
20288 * Makefile.in: *** empty log message ***
20289
202901993-09-10 Richard Stallman <rms@gnu.org>
20291
20292 * src/conflicts.c: *** empty log message ***
20293
20294 * src/system.h: entered into RCS
20295
202961993-09-10 Richard Stallman <rms@gnu.org>
20297
20298 * doc/bison.1: entered into RCS
20299
203001993-09-06 Noah Friedman <friedman@gnu.org>
20301
20302 * src/version.c: entered into RCS
20303
203041993-09-06 Noah Friedman <friedman@gnu.org>
20305
20306 * Makefile.in: *** empty log message ***
20307
203081993-07-30 David J. MacKenzie <djm@gnu.org>
20309
20310 * Makefile.in: *** empty log message ***
20311
203121993-07-24 Richard Stallman <rms@gnu.org>
20313
20314 * src/bison.s1: *** empty log message ***
20315
203161993-07-24 Richard Stallman <rms@gnu.org>
20317
20318 * bison.simple: *** empty log message ***
20319
203201993-07-08 David J. MacKenzie <djm@gnu.org>
20321
20322 * Makefile.in: *** empty log message ***
20323
203241993-07-04 Richard Stallman <rms@gnu.org>
20325
20326 * src/bison.s1: *** empty log message ***
20327
203281993-07-04 Richard Stallman <rms@gnu.org>
20329
20330 * bison.simple: *** empty log message ***
20331
203321993-06-26 David J. MacKenzie <djm@gnu.org>
20333
20334 * src/getargs.c: entered into RCS
20335
203361993-06-26 David J. MacKenzie <djm@gnu.org>
20337
20338 * doc/bison.texinfo: *** empty log message ***
20339
20340 * doc/bison.1: New file.
20341
203421993-06-25 Richard Stallman <rms@gnu.org>
20343
20344 * src/getargs.c: New file.
20345
203461993-06-16 Richard Stallman <rms@gnu.org>
20347
20348 * src/bison.s1: *** empty log message ***
20349
203501993-06-16 Richard Stallman <rms@gnu.org>
20351
20352 * bison.simple: *** empty log message ***
20353
203541993-06-03 Richard Stallman <rms@gnu.org>
20355
20356 * src/bison.s1: New file.
20357
203581993-06-03 Richard Stallman <rms@gnu.org>
20359
20360 * doc/bison.texinfo: *** empty log message ***
20361
203621993-06-03 Richard Stallman <rms@gnu.org>
20363
20364 * bison.simple: New file.
20365
203661993-05-19 Richard Stallman <rms@gnu.org>
20367
20368 * doc/bison.texinfo: New file.
20369
203701993-05-07 Noah Friedman <friedman@gnu.org>
20371
20372 * Makefile.in: *** empty log message ***
20373
203741993-04-28 Noah Friedman <friedman@gnu.org>
20375
20376 * src/reader.c: *** empty log message ***
20377
203781993-04-23 Noah Friedman <friedman@gnu.org>
20379
20380 * src/alloc.h: entered into RCS
20381
203821993-04-20 David J. MacKenzie <djm@gnu.org>
20383
20384 * src/version.c: *** empty log message ***
20385
20386 * src/files.c, src/allocate.c:
20387 entered into RCS
20388
20389 * src/reader.c: *** empty log message ***
20390
20391 * src/lex.c: entered into RCS
20392
20393 * src/conflicts.c: New file.
20394
20395 * src/symtab.c: entered into RCS
20396
20397 * src/alloc.h: New file.
20398
20399 * src/LR0.c: entered into RCS
20400
204011993-04-18 Noah Friedman <friedman@gnu.org>
20402
20403 * src/reader.c: New file.
20404
20405 * src/version.c: *** empty log message ***
20406
204071993-04-18 Noah Friedman <friedman@gnu.org>
20408
20409 * Makefile.in: *** empty log message ***
20410
204111993-04-17 Noah Friedman <friedman@gnu.org>
20412
20413 * Makefile.in: *** empty log message ***
20414
204151993-04-15 Richard Stallman <rms@gnu.org>
20416
20417 * src/main.c, src/files.c:
20418 New file.
20419
204201993-04-15 Noah Friedman <friedman@gnu.org>
20421
20422 * configure.in: entered into RCS
20423
20424 * configure.in: *** empty log message ***
20425
20426 * configure.in: New file.
20427
204281993-04-14 Richard Stallman <rms@gnu.org>
20429
20430 * Makefile.in: New file.
20431
204321993-04-13 Richard Stallman <rms@gnu.org>
20433
20434 * src/version.c: New file.
20435
204361993-03-25 Richard Stallman <rms@gnu.org>
20437
20438 * src/output.c: entered into RCS
20439
204401992-09-25 Richard Stallman <rms@gnu.org>
20441
20442 * configure.bat: entered into RCS
20443
204441992-06-22 Richard Stallman <rms@gnu.org>
20445
20446 * src/vmsgetargs.c: entered into RCS
20447
204481992-06-22 Richard Stallman <rms@gnu.org>
20449
20450 * doc/bison.rnh: entered into RCS
20451
204521992-04-20 David J. MacKenzie <djm@gnu.org>
20453
20454 * README: entered into RCS
20455
204561992-01-22 Richard Stallman <rms@gnu.org>
20457
20458 * src/machine.h: entered into RCS
20459
204601991-12-21 Richard Stallman <rms@gnu.org>
20461
20462 * src/lalr.c, src/closure.c:
20463 entered into RCS
20464
204651991-12-20 Richard Stallman <rms@gnu.org>
20466
20467 * src/state.h: entered into RCS
20468
204691991-12-18 Richard Stallman <rms@gnu.org>
20470
20471 * src/print.c, src/nullable.c, src/derives.c:
20472 entered into RCS
20473
204741991-11-03 David J. MacKenzie <djm@gnu.org>
20475
20476 * src/warshall.c, src/types.h, src/symtab.h, src/lex.h, src/gram.c, src/gram.h, src/files.h:
20477 entered into RCS
20478
204791988-09-09 Richard Stallman <rms@gnu.org>
20480
20481 * src/bison.hairy: entered into RCS
20482
204831987-12-16 Richard Stallman <rms@gnu.org>
20484
20485 * REFERENCES: entered into RCS
dc546b0f 20486
f294a2c2 20487
04098407 20488 -----
f294a2c2 20489
04098407 20490 Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996,
95021767
JD
20491 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
20492 Free Software Foundation, Inc.
f294a2c2 20493
04098407
PE
20494 Copying and distribution of this file, with or without
20495 modification, are permitted provided the copyright notice and this
20496 notice are preserved.
e9071366
AD
20497
20498$Id$